From 7d3655001b74eb1e5147afe5de140b5c20ad8247 Mon Sep 17 00:00:00 2001 From: chrisinajar Date: Thu, 1 Aug 2024 01:44:29 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20chrisina?= =?UTF-8?q?jar/proofofcombat@faf2aba018b97d44e1dd427657a2a7d35ae5f45f=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 4 ++-- .../_buildManifest.js | 2 +- .../_middlewareManifest.js | 0 .../_ssgManifest.js | 0 .../{536-030191733adba69b.js => 536-c2ae71923da7eb01.js} | 2 +- index.html | 2 +- map.html | 2 +- play.html | 2 +- play/admin.html | 2 +- play/combat.html | 2 +- play/inventory.html | 2 +- play/map.html | 2 +- play/quests.html | 2 +- play/settings.html | 2 +- play/shop.html | 2 +- 15 files changed, 14 insertions(+), 14 deletions(-) rename _next/static/{xQkA08X-qtLW5nWTvxfZl => LHUEjorCOpS4S0ps0U0RO}/_buildManifest.js (95%) rename _next/static/{xQkA08X-qtLW5nWTvxfZl => LHUEjorCOpS4S0ps0U0RO}/_middlewareManifest.js (100%) rename _next/static/{xQkA08X-qtLW5nWTvxfZl => LHUEjorCOpS4S0ps0U0RO}/_ssgManifest.js (100%) rename _next/static/chunks/{536-030191733adba69b.js => 536-c2ae71923da7eb01.js} (85%) diff --git a/404.html b/404.html index 6a863ca..2135aa2 100644 --- a/404.html +++ b/404.html @@ -1,4 +1,4 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file + }

404

This page could not be found.

