(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6366],{56177:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/app",function(){return t(91519)}])},99415:function(e,a,t){"use strict";t.d(a,{G:function(){return MetaHeader}});var s=t(85893),n=t(9008),r=t.n(n);t(67294);let i="https://".concat("frontend-nextjs-iiwwcd6hs-basixs-projects.vercel.app","/"),MetaHeader=e=>{let{title:a="Basix",description:t="Basix",image:n="logo-nobg.png",twitterCard:l="summary_large_image",children:d}=e,c=i+n;return(0,s.jsxs)(r(),{children:[a&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("title",{children:a}),(0,s.jsx)("meta",{property:"og:title",content:a}),(0,s.jsx)("meta",{name:"twitter:title",content:a})]}),t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("meta",{name:"description",content:t}),(0,s.jsx)("meta",{property:"og:description",content:t}),(0,s.jsx)("meta",{name:"twitter:description",content:t})]}),n&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("meta",{property:"og:image",content:c}),(0,s.jsx)("meta",{name:"twitter:image",content:c})]}),l&&(0,s.jsx)("meta",{name:"twitter:card",content:l}),(0,s.jsx)("link",{rel:"icon",type:"image/x-icon",sizes:"32x32",href:"/favicon.ico"}),d]})}},90956:function(e,a,t){"use strict";t.d(a,{S:function(){return init},j:function(){return animate}});var s,n,r,i,l,d=0;function init(){let e=document.getElementById("wave");e&&(e.className+=e.className?" waves":"waves"),(s=new THREE.PerspectiveCamera(120,window.innerWidth/window.innerHeight,1,1e4)).position.y=150,s.position.z=300,s.rotation.x=.35,n=new THREE.Scene,i=[];for(var a=2*Math.PI,t=new THREE.SpriteCanvasMaterial({color:9671571,program:function(e){e.beginPath(),e.arc(0,0,.1,0,a,!0),e.fill()}}),d=0,c=0;c<130;c++)for(var o=0;o<35;o++)(l=i[d++]=new THREE.Sprite(t)).position.x=40*c-2600,l.position.z=40*o-1390,n.add(l);r=window.WebGLRenderingContext?new THREE.WebGLRenderer({alpha:!0,antialias:!0}):new THREE.CanvasRenderer,(r=new THREE.CanvasRenderer).setSize(window.innerWidth,window.innerHeight),r.setClearColor(592139,1),e.appendChild(r.domElement),window.addEventListener("resize",onWindowResize,!1)}function onWindowResize(){window.innerWidth,window.innerHeight,window.innerWidth,window.innerHeight,s.aspect=window.innerWidth/window.innerHeight,s.updateProjectionMatrix(),r.setSize(window.innerWidth,window.innerHeight)}function animate(){requestAnimationFrame(animate),function(){for(var e=0,a=0;a<130;a++)for(var t=0;t<35;t++)(l=i[e++]).position.y=20*Math.sin((a+d)*.5)+20*Math.sin((t+d)*.5),l.scale.x=l.scale.y=(Math.sin((a+d)*.3)+2)*4+(Math.sin((t+d)*.5)+1)*4;r.render(n,s),window.innerWidth<768?d+=.02:d+=.04}()}},17921:function(e,a,t){"use strict";t.d(a,{D:function(){return Title}});var s=t(85893),n=t(25675),r=t.n(n),i=t(41664),l=t.n(i),d=t(67294);function Title(){let[e,a]=(0,d.useState)(!1);return(0,s.jsx)(l(),{href:"/",children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 md:flex-row",children:[(0,s.jsx)(r(),{src:"/logo-nobg.png",alt:"logo",width:60,height:60}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold md:text-4xl major-mono",children:"Basix"}),(0,s.jsxs)("div",{className:"relative flex flex-col items-center",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,s.jsxs)("div",{className:"bg-green-100 text-green-800 text-xs font-semibold mt-2 px-2.5 py-0.5 rounded",children:["USDX APY ",7.4.toFixed(1),"%"]}),e&&(0,s.jsxs)("div",{className:"absolute top-full mt-2 flex w-auto min-w-[10rem] justify-center rounded-md bg-black bg-opacity-75 px-3 py-2 text-xs text-white shadow-md",children:["Trailing 5-day average protocol returns. Past performance does not guarantee future results.",(0,s.jsx)("div",{className:"absolute -top-2 h-0 w-0 border-x-transparent border-x-8 border-b-black border-b-8"})]})]})]})]})})}},91519:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return app}});var s=t(85893),n=t(91094),r=t(41664),i=t.n(r),l=t(11163),d=t(67294),c=t(69077),o=t(90956),m=t(50065),u=t(89465),x=t(82917);let f=d.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,s.jsx)("div",{ref:a,className:(0,x.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",t),...n})});f.displayName="Card";let p=d.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,s.jsx)("div",{ref:a,className:(0,x.cn)("flex flex-col space-y-1.5 p-6",t),...n})});p.displayName="CardHeader";let h=d.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,s.jsx)("h3",{ref:a,className:(0,x.cn)("text-2xl font-semibold leading-none tracking-tight",t),...n})});h.displayName="CardTitle";let N=d.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,s.jsx)("p",{ref:a,className:(0,x.cn)("text-sm text-muted-foreground",t),...n})});N.displayName="CardDescription";let g=d.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,s.jsx)("div",{ref:a,className:(0,x.cn)("p-6 pt-0",t),...n})});g.displayName="CardContent";let w=d.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,s.jsx)("div",{ref:a,className:(0,x.cn)("flex items-center p-6 pt-0",t),...n})});w.displayName="CardFooter";let j=d.forwardRef((e,a)=>{let{className:t,type:n,...r}=e;return(0,s.jsx)("input",{type:n,className:(0,x.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:a,...r})});j.displayName="Input";var v=t(42870);function Deposit(){let{address:e}=(0,c.mA)(),[a,t]=(0,d.useState)(""),{data:n}=(0,v.z2)({contractName:"USDXVault"}),{data:r,refetch:i}=(0,v.uT)({contractName:"USDXVault",functionName:"balanceOf",args:[e]}),{data:l}=(0,v.uT)({contractName:"USDXVault",functionName:"previewDeposit",args:[(0,x.H2)(a)]}),{data:o}=(0,v.uT)({contractName:"USDXVault",functionName:"previewDeposit",args:[(0,x.H2)("1")]}),{data:m}=(0,v.uT)({contractName:"USDC",functionName:"balanceOf",args:[e]}),{data:p,refetch:h}=(0,v.uT)({contractName:"USDC",functionName:"allowance",args:[e,null==n?void 0:n.address]}),{writeAsync:N,isLoading:b}=(0,v.u9)({contractName:"USDC",functionName:"approve",args:[null==n?void 0:n.address,(0,x.H2)(a)]}),{writeAsync:y,isLoading:S}=(0,v.u9)({contractName:"USDXVault",functionName:"deposit",args:[(0,x.H2)(a),e]});return(0,s.jsxs)(f,{className:"mt-8 w-full md:w-[440px]",children:[(0,s.jsx)(g,{className:"p-6",children:(0,s.jsxs)("div",{className:"flex flex-col space-y-6 text-[#e0e0e0]",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("label",{className:"text-sm font-medium",htmlFor:"from",children:"You're staking USDC"}),(0,s.jsxs)("span",{className:"text-sm",children:["Balance: ",(0,x.NI)(m||0)," USDC"]})]}),(0,s.jsxs)("div",{className:"relative mt-2",children:[(0,s.jsx)(j,{className:"text-white",id:"from",placeholder:"0.0",value:a,type:"number",onChange:e=>t(e.target.value),autoComplete:"off",required:!0,autoFocus:!0}),(0,s.jsx)(u.z,{className:"absolute right-2 top-1 h-8",variant:"secondary",onClick:()=>t((0,x.NI)(m)),disabled:!m,children:"Max"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("label",{className:"text-sm font-medium",htmlFor:"to",children:"To receive USDX"}),(0,s.jsxs)("span",{className:"text-sm",children:["Balance: ",(0,x.NI)(r||0)," USDX"]})]}),(0,s.jsx)(j,{className:"mt-2 text-white",id:"to",placeholder:"0.0",type:"number",value:(0,x.NI)(l),autoComplete:"off",disabled:!0})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("div",{className:"text-gray-400",children:"1 USDC"}),(0,s.jsxs)("div",{className:"text-right",children:["≈ ",(0,x.NI)(o)," USDx"]})]})]})}),(0,s.jsx)(w,{className:"flex justify-center",children:e?p&&Number(p)>=1e6*Number(a)?(0,s.jsx)(u.z,{className:"w-full",onClick:async()=>{await y(),await i()},disabled:!a,busy:S,children:"Deposit USDC"}):(0,s.jsx)(u.z,{className:"w-full",disabled:!a,onClick:async()=>{await N(),await h()},busy:b,children:"Approve spending USDC"}):(0,s.jsx)(u.z,{className:"w-full px-4 text-base font-bold",onClick:()=>{var e;return null===(e=document.getElementById("connect-wallet-button"))||void 0===e?void 0:e.click()},children:"Connect Wallet"})})]})}var b=t(27484),y=t.n(b),S=t(10285),D=t.n(S),C=t(1646),U=t.n(C),k=t(66607),R=t.n(k),T=t(7124),X=t.n(T),E=t(56176),V=t.n(E),z=t(37181),H=t.n(z),I=t(84110),A=t.n(I),F=t(29387),L=t.n(F),M=t(33360),O=t.n(M),W=t(70178),_=t.n(W);y().extend(D()),y().extend(R()),y().extend(X()),y().extend(V()),y().extend(A()),y().extend(L()),y().extend(O()),y().extend(_()),y().extend(H()),y().extend(U());var B=y();function Withdraw(){let{address:e}=(0,c.mA)(),[a,t]=(0,d.useState)(""),{data:n}=(0,v.z2)({contractName:"USDXVault"}),{data:r}=(0,v.uT)({contractName:"USDXVault",functionName:"balanceOf",args:[e]}),{data:i,refetch:l}=(0,v.uT)({contractName:"USDXVault",functionName:"allowance",args:[e,null==n?void 0:n.address]}),{data:o}=(0,v.uT)({contractName:"USDXVault",functionName:"previewRedeem",args:[(0,x.H2)(a)]}),{data:m}=(0,v.uT)({contractName:"USDXVault",functionName:"previewRedeem",args:[(0,x.H2)("1")]}),{data:p}=(0,v.uT)({contractName:"USDC",functionName:"balanceOf",args:[e]}),{data:h=[],refetch:N}=(0,v.uT)({contractName:"USDXVault",functionName:"getRedeemRequestsByAddress",args:[e]}),{data:b=0}=(0,v.uT)({contractName:"USDXVault",functionName:"redeemDelay",args:[]}),{writeAsync:y,isLoading:S}=(0,v.u9)({contractName:"USDXVault",functionName:"redeem",args:[(0,x.H2)(a),e,e]}),{writeAsync:D,isLoading:C}=(0,v.u9)({contractName:"USDXVault",functionName:"initiateRedeem",args:[(0,x.H2)(a),e,e]}),{writeAsync:U,isLoading:k}=(0,v.u9)({contractName:"USDXVault",functionName:"approve",args:[null==n?void 0:n.address,(0,x.H2)(a)]}),R=(h||[]).filter(e=>!e.executed)[0],{writeAsync:T,isLoading:X}=(0,v.u9)({contractName:"USDXVault",functionName:"executeRedeem",args:[null==R?void 0:R.id]}),E=(h||[]).filter(e=>!e.executed).length>0,V=B((Number((null==R?void 0:R.timestamp)||0)+Number(b||0))*1e3).diff(B());return(0,s.jsxs)(f,{className:"mt-8 w-full md:w-[440px]",children:[(0,s.jsx)(g,{className:"p-6",children:E?(()=>{if(!E)return(0,s.jsx)(s.Fragment,{});let e=B.duration(V).humanize(),a=V>0?"You can claim your unstake reward of ".concat((0,x.NI)(R.shares)," USDX in ").concat(e):"You can claim your USDC now";return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("span",{children:"Current USDX balance"}),(0,s.jsxs)("span",{children:[(0,x.NI)(r||0)," USDX"]})]}),(0,s.jsxs)("div",{className:"mt-3 flex justify-between",children:[(0,s.jsx)("span",{children:"Outstanding withdrawal amount"}),(0,s.jsxs)("span",{children:[(0,x.NI)(R.shares)," USDX"]})]}),(0,s.jsx)("div",{className:"mt-8",children:a})]})})():(0,s.jsxs)("div",{className:"flex flex-col space-y-6 text-[#e0e0e0]",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("label",{className:"text-sm font-medium",htmlFor:"from",children:"You're unstaking"}),(0,s.jsxs)("span",{className:"text-sm",children:["Balance: ",(0,x.NI)(r||0)," USDX"]})]}),(0,s.jsxs)("div",{className:"relative mt-2",children:[(0,s.jsx)(j,{className:"text-white",id:"from",placeholder:"0.0",value:a,type:"number",onChange:e=>t(e.target.value),autoComplete:"off",required:!0,autoFocus:!0}),(0,s.jsx)(u.z,{className:"absolute right-2 top-1 h-8",variant:"secondary",onClick:()=>t((0,x.NI)(r)),disabled:!r,children:"Max"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("label",{className:"text-sm font-medium",htmlFor:"to",children:"To receive USDC"}),(0,s.jsxs)("span",{className:"text-sm",children:["Balance: ",(0,x.NI)(p||0)," USDC"]})]}),(0,s.jsx)(j,{className:"mt-2 text-white",id:"to",placeholder:"0.0",type:"number",value:(0,x.NI)(o),autoComplete:"off",disabled:!0})]}),(0,s.jsx)("div",{className:"flex items-center justify-between text-sm",children:(0,s.jsxs)("div",{className:"text-gray-400",children:["Your reward will be claimable after"," ",B.duration(1e3*Number(b||0)).humanize()]})}),(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("div",{className:"text-gray-400",children:"1 USDX"}),(0,s.jsxs)("div",{className:"text-right",children:["≈ ",(0,x.NI)(m)," USDC"]})]})]})}),(0,s.jsx)(w,{className:"flex justify-center",children:e?E?(0,s.jsxs)(u.z,{className:"w-full",onClick:async()=>{await T(),await N()},disabled:V>0,busy:X,children:["Claim ",(0,x.NI)(R.shares)," USDC"]}):!i||1e6*Number(a)>Number(i)?(0,s.jsx)(u.z,{className:"w-full",disabled:!a||1e6*Number(a)>Number(r),onClick:async()=>{await U(),await l()},busy:k,children:"Approve spending USDX"}):(0,s.jsx)(u.z,{className:"w-full",onClick:async()=>{await D(),await N()},disabled:!a,busy:C,children:"Request unstake USDX"}):(0,s.jsx)(u.z,{className:"w-full px-4 text-base font-bold",onClick:()=>{var e;return null===(e=document.getElementById("connect-wallet-button"))||void 0===e?void 0:e.click()},children:"Connect Wallet"})})]})}var P=t(17921),Y=t(35063),q=t(41352);let G=Y.fC;Y.xz;let Z=Y.h_;Y.x8;let J=d.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,s.jsx)(Y.aV,{ref:a,className:(0,x.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0  fixed inset-0 z-50 bg-black/80",t),...n})});J.displayName=Y.aV.displayName;let K=d.forwardRef((e,a)=>{let{className:t,children:n,...r}=e;return(0,s.jsxs)(Z,{children:[(0,s.jsx)(J,{}),(0,s.jsxs)(Y.VY,{ref:a,className:(0,x.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 sm:rounded-lg",t),...r,children:[n,(0,s.jsxs)(Y.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,s.jsx)(q.Z,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});K.displayName=Y.VY.displayName;let DialogHeader=e=>{let{className:a,...t}=e;return(0,s.jsx)("div",{className:(0,x.cn)("flex flex-col space-y-1.5 text-center sm:text-left",a),...t})};DialogHeader.displayName="DialogHeader";let DialogFooter=e=>{let{className:a,...t}=e;return(0,s.jsx)("div",{className:(0,x.cn)("flex flex-col-reverse sm:flex-row sm:justify-between sm:space-x-2",a),...t})};DialogFooter.displayName="DialogFooter";let Q=d.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,s.jsx)(Y.Dx,{ref:a,className:(0,x.cn)("text-lg font-semibold leading-none tracking-tight",t),...n})});Q.displayName=Y.Dx.displayName;let $=d.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,s.jsx)(Y.dk,{ref:a,className:(0,x.cn)("text-sm text-muted-foreground",t),...n})});$.displayName=Y.dk.displayName;var ee=t(14650);let ea=ee.fC,et=d.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,s.jsx)(ee.aV,{ref:a,className:(0,x.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...n})});et.displayName=ee.aV.displayName;let es=d.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,s.jsx)(ee.xz,{ref:a,className:(0,x.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...n})});es.displayName=ee.xz.displayName;let en=d.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,s.jsx)(ee.VY,{ref:a,className:(0,x.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...n})});en.displayName=ee.VY.displayName;var er=t(37046),ei=t(8478);let generateReferralCode=e=>{let a=(0,n.keccak256)(e),t=a.substring(0,5),s=parseInt(t,16)%1024;return"".concat(t).concat(s.toString().padStart(3,"0"))},ReferralLink=e=>{let{userAddress:a}=e,[t,n]=(0,d.useState)(""),[r,i]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{if(a){let e=generateReferralCode(a);n("".concat(window.location.origin,"/app?ref=").concat(e))}},[a]),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsxs)("div",{className:"inline-flex p-4 border border-blue-200 rounded shadow-sm",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-white-800",children:"Your Referral Link:"}),(0,s.jsxs)("div",{className:"flex gap-2 ml-4",children:[(0,s.jsx)("input",{className:"flex-1 p-2 border rounded text-white-900 max-w-xs",value:t,readOnly:!0}),(0,s.jsx)("button",{className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",onClick:()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})},children:r?"Copied!":"Copy"})]})]})})},signUpWithReferral=async(e,a)=>{if(e)try{let t={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userAddress:e,referrerCode:a})},s=await fetch("https://gwo7xh1441.execute-api.ap-northeast-1.amazonaws.com/beta/referral",t);await s.json()}catch(e){}};function Main(){let[e,a]=(0,d.useState)(!1);(0,d.useEffect)(()=>{let e=new URLSearchParams(window.location.search),a=e.get("ref");a&&!localStorage.getItem("referrer")&&localStorage.setItem("referrer",a)},[]);let{address:t}=(0,c.mA)();(0,d.useEffect)(()=>{let e=new URLSearchParams(window.location.search),a=e.get("ref");a&&signUpWithReferral(t,a)},[t]);let{targetNetwork:n}=(0,ei.p)(),{data:r}=(0,v.uT)({contractName:"USDXVault",functionName:"totalSupply",args:[]}),{data:i}=(0,v.uT)({contractName:"USDXVault",functionName:"portfolioValue",args:[]}),{data:l}=(0,v.uT)({contractName:"USDXVault",functionName:"insuranceFund",args:[]}),{data:u}=(0,v.uT)({contractName:"USDXVault",functionName:"unstakingFee",args:[]}),{data:f}=(0,v.uT)({contractName:"USDXVault",functionName:"previewRedeem",args:[(0,x.H2)("1")]});(0,d.useEffect)(()=>{let e="true"===window.localStorage.getItem("agreedTOU");e||a(!0)},[]);let p=(0,d.useRef)(null);return(0,d.useEffect)(()=>{p.current||(p.current=!0,(0,o.S)(),(0,o.j)())},[]),(0,s.jsx)("div",{className:"relative",children:(0,s.jsxs)("div",{id:"wave",children:[(0,s.jsx)("div",{className:"absolute top-0 w-full",children:(0,s.jsxs)("div",{className:" m-auto min-h-screen w-full max-w-screen-lg pt-2 text-white",children:[(0,s.jsxs)("nav",{className:"flex items-center justify-between py-4 pr-4 md:pr-0",children:[(0,s.jsx)(P.D,{}),(0,s.jsx)("div",{className:"flex items-center space-x-4",children:(0,s.jsx)(m.xX,{})})]}),(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center pb-12 pt-12",children:[(0,s.jsx)("p",{className:"mb-6 px-2 text-center text-lg md:px-0",children:"Mainnet beta now live. Choose your stake and earn rewards."}),(0,s.jsxs)("div",{className:"mb-8 hidden gap-4 md:flex",children:[(0,s.jsxs)("div",{className:"space-y-4 rounded border p-4",children:[(0,s.jsx)("div",{className:"text-sm uppercase",children:"Vault Value"}),(0,s.jsxs)("div",{className:"text-base font-semibold",children:[(0,x.NI)(Number(i||0),2)," USDC"]})]}),(0,s.jsxs)("div",{className:"space-y-4 rounded border p-4",children:[(0,s.jsx)("div",{className:"text-sm",children:"TOTAL MINTED"}),(0,s.jsxs)("div",{className:"text-base font-semibold",children:[(0,x.NI)(r,2)||0," USDX"]})]}),(0,s.jsxs)("div",{className:"space-y-4 rounded border p-4",children:[(0,s.jsx)("div",{className:"text-sm",children:"USDX PRICE"}),(0,s.jsxs)("div",{className:"text-base font-semibold",children:[(0,x.NI)(Number(f)/(1-Number(u)/1e4))," ","USDC"]})]}),(0,s.jsxs)("div",{className:"space-y-4 rounded border p-4",children:[(0,s.jsx)("div",{className:"text-sm",children:"CONTRACT ADDRESS"}),(0,s.jsx)("div",{className:"-ml-1.5 text-base font-semibold",children:(0,s.jsx)(m.kL,{address:er.Z[n.id].USDXVault.address||"",displayAvatar:!1})})]})]}),(0,s.jsx)("div",{className:"flex w-full flex-row-reverse justify-center gap-4",children:(0,s.jsxs)(ea,{defaultValue:"deposit",className:"with-full grow px-4 md:w-fit md:grow-0",children:[(0,s.jsxs)(et,{className:"grid w-full grid-cols-2",children:[(0,s.jsx)(es,{value:"deposit",children:"Stake"}),(0,s.jsx)(es,{value:"withdraw",children:"Unstake"})]}),(0,s.jsx)(en,{value:"deposit",children:(0,s.jsx)(Deposit,{})}),(0,s.jsx)(en,{value:"withdraw",children:(0,s.jsx)(Withdraw,{})})]})})]}),t&&(0,s.jsx)(ReferralLink,{userAddress:t})]})}),e&&(0,s.jsx)(AgreeTermOfUseDialog,{onEsc:()=>a(!1)})]})})}function AgreeTermOfUseDialog(e){let{onEsc:a}=e,t=(0,l.useRouter)();return(0,s.jsx)(G,{open:!0,onOpenChange:function(e){e||t.push("/")},children:(0,s.jsxs)(K,{className:"sm:max-w-[425px]",children:[(0,s.jsxs)(DialogHeader,{children:[(0,s.jsx)(Q,{children:"Terms of Use"}),(0,s.jsx)($,{children:(0,s.jsxs)("p",{children:["By clicking Accept, you confirm that you have read and agreed to our"," ",(0,s.jsx)(i(),{href:"/terms",target:"_blank",className:"text-white hover:underline",children:"Term of Use"})]})})]}),(0,s.jsx)("div",{className:"grid gap-4 py-4",children:(0,s.jsx)("div",{className:"grid grid-cols-4 items-center gap-4"})}),(0,s.jsxs)(DialogFooter,{className:"gap-2",children:[(0,s.jsx)(u.z,{variant:"secondary",className:"md:w-20",onClick:()=>t.push("/"),children:"Exit"}),(0,s.jsx)(u.z,{onClick:function(){window.localStorage.setItem("agreedTOU","true"),a()},className:"md:w-20",children:"Accept"})]})]})})}var el=t(99415),app=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(el.G,{}),(0,s.jsx)(Main,{})]})}},function(e){e.O(0,[5675,1742,9774,2888,179],function(){return e(e.s=56177)}),_N_E=e.O()}]);