1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,501960,e=>{"use strict";var t=e.i(79455);let n=new Map;function a(e){if(n.has(e))return n.get(e);let a=(0,t.randomBytesHex)();return n.set(e,a),a}e.s(["getFunctionId",()=>a])},622687,e=>{"use strict";function t(e){if(e.uri.startsWith("ar://")){let t=e.uri.replace("ar://","");if(e.gatewayUrl){let n=e.gatewayUrl.endsWith("/")?"":"/";return`${e.gatewayUrl}${n}${t}`}return"https://arweave.net/{fileId}".replace("{fileId}",t)}if(e.uri.startsWith("http"))return e.uri;throw Error('Invalid URI scheme, expected "ar://" or "http(s)://"')}e.s(["resolveArweaveScheme",()=>t])},729629,e=>{"use strict";e.s(["default",0,{agreement:{and:"&",prefix:"By connecting, you agree to the",privacyPolicy:"Privacy Policy",termsOfService:"Terms of Service"},backupWallet:"Backup Wallet",buy:"Buy",confirmInWallet:"Confirm in wallet",connectAWallet:"Connect a Wallet",connectedToSmartWallet:"Smart Account",connecting:"Connecting",continueAsGuest:"Continue as guest",copyAddress:"Copy Address",currentNetwork:"Current network",defaultButtonTitle:"Connect",defaultModalTitle:"Sign in",disconnectWallet:"Disconnect Wallet",getStarted:"Get started",goBackButton:"Back",guest:"Guest",guestWalletWarning:"This is a temporary guest wallet. Backup wallet if you don't want to lose access to it",id:"en_US",installed:"Installed",manageWallet:{connectAnApp:"Connect an App",exportPrivateKey:"Export Private Key",linkedProfiles:"Linked Profiles",linkProfile:"Link a Profile",title:"Manage Wallet"},networkSelector:{addCustomNetwork:"Add Custom Network",allNetworks:"All",categoryLabel:{others:"All Networks",popular:"Popular",recentlyUsed:"Recently Used"},failedToSwitch:"Failed to switch network",inputPlaceholder:"Search Network or Chain ID",loading:"Loading",mainnets:"Mainnets",testnets:"Testnets",title:"Select Network"},newToWallets:"New to wallets?",or:"OR",passkeys:{linkPasskey:"Link a Passkey",title:"Passkeys"},payTransactions:"Fiat Transactions",personalWallet:"Personal Wallet",receive:"Receive",receiveFundsScreen:{instruction:"Copy the address to send funds to this wallet",title:"Receive Funds"},recommended:"Recommended",requestTestnetFunds:"Request Testnet Funds",send:"Send",sendFundsScreen:{amount:"Amount",insufficientFunds:"Insufficient Funds",invalidAddress:"Invalid Address",noTokensFound:"No Tokens Found",searchToken:"Search or Paste token address",selectTokenTitle:"Select a Token",sending:"Sending",sendTo:"Send to",submitButton:"Send",successMessage:"Transaction Successful",title:"Send Funds",token:"Token",transactionFailed:"Transaction Failed",transactionRejected:"Transaction Rejected"},signatureScreen:{instructionScreen:{disconnectWallet:"Disconnect Wallet",instruction:"Please sign the message request in your wallet to continue",signInButton:"Sign in",title:"Sign in"},signingScreen:{approveTransactionInSafe:"Approve transaction in Safe",failedToSignIn:"Failed to Sign in",inProgress:"Awaiting Confirmation",prompt:"Signing the signature request in your wallet",promptForSafe:"Sign signature request in your wallet & approve transaction in Safe",title:"Signing In",tryAgain:"Try Again"}},signIn:"Sign in",smartWallet:"Smart Wallet",switchAccount:"Switch Account",switchingNetwork:"Switching Network",switchNetwork:"Switch Network",switchTo:"Switch to",transactions:"Transactions",viewAllTransactions:"View All Transactions",viewFunds:{title:"View Funds",viewAssets:"View Assets",viewNFTs:"View NFTs",viewTokens:"View Tokens"},walletTransactions:"Wallet Transactions",welcomeScreen:{defaultSubtitle:"Connect a wallet to get started",defaultTitle:"Your gateway to the decentralized world"}}])},539844,e=>{"use strict";var t=e.i(249311),n=e.i(687322),a=e.i(414019),i=e.i(56990);let r="0xbd85b039",s=[{name:"id",type:"uint256"}],o=[{type:"uint256"}];function l(e){return(0,i.detectMethod)({availableSelectors:e,method:[r,s,o]})}function c(e){return(0,a.encodeAbiParameters)(s,[e.id])}function u(e){return r+c(e).slice(2)}function d(e){return(0,t.decodeAbiParameters)(o,e)[0]}async function p(e){return(0,n.readContract)({contract:e.contract,method:[r,s,o],params:[e.id]})}e.s(["FN_SELECTOR",0,r,"decodeTotalSupplyResult",()=>d,"encodeTotalSupply",()=>u,"encodeTotalSupplyParams",()=>c,"isTotalSupplySupported",()=>l,"totalSupply",()=>p])},827337,622480,e=>{"use strict";var t=e.i(705593),n=e.i(901147),a=e.i(746164),i=e.i(539844);e.i(249311);var r=e.i(687322);e.i(414019);var s=e.i(56990);let o="0x0e89341c",l=[{name:"tokenId",type:"uint256"}
1],c=[{type:"string"}];function u(e){return(0,s.detectMethod)({availableSelectors:e,method:[o,l,c]})}async function d(e){return(0,r.readContract)({contract:e.contract,method:[o,l,c],params:[e.tokenId]})}async function p(e){let{useIndexer:t=!0}=e;if(t)try{return await m(e)}catch{}return await y(e)}async function m(e){let n=await (0,t.getNFT)({chain:e.contract.chain,client:e.contract.client,contractAddress:e.contract.address,tokenId:e.tokenId});return n||y(e)}async function y(e){let[t,r]=await Promise.all([d({contract:e.contract,tokenId:e.tokenId}),(0,i.totalSupply)({contract:e.contract,id:e.tokenId}).catch(()=>0n)]);return(0,a.parseNFT)(await (0,n.fetchTokenMetadata)({client:e.contract.client,tokenId:e.tokenId,tokenUri:t}).then(n=>n||{id:e.tokenId,type:"ERC1155",uri:t}).catch(()=>({id:e.tokenId,type:"ERC1155",uri:t})),{chainId:e.contract.chain.id,owner:null,supply:r,tokenAddress:e.contract.address,tokenId:e.tokenId,tokenUri:t,type:"ERC1155"})}e.s(["isUriSupported",()=>u,"uri",()=>d],622480),e.s(["getNFT",()=>p],827337)},300544,e=>{"use strict";var t=e.i(843476),n=e.i(184447),a=e.i(313145),i=e.i(399651),r=e.i(758864),s=e.i(107133),o=e.i(799890),l=e.i(139194),c=e.i(832505),u=e.i(271645),d=e.i(178938),p=e.i(451500),m=e.i(985896),y=e.i(565561),g=e.i(29538),h=e.i(446501),f=e.i(410696),w=e.i(309127),T=e.i(400870),b=e.i(392179),v=e.i(581670);function S(e){let n=(0,w.useWalletInfo)(e.wallet.id);return(0,t.jsx)(y.ModalHeader,{leftAligned:!0,onBack:e.onBack,title:n.isLoading?(0,t.jsx)(v.Skeleton,{height:"24px",width:"200px"}):(0,t.jsxs)(t.Fragment,{children:[n.data?.image_id?(0,t.jsx)(T.Img,{client:e.client,height:f.iconSize.md,src:n.data?.image_id,style:{borderRadius:f.radius.sm},width:f.iconSize.md}):null,(0,t.jsx)(b.ModalTitle,{children:n.data?.name})]})})}function C(e){let n="compact"===e.size,{initialScreen:a,screen:i}=(0,d.useScreenContext)(),[r,s]=(0,u.useState)(!1),o=i===e.wallet&&a===e.wallet?void 0:e.goBack;return(0,t.jsxs)(y.Container,{animate:"fadein",flex:"column",fullHeight:!0,p:"lg",style:{minHeight:"250px"},children:[e.isLinking?(0,t.jsx)(y.ModalHeader,{onBack:o,title:e.connectLocale.manageWallet.linkProfile}):(0,t.jsx)(S,{client:e.client,onBack:n?o:void 0,wallet:e.wallet}),(0,t.jsx)(g.Spacer,{y:"lg"}),(0,t.jsx)(y.Container,{center:"y",expand:!0,flex:"column",p:n?void 0:"lg",children:(0,t.jsx)(h.ConnectWalletSocialOptions,{disabled:e.meta.requireApproval&&!r,...e})}),n&&(!1!==e.meta.showThirdwebBranding||e.meta.termsOfServiceUrl||e.meta.privacyPolicyUrl)&&(0,t.jsx)(g.Spacer,{y:"xl"}),(0,t.jsxs)(y.Container,{flex:"column",gap:"lg",children:[(0,t.jsx)(p.TOS,{isApproved:r,locale:e.connectLocale.agreement,onApprove:()=>{s(!r)},privacyPolicyUrl:e.meta.privacyPolicyUrl,requireApproval:e.meta.requireApproval,termsOfServiceUrl:e.meta.termsOfServiceUrl}),!1!==e.meta.showThirdwebBranding&&(0,t.jsx)(m.PoweredByThirdweb,{})]})]})}e.s(["default",0,function(e){let u=(0,n.useSelectionData)(),d=(0,n.useSetSelectionData)(),p=e.connectLocale.id,m=(0,a.useInAppWalletLocale)(p);if(!m)return(0,t.jsx)(s.LoadingScreen,{});let y=()=>{"compact"===e.size&&e.goBack?.(),d({})},g=()=>{e.done(),d({})},h=u?.emailLogin?{email:u.emailLogin}:u?.phoneLogin?{phone:u.phoneLogin}:void 0;return h?(0,t.jsx)(o.OTPLoginUI,{chain:e.chain,client:e.client,done:g,goBack:y,isLinking:e.isLinking,locale:m,size:e.size,userInfo:h,wallet:e.wallet}):u?.passkeyLogin?(0,t.jsx)(l.PassKeyLogin,{chain:e.chain,client:e.client,done:g,isLinking:e.isLinking,locale:e.connectLocale,onBack:y,size:e.size,wallet:e.wallet}):u?.socialLogin?(0,t.jsx)(c.SocialLogin,{chain:e.chain,client:e.client,connectLocale:e.connectLocale,done:g,goBack:y,isLinking:e.isLinking,locale:m,size:e.size,socialAuth:u.socialLogin.type,state:u,wallet:e.wallet}):u?.walletLogin?(0,t.jsx)(i.WalletAuth,{chain:e.chain,client:e.client,done:g,inAppLocale:m,isLinking:u.walletLogin.linking,locale:e.connectLocale,meta:e.meta,onBack:y||(()=>d({})),size:e.size,wallet:e.wallet,walletConnect:e.walletConnect}):u?.guestLogin?(0,t.jsx)(r.GuestLogin,{client:e.client,connectLocale:e.connectLocale,done:g,goBack:y,locale:m,size:e.size,state:u,wallet:e.wallet}):(0,t.jsx)(C,{chain:e.chain,client:e.client,connectLocale:e.connectLocale,done:g,goBack:e.goBack,isLinking:e.isLinking,locale:m,meta:e.meta,select:()=>{},size:e.size,wallet:e.wallet})}],300544)},149544,e=>{"use strict";function t(e){return new Promise(t=>setTimeout(t,e))}e.s(["sleep",()=>t])},839080,856324,e=>{"use strict";var t=e.i(450323),n=e.i(445024);function a(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}e.s(["formatLog",()=>
1a],856324);var i=e.i(982191);let r={"0x0":"reverted","0x1":"success"};function s(e,n){let s={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(e=>a(e)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?(0,t.hexToNumber)(e.transactionIndex):null,status:e.status?r[e.status]:null,type:e.type?i.transactionType[e.type]||e.type:null};return e.blobGasPrice&&(s.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(s.blobGasUsed=BigInt(e.blobGasUsed)),s}let o=(0,n.defineFormatter)("transactionReceipt",s);e.s(["defineTransactionReceipt",0,o,"formatTransactionReceipt",()=>s,"receiptStatuses",0,r],839080)},169744,e=>{"use strict";var t=e.i(839080);async function n(e,n){let a=await e({method:"eth_getTransactionReceipt",params:[n.hash]});if(!a)throw Error("Transaction receipt not found.");return(0,t.formatTransactionReceipt)(a)}e.s(["eth_getTransactionReceipt",()=>n])},596860,e=>{"use strict";var t=e.i(803702);async function n(e){let n=await e({method:"eth_blockNumber"});return(0,t.hexToBigInt)(n)}e.s(["eth_blockNumber",()=>n])},906603,811558,e=>{"use strict";var t=e.i(169744),n=e.i(738290),a=e.i(149544),i=e.i(596860);let r=new Map;function s(e){let{client:t,chain:s,onNewBlockNumber:o,overPollRatio:l,latestBlockNumber:c,onError:u}=e,d=s.id,p=r.get(d);return p||(p=function(e,t,r,s){let o,l,c=[],u=[],d=!1,p=(0,n.getRpcClient)({chain:t,client:e});async function m(){if(!d)return;try{let e=await (0,i.eth_blockNumber)(p);if(!o||e>o){let t=[];if(o)for(let n=o+1n;n<=e;n++)t.push(BigInt(n));else t=[e];o=e;let n=Date.now();if(l){let e=(n-l)/t.length;u.push(e),u=u.slice(-10)}for(let e of(l=n,t))for(let t of c)t(e)}}catch(e){s?s(e):console.error(`[watchBlockNumber]: Failed to poll for latest block number: ${e}`)}let e=Math.max(500,Math.min(5e3,Math.max(500,function(e){for(;e.length<10;)e.unshift(1e3);return e.reduce((e,t)=>e+t,0)/e.length}(u))));await (0,a.sleep)(e/(r??2)),m()}return function(e,t){return c.push(e),d||(o=t,d=!0,m()),function(){0===(c=c.filter(t=>t!==e)).length&&(o=void 0,l=void 0,d=!1)}}}(t,s,l,u),r.set(d,p)),p(o,c)}e.s(["watchBlockNumber",()=>s],811558);let o=new Map;function l(e){let{transactionHash:a,chain:i,client:r}=e,l=i.id,c=`${l}:tx_${a}`,u=e.maxBlocksWaitTime??100;if(o.has(c))return o.get(c);let d=new Promise((e,o)=>{a||o(Error("Transaction has no transactionHash to wait for, did you execute it?"));let l=(0,n.getRpcClient)({chain:i,client:r}),c=-1,d=s({chain:i,client:r,onNewBlockNumber:async()=>{if(++c>=u){d(),o(Error(`Transaction receipt for ${a} not found after ${u} blocks`));return}try{let n=await (0,t.eth_getTransactionReceipt)(l,{hash:a});d(),e(n)}catch{}}})}).finally(()=>{o.delete(c)});return o.set(c,d),d}e.s(["waitForReceipt",()=>l],906603)},891539,e=>{"use strict";var t=e.i(898442);e.s(["Buy",0,t])},870508,e=>{"use strict";var t=e.i(984874);e.s(["Sell",0,t])},31512,e=>{"use strict";var t=e.i(797358);e.s(["Transfer",0,t])},638601,e=>{"use strict";async function t(t){let[{getV1Tokens:a},{getThirdwebDomains:i},{getClientFetch:r},{assertInsightEnabled:s},{stringify:o}]=await Promise.all([e.A(125163),e.A(3418),e.A(329767),e.A(122988),e.A(257143)]),{client:l,chains:c,ownerAddress:u,tokenAddresses:d,queryOptions:p}=t;await s(c);let m={chain_id:c.length>0?c.map(e=>e.id):[1],include_native:"true",include_spam:"false",limit:50,metadata:"true",owner_address:[u],token_address:d||void 0,sort_by:"balance",sort_order:"desc"},y=await a({baseUrl:`https://${i().insight}`,fetch:r(l),query:{...m,...p}});if(y.error)throw Error(`${y.response.status} ${y.response.statusText} - ${y.error?o(y.error):"Unknown error"}`);return n(y.data?.data??[])}async function n(t){let{toTokens:n}=await e.A(272445);return t.map(e=>{let t=e.decimals??18,a=BigInt(e.balance);return{chainId:e.chain_id,decimals:t,displayValue:n(a,t),name:e.name??"",symbol
1:e.symbol??"",tokenAddress:e.token_address,value:a}})}e.s(["getOwnedTokens",()=>t])},185477,e=>{"use strict";e.i(249311);var t=e.i(687322),n=e.i(56990);let a="0x313ce567",i=[],r=[{type:"uint8"}];function s(e){return(0,n.detectMethod)({availableSelectors:e,method:[a,i,r]})}async function o(e){return(0,t.readContract)({contract:e.contract,method:[a,i,r],params:[]})}e.s(["decimals",()=>o,"isDecimalsSupported",()=>s])},113615,e=>{"use strict";var t=e.i(766644),n=e.i(185477);async function a(e){return(0,t.withCache)(()=>(0,n.decimals)(e),{cacheKey:`${e.contract.chain.id}:${e.contract.address}:decimals`,cacheTime:1/0})}e.s(["decimals",()=>a])},309685,e=>{"use strict";var t=e.i(772935);class n extends Error{constructor(e){super(e.message),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"correlationId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"statusCode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e.code,this.correlationId=e.correlationId,this.statusCode=e.statusCode}toString(){return(0,t.stringify)({code:this.code,correlationId:this.correlationId,message:this.message,statusCode:this.statusCode})}}e.s(["ApiError",()=>n])},882223,e=>{"use strict";var t=e.i(576656),n=e.i(234667),a=e.i(309685);async function i(e){let{client:i,chainId:r,tokenAddress:s,symbol:o,name:l,limit:c,offset:u,includePrices:d,sortBy:p,query:m}=e,y=(0,n.getClientFetch)(i),g=new URL(`${(0,t.getThirdwebBaseUrl)("bridge")}/v1/tokens`);null!=r&&g.searchParams.set("chainId",r.toString()),s&&g.searchParams.set("tokenAddress",s),o&&g.searchParams.set("symbol",o),l&&g.searchParams.set("name",l),void 0!==c&&g.searchParams.set("limit",c.toString()),null!=u&&g.searchParams.set("offset",u.toString()),void 0!==d&&g.searchParams.set("includePrices",d.toString()),void 0!==p&&g.searchParams.set("sortBy",p),void 0!==m&&g.searchParams.set("query",m);let h=await y(g.toString());if(!h.ok){let e=await h.json();throw new a.ApiError({code:e.code||"UNKNOWN_ERROR",correlationId:e.correlationId||void 0,message:e.message||h.statusText,statusCode:h.status})}let{data:f}=await h.json();return f}async function r(e){let{client:i,chainId:r,tokenAddress:s}=e,o=(0,n.getClientFetch)(i),l=`${(0,t.getThirdwebBaseUrl)("bridge")}/v1/tokens`,c=await o(l,{body:JSON.stringify({chainId:r,tokenAddress:s}),headers:{"Content-Type":"application/json"},method:"POST"});if(!c.ok){let e=await c.json();throw new a.ApiError({code:e.code||"UNKNOWN_ERROR",correlationId:e.correlationId||void 0,message:e.message||c.statusText,statusCode:c.status})}let{data:u}=await c.json();return u}e.s(["add",()=>r,"tokens",()=>i])},528578,e=>{"use strict";var t=e.i(576656),n=e.i(234667),a=e.i(766644),i=e.i(309685);async function r(e){let{client:r}=e;return(0,a.withCache)(async()=>{let e=(0,n.getClientFetch)(r),a=new URL(`${(0,t.getThirdwebBaseUrl)("bridge")}/v1/chains`),s=await e(a.toString());if(!s.ok){let e=await s.json();throw new i.ApiError({code:e.code||"UNKNOWN_ERROR",correlationId:e.correlationId||void 0,message:e.message||s.statusText,statusCode:s.status})}let{data:o}=await s.json();return o},{cacheKey:"bridge-chains",cacheTime:36e5})}e.s(["chains",()=>r])},548641,e=>{"use strict";var t=e.i(315428),n=e.i(576656),a=e.i(234667),i=e.i(772935),r=e.i(309685);async function s(e){let{client:s,onramp:o,chainId:l,tokenAddress:c,receiver:u,amount:d,purchaseData:p,sender:m,onrampTokenAddress:y,onrampChainId:g,currency:h,maxSteps:f,excludeChainIds:w,paymentLinkId:T,country:b}=e,v=(0,a.getClientFetch)(s),S=`${(0,n.getThirdwebBaseUrl)("bridge")}/v1/onramp/prepare`,C={chainId:Number(l),onramp:o,receiver:u,tokenAddress:c};void 0!==d&&(C.amount=d.toString()),void 0!==p&&(C.purchaseData=p),void 0!==m&&(C.sender=m),void 0!==y&&(C.onrampTokenAddress=y),void 0!==g&&(C.onrampChainId=Number(g)),void 0!==h&&(C.currency=h),void 0!==f&&(C.maxSteps=f),void 0!==w&&(C.excludeChainIds=Array.isArray(w)?w.join(","):w),void 0!==T&&(C.paymentLinkId=T),void 0!==b&&(C.country=b);let I=await v(S,{body:(0,i.stringify)(C),headers:{"Content-Type":"application/json"},method:"POST"});if(!I.ok){let e=await I.json();throw new r.ApiError({code:e.code||"UNKNOWN_ERROR",correlationId:e.correlationId||void 0,message:e.message||I.statusText,statusCode:I.status})}let{data:A}=await I.json(),k=A.steps.map(e=>({...e,destinationAmount:BigInt(e.destinationAmount),originAmount:BigInt(e.originAmount),transactions:e.transactions.map(e=>({...e,chain:(0,t.defineChain)(e.chainId),client:s,value:e.value?BigInt(e.value):void 0}))})),x={...A.intent,amount:A.intent.amount?A.intent.amount:void 0};return{...A,destinationAmount:BigInt(A.destinationAmount),intent:x,steps:k}}e.s(["prepare",()=>s])},898442,e=>{"use strict";var t=e.i(315428),n=e.i(576656),a=e.i(234667),i=e.i(772935),r=e.i(309685);async function s(e){let{originChainId:t,originTokenAddress:i,destinationChainId:s,destinationTokenAddress:o,client:l,maxSteps:c}=e,u="buyAmountWei"in e?e.buyAmountWei:e.amount,d=(0,a.getClientFetch)(l),p=new URL(`${(0,n.getThirdwebBaseUrl)("bridge")}/v1/buy/quote`);p.searchParams.set("originChainId",t.toString()),p.searchParams.set("originTokenAddress",i),p.searchParams.set("destinationChainId",s.toString()),p.searchParams.set("destinationTokenAddress",o),p.searchParams.set("buyAmountWei",u.toString()),p.searchParams.set("amount",u.toString()),c&&p.searchParams.set("maxSteps",c.toString());let m=await d(p.toString());if(!m.ok){let e=await m.json();throw new r.ApiError({code:e.code||"UNKNOWN_ERROR",correlationId:e.correlationId||void 0,message:e.message||m.statusText,statusCode:m.status})}let{data:y}=await m.json();return{blockNumber:y.blockNumber?BigInt(y.blockNumber):void 0,destinationAmount:BigInt(y.destinationAmount),estimatedExecutionTimeMs:y.estimatedExecutionTimeMs,intent:{amount:u,buyAmountWei:u,destinationChainId:s,destinationTokenAddress:o,originChainId:t,originTokenAddress:i},originAmount:BigInt(y.originAmount),steps:y.steps,timestamp:y.timestamp}}async function o(e){let{originChainId:s,originTokenAddress:o,destinationChainId:l,destinationTokenAddress:c,sender:u,receiver:d,client:p,amount:m,purchaseData:y,maxSteps:g,paymentLinkId:h,slippageToleranceBps:f}=e,w=(0,a.getClientFetch)(p),T=new URL(`${(0,n.getThirdwebBaseUrl)("bridge")}/v1/buy/prepare`),b=await w(T.toString(),{body:(0,i.stringify)({amount:m.toString(),buyAmountWei:m.toString(),destinationChainId:l.toString(),destinationTokenAddress:c,maxSteps:g,originChainId:s.toString(),originTokenAddress:o,paymentLinkId:h,purchaseData:y,receiver:d,sender:u,slippageToleranceBps:f}),headers:{"Content-Type":"application/json"},method:"POST"});if(!b.ok){let e=await b.json();throw new r.ApiError({code:e.code||"UNKNOWN_ERROR",correlationId:e.correlationId||void 0,message:e.message||b.statusText,statusCode:b.status})}let{data:v}=await b.json();return{blockNumber:v.blockNumber?BigInt(v.blockNumber):void 0,destinationAmount:BigInt(v.destinationAmount),estimatedExecutionTimeMs:v.estimatedExecutionTimeMs,intent:{amount:m,destinationChainId:l,destinationTokenAddress:c,originChainId:s,originTokenAddress:o,receiver:d,sender:u},originAmount:BigInt(v.originAmount),steps:v.steps.map(e=>({...e,transactions:e.transactions.map(e=>({...e,chain:(0,t.defineChain)(e.chainId),client:p,value:e.value?BigInt(e.value):void 0}))})),timestamp:v.timestamp}}e.s(["prepare",()=>o,"quote",()=>s])},984874,e=>{"use strict";var t=e.i(315428),n=e.i(576656),a=e.i(234667),i=e.i(772935),r=e.i(309685);async function s(e){let{originChainId:t,originTokenAddress:i,destinationChainId:s,destinationTokenAddress:o,amount:l,client:c,maxSteps:u}=e,d=(0,a.getClientFetch)(c),p=new URL(`${(0,n.getThirdwebBaseUrl)("bridge")}/v1/sell/quote`);p.searchParams.set("originChainId",t.toString()),p.searchParams.set("originTokenAddress",i),p.searchParams.set("destinationChainId",s.toString()),p.searchParams.set("destinationTokenAddress",o),p.searchParams.set("sellAmountWei",l.toString()),p.searchParams.set("amount",l.toString()),void 0!==u&&p.searchParams.set("maxSteps",u.toString());let m=await d(p.toString());if(!m.ok){let e=await m.json();throw new r.ApiError({code:e.code||"UNKNOWN_ERROR",correlationId:e.correlationId||void 0,message:e.message||m.statusText,statusCode:m.status})}let{data:y}=await m.json();return{blockNumber:y.blockNumber?BigInt(y.blockNumber):void 0,destinationAmount:BigInt(y.destinationAmount),estimatedExecutionTimeMs:y.estimatedExecutionTimeMs,intent:{amount:l,destinationChainId:s,destinationTokenAddress:o,originChainId:t,originTokenAddress:i},originAmount:BigInt(y.originAmount),steps:y.steps,timestamp:y.timestamp}}async function o(e){let{originChainId:s,originTokenAddress:o,destinationChainId:l,destinationTokenAddress:c,amount:u,sender:d,receiver:p,client:m,purchaseData:y,maxSteps:g,paymentLinkId:h,slippageToleranceBps:f}=e,w=(0,a.getClientFetch)(m),T=new URL(`${(0,n.getThirdwebBaseUrl)("bridge")}/v1/sell/prepare`),b=await w(T.toString(),{body:(0,i.stringify)({amount:u.toString(),destinationChainId:l.toString(),destinationTokenAddress:c,maxSteps:g,originChainId:s.toString(),originTokenAddress:o,paymentLinkId:h,purchaseData:y,receiver:p,sellAmountWei:u.toString(),sender:d,slippageToleranceBps:f}),headers:{"Content-Type":"application/json"},method:"POST"});if(!b.ok){let e=await b.json();throw new r.ApiError({code:e.code||"UNKNOWN_ERROR",correlationId:e.correlationId||void 0,message:e.message||b.statusText,statusCode:b.status})}let{data:v}=await b.json();return{blockNumber:v.blockNumber?BigInt(v.blockNumber):void 0,destinationAmount:BigInt(v.destinationAmount),estimatedExecutionTimeMs:v.estimatedExecutionTimeMs,expiration:v.expiration,intent:{amount:u,destinationChainId:l,destinationTokenAddress:c,originChainId:s,originTokenAddress:o,purchaseData:y,receiver:p,sender:d},originAmount:BigInt(v.originAmount),steps:v.steps.map(e=>({...e,transactions:e.transactions.map(e=>({...e,chain:(0,t.defineChain)(e.chainId),client:m,value:e.value?BigInt(e.value):void 0}))})),timestamp:v.timestamp}}e.s(["prepare",()=>o,"quote",()=>s])},797358,e=>{"use strict";var t=e.i(315428),n=e.i(576656),a=e.i(234667),i=e.i(772935),r=e.i(309685);async function s(e){let{chainId:s,tokenAddress:o,sender:l,receiver:c,client:u,amount:d,purchaseData:p,feePayer:m,paymentLinkId:y}=e,g=(0,a.getClientFetch)(u),h=new URL(`${(0,n.getThirdwebBaseUrl)("bridge")}/v1/transfer/prepare`),f=await g(h.toString(),{body:(0,i.stringify)({amount:d.toString(),chainId:s.toString(),feePayer:m,paymentLinkId:y,purchaseData:p,receiver:c,sender:l,tokenAddress:o,transferAmountWei:d.toString()}),headers:{"Content-Type":"application/json"},method:"POST"});if(!f.ok){let e=await f.json();throw new r.ApiError({code:e.code||"UNKNOWN_ERROR",correlationId:e.correlationId||void 0,message:e.message||f.statusText,statusCode:f.
1status})}let{data:w}=await f.json();return{blockNumber:w.blockNumber?BigInt(w.blockNumber):void 0,destinationAmount:BigInt(w.destinationAmount),estimatedExecutionTimeMs:w.estimatedExecutionTimeMs,intent:{amount:d,chainId:s,feePayer:m,receiver:c,sender:l,tokenAddress:o},originAmount:BigInt(w.originAmount),steps:w.steps.map(e=>({...e,transactions:e.transactions.map(e=>({...e,chain:(0,t.defineChain)(e.chainId),client:u,value:e.value?BigInt(e.value):void 0}))})),timestamp:w.timestamp}}e.s(["prepare",()=>s])},547365,e=>{"use strict";var t=e.i(548641),n=e.i(576656),a=e.i(234667),i=e.i(309685);async function r(e){let{id:t,client:r}=e,s=(0,a.getClientFetch)(r),o=new URL(`${(0,n.getThirdwebBaseUrl)("bridge")}/v1/onramp/status`);o.searchParams.set("id",t);let l=await s(o.toString());if(!l.ok){let e=await l.json();throw new i.ApiError({code:e.code||"UNKNOWN_ERROR",correlationId:e.correlationId||void 0,message:e.message||l.statusText,statusCode:l.status})}let{data:c}=await l.json();return c}e.s(["prepare",()=>t.prepare,"status",()=>r],547365)},290571,e=>{"use strict";var t=function(){return(t=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function n(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,a=Object.getOwnPropertySymbols(e);i<a.length;i++)0>t.indexOf(a[i])&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(n[a[i]]=e[a[i]]);return n}function a(e,t,n,a){return new(n||(n=Promise))(function(i,r){function s(e){try{l(a.next(e))}catch(e){r(e)}}function o(e){try{l(a.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,o)}l((a=a.apply(e,t||[])).next())})}function i(e,t){var n,a,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(l){var c=[o,l];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,a&&(i=2&c[0]?a.return:c[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,c[1])).done)return i;switch(a=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,a=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(!(i=(i=r.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){r=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(6===c[0]&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(e){c=[6,e],a=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function r(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],a=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t,n){if(n||2==arguments.length)for(var a,i=0,r=t.length;i<r;i++)!a&&i in t||(a||(a=Array.prototype.slice.call(t,0,i)),a[i]=t[i]);return e.concat(a||Array.prototype.slice.call(t))}function o(e,t,n,a){if("a"===n&&!a)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?a:"a"===n?a.call(e):a?a.value:t.get(e)}function l(e,t,n,a,i){if("m"===a)throw TypeError("Private method is not writable");if("a"===a&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?i.call(e,n):i?i.value=n:t.set(e,n),n}
1"function"==typeof SuppressedError&&SuppressedError,e.s(["__assign",()=>t,"__awaiter",()=>a,"__classPrivateFieldGet",()=>o,"__classPrivateFieldSet",()=>l,"__generator",()=>i,"__rest",()=>n,"__spreadArray",()=>s,"__values",()=>r])},563406,e=>{"use strict";var t=e.i(315428);function n(e,t,a=!0){a&&e();let i=t.map(t=>t.subscribe(()=>{e()}));return()=>{for(let e of i)e()}}var a=e.i(107470),i=e.i(772935),r=e.i(458708),s=e.i(313230),o=e.i(251903);let l="thirdweb:connected-wallet-ids",c="thirdweb:active-wallet-id",u="thirdweb:active-chain";function d(e){let o=(0,a.createStore)(void 0),d=(0,a.createStore)(void 0),p=(0,a.createStore)(void 0),y=(0,a.createStore)("unknown"),h=(0,a.createStore)(new Map);n(()=>{(0,t.cacheChains)([...h.getValue().values()])},[h]),n(()=>{let e=p.getValue();if(!e)return;let t=h.getValue().get(e.id);t&&t!==e&&p.setValue(t)},[h,p]);let f=(0,a.createStore)(new Map),w=(0,a.createStore)(!1),T=function(e,t){let n=new Set,a=e(),i=e=>{for(let t of(a=e,n))t()};for(let n of t)n.subscribe(()=>{i(e())});return{getValue:()=>a,subscribe:e=>(n.add(e),()=>{n.delete(e)})}}(()=>Array.from(f.getValue().values()),[f]),b=e=>{let t=f.getValue();if(t.has(e.id))return;let n=new Map(t);n.set(e.id,e),f.setValue(n)},v=e=>{let t=new Map(f.getValue());t.delete(e.id),f.setValue(t)},S=t=>{(0,r.deleteConnectParamsFromStorage)(e,t.id),v(t),o.getValue()===t&&(e.removeItem(c),d.setValue(void 0),p.setValue(void 0),o.setValue(void 0),y.setValue("disconnected"))},C=async(t,n)=>{if(!t.getAccount())throw Error("Cannot set a wallet without an account as active");let a=await (async()=>n?.accountAbstraction&&!(0,s.isSmartWallet)(t)?await g(t,n.client,n.accountAbstraction,S):t)();return await e.setItem(c,t.id),b(t),n?.setWalletAsActive!==!1&&A(a),t.subscribe("accountChanged",async()=>{let e=await C(t,n);n?.onConnect?.(e,T.getValue())}),a},I=async(e,t)=>{let n=await C(e,t);return t?.onConnect?.(n,T.getValue()),n},A=e=>{let t=e.getAccount();if(!t)throw Error("Cannot set a wallet without an account as active");b(e),o.setValue(e),d.setValue(t),p.setValue(e.getChain()),y.setValue("connected");let n=e.subscribe("accountChanged",e=>{d.setValue(e)}),a=e.subscribe("chainChanged",e=>p.setValue(e)),i=e.subscribe("disconnect",()=>{r()}),r=()=>{S(e),n(),a(),i()}},k=async t=>{A(t),"smart"!==t.id&&await e.setItem(c,t.id)};n(()=>{let t=p.getValue();t?e.setItem(u,(0,i.stringify)(t)):e.removeItem(u)},[p],!1),n(async()=>{let t=T.getValue().map(e=>e?.id).filter(e=>!!e);e.setItem(l,(0,i.stringify)(Array.from(new Set([...t]))))},[T],!1);let x=async t=>{let n=o.getValue();if(!n)throw Error("No active wallet found");if(!n.switchChain)throw Error("Wallet does not support switching chains");if((0,s.isSmartWallet)(n)){let a=await m(e);if(a){let e=T.getValue().find(e=>e.id===a);if(e){await e.switchChain(t),await n.switchChain(t),A(n);return}}await n.switchChain(t),A(n)}else await n.switchChain(t);p.setValue(n.getChain())};return{activeAccountStore:d,activeWalletChainStore:p,activeWalletConnectionStatusStore:y,activeWalletStore:o,addConnectedWallet:b,connect:I,connectedWallets:T,defineChains:function(e){let t=h.getValue();if(e.every(e=>{let n=t.get(e.id);return(0,i.stringify)(n)===(0,i.stringify)(e)}))return;let n=new Map(t);for(let t of e)n.set(t.id,t);h.setValue(n)},disconnectWallet:e=>{S(e),e.disconnect()},handleConnection:C,isAutoConnecting:w,removeConnectedWallet:v,setActiveWallet:k,switchActiveWalletChain:x}}async function p(e){try{let t=await e.getItem(l);if(t)return JSON.parse(t);return[]}catch{return[]}}async function m(e){try{let t=await e.getItem(c);if(t)return t}catch{}return null}async function y(e){try{let t=await e.getItem(u);if(t)return JSON.parse(t)}catch{}return null}let g=async(e,t,n,a)=>{let i=e.getAccount();if(!i)throw Error("Cannot set a wallet without an account as active");let r=(0,o.smartWallet)(n);await r.connect({chain:n.chain,client:t,personalAccount:i});let s=e.subscribe("disconnect",()=>{l()}),l=()=>{s(),a(r)};return r};e.s(["createConnectionManager",()=>d,"getLastConnectedChain",()=>y,"getStoredActiveWalletId",()=>m,"getStoredConnectedWalletIds",()=>p],563406)},679104,e=>{"use strict";let t;var n=e.i(477830),a=e.i(393460),i=e.i(313230),r=e.i(44154),s=e.i(563406);let o=async e=>{if(t&&!e.force&&await t)return!0;let n=l(e);return t=n,n},l=async({storage:e,props:t,createWalletFn:o,manager:l,connectOverride:u,setLastAuthProvider:d})=>{var p,m,y;let g,h,{wallets:f,onConnect:w}=t,T=t.timeout??15e3,b=!1;l.isAutoConnecting.setValue(!0);let[v,S]=await Promise.all([(0,s.getStoredConnectedWalletIds)(e),(0,s.getStoredActiveWalletId)(e)]),
1C=function(){if("undefined"==typeof document)return;let e=new URLSearchParams(window.location.search),t=e.get("authResult"),n=e.get("walletId"),a=e.get("authProvider"),i=e.get("authCookie");if((i||t)&&n){let r=(()=>{if(t)return e.delete("authResult"),JSON.parse(decodeURIComponent(t))})();return e.delete("walletId"),e.delete("authProvider"),e.delete("authCookie"),window.history.pushState({},"",`${window.location.pathname}?${e.toString()}`),{authCookie:i,authProvider:a,authResult:r,walletId:n}}}(),I=f.find(e=>e.id===C?.walletId);if(C?.authCookie&&I){let i=new a.ClientScopedStorage({clientId:t.client.clientId,ecosystem:(0,n.isEcosystemWallet)(I)?{id:I.id,partnerId:I.getConfig()?.partnerId}:void 0,storage:e});await i.saveAuthCookie(C.authCookie)}if(C?.walletId&&(S=C.walletId,v=v?.includes(C.walletId)?v:[C.walletId,...v||[]]),C?.authProvider&&await d?.(C.authProvider,e),!v)return b;let A=await (0,s.getLastConnectedChain)(e)||t.chain,k=v.map(e=>{let t=f.find(t=>t.id===e);return t||o(e)}),x=S&&(k.find(e=>e.id===S)||o(S));if(x){l.activeWalletConnectionStatusStore.setValue("connecting"),await (p=c({authResult:C?.authResult,client:t.client,lastConnectedChain:A,wallet:x}),m={message:`AutoConnect timeout: ${T}ms limit exceeded.`,ms:T},new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(m.message))},m.ms);p.then(t=>{clearTimeout(n),e(t)},e=>{clearTimeout(n),t(e)})})).catch(e=>{console.warn(e.message),t.onTimeout&&t.onTimeout()});try{await (u?u(x):l.connect(x,{accountAbstraction:t.accountAbstraction,client:t.client}))}catch(e){e instanceof Error&&console.warn("Error auto connecting wallet:",e.message),l.activeWalletConnectionStatusStore.setValue("disconnected")}}else l.activeWalletConnectionStatusStore.setValue("disconnected");let L=k.filter(e=>e.id!==S&&v.includes(e.id));for(let e of L)try{await c({authResult:C?.authResult,client:t.client,lastConnectedChain:A,wallet:e}),l.addConnectedWallet(e)}catch{}x&&(y={connectedWallets:x?[x,...L]:L,wallet:x},g=e=>(0,r.isInAppWallet)(e)||(0,n.isEcosystemWallet)(e),h=(0,i.isSmartWallet)(y.wallet)&&y.connectedWallets.some(e=>g(e)&&e.getAccount()?.address?.toLowerCase()===y.wallet.getAdminAccount?.()?.address?.toLowerCase()),g(y.wallet)||h)&&t.siweAuth?.requiresAuth&&!t.siweAuth?.isLoggedIn&&!t.siweAuth?.isLoggingIn&&await t.siweAuth?.doLogin().catch(e=>{console.warn("Error signing in with SIWE:",e.message)}),l.isAutoConnecting.setValue(!1);let P=l.activeWalletStore.getValue(),E=l.connectedWallets.getValue();if(P){b=!0;try{w?.(P,E)}catch(e){console.error("Error calling onConnect callback:",e)}}else l.activeWalletConnectionStatusStore.setValue("disconnected");return b};async function c(e){return e.wallet.autoConnect({authResult:e.authResult,chain:e.lastConnectedChain,client:e.client})}e.s(["autoConnectCore",0,o],679104)},44154,e=>{"use strict";var t=e.i(389692),n=e.i(335851),a=e.i(315428),i=e.i(323868),r=e.i(612838),s=e.i(308716);e.i(414019),e.i(56990);var o=e.i(558101);let l=[{type:"tuple[]",name:"calls",components:[{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}]}],c=[];var u=e.i(738290),d=e.i(568744),p=e.i(406356),m=e.i(234667),y=e.i(772935),g=e.i(766644),h=e.i(79455),f=e.i(464949),w=e.i(641153);async function T(e){let{client:t,chain:n,bundlerUrl:a}=e,i=a??(0,w.getDefaultBundlerUrl)(n),r=`delegation-contract:${i}`;return(0,g.withCache)(async()=>{let e=(0,m.getClientFetch)(t),n=await e(i,{useAuthToken:!0,body:(0,y.stringify)({id:1,jsonrpc:"2.0",method:"tw_getDelegationContract",params:[]}),headers:{"Content-Type":"application/json"},method:"POST"});if(!n.ok)throw Error(`Failed to fetch delegation contract: ${n.status} ${n.statusText}`);let a=await n.json();if(a.error)throw Error(`Delegation contract RPC error: ${JSON.stringify(a.error)}`);if(!a.result?.delegationContract)throw Error("Invalid response: missing delegationContract in result");return a.result.delegationContract},{cacheKey:r,cacheTime:864e5})}async function b(t){let{client:n,address:a,chain:i}=t,r=(0,u.getRpcClient)({chain:i,client:n});return await e.A(612417).then(({eth_getTransactionCount:e})=>e(r,{address:(0,p.getAddress)(a),blockTag:"pending"}))}async function v(e,t){let n=await (0,i.getBytecode)(e),a=n.length>0&&n.startsWith("0xef0100"),r=`0x${n.slice(8,48)}`;return a&&r.toLowerCase()===t.toLowerCase()}async function S(e){let t=e.timeoutMs||3e5,n=e.intervalMs||1e3,a=Date.now()+t;for(;Date.now()<a;){let t=await (0,f.getQueuedTransactionHash)({options:e.options,transactionId:e.transactionId});if(t.transactionHash)return t.transactionHash;await new Promise(e=>setTimeout(e,n))}throw Error(`Timeout waiting for transaction to be mined on chain ${e.options.chain.id} with transactionId: ${e.transactionId}`)}let C=[{type:"receive",stateMutability:"payable"},{type:"function",name:"createSessionWithSig",inputs:[{name:"sessionS
1pec",type:"tuple",internalType:"struct SessionLib.SessionSpec",components:[{name:"signer",type:"address",internalType:"address"},{name:"isWildcard",type:"bool",internalType:"bool"},{name:"expiresAt",type:"uint256",internalType:"uint256"},{name:"callPolicies",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]},{name:"transferPolicies",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"execute",inputs:[{name:"calls",type:"tuple[]",internalType:"struct Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}]}],outputs:[],stateMutability:"payable"},{type:"function",name:"executeWithSig",inputs:[{name:"wrappedCalls",type:"tuple",internalType:"struct WrappedCalls",components:[{name:"calls",type:"tuple[]",internalType:"struct Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"getCallPoliciesForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]}],stateMutability:"view"}
1,{type:"function",name:"getSessionExpirationForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getSessionStateForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple",internalType:"struct SessionLib.SessionState",components:[{name:"transferValue",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]},{name:"callValue",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]},{name:"callParams",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]}]}],stateMutability:"view"},{type:"function",name:"getTransferPoliciesForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}],stateMutability:"view"},{type:"function",name:"isWildcardSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"onERC1155BatchReceived",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"onERC1155Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"onERC721Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"supportsInterface",inputs:[{name:"interfaceId",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"event",name:"Executed",inputs:[{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"},{name:"data",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"SessionCreated",inputs:[{name:"signer",type:"address",indexed:!0,internalType:"address"},{name:"sessionSpec",type:"tuple",indexed:!1,internalType:"struct SessionLib.SessionSpec",components:[{name:"signer",type:"address",internalType:"address"},{name:"isWildcard",type:"bool",internalType:"bool"},{name:"expiresAt",type:"uint256",internalType:"uint256"},{name:"callPolicies",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]},{name:"transferPolicies",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]}],anonymous:!1},{type:"event",name:"ValueReceived",inputs:[{name:"from",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"AllowanceExceeded",inputs:[{name:"allowanceUsage",type:"uint256",internalType:"uint256"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint64",internalType:"uint64"}]},{type:"error",name:"CallPolicyViolated",inputs:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"}]},{type:"error",name:"CallReverted",inputs:[]},{type:"error",name:"ConditionFailed",inputs:[{name:"param",type:"bytes32",internalType:"bytes32"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"condition",type:"uint8",internalType:"uint8"}]},{type:"error",name:"InvalidDataLength",inputs:[{name:"actualLength",type:"uint256",internalType:"uint256"},{name:"expectedLength",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidSignature",inputs:[{name:"msgSender",type:"address",internalType:"address"},{name:"thisAddress",type:"address",internalType:"address"}]},{type:"error",name:"LifetimeUsageExceeded",inputs:[{name:"lifetimeUsage",type:"uint256",internalType:"uint256"},{name:"limit",type:"uint256",internalType:"uint256"}]}
1,{type:"error",name:"MaxValueExceeded",inputs:[{name:"value",type:"uint256",internalType:"uint256"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NoCallsToExecute",inputs:[]},{type:"error",name:"SessionExpired",inputs:[]},{type:"error",name:"SessionExpiresTooSoon",inputs:[]},{type:"error",name:"SessionZeroSigner",inputs:[]},{type:"error",name:"TransferPolicyViolated",inputs:[{name:"target",type:"address",internalType:"address"}]},{type:"error",name:"UIDAlreadyProcessed",inputs:[]}];function I(e){return"inApp"===e.id||"embedded"===e.id}async function A(e,t,a){if(t?.auth?.mode!=="popup"&&t?.auth?.mode!==void 0&&a.authenticateWithRedirect){let i=e.strategy;n.socialAuthOptions.includes(i)&&await a.authenticateWithRedirect(i,t?.auth?.mode,t?.auth?.redirectUrl)}return P({authAccount:(await a.connect(e)).user.account,client:e.client,createOptions:t,desiredChain:e.chain})}async function k(e,t,n){e.authResult&&n.loginWithAuthToken&&await n.loginWithAuthToken(e.authResult);let a=await L(n);if(!a)throw Error("Failed to authenticate user.");return P({authAccount:a.account,client:e.client,createOptions:t,desiredChain:e.chain})}async function x(t){let{connectSmartAccount:n}=await e.A(523208);return n({chain:t.chain,client:t.client,personalAccount:t.authAccount},t.smartAccountOptions)}async function L(e){let t=await e.getUser();if("Logged In, Wallet Initialized"===t.status)return t}async function P(n){let i,u,{createOptions:m,authAccount:y,desiredChain:g,client:w}=n,I=m&&"executionMode"in m?m.executionMode:void 0;if(I&&("EIP4337"===I.mode?i=I.smartAccount:"EIP7702"===I.mode&&(u=I)),m&&"smartAccount"in m&&m?.smartAccount&&(i=m.smartAccount),i){let[e,t]=await x({authAccount:y,chain:g,client:w,smartAccountOptions:i});return{account:e,adminAccount:y,chain:t}}if(u){if(!g)throw Error("Chain is required for EIP-7702 execution, pass a chain when connecting the inAppWallet.");return{account:(t=>{let{client:n,adminAccount:i,sponsorGas:u}=t,m=async e=>{var t;let m,y=e[0];if(!y)throw Error("No transactions provided");let g=(0,a.getCachedChain)(y.chainId),w=(0,r.getContract)({address:i.address,chain:g,client:n,abi:C}),I=y.authorizationList?.[0],A=await T({client:n,chain:g});if(I&&I.address?.toLowerCase()!==A.toLowerCase())throw Error(`Authorization address does not match expected delegation contract address. Expected ${A} but got ${I.address}`);if(!I&&!await v(w,A)){let e=y.nonce?BigInt(y.nonce):BigInt(await b({client:n,address:i.address,chain:g}));e+=u?0n:1n;let t=await i.signAuthorization?.({address:(0,p.getAddress)(A),chainId:y.chainId,nonce:e});if(!t)throw Error("Failed to sign authorization");I=t}if(u){let t={calls:e.map(e=>({data:e.data??"0x",target:(0,p.getAddress)(e.to??""),value:e.value??0n})),uid:(0,h.randomBytesHex)()},r=await i.signTypedData({domain:{chainId:y.chainId,name:"MinimalAccount",verifyingContract:w.address,version:"1"},message:t,primaryType:"WrappedCalls",types:{Call:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}],WrappedCalls:[{name:"calls",type:"Call[]"},{name:"uid",type:"bytes32"}]}}),s=await (0,f.executeWithSignature)({authorization:I,eoaAddress:(0,p.getAddress)(i.address),options:{chain:(0,a.getCachedChain)(y.chainId),client:n},signature:r,wrappedCalls:t});return{transactionHash:await S({options:{chain:(0,a.getCachedChain)(y.chainId),client:n},transactionId:s.transactionId})}}let k=(t={calls:e.map(e=>({data:e.data??"0x",target:(0,p.getAddress)(e.to??""),value:e.value??0n})),contract:w,overrides:{authorizationList:I?[I]:void 0,value:e.reduce((e,t)=>e+(t.value??0n),0n)}},m=(0,o.once)(async()=>"asyncParams"in t?await t.asyncParams():t),(0,s.prepareContractCall)({contract:t.contract,method:["0x3f707e6b",l,c],params:async()=>[(await m()).calls],value:async()=>(await m()).overrides?.value,accessList:async()=>(await m()).overrides?.accessList,gas:async()=>(await m()).overrides?.gas,gasPrice:async()=>(await m()).overrides?.gasPrice,maxFeePerGas:async()=>(await m()).overrides?.maxFeePerGas,maxPriorityFeePerGas:async()=>(await m()).overrides?.maxPriorityFeePerGas,nonce:async()=>(await m()).overrides?.nonce,extraGas:async()=>(await m()).overrides?.extraGas,erc20Value:async()=>(await m()).overrides?.erc20Value,authorizationList:async()=>(await m()).overrides?.authorizationList})),x=await (0,d.toSerializableTransaction)({from:i.address,transaction:k});return i.sendTransaction(x)},y={address:i.address,sendBatchTransaction:async e=>m(e),sendTransaction:async e=>m([e]),signMessage:({message:e,originalMessage:t,chainId:n})=>i.signMessage({chainId:n,message:e,originalMessage:t}),signTypedData:e=>i.signTypedData(e),sendCalls:async t=>{let{inAppWalletSendCalls:n}=await e.A(88719),a=t.calls[0];if(!a)throw Error("No calls to send");let i=a.client,r=a.chain||t.chain,s=await n({account:y,calls:t.calls,chain:r});return{chain:r,client:i,id:s}},getCallsStatus:async t=>{let{inAppWalletGetCallsStatus:n}=await e.A(88719);return n(t)},getCapabilities:async e=>({[e.chainId??1]:{atomic:{status:"supported"},paymasterService:{supported:u??!1}}})};return y})({adminAccount:y,client:w,sponsorGas:u.sponsorGas}),adminAccount:y,chain:g}}return{account:y,chain:g||t.ethereum}}e.s(["autoConnectInAppWallet",()=>k,"connectInAppWallet",()=>A,"isInAppWallet",()=>I],44154)},458708,e=>{"use strict";var t=e.i(772935);let n="tw:connected-wallet-params";async function a(e,a,i){let r;
1if(!function(e){try{return(0,t.stringify)(e),!0}catch{return!1}}(i))throw Error("given params are not stringifiable");let s=await e.getItem(n);if(s){try{r=JSON.parse(s)}catch{r={}}r[a]=i}else r={[a]:i};e.setItem(n,(0,t.stringify)(r))}async function i(e,a){let i,r=await e.getItem(n);if(r){try{i=JSON.parse(r)}catch{i={}}delete i[a],e.setItem(n,(0,t.stringify)(i))}}async function r(e,t){let a=await e.getItem(n);if(!a)return null;try{let e=JSON.parse(a);if(e?.[t])return e[t];return null}catch{return null}}e.s(["deleteConnectParamsFromStorage",()=>i,"getSavedConnectParamsFromStorage",()=>r,"saveConnectParamsToStorage",()=>a])},313230,e=>{"use strict";var t=e.i(477830);function n(e){if(!e)return!1;if("smart"===e.id)return!0;if("inApp"===e.id||(0,t.isEcosystemWallet)(e)){let t=e.getConfig();if(t&&"smartAccount"in t&&t.smartAccount)return!0;if(t?.executionMode){let e=t.executionMode;return"EIP4337"===e.mode||"EIP7702"===e.mode}}return!1}function a(e){if(!e)return!1;let n=!1;if(e&&"smart"===e.id){let t=e.getConfig();"sponsorGas"in t&&(n=t.sponsorGas),"gasless"in t&&(n=t.gasless)}if(e&&("inApp"===e.id||(0,t.isEcosystemWallet)(e))){let t=e.getConfig();if(t&&"smartAccount"in t&&t.smartAccount){let e=t.smartAccount;"sponsorGas"in e&&(n=e.sponsorGas),"gasless"in e&&(n=e.gasless)}if(t?.executionMode){let e=t.executionMode;if("EIP4337"===e.mode){let t=e.smartAccount;t&&"sponsorGas"in t&&(n=t.sponsorGas),t&&"gasless"in t&&(n=t.gasless)}"EIP7702"===e.mode&&(n=e.sponsorGas||!1)}}return n}e.s(["hasSponsoredTransactionsEnabled",()=>a,"isSmartWallet",()=>n])}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.