\ No newline at end of file diff --git a/_next/static/xQkA08X-qtLW5nWTvxfZl/_buildManifest.js b/_next/static/LHUEjorCOpS4S0ps0U0RO/_buildManifest.js similarity index 95% rename from _next/static/xQkA08X-qtLW5nWTvxfZl/_buildManifest.js rename to _next/static/LHUEjorCOpS4S0ps0U0RO/_buildManifest.js index 494ce13..c8f4f86 100644 --- a/_next/static/xQkA08X-qtLW5nWTvxfZl/_buildManifest.js +++ b/_next/static/LHUEjorCOpS4S0ps0U0RO/_buildManifest.js @@ -1 +1 @@ -self.__BUILD_MANIFEST=function(s,a,t,e,c){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[s,a,t,"static/chunks/pages/index-3f10b49283edad6f.js"],"/_error":["static/chunks/pages/_error-0a004b8b8498208d.js"],"/map":[s,"static/chunks/pages/map-ac98fd875cc92bd3.js"],"/play":[s,a,e,t,c,"static/chunks/pages/play-14d3e1aa3e8af95e.js"],"/play/admin":[s,a,e,t,c,"static/chunks/pages/play/admin-f2e2bb7ab71f1d91.js"],"/play/combat":[s,a,e,t,c,"static/chunks/pages/play/combat-ce4a09652678edd7.js"],"/play/inventory":[s,a,e,t,c,"static/chunks/pages/play/inventory-88b38bcee85c1d92.js"],"/play/map":[s,a,e,t,c,"static/chunks/pages/play/map-928e6b01d827af73.js"],"/play/quests":[s,a,e,t,c,"static/chunks/pages/play/quests-336d76f75d63d7c1.js"],"/play/settings":[s,a,e,t,c,"static/chunks/pages/play/settings-017853d48aecfde4.js"],"/play/shop":[s,a,e,t,c,"static/chunks/pages/play/shop-023088f8729086d7.js"],sortedPages:["/","/_app","/_error","/map","/play","/play/admin","/play/combat","/play/inventory","/play/map","/play/quests","/play/settings","/play/shop"]}}("static/chunks/830-ce12a40911d27808.js","static/chunks/226-8d9d9cdfcb3554c6.js","static/chunks/998-343ebeb690eea4b5.js","static/chunks/607-a944e4e61d40f347.js","static/chunks/536-030191733adba69b.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file +self.__BUILD_MANIFEST=function(s,a,t,e,c){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[s,a,t,"static/chunks/pages/index-3f10b49283edad6f.js"],"/_error":["static/chunks/pages/_error-0a004b8b8498208d.js"],"/map":[s,"static/chunks/pages/map-ac98fd875cc92bd3.js"],"/play":[s,a,e,t,c,"static/chunks/pages/play-14d3e1aa3e8af95e.js"],"/play/admin":[s,a,e,t,c,"static/chunks/pages/play/admin-f2e2bb7ab71f1d91.js"],"/play/combat":[s,a,e,t,c,"static/chunks/pages/play/combat-ce4a09652678edd7.js"],"/play/inventory":[s,a,e,t,c,"static/chunks/pages/play/inventory-88b38bcee85c1d92.js"],"/play/map":[s,a,e,t,c,"static/chunks/pages/play/map-928e6b01d827af73.js"],"/play/quests":[s,a,e,t,c,"static/chunks/pages/play/quests-336d76f75d63d7c1.js"],"/play/settings":[s,a,e,t,c,"static/chunks/pages/play/settings-017853d48aecfde4.js"],"/play/shop":[s,a,e,t,c,"static/chunks/pages/play/shop-023088f8729086d7.js"],sortedPages:["/","/_app","/_error","/map","/play","/play/admin","/play/combat","/play/inventory","/play/map","/play/quests","/play/settings","/play/shop"]}}("static/chunks/830-ce12a40911d27808.js","static/chunks/226-8d9d9cdfcb3554c6.js","static/chunks/998-343ebeb690eea4b5.js","static/chunks/607-a944e4e61d40f347.js","static/chunks/536-c2ae71923da7eb01.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/_next/static/xQkA08X-qtLW5nWTvxfZl/_middlewareManifest.js b/_next/static/LHUEjorCOpS4S0ps0U0RO/_middlewareManifest.js similarity index 100% rename from _next/static/xQkA08X-qtLW5nWTvxfZl/_middlewareManifest.js rename to _next/static/LHUEjorCOpS4S0ps0U0RO/_middlewareManifest.js diff --git a/_next/static/xQkA08X-qtLW5nWTvxfZl/_ssgManifest.js b/_next/static/LHUEjorCOpS4S0ps0U0RO/_ssgManifest.js similarity index 100% rename from _next/static/xQkA08X-qtLW5nWTvxfZl/_ssgManifest.js rename to _next/static/LHUEjorCOpS4S0ps0U0RO/_ssgManifest.js diff --git a/_next/static/chunks/536-030191733adba69b.js b/_next/static/chunks/536-c2ae71923da7eb01.js similarity index 85% rename from _next/static/chunks/536-030191733adba69b.js rename to _next/static/chunks/536-c2ae71923da7eb01.js index 28d7570..8481646 100644 --- a/_next/static/chunks/536-030191733adba69b.js +++ b/_next/static/chunks/536-c2ae71923da7eb01.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[536],{7536:function(e,n,t){t.d(n,{Z:function(){return fi}});var r=t(5893),i=t(7294),o=t(1163),a=t(5152),l=t.n(a),s=t(5616),c=t(7720),u=t(1458),d=t(44),h=t(5861),m=t(6886),f=t(9104),v=t(4373),x=t(5670),p=t(409),y=t(5050),g=t(2950),b=t(7998),j=t(4051),Z=t.n(j),S=t(3920),w=t(8445),k=t(5739),A=t(9496),P=t(5662),C=t(7109),I=t(3946),L=t(4054),E=t(3841),O=t(7058),F=t(4156),T=t(8629),M=t(6824),W=t(622),G=t(4510),D=t(7952);function q(){var e,n,t,r=(0,D.UE)({fetchPolicy:"cache-only"}).data;return null!==(t=null===r||void 0===r||null===(e=r.me)||void 0===e||null===(n=e.account)||void 0===n?void 0:n.hero)&&void 0!==t?t:void 0}var B=t(9238),$=t(5018),z=t(3599),N=t(1903);function H(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsxs)(m.ZP,{item:!0,xs:6,children:["Received offers:",(0,r.jsx)(s.Z,{children:F.map((function(e){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(s.Z,{sx:{mt:1,bgcolor:"info.main",p:2},children:["From: ",(0,r.jsx)("b",{children:e.fromName}),(0,r.jsx)("br",{}),"Item: ",(0,r.jsx)("b",{children:(0,B.GJ)(e.item)}),(0,r.jsx)("br",{}),"Gold: ",(0,r.jsx)("b",{children:e.gold.toLocaleString()}),(0,r.jsx)("br",{}),(0,r.jsx)(P.Z,{sx:{m:1},variant:"contained",color:"success",disabled:I||e.gold>o.gold,onClick:function(){return function(e){return Q.apply(this,arguments)}(e.id)},children:"Accept Trade"}),(0,r.jsx)(P.Z,{sx:{m:1},variant:"contained",color:"error",disabled:I,onClick:function(){return q(e.id)},children:"Reject Trade"})]})},e.id)}))})]}),T.length>0&&(0,r.jsxs)(m.ZP,{item:!0,xs:6,children:["Sent offers:",(0,r.jsx)(s.Z,{children:T.map((function(e){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(s.Z,{sx:{mt:1,bgcolor:"info.main",p:2},children:["To: ",(0,r.jsx)("b",{children:e.toName}),(0,r.jsx)("br",{}),"Item: ",(0,r.jsx)("b",{children:(0,B.GJ)(e.item)}),(0,r.jsx)("br",{}),"Gold: ",(0,r.jsx)("b",{children:e.gold.toLocaleString()}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)(P.Z,{variant:"contained",color:"error",disabled:I,onClick:function(){return q(e.id)},children:"Cancel Trade"})]})},e.id)}))})]})]})]})}function Y(e){var n=e.artifact,t=e.title,o=e.affixes,a=e.sx,l=e.children;if(!n||!t)return null;var s=(0,B.Vy)(n),c=function(e,n){return(0,r.jsx)(h.Z,{variant:"body1",sx:a,children:(0,r.jsx)("b",{children:e})},n)};return"function"===typeof l&&(c=l),(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{children:t}),s.map((function(e){return o&&!o.includes(e.type)?null:c((0,B.xq)(e),e.type)}))]})}function K(e){var n=e.artifact;return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h4",children:n.name}),"A mysterious magical item with the following properties:",(0,r.jsx)(Y,{artifact:n})]})}function V(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t200&&$(j.slice(0,200))}),[j.length]),(0,i.useEffect)((function(){var e;if(!ce.current&&(null===m||void 0===m||null===(e=m.chat)||void 0===e?void 0:e.token)){var n={drop:"error",artifact:"warning",quest:"success",settlement:"info"};return ce.current=(0,S.io)(te,{withCredentials:!0,auth:{token:m.chat.token}}),ce.current.on("hello",(function(e){$(e.chat)})),ce.current.on("chat",(function(e){console.log("Got chat event!",e),$((function(n){return[e].concat(ne(n))}))})),ce.current.on("notification",(function(e){var t,r;e.item&&(e.message=e.message.replace("{{item}}",(0,B.GJ)(e.item))),"drop"===e.type||"artifact"===e.type?e.item?c("You found ".concat((0,B.GJ)(e.item)),{variant:"success"}):e.artifactItem?(c("You found ".concat(e.artifactItem.name),{variant:"success"}),se(e.artifactItem)):c(e.message,{variant:"success"}):"settlement"!==e.type&&c(e.message,{variant:"info"}),$((function(i){return[{type:null!==(t=e.type)&&void 0!==t?t:"notification",id:Math.random(),time:Date.now()/1e3,message:"",from:e.message,color:null!==(r=n[e.type])&&void 0!==r?r:"secondary",variant:"body1"}].concat(ne(i))}))})),ce.current.on("system-message",(function(e){c(e.message,{variant:"warning"}),$((function(n){return[{type:"system",id:Math.random(),time:Date.now()/1e3,message:e.message,from:"",color:e.color,variant:"h6"}].concat(ne(n))}))})),function(){ce.current&&(ce.current.disconnect(),ce.current=void 0)}}}),[null===m||void 0===m||null===(e=m.chat)||void 0===e?void 0:e.token]);var ue=a(R);function de(){return he.apply(this,arguments)}function he(){return(he=X(Z().mark((function e(){var n;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ce.current){e.next=2;break}return e.abrupt("return");case 2:if("private"!==(n=ie[V]).type){e.next=7;break}return ce.current.emit("private-chat",{to:n.heroId,message:R},(function(e){console.log("Got a confirmation!",e),$((function(n){return[e].concat(ne(n))}))})),U(""),e.abrupt("return");case 7:ce.current.emit("chat",{message:R},(function(e){console.log("Got a reply!",e),$((function(n){return[e].concat(ne(n))}))})),U("");case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var me,fe=j.filter((function(e){if("all"===V)return!0;if("chat"===V)return"chat"===e.type||"private"===e.type||"system"===e.type;if("notifications"===V)return"notification"===e.type||"drop"===e.type||"quest"===e.type||"system"===e.type;var n=ie[V];return!n||"private"===n.type&&("private"===e.type&&(e.heroId===n.heroId||e.to===n.heroId))})),ve=N?"Max message: ".concat(140-ue.length,"/").concat(140):"Type here...";return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(T.Z,{open:!(null===u||void 0===u?void 0:u.currentQuest)&&!!le,onClose:function(){return se(!1)},children:(0,r.jsx)(s.Z,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"background.paper",padding:[2,4],minWidth:"320px",maxWidth:"580px",width:"80%",textAlign:"center"},children:le&&(0,r.jsx)(K,{artifact:le})})}),(0,r.jsx)(x.ZP,{value:V,children:(0,r.jsx)(p.Z,{onChange:function(e,n){v&&y(!1),_(n)},"aria-label":"navigation tabs",variant:"scrollable",children:Object.keys(ie).map((function(e){return(0,r.jsx)(d.Z,{label:e,value:e},e)}))})}),"notifications"!==V&&(0,r.jsxs)(L.Z,{sx:{marginTop:1},fullWidth:!0,variant:"outlined",children:[(0,r.jsx)(E.Z,{htmlFor:"chat-input",children:ve}),(0,r.jsx)(O.Z,{disabled:!(null===(n=ce.current)||void 0===n?void 0:n.connected),value:R,id:"chat-input",name:"Chat input",label:ve,placeholder:"Type here...",onChange:function(e){var n=e.target.value;a(n).length<=140&&U(n)},onFocus:function(){return H(!0)},onBlur:function(){return H(!1)},autoComplete:"off",onKeyPress:function(e){"Enter"!==e.key||de()},endAdornment:(0,r.jsxs)(C.Z,{position:"end",children:[(0,r.jsx)(F.Z,{title:"Send message",children:(0,r.jsx)(I.Z,{"aria-label":"send chat",onClick:de,children:(0,r.jsx)(M.Z,{})})}),"private"===(null===(t=ie[V])||void 0===t?void 0:t.type)&&(0,r.jsx)(F.Z,{title:v?"Cancel trade":"Trade with player",children:(0,r.jsxs)(I.Z,{onClick:function(){return y(!v)},children:[v&&(0,r.jsx)(G.Z,{}),!v&&(0,r.jsx)(W.Z,{})]})})]})})]}),v&&u&&(null===(o=ie[V])||void 0===o?void 0:o.heroId)&&(0,r.jsx)(J,{hero:u,to:null!==(me=ie[V].heroId)&&void 0!==me?me:""}),(0,r.jsx)(s.Z,{sx:{padding:1,minHeight:"600px",bgcolor:"background.paper"},children:fe.map((function(e){return(0,r.jsxs)(h.Z,{variant:e.variant||"body1",sx:{color:"".concat("private"===e.type?"secondary":e.color||"text",".main")},children:[e.time&&(0,r.jsxs)(h.Z,{variant:"caption","aria-hidden":"true",children:["(",(0,k.S)(new Date(1e3*e.time)),")\xa0"]}),e.heroId&&(0,r.jsx)(P.Z,{onClick:function(){e.heroId&&l(e.from,e.heroId)},sx:{color:"inherit",textTransform:"none",paddingTop:0,paddingBottom:0,paddingLeft:1,paddingRight:.5,margin:0},children:(0,r.jsxs)("b",{children:[e.from,":"]})}),!e.heroId&&(0,r.jsx)("b",{children:e.from})," ",(0,w.emojify)(e.message)," ",e.time&&(0,r.jsxs)(h.Z,{variant:"caption",sx:g.Z,children:["(",(0,k.S)(new Date(1e3*e.time)),")\xa0"]})]},e.id)}))}),(0,r.jsx)("br",{})]})}var ie=t(1409),oe=t(737);function ae(){var e,n=q(),t=(0,D.W1)({variables:(null===n||void 0===n?void 0:n.location)?{location:{x:n.location.x,y:n.location.y,map:n.location.map}}:void 0,skip:!(null===n||void 0===n?void 0:n.location)}).data;return null!==(e=null===t||void 0===t?void 0:t.locationDetails)&&void 0!==e?e:null}function le(){var e=ae(),n=(null===e||void 0===e?void 0:e.specialLocations)||[];return n.length?n[0]:null}var se,ce=t(2734),ue=t(1292),de=t(5499),he=t(8698),me=t(7600),fe=t(5826);function ve(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var xe=(ve(se={},D.zP.Normal,"Normal stance with no pros or cons."),ve(se,D.zP.Combat,"???"),ve(se,D.zP.Reckless,"Double accuracy but makes you twice as easy to hit."),ve(se,D.zP.Aggressive,"???"),ve(se,D.zP.Defensive,"???"),ve(se,D.zP.NecroticBeam,"???"),ve(se,D.zP.CloudofKnives,"???"),ve(se,D.zP.FrozenOrb,"???"),ve(se,D.zP.MageArmor,"???"),ve(se,D.zP.NormalArrow,"???"),ve(se,D.zP.BarbedArrow,"???"),ve(se,D.zP.BloodHunter,"???"),ve(se,D.zP.DarkPresence,"???"),ve(se,D.zP.AuraoftheLifeless,"???"),ve(se,D.zP.ShieldSmash,"???"),ve(se,D.zP.ShieldSlash,"???"),ve(se,D.zP.HolySmite,"???"),ve(se,D.zP.VengefulSmite,"???"),ve(se,D.zP.WarriorsStance,"???"),ve(se,D.zP.Hexblade,"???"),ve(se,D.zP.Focus,"???"),se);function pe(e){var n=q(),t=(0,i.useState)((null===n||void 0===n?void 0:n.activeStance)||D.zP.Normal),o=t[0],a=t[1];if(!n)return null;var l=n.availableStances.map((function(e){return{name:e,tooltip:xe[e]}}));return l.length<2?null:(0,r.jsx)(m.ZP,{item:!0,xs:12,children:(0,r.jsxs)(m.ZP,{container:!0,sx:{textAlign:"center"},columns:6,spacing:2,children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(c.Z,{})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(h.Z,{variant:"h5",children:"Select Combat Style"})}),l.map((function(n){return(0,r.jsx)(m.ZP,{item:!0,lg:1,md:2,sm:3,xs:6,children:(0,r.jsx)(F.Z,{title:n.tooltip,children:(0,r.jsx)(P.Z,{variant:o===n.name?"outlined":"text",sx:{fontSize:"1rem",padding:2},size:"large",id:"set-stance-".concat(n.name.toLowerCase()),onClick:function(){return function(n){a(n),e.onChange&&e.onChange(n)}(n.name)},"aria-label":"set stance ".concat(n.name),children:n.name})})},n.name)}))]})})}function ye(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(l?"Auto-Battling":"Battling"),q<=0&&"Dead"," ",f.name]}),(0,r.jsx)(u.Z,{variant:"determinate",value:q,color:"error"})]}),q>0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:2,xl:2,children:(0,r.jsx)(F.Z,{title:"Attack using your melee weapons, uses strength and dexterity",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-melee",onClick:function(){return _(D.hK.Melee)},"aria-label":"melee attack",startIcon:(0,r.jsx)(ue.Z,{}),children:"Melee attack"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:2,xl:2,children:(0,r.jsx)(F.Z,{title:"Attack using your ranged weapons, uses dexterity",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-ranged",onClick:function(){return _(D.hK.Ranged)},"aria-label":"ranged attack",startIcon:(0,r.jsx)(de.Z,{}),children:"Ranged attack"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:2,xl:2,children:(0,r.jsx)(F.Z,{title:"Cast spells using your wisdom and intelligence",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-cast",onClick:function(){return _(D.hK.Cast)},"aria-label":"cast spell",startIcon:(0,r.jsx)(he.Z,{}),children:"Cast Spell"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:3,xl:3,children:(0,r.jsx)(F.Z,{title:"Smite your foe using wisdom and willpower",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-holy",onClick:function(){return _(D.hK.Smite)},"aria-label":"holy attack",startIcon:(0,r.jsx)(me.Z,{}),children:"Smite"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:6,md:3,xl:3,children:(0,r.jsx)(F.Z,{title:"Damage yourself to damage the enemy, uses constitution",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-blood",onClick:function(){return _(D.hK.Blood)},"aria-label":"blood magic",startIcon:(0,r.jsx)(fe.Z,{}),children:"Blood magic"})})})]})]}),S&&"This enemy was killed by another player",Q&&Q.log.map((function(e,n){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(h.Z,{children:[e.isEnchantment&&(0,r.jsxs)(i.Fragment,{children:[e.damage<0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("b",{children:e.from})," heals"," ",(0,r.jsx)("span",{id:"fight-".concat(e.from,"-enchantment-heal"),children:(0-e.damage).toLocaleString()})," ","health from their enchantments"]}),e.damage>0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("b",{children:e.from})," dealt"," ",(0,r.jsx)("span",{id:"fight-".concat(e.from,"-enchantment-damage"),children:e.damage.toLocaleString()})," ","enchantment damage to ",(0,r.jsx)("b",{children:e.to})]})]}),!e.isEnchantment&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("b",{children:e.from})," ".concat(we(e.attackType,e.success,e.critical)," "),(0,r.jsx)("b",{children:e.to}),e.success?" for ".concat(e.damage.toLocaleString()," ").concat(e.damageType?e.damageType.toLowerCase():""," damage!"):"."]})]})},"".concat(e.from,"-").concat(n))})),Q&&Q.victory&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)(h.Z,{id:"fight-did-win",children:[f.name," has been killed!",(Q.experience||Q.gold)&&" You gain ",Q.gold&&(0,r.jsxs)(i.Fragment,{children:[" ",(0,r.jsx)("span",{id:"fight-recap-gold",children:Q.gold.toLocaleString()})," ","gold"]}),Q.gold&&Q.experience&&" and",Q.experience&&(0,r.jsxs)(i.Fragment,{children:[" ",(0,r.jsx)("span",{id:"fight-recap-experience",children:Q.experience.toLocaleString()})," ","experience"]}),(Q.experience||Q.gold)&&"!! ",Q.didLevel&&(0,r.jsx)("b",{id:"fight-level-up",children:"You leveled up!!"})]}),Q.drop&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("br",{}),(0,r.jsxs)(h.Z,{id:"fight-got-drop",variant:"h5",children:["You find an enchanted item on the monster's corpse!",(0,r.jsx)("br",{}),(0,B.GJ)(Q.drop)]})]}),(0,r.jsx)("br",{}),V&&(0,r.jsx)(P.Z,{fullWidth:!0,color:"secondary",variant:"contained",onClick:function(){p&&p(f.id,N)},children:"Auto-Battle this enemy"})]})]})]})}function we(e,n,t){switch(e){case D.hK.Blood:return n?t?"surges with blood magic against":"lets blood and casts forth towards":"attempts to cast a spell against";case D.hK.Smite:return n?t?"summons powers beyond this world against":"smites":"attempts to smite";case D.hK.Cast:return n?t?"carefully casts a spell at":"blasts a beam of necrotic energy into":"attempts to cast a spell against";case D.hK.Ranged:return n?t?"lands a sneak attack from the shadows, critically damaging":"fires an arrow at":"shoots an arrow but it misses";case D.hK.Melee:default:return n?t?"lands a crippling blow against":"struck":"missed"}}function ke(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t.5?100*Math.random():g[0],Math.random()>.5?100*Math.random():g[1],Math.random()>.5?100*Math.random():g[2]]),0===x){e.next=4;break}return e.abrupt("return");case 4:if(!(Fe||H>0)){e.next=6;break}return e.abrupt("return");case 6:if(0!==(null===ge||void 0===ge?void 0:ge.combat.health)){e.next=9;break}return console.log("[AutoBattler] Healing!"),e.abrupt("return",Te());case 9:if(Le&&0!==Le.monster.combat.health&&Le.monster.id===C){e.next=13;break}return console.log("[AutoBattler] Challenging new mob!"),De(C),e.abrupt("return");case 13:if(!Le||!we.current){e.next=17;break}return console.log("[AutoBattler] Fighting ".concat(l,"!")),we.current(l),e.abrupt("return");case 17:console.log("[AutoBattler] Doing nothing...");case 18:case"end":return e.stop()}}),e)}))),(0,i.useEffect)((function(){if(w&&C.length){var e=(0,ie.Zi)((function(){j.current()}),500);return function(){(0,ie.cv)(e)}}}),[w,Oe]),(0,i.useEffect)((function(){var e;if(null===se||void 0===se||null===(e=se.monsters)||void 0===e?void 0:e.length){var n=se.monsters.concat().sort((function(e,n){return e.monster.level-n.monster.level}));if(""===K)V(n[0].id);else se.monsters.find((function(e){return e.id===K}))||V(n[0].id)}}),[K,null===se||void 0===se||null===(n=se.monsters)||void 0===n?void 0:n.length]);var ze=null===se||void 0===se||null===(t=se.monsters)||void 0===t?void 0:t.find((function(e){return e.id===K}));ze||(K="");var Ne=Ae.find((function(e){return e.id===te}));if(Ae.find((function(e){return e.id===X}))||(X=""),!ge)return null;ge.levelCap>100||(ye=ye.slice(0,ge.level)),Ae=Ae.filter((function(e){return e.combat.health>0}));var He="Select a new monster to challenge",Qe="Fight an existing monster!",Re="Duel with a nearby player!";return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:4,children:[!w&&ge&&ge.combat.health>0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(m.ZP,{item:!0,md:3,xs:6,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"challenge-monster-select-label",children:He}),(0,r.jsx)($.Z,{id:"challenge-select",labelId:"challenge-monster-select-label",value:U,label:He,disabled:w,onChange:function(e){return J(e.target.value)},children:ye.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,children:[e.name,"\xa0",(0,r.jsxs)(h.Z,{variant:"caption",display:"inline-block",children:["Tier ",e.level]})]},e.id)}))}),(0,r.jsx)(P.Z,{id:"challenge-button",disabled:!U||H>0||fe||w,onClick:function(){return Ge.apply(this,arguments)},variant:"contained",children:"Challenge!"})]})}),(0,r.jsx)(m.ZP,{item:!0,md:3,xs:6,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"fight-monster-select-label",children:Qe}),(0,r.jsx)($.Z,{id:"fight-select",labelId:"fight-monster-select-label",value:K,label:Qe,disabled:w,onChange:function(e){return V(e.target.value)},children:(null===se||void 0===se?void 0:se.monsters)&&Ie(null===se||void 0===se?void 0:se.monsters).sort((function(e,n){return e.monster.level-n.monster.level})).map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,disabled:0===e.monster.combat.health,children:[0===e.monster.combat.health&&"Dead ",e.monster.name]},e.id)}))}),(0,r.jsx)(P.Z,{id:"fight-button",disabled:!K||H>0||fe||ze&&0===ze.monster.combat.health||w,onClick:function(){return We.apply(this,arguments)},variant:"contained",children:"Fight!"})]})}),Ae.length>1&&(0,r.jsx)(m.ZP,{item:!0,md:3,xs:6,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"duel-select-label",children:Re}),(0,r.jsx)($.Z,{id:"duel-select",labelId:"duel-select-label",value:X,label:Re,disabled:w,onChange:function(e){return ee(e.target.value)},children:Ae.filter((function(e){return e.id!==ge.id})).sort((function(e,n){return e.level-n.level})).map((function(e){return(0,r.jsx)(z.Z,{value:e.id,children:e.name},e.id)}))}),(0,r.jsx)(P.Z,{id:"duel-button",disabled:!X.length||H>0||fe||w,onClick:function(){return $e.apply(this,arguments)},variant:"contained",children:"Duel Player!"})]})})]}),w&&(0,r.jsxs)(m.ZP,{item:!0,xs:6,children:[(0,r.jsx)(u.Z,{sx:{margin:1,color:"#f00"},variant:"determinate",value:g[0],color:"inherit"}),(0,r.jsx)(u.Z,{color:"inherit",sx:{margin:1,color:"#0f0"},variant:"determinate",value:g[1]}),(0,r.jsx)(u.Z,{color:"inherit",sx:{margin:1,color:"#00f"},variant:"determinate",value:g[2]}),(0,r.jsx)(P.Z,{fullWidth:!0,variant:"contained",color:"error",size:"large",onClick:function(){return k(!1)},children:"Disable Auto-Battle"})]}),ge&&ge.combat.health<=0&&(0,r.jsx)(m.ZP,{item:!0,lg:3,xs:6,children:(0,r.jsx)(h.Z,{id:"you-are-dead",children:"You are dead."})}),Le&&(0,r.jsx)(i.Fragment,{children:(0,r.jsx)(Se,{hero:ge,fight:Le,onError:function(){ue(),G(null)},autoBattle:w,canAutoBattle:Ee,onAutoBattle:function(e,n){return Be.apply(this,arguments)},fightMutationRef:we,onVictory:function(){return f(d+1)}},"".concat(Le.id,"-").concat(F))}),Ne&&(0,r.jsx)(i.Fragment,{children:(0,r.jsx)(Se,{hero:ge,fight:{id:Ne.id,monster:Ne},onError:function(){ue(),G(null)},duel:!0,autoBattle:!1,canAutoBattle:!1},"".concat(Ne.id,"-").concat(F))}),(0,r.jsx)(m.ZP,{item:!0,lg:3,xs:6,children:(0,r.jsx)(P.Z,{id:"heal-button",fullWidth:!0,onClick:Te,variant:"contained",disabled:H>0||fe||ge&&ge.combat.health===ge.combat.maxHealth,children:"Heal"})})]})})}var Oe=t(1514);function Fe(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsx)(h.Z,{sx:{mb:2},variant:"body1",color:o?"success.main":"error.main",children:s}),n.trades.map((function(e,n){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(h.Z,{children:[(0,r.jsx)(Je,{trade:e}),(0,r.jsx)(P.Z,{disabled:f,onClick:function(){return function(e){return v.apply(this,arguments)}(e.id)},sx:{ml:1},children:"Trade"})]})},"npc shop items ".concat(n))}))]})}function Je(e){var n=e.trade;return(0,r.jsxs)(i.Fragment,{children:["For the price of ",(0,r.jsx)(Ye,{price:n.price}),", I'll give you"," ",(0,r.jsx)(Ye,{price:n.offer})]})}function Ye(e){var n=e.price;return(0,r.jsx)(F.Z,{title:Ke(n),describeChild:!0,children:(0,r.jsx)("b",{"aria-label":Ke(n),children:n.description})})}function Ke(e){var n,t,r,i=[];return e.gold&&i.push("".concat(e.gold.toLocaleString()," gold")),e.dust&&i.push("".concat(e.dust.toLocaleString()," dust")),(null===(n=e.baseItems)||void 0===n?void 0:n.length)&&e.baseItems.forEach((function(e){i.push("".concat(e))})),(null===(t=e.enchantments)||void 0===t?void 0:t.length)&&e.enchantments.forEach((function(e){i.push("".concat((0,B.uD)(e)))})),(null===(r=e.questItems)||void 0===r?void 0:r.length)&&e.questItems.forEach((function(e){i.push("".concat(e))})),i.length?i.join(", "):"???"}var Ve=t(3020),_e=t(6242),Xe=t(2023),en=t(9748),nn=t(4267),tn=t(657),rn=t(1425),on=t(6580),an=t(8951),ln=t(3090),sn=t(1812),cn=t(7855),un=t(3707),dn=t(5843),hn=t(1233);function mn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);to?"error":"",component:"span","aria-label":"Upkeep: ".concat(l),children:[" ","-",l.toLocaleString()]})]},i)}))})}function An(e){var n,t=e.hero,i=e.camp,o=function(e){var n,t;return null!==(t=null===(n=e.find((function(e){return"gold"===e.name})))||void 0===n?void 0:n.value)&&void 0!==t?t:0},a=jn((0,D.Th)(),2),l=a[0],c=a[1].loading,u=(0,D.Hk)(),d=u.data,f=u.refetch,v=null!==(n=null===d||void 0===d?void 0:d.availableUpgrades)&&void 0!==n?n:[],x=jn((0,oe.gZ)(),1)[0]>0;if(!v.length)return null;function p(){return(p=bn(Z().mark((function e(n){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,l({variables:{upgrade:n}});case 3:return e.next=5,f();case 5:e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}var y=!!i.upgrades.find((function(e){return e===D.gT.Settlement}));return(0,r.jsxs)(s.Z,{children:[(0,r.jsxs)(h.Z,{variant:"h6",children:[y?"Settlement":"Camp"," Upgrades"]}),(0,r.jsx)(m.ZP,{container:!0,columns:6,spacing:2,children:v.map((function(e){return(0,r.jsx)(m.ZP,{item:!0,xs:3,children:(0,r.jsxs)(_e.Z,{variant:"outlined",children:[(0,r.jsx)(en.Z,{title:e.name}),(0,r.jsx)(nn.Z,{children:(0,r.jsxs)(h.Z,{variant:"body2",color:"text.secondary",children:["Cost:"," ",e.cost.map((function(e){return"".concat(e.value.toLocaleString()," ").concat((0,Ve.words)(e.name))})).join(", ")]})}),(0,r.jsx)(Xe.Z,{children:(0,r.jsx)(sn.Z,{disabled:x,loading:c,sx:{m:1},variant:"outlined",color:o(e.cost)>t.gold?"error":"success",onClick:function(){return function(e){return p.apply(this,arguments)}(e.type)},children:"Purchase"})})]})},e.type)}))})]})}function Pn(e){e.hero,e.camp;return null}var Cn=t(1730),In=t(2613),Ln=t(3054),En=t(7563),On=t(6398),Fn=t(6667),Tn=t(3898),Mn=t(1733),Wn=t(1671),Gn=t(1749),Dn=t(4231);function qn(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Bn(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,r=new Array(n);t=s||d.find((function(e){return e.x===t&&e.y===o}))?null:d.find((function(e){return e.x===t+1&&e.y===o||e.x===t-1&&e.y===o||e.x===t&&e.y===o+1||e.x===t&&e.y===o-1}))?{x:t,y:o,map:a.location.map}:null}),[d.length,t,o,s]);function m(){return(m=Rn(Z().mark((function e(n){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u({variables:{location:n,type:l}});case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}return h?(0,r.jsx)(i.Fragment,{children:(0,r.jsx)(Nn,{onClick:function(){return function(e){return m.apply(this,arguments)}(h)},hover:!0,color:"rgb(10, 120, 10)",cellSize:n,boundingBox:c,location:h,tooltip:"Build here",icon:(0,r.jsx)(Ln.Z,{})},"".concat(h.x,"-").concat(h.y))}):null}function Yn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0?(0,r.jsx)("li",{children:(0,r.jsx)(et,{name:(0,Ve.words)(e.name),"aria-label":"".concat(e.value.toLocaleString()," out of ").concat((null!==(o=e.maximum)&&void 0!==o?o:0).toLocaleString()),value:"".concat(e.value.toLocaleString()," / ").concat((null!==(a=e.maximum)&&void 0!==a?a:0).toLocaleString())})},e.name):null}))]}),l.id===(null===(n=s.home)||void 0===n?void 0:n.id)&&(0,r.jsx)(An,{camp:l,hero:s}),l.type===D.oS.Settlement&&l.id!==(null===(t=s.home)||void 0===t?void 0:t.id)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{children:"This settlement is a former capital that has fallen. You can destroy this location and reclaim most of the resources."}),(0,r.jsx)(P.Z,{onClick:function(){return c(l)},variant:"contained",color:"error",children:"Destroy former settlement"})]}),l.type===D.oS.Barracks&&(0,r.jsx)(nt,{location:l,action:"Recruit",unit:"troops",cost:1e6,loading:m,onPurchase:function(e){d({variables:e})}}),l.type===D.oS.Treasury&&(0,r.jsx)(nt,{location:l,action:"Purchase",unit:"bonds",cost:1e6,loading:x,onPurchase:function(e){v({variables:e})}}),l.type===D.oS.Treasury&&(0,r.jsx)(nt,{location:l,action:"Sell",unit:"bonds",cost:1e6,loading:x,onPurchase:function(e){v({variables:Vn({},e,{amount:0-e.amount})})}}),l.type===D.oS.Treasury&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(sn.Z,{sx:{m:1},loading:S,variant:"contained",disabled:w,onClick:function(){Z({variables:{location:{x:l.location.x,y:l.location.y,map:l.location.map},greater:!1}})},children:"Craft Element of Gold (1,000,000 bonds)"}),(0,r.jsx)(sn.Z,{sx:{m:1},loading:S,variant:"contained",disabled:w,onClick:function(){Z({variables:{location:{x:l.location.x,y:l.location.y,map:l.location.map},greater:!0}})},children:"Craft Greater Element of Gold (250,000,000 bonds)"})]}),l.type===D.oS.Garrison&&(0,r.jsx)(nt,{location:l,action:"Build",unit:"fortifications",cost:1e6,loading:b,onPurchase:function(e){g({variables:e})}})]}):null}function et(e){var n=e.name,t=e.value,i=e["aria-label"];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("label",{style:{fontWeight:"bold"},htmlFor:"building-details-value-".concat(n),children:[n,":"]})," ",(0,r.jsx)("span",{"aria-label":i,children:t})]})}function nt(e){var n=e.location,t=e.action,o=e.unit,a=e.cost,l=e.loading,s=void 0!==l&&l,c=e.onPurchase,u=(0,i.useState)(0),d=u[0],h=u[1],m=(_n((0,D.Up)(),1)[0],(0,oe.mu)()),f=Number.isFinite(d)&&!isNaN(d)&&d>0;return(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(N.Z,{onChange:function(e){return h(parseInt(e.target.value))},id:"".concat(t,"-input"),label:"Amount of ".concat(o," to ").concat(t.toLowerCase())}),(0,r.jsxs)(sn.Z,{loading:s,variant:"contained",disabled:!f||m,onClick:function(){Number.isFinite(d)&&!isNaN(d)&&c({location:{x:n.location.x,y:n.location.y,map:n.location.map},amount:d})},children:[!f&&"".concat(t," ").concat(o),f&&"".concat(t," ").concat(d.toLocaleString()," ").concat(o," for ").concat((d*a).toLocaleString()," gold")]})]})}var tt=t(89),rt=t(3800),it=t(8456);function ot(e){var n,t,i,o=e.open,a=e.onClose,l=e.loading,c=e.attackResults,u=e.hero;return(0,r.jsx)(T.Z,{open:o,onClose:a,children:(0,r.jsxs)(s.Z,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"background.paper",padding:[2,4],minWidth:"320px",maxWidth:"580px",width:"80%",textAlign:"center"},"aria-labelledby":"attack-results-modal-title","aria-describedby":"modal-modal-description",children:[l&&(0,r.jsx)(it.Z,{}),c&&(0,r.jsxs)(r.Fragment,{children:[c.target.owner===u.id&&(0,r.jsx)(h.Z,{id:"attack-results-modal-title",variant:"h5",component:"h2",children:"Your troops have claimed this location in your name, it now belongs to your settlement."}),c.target.owner!==u.id&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Z,{id:"attack-results-modal-title",variant:"h5",component:"h2",children:["Attack results for ",c.target.location.x,","," ",c.target.location.y]}),(0,r.jsxs)(h.Z,{variant:"subtitle1",children:["Owner:"," ",(0,r.jsx)("strong",{children:null!==(i=null===c||void 0===c||null===(n=c.target)||void 0===n||null===(t=n.publicOwner)||void 0===t?void 0:t.name)&&void 0!==i?i:"Unknown"})]})]}),(0,r.jsx)("br",{}),(0,r.jsxs)(h.Z,{children:["You lost ",at(c.attackerCasualties)]}),(0,r.jsxs)(h.Z,{children:["Your opponent lost"," ",at(c.targetCasualties)]}),c.totalDamage>0&&(0,r.jsxs)(h.Z,{children:["Your troops dealt ",c.totalDamage.toLocaleString()," ","damage"]}),c.damage>0&&(0,r.jsxs)(h.Z,{children:["The target location received"," ",c.damage.toLocaleString()," damage",c.totalDamage>c.damage&&", the rest was absorbed by garrisons."]}),0===c.damage&&(0,r.jsx)(h.Z,{children:"All damage was absorbed by garrisons."})]})]})})}function at(e){var n=Object.keys(e).map((function(n){var t=e[n];return!!(t&&t>0)&&"".concat(t.toLocaleString()," ").concat(n)})).filter((function(e){return!!e}));return n.length?n.join(", "):"nothing"}function lt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-ghost",children:"Ghost:"})," ",(0,r.jsx)("span",{id:"military-target-ghost",children:(null!==(I=null===(f=Oe.ghost)||void 0===f?void 0:f.value)&&void 0!==I?I:0).toLocaleString()})]})]}),ne&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h5",children:"Troups in this location"}),(0,r.jsxs)("ul",{children:[(null!==(L=null===Ce||void 0===Ce?void 0:Ce.value)&&void 0!==L?L:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-enlisted",children:"Enlisted:"})," ",(0,r.jsx)("span",{id:"military-target-enlisted",children:(null!==(E=null===Ce||void 0===Ce?void 0:Ce.value)&&void 0!==E?E:0).toLocaleString()})]}),(null!==(O=null===Ie||void 0===Ie?void 0:Ie.value)&&void 0!==O?O:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-soldier",children:"Soldier:"})," ",(0,r.jsx)("span",{id:"military-target-soldier",children:(null!==(F=null===Ie||void 0===Ie?void 0:Ie.value)&&void 0!==F?F:0).toLocaleString()})]}),(null!==(T=null===Le||void 0===Le?void 0:Le.value)&&void 0!==T?T:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-veteran",children:"Veteran:"})," ",(0,r.jsx)("span",{id:"military-target-veteran",children:(null!==(M=null===Le||void 0===Le?void 0:Le.value)&&void 0!==M?M:0).toLocaleString()})]}),(null!==(W=null===Ee||void 0===Ee?void 0:Ee.value)&&void 0!==W?W:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-ghost",children:"Ghost:"})," ",(0,r.jsx)("span",{id:"military-target-ghost",children:(null!==(G=null===Ee||void 0===Ee?void 0:Ee.value)&&void 0!==G?G:0).toLocaleString()})]})]}),(0,r.jsx)(h.Z,{mb:2,component:"h6",variant:"h5",children:"Troops to send"}),(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:2,children:[(0,r.jsx)(ht,{name:"enlisted",value:le,onChange:se,max:Pe?null!==(q=null===(v=Oe.enlisted)||void 0===v?void 0:v.value)&&void 0!==q?q:0:Math.min(null!==(B=null===(x=Oe.enlisted)||void 0===x?void 0:x.value)&&void 0!==B?B:0,(null!==($=null===Ce||void 0===Ce?void 0:Ce.maximum)&&void 0!==$?$:0)-(null!==(z=null===Ce||void 0===Ce?void 0:Ce.value)&&void 0!==z?z:0))}),(0,r.jsx)(ht,{name:"soldier",value:ue,onChange:de,max:Pe?null!==(N=null===(p=Oe.soldier)||void 0===p?void 0:p.value)&&void 0!==N?N:0:Math.min(null!==(H=null===(y=Oe.soldier)||void 0===y?void 0:y.value)&&void 0!==H?H:0,(null!==(Q=null===Ie||void 0===Ie?void 0:Ie.maximum)&&void 0!==Q?Q:0)-(null!==(R=null===Ie||void 0===Ie?void 0:Ie.value)&&void 0!==R?R:0))}),(0,r.jsx)(ht,{name:"veteran",value:me,onChange:fe,max:Pe?null!==(U=null===(g=Oe.veteran)||void 0===g?void 0:g.value)&&void 0!==U?U:0:Math.min(null!==(J=null===(b=Oe.veteran)||void 0===b?void 0:b.value)&&void 0!==J?J:0,(null!==(Y=null===Le||void 0===Le?void 0:Le.maximum)&&void 0!==Y?Y:0)-(null!==(K=null===Le||void 0===Le?void 0:Le.value)&&void 0!==K?K:0))}),(0,r.jsx)(ht,{name:"ghost",value:xe,onChange:pe,max:Pe?null!==(V=null===(j=Oe.ghost)||void 0===j?void 0:j.value)&&void 0!==V?V:0:Math.min(null!==(_=null===(S=Oe.ghost)||void 0===S?void 0:S.value)&&void 0!==_?_:0,(null!==(X=null===Ee||void 0===Ee?void 0:Ee.maximum)&&void 0!==X?X:0)-(null!==(ee=null===Ee||void 0===Ee?void 0:Ee.value)&&void 0!==ee?ee:0))})]}),Pe&&(0,r.jsx)(P.Z,{onClick:function(){return Fe.apply(this,arguments)},children:"Attack target"}),!Pe&&(0,r.jsx)(P.Z,{onClick:function(){ne&&je({variables:{target:{x:ne.location.x,y:ne.location.y,map:ne.location.map},units:{enlisted:le,soldier:ue,veteran:me,ghost:xe}}})},children:"Move troops"})]})]})}function ht(e){var n=e.name,t=e.onChange,i=e.value,o=e.max;return 0===o?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.ZP,{item:!0,xs:1,children:(0,r.jsxs)("label",{id:"military-slider-".concat(n,"-label"),children:[(0,Ve.words)(n),":"]})}),(0,r.jsx)(m.ZP,{item:!0,xs:3,children:(0,r.jsx)(L.Z,{fullWidth:!0,children:(0,r.jsx)(rt.ZP,{value:i,onChange:function(e,n){return t(n)},min:0,max:o,valueLabelDisplay:"auto",getAriaValueText:function(e){return e.toLocaleString()},"aria-labelledby":"military-slider-".concat(n,"-label")})})}),(0,r.jsx)(m.ZP,{item:!0,xs:2,children:(0,r.jsx)(L.Z,{fullWidth:!0,children:(0,r.jsx)(tt.Z,{value:i,size:"small",onChange:function(e){return t(""===e.target.value?0:Number(e.target.value))},onBlur:function(){i<0?t(0):i>o&&t(o)},inputProps:{step:1,min:0,max:o,type:"number","aria-labelledby":"input-slider"}})})})]})}var mt,ft=t(947);function vt(e){var n=e.cellSize,t=e.x,i=e.y,o=e.boundingBox,a=e.onClick,l=e.adjacentTiles.find((function(e){return e.location.x===t&&e.location.y===i}));return l?(0,r.jsx)(Nn,{onClick:function(){return a(l)},hover:!0,cellSize:n,boundingBox:o,location:{x:t,y:i},tooltip:"Attack here",color:"rgb(140, 0, 0)",icon:(0,r.jsx)(ft.Z,{})},"".concat(t,"-").concat(i)):null}function xt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&"(-".concat(re.upkeep[e.name].toLocaleString(),")")]})},e.name):(0,r.jsxs)(m.ZP,{item:!0,xs:6,sm:3,md:2,lg:1,children:[(0,r.jsx)("b",{children:(0,Ve.words)(e.name)}),":"," ",e.value.toLocaleString(),e.maximum&&" / ".concat(e.maximum.toLocaleString())," ",re.upkeep[e.name]>0&&"(-".concat(re.upkeep[e.name].toLocaleString(),")")]},e.name):(0,r.jsxs)(m.ZP,{item:!0,xs:6,sm:3,md:2,lg:1,children:[(0,r.jsx)("b",{children:(0,Ve.words)(e.name)}),":"," ",e.value.toLocaleString(),e.maximum&&" / ".concat(e.maximum.toLocaleString())]},e.name)})),(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsxs)(p.Z,{"aria-label":"navigation tabs",variant:"scrollable",textColor:"secondary",indicatorColor:"secondary",onChange:function(e,n){I&&L(null),R(n)},sx:{flexShrink:0,flexGrow:1},children:[(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Wn.Z,{}),label:"Building Details",value:"info",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Ln.Z,{}),label:"Build Buildings",value:"build",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Mn.Z,{}),label:"Destroy Buildings",value:"destroy",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(En.Z,{}),label:"Resource Market",value:"market",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Gn.Z,{}),label:"Military",value:"military",wrapped:!0})]})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,md:3,lg:3,children:(0,r.jsxs)(s.Z,{sx:{position:"relative"},children:[(0,r.jsx)(h.Z,{variant:"h6",style:g.Z,children:"Buildings"}),(0,r.jsx)(Ge,{location:re.location,minimapSize:[se,ue],cellSize:he,renderCell:function(e){var n,t,i,o,a,l,s,u,d,h,m,f,v,x,p,y,g,b,j,Z,S,w,k,A,P,C,L,E,O,F,T,M,W,G,q,B,$,z,N,H,R,U,J,Y,K,V,_,X,ee,ie,oe,ae,se=e.x,ce=e.y,ue=!1,de=!1;(null===(n=fe[se])||void 0===n||null===(t=n[ce])||void 0===t?void 0:t.type)!==D.oS.Garrison&&(null===(i=fe[se-1])||void 0===i||null===(o=i[ce+1])||void 0===o?void 0:o.type)!==D.oS.Garrison&&(null===(a=fe[se+1])||void 0===a||null===(l=a[ce+1])||void 0===l?void 0:l.type)!==D.oS.Garrison&&(null===(s=fe[se-1])||void 0===s||null===(u=s[ce])||void 0===u?void 0:u.type)!==D.oS.Garrison&&(null===(d=fe[se+1])||void 0===d||null===(h=d[ce])||void 0===h?void 0:h.type)!==D.oS.Garrison&&(null===(m=fe[se-1])||void 0===m||null===(f=m[ce-1])||void 0===f?void 0:f.type)!==D.oS.Garrison&&(null===(v=fe[se+1])||void 0===v||null===(x=v[ce-1])||void 0===x?void 0:x.type)!==D.oS.Garrison&&(null===(p=fe[se])||void 0===p||null===(y=p[ce+1])||void 0===y?void 0:y.type)!==D.oS.Garrison&&(null===(g=fe[se])||void 0===g||null===(b=g[ce-1])||void 0===b?void 0:b.type)!==D.oS.Garrison&&(null===(j=fe[se])||void 0===j||null===(Z=j[ce+2])||void 0===Z?void 0:Z.type)!==D.oS.Garrison&&(null===(S=fe[se])||void 0===S||null===(w=S[ce-2])||void 0===w?void 0:w.type)!==D.oS.Garrison&&(null===(k=fe[se+2])||void 0===k||null===(A=k[ce])||void 0===A?void 0:A.type)!==D.oS.Garrison&&(null===(P=fe[se-2])||void 0===P||null===(C=P[ce])||void 0===C?void 0:C.type)!==D.oS.Garrison||(ue=!0),(null===(L=fe[se])||void 0===L||null===(E=L[ce])||void 0===E?void 0:E.type)!==D.oS.Barracks&&(null===(O=fe[se-1])||void 0===O||null===(F=O[ce+1])||void 0===F?void 0:F.type)!==D.oS.Barracks&&(null===(T=fe[se+1])||void 0===T||null===(M=T[ce+1])||void 0===M?void 0:M.type)!==D.oS.Barracks&&(null===(W=fe[se-1])||void 0===W||null===(G=W[ce])||void 0===G?void 0:G.type)!==D.oS.Barracks&&(null===(q=fe[se+1])||void 0===q||null===(B=q[ce])||void 0===B?void 0:B.type)!==D.oS.Barracks&&(null===($=fe[se-1])||void 0===$||null===(z=$[ce-1])||void 0===z?void 0:z.type)!==D.oS.Barracks&&(null===(N=fe[se+1])||void 0===N||null===(H=N[ce-1])||void 0===H?void 0:H.type)!==D.oS.Barracks&&(null===(R=fe[se])||void 0===R||null===(U=R[ce+1])||void 0===U?void 0:U.type)!==D.oS.Barracks&&(null===(J=fe[se])||void 0===J||null===(Y=J[ce-1])||void 0===Y?void 0:Y.type)!==D.oS.Barracks&&(null===(K=fe[se])||void 0===K||null===(V=K[ce+2])||void 0===V?void 0:V.type)!==D.oS.Barracks&&(null===(_=fe[se])||void 0===_||null===(X=_[ce-2])||void 0===X?void 0:X.type)!==D.oS.Barracks&&(null===(ee=fe[se+2])||void 0===ee||null===(ie=ee[ce])||void 0===ie?void 0:ie.type)!==D.oS.Barracks&&(null===(oe=fe[se-2])||void 0===oe||null===(ae=oe[ce])||void 0===ae?void 0:ae.type)!==D.oS.Barracks||(de=!0);var me=void 0;if(ue?(me="blue",de&&(me="green")):de&&(me="rgb(180, 200, 0)"),se===re.location.x&&ce===re.location.y)return(0,r.jsx)(Nn,{onClick:function(){return c(function(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,r=new Array(n);t0||E;function J(e){return Y.apply(this,arguments)}function Y(){return(Y=Pt(Z().mark((function e(n){var t,r;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,A({variables:{direction:n}});case 3:T(),e.next=10;break;case 6:e.prev=6,e.t0=e.catch(0),e.t0.graphQLErrors&&(null===(t=e.t0.graphQLErrors[0])||void 0===t||null===(r=t.extensions)||void 0===r?void 0:r.delay)&&w(e.t0.graphQLErrors[0].extensions.remaining);case 10:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}function K(){return(K=Pt(Z().mark((function e(){var n,t;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,L({variables:{x:x,y:g}});case 3:T(),e.next=10;break;case 6:e.prev=6,e.t0=e.catch(0),e.t0.graphQLErrors&&(null===(n=e.t0.graphQLErrors[0])||void 0===n||null===(t=n.extensions)||void 0===t?void 0:t.delay)&&w(e.t0.graphQLErrors[0].extensions.remaining);case 10:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}var V,_=Math.round(Math.pow(5*(0,B.LW)(s.location,{x:x,y:g}),1.3));return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(m.ZP,{container:!0,columns:2,spacing:3,children:[(0,r.jsx)(m.ZP,{item:!0,xs:2,sm:1,children:(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:3,children:[(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:6,children:(0,r.jsx)(Zn,{hero:s,onShowSettlement:function(){f(!0)}})}),(0,r.jsxs)(m.ZP,{item:!0,style:{textAlign:"center"},xs:6,children:[(0,r.jsx)(h.Z,{variant:"h3",children:"Travel"}),s.combat.health>0&&(0,r.jsx)(h.Z,{children:"Use buttons to move around the map."}),0===s.combat.health&&(0,r.jsx)(h.Z,{component:"p",variant:"h6",children:"You cannot move while dead. Heal yourself in the Combat tab."})]}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"North terrain: ".concat(z),disabled:U,variant:"contained",onClick:function(){return J(D.p$.North)},children:"North"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"West terrain: ".concat(R),disabled:U,variant:"contained",onClick:function(){return J(D.p$.West)},children:"West"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsxs)(h.Z,{children:[s.location.x,", ",s.location.y]})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"East terrain: ".concat(Q),disabled:U,variant:"contained",onClick:function(){return J(D.p$.East)},children:"East"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"South terrain: ".concat(H),disabled:U,variant:"contained",onClick:function(){return J(D.p$.South)},children:"South"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),s.stats.intelligence>100&&(0,r.jsxs)(m.ZP,{item:!0,style:{textAlign:"center"},xs:6,children:[(0,r.jsx)(c.Z,{}),(0,r.jsx)(h.Z,{variant:"h5",component:"h3",color:"secondary",sx:{margin:1},children:"Teleport"}),(0,r.jsx)(N.Z,{label:"X coordinate",value:x,onChange:function(e){return l(e.target.value,g)},sx:{width:"100px",margin:1}}),(0,r.jsx)(N.Z,{label:"Y coordinate",value:g,onChange:function(e){return l(x,e.target.value)},sx:{width:"100px",margin:1}}),(0,r.jsx)("br",{}),(0,r.jsxs)(P.Z,{color:"secondary",variant:"outlined",onClick:function(){return K.apply(this,arguments)},disabled:0===_||_>s.stats.intelligence||U,children:["Teleport",(0,r.jsx)("br",{}),_>0&&"".concat(_.toLocaleString()," minimum intelligence")]})]})]})}),(0,r.jsxs)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,sm:1,children:[G&&(0,r.jsx)(h.Z,{variant:"h6",component:"h4",children:G.name}),G&&(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:G.type}),$&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)(h.Z,{variant:"h6",component:"h4",children:[null!==(V=null===(t=$.publicOwner)||void 0===t?void 0:t.name)&&void 0!==V?V:"???","'s Settlement"]}),(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:$.type})]}),!G&&!$&&W&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h6",component:"h4",children:"Wilderness"}),(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:W.terrain.terrain})]}),!G&&!$&&!W&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h6",component:"h4",children:"\xa0"}),(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:"loading..."})]}),(0,r.jsx)(Ge,{location:s.location,renderCell:function(e){var n=e.x,t=e.y;return s.location.x===n&&s.location.y===t?(0,r.jsx)("div",{style:{borderRadius:"".concat(4,"px"),backgroundColor:"red",border:"2px solid rgba(255,255,255,0.3)",width:"".concat(8,"px"),height:"".concat(8,"px"),margin:"auto"}}):null}}),(null===G||void 0===G?void 0:G.description)&&G.description.map((function(e,n){return(0,r.jsx)(h.Z,{component:"h4",variant:"body1",children:e},"loc-desc-".concat(n))})),M.filter((function(e){return!!e})).map((function(e){return(0,r.jsx)(h.Z,{component:"h4",variant:"body1",children:e},e)}))]}),"dock"===(null===G||void 0===G?void 0:G.type)&&(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(ze,{location:G})}),(null===W||void 0===W?void 0:W.shop)&&(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(Ue,{shop:null===W||void 0===W?void 0:W.shop})})]})})}var Et,Ot=t(5582);function Ft(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t2&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{id:"level-up-stat-slider-label",children:x}),(0,r.jsx)(rt.ZP,{min:1,max:v.attributePoints,value:a,onChange:function(e,n){return!Array.isArray(n)&&l(n)},id:"level-up-stat-slider","aria-labelledby":"level-up-stat-slider-label",valueLabelDisplay:"auto"})]})})]}),(0,r.jsx)("br",{}),(0,r.jsxs)(m.ZP,{container:!0,columns:14,spacing:2,children:[(0,r.jsx)(F.Z,{title:"Strength determines your damage when attacking with melee weapons",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-strength",disabled:f||n>0,onClick:function(){return p("Strength")},variant:"contained",children:"Strength"})})})}),(0,r.jsx)(F.Z,{title:"Dexterity determines the accuracy and dodge rate for melee and ranged weapons, it also determines ranged weapons damage",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-dexterity",disabled:f||n>0,onClick:function(){return p("Dexterity")},variant:"contained",children:"Dexterity"})})})}),(0,r.jsx)(F.Z,{title:"Constitution determines your max health, and is used in both attacking and defending blood magic",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-constitution",disabled:f||n>0,onClick:function(){return p("Constitution")},variant:"contained",children:"Constitution"})})})}),(0,r.jsx)(F.Z,{title:"Intelligence determines your spellcasting damage",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-intelligence",disabled:f||n>0,onClick:function(){return p("Intelligence")},variant:"contained",children:"Intelligence"})})})}),(0,r.jsx)(F.Z,{title:"Wisdom is your accuracy and dodge stat for spellcasting and smiting",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-wisdom",disabled:f||n>0,onClick:function(){return p("Wisdom")},variant:"contained",children:"Wisdom"})})})}),(0,r.jsx)(F.Z,{title:"Willpower helps you survive attacks by reducing damage, it also helps smiters deal deal more damage.",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-willpower",disabled:f||n>0,onClick:function(){return p("Willpower")},variant:"contained",children:"Willpower"})})})}),(0,r.jsx)(F.Z,{title:"Luck helps you critically strike foes and also affects item drop rates",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,md:12,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-luck",disabled:f||n>0,onClick:function(){return p("Luck")},variant:"contained",children:"Luck"})})})}),(0,r.jsx)(F.Z,{title:"Places 1 in every stat for a more well rounded character",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,md:12,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-all",disabled:f||n>0,onClick:function(){return p("All")},variant:"contained",children:"All"})})})})]}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{})]}),(0,r.jsx)(c.Z,{})]})}function Dt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);ta.gold,children:[e.cost&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{display:"inline-block",children:e.name}),"\xa0",(0,r.jsxs)(h.Z,{variant:"caption",display:"inline-block",children:["Lvl. ",e.level]}),"\xa0",(0,r.jsxs)(h.Z,{variant:"subtitle2",display:"inline-block",sx:{color:"info.main"},children:[e.cost.toLocaleString()," Gold"]})]}),!e.cost&&e.name]},e.id)}))})]}):null}function Ut(){var e=zt((0,oe.gZ)(),1)[0],n=(0,i.useState)(null),t=n[0],o=n[1],a=(0,i.useState)(""),l=a[0],s=a[1],u=(0,D.Cb)(),d=u.data,f=(u.loading,u.error,zt((0,D.Nn)(),2)),v=f[0],x=f[1].loading,p=zt((0,D.o_)(),2),y=p[0],g=p[1].loading||x||e>0;function b(){return(b=Bt(Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,o(null),e.next=6,v({variables:{baseItem:t.id}});case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function j(){return(j=Bt(Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,o(null),e.next=6,y({variables:{item:t.id}});case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}var S,w="Choose which shop to visit";return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)(h.Z,{align:"center",children:["Welcome to the shop! You can buy and sell any non-enchanted items here.",(0,r.jsx)("br",{}),"The items purchasable here have a level from 1 to 32 but no enchantments or direct attribute increases."]}),(0,r.jsx)("br",{}),(0,r.jsx)(c.Z,{}),(0,r.jsx)("br",{}),(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:2,children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"shop-type-select-label",children:w}),(0,r.jsxs)($.Z,{id:"shop-type-select",labelId:"shop-type-select-label",label:w,onChange:function(e){s(e.target.value),o(null)},children:[(0,r.jsx)(z.Z,{value:"sell",children:"Sell Items"}),(0,r.jsx)(c.Z,{}),(0,r.jsxs)(z.Z,{value:D.$7.MeleeWeapon,children:[Ht(D.$7.MeleeWeapon)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.RangedWeapon,children:[Ht(D.$7.RangedWeapon)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.SpellFocus,children:[Ht(D.$7.SpellFocus)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.Shield,children:[Ht(D.$7.Shield)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.BodyArmor,children:[Ht(D.$7.BodyArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.HandArmor,children:[Ht(D.$7.HandArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.LegArmor,children:[Ht(D.$7.LegArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.HeadArmor,children:[Ht(D.$7.HeadArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.FootArmor,children:[Ht(D.$7.FootArmor)," Shop"]})]})]})}),(0,r.jsxs)(m.ZP,{item:!0,xs:6,sm:3,children:[""!==l&&"sell"!==l&&(0,r.jsx)(Rt,{value:t?t.id:"",type:l,items:function(e){var n;return(null===d||void 0===d||null===(n=d.shopItems)||void 0===n?void 0:n.length)?d.shopItems.filter((function(n){return n.type===e})):[]}(l),onChange:function(e){return o(e)}},l),"sell"===l&&(0,r.jsx)(Qt,{value:t?t.id:"",sellables:null!==(S=null===d||void 0===d?void 0:d.shopItems)&&void 0!==S?S:[],onChange:function(e){return o(e)}})]}),(0,r.jsx)(m.ZP,{item:!0,xs:6,children:t&&(0,r.jsxs)(P.Z,{variant:"contained",color:"sell"===l?"error":"success",fullWidth:!0,disabled:g,onClick:"sell"===l?function(){return j.apply(this,arguments)}:function(){return b.apply(this,arguments)},children:["sell"===l?"Sell":"Buy"," ",t.name," for"," ",t.cost.toLocaleString()," gold"]})})]}),(0,r.jsx)("br",{})]})}function Jt(){q();var e=ae();le();return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h3",sx:{textAlign:"center"},children:"Item Shop"}),(0,r.jsx)(Ut,{}),(null===e||void 0===e?void 0:e.shop)&&(0,r.jsx)(Ue,{shop:null===e||void 0===e?void 0:e.shop})]})}function Yt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=n.levelCap);function l(){return(l=Vt(Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o();case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.log(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}return(0,r.jsxs)(s.Z,{sx:{padding:1,margin:1},children:[(0,r.jsx)(h.Z,{color:"secondary",variant:"h2",children:"Rebirth"}),!a&&(0,r.jsx)(h.Z,{children:"You may only be reborn when you are at level cap. Keep leveling up your character in order to be reborn!"}),a&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{children:"This will reset your character's level and attributes, however you will keep all gold and items and will receive special bonuses depending on your current level cap."}),(0,r.jsx)("br",{}),(0,r.jsx)(P.Z,{size:"large",variant:"outlined",color:"secondary",onClick:function(){return l.apply(this,arguments)},children:"Reset Character to Level 1"})]})]})}var er=t(5988),nr=t(9629);function tr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);t1&&"(".concat(p[e],")"),"???"!==(0,B.Lt)(e)&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"primary.main"},children:["\xa0",(0,B.Lt)(e)]})]},e)}))})]}),(0,r.jsxs)(P.Z,{fullWidth:!0,variant:"contained",disabled:!g||t||v||S>n.enchantingDust,color:"success",onClick:function(){return j.apply(this,arguments)},children:[g&&""!==u&&(0,r.jsxs)(s.Z,{children:[(0,r.jsxs)(h.Z,{children:["Create ",(0,r.jsx)("b",{children:(0,B.GJ)(g,u)})]}),(0,r.jsxs)(h.Z,{variant:"subtitle2",children:["Costs ",S.toLocaleString()," Enchantment Dust"]})]}),!g&&"Select Item"]})]})}function fr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);tn.enchantingDust,color:"error",onClick:function(){return j.apply(this,arguments)},children:[b&&(0,r.jsxs)(s.Z,{children:[(0,r.jsxs)(h.Z,{children:["Disenchant ",(0,r.jsx)("b",{children:(0,B.GJ)(b)})]}),(0,r.jsxs)(h.Z,{variant:"subtitle2",children:["Costs ",w.toLocaleString()," Enchantment Dust"]})]}),!b&&"Select Item"]})]}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),m&&(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"filter-select-label",children:"Filter by enchantment"}),(0,r.jsx)($.Z,{id:"filter-select",labelId:"filter-select-label",value:a||"",label:"Filter by enchantment",onChange:function(e){var t=e.target.value;n.inventory.find((function(e){return e.enchantment===t}))&&l(t)},children:g.map((function(e){return(0,r.jsxs)(z.Z,{value:e,children:[(0,B.uD)(e),"???"!==(0,B.Lt)(e)&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"primary.main"},children:["\xa0",(0,B.Lt)(e)]})]},e)}))})]})]})}var gr=t(3457),br=t(480),jr=t(9368);function Zr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t31)})).sort(B.v4)),v=f.find((function(e){return e.id===a}));!v&&a.length&&(f.length?(v=f[0],a=v.id):a="");var x="Select base item",p=n.equipment.artifact;if(!p)return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(h.Z,{children:"You must have an artifact to imbue items with."})});var y,g=(0,B.Vy)(p);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{children:"Imbueing an item adds parts of an artifact onto a base item. Items can only be imbued once, and there is no way to remove the imbue. You may enchant an imbued item, however only unenchanted items can receive an imbue."}),(0,r.jsx)("br",{}),(0,r.jsxs)(L.Z,{fullWidth:!0,sx:{margin:1},children:[(0,r.jsx)(E.Z,{id:"enchant-baseItem-select-label",children:x}),(0,r.jsx)($.Z,{id:"enchant-baseItem-select",labelId:"enchant-baseItem-select-label",value:a||"",label:x,onChange:function(e){var t=e.target.value;n.inventory.find((function(e){return e.id===t}))&&l(t)},children:f.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,children:[(0,B.GJ)(e),(0,B.mQ)(n,e)&&"*EQUIPPED*"]},e.id)}))})]}),v&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Z,{variant:"h5",children:[v.name," to be imbued with"," ",(0,r.jsx)("strong",{children:p.name})]}),(0,r.jsx)(h.Z,{variant:"subtitle1",children:"Select up to three affixes to activate on the item, each affix increases dust cost dramatically. The remaining affixes will be selected randomly from the remaining affixes."}),(0,r.jsx)(gr.Z,{children:g.map((function(e){return(0,r.jsx)(br.Z,{control:(0,r.jsx)(jr.Z,{disabled:c.length>=3&&!c.includes(e.type),onChange:function(n){var t=c.filter((function(n){return n!==e.type}));n.target.checked&&t.push(e.type),u(t)}}),label:(0,B.xq)(e)},e.type)}))})]}),(0,r.jsx)(sn.Z,{variant:"contained",disabled:t||!v||0===c.length,loading:t,onClick:(y=Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t&&v&&0!==c.length){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,m({variables:{item:v.id,artifact:p.id,affixes:c}});case 4:case"end":return e.stop()}}),e)})),function(){var e=this,n=arguments;return new Promise((function(t,r){var i=y.apply(e,n);function o(e){Sr(i,t,r,o,a,"next",e)}function a(e){Sr(i,t,r,o,a,"throw",e)}o(void 0)}))}),children:"Imbue item"})]})}function Ar(e){var n=e.hero,t=e.disabled,o=(0,i.useState)("1"),a=o[0],l=o[1],u=n.inventory.some((function(e){return"pure-essence"===e.baseItem})),m=n.inventory.some((function(e){return"essence-of-void"===e.baseItem})),f=u&&m&&null!==n.equipment.artifact;return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(c.Z,{sx:{margin:2}}),(0,r.jsx)(h.Z,{variant:"h2",component:"h4",color:"secondary",children:"Crafting"}),(0,r.jsxs)(h.Z,{variant:"subtitle1",color:"secondary",children:["Enchanting Dust:"," ",(0,r.jsx)("span",{id:"hero-stats-enchanting-dust",children:n.enchantingDust.toLocaleString()})]}),(0,r.jsxs)(h.Z,{variant:"subtitle1",color:"secondary",children:["Enchantments:"," ",(0,r.jsx)("span",{id:"hero-stats-enchantments",children:n.enchantments.length.toLocaleString()})]}),(0,r.jsx)("br",{}),(0,r.jsx)(x.ZP,{value:a,children:(0,r.jsxs)(s.Z,{sx:{flexGrow:1,borderBottom:1,borderColor:"divider",display:"flex"},children:[(0,r.jsxs)(p.Z,{orientation:"vertical",onChange:function(e,n){return l(n)},"aria-label":"navigation tabs",variant:"scrollable",textColor:"secondary",indicatorColor:"secondary",sx:{flexShrink:0,flexGrow:0,width:"100px"},children:[(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Mn.Z,{}),label:"Destroy",value:"1"}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(nr.Z,{}),label:"Disenchant",value:"2"}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(er.Z,{}),label:"Enchant",value:"3"}),f&&(0,r.jsx)(d.Z,{icon:(0,r.jsx)(er.Z,{}),label:"Imbue",value:"4"})]}),(0,r.jsxs)(y.Z,{value:"1",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:g.Z,children:"Destroy Items"}),(0,r.jsx)(ar,{hero:n,disabled:t})]}),(0,r.jsxs)(y.Z,{value:"2",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:g.Z,children:"Disenchant Items"}),(0,r.jsx)(yr,{hero:n,disabled:t})]}),(0,r.jsxs)(y.Z,{value:"3",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:g.Z,children:"Enchant Items"}),(0,r.jsx)(mr,{hero:n,disabled:t})]}),f&&(0,r.jsxs)(y.Z,{value:"4",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:g.Z,children:"Imbue Items"}),(0,r.jsx)(kr,{hero:n,disabled:t})]})]})})]})}function Pr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t1){var r=f.find((function(n){return(0,B.GJ)(n)===t&&n.id!==e}));r&&(x.push(r),v[t]-=1)}}})),x.sort(B.v4),(0,r.jsx)(i.Fragment,{children:(0,r.jsx)("div",{children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"".concat(o,"-equip-select-label"),children:a}),(0,r.jsx)($.Z,{id:"".concat(o,"-equip-select"),labelId:"".concat(o,"-equip-select-label"),value:c||"",label:a,disabled:s,onChange:function(e){m(e.target.value),l(o,e.target.value)},children:x.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,disabled:u.indexOf(e.id)>=0,children:[e.id===c?(0,r.jsx)("b",{children:(0,B.GJ)(e)}):(0,r.jsxs)(r.Fragment,{children:[(0,B.GJ)(e),v[(0,B.GJ)(e)]>1&&-1===u.indexOf(e.id)?" x".concat(v[(0,B.GJ)(e)]):""]}),(0,r.jsxs)(h.Z,{variant:"caption",sx:{color:"info.secondary"},children:["\xa0Lvl. ",e.level]}),e.enchantment&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"info.main"},children:["\xa0",(0,B.Lt)(e.enchantment)]})]},e.id)}))})]})})})}function Er(e){var n=e.hero,t=e.disabled,o=e.onChange,a=(0,i.useState)(""),l=a[0],s=a[1],c=n.inventory.filter((function(e){return e.type===D.$7.Quest})).sort((function(e,n){return n.level-e.level})),u="Quest items (passive, always active)",d=n.inventory.find((function(e){return e.id===l}));(0,i.useEffect)((function(){l.length&&!d&&s("")}),[d,l]);var m={};c.forEach((function(e){var n=(0,B.GJ)(e);m[n]?m[n]+=1:m[n]=1}));var f=Object.keys(m).map((function(e){return c.find((function(n){return(0,B.GJ)(n)===e}))}));return(0,r.jsx)(i.Fragment,{children:(0,r.jsx)("div",{children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"quest-item-label",children:u}),(0,r.jsx)($.Z,{id:"quest-item",labelId:"quest-item-label",value:l,label:u,disabled:t,onChange:function(e){if(s(e.target.value),o){var n=c.find((function(n){return n.id===e.target.value}));n&&o(n.baseItem)}},children:f.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,children:[(0,r.jsxs)(r.Fragment,{children:[(0,B.GJ)(e),m[(0,B.GJ)(e)]>1?" x".concat(m[(0,B.GJ)(e)]):""]}),"???"!==(0,B.Lt)(e.baseItem)&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"primary.main"},children:["\xa0",(0,B.Lt)(e.baseItem)]})]},e.id)}))})]})})})}function Or(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0;if(!H)return null;function R(e,n){return U.apply(this,arguments)}function U(){return(U=Tr(Z().mark((function e(n,t){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,W({variables:{item:t,slot:n}});case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:1,children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(h.Z,{variant:"h3",sx:{fontSize:"1.2rem"},children:"Equipped items"})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Lr,{hero:H,slot:"leftHand",label:"Left Hand",onEquip:R,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Lr,{hero:H,slot:"rightHand",label:"Right Hand",onEquip:R,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Lr,{hero:H,slot:"bodyArmor",label:"Body Armor",onEquip:R,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Lr,{hero:H,slot:"handArmor",label:"Gauntlets",onEquip:R,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Lr,{hero:H,slot:"legArmor",label:"Leggings",onEquip:R,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Lr,{hero:H,slot:"headArmor",label:"Helmets",onEquip:R,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Lr,{hero:H,slot:"footArmor",label:"Greaves",onEquip:R,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Er,{hero:H,disabled:Q,onChange:N})}),(0,r.jsxs)(m.ZP,{item:!0,xs:6,children:[!!H.buffs.blessing&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{children:(0,B.uD)(H.buffs.blessing)}),(0,r.jsx)(h.Z,{variant:"body1",children:(0,r.jsx)("b",{children:(0,B.Lt)(H.buffs.blessing)})})]}),(0,r.jsx)(Y,{title:null===(e=H.equipment.artifact)||void 0===e?void 0:e.name,artifact:H.equipment.artifact}),(0,r.jsx)(Y,{title:H.equipment.leftHand?(0,B.GJ)(H.equipment.leftHand,null):null,artifact:null===(n=H.equipment.leftHand)||void 0===n||null===(t=n.imbue)||void 0===t?void 0:t.artifact,affixes:null===(o=H.equipment.leftHand)||void 0===o||null===(a=o.imbue)||void 0===a?void 0:a.affixes}),(0,r.jsx)(Y,{title:H.equipment.rightHand?(0,B.GJ)(H.equipment.rightHand,null):null,artifact:null===(l=H.equipment.rightHand)||void 0===l||null===(s=l.imbue)||void 0===s?void 0:s.artifact,affixes:null===(c=H.equipment.rightHand)||void 0===c||null===(u=c.imbue)||void 0===u?void 0:u.affixes}),(0,r.jsx)(Y,{title:H.equipment.bodyArmor?(0,B.GJ)(H.equipment.bodyArmor,null):null,artifact:null===(d=H.equipment.bodyArmor)||void 0===d||null===(f=d.imbue)||void 0===f?void 0:f.artifact,affixes:null===(v=H.equipment.bodyArmor)||void 0===v||null===(x=v.imbue)||void 0===x?void 0:x.affixes}),(0,r.jsx)(Y,{title:H.equipment.handArmor?(0,B.GJ)(H.equipment.handArmor,null):null,artifact:null===(p=H.equipment.handArmor)||void 0===p||null===(y=p.imbue)||void 0===y?void 0:y.artifact,affixes:null===(g=H.equipment.handArmor)||void 0===g||null===(b=g.imbue)||void 0===b?void 0:b.affixes}),(0,r.jsx)(Y,{title:H.equipment.legArmor?(0,B.GJ)(H.equipment.legArmor,null):null,artifact:null===(j=H.equipment.legArmor)||void 0===j||null===(S=j.imbue)||void 0===S?void 0:S.artifact,affixes:null===(w=H.equipment.legArmor)||void 0===w||null===(k=w.imbue)||void 0===k?void 0:k.affixes}),(0,r.jsx)(Y,{title:H.equipment.headArmor?(0,B.GJ)(H.equipment.headArmor,null):null,artifact:null===(A=H.equipment.headArmor)||void 0===A||null===(P=A.imbue)||void 0===P?void 0:P.artifact,affixes:null===(C=H.equipment.headArmor)||void 0===C||null===(I=C.imbue)||void 0===I?void 0:I.affixes}),(0,r.jsx)(Y,{title:H.equipment.footArmor?(0,B.GJ)(H.equipment.footArmor,null):null,artifact:null===(L=H.equipment.footArmor)||void 0===L||null===(E=L.imbue)||void 0===E?void 0:E.artifact,affixes:null===(O=H.equipment.footArmor)||void 0===O||null===(F=O.imbue)||void 0===F?void 0:F.affixes})]}),H.level===H.levelCap&&(0,B.jr)(z)&&(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(Xt,{hero:H,disabled:Q})}),(0,B.OB)(z)&&(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(Ar,{hero:H,disabled:Q})}),(0,B.jj)(z)&&(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(Ir,{hero:H,disabled:Q})})]})})}function Gr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsx)(Gt,{}),T&&T.currentQuest&&(0,r.jsx)(qr,{event:T.currentQuest})]}),(0,r.jsxs)(s.Z,{sx:{width:"100%",typography:"body1"},children:[(0,r.jsxs)(x.ZP,{value:E,children:[(0,r.jsxs)(s.Z,{sx:{borderBottom:1,borderColor:"divider"},children:[(0,r.jsx)(h.Z,{variant:"h1",sx:g.Z,children:"Navigation"}),(0,r.jsxs)(p.Z,{onChange:function(e,n){"play"===n?Z.push("/play","/play",{scroll:!1}):Z.push("/play/".concat(n),"/play/".concat(n),{scroll:!1}),O(n)},"aria-label":"navigation tabs",variant:"scrollable",children:[(0,r.jsx)(d.Z,{label:"Welcome",value:"play"}),(0,r.jsx)(d.Z,{label:"Combat",value:"combat"}),!(!(null===T||void 0===T?void 0:T.inventory.length)&&!(null===T||void 0===T?void 0:T.gold))&&(0,r.jsx)(d.Z,{label:"Shop",value:"shop"}),!!(null===T||void 0===T?void 0:T.inventory.length)&&(0,r.jsx)(d.Z,{label:"Inventory",value:"inventory"}),(0,r.jsx)(d.Z,{label:"Map",value:"map"}),T&&Object.values(T.questLog).filter((function(e){return!!e})).length>2&&(0,r.jsx)(d.Z,{label:"Quests",value:"quests"}),W&&(0,r.jsx)(d.Z,{label:"Settings",value:"settings"}),M===D.Ks.Admin&&(0,r.jsx)(d.Z,{label:"Admin",value:"admin"})]})]}),(0,r.jsx)(y.Z,{value:"play",children:(0,r.jsxs)(m.ZP,{container:!0,columns:12,spacing:4,children:[(0,r.jsxs)(m.ZP,{item:!0,xs:12,sm:7,md:8,children:[(0,r.jsxs)(h.Z,{variant:"h2",sx:{mb:2,fontSize:"1.8rem"},children:["Welcome to ",(0,r.jsx)("b",{children:"Proof of Combat"}),"!"]}),(0,r.jsxs)(h.Z,{variant:"subtitle1",sx:g.Z,children:["This text is only available to screen readers. Thank you for trying out my game! If you find any parts of the user interface that are difficult to navigate please let me know and I would love to improve them.",(0,r.jsx)("br",{}),(0,r.jsx)(v.Z,{href:"https://github.com/chrisinajar/proofofcombat/wiki/Screen-Readers-and-Accessibility",target:"_blank",rel:"noreferrer",children:"Check this wiki page for more details on accessibility"})]}),(0,r.jsx)(h.Z,{sx:{mb:2},children:"This game is once again being developed actively. It's been a long time coming and there's a lot of major changes to the underlying engine in order to unlock cooler and more interesting mechanics for the game."}),(0,r.jsx)(h.Z,{variant:"h4",sx:g.Z,children:"Discord Server"}),(0,r.jsxs)(h.Z,{sx:{mb:2},children:["If you'd like to talk more with other players, report bugs, or discuss upcoming features,"," ",(0,r.jsx)(v.Z,{underline:"hover",href:"https://discord.gg/t7AZSxvfJG",target:"_blank",rel:"noreferrer",children:"join the discord!"})]}),(0,r.jsx)(h.Z,{variant:"h4",sx:g.Z,children:"Game Wiki"}),(0,r.jsxs)(h.Z,{sx:{mb:2},children:["A great deal of the game is undocumented, but the parts which are documented can be found,"," ",(0,r.jsx)(v.Z,{underline:"hover",href:"https://github.com/chrisinajar/proofofcombat/wiki/",target:"_blank",rel:"noreferrer",children:"in the wiki"}),". The game is nearly impossible to 100% without consulting the wiki."]}),(0,r.jsx)(h.Z,{variant:"h5",sx:{mb:2},children:"Combat Stats"}),(null===T||void 0===T?void 0:T.combatStats)&&(0,r.jsx)(Yr,{skills:T.skills,stats:T.combatStats})]}),(null===F||void 0===F?void 0:F.leaderboard)&&(0,r.jsxs)(m.ZP,{item:!0,xs:12,sm:5,md:4,children:[(0,r.jsx)(h.Z,{variant:"h6",children:"Leaderboard"}),(0,r.jsx)("ul",{id:"leaderboard-list",children:F.leaderboard.slice(0,20).map((function(e,n){return(0,r.jsxs)("li",{id:"leaderboard-list-".concat(n),children:[(0,r.jsx)("b",{id:"leaderboard-list-".concat(n,"-name"),children:e.name})," ","(",(0,B.qh)(e.class),")"]},e.id)}))})]})]})}),(0,r.jsxs)(y.Z,{value:"combat",children:[(0,r.jsx)(h.Z,{variant:"h3",sx:{textAlign:"center"},children:"Combat"}),(0,r.jsx)(h.Z,{children:"Challenge a monster from the list, then fight it to the death. Note that other players in the same location see the same monster lists, so they may get to it first!"}),(0,r.jsx)("br",{}),(0,r.jsx)(Ee,{})]}),(0,r.jsx)(y.Z,{value:"shop",children:(0,r.jsx)(Jt,{})}),(0,r.jsx)(y.Z,{value:"inventory",children:(0,r.jsx)(Wr,{})}),(0,r.jsx)(y.Z,{value:"map",children:(0,r.jsx)(Lt,{})}),(0,r.jsx)(y.Z,{value:"quests",children:(0,r.jsx)(Ur,{})}),(0,r.jsx)(y.Z,{value:"settings",children:(0,r.jsx)(ui,{})}),(0,r.jsx)(y.Z,{value:"admin",children:(0,r.jsx)(mi,{})})]}),(0,r.jsx)("br",{}),(0,r.jsx)(c.Z,{}),(0,r.jsx)("br",{}),(0,r.jsx)(re,{})]})]})})}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[536],{7536:function(e,n,t){t.d(n,{Z:function(){return fi}});var r=t(5893),i=t(7294),o=t(1163),a=t(5152),l=t.n(a),s=t(5616),c=t(7720),u=t(1458),d=t(44),h=t(5861),m=t(6886),f=t(9104),v=t(4373),x=t(5670),p=t(409),y=t(5050),g=t(2950),b=t(7998),j=t(4051),Z=t.n(j),S=t(3920),w=t(8445),k=t(5739),A=t(9496),P=t(5662),C=t(7109),I=t(3946),L=t(4054),E=t(3841),O=t(7058),F=t(4156),T=t(8629),M=t(6824),W=t(622),G=t(4510),D=t(7952);function q(){var e,n,t,r=(0,D.UE)({fetchPolicy:"cache-only"}).data;return null!==(t=null===r||void 0===r||null===(e=r.me)||void 0===e||null===(n=e.account)||void 0===n?void 0:n.hero)&&void 0!==t?t:void 0}var B=t(9238),$=t(5018),z=t(3599),N=t(1903);function H(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsxs)(m.ZP,{item:!0,xs:6,children:["Received offers:",(0,r.jsx)(s.Z,{children:F.map((function(e){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(s.Z,{sx:{mt:1,bgcolor:"info.main",p:2},children:["From: ",(0,r.jsx)("b",{children:e.fromName}),(0,r.jsx)("br",{}),"Item: ",(0,r.jsx)("b",{children:(0,B.GJ)(e.item)}),(0,r.jsx)("br",{}),"Gold: ",(0,r.jsx)("b",{children:e.gold.toLocaleString()}),(0,r.jsx)("br",{}),(0,r.jsx)(P.Z,{sx:{m:1},variant:"contained",color:"success",disabled:I||e.gold>o.gold,onClick:function(){return function(e){return Q.apply(this,arguments)}(e.id)},children:"Accept Trade"}),(0,r.jsx)(P.Z,{sx:{m:1},variant:"contained",color:"error",disabled:I,onClick:function(){return q(e.id)},children:"Reject Trade"})]})},e.id)}))})]}),T.length>0&&(0,r.jsxs)(m.ZP,{item:!0,xs:6,children:["Sent offers:",(0,r.jsx)(s.Z,{children:T.map((function(e){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(s.Z,{sx:{mt:1,bgcolor:"info.main",p:2},children:["To: ",(0,r.jsx)("b",{children:e.toName}),(0,r.jsx)("br",{}),"Item: ",(0,r.jsx)("b",{children:(0,B.GJ)(e.item)}),(0,r.jsx)("br",{}),"Gold: ",(0,r.jsx)("b",{children:e.gold.toLocaleString()}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)(P.Z,{variant:"contained",color:"error",disabled:I,onClick:function(){return q(e.id)},children:"Cancel Trade"})]})},e.id)}))})]})]})]})}function Y(e){var n=e.artifact,t=e.title,o=e.affixes,a=e.sx,l=e.children;if(!n||!t)return null;var s=(0,B.Vy)(n),c=function(e,n){return(0,r.jsx)(h.Z,{variant:"body1",sx:a,children:(0,r.jsx)("b",{children:e})},n)};return"function"===typeof l&&(c=l),(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{children:t}),s.map((function(e){return o&&!o.includes(e.type)?null:c((0,B.xq)(e),e.type)}))]})}function K(e){var n=e.artifact;return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h4",children:n.name}),"A mysterious magical item with the following properties:",(0,r.jsx)(Y,{artifact:n})]})}function V(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t200&&$(j.slice(0,200))}),[j.length]),(0,i.useEffect)((function(){var e;if(!ce.current&&(null===m||void 0===m||null===(e=m.chat)||void 0===e?void 0:e.token)){var n={drop:"error",artifact:"warning",quest:"success",settlement:"info"};return ce.current=(0,S.io)(te,{withCredentials:!0,auth:{token:m.chat.token}}),ce.current.on("hello",(function(e){$(e.chat)})),ce.current.on("chat",(function(e){console.log("Got chat event!",e),$((function(n){return[e].concat(ne(n))}))})),ce.current.on("notification",(function(e){var t,r;e.item&&(e.message=e.message.replace("{{item}}",(0,B.GJ)(e.item))),"drop"===e.type||"artifact"===e.type?e.item?c("You found ".concat((0,B.GJ)(e.item)),{variant:"success"}):e.artifactItem?(c("You found ".concat(e.artifactItem.name),{variant:"success"}),se(e.artifactItem)):c(e.message,{variant:"success"}):"settlement"!==e.type&&c(e.message,{variant:"info"}),$((function(i){return[{type:null!==(t=e.type)&&void 0!==t?t:"notification",id:Math.random(),time:Date.now()/1e3,message:"",from:e.message,color:null!==(r=n[e.type])&&void 0!==r?r:"secondary",variant:"body1"}].concat(ne(i))}))})),ce.current.on("system-message",(function(e){c(e.message,{variant:"warning"}),$((function(n){return[{type:"system",id:Math.random(),time:Date.now()/1e3,message:e.message,from:"",color:e.color,variant:"h6"}].concat(ne(n))}))})),function(){ce.current&&(ce.current.disconnect(),ce.current=void 0)}}}),[null===m||void 0===m||null===(e=m.chat)||void 0===e?void 0:e.token]);var ue=a(R);function de(){return he.apply(this,arguments)}function he(){return(he=X(Z().mark((function e(){var n;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ce.current){e.next=2;break}return e.abrupt("return");case 2:if("private"!==(n=ie[V]).type){e.next=7;break}return ce.current.emit("private-chat",{to:n.heroId,message:R},(function(e){console.log("Got a confirmation!",e),$((function(n){return[e].concat(ne(n))}))})),U(""),e.abrupt("return");case 7:ce.current.emit("chat",{message:R},(function(e){console.log("Got a reply!",e),$((function(n){return[e].concat(ne(n))}))})),U("");case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var me,fe=j.filter((function(e){if("all"===V)return!0;if("chat"===V)return"chat"===e.type||"private"===e.type||"system"===e.type;if("notifications"===V)return"notification"===e.type||"drop"===e.type||"quest"===e.type||"system"===e.type;var n=ie[V];return!n||"private"===n.type&&("private"===e.type&&(e.heroId===n.heroId||e.to===n.heroId))})),ve=N?"Max message: ".concat(140-ue.length,"/").concat(140):"Type here...";return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(T.Z,{open:!(null===u||void 0===u?void 0:u.currentQuest)&&!!le,onClose:function(){return se(!1)},children:(0,r.jsx)(s.Z,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"background.paper",padding:[2,4],minWidth:"320px",maxWidth:"580px",width:"80%",textAlign:"center"},children:le&&(0,r.jsx)(K,{artifact:le})})}),(0,r.jsx)(x.ZP,{value:V,children:(0,r.jsx)(p.Z,{onChange:function(e,n){v&&y(!1),_(n)},"aria-label":"navigation tabs",variant:"scrollable",children:Object.keys(ie).map((function(e){return(0,r.jsx)(d.Z,{label:e,value:e},e)}))})}),"notifications"!==V&&(0,r.jsxs)(L.Z,{sx:{marginTop:1},fullWidth:!0,variant:"outlined",children:[(0,r.jsx)(E.Z,{htmlFor:"chat-input",children:ve}),(0,r.jsx)(O.Z,{disabled:!(null===(n=ce.current)||void 0===n?void 0:n.connected),value:R,id:"chat-input",name:"Chat input",label:ve,placeholder:"Type here...",onChange:function(e){var n=e.target.value;a(n).length<=140&&U(n)},onFocus:function(){return H(!0)},onBlur:function(){return H(!1)},autoComplete:"off",onKeyPress:function(e){"Enter"!==e.key||de()},endAdornment:(0,r.jsxs)(C.Z,{position:"end",children:[(0,r.jsx)(F.Z,{title:"Send message",children:(0,r.jsx)(I.Z,{"aria-label":"send chat",onClick:de,children:(0,r.jsx)(M.Z,{})})}),"private"===(null===(t=ie[V])||void 0===t?void 0:t.type)&&(0,r.jsx)(F.Z,{title:v?"Cancel trade":"Trade with player",children:(0,r.jsxs)(I.Z,{onClick:function(){return y(!v)},children:[v&&(0,r.jsx)(G.Z,{}),!v&&(0,r.jsx)(W.Z,{})]})})]})})]}),v&&u&&(null===(o=ie[V])||void 0===o?void 0:o.heroId)&&(0,r.jsx)(J,{hero:u,to:null!==(me=ie[V].heroId)&&void 0!==me?me:""}),(0,r.jsx)(s.Z,{sx:{padding:1,minHeight:"600px",bgcolor:"background.paper"},children:fe.map((function(e){return(0,r.jsxs)(h.Z,{variant:e.variant||"body1",sx:{color:"".concat("private"===e.type?"secondary":e.color||"text",".main")},children:[e.time&&(0,r.jsxs)(h.Z,{variant:"caption","aria-hidden":"true",children:["(",(0,k.S)(new Date(1e3*e.time)),")\xa0"]}),e.heroId&&(0,r.jsx)(P.Z,{onClick:function(){e.heroId&&l(e.from,e.heroId)},sx:{color:"inherit",textTransform:"none",paddingTop:0,paddingBottom:0,paddingLeft:1,paddingRight:.5,margin:0},children:(0,r.jsxs)("b",{children:[e.from,":"]})}),!e.heroId&&(0,r.jsx)("b",{children:e.from})," ",(0,w.emojify)(e.message)," ",e.time&&(0,r.jsxs)(h.Z,{variant:"caption",sx:g.Z,children:["(",(0,k.S)(new Date(1e3*e.time)),")\xa0"]})]},e.id)}))}),(0,r.jsx)("br",{})]})}var ie=t(1409),oe=t(737);function ae(){var e,n=q(),t=(0,D.W1)({variables:(null===n||void 0===n?void 0:n.location)?{location:{x:n.location.x,y:n.location.y,map:n.location.map}}:void 0,skip:!(null===n||void 0===n?void 0:n.location)}).data;return null!==(e=null===t||void 0===t?void 0:t.locationDetails)&&void 0!==e?e:null}function le(){var e=ae(),n=(null===e||void 0===e?void 0:e.specialLocations)||[];return n.length?n[0]:null}var se,ce=t(2734),ue=t(1292),de=t(5499),he=t(8698),me=t(7600),fe=t(5826);function ve(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var xe=(ve(se={},D.zP.Normal,"Normal stance with no pros or cons."),ve(se,D.zP.Combat,"???"),ve(se,D.zP.Reckless,"Double accuracy but makes you twice as easy to hit."),ve(se,D.zP.Aggressive,"???"),ve(se,D.zP.Defensive,"???"),ve(se,D.zP.NecroticBeam,"???"),ve(se,D.zP.CloudofKnives,"???"),ve(se,D.zP.FrozenOrb,"???"),ve(se,D.zP.MageArmor,"???"),ve(se,D.zP.NormalArrow,"???"),ve(se,D.zP.BarbedArrow,"???"),ve(se,D.zP.BloodHunter,"???"),ve(se,D.zP.DarkPresence,"???"),ve(se,D.zP.AuraoftheLifeless,"???"),ve(se,D.zP.ShieldSmash,"???"),ve(se,D.zP.ShieldSlash,"???"),ve(se,D.zP.HolySmite,"???"),ve(se,D.zP.VengefulSmite,"???"),ve(se,D.zP.WarriorsStance,"???"),ve(se,D.zP.Hexblade,"???"),ve(se,D.zP.Focus,"???"),se);function pe(e){var n=q(),t=(0,i.useState)((null===n||void 0===n?void 0:n.activeStance)||D.zP.Normal),o=t[0],a=t[1];if(!n)return null;var l=n.availableStances.map((function(e){return{name:e,tooltip:xe[e]}}));return l.length<2?null:(0,r.jsx)(m.ZP,{item:!0,xs:12,children:(0,r.jsxs)(m.ZP,{container:!0,sx:{textAlign:"center"},columns:6,spacing:2,children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(c.Z,{})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(h.Z,{variant:"h5",children:"Select Combat Style"})}),l.map((function(n){return(0,r.jsx)(m.ZP,{item:!0,lg:1,md:2,sm:3,xs:6,children:(0,r.jsx)(F.Z,{title:n.tooltip,children:(0,r.jsx)(P.Z,{variant:o===n.name?"outlined":"text",sx:{fontSize:"1rem",padding:2},size:"large",id:"set-stance-".concat(n.name.toLowerCase()),onClick:function(){return function(n){a(n),e.onChange&&e.onChange(n)}(n.name)},"aria-label":"set stance ".concat(n.name),children:n.name})})},n.name)}))]})})}function ye(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(l?"Auto-Battling":"Battling"),q<=0&&"Dead"," ",f.name]}),(0,r.jsx)(u.Z,{variant:"determinate",value:q,color:"error"})]}),q>0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:2,xl:2,children:(0,r.jsx)(F.Z,{title:"Attack using your melee weapons, uses strength and dexterity",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-melee",onClick:function(){return _(D.hK.Melee)},"aria-label":"melee attack",startIcon:(0,r.jsx)(ue.Z,{}),children:"Melee attack"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:2,xl:2,children:(0,r.jsx)(F.Z,{title:"Attack using your ranged weapons, uses dexterity",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-ranged",onClick:function(){return _(D.hK.Ranged)},"aria-label":"ranged attack",startIcon:(0,r.jsx)(de.Z,{}),children:"Ranged attack"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:2,xl:2,children:(0,r.jsx)(F.Z,{title:"Cast spells using your wisdom and intelligence",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-cast",onClick:function(){return _(D.hK.Cast)},"aria-label":"cast spell",startIcon:(0,r.jsx)(he.Z,{}),children:"Cast Spell"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,md:3,xl:3,children:(0,r.jsx)(F.Z,{title:"Smite your foe using wisdom and willpower",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-holy",onClick:function(){return _(D.hK.Smite)},"aria-label":"holy attack",startIcon:(0,r.jsx)(me.Z,{}),children:"Smite"})})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:6,md:3,xl:3,children:(0,r.jsx)(F.Z,{title:"Damage yourself to damage the enemy, uses constitution",describeChild:!0,children:(0,r.jsx)(P.Z,{sx:{fontSize:"1rem",padding:2},size:"large",id:"attack-with-blood",onClick:function(){return _(D.hK.Blood)},"aria-label":"blood magic",startIcon:(0,r.jsx)(fe.Z,{}),children:"Blood magic"})})})]})]}),S&&"This enemy was killed by another player",Q&&Q.log.map((function(e,n){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(h.Z,{children:[e.isEnchantment&&(0,r.jsxs)(i.Fragment,{children:[e.damage<0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("b",{children:e.from})," heals"," ",(0,r.jsx)("span",{id:"fight-".concat(e.from,"-enchantment-heal"),children:(0-e.damage).toLocaleString()})," ","health from their enchantments"]}),e.damage>0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("b",{children:e.from})," dealt"," ",(0,r.jsx)("span",{id:"fight-".concat(e.from,"-enchantment-damage"),children:e.damage.toLocaleString()})," ","enchantment damage to ",(0,r.jsx)("b",{children:e.to})]})]}),!e.isEnchantment&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("b",{children:e.from})," ".concat(we(e.attackType,e.success,e.critical)," "),(0,r.jsx)("b",{children:e.to}),e.success?" for ".concat(e.damage.toLocaleString()," ").concat(e.damageType?e.damageType.toLowerCase():""," damage!"):"."]})]})},"".concat(e.from,"-").concat(n))})),Q&&Q.victory&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)(h.Z,{id:"fight-did-win",children:[f.name," has been killed!",(Q.experience||Q.gold)&&" You gain ",Q.gold&&(0,r.jsxs)(i.Fragment,{children:[" ",(0,r.jsx)("span",{id:"fight-recap-gold",children:Q.gold.toLocaleString()})," ","gold"]}),Q.gold&&Q.experience&&" and",Q.experience&&(0,r.jsxs)(i.Fragment,{children:[" ",(0,r.jsx)("span",{id:"fight-recap-experience",children:Q.experience.toLocaleString()})," ","experience"]}),(Q.experience||Q.gold)&&"!! ",Q.didLevel&&(0,r.jsx)("b",{id:"fight-level-up",children:"You leveled up!!"})]}),Q.drop&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)("br",{}),(0,r.jsxs)(h.Z,{id:"fight-got-drop",variant:"h5",children:["You find an enchanted item on the monster's corpse!",(0,r.jsx)("br",{}),(0,B.GJ)(Q.drop)]})]}),(0,r.jsx)("br",{}),V&&(0,r.jsx)(P.Z,{fullWidth:!0,color:"secondary",variant:"contained",onClick:function(){p&&p(f.id,N)},children:"Auto-Battle this enemy"})]})]})]})}function we(e,n,t){switch(e){case D.hK.Blood:return n?t?"surges with blood magic against":"lets blood and casts forth towards":"attempts to cast a spell against";case D.hK.Smite:return n?t?"summons powers beyond this world against":"smites":"attempts to smite";case D.hK.Cast:return n?t?"carefully casts a spell at":"blasts a beam of necrotic energy into":"attempts to cast a spell against";case D.hK.Ranged:return n?t?"lands a sneak attack from the shadows, critically damaging":"fires an arrow at":"shoots an arrow but it misses";case D.hK.Melee:default:return n?t?"lands a crippling blow against":"struck":"missed"}}function ke(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t.5?100*Math.random():g[0],Math.random()>.5?100*Math.random():g[1],Math.random()>.5?100*Math.random():g[2]]),0===x){e.next=4;break}return e.abrupt("return");case 4:if(!(Fe||H>0)){e.next=6;break}return e.abrupt("return");case 6:if(0!==(null===ge||void 0===ge?void 0:ge.combat.health)){e.next=9;break}return console.log("[AutoBattler] Healing!"),e.abrupt("return",Te());case 9:if(Le&&0!==Le.monster.combat.health&&Le.monster.id===C){e.next=13;break}return console.log("[AutoBattler] Challenging new mob!"),De(C),e.abrupt("return");case 13:if(!Le||!we.current){e.next=17;break}return console.log("[AutoBattler] Fighting ".concat(l,"!")),we.current(l),e.abrupt("return");case 17:console.log("[AutoBattler] Doing nothing...");case 18:case"end":return e.stop()}}),e)}))),(0,i.useEffect)((function(){if(w&&C.length){var e=(0,ie.Zi)((function(){j.current()}),500);return function(){(0,ie.cv)(e)}}}),[w,Oe]),(0,i.useEffect)((function(){var e;if(null===se||void 0===se||null===(e=se.monsters)||void 0===e?void 0:e.length){var n=se.monsters.concat().sort((function(e,n){return e.monster.level-n.monster.level}));if(""===K)V(n[0].id);else se.monsters.find((function(e){return e.id===K}))||V(n[0].id)}}),[K,null===se||void 0===se||null===(n=se.monsters)||void 0===n?void 0:n.length]);var ze=null===se||void 0===se||null===(t=se.monsters)||void 0===t?void 0:t.find((function(e){return e.id===K}));ze||(K="");var Ne=Ae.find((function(e){return e.id===te}));if(Ae.find((function(e){return e.id===X}))||(X=""),!ge)return null;ge.levelCap>100||(ye=ye.slice(0,ge.level)),Ae=Ae.filter((function(e){return e.combat.health>0}));var He="Select a new monster to challenge",Qe="Fight an existing monster!",Re="Duel with a nearby player!";return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:4,children:[!w&&ge&&ge.combat.health>0&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(m.ZP,{item:!0,md:3,xs:6,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"challenge-monster-select-label",children:He}),(0,r.jsx)($.Z,{id:"challenge-select",labelId:"challenge-monster-select-label",value:U,label:He,disabled:w,onChange:function(e){return J(e.target.value)},children:ye.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,children:[e.name,"\xa0",(0,r.jsxs)(h.Z,{variant:"caption",display:"inline-block",children:["Tier ",e.level]})]},e.id)}))}),(0,r.jsx)(P.Z,{id:"challenge-button",disabled:!U||H>0||fe||w,onClick:function(){return Ge.apply(this,arguments)},variant:"contained",children:"Challenge!"})]})}),(0,r.jsx)(m.ZP,{item:!0,md:3,xs:6,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"fight-monster-select-label",children:Qe}),(0,r.jsx)($.Z,{id:"fight-select",labelId:"fight-monster-select-label",value:K,label:Qe,disabled:w,onChange:function(e){return V(e.target.value)},children:(null===se||void 0===se?void 0:se.monsters)&&Ie(null===se||void 0===se?void 0:se.monsters).sort((function(e,n){return e.monster.level-n.monster.level})).map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,disabled:0===e.monster.combat.health,children:[0===e.monster.combat.health&&"Dead ",e.monster.name]},e.id)}))}),(0,r.jsx)(P.Z,{id:"fight-button",disabled:!K||H>0||fe||ze&&0===ze.monster.combat.health||w,onClick:function(){return We.apply(this,arguments)},variant:"contained",children:"Fight!"})]})}),Ae.length>1&&(0,r.jsx)(m.ZP,{item:!0,md:3,xs:6,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"duel-select-label",children:Re}),(0,r.jsx)($.Z,{id:"duel-select",labelId:"duel-select-label",value:X,label:Re,disabled:w,onChange:function(e){return ee(e.target.value)},children:Ae.filter((function(e){return e.id!==ge.id})).sort((function(e,n){return e.level-n.level})).map((function(e){return(0,r.jsx)(z.Z,{value:e.id,children:e.name},e.id)}))}),(0,r.jsx)(P.Z,{id:"duel-button",disabled:!X.length||H>0||fe||w,onClick:function(){return $e.apply(this,arguments)},variant:"contained",children:"Duel Player!"})]})})]}),w&&(0,r.jsxs)(m.ZP,{item:!0,xs:6,children:[(0,r.jsx)(u.Z,{sx:{margin:1,color:"#f00"},variant:"determinate",value:g[0],color:"inherit"}),(0,r.jsx)(u.Z,{color:"inherit",sx:{margin:1,color:"#0f0"},variant:"determinate",value:g[1]}),(0,r.jsx)(u.Z,{color:"inherit",sx:{margin:1,color:"#00f"},variant:"determinate",value:g[2]}),(0,r.jsx)(P.Z,{fullWidth:!0,variant:"contained",color:"error",size:"large",onClick:function(){return k(!1)},children:"Disable Auto-Battle"})]}),ge&&ge.combat.health<=0&&(0,r.jsx)(m.ZP,{item:!0,lg:3,xs:6,children:(0,r.jsx)(h.Z,{id:"you-are-dead",children:"You are dead."})}),Le&&(0,r.jsx)(i.Fragment,{children:(0,r.jsx)(Se,{hero:ge,fight:Le,onError:function(){ue(),G(null)},autoBattle:w,canAutoBattle:Ee,onAutoBattle:function(e,n){return Be.apply(this,arguments)},fightMutationRef:we,onVictory:function(){return f(d+1)}},"".concat(Le.id,"-").concat(F))}),Ne&&(0,r.jsx)(i.Fragment,{children:(0,r.jsx)(Se,{hero:ge,fight:{id:Ne.id,monster:Ne},onError:function(){ue(),G(null)},duel:!0,autoBattle:!1,canAutoBattle:!1},"".concat(Ne.id,"-").concat(F))}),(0,r.jsx)(m.ZP,{item:!0,lg:3,xs:6,children:(0,r.jsx)(P.Z,{id:"heal-button",fullWidth:!0,onClick:Te,variant:"contained",disabled:H>0||fe||ge&&ge.combat.health===ge.combat.maxHealth,children:"Heal"})})]})})}var Oe=t(1514);function Fe(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsx)(h.Z,{sx:{mb:2},variant:"body1",color:o?"success.main":"error.main",children:s}),n.trades.map((function(e,n){return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(h.Z,{children:[(0,r.jsx)(Je,{trade:e}),(0,r.jsx)(P.Z,{disabled:f,onClick:function(){return function(e){return v.apply(this,arguments)}(e.id)},sx:{ml:1},children:"Trade"})]})},"npc shop items ".concat(n))}))]})}function Je(e){var n=e.trade;return(0,r.jsxs)(i.Fragment,{children:["For the price of ",(0,r.jsx)(Ye,{price:n.price}),", I'll give you"," ",(0,r.jsx)(Ye,{price:n.offer})]})}function Ye(e){var n=e.price;return(0,r.jsx)(F.Z,{title:Ke(n),describeChild:!0,children:(0,r.jsx)("b",{"aria-label":Ke(n),children:n.description})})}function Ke(e){var n,t,r,i=[];return e.gold&&i.push("".concat(e.gold.toLocaleString()," gold")),e.dust&&i.push("".concat(e.dust.toLocaleString()," dust")),(null===(n=e.baseItems)||void 0===n?void 0:n.length)&&e.baseItems.forEach((function(e){i.push("".concat(e))})),(null===(t=e.enchantments)||void 0===t?void 0:t.length)&&e.enchantments.forEach((function(e){i.push("".concat((0,B.uD)(e)))})),(null===(r=e.questItems)||void 0===r?void 0:r.length)&&e.questItems.forEach((function(e){i.push("".concat(e))})),i.length?i.join(", "):"???"}var Ve=t(3020),_e=t(6242),Xe=t(2023),en=t(9748),nn=t(4267),tn=t(657),rn=t(1425),on=t(6580),an=t(8951),ln=t(3090),sn=t(1812),cn=t(7855),un=t(3707),dn=t(5843),hn=t(1233);function mn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);to?"error":"",component:"span","aria-label":"Upkeep: ".concat(l),children:[" ","-",l.toLocaleString()]})]},i)}))})}function An(e){var n,t=e.hero,i=e.camp,o=function(e){var n,t;return null!==(t=null===(n=e.find((function(e){return"gold"===e.name})))||void 0===n?void 0:n.value)&&void 0!==t?t:0},a=jn((0,D.Th)(),2),l=a[0],c=a[1].loading,u=(0,D.Hk)(),d=u.data,f=u.refetch,v=null!==(n=null===d||void 0===d?void 0:d.availableUpgrades)&&void 0!==n?n:[],x=jn((0,oe.gZ)(),1)[0]>0;if(!v.length)return null;function p(){return(p=bn(Z().mark((function e(n){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,l({variables:{upgrade:n}});case 3:return e.next=5,f();case 5:e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}var y=!!i.upgrades.find((function(e){return e===D.gT.Settlement}));return(0,r.jsxs)(s.Z,{children:[(0,r.jsxs)(h.Z,{variant:"h6",children:[y?"Settlement":"Camp"," Upgrades"]}),(0,r.jsx)(m.ZP,{container:!0,columns:6,spacing:2,children:v.map((function(e){return(0,r.jsx)(m.ZP,{item:!0,xs:3,children:(0,r.jsxs)(_e.Z,{variant:"outlined",children:[(0,r.jsx)(en.Z,{title:e.name}),(0,r.jsx)(nn.Z,{children:(0,r.jsxs)(h.Z,{variant:"body2",color:"text.secondary",children:["Cost:"," ",e.cost.map((function(e){return"".concat(e.value.toLocaleString()," ").concat((0,Ve.words)(e.name))})).join(", ")]})}),(0,r.jsx)(Xe.Z,{children:(0,r.jsx)(sn.Z,{disabled:x,loading:c,sx:{m:1},variant:"outlined",color:o(e.cost)>t.gold?"error":"success",onClick:function(){return function(e){return p.apply(this,arguments)}(e.type)},children:"Purchase"})})]})},e.type)}))})]})}function Pn(e){e.hero,e.camp;return null}var Cn=t(1730),In=t(2613),Ln=t(3054),En=t(7563),On=t(6398),Fn=t(6667),Tn=t(3898),Mn=t(1733),Wn=t(1671),Gn=t(1749),Dn=t(4231);function qn(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Bn(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,r=new Array(n);t=s||d.find((function(e){return e.x===t&&e.y===o}))?null:d.find((function(e){return e.x===t+1&&e.y===o||e.x===t-1&&e.y===o||e.x===t&&e.y===o+1||e.x===t&&e.y===o-1}))?{x:t,y:o,map:a.location.map}:null}),[d.length,t,o,s]);function m(){return(m=Rn(Z().mark((function e(n){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u({variables:{location:n,type:l}});case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}return h?(0,r.jsx)(i.Fragment,{children:(0,r.jsx)(Nn,{onClick:function(){return function(e){return m.apply(this,arguments)}(h)},hover:!0,color:"rgb(10, 120, 10)",cellSize:n,boundingBox:c,location:h,tooltip:"Build here",icon:(0,r.jsx)(Ln.Z,{})},"".concat(h.x,"-").concat(h.y))}):null}function Yn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0?(0,r.jsx)("li",{children:(0,r.jsx)(et,{name:(0,Ve.words)(e.name),"aria-label":"".concat(e.value.toLocaleString()," out of ").concat((null!==(o=e.maximum)&&void 0!==o?o:0).toLocaleString()),value:"".concat(e.value.toLocaleString()," / ").concat((null!==(a=e.maximum)&&void 0!==a?a:0).toLocaleString())})},e.name):null}))]}),l.id===(null===(n=s.home)||void 0===n?void 0:n.id)&&(0,r.jsx)(An,{camp:l,hero:s}),l.type===D.oS.Settlement&&l.id!==(null===(t=s.home)||void 0===t?void 0:t.id)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{children:"This settlement is a former capital that has fallen. You can destroy this location and reclaim most of the resources."}),(0,r.jsx)(P.Z,{onClick:function(){return c(l)},variant:"contained",color:"error",children:"Destroy former settlement"})]}),l.type===D.oS.Barracks&&(0,r.jsx)(nt,{location:l,action:"Recruit",unit:"troops",cost:1e6,loading:m,onPurchase:function(e){d({variables:e})}}),l.type===D.oS.Treasury&&(0,r.jsx)(nt,{location:l,action:"Purchase",unit:"bonds",cost:1e6,loading:x,onPurchase:function(e){v({variables:e})}}),l.type===D.oS.Treasury&&(0,r.jsx)(nt,{location:l,action:"Sell",unit:"bonds",cost:1e6,loading:x,onPurchase:function(e){v({variables:Vn({},e,{amount:0-e.amount})})}}),l.type===D.oS.Treasury&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(sn.Z,{sx:{m:1},loading:S,variant:"contained",disabled:w,onClick:function(){Z({variables:{location:{x:l.location.x,y:l.location.y,map:l.location.map},greater:!1}})},children:"Craft Element of Gold (1,000,000 bonds)"}),(0,r.jsx)(sn.Z,{sx:{m:1},loading:S,variant:"contained",disabled:w,onClick:function(){Z({variables:{location:{x:l.location.x,y:l.location.y,map:l.location.map},greater:!0}})},children:"Craft Greater Element of Gold (250,000,000 bonds)"})]}),l.type===D.oS.Garrison&&(0,r.jsx)(nt,{location:l,action:"Build",unit:"fortifications",cost:1e6,loading:b,onPurchase:function(e){g({variables:e})}})]}):null}function et(e){var n=e.name,t=e.value,i=e["aria-label"];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("label",{style:{fontWeight:"bold"},htmlFor:"building-details-value-".concat(n),children:[n,":"]})," ",(0,r.jsx)("span",{"aria-label":i,children:t})]})}function nt(e){var n=e.location,t=e.action,o=e.unit,a=e.cost,l=e.loading,s=void 0!==l&&l,c=e.onPurchase,u=(0,i.useState)(0),d=u[0],h=u[1],m=(_n((0,D.Up)(),1)[0],(0,oe.mu)()),f=Number.isFinite(d)&&!isNaN(d)&&d>0;return(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(N.Z,{onChange:function(e){return h(parseInt(e.target.value))},id:"".concat(t,"-input"),label:"Amount of ".concat(o," to ").concat(t.toLowerCase())}),(0,r.jsxs)(sn.Z,{loading:s,variant:"contained",disabled:!f||m,onClick:function(){Number.isFinite(d)&&!isNaN(d)&&c({location:{x:n.location.x,y:n.location.y,map:n.location.map},amount:d})},children:[!f&&"".concat(t," ").concat(o),f&&"".concat(t," ").concat(d.toLocaleString()," ").concat(o," for ").concat((d*a).toLocaleString()," gold")]})]})}var tt=t(89),rt=t(3800),it=t(8456);function ot(e){var n,t,i,o=e.open,a=e.onClose,l=e.loading,c=e.attackResults,u=e.hero;return(0,r.jsx)(T.Z,{open:o,onClose:a,children:(0,r.jsxs)(s.Z,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"background.paper",padding:[2,4],minWidth:"320px",maxWidth:"580px",width:"80%",textAlign:"center"},"aria-labelledby":"attack-results-modal-title","aria-describedby":"modal-modal-description",children:[l&&(0,r.jsx)(it.Z,{}),c&&(0,r.jsxs)(r.Fragment,{children:[c.target.owner===u.id&&(0,r.jsx)(h.Z,{id:"attack-results-modal-title",variant:"h5",component:"h2",children:"Your troops have claimed this location in your name, it now belongs to your settlement."}),c.target.owner!==u.id&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Z,{id:"attack-results-modal-title",variant:"h5",component:"h2",children:["Attack results for ",c.target.location.x,","," ",c.target.location.y]}),(0,r.jsxs)(h.Z,{variant:"subtitle1",children:["Owner:"," ",(0,r.jsx)("strong",{children:null!==(i=null===c||void 0===c||null===(n=c.target)||void 0===n||null===(t=n.publicOwner)||void 0===t?void 0:t.name)&&void 0!==i?i:"Unknown"})]})]}),(0,r.jsx)("br",{}),(0,r.jsxs)(h.Z,{children:["You lost ",at(c.attackerCasualties)]}),(0,r.jsxs)(h.Z,{children:["Your opponent lost"," ",at(c.targetCasualties)]}),c.totalDamage>0&&(0,r.jsxs)(h.Z,{children:["Your troops dealt ",c.totalDamage.toLocaleString()," ","damage"]}),c.damage>0&&(0,r.jsxs)(h.Z,{children:["The target location received"," ",c.damage.toLocaleString()," damage",c.totalDamage>c.damage&&", the rest was absorbed by garrisons."]}),0===c.damage&&(0,r.jsx)(h.Z,{children:"All damage was absorbed by garrisons."})]})]})})}function at(e){var n=Object.keys(e).map((function(n){var t=e[n];return!!(t&&t>0)&&"".concat(t.toLocaleString()," ").concat(n)})).filter((function(e){return!!e}));return n.length?n.join(", "):"nothing"}function lt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-ghost",children:"Ghost:"})," ",(0,r.jsx)("span",{id:"military-target-ghost",children:(null!==(I=null===(f=Oe.ghost)||void 0===f?void 0:f.value)&&void 0!==I?I:0).toLocaleString()})]})]}),ne&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h5",children:"Troups in this location"}),(0,r.jsxs)("ul",{children:[(null!==(L=null===Ce||void 0===Ce?void 0:Ce.value)&&void 0!==L?L:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-enlisted",children:"Enlisted:"})," ",(0,r.jsx)("span",{id:"military-target-enlisted",children:(null!==(E=null===Ce||void 0===Ce?void 0:Ce.value)&&void 0!==E?E:0).toLocaleString()})]}),(null!==(O=null===Ie||void 0===Ie?void 0:Ie.value)&&void 0!==O?O:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-soldier",children:"Soldier:"})," ",(0,r.jsx)("span",{id:"military-target-soldier",children:(null!==(F=null===Ie||void 0===Ie?void 0:Ie.value)&&void 0!==F?F:0).toLocaleString()})]}),(null!==(T=null===Le||void 0===Le?void 0:Le.value)&&void 0!==T?T:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-veteran",children:"Veteran:"})," ",(0,r.jsx)("span",{id:"military-target-veteran",children:(null!==(M=null===Le||void 0===Le?void 0:Le.value)&&void 0!==M?M:0).toLocaleString()})]}),(null!==(W=null===Ee||void 0===Ee?void 0:Ee.value)&&void 0!==W?W:0)>0&&(0,r.jsxs)("li",{children:[(0,r.jsx)("label",{style:{fontWeight:"bold"},htmlFor:"military-unit-info-ghost",children:"Ghost:"})," ",(0,r.jsx)("span",{id:"military-target-ghost",children:(null!==(G=null===Ee||void 0===Ee?void 0:Ee.value)&&void 0!==G?G:0).toLocaleString()})]})]}),(0,r.jsx)(h.Z,{mb:2,component:"h6",variant:"h5",children:"Troops to send"}),(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:2,children:[(0,r.jsx)(ht,{name:"enlisted",value:le,onChange:se,max:Pe?null!==(q=null===(v=Oe.enlisted)||void 0===v?void 0:v.value)&&void 0!==q?q:0:Math.min(null!==(B=null===(x=Oe.enlisted)||void 0===x?void 0:x.value)&&void 0!==B?B:0,(null!==($=null===Ce||void 0===Ce?void 0:Ce.maximum)&&void 0!==$?$:0)-(null!==(z=null===Ce||void 0===Ce?void 0:Ce.value)&&void 0!==z?z:0))}),(0,r.jsx)(ht,{name:"soldier",value:ue,onChange:de,max:Pe?null!==(N=null===(p=Oe.soldier)||void 0===p?void 0:p.value)&&void 0!==N?N:0:Math.min(null!==(H=null===(y=Oe.soldier)||void 0===y?void 0:y.value)&&void 0!==H?H:0,(null!==(Q=null===Ie||void 0===Ie?void 0:Ie.maximum)&&void 0!==Q?Q:0)-(null!==(R=null===Ie||void 0===Ie?void 0:Ie.value)&&void 0!==R?R:0))}),(0,r.jsx)(ht,{name:"veteran",value:me,onChange:fe,max:Pe?null!==(U=null===(g=Oe.veteran)||void 0===g?void 0:g.value)&&void 0!==U?U:0:Math.min(null!==(J=null===(b=Oe.veteran)||void 0===b?void 0:b.value)&&void 0!==J?J:0,(null!==(Y=null===Le||void 0===Le?void 0:Le.maximum)&&void 0!==Y?Y:0)-(null!==(K=null===Le||void 0===Le?void 0:Le.value)&&void 0!==K?K:0))}),(0,r.jsx)(ht,{name:"ghost",value:xe,onChange:pe,max:Pe?null!==(V=null===(j=Oe.ghost)||void 0===j?void 0:j.value)&&void 0!==V?V:0:Math.min(null!==(_=null===(S=Oe.ghost)||void 0===S?void 0:S.value)&&void 0!==_?_:0,(null!==(X=null===Ee||void 0===Ee?void 0:Ee.maximum)&&void 0!==X?X:0)-(null!==(ee=null===Ee||void 0===Ee?void 0:Ee.value)&&void 0!==ee?ee:0))})]}),Pe&&(0,r.jsx)(P.Z,{onClick:function(){return Fe.apply(this,arguments)},children:"Attack target"}),!Pe&&(0,r.jsx)(P.Z,{onClick:function(){ne&&je({variables:{target:{x:ne.location.x,y:ne.location.y,map:ne.location.map},units:{enlisted:le,soldier:ue,veteran:me,ghost:xe}}})},children:"Move troops"})]})]})}function ht(e){var n=e.name,t=e.onChange,i=e.value,o=e.max;return 0===o?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.ZP,{item:!0,xs:1,children:(0,r.jsxs)("label",{id:"military-slider-".concat(n,"-label"),children:[(0,Ve.words)(n),":"]})}),(0,r.jsx)(m.ZP,{item:!0,xs:3,children:(0,r.jsx)(L.Z,{fullWidth:!0,children:(0,r.jsx)(rt.ZP,{value:i,onChange:function(e,n){return t(n)},min:0,max:o,valueLabelDisplay:"auto",getAriaValueText:function(e){return e.toLocaleString()},"aria-labelledby":"military-slider-".concat(n,"-label")})})}),(0,r.jsx)(m.ZP,{item:!0,xs:2,children:(0,r.jsx)(L.Z,{fullWidth:!0,children:(0,r.jsx)(tt.Z,{value:i,size:"small",onChange:function(e){return t(""===e.target.value?0:Number(e.target.value))},onBlur:function(){i<0?t(0):i>o&&t(o)},inputProps:{step:1,min:0,max:o,type:"number","aria-labelledby":"input-slider"}})})})]})}var mt,ft=t(947);function vt(e){var n=e.cellSize,t=e.x,i=e.y,o=e.boundingBox,a=e.onClick,l=e.adjacentTiles.find((function(e){return e.location.x===t&&e.location.y===i}));return l?(0,r.jsx)(Nn,{onClick:function(){return a(l)},hover:!0,cellSize:n,boundingBox:o,location:{x:t,y:i},tooltip:"Attack here",color:"rgb(140, 0, 0)",icon:(0,r.jsx)(ft.Z,{})},"".concat(t,"-").concat(i)):null}function xt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&"(-".concat(re.upkeep[e.name].toLocaleString(),")")]})},e.name):(0,r.jsxs)(m.ZP,{item:!0,xs:6,sm:3,md:2,lg:1,children:[(0,r.jsx)("b",{children:(0,Ve.words)(e.name)}),":"," ",e.value.toLocaleString(),e.maximum&&" / ".concat(e.maximum.toLocaleString())," ",re.upkeep[e.name]>0&&"(-".concat(re.upkeep[e.name].toLocaleString(),")")]},e.name):(0,r.jsxs)(m.ZP,{item:!0,xs:6,sm:3,md:2,lg:1,children:[(0,r.jsx)("b",{children:(0,Ve.words)(e.name)}),":"," ",e.value.toLocaleString(),e.maximum&&" / ".concat(e.maximum.toLocaleString())]},e.name)})),(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsxs)(p.Z,{"aria-label":"navigation tabs",variant:"scrollable",textColor:"secondary",indicatorColor:"secondary",onChange:function(e,n){I&&L(null),R(n)},sx:{flexShrink:0,flexGrow:1},children:[(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Wn.Z,{}),label:"Building Details",value:"info",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Ln.Z,{}),label:"Build Buildings",value:"build",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Mn.Z,{}),label:"Destroy Buildings",value:"destroy",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(En.Z,{}),label:"Resource Market",value:"market",wrapped:!0}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Gn.Z,{}),label:"Military",value:"military",wrapped:!0})]})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,md:3,lg:3,children:(0,r.jsxs)(s.Z,{sx:{position:"relative"},children:[(0,r.jsx)(h.Z,{variant:"h6",style:g.Z,children:"Buildings"}),(0,r.jsx)(Ge,{location:re.location,minimapSize:[se,ue],cellSize:he,renderCell:function(e){var n,t,i,o,a,l,s,u,d,h,m,f,v,x,p,y,g,b,j,Z,S,w,k,A,P,C,L,E,O,F,T,M,W,G,q,B,$,z,N,H,R,U,J,Y,K,V,_,X,ee,ie,oe,ae,se=e.x,ce=e.y,ue=!1,de=!1;(null===(n=fe[se])||void 0===n||null===(t=n[ce])||void 0===t?void 0:t.type)!==D.oS.Garrison&&(null===(i=fe[se-1])||void 0===i||null===(o=i[ce+1])||void 0===o?void 0:o.type)!==D.oS.Garrison&&(null===(a=fe[se+1])||void 0===a||null===(l=a[ce+1])||void 0===l?void 0:l.type)!==D.oS.Garrison&&(null===(s=fe[se-1])||void 0===s||null===(u=s[ce])||void 0===u?void 0:u.type)!==D.oS.Garrison&&(null===(d=fe[se+1])||void 0===d||null===(h=d[ce])||void 0===h?void 0:h.type)!==D.oS.Garrison&&(null===(m=fe[se-1])||void 0===m||null===(f=m[ce-1])||void 0===f?void 0:f.type)!==D.oS.Garrison&&(null===(v=fe[se+1])||void 0===v||null===(x=v[ce-1])||void 0===x?void 0:x.type)!==D.oS.Garrison&&(null===(p=fe[se])||void 0===p||null===(y=p[ce+1])||void 0===y?void 0:y.type)!==D.oS.Garrison&&(null===(g=fe[se])||void 0===g||null===(b=g[ce-1])||void 0===b?void 0:b.type)!==D.oS.Garrison&&(null===(j=fe[se])||void 0===j||null===(Z=j[ce+2])||void 0===Z?void 0:Z.type)!==D.oS.Garrison&&(null===(S=fe[se])||void 0===S||null===(w=S[ce-2])||void 0===w?void 0:w.type)!==D.oS.Garrison&&(null===(k=fe[se+2])||void 0===k||null===(A=k[ce])||void 0===A?void 0:A.type)!==D.oS.Garrison&&(null===(P=fe[se-2])||void 0===P||null===(C=P[ce])||void 0===C?void 0:C.type)!==D.oS.Garrison||(ue=!0),(null===(L=fe[se])||void 0===L||null===(E=L[ce])||void 0===E?void 0:E.type)!==D.oS.Barracks&&(null===(O=fe[se-1])||void 0===O||null===(F=O[ce+1])||void 0===F?void 0:F.type)!==D.oS.Barracks&&(null===(T=fe[se+1])||void 0===T||null===(M=T[ce+1])||void 0===M?void 0:M.type)!==D.oS.Barracks&&(null===(W=fe[se-1])||void 0===W||null===(G=W[ce])||void 0===G?void 0:G.type)!==D.oS.Barracks&&(null===(q=fe[se+1])||void 0===q||null===(B=q[ce])||void 0===B?void 0:B.type)!==D.oS.Barracks&&(null===($=fe[se-1])||void 0===$||null===(z=$[ce-1])||void 0===z?void 0:z.type)!==D.oS.Barracks&&(null===(N=fe[se+1])||void 0===N||null===(H=N[ce-1])||void 0===H?void 0:H.type)!==D.oS.Barracks&&(null===(R=fe[se])||void 0===R||null===(U=R[ce+1])||void 0===U?void 0:U.type)!==D.oS.Barracks&&(null===(J=fe[se])||void 0===J||null===(Y=J[ce-1])||void 0===Y?void 0:Y.type)!==D.oS.Barracks&&(null===(K=fe[se])||void 0===K||null===(V=K[ce+2])||void 0===V?void 0:V.type)!==D.oS.Barracks&&(null===(_=fe[se])||void 0===_||null===(X=_[ce-2])||void 0===X?void 0:X.type)!==D.oS.Barracks&&(null===(ee=fe[se+2])||void 0===ee||null===(ie=ee[ce])||void 0===ie?void 0:ie.type)!==D.oS.Barracks&&(null===(oe=fe[se-2])||void 0===oe||null===(ae=oe[ce])||void 0===ae?void 0:ae.type)!==D.oS.Barracks||(de=!0);var me=void 0;if(ue?(me="blue",de&&(me="green")):de&&(me="rgb(180, 200, 0)"),se===re.location.x&&ce===re.location.y)return(0,r.jsx)(Nn,{onClick:function(){return c(function(e){for(var n=1;ne.length)&&(n=e.length);for(var t=0,r=new Array(n);t0||E;function J(e){return Y.apply(this,arguments)}function Y(){return(Y=Pt(Z().mark((function e(n){var t,r;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,A({variables:{direction:n}});case 3:T(),e.next=10;break;case 6:e.prev=6,e.t0=e.catch(0),e.t0.graphQLErrors&&(null===(t=e.t0.graphQLErrors[0])||void 0===t||null===(r=t.extensions)||void 0===r?void 0:r.delay)&&w(e.t0.graphQLErrors[0].extensions.remaining);case 10:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}function K(){return(K=Pt(Z().mark((function e(){var n,t;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,L({variables:{x:x,y:g}});case 3:T(),e.next=10;break;case 6:e.prev=6,e.t0=e.catch(0),e.t0.graphQLErrors&&(null===(n=e.t0.graphQLErrors[0])||void 0===n||null===(t=n.extensions)||void 0===t?void 0:t.delay)&&w(e.t0.graphQLErrors[0].extensions.remaining);case 10:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}var V,_=Math.round(Math.pow(5*(0,B.LW)(s.location,{x:x,y:g}),1.3));return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(m.ZP,{container:!0,columns:2,spacing:3,children:[(0,r.jsx)(m.ZP,{item:!0,xs:2,sm:1,children:(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:3,children:[(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:6,children:(0,r.jsx)(Zn,{hero:s,onShowSettlement:function(){f(!0)}})}),(0,r.jsxs)(m.ZP,{item:!0,style:{textAlign:"center"},xs:6,children:[(0,r.jsx)(h.Z,{variant:"h3",children:"Travel"}),s.combat.health>0&&(0,r.jsx)(h.Z,{children:"Use buttons to move around the map."}),0===s.combat.health&&(0,r.jsx)(h.Z,{component:"p",variant:"h6",children:"You cannot move while dead. Heal yourself in the Combat tab."})]}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"North terrain: ".concat(z),disabled:U,variant:"contained",onClick:function(){return J(D.p$.North)},children:"North"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"West terrain: ".concat(R),disabled:U,variant:"contained",onClick:function(){return J(D.p$.West)},children:"West"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsxs)(h.Z,{children:[s.location.x,", ",s.location.y]})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"East terrain: ".concat(Q),disabled:U,variant:"contained",onClick:function(){return J(D.p$.East)},children:"East"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(P.Z,{"aria-label":"South terrain: ".concat(H),disabled:U,variant:"contained",onClick:function(){return J(D.p$.South)},children:"South"})}),(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2}),s.stats.intelligence>100&&(0,r.jsxs)(m.ZP,{item:!0,style:{textAlign:"center"},xs:6,children:[(0,r.jsx)(c.Z,{}),(0,r.jsx)(h.Z,{variant:"h5",component:"h3",color:"secondary",sx:{margin:1},children:"Teleport"}),(0,r.jsx)(N.Z,{label:"X coordinate",value:x,onChange:function(e){return l(e.target.value,g)},sx:{width:"100px",margin:1}}),(0,r.jsx)(N.Z,{label:"Y coordinate",value:g,onChange:function(e){return l(x,e.target.value)},sx:{width:"100px",margin:1}}),(0,r.jsx)("br",{}),(0,r.jsxs)(P.Z,{color:"secondary",variant:"outlined",onClick:function(){return K.apply(this,arguments)},disabled:0===_||_>s.stats.intelligence||U,children:["Teleport",(0,r.jsx)("br",{}),_>0&&"".concat(_.toLocaleString()," minimum intelligence")]})]})]})}),(0,r.jsxs)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,sm:1,children:[G&&(0,r.jsx)(h.Z,{variant:"h6",component:"h4",children:G.name}),G&&(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:G.type}),$&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)(h.Z,{variant:"h6",component:"h4",children:[null!==(V=null===(t=$.publicOwner)||void 0===t?void 0:t.name)&&void 0!==V?V:"???","'s Settlement"]}),(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:$.type})]}),!G&&!$&&W&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h6",component:"h4",children:"Wilderness"}),(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:W.terrain.terrain})]}),!G&&!$&&!W&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h6",component:"h4",children:"\xa0"}),(0,r.jsx)(h.Z,{variant:"subtitle2",component:"p",children:"loading..."})]}),(0,r.jsx)(Ge,{location:s.location,renderCell:function(e){var n=e.x,t=e.y;return s.location.x===n&&s.location.y===t?(0,r.jsx)("div",{style:{borderRadius:"".concat(4,"px"),backgroundColor:"red",border:"2px solid rgba(255,255,255,0.3)",width:"".concat(8,"px"),height:"".concat(8,"px"),margin:"auto"}}):null}}),(null===G||void 0===G?void 0:G.description)&&G.description.map((function(e,n){return(0,r.jsx)(h.Z,{component:"h4",variant:"body1",children:e},"loc-desc-".concat(n))})),M.filter((function(e){return!!e})).map((function(e){return(0,r.jsx)(h.Z,{component:"h4",variant:"body1",children:e},e)}))]}),"dock"===(null===G||void 0===G?void 0:G.type)&&(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(ze,{location:G})}),(null===W||void 0===W?void 0:W.shop)&&(0,r.jsx)(m.ZP,{item:!0,style:{textAlign:"center"},xs:2,children:(0,r.jsx)(Ue,{shop:null===W||void 0===W?void 0:W.shop})})]})})}var Et,Ot=t(5582);function Ft(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t2&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{id:"level-up-stat-slider-label",children:x}),(0,r.jsx)(rt.ZP,{min:1,max:v.attributePoints,value:a,onChange:function(e,n){return!Array.isArray(n)&&l(n)},id:"level-up-stat-slider","aria-labelledby":"level-up-stat-slider-label",valueLabelDisplay:"auto"})]})})]}),(0,r.jsx)("br",{}),(0,r.jsxs)(m.ZP,{container:!0,columns:14,spacing:2,children:[(0,r.jsx)(F.Z,{title:"Strength determines your damage when attacking with melee weapons",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-strength",disabled:f||n>0,onClick:function(){return p("Strength")},variant:"contained",children:"Strength"})})})}),(0,r.jsx)(F.Z,{title:"Dexterity determines the accuracy and dodge rate for melee and ranged weapons, it also determines ranged weapons damage",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-dexterity",disabled:f||n>0,onClick:function(){return p("Dexterity")},variant:"contained",children:"Dexterity"})})})}),(0,r.jsx)(F.Z,{title:"Constitution determines your max health, and is used in both attacking and defending blood magic",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-constitution",disabled:f||n>0,onClick:function(){return p("Constitution")},variant:"contained",children:"Constitution"})})})}),(0,r.jsx)(F.Z,{title:"Intelligence determines your spellcasting damage",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-intelligence",disabled:f||n>0,onClick:function(){return p("Intelligence")},variant:"contained",children:"Intelligence"})})})}),(0,r.jsx)(F.Z,{title:"Wisdom is your accuracy and dodge stat for spellcasting and smiting",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-wisdom",disabled:f||n>0,onClick:function(){return p("Wisdom")},variant:"contained",children:"Wisdom"})})})}),(0,r.jsx)(F.Z,{title:"Willpower helps you survive attacks by reducing damage, it also helps smiters deal deal more damage.",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,sm:7,md:4,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-willpower",disabled:f||n>0,onClick:function(){return p("Willpower")},variant:"contained",children:"Willpower"})})})}),(0,r.jsx)(F.Z,{title:"Luck helps you critically strike foes and also affects item drop rates",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,md:12,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-luck",disabled:f||n>0,onClick:function(){return p("Luck")},variant:"contained",children:"Luck"})})})}),(0,r.jsx)(F.Z,{title:"Places 1 in every stat for a more well rounded character",children:(0,r.jsx)(m.ZP,{item:!0,xs:14,md:12,lg:2,children:(0,r.jsx)(h.Z,{align:"center",children:(0,r.jsx)(P.Z,{id:"level-up-all",disabled:f||n>0,onClick:function(){return p("All")},variant:"contained",children:"All"})})})})]}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{})]}),(0,r.jsx)(c.Z,{})]})}function Dt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);ta.gold,children:[e.cost&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{display:"inline-block",children:e.name}),"\xa0",(0,r.jsxs)(h.Z,{variant:"caption",display:"inline-block",children:["Lvl. ",e.level]}),"\xa0",(0,r.jsxs)(h.Z,{variant:"subtitle2",display:"inline-block",sx:{color:"info.main"},children:[e.cost.toLocaleString()," Gold"]})]}),!e.cost&&e.name]},e.id)}))})]}):null}function Ut(){var e=zt((0,oe.gZ)(),1)[0],n=(0,i.useState)(null),t=n[0],o=n[1],a=(0,i.useState)(""),l=a[0],s=a[1],u=(0,D.Cb)(),d=u.data,f=(u.loading,u.error,zt((0,D.Nn)(),2)),v=f[0],x=f[1].loading,p=zt((0,D.o_)(),2),y=p[0],g=p[1].loading||x||e>0;function b(){return(b=Bt(Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,o(null),e.next=6,v({variables:{baseItem:t.id}});case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function j(){return(j=Bt(Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,o(null),e.next=6,y({variables:{item:t.id}});case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}var S,w="Choose which shop to visit";return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)(h.Z,{align:"center",children:["Welcome to the shop! You can buy and sell any non-enchanted items here.",(0,r.jsx)("br",{}),"The items purchasable here have a level from 1 to 32 but no enchantments or direct attribute increases."]}),(0,r.jsx)("br",{}),(0,r.jsx)(c.Z,{}),(0,r.jsx)("br",{}),(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:2,children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"shop-type-select-label",children:w}),(0,r.jsxs)($.Z,{id:"shop-type-select",labelId:"shop-type-select-label",label:w,onChange:function(e){s(e.target.value),o(null)},children:[(0,r.jsx)(z.Z,{value:"sell",children:"Sell Items"}),(0,r.jsx)(c.Z,{}),(0,r.jsxs)(z.Z,{value:D.$7.MeleeWeapon,children:[Ht(D.$7.MeleeWeapon)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.RangedWeapon,children:[Ht(D.$7.RangedWeapon)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.SpellFocus,children:[Ht(D.$7.SpellFocus)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.Shield,children:[Ht(D.$7.Shield)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.BodyArmor,children:[Ht(D.$7.BodyArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.HandArmor,children:[Ht(D.$7.HandArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.LegArmor,children:[Ht(D.$7.LegArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.HeadArmor,children:[Ht(D.$7.HeadArmor)," Shop"]}),(0,r.jsxs)(z.Z,{value:D.$7.FootArmor,children:[Ht(D.$7.FootArmor)," Shop"]})]})]})}),(0,r.jsxs)(m.ZP,{item:!0,xs:6,sm:3,children:[""!==l&&"sell"!==l&&(0,r.jsx)(Rt,{value:t?t.id:"",type:l,items:function(e){var n;return(null===d||void 0===d||null===(n=d.shopItems)||void 0===n?void 0:n.length)?d.shopItems.filter((function(n){return n.type===e})):[]}(l),onChange:function(e){return o(e)}},l),"sell"===l&&(0,r.jsx)(Qt,{value:t?t.id:"",sellables:null!==(S=null===d||void 0===d?void 0:d.shopItems)&&void 0!==S?S:[],onChange:function(e){return o(e)}})]}),(0,r.jsx)(m.ZP,{item:!0,xs:6,children:t&&(0,r.jsxs)(P.Z,{variant:"contained",color:"sell"===l?"error":"success",fullWidth:!0,disabled:g,onClick:"sell"===l?function(){return j.apply(this,arguments)}:function(){return b.apply(this,arguments)},children:["sell"===l?"Sell":"Buy"," ",t.name," for"," ",t.cost.toLocaleString()," gold"]})})]}),(0,r.jsx)("br",{})]})}function Jt(){q();var e=ae();le();return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{variant:"h3",sx:{textAlign:"center"},children:"Item Shop"}),(0,r.jsx)(Ut,{}),(null===e||void 0===e?void 0:e.shop)&&(0,r.jsx)(Ue,{shop:null===e||void 0===e?void 0:e.shop})]})}function Yt(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=n.levelCap);function l(){return(l=Vt(Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o();case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.log(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}return(0,r.jsxs)(s.Z,{sx:{padding:1,margin:1},children:[(0,r.jsx)(h.Z,{color:"secondary",variant:"h2",children:"Rebirth"}),!a&&(0,r.jsx)(h.Z,{children:"You may only be reborn when you are at level cap. Keep leveling up your character in order to be reborn!"}),a&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{children:"This will reset your character's level and attributes, however you will keep all gold and items and will receive special bonuses depending on your current level cap."}),(0,r.jsx)("br",{}),(0,r.jsx)(P.Z,{size:"large",variant:"outlined",color:"secondary",onClick:function(){return l.apply(this,arguments)},children:"Reset Character to Level 1"})]})]})}var er=t(5988),nr=t(9629);function tr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);t1&&"(".concat(p[e],")"),"???"!==(0,B.Lt)(e)&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"primary.main"},children:["\xa0",(0,B.Lt)(e)]})]},e)}))})]}),(0,r.jsxs)(P.Z,{fullWidth:!0,variant:"contained",disabled:!g||t||v||S>n.enchantingDust,color:"success",onClick:function(){return j.apply(this,arguments)},children:[g&&""!==u&&(0,r.jsxs)(s.Z,{children:[(0,r.jsxs)(h.Z,{children:["Create ",(0,r.jsx)("b",{children:(0,B.GJ)(g,u)})]}),(0,r.jsxs)(h.Z,{variant:"subtitle2",children:["Costs ",S.toLocaleString()," Enchantment Dust"]})]}),!g&&"Select Item"]})]})}function fr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);tn.enchantingDust,color:"error",onClick:function(){return j.apply(this,arguments)},children:[b&&(0,r.jsxs)(s.Z,{children:[(0,r.jsxs)(h.Z,{children:["Disenchant ",(0,r.jsx)("b",{children:(0,B.GJ)(b)})]}),(0,r.jsxs)(h.Z,{variant:"subtitle2",children:["Costs ",w.toLocaleString()," Enchantment Dust"]})]}),!b&&"Select Item"]})]}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),m&&(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"filter-select-label",children:"Filter by enchantment"}),(0,r.jsx)($.Z,{id:"filter-select",labelId:"filter-select-label",value:a||"",label:"Filter by enchantment",onChange:function(e){var t=e.target.value;n.inventory.find((function(e){return e.enchantment===t}))&&l(t)},children:g.map((function(e){return(0,r.jsxs)(z.Z,{value:e,children:[(0,B.uD)(e),"???"!==(0,B.Lt)(e)&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"primary.main"},children:["\xa0",(0,B.Lt)(e)]})]},e)}))})]})]})}var gr=t(3457),br=t(480),jr=t(9368);function Zr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t31)})).sort(B.v4)),v=f.find((function(e){return e.id===a}));!v&&a.length&&(f.length?(v=f[0],a=v.id):a="");var x="Select base item",p=n.equipment.artifact;if(!p)return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(h.Z,{children:"You must have an artifact to imbue items with."})});var y,g=(0,B.Vy)(p);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{children:"Imbueing an item adds parts of an artifact onto a base item. Items can only be imbued once, and there is no way to remove the imbue. You may enchant an imbued item, however only unenchanted items can receive an imbue."}),(0,r.jsx)("br",{}),(0,r.jsxs)(L.Z,{fullWidth:!0,sx:{margin:1},children:[(0,r.jsx)(E.Z,{id:"enchant-baseItem-select-label",children:x}),(0,r.jsx)($.Z,{id:"enchant-baseItem-select",labelId:"enchant-baseItem-select-label",value:a||"",label:x,onChange:function(e){var t=e.target.value;n.inventory.find((function(e){return e.id===t}))&&l(t)},children:f.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,children:[(0,B.GJ)(e),(0,B.mQ)(n,e)&&"*EQUIPPED*"]},e.id)}))})]}),v&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Z,{variant:"h5",children:[v.name," to be imbued with"," ",(0,r.jsx)("strong",{children:p.name})]}),(0,r.jsx)(h.Z,{variant:"subtitle1",children:"Select up to three affixes to activate on the item, each affix increases dust cost dramatically. The remaining affixes will be selected randomly from the remaining affixes."}),(0,r.jsx)(gr.Z,{children:g.map((function(e){return(0,r.jsx)(br.Z,{control:(0,r.jsx)(jr.Z,{disabled:c.length>=3&&!c.includes(e.type),onChange:function(n){var t=c.filter((function(n){return n!==e.type}));n.target.checked&&t.push(e.type),u(t)}}),label:(0,B.xq)(e)},e.type)}))})]}),(0,r.jsx)(sn.Z,{variant:"contained",disabled:t||!v||0===c.length,loading:t,onClick:(y=Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t&&v&&0!==c.length){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,m({variables:{item:v.id,artifact:p.id,affixes:c}});case 4:case"end":return e.stop()}}),e)})),function(){var e=this,n=arguments;return new Promise((function(t,r){var i=y.apply(e,n);function o(e){Sr(i,t,r,o,a,"next",e)}function a(e){Sr(i,t,r,o,a,"throw",e)}o(void 0)}))}),children:"Imbue item"})]})}function Ar(e){var n=e.hero,t=e.disabled,o=(0,i.useState)("1"),a=o[0],l=o[1],u=n.inventory.some((function(e){return"pure-essence"===e.baseItem})),m=n.inventory.some((function(e){return"essence-of-void"===e.baseItem})),f=u&&m&&null!==n.equipment.artifact;return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(c.Z,{sx:{margin:2}}),(0,r.jsx)(h.Z,{variant:"h2",component:"h4",color:"secondary",children:"Crafting"}),(0,r.jsxs)(h.Z,{variant:"subtitle1",color:"secondary",children:["Enchanting Dust:"," ",(0,r.jsx)("span",{id:"hero-stats-enchanting-dust",children:n.enchantingDust.toLocaleString()})]}),(0,r.jsxs)(h.Z,{variant:"subtitle1",color:"secondary",children:["Enchantments:"," ",(0,r.jsx)("span",{id:"hero-stats-enchantments",children:n.enchantments.length.toLocaleString()})]}),(0,r.jsx)("br",{}),(0,r.jsx)(x.ZP,{value:a,children:(0,r.jsxs)(s.Z,{sx:{flexGrow:1,borderBottom:1,borderColor:"divider",display:"flex"},children:[(0,r.jsxs)(p.Z,{orientation:"vertical",onChange:function(e,n){return l(n)},"aria-label":"navigation tabs",variant:"scrollable",textColor:"secondary",indicatorColor:"secondary",sx:{flexShrink:0,flexGrow:0,width:"100px"},children:[(0,r.jsx)(d.Z,{icon:(0,r.jsx)(Mn.Z,{}),label:"Destroy",value:"1"}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(nr.Z,{}),label:"Disenchant",value:"2"}),(0,r.jsx)(d.Z,{icon:(0,r.jsx)(er.Z,{}),label:"Enchant",value:"3"}),f&&(0,r.jsx)(d.Z,{icon:(0,r.jsx)(er.Z,{}),label:"Imbue",value:"4"})]}),(0,r.jsxs)(y.Z,{value:"1",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:g.Z,children:"Destroy Items"}),(0,r.jsx)(ar,{hero:n,disabled:t})]}),(0,r.jsxs)(y.Z,{value:"2",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:g.Z,children:"Disenchant Items"}),(0,r.jsx)(yr,{hero:n,disabled:t})]}),(0,r.jsxs)(y.Z,{value:"3",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:g.Z,children:"Enchant Items"}),(0,r.jsx)(mr,{hero:n,disabled:t})]}),f&&(0,r.jsxs)(y.Z,{value:"4",children:[(0,r.jsx)(h.Z,{variant:"h5",sx:g.Z,children:"Imbue Items"}),(0,r.jsx)(kr,{hero:n,disabled:t})]})]})})]})}function Pr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t1){var r=f.find((function(n){return(0,B.GJ)(n)===t&&n.id!==e}));r&&(x.push(r),v[t]-=1)}}})),x.sort(B.v4),(0,r.jsx)(i.Fragment,{children:(0,r.jsx)("div",{children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"".concat(o,"-equip-select-label"),children:a}),(0,r.jsx)($.Z,{id:"".concat(o,"-equip-select"),labelId:"".concat(o,"-equip-select-label"),value:c||"",label:a,disabled:s,onChange:function(e){m(e.target.value),l(o,e.target.value)},children:x.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,disabled:u.indexOf(e.id)>=0,children:[e.id===c?(0,r.jsx)("b",{children:(0,B.GJ)(e)}):(0,r.jsxs)(r.Fragment,{children:[(0,B.GJ)(e),v[(0,B.GJ)(e)]>1&&-1===u.indexOf(e.id)?" x".concat(v[(0,B.GJ)(e)]):""]}),(0,r.jsxs)(h.Z,{variant:"caption",sx:{color:"info.secondary"},children:["\xa0Lvl. ",e.level]}),e.enchantment&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"info.main"},children:["\xa0",(0,B.Lt)(e.enchantment)]})]},e.id)}))})]})})})}function Er(e){var n=e.hero,t=e.disabled,o=e.onChange,a=(0,i.useState)(""),l=a[0],s=a[1],c=n.inventory.filter((function(e){return e.type===D.$7.Quest})).sort((function(e,n){return n.level-e.level})),u="Quest items (passive, always active)",d=n.inventory.find((function(e){return e.id===l}));(0,i.useEffect)((function(){l.length&&!d&&s("")}),[d,l]);var m={};c.forEach((function(e){var n=(0,B.GJ)(e);m[n]?m[n]+=1:m[n]=1}));var f=Object.keys(m).map((function(e){return c.find((function(n){return(0,B.GJ)(n)===e}))}));return(0,r.jsx)(i.Fragment,{children:(0,r.jsx)("div",{children:(0,r.jsxs)(L.Z,{fullWidth:!0,children:[(0,r.jsx)(E.Z,{id:"quest-item-label",children:u}),(0,r.jsx)($.Z,{id:"quest-item",labelId:"quest-item-label",value:l,label:u,disabled:t,onChange:function(e){if(s(e.target.value),o){var n=c.find((function(n){return n.id===e.target.value}));n&&o(n.baseItem)}},children:f.map((function(e){return(0,r.jsxs)(z.Z,{value:e.id,children:[(0,r.jsxs)(r.Fragment,{children:[(0,B.GJ)(e),m[(0,B.GJ)(e)]>1?" x".concat(m[(0,B.GJ)(e)]):""]}),"???"!==(0,B.Lt)(e.baseItem)&&(0,r.jsxs)(h.Z,{variant:"subtitle2",sx:{color:"primary.main"},children:["\xa0",(0,B.Lt)(e.baseItem)]})]},e.id)}))})]})})})}function Or(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0;if(!H)return null;function R(e,n){return U.apply(this,arguments)}function U(){return(U=Tr(Z().mark((function e(n,t){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,W({variables:{item:t,slot:n}});case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}return(0,r.jsx)(i.Fragment,{children:(0,r.jsxs)(m.ZP,{container:!0,columns:6,spacing:1,children:[(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(h.Z,{variant:"h3",sx:{fontSize:"1.2rem"},children:"Equipped items"})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Lr,{hero:H,slot:"leftHand",label:"Left Hand",onEquip:R,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Lr,{hero:H,slot:"rightHand",label:"Right Hand",onEquip:R,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Lr,{hero:H,slot:"bodyArmor",label:"Body Armor",onEquip:R,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Lr,{hero:H,slot:"handArmor",label:"Gauntlets",onEquip:R,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Lr,{hero:H,slot:"legArmor",label:"Leggings",onEquip:R,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Lr,{hero:H,slot:"headArmor",label:"Helmets",onEquip:R,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Lr,{hero:H,slot:"footArmor",label:"Greaves",onEquip:R,disabled:Q})}),(0,r.jsx)(m.ZP,{item:!0,xs:6,sm:3,children:(0,r.jsx)(Er,{hero:H,disabled:Q,onChange:N})}),(0,r.jsxs)(m.ZP,{item:!0,xs:6,children:[!!H.buffs.blessing&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(h.Z,{children:(0,B.uD)(H.buffs.blessing)}),(0,r.jsx)(h.Z,{variant:"body1",children:(0,r.jsx)("b",{children:(0,B.Lt)(H.buffs.blessing)})}),(0,r.jsx)("br",{})]}),(0,r.jsx)(Y,{title:null===(e=H.equipment.artifact)||void 0===e?void 0:e.name,artifact:H.equipment.artifact}),(0,r.jsx)(Y,{title:H.equipment.leftHand?(0,B.GJ)(H.equipment.leftHand,null):null,artifact:null===(n=H.equipment.leftHand)||void 0===n||null===(t=n.imbue)||void 0===t?void 0:t.artifact,affixes:null===(o=H.equipment.leftHand)||void 0===o||null===(a=o.imbue)||void 0===a?void 0:a.affixes}),(0,r.jsx)(Y,{title:H.equipment.rightHand?(0,B.GJ)(H.equipment.rightHand,null):null,artifact:null===(l=H.equipment.rightHand)||void 0===l||null===(s=l.imbue)||void 0===s?void 0:s.artifact,affixes:null===(c=H.equipment.rightHand)||void 0===c||null===(u=c.imbue)||void 0===u?void 0:u.affixes}),(0,r.jsx)(Y,{title:H.equipment.bodyArmor?(0,B.GJ)(H.equipment.bodyArmor,null):null,artifact:null===(d=H.equipment.bodyArmor)||void 0===d||null===(f=d.imbue)||void 0===f?void 0:f.artifact,affixes:null===(v=H.equipment.bodyArmor)||void 0===v||null===(x=v.imbue)||void 0===x?void 0:x.affixes}),(0,r.jsx)(Y,{title:H.equipment.handArmor?(0,B.GJ)(H.equipment.handArmor,null):null,artifact:null===(p=H.equipment.handArmor)||void 0===p||null===(y=p.imbue)||void 0===y?void 0:y.artifact,affixes:null===(g=H.equipment.handArmor)||void 0===g||null===(b=g.imbue)||void 0===b?void 0:b.affixes}),(0,r.jsx)(Y,{title:H.equipment.legArmor?(0,B.GJ)(H.equipment.legArmor,null):null,artifact:null===(j=H.equipment.legArmor)||void 0===j||null===(S=j.imbue)||void 0===S?void 0:S.artifact,affixes:null===(w=H.equipment.legArmor)||void 0===w||null===(k=w.imbue)||void 0===k?void 0:k.affixes}),(0,r.jsx)(Y,{title:H.equipment.headArmor?(0,B.GJ)(H.equipment.headArmor,null):null,artifact:null===(A=H.equipment.headArmor)||void 0===A||null===(P=A.imbue)||void 0===P?void 0:P.artifact,affixes:null===(C=H.equipment.headArmor)||void 0===C||null===(I=C.imbue)||void 0===I?void 0:I.affixes}),(0,r.jsx)(Y,{title:H.equipment.footArmor?(0,B.GJ)(H.equipment.footArmor,null):null,artifact:null===(L=H.equipment.footArmor)||void 0===L||null===(E=L.imbue)||void 0===E?void 0:E.artifact,affixes:null===(O=H.equipment.footArmor)||void 0===O||null===(F=O.imbue)||void 0===F?void 0:F.affixes})]}),H.level===H.levelCap&&(0,B.jr)(z)&&(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(Xt,{hero:H,disabled:Q})}),(0,B.OB)(z)&&(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(Ar,{hero:H,disabled:Q})}),(0,B.jj)(z)&&(0,r.jsx)(m.ZP,{item:!0,xs:6,children:(0,r.jsx)(Ir,{hero:H,disabled:Q})})]})})}function Gr(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(n=e.length);for(var t=0,r=new Array(n);t0&&(0,r.jsx)(Gt,{}),T&&T.currentQuest&&(0,r.jsx)(qr,{event:T.currentQuest})]}),(0,r.jsxs)(s.Z,{sx:{width:"100%",typography:"body1"},children:[(0,r.jsxs)(x.ZP,{value:E,children:[(0,r.jsxs)(s.Z,{sx:{borderBottom:1,borderColor:"divider"},children:[(0,r.jsx)(h.Z,{variant:"h1",sx:g.Z,children:"Navigation"}),(0,r.jsxs)(p.Z,{onChange:function(e,n){"play"===n?Z.push("/play","/play",{scroll:!1}):Z.push("/play/".concat(n),"/play/".concat(n),{scroll:!1}),O(n)},"aria-label":"navigation tabs",variant:"scrollable",children:[(0,r.jsx)(d.Z,{label:"Welcome",value:"play"}),(0,r.jsx)(d.Z,{label:"Combat",value:"combat"}),!(!(null===T||void 0===T?void 0:T.inventory.length)&&!(null===T||void 0===T?void 0:T.gold))&&(0,r.jsx)(d.Z,{label:"Shop",value:"shop"}),!!(null===T||void 0===T?void 0:T.inventory.length)&&(0,r.jsx)(d.Z,{label:"Inventory",value:"inventory"}),(0,r.jsx)(d.Z,{label:"Map",value:"map"}),T&&Object.values(T.questLog).filter((function(e){return!!e})).length>2&&(0,r.jsx)(d.Z,{label:"Quests",value:"quests"}),W&&(0,r.jsx)(d.Z,{label:"Settings",value:"settings"}),M===D.Ks.Admin&&(0,r.jsx)(d.Z,{label:"Admin",value:"admin"})]})]}),(0,r.jsx)(y.Z,{value:"play",children:(0,r.jsxs)(m.ZP,{container:!0,columns:12,spacing:4,children:[(0,r.jsxs)(m.ZP,{item:!0,xs:12,sm:7,md:8,children:[(0,r.jsxs)(h.Z,{variant:"h2",sx:{mb:2,fontSize:"1.8rem"},children:["Welcome to ",(0,r.jsx)("b",{children:"Proof of Combat"}),"!"]}),(0,r.jsxs)(h.Z,{variant:"subtitle1",sx:g.Z,children:["This text is only available to screen readers. Thank you for trying out my game! If you find any parts of the user interface that are difficult to navigate please let me know and I would love to improve them.",(0,r.jsx)("br",{}),(0,r.jsx)(v.Z,{href:"https://github.com/chrisinajar/proofofcombat/wiki/Screen-Readers-and-Accessibility",target:"_blank",rel:"noreferrer",children:"Check this wiki page for more details on accessibility"})]}),(0,r.jsx)(h.Z,{sx:{mb:2},children:"This game is once again being developed actively. It's been a long time coming and there's a lot of major changes to the underlying engine in order to unlock cooler and more interesting mechanics for the game."}),(0,r.jsx)(h.Z,{variant:"h4",sx:g.Z,children:"Discord Server"}),(0,r.jsxs)(h.Z,{sx:{mb:2},children:["If you'd like to talk more with other players, report bugs, or discuss upcoming features,"," ",(0,r.jsx)(v.Z,{underline:"hover",href:"https://discord.gg/t7AZSxvfJG",target:"_blank",rel:"noreferrer",children:"join the discord!"})]}),(0,r.jsx)(h.Z,{variant:"h4",sx:g.Z,children:"Game Wiki"}),(0,r.jsxs)(h.Z,{sx:{mb:2},children:["A great deal of the game is undocumented, but the parts which are documented can be found,"," ",(0,r.jsx)(v.Z,{underline:"hover",href:"https://github.com/chrisinajar/proofofcombat/wiki/",target:"_blank",rel:"noreferrer",children:"in the wiki"}),". The game is nearly impossible to 100% without consulting the wiki."]}),(0,r.jsx)(h.Z,{variant:"h5",sx:{mb:2},children:"Combat Stats"}),(null===T||void 0===T?void 0:T.combatStats)&&(0,r.jsx)(Yr,{skills:T.skills,stats:T.combatStats})]}),(null===F||void 0===F?void 0:F.leaderboard)&&(0,r.jsxs)(m.ZP,{item:!0,xs:12,sm:5,md:4,children:[(0,r.jsx)(h.Z,{variant:"h6",children:"Leaderboard"}),(0,r.jsx)("ul",{id:"leaderboard-list",children:F.leaderboard.slice(0,20).map((function(e,n){return(0,r.jsxs)("li",{id:"leaderboard-list-".concat(n),children:[(0,r.jsx)("b",{id:"leaderboard-list-".concat(n,"-name"),children:e.name})," ","(",(0,B.qh)(e.class),")"]},e.id)}))})]})]})}),(0,r.jsxs)(y.Z,{value:"combat",children:[(0,r.jsx)(h.Z,{variant:"h3",sx:{textAlign:"center"},children:"Combat"}),(0,r.jsx)(h.Z,{children:"Challenge a monster from the list, then fight it to the death. Note that other players in the same location see the same monster lists, so they may get to it first!"}),(0,r.jsx)("br",{}),(0,r.jsx)(Ee,{})]}),(0,r.jsx)(y.Z,{value:"shop",children:(0,r.jsx)(Jt,{})}),(0,r.jsx)(y.Z,{value:"inventory",children:(0,r.jsx)(Wr,{})}),(0,r.jsx)(y.Z,{value:"map",children:(0,r.jsx)(Lt,{})}),(0,r.jsx)(y.Z,{value:"quests",children:(0,r.jsx)(Ur,{})}),(0,r.jsx)(y.Z,{value:"settings",children:(0,r.jsx)(ui,{})}),(0,r.jsx)(y.Z,{value:"admin",children:(0,r.jsx)(mi,{})})]}),(0,r.jsx)("br",{}),(0,r.jsx)(c.Z,{}),(0,r.jsx)("br",{}),(0,r.jsx)(re,{})]})]})})}}}]); \ No newline at end of file diff --git a/index.html b/index.html index 43f11ba..3d2af72 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat


This is a game about clicking things and watching numbers go up, login if you have an account already.




Need an account?






Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat


This is a game about clicking things and watching numbers go up, login if you have an account already.




Need an account?






Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/map.html b/map.html index ad0de3e..49cc525 100644 --- a/map.html +++ b/map.html @@ -1 +1 @@ -Proof of Combat
\ No newline at end of file +Proof of Combat
\ No newline at end of file diff --git a/play.html b/play.html index b21c83a..d6e264e 100644 --- a/play.html +++ b/play.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/play/admin.html b/play/admin.html index a0146c7..86281ab 100644 --- a/play/admin.html +++ b/play/admin.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/play/combat.html b/play/combat.html index 711a1fd..9c59c0b 100644 --- a/play/combat.html +++ b/play/combat.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/play/inventory.html b/play/inventory.html index a7d1caf..e371987 100644 --- a/play/inventory.html +++ b/play/inventory.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/play/map.html b/play/map.html index 4d359b7..f718b89 100644 --- a/play/map.html +++ b/play/map.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/play/quests.html b/play/quests.html index 064ec4a..368100c 100644 --- a/play/quests.html +++ b/play/quests.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/play/settings.html b/play/settings.html index fc54446..38d9c7d 100644 --- a/play/settings.html +++ b/play/settings.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file diff --git a/play/shop.html b/play/shop.html index 67fece1..3cdf212 100644 --- a/play/shop.html +++ b/play/shop.html @@ -1 +1 @@ -Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file +Proof of Combat

Proof of Combat




Client source code

API explorer

Server source code



Logout

\ No newline at end of file