(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8879],{5673:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/staking",function(){return t(27801)}])},89346:function(e,a,t){"use strict";t.d(a,{Ol:function(){return i},SZ:function(){return o},Zb:function(){return n},aY:function(){return c},eW:function(){return m},ll:function(){return d}});var s=t(85893),r=t(67294),l=t(94777);let n=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("div",{ref:a,className:(0,l.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",t),...r})});n.displayName="Card";let i=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("div",{ref:a,className:(0,l.cn)("flex flex-col space-y-1.5 p-6",t),...r})});i.displayName="CardHeader";let d=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("h3",{ref:a,className:(0,l.cn)("text-2xl font-semibold leading-none tracking-tight",t),...r})});d.displayName="CardTitle";let o=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("p",{ref:a,className:(0,l.cn)("text-sm text-muted-foreground",t),...r})});o.displayName="CardDescription";let c=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("div",{ref:a,className:(0,l.cn)("p-6 pt-0",t),...r})});c.displayName="CardContent";let m=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("div",{ref:a,className:(0,l.cn)("flex items-center p-6 pt-0",t),...r})});m.displayName="CardFooter"},5305:function(e,a,t){"use strict";t.d(a,{$N:function(){return h},Be:function(){return p},GG:function(){return c},Vq:function(){return d},cN:function(){return f},cZ:function(){return u},fK:function(){return x}});var s=t(85893),r=t(67294),l=t(6327),n=t(62190),i=t(94777);let d=l.fC;l.xz;let o=l.h_,c=l.x8,m=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.aV,{ref:a,className:(0,i.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r})});m.displayName=l.aV.displayName;let u=r.forwardRef((e,a)=>{let{className:t,children:r,...d}=e;return(0,s.jsxs)(o,{children:[(0,s.jsx)(m,{}),(0,s.jsxs)(l.VY,{ref:a,className:(0,i.cn)("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 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%] sm:rounded-lg",t),...d,children:[r,(0,s.jsxs)(l.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)(n.Z,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});u.displayName=l.VY.displayName;let x=e=>{let{className:a,...t}=e;return(0,s.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-1.5 text-center sm:text-left",a),...t})};x.displayName="DialogHeader";let f=e=>{let{className:a,...t}=e;return(0,s.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...t})};f.displayName="DialogFooter";let h=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.Dx,{ref:a,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",t),...r})});h.displayName=l.Dx.displayName;let p=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.dk,{ref:a,className:(0,i.cn)("text-sm text-muted-foreground",t),...r})});p.displayName=l.dk.displayName},88860:function(e,a,t){"use strict";t.d(a,{I:function(){return n}});var s=t(85893),r=t(67294),l=t(94777);let n=r.forwardRef((e,a)=>{let{className:t,type:r,...n}=e;return(0,s.jsx)("input",{type:r,className:(0,l.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:a,...n})});n.displayName="Input"},1128:function(e,a,t){"use strict";t.d(a,{i:function(){return i}});var s=t(85893),r=t(67294),l=t(19615),n=t(94777);let i=r.forwardRef((e,a)=>{var t;let{className:r,...i}=e;return(0,s.jsxs)(l.fC,{ref:a,className:(0,n.cn)("relative flex w-full touch-none select-none items-center",r),...i,children:[(0,s.jsx)(l.fQ,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:(0,s.jsx)(l.e6,{className:"absolute h-full bg-primary"})}),null===(t=i.defaultValue)||void 0===t?void 0:t.map((e,a)=>(0,s.jsx)(l.bU,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},a))]})});i.displayName=l.fC.displayName},62378:function(e,a,t){"use strict";t.d(a,{RM:function(){return d},SC:function(){return o},iA:function(){return n},pj:function(){return m},ss:function(){return c},xD:function(){return i}});var s=t(85893),r=t(67294),l=t(94777);let n=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("div",{className:"relative w-full overflow-auto",children:(0,s.jsx)("table",{ref:a,className:(0,l.cn)("w-full caption-bottom text-sm",t),...r})})});n.displayName="Table";let i=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("thead",{ref:a,className:(0,l.cn)("[&_tr]:border-b",t),...r})});i.displayName="TableHeader";let d=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("tbody",{ref:a,className:(0,l.cn)("[&_tr:last-child]:border-0",t),...r})});d.displayName="TableBody",r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("tfoot",{ref:a,className:(0,l.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...r})}).displayName="TableFooter";let o=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("tr",{ref:a,className:(0,l.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...r})});o.displayName="TableRow";let c=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("th",{ref:a,className:(0,l.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...r})});c.displayName="TableHead";let m=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("td",{ref:a,className:(0,l.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...r})});m.displayName="TableCell",r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)("caption",{ref:a,className:(0,l.cn)("mt-4 text-sm text-muted-foreground",t),...r})}).displayName="TableCaption"},93517:function(e,a,t){"use strict";t.d(a,{SP:function(){return o},dr:function(){return d},mQ:function(){return i},nU:function(){return c}});var s=t(85893),r=t(67294),l=t(82968),n=t(94777);let i=l.fC,d=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.aV,{ref:a,className:(0,n.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...r})});d.displayName=l.aV.displayName;let o=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.xz,{ref:a,className:(0,n.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),...r})});o.displayName=l.xz.displayName;let c=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.VY,{ref:a,className:(0,n.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...r})});c.displayName=l.VY.displayName},27801:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return G}});var s=t(85893),r=t(67294),l=t(34240),n=t(54124),i=t(89810),d=t(16693),o=t(1958),c=t(39625),m=t(33305),u=t(82020),x=t(55678),f=t(98778),h=t(88860),p=t(1128),g=t(5305),b=t(62378),N=t(90437),y=t(31134);let j=(0,y.Z)("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),v=(0,y.Z)("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);var w=t(74598),k=t(3112),F=t(25675),S=t.n(F);function D(e,a){if("function"==typeof e)return e(a);null!=e&&(e.current=a)}t(73935);var L=Symbol("radix.slottable");function R(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===L}var C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,a)=>{let t=function(e){let a=function(e){let a=r.forwardRef((e,a)=>{let{children:t,...s}=e;if(r.isValidElement(t)){let e,l;let n=(e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?t.props.ref:t.props.ref||t.ref,i=function(e,a){let t={...a};for(let s in a){let r=e[s],l=a[s];/^on[A-Z]/.test(s)?r&&l?t[s]=(...e)=>{l(...e),r(...e)}:r&&(t[s]=r):"style"===s?t[s]={...r,...l}:"className"===s&&(t[s]=[r,l].filter(Boolean).join(" "))}return{...e,...t}}(s,t.props);return t.type!==r.Fragment&&(i.ref=a?function(...e){return a=>{let t=!1,s=e.map(e=>{let s=D(e,a);return t||"function"!=typeof s||(t=!0),s});if(t)return()=>{for(let a=0;a1?r.Children.only(null):null});return a.displayName=`${e}.SlotClone`,a}(e),t=r.forwardRef((e,t)=>{let{children:l,...n}=e,i=r.Children.toArray(l),d=i.find(R);if(d){let e=d.props.children,l=i.map(a=>a!==d?a:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,s.jsx)(a,{...n,ref:t,children:r.isValidElement(e)?r.cloneElement(e,void 0,l):null})}return(0,s.jsx)(a,{...n,ref:t,children:l})});return t.displayName=`${e}.Slot`,t}(`Primitive.${a}`),l=r.forwardRef((e,r)=>{let{asChild:l,...n}=e,i=l?t:a;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(i,{...n,ref:r})});return l.displayName=`Primitive.${a}`,{...e,[a]:l}},{}),P=r.forwardRef((e,a)=>(0,s.jsx)(C.label,{...e,ref:a,onMouseDown:a=>{a.target.closest("button, input, select, textarea")||(e.onMouseDown?.(a),!a.defaultPrevented&&a.detail>1&&a.preventDefault())}}));P.displayName="Label";var A=t(12003),q=t(94777);let E=(0,A.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Y=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(P,{ref:a,className:(0,q.cn)(E(),t),...r})});Y.displayName=P.displayName;var I=t(93517),M=t(89346);function T(e){let{pool:a,isOpen:t,onClose:l,stakedBalance:n}=e,[i,d]=(0,r.useState)(""),[o,c]=(0,r.useState)(""),[m,u]=(0,r.useState)("days"),[x,p]=(0,r.useState)("0"),[b,N]=(0,r.useState)("0"),[y,j]=(0,r.useState)("0");(0,r.useEffect)(()=>{t&&(d(n),c(a.lockDays.toString()),k(n,a.lockDays.toString(),"days"))},[t,n,a.lockDays]);let k=(e,t,s)=>{let r=Number.parseFloat(e)||0,l=Number.parseFloat(t)||0,n=l;"weeks"===s&&(n=7*l),"months"===s&&(n=30*l),"years"===s&&(n=365*l);let i=r,d=0;for(let e=1;e<=n;e++){let e=a.dailyAPYValue/100*i;d+=e,i+=e}p(d.toFixed(4)),N((r+d).toFixed(4)),j(((Math.pow(1+a.dailyAPYValue/100,365)-1)*100).toFixed(2))};return(0,s.jsx)(g.Vq,{open:t,onOpenChange:l,children:(0,s.jsxs)(g.cZ,{className:"bg-green-900/90 border-green-800 text-white backdrop-blur-md max-w-2xl w-[95vw] max-h-[90vh] overflow-y-auto",children:[(0,s.jsxs)(g.fK,{children:[(0,s.jsxs)(g.$N,{className:"flex items-center gap-2",children:[(0,s.jsx)(v,{className:"h-5 w-5"}),"Rewards Calculator - ",a.title]}),(0,s.jsx)(g.Be,{className:"text-gray-300",children:"Calculate potential rewards based on stake amount and duration."})]}),(0,s.jsx)("div",{className:"space-y-4 py-2 sm:py-4",children:(0,s.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 sm:gap-6",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(Y,{htmlFor:"stake-amount",children:"Stake Amount"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(h.I,{id:"stake-amount",type:"number",placeholder:"0.0",value:i,onChange:e=>{let a=e.target.value;d(a),k(a,o,m)},className:"bg-green-950/50 border-green-800 text-white"}),(0,s.jsx)("div",{className:"bg-green-950/50 border border-green-800 rounded-md px-3 py-2 text-sm font-medium",children:"LFG"})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(Y,{htmlFor:"stake-duration",children:"Stake Duration"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)(h.I,{id:"stake-duration",type:"number",placeholder:"0",value:o,onChange:e=>{let a=e.target.value;c(a),k(i,a,m)},className:"bg-green-950/50 border-green-800 text-white"}),(0,s.jsx)(I.mQ,{defaultValue:"days",value:m,onValueChange:e=>{u(e),k(i,o,e)},className:"w-full",children:(0,s.jsxs)(I.dr,{className:"bg-green-950/50 border border-green-800 grid grid-cols-4 h-10 w-full",children:[(0,s.jsx)(I.SP,{value:"days",className:"data-[state=active]:bg-primary data-[state=active]:text-black text-xs sm:text-sm",children:"Days"}),(0,s.jsx)(I.SP,{value:"weeks",className:"data-[state=active]:bg-primary data-[state=active]:text-black text-xs sm:text-sm",children:"Weeks"}),(0,s.jsx)(I.SP,{value:"months",className:"data-[state=active]:bg-primary data-[state=active]:text-black text-xs sm:text-sm",children:"Months"}),(0,s.jsx)(I.SP,{value:"years",className:"data-[state=active]:bg-primary data-[state=active]:text-black text-xs sm:text-sm",children:"Years"})]})})]})]}),(0,s.jsxs)("div",{className:"rounded-md bg-green-950/50 p-3 text-sm",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(w.Z,{className:"h-4 w-4 text-primary"}),(0,s.jsx)("span",{className:"font-medium",children:"Staking Information"})]}),(0,s.jsxs)("ul",{className:"space-y-1 text-gray-300",children:[(0,s.jsxs)("li",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{children:"Daily APY:"}),(0,s.jsx)("span",{children:a.dailyAPY})]}),(0,s.jsxs)("li",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{children:"Effective Annual APY:"}),(0,s.jsxs)("span",{children:[y,"%"]})]}),(0,s.jsxs)("li",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{children:"Compounding:"}),(0,s.jsx)("span",{children:"Daily"})]})]})]})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)(M.Zb,{className:"bg-green-950/50 border-green-800",children:[(0,s.jsxs)(M.Ol,{className:"pb-2",children:[(0,s.jsx)(M.ll,{className:"text-lg text-white",children:"Projected Rewards"}),(0,s.jsx)(M.SZ,{className:"text-gray-300",children:"Based on current APY and compounding"})]}),(0,s.jsx)(M.aY,{children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm text-gray-300 mb-1",children:"Initial Stake"}),(0,s.jsxs)("p",{className:"text-xl font-bold text-white",children:[Number.parseFloat(i||"0").toFixed(4)," LFG"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm text-gray-300 mb-1",children:"Rewards Earned"}),(0,s.jsxs)("p",{className:"text-xl font-bold text-green-400",children:[x," LFG",Number.parseFloat(i)>0&&(0,s.jsxs)("span",{className:"ml-2 text-sm font-normal",children:["(+",(Number.parseFloat(x)/Number.parseFloat(i)*100).toFixed(2),"%)"]})]})]}),(0,s.jsxs)("div",{className:"pt-2 border-t border-green-800",children:[(0,s.jsx)("p",{className:"text-sm text-gray-300 mb-1",children:"Total Value"}),(0,s.jsxs)("p",{className:"text-2xl font-bold text-primary",children:[b," LFG"]})]})]})})]}),(0,s.jsxs)("div",{className:"text-sm text-gray-300",children:[(0,s.jsxs)("p",{className:"mb-2",children:[(0,s.jsx)("span",{className:"font-medium text-white",children:"Note:"})," This calculator provides an estimate based on the current APY."]}),(0,s.jsx)("p",{children:"Actual rewards may vary based on protocol changes, market conditions, and other factors."})]})]})]})}),(0,s.jsx)(g.cN,{children:(0,s.jsx)(f.z,{variant:"outline",onClick:l,className:"border-gray-600 text-gray-300 hover:bg-green-950/50",children:"Close"})})]})})}let V=[{id:"1day",title:"1 Day Lock",lockPeriod:"1 Day",lockDays:1,dailyAPY:"1.00%",dailyAPYValue:1,totalStaked:"0",address:k.e6},{id:"7day",title:"7 Day Lock",lockPeriod:"7 Days",lockDays:7,dailyAPY:"1.50%",dailyAPYValue:1.5,totalStaked:"0",address:k.EQ},{id:"30day",title:"30 Day Lock",lockPeriod:"30 Days",lockDays:30,dailyAPY:"2.00%",dailyAPYValue:2,totalStaked:"0",address:k.ML}];function W(){let[e,a]=(0,r.useState)(null),[t,l]=(0,r.useState)(!0),[y,F]=(0,r.useState)(""),[D,L]=(0,r.useState)(0),[R,C]=(0,r.useState)(!1),[P,A]=(0,r.useState)(!1),[q,E]=(0,r.useState)(null),{address:Y,isConnected:I}=(0,u.Tj)(),{writeContract:M}=(0,n.S)(),{writeContract:W}=(0,n.S)(),{writeContract:G}=(0,n.S)(),{data:O}=(0,i.u)({address:k.Xh,abi:d.Wo,functionName:"allowance",args:[Y||o.DR,k.e6],query:{refetchInterval:3e3,enabled:I,select:e=>parseFloat((0,c.d)(e))}}),{data:z}=(0,i.u)({address:k.Xh,abi:d.Wo,functionName:"allowance",args:[Y||o.DR,k.EQ],query:{refetchInterval:3e3,enabled:I,select:e=>parseFloat((0,c.d)(e))}}),{data:Z}=(0,i.u)({address:k.Xh,abi:d.Wo,functionName:"allowance",args:[Y||o.DR,k.ML],query:{refetchInterval:3e3,enabled:I,select:e=>parseFloat((0,c.d)(e))}}),{data:_}=(0,i.u)({address:k.e6,abi:d.Wo,functionName:"balanceOf",args:[Y||o.DR],query:{refetchInterval:3e3,enabled:I,select:e=>(0,c.d)(e)}}),{data:Q}=(0,i.u)({address:k.EQ,abi:d.Wo,functionName:"balanceOf",args:[Y||o.DR],query:{refetchInterval:3e3,enabled:I,select:e=>(0,c.d)(e)}}),{data:U}=(0,i.u)({address:k.ML,abi:d.Wo,functionName:"balanceOf",args:[Y||o.DR],query:{refetchInterval:3e3,enabled:I,select:e=>(0,c.d)(e)}}),{data:B}=(0,i.u)({address:k.e6,abi:d.Wo,functionName:"totalSupply",query:{refetchInterval:3e3,select:e=>parseFloat((0,c.d)(e)).toLocaleString([],{minimumFractionDigits:0,maximumFractionDigits:0})}}),{data:H}=(0,i.u)({address:k.EQ,abi:d.Wo,functionName:"totalSupply",query:{refetchInterval:3e3,select:e=>parseFloat((0,c.d)(e)).toLocaleString([],{minimumFractionDigits:0,maximumFractionDigits:0})}}),{data:X}=(0,i.u)({address:k.ML,abi:d.Wo,functionName:"totalSupply",query:{refetchInterval:3e3,select:e=>parseFloat((0,c.d)(e)).toLocaleString([],{minimumFractionDigits:0,maximumFractionDigits:0})}}),{data:$}=(0,i.u)({address:k.e6,abi:k.qp,functionName:"getTotalProfits",args:[Y||o.DR],query:{refetchInterval:3e3,enabled:I,select:e=>parseFloat((0,c.d)(e)).toLocaleString([],{minimumFractionDigits:0,maximumFractionDigits:2})}}),{data:K}=(0,i.u)({address:k.EQ,abi:k.qp,functionName:"getTotalProfits",args:[Y||o.DR],query:{refetchInterval:3e3,enabled:I,select:e=>parseFloat((0,c.d)(e)).toLocaleString([],{minimumFractionDigits:0,maximumFractionDigits:2})}}),{data:J}=(0,i.u)({address:k.ML,abi:k.qp,functionName:"getTotalProfits",args:[Y||o.DR],query:{refetchInterval:3e3,enabled:I,select:e=>parseFloat((0,c.d)(e)).toLocaleString([],{minimumFractionDigits:0,maximumFractionDigits:2})}}),{data:ee}=(0,i.u)({address:k.Xh,abi:d.Wo,functionName:"balanceOf",args:[Y||o.DR],query:{refetchInterval:3e3,enabled:I,select:e=>(0,c.d)(e)}}),{data:ea}=(0,i.u)({address:k.e6,abi:k.qp,functionName:"remainingLockTime",args:[Y||o.DR],query:{refetchInterval:3e3,enabled:I,select:e=>parseFloat(e.toString())}}),{data:et}=(0,i.u)({address:k.EQ,abi:k.qp,functionName:"remainingLockTime",args:[Y||o.DR],query:{refetchInterval:3e3,enabled:I,select:e=>parseFloat(e.toString())}}),{data:es}=(0,i.u)({address:k.ML,abi:k.qp,functionName:"remainingLockTime",args:[Y||o.DR],query:{refetchInterval:3e3,enabled:I,select:e=>parseFloat(e.toString())}}),er=e=>{if(e<=0)return"Unlocked";let a=Math.floor(e/86400),t=Math.floor(e%86400/3600),s=Math.floor(e%3600/60);return a>0?"".concat(a,"D ").concat(t,"H ").concat(s,"M"):t>0?"".concat(t,"H ").concat(s,"M"):"".concat(s,"M")},el=e=>e===k.e6?_||"0":e===k.EQ?Q||"0":e===k.ML&&U||"0",en=e=>e===k.e6?B||"0":e===k.EQ?H||"0":e===k.ML&&X||"0",ei=e=>e===k.e6?$||"0":e===k.EQ?K||"0":e===k.ML&&J||"0",ed=e=>e===k.e6?er(ea||0):e===k.EQ?er(et||0):e===k.ML?er(es||0):"Unlocked",eo=e=>e===k.e6?O||0:e===k.EQ?z||0:e===k.ML&&Z||0,ec=e=>{a(e),l(!0),F(""),L(0),C(!0)},em=e=>{a(e),l(!1),F(""),L(0),C(!0)},eu=e=>{E(e),A(!0)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"rounded-lg border border-green-800/50 bg-green-900/20 backdrop-blur-sm overflow-hidden",children:(0,s.jsxs)(b.iA,{children:[(0,s.jsx)(b.xD,{children:(0,s.jsxs)(b.SC,{className:"hover:bg-transparent border-green-800/50",children:[(0,s.jsx)(b.ss,{className:"text-green-400 font-medium",children:"Pool"}),(0,s.jsx)(b.ss,{className:"text-green-400 font-medium",children:"APY"}),(0,s.jsx)(b.ss,{className:"text-green-400 font-medium",children:"Lock Period"}),(0,s.jsx)(b.ss,{className:"text-green-400 font-medium",children:"Total Staked"}),(0,s.jsx)(b.ss,{className:"text-green-400 font-medium",children:"Your Stake"}),(0,s.jsx)(b.ss,{className:"text-green-400 font-medium",children:"Earnings"}),(0,s.jsx)(b.ss,{className:"text-green-400 font-medium",children:"Time Remaining"}),(0,s.jsx)(b.ss,{className:"text-green-400 font-medium text-right",children:"Actions"})]})}),(0,s.jsx)(b.RM,{children:V.map(e=>(0,s.jsxs)(b.SC,{className:"hover:bg-green-900/30 border-green-800/50",children:[(0,s.jsx)(b.pj,{className:"font-medium text-white",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-full overflow-hidden",children:(0,s.jsx)(S(),{src:"/icons/lfg-logo.png",alt:"LFG Token",width:32,height:32,className:"rounded-full"})}),e.title]})}),(0,s.jsx)(b.pj,{children:(0,s.jsxs)("div",{className:"flex items-center gap-1 text-green-400",children:[(0,s.jsx)(N.Z,{className:"h-4 w-4"}),e.dailyAPY]})}),(0,s.jsx)(b.pj,{className:"text-white",children:e.lockPeriod}),(0,s.jsxs)(b.pj,{className:"text-white",children:[en(e.address)," LFG"]}),(0,s.jsxs)(b.pj,{className:"text-white",children:[parseFloat(el(e.address)).toLocaleString([],{minimumFractionDigits:0,maximumFractionDigits:3})," LFG"]}),(0,s.jsxs)(b.pj,{className:"text-white",children:[ei(e.address)," LFG"]}),(0,s.jsx)(b.pj,{children:(0,s.jsxs)("div",{className:"flex items-center gap-1 text-yellow-400",children:[(0,s.jsx)(j,{className:"h-4 w-4"}),ed(e.address)]})}),(0,s.jsx)(b.pj,{className:"text-right",children:(0,s.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,s.jsx)(f.z,{variant:"outline",size:"sm",className:"border-green-500 bg-green-900/50 text-white hover:bg-green-800/70",onClick:()=>ec(e),children:"Stake"}),(0,s.jsx)(f.z,{variant:"outline",size:"sm",className:"border-red-500 bg-red-900/50 text-white hover:bg-red-800/70",onClick:()=>em(e),disabled:0>=Number.parseFloat(el(e.address)),children:"Unstake"}),(0,s.jsxs)(f.z,{variant:"ghost",size:"icon",className:"h-8 w-8 text-green-400 hover:bg-green-900/50 hover:text-white",onClick:()=>eu(e),children:[(0,s.jsx)(v,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Calculator"})]})]})})]},e.id))})]})}),(0,s.jsx)(g.Vq,{open:R,onOpenChange:C,children:(0,s.jsxs)(g.cZ,{className:"bg-green-900/90 border-green-800 text-white backdrop-blur-md",children:[(0,s.jsxs)(g.fK,{children:[(0,s.jsx)(g.$N,{children:t?"Stake LFG":"Unstake LFG"}),(0,s.jsx)(g.Be,{className:"text-gray-300",children:t?"Stake your LFG tokens in the ".concat(null==e?void 0:e.title," pool to earn rewards."):"Unstake your LFG tokens from the ".concat(null==e?void 0:e.title," pool.")})]}),(0,s.jsxs)("div",{className:"space-y-4 py-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("span",{className:"text-sm text-gray-300",children:[t?"Balance":"Staked",":"]}),(0,s.jsx)("span",{className:"font-medium",children:t?"".concat(ee||"0"," LFG"):"".concat(el(null==e?void 0:e.address)," LFG")})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("label",{htmlFor:"amount",className:"text-sm text-gray-300",children:"Amount"}),(0,s.jsx)(f.z,{variant:"ghost",size:"sm",className:"h-6 text-xs text-primary hover:text-primary hover:bg-primary/20",onClick:()=>{F((t?Number.parseFloat(ee||"0"):Number.parseFloat(el(null==e?void 0:e.address))).toString()),L(100)},children:"MAX"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(h.I,{id:"amount",type:"number",placeholder:"0.0",value:y,onChange:a=>{let s=a.target.value;F(s);let r=t?Number.parseFloat(ee||"0"):Number.parseFloat(el(null==e?void 0:e.address));r>0?L(Math.min(Number.parseFloat(s||"0")/r*100,100)):L(0)},className:"bg-green-950/50 border-green-800 text-white"}),(0,s.jsx)("div",{className:"bg-green-950/50 border border-green-800 rounded-md px-3 py-2 text-sm font-medium",children:"LFG"})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(p.i,{defaultValue:[0],max:100,step:1,value:[D],onValueChange:a=>{let s=a[0];L(s);let r=s/100*(t?Number.parseFloat(ee||"0"):Number.parseFloat(el(null==e?void 0:e.address)));F(r.toFixed(r<.1?6:2))},className:"py-4"}),(0,s.jsxs)("div",{className:"flex justify-between text-xs text-gray-400",children:[(0,s.jsx)("span",{children:"0%"}),(0,s.jsx)("span",{children:"25%"}),(0,s.jsx)("span",{children:"50%"}),(0,s.jsx)("span",{children:"75%"}),(0,s.jsx)("span",{children:"100%"})]})]}),t&&(0,s.jsxs)("div",{className:"rounded-md bg-green-950/50 p-3 text-sm",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(w.Z,{className:"h-4 w-4 text-primary"}),(0,s.jsx)("span",{className:"font-medium",children:"Staking Information"})]}),(0,s.jsxs)("ul",{className:"space-y-1 text-gray-300",children:[(0,s.jsxs)("li",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{children:"Lock Period:"}),(0,s.jsx)("span",{children:null==e?void 0:e.lockPeriod})]}),(0,s.jsxs)("li",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{children:"Daily APY:"}),(0,s.jsx)("span",{children:null==e?void 0:e.dailyAPY})]}),(0,s.jsxs)("li",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{children:"Auto-compounding:"}),(0,s.jsx)("span",{children:"Yes"})]})]})]})]}),(0,s.jsxs)(g.cN,{children:[(0,s.jsx)(f.z,{variant:"outline",onClick:()=>C(!1),className:"border-gray-600 bg-gray-800/50 text-gray-300 hover:bg-gray-700/50",children:"Cancel"}),(0,s.jsx)(f.z,{onClick:()=>{if(!e||!y)return;let a=Number.parseFloat(y);if(isNaN(a)||a<=0){x.Am.error("Please enter a valid amount");return}t?eo(e.address)=Number.parseFloat(y),children:e?t?eo(e.address)A(!1),stakedBalance:el(q.address)})]})}function G(){let[e,a]=(0,r.useState)("active"),[t,n]=(0,r.useState)(!1),{address:m,isConnected:x}=(0,u.Tj)(),{data:h}=(0,i.u)({address:k.e6,abi:d.Wo,functionName:"balanceOf",args:[m||o.DR],query:{refetchInterval:3e3,enabled:x,select:e=>parseFloat((0,c.d)(e))}}),{data:p}=(0,i.u)({address:k.EQ,abi:d.Wo,functionName:"balanceOf",args:[m||o.DR],query:{refetchInterval:3e3,enabled:x,select:e=>parseFloat((0,c.d)(e))}}),{data:b}=(0,i.u)({address:k.ML,abi:d.Wo,functionName:"balanceOf",args:[m||o.DR],query:{refetchInterval:3e3,enabled:x,select:e=>parseFloat((0,c.d)(e))}}),{data:N}=(0,i.u)({address:k.e6,abi:d.Wo,functionName:"totalSupply",query:{refetchInterval:3e3,select:e=>parseFloat((0,c.d)(e))}}),{data:y}=(0,i.u)({address:k.EQ,abi:d.Wo,functionName:"totalSupply",query:{refetchInterval:3e3,select:e=>parseFloat((0,c.d)(e))}}),{data:j}=(0,i.u)({address:k.ML,abi:d.Wo,functionName:"totalSupply",query:{refetchInterval:3e3,select:e=>parseFloat((0,c.d)(e))}}),{data:v}=(0,i.u)({address:k.e6,abi:k.qp,functionName:"getTotalProfits",args:[m||o.DR],query:{refetchInterval:3e3,enabled:x,select:e=>parseFloat((0,c.d)(e))}}),{data:F}=(0,i.u)({address:k.EQ,abi:k.qp,functionName:"getTotalProfits",args:[m||o.DR],query:{refetchInterval:3e3,enabled:x,select:e=>parseFloat((0,c.d)(e))}}),{data:S}=(0,i.u)({address:k.ML,abi:k.qp,functionName:"getTotalProfits",args:[m||o.DR],query:{refetchInterval:3e3,enabled:x,select:e=>parseFloat((0,c.d)(e))}});return(0,s.jsxs)(l.Z,{children:[(0,s.jsxs)("div",{className:"w-full flex flex-col gap-6",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("h1",{className:"text-3xl font-bold text-white",children:"LFG Staking"}),(0,s.jsx)("p",{className:"text-gray-400",children:"Stake your LFG tokens to earn auto-compounding rewards"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,s.jsxs)(M.Zb,{className:"bg-green-900/30 border-green-800/50 backdrop-blur-sm",children:[(0,s.jsx)(M.Ol,{className:"pb-2",children:(0,s.jsx)(M.ll,{className:"text-white text-lg",children:"Total Value Locked"})}),(0,s.jsx)(M.aY,{children:(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsx)("span",{className:"text-2xl font-bold text-white",children:((N||0)+(y||0)+(j||0)).toLocaleString([],{maximumFractionDigits:2,minimumFractionDigits:0})}),(0,s.jsx)("span",{className:"text-green-400 text-sm mb-1",children:"LFG"})]})})]}),(0,s.jsxs)(M.Zb,{className:"bg-green-900/30 border-green-800/50 backdrop-blur-sm",children:[(0,s.jsx)(M.Ol,{className:"pb-2",children:(0,s.jsx)(M.ll,{className:"text-white text-lg",children:"Your Staked Balance"})}),(0,s.jsx)(M.aY,{children:(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsx)("span",{className:"text-2xl font-bold text-white",children:((h||0)+(p||0)+(b||0)).toLocaleString([],{maximumFractionDigits:2,minimumFractionDigits:0})}),(0,s.jsx)("span",{className:"text-green-400 text-sm mb-1",children:"LFG"})]})})]}),(0,s.jsxs)(M.Zb,{className:"bg-green-900/30 border-green-800/50 backdrop-blur-sm",children:[(0,s.jsx)(M.Ol,{className:"pb-2",children:(0,s.jsx)(M.ll,{className:"text-white text-lg",children:"Total Earnings"})}),(0,s.jsx)(M.aY,{children:(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsx)("span",{className:"text-2xl font-bold text-white",children:((v||0)+(F||0)+(S||0)).toLocaleString([],{maximumFractionDigits:2,minimumFractionDigits:0})}),(0,s.jsx)("span",{className:"text-green-400 text-sm mb-1",children:"LFG"})]})})]})]}),(0,s.jsx)("div",{className:"flex items-center justify-between",children:(0,s.jsxs)(I.mQ,{defaultValue:"active",className:"w-full",onValueChange:a,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)(I.dr,{className:"bg-green-900/30 border border-green-800/50",children:[(0,s.jsx)(I.SP,{value:"active",className:"data-[state=active]:bg-primary data-[state=active]:text-black",children:"Active Pools"}),(0,s.jsx)(I.SP,{value:"ended",className:"data-[state=active]:bg-primary data-[state=active]:text-black",children:"Ended"})]}),(0,s.jsx)("div",{className:"flex items-center gap-2",children:(0,s.jsxs)(f.z,{variant:"outline",size:"sm",className:"border-green-500 bg-green-900/50 text-white hover:bg-green-800/70",onClick:()=>n(!0),children:[(0,s.jsx)(w.Z,{className:"h-4 w-4 mr-1"}),"How it works"]})})]}),(0,s.jsx)(I.nU,{value:"active",className:"mt-0",children:(0,s.jsx)(W,{})}),(0,s.jsx)(I.nU,{value:"ended",className:"mt-0",children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,s.jsx)("p",{className:"text-gray-400 mb-2",children:"No ended pools at the moment"}),(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Ended pools will appear here"})]})})]})})]}),(0,s.jsx)(g.Vq,{open:t,onOpenChange:n,children:(0,s.jsxs)(g.cZ,{className:"bg-green-900/90 border-green-800 text-white backdrop-blur-md max-w-md max-h-[80vh] overflow-y-auto",children:[(0,s.jsxs)(g.fK,{children:[(0,s.jsxs)(g.$N,{className:"text-xl flex items-center gap-2",children:[(0,s.jsx)(w.Z,{className:"h-5 w-5 text-primary"}),"How Staking Works"]}),(0,s.jsx)(g.Be,{className:"text-gray-300",children:"Learn how to stake LFG tokens and earn rewards"})]}),(0,s.jsx)("div",{className:"space-y-4 py-2",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-lg font-medium text-primary mb-2",children:"What is Staking?"}),(0,s.jsx)("p",{className:"text-gray-300 text-sm",children:"Staking is the process of locking up your LFG tokens in the protocol to earn rewards. By staking, you contribute to the security and stability of the network while earning passive income."})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-lg font-medium text-primary mb-2",children:"How to Stake"}),(0,s.jsxs)("ol",{className:"list-decimal list-inside space-y-2 text-gray-300 text-sm",children:[(0,s.jsxs)("li",{children:[(0,s.jsx)("span",{className:"font-medium text-white",children:"Choose a Pool:"})," Select a staking pool based on your preferred lock period. Longer lock periods typically offer higher APY."]}),(0,s.jsxs)("li",{children:[(0,s.jsx)("span",{className:"font-medium text-white",children:"Approve Tokens:"})," First-time stakers need to approve the staking contract to use their LFG tokens."]}),(0,s.jsxs)("li",{children:[(0,s.jsx)("span",{className:"font-medium text-white",children:"Stake Your Tokens:"})," Enter the amount you wish to stake and confirm the transaction."]}),(0,s.jsxs)("li",{children:[(0,s.jsx)("span",{className:"font-medium text-white",children:"Earn Rewards:"})," Your staked tokens will automatically earn rewards based on the pool's APY. Rewards compound automatically, maximizing your returns."]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-lg font-medium text-primary mb-2",children:"Lock Periods"}),(0,s.jsx)("p",{className:"text-gray-300 text-sm",children:"Each staking pool has a specific lock period during which your tokens are locked. You cannot withdraw your tokens until the lock period ends. Longer lock periods offer higher APY as a reward for your commitment."})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-lg font-medium text-primary mb-2",children:"Auto-Compounding"}),(0,s.jsx)("p",{className:"text-gray-300 text-sm",children:"Our staking pools feature auto-compounding, which means your rewards are automatically reinvested to generate even more rewards. This results in exponential growth of your staked assets over time."})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-lg font-medium text-primary mb-2",children:"Unstaking"}),(0,s.jsx)("p",{className:"text-gray-300 text-sm",children:'Once your lock period ends, you can unstake your tokens along with the accumulated rewards. Use the "Unstake" button in the pool interface to withdraw your tokens.'})]})]})}),(0,s.jsx)("div",{className:"flex justify-end mt-4",children:(0,s.jsx)(g.GG,{asChild:!0,children:(0,s.jsx)(f.z,{className:"bg-primary text-black hover:bg-primary/90",children:"Got it"})})})]})})]})}}},function(e){e.O(0,[9221,5666,6456,3043,5465,6525,2888,9774,179],function(){return e(e.s=5673)}),_N_E=e.O()}]);