PageSourceSearch

https://www.knightsdefi.com/static/js/11.ea8aab97.chunk.js

js knightsdefi.com collected 2026-10-08 10:14:00 UTC 46,560 bytes, 2 lines download raw bytes

1(this["webpackJsonppancake-frontend"]=this["webpackJsonppancake-frontend"]||[]).push([[11],{1008:function(e,t,n){"use strict";var i,a=n(19),c=(n(0),n(4)),r=n(16),o=n(2),s=c.e.div(i||(i=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})),l=function(e){var t=e.onClick,n=e.expanded,i=e.showText,a=e.hideText;return Object(o.jsxs)(s,{"aria-label":"Hide or show expandable content",role:"button",onClick:function(){return t()},children:[Object(o.jsx)(r.B,{color:"primary",bold:!0,children:n?a:i}),n?Object(o.jsx)(r.l,{}):Object(o.jsx)(r.k,{})]})};l.defaultProps={expanded:!1},t.a=l},1013:function(e,t,n){"use strict";var i=n(1008);n.d(t,"a",(function(){return i.a}))},1019:function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return d})),n.d(t,"c",(function(){return b}));var i=n(1),a=n.n(i),c=n(5),r=n(109),o=n.n(r),s=n(55),l=function(e,t){return new(new o.a(e).eth.Contract)(s,t)},d=function(){var e=Object(c.a)(a.a.mark((function e(t,n,i){var c;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.methods.allowance(i,n.options.address).call();case 3:return c=e.sent,e.abrupt("return",c);case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return","0");case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t,n,i){return e.apply(this,arguments)}}(),b=function(){var e=Object(c.a)(a.a.mark((function e(t,n,i){var c,r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=l(t,n),e.prev=1,e.next=4,c.methods.balanceOf(i).call();case 4:return r=e.sent,e.abrupt("return",r);case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return","0");case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,n,i){return e.apply(this,arguments)}}()},1050:function(e,t,n){"use strict";n.d(t,"c",(function(){return m})),n.d(t,"b",(function(){return p})),n.d(t,"a",(function(){return x}));var i,a,c,r=n(19),o=(n(0),n(4)),s=n(16),l=n(57),d=n(2),b=o.e.div(i||(i=Object(r.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,i=e.theme;return n?i.shadows.warning:i.shadows.inset}),(function(e){return e.theme.colors.text})),u=Object(o.e)(s.r)(a||(a=Object(r.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})),j=Object(o.e)(s.B)(c||(c=Object(r.a)(["\n  position: absolute;\n  bottom: -22px;\n  a {\n    display: inline;\n  }\n"]))),x=function(e){var t=e.max,n=e.symbol,i=e.onChange,a=e.onSelectMax,c=e.value,r=(e.addLiquidityUrl,e.inputTitle),o=Object(l.a)(),x="0"===t||!t,p=x?"0":parseFloat(t).toFixed(4);return Object(d.jsxs)("div",{style:{position:"relative"},children:[Object(d.jsxs)(b,{isWarning:x,children:[Object(d.jsxs)(s.n,{justifyContent:"space-between",pl:"16px",children:[Object(d.jsx)(s.B,{fontSize:"14px",children:r}),Object(d.jsxs)(s.B,{fontSize:"14px",children:[o(1120,"Balance"),": ",p.toLocaleString()]})]}),Object(d.jsxs)(s.n,{alignItems:"flex-end",justifyContent:"space-around",children:[Object(d.jsx)(u,{onChange:i,placeholder:"0",value:c}),Object(d.jsx)(s.d,{size:"sm",onClick:a,mr:"8px",children:o(452,"Max")}),Object(d.jsx)(s.B,{fontSize:"16px",children:n})]})]}),x&&Object(d.jsxs)(j,{fontSize:"14px",color:"failure",children:["No tokens to stake:"," "]})]})},p=function(e){var t=e.symbol,n=(e.value,e.addLiquidityUrl,e.inputTitle);Object(l.a)();return Object(d.jsx)("div",{style:{position:"relative"},children:Object(d.jsxs)(b,{children:[Object(d.jsx)(s.n,{justifyContent:"center",children:Object(d.jsxs)(s.B,{fontSize:"14px",children:["Compound",n]})}),Object(d.jsx)(s.n,{alignItems:"flex-end",justifyContent:"center",children:Object(d.jsx)(s.B,{fontSize:"16px",children:t})})]})})}
1,m=function(e){var t=e.max,n=e.symbol,i=e.onChange,a=e.onSelectMax,c=e.value,r=e.addLiquidityUrl,o=e.inputTitle,x=Object(l.a)(),p="0"===t||!t,m=p?"0":parseFloat(t).toFixed(4);return Object(d.jsxs)("div",{style:{position:"relative"},children:[Object(d.jsxs)(b,{isWarning:p,children:[Object(d.jsxs)(s.n,{justifyContent:"space-between",pl:"16px",children:[Object(d.jsx)(s.B,{fontSize:"14px",children:o}),Object(d.jsxs)(s.B,{fontSize:"14px",children:[x(1120,"Balance"),": ",m.toLocaleString()]})]}),Object(d.jsxs)(s.n,{alignItems:"flex-end",justifyContent:"space-around",children:[Object(d.jsx)(u,{onChange:i,placeholder:"0",value:c}),Object(d.jsx)(s.d,{size:"sm",onClick:a,mr:"8px",children:x(452,"Max")}),Object(d.jsx)(s.B,{fontSize:"16px",children:n})]})]}),p&&Object(d.jsxs)(j,{fontSize:"14px",color:"failure",children:["No tokens to stake:"," ",Object(d.jsxs)(s.s,{fontSize:"14px",bold:!1,href:r,external:!0,color:"failure",children:[x(999,"get")," ",n]})]})]})}},1051:function(e,t,n){"use strict";t.a=function(e){var t=e.quoteTokenAdresses,n=e.quoteTokenSymbol,i=e.tokenAddresses,a="BNB"===n?"ETH":t[56],c=i[56];return"".concat(a,"/").concat(c)}},1103:function(e,t,n){"use strict";n.d(t,"a",(function(){return R}));var i,a,c,r,o,s,l=n(1),d=n.n(l),b=n(17),u=n(5),j=n(26),x=n(19),p=n(0),m=n(4),O=n(16),h=n(7),f=n.n(h),g=n(273),k=n(202),y=n(22),B=n(1013),v=n(266),w=n(275),S=n(276),C=n(268),T=n(11),N=n(50),L=n(2),A=m.e.div(i||(i=Object(x.a)(["\n  margin-top: 24px;\n"]))),I=Object(m.f)(a||(a=Object(x.a)(["\n\t0% {\n\t\tbackground-position: 0% 50%;\n\t}\n\t50% {\n\t\tbackground-position: 100% 50%;\n\t}\n\t100% {\n\t\tbackground-position: 0% 50%;\n\t}\n"]))),E=m.e.div(c||(c=Object(x.a)(["\n background: linear-gradient(\n    -45deg,\n    #ff738e,\n    #e4536f 20%,\n    #a34054 40%,\n    #b7eaff 60%,\n    #92cee7 80%,\n    #5dc4d9 100%\n  );\n  background-size: 300% 300%;\n  animation: "," 2s linear infinite;\n  border-radius: 16px;\n  filter: blur(8px);\n  position: absolute;\n  display: none;\n  top: -2px;\n  right: -2px;\n  bottom: -2px;\n  left: -2px;\n  z-index: -1;\n"])),I),q=m.e.div(r||(r=Object(x.a)(["\n  align-self: baseline;\n  background: ",";\n  border-radius: 32px;\n  box-shadow: 0px 2px 12px -8px rgba(25, 19, 38, 0.1), 0px 1px 1px rgba(25, 19, 38, 0.05);\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})),F=m.e.div(o||(o=Object(x.a)(["\n  background-color: ",";\n  height: 1px;\n  margin: 28px auto;\n  width: 100%;\n"])),(function(e){return e.theme.colors.borderColor})),P=m.e.div(s||(s=Object(x.a)(["\n  height: ",";\n  overflow: hidden;\n"])),(function(e){return e.expanded?"100%":"0px"})),R=function(){Object(C.a)(),Object(C.g)();var e=Object(T.t)(),t=Object(N.o)().toNumber(),n=Object(N.j)().toNumber(),i=Object(k.a)(),a=(i.fastRefresh,i.slowRefresh),c=Object(y.c)().account,r=Object(g.a)(),o=Object(p.useState)(!1),s=Object(j.a)(o,2),l=s[0],x=s[1],m=Object(p.useState)({earnings:0,holdings:0,formattedClaimDate:"",claimBnbAvailable:!1,bnbToClaim:0,bfStaking:0,totalRewards:0,bnbPool:0}),h=Object(j.a)(m,2),I=h[0],R=h[1];Object(p.useEffect)((function(){console.log("clean up")}),[]),Object(p.useEffect)((function(){(function(){var e=Object(u.a)(d.a.mark((function e(){var t,n,i,a,o,s,l,u,j,x,p,m,O,h,g;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!c){e.next=38;break}return t=0,n=0,i=0,a=!1,o=0,s=0,l="",u=0,j=Object(C.a)(),x=Object(C.g)(),p=4,e.next=14,j.methods.getUserCurrentRewards(c,p).call();case 14:return t=e.sent,e.next=17,j.methods.userHoldings(c,p).call();case 17:return s=e.sent,e.next=20,x.methods.balanceOf(c).call();case 20:return n=e.sent,e.next=23,x.methods.nextAvailableClaimDate(c).call();case 23:return i=e.sent,e.next=26,x.methods.calculateBNBReward(c).call();case 26:return o=e.sent,e.next=29,r.eth.getBalance(Object(T.t)());case 29:l=e.sent,m=function(e){return new Date(1e3*e)},O=new f.a(t).plus(new f.a(s)).toNumber(),(h=m(i))<new Date&&i>0&&(a=!0),""!==l&&(u=parseInt(l)),g=h.toString(),g=!a&&i>0?h.toString():i<1?"You have not purchased any SHILLING.  Please purchase to be able to claim.":(new Date).toString(),R((function(e){return Object(b.a)(Object(b.a)({},e),{},{earnings:t,holdings:n,formattedClaimDate:g,claimBnbAvailable:a,bnbToClaim:o,bfStaking:s,totalRewards:O,bnbPool:u})}));case 38:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}})()()}),[a,c,r]);Object(w.b)(4,I.bfStaking).onUnstake;var z=Object(S.d)().onBnbReward;return c?Object(L.jsxs)(q,{children:[Object(L.jsx)(E,{}
1),Object(L.jsx)(O.o,{mb:"12px",children:"SHILLING Token"}),Object(L.jsxs)(O.o,{children:["  ",Object(L.jsx)("img",{src:"images/battlefield/shilling.svg",alt:"Shilling Logo",style:{height:"48px"}})]}),Object(L.jsx)(F,{}),Object(L.jsxs)(O.o,{mt:"12px",children:["Your Next BNB Claim: ",(I.bnbToClaim/1e18).toFixed(4)," (~$",(n*I.bnbToClaim/1e18).toLocaleString(),")"]}),Object(L.jsxs)(O.B,{mb:"12px",children:["Your Next Claim Date: ",I.formattedClaimDate]}),I.claimBnbAvailable?Object(L.jsx)(O.d,{variant:"secondary",onClick:z,children:"Claim BNB"}):Object(L.jsx)(O.d,{variant:"tertiary",children:"Cannot Claim BNB Until Claim Date"}),Object(L.jsx)(F,{}),Object(L.jsx)(O.d,{mt:"8px",as:"a",variant:"secondary",href:"https://docs.knightsdefi.com/shilling",target:"_blank",children:"Read More"}),Object(L.jsx)(F,{}),Object(L.jsx)(B.a,{onClick:function(){return x(!l)},expanded:l,showText:"Details",hideText:"Hide"}),Object(L.jsx)(P,{expanded:l,children:Object(L.jsxs)(A,{children:[Object(L.jsx)(O.B,{mb:"2px",children:"Your Holdings "}),Object(L.jsxs)(O.B,{mb:"2px",children:[new f.a((I.holdings/1e18).toFixed(0)).toNumber().toLocaleString()," SHILLING"]}),Object(L.jsxs)(O.B,{mb:"12px",children:["~($ ",(I.holdings/1e18*t).toFixed(2),")"]}),Object(L.jsx)(O.d,{as:"a",variant:"secondary",href:"https://psidex.passive-income.io/#/swap?outputCurrency=".concat(e),target:"_blank",children:"Buy Shilling"}),Object(L.jsx)(F,{}),Object(L.jsxs)(O.o,{mb:"12px",children:["Total BNB in Pool: ",(I.bnbPool/1e18).toFixed(2)," (~$",(n*I.bnbPool/1e18).toLocaleString(),")"]}),Object(L.jsxs)(O.o,{mb:"12px",children:["Your Next BNB Claim: ",(I.bnbToClaim/1e18).toFixed(4)," (~$",(n*I.bnbToClaim/1e18).toLocaleString(),")"]}),Object(L.jsxs)(O.B,{mb:"12px",children:["Your Estimated Annual BNB: ",(I.bnbToClaim/1e18*(365/3)).toFixed(4)," (~$",(n*(I.bnbToClaim/1e18*(365/3))).toLocaleString(),")"]})]})})]}):Object(L.jsxs)(q,{children:[Object(L.jsx)(E,{}),Object(L.jsx)(O.o,{mb:"12px",children:"SHILLING Token"}),Object(L.jsxs)(O.o,{mb:"12px",children:["  ",Object(L.jsx)("img",{src:"images/battlefield/shilling.svg",alt:"Shilling Logo",style:{height:"48px"}})]}),Object(L.jsx)(v.a,{})]})}},1702:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return rt}));var i,a,c,r,o,s,l,d,b,u,j,x,p,m,O,h,f,g,k,y,B,v,w,S,C,T,N,L,A,I=n(17),E=n(19),q=n(26),F=n(0),P=n(44),R=n(4),z=n(23),H=n(7),G=n.n(H),D=n(22),U=n(16),K=n(270),Q=n(274),$=n(154),M=n(50),V=n(202),Y=n(34),W=n(18),_=n(277),J=n(281),X=n(57),Z=n(1013),ee=n(62),te=n(1051),ne=n(2),ie=Object(R.e)(U.n)(i||(i=Object(E.a)(["\n  svg {\n    margin-right: 0.25rem;\n  }\n"]))),ae=(Object(R.e)(U.A)(a||(a=Object(E.a)(["\n  margin-left: 4px;\n"]))),function(e){var t=e.lpLabel,n=(e.multiplier,e.isCommunityBattlefield,e.battlefieldImage),i=e.tokenSymbol,a=e.burnPct,c=e.rewardPoolPct,r=e.externalFeePct,o=e.rewardRate;e.earnedValue;return Object(ne.jsxs)(ie,{justifyContent:"space-between",alignItems:"center",mb:"12px",children:[Object(ne.jsx)(U.q,{src:"/images/battlefield/".concat(n,".svg"),alt:i,width:64,height:64}),Object(ne.jsxs)(U.n,{flexDirection:"column",alignItems:"flex-end",children:[Object(ne.jsx)(U.o,{mb:"0px",children:t}),Object(ne.jsxs)(U.B,{mb:"0px",children:["Burn: ",a,"%"]}),Object(ne.jsxs)(U.B,{mb:"0px",children:["Reward Pool: ",c,"%"]}),Object(ne.jsxs)(U.B,{mb:"0px",children:["External Fees: ",r,"%"]}),Object(ne.jsxs)(U.B,{mb:"0px",children:["Rate: ",o," / Blk."]})]})]})}),ce=n(1),re=n.n(ce),oe=n(5),se=n(1019),le=n(11),de=n(266),be=n(269),ue=n(282),je=n(275),xe=n(33),pe=n(28),me=function(e){var t=Object(z.b)(),n=Object(D.c)().account,i=Object(pe.a)();return{onCompound:Object(F.useCallback)(Object(oe.a)(re.a.mark((function a(){var c;return re.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,Object(xe.c)(i,e,n);case 2:return c=a.sent,t(Object(Y.c)(n)),a.abrupt("return",c);case 5:case"end":return a.stop()}}),a)}))),[n,t,e,i])}},Oe=n(123),he=n(1050),fe=function(e){var t=e.max,n=e.onConfirm,i=e.onDismiss,a=e.tokenName,c=void 0===a?"":a,r=e.addLiquidityUrl,o=Object(F.useState)(""),s=Object(q.a)(o,2),l=s[0],d=s[1],b=Object(F.useState)(!1),u=Object(q.a)(b,2),j=u[0],x=u[1],p=Object(X.a)(),m=Object(F.useMemo)((function(){return Object(ee.b)(t)}
1),[t]),O=Object(F.useCallback)((function(e){d(e.currentTarget.value)}),[d]),h=Object(F.useCallback)((function(){d(m)}),[m,d]);return Object(ne.jsxs)(U.w,{title:p(1068,"Send to War"),onDismiss:i,children:[Object(ne.jsx)(he.a,{value:l,onSelectMax:h,onChange:O,max:m,symbol:c,addLiquidityUrl:r,inputTitle:p(1070,"Send to War")}),Object(ne.jsxs)(Oe.a,{children:[Object(ne.jsx)(U.d,{variant:"secondary",onClick:i,children:p(462,"Cancel")}),Object(ne.jsx)(U.d,{disabled:j||"0"===m||"0"===l,onClick:Object(oe.a)(re.a.mark((function e(){return re.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(!0),e.next=3,n(l);case 3:x(!1),i();case 5:case"end":return e.stop()}}),e)}))),children:j?p(488,"Pending Confirmation"):p(464,"Confirm")})]})]})},ge=function(e){var t=e.onConfirm,n=e.onDismiss,i=e.max,a=e.tokenName,c=void 0===a?"":a,r=Object(F.useState)(""),o=Object(q.a)(r,2),s=o[0],l=o[1],d=Object(F.useState)(!1),b=Object(q.a)(d,2),u=b[0],j=b[1],x=Object(X.a)(),p=Object(F.useMemo)((function(){return Object(ee.b)(i)}),[i]),m=Object(F.useCallback)((function(e){l(e.currentTarget.value)}),[l]),O=Object(F.useCallback)((function(){l(p)}),[p,l]);return Object(ne.jsxs)(U.w,{title:x(1126,"Recall Troops"),onDismiss:n,children:[Object(ne.jsx)(he.a,{onSelectMax:O,onChange:m,value:s,max:p,symbol:c,inputTitle:x(588,"Recall Troops")}),Object(ne.jsxs)(Oe.a,{children:[Object(ne.jsx)(U.d,{variant:"secondary",onClick:n,children:x(462,"Cancel")}),Object(ne.jsx)(U.d,{disabled:u,onClick:Object(oe.a)(re.a.mark((function e(){return re.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j(!0),e.next=3,t(s);case 3:j(!1),n();case 5:case"end":return e.stop()}}),e)}))),children:u?x(488,"Pending Confirmation"):x(464,"Confirm")})]})]})},ke=function(e){var t=e.max,n=e.onConfirm,i=e.onDismiss,a=e.tokenName,c=void 0===a?"":a,r=e.addLiquidityUrl,o=Object(F.useState)(""),s=Object(q.a)(o,2),l=s[0],d=s[1],b=Object(F.useState)(!1),u=Object(q.a)(b,2),j=u[0],x=u[1],p=Object(X.a)(),m=Object(F.useMemo)((function(){return Object(ee.b)(t)}),[t]);Object(F.useCallback)((function(e){d(e.currentTarget.value)}),[d]),Object(F.useCallback)((function(){d(m)}),[m,d]);return Object(ne.jsxs)(U.w,{title:p(1068,"Compound"),onDismiss:i,children:[Object(ne.jsx)(he.b,{value:m,symbol:c,addLiquidityUrl:r,inputTitle:p(1070,"")}),Object(ne.jsxs)(Oe.a,{children:[Object(ne.jsx)(U.d,{variant:"secondary",onClick:i,children:p(462,"Cancel")}),Object(ne.jsx)(U.d,{disabled:j||"0"===m||"0"===l,onClick:Object(oe.a)(re.a.mark((function e(){return re.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(!0),e.next=3,n(l);case 3:x(!1),i();case 5:case"end":return e.stop()}}),e)}))),children:j?p(488,"Pending Confirmation"):p(464,"Confirm")})]})]})},ye=n(85),Be=R.e.button(c||(c=Object(E.a)(["\n  align-items: center;\n  background: ",";\n  border: 0;\n  border-radius: 12px;\n  color: ",";\n  cursor: pointer;\n  display: flex;\n  font-size: ","px;\n  font-weight: 700;\n  height: ","px;\n  justify-content: center;\n  outline: none;\n  padding-left: ","px;\n  padding-right: ","px;\n  pointer-events: ",";\n  width: 100%;\n  border: 2px solid ",";\n  width: 100px;\n  height: 30px;\n  font-size: 14px;\n  padding: 0px;\n"])),(function(e){return e.disabled?"#ddd":e.theme.card.background}),(function(e){return e.disabled?"#acaaaf":"#ccc72d"}),(function(e){return e.fontSize}),(function(e){return e.size}),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.disabled?"none":void 0}),(function(e){return e.disabled?"#eee":"#ccc72d"})),ve=Object(R.e)(ye.b)(r||(r=Object(E.a)(["\n  align-items: center;\n  color: inherit;\n  display: flex;\n  flex: 1;\n  height: 56px;\n  justify-content: center;\n  margin: 0 ","px;\n  padding: 0 ","px;\n  text-decoration: none;\n"])),(function(e){return-e.theme.spacing[4]}),(function(e){return e.theme.spacing[4]})),we=R.e.a(o||(o=Object(E.a)(["\n  align-items: center;\n  color: inherit;\n  display: flex;\n  flex: 1;\n  height: 56px;\n  justify-content: center;\n  margin: 0 ","px;\n  padding: 0 ","px;\n  text-decoration: none;\n"])),(function(e){return-e.theme.spacing[4]}),(function(e){return e.theme.spacing[4]})),Se=function(e){var t,n,i,a=e.children,c=e.disabled,r=e.href,o=e.onClick,s=e.size,l=e.text,d=e.to,b=Object(F.useContext)(R.a),u=b.colors,j=b.spacing,x=u.background;switch(s){case"sm":n=j[3],t=36,i=14;break;case"lg":n=j[4],t=72,i=16;break;case"md":default:n=j[4],t=56,i=16}var p=Object(F.useMemo)((function(){return d?Object(ne.jsx)(ve,{to:d,children:l}):r?Object(ne.jsx)(we,{href:r,target:"__blank",children:l}):l}),[r,l,d]);
1return Object(ne.jsxs)(Be,{boxShadow:undefined,color:x,disabled:c,fontSize:i,onClick:o,padding:n,size:t,children:[a,p]})},Ce=(R.e.div(s||(s=Object(E.a)(["\n  display: flex;\n  svg {\n    width: 20px;\n  }\n"]))),function(e){var t=e.stakedBalance,n=e.tokenBalance,i=e.tokenName,a=e.pid,c=e.addLiquidityUrl,r=e.stakedBalanceFormatted,o=(Object(X.a)(),Object(ue.b)(a).onStake),s=Object(je.c)(a).onUnstake,l=me(a).onCompound,d=Object(ee.a)(t),b=0;d<1e3&&d>=100&&(b=2),d<100&&d>=1&&(b=3),d<1&&d>=.01&&(b=5),d<.01&&d>=0&&(b=6),0===d&&(b=0);var u=new G.a(d.toFixed(b)).toNumber().toLocaleString(),j=Object(U.J)(Object(ne.jsx)(fe,{max:n,onConfirm:o,tokenName:i,addLiquidityUrl:c})),x=Object(q.a)(j,1)[0],p=Object(U.J)(Object(ne.jsx)(ge,{max:t,onConfirm:s,tokenName:i})),m=Object(q.a)(p,1)[0],O=Object(U.J)(Object(ne.jsx)(ke,{max:t,onConfirm:l,tokenName:i}));Object(q.a)(O,1)[0];return Object(ne.jsxs)(U.o,{children:[Object(ne.jsxs)(U.n,{justifyContent:"space-between",alignItems:"center",children:[Object(ne.jsx)(U.o,{color:0===d?"textDisabled":"text",children:u}),0===d?Object(ne.jsx)(Se,{onClick:x,children:Object(ne.jsx)(U.B,{fontSize:"14px",children:"Stake (+)"})}):Object(ne.jsx)(U.n,{mb:"2px",children:Object(ne.jsx)(Se,{variant:"tertiary",onClick:x,children:Object(ne.jsx)(U.B,{fontSize:"14px",children:"Stake (+)"})})})]}),Object(ne.jsxs)(U.n,{justifyContent:"space-between",alignItems:"center",children:[Object(ne.jsxs)(U.B,{fontSize:"14px",children:[" (~$",r,")"]}),0===d?Object(ne.jsx)(U.B,{}):Object(ne.jsx)(U.n,{mb:"2px",children:Object(ne.jsx)(Se,{variant:"tertiary",onClick:m,children:Object(ne.jsx)(U.B,{fontSize:"14px",children:"Unstake (-)"})})})]})]})}),Te=R.e.div(l||(l=Object(E.a)(["\n  padding-top: 16px;\n"]))),Ne=function(e){var t=e.battlefield,n=e.ethereum,i=e.account,a=e.addLiquidityUrl,c=(e.earnedValue,e.stakedBalanceFormatted),r=Object(X.a)(),o=Object(F.useState)(!1),s=Object(q.a)(o,2),l=s[0],d=s[1],b=Object(M.b)(t.lpSymbol),u=b.pid,j=b.lpAddresses,x=Object(M.c)(u),p=x.allowance,m=x.tokenBalance,O=x.stakedBalance,h=(x.earnings,Object(le.a)(j)),f=t.lpSymbol.toUpperCase(),g=i&&p&&p.isGreaterThan(0),k=Object(F.useMemo)((function(){return Object(se.b)(n,h)}),[n,h]),y=Object(be.b)(k).onApprove,B=Object(F.useCallback)(Object(oe.a)(re.a.mark((function e(){return re.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,d(!0),e.next=4,y();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]])}))),[y]);return Object(ne.jsx)(Te,{children:i?Object(ne.jsxs)(Te,{children:[Object(ne.jsxs)(U.n,{children:[Object(ne.jsx)(U.B,{bold:!0,textTransform:"uppercase",color:"secondary",fontSize:"12px",pr:"3px",children:f}),Object(ne.jsx)(U.B,{bold:!0,textTransform:"uppercase",color:"textSubtle",fontSize:"12px",children:r(1074,"Staked")})]}),g?Object(ne.jsx)(Ce,{stakedBalance:O,tokenBalance:m,tokenName:f,pid:u,addLiquidityUrl:a,stakedBalanceFormatted:c}):Object(ne.jsx)(U.d,{mt:"8px",disabled:l,onClick:B,children:r(758,"Approve Contract")})]}):Object(ne.jsx)(de.a,{mt:"8px"})})},Le=R.e.div(d||(d=Object(E.a)(["\n  margin-top: 24px;\n"]))),Ae=Object(R.f)(b||(b=Object(E.a)(["\n\t0% {\n\t\tbackground-position: 0% 50%;\n\t}\n\t50% {\n\t\tbackground-position: 100% 50%;\n\t}\n\t100% {\n\t\tbackground-position: 0% 50%;\n\t}\n"]))),Ie=(R.e.div(u||(u=Object(E.a)(["\n background: linear-gradient(\n    -45deg,\n    #ff738e,\n    #e4536f 20%,\n    #a34054 40%,\n    #b7eaff 60%,\n    #92cee7 80%,\n    #5dc4d9 100%\n  );\n  background-size: 300% 300%;\n  animation: "," 2s linear infinite;\n  border-radius: 16px;\n  filter: blur(8px);\n  position: absolute;\n  display: none;\n  top: -2px;\n  right: -2px;\n  bottom: -2px;\n  left: -2px;\n  z-index: -1;\n"])),Ae),R.e.div(j||(j=Object(E.a)(["\n  align-self: baseline;\n  background: ",";\n  border-radius: 32px;\n  box-shadow: 0px 2px 12px -8px rgba(25, 19, 38, 0.1), 0px 1px 1px rgba(25, 19, 38, 0.05);\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}))),Ee=R.e.div(x||(x=Object(E.a)(["\n  background-color: ",";\n  height: 1px;\n  margin: 28px auto;\n  width: 100%;\n"])),(function(e){return e.theme.colors.borderColor})),qe=R.e.div(p||(p=Object(E.a)(["\n  height: ",";\n  overflow: hidden;
1\n"])),(function(e){return e.expanded?"100%":"0px"})),Fe=function(e){var t=e.battlefield,n=(e.removed,e.cakePrice),i=e.legendPrice,a=e.tablePrice,c=e.squirePrice,r=e.shillingPrice,o=e.bnbPrice,s=e.ethPrice,l=e.ethereum,d=e.account,b=(Object(X.a)(),Object(F.useState)(!1)),u=Object(q.a)(b,2),j=u[0],x=u[1],p=J.a.includes(t.tokenSymbol),m=t.lpSymbol.split(" ")[0].toLocaleLowerCase(),O=Object(M.c)(t.pid),h=O.stakedBalance,f=O.earnings,g=t.rewardsBalance,k=new G.a(g).toNumber().toLocaleString(),y=new G.a(t.quoteTokenAmount).toNumber().toLocaleString(),B=Object(F.useMemo)((function(){return h?t.tokenSymbol===W.b.BNB?o.times(h):t.tokenSymbol===W.b.CAKE||t.tokenSymbol===W.b.KNIGHT?n.times(h):t.tokenSymbol===W.b.ETH?s.times(h):t.tokenSymbol===W.b.LEGEND?i.times(h):t.tokenSymbol===W.b.TABLE?a.times(h):t.tokenSymbol===W.b.SQUIRE?c.times(h):t.tokenSymbol===W.b.SHILLING?r.times(h):new G.a(0):null}),[o,n,s,i,a,c,r,h,t.tokenSymbol]),v=Object(F.useMemo)((function(){return f?t.tokenSymbol===W.b.BNB?o.times(f):t.tokenSymbol===W.b.CAKE||t.tokenSymbol===W.b.KNIGHT?n.times(f):t.tokenSymbol===W.b.ETH?s.times(f):t.tokenSymbol===W.b.LEGEND?i.times(f):t.tokenSymbol===W.b.TABLE?a.times(f):t.tokenSymbol===W.b.SQUIRE?c.times(f):t.tokenSymbol===W.b.SHILLING?r.times(f):new G.a(0):null}),[o,n,s,i,a,c,r,f,t.tokenSymbol]),w=Object(F.useMemo)((function(){return g?t.tokenSymbol===W.b.BNB?o.times(g).times(1e18):t.tokenSymbol===W.b.CAKE||t.tokenSymbol===W.b.KNIGHT?n.times(g).times(1e18):t.tokenSymbol===W.b.ETH?s.times(g).times(1e18):t.tokenSymbol===W.b.LEGEND?i.times(g).times(1e18):t.tokenSymbol===W.b.TABLE?a.times(g).times(1e18):t.tokenSymbol===W.b.SQUIRE?c.times(g).times(1e18):t.tokenSymbol===W.b.SHILLING?r.times(g).times(1e18):new G.a(0):null}),[o,n,s,i,a,c,r,t.tokenSymbol,g]),S=Object(F.useMemo)((function(){return t.quoteTokenAmount?t.tokenSymbol===W.b.BNB?o.times(t.quoteTokenAmount).times(1e18):t.tokenSymbol===W.b.CAKE||t.tokenSymbol===W.b.KNIGHT?n.times(t.quoteTokenAmount).times(1e18):t.tokenSymbol===W.b.ETH?s.times(t.quoteTokenAmount).times(1e18):t.tokenSymbol===W.b.LEGEND?i.times(t.quoteTokenAmount).times(1e18):t.tokenSymbol===W.b.TABLE?a.times(t.quoteTokenAmount).times(1e18):t.tokenSymbol===W.b.SQUIRE?c.times(t.quoteTokenAmount).times(1e18):t.tokenSymbol===W.b.SHILLING?r.times(t.quoteTokenAmount).times(1e18):new G.a(0):null}),[o,n,s,i,a,c,r,t.tokenSymbol,t.quoteTokenAmount]),C=Object(ee.a)(B).toLocaleString(),T=Object(ee.a)(w).toLocaleString(),N=Object(ee.a)(S).toLocaleString(),L=(Object(ee.a)(v).toLocaleString(),v),A=t.lpSymbol&&t.lpSymbol.toUpperCase().replace("PANCAKE",""),I=(t.apy&&t.apy.times(new G.a(100)).toNumber().toLocaleString("en-US").slice(0,-1),t.quoteTokenAdresses),E=t.quoteTokenSymbol,P=t.tokenAddresses,R=Object(te.a)({quoteTokenAdresses:I,quoteTokenSymbol:E,tokenAddresses:P}),z="".concat(K.a,"/").concat(R);return Object(ne.jsxs)(Ie,{children:[Object(ne.jsx)(ae,{lpLabel:A,multiplier:t.multiplier,isCommunityBattlefield:p,battlefieldImage:m,tokenSymbol:t.tokenSymbol,burnPct:t.burnPct,rewardPoolPct:t.rewardPoolPct,externalFeePct:t.externalFeePct,rewardRate:t.rewardRate,earnedValue:L}),Object(ne.jsx)(Ne,{battlefield:t,ethereum:l,account:d,addLiquidityUrl:z,earnedValue:L,stakedBalanceFormatted:C}),Object(ne.jsx)(Ee,{}),Object(ne.jsx)(Z.a,{onClick:function(){return x(!j)},expanded:j,showText:"Details",hideText:"Hide"}),Object(ne.jsx)(qe,{expanded:j,children:Object(ne.jsxs)(Le,{children:[Object(ne.jsx)(U.B,{children:"Total at War:"}),Object(ne.jsxs)(U.B,{fontSize:"14px",children:[y," (~$",N,")"]}),Object(ne.jsx)(U.B,{children:"Total Rewards Remaining:"}),Object(ne.jsxs)(U.B,{fontSize:"14px",children:[k," (~$",T,")"]})]})})]})},Pe=n(273),Re=n(268),ze=n(276),He=function(e){var t=e.earnings,n=e.pid,i=Object(F.useState)(!1),a=Object(q.a)(i,2),c=(a[0],a[1]),r=me(n).onCompound;Object(ee.a)(t);return Object(ne.jsx)(U.n,{justifyContent:"space-between",alignItems:"right",flexDirection:"column-reverse",children:Object(ne.jsx)(Se,{onClick:Object(oe.a)(re.a.mark((function e(){return re.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(!0),e.next=3,r();case 3:c(!1);case 4:case"end":return e.stop()}}),e)}))),children:Object(ne.jsx)(U.B,{fontSize:"14px",children:"Compound"})})})},Ge=function(e){var t=e.earnings,n=e.pid,i=e.earnedValue,a=(Object(X.a)(),Object(F.useState)(!1)),c=Object(q.a)(a,2),r=(c[0],c[1]),o=Object(ze.a)(n).onReward,s=0,l=Object(ee.a)(t);l<1e3&&l>=100&&(s=1),l<100&&l>=1&&(s=2),l<1&&l>=.01&&(s=3),l<.01&&l>=.001&&(s=4),l<.001&&l>=0&&(s=5),0===l&&(s=0);var d=new G.a(l.toFixed(s)).toNumber(),b="0";b=d>
1.001?d.toLocaleString():d.toFixed(s);var u=Object(ee.a)(i).toLocaleString();return Object(ne.jsxs)(U.o,{children:[Object(ne.jsxs)(U.n,{mb:"2px",justifyContent:"space-between",alignItems:"center",children:[Object(ne.jsx)(U.o,{color:0===l?"textDisabled":"text",children:b}),Object(ne.jsx)(Se,{onClick:Object(oe.a)(re.a.mark((function e(){return re.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r(!0),e.next=3,o();case 3:r(!1);case 4:case"end":return e.stop()}}),e)}))),children:Object(ne.jsx)(U.B,{fontSize:"14px",children:"Harvest"})})]}),Object(ne.jsxs)(U.n,{mb:"8px",justifyContent:"space-between",alignItems:"center",children:[Object(ne.jsxs)(U.B,{fontSize:"14px",children:[" (~$",u,")"]}),Object(ne.jsx)(He,{earnings:t,pid:n})]})]})},De=function(e){var t=e.earnings,n=e.pid,i=e.earnedValue,a=e.stakingBalance,c=(Object(X.a)(),Object(F.useState)(!1)),r=Object(q.a)(c,2),o=(r[0],r[1]),s=Object(je.b)(n,a).onUnstake,l=0,d=Object(ee.a)(t);d<1e3&&d>=100&&(l=1),d<100&&d>=1&&(l=2),d<1&&d>=.01&&(l=3),d<.01&&d>=.001&&(l=4),d<.001&&d>=0&&(l=5),0===d&&(l=0);var b=new G.a(d.toFixed(l)).toNumber(),u="0";u=b>.001?b.toLocaleString():b.toFixed(l);var j=Object(ee.a)(i).toLocaleString();return Object(ne.jsxs)(U.o,{children:[Object(ne.jsxs)(U.n,{mb:"2px",justifyContent:"space-between",alignItems:"center",children:[Object(ne.jsx)(U.o,{color:0===d?"textDisabled":"text",children:u}),Object(ne.jsx)(Se,{onClick:Object(oe.a)(re.a.mark((function e(){return re.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o(!0),e.next=3,s();case 3:o(!1);case 4:case"end":return e.stop()}}),e)}))),children:Object(ne.jsx)(U.B,{fontSize:"14px",children:"Harvest"})})]}),Object(ne.jsx)(U.n,{mb:"8px",justifyContent:"space-between",alignItems:"center",children:Object(ne.jsxs)(U.B,{fontSize:"14px",children:[" (~$",j,")"]})})]})},Ue=(R.e.div(m||(m=Object(E.a)(["\n  display: flex;\n  svg {\n    width: 20px;\n  }\n"]))),function(){Object(X.a)();var e=function(){var e=Object(z.b)(),t=Object(D.c)().account,n=Object(pe.a)();return{onCompoundAll:Object(F.useCallback)(Object(oe.a)(re.a.mark((function i(){var a;return re.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,Object(xe.d)(n,t);case 2:return a=i.sent,e(Object(Y.c)(t)),i.abrupt("return",a);case 5:case"end":return i.stop()}}),i)}))),[t,e,n])}}().onCompoundAll,t=Object(ze.b)().onWithdrawAllRewards;return Object(ne.jsxs)(U.n,{justifyContent:"space-between",alignItems:"stretch",children:[Object(ne.jsx)(U.d,{variant:"primary",onClick:e,mr:"6px",children:Object(ne.jsx)(U.B,{color:"tertiary",children:"Compound All"})}),Object(ne.jsx)(U.d,{variant:"primary",onClick:t,children:Object(ne.jsx)(U.B,{color:"tertiary",children:"Harvest All"})})]})}),Ke=R.e.div(O||(O=Object(E.a)(["\n  margin-top: 24px;\n"]))),Qe=Object(R.f)(h||(h=Object(E.a)(["\n\t0% {\n\t\tbackground-position: 0% 50%;\n\t}\n\t50% {\n\t\tbackground-position: 100% 50%;\n\t}\n\t100% {\n\t\tbackground-position: 0% 50%;\n\t}\n"]))),$e=R.e.div(f||(f=Object(E.a)(["\n background: linear-gradient(\n    -45deg,\n    #ff738e,\n    #e4536f 20%,\n    #a34054 40%,\n    #b7eaff 60%,\n    #92cee7 80%,\n    #5dc4d9 100%\n  );\n  background-size: 300% 300%;\n  animation: "," 2s linear infinite;\n  border-radius: 16px;\n  filter: blur(8px);\n  position: absolute;\n  display: none;\n  top: -2px;\n  right: -2px;\n  bottom: -2px;\n  left: -2px;\n  z-index: -1;\n"])),Qe),Me=R.e.div(g||(g=Object(E.a)(["\n  align-self: baseline;\n  background: ",";\n  border-radius: 32px;\n  box-shadow: 0px 2px 12px -8px rgba(25, 19, 38, 0.1), 0px 1px 1px rgba(25, 19, 38, 0.05);\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})),Ve=R.e.div(k||(k=Object(E.a)(["\n  background-color: ",";\n  height: 1px;\n  margin: 28px auto;\n  width: 100%;\n"])),(function(e){return e.theme.colors.borderColor})),Ye=R.e.div(y||(y=Object(E.a)(["\n  height: ",";\n  overflow: hidden;\n"])),(function(e){return e.expanded?"100%":"0px"})),We=function(e){var t=e.battlefield,n=e.account,i=(Object(Re.a)(),Object(Pe.a)()),a=Object(V.a)(),c=(a.fastRefresh,a.slowRefresh),r=Object(M.k)(),o=Object(M.p)(),s=Object(M.n)(),l=Object(M.q)(),d=Object(M.o)(),b=Object(M.c)(0),u=b.stakedBalance,j=b.earnings,x=u,p=j,m=Object(M.c)(1),O=u=m.stakedBalance,h=j=m.earnings,f=Object(M.c)(2),g=u=f.stakedBalance,k=j=f.earnings,y=Object(M.c)(3),B=u=y.stakedBalance,v=j=y.earnings,w=Object(M.c)(4);u=w.stakedBalance;var S=(j=w.earnings).plus(u),C=Object(F.useState)(!1),T=Object(q.a)(C,2),N=T[0],L=T[1],A=new G.a(0),E=new G.a(0),P=Object(M.c)(0),R=(P.userArmyStrength,P.userArmyPercent),z=Object(F.useState)({shillEarnings:0,bfStaking:0,totalRewards:0,totalGuestRewards:new G.a(0)}),H=Object(q.a)(z,2),D=H[0],K=H[1];Object(F.useEffect)((function(){(function(){var e=Object(oe.a)(re.a.mark((function e(){var t,i,a,c,r,o,s,l;return re.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n){e.next=19;break}return t=0,i=0,a=0,c=Object(Re.a)(),r=4,o=6,e.next=9,c.methods.getUserCurrentRewards(n,r).call();case 9:return i=e.sent,e.next=12,c.methods.userHoldings(n,r).call();case 12:return t=e.sent,e.next=15,c.methods.getUserCurrentRewards(n,o).call();case 15:a=e.sent,s=new G.a(i).plus(new G.a(t)).toNumber(),l=new G.a(a),K((function(e){return Object(I.a)(Object(I.a)({},e),{},{shillEarnings:i,bfStaking:t,totalRewards:s,totalGuestRewards:l})}));case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}})()()}),[c,n,i]),A=x.dividedBy(1e18).multipliedBy(r).plus(A),A=B.dividedBy(1e18).multipliedBy(o).plus(A),A=O.dividedBy(1e18).multipliedBy(l).plus(A),A=g.dividedBy(1e18).multipliedBy(s).plus(A),E=p.dividedBy(1e18).multipliedBy(r).plus(E),E=v.dividedBy(1e18).multipliedBy(o).plus(E),E=h.dividedBy(1e18).multipliedBy(l).plus(E),E=k.dividedBy(1e18).multipliedBy(s).plus(E),E=S.dividedBy(1e18).multipliedBy(d).plus(E);var $=new G.a(Object(ee.a)(R)).multipliedBy(100).toFixed(6),Y=t.quoteTokenAdresses,W=t.quoteTokenSymbol,_=t.tokenAddresses,J=(Object(te.a)({quoteTokenAdresses:Y,quoteTokenSymbol:W,tokenAddresses:_}),new G.a(Object(ee.a)(new G.a($).dividedBy(100).multipliedBy(2304e3).multipliedBy(1e18))).toFixed(0)),X=new G.a(Object(ee.a)(new G.a($).dividedBy(100).multipliedBy(7200).multipliedBy(1e18))).toFixed(1),ie=new G.a(Object(ee.a)(new G.a($).dividedBy(100).multipliedBy(.5).multipliedBy(1e18))).toFixed(4),ae=new G.a(Object(ee.a)(new G.a($).dividedBy(100).multipliedBy(.0288).multipliedBy(1e18))).toFixed(6),ce=new G.a(Object(ee.a)(new G.a($).dividedBy(100).multipliedBy(288e7).multipliedBy(1e18))).toFixed(0),se=new G.a(Object(ee.a)(new G.a($).dividedBy(100).multipliedBy(3).multipliedBy(1e18))).toFixed(3),le=new G.a(J).toNumber().toLocaleStr
1ing(),be=(new G.a(X).toNumber().toLocaleString(),new G.a(ae).toNumber().toLocaleString(),new G.a(ie).toNumber().toLocaleString(),new G.a(ce).toNumber().toLocaleString()),ue=new G.a(J).multipliedBy(o).toFixed(2),je=new G.a(X).multipliedBy(r).toFixed(2),xe=new G.a(ie).multipliedBy(s).toFixed(2),pe=new G.a(ae).multipliedBy(l).toFixed(2),me=d.isGreaterThan(0)?new G.a(ce).multipliedBy(d).toFixed(2):0,Oe=new G.a(se).multipliedBy(16).toFixed(2),he=(Number(ue)+Number(Oe)+Number(je)+Number(xe)+Number(pe)+Number(me)).toFixed(2),fe=A.toNumber().toLocaleString(),ge=E.toNumber().toLocaleString(),ke=365*(Number(ue)+Number(Oe)+Number(je)+Number(xe)+Number(pe)+Number(me))/A.toNumber()*100;return n?Object(ne.jsxs)(Me,{children:[Object(ne.jsx)($e,{}),Object(ne.jsx)(U.o,{mb:"8px",children:"\ud83d\udcb0 Rewards \ud83d\udcb0"}),Object(ne.jsx)(Q.a,{children:Object(ne.jsx)(Ue,{})}),Object(ne.jsx)(U.o,{mb:"8px",children:Object(ne.jsx)("u",{children:"Current Rewards"})}),Object(ne.jsxs)(U.B,{children:[Object(ne.jsx)("img",{src:"\\images\\battlefield\\shilling.svg",alt:"Shilling",height:"24px",width:"24px"})," SHILLING ",Object(ne.jsx)("img",{src:"\\images\\battlefield\\shilling.svg",alt:"Shilling",height:"24px",width:"24px"})]}),Object(ne.jsx)(De,{earnings:S,pid:4,earnedValue:S.multipliedBy(d),stakingBalance:D.bfStaking,children:"Harvest Shilling"}),Object(ne.jsxs)(U.B,{mt:"4px",children:[Object(ne.jsx)("img",{src:"\\images\\battlefield\\squire.svg",alt:"Squire",height:"32px",width:"32px"})," SQUIRE ",Object(ne.jsx)("img",{src:"\\images\\battlefield\\squire.svg",alt:"Squire",height:"32px",width:"32px"})]}),Object(ne.jsx)(Ge,{earnings:v,pid:3,earnedValue:v.multipliedBy(o),children:"Harvest Squire"}),Object(ne.jsxs)(U.B,{mt:"4px",children:[Object(ne.jsx)("img",{src:"\\images\\battlefield\\knight.svg",alt:"Knight",height:"32px",width:"32px"})," KNIGHT ",Object(ne.jsx)("img",{src:"\\images\\battlefield\\knight.svg",alt:"Knight",height:"32px",width:"32px"})]}),Object(ne.jsx)(Ge,{earnings:p,pid:0,earnedValue:p.multipliedBy(r),children:"Harvest Knight"}),Object(ne.jsxs)(U.B,{mt:"4px",children:[Object(ne.jsx)("img",{src:"\\images\\battlefield\\legend.svg",alt:"Legend",height:"32px",width:"32px"})," LEGEND ",Object(ne.jsx)("img",{src:"\\images\\battlefield\\legend.svg",alt:"Legend",height:"32px",width:"32px"})]}),Object(ne.jsx)(Ge,{earnings:k,pid:2,earnedValue:k.multipliedBy(s),children:"Harvest Legend"}),Object(ne.jsxs)(U.B,{mt:"4px",children:[Object(ne.jsx)("img",{src:"\\images\\battlefield\\table.svg",alt:"Table",height:"32px",width:"32px"})," TABLE ",Object(ne.jsx)("img",{src:"\\images\\battlefield\\table.svg",alt:"Table",height:"32px",width:"32px"})]}),Object(ne.jsx)(Ge,{earnings:h,pid:1,earnedValue:h.multipliedBy(l),children:"Harvest Table"}),Object(ne.jsx)(Ve,{}),Object(ne.jsx)(U.o,{mb:"8px",children:Object(ne.jsx)("u",{children:"Guest Rewards"})}),Object(ne.jsxs)(U.B,{children:[Object(ne.jsx)("img",{src:"\\images\\battlefield\\CAKE.png",alt:"CAKE",height:"32px",width:"32px"})," CAKE ",Object(ne.jsx)("img",{src:"\\images\\battlefield\\CAKE.png",alt:"CAKE",height:"32px",width:"32px"})]}),Object(ne.jsx)("a",{href:"https://www.pancakeswap.finance",target:"_newwindow",children:Object(ne.jsx)(U.B,{color:"gold",children:"Link to PancakeSwap"})}),Object(ne.jsx)(De,{earnings:D.totalGuestRewards,pid:6,earnedValue:D.totalGuestRewards.multipliedBy(16.429),stakingBalance:0,children:"Harvest Shilling"}),Object(ne.jsx)(Ve,{}),Object(ne.jsx)(Z.a,{onClick:function(){return L(!N)},expanded:N,showText:"Details",hideText:"Hide"}),Object(ne.jsx)(Ye,{expanded:N,children:Object(ne.jsxs)(Ke,{children:[Object(ne.jsxs)(U.B,{children:[" Your Estimated Daily Rewards: $",he]}),Object(ne.jsxs)(U.B,{children:[" SHILLING: ",be," - $",me]}),Object(ne.jsxs)(U.B,{children:[" SQUIRE: ",le," - $",ue]}),Object(ne.jsxs)(U.B,{children:[" KNIGHT: ",X," - $",je]}),Object(ne.jsxs)(U.B,{children:[" LEGEND: ",ie," - $",xe]}),Object(ne.jsxs)(U.B,{children:[" TABLE: ",ae," - $",pe]}),Object(ne.jsxs)(U.B,{mb:"8px",children:[" CAKE (Guest): ",se.toLocaleString()," - $",Oe]}),Object(ne.jsxs)(U.B,{mb:"8px",children:[" Current Rewards: $",ge]}),Object(ne.jsxs)(U.B,{mb:"8px",children:["Your Total Stake: $",fe," "]}),Object(ne.jsxs)(U.B,{children:["Estimated APR: ",ke.toFixed(2),"% "]})]})})]}):Object(ne.jsxs)(Me,{children:[Object(ne.jsx)($e,{}),Object(ne.jsx)(U.o,{mb:"8px",children:"\ud83d\udcb0 Rewards \ud83d\udcb0"}
1),Object(ne.jsx)(de.a,{})]})},_e=R.e.div(B||(B=Object(E.a)(["\n  margin-top: 24px;\n"]))),Je=Object(R.f)(v||(v=Object(E.a)(["\n\t0% {\n\t\tbackground-position: 0% 50%;\n\t}\n\t50% {\n\t\tbackground-position: 100% 50%;\n\t}\n\t100% {\n\t\tbackground-position: 0% 50%;\n\t}\n"]))),Xe=R.e.div(w||(w=Object(E.a)(["\n background: linear-gradient(\n    -45deg,\n    #ff738e,\n    #e4536f 20%,\n    #a34054 40%,\n    #b7eaff 60%,\n    #92cee7 80%,\n    #5dc4d9 100%\n  );\n  background-size: 300% 300%;\n  animation: "," 2s linear infinite;\n  border-radius: 16px;\n  filter: blur(8px);\n  position: absolute;\n  display: none;\n  top: -2px;\n  right: -2px;\n  bottom: -2px;\n  left: -2px;\n  z-index: -1;\n"])),Je),Ze=R.e.div(S||(S=Object(E.a)(["\n  align-self: baseline;\n  background: ",";\n  border-radius: 32px;\n  box-shadow: 0px 2px 12px -8px rgba(25, 19, 38, 0.1), 0px 1px 1px rgba(25, 19, 38, 0.05);\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})),et=R.e.div(C||(C=Object(E.a)(["\n  background-color: ",";\n  height: 1px;\n  margin: 28px auto;\n  width: 100%;\n"])),(function(e){return e.theme.colors.borderColor})),tt=R.e.div(T||(T=Object(E.a)(["\n  height: ",";\n  overflow: hidden;\n"])),(function(e){return e.expanded?"100%":"0px"})),nt=function(e){var t=e.battlefield,n=Object(_.a)().isDark,i=Object(M.k)(),a=Object(M.p)(),c=Object(M.n)(),r=Object(M.q)(),o=Object(M.o)(),s=Object(D.c)().account,l=Object(M.c)(0),d=l.stakedBalance,b=l.earnings,u=d,j=b,x=Object(M.c)(1),p=d=x.stakedBalance,m=b=x.earnings,O=Object(M.c)(2),h=d=O.stakedBalance,f=b=O.earnings,g=Object(M.c)(3),k=d=g.stakedBalance,y=b=g.earnings,B=b=Object(M.c)(4).earnings,v=Object(F.useState)(!1),w=Object(q.a)(v,2),S=w[0],C=w[1],T=new G.a(0),N=new G.a(0),L=Object(M.c)(0),A=L.userArmyStrength,I=L.userArmyPercent;T=u.dividedBy(1e18).multipliedBy(i).plus(T),T=k.dividedBy(1e18).multipliedBy(a).plus(T),T=p.dividedBy(1e18).multipliedBy(r).plus(T),T=h.dividedBy(1e18).multipliedBy(c).plus(T),N=j.dividedBy(1e18).multipliedBy(i).plus(N),N=y.dividedBy(1e18).multipliedBy(a).plus(N),N=m.dividedBy(1e18).multipliedBy(r).plus(N),N=f.dividedBy(1e18).multipliedBy(c).plus(N),N=B.dividedBy(1e18).multipliedBy(o).plus(N);var E=Object(M.b)(t.lpSymbol),P=(E.pid,E.lpAddresses,Object(ee.a)(A).toLocaleString()),R=new G.a(Object(ee.a)(I)).multipliedBy(100).toFixed(6),z=new G.a(t.totalArmyStrength).toNumber().toLocaleString(),H="Squire",Q="images/battlefield/squire.svg",$=Object(ee.a)(I.multipliedBy(100));$>=5?(H="Lord",Q="images/battlefield/Lord.png"):$>=1?(H="Baron",Q="images/battlefield/Baron.png"):$>=.1?(H="General",Q="images/battlefield/General.png"):$>=.001&&(H="Soldier",Q="images/battlefield/Soldier.png");t.apy&&t.apy.times(new G.a(100)).toNumber().toLocaleString("en-US").slice(0,-1);var V=t.quoteTokenAdresses,Y=t.quoteTokenSymbol,W=t.tokenAddresses,J=Object(te.a)({quoteTokenAdresses:V,quoteTokenSymbol:Y,tokenAddresses:W}),X=("".concat(K.a,"/").concat(J),new G.a(Object(ee.a)(new G.a(R).dividedBy(100).multipliedBy(2304e3).multipliedBy(1e18))).toFixed(0)),ie=new G.a(Object(ee.a)(new G.a(R).dividedBy(100).multipliedBy(7200).multipliedBy(1e18))).toFixed(1),ae=new G.a(Object(ee.a)(new G.a(R).dividedBy(100).multipliedBy(.5).multipliedBy(1e18))).toFixed(4),ce=new G.a(Object(ee.a)(new G.a(R).dividedBy(100).multipliedBy(.0288).multipliedBy(1e18))).toFixed(6),re=new G.a(Object(ee.a)(new G.a(R).dividedBy(100).multipliedBy(288e7).multipliedBy(1e18))).toFixed(0),oe=(new G.a(X).toNumber().toLocaleString(),new G.a(ie).toNumber().toLocaleString(),new G.a(ce).toNumber().toLocaleString(),new G.a(ae).toNumber().toLocaleString(),new G.a(re).toNumber().toLocaleString(),new G.a(X).multipliedBy(a).toFixed(2)),se=new G.a(ie).multipliedBy(i).toFixed(2),le=new G.a(ae).multipliedBy(c).toFixed(2),de=new G.a(ce).multipliedBy(r).toFixed(2),be=o.isGreaterThan(0)?new G.a(re).multipliedBy(o).toFixed(2):0,ue=((Number(oe)+Number(se)+Number(le)+Number(de)+Number(be)).toFixed(2),T.toNumber().toLocaleStr
1ing());N.toNumber().toLocaleString(),Number(oe),Number(se),Number(le),Number(de),Number(be),T.toNumber();return Object(ne.jsxs)(Ze,{children:[Object(ne.jsx)(Xe,{}),Object(ne.jsx)(U.o,{mb:"8px",children:"\u2694\ufe0f The Battlefield \u2694\ufe0f"}),Object(ne.jsx)(U.B,{children:" Earn all rewards at once by staking SQUIRE, KNIGHT, LEGEND, and TABLE!"}),Object(ne.jsx)(et,{}),Object(ne.jsx)(U.d,{as:"a",variant:"secondary",mt:"12px",ml:"12px",href:"https://docs.knightsdefi.com/battlefield",target:"_blank",children:"Read More"}),Object(ne.jsx)(et,{}),Object(ne.jsx)(Z.a,{onClick:function(){return C(!S)},expanded:S,showText:"Details",hideText:"Hide"}),Object(ne.jsx)(tt,{expanded:S,children:Object(ne.jsxs)(_e,{children:[Object(ne.jsxs)(U.B,{mb:"8px",children:["Total Army Strength: ",z," "]}),Object(ne.jsxs)(U.B,{mb:"8px",children:["Your Army Strength: ",P," "]}),Object(ne.jsxs)(U.B,{children:[" Your Army Percent: ",R,"% "]}),Object(ne.jsxs)(U.B,{mb:"8px",children:["Your Total Stake: $",ue," "]}),s?Object(ne.jsxs)(_e,{children:[Object(ne.jsxs)(U.o,{mb:"8px",children:[" Your Rank: ",H]}),Object(ne.jsx)("img",{src:Q,alt:H}),Object(ne.jsx)(et,{})]}):Object(ne.jsx)(U.B,{}),n?Object(ne.jsx)("img",{src:"images/battlefield/BFLegendDark.PNG",alt:"Battlefield Rank Legend"}):Object(ne.jsx)("img",{src:"images/battlefield/BFLegendLight.PNG",alt:"Battlefield Rank Legend"})]})})]})},it=n(1103),at=R.e.div(N||(N=Object(E.a)(["\n  background-color: ",";\n  height: 1px;\n  margin: 0 auto 32px;\n  width: 100%;\n"])),(function(e){return e.theme.colors.textSubtle})),ct=R.e.div(A||(A=Object(E.a)(["\n  align-items: center;\n  color: ",";\n  display: flex;\n  margin-left: auto;\n  margin-right: auto;\n  width: 100%;\n  justify-content: center;\n  padding: 48px 0;\n  ul {\n    margin: 0;\n    padding: 0;\n    list-style-type: none;\n    font-size: 16px;\n    li {\n      margin-bottom: 4px;\n    }\n  }\n"])),(function(e){return e.theme.colors.primary})),rt=function(){var e=Object(P.g)().path,t=Object(M.a)(),n=Object(M.k)(),i=Object(M.n)(),a=Object(M.p)(),c=Object(M.q)(),r=Object(M.o)(),o=Object(M.j)(),s=Object(D.c)(),l=s.account,d=s.ethereum,b=Object(M.m)(),u=Object(z.b)(),j=Object(V.a)().fastRefresh;Object(F.useEffect)((function(){l&&u(Object(Y.c)(l))}),[l,u,j]);var x=Object(F.useState)(!1),p=Object(q.a)(x,2),m=p[0],O=(p[1],R.e.div(L||(L=Object(E.a)(["\n  padding-top: 16px;\n"]))),t.filter((function(e){return!0===e.visible}))),h=t.filter((function(e){return"0X"===e.multiplier})),f=O.filter((function(e){return e.userData&&new G.a(e.userData.stakedBalance).isGreaterThan(0)})),g=(Object(_.a)().isDark,Object(F.useCallback)((function(e,s){var u,j=new G.a((null===(u=t.find((function(e){return e.pid===K.d})))||void 0===u?void 0:u.tokenPriceVsQuote)||0);return e.map((function(e){if(!e.tokenAmount||!e.lpTotalInQuoteToken||!e.lpTotalInQuoteToken)return e;var t=K.c.times(e.poolWeight),i=t.times(K.b),a=j.times(i).div(e.lpTotalInQuoteToken);if(e.quoteTokenSymbol===W.b.BUSD||e.quoteTokenSymbol===W.b.UST)a=j.times(i).div(e.lpTotalInQuoteToken).times(o);else if(e.quoteTokenSymbol===W.b.ETH)a=n.div(b).times(i).div(e.lpTotalInQuoteToken);else if(e.quoteTokenSymbol===W.b.CAKE)a=i.div(e.lpTotalInQuoteToken);else if(e.quoteTokenSymbol===W.b.KNIGHT)a=i.div(e.lpTotalInQuoteToken);else if(e.dual){var c=e&&j.times(t).times(K.b).div(e.lpTotalInQuoteToken),r=e.tokenPriceVsQuote&&new G.a(e.tokenPriceVsQuote).times(e.dual.rewardPerBlock).times(K.b).div(e.lpTotalInQuoteToken);a=c&&r&&c.plus(r)}return Object(I.a)(Object(I.a)({},e),{},{apy:a})})).map((function(e){return Object(ne.jsx)(Fe,{battlefield:e,removed:s,bnbPrice:o,cakePrice:n,legendPrice:i,tablePrice:c,squirePrice:a,shillingPrice:r,ethPrice:b,ethereum:d,account:l},e.pid)}))}),[t,o,i,c,a,r,b,n,d,l]));return Object(ne.jsxs)($.a,{children:[Object(ne.jsx)("div",{children:Object(ne.jsx)(Q.a,{children:Object(ne.jsxs)(P.a,{exact:!0,path:"".concat(e),children:[Object(ne.jsx)(U.o,{as:"h1",size:"xl",children:Object(ne.jsx)(nt,{battlefield:O[0]})}),Object(ne.jsx)(We,{battlefield:O[0],account:l})]})})}),Object(ne.jsxs)("div",{children:[Object(ne.jsxs)(Q.a,{children:[Object(ne.jsx)(P.a,{exact:!0,path:"".concat(e),children:g(m?f:O,!1)}),Object(ne.jsx)(P.a,{exact:!0,path:"".concat(e,"/history"),children:g(h,!0)})]}),Object(ne.jsx)(at,{}),Object(ne.jsx)(U.B,{children:"*Army Strength is calculated as follows:"}),Object(ne.jsx)(U.B,{children:"(SQUIRE*1e18 + (KNIGHT*1e18 * 500)) * 2^(floor(log10((TABLE*1e18 * LEGEND*1e18 * 5)))"})]}),Object(ne.jsx)(ct,{children:Object(ne.jsx)(it.a,{})})]})}}}]);
2//# sourceMappingURL=11.ea8aab97.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.