text: (this["webpackJsonppancake-frontend"]=this["webpackJsonppancake-frontend"]||[]).push([[15],{1155:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return jr}));var r,c=n(12),i=n(21),a=n(28),s=n(0),o=n.n(s),l=n(53),d=n(43),b=n(16),j=n.n(b),u=n(17),x=n(5),O=n(11),p=n(283),h=n(169),m=n(37),f=n(143),g=n(47),v=n(280),y=n(24),k=n(33),w=n(284),C=n(174),S=n(18),L=n(399),q={latin_map:{"\u03c4":"t","\u03a4":"T"}},A=function(e){return e.replace(/[^A-Za-z0-9[\] ]/g,(function(e){return q.latin_map[e]||e}))},T=n(413),D=n(160),R=n(916),F=n(2),P=O.e.div(r||(r=Object(a.a)(["\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  cursor: pointer;\n\n  svg {\n    fill: ",";\n  }\n"])),(function(e){return e.theme.colors.primary})),B=function(e){var t=e.onClick,n=e.expanded,r=Object(y.b)().t;return Object(F.jsxs)(P,{"aria-label":r("Hide or show expandable content"),role:"button",onClick:function(){return t()},children:[Object(F.jsx)(x.Ob,{color:"primary",bold:!0,children:r(n?"Hide":"Details")}),n?Object(F.jsx)(x.I,{}):Object(F.jsx)(x.F,{})]})};B.defaultProps={expanded:!1};var E,U,z,N,Q,I,M,V,G,H,K,W,X,Y,$,_,J,Z,ee,te,ne,re,ce,ie,ae,se,oe,le,de,be,je,ue,xe,Oe,pe,he,me,fe,ge,ve,ye,ke,we,Ce,Se,Le,qe,Ae,Te,De,Re,Fe,Pe,Be,Ee,Ue=B,ze=n(50),Ne=function(e){var t=e.quoteTokenAddress,n=e.tokenAddress,r=Object(S.Ab)(),c=t?t[56]:null,i=n?n[56]:null,a=i&&i!==r?i:"BNB";return"".concat(c&&c!==r?c:"BNB","/").concat(a)},Qe=O.e.div(E||(E=Object(a.a)(["\n  margin-top: 24px;\n"]))),Ie=Object(O.e)(x.cb)(U||(U=Object(a.a)(["\n  font-weight: 400;\n"]))),Me=function(e){var t=e.bscScanAddress,n=e.infoAddress,r=e.removed,c=e.totalValueFormatted,i=e.lpLabel,a=e.addLiquidityUrl,s=Object(y.b)().t;return Object(F.jsxs)(Qe,{children:[Object(F.jsxs)(x.R,{justifyContent:"space-between",children:[Object(F.jsxs)(x.Ob,{children:[s("Total Liquidity"),":"]}),Object(F.jsx)(x.Ob,{children:c})]}),!r&&Object(F.jsx)(Ie,{href:a,children:s("Get %symbol%",{symbol:i})}),Object(F.jsx)(Ie,{href:t,children:s("View Contract")}),Object(F.jsx)(Ie,{href:n,children:s("See Pair Info")})]})},Ve=n(213),Ge=Object(O.e)(x.R)(z||(z=Object(a.a)(["\n  svg {\n    margin-right: 4px;\n  }\n"]))),He=Object(O.e)(x.Mb)(N||(N=Object(a.a)(["\n  margin-left: 4px;\n"]))),Ke=function(e){var t=e.lpLabel,n=e.multiplier,r=e.isCommunityFarm,c=e.farmImage,i=e.tokenSymbol;return Object(F.jsxs)(Ge,{justifyContent:"space-between",alignItems:"center",mb:"12px",children:[Object(F.jsx)(x.W,{src:"/images/farms/".concat(c,".svg"),alt:i,width:64,height:64}),Object(F.jsxs)(x.R,{flexDirection:"column",alignItems:"flex-end",children:[Object(F.jsx)(x.S,{mb:"4px",children:t.split(" ")[0]}),Object(F.jsxs)(x.R,{justifyContent:"center",children:[r?Object(F.jsx)(Ve.a,{}):Object(F.jsx)(Ve.c,{}),Object(F.jsx)(He,{variant:"secondary",children:n})]})]})]})},We=n(3),Xe=n.n(We),Ye=n(10),$e=n(22),_e=n(30),Je=n(279),Ze=n(125),et=n(170),tt=n(282),nt=n(888),rt=O.e.div(Q||(Q=Object(a.a)(["\n  display: flex;\n  flex-direction: column;\n  background-color: ",";\n  border-radius: 16px;\n  box-shadow: ",";\n  color: ",";\n  padding: 8px 16px 8px 0;\n  width: 100%;\n"])),(function(e){return e.theme.colors.input}),(function(e){var t=e.isWarning,n=void 0!==t&&t,r=e.theme;return n?r.shadows.warning:r.shadows.inset}),(function(e){return e.theme.colors.text})),ct=Object(O.e)(x.Y)(I||(I=Object(a.a)(["\n  box-shadow: none;\n  width: 60px;\n  margin: 0 8px;\n  padding: 0 8px;\n\n  "," {\n    width: 80px;\n  }\n\n  "," {\n    width: auto;\n  }\n"])),(function(e){return e.theme.mediaQueries.xs}),(function(e){return e.theme.mediaQueries.sm})),it=Object(O.e)(x.Ob)(M||(M=Object(a.a)(["\n  position: absolute;\n  bottom: -22px;\n  a {\n    display: inline;\n  }\n"]))),at=function(e){var t=e.max,n=e.symbol,r=e.onChange,c=e.onSelectMax,i=e.value,a=e.addLiquidityUrl,s=e.inputTitle,o=Object(y.b)().t,l="0"===t||!t;return Object(F.jsxs)("div",{style:{position:"relative"},children:[Object(F.jsxs)(rt,{isWarning:l,children:[Object(F.jsxs)(x.R,{justifyContent:"space-between",pl:"16px",children:[Object(F.jsx)(x.Ob,{fontSize:"14px",children:s}),Object(F.jsx)(x.Ob,{fontSize:"14px",children:o("Balance: %balance%",{balance:function(e){if(l)return"0";var t=Number(e);return t>0&&t<1e-4?t.toLocaleString(void 0,{maximumFractionDigits:20}):t.toLocaleString()}(t)})})]}),Object(F.jsxs)(x.R,{alignItems:"flex-end",justifyContent:"space-around",children:[Object(F.jsx)(ct,{pattern:"^[0-9]*[.,]?[0-9]*$",inputMode:"decimal",step:"any",min:"0",onChange:r,placeholder:"0",value:i}),Object(F.jsx)(x.q,{scale:"sm",onClick:c,mr:"8px",children:o("Max")}),Object(F.jsx)(x.Ob,{fontSize:"16px",children:n})]})]}),l&&Object(F.jsxs)(it,{fontSize:"14px",color:"failure",children:[o("No tokens to stake"),":"," ",Object(F.jsx)(x.bb,{fontSize:"14px",bold:!1,href:a,external:!0,color:"failure",children:o("Get %symbol%",{symbol:n})})]})]})},st=function(e){var t=e.max,n=e.onConfirm,r=e.onDismiss,c=e.tokenName,a=void 0===c?"":c,o=e.addLiquidityUrl,l=Object(s.useState)(""),d=Object(i.a)(l,2),b=d[0],u=d[1],O=Object(s.useState)(!1),p=Object(i.a)(O,2),h=p[0],m=p[1],f=Object(y.b)().t,g=Object(s.useMemo)((function(){return Object(k.e)(t)}),[t]),v=new j.a(b),w=new j.a(g),C=Object(s.useCallback)((function(e){e.currentTarget.validity.valid&&u(e.currentTarget.value.replace(/,/g,"."))}),[u]),S=Object(s.useCallback)((function(){u(g)}),[g,u]);return Object(F.jsxs)(x.nb,{title:f("Stake LP tokens"),onDismiss:r,children:[Object(F.jsx)(at,{value:b,onSelectMax:S,onChange:C,max:g,symbol:a,addLiquidityUrl:o,inputTitle:f("Stake")}),Object(F.jsxs)(nt.a,{children:[Object(F.jsx)(x.q,{variant:"secondary",onClick:r,width:"100%",disabled:h,children:f("Cancel")}),Object(F.jsx)(x.q,{width:"100%",disabled:h||!v.isFinite()||v.eq(0)||v.gt(w),onClick:Object(Ye.a)(Xe.a.mark((function e(){return Xe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return m(!0),e.next=3,n(b);case 3:m(!1),r();case 5:case"end":return e.stop()}}),e)}))),children:f(h?"Pending Confirmation":"Confirm")})]}),Object(F.jsx)(x.cb,{href:o,style:{alignSelf:"center"},children:f("Get %symbol%",{symbol:a})})]})},ot=function(e){var t=e.onConfirm,n=e.onDismiss,r=e.max,c=e.tokenName,a=void 0===c?"":c,o=Object(s.useState)(""),l=Object(i.a)(o,2),d=l[0],b=l[1],u=Object(s.useState)(!1),O=Object(i.a)(u,2),p=O[0],h=O[1],m=Object(y.b)().t,f=Object(s.useMemo)((function(){return Object(k.e)(r)}),[r]),g=new j.a(d),v=new j.a(f),w=Object(s.useCallback)((function(e){e.currentTarget.validity.valid&&b(e.currentTarget.value.replace(/,/g,"."))}),[b]),C=Object(s.useCallback)((function(){b(f)}),[f,b]);return Object(F.jsxs)(x.nb,{title:m("Unstake LP tokens"),onDismiss:n,children:[Object(F.jsx)(at,{onSelectMax:C,onChange:w,value:d,max:f,symbol:a,inputTitle:m("Unstake")}),Object(F.jsxs)(nt.a,{children:[Object(F.jsx)(x.q,{variant:"secondary",onClick:n,width:"100%",disabled:p,children:m("Cancel")}),Object(F.jsx)(x.q,{disabled:p||!g.isFinite()||g.eq(0)||g.gt(v),onClick:Object(Ye.a)(Xe.a.mark((function e(){return Xe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h(!0),e.next=3,t(d);case 3:h(!1),n();case 5:case"end":return e.stop()}}),e)}))),width:"100%",children:m(p?"Pending Confirmation":"Confirm")})]})]})},lt=O.e.div(V||(V=Object(a.a)(["\n  display: flex;\n  svg {\n    width: 20px;\n  }\n"]))),dt=function(e){var t=e.stakedBalance,n=e.tokenBalance,r=e.tokenName,c=e.pid,a=e.addLiquidityUrl,o=Object(y.b)().t,d=Object(et.a)(c).onStake,b=Object(tt.a)(c).onUnstake,j=Object(l.g)(),u=Object(s.useCallback)((function(){var e=Object(k.c)(t);return e>0&&e<1e-4?Object(k.e)(t).toLocaleString():e.toLocaleString()}),[t]),O=Object(x.ic)(Object(F.jsx)(st,{max:n,onConfirm:d,tokenName:r,addLiquidityUrl:a})),p=Object(i.a)(O,1)[0],h=Object(x.ic)(Object(F.jsx)(ot,{max:t,onConfirm:b,tokenName:r})),m=Object(i.a)(h,1)[0];return Object(F.jsxs)(x.R,{justifyContent:"space-between",alignItems:"center",children:[Object(F.jsx)(x.S,{color:t.eq(0)?"textDisabled":"text",children:u()}),t.eq(0)?Object(F.jsx)(x.q,{onClick:p,disabled:["history","archived"].some((function(e){return j.pathname.includes(e)})),children:o("Stake LP")}):Object(F.jsxs)(lt,{children:[Object(F.jsx)(x.V,{variant:"tertiary",onClick:m,mr:"6px",children:Object(F.jsx)(x.mb,{color:"primary",width:"14px"})}),Object(F.jsx)(x.V,{variant:"tertiary",onClick:p,disabled:["history","archived"].some((function(e){return j.pathname.includes(e)})),children:Object(F.jsx)(x.a,{color:"primary",width:"14px"})})]})]})},bt=n(278),jt=n(903),ut=function(e){var t=e.earnings,n=e.pid,r=Object(u.c)().account,c=Object(y.b)().t,a=Object(s.useState)(!1),o=Object(i.a)(a,2),l=o[0],d=o[1],b=Object(bt.b)(n).onReward,O=Object(m.G)(),p=r?Object(k.c)(t):0,h=p.toLocaleString(),f=p?new j.a(p).multipliedBy(O).toNumber():0;return Object(F.jsxs)(x.R,{mb:"8px",justifyContent:"space-between",alignItems:"center",children:[Object(F.jsxs)(x.S,{color:0===p?"textDisabled":"text",children:[h,f>0&&Object(F.jsx)(jt.a,{value:f})]}),Object(F.jsx)(x.q,{disabled:0===p||l,onClick:Object(Ye.a)(Xe.a.mark((function e(){return Xe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d(!0),e.next=3,b();case 3:d(!1);case 4:case"end":return e.stop()}}),e)}))),children:c("Harvest")})]})},xt=O.e.div(G||(G=Object(a.a)(["\n  padding-top: 16px;\n"]))),Ot=function(e){var t=e.farm,n=e.account,r=e.addLiquidityUrl,c=Object(y.b)().t,a=Object(s.useState)(!1),o=Object(i.a)(a,2),l=o[0],d=o[1],b=t.pid,u=t.lpAddresses,O=t.userData||{},p=O.allowance,h=void 0===p?0:p,m=O.tokenBalance,f=void 0===m?0:m,g=O.stakedBalance,v=void 0===g?0:g,k=O.earnings,w=void 0===k?0:k,C=new j.a(h),L=new j.a(f),q=new j.a(v),A=new j.a(w),T=Object(S.a)(u),D=t.lpSymbol.toUpperCase(),R=n&&C&&C.isGreaterThan(0),P=Object(_e.a)(),B=Object($e.a)(T,P),E=Object(Je.a)(B).onApprove,U=Object(s.useCallback)(Object(Ye.a)(Xe.a.mark((function e(){return Xe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,d(!0),e.next=4,E();case 4:d(!1),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),[E]);return Object(F.jsxs)(xt,{children:[Object(F.jsxs)(x.R,{children:[Object(F.jsx)(x.Ob,{bold:!0,textTransform:"uppercase",color:"secondary",fontSize:"12px",pr:"3px",children:"CAKE"}),Object(F.jsx)(x.Ob,{bold:!0,textTransform:"uppercase",color:"textSubtle",fontSize:"12px",children:c("Earned")})]}),Object(F.jsx)(ut,{earnings:A,pid:b}),Object(F.jsxs)(x.R,{children:[Object(F.jsx)(x.Ob,{bold:!0,textTransform:"uppercase",color:"secondary",fontSize:"12px",pr:"3px",children:D}),Object(F.jsx)(x.Ob,{bold:!0,textTransform:"uppercase",color:"textSubtle",fontSize:"12px",children:c("Staked")})]}),n?R?Object(F.jsx)(dt,{stakedBalance:q,tokenBalance:L,tokenName:D,pid:b,addLiquidityUrl:r}):Object(F.jsx)(x.q,{mt:"8px",width:"100%",disabled:l,onClick:U,children:c("Approve Contract")}):Object(F.jsx)(Ze.a,{mt:"8px",width:"100%"})]})},pt=n(285),ht=function(e){var t=e.lpLabel,n=e.cakePrice,r=e.apr,c=e.addLiquidityUrl,a=Object(y.b)().t,s=Object(x.ic)(Object(F.jsx)(pt.a,{linkLabel:a("Get %symbol%",{symbol:t}),tokenPrice:n.toNumber(),apr:r,linkHref:c})),o=Object(i.a)(s,1)[0];return Object(F.jsx)(x.V,{onClick:function(e){e.stopPropagation(),o()},variant:"text",scale:"sm",ml:"4px",children:Object(F.jsx)(x.t,{width:"18px"})})},mt=Object(O.f)(H||(H=Object(a.a)(["  \n  0% {\n    background-position: 50% 0%;\n  }\n  50% {\n    background-position: 50% 100%;\n  }\n  100% {\n    background-position: 50% 0%;\n  }\n"]))),ft=O.e.div(K||(K=Object(a.a)(["\n  background: ",";\n  background-size: 400% 400%;\n  animation: "," 2s linear infinite;\n  border-radius: 32px;\n  position: absolute;\n  top: -1px;\n  right: -1px;\n  bottom: -3px;\n  left: -1px;\n  z-index: -1;\n"])),(function(e){var t=e.theme;return"linear-gradient(180deg, ".concat(t.colors.primaryBright,", ").concat(t.colors.secondary,")")}),mt),gt=O.e.div(W||(W=Object(a.a)(["\n  align-self: baseline;\n  background: ",";\n  border-radius: ",";\n  box-shadow: 0px 1px 4px rgba(25, 19, 38, 0.15);\n  display: flex;\n  flex-direction: column;\n  justify-content: space-around;\n  padding: 24px;\n  position: relative;\n  text-align: center;\n"])),(function(e){return e.theme.card.background}),(function(e){var t=e.theme;return e.isPromotedFarm?"31px":t.radii.card})),vt=O.e.div(X||(X=Object(a.a)(["\n  background-color: ",";\n  height: 1px;\n  margin: 28px auto;\n  width: 100%;\n"])),(function(e){return e.theme.colors.borderColor})),yt=O.e.div(Y||(Y=Object(a.a)(["\n  height: ",";\n  overflow: hidden;\n"])),(function(e){return e.expanded?"100%":"0px"})),kt=function(e){var t=e.farm,n=e.removed,r=e.cakePrice,c=e.account,a=Object(y.b)().t,o=Object(s.useState)(!1),l=Object(i.a)(o,2),d=l[0],b=l[1],j=t.lpSymbol.split(" ")[0].toLocaleLowerCase(),u=t.liquidity?"$".concat(t.liquidity.toNumber().toLocaleString(void 0,{maximumFractionDigits:0})):"-",O=t.lpSymbol&&t.lpSymbol.toUpperCase().replace("PANCAKE",""),p=t.dual?t.dual.earnLabel:"CAKE",h=t.apr&&t.apr.toLocaleString("en-US",{maximumFractionDigits:2}),m=Ne({quoteTokenAddress:t.quoteToken.address,tokenAddress:t.token.address}),f="".concat(ze.a,"/").concat(m),g=t.lpAddresses[56],v="CAKE"===t.token.symbol;return Object(F.jsxs)(gt,{isPromotedFarm:v,children:[v&&Object(F.jsx)(ft,{}),Object(F.jsx)(Ke,{lpLabel:O,multiplier:t.multiplier,isCommunityFarm:t.isCommunity,farmImage:j,tokenSymbol:t.token.symbol}),!n&&Object(F.jsxs)(x.R,{justifyContent:"space-between",alignItems:"center",children:[Object(F.jsxs)(x.Ob,{children:[a("APR"),":"]}),Object(F.jsx)(x.Ob,{bold:!0,style:{display:"flex",alignItems:"center"},children:t.apr?Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(ht,{lpLabel:O,addLiquidityUrl:f,cakePrice:r,apr:t.apr}),h,"%"]}):Object(F.jsx)(x.Fb,{height:24,width:80})})]}),Object(F.jsxs)(x.R,{justifyContent:"space-between",children:[Object(F.jsxs)(x.Ob,{children:[a("Earn"),":"]}),Object(F.jsx)(x.Ob,{bold:!0,children:p})]}),Object(F.jsx)(Ot,{farm:t,account:c,addLiquidityUrl:f}),Object(F.jsx)(vt,{}),Object(F.jsx)(Ue,{onClick:function(){return b(!d)},expanded:d}),Object(F.jsx)(yt,{expanded:d,children:Object(F.jsx)(Me,{removed:n,bscScanAddress:"https://bscscan.com/address/".concat(t.lpAddresses[56]),infoAddress:"https://pancakeswap.info/pair/".concat(g),totalValueFormatted:u,lpLabel:O,addLiquidityUrl:f})})]})},wt=function(e,t){var n=Object(s.useState)(!1),r=Object(i.a)(n,2),c=r[0],a=r[1];return Object(s.useEffect)((function(){var n;return e&&!c?a(!0):!e&&c&&(n=setTimeout((function(){return a(!1)}),t)),function(){return clearTimeout(n)}}),[e,t,c]),c},Ct=O.e.div($||($=Object(a.a)(["\n  display: flex;\n  align-items: center;\n  color: ",";\n\n  button {\n    width: 20px;\n    height: 20px;\n\n    svg {\n      path {\n        fill: ",";\n      }\n    }\n  }\n"])),(function(e){return e.theme.colors.text}),(function(e){return e.theme.colors.textSubtle})),St=O.e.div(_||(_=Object(a.a)(["\n  min-width: 60px;\n  text-align: left;\n"]))),Lt=function(e){var t=e.value,n=e.lpLabel,r=e.tokenAddress,c=e.quoteTokenAddress,i=e.cakePrice,a=e.originalValue,s=e.hideButton,o=void 0!==s&&s,l=Ne({quoteTokenAddress:c,tokenAddress:r}),d="".concat(ze.a,"/").concat(l);return 0!==a?Object(F.jsx)(Ct,{children:a?Object(F.jsxs)(F.Fragment,{children:[Object(F.jsxs)(St,{children:[t,"%"]}),!o&&Object(F.jsx)(ht,{lpLabel:n,cakePrice:i,apr:a,addLiquidityUrl:d})]}):Object(F.jsx)(St,{children:Object(F.jsx)(x.Fb,{width:60})})}):Object(F.jsx)(Ct,{children:Object(F.jsxs)(St,{children:[a,"%"]})})},qt=Object(O.e)(x.W)(J||(J=Object(a.a)(["\n  width: 24px;\n  height: 24px;\n\n  "," {\n    width: 40px;\n    height: 40px;\n  }\n"])),(function(e){return e.theme.mediaQueries.sm})),At=O.e.div(Z||(Z=Object(a.a)(["\n  padding-left: 16px;\n  display: flex;\n  align-items: center;\n\n  "," {\n    padding-left: 32px;\n  }\n"])),(function(e){return e.theme.mediaQueries.sm})),Tt=function(e){var t=e.image,n=e.label,r=e.pid,c=Object(m.f)(r).stakedBalance,i=Object(y.b)().t,a=Object(k.c)(c);return Object(F.jsxs)(At,{children:[Object(F.jsx)(qt,{src:"/images/farms/".concat(t,".svg"),alt:"icon",width:40,height:40,mr:"8px"}),Object(F.jsxs)("div",{children:[a?Object(F.jsx)(x.Ob,{color:"secondary",fontSize:"12px",bold:!0,textTransform:"uppercase",children:i("Farming")}):null,Object(F.jsx)(x.Ob,{bold:!0,children:n})]})]})},Dt=O.e.span(ee||(ee=Object(a.a)(["\n  color: ",";\n  display: flex;\n  align-items: center;\n"])),(function(e){var t=e.earned,n=e.theme;return t?n.colors.text:n.colors.textDisabled})),Rt=function(e){var t=e.earnings;return e.userDataReady?Object(F.jsx)(Dt,{earned:t,children:t.toLocaleString()}):Object(F.jsx)(Dt,{earned:0,children:Object(F.jsx)(x.Fb,{width:60})})},Ft=O.e.div(te||(te=Object(a.a)(["\n  display: flex;\n  width: 100%;\n  justify-content: flex-end;\n  padding-right: 8px;\n  color: ",";\n\n  "," {\n    padding-right: 0px;\n  }\n"])),(function(e){return e.theme.colors.primary}),(function(e){return e.theme.mediaQueries.sm})),Pt=Object(O.e)(x.F)(ne||(ne=Object(a.a)(["\n  transform: ",";\n  height: 20px;\n"])),(function(e){return e.toggled?"rotate(180deg)":"rotate(0)"})),Bt=function(e){var t=e.actionPanelToggled,n=Object(y.b)().t,r=!Object(x.hc)().isXl;return Object(F.jsxs)(Ft,{children:[!r&&n("Details"),Object(F.jsx)(Pt,{color:"primary",toggled:t})]})},Et=O.e.div(re||(re=Object(a.a)(["\n  display: inline-block;\n"]))),Ut=O.e.div(ce||(ce=Object(a.a)(["\n  color: ",";\n  width: 36px;\n  text-align: right;\n  margin-right: 14px;\n\n  "," {\n    text-align: left;\n    margin-right: 0;\n  }\n"])),(function(e){return e.theme.colors.text}),(function(e){return e.theme.mediaQueries.lg})),zt=O.e.div(ie||(ie=Object(a.a)(["\n  display: flex;\n  align-items: center;\n"]))),Nt=function(e){var t=e.multiplier,n=t?t.toLowerCase():Object(F.jsx)(x.Fb,{width:30}),r=Object(y.b)().t,c=Object(F.jsxs)("div",{children:[r("The multiplier represents the amount of CAKE rewards each farm gets."),Object(F.jsx)("br",{}),Object(F.jsx)("br",{}),r("For example, if a 1x farm was getting 1 CAKE per block, a 40x farm would be getting 40 CAKE per block.")]}),i=Object(x.kc)(c,{placement:"top-end",tooltipOffset:[20,10]}),a=i.targetRef,s=i.tooltip,o=i.tooltipVisible;return Object(F.jsxs)(zt,{children:[Object(F.jsx)(Ut,{children:n}),Object(F.jsx)(Et,{ref:a,children:Object(F.jsx)(x.T,{color:"textSubtle"})}),o&&s]})},Qt=O.e.div(ae||(ae=Object(a.a)(["\n  display: inline-block;\n"]))),It=O.e.div(se||(se=Object(a.a)(["\n  min-width: 110px;\n  font-weight: 600;\n  text-align: right;\n  margin-right: 14px;\n\n  "," {\n    text-align: left;\n    margin-right: 0;\n  }\n"])),(function(e){return e.theme.mediaQueries.lg})),Mt=O.e.div(oe||(oe=Object(a.a)(["\n  display: flex;\n  align-items: center;\n"]))),Vt=function(e){var t=e.liquidity,n=t?"$".concat(Number(t).toLocaleString(void 0,{maximumFractionDigits:0})):Object(F.jsx)(x.Fb,{width:60}),r=Object(y.b)().t,c=Object(x.kc)(r("The total value of the funds in this farm\u2019s liquidity pool"),{placement:"top-end",tooltipOffset:[20,10]}),i=c.targetRef,a=c.tooltip,s=c.tooltipVisible;return Object(F.jsxs)(Mt,{children:[Object(F.jsx)(It,{children:Object(F.jsx)(x.Ob,{children:n})}),Object(F.jsx)(Qt,{ref:i,children:Object(F.jsx)(x.T,{color:"textSubtle"})}),s&&a]})},Gt=n(277),Ht=O.e.div(le||(le=Object(a.a)(["\n  padding: 16px;\n  border: 2px solid ",";\n  border-radius: 16px;\n  flex-grow: 1;\n  flex-basis: 0;\n  margin-bottom: 16px;\n\n  "," {\n    margin-left: 12px;\n    margin-right: 12px;\n    margin-bottom: 0;\n    max-height: 100px;\n  }\n\n  "," {\n    margin-left: 48px;\n    margin-right: 0;\n    margin-bottom: 0;\n    max-height: 100px;\n  }\n"])),(function(e){return e.theme.colors.input}),(function(e){return e.theme.mediaQueries.sm}),(function(e){return e.theme.mediaQueries.xl})),Kt=O.e.div(de||(de=Object(a.a)(["\n  font-weight: 600;\n  font-size: 12px;\n  margin-bottom: 8px;\n"]))),Wt=O.e.span(be||(be=Object(a.a)(["\n  color: ",";\n"])),(function(e){return e.theme.colors.secondary})),Xt=O.e.span(je||(je=Object(a.a)(["\n  color: ",";\n"])),(function(e){return e.theme.colors.textSubtle})),Yt=O.e.div(ue||(ue=Object(a.a)(["\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n"]))),$t=O.e.div(xe||(xe=Object(a.a)(["\n  font-weight: 600;\n  font-size: 20px;\n  color: ",";\n"])),(function(e){return e.theme.colors.text})),_t=O.e.div(Oe||(Oe=Object(a.a)(["\n  font-size: 12px;\n  color: ",";\n"])),(function(e){return e.theme.colors.textSubtle})),Jt=function(e){var t=e.pid,n=e.userData,r=e.userDataReady,c=new j.a(n.earnings),a=Object(m.G)(),o=0,l=0,d=r?o.toLocaleString():Object(F.jsx)(x.Fb,{width:60});c.isZero()||(o=Object(k.c)(c),l=new j.a(o).multipliedBy(a).toNumber(),d=o.toLocaleString());var b=Object(s.useState)(!1),u=Object(i.a)(b,2),O=u[0],p=u[1],h=Object(bt.b)(t).onReward,f=Object(y.b)().t,g=Object(Gt.useCountUp)({start:0,end:l,duration:1,separator:",",decimals:3}),v=g.countUp,w=g.update,C=Object(s.useRef)(w);return Object(s.useEffect)((function(){C.current(l)}),[l,C]),Object(F.jsxs)(Ht,{children:[Object(F.jsxs)(Kt,{children:[Object(F.jsx)(Wt,{children:"CAKE "}),Object(F.jsx)(Xt,{children:f("Earned").toUpperCase()})]}),Object(F.jsxs)(Yt,{children:[Object(F.jsxs)("div",{children:[Object(F.jsx)($t,{children:d}),v>0&&Object(F.jsxs)(_t,{children:["~",v,"USD"]})]}),Object(F.jsx)(x.q,{disabled:!o||O||!r,onClick:Object(Ye.a)(Xe.a.mark((function e(){return Xe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p(!0),e.next=3,h();case 3:p(!1);case 4:case"end":return e.stop()}}),e)}))),ml:"4px",children:f("Harvest")})]})]})},Zt=O.e.div(pe||(pe=Object(a.a)(["\n  display: flex;\n"]))),en=function(e){var t=e.pid,n=e.lpSymbol,r=e.lpAddresses,c=e.quoteToken,a=e.token,o=e.userDataReady,d=Object(y.b)().t,b=Object(u.c)().account,j=Object(s.useState)(!1),O=Object(i.a)(j,2),p=O[0],h=O[1],f=Object(m.f)(t),g=f.allowance,v=f.tokenBalance,w=f.stakedBalance,C=Object(et.a)(t).onStake,S=Object(tt.a)(t).onUnstake,L=Object(_e.a)(),q=Object(l.g)(),A=b&&g&&g.isGreaterThan(0),T=r[56],D=Ne({quoteTokenAddress:c.address,tokenAddress:a.address}),R="".concat(ze.a,"/").concat(D),P=Object(s.useCallback)((function(){var e=Object(k.c)(w);return e>0&&e<1e-4?Object(k.e)(w).toLocaleString():e.toLocaleString()}),[w]),B=Object(x.ic)(Object(F.jsx)(st,{max:v,onConfirm:C,tokenName:n,addLiquidityUrl:R})),E=Object(i.a)(B,1)[0],U=Object(x.ic)(Object(F.jsx)(ot,{max:w,onConfirm:S,tokenName:n})),z=Object(i.a)(U,1)[0],N=Object($e.a)(T,L),Q=Object(Je.a)(N).onApprove,I=Object(s.useCallback)(Object(Ye.a)(Xe.a.mark((function e(){return Xe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,h(!0),e.next=4,Q();case 4:h(!1),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),[Q]);return b?A?w.gt(0)?Object(F.jsxs)(Ht,{children:[Object(F.jsxs)(Kt,{children:[Object(F.jsxs)(Wt,{children:[n," "]}),Object(F.jsx)(Xt,{children:d("Staked").toUpperCase()})]}),Object(F.jsxs)(Yt,{children:[Object(F.jsx)("div",{children:Object(F.jsx)($t,{children:P()})}),Object(F.jsxs)(Zt,{children:[Object(F.jsx)(x.V,{variant:"secondary",onClick:z,mr:"6px",children:Object(F.jsx)(x.mb,{color:"primary",width:"14px"})}),Object(F.jsx)(x.V,{variant:"secondary",onClick:E,disabled:["history","archived"].some((function(e){return q.pathname.includes(e)})),children:Object(F.jsx)(x.a,{color:"primary",width:"14px"})})]})]})]}):Object(F.jsxs)(Ht,{children:[Object(F.jsxs)(Kt,{children:[Object(F.jsxs)(Xt,{children:[d("Stake").toUpperCase()," "]}),Object(F.jsx)(Wt,{children:n})]}),Object(F.jsx)(Yt,{children:Object(F.jsx)(x.q,{width:"100%",onClick:E,variant:"secondary",disabled:["history","archived"].some((function(e){return q.pathname.includes(e)})),children:d("Stake LP")})})]}):o?Object(F.jsxs)(Ht,{children:[Object(F.jsx)(Kt,{children:Object(F.jsx)(Xt,{children:d("Enable Farm").toUpperCase()})}),Object(F.jsx)(Yt,{children:Object(F.jsx)(x.q,{width:"100%",disabled:p,onClick:I,variant:"secondary",children:d("Enable")})})]}):Object(F.jsxs)(Ht,{children:[Object(F.jsx)(Kt,{children:Object(F.jsx)(Xt,{children:d("Start Farming").toUpperCase()})}),Object(F.jsx)(Yt,{children:Object(F.jsx)(x.Fb,{width:180,marginBottom:28,marginTop:14})})]}):Object(F.jsxs)(Ht,{children:[Object(F.jsx)(Kt,{children:Object(F.jsx)(Xt,{children:d("Start Farming").toUpperCase()})}),Object(F.jsx)(Yt,{children:Object(F.jsx)(Ze.a,{width:"100%"})})]})},tn=Object(O.f)(he||(he=Object(a.a)(["\n  from {\n    max-height: 0px;\n  }\n  to {\n    max-height: 500px;\n  }\n"]))),nn=Object(O.f)(me||(me=Object(a.a)(["\n  from {\n    max-height: 500px;\n  }\n  to {\n    max-height: 0px;\n  }\n"]))),rn=O.e.div(fe||(fe=Object(a.a)(["\n  animation: ",";\n  overflow: hidden;\n  background: ",";\n  display: flex;\n  width: 100%;\n  flex-direction: column-reverse;\n  padding: 24px;\n\n  "," {\n    flex-direction: row;\n    padding: 16px 32px;\n  }\n"])),(function(e){return e.expanded?Object(O.d)(ge||(ge=Object(a.a)(["\n          "," 300ms linear forwards\n        "])),tn):Object(O.d)(ve||(ve=Object(a.a)(["\n          "," 300ms linear forwards\n        "])),nn)}),(function(e){return e.theme.colors.background}),(function(e){return e.theme.mediaQueries.lg})),cn=Object(O.e)(x.cb)(ye||(ye=Object(a.a)(["\n  font-weight: 400;\n"]))),an=O.e.div(ke||(ke=Object(a.a)(["\n  color: ",";\n  align-items: center;\n  display: flex;\n  justify-content: space-between;\n\n  "," {\n    justify-content: flex-start;\n  }\n"])),(function(e){return e.theme.colors.text}),(function(e){return e.theme.mediaQueries.sm})),sn=O.e.div(we||(we=Object(a.a)(["\n  display: flex;\n  align-items: center;\n  margin-top: 25px;\n\n  "," {\n    margin-top: 16px;\n  }\n\n  > div {\n    height: 24px;\n    padding: 0 6px;\n    font-size: 14px;\n    margin-right: 4px;\n\n    svg {\n      width: 14px;\n    }\n  }\n"])),(function(e){return e.theme.mediaQueries.sm})),on=O.e.div(Ce||(Ce=Object(a.a)(["\n  display: flex;\n  flex-direction: column;\n\n  "," {\n    flex-direction: row;\n    align-items: center;\n    flex-grow: 1;\n    flex-basis: 0;\n  }\n"])),(function(e){return e.theme.mediaQueries.sm})),ln=O.e.div(Se||(Se=Object(a.a)(["\n  min-width: 200px;\n"]))),dn=O.e.div(Le||(Le=Object(a.a)(["\n  display: block;\n\n  "," {\n    display: none;\n  }\n"])),(function(e){return e.theme.mediaQueries.lg})),bn=O.e.div(qe||(qe=Object(a.a)(["\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  margin: 4px 0px;\n"]))),jn=function(e){var t=e.details,n=e.apr,r=e.multiplier,i=e.liquidity,a=e.userDataReady,s=e.expanded,o=t,l=Object(y.b)().t,d="0X"!==o.multiplier,b=o.quoteToken,j=o.token,u=o.dual,O=o.lpSymbol&&o.lpSymbol.toUpperCase().replace("PANCAKE",""),p=Ne({quoteTokenAddress:b.address,tokenAddress:j.address}),h=o.lpAddresses[56],m="https://bscscan.com/address/".concat(h),f="https://pancakeswap.info/pair/".concat(h);return Object(F.jsxs)(rn,{expanded:s,children:[Object(F.jsxs)(ln,{children:[d&&Object(F.jsx)(an,{children:Object(F.jsx)(cn,{href:"https://exchange.pancakeswap.finance/#/add/".concat(p),children:l("Get %symbol%",{symbol:O})})}),Object(F.jsx)(cn,{href:m,children:l("View Contract")}),Object(F.jsx)(cn,{href:f,children:l("See Pair Info")}),Object(F.jsxs)(sn,{children:[o.isCommunity?Object(F.jsx)(Ve.a,{}):Object(F.jsx)(Ve.c,{}),u?Object(F.jsx)(Ve.d,{}):null]})]}),Object(F.jsxs)(dn,{children:[Object(F.jsxs)(bn,{children:[Object(F.jsx)(x.Ob,{children:l("APR")}),Object(F.jsx)(Lt,Object(c.a)({},n))]}),Object(F.jsxs)(bn,{children:[Object(F.jsx)(x.Ob,{children:l("Multiplier")}),Object(F.jsx)(Nt,Object(c.a)({},r))]}),Object(F.jsxs)(bn,{children:[Object(F.jsx)(x.Ob,{children:l("Liquidity")}),Object(F.jsx)(Vt,Object(c.a)({},i))]})]}),Object(F.jsxs)(on,{children:[Object(F.jsx)(Jt,Object(c.a)(Object(c.a)({},o),{},{userDataReady:a})),Object(F.jsx)(en,Object(c.a)(Object(c.a)({},o),{},{userDataReady:a}))]})]})},un=O.e.div(Ae||(Ae=Object(a.a)(["\n  font-size: 12px;\n  color: ",";\n  text-align: left;\n"])),(function(e){return e.theme.colors.textSubtle})),xn=O.e.div(Te||(Te=Object(a.a)(["\n  min-height: 24px;\n  display: flex;\n  align-items: center;\n"]))),On=function(e){var t=e.label,n=void 0===t?"":t,r=e.children;return Object(F.jsxs)("div",{children:[n&&Object(F.jsx)(un,{children:n}),Object(F.jsx)(xn,{children:r})]})},pn=[{id:1,name:"farm",sortable:!0,label:""},{id:2,name:"earned",sortable:!0,label:"Earned"},{id:3,name:"apr",sortable:!0,label:"APR"},{id:6,name:"details",sortable:!0,label:""}],hn=[{id:1,name:"farm",sortable:!0,label:""},{id:2,name:"earned",sortable:!0,label:"Earned"},{id:3,name:"apr",sortable:!0,label:"APR"},{id:4,name:"liquidity",sortable:!0,label:"Liquidity"},{id:5,name:"multiplier",sortable:!0,label:"Multiplier"},{id:6,name:"details",sortable:!0,label:""}];!function(e){e.TABLE="TABLE",e.CARD="CARD"}(De||(De={}));var mn,fn,gn,vn,yn,kn,wn,Cn,Sn,Ln,qn,An,Tn,Dn,Rn,Fn,Pn,Bn={apr:Lt,farm:Tt,earned:Rt,details:Bt,multiplier:Nt,liquidity:Vt},En=O.e.div(Re||(Re=Object(a.a)(["\n  padding: 24px 0px;\n  display: flex;\n  width: 100%;\n  align-items: center;\n  padding-right: 8px;\n\n  "," {\n    padding-right: 32px;\n  }\n"])),(function(e){return e.theme.mediaQueries.xl})),Un=O.e.tr(Fe||(Fe=Object(a.a)(["\n  cursor: pointer;\n  border-bottom: 2px solid ",";\n"])),(function(e){return e.theme.colors.borderColor})),zn=O.e.td(Pe||(Pe=Object(a.a)(["\n  padding: 16px 0 24px 16px;\n"]))),Nn=O.e.td(Be||(Be=Object(a.a)(["\n  padding-top: 16px;\n  padding-bottom: 24px;\n"]))),Qn=O.e.td(Ee||(Ee=Object(a.a)(["\n  padding-top: 24px;\n"]))),In=function(e){var t=e.details,n=e.userDataReady,r=!!Object(m.f)(t.pid).stakedBalance.toNumber(),a=Object(s.useState)(r),l=Object(i.a)(a,2),d=l[0],b=l[1],j=wt(d,300),u=Object(y.b)().t,O=function(){b(!d)};Object(s.useEffect)((function(){b(r)}),[r]);var p=Object(x.hc)(),h=p.isXl,f=p.isXs,g=!h,v=g?pn:hn,k=v.map((function(e){return e.name}));return Object(F.jsxs)(F.Fragment,{children:[f?Object(F.jsxs)(Un,{onClick:O,children:[Object(F.jsxs)("td",{children:[Object(F.jsx)("tr",{children:Object(F.jsx)(Qn,{children:Object(F.jsx)(On,{children:Object(F.jsx)(Tt,Object(c.a)({},e.farm))})})}),Object(F.jsxs)("tr",{children:[Object(F.jsx)(zn,{children:Object(F.jsx)(On,{label:u("Earned"),children:Object(F.jsx)(Rt,Object(c.a)(Object(c.a)({},e.earned),{},{userDataReady:n}))})}),Object(F.jsx)(Nn,{children:Object(F.jsx)(On,{label:u("APR"),children:Object(F.jsx)(Lt,Object(c.a)(Object(c.a)({},e.apr),{},{hideButton:!0}))})})]})]}),Object(F.jsx)("td",{children:Object(F.jsx)(En,{children:Object(F.jsx)(On,{children:Object(F.jsx)(Bt,{actionPanelToggled:d})})})})]}):Object(F.jsx)(Un,{onClick:O,children:Object.keys(e).map((function(t){var r=k.indexOf(t);if(-1===r)return null;switch(t){case"details":return Object(F.jsx)("td",{children:Object(F.jsx)(En,{children:Object(F.jsx)(On,{children:Object(F.jsx)(Bt,{actionPanelToggled:d})})})},t);case"apr":return Object(F.jsx)("td",{children:Object(F.jsx)(En,{children:Object(F.jsx)(On,{label:u("APR"),children:Object(F.jsx)(Lt,Object(c.a)(Object(c.a)({},e.apr),{},{hideButton:g}))})})},t);default:return Object(F.jsx)("td",{children:Object(F.jsx)(En,{children:Object(F.jsx)(On,{label:u(v[r].label),children:o.a.createElement(Bn[t],Object(c.a)(Object(c.a)({},e[t]),{},{userDataReady:n}))})})},t)}}))}),j&&Object(F.jsx)("tr",{children:Object(F.jsx)("td",{colSpan:6,children:Object(F.jsx)(jn,Object(c.a)(Object(c.a)({},e),{},{expanded:d}))})})]})},Mn=O.e.div(mn||(mn=Object(a.a)(["\n  filter: ",";\n  width: 100%;\n  background: ",";\n  border-radius: 16px;\n  margin: 16px 0px;\n"])),(function(e){return e.theme.card.dropShadow}),(function(e){return e.theme.card.background})),Vn=O.e.div(fn||(fn=Object(a.a)(["\n  overflow: visible;\n\n  &::-webkit-scrollbar {\n    display: none;\n  }\n"]))),Gn=O.e.table(gn||(gn=Object(a.a)(["\n  border-collapse: collapse;\n  font-size: 14px;\n  border-radius: 4px;\n  margin-left: auto;\n  margin-right: auto;\n  width: 100%;\n"]))),Hn=O.e.tbody(vn||(vn=Object(a.a)(["\n  & tr {\n    td {\n      font-size: 16px;\n      vertical-align: middle;\n    }\n  }\n"]))),Kn=O.e.div(yn||(yn=Object(a.a)(["\n  position: relative;\n"]))),Wn=O.e.div(kn||(kn=Object(a.a)(["\n  display: flex;\n  justify-content: center;\n  padding-top: 5px;\n  padding-bottom: 5px;\n"]))),Xn=function(e){var t=Object(s.useRef)(null),n=Object(y.b)().t,r=e.data,i=e.columns,a=e.userDataReady,o=Object(x.jc)(i,r,{sortable:!0,sortColumn:"farm"}).rows;return Object(F.jsx)(Mn,{children:Object(F.jsxs)(Kn,{children:[Object(F.jsx)(Vn,{ref:t,children:Object(F.jsx)(Gn,{children:Object(F.jsx)(Hn,{children:o.map((function(e){return Object(s.createElement)(In,Object(c.a)(Object(c.a)({},e.original),{},{userDataReady:a,key:"table-row-".concat(e.id)}))}))})})}),Object(F.jsx)(Wn,{children:Object(F.jsxs)(x.q,{variant:"text",onClick:function(){t.current.scrollIntoView({behavior:"smooth"})},children:[n("To Top"),Object(F.jsx)(x.I,{color:"primary"})]})})]})})},Yn=n(98),$n=function(e){var t,n=e.hasStakeInFinishedFarms,r=Object(l.i)().url,c=Object(l.g)(),i=Object(y.b)().t;switch(c.pathname){case"/farms":t=0;break;case"/farms/history":t=1;break;case"/farms/archived":t=2;break;default:t=0}return Object(F.jsx)(_n,{children:Object(F.jsxs)(x.r,{activeIndex:t,scale:"sm",variant:"subtle",children:[Object(F.jsx)(x.s,{as:Yn.a,to:"".concat(r),children:i("Live")}),Object(F.jsx)(x.vb,{show:n,children:Object(F.jsx)(x.s,{as:Yn.a,to:"".concat(r,"/history"),children:i("Finished")})})]})})},_n=O.e.div(wn||(wn=Object(a.a)(["\n  display: flex;\n  justify-content: center;\n  align-items: center;\n\n  a {\n    padding-left: 12px;\n    padding-right: 12px;\n  }\n\n  "," {\n    margin-left: 16px;\n  }\n"])),(function(e){return e.theme.mediaQueries.sm})),Jn=n(216),Zn=n.n(Jn),er=Object(O.e)(x.Y)(Cn||(Cn=Object(a.a)(["\n  border-radius: 16px;\n  margin-left: auto;\n"]))),tr=O.e.div(Sn||(Sn=Object(a.a)(["\n  position: relative;\n  "," {\n    width: 234px;\n    display: block;\n  }\n"])),(function(e){return e.theme.mediaQueries.sm})),nr=O.e.div(Ln||(Ln=Object(a.a)([""]))),rr=function(e){var t=e.onChange,n=Object(y.b)().t,r=Object(s.useState)(!1),c=Object(i.a)(r,2),a=c[0],o=c[1],l=Object(s.useState)(""),d=Object(i.a)(l,2),b=d[0],j=d[1],u=Object(s.useMemo)((function(){return Zn()((function(e){return t(e)}),500)}),[t]);return Object(F.jsx)(nr,{toggled:a,children:Object(F.jsx)(tr,{children:Object(F.jsx)(er,{value:b,onChange:function(e){j(e.target.value),u(e)},placeholder:n("Search Farms"),onBlur:function(){return o(!1)}})})})},cr=O.e.div(qn||(qn=Object(a.a)(["\n  margin-left: -8px;\n\n  "," {\n    margin-left: 0;\n  }\n"])),(function(e){return e.theme.mediaQueries.sm})),ir=function(e){var t=e.viewMode,n=e.onToggle,r=function(e){t!==e&&n(e)};return Object(F.jsxs)(cr,{children:[Object(F.jsx)(x.V,{variant:"text",scale:"sm",onClick:function(){return r(De.CARD)},children:Object(F.jsx)(x.z,{color:t===De.CARD?"primary":"textDisabled"})}),Object(F.jsx)(x.V,{variant:"text",scale:"sm",onClick:function(){return r(De.TABLE)},children:Object(F.jsx)(x.db,{color:t===De.TABLE?"primary":"textDisabled"})})]})},ar=O.e.div(An||(An=Object(a.a)(["\n  display: flex;\n  width: 100%;\n  align-items: center;\n  position: relative;\n\n  justify-content: space-between;\n  flex-direction: column;\n  margin-bottom: 32px;\n\n  "," {\n    flex-direction: row;\n    flex-wrap: wrap;\n    padding: 16px 32px;\n    margin-bottom: 0;\n  }\n"])),(function(e){return e.theme.mediaQueries.sm})),sr=O.e.div(Tn||(Tn=Object(a.a)(["\n  display: flex;\n  align-items: center;\n  margin-left: 10px;\n\n  "," {\n    margin-left: 8px;\n  }\n"])),x.Ob),or=O.e.div(Dn||(Dn=Object(a.a)(["\n  > "," {\n    font-size: 12px;\n  }\n"])),x.Ob),lr=O.e.div(Rn||(Rn=Object(a.a)(["\n  display: flex;\n  align-items: center;\n  width: 100%;\n  padding: 8px 0px;\n\n  "," {\n    width: auto;\n    padding: 0;\n  }\n"])),(function(e){return e.theme.mediaQueries.sm})),dr=O.e.div(Fn||(Fn=Object(a.a)(["\n  flex-wrap: wrap;\n  justify-content: space-between;\n  display: flex;\n  align-items: center;\n  width: 100%;\n\n  > div {\n    padding: 8px 0px;\n  }\n\n  "," {\n    justify-content: flex-start;\n    width: auto;\n\n    > div {\n      padding: 0;\n    }\n  }\n"])),(function(e){return e.theme.mediaQueries.sm})),br=Object(O.e)(x.W)(Pn||(Pn=Object(a.a)(["\n  margin-left: auto;\n  margin-right: auto;\n  margin-top: 58px;\n"]))),jr=function(){var e=Object(l.i)().path,t=Object(l.g)().pathname,n=Object(y.b)().t,r=Object(m.g)(),a=r.data,o=r.userDataLoaded,b=Object(m.G)(),O=Object(s.useState)(""),q=Object(i.a)(O,2),P=q[0],B=q[1],E=Object(v.a)(De.TABLE,"pancake_farm_view"),U=Object(i.a)(E,2),z=U[0],N=U[1],Q=Object(u.c)().account,I=Object(s.useState)("hot"),M=Object(i.a)(I,2),V=M[0],G=M[1],H=Object(m.m)(),K=Object(d.b)(),W=Object(f.a)().fastRefresh;Object(s.useEffect)((function(){Q&&K(Object(g.d)(Q))}),[Q,K,W]);var X=t.includes("archived"),Y=t.includes("history"),$=!Y&&!X,_=!Q||!!Q&&o,J=Object(s.useState)(!$),Z=Object(i.a)(J,2),ee=Z[0],te=Z[1];Object(s.useEffect)((function(){te(!$)}),[$]),Object(s.useEffect)((function(){K(Object(D.d)(X)),X&&(K(Object(D.c)()),Q&&K(Object(g.d)(Q)))}),[X,K,Q]);var ne=a.filter((function(e){return 0!==e.pid&&"0X"!==e.multiplier&&!Object(L.a)(e.pid)})),re=a.filter((function(e){return 0!==e.pid&&"0X"===e.multiplier&&!Object(L.a)(e.pid)})),ce=a.filter((function(e){return Object(L.a)(e.pid)})),ie=ne.filter((function(e){return e.userData&&new j.a(e.userData.stakedBalance).isGreaterThan(0)})),ae=re.filter((function(e){return e.userData&&new j.a(e.userData.stakedBalance).isGreaterThan(0)})),se=ce.filter((function(e){return e.userData&&new j.a(e.userData.stakedBalance).isGreaterThan(0)})),oe=Object(s.useCallback)((function(e){var t=e.map((function(e){if(!e.lpTotalInQuoteToken||!H)return e;var t=H[Object(S.a)(e.quoteToken.address).toLowerCase()],n=new j.a(e.lpTotalInQuoteToken).times(t),r=$?Object(w.a)(e.poolWeight,b,n):0;return Object(c.a)(Object(c.a)({},e),{},{apr:r,liquidity:n})}));if(P){var n=A(P.toLowerCase());t=t.filter((function(e){return A(e.lpSymbol.toLowerCase()).includes(n)}))}return t}),[b,H,P,$]),le=Object(s.useRef)(null),de=Object(s.useState)(12),be=Object(i.a)(de,2),je=be[0],ue=be[1],xe=Object(s.useState)(!1),Oe=Object(i.a)(xe,2),pe=Oe[0],he=Oe[1],me=Object(s.useMemo)((function(){var e=[];return $&&(e=oe(ee?ie:ne)),Y&&(e=oe(ee?ae:re)),X&&(e=oe(ee?se:ce)),function(e){switch(V){case"apr":return Object(C.orderBy)(e,(function(e){return e.apr}),"desc");case"multiplier":return Object(C.orderBy)(e,(function(e){return e.multiplier?Number(e.multiplier.slice(0,-1)):0}),"desc");case"earned":return Object(C.orderBy)(e,(function(e){return e.userData?Number(e.userData.earnings):0}),"desc");case"liquidity":return Object(C.orderBy)(e,(function(e){return Number(e.liquidity)}),"desc");default:return e}}(e).slice(0,je)}),[V,ne,oe,re,ce,$,Y,X,se,ae,ee,ie,je]);Object(s.useEffect)((function(){pe||(new IntersectionObserver((function(e){Object(i.a)(e,1)[0].isIntersecting&&ue((function(e){return e+12}))}),{rootMargin:"0px",threshold:1}).observe(le.current),he(!0))}),[me,pe]);var fe=me.map((function(e){var t=e.token,n=e.quoteToken,r=t.address,c=n.address,i=e.lpSymbol&&e.lpSymbol.split(" ")[0].toUpperCase().replace("PANCAKE","");return{apr:{value:e.apr&&e.apr.toLocaleString("en-US",{maximumFractionDigits:2}),multiplier:e.multiplier,lpLabel:i,tokenAddress:r,quoteTokenAddress:c,cakePrice:b,originalValue:e.apr},farm:{image:e.lpSymbol.split(" ")[0].toLocaleLowerCase(),label:i,pid:e.pid},earned:{earnings:Object(k.c)(new j.a(e.userData.earnings)),pid:e.pid},liquidity:{liquidity:e.liquidity},multiplier:{multiplier:e.multiplier},details:e}}));return Object(F.jsxs)(F.Fragment,{children:[Object(F.jsxs)(T.a,{children:[Object(F.jsx)(x.S,{as:"h1",scale:"xxl",color:"secondary",mb:"24px",children:n("Farms")}),Object(F.jsx)(x.S,{scale:"lg",color:"text",children:n("Stake Liquidity Pool (LP) tokens to earn.")})]}),Object(F.jsxs)(h.a,{children:[Object(F.jsxs)(ar,{children:[Object(F.jsxs)(dr,{children:[Object(F.jsx)(ir,{viewMode:z,onToggle:function(e){return N(e)}}),Object(F.jsxs)(sr,{children:[Object(F.jsx)(x.Tb,{checked:ee,onChange:function(){return te(!ee)},scale:"sm"}),Object(F.jsxs)(x.Ob,{children:[" ",n("Staked only")]})]}),Object(F.jsx)($n,{hasStakeInFinishedFarms:ae.length>0})]}),Object(F.jsxs)(lr,{children:[Object(F.jsxs)(or,{children:[Object(F.jsx)(x.Ob,{textTransform:"uppercase",children:n("Sort by")}),Object(F.jsx)(R.a,{options:[{label:n("Hot"),value:"hot"},{label:n("APR"),value:"apr"},{label:n("Multiplier"),value:"multiplier"},{label:n("Earned"),value:"earned"},{label:n("Liquidity"),value:"liquidity"}],onChange:function(e){G(e.value)}})]}),Object(F.jsxs)(or,{style:{marginLeft:16},children:[Object(F.jsx)(x.Ob,{textTransform:"uppercase",children:n("Search")}),Object(F.jsx)(rr,{onChange:function(e){B(e.target.value)}})]})]})]}),function(){if(z===De.TABLE&&fe.length){var t=hn.map((function(e){return{id:e.id,name:e.name,label:e.label,sort:function(t,n){switch(e.name){case"farm":return n.id-t.id;case"apr":return t.original.apr.value&&n.original.apr.value?Number(t.original.apr.value)-Number(n.original.apr.value):0;case"earned":return t.original.earned.earnings-n.original.earned.earnings;default:return 1}},sortable:e.sortable}}));return Object(F.jsx)(Xn,{data:fe,columns:t,userDataReady:_})}return Object(F.jsx)("div",{children:Object(F.jsxs)(p.a,{children:[Object(F.jsx)(l.b,{exact:!0,path:"".concat(e),children:me.map((function(e){return Object(F.jsx)(kt,{farm:e,cakePrice:b,account:Q,removed:!1},e.pid)}))}),Object(F.jsx)(l.b,{exact:!0,path:"".concat(e,"/history"),children:me.map((function(e){return Object(F.jsx)(kt,{farm:e,cakePrice:b,account:Q,removed:!0},e.pid)}))}),Object(F.jsx)(l.b,{exact:!0,path:"".concat(e,"/archived"),children:me.map((function(e){return Object(F.jsx)(kt,{farm:e,cakePrice:b,account:Q,removed:!0},e.pid)}))})]})})}(),Object(F.jsx)("div",{ref:le}),Object(F.jsx)(br,{src:"/images/3dpan.png",alt:"Pancake illustration",width:120,height:103})]})]})}},888:function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var r,c,i,a=n(28),s=n(0),o=n.n(s),l=n(11),d=n(2),b=l.e.div(r||(r=Object(a.a)(["\n  height: ","px;\n  width: ","px;\n"])),(function(e){return e.size}),(function(e){return e.size})),j=function(e){var t,n=e.size,r=void 0===n?"md":n,c=Object(s.useContext)(l.a).spacing;switch(r){case"lg":t=c[6];break;case"sm":t=c[2];break;case"md":default:t=c[4]}return Object(d.jsx)(b,{size:t})},u=l.e.div(c||(c=Object(a.a)(["\n  align-items: center;\n  background-color: ","00;\n  display: flex;\n  margin: 0;\n  padding: ","px 0;\n"])),(function(e){return e.theme.colors.primaryDark}),(function(e){return e.theme.spacing[4]})),x=l.e.div(i||(i=Object(a.a)(["\n  flex: 1;\n"]))),O=function(e){var t=e.children,n=o.a.Children.toArray(t).length;return Object(d.jsx)(u,{children:o.a.Children.map(t,(function(e,t){return Object(d.jsxs)(d.Fragment,{children:[Object(d.jsx)(x,{children:e}),t<n-1&&Object(d.jsx)(j,{})]})}))})}},900:function(e,t,n){"use strict";var r=n(0),c=n(277),i=n(5),a=n(2);t.a=function(e){var t=e.value,n=e.decimals,s=e.fontSize,o=void 0===s?"40px":s,l=e.lineHeight,d=void 0===l?"1":l,b=e.prefix,j=void 0===b?"":b,u=e.bold,x=void 0===u||u,O=e.color,p=void 0===O?"text":O,h=Object(c.useCountUp)({start:0,end:t,duration:1,separator:",",decimals:void 0!==n?n:t<0?4:t>1e5?0:3}),m=h.countUp,f=h.update,g=Object(r.useRef)(f);return Object(r.useEffect)((function(){g.current(t)}),[t,g]),Object(a.jsxs)(i.Ob,{bold:x,fontSize:o,style:{lineHeight:d},color:p,children:[j,m]})}},903:function(e,t,n){"use strict";var r=n(12),c=(n(0),n(900)),i=n(2);t.a=function(e){return Object(i.jsx)(c.a,Object(r.a)({fontSize:"14px",lineHeight:"1.1",color:"textSubtle",prefix:"~$",bold:!1,decimals:2},e))}},916:function(e,t,n){"use strict";var r,c,i,a,s,o,l=n(12),d=n(21),b=n(28),j=n(0),u=n(11),x=n(5),O=n(2),p=u.e.div(r||(r=Object(b.a)(["\n  width: 100%;\n  height: 40px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 0px 16px;\n  box-shadow: ",";\n  border: 1px solid ",";\n  border-radius: 16px;\n  background: ",";\n  transition: border-radius 0.15s;\n"])),(function(e){return e.theme.shadows.inset}),(function(e){return e.theme.colors.inputSecondary}),(function(e){return e.theme.colors.input})),h=u.e.div(c||(c=Object(b.a)(["\n  min-width: 136px;\n  height: 0;\n  position: absolute;\n  overflow: hidden;\n  background: ",";\n  z-index: ",";\n  transition: transform 0.15s, opacity 0.15s;\n  transform: scaleY(0);\n  transform-origin: top;\n  opacity: 0;\n\n  "," {\n    min-width: 168px;\n  }\n"])),(function(e){return e.theme.colors.input}),(function(e){return e.theme.zIndices.dropdown}),(function(e){return e.theme.mediaQueries.sm})),m=u.e.div(i||(i=Object(b.a)(["\n  cursor: pointer;\n  width: ","px;\n  position: relative;\n  background: ",";\n  border-radius: 16px;\n  height: 40px;\n  min-width: 136px;\n  user-select: none;\n\n  "," {\n    min-width: 168px;\n  }\n\n  ","\n\n  svg {\n    position: absolute;\n    right: 16px;\n    top: 50%;\n    transform: translateY(-50%);\n  }\n"])),(function(e){return e.width}),(function(e){return e.theme.colors.input}),(function(e){return e.theme.mediaQueries.sm}),(function(e){return e.isOpen&&Object(u.d)(a||(a=Object(b.a)(["\n      "," {\n        border-bottom: 1px solid ",";\n        box-shadow: ",";\n        border-radius: 16px 16px 0 0;\n      }\n\n      "," {\n        height: auto;\n        transform: scaleY(1);\n        opacity: 1;\n        border: 1px solid ",";\n        border-top-width: 0;\n        border-radius: 0 0 16px 16px;\n        box-shadow: ",";\n      }\n    "])),p,(function(e){return e.theme.colors.inputSecondary}),(function(e){return e.theme.tooltip.boxShadow}),h,(function(e){return e.theme.colors.inputSecondary}),(function(e){return e.theme.tooltip.boxShadow}))})),f=u.e.ul(s||(s=Object(b.a)(["\n  padding: 0;\n  margin: 0;\n  box-sizing: border-box;\n  z-index: ",";\n"])),(function(e){return e.theme.zIndices.dropdown})),g=u.e.li(o||(o=Object(b.a)(["\n  list-style: none;\n  padding: 8px 16px;\n  &:hover {\n    background: ",";\n  }\n"])),(function(e){return e.theme.colors.inputSecondary}));t.a=function(e){var t=e.options,n=e.onChange,r=Object(j.useRef)(null),c=Object(j.useRef)(null),i=Object(j.useState)(!1),a=Object(d.a)(i,2),s=a[0],o=a[1],b=Object(j.useState)(t[0]),u=Object(d.a)(b,2),v=u[0],y=u[1],k=Object(j.useState)({width:0,height:0}),w=Object(d.a)(k,2),C=w[0],S=w[1],L=function(){return o(!s)},q=function(e){return function(){y(e),o(!1),n&&n(e)}};return Object(j.useEffect)((function(){S({width:c.current.offsetWidth,height:c.current.offsetHeight})}),[]),Object(O.jsxs)(m,Object(l.a)(Object(l.a)({isOpen:s,ref:r},C),{},{children:[0!==C.width&&Object(O.jsx)(p,{onClick:L,children:Object(O.jsx)(x.Ob,{children:v.label})}),Object(O.jsx)(x.d,{color:"text",onClick:L}),Object(O.jsx)(h,{children:Object(O.jsx)(f,{ref:c,children:t.map((function(e){return e.label!==v.label?Object(O.jsx)(g,{onClick:q(e),children:Object(O.jsx)(x.Ob,{children:e.label})},e.label):null}))})})]}))}}}]);
  //# sourceMappingURL=15.37c017af.chunk.js.map