(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{89783:function(e,t,n){Promise.resolve().then(n.bind(n,68320)),Promise.resolve().then(n.bind(n,82333)),Promise.resolve().then(n.t.bind(n,9276,23)),Promise.resolve().then(n.t.bind(n,33449,23))},68320:function(e,t,n){"use strict";n.d(t,{DashboardSection:function(){return ta}});var a,i,s,r,l=n(51627),d=n(47638),o=n(13789);let u=e=>{let{children:t,className:n,border:a=!0}=e;return(0,l.jsx)("div",{className:"bg-white rounded-xl flex-col flex ".concat(n," ").concat(a&&"border border-gray-200"),children:t})},p=[{day:"Monday",hours:"9:00 AM - 5:00 PM"},{day:"Tuesday",hours:"9:00 AM - 5:00 PM"},{day:"Wednesday",hours:"9:00 AM - 5:00 PM"},{day:"Thursday",hours:"9:00 AM - 5:00 PM"},{day:"Friday",hours:"9:00 AM - 5:00 PM"},{day:"Saturday",hours:"Closed"},{day:"Sunday",hours:"Closed"}];var c=n(75419),m=n.n(c),y=n(61226),x=n.n(y),f=n(63580),h=n.n(f);m().extend(x()),m().extend(h());let b=e=>{let{onClose:t}=e,n=m()().tz("America/New_York").format("dddd h:mm A");return(0,l.jsx)("div",{className:"absolute top-0 left-0 z-10 w-full h-full",children:(0,l.jsxs)(u,{className:"flex flex-col w-full h-full gap-6 p-6",border:!1,children:[(0,l.jsxs)("div",{className:"flex flex-col w-full h-full gap-6",children:[(0,l.jsx)("div",{className:"text-2xl font-bold text-trust",children:"Invest in USYC"}),(0,l.jsx)("div",{className:"text-base font-bold text-trust",children:"USYC Trading Hours"}),(0,l.jsx)("div",{children:p.map((e,t)=>(0,l.jsxs)("div",{className:"flex flex-row text-sm text-gray-800",children:[(0,l.jsx)("div",{className:"font-bold w-28",children:e.day}),(0,l.jsx)("div",{className:"font-medium",children:e.hours})]},t))}),(0,l.jsxs)("div",{className:"text-sm font-medium text-gray-800",children:["It is currently ",n,"."]}),(0,l.jsxs)("div",{className:"text-sm font-medium text-gray-800",children:[(0,l.jsxs)("p",{children:["Trading is closed on all"," ",(0,l.jsx)("a",{className:"underline",href:"https://www.opm.gov/policy-data-oversight/pay-leave/federal-holidays/",target:"_blank",children:"US Federal Holidays"}),"."]}),(0,l.jsx)("p",{children:" All hours are listed in Eastern Time (ET)."})]})]}),(0,l.jsx)("div",{className:"font-sans text-xs font-medium text-gray-600 underline hover:cursor-pointer",onClick:()=>t(),children:"Close Information"})]})})};var v=n(42887);let g="0xDoesNotExist",w={"0x1":["PYUSD","USDC"],"0x5":["PYUSD","USDC"],"0xAA36A7":["PYUSD","USDC"],base_sepolia:["USDC","HNUSD"],base_mainnet:["USDC","HNUSD"]},j={HNUSD:{"0x1":g,"0x5":g,"0xAA36A7":g,base_sepolia:"0x3B7256048f64a26DC96A935aC0E833e37462200a",base_mainnet:g},PYUSD:{"0x5":g,"0x1":"0x0a5ea26fdd38cf2acb06dc64198374c337879dab","0xAA36A7":"0x8C5d21F2DA253a117E8B89108be8FE781583C1dF",base_sepolia:g,base_mainnet:g},USDC:{"0x5":"0xE182E029462c848cfa0AdD4ceC2563306FA3a787","0x1":"0x5C73E1cfdD85b7f1d608F7F7736fC8C653513B7A","0xAA36A7":"0xbb0524426bc1d13dAB721DB69D86374FC6BaCDba",base_sepolia:"0xB564cE0A049977473865B8C2B16537D7b4aebe47",base_mainnet:"0xAE133456840000C7ebe16b943054Cb303A162438"}},T={"0x1":"0x136471a34f6ef19fE571EFFC1CA711fdb8E49f2b","0x5":"0xb265020C1E8841b0e16e2f8E8d21D2B45ab2df42",7700:"0xFb8255f0De21AcEBf490F1DF6F0BDd48CC1df03B",7701:"0xd3D41C08a7e14129bF6Ec9A32697322C70af7E5a","0xAA36A7":"0x38D3A3f8717F4DB1CcB4Ad7D8C755919440848A3",base_sepolia:"0x024E76D7efD2160cd9f1966B49D640f6F6fAA499",base_mainnet:"0xeeE7aF832440884d2b693B4193FA2ec26A48C7d3"},N={"0x1":"0x6c3ea9036406852006290770bedfcaba0e23a0e8","0x5":g,"0xAA36A7":"0xCaC524BcA292aaade2DF8A05cC58F0a65B1B3bB9"},C={base_sepolia:"0x87967CeB1750972Db9f41696C9274b28A3D5c88C",base_mainnet:"0xED8Be5F4DE1C45B7402e07C61C03828Ed21346c3"},A={"0xAA36A7":"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238","0x5":"0x07865c6E87B9F70255377e024ace6630C1Eaa37F","0x1":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",base_sepolia:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",base_mainnet:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},S={"0x1":"0x4c48bcb2160F8e0aDbf9D4F3B034f1e36d1f8b3e","0x5":"0x06BE409e34fC73BF23f2276D191Cc80e479334a2",7700:"0x1d18c02bC80b1921255E71cF2939C03258d75470",7701:"0x35b96d80C72f873bACc44A1fACfb1f5fac064f1a","0xAA36A7":"0x35b96d80C72f873bACc44A1fACfb1f5fac064f1a",base_mainnet:g,base_sepolia:g};(a=s||(s={}))[a.AddCollateral=0]="AddCollateral",a[a.RemoveCollateral=1]="RemoveCollateral",a[a.MintShort=2]="MintShort",a[a.BurnShort=3]="BurnShort",a[a.MergeOptionToken=4]="MergeOptionToken",a[a.SplitOptionToken=5]="SplitOptionToken",a[a.AddLong=6]="AddLong",a[a.RemoveLong=7]="RemoveLong",a[a.SettleAccount=8]="SettleAccount",a[a.MintShortIntoAccount=9]="MintShortIntoAccount",a[a.TransferCollateral=10]="TransferCollateral",a[a.TransferLong=11]="TransferLong",a[a.TransferShort=12]="TransferShort",a[a.BurnShortInAccount=13]="BurnShortInAccount",(i=r||(r={}))[i.AddCollateral=0]="AddCollateral",i[i.RemoveCollateral=1]="RemoveCollateral",i[i.MintShort=2]="MintShort",i[i.BurnShort=3]="BurnShort",i[i.AddLong=4]="AddLong",i[i.RemoveLong=5]="RemoveLong",i[i.ExerciseToken=6]="ExerciseToken",i[i.SettleAccount=7]="SettleAccount",i[i.MintShortIntoAccount=8]="MintShortIntoAccount",i[i.TransferCollateral=9]="TransferCollateral",i[i.TransferLong=10]="TransferLong",i[i.TransferShort=11]="TransferShort",i[i.BurnShortInAccount=12]="BurnShortInAccount";var M=n(3919),_=n(69433);let k=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>(0,M.do)({...t,onSuccess:e=>{var n;console.debug("contract read success",{functionName:null==t?void 0:t.functionName,data:e}),null==t||null===(n=t.onSuccess)||void 0===n||n.call(t,e)},onError:n=>{var a,i;(null===(a=e.shouldSwallowError)||void 0===a?void 0:a.call(e,n))||(console.error("contract read error",{functionName:null==t?void 0:t.functionName,error:n,opts:e}),_.Tb(n),null==t||null===(i=t.onError)||void 0===i||i.call(t,n))}})},D=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}],E=[{inputs:[{internalType:"address",name:"_ytoken",type:"address"},{internalType:"uint8",name:"_decimals",type:"uint8"},{internalType:"string",name:"_description",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadAmount",type:"error"},{inputs:[],name:"Overflow",type:"error"},{inputs:[],name:"RoundDataReported",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint80",name:"roundId",type:"uint80"},{indexed:!1,internalType:"uint256",name:"balance",type:"uint256"},{indexed:!1,internalType:"uint256",name:"interest",type:"uint256"},{indexed:!1,internalType:"uint256",name:"price",type:"uint256"},{indexed:!1,internalType:"uint256",name:"updatedAt",type:"uint256"}],name:"BalanceReported",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",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"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"description",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint80",name:"_roundId",type:"uint80"}],name:"getRoundData",outputs:[{internalType:"uint80",name:"roundId",type:"uint80"},{internalType:"int256",name:"answer",type:"int256"},{internalType:"uint256",name:"startedAt",type:"uint256"},{internalType:"uint256",name:"updatedAt",type:"uint256"},{internalType:"uint80",name:"answeredInRound",type:"uint80"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint80",name:"_roundId",type:"uint80"}],name:"getRoundDetails",outputs:[{internalType:"uint80",name:"roundId",type:"uint80"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"interest",type:"uint256"},{internalType:"uint256",name:"totalSupply",type:"uint256"},{internalType:"uint256",name:"updatedAt",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_owner",type:"address"},{internalType:"string",name:"_description",type:"string"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"latestRoundData",outputs:[{internalType:"uint80",name:"roundId",type:"uint80"},{internalType:"int256",name:"answer",type:"int256"},{internalType:"uint256",name:"startedAt",type:"uint256"},{internalType:"uint256",name:"updatedAt",type:"uint256"},{internalType:"uint80",name:"answeredInRound",type:"uint80"}],stateMutability:"view",type:"function"},{inputs:[],name:"latestRoundDetails",outputs:[{internalType:"uint80",name:"roundId",type:"uint80"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"interest",type:"uint256"},{internalType:"uint256",name:"totalSupply",type:"uint256"},{internalType:"uint256",name:"updatedAt",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"nextPrice",outputs:[{internalType:"int256",name:"",type:"int256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"proxiableUUID",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_principal",type:"uint256"},{internalType:"uint256",name:"_interest",type:"uint256"},{internalType:"uint256",name:"_totalSupply",type:"uint256"},{internalType:"int256",name:"_nextPrice",type:"int256"}],name:"reportBalance",outputs:[{internalType:"uint80",name:"roundId",type:"uint80"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_description",type:"string"}],name:"setDescription",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"}],name:"upgradeTo",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"upgradeToAndCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"ytoken",outputs:[{internalType:"contract IYieldToken",name:"",type:"address"}],stateMutability:"view",type:"function"}],I=[{inputs:[{internalType:"address",name:"_ytoken",type:"address"},{internalType:"address",name:"_oracle",type:"address"},{internalType:"address",name:"_dst",type:"address"},{internalType:"address",name:"_authority",type:"address"},{internalType:"address",name:"_feeRecipient",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadAddress",type:"error"},{inputs:[],name:"BadAmount",type:"error"},{inputs:[],name:"BadFee",type:"error"},{inputs:[],name:"BadPrice",type:"error"},{inputs:[],name:"BadTime",type:"error"},{inputs:[],name:"NotPermissioned",type:"error"},{inputs:[],name:"YearNotFound",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"afterHourTrading",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newAfterHourTrading",type:"uint256"}],name:"AfterHourTradingSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"recipient",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"paid",type:"uint256"},{indexed:!1,internalType:"uint256",name:"price",type:"uint256"},{indexed:!1,internalType:"uint256",name:"fee",type:"uint256"}],name:"Bought",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldDedicated",type:"address"},{indexed:!1,internalType:"address",name:"newDedicated",type:"address"}],name:"DedicatedSet",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"buyFee",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newBuyFee",type:"uint256"},{indexed:!1,internalType:"uint256",name:"sellFee",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newSellFee",type:"uint256"}],name:"FeesSet",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",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"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"recipient",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"received",type:"uint256"},{indexed:!1,internalType:"uint256",name:"price",type:"uint256"},{indexed:!1,internalType:"uint256",name:"fee",type:"uint256"}],name:"Sold",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"recipient",type:"address"},{indexed:!0,internalType:"address",name:"token",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Transferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[],name:"afterHourTrading",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"authority",outputs:[{internalType:"contract IAuthority",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"buy",outputs:[{internalType:"uint256",name:"amount",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"buyFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"},{internalType:"address",name:"_recipient",type:"address"}],name:"buyFor",outputs:[{internalType:"uint256",name:"amount",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"buyPreview",outputs:[{internalType:"uint256",name:"payout",type:"uint256"},{internalType:"uint256",name:"fee",type:"uint256"},{internalType:"int256",name:"price",type:"int256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_from",type:"address"},{internalType:"uint256",name:"_amount",type:"uint256"},{internalType:"address",name:"_recipient",type:"address"},{internalType:"uint256",name:"_deadline",type:"uint256"},{internalType:"uint8",name:"_v",type:"uint8"},{internalType:"bytes32",name:"_r",type:"bytes32"},{internalType:"bytes32",name:"_s",type:"bytes32"}],name:"buyWithPermit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"dedicated",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"dst",outputs:[{internalType:"contract DaylightSavingsCalendar",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"feeRecipient",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_owner",type:"address"},{internalType:"address",name:"_stable",type:"address"},{internalType:"uint256",name:"_afterHourTrading",type:"uint256"},{internalType:"uint256",name:"_buyFee",type:"uint256"},{internalType:"uint256",name:"_sellFee",type:"uint256"},{internalType:"address",name:"_dedicated",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"isDST",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"oracle",outputs:[{internalType:"contract IYieldTokenOracle",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"proxiableUUID",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"sell",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"sellFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"},{internalType:"address",name:"_recipient",type:"address"}],name:"sellFor",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"sellPreview",outputs:[{internalType:"uint256",name:"payout",type:"uint256"},{internalType:"uint256",name:"fee",type:"uint256"},{internalType:"int256",name:"price",type:"int256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_hourMinute",type:"uint256"}],name:"setAfterHourTrading",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_dedicated",type:"address"}],name:"setDedicated",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_buy",type:"uint256"},{internalType:"uint256",name:"_sell",type:"uint256"}],name:"setFees",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"stable",outputs:[{internalType:"contract IERC20Metadata",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_token",type:"address"},{internalType:"uint256",name:"_amount",type:"uint256"},{internalType:"address",name:"_recipient",type:"address"}],name:"transfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"}],name:"upgradeTo",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"upgradeToAndCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"ytoken",outputs:[{internalType:"contract IYieldToken",name:"",type:"address"}],stateMutability:"view",type:"function"}],B=e=>{switch(e){case 84532:return"base_sepolia";case 8453:return"base_mainnet";default:return"0x".concat(e.toString(16).toUpperCase())}};var O=n(82728);let L={"0x1":"PYUSD","0x5":"PYUSD","0xAA36A7":"PYUSD",base_mainnet:"HNUSD",base_sepolia:"HNUSD"},U={"0x1":8n,"0x5":8n,"0xAA36A7":8n,base_mainnet:18n,base_sepolia:18n},F=e=>{let t=e.get("chain");if(t)switch(t){case"mainnet":case"eth_mainnet":break;case"sepolia":case"eth_sepolia":return 11155111;case"base":return 8453;case"base_sepolia":return 84532}return 1},R=()=>{var e;let t=(0,O.useSearchParams)(),{chain:n}=(0,M.LN)(),a=null!==(e=null==n?void 0:n.id)&&void 0!==e?e:F(t),i=B(a);return{chainId:a,networkId:i,defaultCollateralSymbol:L[i],collaterals:w[i],priceDecimals:U[i]}},Y=e=>{var t,n,a;let{tokenSymbol:i,tokenAmount:s=10000000n}=e,{chainId:r,networkId:l,priceDecimals:d}=R(),u=j[i][l],{data:p,refetch:c,isFetching:m,isLoading:y}=k()({abi:I,chainId:r,address:u,functionName:"buyPreview",args:[s]}),x=null!==(t=null==p?void 0:p[0])&&void 0!==t?t:0n,f=null!==(n=null==p?void 0:p[1])&&void 0!==n?n:0n,h=null!==(a=null==p?void 0:p[2])&&void 0!==a?a:0n,{data:b}=(0,M.Ov)({chainId:r});return(0,o.useEffect)(()=>{s&&c()},[b,i,s,c]),{usycPayoutAmount:x,stablecoinFee:f,usycPrice:h,usycToStablecoinPrice:h?10n**(2n*d)/h:0n,isFetching:m,isLoading:y}};var P=n(55210);let H=()=>{let e=(0,o.useRef)(),{chainId:t,networkId:n,priceDecimals:a}=R(),{data:i,isLoading:s,refetch:r,isError:l,error:d}=k()({abi:E,address:S[n],chainId:t,functionName:"nextPrice",watch:!0,cacheTime:5e3}),u=void 0===i?e.current:(0,P.b)(i,Number(a));return void 0!==i&&(e.current=(0,P.b)(i,Number(a))),{isLoading:s,rawNextPrice:i,nextPrice:u,refetch:r}},W=e=>{let{usycPrice:t,isLoading:n}=Y({tokenSymbol:e,tokenAmount:100n}),{rawNextPrice:a,isLoading:i}=H(),s=n||i;return void 0===t||void 0===a?{isLoading:s,isAfterHoursPrice:!1}:t===a?{isAfterHoursPrice:!0,isLoading:s}:{isAfterHoursPrice:!1,isLoading:s}},G=()=>{let e=(0,M.mA)(),t=(0,O.useSearchParams)().get("view");return t?{address:t,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,connector:{},status:"connected",overridden:!0,removeOverride:()=>{window.history.pushState({},document.title,window.location.pathname),location.reload()}}:e},q=()=>{let{overridden:e,address:t,status:n,isConnected:a}=G();(0,o.useEffect)(()=>{let a={status:n,overridden:e,address:t};console.debug("updating senty wallet context and user",a),_.v("wallet",a),_.av({email:t,id:t})},[e,t,n,a])},K=e=>{let{children:t,onClose:n}=e;return(0,l.jsx)("div",{className:"absolute top-0 left-0 z-10 w-full h-full bg-white",children:(0,l.jsx)("div",{className:"flex flex-col w-full h-full px-6 pt-6",children:(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 text-center text-gray-800 grow",children:[t,(0,l.jsx)("button",{className:"w-full p-3 text-lg font-medium text-center text-gray-800 rounded-lg bg-steel-50",onClick:n,children:"Close"})]})})})},z=()=>(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"60",height:"60",viewBox:"0 0 60 60",fill:"none",children:[(0,l.jsx)("circle",{cx:"30",cy:"30",r:"30",fill:"#059669"}),(0,l.jsx)("path",{d:"M14.0002 27.7653L24.952 41.7721C25.0461 41.8924 25.2252 41.901 25.3303 41.7902L46.0002 20.0006",stroke:"white",strokeWidth:"3",strokeLinecap:"round"})]}),V=e=>{let t=["WBTC","WETH"].includes(e.toUpperCase())?e.substring(1):e.startsWith("hn")||e.startsWith("ls")?e.substring(2):e;return"/icons/".concat(t.toLowerCase(),".svg")};var $=e=>{let{currency:t,width:n,height:a}=e,[i,s]=(0,o.useState)(V(t.toLowerCase()));return(0,o.useEffect)(()=>{s(V(t))},[t]),(0,l.jsx)(d.default,{style:{display:"inline"},onError:()=>s(V("unknown")),alt:t.toUpperCase(),src:i,height:a,width:n})};let X=()=>(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[(0,l.jsx)("circle",{cx:"12",cy:"12",r:"11.5",fill:"white",stroke:"#E5E7EB"}),(0,l.jsx)("path",{d:"M17 12.8571L12 17.8571M12 17.8571L7 12.8571M12 17.8571V7",stroke:"#374151",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]});var Q=n(52046),Z=n(42453),J=n(14436);let ee={right:-90,left:90,up:180,down:0},et=e=>{let{direction:t,className:n}=e;return(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:null!=n?n:"w-6 h-6",transform:"rotate(".concat(ee[t],")"),children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})})},en=e=>{let{onChange:t,value:n,collaterals:a}=e;return(0,l.jsx)("div",{className:"w-[136px]",children:(0,l.jsx)(Z.R,{value:n,onChange:t,children:e=>{let{open:t}=e;return(0,l.jsxs)("div",{className:"relative flex flex-col w-[136px]",children:[(0,l.jsx)(Z.R.Button,{className:"flex justify-between w-full p-2 border border-gray-300 rounded-lg",children:(0,l.jsxs)("div",{className:"flex flex-row items-center w-full gap-2",children:[(0,l.jsx)($,{currency:n,width:20,height:20}),(0,l.jsxs)("div",{className:"flex text-xl font-medium grow",children:[" ",n]}),(0,l.jsx)(et,{className:"w-4 h-4 transition-transform ".concat(t?"rotate-180":""),direction:"down"})]})}),(0,l.jsx)(J.u,{as:o.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,l.jsx)(Z.R.Options,{className:"absolute z-20 w-full mr-1 bg-white border border-gray-300 rounded-lg top-full",children:a.map(e=>(0,l.jsx)(Z.R.Option,{value:e,children:t=>{let{selected:n}=t;return(0,l.jsxs)("div",{className:"flex flex-row p-2 items-center hover:bg-gray-200 hover:cursor-pointer gap-1 ".concat(n?"font-bold":""),children:[(0,l.jsx)($,{currency:e,width:20,height:20}),e]})}},e))})})]})}})})},ea=()=>(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",children:(0,l.jsx)("path",{d:"M1 1.00125V4.33459H1.388M1.388 4.33459C1.83057 3.24001 2.62379 2.32319 3.64335 1.72783C4.66292 1.13246 5.8512 0.892196 7.02198 1.04468C8.19276 1.19717 9.27986 1.73378 10.1129 2.57044C10.946 3.40709 11.4779 4.4965 11.6253 5.66792M1.388 4.33459H4.33333M11.6667 11.6679V8.33459H11.2793M11.2793 8.33459C10.8361 9.42853 10.0427 10.3446 9.02322 10.9394C8.00376 11.5343 6.81583 11.7743 5.6454 11.6218C4.47497 11.4694 3.38813 10.9332 2.55502 10.0971C1.72191 9.26097 1.18957 8.17222 1.04133 7.00125M11.2793 8.33459H8.33333",stroke:"#6B7280",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});var ei=n(68971);let es=function(e){let{maxDisplayDecimals:t,addSign:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e)return"---";let a=ed(e);if(n&&Number(e)>0&&(a="+"+a),void 0!==t){let e=a.split("."),n=e[0],i=e[1];"0"===n&&i?i.length>8&&(a="".concat(n,".").concat(i.slice(0,8),"...")):a="0"!==i&&i&&0!==t?"".concat(n,".").concat(i.slice(0,t)):n}return a},er=function(e,t){let{maxDisplayDecimals:n,addSign:a,showEllipsisForOverflow:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{showEllipsisForOverflow:!0};if(null==e)return"---";let s=BigInt(e),r=ed((0,ei.b)(s,t));if(void 0!==n){let e=r.split("."),t=e[0],a=e[1];r="0"===t&&a?i?"".concat(t,".").concat(a.slice(0,8),"..."):"".concat(t,".").concat(a.slice(0,n)):"0"!==a&&a&&0!==n?"".concat(t,".").concat(a.slice(0,n)):t}return a&&BigInt(e)>BigInt(0)&&(r="+"+r),r},el=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>2;return null===e||void 0==e?"0.00":new Intl.NumberFormat("en-US",{maximumFractionDigits:t(e),minimumFractionDigits:t(e)}).format(Number(e))};function ed(e){let t=String(e).split(".");if(isNaN(Number(e)))return"---";if(Number(e)>0&&0!==Number(e)&&1e-6>Number(e))return"<0.000001";if(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)throw Error("invalid value while commifying: ".concat(e));let n=t[0],a="";for("-"===n.substring(0,1)&&(a="-",n=n.substring(1));"0"===n.substring(0,1);)n=n.substring(1);""===n&&(n="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);let s=[];for(;n.length;){if(n.length<=3){s.unshift(n);break}{let e=n.length-3;s.unshift(n.substring(e)),n=n.substring(0,e)}}return a+s.join(",")+i}let eo=e=>{let{usycPrice:t,usycToStablecoin:n,collateral:a,swapDefaultView:i=!1}=e,[s,r]=(0,o.useState)(i),{priceDecimals:d}=R(),[u,p]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{p(!0)},[]),(0,l.jsxs)("div",{className:"flex flex-row justify-between text-sm font-medium text-gray-500",children:[(0,l.jsx)("span",{children:"Rate"}),(0,l.jsxs)("div",{className:"flex flex-row items-center gap-2",children:[u&&t?(0,l.jsx)(l.Fragment,{children:s?(0,l.jsxs)("span",{className:"font-inter",children:["1 ",a," ≈"," ",er(t,Number(d),{showEllipsisForOverflow:!1,maxDisplayDecimals:6})," ","USYC"]}):(0,l.jsxs)("span",{className:"font-inter",children:["1 USYC ≈"," ",er(n,Number(d),{showEllipsisForOverflow:!1,maxDisplayDecimals:6})," ",a]})}):(0,l.jsx)("div",{className:"w-48 h-4 bg-gray-300 rounded animate-pulse"}),(0,l.jsx)("div",{className:"hover:cursor-pointer",onClick:()=>r(!s),children:(0,l.jsx)(ea,{})})]})]})},eu=e=>{let{inputCurrency:t,outputCurrency:n,inputTokenBalance:a,inputTokenBalanceDecimals:i,inputToOutputConversion:s,outputToInputConversion:r,outputAmount:d,setInputAmount:u,onFundTokenChange:p,showConfirmationScreen:c}=e,[m,y]=(0,o.useState)(""),{collaterals:x}=R();console.debug({inputToOutputConversion:s,outputToInputConversion:r});let f=()=>{s&&r&&(y((0,P.b)(a,i)),u(a))};return(0,o.useEffect)(()=>{c&&(y(""),u(BigInt(0)))},[c,u]),(0,l.jsxs)("div",{className:"flex flex-col pt-6 pb-3",children:[(0,l.jsxs)("div",{className:"flex flex-col w-full gap-5 p-5 border border-gray-200 rounded",children:[(0,l.jsxs)("div",{className:"flex flex-row justify-between text-sm font-medium text-gray-500",children:[(0,l.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,l.jsx)("span",{children:"Balance"}),(0,l.jsx)("div",{className:"hover:cursor-pointer hover:text-white hover:bg-gray-400 text-gray-500 text-xs font-bold leading-none h-5 px-2 py-0.5 rounded-[20px] border border-gray-400",onClick:()=>f(),children:"MAX"})]}),(0,l.jsx)("span",{className:"font-inter",children:(0,P.b)(a,i)})]}),(0,l.jsxs)("div",{className:"flex flex-row items-center pb-2",children:[(0,l.jsx)(en,{onChange:p,value:t,collaterals:x}),(0,l.jsx)("div",{children:(0,l.jsx)("input",{type:"text",className:"w-full font-medium text-right text-gray-800 placeholder-gray-400 bg-transparent border-0 text-md sm:text-xl font-inter focus:outline-none focus:ring-0",placeholder:"0.00",value:m,onChange:e=>{if(!s||!r)return;let t=e.target.value;/^\d*\.?\d{0,8}$/.test(t)&&t.length<=18&&(y(t),u((0,Q.v)(t,i)))}})})]})]}),(0,l.jsx)("div",{className:"relative flex items-center justify-center h-2",children:(0,l.jsx)(X,{})}),(0,l.jsxs)("div",{className:"flex flex-col w-full gap-5 p-5 border border-gray-200 rounded",children:[(0,l.jsx)(eo,{collateral:t,usycPrice:s,usycToStablecoin:r,swapDefaultView:!0}),(0,l.jsxs)("div",{className:"flex flex-row justify-between pb-2",children:[(0,l.jsxs)("div",{className:"flex flex-row justify-center",children:[(0,l.jsx)("div",{className:"hidden w-6 h-6 sm:block",children:(0,l.jsx)($,{currency:n,width:24,height:24})}),(0,l.jsx)("div",{className:"mr-2 font-medium text-gray-800 sm:ml-1 text-md sm:text-xl",children:n})]}),(0,l.jsx)("div",{className:"w-full font-medium text-right text-gray-800 placeholder-gray-400 bg-transparent border-0 text-md sm:text-xl font-inter focus:outline-none focus:ring-0",children:(0,l.jsx)("span",{children:d||"0"})})]})]})]})};var ep=n(71940);let ec=e=>{let{className:t}=e,[n,a]=(0,o.useState)(!1),i=()=>{a(!1)};return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:t||"w-full p-3 text-lg font-medium text-center text-gray-600 bg-white border rounded-lg border-slate-400 hover:cursor-pointer",onClick:()=>{a(!0)},children:"Contact us to get access"}),(0,l.jsx)(ep.V,{as:"div",className:"fixed inset-0 z-10 overflow-y-auto",open:n,onClose:i,children:(0,l.jsxs)("div",{className:"flex items-center justify-center min-h-screen",children:[(0,l.jsx)(ep.V.Overlay,{className:"fixed inset-0 bg-black opacity-30"}),(0,l.jsxs)("div",{className:"relative max-w-md p-10 bg-white rounded-lg",children:[(0,l.jsx)(ep.V.Title,{className:"text-xl font-medium text-gray-800",children:"Contact Us"}),(0,l.jsxs)(ep.V.Description,{className:"my-10 text-gray-800",children:["Contact us at"," ",(0,l.jsx)("a",{className:"focus:outline-none focus:ring-0",href:"mailto:support@hashnote.com",children:(0,l.jsx)("u",{children:"support@hashnote.com"})})," ","to start onboarding."]}),(0,l.jsx)("div",{className:"w-full h-11 p-2.5 bg-black justify-center items-center gap-2.5 inline-flex cursor-pointer text-white font-bold",onClick:i,children:"Close"})]})]})})]})},em=()=>(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"animate-spin",width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",children:[(0,l.jsx)("path",{d:"M15 3.75C21.2133 3.75 26.25 8.7868 26.25 15C26.25 21.2133 21.2133 26.25 15 26.25C8.7868 26.25 3.75 21.2133 3.75 15C3.75 8.7868 8.7868 3.75 15 3.75Z",stroke:"#002855",strokeOpacity:"0.3",strokeWidth:"3",strokeLinecap:"round"}),(0,l.jsx)("path",{d:"M15 3.75C21.2133 3.75 26.25 8.7868 26.25 15",stroke:"#002855",strokeWidth:"3",strokeLinecap:"round"})]}),ey=e=>{let{className:t,children:n,onClick:a,disabled:i}=e;return(0,l.jsx)("button",{className:"w-full p-3 text-lg font-medium text-center text-gray-800 rounded-lg bg-adept disabled:bg-gray-200 disabled:text-gray-400 $",onClick:a,disabled:i,children:n})},ex=()=>({hasAccess:!0});var ef=n(46580);let eh=["User rejected the request","User denied transaction signature"],eb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>(0,M.GG)({onSuccess:(n,a,i)=>{var s;console.debug("contract write success",{result:n,label:e.label,functionName:null==t?void 0:t.functionName}),_.n_({category:"transactions",message:"contract write success",data:n,level:4}),null===(s=t.onSuccess)||void 0===s||s.call(t,n,a,i)},onError:(n,a,i)=>{var s;if(console.trace("contract write error",{error:n,label:e.label,functionName:null==t?void 0:t.functionName}),"message"in n&&eh.some(e=>n.message.includes(e))){console.debug("skipping sentry capture");return}_.Tb(n),null===(s=t.onError)||void 0===s||s.call(t,n,a,i)},...t})},ev=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>(0,M.PJ)({onSuccess:n=>{let a="prepare contract write success".concat(e.label&&": ".concat(e.label));console.debug(a,{result:n,label:e.label,functionName:null==t?void 0:t.functionName}),_.n_({category:"transactions",message:a,data:n,level:4})},onError:n=>{console.error("prepare contract write error".concat(e.label&&": ".concat(e.label)),{error:n,label:e.label,functionName:null==t?void 0:t.functionName}),_.Tb(n)},...t})},eg=e=>{let{tokenAddress:t,spenderAddress:n,chainId:a,enabled:i,onApproveConfirmation:s,allowanceRequired:r}=e,{address:l}=G(),{chain:d}=(0,M.LN)(),o=!!((void 0===i||!0===i)&&l&&t&&n&&a&&(null==d?void 0:d.id)===a),{data:u,isLoading:p,refetch:c}=k()({enabled:o,watch:!0,abi:ef.em,address:t,cacheTime:1e3,chainId:a,functionName:"allowance",args:[null!=l?l:"0x",null!=n?n:"0x"]}),{config:m}=ev({label:"useAllowance token approve"})({enabled:o,chainId:a,address:t,abi:ef.em,functionName:"approve",args:[null!=n?n:"0x",null!=r?r:BigInt(0)]}),{write:y,isLoading:x,data:f}=eb({label:"useAllowance token approve"})(m),{isLoading:h}=(0,M.BX)({chainId:a,hash:null==f?void 0:f.hash,onSuccess:async e=>{console.debug("allowance approval confirmed",e),c(),null==s||s()}});return t&&n&&a?{allowance:null!=u?u:BigInt(0),isFetchingAllowance:p,write:y,confirming:h,refetch:c,waitingForSignature:x}:{allowance:BigInt(0),write:void 0,isFetchingAllowance:!1,confirming:!1,refetch:void 0,waitingForSignature:!1}},ew={"0x1":"https://ethereum-mainnet.graph-eu.p2pify.com/ebddc3f1033a673b2a59d8502d46b6ea/vaults_mainnet","0x5":"https://ethereum-goerli.graph-eu.p2pify.com/1edf2c02ad38ffd266e22369a3a780d8/vaults_goerli","0xAA36A7":"https://ethereum-goerli.graph-eu.p2pify.com/2f8067735aafbd29eb5ff10a7005b745/hashnote_sepolia"},ej=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(void 0===t)return;let n=B(t);switch(e){case"USDC":return A[n];case"PYUSD":return N[n];case"HNUSD":return C[n];default:throw Error("Invalid USYC Collateral: ".concat(e))}},eT=e=>{let{collateral:t,allowanceRequired:n,onApproveConfirmation:a}=e,{chainId:i,networkId:s}=R(),{address:r}=G(),{allowance:l,write:d,confirming:o,waitingForSignature:u}=eg({chainId:i,spenderAddress:j[t][s],tokenAddress:ej(t,i),allowanceRequired:null!=n?n:BigInt(0),enabled:!!r,onApproveConfirmation:a});return{allowance:l,write:d,confirming:o,waitingForSignature:u}},eN=[{inputs:[{internalType:"address",name:"_ytoken",type:"address"},{internalType:"address",name:"_stable",type:"address"},{internalType:"address",name:"_oracle",type:"address"},{internalType:"address",name:"_holidays",type:"address"},{internalType:"address",name:"_dst",type:"address"},{internalType:"address",name:"_allowlist",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AfterHours",type:"error"},{inputs:[],name:"BadAddress",type:"error"},{inputs:[],name:"BadAmount",type:"error"},{inputs:[{internalType:"enum Holiday",name:"holiday",type:"uint8"}],name:"ClosedForHoliday",type:"error"},{inputs:[],name:"ClosedForWeekend",type:"error"},{inputs:[],name:"InvalidTradingWindow",type:"error"},{inputs:[],name:"NoAccess",type:"error"},{inputs:[],name:"NotPermissioned",type:"error"},{inputs:[],name:"YearNotFound",type:"error"},{inputs:[],name:"YearNotFound",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"beacon",type:"address"}],name:"BeaconUpgraded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"paid",type:"uint256"},{indexed:!1,internalType:"uint256",name:"price",type:"uint256"}],name:"Bought",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousLp",type:"address"},{indexed:!1,internalType:"address",name:"newLp",type:"address"}],name:"LiquidityProviderSet",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"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"received",type:"uint256"},{indexed:!1,internalType:"uint256",name:"fee",type:"uint256"}],name:"Sold",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[],name:"allowlist",outputs:[{internalType:"contract IAllowlist",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"buy",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"},{internalType:"address",name:"_recipient",type:"address"}],name:"buyFor",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"dst",outputs:[{internalType:"contract DaylightSavingsCalendar",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"fund",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getHoliday",outputs:[{internalType:"enum Holiday",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"holidays",outputs:[{internalType:"contract HolidayCalendar",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_owner",type:"address"},{internalType:"address",name:"_liquidityProvider",type:"address"},{internalType:"uint256",name:"_startHour",type:"uint256"},{internalType:"uint256",name:"_endHour",type:"uint256"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"isCoreTradingHours",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"isDST",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_year",type:"uint256"},{internalType:"uint256",name:"_month",type:"uint256"},{internalType:"uint256",name:"_day",type:"uint256"}],name:"isHoliday",outputs:[{internalType:"enum Holiday",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"isHoliday",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"isTradingDay",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"liquidityProvider",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"marketIsOpen",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"oracle",outputs:[{internalType:"contract IYieldTokenOracle",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"proxiableUUID",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_ytokenAmount",type:"uint256"},{internalType:"uint256",name:"_stableAmount",type:"uint256"}],name:"redeem",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"sell",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"},{internalType:"address",name:"_recipient",type:"address"}],name:"sellFor",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"sellPreview",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"int256",name:"",type:"int256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_liquidityProvider",type:"address"}],name:"setLiquidityProvider",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_startHour",type:"uint256"},{internalType:"uint256",name:"_endHour",type:"uint256"}],name:"setTradingHours",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"stable",outputs:[{internalType:"contract IERC20Metadata",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"state",outputs:[{internalType:"enum TradingDays.State",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"time",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"tradingEndHour",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"tradingStartHour",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"}],name:"upgradeTo",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"upgradeToAndCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"ytoken",outputs:[{internalType:"contract IYieldToken",name:"",type:"address"}],stateMutability:"view",type:"function"}],eC=e=>{let{collateralAmount:t,collateral:n,onConfirmation:a}=e,{chainId:i,networkId:s}=R(),{address:r}=G(),{data:l,isError:d,error:u,refetch:p,isRefetching:c}=ev({label:"buy usyc"})({address:j[n][s],account:r,abi:eN,functionName:"buy",chainId:i,enabled:!!r&&!!t,args:[null!=t?t:BigInt(0)]}),{write:m,isError:y,error:x,isLoading:f,data:h}=eb()({...l}),{isLoading:b}=(0,M.BX)({chainId:i,hash:null==h?void 0:h.hash,onSuccess:async()=>{null==a||a(),p()}}),{data:v}=(0,M.Ov)({chainId:i}),{confirming:g}=eT({collateral:n,allowanceRequired:t,onApproveConfirmation:p});return(0,o.useEffect)(()=>{c||p()},[v,g,n]),{buyUSYC:m,isPrepareError:d,prepareError:u,isWriteError:y,writeError:x,isWaitingForSignature:f,isConfirming:b}},eA=e=>{let{children:t}=e;return(0,l.jsx)("div",{className:"absolute top-0 left-0 z-10 w-full h-full bg-white",children:(0,l.jsxs)("div",{className:"flex flex-col w-full h-full px-6 pt-6",children:[(0,l.jsx)("div",{className:"flex flex-col justify-center text-center text-gray-800 grow",children:t}),(0,l.jsx)("div",{className:"flex self-end justify-center w-full p-3 text-lg font-medium text-center text-gray-800 rounded-lg bg-steel50",children:(0,l.jsx)(em,{})})]})})},eS=(e,t)=>t,eM=e=>{let{buyAmount:t,collateral:n,chainID:a,showConfirmationScreen:i,spendingBalance:s}=e,{hasAccess:r}=ex(),{isAfterHoursPrice:d}=W(n),{isConnected:u,isDisconnected:p,isConnecting:c}=G(),{isFullyConnected:m}=(0,v.SXd)(),{allowance:y,write:x,waitingForSignature:f,confirming:h}=eT({collateral:n,allowanceRequired:t}),{buyUSYC:b,isWriteError:g,writeError:w,isWaitingForSignature:j,isConfirming:T}=eC({collateralAmount:t,collateral:n}),[N,C]=(0,o.useReducer)(eS,"LOADING");switch((0,o.useEffect)(()=>{if(!r){C("NOT_PERMISSIONED");return}if(c||m&&p){C("LOADING");return}if(j||f){C("AWAITING_SIGNATURE");return}if(h){C("LOADING");return}if(t>0&&(!y||t>y)){C("USDC_ALLOWANCE_TOO_LOW");return}if(T){i(!0),C("BUY_CONFIRMING");return}C("BUY_OK")},[u,a,r,n,d,j,f,h,t,y,T,i,c,p,m]),N){case"LOADING":case"AWAITING_SIGNATURE":return(0,l.jsx)("div",{className:"flex self-end justify-center w-full p-3 text-lg font-medium text-center text-gray-800 rounded-lg bg-steel50",children:(0,l.jsx)(em,{})});case"NOT_PERMISSIONED":return(0,l.jsx)("div",{className:"flex flex-col gap-3",children:(0,l.jsx)(ec,{})});case"USDC_ALLOWANCE_TOO_LOW":return(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsxs)("div",{className:"text-sm font-medium text-red-500",children:["The approved ",n," spending cap must be greater than or equal to the funding amount."]}),(0,l.jsxs)(ey,{onClick:()=>null==x?void 0:x(),children:["Approve ",n]})]});case"BUY_CONFIRMING":return(0,l.jsxs)(eA,{children:[(0,l.jsx)("div",{className:"font-bold",children:"Funding Initiated."}),(0,l.jsx)("div",{children:"Now Minting USYC."})]});case"BUY_OK":return(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[s<t?(0,l.jsx)("div",{className:"text-sm font-medium text-red-500",children:(0,l.jsxs)("p",{children:["Your ",n," balance is insufficient to fund the requested amount."]})}):!g||(null==w?void 0:w.message.toLowerCase().includes("user denied"))?null:(0,l.jsx)("div",{className:"text-sm font-medium text-red-500",children:(0,l.jsxs)("p",{children:["There was an error in processing your request. Our team has been notified:"," ",null==w?void 0:w.message]})}),(0,l.jsx)(ey,{onClick:()=>null==b?void 0:b(),disabled:!t||t===BigInt(0)||s<t,children:"Add Funds"})]})}},e_=e=>{let{collateral:t,allowanceRequired:n}=e,{chainId:a,networkId:i}=R(),{address:s}=G(),{allowance:r,write:l,confirming:d,waitingForSignature:o}=eg({chainId:a,spenderAddress:j[t][i],tokenAddress:T[i],allowanceRequired:null!=n?n:BigInt(0),enabled:!!s});return{allowance:r,write:l,confirming:d,waitingForSignature:o}},ek=e=>{let{collateral:t,usycSellAmount:n,onConfirmation:a}=e,{chainId:i,networkId:s}=R(),{address:r}=G(),{data:l,isError:d,error:u,refetch:p,isRefetching:c}=ev({label:"sell usyc"})({address:j[t][s],account:r,abi:I,functionName:"sell",chainId:i,enabled:!!r&&!!n,args:[null!=n?n:BigInt(0)]}),{write:m,isError:y,error:x,isLoading:f,data:h}=eb()({...l}),{isLoading:b}=(0,M.BX)({chainId:i,hash:null==h?void 0:h.hash,onSuccess:async()=>{null==a||a()}}),{data:v}=(0,M.Ov)({chainId:i}),{confirming:g}=e_({collateral:t,allowanceRequired:n});return(0,o.useEffect)(()=>{c||p()},[v,g,t]),{sellUSYC:m,isPrepareError:d,prepareError:u,isWriteError:y,writeError:x,isWaitingForSignature:f,isConfirming:b}},eD=(e,t)=>!!(t&&e&&e!==g&&t!==g),eE=e=>{let{chainId:t}=e,n=j.PYUSD[B(t)],a=ej("PYUSD",t),i=(0,M.KQ)({address:n,token:a,chainId:t,enabled:eD(n,a)}),s=j.USDC[B(t)],r=ej("USDC",t),l=(0,M.KQ)({address:s,token:r,chainId:t,enabled:eD(s,r)}),d=j.HNUSD[B(t)],o=ej("HNUSD",t);return{PYUSD:i,USDC:l,HNUSD:(0,M.KQ)({address:d,token:o,chainId:t,enabled:eD(d,o)})}},eI=(e,t)=>t,eB=e=>{var t;let{sellAmount:n,collateral:a,chainID:i,expectedOutputAmount:s,showConfirmationScreen:r,spendingBalance:d}=e,{hasAccess:u}=ex(),{isAfterHoursPrice:p}=W(a),{isConnected:c,isDisconnected:m,isConnecting:y}=G(),{isFullyConnected:x}=(0,v.SXd)(),{allowance:f,write:h,waitingForSignature:b,confirming:g}=e_({collateral:a,allowanceRequired:n}),{sellUSYC:w,isPrepareError:j,isWriteError:T,writeError:N,isWaitingForSignature:C,isConfirming:A}=ek({usycSellAmount:n,collateral:a}),S=null===(t=eE({chainId:i})[a].data)||void 0===t?void 0:t.value,[M,_]=(0,o.useReducer)(eI,"LOADING");switch((0,o.useEffect)(()=>{if(y||x&&m){_("LOADING");return}if(C||b){_("AWAITING_SIGNATURE");return}if(g){_("LOADING");return}if(n>0&&(!f||n>f)){_("USYC_ALLOWANCE_TOO_LOW");return}if(A){r(!0),_("SELL_CONFIRMING");return}_("SELL_OK")},[c,i,u,p,C,b,g,n,f,A,S,r,y,m,x,N]),M){case"LOADING":case"AWAITING_SIGNATURE":return(0,l.jsx)("div",{className:"flex self-end justify-center w-full p-3 text-lg font-medium text-center text-gray-800 rounded-lg bg-steel50",children:(0,l.jsx)(em,{})});case"USYC_ALLOWANCE_TOO_LOW":return(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsx)("div",{className:"text-sm font-medium text-red-500",children:"The approved USYC spending cap must be greater than or equal to the redeem amount."}),(0,l.jsx)(ey,{onClick:()=>null==h?void 0:h(),children:"Approve USYC"})]});case"SELL_CONFIRMING":return(0,l.jsxs)(eA,{children:[(0,l.jsx)("div",{className:"font-bold",children:" Redemption Initiated."}),(0,l.jsx)("div",{children:"Now Redeeming USYC."})]});case"SELL_OK":return(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[d<n?(0,l.jsx)("div",{className:"text-sm font-medium text-red-500",children:(0,l.jsx)("p",{children:"Your USYC balance is insufficient to redeem the requested amount."})}):s&&void 0!==S&&S<s?(0,l.jsxs)("div",{className:"text-sm font-medium text-red-500",children:[(0,l.jsxs)("p",{children:["The ",a," redemption amount exceeds the current available supply (",er(S,6)," ",a,")."," "]}),(0,l.jsxs)("p",{children:["Please try again later or contact us at"," ",(0,l.jsx)("a",{href:"mailto:support@hashnote.com",className:"text-blue-500 underline",children:"support@hashnote.com"})," ","if you need further assistance."]})]}):!T||(null==N?void 0:N.message.toLowerCase().includes("user denied"))?null:(0,l.jsx)("div",{className:"text-sm font-medium text-red-500",children:(0,l.jsxs)("p",{children:["There was an error in processing your request. Our team has been notified:"," ",null==N?void 0:N.message]})}),(0,l.jsx)(ey,{onClick:()=>null==w?void 0:w(),disabled:!n||n===BigInt(0)||d<n,children:"Redeem Funds"})]})}},eO=(e,t)=>t,eL=e=>{let{mode:t,buyOrSellAmount:n,collateralToken:a,chainID:i,expectedOutputAmount:s,showConfirmationScreen:r,spendingBalance:d}=e,{hasAccess:u}=ex(),{isAfterHoursPrice:p}=W(a),{isConnected:c,isDisconnected:m,isConnecting:y,isReconnecting:x}=G(),{isFullyConnected:f,loadingNetwork:h}=(0,v.SXd)(),[b,g]=(0,o.useReducer)(eO,"LOADING");switch((0,o.useEffect)(()=>{(async()=>{if(h||y||f&&m){g("LOADING");return}if(m){g("WALLET_NOT_CONNECTED");return}if(!0!==u){g("NOT_ONBOARDED");return}if("buy"===t){g("BUY_OK");return}if("sell"===t){g("SELL_OK");return}g("LOADING")})()},[a,c,i,u,p,t,n,r,y,m,f,h]),b){case"LOADING":case"REQUIRES_NETWORK_SWITCH":return(0,l.jsx)("div",{className:"flex self-end justify-center w-full p-3 text-lg font-medium text-center text-gray-800 rounded-lg bg-steel50",children:(0,l.jsx)(em,{})});case"WALLET_NOT_CONNECTED":return(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsx)(v.oPJ,{buttonClassName:"w-full",children:(0,l.jsx)("div",{className:"w-full p-3 text-lg font-medium text-center text-gray-800 rounded-lg bg-adept",children:"Connect your wallet"})}),(0,l.jsx)(ec,{})]});case"NOT_ONBOARDED":return(0,l.jsx)(ec,{});case"MARKET_CLOSED":return(0,l.jsx)(ey,{disabled:!0,children:"Market is Currently Closed"});case"BUY_OK":return(0,l.jsx)(eM,{buyAmount:n,collateral:a,chainID:i,showConfirmationScreen:r,spendingBalance:d});case"SELL_OK":return(0,l.jsx)(eB,{collateral:a,sellAmount:n,chainID:i,expectedOutputAmount:s,showConfirmationScreen:r,spendingBalance:d})}},eU=e=>{var t,n,a,i,s,r;let{onCollateralChange:d}=e,[u,p]=(0,o.useState)(BigInt(0)),{defaultCollateralSymbol:c,chainId:m}=R(),[y,x]=(0,o.useState)(c),{address:f}=(0,M.mA)(),h=ej(y,m),{isConnected:b}=G(),v=(0,M.KQ)({address:f,enabled:!!f,token:null!=h?h:"0x0",chainId:m,watch:!0}),{data:g}=(0,M.do)({abi:D,address:h,chainId:m,functionName:"decimals",cacheTime:12e4}),[w,j]=(0,o.useState)(!1),{stablecoinFee:T,usycPayoutAmount:N,usycPrice:C,usycToStablecoinPrice:A}=Y({tokenSymbol:y,tokenAmount:u});return(0,o.useEffect)(()=>{d(y)},[y,d]),(0,o.useEffect)(()=>{x(c)},[m,c]),(0,l.jsxs)("div",{className:"relative flex flex-col px-6",children:[w&&(0,l.jsxs)(K,{onClose:()=>j(!1),children:[(0,l.jsx)(z,{}),(0,l.jsx)("div",{className:"font-bold",children:" USYC Token Minted!"})]}),(0,l.jsx)(eu,{outputCurrency:"USYC",outputAmount:(0,P.b)(N,6),inputCurrency:y,inputTokenBalance:null!==(i=null==v?void 0:null===(t=v.data)||void 0===t?void 0:t.value)&&void 0!==i?i:BigInt(0),inputTokenBalanceDecimals:null!=g?g:0,inputToOutputConversion:A,outputToInputConversion:C,setInputAmount:p,onFundTokenChange:e=>{x(e)},showConfirmationScreen:w}),b&&(0,l.jsx)("div",{className:"flex flex-col",children:(0,l.jsxs)("div",{className:"flex flex-row justify-between w-full pb-3 text-sm text-black",children:[(0,l.jsx)("div",{className:"flex flex-row gap-1",children:"Fee"}),(0,l.jsxs)("div",{className:"text-right font-azeret",children:[er(T,null!==(s=null===(n=v.data)||void 0===n?void 0:n.decimals)&&void 0!==s?s:0)," ",y]})]})}),(0,l.jsx)(eL,{mode:"buy",collateralToken:y,buyOrSellAmount:u,chainID:m,showConfirmationScreen:j,spendingBalance:null!==(r=null===(a=v.data)||void 0===a?void 0:a.value)&&void 0!==r?r:BigInt(0)})]})},eF=function(){let{className:e,fill:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{className:"w-6 h-6"};return(0,l.jsx)("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,l.jsx)("path",{d:"M12 17C12.2833 17 12.521 16.904 12.713 16.712C12.905 16.52 13.0007 16.2827 13 16V12C13 11.7167 12.904 11.479 12.712 11.287C12.52 11.095 12.2827 10.9993 12 11C11.7167 11 11.479 11.096 11.287 11.288C11.095 11.48 10.9993 11.7173 11 12V16C11 16.2833 11.096 16.521 11.288 16.713C11.48 16.905 11.7173 17.0007 12 17ZM12 9C12.2833 9 12.521 8.904 12.713 8.712C12.905 8.52 13.0007 8.28267 13 8C13 7.71667 12.904 7.479 12.712 7.287C12.52 7.095 12.2827 6.99933 12 7C11.7167 7 11.479 7.096 11.287 7.288C11.095 7.48 10.9993 7.71733 11 8C11 8.28333 11.096 8.521 11.288 8.713C11.48 8.905 11.7173 9.00067 12 9ZM12 22C10.6167 22 9.31667 21.7373 8.1 21.212C6.88333 20.6867 5.825 19.9743 4.925 19.075C4.025 18.175 3.31267 17.1167 2.788 15.9C2.26333 14.6833 2.00067 13.3833 2 12C2 10.6167 2.26267 9.31667 2.788 8.1C3.31333 6.88333 4.02567 5.825 4.925 4.925C5.825 4.025 6.88333 3.31267 8.1 2.788C9.31667 2.26333 10.6167 2.00067 12 2C13.3833 2 14.6833 2.26267 15.9 2.788C17.1167 3.31333 18.175 4.02567 19.075 4.925C19.975 5.825 20.6877 6.88333 21.213 8.1C21.7383 9.31667 22.0007 10.6167 22 12C22 13.3833 21.7373 14.6833 21.212 15.9C20.6867 17.1167 19.9743 18.175 19.075 19.075C18.175 19.975 17.1167 20.6877 15.9 21.213C14.6833 21.7383 13.3833 22.0007 12 22ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z",fill:null!=t?t:"#000"})})},eR=e=>{let{text:t,className:n,position:a="center"}=e,i="absolute bottom-5 max-w-[220px] font-sans text-xs font-medium text-white text-left p-2 transition-opacity bg-gray-600 border rounded opacity-0 pointer-events-none bottom border-slate-400 w-max group-hover:opacity-100 ".concat((()=>{switch(a){case"left":return"right-2";case"center":return"left-1/2 transform -translate-x-1/2";default:return"left-2"}})());return(0,l.jsxs)("div",{className:"relative group w-max ".concat(n),children:[(0,l.jsx)(eF,{className:"w-[18px] h-[18px]",fill:"#9CA3AF"}),(0,l.jsx)("span",{className:i,children:t})]})},eY=e=>{let{usycAmount:t,collateral:n}=e,{chainId:a,networkId:i,priceDecimals:s}=R(),{data:r}=k()({address:j[n][i],abi:I,functionName:"sellPreview",chainId:a,args:[null!=t?t:BigInt(0)]}),l=(null==r?void 0:r[0])||BigInt(0),d=(null==r?void 0:r[1])||BigInt(0),o=(null==r?void 0:r[2])||BigInt(0);return{fees:d,usycAmount:t,stablecoinPayout:l,usycPrice:o,usycToStablecoinPrice:o?10n**(2n*s)/o:0n}},eP=e=>{let{inputCurrency:t,outputCurrency:n,inputTokenBalance:a,inputTokenBalanceDecimals:i,inputToOutputConversion:s,outputToInputConversion:r,setInputAmount:d,outputAmount:u,onRedeemTokenChange:p,showConfirmationScreen:c}=e,{collaterals:m}=R(),[y,x]=(0,o.useState)(""),[f,h]=(0,o.useState)(!1),b=()=>{x((0,P.b)(a,i)),d(a)},[v,g]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{g(!0)},[]),(0,o.useEffect)(()=>{c&&(x(""),d(BigInt(0)))},[c,d]),(0,l.jsxs)("div",{className:"flex flex-col pt-6 pb-3",children:[(0,l.jsxs)("div",{className:"flex flex-col w-full gap-5 p-5 border border-gray-200 rounded",children:[(0,l.jsxs)("div",{className:"flex flex-row justify-between text-sm font-medium text-gray-500",children:[(0,l.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,l.jsx)("span",{children:"Balance"}),(0,l.jsx)("div",{className:"hover:cursor-pointer hover:text-white hover:bg-gray-400 text-gray-500 text-xs font-bold leading-none h-5 px-2 py-0.5 rounded-[20px] border border-gray-400",onClick:()=>b(),children:"MAX"})]}),(0,l.jsx)("span",{className:"font-inter",children:(0,P.b)(a,i)})]}),(0,l.jsxs)("div",{className:"flex flex-row justify-between pb-2",children:[(0,l.jsxs)("div",{className:"flex flex-row justify-center",children:[(0,l.jsx)("div",{className:"hidden w-6 h-6 sm:block",children:(0,l.jsx)($,{currency:t,width:24,height:24})}),(0,l.jsx)("div",{className:"mr-2 font-medium text-gray-800 sm:ml-1 text-md sm:text-xl",children:t})]}),(0,l.jsx)("div",{children:(0,l.jsx)("input",{type:"text",className:"w-full font-medium text-right text-gray-800 placeholder-gray-400 bg-transparent border-0 text-md sm:text-xl font-inter focus:outline-none focus:ring-0",placeholder:"0.00",value:y,onChange:e=>{let t=e.target.value;/^\d*\.?\d{0,8}$/.test(t)&&t.length<=18&&(x(t),d((0,Q.v)(t,i)))}})})]})]}),(0,l.jsx)("div",{className:"relative flex items-center justify-center h-2",children:(0,l.jsx)(X,{})}),(0,l.jsxs)("div",{className:"flex flex-col w-full gap-5 p-5 border border-gray-200 rounded",children:[(0,l.jsx)(eo,{collateral:n,usycPrice:s,usycToStablecoin:r}),(0,l.jsxs)("div",{className:"flex flex-row justify-between pb-2",children:[(0,l.jsx)(en,{onChange:p,value:n,collaterals:m}),(0,l.jsx)("div",{children:(0,l.jsx)("div",{className:"w-full font-medium text-right text-gray-800 placeholder-gray-400 bg-transparent border-0 text-md sm:text-xl font-inter focus:outline-none focus:ring-0",children:(0,P.b)(u,6).toString()})})]})]})]})},eH=e=>{var t,n,a,i;let{onCollateralChange:s}=e,{defaultCollateralSymbol:r,chainId:d,networkId:u}=R(),[p,c]=(0,o.useState)(BigInt(0)),[m,y]=(0,o.useState)(!1),[x,f]=(0,o.useState)(r),{address:h}=(0,M.mA)(),b=T[u],v=(0,M.KQ)({address:h,token:b,chainId:d,watch:!0}),{isConnected:g}=G(),{fees:w,stablecoinPayout:j,usycPrice:N,usycToStablecoinPrice:C}=eY({usycAmount:p,collateral:x});return(0,o.useEffect)(()=>{s(x)},[x,s]),(0,o.useEffect)(()=>{f(r)},[d,r]),(0,l.jsxs)("div",{className:"relative flex flex-col px-6",children:[m&&(0,l.jsxs)(K,{onClose:()=>y(!1),children:[(0,l.jsx)(z,{}),(0,l.jsx)("div",{className:"font-bold",children:" USYC Token Redeemed!"})]}),(0,l.jsx)(eP,{inputCurrency:"USYC",outputCurrency:x,inputTokenBalance:null!==(a=null===(t=v.data)||void 0===t?void 0:t.value)&&void 0!==a?a:BigInt(0),inputTokenBalanceDecimals:6,inputToOutputConversion:C,outputToInputConversion:N,setInputAmount:c,outputAmount:j,onRedeemTokenChange:e=>f(e),showConfirmationScreen:m}),g&&(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsxs)("div",{className:"flex flex-row justify-between w-full pb-3 text-sm text-black",children:[(0,l.jsxs)("div",{className:"flex flex-row gap-1",children:["Total Amount Before Fees",(0,l.jsx)(eR,{position:"center",text:"This amount is the total amount of ".concat(x," redeemed before fees are deducted.")})]}),(0,l.jsxs)("div",{className:"text-right font-azeret",children:[er(j+w,6)," ",x]})]}),(0,l.jsxs)("div",{className:"flex flex-row justify-between w-full pb-3 text-sm text-black",children:[(0,l.jsxs)("div",{className:"flex flex-row gap-1",children:["Fees","USDC"===x&&(0,l.jsx)(eR,{position:"right",text:"A 0.10% fee is deducted from the total amount of USDC redeemed."}),"PYUSD"===x&&(0,l.jsx)(eR,{position:"right",text:"There are no fees for redeeming via PYUSD."})]}),(0,l.jsxs)("div",{className:"text-right font-azeret",children:[er(w,6)," ",x]})]})]}),(0,l.jsx)(eL,{mode:"sell",buyOrSellAmount:p,collateralToken:x,chainID:d,showConfirmationScreen:y,expectedOutputAmount:j+w,spendingBalance:null!==(i=null===(n=v.data)||void 0===n?void 0:n.value)&&void 0!==i?i:BigInt(0)})]})},eW=()=>{let[e,t]=(0,o.useState)("PYUSD"),[n,a]=(0,o.useState)(!1),[i,s]=(0,o.useState)("fund"),r=e=>{s(e)},{isAfterHoursPrice:d,isLoading:u}=W(e),{nextPrice:p}=H(),[c,m]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{m(!0)},[]),q(),(0,l.jsxs)("div",{className:"bg-white rounded-xl flex-col flex max-w-[468px] md:w-[468px] w-full py-6 relative [@media(min-width:520px)]:border border-gray-200",children:[(0,l.jsxs)("div",{className:"flex flex-col w-full px-6 border-b",children:[(0,l.jsxs)("div",{className:"flex flex-row items-start justify-between w-full",children:[(0,l.jsx)("div",{className:"text-2xl font-bold text-trust",children:"Invest in USYC"}),(0,l.jsx)(v.ebp,{innerButtonComponent:(0,l.jsx)("button",{children:"Connect your wallet"}),buttonClassName:"button--padding-small",variant:"modal"})]}),(0,l.jsxs)("div",{className:"flex flex-row w-full gap-6 mt-6 font-medium text-gray-800",children:[(0,l.jsx)("div",{className:"pb-2 px-1 hover:cursor-pointer ".concat("fund"===i?"border-b-2 border-black":""),onClick:()=>r("fund"),children:"Fund"}),(0,l.jsx)("div",{className:"pb-2 px-1 hover:cursor-pointer ".concat("redeem"===i?"border-b-2 border-black":""),onClick:()=>r("redeem"),children:"Redeem"})]})]}),"fund"===i?(0,l.jsx)(eU,{onCollateralChange:t}):"redeem"===i?(0,l.jsx)(eH,{onCollateralChange:t}):null,n&&(0,l.jsx)(b,{onClose:()=>a(!1)}),(0,l.jsx)("div",{className:"flex flex-row w-full gap-3 px-6 mt-6 text-xs font-medium ",children:"fund"===i&&(c?u?(0,l.jsx)("div",{className:"w-24 h-4 bg-gray-300 rounded animate-pulse"}):d?(0,l.jsx)(l.Fragment,{children:p&&(0,l.jsxs)("span",{className:"text-emerald-600",children:["After Hours Price: $",p]})}):null:(0,l.jsx)("div",{className:"w-24 h-4 bg-gray-300 rounded animate-pulse"}))})]})},eG=e=>{let{children:t}=e;return(0,l.jsx)("div",{className:"flex inline-flex items-center text-gray-600 text-sm font-medium leading-tight",children:t})},eq=e=>{let{children:t}=e;return(0,l.jsx)("div",{className:"text-gray-800 text-2xl font-medium font-azeret",children:t})},eK=e=>{var t;let{usycStats:n,chainID:a}=e,i=eE({chainId:a}),s=B(a),[r,d]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{d(!0)},[]),(0,l.jsxs)("div",{className:"grid w-full grid-cols-1 gap-6 md:grid-cols-2",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(eG,{children:"Assets Under Management"}),(0,l.jsx)(eq,{children:r&&n?n.total_aum?"$"+el(n.total_aum):"---":(0,l.jsx)("div",{className:"w-full h-6 mt-1 bg-gray-300 rounded animate-pulse"})})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",title:null!==(t=null==n?void 0:n.latest_price)&&void 0!==t?t:"",children:[(0,l.jsx)(eG,{children:"USYC Price"}),(0,l.jsx)(eq,{children:r&&n?n.latest_price?"$"+es(n.latest_price,{maxDisplayDecimals:6}):"---":(0,l.jsx)("div",{className:"w-full h-6 mt-1 bg-gray-300 rounded animate-pulse"})})]}),r?w[s].map(e=>{var t,n,a,s,r,d;return(null===(n=i[e])||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.value)!==void 0&&(null===(s=i[e])||void 0===s?void 0:null===(a=s.data)||void 0===a?void 0:a.value)>BigInt(0)?(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)(eG,{children:["Instant Redemption Capacity",(0,l.jsxs)("div",{className:"flex flex-row gap-1 bg-gray-100 rounded justify-center ml-1 px-1.5 py-1",children:[(0,l.jsx)($,{currency:e.toLowerCase(),width:14,height:14}),(0,l.jsx)("div",{className:"text-xs",children:e.toUpperCase()})]})]}),(0,l.jsx)(eq,{children:"$"+er(null===(d=i[e])||void 0===d?void 0:null===(r=d.data)||void 0===r?void 0:r.value,6).match(/^[\d,]+(?:\.\d{0,2})?/)})]},"teller-capacity-".concat(e)):null}):null,(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)(eG,{children:["Est. Yield (Net of Fees)",(0,l.jsx)(eR,{className:"pl-1",text:"Five day average historical annualized yield net of fees.",position:"right"})]}),(0,l.jsx)(eq,{children:r&&n?n.estimated_yield?es(n.estimated_yield,{maxDisplayDecimals:3})+"%":"---":(0,l.jsx)("div",{className:"w-full h-6 mt-1 bg-gray-300 rounded animate-pulse"})})]})]})},ez=e=>{let{networkId:t}=e,[n,a]=(0,o.useState)([]),[i,s]=(0,o.useState)(null);return(0,o.useEffect)(()=>{(async()=>{try{let e=await fetch(ew[t],{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({query:"{\n  yieldCoinReports(first: 1000) {\n    id\n    timestamp\n    decimals\n    price\n  }\n}"})});if(!e.ok)throw Error("Network request failed");let n=(await e.json()).data.yieldCoinReports||[];a(n)}catch(e){console.error("Error fetching data:",e),s("Error fetching data")}})()},[t]),{data:n,error:i}};var eV=n(93227),e$=n(3229),eX=n(45975),eQ=n(23248),eZ=n(88576),eJ=n(53436),e0=n(13540);let e1=e=>{let{x:t,y:n,payload:a}=e;return(0,l.jsx)("g",{transform:"translate(".concat(t,",").concat(n,")"),children:(0,l.jsxs)("text",{x:-6,y:-8,dy:0,textAnchor:"start",className:"text-sm tabular-nums",fill:"#4B5563",children:["$",parseFloat(a.value).toFixed(4)]})})},e2=e=>{let{payload:t}=e;return t&&t[0]?(0,l.jsxs)("div",{className:"flex w-full gap-3 p-3 bg-white border border-gray-400 rounded opacity-95",children:[(0,l.jsx)("div",{className:"text-xs font-normal text-gray-500",children:m()(1e3*t[0].payload.timestamp).format("MMM DD, YYYY")}),(0,l.jsxs)("div",{className:"text-xs text-right text-gray-800 font medium font-azeret",children:["$",t[0].payload.price]})]}):null},e6=e=>{let{x:t,y:n,payload:a}=e;return(0,l.jsx)("g",{transform:"translate(".concat(t,",").concat(n,")"),children:(0,l.jsx)("text",{y:20,textAnchor:"middle",className:"text-xs font-medium font-inter",fill:"#9CA3AF",children:m()(1e3*a.value).format("MMM DD")})})},e5=e=>{let{data:t}=e;return(0,l.jsx)("div",{className:"w-full h-full min-h-[350px] pt-8",children:(0,l.jsx)(eV.h,{width:"100%",height:"100%",children:(0,l.jsxs)(e$.w,{data:t,margin:{top:20,right:8,left:-44,bottom:10},children:[(0,l.jsx)(eX.K,{dataKey:"timestamp",type:"number",domain:["dataMin","dataMax"],minTickGap:75,tick:(0,l.jsx)(e6,{}),tickCount:40,interval:"preserveEnd",tickFormatter:e=>m()(1e3*e).format("MMM DD")}),(0,l.jsx)(eQ.B,{axisLine:!1,dataKey:"price",domain:[e=>.005*Math.floor(e/.005),e=>.005*Math.ceil(e/.005)],interval:"preserveStartEnd",includeHidden:!0,tick:(0,l.jsx)(e1,{}),tickCount:6,tickLine:!1}),(0,l.jsx)(eZ.u,{content:(0,l.jsx)(e2,{})}),(0,l.jsx)(eJ.q,{vertical:!1}),(0,l.jsx)(e0.x,{type:"monotone",dataKey:"price",stroke:"#0369A1",strokeWidth:2,activeDot:{stroke:"#0369A1",fill:"white",strokeWidth:2,r:5},dot:!1})]})})})},e3=e=>{let{tabs:t,className:n}=e,[a,i]=(0,o.useState)(t.length-1),s=e=>{i(e),t[e].onClick()};return(0,l.jsx)("div",{className:"flex items-start justify-start gap-2 ".concat(n),children:t.map((e,t)=>(0,l.jsx)("div",{onClick:()=>s(t),className:"".concat(t===a?"bg-steelbg border border-steel font-bold":"hover:bg-steelbg font-medium"," h-7 px-3 py-1.5 rounded justify-center items-center gap-2.5 flex hover:cursor-pointer"),children:(0,l.jsx)("div",{className:"text-xs leading-none text-gray-800",children:e.label})},t))})},e7=e=>{let{}=e;return(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:(0,l.jsx)("path",{d:"M4.93766 3.28768H10.7124M10.7124 3.28768V9.06239M10.7124 3.28768L3.28774 10.7123",stroke:"#059669",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},e8=e=>{let{usycStats:t,chainID:n}=e,{data:a}=ez({networkId:"0x1"}),[i,s]=(0,o.useState)(0),r=e=>{switch(e){case"1W":s(m()().subtract(1,"week").unix());break;case"1M":s(m()().subtract(1,"month").unix());break;case"3M":s(m()().subtract(3,"month").unix());break;case"1Y":s(m()().subtract(1,"year").unix());break;case"ALL":s(0)}},d=null==a?void 0:a.filter(e=>e.timestamp>=i).sort((e,t)=>e.timestamp-t.timestamp);return(0,l.jsxs)("div",{className:"grid w-full grid-cols-2",children:[(0,l.jsxs)("div",{className:"flex flex-col order-1 w-full col-span-2 gap-2 lg:col-span-1",children:[(0,l.jsx)(eG,{children:"Token Price"}),(0,l.jsx)(eq,{children:t?(0,l.jsxs)("div",{className:"flex flex-row items-center gap-3 text-xl",children:[t.latest_price?"$"+es(t.latest_price,{maxDisplayDecimals:6}):"---",(0,l.jsxs)("div",{className:"bg-emerald-50 rounded gap-0.5 items-center inline-flex px-1",children:[(0,l.jsx)(e7,{}),(0,l.jsx)("div",{className:"text-sm text-emerald-600 font-azeret",children:d&&d.length>=2?(0,l.jsxs)("div",{children:[((d[d.length-1].price-d[0].price)/d[0].price*100).toFixed(2),"%"]}):(0,l.jsx)("div",{children:"0.00%"})})]})]}):(0,l.jsx)("div",{className:"w-full h-6 mt-1 bg-gray-300 rounded animate-pulse max-w-[306px]"})})]}),(0,l.jsx)("div",{className:"flex justify-center order-last w-full col-span-2 pt-4 lg:pt-0 lg:justify-end lg:col-span-1 lg:order-2",children:(0,l.jsx)(e3,{tabs:[{label:"1W",onClick:()=>r("1W")},{label:"1M",onClick:()=>r("1M")},{label:"3M",onClick:()=>r("3M")},{label:"1Y",onClick:()=>r("1Y")},{label:"ALL",onClick:()=>r("ALL")}]})}),(0,l.jsx)("div",{className:"order-3 w-full col-span-2",children:(0,l.jsx)(e5,{data:d})})]})},e4=()=>{let[e,t]=(0,o.useState)(null),[n,a]=(0,o.useState)(null);return(0,o.useEffect)(()=>{(async()=>{try{let e=await fetch("https://api.hashnote.com/v1/usyc/stats",{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}});if(!e.ok)throw Error("GET USYC stats request failed");let n=(await e.json()).data;t(n)}catch(e){console.error("Error fetching data:",e),a("Error fetching data")}})()},[]),{data:e,error:n}};var e9=n(7578);let te=(0,l.jsxs)("div",{className:"p-4 text-red-500 bg-red-100 rounded",children:[(0,l.jsx)("p",{children:"Something went wrong."}),(0,l.jsxs)("p",{children:["Please contact us at"," ",(0,l.jsx)("a",{href:"mailto:support@hashnote.com",className:"text-blue-500 cursor-pointer",children:"support@hashnote.com"})," ","if you need further assistance."]})]});var tt=e=>{let{children:t,fallback:n}=e;return(0,l.jsx)(e9.SV,{fallback:n||te,onError:(e,t)=>{console.error("ErrorBoundary caught an error",e,t)},children:t})},tn=()=>(0,l.jsxs)("div",{className:"bg-white rounded-xl flex-col flex max-w-[468px] md:w-[468px] w-full py-6 relative [@media(min-width:520px)]:border border-gray-200",children:[(0,l.jsx)("div",{className:"flex flex-col w-full px-6 border-b",children:(0,l.jsx)("div",{className:"flex flex-row items-start justify-between w-full pb-4",children:(0,l.jsx)("div",{className:"text-2xl font-bold text-trust",children:"Invest in USYC"})})}),(0,l.jsxs)("div",{className:"p-6 text-center",children:[(0,l.jsx)("h2",{className:"text-xl font-bold text-red-600",children:"An error has occured."}),(0,l.jsx)("p",{className:"mt-4 text-gray-700",children:"The USYC Teller widget is currently unavailable."}),(0,l.jsxs)("p",{className:"mt-4 text-gray-700",children:["Please try again later or contact us at"," ",(0,l.jsx)("a",{href:"mailto: support@hashnote.com",className:"text-blue-500 cursor-pointer",children:"support@hashnote.com"})," ","if the issue persists."]})]})]});let ta=()=>{let{chainId:e}=R(),{data:t}=e4();return(0,l.jsxs)("div",{className:"flex flex-col max-w-[1248px] items-center w-full py-8 px-6",children:[(0,l.jsxs)("div",{className:"flex flex-row items-center w-full mb-5",children:[(0,l.jsx)(d.default,{src:"usyc.svg",alt:"USYC Logo",width:36,height:36}),(0,l.jsx)("p",{className:"ml-2 text-4xl font-bold text-gray-800",children:"USYC"}),(0,l.jsx)("div",{className:"ml-5 text-xl font-bold text-gray-800",children:"Hashnote US Yield Coin"})]}),(0,l.jsxs)("div",{className:"flex flex-col w-full lg:flex-row",children:[(0,l.jsxs)("div",{className:"flex flex-col items-start flex-grow w-full",children:[(0,l.jsx)("div",{className:"w-full p-6 bg-white border border-gray-200 rounded-xl",children:(0,l.jsx)(eK,{usycStats:t,chainID:e})}),(0,l.jsx)("div",{className:"w-full p-6 mt-6 mb-6 bg-white border border-gray-200 lg:mb-0 rounded-xl",children:(0,l.jsx)(e8,{usycStats:t,chainID:e})})]}),(0,l.jsx)("div",{className:"flex flex-col items-center lg:w-fit lg:pl-6 lg:items-end w-full [@media(min-width:520px)]:mb-6 mb-0 lg:mb-0",children:(0,l.jsx)(o.Suspense,{fallback:(0,l.jsx)("div",{className:"h-[530px] items-center justify-center bg-white rounded-xl flex-col flex max-w-[468px] md:w-[468px] w-full py-6 relative [@media(min-width:520px)]:border border-gray-200",children:(0,l.jsx)("div",{children:(0,l.jsx)(em,{})})}),children:(0,l.jsx)(tt,{fallback:(0,l.jsx)(tn,{}),children:(0,l.jsx)(eW,{})})})})]})]})}},82333:function(e,t,n){"use strict";n.d(t,{InfoTabManager:function(){return m}});var a=n(51627),i=n(13789);let s=e=>{let{tabs:t,activeTab:n,onTabClick:i}=e;return(0,a.jsx)("div",{className:"flex flex-row w-full gap-4 pb-3 text-sm border-b-2 border-gray-200 px-7 sm:gap-8 sm:text-base",children:t.map(e=>(0,a.jsx)("div",{onClick:()=>i(e.key),className:"hover:cursor-pointer ".concat(n===e.key&&"font-bold"),children:e.label},e.key))})};var r=n(91379),l=n(44170);let d={renderNode:{[l.BLOCKS.EMBEDDED_ASSET]:e=>(0,a.jsx)("img",{src:"https://".concat(e.data.target.fields.file.url),height:e.data.target.fields.file.details.image.height,width:e.data.target.fields.file.details.image.width,alt:e.data.target.fields.description})}},o=e=>{let{content:t}=e;return(0,a.jsx)("div",{className:"flex flex-col w-full px-7",children:t.map((e,t)=>(0,a.jsxs)("div",{className:"relative pt-8 contentful-item",children:[e.fields.indentTitle&&(0,a.jsx)("div",{className:"w-1.5 h-6 bg-steel absolute -left-4"}),(0,a.jsx)("div",{className:"mb-4 font-bold",children:e.fields.sectionTitle}),(0,a.jsxs)("div",{className:"grid grid-cols-1 text-sm md:grid-cols-2",children:[(0,a.jsx)("div",{className:e.fields.showRightColumn?"space-y-2 col-span-1 border-spacing-1 md:mr-16":"space-y-2 col-span-1 md:col-span-2 border-spacing-1",children:(0,r.h)(e.fields.leftColumn)}),e.fields.showRightColumn&&(0,a.jsx)("div",{className:"col-span-1 mt-4 space-y-2 md:mt-0 border-spacing-1",children:(0,r.h)(e.fields.rightColumn,d)})]})]},t))})},u={renderNode:{[l.BLOCKS.EMBEDDED_ASSET]:e=>(0,a.jsx)("img",{src:"https://".concat(e.data.target.fields.file.url),height:e.data.target.fields.file.details.image.height,width:e.data.target.fields.file.details.image.width,alt:e.data.target.fields.description})}},p=e=>{let{content:t}=e;return(0,a.jsx)("div",{className:"flex flex-col w-full px-7",children:t.map((e,n)=>(0,a.jsxs)("div",{className:"relative pt-8 contentful-item",children:[e.fields.indentTitle&&(0,a.jsx)("div",{className:"w-1.5 h-6 bg-slate-400 absolute -left-4"}),(0,a.jsx)("div",{className:"mb-4 font-bold",children:e.fields.sectionTitle}),(0,a.jsxs)("div",{className:"grid grid-cols-1 text-sm md:grid-cols-2",children:[(0,a.jsx)("div",{className:e.fields.showRightColumn?"space-y-2 col-span-1 border-spacing-1 md:break-normal break-words [overflow-wrap:anywhere]":"space-y-2 col-span-1 md:col-span-2 border-spacing-1 md:break-normal break-words [overflow-wrap:anywhere]",children:(0,r.h)(e.fields.leftColumn)}),e.fields.showRightColumn&&(0,a.jsx)("div",{className:"col-span-1 mt-4 space-y-2 md:ml-4 md:mt-0 border-spacing-1",children:(0,r.h)(e.fields.rightColumn,u)})]}),n<t.length-1&&(0,a.jsx)("hr",{className:"mt-4"})]},n))})},c=e=>{let{tab:t,content:n}=e,i=n.filter(e=>e.fields.tab===t).sort((e,t)=>e.fields.order-t.fields.order);return"specifications"===t?(0,a.jsx)(p,{content:i}):(0,a.jsx)(o,{content:i})},m=e=>{let{content:t}=e,[n,r]=(0,i.useState)("overview");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s,{tabs:[{label:"Overview",key:"overview"},{label:"Fund/Redeem",key:"subscribe_redeem"},{label:"Specifications",key:"specifications"}],activeTab:n,onTabClick:r}),(0,a.jsx)(c,{tab:n,content:t})]})}}},function(e){e.O(0,[792,276,993,961,215,307,544,882,744],function(){return e(e.s=89783)}),_N_E=e.O()}]);