PageSourceSearch

https://evrloot.com/_next/static/chunks/pages/marketplace-ddc5fdac0e1e6888.js

js evrloot.com collected 2026-10-06 07:57:13 UTC 314,338 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2465,1455],{35610:function(e,t,o){(window.__NEXT_P=window.__NEXT_P||[]).push(["/marketplace",function(){return o(15348)}])},20837:function(e,t){"use strict";t.Z={src:"/_next/static/media/GlimmerLogoCurrency.0e30c8ec.svg",height:13,width:15,blurWidth:0,blurHeight:0}},24754:function(e,t,o){"use strict";o.d(t,{Z:function(){return tn}});var i,l,n,r,a=o(44610),s=o(67462),d=o(85893),c=o(83658),u=o(88329),p=o(90243),x=o(68029),h=o(15715),v=o(43321),m=o(59099),f=o(90092),g=o(48899),w=o(67294),b=o(45007),j=o(25343),C=o(24996),y=o(80168),S=o(99484);async function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2?arguments[2]:void 0;return await fetch("".concat(S.Pi,"/").concat(e,"/").concat(t),{signal:null==o?void 0:o.signal}).then(async e=>200==e.status?await e.json():void 0).catch(e=>{console.log("Failed to fetch trades ",e)})}async function I(e,t,o){return(null==t?void 0:t.find(e=>e.assets.find(e=>289==e.assetId)))==void 0}let _={mineFilter:"",classFilter:"",rarityFilter:"",slotFilter:"",eqNameFilter:"",typeFilter:"",containFilter:"",statusFilter:"",scaleFilter:"",soulOrResourceFilter:"",sortBy:"",page:1,limit:15,activeFilter:"active",isInventoryFilter:!1,dateFilter:30};async function N(e,t){return await new Promise((o,i)=>{null==e||e.emit("getTrade",t,e=>{try{console.log("All Trades, ",e),200==e.status?o(e.trade):i(Error("Failed to get trade"))}catch(e){i(e)}})})}var E=o(30381),F=o.n(E),M=o(73636),A=o(12519),R=o(82206),T=o(38488),z=o(12912),D=o(15379);function L(e){let{pageData:t,setPageData:o,downIcon:i,onReload:l,hideFilter:n,selectedTab:r}=e,c={brown:"#38332E",beige:"#E5C687",yellow:"#FAC70C",red:"#AF1817"},[x,v]=(0,w.useState)("black"),[m,f]=(0,w.useState)("black"),[g,b]=(0,w.useState)(c.beige),[j,C]=(0,w.useState)(c.beige),[y,S]=(0,w.useState)(c.beige);return(0,d.jsxs)(u.k,{w:"100%",align:"flex-start",className:F().newTradesGridFilter,justifyContent:"flex-start",flexWrap:"nowrap",mb:"2px",gap:"16px",children:[o&&(0,d.jsxs)(M.U,{hidden:n,children:[(0,d.jsx)(D.Z,{text:"Show All",placement:"right",children:(0,d.jsx)(A.h,{size:"sm",bgColor:c.brown,_hover:{bgColor:c.brown},"aria-label":"Show all",icon:(0,d.jsx)(z.Q_,{fill:(null==t?void 0:t.soulOrResourceFilter)===""?c.yellow:g}),onMouseEnter:()=>b(c.yellow),onMouseLeave:()=>b(c.beige),onClick:()=>o((0,s._)((0,a._)({},t),{soulOrResourceFilter:"",statusFilter:"",page:1}))})}),(0,d.jsx)(D.Z,{text:"Show Souls Only",placement:"right",children:(0,d.jsx)(A.h,{size:"sm",bgColor:c.brown,_hover:{bgColor:c.brown},"aria-label":"Show souls",icon:(0,d.jsx)(z.Fe,{fill:(null==t?void 0:t.soulOrResourceFilter)==="souls"?c.yellow:j}),onMouseEnter:()=>C(c.yellow),onMouseLeave:()=>C(c.beige),onClick:()=>o((0,s._)((0,a._)({},t),{soulOrResourceFilter:"souls",page:1}))})}),(0,d.jsx)(D.Z,{text:"Show Gear & Resources",placement:"right",children:(0,d.jsx)(A.h,{size:"sm",bgColor:c.brown,_hover:{bgColor:c.brown},"aria-label":"Show resources and gear",icon:(0,d.jsx)(z.gT,{fill:(null==t?void 0:t.soulOrResourceFilter)==="resources"?c.yellow:y}),onMouseEnter:()=>S(c.yellow),onMouseLeave:()=>S(c.beige),onClick:()=>o((0,s._)((0,a._)({},t),{soulOrResourceFilter:"resources",page:1}))})})]}),(0,d.jsxs)(p.P,{hidden:n,width:"fit-content",value:null==t?void 0:t.sortBy,size:"sm",bgColor:"#38332E",onChange:e=>o((0,s._)((0,a._)({},t),{sortBy:e.target.value,page:1})),style:(null==t?void 0:t.sortBy)?{color:c.yellow,backgroundColor:"#38332E"}:{color:c.beige,backgroundColor:"#38332E"},icon:n?void 0:i,iconSize:n?"0px":"10px",_hover:{color:c.yellow},_focus:{outline:"none"},_focusVisible:{outline:"none"},children:[(0,d.jsx)("option",{value:"newest",children:" Newest"}),(0,d.jsx)("option",{value:"oldest",children:"Oldest"})]}),o&&(0,d.jsxs)(p.P,{hidden:n,width:"fit-content",value:null==t?void 0:t.containFilter,size:"sm",onChange:e=>o((0,s._)((0,a._)({},t),{containFilter:e.target.value,page:1})),style:(null==t?void 0:t.containFilter)?{color:c.yellow,backgroundColor:"#38332E"}:{color:c.beige,backgroundColor:"#38332E"},placeholder:"Contain",icon:n?void 0:i,iconSize:n?"0px":"10px",_hover:{color:c.yellow},_focus:{outline:"none"},_focusVisible:{outline:"none"},children:[(0,d.jsx)("option",{value:"buyout",children:"Direct Buyout"}),(0,d.jsx)("option",{value:"trade",children:"No Buyout/Only Trade"})]}),o&&(0,d.jsxs)(p.P,{hidden:n,width:"fit-content",value:null==t?void 0:t.mineFilter,size:"sm",onChange:e=>o((0,s._)((0,a._)({},t),{mineFilter:e.target.value,page:1})),style:(null==t?void 0:t.mineFilter)?{color:c.yellow,backgroundColor:"#38332E"}:{color:c.beige,backgroundColor:"#38332E"},placeholder:"All Trades",icon:n?void 0:i,iconSize:n?"0px":"10px",_hover:{color:c.yellow},_focus:{outline:"none"},_focusVisible:{outline:"none"},children:[(0,d.jsx)("option",{value:"trades",children:"My Trades"}),(0,d.jsx)("option",{value:"bids",children:"My Bids"})]}),o&&(0,d.jsxs)(p.P,{hidden:n,width:"fit-content",value:null==t?void 0:t.rarityFilter,size:"sm",onChange:e=>o((0,s._)((0,a._)({},t),{rarityFilter:e.target.value,page:1})),style:(null==t?void 0:t.rarityFilter)?{color:c.yellow,backgroundColor:"#38332E"}:{color:c.beige,backgroundColor:"#38332E"},placeholder:"Rarity",icon:n?void 0:i,iconSize:n?"0px":"10px",_hover:{color:c.yellow},_focus:{outline:"none"},_focusVisible:{outline:"none"},children:[(0,d.jsx)("option",{value:"common",children:"Common"}),(0,d.jsx)("option",{value:"rare",children:"Rare"}),(0,d.jsx)("option",{value:"epic",children:"Epic"}),(0,d.jsx)("option",{value:"legendary",children:"Legendary"})]}),((null==t?void 0:t.typeFilter)==="gear"&&!n||(null==t?void 0:t.isInventoryFilter))&&(0,d.jsxs)(d.Fragment,{children:[!(null==t?void 0:t.isInventoryFilter)&&(0,d.jsxs)(p.P,{width:"fit-content",value:null==t?void 0:t.classFilter,size:"sm",onChange:e=>o((0,s._)((0,a._)({},t),{classFilter:e.target.value,page:1})),style:(null==t?void 0:t.classFilter)?{color:c.yellow,backgroundColor:"#38332E"}:{color:c.beige,backgroundColor:"#38332E"},placeholder:"Class",icon:n?void 0:i,iconSize:n?"0px":"10px",_hover:{color:c.yellow},_focus:{outline:"none"},_focusVisible:{outline:"none"},children:[(0,d.jsx)("option",{value:"alchemist",children:"Alchemist"}),(0,d.jsx)("option",{value:"berserker",children:"Berserker"}),(0,d.jsx)("option",{value:"ranger",children:"Ranger"})]}),("Equippables"===r||(null==t?void 0:t.typeFilter)==="gear"&&!n)&&(0,d.jsxs)(p.P,{width:"fit-content",placeholder:"Slot",value:null==t?void 0:t.slotFilter,size:"sm",fontSize:"13px",onChange:e=>o((0,s._)((0,a._)({},t),{slotFilter:e.target.value,page:1})),style:(null==t?void 0:t.slotFilter)?{color:c.yellow,backgroundColor:"#38332E"}:{color:c.beige,backgroundColor:"#38332E"},icon:n?void 0:i,iconSize:n?"0px":"10px",_hover:{color:c.yellow},_focus:{outline:"none"},_focusVisible:{outline:"none"},children:[(0,d.jsx)("option",{value:"body",children:"Body"}),(0,d.jsx)("option",{value:"feet",children:"Feet"}),(0,d.jsx)("option",{value:"main hand",children:"Main Hand"}),(0,d.jsx)("option",{value:"off hand",children:"Off Hand"}),(0,d.jsx)("option",{value:"head",children:"Head"})]})]}),o&&"Fish"===r&&(0,d.jsxs)(p.P,{width:"fit-content",value:null==t?void 0:t.scaleFilter,size:"sm",onChange:e=>o((0,s._)((0,a._)({},t),{scaleFilter:e.target.value,page:1})),style:(null==t?void 0:t.scaleFilter)?{color:c.yellow,backgroundColor:"#38332E"}:{color:c.beige,backgroundColor:"#38332E"},placeholder:"Scale",icon:n?void 0:i,iconSize:n?"0px":"10px",_hover:{color:c.yellow},_focus:{outline:"none"},_focusVisible:{outline:"none"},children:[(0,d.jsx)("option",{value:"featherweight",children:"Featherweight"}),(0,d.jsx)("option",{value:"heavyweight",children:"Heavyweight"}),(0,d.jsx)("option",{value:"middling",children:"Middling"})]}),(0,d.jsx)(R.I,{hidden:n,width:"30%",size:"sm",placeholder:"Search...",value:null==t?void 0:t.eqNameFilter,onChange:e=>o((0,s._)((0,a._)({},t),{eqNameFilter:e.currentTarget.value,page:1})),className:F().tradeInput,style:(null==t?void 0:t.eqNameFilter)?{color:c.yellow,backgroundColor:"#0000"}:{color:c.beige,backgroundColor:"#0000"},_placeholder:(null==t?void 0:t.eqNameFilter)?{}:{color:c.brown,backgroundColor:"#0000"},_focus:{outline:"none"},_focusVisible:{outline:"none"}}),(0,d.jsx)(D.Z,{text:"Refresh",placement:"right",offset:[0,0],children:(0,d.jsx)(u.k,{ml:"auto",w:"30px",h:"30px",minW:"30px",borderRadius:"50%",bgColor:"#38332E",cursor:"pointer",alignItems:"center",justifyContent:"center",filter:"drop-shadow(2px 2px 0 ".concat(x,")"),onMouseEnter:()=>v(c.yellow),onMouseLeave:()=>v("black"),onClick:l&&l,children:(0,d.jsx)(h.M,{w:"16.5px",h:"19px",mb:"2.5px",children:(0,d.jsx)(z.BG,{fill:c.yellow})})})}),(0,d.jsx)(T.z,{hidden:n,h:"30px",size:"sm",variant:"solid",fontFamily:"Grenze",fontSize:"20px",fontWeight:"medium",color:"#FAC70C",width:"57px",sx:(null==t?void 0:t.rarityFilter)||(null==t?void 0:t.slotFilter)||(null==t?void 0:t.classFilter)||(null==t?void 0:t.eqNameFilter)||(null==t?void 0:t.mineFilter)||(null==t?void 0:t.scaleFilter)||(null==t?void 0:t.containFilter)||(null==t?void 0:t.soulOrResourceFilter)?{backgroundColor:c.red}:{backgroundColor:"#38332E"},filter:"drop-shadow(2px 2px 0 ".concat(m,")"),_focus:{outline:"none"},_hover:{backgroundColor:c.red},onMouseEnter:()=>f(c.yellow),onMouseLeave:()=>f("black"),onClick:()=>{o((0,s._)((0,a._)({},_),{page:1,rarityFilter:"",slotFilter:"",classFilter:"",eqNameFilter:"",mineFilter:"",scaleFilter:"",containFilter:"",soulOrResourceFilter:"",sortBy:"newest",statusFilter:""}))},children:"Clear"})]})}var B=o(5152),H=o.n(B),W=o(8186),O=o(73244),P=o(4296),U=o(89342),q=o(37945),G=o(84058),Z=o(18118),V=o(47854),Y=o(86286),$=o(36286),K=o(30317),J=o(54331
1),X=o(12596),Q=o(40916),ee=o(47313),et=o(33190);function eo(e){let{trade:t,slotSize:o,numberSlots:i,setForcedRefresh:l,newStyle:n}=e,r=(0,b.I0)(),{playSFX:a}=(0,et.Q)(),[s,c]=(0,w.useState)(!1),[u,p]=(0,w.useState)([]),x=i||8,h=(0,w.useRef)(),v=(0,b.v9)(e=>e.inventoryReducer.itemInHand),m=(0,b.v9)(e=>e.inventoryReducer.selectedForTrade);return(0,w.useEffect)(()=>()=>{r((0,V.Ku)())},[]),(0,w.useEffect)(()=>{h.current&&h.current.abort();let e=new AbortController;h.current=e},[v]),(0,w.useEffect)(()=>{var e,t,i,l,r,a,s,c,u,h;let v=[],f=0;if(null==m?void 0:m.soulNfts)for(let t=0;t<(null==m?void 0:null===(e=m.soulNfts)||void 0===e?void 0:e.length);t++){let e=null==m?void 0:m.soulNfts[t];v.push((0,d.jsx)(ee.H,{nft:e,slotSize:o,onSelect:V.Ns},"tradebox-"+f)),f+=1}if(null==m?void 0:m.nfts)for(let e=0;e<(null==m?void 0:null===(t=m.nfts)||void 0===t?void 0:t.length);e++){let t=null==m?void 0:m.nfts[e];v.push((0,d.jsx)(J.s,{asset:t,slotSize:o,newStyle:n,onSelect:V.Ns},"tradebox-"+f)),f+=1}if(null==m?void 0:m.resources)for(let e=0;e<(null==m?void 0:null===(i=m.resources)||void 0===i?void 0:i.length);e++){let t=null==m?void 0:m.resources[e];v.push((0,d.jsx)(Y.Z,{resource:t,size:o,newStyle:n,invertSelect:!0,onSelect:V.Ns},"tradebox-"+t.resourceId+f)),f+=1}if(null==m?void 0:m.unclaimedNfts)for(let e=0;e<(null==m?void 0:null===(l=m.unclaimedNfts)||void 0===l?void 0:l.length);e++){let t=null==m?void 0:m.unclaimedNfts[e];v.push((0,d.jsx)($.I,{reward:t,slotSize:o,multiSelect:!0,newStyle:n,onSelect:V.Ns},"tradebox-"+f)),f+=1}if(null==m?void 0:m.escrowedSoulNfts)for(let e=0;e<(null==m?void 0:null===(r=m.escrowedSoulNfts)||void 0===r?void 0:r.length);e++){let t=null==m?void 0:m.escrowedSoulNfts[e];v.push((0,d.jsx)(ee.H,{nft:t,slotSize:o,onSelect:V.Ns,isEscrowed:!0},"tradebox-"+f)),f+=1}if(null==m?void 0:m.escrowedNfts)for(let e=0;e<(null==m?void 0:null===(a=m.escrowedNfts)||void 0===a?void 0:a.length);e++){let t=null==m?void 0:m.escrowedNfts[e];v.push((0,d.jsx)(J.s,{asset:t,slotSize:o,newStyle:n,isEscrowed:!0,onSelect:V.Ns},"tradebox-"+f)),f+=1}if(null==m?void 0:m.escrowedResources)for(let e=0;e<(null==m?void 0:null===(s=m.escrowedResources)||void 0===s?void 0:s.length);e++){let t=null==m?void 0:m.escrowedResources[e];v.push((0,d.jsx)(Y.Z,{resource:t,size:o,newStyle:n,invertSelect:!0,isEscrowed:!0,onSelect:V.Ns},"tradebox-"+t.resourceId+f)),f+=1}if(null==m?void 0:m.escrowedUnclaimedNfts)for(let e=0;e<(null==m?void 0:null===(c=m.escrowedUnclaimedNfts)||void 0===c?void 0:c.length);e++){let t=null==m?void 0:m.escrowedUnclaimedNfts[e];v.push((0,d.jsx)($.I,{reward:t,slotSize:o,multiSelect:!0,newStyle:n,isEscrowed:!0,onSelect:V.Ns},"tradebox-"+f)),f+=1}if(null==m?void 0:m.escrowedErc20s)for(let e=0;e<(null==m?void 0:null===(u=m.escrowedErc20s)||void 0===u?void 0:u.length);e++){let t=null==m?void 0:m.escrowedErc20s[e];Number(t.amount)&&(v.push((0,d.jsx)(X.Z,{erc20:t,size:o,multiSelect:!1,newStyle:!0,isEscrowed:!0,onSelect:V.Ns},"market-inv-"+f)),f+=1)}(null==m?void 0:m.escrowedEther)&&(null==m?void 0:m.escrowedEther)>0&&(v.push((0,d.jsx)(Q.Z,{ether:null==m?void 0:m.escrowedEther,size:o,multiSelect:!1,newStyle:!0,isEscrowed:!0,onSelect:V.Ns},"market-inv-"+f)),f+=1),h=f<=x?x:f+1;let g=f;for(let e=0;e<h-g;e++)v.push((0,d.jsx)(K.Z,{asset:void 0,soulClass:"MULTI",slotSize:o,colorScheme:"dark"},"tradebox-"+f+e+"1"));p(v)},[m]),(0,d.jsx)(W.g,{spacing:1,justifyContent:"flex-start",px:"21px",children:(0,d.jsx)(Z.E,{maxH:"207px",className:F().modal,overflowY:"auto",overflowX:"hidden",paddingBottom:"5px",justifyContent:"space-between",align:"center",justify:"center",onClick:async e=>{v&&(a("sound.inventory.armor"),r((0,V.Vg)(v)),r((0,V.Ku)()))},children:u})})}var ei=o(96116),el=o(12572),en=o(60716),er=o(20837),ea=o(12979),es=o(15339),ed=o(65665),ec=o(35553),eu=o(4794),ep=o(27218),ex=o(42875),eh=o(70339),ev=o(85401);function em(e){var t,o,i,l,n,r,a,s,c,u,v,m,g,j;let{onClose:y,forcedRefresh:S,setForcedRefresh:I,tradeMessage:_,setTradeMessage:N,tradeTitle:E,setTradeTitle:A,tradeFee:T,setTradeFee:L,selectedTab:B,setSelectedTab:H}=e,{connectedWallet:Z}=(0,b.v9)(e=>e.web3Reducer),Y=null==Z?void 0:Z.address,$=(0,b.I0)(),[K,J]=(0,w.useState)("moonbeam"),[X,Q]=(0,w.useState)(""),[ee,et]=(0,w.useState)(""),[em,ef]=(0,w.useState)(!1),[eg,ew]=(0,w.useState)(""),[eb,ej]=(0,w.useState)(""),[eC,ey]=(0,w.useState)(""),[eS,ek]=(0,w.useState)("createTrade-"+E),eI=(0,b.v9)(e=>e.inventoryReducer.selectedForTrade),{socket:e_}=(0,ev.s)(),eN=(0,b.v9)(e=>e.web3Reducer.web3Provider),eE=(0,b.v9)(e=>e.web3Reducer.metatransactions.marketplace),eF=(0,b.v9)(e=>e.web3Reducer.metatransactions),eM=((null===(t=eI.soulNfts)||void 0===t?void 0:t.length)||0)>0||((null===(o=eI.escrowedSoulNfts)||void 0===o?void 0:o.length)||0)>0,eA=0==((null===(i=eI.nfts)||void 0===i?void 0:i.length)||0)&&0==((null===(l=eI.unclaimedNfts)||void 0===l?void 0:l.length)||0)&&0==((null===(n=eI.resources)||void 0===n?void 0:n.length)||0)&&0==((null===(r=eI.escrowedUnclaimedNfts)||void 0===r?void 0:r.length)||0)&&0==((null===(a=eI.escrowedNfts)||void 0===a?void 0:a.length)||0)&&0==((null===(s=eI.escrowedResources)||void 0===s?void 0:s.length)||0),eR=!eM&&eA,eT=eM&&!eA,ez=!E||""===E||eR||T>Number(eg)||eT;async function eD(){if(!Y||!E||""===E)return;$((0,es.h)({id:"create-market-trade-",text:"Trade Creation",icon:void 0})),ef(!0);let e=await (0,ed.V7)(eI,X,ee,K,E,null!=_?_:"",eN,Y,$,e_,eF,ek);e?($((0,es.h)({id:"create-market-trade-",text:"Success!",waitingTime:2500,icon:"CHECK"})),$((0,V.s9)()),N(""),A(""),$((0,ex.gS)(eS)),eH(e).then(e=>{console.log("Got new trade!",e),e&&$((0,C.J4)(e[0])),$((0,C.LF)({closeDetail:!1})),ef(!1)})):($((0,es.h)({id:"create-market-trade-",text:"Failed!",waitingTime:2500,icon:"FAIL"})),setTimeout(()=>{ef(!1)},5e3))}async function eL(){if("moonbeam"===K){if(eE){let e=await (0,eu.gh)(eN);ew(null!=e?e:"0")}else{let e;if(Y){let t=await (null==eN?void 0:eN.getBalance(Y));e=(e=ec.formatEther(null!=t?t:0)).slice(0,e.indexOf(".")+3)}ew(null!=e?e:"0")}}}async function eB(){if(eO){let e=(0,eu.Rj)(eN,(0,eu.iF)("PinkToken"));ej((Math.round(100*Number(await (0,eu.Oo)(e,null==eO?void 0:eO.decimals,eN)))/100).toString())}else ej("0")}async function eH(e){return Y?k(Y,e).then(e=>e):void 0}(0,w.useEffect)(()=>{(async function(){L(await (0,en.HT)(eI,X,ee,eN))})()},[eI]),(0,w.useEffect)(()=>{"moonbeam"===K?et(""):Q("")},[K]),(0,w.useEffect)(()=>{"moonbeam"===K?eL():eB()},[K]);
1let eW=(0,eu.K5)(),eO=eW.find(e=>e.id==K);return(0,d.jsx)(h.M,{w:"100%",h:"100%",px:"26px",py:"16px",minH:"360px",children:em?(0,d.jsx)(h.M,{w:"100%",h:"100%",children:(0,d.jsx)(ep.s,{groupId:eS})}):(0,d.jsxs)(M.U,{w:"100%",h:"100%",gap:"34px",alignItems:"flex-start",justifyContent:"center",spacing:0,children:[(0,d.jsx)(x.x,{minW:"380px",w:"60%",h:"100%",bg:"#0B0B0A",boxShadow:"0px 0px 10px black inset",borderRadius:"5px",border:"3px ".concat(eh.D.brown," solid"),py:"10px",children:(0,d.jsxs)(W.g,{w:"100%",h:"100%",gap:"20px",spacing:0,overflow:"hidden",children:[(0,d.jsx)(f.x,{color:eh.D.beige,fontSize:"30px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"30px",letterSpacing:.6,children:"Your Backpack"}),(0,d.jsx)(el.Z,{numSlots:24,slotSize:54,spacing:1,gridHeight:"270px",includeEquipped:!0,forcedRefresh:S,colorScheme:"dark",selectedTab:B,setSelectedTab:H,columns:5,lockTabs:(null!==(v=null==eI?void 0:null===(c=eI.soulNfts)||void 0===c?void 0:c.length)&&void 0!==v?v:0)>0||(null!==(m=null==eI?void 0:null===(u=eI.escrowedSoulNfts)||void 0===u?void 0:u.length)&&void 0!==m?m:0)>0,lockSoul:function(e){let{nfts:t,resources:o,unclaimedNfts:i,escrowedNfts:l,escrowedResources:n,escrowedUnclaimedNfts:r,escrowedErc20s:a}=e;return[t,o,i,l,n,r,a].some(e=>{var t;return(null!==(t=null==e?void 0:e.length)&&void 0!==t?t:0)>0})}(eI),showSoulTab:!0})]})}),(0,d.jsxs)(W.g,{minW:"345px",w:"40%",h:"100%",gap:"15px",spacing:0,children:[(0,d.jsx)(x.x,{w:"100%",h:"100%",bg:"#0B0B0A",boxShadow:"0px 0px 10px black inset",borderRadius:"5px",border:"3px ".concat(eh.D.brown," solid"),py:"10px",className:F().newmarket,children:(0,d.jsxs)(W.g,{w:"100%",h:"100%",gap:"16px",justifyContent:"space-between",spacing:0,children:[(0,d.jsx)(f.x,{color:eh.D.beige,fontSize:"30px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"25px",letterSpacing:.6,children:"Create a Trade"}),(0,d.jsx)(f.x,{color:"white",fontSize:"16px",fontFamily:"Grenze",fontWeight:"light",lineHeight:"16px",letterSpacing:.64,px:"33px",children:"Drag and drop from your backpack the items you wish to trade."}),(0,d.jsx)(eo,{trade:void 0,slotSize:54,numberSlots:8,setForcedRefresh:I,newStyle:!0}),(0,d.jsxs)(W.g,{w:"100%",px:"22.5px",gap:"7px",spacing:0,children:[(0,d.jsx)(D.Z,{text:"".concat(60-(null!==(g=null==E?void 0:E.length)&&void 0!==g?g:0)," characters left"),placement:"right",isOpen:"title"===eC&&""!==E,children:(0,d.jsx)(R.I,{size:"sm",variant:"outline",placeholder:"What are you searching for?",style:{color:"white",fontSize:"16px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"30px",letterSpacing:.32},fontSize:"16px",onChange:e=>A(e.currentTarget.value),value:E,borderColor:eR||E?eh.D.brown:eh.D.yellow+"33",borderRadius:"5px",borderWidth:"3px",maxLength:60,onFocus:e=>ey("title"),onBlur:e=>ey(""),_placeholder:{opacity:1,color:eh.D.brown},_hover:eR||E?{borderColor:eh.D.brown}:{borderColor:eh.D.yellow+"66"},_focus:{outline:"none"}})}),(0,d.jsx)(D.Z,{text:"".concat(136-(null!==(j=null==_?void 0:_.length)&&void 0!==j?j:0)," characters left"),placement:"right",isOpen:"message"===eC&&""!==_,children:(0,d.jsx)(O.g,{size:"sm",variant:"outline",resize:"none",placeholder:"Optional: Add detail on what you want...",style:{color:"white",fontSize:"16px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"15px",letterSpacing:.32},onChange:e=>N(e.currentTarget.value),maxLength:136,value:_,fontSize:"16px",borderColor:eh.D.brown,borderRadius:"5px",borderWidth:"3px",minHeight:"40px",h:"100%",onFocus:e=>ey("message"),onBlur:e=>ey(""),_placeholder:{opacity:1,color:eh.D.brown},_hover:{borderColor:eh.D.brown},_focus:{outline:"none"}})}),(0,d.jsxs)(W.g,{w:"100%",spacing:1,alignItems:"flex-start",children:[(0,d.jsx)(f.x,{color:"white",opacity:.5,fontSize:"14px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"18px",letterSpacing:.28,children:"Buy now price:"}),(0,d.jsxs)(M.U,{w:"100%",h:"100%",spacing:0,className:F().newTradesGridFilter,justifyContent:"center",gap:"15px",children:[(0,d.jsxs)(p.P,{width:"fit-content",maxW:"70px",value:K,size:"sm",onChange:e=>J(e.target.value),style:K?{color:eh.D.yellow}:{color:eh.D.beige,backgroundColor:"#0000"},icon:(0,d.jsx)(z.Xo,{fill:eh.D.beige}),iconSize:"10px",_hover:{color:eh.D.yellow},_focus:{outline:"none"},children:[(0,d.jsx)("option",{style:{backgroundColor:"#000d"},value:"moonbeam",children:"Moonbeam"}),eW.map(e=>(0,d.jsx)("option",{style:{backgroundColor:"#000d"},value:e.id,children:e.name},e.id)),(0,d.jsx)("option",{style:{backgroundColor:"#000d"},value:"bananas",disabled:!0,children:"More soon"})]}),(0,d.jsxs)(h.M,{w:"85%",gap:0,zIndex:0,pos:"relative",children:["moonbeam"===K&&(0,d.jsxs)(P.B,{w:"100%",m:0,zIndex:1,children:[(0,d.jsx)(U.Z,{pt:"1px",h:"100%",children:(0,d.jsx)(q.E,{src:null===er.Z||void 0===er.Z?void 0:er.Z.src,w:"20px",h:"20px",ms:"2px",me:"2px"}),me:"187px"}),(0,d.jsx)(G.Y2,{w:"100%",step:.1,defaultValue:0,precision:1,onChange:function(e){if(e.indexOf(".")!=e.lastIndexOf("."))return;if("."==e.at(e.length-1)){Q(e);return}let t=e.replace(/^\$/,"");(0,ea.hj)(t)&&Q(String(t))},value:X,max:9999999,min:0,size:"sm",style:X?{color:eh.D.yellow}:{color:eh.D.beige,backgroundColor:"#0000"},_focus:{outline:"none"},children:(0,d.jsx)(G.zu,{pl:"38px",pr:0,placeholder:"Optional: $GLMR (bal: ".concat(eg,")"),_placeholder:{opacity:1,color:eh.D.brown},_focus:{outline:"none"}})}),X&&(0,d.jsx)(U.x,{h:"100%",w:"100px",children:(0,d.jsxs)(f.x,{color:eh.D.yellow,fontSize:"14px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"15px",letterSpacing:.32,children:["$GLMR (bal: ",eg,")"]}),right:"10px"})]}),eO&&(0,d.jsxs)(P.B,{w:"100%",m:0,zIndex:1,children:[(0,d.jsx)(U.Z,{pt:"1px",h:"100%",children:(0,d.jsx)(q.E,{src:eO.image,w:"20px",h:"20px",ms:"2px",me:"2px"}),me:"187px"}),(0,d.jsx)(G.Y2,{w:"100%",step:.1,defaultValue:0,precision:1,onChange:function(e){if(e.indexOf(".")!=e.lastIndexOf("."))return;if("."==e.at(e.length-1)){et(e);return}let t=e.replace(/^\$/,"");(0,ea.hj)(t)&&et(String(t))},value:ee,max:9999999,min:0,size:"sm",style:ee?{color:eh.D.yellow}:{color:eh.D.beige,backgroundColor:"#0000"},_focus:{outline:"none"},children:(0,d.jsx)(G.zu,{pl:"38px",pr:0,placeholder:"Optional: ".concat(eO.symbol," (bal: ").concat(eb,")"),_placeholder:{opacity:1,color:eh.D.brown},_focus:{outline:"none"}})}),ee&&(0,d.jsx)(U.x,{h:"100%",w:"100px",children:(0,d.jsx)(f.x,{color:ee?eh.D.yellow:eh.D.brown,fontSize:"14px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"15px",letterSpacing:.32,children:"".concat(eO.symbol," (bal: ").concat(eb,")")}),right:"10px"})]})]})]})]})]}),(0,d.jsx)(f.x,{color:eh.D.yellow,fontSize:"14px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"18px",letterSpacing:.28,px:"33px",children:"Fee to post trade: ".concat(Math.round(1e3*T)/1e3," $GLMR")}),T>Number(eg)&&(0,d.jsx)(f.x,{color:"#b00b00",fontSize:"14px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"14px",letterSpacing:.28,px:"33px",children:"Insufficient balance"})]})}),(0,d.jsxs)(M.U,{w:"100%",gap:"20px",justifyContent:"center",spacing:0,children:[(0,d.jsx)(D.Z,{text:eT?"Please select a valid item to trade":"Please fill in a Title",placement:"bottom",shouldWrapChildren:!0,isOpen:!eR&&(!E||eT),children:(0,d.jsx)(ei.Z,{text:"Post Trade",disabled:ez,onClick:async()=>{eD()}})}),(0,d.jsx)(ei.Z,{text:"Cancel",color:eh.D.red,hoverColor:eh.D.yellow,onClick:y}
1)]})]})]})})}var ef=o(19807);let eg={brown:"#38332E",beige:"#E5C687",yellow:"#FAC70C",red:"#AF1817"};function ew(e){var t,o,i;let{trade:l,onClose:n,forcedRefresh:r,setForcedRefresh:a,selectedTab:s,setSelectedTab:c}=e,v=(0,b.I0)(),{connectedWallet:m}=(0,b.v9)(e=>e.web3Reducer),g=null==m?void 0:m.address,[j,y]=(0,w.useState)(void 0),[S,k]=(0,w.useState)(!1),[I,_]=(0,w.useState)([]),[N,E]=(0,w.useState)("moonbeam"),[A,R]=(0,w.useState)(""),[T,D]=(0,w.useState)(""),[L,B]=(0,w.useState)(""),[H,O]=(0,w.useState)(""),[Z,V]=(0,w.useState)(""),[Y,$]=(0,w.useState)(""),[K,J]=(0,w.useState)(!0),X=(0,b.v9)(e=>e.transactionsReducer.transactionGroups).find(e=>e.groupId==="create-market-bid-"+l.id),Q=(0,b.v9)(e=>e.inventoryReducer.selectedForTrade),et=(0,b.v9)(e=>e.web3Reducer.web3Provider),en=(0,b.v9)(e=>e.web3Reducer.metatransactions),{socket:ex}=(0,ev.s)();async function eh(){g&&(v((0,es.h)({id:"create-market-bid-"+l.id,text:"Creating bid!",icon:void 0,soulId:l.id})),k(!0),await (0,ed.R2)(l,Q,A,T,N,L,H,void 0,et,g,v,en,ex)?(v((0,es.h)({id:"create-market-bid-"+l.id,text:"Success!",waitingTime:2500,icon:"CHECK"})),R(""),D(""),setTimeout(()=>{v((0,C.LF)({closeDetail:!1})),v((0,C.J4)(l)),k(!1)},3e3)):(v((0,es.h)({id:"create-market-bid-"+l.id,text:"Failed!",waitingTime:2500,icon:"FAIL",soulId:l.id})),setTimeout(()=>{k(!1)},1500)))}async function em(){if(ej){let e=(0,eu.Rj)(et,ej.address);$((Math.round(100*Number(await (0,eu.Oo)(e,null==ej?void 0:ej.decimals,et)))/100).toString())}else $("0")}async function ew(){if("moonbeam"===N){let e;if(g){let t=await (null==et?void 0:et.getBalance(g));e=(e=ec.formatEther(null!=t?t:0)).slice(0,e.indexOf(".")+3)}V(null!=e?e:"0")}}(0,w.useEffect)(()=>{var e,t,o,i,l,n,r,a;J((null===(e=Q.nfts)||void 0===e?void 0:e.length)===0&&(null===(t=Q.unclaimedNfts)||void 0===t?void 0:t.length)===0&&(null===(o=Q.resources)||void 0===o?void 0:o.length)===0&&(null===(i=Q.soulNfts)||void 0===i?void 0:i.length)===0&&""==A&&""==T&&BigInt(Q.escrowedEther||0)==BigInt(0)&&(null===(l=Q.escrowedNfts)||void 0===l?void 0:l.length)===0&&(null===(n=Q.escrowedResources)||void 0===n?void 0:n.length)===0&&(null===(r=Q.escrowedNfts)||void 0===r?void 0:r.length)===0&&(null===(a=Q.escrowedErc20s)||void 0===a?void 0:a.length)===0)},[Q]),(0,w.useEffect)(()=>{var e,t,o,i,n,r;let a=[];null===(e=l.erc1155s)||void 0===e||e.forEach(e=>{e.retrievedMetadata&&a.push(e.retrievedMetadata)}),null===(t=l.erc721s)||void 0===t||t.forEach(e=>{e.retrievedMetadata&&a.push(e.retrievedMetadata)}),null===(o=l.unclaimedNfts)||void 0===o||o.forEach(e=>{e.retrievedMetadata&&a.push(e.retrievedMetadata)}),null===(i=l.unclaimedResources)||void 0===i||i.forEach(e=>{e.retrievedMetadata&&a.push(e.retrievedMetadata)}),null===(n=l.composedNfts)||void 0===n||n.forEach(e=>{e.retrievedMetadata&&a.push(e)}),_(a),(null==l?void 0:l.composedNfts)&&(null==l?void 0:null===(r=l.composedNfts)||void 0===r?void 0:r.length)>0&&y(l.composedNfts[0])},[l]),(0,w.useEffect)(()=>{"moonbeam"===N?D(""):R("")},[N]),(0,w.useEffect)(()=>{"moonbeam"===N?ew():em()},[N]);let eb=(0,eu.K5)(),ej=eb.find(e=>e.id==N);return(0,d.jsx)(h.M,{w:"100%",h:"100%",px:"26px",py:"12px",minH:"360px",children:S?(0,d.jsx)(h.M,{w:"100%",h:"100%",children:X&&(0,d.jsx)(ep.s,{groupId:X.groupId})}):(0,d.jsxs)(M.U,{w:"100%",h:"100%",gap:"34px",alignItems:"flex-start",justifyContent:"center",spacing:0,children:[(0,d.jsx)(x.x,{minW:"380px",w:"60%",h:"100%",bg:"#0B0B0A",boxShadow:"0px 0px 10px black inset",borderRadius:"5px",border:"3px #38332E solid",py:"10px",children:(0,d.jsxs)(W.g,{w:"100%",h:"100%",gap:"20px",spacing:0,overflow:"hidden",children:[(0,d.jsx)(f.x,{color:"#E5C687",fontSize:"30px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"25px",letterSpacing:.6,children:"Your Backpack"}),(0,d.jsx)(el.Z,{numSlots:24,slotSize:54,spacing:1,gridHeight:"270px",includeEquipped:!0,forcedRefresh:r,colorScheme:"dark",selectedTab:s,setSelectedTab:c,columns:5,showEscrowedTokens:!0,showSoulTab:!0})]})}),(0,d.jsxs)(W.g,{w:"45%",minW:"345px",h:"100%",gap:"15px",spacing:0,children:[(0,d.jsx)(x.x,{h:"100%",bg:"#0B0B0A",boxShadow:"0px 0px 10px black inset",borderRadius:"5px",border:"3px #38332E solid",py:"10px",overflowY:"auto",className:F().newmarket,children:(0,d.jsxs)(W.g,{w:"100%",h:"100%",gap:"15p
1x",justifyContent:"flex-start",spacing:0,children:[(0,d.jsx)(f.x,{color:"#E5C687",fontSize:"30px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"25px",letterSpacing:.6,children:"Proposed Trade"}),j?(0,d.jsx)(ee.H,{slotSize:64,nft:j,soulClass:"".concat(null==j?void 0:null===(i=j.retrievedMetadata)||void 0===i?void 0:null===(o=i.properties)||void 0===o?void 0:null===(t=o["Soul Class"])||void 0===t?void 0:t.value)}):(0,d.jsx)(u.k,{flexDirection:"column",justifyContent:"center",alignItems:"center",pt:"5px",children:(()=>{let e=I.slice(0),t=[];for(let o=0;o<e.length;o+=4){let i=e.slice(o,o+4).map((e,t)=>"parts"in e?(0,d.jsx)(x.x,{m:"-5.5px",_hover:{cursor:"pointer"},children:(0,d.jsx)(ee.H,{nft:e,slotSize:19})},t):(0,d.jsx)(x.x,{m:"-5.5px",_hover:{cursor:"pointer"},children:(0,d.jsx)(ef.Z,{metadata:e,index:o,isBig:!0})},t));t.push((0,d.jsx)(x.x,{justifyContent:"center",alignItems:"flex-start",display:"inline-flex",children:i},o))}return t})()}),(0,d.jsx)(f.x,{color:"#E5C687",fontSize:"30px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"30px",letterSpacing:.6,children:"Place a Bid"}),(0,d.jsx)(f.x,{color:"white",fontSize:"16px",fontFamily:"Grenze",fontWeight:"light",lineHeight:"16px",letterSpacing:.64,px:"20px",children:"Drag and drop from your backpack the items you wish to bid for this trade."}),(0,d.jsx)(eo,{slotSize:54,numberSlots:8,trade:l,setForcedRefresh:a,newStyle:!0}),("moonbeam"===N&&Number(A)>Number(Z)||ej&&Number(T)<Number(Y))&&(0,d.jsx)(f.x,{color:"#b00b00",fontSize:"14px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"14px",letterSpacing:.28,px:"33px",top:49,pos:"relative",children:"Insufficient balance"}),(0,d.jsxs)(W.g,{w:"100%",h:"100%",spacing:1,alignItems:"flex-start",px:"22.5px",justifyContent:"flex-end",children:[(0,d.jsx)(f.x,{color:"white",opacity:.5,fontSize:"14px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"18px",letterSpacing:.28,children:"Buy now price:"}),(0,d.jsxs)(M.U,{w:"100%",spacing:0,className:F().newTradesGridFilter,gap:"11px",children:[(0,d.jsxs)(p.P,{width:"30%",maxW:"120px",value:N,size:"sm",onChange:e=>E(e.target.value),style:N?{color:eg.yellow}:{color:eg.beige,backgroundColor:"#0000"},icon:(0,d.jsx)(z.Xo,{fill:eg.brown}),iconSize:"10px",_hover:{color:eg.yellow},_focus:{outline:"none"},children:[(0,d.jsx)("option",{style:{backgroundColor:"#000d"},value:"moonbeam",children:"Moonbeam"}),eb.map(e=>(0,d.jsx)("option",{style:{backgroundColor:"#000d"},value:e.id,children:e.name},e.id)),(0,d.jsx)("option",{style:{backgroundColor:"#000d"},value:"bananas",disabled:!0,children:"More soon"})]}),(0,d.jsxs)(h.M,{w:"70%",gap:0,zIndex:0,pos:"relative",children:["moonbeam"===N&&(0,d.jsx)(h.M,{w:"100%",flexDir:"column",pos:"relative",children:(0,d.jsxs)(P.B,{w:"100%",m:0,zIndex:1,children:[(0,d.jsx)(U.Z,{pt:"1px",h:"100%",children:(0,d.jsx)(q.E,{src:null===er.Z||void 0===er.Z?void 0:er.Z.src,w:"20px",h:"20px",ms:"2px",me:"2px"}),pointerEvents:"none"}),(0,d.jsx)(G.Y2,{w:"100%",step:.1,defaultValue:0,precision:1,onChange:function(e){if(e.indexOf(".")!=e.lastIndexOf("."))return;if("."==e.at(e.length-1)){R(e);return}let t=e.replace(/^\$/,"");(0,ea.hj)(t)&&R(String(t))},value:A,max:9999999,min:0,size:"sm",style:A?{color:eg.yellow}:{color:eg.beige,backgroundColor:"#0000"},_focus:{outline:"none"},children:(0,d.jsx)(G.zu,{pl:"38px",pr:0,placeholder:"Optional: $GLMR (bal: ".concat(Z,")"),_placeholder:{opacity:1,color:"#38332E"},_focus:{outline:"none"}})}),A&&(0,d.jsx)(U.x,{h:"100%",w:"100px",children:(0,d.jsxs)(f.x,{color:eg.yellow,fontSize:"14px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"15px",letterSpacing:.32,children:["$GLMR (bal: ",Z,")"]}),right:"10px"})]})}),ej&&(0,d.jsx)(h.M,{w:"100%",flexDir:"column",pos:"relative",children:(0,d.jsxs)(P.B,{w:"100%",m:0,zIndex:1,children:[(0,d.jsx)(U.Z,{pt:"1px",h:"100%",children:(0,d.jsx)(q.E,{src:ej.image,w:"20px",h:"20px",ms:"2px",me:"2px"}),me:"187px"}),(0,d.jsx)(G.Y2,{w:"100%",defaultValue:0,precision:2,onChange:function(e){if(e.indexOf(".")!=e.lastIndexOf("."))return;if("."==e.at(e.length-1)){D(e);return}let t=e.replace(/^\$/,"");(0,ea.hj)(t)&&D(String(t))}
1,value:T,max:Number(Y),min:0,step:.05,size:"sm",style:T?{color:eg.yellow}:{color:eg.beige,backgroundColor:"#0000"},_focus:{outline:"none"},children:(0,d.jsx)(G.zu,{pl:"38px",pr:0,placeholder:"Optional: ".concat(ej.symbol," (bal: ").concat(Y,")"),_placeholder:{opacity:1,color:"#38332E"},_focus:{outline:"none"}})}),T&&(0,d.jsx)(U.x,{h:"100%",w:"100px",children:(0,d.jsx)(f.x,{color:T?eg.yellow:eg.brown,fontSize:"14px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"15px",letterSpacing:.32,children:"".concat(ej.symbol," (bal: ").concat(Y,")")}),right:"10px"})]})})]})]})]})]})}),(0,d.jsxs)(M.U,{w:"100%",gap:"20px",justifyContent:"center",spacing:0,children:[(0,d.jsx)(ei.Z,{text:"Place Bid",disabled:K,onClick:eh}),(0,d.jsx)(ei.Z,{text:"Cancel",color:eg.red,hoverColor:eg.yellow,onClick:n})]})]})]})})}var eb=o(71073);let ej={brown:"#38332E",yellow:"#FAC70C",red:"#AF1817"},eC=["Notifications","Activity","Voided"];function ey(e){let{myTabIndex:t,selectedTabIndex:o,account:i,setSelectedTabIndex:l,setInProgress:n}=e,r=(0,b.I0)(),[a,s]=(0,w.useState)(0),[c,u]=(0,w.useState)("hidden"),[p,v]=(0,w.useState)("Notifications"),[m,g]=(0,w.useState)([]),[j,y]=(0,w.useState)([]),[S,k]=(0,w.useState)([]),I=(0,b.v9)(e=>e.marketplaceReducer.tradeNotifications),{socket:_}=(0,ev.s)(),N=e=>{var t,o,i;return"tradeAcceptedBid"==e.reason&&0===e.trade.acceptedBid.erc721s.length&&0===e.trade.acceptedBid.erc1155s.length&&("0"!==e.trade.buyOutEther.toString()&&e.trade.buyOutEther==e.trade.acceptedBid.offeredEther||(null===(t=e.trade.buyOutErc20)||void 0===t?void 0:t.amount.toString())!=="0"&&(null===(o=e.trade.buyOutErc20)||void 0===o?void 0:o.amount)==(null===(i=e.trade.acceptedBid.offeredErc20)||void 0===i?void 0:i.amount))};function E(e){m.push(e),g(m);let t=null==I?void 0:I.filter(t=>{var o,i,l,n;return(null===(o=t.trade)||void 0===o?void 0:o.id)+(null===(i=t.bid)||void 0===i?void 0:i.id)!==(null===(l=e.trade)||void 0===l?void 0:l.id)+(null===(n=e.bid)||void 0===n?void 0:n.id)});r((0,C.SS)(t||[]))}(0,w.useEffect)(()=>{y((null==I?void 0:I.filter(e=>"tradeNewBid"===e.reason||"bidAccepted"===e.reason||"bidRejected"===e.reason||N(e))).sort((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime())),k((null==I?void 0:I.filter(e=>"bidVoid"===e.reason||"tradeVoid"===e.reason)).sort((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime()))},[I]),(0,w.useEffect)(()=>{if(_)return R(),()=>{null==_||_.emit("unsubscribeFromMarketNotifications")}},[_]),(0,w.useEffect)(()=>{o===t?(s(320),setTimeout(()=>{u("visible")},150)):(s(0),setTimeout(()=>{u("hidden"),v("Notifications"),function(){if(m.length){console.log("clearSelectedNotifications",m);let e=function(e,t){if(e)return t.map(t=>{var o;return{playerAddress:e,id:t.id,tradeAcceptedBid:"tradeAcceptedBid"==t.reason||void 0,tradeBids:"tradeNewBid"==t.reason?[null===(o=t.bid)||void 0===o?void 0:o.id]:void 0,tradeCancelled:"tradeCancelled"==t.reason||void 0,bidAccepted:"bidAccepted"==t.reason||void 0,bidRejected:"bidRejected"==t.reason||void 0,bidWithdrawn:"bidWithdrawn"==t.reason||void 0,bidNew:"bidNew"==t.reason||void 0,tradeNew:"tradeNew"==t.reason||void 0}})}(i,m);null==_||_.emit("clearNotifications",e,e=>{try{e&&(console.log("clearNotifications",e),g([]))}catch(e){console.error("Error in clearSelectedNotifications",e)}})}}()},150))},[o]);let A=(0,w.useRef)(!1);async function R(){!A.current&&(null==_?void 0:_.connected)&&(A.current=!0,_.emit("subscribeToMarketNotifications",e=>{try{console.log("Subscribed To Market Notifications",e),e&&r((0,C.SS)(e.sort((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime())))}catch(e){console.error("Error in subscribeNotifications",e)}}),null!=_&&_.hasListeners("marketNotification")||_.on("marketNotification",e=>{console.log("Received new Market Notification",e),e&&r((0,C.SS)(e.sort((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime())))}))}return(0,d.jsx)(x.x,{zIndex:100,color:"white",position:"absolute",top:"83px",left:"10px",width:a+"px",height:"inherit",maxH:"min(85%, 500px)",backgroundImage:"url(/assets/newmodal/Notification-Bg.svg)",backgroundRepeat:"no-repeat",backgroundSize:"100% 100%",backgroundPosition:"center",transition:"width 0.3s",children:(0,d.jsxs)(W.g,{h:"100%",opacity:a,transition:"opacity 0.1s ease-out",spacing:0,gap:"28px",px:"15px",py:"16px",children:[(0,d.jsx)(M.U,{w:"100%",spacing:0,gap:"20px",justifyContent:"center",visibility:c,children:eC.map(e=>(0,d.jsx)(h.M,{w:"125px",h:"27px",borderRadius:"5px",borderColor:ej.brown,borderWidth:"2px",bg:"#090908",boxShadow:"4px 4px 0px ".concat(p===e?ej.yellow:"black"),onClick:()=>v(e),cursor:"pointer",pos:"relative",_hover:{borderColor:ej.yellow},children:(0,d.jsx)(f.x,{color:p===e?ej.yellow:"white",fontSize:"16px",fontFamily:"Grenze",fontWeight:"light",lineHeight:"16px",letterSpacing:.64,px:"8px",py:"7px",children:e})},e))}),(0,d.jsx)(W.g,{w:"100%",spacing:0,gap:"20px",overflowY:"scroll",visibility:c,className:F().notificationsScroller,children:p===eC[0]?j&&j.length>0?null==j?void 0:j.map((e,t)=>(0,d.jsx)(x.x,{w:"100%",children:e&&(0,d.jsx)(eS,{type:"notification",notification:e,setSelectedTabIndex:l,addToClearedNotifications:E,setInProgress:n,account:i,notificationSoldViaBuyout:N})},e.id+"-"+t)):(0,d.jsx)(f.x,{color:ej.brown,fontSize:"16px",fontFamily:"Grenze",fontWeight:"normal",lineHeight:"14px",letterSpacing:.32,children:"You have no notifications."}):p===eC[1]?I&&I.length>0?null==I?void 0:I.map((e,t)=>(0,d.jsx)(x.x,{w:"100%",children:e&&(0,d.jsx)(eS,{type:"activity",notification:e,setSelectedTabIndex:l,setInProgress:n,account:i,notificationSoldViaBuyout:N})},e.id+"-"+t)):(0,d.jsx)(f.x,{color:ej.brown,fontSize:"16px",fontFamily:"Grenze",fontWeight:"normal",lineHeight:"14px",letterSpacing:.32,children:"You have no activity."}):p===eC[2]&&S&&S.length>0?null==S?void 0:S.map((e,t)=>(0,d.jsx)(x.x,{w:"100%",children:e&&(0,d.jsx)(eS,{type:"activity",notification:e,setSelectedTabIndex:l,setInProgress:n,account:i,notificationSoldViaBuyout:N})},e.id+"-"+t)):(0,d.jsx)(f.x,{color:ej.brown,fontSize:"16px",fontFamily:"Grenze",fontWeight:"normal",lineHeight:"14px",letterSpacing:.32,children:"You have no voided trades or bids."})})]})})}function eS(e){var t;let{type:o,notification:i,addToClearedNotifications:l,setSelectedTabIndex:n,setInProgress:r,account:s,notificationSoldViaBuyout:c}=e,p=(0,b.I0)(),{socket:x}=(0,ev.s)(),v={bidAccepted:(0,d.jsx)(z.yr,{fill:"#11A74D"}),bidRejected:(0,d.jsx)(z.Xk,{fill:"#AF1817"}),bidWithdrawn:(0,d.jsx)(z.Xk,{fill:"#FAC70C"}),bidNew:(0,d.jsx)(z.ve,{fill:"#FAC70C"}),tradeNewBid:(0,d.jsx)(z.ve,{fill:"#FAC70C"}),tradeNew:(0,d.jsx)(z.ve,{fill:"#FAC70C"}),tradeAcceptedBid:c(i)?(0,d.jsx)(z.AM,{fill:"#11A74D"}):(0,d.jsx)(z.ab,{fill:"#FAC70C"}),tradeCancelled:(0,d.jsx)(z.Xk,{fill:"#FAC70C"})},[m,g]=(0,w.useState)(ej.red),j=(0,b.v9)(e=>e.marketplaceReducer.trades);async function y(e){let t=j.find(t=>{var o;return t.id===(null===(o=e.trade)||void 0===o?void 0:o.id)});if(!t){var o;t=await N(x,null===(o=e.trade)||void 0===o?void 0:o.id)}let i=(0,a._)({},e.trade);console.log(e),(null==e?void 0:e.reason)=="tradeAccepted"?e.bid&&(i.acceptedBid=e.bid,i.bids=[e.bid]):(null==e?void 0:e.reason)=="tradeAcceptedBid"?e.trade.acceptedBid&&e.bid&&(i.acceptedBid=e.bid,i.bids=[e.bid]):(null==e?void 0:e.reason)=="bidAccepted"?e.bid&&(i.acceptedBid=e.bid,i.bids=[e.bid]):(null==e?void 0:e.reason)=="bidNew"||null==e||e.reason,console.log("setShownTrade",i),p((0,C.J4)(null!=t?t:i)),n(null)}return i?(0,d.jsxs)(W.g,{spacing:0,alignItems:"flex-start",children:[(e=>{let t=i.date;if(!t)return(0,d.jsx)(d.Fragment,{});{let e=(0,eb.Jn)(t);if(e)return(0,d.jsx)(f.x,{color:"white",fontSize:"12px",fontFamily:"Grenze",fontStyle:"italic",fontWeight:"light",lineHeight:"4",letterSpacing:.24,children:e})}})(i.reason),(0,d.jsxs)(M.U,{w:"100%",spacing:0,justifyContent:"space-between",alignItems:"center",children:[(0,d.jsxs)(u.k,{justifyContent:"center",alignItems:"center",gap:"8px",children:[null!==(t=v[i.reason])&&void 0!==t?t:(0,d.jsx)(d.Fragment,{}),(0,d.jsx)(f.x,{color:"#E5C687",fontSize:"16px",fontFamily:"Grenze",fontWeight:"normal",letterSpacing:.32,children:"bidAccepted"==i.reason?"Your bid was accepted.":"bidRejected"==i.reason?"Your bid was rejected.":"bidClosed"==i.reason?"You cancelled your bid.":"bidWithdrawn"==i.reason?"You withdrew your bid.":c(i)?"Your trade sold via buyout.":"tradeAcceptedBid"==i.reason?"You accepted a bid.":"tradeClosed"==i.reason?"You cancelled your trade.":"tradeNewBid"==i.reason?"Someone bid on your trade.":"tradeCancelled"==i.reason?"You cancelled your trade.":"tradeNew"==i.reason?"You opened a new trade.":"bidNew"==i.reason?"You bid on a trade.":"tradeVoid"==i.reason?"You voided your trade by withdrawing an item.":"bidVoid"==i.reason?"A bid of yours was voided and must be cancelled.":"Unknown"})]}),(0,d.jsxs)(u.k,{justifyContent:"flex-start",alignItems:"center",gap:"8px",children:[(0,d.jsx)(ei.Z,{style:{height:"15px"},onClick:()=>y(i),children:(0,d.jsx)(f.x,{fontSize:"15px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"15px",letterSpacing:.3,px:"6px",py:"3px",children:"View"})}
1),"notification"===o&&(0,d.jsx)(D.Z,{text:"Dismiss Notification",placement:"right",children:(0,d.jsx)(h.M,{width:"21px",height:"21px",filter:"drop-shadow(2px 2px 0 black)",bgColor:"#38332E",p:"3px",borderRadius:"5px",_hover:{cursor:"pointer"},onMouseEnter:()=>g(ej.yellow),onMouseLeave:()=>g(ej.red),onClick:()=>{l&&l(i)},children:(0,d.jsx)(z.Xk,{fill:m})})})]})]})]}):(0,d.jsx)(d.Fragment,{})}var ek=o(16610),eI=o(2593);let e_=(0,w.forwardRef)((e,t)=>{var o,i,l,n,r,a,s,c,p,v,m,g,j,y,S;let{trade:k,account:I,setSelectedTabIndex:_}=e,N=(0,b.I0)(),[E,F]=(0,w.useState)(!1),[M,A]=(0,w.useState)([]),[R,T]=(0,w.useState)([]),[D,L]=(0,w.useState)(void 0),B=ec.formatUnits(eI.O$.from(k.buyOutEther),18),{tokenAmount:H,tokenSymbol:O,image:P}=(0,ea.dp)(k.buyOutErc20),{tokenAmount:U,tokenSymbol:G,image:Z}=(0,ea.dp)(null===(o=k.acceptedBid)||void 0===o?void 0:o.offeredErc20);(0,w.useEffect)(()=>{var e,t,o,i,l;let n=[];null===(e=k.erc1155s)||void 0===e||e.forEach(e=>{if(null==e?void 0:e.retrievedMetadata){var t;e.retrievedMetadata.amount=null!==(t=e.amount)&&void 0!==t?t:1,n.push(e.retrievedMetadata)}}),null===(t=k.erc721s)||void 0===t||t.forEach(e=>{if(null==e?void 0:e.retrievedMetadata){var t;e.retrievedMetadata.amount=null!==(t=e.amount)&&void 0!==t?t:1,n.push(e.retrievedMetadata)}}),null===(o=k.unclaimedNfts)||void 0===o||o.forEach(e=>{if(e.retrievedMetadata){var t;e.retrievedMetadata.unclaimed=!0,e.retrievedMetadata.amount=null!==(t=e.amount)&&void 0!==t?t:1,n.push(e.retrievedMetadata)}}),null===(i=k.unclaimedResources)||void 0===i||i.forEach(e=>{if(e.retrievedMetadata){var t;e.retrievedMetadata.unclaimed=!0,e.retrievedMetadata.amount=null!==(t=e.amount)&&void 0!==t?t:1,n.push(e.retrievedMetadata)}}),A(n),k.acceptedBid&&function(){var e,t,o,i,l;let n=null!==(l=k.bids.find(e=>e.id===k.acceptedBid.id))&&void 0!==l?l:k.acceptedBid,r=[];null===(e=n.erc1155s)||void 0===e||e.forEach(e=>{if(null==e?void 0:e.retrievedMetadata){var t;e.retrievedMetadata.amount=null!==(t=e.amount)&&void 0!==t?t:1,r.push(e.retrievedMetadata)}}),null===(t=n.erc721s)||void 0===t||t.forEach(e=>{if(null==e?void 0:e.retrievedMetadata){var t;e.retrievedMetadata.amount=null!==(t=e.amount)&&void 0!==t?t:1,r.push(e.retrievedMetadata)}}),null===(o=n.unclaimedNfts)||void 0===o||o.forEach(e=>{if(e.retrievedMetadata){var t;e.retrievedMetadata.unclaimed=!0,e.retrievedMetadata.amount=null!==(t=e.amount)&&void 0!==t?t:1,r.push(e.retrievedMetadata)}}),null===(i=n.unclaimedResources)||void 0===i||i.forEach(e=>{if(e.retrievedMetadata){var t;e.retrievedMetadata.unclaimed=!0,e.retrievedMetadata.amount=null!==(t=e.amount)&&void 0!==t?t:1,r.push(e.retrievedMetadata)}}),T(r)}(),I&&k.ownerAddress.toLowerCase()===(null==I?void 0:I.toLowerCase())?F(!0):F(!1),(null==k?void 0:k.composedNfts)&&(null==k?void 0:null===(l=k.composedNfts)||void 0===l?void 0:l.length)>0&&L(k.composedNfts[0])},[k]);let V=e=>!e.active&&e.acceptedBid?{text:"Sold",color:"#11A74D",icon:(0,d.jsx)(z.yr,{fill:"#11A74D"})}:e.active?{text:"Active",color:"#FAC70C",icon:(0,d.jsx)(z.k8,{fill:"#FAC70C"})}:{text:"Cancelled",color:"#AF1817",icon:(0,d.jsx)(z.Xk,{fill:"#AF1817"})};return(0,d.jsxs)(W.g,{w:"full",alignItems:"flex-start",spacing:0,ref:t,scrollMarginTop:"15px",children:[(0,d.jsx)(f.x,{color:"white",fontSize:"14px",fontFamily:"Grenze",fontStyle:"italic",fontWeight:"300",lineHeight:"18px",letterSpacing:.28,children:k.startTime&&(0,eb.Jn)(k.startTime)}),(0,d.jsxs)(ek.r,{w:"100%",h:"50px",background:"#0B0B0A",boxShadow:"0px 0px 10px black inset",borderRadius:"5px",border:"3px #38332E solid",filter:"drop-shadow(4px 4px 0 ".concat(E?"#AF1817":"black",")"),templateColumns:"104px 204px 50px auto 60px",gap:"26px",alignItems:"center",py:"3px",px:"9px",children:[(0,d.jsxs)(u.k,{justifySelf:"flex-start",gap:"5px",alignItems:"center",children:[V(k).icon,(0,d.jsx)(f.x,{color:V(k).color,fontSize:"14px",fontFamily:"Grenze",fontWeight:"normal",lineHeight:"18px",letterSpacing:"0.02em",children:V(k).text})]}),D?(0,d.jsx)(x.x,{transform:"translateX(-6px)",children:(0,d.jsx)(ee.H,{slotSize:35,nft:D,soulClass:"".concat(null==D?void 0:null===(n=D.retrievedMetadata)||void 0===n?void 0:null===(l=n.properties)||void 0===l?void 0:null===(i=l["Soul Class"])||void 0===i?void 0:i.value)})}):(0,d.jsx)(u.k,{children:M.map((e,t)=>(0,d.jsx)(x.x,{m:"-5.5px",_hover:{cursor:"pointer"},my:"3px",children:(0,d.jsx)(ef.Z,{metadata:e,index:t})},(null==e?void 0:e.id)+"_"+t))}),R.length>0||!k.active&&k.acceptedBid&&((null===(a=k.acceptedBid)||void 0===a?void 0:null===(r=a.offeredEther)||void 0===r?void 0:r.toString())!="0"||(null===(p=k.acceptedBid)||void 0===p?void 0:null===(c=p.offeredErc20)||void 0===c?void 0:null===(s=c.amount)||void 0===s?void 0:s.toString())!="0")?(0,d.jsx)(h.M,{w:"100%",h:"100%",children:(0,d.jsx)(q.E,{src:"./assets/icons/tradingIcon.svg"})}):(0,d.jsx)(f.x,{}),!k.active&&k.acceptedBid?(0,d.jsxs)(u.k,{alignItems:"center",gap:"10px",children:[R.length>0&&(0,d.jsx)(u.k,{children:R.map((e,t)=>(0,d.jsx)(x.x,{m:"-5.5px",_hover:{cursor:"pointer"},my:"3px",children:(0,d.jsx)(ef.Z,{metadata:e,index:t})},(null==e?void 0:e.id)+"_"+t))}),(0,d.jsx)(f.x,{color:"#FAC70C",fontSize:"14px",fontFamily:"Grenze",fontWeight:"normal",lineHeight:"18px",letterSpacing:"0.02em",textAlign:"left",children:(null===(v=k.acceptedBid.offeredEther)||void 0===v?void 0:v.toString())!="0"?"".concat(R.length>0?"+ ":""," ").concat(ec.formatUnits(eI.O$.from(k.acceptedBid.offeredEther),18)," $GLMR"):(null===(g=k.acceptedBid.offeredErc20)||void 0===g?void 0:null===(m=g.amount)||void 0===m?void 0:m.toString())!="0"?"".concat(U," ").concat(G):""})]}):B&&(null==k?void 0:null===(j=k.buyOutEther)||void 0===j?void 0:j.toString())!="0"?(0,d.jsxs)(f.x,{color:"#FAC70C",fontSize:"14px",fontFamily:"Grenze",fontWeight:"normal",lineHeight:"18px",letterSpacing:"0.02em",textAlign:"left",children:["Direct buyout: ",B," $GLMR"]}):"0"!=H&&(null==k?void 0:null===(S=k.buyOutErc20)||void 0===S?void 0:null===(y=S.amount)||void 0===y?void 0:y.toString())!="0"?(0,d.jsxs)(f.x,{color:"#FAC70C",fontSize:"14px",fontFamily:"Grenze",fontWeight:"normal",lineHeight:"18px",letterSpacing:"0.02em",textAlign:"left",children:["Direct buyout: ","".concat(H," ").concat(O)]}):(0,d.jsx)(f.x,{}),(0,d.jsx)(ei.Z,{style:{height:"15px"},onClick:function(){N((0,C.J4)(k)),setTimeout(()=>{_(null)},300)},children:(0,d.jsx)(f.x,{fontSize:"15px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"15px",letterSpacing:.3,px:"6px",py:"3px",children:"View"})})]})]})});function eN(e){var t,o,i;let{item:l}=e;return(0,d.jsxs)(ek.r,{w:"100%",h:"50px",background:"#0B0B0A",boxShadow:"0px 0px 10px black inset",borderRadius:"5px",border:"3px #38332E solid",filter:"drop-shadow(4px 4px 0 black)",templateColumns:"60% 40%",alignItems:"center",py:"3px",px:"9px",children:[(0,d.jsxs)(u.k,{alignItems:"center",children:[(0,d.jsx)(x.x,{m:"-5.5px",_hover:{cursor:"pointer"},my:"3px",children:(0,d.jsx)(ef.Z,{metadata:null==l?void 0:l.retrievedMetadata,index:0})},null==l?void 0:null===(t=l.retrievedMetadata)||void 0===t?void 0:t.id),(0,d.jsx)(f.x,{color:"white",fontSize:"18px",fontFamily:"Grenze",fontWeight:"normal",lineHeight:"18px",letterSpacing:"0.02em",textAlign:"left",ml:"15px",children:null!==(i=null===(o=l.retrievedMetadata)||void 0===o?void 0:o.name)&&void 0!==i?i:l.name})]}),(0,d.jsx)(f.x,{color:"#FAC70C",fontSize:"14px",fontFamily:"Grenze",fontWeight:"normal",lineHeight:"18px",letterSpacing:"0.02em",textAlign:"right",children:l.amount})]})}var eE=o(12553);let eF=(0,d.jsx)(eE.J,{width:"9px",height:"9px",viewBox:"0 0 9 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",mr:"5px",children:(0,d.jsx)("path",{d:"M8.10557 4.05279C8.4741 4.23705 8.4741 4.76295 8.10557 4.94721L0.723606 8.6382C0.391156 8.80442 -3.74286e-07 8.56267 -3.58039e-07 8.19098L-3.53633e-08 0.809017C-1.91161e-08 0.437326 0.391156 0.195
1578 0.723607 0.361803L8.10557 4.05279Z",fill:"#38332E"})}),eM=(0,d.jsx)(eE.J,{width:"9px",height:"9px",viewBox:"0 0 9 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",mr:"5px",children:(0,d.jsx)("path",{d:"M4.05279 0.894426C4.23705 0.525902 4.76295 0.525903 4.94721 0.894427L8.6382 8.27639C8.80442 8.60884 8.56267 9 8.19098 9H0.809017C0.437326 9 0.195578 8.60884 0.361803 8.27639L4.05279 0.894426Z",fill:"#11A74D"})}),eA=(0,d.jsx)(eE.J,{width:"9px",height:"9px",viewBox:"0 0 9 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",mr:"5px",children:(0,d.jsx)("path",{d:"M5.44721 8.10557C5.26295 8.4741 4.73705 8.4741 4.55279 8.10557L0.861804 0.723605C0.695579 0.391155 0.937327 -7.48573e-07 1.30902 -7.16078e-07L8.69098 -7.07265e-08C9.06267 -3.82323e-08 9.30442 0.391156 9.1382 0.723607L5.44721 8.10557Z",fill:"#AF1817"})});function eR(e){let{lastTrades:t,statistics:o,topItems:i,isLoading:l,setSelectedTabIndex:n,scrollPosition:r}=e,a={brown:"#38332E"},{connectedWallet:s}=(0,b.v9)(e=>e.web3Reducer),c=null==s?void 0:s.address,[u,p]=(0,w.useState)({}),[m,j]=(0,w.useState)(!0),C=e=>{var t,o;null===(o=u[e])||void 0===o||null===(t=o.current)||void 0===t||t.scrollIntoView({behavior:"smooth",block:"start"})},y={fulfilledTrades:"Trades Fulfilled",tokenVolume:"Total Volume",createdTrades:"Trades Created",createdBids:"Bids Posted"};function S(e){let t=eI.O$.from((null==e?void 0:e.oldAmount)||0),o=eI.O$.from((null==e?void 0:e.amount)||0),i=ec.formatEther(o),l=ec.formatEther(t);return t.isZero()?0:(+i-+l)/+l*100}return(0,w.useEffect)(()=>{!l&&t&&o&&i&&j(!1)},[l,t,o,i]),(0,w.useEffect)(()=>{r&&C(r)},[r,C]),(0,w.useEffect)(()=>{t&&p(null==t?void 0:t.reduce((e,t,o)=>(e[o]=(0,w.createRef)(),e),{}))},[t]),(0,d.jsx)(x.x,{w:"100%",h:"100%",children:m?(0,d.jsx)(h.M,{w:"100%",h:"100%",children:(0,d.jsx)(g.$,{size:"lg"})}):(0,d.jsxs)(W.g,{w:"100%",h:"100%",justify:"flex-start",align:"center",spacing:0,overflowY:"scroll",className:F().newmarket,children:[(0,d.jsxs)(M.U,{w:"100%",maxH:"300px",h:"50%",px:"20px",py:"10px",spacing:0,gap:"28px",align:"flex-start",children:[(0,d.jsxs)(W.g,{h:"100%",w:"45%",spacing:0,alignItems:"flex-start",gap:"5px",children:[(0,d.jsx)(f.x,{className:F().analyticsTitle,children:"Marketplace Stats"}),(0,d.jsx)(v.M,{columns:2,w:"100%",h:"100%",gridTemplateRows:"repeat(2, 1fr)",gap:"8px",children:Object.keys(o||{}).map(e=>{var t,i,l,n,r,s,c,u,p,x,h,v,m,g,w,b,j,C,k;return(0,d.jsx)(W.g,{border:"3px solid ".concat(a.brown),borderRadius:"8px",boxShadow:"0px 0px 10px 0px black inset",boxSizing:"content-box",justifyContent:"space-evenly",spacing:0,pb:"5px",children:o[e]instanceof Array?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(M.U,{alignItems:"flex-end",children:[(0,d.jsx)(f.x,{className:F().analyticsValue,children:ec.formatEther(eI.O$.from((null===(i=o[e])||void 0===i?void 0:null===(t=i.find(e=>"GLMR"===e.type))||void 0===t?void 0:t.amount)||0))}),(0,d.jsx)(z.WI,{fill:"#FAC70C",width:"26px",height:"22px"})]}),(0,d.jsx)(f.x,{className:F().analyticsSubtitle,children:null!==(b=y[e])&&void 0!==b?b:""}),(0,d.jsxs)(f.x,{fontFamily:"Grenze",fontSize:"14px",fontWeight:"normal",lineHeight:"23px",letterSpacing:"0.02em",textAlign:"center",color:S(null===(l=o[e])||void 0===l?void 0:l.find(e=>"GLMR"===e.type))>0?"#11A74D":0>S(null===(n=o[e])||void 0===n?void 0:n.find(e=>"GLMR"===e.type))?"#AF1817":"#38332E",children:[S(null===(r=o[e])||void 0===r?void 0:r.find(e=>"GLMR"===e.type))>0?eM:0>S(null===(s=o[e])||void 0===s?void 0:s.find(e=>"GLMR"===e.type))?eA:eF,null!==(j=null===(c=S(null===(u=o[e])||void 0===u?void 0:u.find(e=>"GLMR"===e.type)).toFixed(2))||void 0===c?void 0:c.replace(/\.00$/,""))&&void 0!==j?j:0,"%"]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.x,{className:F().analyticsValue,children:o[e].amount}),(0,d.jsx)(f.x,{className:F().analyticsSubtitle,children:null!==(C=y[e])&&void 0!==C?C:""}),(0,d.jsxs)(f.x,{fontFamily:"Grenze",fontSize:"14px",fontWeight:"normal",lineHeight:"23px",letterSpacing:"0.02em",textAlign:"center",color:(null===(p=o[e])||void 0===p?void 0:p.percentage)>0?"#11A74D":(null===(x=o[e])||void 0===x?void 0:x.percentage)<0?"#AF1817":"#38332E",children:[(null===(h=o[e])||void 0===h?void 0:h.percentage)>0?eM:(null===(v=o[e])||void 0===v?void 0:v.percentage)<0?eA:eF,null!==(k=null===(w=o[e])||void 0===w?void 0:null===(g=w.percentage)||void 0===g?void 0:null===(m=g.toFixed(2))||void 0===m?void 0:m.replace(/\.00$/,""))&&void 0!==k?k:0,"%"]})]})},e)})})]}),(0,d.jsxs)(W.g,{flex:"1",h:"100%",spacing:0,gap:"5px",alignItems:"flex-start",children:[(0,d.jsx)(f.x,{className:F().analyticsTitle,children:"Top Traded Items"}),(0,d.jsxs)(x.x,{h:"100%",w:"fill-available",overflowY:"scroll",border:"3px solid ".concat(a.brown),borderRadius:"8px",boxShadow:"0px 0px 10px 0px black inset",boxSizing:"content-box",className:F().newmarket,px:"20px",py:"10px",children:[(0,d.jsxs)(ek.r,{w:"full",templateColumns:"60% 40%",alignItems:"center",pb:"15px",whiteSpace:"nowrap",children:[(0,d.jsx)(f.x,{color:"white",fontSize:"20px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"30px",letterSpacing:"0.02em",textAlign:"left",children:"Item"}),(0,d.jsx)(f.x,{color:"white",fontSize:"20px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"30px",letterSpacing:"0.02em",textAlign:"right",children:"Amount Traded"})]}),(0,d.jsx)(W.g,{w:"100%",alignItems:"flex-start",overflow:"hidden",gap:"5px",children:i.length>0?i.map((e,t)=>(0,d.jsx)(eN,{item:e},t)):(0,d.jsx)(f.x,{fontFamily:"Grenze",children:"No Items."})})]})]})]}),(0,d.jsxs)(W.g,{w:"100%",px:"20px",py:"10px",spacing:0,gap:"5px",alignItems:"flex-start",children:[(0,d.jsx)(f.x,{className:F().analyticsTitle,children:"Latest Trades"}),(0,d.jsx)(x.x,{h:"100%",w:"100%",overflowY:"scroll",border:"3px solid ".concat(a.brown),borderRadius:"8px",boxShadow:"0px 0px 10px 0px black inset",boxSizing:"content-box",className:F().newmarket,children:(0,d.jsxs)(W.g,{w:"100%",alignItems:"flex-start",pt:"7px",pb:"11px",px:"26px",overflow:"hidden",children:[(0,d.jsxs)(ek.r,{w:"100%",templateColumns:"114px 204px 50px auto 60px",gap:"26px",alignItems:"center",py:"3px",children:[(0,d.jsx)(f.x,{color:"white",fontSize:"20px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"30px",letterSpacing:"0.02em",textAlign:"left",children:"Status"}),(0,d.jsx)(f.x,{color:"white",fontSize:"20px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"30px",letterSpacing:"0.02em",textAlign:"left",children:"Proposed Trade"}),(0,d.jsx)(f.x,{}),(0,d.jsx)(f.x,{color:"white",fontSize:"20px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"30px",letterSpacing:"0.02em",textAlign:"left",children:"Accepted Bid/ Buyout Amount"})]}),t&&t.length>0?t.map((e,t)=>(0,d.jsx)(e_,{ref:u[t],trade:e,account:c,setSelectedTabIndex:n},t)):(0,d.jsx)(f.x,{fontFamily:"Grenze",children:"No Trades."})]})})]})]})})}var eT=o(90084),ez=o(26972),eD=o(47516),eL=o(42463);function eB(){let e=(0,b.I0)(),t={brown:"#38332E",yellow:"#FAC70C",red:"#AF1817",beige:"#E5C687"},[o,i]=w.useState([]),[l,n]=w.useState(!1),[r,s]=w.useState(!1),u=(0,b.v9)(e=>e.marketplaceReducer.trades),[p,v]=w.useState([]),[m,j]=w.useState([]),{isOpen:y,onToggle:S,onClose:k}=(0,c.q)(),{socket:I}=(0,ev.s)(),[_,N]=w.useState("withdraw-escrow"),E=(0,b.v9)(e=>e.web3Reducer.web3Provider),{connectedWallet:A}=(0,b.v9)(e=>e.web3Reducer),R=null==A?void 0:A.address,T=(0,b.v9)(e=>e.web3Reducer.metatransactions),z=(0,b.v9)(e=>e.inventoryReducer.escrowedData),D=(0,b.v9)(e=>e.marketplaceReducer.removeFromEscrow),L=(0,b.v9)(e=>e.inventoryReducer.selectedForTrade);(0,w.useEffect)(()=>()=>{e((0,C.Ao)())},[]),(0,w.useEffect)(()=>{var e,t,o,i,l;if((null==D?void 0:null===(e=D.nfts)||void 0===e?void 0:e.length)||(null==D?void 0:null===(t=D.unclaimedNfts)||void 0===t?void 0:t.length)||(null==D?void 0:null===(o=D.resources)||void 0===o?void 0:o.length)||(null==D?void 0:null===(i=D.erc20s)||void 0===i?void 0:i.length)||(null==D?void 0:D.ether)||(null==D?void 0:null===(l=D.soulNfts)||void 0===l?void 0:l.length)){n(!0);let{tradesWithItem:e,bidsWithItem:t}=(0,eD.w)(R,u,D,z);v(e),j(t)}else n(!1)},[D]),(0,w.useEffect)(()=>{let e=function(){let e=[],t=0;if(z){var o,i,l,n,r,s,c,u,p,x,h,v;let m=z.erc1155s.slice();
1if(m.forEach(e=>{var t,o,i;let l=null===(t=L.resources)||void 0===t?void 0:t.find(t=>t.resourceId==e.resourceId);e.amount-=(null==l?void 0:l.amount)||0;let n=null===(o=D.resources)||void 0===o?void 0:o.find(t=>t.resourceId==e.resourceId);e.amount-=(null==n?void 0:n.amount)||0;let r=null===(i=z.unclaimedResources.find(t=>t.resourceId==e.resourceId))||void 0===i?void 0:i.amount;e.resourceId=e.resourceId||Number(e.id),r&&(e.unclaimedAmount=r)}),z.unclaimedResources.forEach(e=>{if(!m.find(t=>t.resourceId==e.resourceId)){let t=(0,a._)({},e);t.unclaimedAmount=t.amount,m.push(t)}}),null==z?void 0:z.erc721s)for(let n=0;n<(null==z?void 0:null===(o=z.erc721s)||void 0===o?void 0:o.length);n++){let o=null==z?void 0:z.erc721s[n];(null===(i=L.nfts)||void 0===i||!i.find(e=>e.id==o.id))&&((null===(l=D.nfts)||void 0===l?void 0:l.find(e=>e.id==o.id))||(e.push((0,d.jsx)(J.s,{asset:o,slotSize:62,newStyle:!0,isEscrowed:!0,onSelect:C.ZU},"tradebox-"+t)),t+=1))}if(null==z?void 0:z.composedNfts)for(let o=0;o<(null==z?void 0:null===(n=z.composedNfts)||void 0===n?void 0:n.length);o++){let i=null==z?void 0:z.composedNfts[o];(null===(r=L.soulNfts)||void 0===r||!r.find(e=>e.id==i.id))&&((null===(s=D.soulNfts)||void 0===s?void 0:s.find(e=>e.id==i.id))||(e.push((0,d.jsx)(ee.H,{nft:i,slotSize:62,onSelect:C.ZU,isEscrowed:!0},"tradebox-"+t)),t+=1))}if(null==m?void 0:m.length)for(let o=0;o<m.length;o++){let i=m[o];e.push((0,d.jsx)(Y.Z,{resource:i,size:62,newStyle:!0,isEscrowed:!0,onSelect:C.ZU},"market-inv-"+t)),t+=1}if(null==z?void 0:z.unclaimedNfts)for(let o=0;o<(null==z?void 0:null===(c=z.unclaimedNfts)||void 0===c?void 0:c.length);o++){let i=null==z?void 0:z.unclaimedNfts[o],l=null===(u=L.unclaimedNfts)||void 0===u?void 0:u.find(e=>e.id==i.id);l&&(i.amount-=l.amount);let n=null===(p=D.unclaimedNfts)||void 0===p?void 0:p.find(e=>e.id==i.id);n&&(i.amount-=n.amount),i.amount<=0||(e.push((0,d.jsx)($.I,{reward:i,slotSize:62,multiSelect:!0,newStyle:!0,isEscrowed:!0,onSelect:C.ZU},"bidbox-"+t)),t+=1)}if(null==z?void 0:z.erc20s)for(let o=0;o<(null==z?void 0:null===(x=z.erc20s)||void 0===x?void 0:x.length);o++){if(!Number(null==z?void 0:z.erc20s[o].amount))continue;let i=null==z?void 0:z.erc20s[o],l=null===(h=L.escrowedErc20s)||void 0===h?void 0:h.find(e=>e.id==i.id);l&&(i.amount=BigInt(i.amount)-BigInt(l.amount));let n=null===(v=D.erc20s)||void 0===v?void 0:v.find(e=>e.id==i.id);n&&(i.amount=BigInt(i.amount)-BigInt(n.amount)),e.push((0,d.jsx)(X.Z,{erc20:i,size:62,multiSelect:!0,newStyle:!0,isEscrowed:!0,onSelect:C.ZU},"market-inv-"+t)),t+=1}if((null==z?void 0:z.ether)>0){let o=BigInt(L.escrowedEther||0),i=D.ether,l=BigInt(z.ether)-(o||BigInt(0))-(i||BigInt(0));e.push((0,d.jsx)(Q.Z,{ether:l,size:62,multiSelect:!0,newStyle:!0,isEscrowed:!0,onSelect:C.ZU},"market-inv-"+t)),t+=1}return e}}();e&&0==e.length?e.push((0,d.jsx)(x.x,{w:"200%",children:"No In-Market Items."},"inmsg")):e||(e=[(0,d.jsx)(g.$,{size:"md"},"spin-esc")]),i(e)},[z]);let B=async()=>{(null==I?void 0:I.connected)&&I.emit("getPlayerEscrow",{account:R},t=>{try{t&&e((0,V.OF)(t))}catch(e){console.error("Error in getPlayerEscrow",e)}})};async function H(){s(!0),await (0,en.cB)(D,p.map(e=>e.id),m.map(e=>e.id),E,e,T,I,N),setTimeout(()=>{s(!1)},1500),e((0,C.Ao)()),e((0,V.fi)(Date.now()))}return(0,w.useEffect)(()=>{R&&B()},[R]),(0,d.jsx)(x.x,{w:"100%",h:"100%",children:r?(0,d.jsx)(h.M,{children:(0,d.jsx)(ep.s,{groupId:_,latestOnly:!1})}):(0,d.jsxs)(W.g,{w:"100%",h:"100%",justify:"flex-start",align:"center",spacing:0,overflowY:"scroll",className:F().newmarket,px:"50px",py:"10px",gap:3,children:[(0,d.jsx)(f.x,{className:F().analyticsTitle,children:"Your 'In-Market' Items "}),(0,d.jsxs)(x.x,{px:"20px",w:"100%",style:{color:t.beige},mb:"20px",border:"3px solid ".concat(t.brown),borderRadius:"8px",boxShadow:"0px 0px 10px 0px black inset",justifyContent:"space-evenly",children:[(0,d.jsxs)(f.x,{style:{fontSize:"20px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"25px"},pb:"5px",children:["These items are currently being held in escrow within the marketplace. ",(0,d.jsx)("br",{})]}),(0,d.jsxs)(f.x,{style:{fontSize:"20px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"25px"},children:[(0,d.jsx)("u",{children:"Please note"}),": Items withdrawn from the Marketplace will be returned to your regular inventory and related bids or trades voided."]})]}),(0,d.jsx)(ek.r,{h:"100%",w:"100%",px:"29px",templateColumns:"repeat(auto-fill, minmax(82px, 1fr))",gridAutoRows:"max-content",gap:"13px",justifyContent:"center",justifyItems:"center",overflowY:"auto",pb:"40px",children:o?o.length?o.map((e,t)=>e):(0,d.jsx)(g.$,{size:"lg"}):(0,d.jsx)(d.Fragment,{})}),(0,d.jsxs)(M.U,{w:"100%",justify:"center",spacing:5,children:[(0,d.jsx)(eL.Z,{trigger:(0,d.jsx)(x.x,{children:(0,d.jsx)(ei.Z,{text:"Withdraw Selected",onClick:S,color:t.red,hoverColor:t.yellow,disabled:!l||r})}),title:"Confirmation",content:"Are you sure you want to WITHDRAW these items?",isOpen:y,onClose:k,onYes:H,footer:(0,d.jsxs)(f.x,{color:"#E5C687",fontSize:"16px",fontFamily:"Grenze",fontWeight:"400",lineHeight:"18px",letterSpacing:.32,children:[(null==p?void 0:p.length)?"The following trade".concat((null==p?void 0:p.length)?"s":""," will be\n                CANCELLED as a result:"):null,p.map(e=>eW(e)),(null==m?void 0:m.length)?"The following bid".concat((null==m?void 0:m.length)?"s":""," will be\n                CANCELLED as a result:"):null,m.map(e=>eH(e))]})}),(0,d.jsx)(ei.Z,{text:"Cancel",onClick:()=>void(e((0,C.Ao)()),s(!1)),disabled:!l,color:t.red,hoverColor:t.yellow})]})]})})}let eH=e=>{var t;return e.id?(0,d.jsx)(ez.u,{label:(0,d.jsxs)(f.x,{color:"#FAC70C",fontSize:"20px",fontFamily:"Grenze",fontWeight:"400",lineHeight:"20px",letterSpacing:.4,children:["Bid Id: ",e.id.slice(0,4)+"..."+e.id.slice(-4),(0,d.jsx)("br",{}),e.offeredErc20.amount>BigInt(0)?(0,d.jsxs)(f.x,{children:["- ",e.offeredErc20.amount]}):null,e.offeredEther>BigInt(0)?(0,d.jsxs)(f.x,{children:["- ",ec.formatEther(e.offeredEther.toString())," GLMR"]}):null,null===(t=e.composedNfts)||void 0===t?void 0:t.map(e=>{var t;return(0,d.jsxs)(f.x,{children:["- ",null===(t=e.retrievedMetadata)||void 0===t?void 0:t.name," "]},e.id)}),e.erc721s.map(e=>{var t;return(0,d.jsxs)(f.x,{children:["- ",null===(t=e.retrievedMetadata)||void 0===t?void 0:t.name," "]},e.id)}),e.erc1155s.map(e=>{var t;return(0,d.jsxs)(f.x,{children:["- ",null===(t=e.retrievedMetadata)||void 0===t?void 0:t.name]},e.id)}),e.unclaimedNfts.map(e=>{var t;return(0,d.jsxs)(f.x,{children:["- ",null===(t=e.retrievedMetadata)||void 0===t?void 0:t.name]},e.id)}),e.unclaimedResources.map(e=>{var t;return(0,d.jsxs)(f.x,{children:["- ",null===(t=e.retrievedMetadata)||void 0===t?void 0:t.name]},e.id)})]}),"aria-label":"A tooltip",backgroundColor:"#1f2326",borderRadius:"7px",borderWidth:"1px",children:(0,d.jsx)(f.x,{color:"#FAC70C",fontSize:"20px",fontFamily:"Grenze",fontWeight:"400",lineHeight:"20px",letterSpacing:.4,children:e.id.slice(0,4)+"..."+e.id.slice(-4)})},"bid-"+e.id):null},eW=e=>{var t;return e.id?(0,d.jsx)(ez.u,{label:(0,d.jsxs)(f.x,{color:"#FAC70C",fontSize:"20px",fontFamily:"Grenze",fontWeight:"400",lineHeight:"20px",letterSpacing:.4,children:["Trade Id: ",e.id.slice(0,4)+"..."+e.id.slice(-4),(0,d.jsx)("br",{}),null===(t=e.composedNfts)||void 0===t?void 0:t.map(e=>{var t;return(0,d.jsxs)(f.x,{children:["- ",null===(t=e.retrievedMetadata)||void 0===t?void 0:t.name," "]},e.id)}),e.erc721s.map(e=>{var t;return(0,d.jsxs)(f.x,{children:["- ",null===(t=e.retrievedMetadata)||void 0===t?void 0:t.name," "]},e.id)}),e.erc1155s.map(e=>{var t;return(0,d.jsxs)(f.x,{children:["- ",null===(t=e.retrievedMetadata)||void 0===t?void 0:t.name]},e.id)}),e.unclaimedNfts.map(e=>{var t;return(0,d.jsxs)(f.x,{children:["- ",null===(t=e.retrievedMetadata)||void 0===t?void 0:t.name]},e.id)}),e.unclaimedResources.map(e=>{var t;return(0,d.jsxs)(f.x,{children:["- ",null===(t=e.retrievedMetadata)||void 0===t?void 0:t.name]},e.id)})]}),"aria-label":"A tooltip",backgroundColor:"#1f2326",borderRadius:"7px",borderWidth:"1px",children:(0,d.jsx)(f.x,{color:"#FAC70C",fontSize:"20px",fontFamily:"Grenze",fontWeight:"400",lineHeight:"20px",letterSpacing:.4,children:e.id.slice(0,4)+"..."+e.id.slice(-4)})},e.id):null};var eO=o(88155),eP=o(44178);function eU(e){var t,o,i,l,n,r,a,s;let{item:c,initCreateOrderForItem:p,currencyConversion:h,sortBy:v}=e,m=(0,w.useMemo)(()=>"24hvol"===v?c.change24h:"7dvol"===v?c.change7d:"30dvol"===v?c.change30d:null,[v,c.change24h,c.change7d,c.change30d]),g=(0,w.useMemo)(()=>"Trending"===m?"white":m&&m>0?eh.D.green:m&&m<0?eh.D.red:eh.D.brown,[m]);return(0,d.jsxs)(ek.r,{w:"100%",background:"#0B0B0A",boxShadow:"0px 0px 10px black inset",borderRadius:"5px",outline:"3px solid ".concat(eh.D.brown),filter:"drop-shadow(4px 4px 0 black)",templateColumns:"34% 13.5% 13.5% 13.5% 13.5% 12%",alignItems:"center",py:"3px",px:"12px",pos:"relative",onClick:p,cursor:"pointer",transition:"transform 0.2s",_hover:{transform:"scale(1.01)",outline:"3px solid ".concat(eh.D.yellow)},children:[(0,d.jsxs)(u.k,{flexDir:"row",pos:"absolute",left:"-10px",zIndex:100,children:[c.haveSold&&(0,d.jsx)(eq,{type:"sell"}),c.haveBought&&(0,d.jsx)(eq,{type:"buy",hasBoth:c.haveSold})]}),(0,d.jsxs)(u.k,{alignItems:"center",mr:"10px",children:[(0,d.jsx)(x.x,{m:"-5.5px",_hover:{cursor:"pointer"},my:"3px",children:(0,d.jsx)(ef.Z,{metadata:c.metadata,index:0})},"".concat(c.collection,"-").concat(c.itemId)),(0,d.jsx)(f.x,{color:(0,eb.kg)(null!==(a=null==c?void 0:null===(l=c.metadata)||void 0===l?void 0:null===(i=l.properties)||void 0===i?void 0:null===(o=i.Rarity)||void 0===o?void 0:null===(t=o.value)||void 0===t?void 0:t.toLowerCase())&&void 0!==a?a:"common"),fontSize:"14px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"12px",letterSpacing:0,textAlign:"left",ml:"15px",children:null===(n=c.metadata)||void 0===n?void 0:n.name})]}),(0,eP.D)(Number((0,eO.d)(c.buyPrice)),h),(0,eP.D)(Number((0,eO.d)(c.sellPrice)),h),(0,d.jsx)(f.x,{fontFamily:"Grenze",fontSize:"14px",fontWeight:"normal",lineHeight:"18px",letterSpacing:"0.02em",textAlign:"left",color:g,children:"Trending"===m?(0,d.jsxs)(M.U,{spacing:0,gap:"5px",children:[(0,d.jsx)(eE.J,{width:"11px",height:"15px",viewBox:"0 0 11 15",children:(0,d.jsx)("path",{d:"M3.29462 14.9798C3.44114 15.0577 3.59569 14.889 3.50599 14.7494C3.01908 13.9916 2.558 12.7164 3.29261 11.0741C4.51766 8.33547 5.2631 6.91704 5.2631 6.91704C5.2631 6.91704 5.6596 8.57234 6.7344 10.0441C7.76884 11.4606 8.33504 13.2421 7.42225 14.7262C7.33658 
114.8655 7.48764 15.0298 7.6332 14.9554C8.76311 14.3774 10.0304 13.218 10.1734 10.9108C10.2261 10.2058 10.1471 9.21881 9.75169 7.97329C9.24333 6.39471 8.61838 5.65812 8.25678 5.34179C8.14862 5.24716 7.98041 5.33103 7.98928 5.47446C8.09465 7.17775 7.45386 7.60998 7.08913 6.63589C6.94347 6.24682 6.85852 5.57387 6.85852 4.75436C6.85852 3.39002 6.46268 1.98556 5.59001 0.844284C5.36308 0.547494 5.09754 0.270165 4.79288 0.0336697C4.68258 -0.0519677 4.52271 0.0341109 4.5328 0.173376C4.59981 1.09828 4.5391 3.74899 2.21358 6.91576C0.105027 9.85329 0.922088 12.1093 1.21201 12.7203C1.76633 13.8909 2.53952 14.5783 3.29462 14.9798Z",fill:"white"})}),(0,d.jsx)(f.x,{children:"Trending"})]}):(0,d.jsxs)(d.Fragment,{children:[m&&m>0?eM:m&&m<0?eA:eF,m&&m>0?"+":"",null!==(s=null==m?void 0:null===(r=m.toFixed(2))||void 0===r?void 0:r.replace(/\.00$/,""))&&void 0!==s?s:0,"%"]})}),"24hvol"===v?(0,eP.D)(Number((0,eO.d)(c.volume24h)),h):"30dvol"===v?(0,eP.D)(Number((0,eO.d)(c.volume30d)),h):(0,eP.D)(Number((0,eO.d)(c.volume7d)),h),(0,d.jsx)(f.x,{fontSize:"15px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"15px",letterSpacing:"0.02em",marginLeft:"auto",color:eh.D.yellow,children:"Buy/Sell"})]})}let eq=e=>{let{type:t,hasBoth:o}=e;return(0,d.jsx)(ez.u,{label:(0,d.jsx)(x.x,{borderRadius:"5px",border:"3px solid ".concat("sell"===t?eh.D.red:eh.D.green),bgColor:"#0A0A09",children:(0,d.jsxs)(f.x,{fontFamily:"Grenze",fontWeight:"medium",fontSize:"18px",lineHeight:"16px",letterSpacing:0,px:"15px",py:"9px",children:["You have"," ",(0,d.jsx)("span",{style:{color:"sell"===t?eh.D.red:eh.D.green},children:"sell"===t?"Sell Orders":"Buy Orders"})," ","active on this item"]})}),bg:"transparent",boxShadow:"0 0 0px rgba(0, 0, 0, 0)",placement:"right",offset:[0,-8],children:(0,d.jsx)(eE.J,{width:"16px",height:"16px",viewBox:"0 0 16 16",transform:o?"translateX(-8px)":void 0,filter:"drop-shadow(-1px -1px 0px ".concat(eh.D.brown,") \n              drop-shadow(1px -1px 0px ").concat(eh.D.brown,") \n              drop-shadow(1px 1px 0px ").concat(eh.D.brown,")\n              drop-shadow(-1px 1px 0px ").concat(eh.D.brown,")"),children:"sell"===t?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M0.0791415 8.17026L7.59031 15.8777C7.66978 15.9592 7.83489 16 8 16L8 13.3938L2.60881 8L9.5399e-08 8C9.22231e-08 8.05806 0.0263805 8.11612 0.0791415 8.17026Z",fill:"#E76463"}),(0,d.jsx)("path",{d:"M8.4097 15.8777L15.9209 8.17026C15.9736 8.11612 16 8.05806 16 8L13.3912 8L8 13.3938L8 16C8.16511 16 8.33023 15.9592 8.4097 15.8777Z",fill:"#7A2626"}),(0,d.jsx)("path",{d:"M2.60881 8L8 13.3938L13.3912 8L8 2.60625L2.60881 8Z",fill:"#AF1817"}),(0,d.jsx)("path",{d:"M15.9209 7.82974L8.4097 0.12232C8.33023 0.0407725 8.16511 -3.28338e-08 8 3.57944e-08L8 2.60625L13.3912 8L16 8C16 7.94194 15.9736 7.88388 15.9209 7.82974Z",fill:"#7A2626"}),(0,d.jsx)("path",{d:"M7.59031 0.12232L0.0791415 7.82974C0.0263806 7.88388 9.85749e-08 7.94194 9.5399e-08 8L2.60881 8L8 2.60625L8 3.57944e-08C7.83489 1.04422e-07 7.66978 0.0407726 7.59031 0.12232Z",fill:"#E76463"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("path",{d:"M0.0791415 8.17026L7.59031 15.8777C7.66978 15.9592 7.83489 16 8 16L8 13.3938L2.60881 8L9.5399e-08 8C9.22231e-08 8.05806 0.0263805 8.11612 0.0791415 8.17026Z",fill:"#59D089"}),(0,d.jsx)("path",{d:"M8.4097 15.8777L15.9209 8.17026C15.9736 8.11612 16 8.05806 16 8L13.3912 8L8 13.3938L8 16C8.16511 16 8.33023 15.9592 8.4097 15.8777Z",fill:"#0E6330"}),(0,d.jsx)("path",{d:"M2.60881 8L8 13.3938L13.3912 8L8 2.60625L2.60881 8Z",fill:"#11A74D"}),(0,d.jsx)("path",{d:"M15.9209 7.82974L8.4097 0.12232C8.33023 0.0407725 8.16511 -3.28338e-08 8 3.57944e-08L8 2.60625L13.3912 8L16 8C16 7.94194 15.9736 7.88388 15.9209 7.82974Z",fill:"#0E6330"}),(0,d.jsx)("path",{d:"M7.59031 0.12232L0.0791415 7.82974C0.0263806 7.88388 9.85749e-08 7.94194 9.5399e-08 8L2.60881 8L8 2.60625L8 3.57944e-08C7.83489 1.04422e-07 7.66978 0.0407726 7.59031 0.12232Z",fill:"#59D089"})]})})})};var eG=(0,w.memo)(function(e){let{orderbookItems:t,initCreateOrder:o,getFullItem:i,setContainFilter:l,containFilter:n,openLogs:r,sortBy:a}=e,s=(0,b.v9)(e=>e.marketplaceReducer.currencyConversion),[c,p]=(0,w.useState)(!0),[v,j]=(0,w.useState)(!1),C=(0,w.useRef)(),[y,S]=(0,w.useState)(void 0),k=[],I=(0,w.useRef)(10),_=(0,b.v9)(e=>e.web3Reducer.web3Provider),N=(0,b.I0)(),E=(0,w.useCallback)(()=>{console.log("cleanupExistingListener"),C.current&&(console.log("Cleaning up existing orderbook event listener"),C.current(),C.current=void 0,j(!1))},[]);(0,w.useEffect)(()=>(console.log("orderBookListuseEffect"),E(),_&&(console.log("Setting up orderbook event listener"),(async()=>{try{let e=await (0,en.n4)(_,N);C.current=e,j(!0)}catch(e){console.error("Error setting up orderbook event listener:",e),j(!1)}})()),()=>{E()}),[_,N,E]);let A=(e,o)=>{console.log("loopWithSlice");let i=t.slice(e,o);console.log("loopWithSlice slicedPosts",i),console.log("loopWithSlice arrayForHoldingPosts",k=k.concat(i)),S(k)};console.log("postsToShow",y),(0,w.useEffect)(()=>{console.log("loopWithSlice useEffect"),A(0,I.current)},[t]);let T=(0,w.useCallback)(()=>{let e=I.current+10;S(t.slice(0,e)),I.current=e},[t]);return(0,w.useEffect)(()=>{console.log("handleShowMorePosts useEffect"),y&&y.length>0&&c?p(!1):setTimeout(()=>{p(!1)},2e3)},[y]),(0,d.jsxs)(W.g,{p:"20px",h:"100%",className:F().newmarket,overflowY:"scroll",gap:"26px",spacing:0,children:[(0,d.jsxs)(x.x,{w:"100%",pos:"relative",children:[(0,d.jsx)(f.x,{className:F().analyticsTitle,children:"Auction House"}),(0,d.jsxs)(M.U,{pos:"absolute",h:"28px",right:"24px",top:"-5px",borderRadius:"5px",cursor:"pointer",px:"8px",bgColor:eh.D.brown,fill:eh.D.beige,color:eh.D.beige,filter:"drop-shadow(4px 4px 0px black)",_hover:{fill:eh.D.yellow,color:eh.D.yellow,filter:"drop-shadow(4px 4px 0px ".concat(eh.D.yellow,")")},onClick:r,children:[(0,d.jsx)(eE.J,{width:"16px",height:"12px",viewBox:"0 0 16 12",children:(0,d.jsx)("path",{d:"M5.83333 2.4C5.50278 2.4 5.22589 2.2848 5.00267 2.0544C4.77945 1.824 4.66745 1.5392 4.66667 1.2C4.66589 0.860799 4.77789 0.575999 5.00267 0.3456C
15.22745 0.1152 5.50433 0 5.83333 0H14.8333C15.1639 0 15.4412 0.1152 15.6652 0.3456C15.8892 0.575999 16.0008 0.860799 16 1.2C15.9992 1.5392 15.8872 1.8244 15.664 2.0556C15.4408 2.2868 15.1639 2.4016 14.8333 2.4H5.83333ZM5.83333 7.19999C5.50278 7.19999 5.22589 7.08479 5.00267 6.85439C4.77945 6.62399 4.66745 6.33919 4.66667 5.99999C4.66589 5.66079 4.77789 5.37599 5.00267 5.14559C5.22745 4.91519 5.50433 4.79999 5.83333 4.79999H14.8333C15.1639 4.79999 15.4412 4.91519 15.6652 5.14559C15.8892 5.37599 16.0008 5.66079 16 5.99999C15.9992 6.33919 15.8872 6.62439 15.664 6.85559C15.4408 7.08679 15.1639 7.20159 14.8333 7.19999H5.83333ZM5.83333 12C5.50278 12 5.22589 11.8848 5.00267 11.6544C4.77945 11.424 4.66745 11.1392 4.66667 10.8C4.66589 10.4608 4.77789 10.176 5.00267 9.94559C5.22745 9.71519 5.50433 9.59999 5.83333 9.59999H14.8333C15.1639 9.59999 15.4412 9.71519 15.6652 9.94559C15.8892 10.176 16.0008 10.4608 16 10.8C15.9992 11.1392 15.8872 11.4244 15.664 11.6556C15.4408 11.8868 15.1639 12.0016 14.8333 12H5.83333ZM1.16667 2.4C0.836115 2.4 0.559226 2.2848 0.336004 2.0544C0.112782 1.824 0.0007818 1.5392 4.02298e-06 1.2C-0.000773754 0.860799 0.111226 0.575999 0.336004 0.3456C0.560782 0.1152 0.83767 0 1.16667 0C1.49567 0 1.77295 0.1152 1.9985 0.3456C2.22406 0.575999 2.33567 0.860799 2.33334 1.2C2.331 1.5392 2.219 1.8244 1.99734 2.0556C1.77567 2.2868 1.49878 2.4016 1.16667 2.4ZM1.16667 7.19999C0.836115 7.19999 0.559226 7.08479 0.336004 6.85439C0.112782 6.62399 0.0007818 6.33919 4.02298e-06 5.99999C-0.000773754 5.66079 0.111226 5.37599 0.336004 5.14559C0.560782 4.91519 0.83767 4.79999 1.16667 4.79999C1.49567 4.79999 1.77295 4.91519 1.9985 5.14559C2.22406 5.37599 2.33567 5.66079 2.33334 5.99999C2.331 6.33919 2.219 6.62439 1.99734 6.85559C1.77567 7.08679 1.49878 7.20159 1.16667 7.19999ZM1.16667 12C0.836115 12 0.559226 11.8848 0.336004 11.6544C0.112782 11.424 0.0007818 11.1392 4.02298e-06 10.8C-0.000773754 10.4608 0.111226 10.176 0.336004 9.94559C0.560782 9.71519 0.83767 9.59999 1.16667 9.59999C1.49567 9.59999 1.77295 9.71519 1.9985 9.94559C2.22406 10.176 2.33567 10.4608 2.33334 10.8C2.331 11.1392 2.219 11.4244 1.99734 11.6556C1.77567 11.8868 1.49878 12.0016 1.16667 12Z"})}),(0,d.jsx)(f.x,{className:F().analyticsSubtitleNoColor,children:"Logs"})]})]}),(0,d.jsxs)(M.U,{w:"100%",px:"32px",gap:"16px",className:F().newTradesGridFilter,children:[(0,d.jsx)(f.x,{color:eh.D.beige,className:F().analyticsSubtitleNoColor,whiteSpace:"nowrap",children:"Search Item:"}),l&&(0,d.jsx)(R.I,{width:"100%",size:"sm",placeholder:"Search...",value:n,onChange:e=>l(e.currentTarget.value),className:F().tradeInput,style:n?{color:eh.D.yellow,backgroundColor:"#0000"}:{color:eh.D.beige,backgroundColor:"#0000"},_placeholder:n?{}:{color:eh.D.brown,backgroundColor:"#0000"},_focus:{outline:"none"},_focusVisible:{outline:"none"}})]}),(0,d.jsxs)(x.x,{w:"100%",h:"100%",children:[(0,d.jsxs)(ek.r,{w:"fill-available",px:"32px",templateColumns:"34% 13.5% 13.5% 13.5% 13.5% 12%",alignItems:"center",pb:"3px",whiteSpace:"nowrap",children:[(0,d.jsx)(f.x,{className:F().tableText,textAlign:"left",children:"Item"}),(0,d.jsx)(f.x,{className:F().tableText,textAlign:"left",children:"Sell For"}),(0,d.jsx)(f.x,{className:F().tableText,textAlign:"left",children:"Buy For"}),(0,d.jsx)(f.x,{className:F().tableText,textAlign:"left",children:"24hvol"===a?"24h %":"30dvol"===a?"30d %":"7d %"}),(0,d.jsx)(f.x,{className:F().tableText,textAlign:"left",children:"24hvol"===a?"24h Vol":"30dvol"===a?"30d Vol":"7d Vol"}),(0,d.jsx)(f.x,{className:F().tableText,textAlign:"center"})]}),c?(0,d.jsx)(h.M,{h:"100%",w:"100%",pb:"50px",children:(0,d.jsx)(g.$,{size:"lg"})}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(W.g,{w:"100%",px:"20px",py:"4px",alignItems:"flex-start",overflow:"hidden",gap:"20px",pb:y&&y.length===t.length?"30px":"4px",children:y&&(null==y?void 0:y.length)>0?y.filter(e=>{var t;return null===(t=i(e).metadata)||void 0===t?void 0:t.name}).map((e,t)=>(0,d.jsx)(eU,{item:i(e),initCreateOrderForItem:()=>o(e),currencyConversion:s,sortBy:a},t)):(0,d.jsx)(f.x,{fontFamily:"Grenze",w:"100%",textAlign:"center",pt:"20px",children:"No Items."})}),y&&y.length!==t.length&&(0,d.jsx)(m.P,{colSpan:1,gridColumn:"1 / -1",pb:"140px",children:(0,d.jsx)(u.k,{alignItems:"center",justifyContent:"center",w:"100%",py:"15px",children:(0,d.jsx)(ei.Z,{text:"Load More..",onClick:T})})})]})]})]})}),eZ=o(48207),eV=o(90439),eY=o(86384),e$=o(23148),eK=o(26495);e$.kL.register(e$.f$,e$.uw,e$.ZL,e$.od,e$.jn,e$.De,e$.u,e$.ST,e$.vn);let eJ={scales:{y:{type:"linear",position:"right"},y2:{type:"linear",position:"left"}}};function eX(e){let{data:t}=e;return(0,d.jsx)(eK.Chart,{type:"bar",data:t,options:eJ})}var eQ=o(40036);function e0(e){var t,o,i,l,n,r,a,s,c,p,h,v,m,g,w,b,j,C,S,k,I,_;let{item:N,fullLogs:E,onClick:F,currencyConversion:M,unclickable:A}=e;return(0,d.jsxs)(ek.r,{w:"100%",background:"#0B0B0A",boxShadow:"0px 0px 10px black inset",borderRadius:"5px",outline:"3px solid ".concat(N.eventType===y.tw.OrderCancelled||N.eventType===y.tw.OrderWithdrawn||N.eventType===y.tw.OrderWithdrawnByTrader?eh.D.brown:N.eventType===y.tw.OrderFilled||N.eventType===y.tw.OrderPartiallyFilled?(null===(t=N.order)||void 0===t?void 0:t.selling)?eh.D.green:eh.D.red:(null===(o=N.order)||void 0===o?void 0:o.selling)?eh.D.red:eh.D.green),filter:"drop-shadow(4px 4px 0 black)",templateColumns:E?"16% 22% 16.5% 15% 15.5% 15%":"13.5% 18% 13.5% 9.5% 24.5% 9% 12%",alignItems:"center",py:"3px",px:"12px",cursor:A?"default":"pointer",onClick:()=>{!A&&F&&F()},_hover:{outline:!A&&"3px solid ".concat(eh.D.yellow)},children:[(0,d.jsx)(f.x,{color:"white",fontSize:"14px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"12px",letterSpacing:0,textAlign:"left",children:E?(0,d.jsxs)(d.Fragment,{children:["".concat(new Date(N.timestamp).toLocaleDateString("en-US",{year:"numeric",month:"numeric",day:"numeric"})),(0,d.jsx)("br",{}),"".concat(new Date(N.timestamp).toLocaleTimeString("en-US",{hour:"numeric",minute:"numeric"}))]}):(0,d.jsx)(d.Fragment,{children:(0,eb.Jn)(N.timestamp)})}),!E&&(0,d.jsx)(f.x,{color:"white",fontSize:"14px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"12px",letterSpacing:0,textAlign:"left",mr:"20px",children:(0,eb.ro)(null!==(k=null==N?void 0:N.trader)&&void 0!==k?k:"",15)}),E&&(0,d.jsxs)(u.k,{alignItems:"center",mr:"10px",children:[(0,d.jsx)(x.x,{m:"-5.5px",_hover:{cursor:"pointer"},my:"3px",children:(0,d.jsx)(ef.Z,{metadata:N.metadata,index:0})},"".concat(N.collection,"-").concat(N.itemId)),(0,d.jsx)(f.x,{color:(0,eb.kg)(null!==(I=null==N?void 0:null===(r=N.metadata)||void 0===r?void 0:null===(n=r.properties)||void 0===n?void 0:null===(l=n.Rarity)||void 0===l?void 0:null===(i=l.value)||void 0===i?void 0:i.toLowerCase())&&void 0!==I?I:"common"),fontSize:"14px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"12px",letterSpacing:0,textAlign:"left",ml:"15px",children:null===(a=N.metadata)||void 0===a?void 0:a.name})]}),(0,d.jsx)(f.x,{fontSize:"18px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"16px",letterSpacing:0,textAlign:"left",children:N.eventType===y.tw.OrderPartiallyFilled?(0,d.jsxs)("span",{style:{color:(null===(s=N.order)||void 0===s?void 0:s.selling)?eh.D.green:eh.D.red},children:[E&&(0,d.jsxs)(d.Fragment,{children:["Partially",(0,d.jsx)("br",{})]}),(null===(c=N.order)||void 0===c?void 0:c.selling)?"Bought":"Sold"]}):N.eventType===y.tw.OrderFilled?(0,d.jsx)("span",{style:{color:(null===(p=N.order)||void 0===p?void 0:p.selling)?eh.D.green:eh.D.red},children:(null===(h=N.order)||void 0===h?void 0:h.selling)?"Bought":"Sold"}):N.eventType===y.tw.OrderCreated?(0,d.jsx)("span",{style:{color:(null===(v=N.order)||void 0===v?void 0:v.selling)?eh.D.red:eh.D.green},children:(null===(m=N.order)||void 0===m?void 0:m.selling)?(0,d.jsxs)(d.Fragment,{children:["Sell Order ",(0,d.jsx)("br",{})," Created"]}):(0,d.jsxs)(d.Fragment,{children:["Buy Order ",(0,d.jsx)("br",{})," Created"]})}):N.eventType===y.tw.OrderCancelled?(0,d.jsx)("span",{style:{color:eh.D.brown},children:(null===(g=N.order)||void 0===g?void 0:g.selling)?(0,d.jsxs)(d.Fragment,{children:["Sell Order ",(0,d.jsx)("br",{})," Cancelled"]}):(0,d.jsxs)(d.Fragment,{children:["Buy Order ",(0,d.jsx)("br",{})," Cancelled"]})}):N.eventType===y.tw.OrderWithdrawn||N.eventType===y.tw.OrderWithdrawnByTrader?(0,d.jsx)("span",{style:{color:eh.D.brown},children:"Order Withdrawn"}):null}),(0,d.jsx)(f.x,{color:"white",fontSize:"18px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"18px",letterSpacing:0,textAlign:"left",children:Number(N.quantity)+Number(N.unclaimedQuantity)}),!E&&(0,d.jsxs)(u.k,{alignItems:"center",mr:"10px",children:[(0,d.jsx)(x.x,{m:"-5.5px",_hover:{cursor:"pointer"},my:"3px",children:(0,d.jsx)(ef.Z,{metadata:N.metadata,index:0})},"".concat(N.collection,"-").concat(N.itemId)),(0,d.jsx)(f.x,{color:(0,eb.kg)(null!==(_=null==N?void 0:null===(C=N.metadata)||void 0===C?void 0:null===(j=C.properties)||void 0===j?void 0:null===(b=j.Rarity)||void 0===b?void 0:null===(w=b.value)||void 0===w?void 0:w.toLowerCase())&&void 0!==_?_:"common"),fontSize:"14px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"12px",letterSpacing:0,textAlign:"left",ml:"15px",children:null===(S=N.metadata)||void 0===S?void 0:S.name})]}),!E&&(0,d.jsx)(f.x,{color:"white",fontSize:"18px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"18px",letterSpacing:0,textAlign:"left",children:"for"}),(0,eP.D)(Number((0,eO.d)(N.order.unitPrice))*(Number(N.quantity)+Number(N.unclaimedQuantity)),M),E&&(0,eP.D)(Number((0,eO.d)(N.order.unitPrice)),M)]})}function e1(e){let{items:t,loading:o,onClose:i,noHeader:l,fullLogs:n,unclickable:r}=e,a=(0,b.I0)(),s=(0,b.v9)(e=>e.marketplaceReducer.currencyConversion);return(0,d.jsxs)(x.x,{w:"100%",children:[(0,d.jsx)(ek.r,{w:"fill-available",px:"32px",templateColumns:n?"16% 22% 16.5% 15% 15.5% 15%":"13.5% 18% 13.5% 9.5% 24.5% 9% 12%",alignItems:"center",pb:"3px",whiteSpace:"nowrap",children:!l&&(null==t?void 0:t.length)>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.x,{className:F().tableText,textAlign:"left",children:"Date"}),(0,d.jsx)(f.x,{className:F().tableText,textAlign:"left",children:"Item"}),(0,d.jsx)(f.x,{className:F().tableText,textAlign:"left",children:"Status"}),(0,d.jsx)(f.x,{className:F().tableText,textAlign:"left",children:"Amount"}),(0,d.jsx)(f.x,{className:F().tableText,textAlign:"left",children:"Total Price"}),(0,d.jsx)(f.x,{className:F().tableText,textAlign:"left",children:"Price/ Item"}),n&&(0,d.jsx)(f.x,{className:F().tableText,textAlign:"center"})]})}),o?(0,d.jsx)(h.M,{h:"100%",w:"100%",pb:"50px",children:(0,d.jsx)(g.$,{size:"lg"})}):(0,d.jsx)(W.g,{w:"100%",px:"20px",pt:n?"4px":"15px",pb:n?"30px":"
115px",alignItems:"flex-start",overflow:"hidden",gap:"20px",children:(null==t?void 0:t.length)>0?(0,d.jsx)(d.Fragment,{children:t.filter(e=>n?e:e.eventType===y.tw.OrderPartiallyFilled||e.eventType===y.tw.OrderFilled).sort((e,t)=>e.timestamp>t.timestamp?-1:1).map((e,t)=>(0,d.jsx)(e0,{item:e,fullLogs:n,unclickable:r,onClick:()=>{a((0,j.wW)({mode:en.pz.AdvancedTrading,item:e,suggestedQuantity:1})),i&&i()},currencyConversion:s},t))}):(0,d.jsx)(f.x,{fontFamily:"Grenze",w:"100%",textAlign:"center",children:"No Recent Activity."})})]})}let e2="sticky_live_ticker_closed";var e5=e=>{let{items:t,isLoading:o,unclickable:i}=e,[l,n]=(0,w.useState)(!0),[r,a]=(0,w.useState)(!1);return(0,w.useEffect)(()=>{(()=>{try{let e=localStorage.getItem(e2);if(e){let{timestamp:t}=JSON.parse(e);Math.floor(Date.now()/1e3)-t<600?n(!1):localStorage.removeItem(e2)}}catch(e){console.error("Error checking ticker status:",e),localStorage.removeItem(e2)}})()},[]),(0,d.jsxs)(x.x,{pos:"absolute",bottom:"0px",w:"100%",minH:"60px",zIndex:1e3,filter:l?"drop-shadow(0px 0px 7px ".concat(eh.D.common,")"):void 0,bgColor:"#0A0A0A",borderRadius:"0px 0px 3px 3px",transform:l?"translateY(0)":"translateY(100%)",transition:"transform 1s",children:[(0,d.jsxs)(h.M,{pos:"absolute",h:"35px",top:"-30px",left:"0px",borderRadius:"3px 10px 0 0",cursor:"pointer",bgColor:"#0A0A0A",onClick:()=>{l?n(!1):(localStorage.removeItem(e2),n(!0))},color:"white",_hover:{color:eh.D.yellow},children:[(0,d.jsx)(f.x,{fontFamily:"Grenze",px:"15px",children:"Live"}),(0,d.jsx)(x.x,{pos:"absolute",right:"5px",top:"5px",w:"8px",h:"8px",borderRadius:"50%",bgColor:eh.D.red})]}),l&&(0,d.jsx)(h.M,{pos:"absolute",w:"35px",h:"35px",top:"-30px",right:"0px",borderRadius:"10px 3px 0 0",cursor:"pointer",bgColor:"#0A0A0A",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onClick:()=>{try{let e=Math.floor(Date.now()/1e3);localStorage.setItem(e2,JSON.stringify({timestamp:e}))}catch(e){console.error("Error storing ticker status:",e)}n(!1),a(!1)},children:(0,d.jsx)(h.M,{w:"22px",h:"22px",children:(0,d.jsx)(z.VD,{fill:r?eh.D.red:eh.D.brown})})}),(0,d.jsx)(e1,{items:t,loading:o,fullLogs:!1,unclickable:i,noHeader:!0})]})};function e3(e){var t,o,i,l,n,r,c;let{item:p,historicTrades:x}=e;(0,b.I0)();let v="".concat(null==p?void 0:null===(i=p.retrievedMetadata)||void 0===i?void 0:null===(o=i.properties)||void 0===o?void 0:null===(t=o.Rarity)||void 0===t?void 0:t.value)||"common",m=(0,eb.kg)(v),g=(0,eY.WR)((null==p?void 0:null===(l=p.retrievedMetadata)||void 0===l?void 0:l.thumbnailUri)||(null==p?void 0:null===(n=p.retrievedMetadata)||void 0===n?void 0:n.imageUri)||(null==p?void 0:null===(r=p.retrievedMetadata)||void 0===r?void 0:r.image)),[j,C]=(0,w.useState)([]),[y,S]=(0,w.useState)([]),[k,I]=(0,w.useState)([]),[_,N]=(0,w.useState)(604800),E=(0,b.v9)(e=>e.windowReducer.lastOrderbookEvents),{itemId:A,collection:R}=p?(0,ea.Ew)(p):{itemId:0,collection:""},T=E.filter(e=>e.orderGroup.itemId===A&&e.orderGroup.collection===R);return(0,w.useEffect)(()=>{(function(){if(p){let e=new Date,t=new Date(e.getTime()-1e3*_),o=_/30;(0,eQ.$r)(A,R,t,e).then(e=>{let i=[];for(let l=0;l<30;l++){let n=new Date(t.getTime()+l*o*1e3),r=new Date(n.getTime()+1e3*o);i.push(e.filter(e=>e.timestamp>=n&&e.timestamp<r))}let l=[],n=[];for(let e of i){let t=Number(e.reduce((e,t)=>e+t.totalQuantity*t.unitPrice,0n)/10n**12n)/1e6,o=e.reduce((e,t)=>e+Number(t.totalQuantity),0),i=0===o?0:Number(t)/o;l.push(Number(t)),n.push(Number(i))}S(l),I(n),C(function(e){let t=_/30,o=[];for(let i=0;i<30;i++){let l=new Date(e.getTime()+i*t*1e3);t>=86400?o.push(l.toDateString()):t>=3600?o.push(l.toLocaleTimeString("en-US",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})):o.push(l.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}))}return o}(t))})}})()},[p,_]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(W.g,{h:"100%",justifyContent:"space-between",gap:"10px",className:F().newmarket,overflowY:"scroll",pb:"80px",children:[(0,d.jsxs)(M.U,{w:"100%",gap:"5px",mt:"10px",px:"75px",justifyContent:"flex-start",spacing:0,children:[(0,d.jsx)(h.M,{boxSize:"54px",minW:"54px",border:"2px s
1olid ".concat(m),bgColor:"#0A0A09",boxShadow:"0px 0px 10px 2px ".concat(m," inset"),overflow:"visible",zIndex:30,borderRadius:"6px",children:g&&(0,d.jsx)(q.E,{src:g,width:"100%",height:"100%",maxH:"54px",objectFit:"fill"})}),(0,d.jsx)(f.x,{color:"#7E7E7E",fontSize:"30px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"26px",letterSpacing:0,children:p&&(null===(c=p.retrievedMetadata)||void 0===c?void 0:c.name)})]}),(0,d.jsxs)(M.U,{w:"100%",alignItems:"flex-start",px:"75px",children:[(0,d.jsx)(u.k,{w:"50%",position:"relative",justifyContent:"center",my:"30px",children:(0,d.jsx)(eZ.default,{item:p,suggestedQuantity:1,advancedTradingMode:!0})}),(0,d.jsx)(u.k,{w:"50%",position:"relative",justifyContent:"center",my:"30px",children:(0,d.jsx)(eV.default,{item:p,suggestedQuantity:1,advancedTradingMode:!0})})]}),(0,d.jsxs)(M.U,{w:"100%",alignItems:"right",px:"75px",gap:"5px",children:[(0,d.jsx)(h.M,{w:"35px",h:"30px",borderRadius:"5px",bgColor:eh.D.brown,onClick:()=>N(86400),cursor:"pointer",filter:"drop-shadow(2px 2px 0px black)",_hover:{filter:"drop-shadow(2px 2px 0px ".concat(eh.D.yellow,")")},border:"2px solid ".concat(86400===_?eh.D.yellow:"transparent"),children:(0,d.jsx)(f.x,{fontSize:"15px",color:86400===_?eh.D.yellow:eh.D.beige,children:(0,d.jsx)("strong",{children:"24h"})})}),(0,d.jsx)(h.M,{w:"35px",h:"30px",borderRadius:"5px",bgColor:eh.D.brown,onClick:()=>N(604800),cursor:"pointer",border:"2px solid ".concat(604800===_?eh.D.yellow:"transparent"),_hover:{filter:"drop-shadow(2px 2px 0px ".concat(eh.D.yellow,")")},children:(0,d.jsx)(f.x,{fontSize:"15px",color:604800===_?eh.D.yellow:eh.D.beige,children:(0,d.jsx)("strong",{children:"7d"})})}),(0,d.jsx)(h.M,{w:"35px",h:"30px",borderRadius:"5px",bgColor:eh.D.brown,onClick:()=>N(2592e3),cursor:"pointer",border:"2px solid ".concat(2592e3===_?eh.D.yellow:"transparent"),_hover:{filter:"drop-shadow(2px 2px 0px ".concat(eh.D.yellow,")")},children:(0,d.jsx)(f.x,{fontSize:"15px",color:2592e3===_?eh.D.yellow:eh.D.beige,children:(0,d.jsx)("strong",{children:"30d"})})})]}),(0,d.jsx)(M.U,{w:"100%",alignItems:"flex-start",px:"75px",children:(0,d.jsx)(eX,{data:{labels:j,datasets:[{type:"line",label:"Average Price",borderColor:"rgb(197,167,91)",borderWidth:2,fill:!1,data:k,yAxisId:"y"},{type:"bar",label:"Volume",backgroundColor:"rgb(37,84,62)",data:y,borderColor:"white",borderWidth:2,yAxisId:"y2"}]}})})]}),(0,d.jsx)(e5,{items:T.length?T.map(function(e){return(0,s._)((0,a._)({},e),{collection:e.orderGroup.collection,itemId:e.orderGroup.itemId,metadata:null==p?void 0:p.retrievedMetadata})}):null!=x?x:[],isLoading:!1,unclickable:!0})]})}function e8(e){let{getFullItem:t,onClose:o}=e,{connectedWallet:i}=(0,b.v9)(e=>e.web3Reducer),l=null==i?void 0:i.address,[n,r]=(0,w.useState)(""),[a,s]=(0,w.useState)([]),[c,u]=(0,w.useState)(!0);async function p(){if(!l)return;let e=await (0,eQ.C8)(l);u(!1),s(e)}return(0,w.useEffect)(()=>{l&&p()},[l]),(0,d.jsxs)(W.g,{p:"20px",h:"100%",className:F().newmarket,overflowY:"scroll",gap:"26px",spacing:0,children:[(0,d.jsx)(x.x,{w:"100%",pos:"relative",children:(0,d.jsx)(f.x,{className:F().analyticsTitle,children:"Logs"})}),(0,d.jsxs)(M.U,{w:"100%",px:"32px",gap:"16px",className:F().newTradesGridFilter,children:[(0,d.jsx)(f.x,{color:eh.D.beige,className:F().analyticsSubtitleNoColor,whiteSpace:"nowrap",children:"Search Item:"}),r&&(0,d.jsx)(R.I,{width:"100%",size:"sm",placeholder:"Search...",value:n,onChange:e=>r(e.currentTarget.value),className:F().tradeInput,style:n?{color:eh.D.yellow,backgroundColor:"#0000"}:{color:eh.D.beige,backgroundColor:"#0000"},_placeholder:n?{}:{color:eh.D.brown,backgroundColor:"#0000"},_focus:{outline:"none"},_focusVisible:{outline:"none"}})]}),(0,d.jsx)(e1,{items:a.map(e=>t(e)).filter(e=>{var t,o;return""===n||(null===(o=e.metadata)||void 0===o?void 0:null===(t=o.name)||void 0===t?void 0:t.toLowerCase().includes(n.toLowerCase()))}),loading:c,fullLogs:!0,onClose:o})]})}(i=n||(n={}))[i.DAY=86400]="DAY",i[i.WEEK=604800]="WEEK",i[i.MONTH=2592e3]="MONTH";var e9=function(e){let{setContainFilter:t,containFilter:o,sortBy:i,typeFilter:l,newOrderViewActive:n,setOrderbookNewOrderViewActive:r,getFullItem:c,isLogsOpen:u,onLogsOpen:p,onLogsClose:v}=e,m=(0,b.I0)(),{connectedWallet:f}=(0,b.v9)(e=>e.web3Reducer),j=null==f?void 0:f.address,S=(0,b.v9)(e=>e.marketplaceReducer.orderbookOrderItems),k=(0,b.v9)(e=>e.marketplaceReducer.orderbookAllAcceptedItems),I=(0,b.v9)(e=>e.marketplaceReducer.isLoading),_=(0,b.v9)(e=>e.marketplaceReducer.triggerOrderBookRefresh),N=(0,b.v9)(e=>e.windowReducer.orderBookQuickTradeConfig),E=(0,b.v9)(e=>e.windowReducer.lastOrderbookEvents),[F,M]=(0,w.useState)(),[A,R]=(0,w.useState)([]),T=(0,w.useMemo)(()=>{let e=Object.fromEntries(Object.entries(null!=k?k:{}).filter(e=>{let[t,o]=e;return!S.map(e=>e.acceptedItemId).includes(t)})),t=[];return Object.entries(e).map((e,o)=>{var i,l,n;let[r,a]=e;if(a.metadata&&!(null===(n=a.metadata)||void 0===n?void 0:null===(l=n.name)||void 0===l?void 0:null===(i=l.toLowerCase())||void 0===i?void 0:i.includes("learned recipe"))){let e={acceptedItemId:"".concat(a.collection,"-").concat(a.itemId),collectionType:a.acceptedType===y.n$.Resource?y.yl.ERC1155:y.yl.ERC721,sellPrice:0n,buyPrice:0n,currency:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",currencySymbol:"GLMR",change24h:0,change7d:0,change30d:0,volume24h:0n,volume7d:0n,volume30d:0n,haveBought:!1,haveSold:!1};t.push(e)}}),(S.concat(t)||[]).filter(e=>{var t,i,n;return(""===l||e.collectionType===y.yl.ERC1155&&"resources"===l||e.collectionType===y.yl.ERC721&&"nfts"===l)&&(""===o||(null==k?void 0:null===(n=k[e.acceptedItemId])||void 0===n?void 0:null===(i=n.metadata)||void 0===i?void 0:null===(t=i.name)||void 0===t?void 0:t.toLowerCase().includes(o.toLowerCase())))}).sort((e,t)=>
1{var o,l,n,r;return"24hvol"===i?Number(t.volume24h)-Number(e.volume24h):"7dvol"===i?Number(t.volume7d)-Number(e.volume7d):"30dvol"===i?Number(t.volume30d)-Number(e.volume30d):"buypriceasc"===i?Number(e.buyPrice)-Number(t.buyPrice):"buypricedesc"===i?Number(t.buyPrice)-Number(e.buyPrice):"sellpriceasc"===i?Number(e.sellPrice)-Number(t.sellPrice):"sellpricedesc"===i?Number(t.sellPrice)-Number(e.sellPrice):"alphabetical"===i?(null!==(n=null===(o=k[e.acceptedItemId].metadata)||void 0===o?void 0:o.name)&&void 0!==n?n:"").localeCompare(null!==(r=null===(l=k[t.acceptedItemId].metadata)||void 0===l?void 0:l.name)&&void 0!==r?r:""):0})},[k,S,l,o,i]);(0,w.useEffect)(()=>{console.log("triggerOrderBookRefresh",_),L()},[j,_]),(0,w.useEffect)(()=>{console.log("account",j),j&&D()},[j]),(0,w.useEffect)(()=>{if(console.log("orderBookQuickTradeConfig",N),N.mode===en.pz.AdvancedTrading&&N.item){let e=T.filter(e=>{var t;return null===(t=c(e).metadata)||void 0===t?void 0:t.name}),{itemId:t,collection:o}=(0,ea.Ew)(N.item);console.log("Trying to find item to init order for ".concat(t," in ").concat(o));let i=e.find(e=>{var i;let l=c(e);return(null===(i=l.itemId)||void 0===i?void 0:i.toString())===t.toString()&&l.collection.toLowerCase()===o});i&&H(i)}},[N,T]),(0,w.useEffect)(()=>{console.log("lastOrderbookEvents",E),!I&&k&&z()},[E,k,I]);let z=(0,w.useCallback)(async()=>{console.log("getLastHistoricTrades"),R((await (0,eQ.N5)()).map(e=>{var t;let o=k[(null===(t=e.collection)||void 0===t?void 0:t.toLowerCase())+"-"+e.itemId];return(0,s._)((0,a._)({},e),{metadata:null==o?void 0:o.metadata})}))},[k]),D=(0,w.useCallback)(async()=>{if(console.log("getMyOrders"),!j)return;let e=await (0,eQ.gH)(j);m((0,C.it)(e))},[j,m]),L=(0,w.useCallback)(async()=>{if(console.log("getOrderbookItems"),!j)return;m((0,C.K4)(!0));let e=await (0,eQ.m7)(j);m((0,C.Hq)(e)),m((0,C.K4)(!1))},[j,m]),B=(0,w.useCallback)(e=>{console.log("getItemForOrderBookLogFromEvent",e),console.log("allAcceptedItems",k),console.log("Key",e.orderGroup.collection+"-"+e.orderGroup.itemId);let t=k[e.orderGroup.collection.toLowerCase()+"-"+e.orderGroup.itemId];return console.log("acceptedItem",t),(0,s._)((0,a._)({},e),{collection:e.orderGroup.collection,itemId:e.orderGroup.itemId,metadata:null==t?void 0:t.metadata,trader:e.trader})},[k]),H=(0,w.useCallback)(e=>{console.log("Creating Order for ",e),r(!0);let t=k[e.acceptedItemId];t.acceptedType===y.n$.Resource?M({resourceId:t.itemId,retrievedMetadata:t.metadata}):M({itemId:t.itemId,contractAddress:t.collection,retrievedMetadata:t.metadata})},[k]),W=(0,w.useCallback)(e=>{let t=k[e.orderGroup.collection+"-"+e.orderGroup.itemId];return(0,a._)({},e,t)},[k]);return(0,d.jsx)(x.x,{w:"100%",h:"100%",pos:"relative",children:!I&&k?u?(0,d.jsx)(e8,{getFullItem:W,onClose:v}):n?(0,d.jsx)(e3,{item:F,historicTrades:A.filter(e=>{let{itemId:t}=(0,ea.Ew)(F);return e.itemId===t})}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(eG,{orderbookItems:T,initCreateOrder:H,getFullItem:c,setContainFilter:t,containFilter:o,openLogs:p,sortBy:i}),(0,d.jsx)(e5,{items:E.length<2?A:E.sort((e,t)=>new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime()).slice(0,2).map(e=>B(e)),isLoading:I})]}):(0,d.jsx)(h.M,{w:"100%",h:"100%",children:(0,d.jsx)(g.$,{size:"lg"})})})};function e4(e){let{hideFilter:t,typeFilter:o,setTypeFilter:i,sortBy:l,setSortBy:n,downIcon:r,onReload:a,containFilter:s,setContainFilter:c}=e,[x,v]=(0,w.useState)("black"),[m,f]=(0,w.useState)("black");return(0,d.jsxs)(u.k,{w:"100%",align:"flex-start",className:F().newTradesGridFilter,justifyContent:"flex-start",flexWrap:"nowrap",mb:"2px",gap:"16px",children:[i&&(0,d.jsxs)(p.P,{hidden:t,width:"fit-content",value:o,size:"sm",onChange:e=>i(e.target.value),style:o?{color:eh.D.yellow,backgroundColor:"#38332E"}:{color:eh.D.beige,backgroundColor:"#38332E"},placeholder:"All Items",icon:t?void 0:r,iconSize:t?"0px":"10px",_hover:{color:eh.D.yellow},_focus:{outline:"none"},_focusVisible:{outline:"none"},children:[(0,d.jsx)("option",{value:"nfts",children:"NFTs"}),(0,d.jsx)("option",{value:"resources",children:"Resources"})]}),n&&(0,d.jsx)(p.P,{hidden:t,width:"fit-content",value:l,size:"sm",bgColor:"#38332E",onChange:e=>n(e.target.value),style:l?{color:eh.D.yellow,backgroundColor:"#38332E"}:{color:eh.D.beige,backgroundColor:"#38332E"},placeholder:"Sort By",icon:t?void 0:r,iconSize:t?"0px":"10px",_hover:{color:eh.D.yellow},_focus:{outline:"none"},_focusVisible:{outline:"none"},children:Object.entries(ea.xl).map((e,t)=>{let[o,i]=e;return(0,d.jsx)("option",{value:o,children:i},t)})}),(0,d.jsx)(D.Z,{text:"Refresh",placement:"right",offset:[0,0],children:(0,d.jsx)(u.k,{ml:"auto",w:"30px",h:"30px",minW:"30px",borderRadius:"50%",bgColor:"#38332E",cursor:"pointer",alignItems:"center",justifyContent:"center",filter:"drop-shadow(2px 2px 0 ".concat(x,")"),onMouseEnter:()=>v(eh.D.yellow),onMouseLeave:()=>v("black"),onClick:a&&a,children:(0,d.jsx)(h.M,{w:"16.5px",h:"19px",mb:"2.5px",children:(0,d.jsx)(z.BG,{fill:eh.D.yellow})})})}),(0,d.jsx)(T.z,{hidden:t,h:"30px",size:"sm",variant:"solid",fontFamily:"Grenze",fontSize:"20px",fontWeight:"medium",color:"#FAC70C",width:"57px",sx:o||l||s?{backgroundColor:eh.D.red}:{backgroundColor:eh.D.brown},filter:"drop-shadow(2px 2px 0 ".concat(m,")"),_focus:{outline:"none"},_hover:{backgroundColor:eh.D.red},onMouseEnter:()=>f(eh.D.yellow),onMouseLeave:()=>f("black"),onClick:()=>{n&&n(""),i&&i(""),c&&c("")},children:"Clear"})]})}var e6=o(77369),e7=o(11163);async function te(e,t){console.log("fetchAnalytics",e);let o=await fetch("".concat(S.oQ).concat(e?"?filtervalue="+e:""),{signal:null==t?void 0:t.signal}).then(async e=>200==e.status?await e.json():void 0).catch(e=>{console.log("Failed to fetch analytics ",e)});return console.log("analytics",o),o}var tt=o(42069);(l=r||(r={}))[l.Notifications=0]="Notifications",l[l.Bartering=1]="Bartering",l[l.OrderBook=2]="OrderBook",l[l.Analytics=3]="Analytics",l[l.YourItems=4]="YourItems";let to=()=>(0,d.jsx)(x.x,{height:"132px",w:"164px",bg:"black",border:"3px solid ".concat(eh.D.brown),borderRadius:"5px",children:(0,d.jsx)(h.M,{h:"100%",w:"100%",children:(0,d.jsx)(g.$,{size:"lg"})})}),ti=w.lazy(()=>o.e(4653).then(o.bind(o,44653))),tl=H()(o.e(4508).then(o.bind(o,44508)),{loadableGenerated:{webpack:()=>[44508]},loading:()=>(0,d.jsx)(h.M,{h:"100%",w:"100%",children:(0,d.jsx)(g.$,{size:"lg"})}),ssr:!1});var tn=function(e){let{tradeId:t}=e,o=(0,e7.useRouter)(),i=(0,b.I0)(),{web3Provider:l,connectedWallet:n}=(0,b.v9)(e=>e.web3Reducer),r=null==n?void 0:n.address,[S,k]=(0,w.useState)([]),[N,E]=(0,w.useState)(),[M,A]=(0,w.useState)(),[R,T]=(0,w.useState)(),{fetchResources:D,fetchLootNfts:B,fetchTriumphNfts:H,fetchFishNfts:W}=(0,tt.m)(),O=(0,b.v9)(e=>e.windowReducer.marketplaceWindow),P=(0,b.v9)(e=>e.inventoryReducer.selectedSoulNft);(0,b.v9)(e=>e.inventoryReducer.soulNfts);let U=(0,b.v9)(e=>e.inventoryReducer.lootNfts),q=(0,b.v9)(e=>e.marketplaceReducer.trades),G=(0,b.v9)(e=>e.marketplaceReducer.isLoading),Z=(0,b.v9)(e=>e.marketplaceReducer.shownTrade),Y=(0,b.v9)(e=>e.marketplaceReducer.triggerOrderBookRefresh),$=(0,b.v9)(e=>e.marketplaceReducer.tradeNotifications),K=(0,b.v9)(e=>e.marketplaceReducer.triggerRefresh),J=(0,b.v9)(e=>e.windowReducer.characterSheetWindow);(0,b.v9)(e=>e.marketplaceReducer.trades);let X=(0,b.v9)(e=>e.windowReducer.orderBookQuickTradeConfig),{socket:Q}=(0,ev.s)(),ee=(0,b.v9)(e=>e.web3Reducer.metatransactions),[eo,el]=(0,w.useState)(_),[er,es]=(0,w.useState)([]),[ed,ec]=(0,w.useState)("newest"),[ep,ex]=(0,w.useState)(!1),[ef,eg]=(0,w.useState)(!1),[eb,ej]=(0,w.useState)(!1),[eC,eS]=(0,w.useState)(t),[ek,eI]=(0,w.useState)(),[e_,eN]=(0,w.useState)(""),[eE,eF
1]=(0,w.useState)(""),[eM,eA]=(0,w.useState)(0),[ez,eD]=(0,w.useState)("Equippables"),[eL,eH]=(0,w.useState)(1),[eW,eP]=(0,w.useState)(null),[eU,eq]=(0,w.useState)(""),[eG,eZ]=(0,w.useState)([]),[eV,eY]=(0,w.useState)(!1);(0,w.useRef)(15),(0,w.useEffect)(()=>{eS(t)},[t]);let e$=(0,w.useCallback)(async()=>{if(!l)return;let e=await (0,ea.CG)(void 0,r,l),t=(0,eO.d)(e);eq(t.slice(0,t.indexOf(".")+3))},[r,l]),eK=(0,w.useCallback)(async()=>{if(!l)return;let e=await (0,eu.gh)(l),t=null==e?void 0:e.slice(0,e.indexOf(".")+3);eq(null!=t?t:"0")},[l]);(0,w.useEffect)(()=>{(null==ee?void 0:ee.marketplace)?eK():e$()},[r,l,Y,K,ee]);let[eJ,eX]=(0,w.useState)("7dvol"),[eQ,e0]=(0,w.useState)(""),[e1,e2]=(0,w.useState)(""),[e5,e3]=(0,w.useState)(!1),{isOpen:e8,onOpen:tn,onClose:tr}=(0,c.q)(),ta=(0,b.v9)(e=>e.marketplaceReducer.orderbookAllAcceptedItems);(0,w.useEffect)(()=>{X.mode===en.pz.AdvancedTrading&&X.item&&tT(2)},[X]);let ts=(0,w.useCallback)(e=>{var t,o,i;return"tradeAccepted"==e.reason&&0===e.trade.acceptedBid.erc721s.length&&0===e.trade.acceptedBid.erc1155s.length&&("0"!==e.trade.buyOutEther.toString()&&e.trade.buyOutEther==e.trade.acceptedBid.offeredEther||(null===(t=e.trade.buyOutErc20)||void 0===t?void 0:t.amount.toString())!=="0"&&(null===(o=e.trade.buyOutErc20)||void 0===o?void 0:o.amount)==(null===(i=e.trade.acceptedBid.offeredErc20)||void 0===i?void 0:i.amount))},[]),td=(0,w.useMemo)(()=>null==$?void 0:$.filter(e=>"tradeNewBid"===e.reason||"bidAccepted"===e.reason||"bidRejected"===e.reason||ts(e)),[$,ts]),{playSFX:tc}=(0,et.Q)();(0,w.useEffect)(()=>{tc("sound.hub.marketplace.enter")},[]);let[tu,tp]=(0,w.useState)(""),[tx,th]=(0,w.useState)(""),[tv,tm]=(0,w.useState)(""),[tf,tg]=(0,w.useState)(""),[tw,tb]=(0,w.useState)(!1),[tj,tC]=(0,w.useState)(0),ty=(0,b.v9)(e=>e.inventoryReducer.backpackFilter);(0,w.useEffect)(()=>{var e,t,o,l;ty.rarity=tu,""!=tu?(null===(o=ty.enabledFields)||void 0===o?void 0:o.includes("Rarity"))||null===(l=ty.enabledFields)||void 0===l||l.push("Rarity"):null===(t=ty.enabledFields)||void 0===t||t.splice(null===(e=ty.enabledFields)||void 0===e?void 0:e.indexOf("Rarity"),1),i((0,V.Ve)((0,a._)({},ty)))},[tu]),(0,w.useEffect)(()=>{var e,t,o,l;ty.class=tx,""!=tx?(null===(o=ty.enabledFields)||void 0===o?void 0:o.includes("Class"))||null===(l=ty.enabledFields)||void 0===l||l.push("Class"):null===(t=ty.enabledFields)||void 0===t||t.splice(null===(e=ty.enabledFields)||void 0===e?void 0:e.indexOf("Class"),1),i((0,V.Ve)((0,a._)({},ty)))},[tx]),(0,w.useEffect)(()=>{var e,t,o,l;ty.slot=tv,""!=tv?(null===(o=ty.enabledFields)||void 0===o?void 0:o.includes("Slot"))||null===(l=ty.enabledFields)||void 0===l||l.push("Slot"):null===(t=ty.enabledFields)||void 0===t||t.splice(null===(e=ty.enabledFields)||void 0===e?void 0:e.indexOf("Slot"),1),i((0,V.Ve)((0,a._)({},ty)))},[tv]),(0,w.useEffect)(()=>{var e,t,o,l;ty.scale=tf,""!=tf?(null===(o=ty.enabledFields)||void 0===o?void 0:o.includes("Scale"))||null===(l=ty.enabledFields)||void 0===l||l.push("Scale"):null===(t=ty.enabledFields)||void 0===t||t.splice(null===(e=ty.enabledFields)||void 0===e?void 0:e.indexOf("Scale"),1),i((0,V.Ve)((0,a._)({},ty)))},[tf]),(0,w.useEffect)(()=>{tm(""),tg("")},[ez]),(0,w.useEffect)(()=>{2===eL&&(console.log("Fetching NFTs and Resources for Orderbook"),B(),H(),W(),D())},[eL]),(0,w.useEffect)(()=>{G||E(S.filter(e=>(null==eo?void 0:eo.activeFilter)==="sold"?!e.active&&e.acceptedBid:(null==eo?void 0:eo.activeFilter)==="active"?e.active:(null==eo?void 0:eo.activeFilter)!=="cancelled"||!e.active&&!e.acceptedBid))},[null==eo?void 0:eo.activeFilter,S]);let tS=(0,w.useMemo)(()=>ef||eb?(0,d.jsx)(L,{selectedTab:ez,pageData:eo,setPageData:el,downIcon:(0,d.jsx)(z.Xo,{fill:eh.D.beige}),onReload:()=>i((0,C.LF)({closeDetail:!Z}))}):2===eL?(0,d.jsx)(e4,{typeFilter:e1,sortBy:eJ,setTypeFilter:e2,setSortBy:eX,containFilter:eQ,setContainFilter:e0,downIcon:(0,d.jsx)(z.Xo,{fill:eh.D.beige}),hideFilter:e5||e8,onReload:()=>{i((0,C.zA)())}}):3===eL?(0,d.jsxs)(u.k,{w:"100%",align:"flex-start",className:F().newTradesGridFilter,justifyContent:"flex-start",flexWrap:"nowrap",mb:"2px",gap:"16px",children:[(0,d.jsxs)(p.P,{width:"fit-content",value:null==eo?void 0:eo.dateFilter,size:"sm",onChange:e=>el((0,s._)((0,a._)({},eo),{dateFilter:+e.target.value})),style:(null==eo?void 0:eo.dateFilter)?{color:eh.D.yellow,backgroundColor:"#38332E"}:{color:eh.D.beige,backgroundColor:"#38332E"},icon:(0,d.jsx)(z.Xo,{fill:eh.D.beige}),iconSize:"10px",_hover:{color:eh.D.yellow},_focus:{outline:"none"},_focusVisible:{outline:"none"},children:[(0,d.jsx)("option",{style:{backgroundColor:"#000d"},value:1,children:"Last day"}),(0,d.jsx)("option",{style:{backgroundColor:"#000d"},value:7,children:"Last 7 days"}),(0,d.jsx)("option",{style:{backgroundColor:"#000d"},value:30,children:"Last 30 days"})]}),(0,d.jsxs)(p.P,{width:"fit-content",value:null==eo?void 0:eo.activeFilter,size:"sm",onChange:e=>el((0,s._)((0,a._)({},eo),{activeFilter:e.target.value})),style:(null==eo?void 0:eo.activeFilter)?{color:eh.D.yellow,backgroundColor:"#38332E"}:{color:eh.D.beige,backgroundColor:"#38332E"},icon:(0,d.jsx)(z.Xo,{fill:eh.D.beige}),iconSize:"10px",placeholder:"All Trades",_hover:{color:eh.D.yellow},_focus:{outline:"none"},_focusVisible:{outline:"none"},children:[(0,d.jsx)("option",{style:{backgroundColor:"#000d"},value:"active",children:"Active"}),(0,d.jsx)("option",{style:{backgroundColor:"#000d"},value:"cancelled",children:"Cancelled"}),(0,d.jsx)("option",{style:{backgroundColor:"#000d"},value:"sold",children:"Sold"})]})]}):(0,d.jsx)(L,{pageData:eo,setPageData:el,downIcon:(0,d.jsx)(z.Xo,{fill:eh.D.beige}),onReload:()=>{i((0,C.LF)({closeDetail:!Z})),i((0,V.ZQ)())},hideFilter:void 0!==Z||4===eL}),[ef,eb,eL,tu,tx,tv,tf,Z,eo,el,eJ,e1,eQ,e5,e8,ez]);(0,w.useEffect)(()=>{console.log("getTrades useeffect",Q),Q&&tF(eo,{closeDetail:!1})},[Q,K,eo]),(0,w.useEffect)(()=>{!0==K.closeDetail?i((0,C.J4)(void 0)):(eg(!1),ej(!1))},[K]);let tk=(0,w.useCallback)(()=>{i((0,C.K4)(!0)),te(null==eo?void 0:eo.dateFilter).then(e=>{e&&(A(e.statistics),T(e.topItems),k(e.lastTrades),i((0,C.K4)(!1)))})},[null==eo?void 0:eo.dateFilter,A,T,k,i]),tI=(0,w.useRef)();(0,w.useEffect)(()=>{tI.current&&tI.current.abort();let e=new AbortController;async function t(){return!!P&&await I(P,U,e)}tI.current=e,((null==P?void 0:P.hasMarketStall)==void 0||(null==P?void 0:P.hasMarketStall)==!1)&&t().then(e=>{P&&(P.hasMarketStall=!0)})},[]),(0,w.useEffect)(()=>
1{if(q){if(Z){var e;i((0,C.J4)(null!==(e=q.find(e=>e.id==Z.id))&&void 0!==e?e:Z))}if(eC){let e=q.find(e=>e.id==eC);e?i((0,C.J4)(e)):te(30).then(e=>{if(e){var t;let o=null===(t=e.lastTrades)||void 0===t?void 0:t.find(e=>e.id==eC);o&&i((0,C.J4)(o))}})}}},[q,Z,eC]),(0,w.useEffect)(()=>{Z||ef||eb?ex(!0):ex(!1)},[Z,ef,eb]),(0,w.useEffect)(()=>{3===eL&&tk()},[null==eo?void 0:eo.dateFilter]),(0,w.useEffect)(()=>{2!==eL&&e3(!1)},[eL]);let t_=(0,w.useCallback)(e=>{let{trade:t}=e;return(0,d.jsx)(w.Suspense,{fallback:to(),children:(0,d.jsx)(ti,{trade:t||void 0,account:null!=r?r:void 0,onClick:e=>{i((0,C.J4)(e)),tT(null)}},t?t.id:"")},t?t.id:"")},[i,r]);(0,w.useCallback)(e=>{var t,o,i,l;let n=[];return null===(t=e.erc1155s)||void 0===t||t.forEach(e=>{(null==e?void 0:e.retrievedMetadata)&&n.push(e.retrievedMetadata)}),null===(o=e.erc721s)||void 0===o||o.forEach(e=>{(null==e?void 0:e.retrievedMetadata)&&n.push(e.retrievedMetadata)}),null===(i=e.unclaimedNfts)||void 0===i||i.forEach(e=>{(null==e?void 0:e.retrievedMetadata)&&n.push(e.retrievedMetadata)}),null===(l=e.unclaimedResources)||void 0===l||l.forEach(e=>{(null==e?void 0:e.retrievedMetadata)&&n.push(e.retrievedMetadata)}),n},[]);let tN=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];let t=[];e.filter(e=>!e.voided&&e.active).forEach(e=>t.push(t_({trade:e}))),es(t),i((0,C.K4)(!1))};(0,w.useEffect)(()=>{er.length>0&&i((0,C.K4)(!1))},[er]);let tE=(0,w.useRef)(!1),tF=(0,w.useCallback)(async(e,t)=>{if(tE.current||!Q)return;let{closeDetail:o}=t;tE.current=!0;let l=setTimeout(()=>{tE.current=!1},5e3);null==Q||Q.emit("activeTradesPaginated",e,e=>{try{var t,o;console.log("All Trades, ",e),null===(t=e.activeTrades)||void 0===t||t.forEach(e=>{var t,o,i;(null===(t=e.composedNfts)||void 0===t?void 0:t[0])&&(e.composedNfts[0].equipped=null===(i=e.composedNfts)||void 0===i?void 0:null===(o=i[0].children)||void 0===o?void 0:o.slice())}),200==e.status&&(i((0,C.Cf)(e.activeTrades)),tN(e.activeTrades||[]),e.total==(null===(o=e.activeTrades)||void 0===o?void 0:o.length)?eY(!0):eY(!1)),tE.current=!1,clearTimeout(l)}catch(e){console.error("Error in activeTrades",e)}})},[Q,r]),tM=(0,w.useCallback)(()=>{i((0,V.s9)()),i((0,C.LF)({closeDetail:!0})),i((0,j.vl)(void 0)),eN(""),eF(""),eA(0),tp(""),th(""),tm(""),tg(""),eD("Equippables"),eg(!1),ej(!1)},[i]),tA=(0,w.useCallback)(()=>{tM(),i((0,C.J4)(void 0)),i((0,j.VZ)(!1))},[i]),tR=(0,w.useCallback)(()=>{if(Z&&ef||Z&&eb||Z&&3===eL)i((0,C.J4)(null==q?void 0:q.find(e=>e.id==Z.id))),tT(eW);else if(2===eL)e8?tr():e5?(e3(!1),i((0,j.wW)({mode:en.pz.Inactive,item:void 0,suggestedQuantity:0}))):tT(eW);else{var e;i((0,C.J4)(void 0)),tT(eW),(null===(e=o.query)||void 0===e?void 0:e.mId)&&eS("")}tM()},[i,Z,ef,eb,eL,eW,e5,q,o,e8]),tT=(0,w.useCallback)(e=>{4===e||3===e||2===e||0===e||1===e?eP(1):0===eL?eP(1):eP(eL),3===e?tC(S.findIndex(e=>e.id==(null==Z?void 0:Z.id))):tC(-1),eH(e)},[S,Z,eL,tC,eH]),[tz,tD]=(0,w.useState)(!1),tL=(0,w.useCallback)(()=>{tD(!0),eS(void 0),i((0,C.J4)(void 0)),o.push("/game")},[o,i]);return(0,d.jsxs)(d.Fragment,{children:[O&&(0,d.jsx)(e6.Z,{maxWidth2xl:"65%",onClick:()=>{J&&i((0,j.zt)(!1))},isOpen:O,onClose:eC?tL:tA,onBack:ef||Z||!(2>(eL||0))?tR:void 0,selectedTabIndex:eL,setSelectedTabIndex:tT,filters:tS,scrollToTop:e5,onAdd:()=>{tT(null),eg(!0)},overflow:2===eL?"clip":"auto",currentBalance:eU,tabs:[{icon:(0,d.jsx)(z.p3,{}),layover:(0,d.jsx)(ey,{myTabIndex:0,selectedTabIndex:eL,account:r,setSelectedTabIndex:tT,setInProgress:tb}),tooltip:"Notifications",showBadge:(null==td?void 0:td.length)>0,onClick:()=>{0===eL&&tT(1)}},{icon:(0,d.jsx)(z.P5,{}),tooltip:"Bartering",onClick:()=>{}},{icon:(0,d.jsx)(z.Zv,{}),tooltip:"Auction House",content:(0,d.jsx)(e9,{containFilter:eQ,typeFilter:e1,sortBy:eJ,newOrderViewActive:e5,getFullItem:function(e){let t=ta[e.acceptedItemId];return{collection:null==t?void 0:t.collection,collectionType:(null==t?void 0:t.acceptedType)===y.n$.Resource?y.yl.ERC1155:y.yl.ERC721,itemId:null==t?void 0:t.itemId,metadata:null==t?void 0:t.metadata,sellPrice:e.sellPrice,buyPrice:e.buyPrice,currency:e.currency,currencySymbol:e.currencySymbol,change24h:e.change24h,change7d:e.change7d,change30d:e.change30d,volume24h:e.volume24h,volume7d:e.volume7d,volume30d:e.volume30d,haveBought:e.haveBought,haveSold:e.haveSold}},setContainFilter:e0,setOrderbookNewOrderViewActive:e3,isLogsOpen:e8,onLogsOpen:tn,onLogsClose:tr}),disabled:!1,onClick:()=>{}},{icon:(0,d.jsx)(z.dg,{}),tooltip:"Analytics",content:(0,d.jsx)(eR,{lastTrades:N,statistics:M,topItems:R,isLoading:G,setSelectedTabIndex:tT,scrollPosition:tj}),disabled:!1,onClick:()=>{i((0,C.J4)(void 0)),tk()}},{icon:(0,d.jsx)(x.x,{as:eT.VzH,width:"100%",height:"100%"}),tooltip:"Your In-Market Items",content:(0,d.jsx)(eB,{}),onClick:()=>{}}],children:er&&!G?(0,d.jsxs)(d.Fragment,{children:[ef?(0,d.jsx)(em,{forcedRefresh:ek,setForcedRefresh:eI,tradeMessage:e_,setTradeMessage:eN,tradeTitle:eE,setTradeTitle:eF,tradeFee:eM,setTradeFee:eA,onClose:tM,selectedTab:ez,setSelectedTab:eD}):eb&&Z?(0,d.jsx)(ew,{trade:Z,forcedRefresh:ek,setForcedRefresh:eI,onClose:tM,selectedTab:ez,setSelectedTab:eD}):ep&&Z&&(0,d.jsx)(tl,{inProgress:tw,setInProgress:tb,trade:Z,setPlaceBidViewOpen:ej}),(0,d.jsx)(h.M,{w:"100%",h:"100%",hidden:ep,flexDir:"column",children:er?(0,d.jsxs)(v.M,{h:"99%",w:"100%",minChildWidth:"164px",spacingX:"83px",spacingY:"47px",pl:"58px",pr:"40px",pb:5,pt:9,overflowY:"scroll",justifyItems:"center",justifyContent:"center",gridAutoRows:"max-content",templateColumns:"repeat(auto-fill, minmax(164px, 164px))",className:F().newmarket,children:[er,(null==er?void 0:er.length)>0&&!eV&&(0,d.jsx)(m.P,{colSpan:1,gridColumn:"1 / -1",children:(0,d.jsx)(u.k,{alignItems:"center",justifyContent:"center",w:"100%",children:(0,d.jsx)(ei.Z,{text:"Load More..",onClick:()=>{el((0,s._)((0,a._)({},eo),{page:eo.page+1}))}})})})]}):(0,d.jsx)(h.M,{w:"100%",h:"100%",children:(null==eo?void 0:eo.mineFilter)==="trades"?(0,d.jsx)(f.x,{children:"You have no active trades."}):(null==eo?void 0:eo.mineFilter)==="bids"?(0,d.jsx)(f.x,{children:"You have no active bids."}):(0,d.jsx)(g.$,{size:"lg"})})})]}):(0,d.jsx)(h.M,{w:"100%",h:"100%",children:(0,d.jsx)(g.$,{size:"lg"})})}),tz&&(0,d.jsx)(h.M,{w:"100vw",h:"100vh",zIndex:1e6,bgColor:"rgba(0,0,0,0.8)",children:(0,d.jsx)(g.$,{size:"xl",color:"white"})})]})}},54331:function(e,t,o){"use strict";o.d(t,{s:function(){return f}});var i=o(85893),l=o(90944),n=o.n(l),r=o(67294),a=o(18118),s=o(26972),d=o(15715),c=o(37945),u=o(74032),p=o(92041),x=o(86384),h=o(47854),v=o(45007),m=o(77286);function f(e){var t,o,l,f,g,w,b,j,C,y,S,k,I;let{asset:_,slotSize:N,colorScheme:E,newStyle:F,isEscrowed:M,onSelect:A,disabled:R}=e,T=(0,v.I0)(),[z,D]=(0,r.useState)(0),L=(0,v.v9)(e=>e.inventoryReducer.itemInHand),B=(0,v.v9)(e=>e.marketplaceReducer.removeFromEscrow);(0,r.useEffect)(()=>{(null==_?void 0:_.id)&&B.nfts&&B.nfts.find(e=>e.contractAddress==(null==_?void 0:_.contractAddress)&&e.id==(null==_?void 0:_.id))?D(1):D(0)},[B]);let H=(null==L?void 0:null===(t=L.nft)||void 0===t?void 0:t.id)!==(null==_?void 0:_.id)?(0,x.WR)((null==_?void 0:null===(o=_.retrievedMetadata)||void 0===o?void 0:o.inventoryUri)||(null==_?void 0:null===(l=_.retrievedMetadata)||void 0===l?void 0:l.thumbnailUri)||(null==_?void 0:null===(f=_.retrievedMetadata)||void 0===f?void 0:f.thumbnailURI)):void 0,W=null==_?void 0:null===(b=_.retrievedMetadata)||void 0===b?void 0:null===(w=b.properties)||void 0===w?void 0:null===(g=w.Rarity)||void 0===g?void 0:g.value,O="";return O=F?0!=z?n().activeSelection:_?"Rare"==W?n().rareItemNew:"Epic"==W?n().epicItemNew:"Legendary"==W?n().legendaryItemNew:n().commonItemNew:n().emptySlot:_?"Rare"==W?n().rareItem:"Epic"==W?n().epicItem:"Legendary"==W?n().legendaryItem:n().commonItem:n().emptySlot,(0,i.jsx)(a.U,{w:N,h:N,className:O,bgColor:"light"==E?"#2229":"#3338",alignItems:"center",justifyContent:"center",children:(0,i.jsx)(s.u,{wordBreak:"break-word",label:(0,m.Z)({metadata:null==_?void 0:_.retrievedMetadata,asset:(null==_?void 0:_.id)?{nft:{id:_.id}}:void 0,image:H}),placement:"auto",p:0,bgColor:"transparent",children:(0,i.jsxs)(d.M,{cursor:"pointer",w:N,h:N,position:"relative",padding:"2px",rounded:"10px",onClick:e=>{R||(null==L?void 0:L.nft)||!_||(e.shiftKey||e.metaKey?window.open("https://singular.app/collectibles/moonbeam/".concat(null==_?void 0:_.contractAddress,"/").concat(null==_?void 0:_.tokenId)):(A&&T(A({nft:_,isEscrowed:M})),T((0,h.Ns)({nft:_}))))},children:[H&&(0,i.jsx)(p.yZ,{src:H,width:1*(N||0),height:1*(N||0),rounded:"10px",o
1pacity:1}),(null==_?void 0:null===(y=_.retrievedMetadata)||void 0===y?void 0:null===(C=y.properties)||void 0===C?void 0:null===(j=C.Scale)||void 0===j?void 0:j.value)==="Heavyweight"&&(0,i.jsx)(c.E,{position:"absolute",w:"25px",h:"25px",right:"4px",bottom:"4px",src:"/Resources/heavy.png"}),(null==_?void 0:null===(I=_.retrievedMetadata)||void 0===I?void 0:null===(k=I.properties)||void 0===k?void 0:null===(S=k.Scale)||void 0===S?void 0:S.value)==="Featherweight"&&(0,i.jsx)(c.E,{position:"absolute",w:"25px",h:"25px",right:"4px",bottom:"4px",src:"/Resources/feather.png"}),(0,i.jsx)(u.C,{colorScheme:"red",position:"absolute",top:0,right:0})]})},(null==_?void 0:_.id)+"-tooltip")},null==_?void 0:_.id)}},47516:function(e,t,o){"use strict";function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0;if(!t)return!1;let i=t.playerAddress,l=e.filter(e=>e.ownerAddress===i),n=e.map(e=>e.bids).flat().filter(e=>(null==e?void 0:e.ownerAddress)===i),r=l.some(e=>{var i,l,n,r;return e.id!=o.id&&((null===(i=e.erc1155s)||void 0===i?void 0:i.some(e=>{var i;return null===(i=o.erc1155s)||void 0===i?void 0:i.some(o=>o.tokenId===e.tokenId&&t.erc1155s.find(t=>t.id===o.tokenId&&t.amount-o.amount<e.amount))}))||(null===(l=e.unclaimedResources)||void 0===l?void 0:l.some(e=>{var i;return null===(i=o.unclaimedResources)||void 0===i?void 0:i.some(o=>o.resourceId===e.resourceId&&t.unclaimedResources.find(t=>t.resourceId===o.resourceId&&t.amount-o.amount<e.amount))}))||(null===(n=e.unclaimedNfts)||void 0===n?void 0:n.some(e=>{var i;return null===(i=o.unclaimedNfts)||void 0===i?void 0:i.some(o=>o.itemId===e.itemId&&o.contractAddress===e.contractAddress&&t.unclaimedNfts.find(t=>t.itemId===o.itemId&&t.contractAddress==o.contractAddress&&t.amount-o.amount<e.amount))}))||(null===(r=e.erc721s)||void 0===r?void 0:r.some(e=>{var t;return null===(t=o.erc721s)||void 0===t?void 0:t.some(t=>t.contractAddress===e.contractAddress&&t.tokenId===e.tokenId)}
1)))}),a=n.some(e=>{var i,l,n,r;return e.id!=o.id&&((null===(i=e.erc1155s)||void 0===i?void 0:i.some(e=>{var i;return null===(i=o.erc1155s)||void 0===i?void 0:i.some(o=>o.tokenId===e.tokenId&&t.erc1155s.find(t=>t.id===o.tokenId&&t.amount-o.amount<e.amount))}))||(null===(l=e.unclaimedResources)||void 0===l?void 0:l.some(e=>{var i;return null===(i=o.unclaimedResources)||void 0===i?void 0:i.some(o=>o.resourceId===e.resourceId&&t.unclaimedResources.find(t=>t.resourceId===o.resourceId&&t.amount-o.amount<e.amount))}))||(null===(n=e.unclaimedNfts)||void 0===n?void 0:n.some(e=>{var i;return null===(i=o.unclaimedNfts)||void 0===i?void 0:i.some(o=>o.itemId===e.itemId&&o.contractAddress===e.contractAddress&&t.unclaimedNfts.find(t=>t.itemId===o.itemId&&t.contractAddress==o.contractAddress&&t.amount-o.amount<e.amount))}))||(null===(r=e.erc721s)||void 0===r?void 0:r.some(e=>{var t;return null===(t=o.erc721s)||void 0===t?void 0:t.some(t=>t.contractAddress===e.contractAddress&&t.tokenId===e.tokenId)})))});return r||a}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,l=t.filter(t=>t.ownerAddress===e),n=t.map(e=>e.bids).flat().filter(t=>(null==t?void 0:t.ownerAddress)===e&&!(null==t?void 0:t.withdrawnBlock)&&!(null==t?void 0:t.rejectedBlock)&&!(null==t?void 0:t.acceptedBlock));return{tradesWithItem:l.filter(e=>{var t,l,n,r,a;return(null===(t=e.erc1155s)||void 0===t?void 0:t.some(e=>{var t;return null===(t=o.resources)||void 0===t?void 0:t.some(t=>t.resourceId===e.tokenId&&i.erc1155s.find(o=>o.resourceId===t.resourceId&&o.amount-t.amount<e.amount))}))||(null===(l=e.unclaimedResources)||void 0===l?void 0:l.some(e=>{var t;return null===(t=o.resources)||void 0===t?void 0:t.some(t=>t.resourceId===e.resourceId&&i.unclaimedResources.find(o=>o.resourceId===t.resourceId&&o.amount-(t.unclaimedAmount||0)<e.amount))}))||(null===(n=e.unclaimedNfts)||void 0===n?void 0:n.some(e=>{var t;return null===(t=o.unclaimedNfts)||void 0===t?void 0:t.some(t=>t.itemId===e.itemId&&t.contractAddress===e.contractAddress&&i.unclaimedNfts.find(o=>o.itemId===t.itemId&&o.contractAddress==t.contractAddress&&o.amount-t.amount<e.amount))}))||(null===(r=e.erc721s)||void 0===r?void 0:r.some(e=>{var t;return null===(t=o.nfts)||void 0===t?void 0:t.some(t=>t.contractAddress===e.contractAddress&&t.tokenId===e.tokenId)}
1))||(null===(a=e.composedNfts)||void 0===a?void 0:a.some(e=>{var t;return null===(t=o.soulNfts)||void 0===t?void 0:t.some(t=>t.address===e.address&&t.tokenId===e.tokenId)}))}),bidsWithItem:n.filter(e=>{var t,l,n,r,a,s;return(null===(t=e.erc1155s)||void 0===t?void 0:t.some(e=>{var t;return null===(t=o.resources)||void 0===t?void 0:t.some(t=>t.resourceId===e.tokenId&&i.erc1155s.find(o=>o.id===t.resourceId&&o.amount-t.amount<e.amount))}))||(null===(l=e.unclaimedResources)||void 0===l?void 0:l.some(e=>{var t;return null===(t=o.resources)||void 0===t?void 0:t.some(t=>t.resourceId===e.resourceId&&i.unclaimedResources.find(o=>o.resourceId===t.resourceId&&o.amount-(t.unclaimedAmount||0)<e.amount))}))||(null===(n=e.unclaimedNfts)||void 0===n?void 0:n.some(e=>{var t;return null===(t=o.unclaimedNfts)||void 0===t?void 0:t.some(t=>t.itemId===e.itemId&&t.contractAddress===e.contractAddress&&i.unclaimedNfts.find(o=>o.itemId===t.itemId&&o.contractAddress==t.contractAddress&&o.amount-t.amount<e.amount))}))||(null===(r=e.erc721s)||void 0===r?void 0:r.some(e=>{var t;return null===(t=o.nfts)||void 0===t?void 0:t.some(t=>t.contractAddress===e.contractAddress&&t.tokenId===e.tokenId)}
1))||(null===(a=e.composedNfts)||void 0===a?void 0:a.some(e=>{var t;return null===(t=o.soulNfts)||void 0===t?void 0:t.some(t=>t.address===e.address&&t.tokenId===e.tokenId)}))||(null===(s=o.erc20s)||void 0===s?void 0:s.find(t=>{var o;return t.contractAddress===(null===(o=e.offeredErc20)||void 0===o?void 0:o.contractAddress)&&e.offeredErc20.amount>0&&i.erc20s.find(o=>o.contractAddress===t.contractAddress&&o.amount-t.amount<e.offeredErc20.amount)}))||BigInt(null==i?void 0:i.ether)-(BigInt(o.ether||0)||BigInt(0))<(e.offeredEther||BigInt(0))})}}o.d(t,{P:function(){return i},w:function(){return l}})},65665:function(e,t,o){"use strict";o.d(t,{R2:function(){return x},V7:function(){return p}});var i=o(15339),l=o(4794),n=o(59721),r=o(60716),a=o(2593),s=o(35553),d=o(56371),c=o(42875);async function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;return console.log("Confirm connectivity",e),null!=e&&!!e.connected&&new Promise(o=>{setTimeout(()=>{o(!1)},t),console.log("socket [DEBUG] pinging"),null==e||e.emit("ping",e=>{try{console.log("socket [DEBUG] ping response",e),o(200==e.status)}catch(e){console.error("Error in confirmConnectivity",e)}})})}async function p(e,t,o,n,p,x,m,f,g,w,b,j){let C;console.log("globalSocket",w);let y=(0,l.Li)({id:n});if(n&&"moonbeam"!=n&&!y)return console.log("supportedTokensByNetwork",n,y),console.error("Invalid token type"),0;let S=t?(0,d.parseEther)(t):a.O$.from(0),k=o?s.parseUnits(o,null==y?void 0:y.decimals):a.O$.from(0),I=await (0,r.uz)(f,m);if(j(C=b.marketplace?"meta-createTrade-"+I:"createTrade-"+I),g&&g((0,c.y0)({groupId:C,title:"Creating New Trade",subtitle:p,action:{type:"trade"},transactions:[],network:m.network.name||"unknown",icon:"\uD83D\uDD04"})),!await h(e,a.O$.from(0),(null==y?void 0:y.address)||"",m,g,"createTrade-"+p))return 0;g&&g((0,c.Ug)({groupId:C,status:"confirmed",text:"Approvals OK",icon:"\uD83D\uDFE2",id:"approvals-"+p}));let _=await u(w,1e4);return(console.log("connected",_),_)?(await v(w,I,p,x,f),g&&g((0,c.Ug)({groupId:C,status:"confirmed",text:"Trade metadata",icon:"\uD83D\uDFE2",id:"backend-connection-"+p})),await (0,r.TR)(e,S,k,(null==y?void 0:y.address)||"",m,g,C,b,w).catch(e=>(console.log("launch errored:",e),0))):(g&&g((0,i.h)({text:"No connection to backend",icon:"\uD83D\uDD0C",waitingTime:5e3})),g&&g((0,c.Ug)({groupId:C,status:"error",text:"Unable to set trade metadata. Refresh and try again.",icon:"\uD83D\uDD0C",id:"backend-connection-"+p})),0)}async function x(e,t,o,i,n,u,p,x,v,m,f,g,w){let b;console.log("launchNewBid",t,o,i,n,v,m),b=g.marketplace?"meta-createBid-"+e.id:"createBid-"+e.id,f((0,c.y0)({groupId:b,title:"Creating a New Bid",subtitle:e.title||void 0,action:{type:"bid"},network:v.network.name||"unknown",transactions:[],icon:"\uD83D\uDCB0"}));let j=(0,l.Li)({id:n});if(n&&"moonbeam"!=n&&!j)return console.log("supportedTokensByNetwork",n,j),console.error("Invalid token type"),0;console.log("Approvals OK");let C=o?(0,d.parseEther)(o):a.O$.from(0),y=i?s.parseUnits(i,null==j?void 0:j.decimals):a.O$.from(0);return await h(t,y,(null==j?void 0:j.address)||null,v,f,b)?(f&&f((0,c.Ug)({groupId:b,status:"confirmed",text:"Approvals OK",icon:"\uD83D\uDFE2",id:"approvals-"+e.id})),await (0,r.m)(e.id,t,C,y,(null==j?void 0:j.address)||null,x,v,f,b,g,w).catch(e=>(console.log("launch errored:",e),0))):0}async function h(e,t,o,i,r,a){var s,d,c,u,p,x,h,v,m,f;if((null===(s=e.resources)||void 0===s?void 0:s.length)&&!await (0,n.U)(i,r,a,(0,l.iF)("MarketDiamond"))||(null===(d=e.nfts)||void 0===d?void 0:d.length)&&((null===(x=e.nfts)||void 0===x?void 0:x.find(e=>e.contractAddress.toLowerCase()==(0,l.iF)("NestableLootV2").toLowerCase()))&&!await (0,l.mv)(i,!0,r,a,(0,l.iF)("MarketDiamond"))||(null===(h=e.nfts)||void 0===h?void 0:h.find(e=>e.contractAddress.toLowerCase()==(0,l.iF)("NestableLoot").toLowerCase()))&&!await (0,l.n6)(i,!0,r,a,(0,l.iF)("MarketDiamond"))||(null===(v=e.nfts)||void 0===v?void 0:v.find(e=>e.contractAddress.toLowerCase()==(0,l.iF)("NestableFish").toLowerCase()))&&!await (0,l.v$)(i,!0,r,a,(0,l.iF)("MarketDiamond"))||(null===(m=e.nfts)||void 0===m?void 0:m.find(e=>e.contractAddress.toLowerCase()==(0,l.iF)("NestableFishV2").toLowerCase()))&&!await (0,l.Ee)(i,!0,r,a,(0,l.iF)("MarketDiamond"))||(null===(f=e.nfts)||void 0===f?void 0:f.find(e=>e.contractAddress.toLowerCase()==(0,l.iF)("NestableTriumph").toLowerCase()))&&!await (0,l._N)(i,!0,r,a,(0,l.iF)("MarketDiamond")))||
1(null===(c=e.soulNfts)||void 0===c?void 0:c.find(e=>!e.isStaked&&e.address.toLowerCase()==(0,l.iF)("NestableSoul").toLowerCase()))&&(console.log("soul is NOT staked"),!await (0,l.eT)(i,!0,r,a,(0,l.iF)("MarketDiamond")))||(null===(u=e.soulNfts)||void 0===u?void 0:u.find(e=>e.isStaked&&e.address.toLowerCase()==(0,l.iF)("NestableSoul").toLowerCase()))&&(console.log("soul is STAKED"),!await (0,l.ER)(i,!0,r,a,(0,l.iF)("MarketDiamond")))||(null===(p=e.soulNfts)||void 0===p?void 0:p.find(e=>e.isStaked&&e.address.toLowerCase()==(0,l.iF)("Citizens").toLowerCase()))&&(console.log("soul is STAKED"),!await (0,l.ER)(i,!0,r,a,(0,l.iF)("MarketDiamond"))))return!1;if(t&&o){console.log("Checking token",o,t);let e=(0,l.Rj)(i,o);if(!await (0,l.C5)(e,t,(0,l.iF)("MarketDiamond"),i,r,a))return!1}return!0}async function v(e,t,o,i,l){console.log(e,t,o,i,l),await new Promise(n=>{console.log("here we go"),null==e||e.emit("setTradeMetadata",{playerAddress:l,tradeId:t,network:"moonbeam",title:o,message:i},e=>{try{console.log("setTradeMetadata",e),n(e)}catch(e){console.error("Error in setTradeMetadata",e)}})})}o(67642),o(99484),o(71073)},11179:function(e,t,o){"use strict";o.d(t,{Z:function(){return F}});var i=o(85893),l=o(8186),n=o(15715),r=o(90092),a=o(73636),s=o(37945),d=o(64831),c=o(84058),u=o(88329),p=o(51107),x=o(82206),h=o(68029),v=o(48899),m=o(12553),f=o(26972),g=o(12912),w=o(96116),b=o(70339),j=o(86384),C=o(71073),y=o(17544),S=o(98361),k=o(30381),I=o.n(k),_=o(44178),N=o(26218),E=o(67294);function F(e){var t,o,k,F,M,A,R;let{type:T,item:z,children:D,content:L,updateUnits:B,units:H,ownedUnits:W,isChecked:O,checkboxDisabled:P,onChangeInstant:U,openAdvancedTrading:q,onChangeCustomUnitPrice:G,customUnitPriceInput:Z,formatedTotalPrice:V,currentPrice:Y,lastSalePrice:$,lastSaleDate:K,closeModal:J,isLoading:X,mainBtnDisabled:Q,onClickMainBtn:ee,advancedTradingMode:et,currentCurrency:eo,orders:ei,ordersPerPrice:el,cancelOrderAtPrice:en,currencyConversion:er}=e,{user:ea}=(0,S.s)(),es=null==ea?void 0:null===(t=ea.wallet)||void 0===t?void 0:t.address,ed="".concat(null==z?void 0:null===(F=z.retrievedMetadata)||void 0===F?void 0:null===(k=F.properties)||void 0===k?void 0:null===(o=k.Rarity)||void 0===o?void 0:o.value)||"common",ec=(0,E.useMemo)(()=>(0,C.kg)(ed),[ed]),eu=(0,E.useMemo)(()=>{var e,t,o;return(0,j.WR)((null==z?void 0:null===(e=z.retrievedMetadata)||void 0===e?void 0:e.thumbnailUri)||(null==z?void 0:null===(t=z.retrievedMetadata)||void 0===t?void 0:t.imageUri)||(null==z?void 0:null===(o=z.retrievedMetadata)||void 0===o?void 0:o.image))},[z]),ep=(0,E.useMemo)(()=>Object.keys(el[eo||""]||{}).sort((e,t)=>"sell"===T?Number((0,y.f)(e))-Number((0,y.f)(t)):Number((0,y.f)(t))-Number((0,y.f)(e))),[el,eo,T]),ex=(0,E.useCallback)(e=>{var t;if(!eo||!ei[eo])return 0n;let o=null===(t=ei[eo])||void 0===t?void 0:t.filter(t=>t.unitPrice===e&&t.trader.toLowerCase()===(null==es?void 0:es.toLowerCase()));return(null==o?void 0:o.reduce((e,t)=>e+t.quantity+t.unclaimedQuantity,0n))||0n},[ei,eo,es]);return z?(0,i.jsxs)(l.g,{w:"307px",h:"100%",alignItems:"center",justifyContent:"center",gap:"14px",spacing:0,filter:"drop-shadow(0px 0px 40px black)",children:[(0,i.jsx)(n.M,{w:"100%",h:"30px",borderRadius:"5px",bgColor:"#0A0A09",outline:"3px solid ".concat("buy"===T?b.D.green:b.D.red),px:"4px",children:(0,i.jsxs)(r.x,{fontSize:"16px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"16px",letterSpacing:0,color:b.D.white,textAlign:"center",children:["I want to"," ",(0,i.jsx)("span",{style:{color:"buy"===T?b.D.green:b.D.red},children:"buy"===T?"Buy":"Sell"})," ",(0,i.jsx)("span",{style:{color:ec},children:null==z?void 0:null===(M=z.retrievedMetadata)||void 0===M?void 0:M.name})]})}),!et&&(0,i.jsx)(N.Z,{currentPrice:Y,lastSalePrice:$,lastSaleDate:K}),(0,i.jsxs)(l.g,{w:"100%",h:"min-content",borderRadius:"5px",bgColor:"#0A0A09",outline:"3px solid ".concat(b.D.brown),p:"15px",gap:"20px",spacing:0,pos:"relative",children:[!et&&(0,i.jsx)(n.M,{pos:"absolute",top:"5px",right:"5px",w:"20px",h:"20px",borderRadius:"5px",bgColor:b.D.brown,onClick:J,cursor:"pointer",filter:"drop-shadow(2px 2px 0px black)",_hover:{filter:"drop-shadow(2px 2px 0px ".concat(b.D.red,")")},children:(0,i.jsx)(g.Xk,{fill:b.D.red,width:"14px",height:"14px"})}),!et&&(0,i.jsxs)(a.U,{children:[(0,i.jsx)(n.M,{boxSize:"60px",minW:"60px",border:"3px solid ".concat(ec),bgColor:"#0A0A09",boxShadow:"0px 0px 10px 2px ".concat(ec," inset"),overflow:"visible",zIndex:30,borderRadius:"6px",children:eu&&(0,i.jsx)(s.E,{src:eu,width:"100%",height:"100%",maxH:"60px",objectFit:"fill"})}),(0,i.jsx)(r.x,{fontSize:"24px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"22px",letterSpacing:0,color:ec,children:null==z?void 0:null===(A=z.retrievedMetadata)||void 0===A?void 0:A.name})]}),!et&&(0,i.jsx)(d.i,{borderColor:b.D.brown}),L,(0,i.jsx)(d.i,{borderColor:b.D.brown}),(0,i.jsxs)(l.g,{w:"100%",alignItems:"flex-start",spacing:0,className:I().newTradesGridFilter,children:[(0,i.jsxs)(r.x,{fontFamily:"Grenze",fontWeight:"normal",color:"white",fontSize:"16px",lineHeight:"18px",letterSpacing:0,children:["How many do you wish to ","buy"===T?"buy":"sell","?"]}),(0,i.jsx)(a.U,{w:"100%",justifyContent:"center",spacing:0,children:(0,i.jsx)(c.Y2,{w:"100%",className:I().tradeInput,defaultValue:0,precision:0,onChange:B,onKeyDown:e=>{e.stopPropagation()},value:H,max:W||9999999,min:1,step:1,size:"sm",style:H?{color:b.D.yellow}:{color:b.D.beige,backgroundColor:"#0000"},_focus:{outline:"none"},children:(0,i.jsx)(c.zu,{pl:"10px",pr:0,_placeholder:{opacity:1,color:"#38332E"},_focus:{outline:"none"}})})})]}),(0,i.jsxs)(a.U,{w:"100%",gap:"20px",justifyContent:"left",spacing:0,children:[(0,i.jsx)(u.k,{w:"50%",justifyContent:"left",children:(0,i.jsx)(p.X,{isChecked:O,isDisabled:P,iconColor:"#b00b00",color:"white",colorScheme:"white",onCh
1ange:U,children:(0,i.jsxs)(r.x,{color:"white",fontSize:"16px",fontFamily:"Grenze",fontWeight:"normal",lineHeight:"18px",letterSpacing:0,children:["Instant ","buy"===T?"Buy":"Sell"]})})}),(0,i.jsx)(u.k,{w:"50%",justifyContent:"right",children:!et&&(0,i.jsx)(w.Z,{onClick:q,children:(0,i.jsx)(r.x,{px:"5px",fontSize:"16px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"15px",letterSpacing:"0.02em",children:"Advanced Trading"})})})]}),!O&&(0,i.jsxs)(l.g,{w:"100%",alignItems:"flex-start",spacing:0,children:[(0,i.jsx)(a.U,{w:"100%",gap:"5px",justifyContent:"left",spacing:0,children:(0,i.jsxs)(r.x,{fontFamily:"Grenze",fontWeight:"normal",color:"white",fontSize:"16px",lineHeight:"18px",letterSpacing:0,children:["At what price do you wish to ","buy"===T?"buy":"sell","?"]})}),(0,i.jsx)(a.U,{w:"100%",justifyContent:"center",spacing:0,className:I().newTradesGridFilter,children:(0,i.jsx)(x.I,{w:"100%",className:I().tradeInput,value:Z,onChange:G,onKeyDown:e=>{e.stopPropagation()},onBlur:()=>{""!==Z&&Z||G({target:{value:"0"}})},size:"sm",style:Z?{color:b.D.yellow}:{color:b.D.beige,backgroundColor:"#0000"},_focus:{outline:"none"}})})]}),!O&&(0,i.jsxs)(r.x,{w:"105%",color:"#7E7E7E",fontSize:"16px",fontFamily:"Grenze",fontWeight:"light",fontStyle:"italic",lineHeight:"18px",letterSpacing:0,textAlign:"center",children:["buy"===T&&"A Buy Order will be placed at your wished price and will be processed if someone sells at this price.","sell"===T&&"A Sell Order will be placed at your wished price and will be processed if someone buys at this price."]}),(0,i.jsx)(d.i,{borderColor:b.D.brown}),(0,i.jsx)(r.x,{color:"#7E7E7E",fontSize:"18px",fontFamily:"Grenze",fontWeight:"light",fontStyle:"italic",lineHeight:"18px",letterSpacing:0,textAlign:"center",children:(0,i.jsxs)("span",{children:["You are about to"," ","buy"===T?O?"buy":"place a Buy Order for":O?"sell":"place a Sell Order for"," ",(0,i.jsxs)("span",{style:{fontWeight:"500"},children:[H," ",null==z?void 0:null===(R=z.retrievedMetadata)||void 0===R?void 0:R.name]})," ",!!V&&(0,i.jsxs)(i.Fragment,{children:["for a total price of"," ",(0,i.jsxs)(h.x,{display:"inline-flex",w:"min-content",alignItems:"flex-end",children:[(0,i.jsx)(h.x,{display:"inline",color:b.D.yellow,fontWeight:"medium",children:V}),(0,i.jsx)(g.WI,{fill:b.D.yellow,width:"16px",height:"12px"}),(0,i.jsx)("span",{style:{color:"white"},children:"(".concat((0,_.x)(Number(V)*er),")")})]})]})]})}),(0,i.jsx)(n.M,{w:"100%",children:(0,i.jsx)(a.U,{h:"28px",bgColor:b.D.brown,borderRadius:"5px",px:"8px",fill:Q||X?"black":b.D.beige,color:Q||X?"black":b.D.beige,filter:"drop-shadow(4px 4px 0px black)",cursor:Q||X?"not-allowed":"pointer",spacing:0,gap:"6px",transition:"all 0.3s ease",_hover:{fill:Q||X?"black":"buy"===T?b.D.green:b.D.red,color:Q||X?"black":"buy"===T?b.D.green:b.D.red,filter:!Q&&!X&&"drop-shadow(4px 4px 0px ".concat("buy"===T?b.D.green:b.D.red,")")},onClick:()=>{Q||X||ee()},children:X?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(v.$,{size:"sm"}),(0,i.jsx)(r.x,{fontSize:"20px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"30px",letterSpacing:0,children:"Loading.."})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m.J,{width:"15px",height:"12px",viewBox:"0 0 15 12",children:(0,i.jsx)("path",{d:"M12.0679 0.215925C11.906 0.0954291 11.6778 0.124686 11.5515 0.282124L5.94444 7.27273L3.08438 4.59838C2.94233 4.46556 2.72232 4.46336 2.57765 4.59332L0.801982 6.18846C0.639213 6.33468 0.63568 6.58862 0.794318 6.73932L6.03976 11.722C6.19779 11.8721 6.45007 11.8563 6.58816 11.6877L14.2511 2.32988C14.3867 2.16436 14.3565 1.91918 
114.1849 1.79146L12.0679 0.215925Z"})}),(0,i.jsx)(r.x,{fontSize:"20px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"30px",letterSpacing:0,children:O?"buy"===T?"Buy"+(Q?"":" for "):"Sell"+(Q?"":" for "):"buy"===T?"Place Buy Order":"Place Sell Order"}),O&&!Q&&(0,i.jsxs)(a.U,{spacing:0,children:[(0,i.jsx)(r.x,{fontSize:"20px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"30px",letterSpacing:0,color:b.D.yellow,children:V}),(0,i.jsx)(n.M,{mt:"5px",children:(0,i.jsx)(g.WI,{fill:b.D.yellow,width:"16px",height:"12px"})})]})]})})}),D]}),et&&(0,i.jsxs)(a.U,{w:"100%",h:"32px",borderRadius:"5px",bgColor:"#0A0A09",outline:"3px solid ".concat(b.D.brown),justifyContent:"center",fill:"buy"===T?b.D.green:b.D.red,children:[(0,i.jsxs)(m.J,{width:"12px",height:"14px",viewBox:"0 0 12 14",children:[(0,i.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.501899 8.28469C0.489186 8.08914 0.540528 7.8946 0.649137 7.72679C0.757745 7.55899 0.918505 7.42582 1.11016 7.34489C1.30182 7.26396 1.51535 7.23909 1.72252 7.27356L2.89674 7.47176C2.69967 5.67114 2.8672 3.8026 3.86418 2.36931C5.03421 0.687229 7.22777 -0.240362 10.7586 0.0540433L10.7608 0.0542329C11.2848 0.099846 11.4675 0.536987 11.4949 0.774626C11.5229 1.01724 11.4454 1.43589 11.0159 1.62161C10.2552 1.94945 9.31491 2.52706 8.69234 3.50446C8.12723 4.39165 7.78776 5.66411 8.15859 7.49481L9.46598 7.27382C9.67351 7.23892 9.88803 7.26351 10.0801 7.34449C10.2722 7.42546 10.4333 7.5589 10.5421 7.72711C10.6508 7.89531 10.702 8.09032 10.6889 8.28624C10.6758 8.48216 10.599 8.66975 10.4687 8.82409L6.41236 13.6303C6.31508 13.7454 6.19079 13.8387 6.04924 13.9027C5.90769 13.9667 5.75238 14 5.59503 14C5.43767 14 5.28236 13.9667 5.14081 13.9027C4.99927 13.8387 4.87517 13.7457 4.77789 13.6305L0.729792 8.83295C0.726598 8.82934 0.723446 8.82569 0.720337 8.82198C0.590782 8.6676 0.514612 8.48024 0.501899 8.28469ZM1.76797 8.35419L3.45526 8.639C3.63534 8.6694 3.82011 8.61702 3.95142 8.49835C4.08274 8.37969 4.14446 8.20932 4.11716 8.04086C3.80354 6.10548 3.91381 4.24038 4.81615 2.94313C5.59726 1.82018 7.06269 1.0031 9.75484 1.05776C9.04182 1.47172 8.28029 2.08137 7.71681 2.966C6.92896 4.20289 6.57059 5.91099 7.16822 8.22873C7.23844 8.50106 7.52491 8.67494 7.82093 8.6249L9.42309 8.35408L5.59504 12.8898L1.76797 8.35419Z"}),(0,i.jsx)("path",{d:"M1.76797 8.35419L3.45526 8.639C3.63534 8.6694 3.82011 8.61702 3.95142 8.49835C4.08274 8.37969 4.14446 8.20932 4.11716 8.04086C3.80354 6.10548 3.91381 4.24038 4.81615 2.94313C5.59726 1.82018 7.06269 1.0031 9.75484 1.05776C9.04182 1.47172 8.28029 2.08137 7.71681 2.966C6.92896 4.20289 6.57059 5.91099 7.16822 8.22873C7.23844 8.50106 7.52491 8.67494 7.82093 8.6249L9.42309 8.35408L5.59504 12.8898L1.76797 8.35419Z"})]}),(0,i.jsxs)(r.x,{fontSize:"20px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"18px",letterSpacing:0,color:"buy"===T?b.D.green:b.D.red,children:["Current ","buy"===T?"Buying":"Selling"," Orders"]}),(0,i.jsxs)(m.J,{width:"12px",height:"14px",viewBox:"0 0 12 14",children:[(0,i.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.4981 8.28469C11.5108 8.08914 11.4595 7.8946 11.3509 7.72679C11.2423 7.55899 11.0815 7.42582 10.8898 7.34489C10.6982 7.26396 10.4846 7.23909 10.2775 7.27356L9.10326 7.47176C9.30033 5.67114 9.1328 3.8026 8.13582 2.36931C6.96579 0.687229 4.77223 -0.240362 1.24137 0.0540433L1.23916 0.0542329C0.715237 0.099846 0.532513 0.536987 0.505097 0.774626C0.477108 1.01724 0.554601 1.43589 0.984055 1.62161C1.74479 1.94945 2.68509 2.52706 3.30766 3.50446C3.87277 4.39165 4.21224 5.66411 3.84141 7.49481L2.53402 7.27382C2.32649 7.23892 2.11197 7.26351 1.91987 7.34449C1.72776 7.42546 1.56665 7.5589 1.45792 7.72711C1.34919 7.89531 1.29799 8.09032 1.3111 8.28624C1.3242 8.48216 1.40101 8.66975 1.53132 8.82409L5.58764 13.6303C5.68492 
113.7454 5.80921 13.8387 5.95076 13.9027C6.09231 13.9667 6.24762 14 6.40497 14C6.56233 14 6.71764 13.9667 6.85919 13.9027C7.00073 13.8387 7.12483 13.7457 7.22211 13.6305L11.2702 8.83295C11.2734 8.82934 11.2766 8.82569 11.2797 8.82198C11.4092 8.6676 11.4854 8.48024 11.4981 8.28469ZM10.232 8.35419L8.54474 8.639C8.36466 8.6694 8.17989 8.61702 8.04858 8.49835C7.91726 8.37969 7.85554 8.20932 7.88284 8.04086C8.19646 6.10548 8.08619 4.24038 7.18385 2.94313C6.40274 1.82018 4.93731 1.0031 2.24516 1.05776C2.95818 1.47172 3.71971 2.08137 4.28319 2.966C5.07104 4.20289 5.42941 5.91099 4.83178 8.22873C4.76156 8.50106 4.47509 8.67494 4.17907 8.6249L2.57691 8.35408L6.40496 12.8898L10.232 8.35419Z"}),(0,i.jsx)("path",{d:"M10.232 8.35419L8.54474 8.639C8.36466 8.6694 8.17989 8.61702 8.04858 8.49835C7.91726 8.37969 7.85554 8.20932 7.88284 8.04086C8.19646 6.10548 8.08619 4.24038 7.18385 2.94313C6.40274 1.82018 4.93731 1.0031 2.24516 1.05776C2.95818 1.47172 3.71971 2.08137 4.28319 2.966C5.07104 4.20289 5.42941 5.91099 4.83178 8.22873C4.76156 8.50106 4.47509 8.67494 4.17907 8.6249L2.57691 8.35408L6.40496 12.8898L10.232 8.35419Z"})]})]}),et&&eo&&(0,i.jsxs)(a.U,{w:"100%",justifyContent:"center",spacing:0,children:[(0,i.jsx)(u.k,{flex:"5",justifyContent:"flex-start",alignItems:"center",children:(0,i.jsx)(r.x,{fontSize:"18px",fontFamily:"Grenze",fontWeight:"normal",lineHeight:"16px",letterSpacing:0,color:b.D.white,children:"Quantity"})}),(0,i.jsx)(u.k,{flex:"4",justifyContent:"flex-start",alignItems:"center",children:(0,i.jsx)(r.x,{fontSize:"18px",fontFamily:"Grenze",fontWeight:"normal",lineHeight:"16px",letterSpacing:0,color:b.D.white,ml:"6px",children:"Price per Item"})})]}),et&&eo&&ei[eo]&&(0,i.jsx)(l.g,{w:"100%",gap:"8px",spacing:0,children:ep.map((e,t)=>(0,i.jsxs)(a.U,{w:"100%",pos:"relative",justifyContent:"space-between",children:[ex((0,y.f)(e))&&(0,i.jsx)(m.J,{pos:"absolute",left:"-17px",width:"10px",height:"10px",viewBox:"0 0 10 10",children:(0,i.jsx)("path",{d:"M9.35227 3.98399C10.2159 4.42682 10.2159 5.57318 9.35227 6.01601L1.87088 9.85206C1.03151 10.2824 -4.19718e-08 9.72227 0 8.83606L3.63358e-07 1.16394C4.05329e-07 0.277729 1.03151 -0.282448 1.87088 0.147935L9.35227 3.98399Z",fill:"#FAC70C"})}),(0,i.jsx)(n.M,{w:"94px",h:"22px",bgColor:"#0A0A09",outline:"1.5px solid ".concat(ex((0,y.f)(e))?b.D.yellow:b.D.brown),borderRadius:"5px",children:(0,i.jsx)(r.x,{fontSize:"16px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"16px",letterSpacing:0,color:b.D.yellow,children:el[eo][e]})}),(0,i.jsx)(n.M,{boxSize:"23px",minW:"23px",border:"1.5px solid ".concat(ec),bgColor:"#0A0A09",boxShadow:"0px 0px 4.26px 0.85px ".concat(ec," inset"),overflow:"visible",zIndex:30,borderRadius:"2.56px",children:eu&&(0,i.jsx)(s.E,{src:eu,width:"100%",height:"100%",maxH:"23px",objectFit:"fill"})}),(0,i.jsx)(r.x,{fontSize:"16px",fontFamily:"Grenze",fontStyle:"italic",fontWeight:"normal",lineHeight:"16px",letterSpacing:0,color:"white",children:"at"}),(0,i.jsx)(n.M,{w:"94px",h:"22px",bgColor:"#0A0A09",outline:"1.5px solid ".concat(ex((0,y.f)(e))?b.D.yellow:b.D.brown),borderRadius:"5px",children:(0,i.jsxs)(u.k,{w:"100%",alignItems:"center",px:"4px",children:[(0,i.jsx)(r.x,{flex:"4",fontSize:"16px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"16px",letterSpacing:0,color:b.D.yellow,children:e}),(0,i.jsx)(h.x,{flex:"1",children:(0,i.jsx)(g.WI,{fill:b.D.yellow,width:"14px",height:"11px"})})]})}),ex((0,y.f)(e))?(0,i.jsx)(f.u,{label:"Cancel Order ("+ex((0,y.f)(e)).toString()+" Yours)",children:(0,i.jsx)(n.M,{w:"20px",h:"20px",borderRadius:"5px",bgColor:b.D.brown,onClick:()=>en((0,y.f)(e)),cursor:"pointer",filter:"drop-shadow(2px 2px 0px black)",_hover:{filter:"drop-shadow(2px 2px 0px ".concat(b.D.red,")")},children:(0,i.jsx)(g.Xk,{fill:b.D.red,width:"14px",height:"14px"})})}):(0,i.jsx)(h.x,{w:"20px",h:"20px"})]},t))})]}):null}},48207:function(e,t,o){"use strict";o.r(t),o.d(t,{default:function(){return _}});var i=o(44610),l=o(67462),n=o(85893),r=o(8186),a=o(90092),s=o(73636),d=o(25343),c=o(45007),u=o(60716),p=o(40036),x=o(67294),h=o(80168),v=o(12979),m=o(70339),f=o(88155),g=o(91485),w=o(98361),b=o(11179),j=o(85401),C=o(42069),y=o(24996),S=o(44178),k=o(4794),I=o(35553);function _(e){var t;let{item:o,suggestedQuantity:_,advancedTradingMode:N}=e,E=(0,c.I0)(),{fetchResources:F,fetchLootNfts:M,fetchFishNfts:A,fetchTriumphNfts:R}=(0,C.m)(),T=(0,c.v9)(e=>e.web3Reducer.metatransactions),{socket:z}=(0,j.s)(),D=(0,c.v9)(e=>e.web3Reducer.web3Provider),{user:L}=(0,w.s)(),B=null==L?void 0:null===(t=L.wallet)||void 0===t?void 0:t.address,H=(0,c.v9)(e=>e.marketplaceReducer.currencyConversion),[W,O]=(0,x.useState)({}),[P,U]=(0,x.useState)({}),[q,G]=(0,x.useState)({}),[Z,V]=(0,x.useState)(!1),[Y,$]=(0,x.useState)(void 0),[K,J]=(0,x.useState)(0),[X,Q]=(0,x.useState)(void 0),[ee,et]=(0,x.useState)(void 0),[eo,ei]=(0,x.useState)(!0),[el,en]=(0,x.useState)(0),[er,ea]=(0,x.useState)("0"),[es,ed]=(0,x.useState)(0n),ec=K>0?BigInt(es)/BigInt(K):0n,[eu,ep]=(0,x.useState)("0"),ex=K>0?BigInt(Math.round(1e10*(parseFloat(eu)||0)))*BigInt(1e8):0n,eh=ex*BigInt(K||0),ev=(0,f.d)(eo?es:eh),em=ev.slice(0,ev.indexOf(".")+4),ef=(0,x.useMemo)(()=>0===el,[el]),eg=(0,x.useMemo)(()=>K>el,[K,el]),ew=(0,x.useMemo)(()=>I.parseEther(er).lt(eh),[er,eh]),eb=(ef||eg)&&eo||!Y||!K||"0"===em||ew,ej=(0,x.useCallback)(async()=>{let e=await (0,v.CG)(Y,B,D),t=(0,f.d)(e);ea(t.slice(0,t.indexOf(".")+3))},[Y,B,D]),eC=(0,x.useCallback)(async()=>
1{if(B){let e=await (0,k.gh)(D);ea(null!=e?e:"0")}},[B,D]);(0,x.useEffect)(()=>{ey()},[o,Y]),(0,x.useEffect)(()=>{isNaN(K)&&J(0),ek(),(ef||eg)&&!Z&&K>0&&ei(!1)},[ef,eg,Z,K]),(0,x.useEffect)(()=>{if(Y){let e=(0,v.N5)(P[Y]||[]);en(e),!Z&&N&&ei(e>0),ek()}},[Y,P,N,Z]);let ey=(0,x.useCallback)(()=>{e_(),J(_),ek(),T.marketplace?eC():ej()},[_,Y,B,D]),eS=(0,x.useCallback)(e=>{try{let t=parseInt(e);if(Number.isNaN(t))throw Error("NaN");J(t),ek(t)}catch(e){J(0),console.error(e)}},[]),ek=(0,x.useCallback)(e=>{if(Y){let t=e||K;if(!t)return;let o=(0,v.m_)(P[Y]||[],t);ed(o),"0"===eu&&ep((0,f.d)(o))}},[Y,K,eu,P]),eI=(0,x.useCallback)(e=>{let t=e.target.value;(!t||t.match(/^\d{1,}(\.\d{0,3})?$/))&&ep(t)},[]),e_=(0,x.useCallback)(async()=>{if(o){V(!0);let{itemId:e,collection:t}=(0,v.Ew)(o),[i,{lastPrice:l,lastSaleDate:n}]=await Promise.all([(0,p.Fy)(e,t,Y||h.Wm),(0,p.Z$)(e,t)]);Q(l),et(n);let r=(0,v.vX)(i,!1);O(r),U((0,v.vX)(i,!0)),G((0,v.ai)(r)),$(Object.keys(r).length>0?Object.keys(r)[0]:h.Wm),V(!1)}},[o,Y]),eN=(0,x.useCallback)(()=>{V(!1),E((0,d.wW)({mode:u.pz.Inactive,item:void 0,suggestedQuantity:0}))},[E]),eE=(0,x.useCallback)(()=>{E((0,d.wW)({mode:u.pz.AdvancedTrading,item:o,suggestedQuantity:1}))},[E,o]),eF=(0,x.useCallback)(async()=>{if(V(!0),eo?console.log("Buying at market price",K,Y):console.log("Buying at a specific price",K,Y,ex),!o||!Y||!D)return;let{itemId:e,collection:t,collectionType:i}=(0,v.Ew)(o);((0,v.l6)(o)||(0,v.fH)(o))&&(e=e>>8<<8);let l={itemId:e,collection:t,collectionType:i,currency:Y};eo?eA(await (0,u.cw)(l,K,ec,!0,D,E,T,z),"Items bought!","Buying items failed"):eA(await (0,u.cw)(l,K,ex,!1,D,E,T,z),"Buy order created!","Creating order failed"),setTimeout(()=>{(0,v.l6)(o)&&A(),(0,v.fH)(o)&&R(),(0,v.T$)(o)&&F(),(0,v.v_)(o)&&M()},5e3)},[o,Y,D,E,T,z,eo,K,ec,ex]),eM=(0,x.useCallback)(async e=>{var t,n,r;if(!Y||!W[Y])return;let a=null===(t=W[Y])||void 0===t?void 0:t.find(t=>t.unitPrice===e);if(!a||!D)return;console.log(h.CE,Y);let s=(null==o?void 0:null===(n=o.retrievedMetadata)||void 0===n?void 0:n.currencySymbol)||h.CE[Y];V(!0),(0,g.C)({title:"Cancelling Order",description:"Opening Wallet to cancel order for ".concat(a.quantity+a.unclaimedQuantity," ").concat(null==o?void 0:null===(r=o.retrievedMetadata)||void 0===r?void 0:r.name," at ").concat((0,f.d)(e)," ").concat(s,"."),status:"info",duration:1e4,isClosable:!0,position:"top",variant:"top-accent"});let d=await (0,u.az)(BigInt(a.id),D,E,T,z);if(d){let e=W[Y].filter(e=>e.id!=e.id);O((0,l._)((0,i._)({},W),{[Y]:e}))}eA(d,"Order cancelled!","Cancelling order failed")},[W,Y,D,E,T,z,o]),eA=(0,x.useCallback)((e,t,o)=>{e?((0,g.C)({title:t,status:"success",duration:5e3,isClosable:!0,position:"top",variant:"top-accent"}),ey(),V(!1),setTimeout(()=>{eR(),N&&E((0,y.zA)())},5e3)):((0,g.C)({title:o,status:"error",duration:5e3,isClosable:!0,position:"top",variant:"top-accent"}),V(!1))},[N,E,o,Z]),eR=(0,x.useCallback)(()=>{o&&((0,v.T$)(o)?F():(0,v.v_)(o)?M():(0,v.l6)(o)?A():(0,v.fH)(o)&&R())},[o]);return(0,n.jsx)(b.Z,{type:"buy",item:o,content:(0,n.jsxs)(r.g,{w:"100%",h:"100%",spacing:0,children:[(0,n.jsxs)(a.x,{fontSize:"24px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"17px",letterSpacing:0,color:m.D.beige,children:["Your Balance ",T.marketplace?"(EasyPay)":""]}),(0,n.jsx)(s.U,{alignItems:"flex-end",spacing:0,children:(0,S.D)(Number(er),H,!0)})]}),updateUnits:eS,units:K,isChecked:eo,checkboxDisabled:ef||eg,onChangeInstant:e=>{ei(e.target.checked)},openAdvancedTrading:eE,onChangeCustomUnitPrice:eI,customUnitPriceInput:eu,formatedTotalPrice:em,currentPrice:Y?(0,f.d)((0,v.m_)(P[Y]||[],1)):void 0,lastSalePrice:X,lastSaleDate:ee,closeModal:eN,isLoading:Z,mainBtnDisabled:eb,onClickMainBtn:eF,advancedTradingMode:N,currentCurrency:Y,orders:W,ordersPerPrice:q,cancelOrderAtPrice:eM,currencyConversion:H})}},90439:function(e,t,o){"use strict";o.r(t),o.d(t,{default:function(){return y}});var i=o(44610),l=o(67462),n=o(85893),r=o(8186),a=o(90092),s=o(73636),d=o(25343),c=o(45007),u=o(60716),p=o(40036),x=o(67294),h=o(80168),v=o(12979),m=o(70339),f=o(88155),g=o(91485),w=o(11179),b=o(42069),j=o(85401),C=o(24996);function y(e){let{item:t,suggestedQuantity:o,advancedTradingMode:y}=e,S=(0,c.I0)(),{fetchResources:k,fetchLootNfts:I,fetchFishNfts:_,fetchTriumphNfts:N}=(0,b.m)(),E=(0,c.v9)(e=>e.web3Reducer.web3Provider),F=(0,c.v9)(e=>e.web3Reducer.metatransactions),M=(0,c.v9)(e=>e.marketplaceReducer.currencyConversion),{socket:A}=(0,j.s)(),[R,T]=(0,x.useState)({}),[z,D]=(0,x.useState)({}),[L,B]=(0,x.useState)({}),[H,W]=(0,x.useState)(!1),[O,P]=(0,x.useState)(void 0),[U,q]=(0,x.useState)(0),[G,Z]=(0,x.useState)(void 0),[V,Y]=(0,x.useState)(void 0),[$,K]=(0,x.useState)(!0),[J,X]=(0,x.useState)(0),[Q,ee]=(0,x.useState)(0n),[et,eo]=(0,x.useState)(0n),[ei,el]=(0,x.useState)([]),[en,er]=(0,x.useState)(0n),ea=U>0?BigInt(en)/BigInt(U):0n,[es,ed]=(0,x.useState)("0"),ec=(0,x.useMemo)(()=>U>0?BigInt(Math.round(1e10*(parseFloat(es)||0)))*BigInt(1e8):0n,[U,es]),eu=(0,x.useMemo)(()=>ec*BigInt(U||0),[ec,U]),ep=(0,f.d)($?en:eu),ex=ep.slice(0,ep.indexOf(".")+4),eh=(0,c.v9)(e=>e.inventoryReducer.unclaimedNfts),ev=(0,c.v9)(e=>e.inventoryReducer.resources),em=(0,c.v9)(e=>e.inventoryReducer.lootNfts),ef=(0,c.v9)(e=>e.inventoryReducer.fishNfts),eg=(0,c.v9)(e=>e.inventoryReducer.triumphNfts),ew=(0,x.useMemo)(()=>0===J&&!H,[J,H]),eb=(0,x.useMemo)(()=>U>J,[U,J]),ej=(0,x.useMemo)(()=>Number(Q+et),[Q,et]),eC=(0,x.useMemo)(()=>(ew||eb)&&$||!O||!U||"0"===ex||!ej,[ew,eb,$,O,U,ex,ej]);(0,x.useEffect)(()=>{eS()},[t,O]),(0,x.useEffect)(()=>{ey()},[em,ef,eg,ev]),(0,x.useEffect)(()=>{isNaN(U)&&q(0),ek();let e=(0,v.N5)(z[O||h.Wm]||[]);!H&&U>0&&e<U&&K(!1)},[ew,eb,H]),(0,x.useEffect)(()=>{O&&(X((0,v.N5)(z[O]||[])),ek())},[O,z]);let ey=(0,x.useCallback)(()=>
1{if(!t)return;let{itemId:e,collection:o}=(0,v.Ew)(t),i=e>>8;if((0,v.T$)(t)){let t=ev.find(t=>t.id&&Number(t.id)===e||t.resourceId&&Number(t.resourceId)===e);t?(ee(BigInt(t.amount||0)-BigInt(t.unclaimedAmount||0)),eo(BigInt(t.unclaimedAmount||0))):console.log("Resource not found")}else{let l;console.log("Finding item balance for item with collection ".concat(o,", itemId ").concat(e," and poolId ").concat(i)),console.log("Unclaimed NFTs",eh),(0,v.v_)(t)?console.log("Unclaimed Loot:",l=eh.find(t=>t&&(t.id&&Number(t.id)===e||t.itemId&&Number(t.itemId)===e)&&t.contractAddress.toLowerCase()===o.toLowerCase())):console.log("Unclaimed Fish/Triumph:",l=eh.find(e=>e.itemId&&Number(e.itemId)>>8===i&&e.contractAddress===o)),ee(BigInt(0)),eo(BigInt((null==l?void 0:l.amount)||0))}},[t,eh,ev]);function eS(){t&&(console.log("Loading all"),(0,v.fH)(t)?(console.log("Loading Triumphs"),N()):(0,v.l6)(t)&&(console.log("Loading Fish"),_()),eI(),q(o),ek(),ey())}function ek(e){if(O){let t=e||U;if(!t)return;let o=(0,v.m_)(z[O]||[],t);er(o),"0"===es&&ed((0,f.d)(o))}}async function eI(){if(t){let e;W(!0);let{itemId:o,collection:i}=(0,v.Ew)(t),[l,{lastPrice:n,lastSaleDate:r}]=await Promise.all([(0,p.Fy)(o,i,O||h.Wm),(0,p.Z$)(o,i)]);Z(n),Y(r);let a=(0,v.vX)(l,!0);T(a),D((0,v.vX)(l,!1)),B((0,v.ai)(a)),(e=Object.keys(a).length>0?Object.keys(a)[0].toLowerCase():h.Wm)!==O&&P(e),W(!1)}}let e_=(0,x.useCallback)(async()=>{if(W(!0),!t||!O||!E)return;let e=(0,v.l6)(t),o=(0,v.fH)(t),i=(0,v.T$)(t),l=(0,v.v_)(t),{itemId:n,collection:r,collectionType:a}=(0,v.Ew)(t);(e||o)&&(n=n>>8<<8),$?console.log("Selling ".concat(r,"-").concat(n," at market price, unitsToSell: ").concat(U,", currentCurrency: ").concat(O,", sellNftTokenIds: ").concat(ei)):console.log("Selling ".concat(r,"-").concat(n," at a specific price, unitsToSell: ").concat(U,", currentCurrency: ").concat(O,", customUnitSellPrice: ").concat(ec,", sellNftTokenIds: ").concat(ei));let s={itemId:n,collection:r,collectionType:a,currency:O},d=et>=BigInt(U)?BigInt(U):et,c=BigInt(U)-d;if(c>Q)return(0,g.C)({title:"Not enough balance",status:"warning",duration:5e3,isClosable:!0,position:"top",variant:"top-accent"}),0;$?eE(await (0,u.xS)(s,d,c,ea,!0,ei,i,l,e,o,E,S,F,A),"Items sold!","Selling items failed",-c,-d):eE(await (0,u.xS)(s,d,c,ec,!1,ei,i,l,e,o,E,S,F,A),"Sell order created!","Creating order failed",-c,-d),setTimeout(()=>{(0,v.l6)(t)&&_(),(0,v.fH)(t)&&N()},5e3)},[t,O,E,$,ea,et,U,ec,ei,S,F,A]),eN=(0,x.useCallback)(async e=>{var o,n,r,a;if(!O||!R[O])return;let s=null===(o=R[O])||void 0===o?void 0:o.find(t=>t.unitPrice===e);if(!s||!E)return;console.log(h.CE,O);let d=(null==t?void 0:null===(n=t.retrievedMetadata)||void 0===n?void 0:n.currencySymbol)||h.CE[O];W(!0),(0,g.C)({title:"Cancelling Order",description:"Opening Wallet to cancel order for ".concat(s.quantity+s.unclaimedQuantity," ").concat(null==t?void 0:null===(r=t.retrievedMetadata)||void 0===r?void 0:r.name," at ").concat((0,f.d)(e)," ").concat(d,"."),status:"info",duration:1e4,isClosable:!0,position:"top",variant:"top-accent"});let c=await (0,u.az)(BigInt(s.id),E,S,F,A);if(c){let e=R[O].filter(e=>e.id!=e.id);T((0,l._)((0,i._)({},R),{[O]:e}))}console.log(t),console.log("Cancelling order at price ".concat(e," for ").concat(s.quantity+s.unclaimedQuantity," ").concat(null==t?void 0:null===(a=t.retrievedMetadata)||void 0===a?void 0:a.name)),eE(c,"Order cancelled!","Cancelling order failed",s.quantity,s.unclaimedQuantity)},[O,R,E,S,F,A,t]);function eE(e,o,i,l,n){e?((0,g.C)({title:o,status:"success",duration:5e3,isClosable:!0,position:"top",variant:"top-accent"}),eS(),W(!1),y||(0n!=l&&(console.log("Updating item balance",Q,l),ee(Q+l)),0n!=n&&(console.log("Updating item unclaimed balance",et,n),eo(et+n))),setTimeout(()=>{t&&((0,v.T$)(t)?k():(0,v.v_)(t)?I():(0,v.l6)(t)?_():(0,v.fH)(t)&&N()),y&&S((0,C.zA)())},5e3)):((0,g.C)({title:i,status:"error",duration:5e3,isClosable:!0,position:"top",variant:"top-accent"}),W(!1))}return(0,n.jsx)(w.Z,{type:"sell",item:t,content:(0,n.jsxs)(r.g,{w:"100%",h:"100%",spacing:0,children:[(0,n.jsx)(a.x,{fontSize:"24px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"17px",letterSpacing:0,color:m.D.beige,children:"You Own"}),(0,n.jsx)(a.x,{fontSize:"18px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"18px",letterSpacing:0,color:m.D.yellow,children:ej})]}),updateUnits:function(e){try{let t=parseInt(e);if(Number.isNaN(t))throw Error("NaN");q(t),ek(t)}catch(e){q(0),console.error(e)}}
1,units:U,ownedUnits:ej,isChecked:$,checkboxDisabled:ew||eb,onChangeInstant:e=>{K(e.target.checked)},openAdvancedTrading:function(){S((0,d.wW)({mode:u.pz.AdvancedTrading,item:t,suggestedQuantity:1}))},onChangeCustomUnitPrice:function(e){let t=e.target.value;(!t||t.match(/^\d{1,}(\.\d{0,3})?$/))&&ed(t)},customUnitPriceInput:es,formatedTotalPrice:ex,currentPrice:O?(0,f.d)((0,v.m_)(z[O]||[],1)):void 0,lastSalePrice:G,lastSaleDate:V,closeModal:function(){W(!1),S((0,d.wW)({mode:u.pz.Inactive,item:void 0,suggestedQuantity:0}))},isLoading:H,mainBtnDisabled:eC,onClickMainBtn:e_,advancedTradingMode:y,currentCurrency:O,orders:R,ordersPerPrice:L,cancelOrderAtPrice:eN,currencyConversion:M,children:!H&&0==ej&&(0,n.jsx)(s.U,{w:"100%",gap:"20px",justifyContent:"center",spacing:0,children:(0,n.jsx)(a.x,{alignSelf:"stretch",color:m.D.red,fontSize:"15px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"16px",letterSpacing:.5,textAlign:"center",children:"You have no units to sell"})})})}},8022:function(e,t,o){"use strict";o.d(t,{Br:function(){return d},K5:function(){return r},V_:function(){return l},WY:function(){return c},dt:function(){return n},mB:function(){return s},tv:function(){return a}});var i=o(85893);let l=e=>{let{fill:t}=e;return(0,i.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 0C0.895432 0 0 0.895432 0 2V12C0 13.1046 0.895432 14 2 14H12C13.1046 14 14 13.1046 14 12V2C14 0.895432 13.1046 0 12 0H2ZM8.47369 5.52631H10.5789C10.8122 5.52631 11 5.7141 11 5.94736V8.05264C11 8.2859 10.8122 8.47369 10.5789 8.47369H8.47369H5.52632H3.42105C3.18779 8.47369 3 8.2859 3 8.05264V5.94736C3 5.7141 3.18779 5.52631 3.42105 5.52631H5.52632H8.47369Z",fill:t})})},n=e=>{let{fill:t}=e;return(0,i.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 0C0.895432 0 0 0.895432 0 2V12C0 13.1046 0.895432 14 2 14H12C13.1046 14 14 13.1046 14 12V2C14 0.895432 13.1046 0 12 0H2ZM5.52632 3.42105C5.52632 3.18779 5.7141 3 5.94737 3H8.05263C8.2859 3 8.47369 3.18779 8.47369 3.42105V5.52631H10.5789C10.8122 5.52631 11 5.7141 11 5.94736V8.05264C11 8.2859 10.8122 8.47369 10.5789 8.47369H8.47369V10.5789C8.47369 10.8122 8.2859 11 8.05263 11H5.94737C5.7141 11 5.52632 10.8122 5.52632 10.5789V8.47369H3.42105C3.18779 8.47369 3 8.2859 3 8.05264V5.94736C3 5.7141 3.18779 5.52631 3.42105 5.52631H5.52632V3.42105Z",fill:t})})},r=e=>{let{fill:t}=e;return(0,i.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M2.04199 4.66667C2.04199 3.19391 3.2359 2 4.70866 2H23.3753C24.8481 2 26.042 3.19391 26.042 4.66667V23.3333C26.042 24.8061 24.8481 26 23.3753 26H4.70866C3.2359 26 2.04199 24.8061 2.04199 23.3333V4.66667Z",fill:"#090908"}),(0,i.jsx)("path",{d:"M4.70866 1C2.68361 1 1.04199 2.64162 1.04199 4.66667V23.3333C1.04199 25.3584 2.68361 27 4.70866 27H23.3753C25.4004 27 27.042 25.3584 27.042 23.3333V4.66667C27.042 2.64162 25.4004 1 23.3753 1H4.70866Z",stroke:t,strokeWidth:"2"}),(0,i.jsx)("path",{d:"M11.8947 6C11.4282 6 11.0526 6.37558 11.0526 6.84211V11.0526H6.84211C6.37558 11.0526 6 11.4282 6 11.8947V16.1053C6 16.5718 6.37558 16.9474 6.84211 16.9474H11.0526V21.1579C11.0526 21.6244 11.4282 22 11.8947 22H16.1053C16.5718 22 16.9474 21.6244 16.9474 21.1579V16.9474H21.1579C21.6244 16.9474 22 16.5718 22 16.1053V11.8947C22 11.4282 21.6244 11.0526 21.1579 11.0526H16.9474V6.84211C16.9474 6.37558 16.5718 6 16.1053 6H11.8947Z",fill:t,stroke:t,strokeWidth:"0.444444"})]})},a=e=>{let{fill:t}=e;return(0,i.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M2.04199 4.66667C2.04199 3.19391 3.2359 2 4.70866 2H23.3753C24.8481 2 26.042 3.19391 26.042 4.66667V23.3333C26.042 24.8061 24.8481 26 23.3753 26H4.70866C3.2359 26 2.04199 24.8061 2.04199 23.3333V4.66667Z",fill:"#090908"}),(0,i.jsx)("path",{d:"M4.70866 1C2.68361 1 1.04199 2.64162 1.04199 4.66667V23.3333C1.04199 25.3584 2.68361 27 4.70866 27H23.3753C25.4004 27 27.042 25.3584 27.042 23.3333V4.66667C27.042 2.64162 25.4004 1 23.3753 1H4.70866Z",stroke:t,strokeWidth:"2"}),(0,i.jsx)("path",{d:"M11.0526 11.0526H6.84211C6.37558 11.0526 6 11.4282 6 11.8947V16.1053C6 16.5718 6.37558 16.9474 6.84211 16.9474H11.0526H16.9474H21.1579C21.6244 16.9474 22 16.5718 22 16.1053V11.8947C22 11.4282 21.6244 11.0526 21.1579 11.0526H16.9474H11.0526Z",fill:t,stroke:t,strokeWidth:"0.444444"})]})},s=e=>{let{fill:t,width:o,height:l}=e;return(0,i.jsx)("svg",{width:o||"12",height:l||"16",viewBox:"0 0 12 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M5.99994 0C3.46678 0 1.4172 2.20274 1.4172 4.92478V7.35615H2.96726V5.03198C2.96726 3.22704 4.32592 1.76282 5.99994 1.76282C7.67405 1.76282 9.03268 3.26791 9.03268 5.
103195V7.35615H10.5827V4.92481C10.5827 2.27227 8.52875 0 5.99997 0H5.99994ZM0.71399 7.98478C0.257354 8.75263 0 9.63801 0 10.5675C0 13.5397 2.65574 16 6.00003 16C9.34426 16 12 13.5397 12 10.5675C12 9.63791 11.7418 8.75273 11.285 7.98478H0.713928H0.71399ZM5.99119 8.78997C6.68942 8.78997 7.26874 9.39343 7.26874 10.1449C7.26874 10.7085 6.93743 11.1954 6.48345 11.4021L7.50612 14.7029H4.49388L5.49795 11.4022C5.04394 11.1955 4.7312 10.7086 4.7312 10.145C4.7312 9.3936 5.29292 8.79007 5.99115 8.79007L5.99119 8.78997Z",fill:t})})},d=e=>{let{fill:t,width:o,height:l}=e;return(0,i.jsxs)("svg",{width:o||"11",height:l||"14",viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M2.14562 6.86589C1.78737 7.47269 1.58547 8.17236 1.58547 8.90689C1.58547 11.2557 3.66902 13.2 6.29276 13.2C8.91646 13.2 11 11.2557 11 8.90689C11 8.17228 10.7975 7.47276 10.4391 6.86589H2.14562ZM6.28582 7.50219C6.83362 7.50219 7.28812 7.97908 7.28812 8.57293C7.28812 9.01835 7.0282 9.4031 6.67203 9.56648L7.47435 12.1749H5.11112L5.89886 9.56651C5.54267 9.40316 5.29731 9.01837 5.29731 8.57301C5.29731 7.97921 5.73803 7.50219 6.28582 7.50219Z",fill:t}),(0,i.jsx)("path",{d:"M3.96568 2.21665C5.03346 0.35374 7.29009 -0.343926 9.0112 0.656993C10.7293 1.65618 11.2336 4.02288 10.1931 5.83823L9.23931 7.50219L8.18614 6.88972L9.09786 5.29908C9.78984 4.09181 9.45715 2.52492 8.3197 1.86343C7.18231 1.20198 5.68482 1.66723 4.97679 2.90249L4.06509 4.49311L3.01191 3.88064L3.96568 2.21665Z",fill:t}),(0,i.jsx)("path",{d:"M1.42644 3.25157L0.855866 3.8263L2.48673 4.45928L1.42644 3.25157Z",fill:t}),(0,i.jsx)("path",{d:"M2.28254 4.97576L0.285412 4.40103L0 5.26313L2.28254 4.97576Z",fill:t}),(0,i.jsx)("path",{d:"M2.48673 5.72281L1.42668 6.69995L0.855866 6.12522L2.48673 5.72281Z",fill:t})]})},c=e=>{let{fill:t,width:o,height:l}=e;return(0,i.jsx)("svg",{width:o||"21",height:l||"21",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M15.3587 0.90018C14.6971 0.893125 14.1763 1.09542 13.9792 1.52323C13.0143 3.6186 11.9143 5.20412 10.6286 6.47726C10.7587 6.52074 10.8853 6.57417 11.0072 6.63706C11.5574 6.92041 12.0776 7.38811 12.5031 7.9399C12.9286 8.4917 13.2593 9.12747 13.3834 9.77739C13.415 9.94246 13.4326 10.1105 13.4325 10.2776C15.0834 9.24866 17.0358 8.53635 19.4004 8.11018C20.032 7.99625 20.4023 6.90073 20.3071 5.63249L18.8178 5.59024L20.1124 4.54212C19.9367 3.92933 19.6459 3.32752 19.2162 2.82206C18.5584 2.04846 17.673 1.49671 16.8134 1.18793L15.7135 1.84663L15.8327 0.93845C15.6685 0.915218 15.5103 0.9017 15.3587 0.900138L15.3587 0.90018ZM9.99447 7.15844C9.94944 7.16064 9.9072 7.16799 9.86738 7.1783C9.36004 7.61144 8.82483 8.00609 8.26022 8.37287C8.29588 8.38681 8.33096 8.40105 8.36612 8.41647C8.96441 8.67802 9.52848 9.14069 9.99582 9.7101C10.5616 10.3996 10.9964 11.2705 11.0813 12.1495C11.5191 11.7116 11.9811 11.3071 12.4727 10.9364C12.6462 10.6595 12.6815 10.3252 12.6051 9.92519C12.5126 9.44111 12.239 8.89324 11.8743 8.42035C11.5096 7.94751 11.0533 7.54926 10.6431 7.33793C10.3867 7.20588 10.1706 7.14995 9.99443 7.1584L9.99447 7.15844ZM7.37191 8.98672C7.31323 8.98896 7.25795 8.99813 7.20381 9.01046C5.63638 9.88747 3.85341 10.615 1.8105 11.376C1.83482 11.3777 1.8588 11.3799 1.88337 11.3825C2.33356 11.4314 2.77621 11.5941 3.20318 11.8419L4.79972 11.1476L4.12983 12.5297C4.3838 12.7592 4.62984 13.0145 4.86457 13.2901C5.74403 14.3222 6.47284 15.6499 6.85961 17.0112C6.8597 17.0116 6.85949 17.0121 6.85961 17.0125C6.98585 17.4564 7.07609 17.896 7.12701 18.322C8.0162 16.2759 9.00707 14.5516 10.1917 13.1263C10.501 12.219 10.0991 11.0815 9.38415 10.2104C8.98424 9.72307 8.49554 9.33529 8.04844 9.13984C7.79698 9.02985 7.57101 8.97903 7.37191 8.98672ZM13.3716 11.3034C13.0619 11.5167 12.7589 11.7473 12.4635 11.9924C14.1224 12.3836 15.0456 13.5014 15.8802 14.618C16.3235 15.211 16.7528 15.8054 17.2835 16.3367C18.3083 16.723 19.1123 16.6062 19.9908 15.7057C16.0864 14.5322 15.9193 11.7937 13.3716 11.3033L13.3716 11.3034ZM1.59204 12.1574C1.13143 12.1669 0.81849 12.4005 0.603117 12.8584C0.356988 13.3816 0.301747 14.2299 0.621672 15.2688C0.865259 16.0599 1.32151 16.862 1.83961 17.4495C2.3577 18.0369 2.93681 18.382 3.33815 18.3959H3.33951C3.49697 18.4014 3.61711 18.3671 3.71281 18.2797L3.70489 18.2718L3.79355 18.1834C3.82715 18.134 3.85795 18.0757 3.8862 18.0065C4.00524 17.715 4.02515 17.2228 3.80808 16.6125C3.51642 15.7923 2.9981 15.2637 2.39422 15.1434L1.42123 14.9506L2.26057 14.4226L3.89027 13.4009C3.18493 12.6904 2.42663 12.2348 1.79856 12.1667C1.72654 12.1589 1.65778 12.1561 1.59199 12.1575L1.59204 12.1574ZM11.6003 12.3858L10.5611 13.4576C14.8161 14.2128 12.9101 19.4138 17.31 20.9L16.2602 18.4804C17.6483 19.1626 19.115 19.4361 20.3999 18.9886C14.6483 17.2167 16.3195 13.6247 11.6003 12.3858ZM4.42103 14.0002L3.32095 14.6906C3.8793 15.0496 4.3042 15.6437 4.55477 16.3485C4.66365 16.6545 4.72986 16.9486 4.756 17.2263L5.74898 16.239C5.40669 15.4284 4.94261 14.6521 4.42112 14.0002L4.42103 14.0002ZM6.04675 17.0574L4.26484 18.8315L4.25823 18.8249C4.07798 18.9914 3.85765 19.1107 3.61491 19.1602C4.60061 19.7885 5.50616 19.9774 6.02163 19.5641C6.2021 19.4194 6.31999 19.211 6.38045 18.9556C6.36308 18.4198 6.27022 17.8314 6.09844 17.2277C6.08225 17.1708 6.06429 17.1142 6.04675 17.0574Z",fill:t})})}},27218:function(e,t,o){"use strict";o.d(t,{s:function(){return p}});var i=o(85893),l=o(67294),n=o(8186),r=o(90092),a=o(73636),s=o(64831
1),d=o(48899),c=o(45007);let u={beige:"#E5C687",yellow:"#FAC70C"},p=e=>{let{groupId:t,latestOnly:o=!1}=e,[p,h]=(0,l.useState)([]),v=(0,c.v9)(e=>e.transactionsReducer.transactionGroups);(0,l.useEffect)(()=>{m&&h(m.transactions)},[v]);let m=(0,c.v9)(e=>e.transactionsReducer.transactionGroups).find(e=>e.groupId===t),[f,g]=(0,l.useState)("initiated");return((0,l.useEffect)(()=>{if(!m)return;let e="initiated";m.transactions.forEach(t=>{"pending"===t.status?e="pending":"initiated"===t.status?e="initiated":"confirmed"===t.status?e="confirmed":"error"===t.status?e="error":"cleared"===t.status&&(e="cleared")}),g(e)},[m]),(0,l.useEffect)(()=>{m&&h(m.transactions)},[m]),m)?(0,i.jsxs)(n.g,{w:"100%",h:"100%",gap:"10px",spacing:0,children:[(0,i.jsx)(r.x,{color:"#E5C687",fontSize:"30px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"30px",letterSpacing:.6,children:m.title}),m.subtitle&&(0,i.jsxs)(r.x,{color:u.yellow,fontSize:"16px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"16px",letterSpacing:.64,children:['"',m.subtitle,'"']}),(0,i.jsxs)(a.U,{spacing:3,children:[(0,i.jsx)(r.x,{color:"#E5C687",fontSize:"16px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"16px",letterSpacing:.64,children:"Network: "}),(0,i.jsx)(r.x,{color:u.yellow,fontSize:"16px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"16px",letterSpacing:.64,children:m.network})]}),(0,i.jsxs)(a.U,{spacing:3,children:[(0,i.jsx)(r.x,{color:"#E5C687",fontSize:"16px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"16px",letterSpacing:.64,children:"Total Completion:"}),(0,i.jsx)(r.x,{color:u.yellow,fontSize:"16px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"16px",letterSpacing:.64,children:f}),(0,i.jsx)(r.x,{color:u.yellow,fontSize:"16px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"16px",letterSpacing:.64,children:"initiated"==f?"⚪":"pending"==f?"⏳":"confirmed"==f?"\uD83D\uDFE2":"error"==f?"\uD83D\uDD34":"\uD83D\uDFE1"})]}),(0,i.jsx)(s.i,{w:"45%",borderColor:u.beige,pb:"10px",pt:"10px"}),o?p.slice(-1)[0]?(0,i.jsx)(x,{transaction:p.slice(-1)[0]},p.slice(-1)[0].id):null:p.map((e,t)=>(0,i.jsx)(x,{transaction:e},t)),"error"!=f&&"confirmed"!=f&&(0,i.jsx)(d.$,{color:"white"})]}):null};function x(e){let{transaction:t}=e;return(0,i.jsxs)(n.g,{children:[(0,i.jsxs)(a.U,{spacing:3,children:[(0,i.jsx)(r.x,{color:"#E5C687",fontSize:"16px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"16px",letterSpacing:.64,children:"".concat(t.text,":  ")}),(0,i.jsx)(r.x,{color:u.yellow,fontSize:"16px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"16px",letterSpacing:.64,children:t.status}),(0,i.jsx)(r.x,{color:u.yellow,fontSize:"16px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"16px",letterSpacing:.64,children:t.icon})]}),t.hash&&(0,i.jsx)(r.x,{color:"#E5C687",fontSize:"16px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"16px",letterSpacing:.64,children:"Hash: ".concat(t.hash)}),t.error&&(0,i.jsx)(r.x,{color:"#E5C687",fontSize:"16px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"16px",letterSpacing:.64,children:'Error: "'.concat(t.error,'"')})]})}},31406:function(e,t,o){"use strict";var i=o(85893),l=o(26580),n=o.n(l),r=o(26551),a=o.n(r),s=o(5490),d=o(89865),c=o(26840),u=o(57391),p=o(21360),x=o(70010),h=o(68029),v=o(73636),m=o(38488);t.Z=function(e){let{isOpen:t,onClose:o,call:l,isStaking:r}=e;return(0,i.jsxs)(s.u_,{isOpen:t,onClose:o,isCentered:!0,children:[(0,i.jsx)(d.Z,{}),(0,i.jsxs)(c.h,{backgroundColor:"#000d",borderWidth:"1px",borderColor:"#fff6",children:[(0,i.jsx)(u.x,{color:"white",children:"Staking Confirmation"}),(0,i.jsx)(p.o,{}),(0,i.jsxs)(x.f,{className:n().stakingModal,w:"100%",children:[(0,i.jsxs)(h.x,{children:[(0,i.jsxs)("h2",{children:["Use this menu if you wish to un-stake your Soul and leave the world of Estra.",(0,i.jsx)("p",{})," ",(0,i.jsx)("br",{}),"You may re-stake at any time.",(0,i.jsx)("p",{})," ",(0,i.jsx)("br",{}),"You will still be able to access your Soul's Loot NFTs and other features from outside of Evrloot.",(0,i.jsx)("p",{})," ",(0,i.jsx)("br",{})]}),(0,i.jsx)("h2",{style:{color:"white"},children:(0,i.jsx)("i",{children:"Please note that unstaking is not possible while on a mission or expedition."})})]}),(0,i.jsxs)(v.U,{mt:"30px",mb:"5px",w:"100%",spacing:"5",children:[(0,i.jsx)(m.z,{className:a().button,whiteSpace:"normal",variant:"outline",padding:"0.3rem 0.3rem",letterSpacing:"0.15rem",backgroundSize:"200%",backgroundImage:"linear-gradient(51deg,#960e05 50%,#b00b00 65%,#e63922 100%)",transition:"0.2s ease-in-out",transitionProperty:"background-position",color:"#fff",borderColor:"transparent",boxShadow:"-5px -5px 1px rgb(255 255 255 / 3%), 5px 5px 5px rgb(0 0 0 / 35%)",borderRadius:"7px",_hover:{backgroundColor:"transparent"},w:"150px",onClick:async()=>
1{l().then(()=>{o()})},isLoading:r,children:"Leave Estra (Unstake)"}),(0,i.jsx)(m.z,{className:a().button,whiteSpace:"normal",variant:"outline",padding:"0.3rem 0.3rem",letterSpacing:"0.15rem",backgroundSize:"200%",backgroundImage:"linear-gradient(51deg,#960e05 50%,#b00b00 65%,#e63922 100%)",transition:"0.2s ease-in-out",transitionProperty:"background-position",color:"#fff",borderColor:"transparent",boxShadow:"-5px -5px 1px rgb(255 255 255 / 3%), 5px 5px 5px rgb(0 0 0 / 35%)",borderRadius:"7px",_hover:{backgroundColor:"transparent"},w:"150px",onClick:()=>{o()},children:"Cancel"})]})]})]})]})}},30317:function(e,t,o){"use strict";var i=o(85893),l=o(90944),n=o.n(l),r=o(67294),a=o(18118),s=o(26972),d=o(15715),c=o(37945),u=o(74032),p=o(92041),x=o(86384),h=o(47854),v=o(45007),m=o(56857),f=o(97619),g=o(10754),w=o(77286);let b=(e,t,o,i)=>o?e?"Rare"==i?n().rareItemNew:"Epic"==i?n().epicItemNew:"Legendary"==i?n().legendaryItemNew:n().commonItemNew:(null==t?void 0:t.nftAsset)||(null==t?void 0:t.resource)||(null==t?void 0:t.unclaimedNft)?n().validSlot:n().emptySlot:e?"Rare"==i?n().rareItem:"Epic"==i?n().epicItem:"Legendary"==i?n().legendaryItem:n().commonItem:(null==t?void 0:t.nftAsset)||(null==t?void 0:t.resource)||(null==t?void 0:t.unclaimedNft)?n().validSlot:n().emptySlot;t.Z=(0,r.memo)(function(e){var t,o,l,n,j,C,y,S,k;let{asset:I,soulClass:_,slotSize:N,colorScheme:E,newStyle:F,onSelect:M}=e,A=(0,v.I0)(),R=(0,v.v9)(e=>e.inventoryReducer.itemInHand),T=(0,r.useMemo)(()=>{var e,t,o,i,l;return(null==R?void 0:null===(e=R.nftAsset)||void 0===e?void 0:e.nft.id)!==(null==I?void 0:null===(t=I.nft)||void 0===t?void 0:t.id)?(0,x.WR)((null==I?void 0:null===(o=I.retrievedMetadata)||void 0===o?void 0:o.inventoryUri)||(null==I?void 0:null===(i=I.retrievedMetadata)||void 0===i?void 0:i.thumbnailUri)||(null==I?void 0:null===(l=I.retrievedMetadata)||void 0===l?void 0:l.thumbnailURI)):void 0},[R,I]),z=null==I?void 0:null===(l=I.retrievedMetadata)||void 0===l?void 0:null===(o=l.properties)||void 0===o?void 0:null===(t=o.Rarity)||void 0===t?void 0:t.value,D=b(I,R,F,z),L=(0,i.jsx)(a.U,{w:N,h:N,className:D,bgColor:"light"==E?"#2229":"#3338",alignItems:"center",justifyContent:"center",children:(0,i.jsx)(s.u,{wordBreak:"break-word",label:(0,w.Z)({asset:I,metadata:null==I?void 0:I.retrievedMetadata,soulClass:_,image:T,slot:null==I?void 0:I.partDescription}),placement:"auto",backgroundColor:"transparent",p:0,children:(0,i.jsxs)(d.M,{cursor:"pointer",w:N,h:N,position:"relative",padding:"2px",rounded:"10px",onClick:e=>{if(!(null==R?void 0:R.nftAsset)&&I){if(e.shiftKey||e.metaKey){var t,o;let e=(null===(t=I.nft.collection)||void 0===t?void 0:t.id)=="loot"?"0x29b58A7fCeecF0C84e62301E5b933416a1DB0599":"0x95492EdCC1D373E236E368973285Ad47D56D07b6";window.open("https://singular.app/collectibles/moonbeam/".concat((null==I?void 0:null===(o=I.nft.collection)||void 0===o?void 0:o.address)||(null==I?void 0:I.nft.address)||e,"/").concat(null==I?void 0:I.nft.tokenId))}else M&&M!==h.BD?(console.log("onSelect",M),M({nftAsset:I})):(A((0,h.BD)({nftAsset:I})),A((0,h.Ns)({nftAsset:I})))}},children:[T&&(0,i.jsx)(p.yZ,{src:T,width:N||80,height:N||80,rounded:"10px"}),(null==I?void 0:null===(C=I.retrievedMetadata)||void 0===C?void 0:null===(j=C.properties)||void 0===j?void 0:null===(n=j.Scale)||void 0===n?void 0:n.value)==="Heavyweight"&&(0,i.jsx)(c.E,{color:"white",position:"absolute",w:"12.1px",h:"12.1px",right:"4px",bottom:"4px",src:"/Resources/heavy_white.png",alt:"Heavyweight"}),(null==I?void 0:null===(k=I.retrievedMetadata)||void 0===k?void 0:null===(S=k.properties)||void 0===S?void 0:null===(y=S.Scale)||void 0===y?void 0:y.value)==="Featherweight"&&(0,i.jsx)(c.E,{color:"white",position:"absolute",w:"23.1px",h:"23.1px",right:"5px",bottom:"4px",src:"/Resources/feather_white.png",alt:"Featherweight"}),(0,i.jsx)(u.C,{colorScheme:"red",position:"absolute",top:0,right:0})]})},(null==I?void 0:I.nft.id)+"-tooltip")},null==I?void 0:I.nft.id);return(0,i.jsxs)(g.x,{children:[(0,i.jsx)(m.W,{children:L}),(0,i.jsx)(f.$,{item:I,suggestedQuantity:1})]})})},12572:function(e,t,o){"use strict";o.d(t,{Z:function(){return R}});
1var i=o(44610),l=o(67462),n=o(85893),r=o(8186),a=o(16610),s=o(15715),d=o(90092),c=o(68029),u=o(48899),p=o(45007),x=o(67294),h=o(30381),v=o.n(h),m=o(86384),f=o(4357);function g(e){return{poolId:e>>8,memberId:255&e}}function w(e,t){var o,i,l,n,r,a,s,d,c,u,p,x,h,v,m,f,w,b,j,C,y,S,k,I,_,N,E,F,M,A,R;if(!t)return!1;if(!e)return!0;if((null==e?void 0:e.class)&&(null==t?void 0:null===(o=t.retrievedMetadata)||void 0===o?void 0:o.properties)&&(null==t?void 0:null===(l=t.retrievedMetadata)||void 0===l?void 0:null===(i=l.properties["Soul Class"])||void 0===i?void 0:i.value).toLowerCase()!==e.class.toLowerCase()||(null==e?void 0:e.slot)&&(null==t?void 0:null===(n=t.retrievedMetadata)||void 0===n?void 0:n.properties)&&(null==t?void 0:null===(r=t.retrievedMetadata)||void 0===r?void 0:r.properties.Slot)&&(null==t?void 0:null===(s=t.retrievedMetadata)||void 0===s?void 0:null===(a=s.properties.Slot)||void 0===a?void 0:a.value).toLowerCase()!==e.slot.toLowerCase()||(null==e?void 0:e.rarity)&&(null==t?void 0:null===(d=t.retrievedMetadata)||void 0===d?void 0:d.properties)&&(null==t?void 0:null===(c=t.retrievedMetadata)||void 0===c?void 0:c.properties.Rarity)&&(null==t?void 0:null===(p=t.retrievedMetadata)||void 0===p?void 0:null===(u=p.properties.Rarity)||void 0===u?void 0:u.value).toLowerCase()!==(null==e?void 0:e.rarity.toLowerCase())||(null==e?void 0:e.stats)&&(null==t?void 0:null===(x=t.retrievedMetadata)||void 0===x?void 0:x.properties)&&!(e.stats in(null===(h=t.retrievedMetadata)||void 0===h?void 0:h.properties)))return!1;if((null==e?void 0:e.scale)&&(null==t?void 0:null===(v=t.retrievedMetadata)||void 0===v?void 0:v.properties)&&(null===(f=t.retrievedMetadata)||void 0===f?void 0:null===(m=f.properties.Scale)||void 0===m?void 0:m.value)){let o=null===(S=t.retrievedMetadata)||void 0===S?void 0:null===(y=S.properties.Scale)||void 0===y?void 0:null===(C=y.value)||void 0===C?void 0:C.toLowerCase();if((null==e?void 0:e.scale.toLowerCase())=="middling"){if("heavyweight"==o||"featherweight"==o)return!1}else if(e.scale.toLowerCase()!=o)return!1}if((null==e?void 0:e.isEquipped)=="notEquipped"){if("nft"in t&&(null==t?void 0:null===(k=t.nft.parent)||void 0===k?void 0:k.id))return!1}else if((null==e?void 0:e.isEquipped)=="equipped"){if("nft"in t&&!(null==t?void 0:null===(I=t.nft.parent)||void 0===I?void 0:I.id))return!1}else if("nft"in t&&(null==e?void 0:e.isEquipped)&&(null==e?void 0:e.isEquipped)!==(null==t?void 0:null===(w=t.nft.parent)||void 0===w?void 0:w.id))return!1;return(!("nft"in t)||null==e||!e.resource||!!(null==t?void 0:null===(b=t.nft.id)||void 0===b?void 0:b.match(e.resource)))&&(!("nft"in t)||null==e||!e.name||!!e.name.find(e=>{var o;return null==t?void 0:null===(o=t.nft.id)||void 0===o?void 0:o.match(e)}))&&("nft"in t&&(null===(j=e.contractAddresses)||void 0===j?void 0:j.length)&&(!e.contractAddresses.includes(t.nft.address)||!function(e,t){if(!e)return!0;let{poolId:o,memberId:i}=g(e),{poolId:l,memberId:n}=g(t);return o==l&&(i==n||0==i)}(null===(_=e.itemIds)||void 0===_?void 0:_[0],t.nft.itemId))?(console.log("false"),!1):((null==e?void 0:e.description)!="Potions"||(null===(F=t.retrievedMetadata)||void 0===F?void 0:null===(E=F.properties)||void 0===E?void 0:null===(N=E.Type)||void 0===N?void 0:N.value)==="Potion")&&((null==e?void 0:e.description)!="Tinctures"||(null===(R=t.retrievedMetadata)||void 0===R?void 0:null===(A=R.properties)||void 0===A?void 0:null===(M=A.Type)||void 0===M?void 0:M.value)==="Tincture"))}var b=o(36286),j=o(86286),C=o(59555),y=o(30317),S=o(54331),k=o(12596),I=o(40916),_=o(47313),N=o(8022),E=o(15379),F=o(42069),M=o(47854),A=o(70339),R=x.memo(function(e){let{slotSize:t,numSlots:o,spacing:h,gridHeight:g,includeEquipped:R,forcedRefresh:T,singleSelectOnly:z,selectedTab:D,setSelectedTab:L,columns:B=4,showHints:H=!1,showEscrowedTokens:W=!1,lockTabs:O=!1,lockSoul:P=!1,showSoulTab:U=!1,colorScheme:q="light"}=e,G=["Equippables","Resources","Fish","Triumphs","???","In-Market"];U&&G.unshift("Souls");let{soulNfts:Z,lootNfts:V,fishNfts:Y,triumphNfts:$,citizenNfts:K,equipmentRefreshSignal:J,selectedForTrade:X,itemInHand:Q,backpackFilter:ee,fishingBoardNfts:et,botanistNfts:eo,unclaimedNfts:ei,selectedSoulNft:el,resources:en,unclaimedResources:er,loadingFishNfts:ea,loadingTriumphNfts:es,fetchRewards:ed,fetchResources:ec,fetchLootNfts:eu,fetchFishNfts:ep,fetchTriumphNfts:ex,fetchBotanistNfts:eh,fetchFishingBoardNfts:ev,fetchEscrowStorage:em,setFishingBoardNfts:ef,setBotanistNfts:eg,dropItem:ew,removeFromTradeSelection:eb,setBackpackFilter:ej,setSelectedForTrade:eC,setTradeSelection:ey,clearTradeSelection:eS,setIsRefreshingNfts:ek}=(0,F.m)(),eI=(0,p.v9)(e=>e.windowReducer.stashWindow),e_=(0,p.v9)(e=>e.inventoryReducer.escrowedData),eN=(0,p.v9)(e=>e.marketplaceReducer.removeFromEscrow),eE=(0,p.v9)(e=>e.inventoryReducer.selectedPotions),eF=(0,p.v9)(e=>e.inventoryReducer.selectedTinctures),eM=(0,p.v9)(e=>e.inventoryReducer.mercWallet),eA=(0,p.v9)(e=>e.inventoryReducer.selectedMercPotionAmount),eR=(0,p.v9)(e=>e.inventoryReducer.selectedMercTinctureAmount),{web3Provider:eT,connectedWallet:ez}=(0,p.v9)(e=>e.web3Reducer),eD=null==ez?void 0:ez.address;(0,x.useRef)();let eL=(0,x.useRef)(),[eB,eH]=(0,x.useState)(),[eW,eO]=(0,x.useState)(),[eP,eU]=(0,x.useState)(),[eq,eG]=(0,x.useState)(!1),[eZ,eV]=(0,x.useState)(),eY=(0,x.useRef)();(0,x.useRef)(),(0,x.useRef)();let e$=(null==ee?void 0:ee.onSelect)||M.BD;(0,x.useEffect)(()=>{to(D)},[D,eI]),(0,x.useEffect)(()=>{eL.current&&eL.current.abort();let e=new AbortController;return eL.current=e,tt(e),()=>{var e;return null===(e=eL.current)||void 0===e?void 0:e.abort()}},[el]);let eK=(0,x.useMemo)(()=>(0,f.fT)(V||[],[...Z,...K],X,Q),[V,X,Q,Z,J]),eJ=(0,x.useMemo)(()=>(0,f.sC)(en||[],X,Q,[...eE,...eF]),[en,eA,eR,X,Q,eE,eF]),eX=(0,x.useMemo)(()=>(void 0==et&&(0,m.Y5)(eD).then(e=>{ef(e)}),(0,f.YS)(Y||[],et||[],X,Q)),[Y,et,X,Q]),eQ=(0,x.useMemo)(()=>(void 0==eo&&(0,m.ZO)(eD).then(e=>{eg(e)}),(0,f._V)($||[],eo||[],X,Q)),[$,eo,X,Q]),e0=(0,x.useMemo)(()=>(0,f.VR)(ei,X,Q),[ei,X,Q]);(0,x.useEffect)(()=>("Souls"==D&&(Z.length||K.length)&&eU([...K.filter(e=>{var t;return!e.isListed&&!(null===(t=X.soulNfts)||void 0===t?void 0:t.find(t=>
1t.id==e.id))}),...Z.filter(e=>{var t;return!e.isListed&&!(null===(t=X.soulNfts)||void 0===t?void 0:t.find(t=>t.id==e.id))})]),()=>{}),[Z,D,Q,X,J]),(0,x.useEffect)(()=>{if("Souls"==D||(null==ee?void 0:ee.type)=="Souls"){let e=[];console.log("producing souls jsx now!",eP),null==eP||eP.forEach((o,i)=>{var l,r,a,s,d;let c=(0,n.jsx)(_.H,{slotSize:t||82,nft:o,soulClass:"".concat(null==o?void 0:null===(a=o.retrievedMetadata)||void 0===a?void 0:null===(r=a.properties)||void 0===r?void 0:null===(l=r["Soul Class"])||void 0===l?void 0:l.value),onSelect:M.Vg,disabled:O&&(null==X?void 0:null===(d=X.soulNfts)||void 0===d?void 0:null===(s=d[0])||void 0===s?void 0:s.id)!==(null==o?void 0:o.id)});e.push(c)}),eO(e)}},[eP,D,ee]);let e1=(0,x.useCallback)(e=>{let o=[],i=[];switch(e){case"fishes":eX&&eX.length>0&&i.push(...eX);break;case"triumphs":eQ&&eQ.length>0&&i.push(...eQ);break;case"equipment":eK&&eK.length>0&&i.push(...eK)}return i.forEach((i,l)=>{(!ee||w(ee,i))&&o.push((0,n.jsx)(y.Z,{asset:i,soulClass:eZ,slotSize:t||82,colorScheme:"dark",newStyle:!0,onSelect:e$},"slot-"+e+"-"+l))}),o},[eK,eX,eQ,ee,eZ,e$,t]),e2=(0,x.useCallback)(()=>{let e=[];return e0&&e0.length>0&&e0.forEach((o,i)=>{(null==o?void 0:o.amount)>0&&w(ee,o)&&e.push((0,n.jsx)(b.I,{reward:o,slotSize:t||82,newStyle:!0,onSelect:e$},o.itemId+" - "+i))}),e},[e0,ee,e$]),e5=(0,x.useCallback)(()=>{let e=[],o=0;if(e_){var l,r,a,s,d,c,u,p,x,h,v,m,f,g,w,C,y,N,E,F,A,R,T,z,D,L,B,H,O,P,U,q,G,Z,V,Y,$,K,J,Q,ee,et,eo;let ei=e_.erc1155s.slice();if(ei.forEach(e=>{var t,o,i;let l=null===(t=X.resources)||void 0===t?void 0:t.find(t=>t.resourceId==e.resourceId);e.amount-=(null==l?void 0:l.amount)||0;let n=null===(o=eN.resources)||void 0===o?void 0:o.find(t=>t.resourceId==e.resourceId);e.amount-=(null==n?void 0:n.amount)||0,e.resourceId=e.resourceId||Number(e.id);let r=null===(i=e_.unclaimedResources.find(t=>t.resourceId==e.resourceId))||void 0===i?void 0:i.amount;r&&(e.unclaimedAmount=r,e.amount+=r)}),e_.unclaimedResources.forEach(e=>{if(!ei.find(t=>t.resourceId==e.resourceId)){let t=(0,i._)({},e);t.unclaimedAmount=t.amount,ei.push(t)}}),null==e_?void 0:e_.erc721s)for(let i=0;i<(null==e_?void 0:null===(l=e_.erc721s)||void 0===l?void 0:l.length);i++){let l=null==e_?void 0:e_.erc721s[i];(null===(r=X.nfts)||void 0===r||!r.find(e=>e.id==l.id))&&((null===(a=eN.nfts)||void 0===a?void 0:a.find(e=>e.id==l.id))||(e.push((0,n.jsx)(S.s,{asset:l,slotSize:t||82,newStyle:!0,isEscrowed:!0,onSelect:M.Vg,disabled:(null!==(c=null==X?void 0:null===(s=X.soulNfts)||void 0===s?void 0:s.length)&&void 0!==c?c:0)>0||(null!==(u=null==X?void 0:null===(d=X.escrowedSoulNfts)||void 0===d?void 0:d.length)&&void 0!==u?u:0)>0},"tradebox-"+o)),o+=1))}if(null==e_?void 0:e_.composedNfts)for(let i=0;i<(null==e_?void 0:null===(p=e_.composedNfts)||void 0===p?void 0:p.length);i++){let l=null==e_?void 0:e_.composedNfts[i];!((null===(x=X.soulNfts)||void 0===x?void 0:x.find(e=>e.id==l.id))||(null===(h=X.escrowedSoulNfts)||void 0===h?void 0:h.find(e=>e.id==l.id)))&&((null===(v=eN.soulNfts)||void 0===v?void 0:v.find(e=>e.id==l.id))||(e.push((0,n.jsx)(_.H,{nft:l,slotSize:t||82,onSelect:M.Vg,isEscrowed:!0,disabled:(null!==(A=null==X?void 0:null===(m=X.escrowedNfts)||void 0===m?void 0:m.length)&&void 0!==A?A:0)>0||((null===(f=X.soulNfts)||void 0===f?void 0:f.length)||0)>0||((null===(g=X.escrowedSoulNfts)||void 0===g?void 0:g.length)||0)>0||((null===(w=X.nfts)||void 0===w?void 0:w.length)||0)>0||((null===(C=X.unclaimedNfts)||void 0===C?void 0:C.length)||0)>0||((null===(y=X.resources)||void 0===y?void 0:y.length)||0)>0||((null===(N=X.escrowedUnclaimedNfts)||void 0===N?void 0:N.length)||0)>0||((null===(E=X.escrowedNfts)||void 0===E?void 0:E.length)||0)>0||((null===(F=X.escrowedResources)||void 0===F?void 0:F.length)||0)>0},"tradebox-"+o)),o+=1))}if(null==ei?void 0:ei.length)for(let i=0;i<ei.length;i++){let l=ei[i];e.push((0,n.jsx)(j.Z,{resource:l,size:t||82,newStyle:!0,isEscrowed:!0,onSelect:M.Vg,disabled:(null!==(z=null==X?void 0:null===(R=X.soulNfts)||void 0===R?void 0:R.length)&&void 0!==z?z:0)>0||(null!==(D=null==X?void 0:null===(T=X.escrowedSoulNfts)||void 0===T?void 0:T.length)&&void 0!==D?D:0)>0},"market-inv-"+o)),o+=1}if(null==e_?void 0:e_.unclaimedNfts)for(let i=0;i<(null==e_?void 0:null===(L=e_.unclaimedNfts)||void 0===L?void 0:L.length);i++){let l=null==e_?void 0:e_.unclaimedNfts[i],r=null===(B=X.unclaimedNfts)||void 0===B?void 0:B.find(e=>e.id==l.id);r&&(l.amount-=r.amount);let a=null===(H=eN.unclaimedNfts)||void 0===H?void 0:H.find(e=>e.id==l.id);a&&(l.amount-=a.amount),l.amount<=0||(e.push((0,n.jsx)(b.I,{reward:l,slotSize:t||82,multiSelect:!0,newStyle:!0,isEscrowed:!0,onSelect:M.Vg,disabled:(null!==(U=null==X?void 0:null===(O=X.soulNfts)||void 0===O?void 0:O.length)&&void 0!==U?U:0)>0||(null!==(q=null==X?void 0:null===(P=X.escrowedSoulNfts)||void 0===P?void 0:P.length)&&void 0!==q?q:0)>0},"bidbox-"+o)),o+=1)}if(W&&(null==e_?void 0:e_.erc20s))for(let l=0;l<(null==e_?void 0:null===(G=e_.erc20s)||void 0===G?void 0:G.length);l++){if(!Number(null==e_?void 0:e_.erc20s[l].amount))continue;let r=(0,i._)({},null==e_?void 0:e_.erc20s[l]),a=null===(Z=X.escrowedErc20s)||void 0===Z?void 0:Z.find(e=>
1e.id==r.id);a&&(r.amount=BigInt(r.amount)-BigInt(a.amount));let s=null===(V=eN.erc20s)||void 0===V?void 0:V.find(e=>e.id==r.id);s&&(r.amount=BigInt(r.amount)-BigInt(s.amount)),r.amount<=BigInt(0)||(e.push((0,n.jsx)(k.Z,{erc20:r,size:t||82,multiSelect:!0,newStyle:!0,isEscrowed:!0,onSelect:M.Vg,disabled:(null!==(K=null==X?void 0:null===(Y=X.soulNfts)||void 0===Y?void 0:Y.length)&&void 0!==K?K:0)>0||(null!==(J=null==X?void 0:null===($=X.escrowedSoulNfts)||void 0===$?void 0:$.length)&&void 0!==J?J:0)>0},"market-inv-"+o)),o+=1)}if(W&&(null==e_?void 0:e_.ether)>0){let i=X.escrowedEther,l=eN.ether,r=BigInt(e_.ether)-(i||BigInt(0))-(l||BigInt(0));e.push((0,n.jsx)(I.Z,{ether:r,size:t||82,newStyle:!0,isEscrowed:!0,onSelect:M.Vg,onDrop:eb,disabled:(null!==(et=null==X?void 0:null===(Q=X.soulNfts)||void 0===Q?void 0:Q.length)&&void 0!==et?et:0)>0||(null!==(eo=null==X?void 0:null===(ee=X.escrowedSoulNfts)||void 0===ee?void 0:ee.length)&&void 0!==eo?eo:0)>0},"market-inv-"+o)),o+=1}return e}},[e_,X,eN,e$,W]),e3=(0,x.useCallback)(()=>{var e,o,i,l;let r=[];return eJ&&eJ.forEach((e,o)=>{(null==e?void 0:e.resourceId)&&w(ee,e)&&r.push((0,n.jsx)(j.Z,{resource:e,size:t||82,singleSelectOnly:z,newStyle:!0,onSelect:e$},"resource-"+e.resourceId+"-"+e.amount))}),(null==ee?void 0:ee.description)=="Potions"&&r.push((0,n.jsx)(j.Z,{resource:{id:"uniqueId",resourceId:1,amount:((null==eM?void 0:null===(o=eM.potions)||void 0===o?void 0:null===(e=o.find(e=>"2"==e.uniqueId))||void 0===e?void 0:e.amount)||0)-eA,metadataUri:"",retrievedMetadata:{name:"Warborn Health Potion",description:"Use this potion to heal your character for a flat amount of maxHealth",mediaUri:"/assets/warborn/Warborn_Health_500.png",attributes:[{label:"Type",type:"string",value:"Potion",trait_type:"Type"}],thumbnailUri:"/assets/warborn/Warborn_Health_500.png",image:"/assets/warborn/Warborn_Health_500.png",properties:{Type:{value:"Potion",type:"string"}}},unclaimedAmount:0},size:t||82,singleSelectOnly:z,onSelect:e$,newStyle:!0},"warborn-potion")),(null==ee?void 0:ee.description)=="Tinctures"&&r.push((0,n.jsx)(j.Z,{resource:{id:"uniqueId",resourceId:1,amount:((null==eM?void 0:null===(l=eM.potions)||void 0===l?void 0:null===(i=l.find(e=>"13"==e.uniqueId))||void 0===i?void 0:i.amount)||0)-eR,metadataUri:"",retrievedMetadata:{name:"Warborn Fortitude Tincture",description:"This tincture will increase your character's max health before entering the expedition.",mediaUri:"/assets/warborn/Warborn_Tincture_500.png",attributes:[{label:"Type",type:"string",value:"Tincture",trait_type:"Type"}],thumbnailUri:"/assets/warborn/Warborn_Tincture_500.png",image:"/assets/warborn/Warborn_Tincture_500.png",properties:{Type:{value:"Tincture",type:"string"}}},unclaimedAmount:0},size:t||82,singleSelectOnly:z,onSelect:e$,newStyle:!0},"warborn-tincture")),r},[eJ,ee,eM,eA,eR,eE,eF,e$,z]),e8=(0,x.useMemo)(()=>e1("equipment"),[eK,ee,e1]),e9=(0,x.useMemo)(()=>e1("fishes"),[eX,ee,e1]),e4=(0,x.useMemo)(()=>e1("triumphs"),[eQ,ee,e1]),e6=(0,x.useMemo)(()=>e3(),[en,eJ,eM,eE,eF,eA,eR,ee]),e7=(0,x.useMemo)(()=>e2(),[e0,ee]),te=(0,x.useMemo)(()=>e5(),[e_,ee,X]);(0,x.useEffect)(()=>{L&&((null==ee?void 0:ee.type)=="Resources"?L("Resources"):(null==ee?void 0:ee.type)=="Fish"?L("Fish"):(null==ee?void 0:ee.type)=="Triumphs"?L("Triumphs"):(null==ee?void 0:ee.type)=="Equippables"?L("Equippables"):(null==ee?void 0:ee.type)==""&&L(""))},[ee]),(0,x.useEffect)(()=>{L&&L(D)},[]),(0,x.useEffect)(()=>{"Fish"==D?ej((0,l._)((0,i._)({},ee),{showFilter:!0,fields:["Rarity","Scale"],slotFields:["fish_1","fish_2","fish_3","fish_4","fish_5","fish_6","fish_7","fish_8","fish_9","fish_10","fish_11","fish_12","fish_13","fish_14","fish_15","fish_16","fish_17","fish_18","fish_19","fish_20","fish_21","fish_22"]})):"Triumphs"==D?ej((0,l._)((0,i._)({},ee),{showFilter:!0,fields:["Rarity"]})):"Resources"==D?ej((0,l._)((0,i._)({},ee),{showFilter:!0,fields:["Rarity"]})):"???"==D?ej((0,l._)((0,i._)({},ee),{showFilter:!0,fields:["Rarity"]})):"Equippables"==D&&ej((0,l._)((0,i._)({},ee),{showFilter:!0,fields:["Rarity","Slot"],slotFields:["Main Hand","Off Hand","Head","Body","Feet","Neck","Left Ring","Right Ring"]}))},[]);let tt=(0,x.useCallback)(async e=>{if((null==el?void 0:el.metadataUri)&&!(null==el?void 0:el.retrievedMetadata))await (0,m.ip)(null==el?void 0:el.metadataUri,e).then(e=>{(null==e?void 0:e.properties)&&(null==e?void 0:e.properties["Soul Class"])&&((null==e?void 0:e.properties["Soul Class"].value)=="Berserker"?eV("Berserker"):(null==e?void 0:e.properties["Soul Class"].value)=="Alchemist"?eV("Alchemist"):(null==e?void 0:e.properties["Soul Class"].value)=="Ranger"?eV("Ranger"):(null==e?void 0:e.properties["Soul Class"].value)=="Behemoth"?eV("Behemoth"):(null==e?void 0:e.properties["Soul Class"].value)=="Sand Shaper"&&eV("Sand Shaper"))});else if(null==el?void 0:el.retrievedMetadata){var t,o,i,l,n,r,a;(null==el?void 0:null===(t=el.retrievedMetadata)||void 0===t?void 0:t.properties)&&(null==el?void 0:null===(o=el.retrievedMetadata)||void 0===o?void 0:o.properties["Soul Class"])&&((null==el?void 0:null===(i=el.retrievedMetadata)||void 0===i?void 0:i.properties["Soul Class"].value)=="Berserker"?eV("Berserker"):(null==el?void 0:null===(l=el.retrievedMetadata)||void 0===l?void 0:l.properties["Soul Class"].value)=="Alchemist"?eV("Alchemist"):(null==el?void 0:null===(n=el.retrievedMetadata)||void 0===n?void 0:n.properties["Soul Class"].value)=="Ranger"?eV("Ranger"):(null==el?void 0:null===(r=el.retrievedMetadata)||void 0===r?void 0:r.properties["Soul Class"].value)=="Behemoth"?eV("Behemoth"):(null==el?void 0:null===(a=el.retrievedMetadata)||void 0===a?void 0:a.properties["Soul Class"].value)=="Sand Shaper"&&eV("Sand Shaper"))}},[el]),to=(0,x.useCallback)((e,t)=>{console.log("Refreshing NFTs: ",e),ek(!0),"Equippables"==e?(null==e8?void 0:e8.length)||eu():"Triumphs"==e?(null==$?void 0:$.length)||((null==eo?void 0:eo.length)||eh(),ex()):"Fish"==e?((null==et?void 0:et.length)||ev(),(null==Y?void 0:Y.length)||ep()):"???"==e?ed():"Resources"==e?ec():"In-Market"==e&&em(),setTimeout(()=>{ek(!1)},100)},[D]),ti=(0,x.useCallback)(e=>{L&&D!==e&&L(e)},[D,L]);return(0,n.jsxs)(r.g,{w:"100%",h:"100%",gap:"20px",spacing:0,py:"5px",pb:"15px",children:[(0,n.jsx)(a.r,{w:"100%",px:"37.5
1px",pt:"3px",templateColumns:"repeat(auto-fill, minmax(82px, 1fr))",gridAutoRows:"max-content",gap:"12px",justifyContent:"center",justifyItems:"center",children:(!ee||!ee.hideTabs)&&G.map((e,t)=>(0,n.jsx)(E.Z,{text:"with both Souls and Resources/Gear",secondaryText:"Can't create trade",disabled:D===e||!O&&"Souls"!==e||!P&&!O,children:(0,n.jsxs)(s.M,{w:"92px",h:"38px",borderRadius:"5px",borderColor:A.D.brown,borderWidth:"2px",bg:"#090908",boxShadow:"2.5px 2.5px 0px ".concat(D===e?A.D.yellow:"black"),onClick:()=>{!O&&("Souls"==e&&P||ti(e))},cursor:"pointer",pos:"relative",_hover:{borderColor:O||"Souls"==e&&P?A.D.brown:A.D.yellow},children:[(0,n.jsx)(d.x,{color:D===e?A.D.yellow:O||"Souls"==e&&P?A.D.brown:"white",style:{color:D===e?A.D.yellow:O||"Souls"==e&&P?A.D.brown:"white"},fontSize:"16px",fontFamily:"Grenze",fontWeight:"300",lineHeight:"16px",letterSpacing:.64,px:"8px",py:"7px",children:e}),(O||"Souls"==e&&P)&&D!==e&&(0,n.jsx)(c.x,{pos:"absolute",left:"1px",top:"1px",children:(0,n.jsx)(N.mB,{fill:A.D.brown})})]},"inv-tab-"+t)},t))}),"In-Market"==D&&H&&(0,n.jsxs)(c.x,{px:"20px",w:"100%",style:{color:"black"},children:[(0,n.jsx)(d.x,{style:{fontSize:"20px",fontFamily:"Grenze",fontWeight:"500"},pb:"5px",children:"These items are currently 'in-market'. Hover over to see status."}),(0,n.jsx)(d.x,{style:{fontSize:"20px",fontFamily:"Grenze",fontWeight:"500"},children:"Items withdrawn from the marketplace will be returned to your regular inventory and existing bids or trades cancelled."})]}),(0,n.jsx)(a.r,{ref:eY,h:"100%",w:"100%",px:"29px",templateColumns:"repeat(auto-fill, minmax(60px, 1fr))",gridAutoRows:"max-content",gap:"13px",justifyContent:"center",justifyItems:"center",overflowY:"auto",pb:"40px",className:v().newmarket,onClick:e=>{if(eG(!0),null==Q?void 0:Q.nftAsset){var t,o,i;(null==el?void 0:null===(t=el.equipped)||void 0===t?void 0:t.find(e=>(0,C.d)(e,Q.nftAsset)))&&el&&(el.equipped=null==el?void 0:null===(o=el.equipped)||void 0===o?void 0:o.filter(e=>!(0,C.d)(e,null==Q?void 0:Q.nftAsset)));let e=null==et?void 0:et.find(e=>{var t;return null===(t=e.equipped)||void 0===t?void 0:t.find(e=>(0,C.d)(e,null==Q?void 0:Q.nftAsset))});e&&(e.equipped=null==e?void 0:null===(i=e.equipped)||void 0===i?void 0:i.filter(e=>!(0,C.d)(e,null==Q?void 0:Q.nftAsset))),ew()}else(null==Q?void 0:Q.nft)?ew():(null==Q?void 0:Q.resource)?ew():(null==Q?void 0:Q.unclaimedNft)?ew():(null==Q?void 0:Q.erc20)?ew():(null==Q?void 0:Q.ether)&&ew()},children:""==D?eB&&eB.length>0?eB.map((e,t)=>e):eB?(0,n.jsx)(c.x,{w:"100%",p:"10px",fontSize:"16px",fontWeight:"medium",textAlign:"center",children:(0,n.jsx)("p",{style:{fontFamily:"Gnellen",fontSize:"16px",color:A.D.beige,padding:"10px",textAlign:"center",background:"rgba(0, 0, 0, 0.7)",borderRadius:"5px",border:"1px solid #3a1a1a",whiteSpace:"nowrap",wordBreak:"keep-all",display:"inline-block",width:"auto"},children:"No Items."})},"inmsg-items"):(0,n.jsx)(u.$,{size:"lg"}):"Equippables"==D?e8&&e8.length>0?e8.map((e,t)=>e):e8?(0,n.jsx)(c.x,{w:"100%",p:"10px",fontSize:"16px",fontWeight:"medium",textAlign:"center",children:(0,n.jsx)("p",{style:{fontFamily:"Gnellen",fontSize:"16px",color:A.D.beige,padding:"10px",textAlign:"center",background:"rgba(0, 0, 0, 0.7)",borderRadius:"5px",border:"1px solid #3a1a1a",whiteSpace:"nowrap",wordBreak:"keep-all",display:"inline-block",width:"auto"},children:"No Equippable Items."})},"inmsg-equippables"):(0,n.jsx)(u.$,{size:"lg"}):"Fish"==D?e9&&e9.length>0?e9.map((e,t)=>e):e9?(0,n.jsx)(c.x,{w:"100%",p:"10px",fontSize:"16px",fontWeight:"medium",textAlign:"center",children:(0,n.jsx)("p",{style:{fontFamily:"Gnellen",fontSize:"16px",color:A.D.beige,padding:"10px",textAlign:"center",background:"rgba(0, 0, 0, 0.7)",borderRadius:"5px",border:"1px solid #3a1a1a",whiteSpace:"nowrap",wordBreak:"keep-all",display:"inline-block",width:"auto"},children:"No Fish Items."})},"inmsg-fish"):ea?(0,n.jsx)(u.$,{size:"lg",color:"white"}):null:"Triumphs"==D?e4&&e4.length>0?e4.map((e,t)=>e):e4?(0,n.jsx)(c.x,{w:"100%",p:"10px",fontSize:"16px",fontWeight:"medium",textAlign:"center",children:(0,n.jsx)("p",{style:{fontFamily:"Gnellen",fontSize:"16px",color:A.D.beige,padding:"10px",textAlign:"center",background:"rgba(0, 0, 0, 0.7)",borderRadius:"5px",border:"1px solid #3a1a1a",whiteSpace:"nowrap",wordBreak:"keep-all",display:"inline-block",width:"auto"},children:"No Triumph Items."})},"inmsg-triumphs"):es?(0,n.jsx)(u.$,{size:"lg",color:"white"}):null:"Resources"==D?e6&&e6.length>0?e6.map((e,t)=>e):e6?(0,n.jsx)(c.x,{w:"100%",p:"10px",fontSize:"16px",fontWeight:"medium",textAlign:"center",children:(0,n.jsx)("p",{style:{fontFamily:"Gnellen",fontSize:"16px",color:A.D.beige,padding:"10px",textAlign:"center",background:"rgba(0, 0, 0, 0.7)",borderRadius:"5px",border:"1px solid #3a1a1a",whiteSpace:"nowrap",wordBreak:"keep-all",display:"inline-block",width:"auto"},children:"No Resources."})},"inmsg-resources"):(0,n.jsx)(u.$,{size:"lg"}):"???"==D?(0,n.jsx)(n.Fragment,{children:e7?e7.map((e,t)=>e):(0,n.jsx)(u.$,{size:"lg"})}):"In-Market"==D?te&&te.length>0?te.map((e,t)=>e):te?(0,n.jsx)(c.x,{w:"100%",p:"10px",fontSize:"16px",fontWeight:"medium",textAlign:"center",children:(0,n.jsx)("p",{style:{fontFamily:"Gnellen",fontSize:"16px",color:A.D.beige,padding:"10px",textAlign:"center",background:"rgba(0, 0, 0, 0.7)",borderRadius:"5px",border:"1px solid #3a1a1a",whiteSpace:"nowrap",wordBreak:"keep-all",display:"inline-block",width:"auto"},children:"No In-Market Items."})},"fmsg"):(0,n.jsx)(u.$,{size:"lg"}):"Souls"==D?eW&&eW.length>0?eW.map((e,t)=>e):eW?(0,n.jsx)(c.x,{w:"100%",p:"10px",fontSize:"16px",fontWeight:"medium",textAlign:"center",children:(0,n.jsx)("p",{style:{fontFamily:"Gnellen",fontSize:"16px",color:A.D.beige,padding:"10px",textAlign:"center",background:"rgba(0, 0, 0, 0.7)",borderRadius:"5px",border:"1px solid #3a1a1a",whiteSpace:"nowrap",wordBreak:"keep-all",display:"inline-block",width:"auto"},children:"No available Souls."})},"inmsg-souls"):(0,n.jsx)(u.$,{size:"lg"}):(0,n.jsx)(n.Fragment,{})},D)]})})},36286:function(e,t,o){"use strict";o.d(t,{I:function(){return y}});var i=o(85893),l=o(90944),n=o.n(l),r=o(67294),a=o(18118),s=o(44988),d=o(26972),c=o(68029),u=o(933),p=o(74032),x=o(37945),h=o(92041),v=o(86384),m=o(45007),f=o(47854),g=o(10331),w=o(56857),b=o(97619),j=o(10754),C=o(77286);function y(e){var t,o,l,y,S;let{reward:k,slotSize:I,multiSelect:_,newStyle:N,isEscrowed:E,onSelect:F,disabled:M}=e;I||(I=70);let A=(0,r.useRef)(),R=(0,v.WR)((null===(t=k.retrievedMetadata)||void 0===t?void 0:t.thumbnailUri)||(null===(o=k.retrievedMetadata)||void 0===o?void 0:o.mediaUri)),T=(0,m.I0)(),[z,D]=(0,r.useState)(0),[L,B]=(0,r.useState)(),[H,W]=(0,r.useState)(!1),[O,P]=(0,r.useState)(!1),[U,q]=(0,r.useState)(!0),[G,Z]=(0,r.useState)(k.amount),V=!("tokenId"in k),Y=(0,m.v9)(e=>e.inventoryReducer.itemInHand);(0,r.useEffect)(()=>{async function e(){let e;k.metadataUri&&(e=await (0,v.ip)(k.metadataUri)),B(e),e&&(k.retrievedMetadata=e)}!k.retrievedMetadata&&k.metadataUri?e():B(k.retrievedMetadata)},[k]),(0,r.useEffect)(()=>{Z(k.amount)},[k]);let $=(0,m.v9)(e=>e.marketplaceReducer.removeFromEscrow);(0,r.useEffect)(()=>
1{if((null==k?void 0:k.id)&&$.unclaimedNfts){let e=$.unclaimedNfts.find(e=>e.contractAddress==(null==k?void 0:k.contractAddress)&&e.itemId==(null==k?void 0:k.itemId));k?D((null==e?void 0:e.amount)||0):D(0)}else D(0)},[$]);let K=null===(S=k.retrievedMetadata)||void 0===S?void 0:null===(y=S.attributes)||void 0===y?void 0:null===(l=y.find(e=>"Rarity"==e.label))||void 0===l?void 0:l.value,J="";if(J=N?0!=z?n().activeSelection:"Common"==K?n().commonItemNew:"Rare"==K?n().rareItemNew:"Epic"==K?n().epicItemNew:"Legendary"==K?n().legendaryItemNew:n().emptySlotNew:"Common"==K?n().commonItem:"Rare"==K?n().rareItem:"Epic"==K?n().epicItem:"Legendary"==K?n().legendaryItem:n().emptySlot,!(null==k?void 0:k.amount))return null;let X=(0,i.jsx)(a.U,{w:I,h:I,className:J,overflow:"visible",cursor:"pointer",pointerEvents:"visible",justifyContent:"center",alignItems:"center",onClick:e=>{M||!_||Y||(k.amount>1?(P(!0),W(!0)):(F&&T(F({unclaimedNft:k,isEscrowed:E,amount:G})),T((0,f.Ns)({unclaimedNft:k}))))},onMouseEnter:e=>{_&&k.amount>1&&O&&W(!0)},onMouseLeave:e=>{_&&W(!1)},children:R&&(0,i.jsxs)(s.J,{initialFocusRef:A,placement:"top-end",closeOnBlur:!1,closeOnEsc:!0,onOpen:()=>q(!1),onClose:()=>q(!0),isOpen:O,children:[(0,i.jsx)(d.u,{wordBreak:"break-word",label:(0,C.Z)({metadata:k.retrievedMetadata,image:R}),placement:"left",bgColor:"transparent",p:0,shouldWrapChildren:U,children:(0,i.jsx)(c.x,{display:"inline-block",children:(0,i.jsx)(u.x,{children:(0,i.jsxs)(c.x,{pos:"relative",onClick:()=>{!Y&&(1==k.amount?F&&T(F({unclaimedNft:k,amount:G,isEscrowed:E})):P(!0))},children:[(0,i.jsx)(h.yZ,{src:R,width:I,height:I,rounded:"50%"}),N?(0,i.jsx)(p.C,{position:"absolute",bgColor:"transparent",color:"white",bottom:0,right:0,children:k.amount}):(0,i.jsx)(p.C,{colorScheme:"red",color:"#b00b00",bgColor:"white",rounded:"md",position:"absolute",top:0,right:0,border:"0.5px solid #822626",children:k.amount}),V&&(0,i.jsx)(x.E,{position:"absolute",top:0,right:0,w:6,h:6,src:"/icons/With_BG/chest_eq_icon_r.png"})]})})})},k.itemId+"-tooltip"),(0,i.jsx)(g.N,{res:k,invertSelect:!1,amount:G,setAmount:Z,setActivated:P,metadata:L,isEscrowed:E,mRef:A,onSelect:F})]})},k.itemId);return(0,i.jsxs)(j.x,{children:[(0,i.jsx)(w.W,{children:X}),(0,i.jsx)(b.$,{item:k,suggestedQuantity:1})]})}},47313:function(e,t,o){"use strict";o.d(t,{H:function(){return v}});var i=o(85893),l=o(18118),n=o(26972),r=o(15715),a=o(68029),s=o(37945),d=o(90944),c=o.n(d),u=o(92041),p=o(67294),x=o(45007),h=o(77286);function v(e){var t;let{nft:o,slotSize:d,soulClass:v,isEscrowed:m,onSelect:f,disabled:g}=e,w=(0,x.I0)(),[b,j]=(0,p.useState)({x:0,y:0}),[C,y]=(0,p.useState)(""),[S,k]=(0,p.useState)("#38332E"),[I,_]=(0,p.useState)(!1),N=(0,x.v9)(e=>e.inventoryReducer.itemInHand),E=(0,x.v9)(e=>e.marketplaceReducer.removeFromEscrow);return(0,p.useEffect)(()=>{(null==o?void 0:o.id)&&E.soulNfts&&E.soulNfts.find(e=>e.address==(null==o?void 0:o.address)&&e.id==(null==o?void 0:o.id))?_(!0):_(!1)},[E]),(0,p.useEffect)(()=>{var e,t,i;!C&&(v=null!=v?v:null==o?void 0:null===(i=o.retrievedMetadata)||void 0===i?void 0:null===(t=i.properties)||void 0===t?void 0:null===(e=t["Soul Class"])||void 0===e?void 0:e.value)&&("Berserker"==v?(y("assets/portrait/Berserker_Logo.jpg"),j({x:0,y:8})):"Alchemist"==v?(y("assets/portrait/Alchemist_Logo.jpg"),j({x:1,y:8})):"Ranger"==v?(y("assets/portrait/Ranger_Logo.jpg"),j({x:0,y:6})):"Behemoth"==v?(y("assets/portrait/Behemoth_Logo.jpg"),j({x:0,y:0})):v.includes("Sand")&&(y("assets/portrait/SandShaper_Logo.jpg"),j({x:0,y:0})))},[o]),(0,i.jsx)(l.U,{w:d+"px",h:d+"px",className:I?c().activeSelection:c().commonItemNew,bgColor:"#3338",alignItems:"center",justifyContent:"center",onMouseEnter:()=>k("#FAC70C"),onMouseLeave:()=>k("#38332E"),children:(0,i.jsx)(n.u,{wordBreak:"break-word",label:(0,h.Z)({metadata:null==o?void 0:o.retrievedMetadata,asset:(null==o?void 0:o.id)?{nft:{id:o.id}}:void 0,untradeable:!0}),placement:"auto",bgColor:"transparent",shouldWrapChildren:!0,p:0,children:(0,i.jsxs)(r.M,{cursor:"pointer",w:d-3+"px",h:d-3+"px",position:"relative",rounded:"7px",onClick:e=>{g||(null==N?void 0:N.soulNft)||!o||!f||w(f({soulNft:o,isEscrowed:m}))},overflow:"hidden",children:[(0,i.jsx)(a.x,{id:"pic",position:"absolute",w:d+"px",h:d+"px",top:(null==v?void 0:v.includes("Sand"))||(null==v?void 0:v.includes("Behemoth"))?(null==b?void 0:b.y)+10:null==b?void 0:b.y,left:(null==v?void 0:v.includes("Sand"))||(null==v?void 0:v.includes("Behemoth"))?(null==b?void 0:b.x)-2:null==b?void 0:b.x,transform:"scale(2.6)",borderColor:"white",alignItems:"center",justifyContent:"center",children:(0,i.jsx)(u.lw,{parts:null!==(t=null==o?void 0:o.parts)&&void 0!==t?t:[]},null==o?void 0:o.id)},"div-".concat(null==o?void 0:o.id,"-").concat(null==b?void 0:b.x)),(0,i.jsx)(a.x,{pos:"absolute",top:"-1px",left:"-1px",children:(0,i.jsx)(s.E,{src:C,boxSize:"17px",borderRadius:"full",border:"1.13px solid ".concat(S)})})]})},(null==o?void 0:o.id)+"-tooltip")},null==o?void 0:o.id)}},12596:function(e,t,o){"use strict";var i=o(85893),l=o(90944),n=o.n(l),r=o(88329),a=o(26972),s=o(90092),d=o(44988),c=o(933),u=o(68029),p=o(37945),x=o(74032),h=o(49381),v=o(73898),m=o(94665),f=o(24883),g=o(43803),w=o(15715),b=o(73636),j=o(82206),C=o(24858),y=o(12519),S=o(67294),k=o(47854),I=o(87461),_=o(75316),N=o(86115),E=o(86523),F=o(45007),M=o(74904),A=o(35553),R=o(2593),T=o(4794);let z=(0,h.G)((e,t)=>{let o=(0,F.I0)(),{erc20:l,invertSelect:r,amount:s,setAmount:d,setActivated:c,metadata:u,isEscrowed:p,decimals:h=18,onSelect:S}=e,T="#38332E",z="#E5C687";return(0,i.jsxs)(v.y,{color:"white",bg:"#000e",border:"3px solid #38332E",w:"140px",h:"125px",onMouseMoveCapture:e=>{e.stopPropagation()}
1,draggable:!1,zIndex:1e3,pos:"absolute",cursor:"auto",children:[(0,i.jsx)(m.Y,{pt:4,fontWeight:"bold",border:"0",userSelect:"none",draggable:!1,w:"100%",bg:T,textAlign:"center",pb:1,children:r?"Remove":"Select"}),(0,i.jsx)(f.u,{onClick:()=>c(!1)}),(0,i.jsx)(g.b,{w:"100%",px:"2px",children:(0,i.jsxs)(w.M,{zIndex:1e3,pos:"relative",w:"100%",h:"30px",userSelect:"none",draggable:!1,children:[(0,i.jsx)(x.C,{zIndex:2,color:z,w:"20px",bgColor:"transparent",position:"absolute",bottom:.5,left:"45%",userSelect:"none",draggable:!1,pointerEvents:"none",style:{fontSize:"16px"},children:s}),(0,i.jsxs)(b.U,{justifyContent:"center",onClick:e=>{e.stopPropagation()},w:"100%",alignItems:"center",justifyItems:"center",alignContent:"center",align:"center",spacing:1,children:[(0,i.jsx)(I.Y,{as:M.P1Z,boxSize:"19px",color:"white.500",_hover:{color:z},onClick:e=>{s&&A.parseUnits(s,h)>R.O$.from(1e15)?d(A.formatUnits(A.parseUnits(s,h).toBigInt()-BigInt(10**(h-3)),h)):d("0"),e.stopPropagation()},cursor:"pointer"}),(0,i.jsx)(j.I,{px:0,w:"90%",h:"20px",cursor:"all-scroll",borderWidth:"1px",focusBorderColor:"green",borderColor:"white",bgColor:T,placeholder:"",bg:"white",color:"white",onChange:e=>{var t;(t=e.currentTarget.value)?d(t):d("0")},maxLength:10,type:"range",min:0,max:Number(A.formatUnits(l.amount,h)),step:.01,rounded:"10px",value:Number(s),_hover:{borderColor:z,color:z},ref:t}),(0,i.jsx)(_.L,{as:M.zUF,boxSize:"19px",color:"white.500",_hover:{color:z},onClick:e=>{s&&A.parseUnits(s,h).toBigInt()+BigInt(1e15)<=l.amount?d(A.formatUnits(A.parseUnits(s,h).toBigInt()+BigInt(10**(h-3)),h)):d(A.formatUnits(l.amount,h)),e.stopPropagation()},cursor:"pointer"})]})]})}),(0,i.jsx)(C.D,{border:"0",display:"flex",alignItems:"center",justifyContent:"space-between",pb:4,children:(0,i.jsxs)(b.U,{w:"100%",justifyContent:"center",children:[(0,i.jsx)(a.u,{className:n().rewardsTooltip,label:(0,i.jsxs)("p",{style:{color:"white"},children:["Select "," ",(0,i.jsx)("b",{style:{color:"#FAC70C"},children:s})," "," "+(null==u?void 0:u.name)]}),placement:"auto",backgroundColor:"#1f2326",borderRadius:"7px",borderWidth:"1px",children:(0,i.jsx)(y.h,{icon:(0,i.jsx)(N.n,{h:"20px",w:"8px"}),"aria-label":"Select",variant:"solid",colorScheme:"green",h:"15px",w:"40px",minW:"30px",p:0,bgColor:T,style:{color:"white"},onClick:e=>{c(!1),S&&s&&"0"!==s&&o(S({erc20:l,amount:s?A.parseUnits(s,h):0,isEscrowed:p})),r&&(o((0,k.Ku)()),l.amount===BigInt(0)&&o((0,k.Ns)({erc20:l,isEscrowed:p}))),c(!1),e.stopPropagation()}})},l.id+"-select-tooltip1"),(0,i.jsx)(a.u,{className:n().rewardsTooltip,label:(0,i.jsx)("p",{style:{color:"white"},children:"Cancel"}),placement:"auto",backgroundColor:"#1f2326",borderRadius:"7px",borderWidth:"1px",children:(0,i.jsx)(y.h,{icon:(0,i.jsx)(E.T,{h:"20px",w:"4px"}),"aria-label":"Select",colorScheme:"red",variant:"solid",h:"15px",w:"40px",minW:"30px",p:0,bgColor:T,style:{color:"white"},onClick:e=>{c(!1),e.stopPropagation()}})},l.id+"-cancel-tooltip1")]})})]})});t.Z=S.memo(e=>{var t,o;let{erc20:l,size:h,multiSelect:v,newStyle:m,invertSelect:f,isEscrowed:g,disableClick:w,refreshTick:b,onSelect:j,onDrop:C,disabled:y}=e,k=(0,F.I0)(),[I,_]=(0,S.useState)(),[N,E]=(0,S.useState)(!1),[M,R]=(0,S.useState)(!0),[D,L]=(0,S.useState)(),[B,H]=(0,S.useState)(BigInt(0)),W=(0,F.v9)(e=>e.inventoryReducer.itemInHand),O=(0,F.v9)(e=>e.marketplaceReducer.removeFromEscrow),P=(0,T.Li)({contractAddress:l.contractAddress});(0,S.useEffect)(()=>{var e;if((null==l?void 0:l.amount)>0&&(null===(e=O.erc20s)||void 0===e?void 0:e.length)){let e=O.erc20s.find(e=>e.contractAddress==(null==l?void 0:l.contractAddress));e?H(e.amount):H(BigInt(0))}else H(BigInt(0));console.log("removeFromEscrow",O)},[O]);let U=h||70;(0,S.useEffect)(()=>{L(A.formatUnits(l.amount,(null==P?void 0:P.decimals)||18))},[l]);let q=null==I?void 0:null===(o=I.properties)||void 0===o?void 0:null===(t=o.Rarity)||void 0===t?void 0:t.value,G="";m&&(G=B?n().activeSelection:n().commonItemNew);let Z=(0,S.useRef)();return P&&l.amount?(0,i.jsx)(r.k,{w:U,h:U,className:G,cursor:"pointer",overflow:"visible",pointerEvents:"visible",children:(0,i.jsx)(a.u,{className:n().rewardsTooltip,label:(0,i.jsxs)(s.x,{style:{color:"white"},children:[P.name," : $",D]}),placement:"auto",backgroundColor:"#1f2326",borderRadius:"7px",borderWidth:"1px",borderColor:"Legendary"==q?"#ff8000":"Epic"==q?"#fd57dc":"Rare"==q?"#0b8aff":"#fff3",boxShadow:"Legendary"==q?"0px 0px 10px 0px #ff8000, inset 0px 0px 5px 0px #ff8000":"Epic"==q?"0px 0px 10px 0px #fd57dc, inset 0px 0px 5px 0px #fd57dc "
1:"Rare"==q?"0px 0px 10px 0px #0b8aff, inset 0px 0px 5px 0px #0b8aff":"0px 0px 10px 0px #fff3, inset 0px 0px 5px 0px ",p:0,shouldWrapChildren:M,children:(0,i.jsxs)(d.J,{initialFocusRef:Z,placement:"auto",closeOnBlur:!1,closeOnEsc:!0,onOpen:()=>R(!1),onClose:()=>R(!0),isOpen:N,children:[(0,i.jsx)(c.x,{children:(0,i.jsxs)(u.x,{pos:"relative",onClick:()=>{y||W||(v?E(!0):(j&&k(j({erc20:l,amount:D,isEscrowed:g})),L(D)))},children:[(0,i.jsx)(p.E,{src:P.image,width:U-5,height:U-5}),m?(0,i.jsx)(x.C,{position:"absolute",bgColor:"transparent",color:"Pink"==P.name?"black":"white",bottom:0,right:0,children:A.formatUnits(l.amount,P.decimals)}):(0,i.jsx)(x.C,{colorScheme:"blue",color:"#b00b00",bgColor:"white",rounded:"md",position:"absolute",top:0,right:0,children:A.formatUnits(l.amount,P.decimals)}),B>0&&(0,i.jsxs)(x.C,{colorScheme:"green",color:"#b00b00",bgColor:"white",rounded:"md",position:"absolute",top:0,right:0,textAlign:"center",children:["Select ",A.formatUnits(B,P.decimals)]})]})}),(0,i.jsx)(z,{erc20:l,invertSelect:f,amount:D,setAmount:L,setActivated:E,metadata:I,isEscrowed:g,ref:Z,onSelect:j,decimals:P.decimals})]})},l.id+"-tooltip1")}):null})},40916:function(e,t,o){"use strict";var i=o(85893),l=o(90944),n=o.n(l),r=o(88329),a=o(44988),s=o(26972),d=o(90092),c=o(68029),u=o(933),p=o(37945),x=o(74032),h=o(49381),v=o(73898),m=o(43803),f=o(15715),g=o(73636),w=o(82206),b=o(24858),j=o(67294),C=o(47854),y=o(87461),S=o(75316),k=o(45007),I=o(74904),_=o(20837),N=o(35553),E=o(2593),F=o(15379),M=o(12912);let A=null===_.Z||void 0===_.Z?void 0:_.Z.src,R="GLMR",T=(0,h.G)((e,t)=>{let o=(0,k.I0)(),{ether:l,invertSelect:r,amount:a,setAmount:s,setActivated:c,metadata:u,isEscrowed:p,onSelect:x}=e,h="#E5C687";return(0,i.jsxs)(v.y,{color:"#FAC70C",bg:"transparent",w:"167px",h:"79px",onMouseMoveCapture:e=>{e.stopPropagation()},draggable:!1,zIndex:1e3,pos:"absolute",cursor:"auto",bgImage:"url(/assets/newmodal/AmountSelectorBG.svg)",bgRepeat:"no-repeat",bgSize:"167px 79px",border:"none",_focus:{outline:"none"},children:[(0,i.jsx)(m.b,{w:"100%",px:"2px",children:(0,i.jsxs)(f.M,{pos:"relative",w:"100%",h:"30px",userSelect:"none",draggable:!1,flexDir:"column",children:[(0,i.jsx)(d.x,{fontFamily:"Grenze",fontSize:"20px",fontWeight:"regular",lineHeight:"30px",letterSpacing:"0.02em",textAlign:"center",color:"#FAC70C",children:a}),(0,i.jsxs)(g.U,{justifyContent:"center",onClick:e=>{e.stopPropagation()},w:"100%",alignItems:"center",justifyItems:"center",alignContent:"center",align:"center",spacing:1,children:[(0,i.jsx)(y.Y,{as:I.P1Z,boxSize:"19px",color:"white.500",_hover:{color:h},onClick:e=>{a&&N.parseEther(a)>E.O$.from(1e15)?s(N.formatEther(N.parseEther(a).toBigInt()-BigInt(1e15))):s("0"),e.stopPropagation()},cursor:"pointer"}),(0,i.jsx)(w.I,{px:0,w:"90%",h:"8px",cursor:"all-scroll",borderWidth:"0px",focusBorderColor:"none",borderColor:"white",bgColor:"#38332E",placeholder:null==a?void 0:a.toString(),color:"white",onChange:e=>{var t;(t=e.currentTarget.value)?s(t):s("0")},maxLength:10,type:"range",min:0,max:Number(N.formatEther(l)),step:.1,rounded:"10px",value:Number(a),className:n().newmarket,ref:t}),(0,i.jsx)(S.L,{as:I.zUF,boxSize:"19px",color:"white.500",_hover:{color:h},onClick:e=>{a&&N.parseEther(a).toBigInt()+BigInt(1e15)<=l?s(N.formatEther(N.parseEther(a).toBigInt()+BigInt(1e15))):s(N.formatEther(l)),e.stopPropagation()},cursor:"pointer"})]})]})}),(0,i.jsx)(b.D,{border:"0",display:"flex",alignItems:"center",justifyContent:"space-between",pb:4,children:(0,i.jsxs)(g.U,{w:"100%",justifyContent:"center",children:[(0,i.jsx)(F.Z,{text:"Select ".concat(a," $").concat(R),placement:"left",children:(0,i.jsx)(f.M,{width:"18px",height:"16.5px",filter:"drop-shadow(2px 2px 0 black)",cursor:"pointer",onClick:e=>{c(!1),x&&a&&N.parseEther(a).toBigInt()>BigInt(0)&&o(x({ether:l,amount:a?N.parseEther(a):0,isEscrowed:p})),r&&(o((0,C.Ku)()),l===BigInt(0)&&o((0,C.Ns)({ether:l,isEscrowed:p}))),c(!1),e.stopPropagation()},children:(0,i.jsx)(M.yr,{fill:"#FAC70C"})})}),(0,i.jsx)(F.Z,{text:"Cancel",placement:"right",children:(0,i.jsx)(f.M,{width:"18px",height:"16.5px",filter:"drop-shadow(2px 2px 0 black)",cursor:"pointer",onClick:e=>{s(N.formatEther(l)),c(!1),e.stopPropagation()},children:(0,i.jsx)(M.Xk,{fill:"#FAC70C"})})})]})})]})});t.Z=j.memo(e=>{var t,o;let{ether:l,size:h,multiSelect:v,newStyle:m,invertSelect:f,isEscrowed:g,disableClick:w,refreshTick:b,onSelect:C,onDrop:y,disabled:S}
1=e,I=(0,k.I0)(),[_,E]=(0,j.useState)(),[F,M]=(0,j.useState)(!1),[z,D]=(0,j.useState)(!0),[L,B]=(0,j.useState)(),[H,W]=(0,j.useState)(""),O=(0,k.v9)(e=>e.inventoryReducer.itemInHand),P=(0,k.v9)(e=>e.marketplaceReducer.removeFromEscrow);(0,j.useEffect)(()=>{l>0&&P.ether?W(N.formatEther(P.ether)):W("")},[P]);let U=h||70;(0,j.useEffect)(()=>{B(N.formatEther(l))},[l]);let q=null==_?void 0:null===(o=_.properties)||void 0===o?void 0:null===(t=o.Rarity)||void 0===t?void 0:t.value,G="";m&&(G=H?n().activeSelection:n().commonItemNew);let Z=(0,j.useRef)();return l>0?(0,i.jsx)(r.k,{w:U,h:U,className:G,cursor:"pointer",overflow:"visible",pointerEvents:"visible",children:(0,i.jsxs)(a.J,{initialFocusRef:Z,placement:"auto",closeOnBlur:!1,closeOnEsc:!0,onOpen:()=>D(!1),onClose:()=>D(!0),isOpen:F,children:[(0,i.jsx)(s.u,{className:n().rewardsTooltip,label:(0,i.jsxs)(d.x,{style:{color:"white"},children:[R,": $",L]}),placement:"auto",backgroundColor:"#1f2326",borderRadius:"7px",borderWidth:"1px",borderColor:"Legendary"==q?"#ff8000":"Epic"==q?"#fd57dc":"Rare"==q?"#0b8aff":"#fff3",boxShadow:"Legendary"==q?"0px 0px 10px 0px #ff8000, inset 0px 0px 5px 0px #ff8000":"Epic"==q?"0px 0px 10px 0px #fd57dc, inset 0px 0px 5px 0px #fd57dc ":"Rare"==q?"0px 0px 10px 0px #0b8aff, inset 0px 0px 5px 0px #0b8aff":"0px 0px 10px 0px #fff3, inset 0px 0px 5px 0px ",p:0,shouldWrapChildren:z,children:(0,i.jsx)(c.x,{display:"inline-block",h:"full",children:(0,i.jsx)(u.x,{children:(0,i.jsxs)(c.x,{h:"full",pos:"relative",onClick:()=>{S||O||(v?M(!0):(C&&I(C({ether:l,amount:L,isEscrowed:g})),B(L)))},children:[(0,i.jsx)(p.E,{src:A,width:U,height:U}),m?(0,i.jsx)(x.C,{position:"absolute",bgColor:"transparent",color:"white",bottom:0,right:0,children:N.formatEther(l)}):(0,i.jsx)(x.C,{colorScheme:"blue",color:"#b00b00",bgColor:"white",rounded:"md",position:"absolute",top:0,right:0,children:N.formatEther(l)}),H&&(0,i.jsxs)(x.C,{colorScheme:"green",color:"#b00b00",bgColor:"white",rounded:"md",position:"absolute",top:0,right:0,textAlign:"center",children:["Select ",H]})]})})})},"escrow-ether-tooltip1"),(0,i.jsx)(T,{ether:l,invertSelect:f,amount:L,setAmount:B,setActivated:M,metadata:_,isEscrowed:g,ref:Z,onSelect:C})]})}):null})},96116:function(e,t,o){"use strict";var i=o(44610),l=o(85893),n=o(38488),r=o(90092),a=o(33190);t.Z=e=>{let{children:t,text:o,color:s,hoverColor:d,style:c,disabled:u,onClick:p,ref:x,loading:h,fontSize:v,type:m}=e,f={yellow:"#FAC70C",red:"#AF1817"},g=(0,i._)({},c),{playSFX:w}=(0,a.Q)();return(0,l.jsx)(n.z,{ref:x,h:"23px",border:"2px",borderRadius:"3.75px",colorScheme:u?"grey":s||f.yellow,borderColor:u?"grey":s||f.yellow,color:u?"grey":s||f.yellow,transition:"all .2s linear",boxSizing:"content-box",p:0,background:"rgba(0, 0, 0, 0.01)",boxShadow:"0px 0px 7.5px 3.75px black inset",paddingBottom:"2px",style:g,isDisabled:u,isLoading:h,loadingText:"Loading",onMouseEnter:()=>{h||u||w("sound.ui.hover")},onClick:()=>{h||(w("sound.ui.interact"),null==p||p())},cursor:u?"not-allowed":"pointer",type:m||"button",_hover:{transition:"all .2s linear",borderColor:u?"grey":h?"#FAC70C":d||f.red,color:u?"grey":h?"#FAC70C":d||f.red},_focus:{outline:"none"},_focusVisible:{outline:"none"},_loading:{fontSize:"22.50px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"22.50px",letterSpacing:"0.02em",padding:"4.5px 9px 4.5px 9px"},children:t||(0,l.jsx)(r.x,{fontSize:v||"22.50px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"22.50px",letterSpacing:.45,px:"9px",py:"4.5px",children:o})})}},19807:function(e,t,o){"use strict";var i=o(85893),l=o(26972),n=o(68029),r=o(88329),a=o(90092),s=o(86384),d=o(67294),c=o(71073),u=o(77286);t.Z=e=>{let{index:t,isBig:o,isMedium:p,metadata:x,label:h}=e,[v,m]=(0,d.useState)("common"),[f,g]=(0,d.useState)((0,c.kg)(v));return(0,d.useEffect)(()=>{var e,t,o,i;m(null!==(i=null==x?void 0:null===(o=x.properties)||void 0===o?void 0:null===(t=o.Rarity)||void 0===t?void 0:null===(e=t.value)||void 0===e?void 0:e.toLowerCase())&&void 0!==i?i:"common")},[x]),(0,i.jsx)(l.u,{label:h||(0,u.Z)({metadata:x,image:(0,s.WR)((null==x?void 0:x.inventoryUri)||(null==x?void 0:x.thumbnailUri)||(null==x?void 0:x.mediaUri)),untradeable:!0,amount:null==x?void 0:x.amount}),placement:"auto",bgColor:"transparent",p:0,children:(0,i.jsx)(n.x,{w:o?"52px":p?"40px":"32.5px",h:o?"52px":p?"40px":"32.5px",borderRadius:"50%",backgroundImage:"url(".concat((0,s.WR)((null==x?void 0:x.inventoryUri)||(null==x?void 0:x.thumbnailUri)||(null==x?void 0:x.mediaUri)),")"),backgroundRepeat:"no-repeat",backgroundSize:"".concat(o?"52px":p?"40px":"32px"," auto"),backgroundPosition:"center",backgroundColor:"#0B0B0A",border:"".concat(o?"2px":"1px"," solid ").concat((0,c.kg)(v)),filter:"drop-shadow(".concat(o?"4px 4px":"2px 2px"," 0 black)"),boxShadow:o?"0px 0px 10px 2px ".concat((0,c.kg)(v)," inset"):"none",_hover:{border:"".concat(o?"2px":"1px"," solid #FAC70C"),boxShadow:"0px 0px ".concat(o?"10px 2px":"5px 2.5px"," #FAC70C inset")},onMouseEnter:()=>g("#FAC70C"),onMouseLeave:()=>g((0,c.kg)(v)),children:(null==x?void 0:x.amount)&&(0,i.jsx)(n.x,{pos:"absolute",top:o?"-2px":void 0,bottom:o?void 0:"-2px",left:"-2px",w:o?"19px":"15.75px",h:o?"19px":"15.75px",border:"".concat(o?"1.5px":"1.13px"," solid ").concat(f),borderRadius:"50%",boxSizing:"content-box",bgColor:"black",children:(0,i.jsx)(r.k,{h:"100%",alignItems:"flex-end",justifyContent:"center",children:(0,i.jsx)(a.x,{color:"white",fontSize:o?"16px":"12px",fontFamily:"Grenze Gotisch",fontWeight:"light",lineHeight:x.amount>99?o?"10px":"7.5px":void 0,children:x.amount>99?"99\n+":x.amount})})})},(null==x?void 0:x.id)+t)},(null==x?void 0:x.id)+t+"-tooltip1")}},77369:function(e,t,o){"use strict";o.d(t,{Z:function(){return I}});var i=o(85893),l=o(68029),n=o(48646),r=o(15715),a=o(73636),s=o(90092),d=o(55436),c=o(8186),u=o(88329),p=o(74032),x=o(37945),h=o(67294),v=o(12912),m=o(15379),f=o(30381),g=o.n(f),w=o(96116),b=o(70339),j=o(33190),C=o(45007),y=o(75548),S=o(25343),k=o(90084);function I(e){var t,o,f,I,_,N,E,F,M,A,R,T,z,D,L,B,H,W,O,P,U,q,G,Z,V,Y,$,K,J;let{isOpen:X,tabs:Q,selectedTabIndex:ee,filters:et,children:eo,onClose:ei,onBack:el,onAdd:en,setSelectedTabIndex:er,aspectRatio:ea,bgImage:es,bgOverlay:ed,width:ec,height:eu,svgs:ep,onBtnClick:ex,btnText:eh,btnDisabled:ev,btnDisabledText:em,btnLoading:ef,bigTitle:eg,customBtn:ew,bigIconSrc:eb,bigIconText:ej,onClick:eC,zIndex:ey,scrollToTop:eS,overflow:ek,currentBalance:eI,noBottomBo
1x:e_,paddingBottom:eN,maxWidth2xl:eE}=e,eF=(0,C.I0)(),eM=(0,h.useRef)(null),[eA,eR]=(0,h.useState)(b.D.brown),[eT,ez]=(0,h.useState)(b.D.brown),[eD,eL]=(0,h.useState)(b.D.yellow),[eB,eH]=(0,h.useState)(b.D.yellow),[eW,eO]=(0,h.useState)(null),eP=(0,h.useRef)(null),{playSFX:eU}=(0,j.Q)(),eq=(0,C.v9)(e=>e.web3Reducer.metatransactions);(0,h.useEffect)(()=>{if(eS){var e;null===(e=eM.current)||void 0===e||e.scrollTo(0,0)}},[eS]);let eG=(0,h.useCallback)(e=>{e?eF((0,y.$_)({missions:!0,expeditions:!0,marketplace:!0,equipment:!0})):eF((0,y.$_)({missions:!1,expeditions:!1,marketplace:!1,equipment:!1}))},[eF]);return(0,i.jsx)(l.x,{zIndex:ey||402,w:"100vw",h:"100vh",backgroundColor:"#0004",position:"fixed",overflow:"hidden",onClick:eC,children:(0,i.jsx)(n.p,{in:X,children:(0,i.jsxs)(r.M,{h:"100vh",w:"100vw",transform:{base:"scale(".concat(1,")"),"2xl":eE?"scale(1)":"scale(".concat(1.1,")")},children:[(0,i.jsxs)(l.x,{ref:eP,pos:"relative",h:eu||"70vh",w:{base:ec||"auto","2xl":eE?"calc(min(2000px, ".concat(eE,"))"):ec||"auto"},style:{aspectRatio:ea||(ec||eu?"auto":"9/6"),backgroundImage:"url(".concat(ed?null==ed?void 0:ed.src:"/assets/newmodal/OverlayGrainTextureMarket.png","), url(").concat(es?null==es?void 0:es.src:"/assets/newmodal/BackgroundLargeMarket.svg",")")},minW:ec?"auto":"calc(min(2000px, ".concat(eE,"))"),minH:eu?"auto":"600px",bgSize:"cover",bgPos:"center",bgRepeat:"no-repeat",filter:"drop-shadow(6px 6px 0 black)",zIndex:3,color:"gray",textAlign:"center",children:[eI&&(0,i.jsxs)(a.U,{pos:"absolute",bottom:"5px",right:"110px",alignItems:"center",spacing:0,justifyContent:"center",borderRadius:"5px",p:"5px",children:[(0,i.jsx)(s.x,{fontSize:"17px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"17px",letterSpacing:0,color:b.D.beige,mr:"6px",children:"Your Balance"}),(0,i.jsx)(s.x,{fontSize:"16px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"16px",letterSpacing:0,color:b.D.yellow,mr:"2px",children:eI}),eq.marketplace?(0,i.jsx)(k._OR,{fill:b.D.yellow,width:"8px",height:"8px"}):(0,i.jsx)(v.WI,{fill:b.D.yellow,width:"14px",height:"11px"}),(0,i.jsx)(d.r,{px:"10px",colorScheme:"whiteAlpha",variant:"secondary",size:"sm",checked:eq.marketplace,onChange:e=>eG(e.target.checked)}),(0,i.jsxs)(s.x,{fontSize:"16px",fontFamily:"Grenze",fontWeight:"medium",lineHeight:"16px",letterSpacing:0,color:eq.marketplace?b.D.yellow:b.D.grey,onClick:()=>eF((0,S.k0)(!0)),children:["(Easypay"," ",eq.marketplace?"Enabled)":"Disabled)"]})]}),null==Q?void 0:null===(t=Q[0])||void 0===t?void 0:t.layover,(0,i.jsxs)(c.g,{w:"100%",h:"100%",spacing:0,px:eu||ec?"32px":"40px",pt:"24px",pb:eN||(ex||ew?"16px":"37px"),gap:"9px",children:[eg&&(0,i.jsx)(u.k,{h:"61px",w:"98%",border:"3px solid ".concat(b.D.brown),borderRadius:5,boxShadow:"0px 0px 10px 6px black inset",background:"rgba(0, 0, 0, 0.01)",className:g().newmarket,overflowY:"hidden",p:"13px",alignItems:"center",justifyContent:"center",children:(0,i.jsx)(s.x,{fontFamily:"Gnellen",fontSize:"55px",letterSpacing:"0.02em",color:"#E5C687",mt:"10px",children:eg})}),et&&(0,i.jsx)(l.x,{w:"98%",children:et}),e_?(0,i.jsx)(i.Fragment,{children:null==ee||ee>=0&&!(null==Q?void 0:null===(o=Q[ee])||void 0===o?void 0:o.content)||ee>=0&&(null==Q?void 0:null===(f=Q[ee])||void 0===f?void 0:f.disabled)?eo:ee>=0?null==Q?void 0:null===(I=Q[ee])||void 0===I?void 0:I.content:""}):(0,i.jsx)(l.x,{ref:eM,w:"98%",h:ek?"94%":"95%",border:"3px solid ".concat(b.D.brown),borderRadius:5,boxShadow:"0px 0px 10px 6px black inset",background:"rgba(0, 0, 0, 0.01)",className:g().newmarket,overflowY:null!=ek?ek:"auto",overflowX:null!=ek?ek:"hidden",children:null==ee||ee>=0&&!(null==Q?void 0:null===(_=Q[ee])||void 0===_?void 0:_.content)||ee>=0&&(null==Q?void 0:null===(N=Q[ee])||void 0===N?void 0:N.disabled)?eo:ee>=0?null==Q?void 0:null===(E=Q[ee])||void 0===E?void 0:E.content:""}),ew||ex&&(0,i.jsx)(m.Z,{text:null!=em?em:"",disabled:!ev||!em,children:(0,i.jsx)(l.x,{children:(0,i.jsx)(w.Z,{onClick:ex,style:{height:"auto","border-radius":"5px",margin:"3px"},disabled:ev,loading:ef,children:(0,i.jsx)(s.x,{fontSize:"30px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"30px",letterSpacing:"0.02em",px:"9px",children:eh})})})})]})]}),(0,i.jsx)(l.x,{pos:"absolute",top:(null===(F=eP.current)||void 0===F?void 0:F.clientHeight)?"calc(50vh - ".concat((null!==(U=null===(M=eP.current)||void 0===M?void 0:M.clientHeight)&&void 0!==U?U:600)/2+"px"," - 24px)"):eu?"calc(50vh - ".concat(+eu.replace("px","")/2,"px - 24px)"):"calc(50vh - 300px - 24px)",right:(null===(A=eP.current)||void 0===A?void 0:A.clientWidth)?"calc(50vw - ".concat((null!==(q=null===(R=eP.current)||void 0===R?void 0:R.clientWidth)&&void 0!==q?q:900)/2+"px"," - 19px)"):ec?"calc(50vw - ".concat(+ec.replace("px","")/2,"px - 19px)"):"calc(50vw - 450px - 19px)",w:"50px",h:"50px",_hover:{cursor:"pointer"},onMouseEnter:()=>{eR(b.D.red),eU("sound.ui.hover")},onMouseLeave:()=>eR(b.D.brown),zIndex:4,filter:"drop-shadow(4px 4px 0 black)",onClick:()=>{eU("sound.ui.interact"),ei()},borderRadius:"full",bgImage:"url(/assets/newmodal/CircleBackgroun
1d.svg)",bgRepeat:"no-repeat",bgSize:"contain",bgPos:"center",children:(0,i.jsx)(r.M,{w:"100%",h:"100%",children:(0,i.jsx)(u.k,{w:"38px",h:"38px",border:"3px solid ".concat(eA),borderRadius:"50%",background:"rgba(0, 0, 0, 0.01)",boxShadow:"0px 0px 10px 2px black inset",justifyContent:"center",alignItems:"center",children:(0,i.jsx)(r.M,{w:"27.75px",h:"28px",children:(0,i.jsx)(v.VD,{fill:eA})})})})}),el&&(0,i.jsx)(m.Z,{text:"Back",placement:"right-start",children:(0,i.jsx)(l.x,{pos:"absolute",top:"calc(50vh - ".concat((null!==(G=null===(T=eP.current)||void 0===T?void 0:T.clientHeight)&&void 0!==G?G:600)/2+"px"," - 24px)"),left:"calc(50vw - ".concat((null!==(Z=null===(z=eP.current)||void 0===z?void 0:z.clientWidth)&&void 0!==Z?Z:900)/2+"px"," - 22px)"),w:"50px",h:"50px",_hover:{cursor:"pointer"},onMouseEnter:()=>ez(b.D.yellow),onMouseLeave:()=>ez(b.D.brown),zIndex:4,filter:"drop-shadow(4px 4px 0 black)",onClick:()=>{ez(b.D.brown),el()},borderRadius:"full",bgImage:"url(/assets/newmodal/CircleBackground.svg)",bgRepeat:"no-repeat",bgSize:"contain",bgPos:"center",children:(0,i.jsx)(r.M,{w:"100%",h:"100%",children:(0,i.jsx)(u.k,{w:"38px",h:"38px",border:"3px solid ".concat(eT),borderRadius:"50%",background:"rgba(0, 0, 0, 0.01)",boxShadow:"0px 0px 10px 2px black inset",justifyContent:"center",alignItems:"center",children:(0,i.jsx)(r.M,{w:"24px",h:"28px",mb:"2.5px",children:(0,i.jsx)(v.xC,{fill:eT})})})})})}),en&&(0,i.jsx)(m.Z,{text:"Create a New Trade",placement:"right-start",children:(0,i.jsx)(l.x,{pos:"absolute",bottom:"calc(50vh - ".concat((null!==(V=null===(D=eP.current)||void 0===D?void 0:D.clientHeight)&&void 0!==V?V:600)/2+"px"," - 26px)"),w:"60px",h:"60px",_hover:{cursor:"pointer"},onMouseEnter:()=>eH(b.D.red),onMouseLeave:()=>eH(b.D.yellow),zIndex:3,onClick:()=>en(),borderRadius:"full",bgImage:"url(/assets/newmodal/CircleBackground.svg)",bgRepeat:"no-repeat",bgSize:"contain",bgPos:"center",children:(0,i.jsx)(r.M,{w:"100%",h:"100%",children:(0,i.jsx)(u.k,{w:"42px",h:"42px",border:"3px solid ".concat(eB),borderRadius:"50%",background:"rgba(0, 0, 0, 0.01)",boxShadow:"0px 0px 10px 2px black inset",alignItems:"center",justifyContent:"center",children:(0,i.jsx)(r.M,{w:"21.6px",h:"21.6px",children:(0,i.jsx)(v.pO,{fill:eB})})})})})}),null==Q?void 0:Q.map((e,t)=>{var o,n,a,s,d;let c;return(0,i.jsx)(m.Z,{text:e.tooltip,placement:"left-start",children:(0,i.jsxs)(l.x,{pos:"absolute",w:"60px",h:"50px",top:"calc(50vh - ".concat((null!==(a=null===(o=eP.current)||void 0===o?void 0:o.clientHeight)&&void 0!==a?a:600)/2+"px"," + ").concat(60*(t+1)+27,"px)"),left:"calc(50vw - ".concat((null!==(s=null===(n=eP.current)||void 0===n?void 0:n.clientWidth)&&void 0!==s?s:900)/2+"px"," - 48px)"),onClick:()=>{e.disabled||(er&&er(t),eL(b.D.brown),e.onClick())},bgImage:"url(/assets/newmodal/TabBackground.svg)",bgRepeat:"no-repeat",bgSize:"cover",bgPos:"center",zIndex:2,_hover:{cursor:(null==e?void 0:e.disabled)?"not-allowed":"pointer"},onMouseEnter:()=>eO(t),onMouseLeave:()=>eO(null),children:[(0,i.jsx)(r.M,{w:"30px",h:"30px",pos:"relative",top:"50%",left:"43%",transform:"translate(-50%, -50%)",children:(0,h.cloneElement)(e.icon,{fill:(c=b.D.brown,eW===t&&(c=b.D.yellow),ee===t&&(c=b.D.yellow),(null==Q?void 0:null===(d=Q[t])||void 0===d?void 0:d.disabled)&&(c=b.D.brown),c)})}),e.showBadge&&(0,i.jsx)(p.C,{position:"absolute",top:"-5px",left:"-5px",boxSizing:"content-box",variant:"solid",style:{color:"white",backgroundColor:"black",borderWidth:"1.5px",borderColor:b.D.yellow,borderRadius:"100%"},children:(0,i.jsx)(r.M,{w:"100%",h:"100%",p:"1.5px",children:(0,i.jsx)(v.ve,{fill:b.D.yellow,width:"2.18",height:"9.82"})})})]},t)},t)}),(null==Q?void 0:Q.length)&&Q.length>0&&(0,i.jsx)(l.x,{pos:"absolute",top:"calc(50vh - ".concat((null!==(Y=null===(L=eP.current)||void 0===L?void 0:L.clientHeight)&&void 0!==Y?Y:600)/2+"px"," + ").concat(60*Q.length+72,"px)"),left:"calc(50vw - ".concat((null!==($=null===(B=eP.current)||void 0===B?void 0:B.clientWidth)&&void 0!==$?$:900)/2+"px"," - 38px)"),children:(0,i.jsx)(x.E,{src:"./assets/newmodal/ChiliHangingBlack.svg",width:"28px"})}),null==ep?void 0:ep.map((e,t)=>{var o,n,r,a,s,d,c,u,p,h,v,m;return(0,i.jsx)(l.x,{pos:"absolute",top:e.offset.top?(null===(o=eP.current)||void 0===o?void 0:o.clientHeight)?"calc(50vh - ".concat((null!==(p=null===(n=eP.current)||void 0===n?void 0:n.clientHeight)&&void 0!==p?p:600)/2+"px"," + ").concat(e.offset.top,")"):eu?"calc(50vh - ".concat(+eu.replace("px","")/2,"px + ").concat(e.offset.top,")"):"calc(50vh - 300px + "+e.offset.top+")":"auto",right:e.offset.right?(null===(r=eP.current)||void 0===r?void 0:r.clientWidth)?"calc(50vw - ".concat((null!==(h=null===(a=eP.current)||void 0===a?void 0:a.clientWidth)&&void 0!==h?h:900)/2+"px"," + ").concat(e.offset.right,")"):ec?"calc(50vw - ".concat(+ec.replace("px","")/2,"px + ").concat(e.offset.right,")"):"calc(50vw - 450px + "+e.offset.right+")":"auto",left:e.offset.left?(null===(s=eP.current)||void 0===s?void 0:s.clientWidth)?"calc(50vw - ".concat((null!==(v=null===(d=eP.current)||void 0===d?void 0:d.clientWidth)&&void 0!==v?v:900)/2+"px"," + ").concat(e.offset.left,")"):ec?"calc(50vw - ".concat(+ec.replace("px","")/2,"px + ").concat(e.offset.left,")"):"calc(50vw - 450px + "+e.offset.left+")":"auto",bottom:e.offset.bottom?(null===(c=eP.current)||void 0===c?void 0:c.clientHeight)?"calc(50vh - ".concat((null!==(m=null===(u=eP.current)||void 0===u?void 0:u.clientHeight)&&void 0!==m?m:600)/2+"px"," + ").concat(e.offset.bottom,")"):eu?"calc(50vh - ".concat(+eu.replace("px","")/2,"px + ").concat(e.offset.bottom,")"):"calc(50vh - 300px + "+e.offset.bottom+")":"auto",zIndex:2,children:(0,i.jsx)(x.E,{src:e.src,width:e.width})},t)}),eb&&(0,i.jsxs)(l.x,{pos:"absolute",zIndex:3,top:(null===(H=eP.current)||void 0===H?void 0:H.clientHeight)?"calc(50vh - ".concat((null!==(K=null===(W=eP.current)||void 0===W?void 0:W.clientHeight)&&void 0!==K?K:600)/2+"px"," + 75px)"):eu?"calc(50vh - ".concat(+eu.replace("px","")/2,"px + 75px)"):"calc(50vh - 300px + 75px)",left:(null===(O=eP.current)||void 0===O?void 0:O.clientWidth)?"calc(50vw - ".concat((null!==(J=null===(P=eP.current)||void 0===P?void 0:P.clientWidth)&&void 0!==J?J:900)/2+"px"," - 235px)"):ec?"calc(50vw - ".concat(+ec.replace("px","")/2,"px - 235px)"):"calc(50vw - 450px - 235px)",children:[(0,i.jsx)(l.x,{pos:"absolute",top:"-70px",left:"-25px",w:"275px",h:"131px",bgImage:"url(/assets/newmodal/bigImgBar.svg)",bgRepeat:"no-repeat",bgSize:"contain",bgPos:"center"}),(0,i.jsx)(l.x,{pos:"absolute",top:"180px",left:"10px",w:"182px",h:"177px",bgImage:"url(/assets/newmodal/bigImgBarOrn
1aments.svg)",bgRepeat:"no-repeat",bgSize:"contain",bgPos:"center"}),(0,i.jsx)(l.x,{pos:"absolute",top:"110px",left:"6px",w:"182px",h:"177px",bgImage:"url(/assets/newmodal/DialogueRectangle.svg)",bgRepeat:"no-repeat",bgSize:"contain",bgPos:"center",children:(0,i.jsx)(s.x,{w:"100%",textAlign:"center",color:"#E5C687",mt:"80px",fontFamily:"Grenze",fontWeight:"medium",fontSize:"24px",lineHeight:"30px",letterSpacing:"0.02em",children:ej})}),(0,i.jsx)(l.x,{bgImage:"url(/assets/newmodal/DialogueCircle.svg)",bgRepeat:"no-repeat",bgSize:"cover",bgPos:"center",w:"192px",h:"192px",filter:"drop-shadow(4px 4px 0 black)",children:(0,i.jsx)(r.M,{w:"100%",h:"100%",children:(0,i.jsx)(l.x,{bgImage:eb,bgSize:"contain",bgRepeat:"no-repeat",bgPos:"center",w:"170px",h:"170px"})})})]})]})})})}},42463:function(e,t,o){"use strict";var i=o(85893),l=o(44988),n=o(933),r=o(73898),a=o(43803),s=o(8186),d=o(90092),c=o(73636),u=o(15715),p=o(96116);t.Z=e=>{let{trigger:t,title:o,content:x,footer:h,isOpen:v,onClose:m,onYes:f,onNo:g}=e;return(0,i.jsxs)(l.J,{placement:"left-end",matchWidth:!0,isOpen:v,onClose:m,children:[(0,i.jsx)(n.x,{children:t}),(0,i.jsx)(r.y,{maxW:"221px",bg:"black",border:"none",alignItems:"center",_focus:{outline:"none"},children:(0,i.jsx)(a.b,{alignItems:"center",children:(0,i.jsxs)(s.g,{w:"191px",gap:"11px",spacing:0,alignItems:"center",children:[(0,i.jsx)(d.x,{color:"#FAC70C",fontSize:"20px",fontFamily:"Grenze",fontWeight:"400",lineHeight:"20px",letterSpacing:.4,children:o}),(0,i.jsx)(d.x,{color:"#E5C687",fontSize:"16px",fontFamily:"Grenze",fontWeight:"400",lineHeight:"18px",letterSpacing:.32,children:x}),(0,i.jsxs)(c.U,{children:[f&&(0,i.jsx)(p.Z,{style:{height:"15px",width:"33px",borderRadius:"2.5px"},onClick:()=>{f(),m()},children:(0,i.jsx)(d.x,{fontSize:"15px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"15px",letterSpacing:.3,px:"6px",py:"3px",children:"Yes"})}),(0,i.jsx)(p.Z,{style:{height:"15px",width:"33px",borderRadius:"2.5px"},onClick:()=>{g&&g(),m()},children:(0,i.jsx)(d.x,{fontSize:"15px",fontFamily:"Grenze",fontWeight:"500",lineHeight:"15px",letterSpacing:.3,px:"6px",py:"3px",children:"No"})})]}),(0,i.jsx)(u.M,{borderTop:"1px solid #E5C687",children:h})]})})})]})}},44474:function(e,t,o){"use strict";var i=o(26503),l=o(28397),n=o(85893),r=o(15715),a=o(48899),s=o(26972),d=o(38488),c=o(12553),u=o(63543),p=o(45007),x=o(47854),h=o(42069);t.Z=function(e){let t=(0,p.I0)(),o=(0,i._)({},(0,l._)(e)),{isRefreshingNfts:v}=(0,h.m)();return(0,n.jsx)(r.M,{children:v?(0,n.jsx)(a.$,{color:"white"}):(0,n.jsx)(s.u,{label:"Refresh",children:(0,n.jsx)(d.z,{w:o.w||"20px",h:o.h||"20px",zIndex:o.zIndex||499,background:"transparent",_hover:{opacity:"70%"},onClick:()=>{t((0,x.ZQ)()),t((0,x.cl)(!0))},children:(0,n.jsx)(c.J,{as:u.Em2,width:o.w||"20px",height:o.h||"20px",color:"#FFFFFF"})})})})}},19157:function(e,t,o){"use strict";var i=o(85893),l=o(15715),n=o(88329),r=o(8186),a=o(90092),s=o(37945),d=o(44474),c=o(26551),u=o.n(c);t.Z=()=>(0,i.jsx)(l.M,{height:"100%",minH:"100vh",children:(0,i.jsx)(n.k,{w:"100%",maxW:"1200px",flexDirection:"column",h:"100%",alignSelf:"center",children:(0,i.jsxs)(r.g,{spacing:4,align:"stretch",marginTop:"40px",children:[(0,i.jsx)(a.x,{className:u().cleanText,align:"center",children:"Down for maintenance. Please try again shortly."}),(0,i.jsxs)(l.M,{width:"100%",flexDir:"column",justifyContent:"space-between",h:"110px",children:[(0,i.jsx)(s.E,{src:"/assets/Doubloon.gif",width:"50px",height:"50px",alt:"Loading.."}),(0,i.jsx)(d.Z,{h:"30px",w:"30px"})]})]})})})},15678:function(e,t,o){"use strict";var i=o(85893),l=o(68029),n=o(26551),r=o.n(n);t.Z=()=>(0,i.jsx)(l.x,{position:"absolute",bottom:0,right:0,zIndex:1e3,justifySelf:"flex-end",paddingBottom:"5px",paddingRight:"5px",className:r().versionText,children:(0,i.jsx)("h4",{children:"Version 1.3"})})},51712:function(e,t,o){"use strict";var i=o(85893),l=o(26551),n=o.n(l),r=o(8186),a=o(74703),s=o(6007),d=o(57167),c=o(43416);t.Z=(e,t,o)=>e?(0,i.jsxs)(r.g,{className:n().rewardsTooltip,w:"100%",alignItems:"flex-start",children:[(0,i.jsx)("h1",{children:null==t?void 0:t.name}),(0,i.jsxs)("h2",{children:[" ",null==t?void 0:t.description]}),(null==t?void 0:t.properties)&&(0,i.jsx)(a.i,{children:(0,i.jsx)(s.p,{children:Object.keys(null==t?void 0:t.properties).map((e,o)=>{var l;return"Rarity"==e?(0,i.jsxs)(d.Tr,{children:[(0,i.jsxs)(c.Td,{children:[(0,i.jsx)("h3",{children:"".concat(e,": ")}),"\xa0"," "]}),(0,i.jsx)(c.Td,{children:(0,i.jsx)("h3",{style:{color:"#0b8aff"},children:null==t?void 0:null===(l=t.properties)||void 0===l?void 0:l.Rarity.value})})]},e):(0,i.jsxs)(d.Tr,{children:[(0,i.jsx)(c.Td,{margin:0,padding:0,textDecoration:"underline",width:"100px",children:"".concat(e,":")}),(0,i.jsx)(c.Td,{margin:0,padding:0,children:(null==t?void 0:t.properties)&&(null==t?void 0:t.properties[e].value)})]},e)})})}),(0,i.jsx)("h3",{children:"ID:  ".concat(e)}),!o&&(0,i.jsx)("h3",{children:"Click to view on Singular"})]}):(0,i.jsx)("h3",{})},59200:function(e,t,o){"use strict";var i=o(37340),l=o(85893),n=o(26551),r=o.n(n),a=o(67294),s=o(15715),d=o(92041),c=o(86384),u=o(54335);function p(){let e=(0,i._)(["\n  position: absolute;\n  pointer-events: none;\n  width: 80.1px;\n  height: 80.1px;\n  z-index: 3000;\n  box-shadow: none;\n"]);return p=function(){return e},e}let x=(0,a.memo)(e=>{let{src:t}=e;return(0,l.jsx)(d.yZ,{src:t,width:80,height:80,rounded:"10px"})}),h=(0,a.memo)((0,u.ZP)(s.M)(p()));t.Z=(0,a.memo)(e=>{var t,o,i,n;let{itemInHand:s}=e,d=(0,a.useRef)({x:0,y:0}),u=(0,a.useRef)(null),[p,v]=(0,a.useState)(""),m=(0,a.useMemo)(()=>{var e,t,o,i;switch(null==s?void 0:null===(i=s.nftAsset)||void 0===i?void 0:null===(o=i.retrievedMetadata)||void 0===o?void 0:null===(t=o.properties)||void 0===t?void 0:null===(e=t.Rarity)||void 0===e?void 0:e.value){case"Rare":return r().rareItem;case"Epic":return r().epicItem;case"Legendary":return r().legendaryItem;default:return r().commonItem}},[null==s?void 0:null===(n=s.nftAsset)||void 0===n?void 0:null===(i=n.retrievedMetadata)||void 0===i?void 0:null===(o=i.properties)||void 0===o?void 0:null===(t=o.Rarity)||void 0===t?void 0:t.value]);return((0,a.useEffect)(()=>{let e;let t=()=>{u.current&&(u.current.style.transform="translate(".concat(d.current.x-40.001,"px, ").concat(d.current.y-40.001,"px)")),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[]),(0,a.useEffect)(()=>{let e=e=>{d.current={x:e.clientX,y:e.clientY}};return window.addEventListener("mousemove",e),()=>window.removeEventListener("mousemove",e)},[]),(0,a.useEffect)(()=>{var e,t,o,i,l,n;let r=(null==s?void 0:null===(e=s.nftAsset)||void 0===e?void 0:e.retrievedMetadata)||(null==s?void 0:null===(t=s.nft)||void 0===t?void 0:t.retrievedMetadata)||(null==s?void 0:null===(o=s.resource)||void 0===o?void 0:o.retrievedMetadata)||(null==s?void 0:null===(i=s.unclaimedNft)||void 0===i?void 0:i.retrievedMetadata)||(null==s?void 0:null===(l=s.unclaimedResource)||void 0===l?void 0:l.retrievedMetadata)||(null==s?void 0:null===(n=s.erc20)||void 0===n?void 0:n.retrievedMetadata)||(null==s?void 0:s.metadata);v((0,c.WR)((null==r?void 0:r.inventoryUri)||(null==r?void 0:r.thumbnailUri)||(null==r?void 0:r.mediaUri)||(null==r?void 0:r.image))||"")},[s]),s&&p)?(0,l.jsx)(h,{ref:u,className:m,children:(0,l.jsx)(x,{src:p})}):null},(e,t)=>{var o,i,l,n,r,a,s,d,c,u,p,x,h,v,m,f,g,w,b,j,C,y;return(null===(i=e.itemInHand)||void 0===i?void 0:null===(o=i.nft)||void 0===o?void 0:o.id)===(null===(n=t.itemInHand)||void 0===n?void 0:null===(l=n.nft)||void 0===l?void 0:l.id)&&(null===(s=e.itemInHand)||void 0===s?void 0:null===(a=s.nftAsset)||void 0===a?void 0:null===(r=a.nft)||void 0===r?void 0:r.id)===(null===(u=t.itemInHand)||void 0===u?void 0:null===(c=u.nftAsset)||void 0===c?void 0:null===(d=c.nft)||void 0===d?void 0:d.id)&&(null===(x=e.itemInHand)||void 0===x?void 0:null===(p=x.resource)||void 0===p?void 0:p.id)===(null===(v=t.itemInHand)||void 0===v?void 0:null===(h=v.resource)||void 0===h?void 0:h.id)&&(null===(f=e.itemInHand)||void 0===f?void 0:null===(m=f.unclaimedNft)||void 0===m?void 0:m.id)===(null===(w=t.itemInHand)||void 0===w?void 0:null===(g=w.unclaimedNft)||void 0===g?void 0:g.id)&&(null===(j=e.itemInHand)||void 0===j?void 0:null===(b=j.unclaimedResource)||void 0===b?void 0:b.id)===(null===(y=t.itemInHand)||void 0===y?void 0:null===(C=y.unclaimedResource)||void 0===C?void 0:C.id)})},35701:function(e,t,o){"use strict";var i=o(85893),l=o(26551),n=o.n(l),r=o(5490),a=o(89865),s=o(26840),d=o(57391),c=o(70010),u=o(68029),p=o(73636),x=o(38488);t.Z=function(e){let{isOpen:t,onClose:o,call:l,inProgress:h}=e;return(0,i.jsxs)(r.u_,{isOpen:t,onClose:o,isCentered:!0,children:[(0,i.jsx)(a.Z,{}),(0,i.jsxs)(s.h,{backgroundColor:"#000d",borderWidth:"1px",borderColor:"#fff6",children:[(0,i.jsx)(d.x,{color:"white",children:"Loot Contract Approval"}),(0,i.jsxs)(c.f,{className:n().modal,w:"100%",children:[(0,i.jsx)(u.x,{children:(0,i.jsxs)("h4",{children:["You are equipping an item that is not currently staked within Estra. This just means that the item is not nested within any of your Souls, including this one.",(0,i.jsx)("p",{})," ",(0,i.jsx)("br",{}),"You will need to approve the game contract to allow it to transfer this item to your Soul. After that you will be able to use it."]})}),(0,i.jsxs)(p.U,{mt:"30px",mb:"5px",w:"100%",spacing:"5",children:[(0,i.jsx)(x.z,{className:n().button,whiteSpace:"normal",variant:"outline",padding:"0.3rem 0.3rem",letterSpacing:"0.15rem",backgroundSize:"200%",backgroundImage:"linear-gradient(51deg,#960e05 50%,#b00b00 65%,#e63922 100%)",transition:"0.2s ease-in-out",transitionProperty:"background-position",color:"#fff",borderColor:"transparent",boxShadow:"-5px -5px 1px rgb(255 255 255 / 3%), 5px 5px 5px rgb(0 0 0 / 35%)",borderRadius:"7px",_hover:{backgroundColor:"transparent"},w:"150px",onClick:()=>{l(!0),o()},isLoading:h,children:"Approve"}),(0,i.jsx)(x.z,{className:n().button,whiteSpace:"normal",variant:"outline",padding:"0.3rem 0.3rem",letterSpacing:"0.15rem",backgroundSize:"200%",backgroundImage:"linear-gradient(51deg,#960e05 50%,#b00b00 65%,#e63922 100%)",transition:"0.2s ease-in-out",transitionProperty:"background-position",color:"#fff",borderColor:"transparent",boxShadow:"-5px -5px 1px rgb(255 255 255 / 3%), 5px 5px 5px rgb(0 0 0 / 35%)",borderRadius:"7px",_hover:{backgroundColor:"transparent"},w:"150px",onClick:()=>{l(!1),o()},isLoading:h,children:"Cancel"})]})]})]})]})}},19575:function(e,t,o){"use strict";var i=o(85893),l=o(98251),n=o.n(l),r=o(73636),a=o(88329),s=o(90092),d=o(64831
1),c=o(8186),u=o(67294);t.Z=(0,u.memo)(e=>{let{soulAttributes:t,soulNft:o}=e,l=e=>{var l;let c,u,{attribute:p}=e;if(t&&o&&(null===(l=o.retrievedMetadata)||void 0===l?void 0:l.properties)){let e=o.retrievedMetadata.properties[p];e&&(c=t[p],u=e.value)}return void 0!==c&&void 0!==u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.U,{w:"100%",h:"5%",justify:"space-between",pe:"4px",children:(0,i.jsxs)(a.k,{w:"100%",h:"100%",justify:"space-between",children:[(0,i.jsx)(a.k,{w:"45%",h:"100%",ml:0,className:n().traitStats,children:(0,i.jsx)(s.x,{color:"white",lineHeight:"15px",children:p})}),(0,i.jsxs)(a.k,{w:"55%",h:"100%",justify:"space-between",mr:0,children:[(0,i.jsx)(s.x,{className:n().traitStats,color:"white",lineHeight:"15px",textAlign:"right",mr:0,children:u}),(0,i.jsx)(s.x,{color:"white",lineHeight:"15px",children:0!==c?"+".concat(c):"0"}),(0,i.jsx)(s.x,{className:n().circledTraitStats,color:"white",children:c+u})]})]})}),(0,i.jsx)(d.i,{w:"100%",borderColor:"#FFD66C",borderTopWidth:"1px"})]}):null};return(0,i.jsxs)(c.g,{h:"100%",w:"100%",p:"10px",children:[(0,i.jsx)(a.k,{h:"12%",w:"20%",children:(0,i.jsx)(s.x,{as:"h3",color:"white",lineHeight:"15px",children:"Stats"})}),(0,i.jsx)(a.k,{h:"1%",w:"100%",children:(0,i.jsx)(d.i,{w:"100%",borderColor:"#FFD66C",borderTopWidth:"1px"})}),(0,i.jsx)(a.k,{h:"87%",w:"100%",overflow:"auto",className:n().details,children:(0,i.jsxs)(c.g,{w:"100%",children:[(0,i.jsx)(r.U,{w:"100%",h:"10%",justify:"space-between",children:(0,i.jsxs)(a.k,{w:"100%",h:"100%",justify:"space-between",children:[(0,i.jsx)(a.k,{w:"42%",h:"100%",ml:0}),(0,i.jsxs)(a.k,{w:"58%",h:"100%",justify:"space-between",className:n().details,children:[(0,i.jsx)(s.x,{color:"white",lineHeight:"15px",children:"Soul"}),(0,i.jsx)(s.x,{color:"white",lineHeight:"15px",children:"Items"}),(0,i.jsx)(s.x,{color:"white",lineHeight:"15px",children:"Total"})]})]})}),(0,i.jsx)(l,{attribute:"Strength"}),(0,i.jsx)(l,{attribute:"Dexterity"}),(0,i.jsx)(l,{attribute:"Intelligence"}),(0,i.jsx)(l,{attribute:"Wisdom"}),(0,i.jsx)(l,{attribute:"Fortitude"}),(0,i.jsx)(l,{attribute:"Luck"})]})})]})})},15277:function(e,t,o){"use strict";o.d(t,{F:function(){return i},R:function(){return l}});let i=()=>({Strength:0,Dexterity:0,Intelligence:0,Wisdom:0,Fortitude:0,Luck:0,Damage:0,Armor:0}),l=(e,t)=>
1{let o={Strength:0,Dexterity:0,Intelligence:0,Wisdom:0,Fortitude:0,Luck:0,Damage:0,Armor:0},i={Power:0,Balance:0,Speed:0,Fortitude:0};return(null==e||e.forEach(e=>{var l,n,r;(null===(l=e.retrievedMetadata)||void 0===l?void 0:l.properties)&&(t?Object.keys(null===(r=e.retrievedMetadata)||void 0===r?void 0:r.properties).forEach(t=>{if(t in i){var o,l;(null===(o=e.retrievedMetadata)||void 0===o?void 0:o.properties)&&(i[t]+=Number(null===(l=e.retrievedMetadata)||void 0===l?void 0:l.properties[t].value))}}):Object.keys(null===(n=e.retrievedMetadata)||void 0===n?void 0:n.properties).forEach(t=>{if(t in o){var i,l;(null===(i=e.retrievedMetadata)||void 0===i?void 0:i.properties)&&(o[t]+=Number(null===(l=e.retrievedMetadata)||void 0===l?void 0:l.properties[t].value))}}))}),t)?i:o}},76814:function(e,t,o){"use strict";o.d(t,{Ac:function(){return x},t6:function(){return p}});var i=o(2593),l=o(4794),n=o(71073),r=o(91485),a=o(58800),s=o(25343);async function d(e,t){let{equipContract:o,equipToken:i,equipAsset:n,slotPartId:r,parentAddress:a,parentToken:s,parentAsset:d}=e;console.log("verifyEquipTransaction",e);let c=(0,l.tC)(t),u=(0,l._7)(t),p=(0,l.pc)(t),x=(0,l.yk)(t),h=(0,l.EK)(t),v=(0,l.AG)(t),m=(0,l.FV)(t),f=(0,l.ph)(t),g=(0,l.b5)(t),w=o.toLowerCase()==h.address.toLowerCase()?h:o.toLowerCase()==x.address.toLowerCase()?x:o.toLowerCase()==v.address.toLowerCase()?v:o.toLowerCase()==m.address.toLowerCase()?m:o.toLowerCase()==f.address.toLowerCase()?f:null,b=a.toLowerCase()==c.address.toLowerCase()?c:a.toLowerCase()==p.address.toLowerCase()?p:a.toLowerCase()==u.address.toLowerCase()?u:a.toLowerCase()==g.address.toLowerCase()?g:null;if(!w)return console.log("Error: invalid child contract"),!1;if(!b)return console.log("Error: invalid parent contract"),!1;let j=await w.getAssetAndEquippableData(i,n),C=await b.getAssetAndEquippableData(s,d);return j[2]!=C[2]?(console.log("Error: mismatched catalog address"),!1):C[3].map(e=>Number(e)).includes(Number(j[1]))?!await b.isChildEquipped(s,o,i)||(console.log("Error: already equipped"),!1):(console.log("Error: mismatched part Ids"),!1)}async function c(e,t,o){let i=(await u(e,t[0].parentTokenId)).map(e=>({tokenId:e.tokenId,contractAddress:e.contractAddress})),n={tokenId:0,childIndex:0,assetId:0,slotPartId:0,childAssetId:0,parentIsStaked:!1},a={tokenId:0,to:(0,l.iF)("NestableSoul"),destinationId:0,childIndex:0,childAddress:(0,l.iF)("NestableSoul"),childId:0,isPending:!1,parentIsStaked:!1},s=[],c=[],p=[];var x="";return(await Promise.all(t.map(async e=>{if("equip"==e.action){x="equip";let t=i.findIndex(t=>t.tokenId==e.asset.nft.tokenId);if(s.push({tokenId:e.parentTokenId,childIndex:t,assetId:e.parentAssetId||0,slotPartId:e.asset.partId||0,childAssetId:e.asset.assetId||0}),c.push(n),p.push(a),!await d({equipContract:e.asset.nft.address,equipToken:e.asset.nft.tokenId,equipAsset:e.asset.assetId||0,slotPartId:e.asset.partId||0,parentAddress:e.nestableAddress||"",parentToken:e.parentTokenId,parentAsset:e.parentAssetId||0},o).catch(e=>(console.log("Error: mismatched catalog",e),!1)))return console.log("Error: mismatched catalog"),(0,r.C)({title:"Updating equipped items",description:"Equipment mismatch! Please refresh your browser and try again.",status:"error",duration:18e3,isClosable:!0,position:"top",variant:"top-accent"}),!1}else if("unequip_tx"==e.action){if(!e.playerAddress)throw Error("No player address");let t=i.findIndex(t=>t.tokenId==e.asset.nft.tokenId);c.push({tokenId:e.parentTokenId,childIndex:t,assetId:e.parentAssetId||0,slotPartId:e.asset.partId||0,childAssetId:e.asset.assetId||0}),p.push({tokenId:e.oldParentTokenId||0,to:e.playerAddress||"",destinationId:0,childIndex:t,childAddress:e.childAddress||"",childId:e.asset.nft.tokenId,isPending:!1,parentIsStaked:e.oldParentStaked||!1}),i.splice(t,1,i[i.length-1]),i.pop(),s.push(n)}else if("unequip"==e.action){let t=i.findIndex(t=>t.tokenId==e.asset.nft.tokenId);c.push({tokenId:e.parentTokenId,childIndex:t,assetId:e.parentAssetId||0,slotPartId:e.asset.partId||0,childAssetId:e.asset.assetId||0}),p.push(a),s.push(n)}else if("tx_equip"==e.action){let t=i.length;i.push({tokenId:e.asset.nft.tokenId,contractAddress:e.asset.nft.address}),c.push(n),p.push({tokenId:e.oldParentTokenId||0,to:e.nestableAddress||"",destinationId:e.parentTokenId||0,childIndex:e.childIndex||0,childAddress:e.asset.nft.address,childId:e.asset.nft.tokenId,isPending:e.asset.nft.pending||!1,parentIsStaked:e.oldParentStaked||!1});let l={tokenId:e.parentTokenId,childIndex:t,assetId:e.parentAssetId||0,slotPartId:e.asset.partId||0,childAssetId:e.asset.assetId||0};if(s.push(l),!await d({equipContract:e.asset.nft.address,equipToken:e.asset.nft.tokenId,equipAsset:e.asset.assetId||0,slotPartId:e.asset.partId||0,parentAddress:e.nestableAddress||"",parentToken:e.parentTokenId,parentAsset:e.parentAssetId||0},o).catch(e=>(console.log("Error: mismatched catalog",e),!1)))return console.log("Error: mismatched catalog"),(0,r.C)({title:"Updating equipped items",description:"Mismatched catalog! Please refresh your browser before trying again.",status:"error",duration:18e3,isClosable:!0,position:"top",variant:"top-accent"}),!1}else if("accept_equip"==e.action){let t=i.length;i.push({tokenId:e.asset.nft.tokenId,contractAddress:e.asset.nft.address}),c.push(n),p.push({tokenId:0,to:e.nestableAddress||"",destinationId:e.parentTokenId||0,childIndex:e.childIndex||0,childAddress:e.asset.nft.address,childId:e.asset.nft.tokenId,isPending:!0,parentIsStaked:e.oldParentStaked||!1}),s.push({tokenId:e.parentTokenId,childIndex:t,assetId:e.parentAssetId||0,slotPartId:e.asset.partId||0,childAssetId:e.asset.assetId||0})}else if("unequip_tx_equip"==e.action){var t,l;let o=i.length;i.push({tokenId:e.asset.nft.tokenId,contractAddress:e.asset.nft.address}),c.push({tokenId:e.oldParentTokenId||0,childIndex:e.childIndex||0,assetId:e.oldParentTokenId||0,slotPartId:(null===(t=e.oldAsset)||void 0===t?void 0:t.partId)||0,childAssetId:(null===(l=e.oldAsset)||void 0===l?void 0:l.assetId)||0}),p.push({tokenId:e.oldParentTokenId||0,to:e.nestableAddress||"",destinationId:e.parentTokenId||0,childIndex:e.childIndex||0,childAddress:e.asset.nft.address,childId:e.asset.nft.tokenId,isPending:!1,parentIsStaked:e.oldParentStaked||!1}),s.push({tokenId:e.parentTokenId,childIndex:o,assetId:e.parentAssetId||0,slotPartId:e.asset.partId||0,childAssetId:e.asset.assetId||0})}else throw Error("Action not supported")}))).includes(!1)?{singleAction:"",equipInputs:[],unequipInputs:[],transferInputs:[]}:{singleAction:x,equipInputs:s,unequipInputs:c,transferInputs:p}}async function u(e,t){return console.log("Getting children of "+t),await e.childrenOf(t).then(e=>e).catch(t=>((0,a.H)(t,e.interface),console.log(t),[]))}async function p(e,t,o,d,u,p){var x,h,v;let m;switch((0,r.C)({title:"Updating equipped items",description:"Opening Wallet..",status:"info",duration:25e3,isClosable:!0,position:"top",variant:"top-accent"},"equipToast"),e.toLowerCase()){case(0,l.iF)("NestableSoul").toLowerCase():m=(0,l.tC)(o);break;case(0,l.iF)("Citizens").toLowerCase():m=(0,l.b5)(o);break;default:return console.log("Unrecognized parent contract address:",e),0}let f=(0,l.kT)(o),{singleAction:g,unequipInputs:w,transferInputs:b,equipInputs:j}=await c(m,t,o);console.log("parentContractAddress",m.address),console.log(w),console.log(b),console.log(j),await (null==o?void 0:o.ready);let C=0;if(1==j.length&&"equip"==g){let e=await f.estimateGas.callEquip(m.address,j[0]).catch(e=>(console.log("estimateGas errored:",e),i.O$.from(1e6))),r=await (null==o?void 0:o.getFeeData()),c=e.mul(null!==(x=null==r?void 0:r.gasPrice)&&void 0!==x?x:i.O$.from(125));if(d.equipment){let i=!1;C=await (0,n.XD)(()=>o.getBlockNumber(),3).catch(e=>1);let l={address:m.address,equipInputs:j[0],fee:0,gasFee:c,gasEstimate:e,parentTokenId:j[0].tokenId,changes:[{action:"equip",asset:t[0].asset}]};for(u((0,s.Xp)("facetEquip",l,e=>((null==e?void 0:e.status)!=!0&&(console.log("equip",e,"failed"),C=0),i=!0,u((0,s.JK)()),null==e?void 0:e.status)));!i;)await (0,n._v)(100);return(0,n._v)(500),console.log("return blockNumber",C),1}await f.callEquip(m.address,j[0]).then(async e=>((0,l.SU)("equipToast","Updating equipped items","Waiting for confirmation..",1e4),C=(await e.wait()).blockNumber,e)).catch(e=>{let t=(0,a.H)(e,f.interface);return console.log(t),(0,l.Jc)("equipToast","Updating equipped itemsq","Error: "+t.error),C=0,null})}else if(1==w.length&&"unequip"==g){let e=await f.estimateGas.callUnEquip(m.address,w[0]).catch(e=>(console.log("estimateGas errored:",e),i.O$.from(1e6))),r=await (null==o?void 0:o.getFeeData()),c=e.mul(null!==(h=null==r?void 0:r.gasPrice)&&void 0!==h?h:i.O$.from(125));if(d.equipment){let i=!1;C=await (0,n.XD)(()=>o.getBlockNumber(),3).catch(e=>1);let l={address:m.address,unequipInputs:w[0],fee:0,gasFee:c,gasEstimate:e,parentTokenId:w[0].tokenId,changes:[{action:"unequip",asset:t[0].asset}]};for(u((0,s.Xp)("facetUnequip",l,e=>((null==e?void 0:e.status)!=!0&&(console.log("unequip",e,"failed"),C=0),u((0,s.JK)()),i=!0,null==e?void 0:e.status)));!i;)await (0,n._v)(100);return(0,n._v)(500),console.log("return blockNumber",C),1}await f.callUnEquip(m.address,w[0]).then(async e=>((0,l.SU)("equipToast","Updating equipped items","Waiting for confirmation..",1e4),C=(await e.wait()).blockNumber,e)).catch(e=>{let t=(0,a.H)(e,f.interface);return console.log(t),(0,l.Jc)("equipToast","Updating equipped itemsq","Error: "+t.error),C=0,null})}else if(j.length>0){let e=await f.estimateGas.multiEquip(m.address,w,b,j).catch(e=>(console.log("estimateGas errored:",e),i.O$.from(1e6))),r=await (null==o?void 0:o.getFeeData()),c=e.mul(null!==(v=null==r?void 0:r.gasPrice)&&void 0!==v?v:i.O$.from(125));if(d.equipment){let i=!1;C=await (0,n.XD)(()=>o.getBlockNumber(),3).catch(e=>1);let l={address:m.address,unequipInputs:w,transferInputs:b,equipInputs:j,fee:0,gasFee:c,gasEstimate:e,parentTokenId:w[0].tokenId,changes:null==t?void 0:t.map(e=>({action:e.action,asset:e.asset}))};for(u((0,s.Xp)("facetMultiEquip",l,e=>((null==e?void 0:e.status)!=!0&&(console.log("multiEquip",e,"failed"),C=0),u((0,s.JK)()),i=!0,null==e?void 0:e.status)));!i;)await (0,n._v)(100);return(0,n._v)(500),console.log("return blockNumber",C),1}await f.multiEquip(m.address,w,b,j).then(async e=>((0,l.SU)("equipToast","Updating equipped items","Waiting for confirmation..",1e4),C=(await e.wait()).blockNumber,e)).catch(e=>{let t;try{t=(0,a.H)(e,f.interface)}catch(e){try{t=(0,a.H)(e,(0,l.tC)(o).interface)}catch(e){console.log(t),t={msg:"Unknown error",error:"Unknown error"}}}return console.log(t),(0,l.Jc)("equipToast","Updating equipped items","Error: "+t.error),C=0,null})}return console.log("blockNumber ::",C),C>0?(0,r.C)({title:"Updating equipped items",description:"Confirmed!",status:"success",duration:18e3,isClosable:!0,position:"top",variant:"top-accent"},"equipToast"):(0,r.C)({title:"Updating equipped items",description:"Failed!",status:"error",duration:18e3,isClosable:!0,position:"top",variant:"top-accent"},"equipToast"),console.log("Return",C),C}async function x(e,t,o,n,s,d){var u,p,x;let h;switch((0,r.C)({title:"Updating equipped items",description:"",status:"info",duration:25e3,isClosable:!0,position:"top",variant:"top-accent"},"equipToast"),e){case(0,l.iF)("NestableBoard"):h=(0,l.pc)(o);break;case(0,l.iF)("BotanistWorkshop"):h=(0,l._7)(o);break;default:return!1}await (null==o?void 0:o.ready);let{singleAction:v,unequipInputs:m,transferInputs:f,equipInputs:g}=await c(h,t,o);console.log(m),console.log(f),console.log(g),console.log(v);let w=0;if(1==g.length&&"equip"==v){let e=await h.estimateGas.equip(g[0]).catch(e=>(console.log("estimateGas errored:",e),i.O$.from(1e6))),t=await (null==o?void 0:o.getFeeData());e.mul(null!==(u=null==t?void 0:t.gasPrice)&&void 0!==u?u:i.O$.from(125)),await h.equip(g[0]).then(async e=>{(0,l.SU)("equipToast","Updating equipped items","Waiting for confirmation..",1e4);let t=await e.wait();return w=t.blockNumber,t}).catch(e=>{let t=(0,a.H)(e,h.interface);return console.log(t),(0,l.Jc)("equipToast","Updating equipped items","Error: "+t.error),w=0,null})}else if(1==m.length&&"unequip"==v){let e=await h.estimateGas.unequip(m[0].tokenId,m[0].assetId,m[0].slotPartId).catch(e=>(console.log("estimateGas errored:",e),i.O$.from(1e6))),t=await (null==o?void 0:o.getFeeData());e.mul(null!==(p=null==t?void 0:t.gasPrice)&&void 0!==p?p:i.O$.from(125)),await h.unequip(m[0].tokenId,m[0].assetId,m[0].slotPartId).then(async e=>{(0,l.SU)("equipToast","Updating equipped items","Waiting for confirmation..",1e4);let t=await e.wait();return w=t.blockNumber,t}).catch(e=>{let t=(0,a.H)(e,h.interface);return console.log(t),(0,l.Jc)("equipToast","Updating equipped items","Error: "+(null==t?void 0:t.error)),w=0,null})}else if(g.length>0){console.log("multiEquip");let e=await h.estimateGas.multiEquip(m,f,g).catch(e=>(console.log("estimateGas errored:",e),i.O$.from(1e6))),t=await (null==o?void 0:o.getFeeData());e.mul(null!==(x=null==t?void 0:t.gasPrice)&&void 0!==x?x:i.O$.from(125)),await h.multiEquip(m,f,g).then(async e=>{(0,l.SU)("equipToast","Updating equipped items","Waiting for confirmation..",1e4);let t=await e.wait();return w=t.blockNumber,t}).catch(e=>{let t=(0,a.H)(e,h.interface);return console.log(t),(0,l.Jc)("equipToast","Updating equipped items","Error: "+(null==t?void 0:t.error)),w=0,null})}return w?(0,r.C)({title:"Updating equipped items",description:"Confirmed!",status:"success",duration:18e3,isClosable:!0,position:"top",variant:"top-accent"},"equipToast"):(0,r.C)({title:"Updating equipped items",description:"Failed!",status:"error",duration:18e3,isClosable:!0,position:"top",variant:"top-accent"},"equipToast"),w}o(60716),o(87529)}
1,4357:function(e,t,o){"use strict";o.d(t,{Pe:function(){return p},Rj:function(){return c},VR:function(){return h},YB:function(){return m},YS:function(){return s},Zq:function(){return x},_V:function(){return d},fT:function(){return v},mh:function(){return u},sC:function(){return f}});var i=o(44610),l=o(67462),n=o(86384),r=o(59555),a=o(47854);function s(e,t,o,i,l){let n=function(e,t,o){let i=[];return e&&(null==t||t.forEach(e=>{e.equipped&&e.equipped.forEach(e=>{var t;(null===(t=e.nft)||void 0===t?void 0:t.id)&&i.push(e.nft.id)})})),i}(e,t),r=e.filter(e=>{var t,l,r,a,s;return(null===(t=e.retrievedMetadata)||void 0===t?void 0:t.name)!="Fishingboard Item"&&!(null==n?void 0:n.includes(e.id))&&!(null==o?void 0:null===(l=o.nfts)||void 0===l?void 0:l.find(t=>t.contractAddress==e.address&&t.tokenId==e.tokenId))&&(null==i?void 0:null===(a=i.nftAsset)||void 0===a?void 0:null===(r=a.nft)||void 0===r?void 0:r.id)!=e.id&&(null==i?void 0:null===(s=i.nft)||void 0===s?void 0:s.id)!=e.id}),a=[];return r.forEach(async e=>{let t=e.activeAsset||e.assets[0];t&&a.push(t)}),a.sort((e,t)=>e.src&&t.src?e.src.localeCompare(t.src):1),l&&l(a),a}function d(e,t,o,i,l){let n=[];null==t||t.forEach(e=>{var t;null===(t=e.equipped)||void 0===t||t.forEach(e=>{e.nft&&n.push(e.nft.id)})});let r=e.filter(e=>{var t,l,r,a;return!(null==n?void 0:n.includes(e.id))&&!(null==o?void 0:null===(t=o.nfts)||void 0===t?void 0:t.find(t=>t.contractAddress==e.address&&t.tokenId==e.tokenId))&&(null==i?void 0:null===(r=i.nftAsset)||void 0===r?void 0:null===(l=r.nft)||void 0===l?void 0:l.id)!=e.id&&(null==i?void 0:null===(a=i.nft)||void 0===a?void 0:a.id)!=e.id}),a=[];return r.forEach(e=>{let t=e.activeAsset||e.assets[0];t&&a.push(t)}),a.sort((e,t)=>e.src&&t.src?e.src.localeCompare(t.src):1),l&&l(a),a}async function c(e,t,o,i){if(!(null==e?void 0:e.parts))return[];let l=e.parts.map(async e=>{if("slot"!==e.type)return e;let o=t.find(t=>(null==t?void 0:t.partId)===e.partId);if(o){var l;if(!o.retrievedMetadata&&o.metadataUri){let e=await (0,n.ip)(o.metadataUri,i);o.retrievedMetadata=e}e.src=null===(l=o.retrievedMetadata)||void 0===l?void 0:l.mediaUri,e.metadataUri=o.metadataUri}else e.src=void 0,e.metadataUri="","retrievedMetadata"in e&&(e.retrievedMetadata=void 0);return e}),r=[];return await Promise.allSettled(l).then(e=>e.forEach(e=>{"fulfilled"==e.status&&r.push(e.value)})),e.parts=r,r}async function u(e,t,o,i){var l,n;let a=[],s=(null==t?void 0:null===(l=t.children)||void 0===l?void 0:l.filter(e=>!(null==i?void 0:i.find(t=>(0,r.d)(e,t)))))||[];console.log("removedAssetsThisSoul",s),a.push(...s.map(e=>{var o,i,l,n,r,a,s,d,c,u,p,x,h;return(null===(o=t.equipped)||void 0===o?void 0:o.find(t=>{var o,i;return(null===(o=t.nft)||void 0===o?void 0:o.id)===(null===(i=e.nft)||void 0===i?void 0:i.id)}))?{asset:e,oldParentTokenId:null===(l=e.nft)||void 0===l?void 0:null===(i=l.parent)||void 0===i?void 0:i.tokenId,parentTokenId:t.tokenId,parentAssetId:null===(n=t.activeAsset)||void 0===n?void 0:n.assetId,childIndex:null===(r=e.nft)||void 0===r?void 0:r.childIndex,action:"unequip"}:{asset:e,oldParentTokenId:null===(s=e.nft)||void 0===s?void 0:null===(a=s.parent)||void 0===a?void 0:a.tokenId,parentTokenId:t.tokenId,parentAssetId:null===(d=t.activeAsset)||void 0===d?void 0:d.assetId,childIndex:null===(c=e.nft)||void 0===c?void 0:c.childIndex,action:"unequip_tx",playerAddress:t.owner.ownerAddress,oldParentStaked:(null===(p=e.nft)||void 0===p?void 0:null===(u=p.parent)||void 0===u?void 0:u.staked)||!0,childAddress:null===(h=e.nft)||void 0===h?void 0:null===(x=h.collection)||void 0===x?void 0:x.address}}));let d=0;null==t||null===(n=t.equipped)||void 0===n||n.forEach(e=>{var i,l,n,s,c,u,p,x,h,v,m,f,g,w,b,j,C,y,S,k,I,_,N;if((null===(l=e.nft)||void 0===l?void 0:null===(i=l.parent)||void 0===i?void 0:i.tokenId)&&(null===(s=e.nft)||void 0===s?void 0:null===(n=s.parent)||void 0===n?void 0:n.tokenId)!==t.tokenId&&(null==o?void 0:o.find(t=>{var o;return null===(o=t.children)||void 0===o?void 0:o.find(t=>{var o,i;return(null===(o=t.nft)||void 0===o?void 0:o.tokenId)===(null===(i=e.nft)||void 0===i?void 0:i.tokenId)})}))){let i=null==o?void 0:null===(h=o.find(t=>{var o;return t.tokenId===(null===(o=e.nft)||void 0===o?void 0:o.tokenId)}
1))||void 0===h?void 0:h.activeAsset;null==o||o.filter(e=>Number(e.owner.tokenId)==t.tokenId).map(e=>e.childIndex||0),a.push({asset:e,oldParentTokenId:null===(v=e.nft.parent)||void 0===v?void 0:v.tokenId,nestableAddress:t.address,parentTokenId:t.tokenId,parentAssetId:null===(m=t.activeAsset)||void 0===m?void 0:m.assetId,childIndex:e.nft.childIndex,newChildIndex:(t.activeChildren||0)+d,oldParentStaked:e.nft.parent.staked,action:"unequip_tx_equip",oldAsset:i}),d++}else if((null===(u=e.nft)||void 0===u?void 0:null===(c=u.parent)||void 0===c?void 0:c.tokenId)!==t.tokenId)a.push({asset:e,oldParentTokenId:(null===(g=e.nft)||void 0===g?void 0:null===(f=g.parent)||void 0===f?void 0:f.tokenId)||t.tokenId,nestableAddress:t.address,parentTokenId:t.tokenId,parentAssetId:null===(w=t.activeAsset)||void 0===w?void 0:w.assetId,childIndex:(null===(b=e.nft)||void 0===b?void 0:b.childIndex)===-1?(null===(C=e.nft)||void 0===C?void 0:null===(j=C.parent)||void 0===j?void 0:j.tokenId)?0:999991:null===(y=e.nft)||void 0===y?void 0:y.childIndex,newChildIndex:(t.activeChildren||0)+d,oldParentStaked:null===(k=e.nft)||void 0===k?void 0:null===(S=k.parent)||void 0===S?void 0:S.staked,action:"tx_equip"}),d++;else if(e.nft.pending&&(null===(p=e.nft.parent)||void 0===p?void 0:p.tokenId)==t.tokenId){let i=o.filter(e=>Number(e.owner.tokenId)==t.tokenId&&999!==e.childIndex).map(e=>e.childIndex||0);a.push({asset:e,oldParentTokenId:null===(I=e.nft.parent)||void 0===I?void 0:I.tokenId,nestableAddress:t.address,parentTokenId:t.tokenId,parentAssetId:null===(_=t.activeAsset)||void 0===_?void 0:_.assetId,childIndex:e.nft.childIndex||0,newChildIndex:Math.max(...i)+1,action:"accept_equip"})}else(null===(x=t.children)||void 0===x?void 0:x.find(t=>(0,r.d)(t,e)))||a.push({asset:e,parentTokenId:t.tokenId,nestableAddress:t.address,parentAssetId:null===(N=t.activeAsset)||void 0===N?void 0:N.assetId,childIndex:e.nft.childIndex,action:"equip"})}),console.log("CHANGES to be applied:",a),e(a)}async function p(e,t,o){var i;t.equipped=null===(i=t.children)||void 0===i?void 0:i.slice(),o((0,a.lZ)(t)),e([])}async function x(e,t,o){var i;let l=null===(i=t.pendingChildren)||void 0===i?void 0:i.map(e=>o.find(t=>t.tokenId==e.tokenId&&t.address==e.address));e(null==l?void 0:l.map(e=>(null==e?void 0:e.activeAsset)||(null==e?void 0:e.assets[0])).filter(e=>e))}function h(e,t,o,n){let r=[];return e.filter(e=>e&&(null==e?void 0:e.amount)>0&&((null==e?void 0:e.itemId)&255)==0&&(null==e?void 0:e.metadataUri)).forEach(e=>{var n,a,s;let d,c;r.push((0,l._)((0,i._)({},e),{amount:(d=null===(n=t.unclaimedNfts)||void 0===n?void 0:n.find(t=>t.contractAddress==e.contractAddress&&t.itemId==e.itemId),c=(null==o?void 0:null===(a=o.unclaimedNft)||void 0===a?void 0:a.contractAddress)==e.contractAddress&&(null==o?void 0:null===(s=o.unclaimedNft)||void 0===s?void 0:s.itemId)==e.itemId?null==o?void 0:o.unclaimedNft:void 0,e.amount-((null==d?void 0:d.amount)||0)-((null==c?void 0:c.amount)||0))}))}),n&&n(r),r}function v(e,t,o,i,l){let n=null==e?void 0:e.filter(e=>{var l,n,r,a;return!(null==t?void 0:t.find(t=>{var o;return null===(o=t.equipped)||void 0===o?void 0:o.find(t=>{var o;return t&&(null===(o=t.nft)||void 0===o?void 0:o.id)===e.id})}))&&!(null==o?void 0:null===(l=o.nfts)||void 0===l?void 0:l.find(t=>t.contractAddress==e.address&&t.tokenId==e.tokenId))&&(null==i?void 0:null===(r=i.nftAsset)||void 0===r?void 0:null===(n=r.nft)||void 0===n?void 0:n.id)!=e.id&&(null==i?void 0:null===(a=i.nft)||void 0===a?void 0:a.id)!=e.id&&"EVR-SOULS"!==e.collectionName}).map(e=>e.activeAsset||e.assets.find(e=>{var t;return Number(null==e?void 0:null===(t=e.catalog)||void 0===t?void 0:t.address)}));var r=null==n?void 0:n.filter(e=>e);return l&&l(r||[]),r}function m(e,t,o,i,l,n){var r,a,s,d,c,u,p,x;if(!t)return null;let h=[];for(let e of(n?null!==(a=null===(r=t.children)||void 0===r?void 0:r.filter(e=>e.equipped&&"Background"!=e.partDescription))&&void 0!==a?a:[]:t.equipped||[])||[]){if(!e)return;e.partDescription||(e.partDescription=(null===(c=e.retrievedPartMetadata)||void 0===c?void 0:null===(d=c.properties)||void 0===d?void 0:null===(s=d.Slot)||void 0===s?void 0:s.value)||"",console.log(null===(x=e.retrievedPartMetadata)||void 0===x?void 0:null===(p=x.properties)||void 0===p?void 0:null===(u=p.Slot)||void 0===u?void 0:u.value)),"Extra_9"==e.partDescription&&(e.partDescription="Neck"),h.push(e)}return e&&e(h),h}function f(e,t,o,l,n){var r;let a=e.map(e=>(0,i._)({},e));
1if(null===(r=t.resources)||void 0===r||r.forEach(e=>{let t=a.find(t=>t.resourceId===e.resourceId);t&&(t.amount-=e.amount)}),l.forEach(e=>{let t=a.find(t=>t.resourceId===e.resourceId);t&&(t.amount-=e.amount)}),null==o?void 0:o.resource){let e=a.find(e=>{var t;return e.resourceId===(null===(t=o.resource)||void 0===t?void 0:t.resourceId)});e&&(e.amount-=o.resource.amount)}return n&&n(a),a}},41941:function(e,t,o){"use strict";o.d(t,{AF:function(){return a},BS:function(){return d},Wi:function(){return s},dK:function(){return c}});var i=o(45077),l=o(4794),n=o(91485),r=o(58800);async function a(e,t){(0,n.C)({title:"Preparing Transaction to stake Soul",description:"Waiting for Moonbeam...",status:"info",duration:5e3,isClosable:!0,position:"top",variant:"top-accent"});let o=(0,l.I9)(t);return console.log(e.collectionName),e.collectionName.includes("EVR-SOULS"),e.collectionName.includes("Leapers"),e.collectionName.includes("PINKxEVRLOOT"),e.collectionName.includes("PINKxEVRLOOT2"),e.collectionName.includes("CITIZEN"),console.log("STAKING",e.collectionName.toLowerCase().includes("souls")?(0,l.iF)("NestableSoul"):e.collectionName.toLowerCase().includes("pink")?(0,l.iF)("EvrlootPinkPromo"):e.collectionName.toLowerCase().includes("citizen")?(0,l.iF)("Citizens"):(0,l.iF)("DuneLeapers"),e.tokenId),await o.stakeSoulToken(e.collectionName.toLowerCase().includes("souls")?(0,l.iF)("NestableSoul"):e.collectionName.toLowerCase().includes("pinkxevrloot2")?(0,l.iF)("EvrlootPinkPromo2"):e.collectionName.toLowerCase().includes("pink")?(0,l.iF)("EvrlootPinkPromo"):e.collectionName.toLowerCase().includes("citizen")?(0,l.iF)("Citizens"):(0,l.iF)("DuneLeapers"),e.tokenId).then(async e=>(await e.wait(),(0,n.C)({title:"Successfully staked!",description:"Success!",status:"success",duration:14e3}),!0)).catch(e=>(console.log((0,r.H)(e,o.interface).error),console.log(e),!1))}async function s(e,t){var o,i;if((null===(o=e.lastPlayerMission)||void 0===o?void 0:o.startTime)&&!(null===(i=e.lastPlayerMission)||void 0===i?void 0:i.claimedTime))return(0,n.C)({title:"Leaving Estra (Unstaking Soul)",description:"This soul is currently on a mission! You must complete the mission before leaving the land of Estra (i.e. unstaking)",status:"info",duration:4e4,isClosable:!0,position:"top",variant:"top-accent"}),!1;(0,n.C)({title:"Leaving Estra (Unstaking Soul)",description:"Returning Soul from Staking contract...",status:"info",duration:4e4,isClosable:!0,position:"top",variant:"top-accent"});let a=(0,l.I9)(t);return console.log(e.estraTokenId),await a.unstakeSoulToken(e.estraTokenId).then(async e=>(await e.wait(),!0)).then(async e=>{e&&(0,n.C)({title:"Successfully unstaked Soul",description:"Success!",status:"success",duration:4e3})}).catch(e=>((0,n.C)({title:"Leaving Estra (Unstaking Soul)",description:"Failed to unstake. Please wait a few minutes and try again",status:"error",duration:4e3}),console.log((0,r.H)(e,a.interface).error),console.log(e),!1))}async function d(e,t){let o;let i=await t.getSigner().getAddress();e.collectionName.includes("EVR-SOULS"),e.collectionName.includes("Leapers"),e.collectionName.includes("PINKxEVRLOOT"),e.collectionName.includes("CITIZEN");let a=e.collectionName.toLowerCase().includes("souls")?"souls":e.collectionName.toLowerCase().includes("pinkxevrloot2")?"pink2":e.collectionName.toLowerCase().includes("pink")?"pink":e.collectionName.toLowerCase().includes("citizen")?"citizen":"duneleapers",s=(0,l.tC)(t),d=(0,l.sb)(t),c=(0,l._B)(t),u=(0,l.Cy)(t),p=(0,l.b5)(t);(0,n.C)({title:"Checking if you have approved the staking contract",description:"Waiting for confirmation..",status:"info",duration:5e3,isClosable:!0,position:"top",variant:"top-accent"});let x=await s.isApprovedForAll(i,(0,l.iF)("Diamond")),h=await d.isApprovedForAll(i,(0,l.iF)("Diamond")),v=await c.isApprovedForAll(i,(0,l.iF)("Diamond")),m=await u.isApprovedForAll(i,(0,l.iF)("Diamond")),f=await p.isApprovedForAll(i,(0,l.iF)("Diamond"));return(console.log("APPROVED",x,h,v,m,f,a),x&&"souls"==a||h&&"duneleapers"==a||v&&"pink"==a||m&&"pink2"==a||f&&"citizen"==a)?((0,n.C)({title:"You have already approved the staking contract",description:"Confirmed!",status:"success",duration:4e3}),!0):((0,n.C)({title:"You need to approve the staking contract",description:"Please confirm",status:"info",duration:4e3}),"souls"==a?o=await s.setApprovalForAll((0,l.iF)("Diamond"),!0).then(async e=>(await e.wait(),(0,n.C)({title:"Successfully approved the staking contract",description:"Success!",status:"success",duration:4e3}),!0)).catch(e=>(console.log((0,r.H)(e,s.interface).error),!1)):"duneleapers"==a?o=await d.setApprovalForAll((0,l.iF)("Diamond"),!0).then(async e=>(await e.wait(),(0,n.C)({title:"Successfully approved the staking contract",description:"Success!",status:"success",duration:4e3}),!0)).catch(e=>((0,n.C)({title:"Failied to approved the staking contract",description:"Failed Please try again in a few minutes",status:"success",duration:4e3}),!1)):"pink"==a?o=await c.setApprovalForAll((0,l.iF)("Diamond"),!0).then(async e=>(await e.wait(),(0,n.C)({title:"Successfully approved the staking contract",description:"Success!",status:"success",duration:4e3}),!0)).catch(e=>(console.log((0,r.H)(e,c.interface).error),!1)):"pink2"==a?o=await u.setApprovalForAll((0,l.iF)("Diamond"),!0).then(async e=>(await e.wait(),(0,n.C)({title:"Successfully approved the staking contract",description:"Success!",status:"success",duration:4e3}),!0)).catch(e=>(console.log((0,r.H)(e,c.interface).error),!1)):"citizen"==a&&(o=await p.setApprovalForAll((0,l.iF)("Diamond"),!0).then(async e=>(await e.wait(),(0,n.C)({title:"Successfully approved the staking contract",description:"Success!",status:"success",duration:4e3}),!0)).catch(e=>(console.log((0,r.H)(e,p.interface).error),!1))),o)}async function c(e,t){let o;await t.getSigner().getAddress();let i=(0,l.tC)(t);return e.toLowerCase().includes("souls")&&(o=await i.setApprovalForAll((0,l.iF)("Diamond"),!1).then(async e=>(await e.wait(),(0,n.C)({title:"Successfully removed approval for the staking contract",description:"Success!",status:"success",duration:4e3}),!0)).catch(e=>((0,n.C)({title:"Failed to remove approval for the staking contract",description:"Failed Please try again in a few minutes",status:"success",duration:4e3}),!1))),o}(0,i.I)()},15348:function(e,t,o){"use strict";o.r(t),o.d(t,{default:function(){return eO}});var i=o(85893),l=o(67294),n=o(26551),r=o.n(n),a=o(88329),s=o(8186),d=o(73636),c=o(72009),u=o(42124),p=o(19157),x=o(15678),h=o(98361),v=o(45007),m=o(25343),f=o(59200),g=
1o(24754),w=o(11163),b=o(83658),j=o(15715),C=o(68029),y=o(38488),S=o(26972),k=o(90092),I=o(84819),_=o(61193),N=o.n(_),E=e=>{let{onClose:t}=e;return(0,i.jsxs)(d.U,{className:"handle",padding:"5px",h:"5%",w:"100%",justifyContent:"space-between",cursor:"all-scroll",children:[(0,i.jsx)("h3",{style:{fontWeight:1e3,marginTop:5},children:"Soul Details"}),(0,i.jsx)(y.z,{h:"10px",style:{padding:0,backgroundColor:"#0000",color:"white",borderColor:"white"},onClick:()=>{t()},children:(0,i.jsx)("h3",{style:{fontSize:18,fontWeight:400,marginTop:5},children:"Close"})})]})},F=o(64831),M=e=>{var t;let{soulNft:o}=e;return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(s.g,{className:r().modal,h:"100%",w:"100%",children:[(0,i.jsx)("h1",{style:{marginBottom:"-25px"},children:null==o?void 0:null===(t=o.retrievedMetadata)||void 0===t?void 0:t.name}),(0,i.jsx)(F.i,{w:"80%",color:"black",borderColor:"black",paddingTop:"10px",marginBottom:"0px"})]})})},A=e=>{let{tabState:t,setTabState:o,disabled:l}=e,n=e=>{let{tabName:n}=e;return(0,i.jsx)(j.M,{display:l&&"Companions"==n?"none":"flex",w:"25%",borderRadius:"7px",borderWidth:"1px",padding:"5px",borderColor:"black",backgroundColor:t===n?"#000d":"transparent",onClick:()=>o(n),cursor:"pointer",children:(0,i.jsx)(a.k,{padding:"4px",children:(0,i.jsx)("h3",{style:t===n?{color:"white"}:{color:"black"},children:n})})})};return(0,i.jsxs)(d.U,{w:"100%",justifyContent:"flex-start",paddingBottom:"6px",paddingTop:"0px",className:r().missionSelector,children:[(0,i.jsx)(n,{tabName:"Soul"}),(0,i.jsx)(n,{tabName:"History"}),(0,i.jsx)(n,{tabName:"Cosmetic"}),(0,i.jsx)(n,{tabName:"Companions"})]})},R=o(14991),T=o.n(R),z=o(98251),D=o.n(z),L=o(14114),B=e=>{var t,o,l,n,r,d,c,u,p,x,h,v,m,f,g;let{soulNft:w,relics:b}=e;return(0,i.jsx)(s.g,{w:(null==b?void 0:b.length)&&(null==b?void 0:b.length)>0?"80%":"100%",h:"100%",borderRadius:"7px",backgroundColor:"#000000e2",className:D().details,children:(0,i.jsxs)(s.g,{w:"100%",h:"100%",paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"10px",children:[(0,i.jsx)(a.k,{w:"100%",h:"10%",margin:"0px",display:"inline",children:(0,i.jsx)("h3",{style:{textAlign:"center"}
1,children:"Background"})}),(0,i.jsx)(a.k,{w:"100%",h:"3%",children:(0,i.jsx)(F.i,{w:"100%",borderColor:"#FFD66C",borderTopWidth:"1px"})}),(0,i.jsx)(a.k,{w:"100%",h:"100%",overflowY:"auto",className:D().details,children:(0,i.jsx)(k.x,{style:{color:"white",lineHeight:"15px"},fontSize:"20px",children:null==w?void 0:null===(t=w.retrievedMetadata)||void 0===t?void 0:t.description})}),(0,i.jsxs)(a.k,{flexDirection:"row",w:"100%",h:"25%",gap:9,children:[(0,i.jsx)(s.g,{w:"25%",h:"5%",children:(0,i.jsxs)(a.k,{w:"100%",children:[(0,i.jsx)(k.x,{className:D().uncircledTrait,style:{color:"white",lineHeight:"15px"},children:"Personality:"}),(0,i.jsx)(L.L,{}),(0,i.jsx)(k.x,{className:D().circledTrait,style:{color:"white",lineHeight:"15px"},children:null==w?void 0:null===(n=w.retrievedMetadata)||void 0===n?void 0:null===(l=n.properties)||void 0===l?void 0:null===(o=l.Personality)||void 0===o?void 0:o.value})]})}),(0,i.jsx)(s.g,{w:"25%",h:"5%",children:(0,i.jsxs)(a.k,{w:"100%",children:[(0,i.jsx)(k.x,{className:D().uncircledTrait,style:{color:"white",lineHeight:"15px"},children:"Talent:"}),(0,i.jsx)(L.L,{}),(0,i.jsx)(k.x,{className:D().circledTrait,style:{color:"white",lineHeight:"15px"},children:null==w?void 0:null===(c=w.retrievedMetadata)||void 0===c?void 0:null===(d=c.properties)||void 0===d?void 0:null===(r=d.Talent)||void 0===r?void 0:r.value})]})}),(0,i.jsx)(s.g,{w:"25%",h:"5%",children:(0,i.jsxs)(a.k,{w:"100%",children:[(0,i.jsx)(k.x,{className:D().uncircledTrait,style:{color:"white",lineHeight:"15px"},children:"Origin:"}),(0,i.jsx)(L.L,{}),(0,i.jsx)(k.x,{className:D().circledTrait,style:{color:"white",lineHeight:"15px"},children:null==w?void 0:null===(x=w.retrievedMetadata)||void 0===x?void 0:null===(p=x.properties)||void 0===p?void 0:null===(u=p.Origin)||void 0===u?void 0:u.value})]})}),(null==w?void 0:null===(v=w.retrievedMetadata)||void 0===v?void 0:null===(h=v.properties)||void 0===h?void 0:h.Role)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(s.g,{w:"25%",h:"5%",children:(0,i.jsxs)(a.k,{w:"100%",children:[(0,i.jsx)(k.x,{className:D().uncircledTrait,style:{color:"white",lineHeight:"15px"},children:"Role:"}),(0,i.jsx)(L.L,{}),(0,i.jsx)(k.x,{className:D().circledTrait,style:{color:"white",lineHeight:"15px"},children:null==w?void 0:null===(g=w.retrievedMetadata)||void 0===g?void 0:null===(f=g.properties)||void 0===f?void 0:null===(m=f.Role)||void 0===m?void 0:m.value})]})})})]})]})})},H=o(66481),W=o(51604),O=e=>{let{disabled:t}=e,o=(0,v.I0)(),[n,r]=(0,l.useState)(0),c=(0,v.v9)(e=>e.inventoryReducer.selectedSoulNft),u=(0,v.v9)(e=>e.missionsReducer.historicalMissions),p=(0,l.useRef)();(0,l.useEffect)(()=>{if(null==u?void 0:u.length)return;let e=new AbortController;p.current=e,c&&(0,H.c2)(null==c?void 0:c.id,e).then(e=>{o((0,W.rV)(e))}),r((null==u?void 0:u.length)||0)},[]),(0,l.useEffect)(()=>{r((null==u?void 0:u.length)||0)},[u]);let{}=e;return(0,i.jsx)(s.g,{w:"100%",h:"45%",borderRadius:"7px",backgroundColor:"#000000e2",className:D().details,children:(0,i.jsxs)(s.g,{w:"100%",h:"100%",paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"20px",children:[(0,i.jsx)(a.k,{w:"100%",h:"10%",margin:"0px",display:"inline",marginBottom:"8px",children:(0,i.jsx)("h3",{style:{textAlign:"center"},children:"Progress"})}),(0,i.jsx)(a.k,{w:"100%",h:"3%",children:(0,i.jsx)(F.i,{w:"100%",borderColor:"#FFD66C",borderTopWidth:"1px"})}),(0,i.jsxs)(d.U,{w:"100%",h:"87%",overflowY:"scroll",className:D().details,children:[(0,i.jsxs)(s.g,{w:"50%",h:"100%",children:[(0,i.jsxs)(a.k,{w:"100%",h:"20%",children:[(0,i.jsx)(k.x,{style:{color:"white",lineHeight:"15px"},children:"Missions completed"}),(0,i.jsx)(L.L,{}),(0,i.jsx)(k.x,{className:D().circledTrait,style:{color:"white",lineHeight:"15px"},minW:"28px",children:n}),(0,i.jsx)(k.x,{display:t?"none":"block",border:"1px solid #ffd66c",p:"3px",fontSize:"10px",style:{color:"#ffd66c"},borderRadius:"5px",ms:"10.5",onClick:e=>{o((0,m.AL)(!0)),o((0,m.u)("MISSION_LOG_WINDOW")),e.stopPropagation()},cursor:"pointer",_hover:{color:"white !important",border:"1px solid white"},children:"Mission Log"}),t&&(0,i.jsx)(C.x,{w:"81.5px",children:" "})]}),(0,i.jsxs)(a.k,{w:"100%",children:[(0,i.jsx)(k.x,{style:{color:"white",lineHeight:"15px"},children:"Quests completed"}),(0,i.jsx)(L.L,{}),(0,i.jsx)(k.x,{className:D().circledTrait,style:{color:"white",lineHeight:"15px"},children:"TBD"}),(0,i.jsx)(C.x,{w:"81.5px",children:" "})]}),(0,i.jsxs)(a.k,{w:"100%",children:[(0,i.jsx)(k.x,{style:{color:"white",lineHeight:"15px"},children:"Fights won"}),(0,i.jsx)(L.L,{}),(0,i.jsx)(k.x,{className:D().circledTrait,style:{color:"white",lineHeight:"15px"},children:"TBD"}),(0,i.jsx)(C.x,{w:"81.5px",children:" "})]}),(0,i.jsxs)(a.k,{w:"100%",children:[(0,i.jsx)(k.x,{style:{color:"white",lineHeight:"15px"},children:"Fights lost"}),(0,i.jsx)(L.L,{}),(0,i.jsx)(k.x,{className:D().circledTrait,style:{color:"white",lineHeight:"15px"},children:"TBD"}),(0,i.jsx)(C.x,{w:"81.5px",children:" "})]})]}),(0,i.jsx)(s.g,{w:"50%",h:"100%",children:(0,i.jsx)(a.k,{w:"100%",h:"100%",border:"1px solid #FFD66C",borderRadius:"8px",children:(0,i.jsx)(a.k,{padding:"8px",children:(0,i.jsxs)(k.x,{style:{color:"white",lineHeight:"15px"},children:["City of Trakan:",(0,i.jsx)("br",{}),"You have just arrived in the city and are trying to find your way around. There is still a lot to discover in the city."]})})})})]})]})})},P=e=>{let{soulNft:t,relics:o,disabled:l}=e;return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(a.k,{w:"100%",h:"90%",position:"relative",right:0,top:0,className:D().details,flexDirection:"column",alignContent:"flex-start",alignItems:"stretch",justifyContent:"flex-start",backgroundSize:"cover",children:(0,i.jsx)(d.U,{w:"100%",h:"100%",paddingTop:"0px",spacing:0,children:(0,i.jsxs)(s.g,{className:T().modal,h:"100%",w:"100%",padding:"0%",paddingTop:"0",spacing:2,children:[(0,i.jsx)(d.U,{h:"55%",w:"100%",children:(0,i.jsx)(B,{relics:o,soulNft:t})}),(0,i.jsx)(O,{disabled:l})]})})})})},U=o(16610),q=o(59099),G=o(73108),Z=o(95957),V=o(97725),Y=(0,l.memo)(e=>{let{skill:t,setSkillSelected:o}=e,n=(0,l.useCallback)(()=>{console.log(t.activityName),o&&o(t.activityName)},[t.activityName,o]),{level:r,priorLevelExp:s,nextLevelExp:d}=(0,Z.Mg)(t.experience),c=V.t[r];return(0,i.jsxs)(q.P,{h:"30px",w:"100%",onClick:n,cursor:"pointer",className:D().details,children:[(0,i.jsxs)(a.k,{w:"100%",children:[(0,i.jsxs)(k.x,{className:D().details,color:"white",lineHeight:"15px",children:["".concat(t.activityName," ").concat(c),(0,i.jsx)(k.x,{as:"i",color:"#fff9",children:" (".concat(r,")")})]}),(0,i.jsx)(L.L,{})]}),(0,i.jsx)(C.x,{w:"100%",position:"relative",children:(0,i.jsx)(G.Z,{completed:t.experience/d*100,className:D().progressBarWrapper,barContainerClassName:D().progressBarContainer,customLabel:"".concat(Math.round(t.experience)," / ").concat(d),labelClassName:t.experience/d*100>.2?D().progressBarLabel:D().progressBarLabelWhite,bgColor:"#eac48b",baseBgColor:"transparent",height:"12px",isLabelVisible:!1})})]},t.activityId)}),$=o(3760),K=(0,l.memo)(e=>{var t;let{soulNft:o}=e,[n,r]=(0,l.useState)("Fishing");return(0,i.jsx)(d.U,{w:"100%",h:"50%",alignSelf:"stretch",justify:"space-between",position:"relative",borderRadius:"7px",backgroundColor:"#000000e2",children:(0,i.jsx)(s.g,{w:"100%",h:"100%",children:(0,i.jsxs)(s.g,{h:"100%",w:"100%",p:"10px",children:[(0,i.jsx)(a.k,{h:"12%",w:"20%",children:(0,i.jsx)(k.x,{as:"h3",color:"white",lineHeight:"15px",children:"Skills"})}),(0,i.jsx)(a.k,{h:"1%",w:"100%",children:(0,i.jsx)(F.i,{w:"100%",borderColor:"#FFD66C",borderTopWidth:"1px"})}),(0,i.jsx)(a.k,{h:"67%",w:"100%",overflowY:"scroll",children:(0,i.jsx)(U.r,{w:"100%",templateColumns:"repeat(3, 1fr)",height:"101",columnGap:1,p:"0px",children:(null===(t=o.experience)||void 0===t?void 0:t.activities)&&o.experience.activities.map((e,t)=>{if(e.activityId)return(0,i.jsx)(Y,{skill:e,setSkillSelected:r},e.activityId+"-"+t)}
1)})}),(0,i.jsx)(a.k,{h:"23%",w:"100%",children:(0,i.jsx)($.Z,{skillName:n})})]})})})}),J=o(19575),X=o(72255),Q=(0,l.memo)(e=>{let{soulAttributes:t,soulNft:o}=e;return(0,i.jsxs)(d.U,{w:"100%",h:"50%",alignSelf:"stretch",justify:"space-between",position:"relative",borderRadius:"7px",backgroundColor:"#000000e2",className:D().details,children:[(0,i.jsx)(s.g,{w:"50%",h:"100%",children:(0,i.jsx)(J.Z,{soulAttributes:t,soulNft:o})}),(0,i.jsx)(s.g,{w:"50%",h:"100%",children:(0,i.jsx)(X.Z,{soulNft:o})})]})}),ee=(0,l.memo)(e=>{let{soulAttributes:t,soulNft:o}=e;return(0,i.jsx)(a.k,{w:"100%",h:"90%",position:"relative",right:0,top:0,className:D().details,flexDir:"column",alignContent:"flex-start",alignItems:"stretch",justifyContent:"flex-start",backgroundSize:"cover",children:(0,i.jsx)(d.U,{w:"100%",h:"100%",pt:0,spacing:0,children:(0,i.jsxs)(s.g,{h:"100%",w:"100%",p:0,spacing:2,children:[(0,i.jsx)(Q,{soulNft:o,soulAttributes:t}),o&&(0,i.jsx)(K,{soulNft:o})]})})})}),et=o(59555),eo=o(42069),ei=(0,l.memo)(e=>{var t,o;let{soulNft:n,itemSize:d,equippedAssets:c,selectedItem:u,soulClass:p,disabled:x}=e,[h,v]=(0,l.useState)(),m=e=>{let{gridAreaName:t,slot:o,title:l}=e,{lootNfts:a}=(0,eo.m)();return(0,i.jsxs)(C.x,{gridArea:t,w:d,h:d,className:r().inventoryContainerEmpty,position:"relative",children:[(0,i.jsx)(j.M,{w:"100%",position:"absolute",top:-4,children:(0,i.jsx)(k.x,{style:{color:"white",lineHeight:"15px"},children:l})}),(0,i.jsx)(et.Z,{slotDescription:o,equipped:c,soulNft:n,soulClass:p,disabled:x,lootNfts:a})]})};return(0,l.useEffect)(()=>{let e=null==c?void 0:c.find(e=>40===e.partId);e&&v(e)},[c,u]),(0,i.jsx)(s.g,{w:"100%",h:"55%",borderRadius:"7px",backgroundColor:"#000000e2",className:D().details,children:(0,i.jsxs)(s.g,{w:"100%",h:"100%",px:"20px",pt:"10px",pb:"20px",children:[(0,i.jsx)(a.k,{w:"100%",h:"10%",m:"0",display:"inline",children:(0,i.jsx)(k.x,{as:"h3",textAlign:"center",w:"100%",children:"Equipped Cosmetics"})}),(0,i.jsx)(a.k,{w:"100%",h:"3%",children:(0,i.jsx)(F.i,{w:"100%",borderColor:"#FFD66C",borderTopWidth:"1px"})}),(0,i.jsx)(a.k,{w:"100%",h:"87%",children:(0,i.jsxs)(s.g,{w:"100%",h:"100%",children:[(0,i.jsx)(a.k,{w:"100%",h:"50%",children:(0,i.jsxs)(U.r,{zIndex:100,top:3,left:3,w:"50%",h:"0%",p:"15px",gap:3,gridTemplateAreas:{base:"'bg frame frame-augment market-stall'"},children:[(0,i.jsx)(m,{gridAreaName:"bg",slot:"Background",title:"Background"}),(0,i.jsx)(m,{gridAreaName:"frame",slot:"Frame",title:"Frame"}),(0,i.jsx)(m,{gridAreaName:"frame-augment",slot:"Extra_25",title:"Augment"}),(0,i.jsx)(m,{gridAreaName:"market-stall",slot:"Object",title:"Market Stall"})]})}),(0,i.jsx)(a.k,{w:"100%",h:"50%",children:h&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(s.g,{pt:"10px",children:(0,i.jsx)(a.k,{w:"100%",h:"100%",border:"1px solid #FFD66C",borderRadius:"8px",p:"8px",children:(0,i.jsxs)(k.x,{style:{color:"white",lineHeight:"15px"},children:["Background: ",h&&(null===(t=h.retrievedMetadata)||void 0===t?void 0:t.name),(0,i.jsx)("br",{}),h&&(null===(o=h.retrievedMetadata)||void 0===o?void 0:o.description)]})})})})})]})})]})})}),el=(0,l.memo)(e=>{let{soulNft:t,itemSize:o,equippedAssets:l,setSelectedItem:n,selectedItem:r,soulClass:c,disabled:u}=e;return(0,i.jsx)(a.k,{w:"100%",h:"100%",position:"relative",right:0,top:0,className:T().missions,flexDir:"column",alignContent:"flex-start",alignItems:"stretch",justifyContent:"flex-start",backgroundSize:"cover",children:(0,i.jsx)(d.U,{w:"100%",h:"100%",pt:0,spacing:0,children:(0,i.jsx)(s.g,{className:T().missions,h:"100%",w:"100%",p:0,spacing:2,children:(0,i.jsx)(ei,{soulNft:t,itemSize:o,equippedAssets:l,setSelectedItem:n,selectedItem:r,soulClass:c,disabled:u})})})})}),en=e=>{let{setTabState:t,tabState:o}=e,l=e=>{let{choice:l}=e;return(0,i.jsxs)(j.M,{w:"19%",borderRadius:"7px",borderWidth:"1px",padding:"5px",borderColor:"black",backgroundColor:o===l?"#000d":"transparent",onClick:()=>t(l),cursor:"pointer",children:[" ",(0,i.jsx)(a.k,{padding:"4px",children:(0,i.jsx)(k.x,{style:o===l?{color:"white"}:{color:"black "},children:l})})]})};return(0,i.jsx)(a.k,{w:"100%",justifyContent:"flex-start",paddingBottom:"6px",paddingTop:"0px",flexWrap:"wrap",gap:"2px",className:r().missionSelector,children:e.activities.map(e=>(0,i.jsx)(l,{choice:e.activityName},e.activityName))})},er=e=>{let{soulNft:t,allSoulsXPDict:o,selectedMission:l,localLeaderboardIsLoading:n,nameMap:r}=e,c=(0,v.v9)(e=>e.inventoryReducer.soulNfts),u=(0,v.v9)(e=>e.inventoryReducer.duneLeapers);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(s.g,{h:"80%",w:"100%",padding:"10px",borderRadius:"7px",backgroundColor:"#000000e2",className:D().details,overflow:"auto",children:[(0,i.jsx)(a.k,{h:"6%",w:"100%",display:"inline",children:(0,i.jsx)("h3",{style:{textAlign:"center"},children:l})}),(0,i.jsx)(a.k,{h:"1%",w:"95%",children:(0,i.jsx)(F.i,{w:"100%",borderColor:"#FFD66C",borderTopWidth:"1px"})}),(0,i.jsx)(a.k,{h:"60%",w:"100%",children:(0,i.jsxs)(s.g,{w:"100%",children:[(0,i.jsx)(d.U,{w:"90%",h:"5%",justifyContent:"space-between",children:(0,i.jsxs)(a.k,{w:"100%",h:"100%",justifyContent:"flex-start",children:[(0,i.jsx)(a.k,{w:"10%",h:"100%",marginLeft:"0",children:(0,i.jsx)(k.x,{style:{color:"white",lineHeight:"15px"},children:"Rank"})}),(0,i.jsx)(a.k,{w:"10%",h:"100%",justifyContent:"space-between",children:(0,i.jsx)(k.x,{style:{color:"white",lineHeight:"15px"},children:"XP"})}),(0,i.jsx)(a.k,{w:"25%",h:"100%",justifyContent:"space-between",children:(0,i.jsx)(k.x,{style:{color:"white",lineHeight:"15px"},children:"Soul"})}),(0,i.jsx)(a.k,{w:"45%",justifyContent:"space-between",children:(0,i.jsxs)(k.x,{style:{color:"white",lineHeight:"15px"},children:[" ","Last ".concat(l," Mission")]})})]})}),(0,i.jsx)(a.k,{h:"1%",w:"95%",children:(0,i.jsx)(F.i,{w:"100%",borderColor:"#FFD66C",borderTopWidth:"1px"})}),(0,i.jsx)(d.U,{w:"90%",h:"80%",children:(0,i.jsx)(a.k,{w:"100%",h:"100%",justifyContent:"space-between",children:(0,i.jsx)(()=>{let e=[];return"Toading"==l?null==u||u.forEach(t=>{var o,i,n,r,a,s;e.push({id:t.id,xp:null===(n=t.experience)||void 0===n?void 0:null===(i=n.activities)||void 0===i?void 0:null===(o=i.find(e=>e.activityName==l))||void 0===o?void 0:o.experience,name:(null===(r=t.retrievedMetadata)||void 0===r?void 0:r.name)||"Unnamed Soul",lastMission:(null===(s=t.lastPlayerMission)||void 0===s?void 0:null===(a=s.mission)||void 0===a?void 0:a.missionType)==l?t.lastPlayerMission:void 0})}
1):null==c||c.forEach(t=>{var o,i,n,r,a,s;e.push({id:t.id,xp:null===(n=t.experience)||void 0===n?void 0:null===(i=n.activities)||void 0===i?void 0:null===(o=i.find(e=>e.activityName==l))||void 0===o?void 0:o.experience,name:(null===(r=t.retrievedMetadata)||void 0===r?void 0:r.name)||"Unnamed Soul",lastMission:(null===(s=t.lastPlayerMission)||void 0===s?void 0:null===(a=s.mission)||void 0===a?void 0:a.missionType)==l?t.lastPlayerMission:void 0})}),console.log(e),e.sort((e,t)=>t.xp-e.xp),(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(s.g,{w:"80%",children:e.map((e,o)=>{var l,n;return(0,i.jsxs)(a.k,{borderRadius:"8px",border:e.id===(null==t?void 0:t.id)?"1px solid #FFD66C":"",w:"100%",h:"100%",justifyContent:"flex-start",alignItems:"center",children:[(0,i.jsx)(a.k,{w:"10%",marginLeft:"10px",children:(0,i.jsx)(k.x,{style:{color:"white",lineHeight:"15px"},children:o+1})}),(0,i.jsx)(a.k,{w:"13%",children:(0,i.jsx)(k.x,{style:{color:"white",lineHeight:"15px"},children:e.xp&&Math.floor(Math.round(10*e.xp)/10)})}),(0,i.jsx)(a.k,{w:"31%",justifyContent:"flex-start",children:(0,i.jsx)(k.x,{style:{color:"white",lineHeight:"15px"},children:e.name})}),(0,i.jsx)(a.k,{children:(0,i.jsx)(k.x,{style:{color:"white",lineHeight:"15px"},children:(null===(n=e.lastMission)||void 0===n?void 0:null===(l=n.mission)||void 0===l?void 0:l.name)||"-"})})]},"".concat(e," ").concat(o," ").concat(Math.random()))})})})},{})})})]})})]})})},ea=e=>{var t;let{soulNft:o,allSoulsXPDict:n,nameMap:r,localLeaderboardIsLoading:c}=e,[u,p]=(0,l.useState)("Fishing");return(0,i.jsx)(a.k,{w:"100%",h:"100%",position:"relative",right:0,top:0,className:D().details,flexDirection:"column",alignContent:"flex-start",alignItems:"stretch",justifyContent:"flex-start",backgroundSize:"cover",children:(0,i.jsx)(d.U,{w:"100%",h:"100%",paddingTop:"0px",spacing:0,children:(0,i.jsxs)(s.g,{className:T().modal,h:"100%",w:"100%",padding:"0%",paddingTop:"0",spacing:2,children:[(0,i.jsx)(er,{soulNft:o,allSoulsXPDict:n,selectedMission:u,localLeaderboardIsLoading:c,nameMap:r}),(0,i.jsx)(en,{setTabState:p,tabState:u,activities:(null==o?void 0:null===(t=o.experience)||void 0===t?void 0:t.activities.filter(e=>"Unknown"!=e.activityName))||[]})]})})})};let es=e=>e.inventoryReducer.selectedSoulNft,ed=(0,l.memo)(e=>{let{selectedMarketplaceSoul:t,tabState:o,setTabState:n,itemSize:r,equippedAssets:a,setSelectedItem:s,selectedItem:d,soulClass:c,soulAttributes:u,allSoulsXPDict:p,nameMap:x,localLeaderboardIsLoading:h,relics:m}=e,f=(0,v.v9)(es),g=(0,l.useMemo)(()=>t||f,[t,f]),w=(0,l.useMemo)(()=>!!t&&(null==t?void 0:t.id)!==(null==f?void 0:f.id),[t,null==f?void 0:f.id]);return(0,l.useMemo)(()=>g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(A,{tabState:o,setTabState:n,disabled:w}),"Soul"===o&&(0,i.jsx)(ee,{soulAttributes:u,soulNft:g}),"History"===o&&(0,i.jsx)(P,{soulNft:g,relics:m,disabled:w}),"Cosmetic"===o&&(0,i.jsx)(el,{soulNft:g,itemSize:r,equippedAssets:a,setSelectedItem:s,selectedItem:d,soulClass:c,disabled:!!t||(null==f?void 0:f.isListed)}),"Companions"===o&&(0,i.jsx)(ea,{soulNft:f,allSoulsXPDict:p,nameMap:x,localLeaderboardIsLoading:h})]}):null,[o,g,w,r,a,s,d,c,p,x,h])});var ec=o(44610),eu=o(67462),ep=o(57879),ex=o(12553),eh=o(4357),ev=o(86384),em=o(63543),ef=o(51712),eg=o(92041),ew=o(4794),eb=o(35701),ej=o(76814),eC=o(71073),ey=o(15339),eS=o(47854),ek=o(85401);let eI=(0,l.memo)(function(e){let{gridAreaName:t,slot:o,itemSize:l,equippedAssets:n,useSoul:a,soulClass:s,disabled:d,lootNfts:c}=e;return(0,i.jsx)(C.x,{gridArea:t,w:l,h:l,className:r().inventoryContainerEmpty,children:(0,i.jsx)(et.Z,{slotDescription:o,equipped:n,soulNft:a,soulClass:s,disabled:d,lootNfts:c})})}),e_=(0,l.memo)(function(e){var t,o;let{composedParts:n,itemSize:a,equippedAssets:s,soulClass:c,inventoryChanges:u,setInventoryChanges:p,disabled:x}=e,h=(0,v.I0)(),m=(0,v.v9)(e=>e.inventoryReducer.socketActive),f=(0,v.v9)(e=>e.windowReducer.selectedMarketplaceSoul||e.inventoryReducer.selectedSoulNft,v.wU),{isOpen:g,onOpen:w,onClose:C}=(0,b.q)(),{lootNfts:I,fetchLootNfts:_}=(0,eo.m)(),[N,E]=(0,l.useState)(void 0),[F,M]=(0,l.useState)([]),{socket:A}=(0,ek.s)(),[R,T]=(0,l.useState)(!1),z=(0,v.v9)(e=>e.inventoryReducer.selectedSoulNft);(0,v.v9)(e=>e.windowReducer.selectedMarketplaceSoul);let{connectedWallet:D,web3Provider:L}=(0,v.v9)(e=>e.web3Reducer),B=(0,v.v9)(e=>e.web3Reducer.metatransactions);null==D||D.address;let H=!!((null==z?void 0:null===(t=z.lastPlayerMission)||void 0===t?void 0:t.startTime)&&!(null==z?void 0:null===(o=z.lastPlayerMission)||void 0===o?void 0:o.claimedTime));async function W(e){if(!L)return[];let t=[];return void 0==e.find(e=>{var t,o;return"tx_equip"===e.action&&e.childIndex&&e.childIndex>99999&&(null===(o=e.asset)||void 0===o?void 0:null===(t=o.nft)||void 0===t?void 0:t.address)===(0,ew.iF)("NestableLoot").toLocaleLowerCase()})||await (0,ew.n6)(L)||t.push((0,ew.iF)("NestableLoot")),void 0==e.find(e=>{var t,o;return"tx_equip"===e.action&&e.childIndex&&e.childIndex>99999&&(null===(o=e.asset)||void 0===o?void 0:null===(t=o.nft)||void 0===t?void 0:t.address)===(0,ew.iF)("NestableLootV2").toLocaleLowerCase()})||await (0,ew.mv)(L)||t.push((0,ew.iF)("NestableLootV2")),t}async function O(e){M(await W(e))}async function P(){var e,t,o;if(!L)return;T(!0),h((0,ey.h)({id:"equipment-"+(null==z?void 0:z.id),text:"Updating Equipment!",soulId:null==z?void 0:z.id,soulMetadata:null==z?void 0:z.retrievedMetadata,data:[...u]}));let i=await (0,ej.t6)(z.address,u,L,B,h,A);if(console.log("soulEquip returnedblockNumber",i),1==i){let t=[];null===(e=z.equipped)||void 0===e||e.filter(e=>
1e.equipped).forEach(e=>{t.push((0,eu._)((0,ec._)({},e),{equipped:!0,nft:(0,eu._)((0,ec._)({},e.nft),{parent:(0,eu._)((0,ec._)({},e.nft.parent),{id:z.id,tokenId:z.tokenId})})}))}),z.children=t,z.equipped=t,console.log("soulNft updated w children",z),p([]),T(!1),h((0,ey.h)({id:"equipment-"+(null==z?void 0:z.id),text:"Success!",waitingTime:2500,icon:"CHECK",soulId:null==z?void 0:z.id,soulMetadata:null==z?void 0:z.retrievedMetadata}))}else if(i){let e;let i=null==z?void 0:z.id,l=null==z?void 0:z.squidHeight,n=8;for(console.log("soulNft",z),console.log("inventoryChanges",u),console.log("soulId",i),console.log("currentHeight",l);n>0&&(console.log("tempSoulNft",e=await q(i,new AbortController)),null==e||!e.squidHeight||!(e.squidHeight>(l||0)));)await (0,eC._v)(4e3),console.log("maxIntervals",--n);e&&(z.equipped=null===(t=e.children)||void 0===t?void 0:t.slice(),z.children=null===(o=e.children)||void 0===o?void 0:o.slice()),T(!1),h((0,ey.h)({id:"equipment-"+(null==z?void 0:z.id),text:"Success!",waitingTime:2500,icon:"CHECK",soulId:null==z?void 0:z.id,soulMetadata:null==z?void 0:z.retrievedMetadata})),h((0,eS.lZ)(z)),_(),p([])}else T(!1),h((0,ey.h)({id:"equipment-"+(null==z?void 0:z.id),text:"Failed!",waitingTime:2500,icon:"ERROR",soulId:null==z?void 0:z.id,soulMetadata:null==z?void 0:z.retrievedMetadata}))}let q=async(e,t)=>await (0,ev.x4)(e,t);async function G(){if(F.length)return w(),!1}async function Z(){if(!L)return;let e=!0;F.includes((0,ew.iF)("NestableLoot"))&&(e=await (0,ew.Tl)(L)),F.includes((0,ew.iF)("NestableLootV2"))&&(e=await (0,ew.dJ)(L)),e&&(E(!1),W(u).then(e=>M(e)))}(0,l.useEffect)(()=>{O(u)},[u]),(0,l.useEffect)(()=>{console.log(N),N&&Z()},[N]);let V=(0,l.useMemo)(()=>({itemSize:a,equippedAssets:s,useSoul:f,soulClass:c,disabled:x,lootNfts:I}),[a,s,f,c,x,m]);return(0,i.jsxs)(j.M,{w:"95%",h:"96%",position:"relative",borderRadius:"7px",overflow:"hidden",children:[n&&(0,i.jsx)(eg.Pc,{parts:n}),(0,i.jsxs)(U.r,{zIndex:100,position:"absolute",top:0,left:0,gap:"2",w:"100%",h:"100%",padding:"15px",gridTemplateColumns:{base:"1fr 6fr 1fr",md:"1fr 6fr 1fr"},gridTemplateRows:{base:"auto",md:"1fr 1fr 1fr 1fr 1fr 1fr"},gridTemplateAreas:{base:" 'head char ammy' 'armor char blank1' 'left char right' 'lring char rring' 'boots char blank2' 'blank3 char blank2'",md:" 'head char ammy' 'armor char blank1' 'left char right' 'lring char rring' 'boots char blank2' 'blank3 char blank2'"},children:[(0,i.jsx)(eI,(0,eu._)((0,ec._)({},V),{gridAreaName:"right",slot:"Off Hand"})),(0,i.jsx)(eI,(0,eu._)((0,ec._)({},V),{gridAreaName:"left",slot:"Main Hand"})),(0,i.jsx)(eI,(0,eu._)((0,ec._)({},V),{gridAreaName:"boots",slot:"Feet"})),(0,i.jsx)(eI,(0,eu._)((0,ec._)({},V),{gridAreaName:"armor",slot:"Body"})),(0,i.jsx)(eI,(0,eu._)((0,ec._)({},V),{gridAreaName:"head",slot:"Head"})),(0,i.jsx)(eI,(0,eu._)((0,ec._)({},V),{gridAreaName:"lring",slot:"Ring Main Hand"})),(0,i.jsx)(eI,(0,eu._)((0,ec._)({},V),{gridAreaName:"rring",slot:"Ring Off Hand"})),(0,i.jsx)(eI,(0,eu._)((0,ec._)({},V),{gridAreaName:"ammy",slot:"Neck"}))]}),u.length>0&&(0,i.jsxs)(d.U,{position:"absolute",bottom:0,zIndex:101,children:[F.length?(0,i.jsx)(S.u,{label:u.map((e,t)=>(0,i.jsx)(k.x,{children:"".concat(e.action,": ").concat(e.asset.nft.id," (Asset:").concat(e.asset.assetId,")")},e.asset.assetId)),children:(0,i.jsx)(y.z,{colorScheme:"red",onClick:()=>{G()},children:"Approval Required"})}):(0,i.jsx)(S.u,{label:H?"Cannot Equip while on Mission":u.map((e,t)=>(0,i.jsx)(k.x,{children:"".concat(e.action,": ").concat(e.asset.nft.id," (Asset:").concat(e.asset.assetId,")")},e.asset.assetId)),shouldWrapChildren:!0,children:(0,i.jsx)(y.z,{colorScheme:"red",onClick:()=>{P()},isLoading:R,isDisabled:H,children:"Apply"})}),(0,i.jsx)(S.u,{label:u.map(e=>(0,i.jsx)(k.x,{children:"".concat(e.action,": ").concat(e.asset.nft.id," (Asset:").concat(e.asset.assetId,")")},e.asset.assetId)),children:(0,i.jsx)(y.z,{colorScheme:"red",onClick:()=>{(0,eh.Pe)(p,z,h),h((0,eS.fi)(Math.random()))},isLoading:R,children:"Revert"})})]}),(0,i.jsx)(S.u,{className:r().rewardsTooltip,label:(0,ef.Z)(null==f?void 0:f.id,null==f?void 0:f.retrievedMetadata),placement:"auto",backgroundColor:"#1f2326",borderRadius:"7px",borderWidth:"1px",borderColor:"#fff3",shouldWrapChildren:!0,children:(0,i.jsx)(ep.r,{href:"https://singular.app/collectibles/moonbeam/".concat(null==f?void 0:f.address,"/").concat(f.tokenId),isExternal:!0,children:(0,i.jsx)(ex.J,{as:em.ocf,w:35,h:35,color:"white",position:"absolute",bottom:5,right:5,onClick:()=>{},cursor:"pointer",zIndex:101})},null==f?void 0:f.id)}),(0,i.jsx)(eb.Z,{isOpen:g,onClose:C,call:E,inProgress:R})]})});var eN=o(15277),eE=o(99484);async function eF(e){return fetch("".concat(eE.k9,"/").concat(e)).then(async e=>e.json().then(async e=>{var t;return null===(t=e.retrievedMetadata)||void 0===t?void 0:t.name}))}async function eM(e,t){let o=0,i={};e.forEach(async l=>{o+=1,await eF(l).then(n=>{i[l]=n,o===e.length&&t(i)})})}var eA=o(31406),eR=o(41941),eT=o(91750),ez=l.memo(function(e){var t;let o="CHARACTER_SHEET_WINDOW",{isOpen:n,setSoulAttributes:c}=e,{soulAttributes:u}=e,p=(0,v.I0)(),x=(0,v.v9)(e=>e.inventoryReducer.itemInHand),{height:f,width:g}=(0,I.d)(),w=(0,l.useRef)(null),_="80px",[F,A]=(0,l.useState)("UNDEFINED"),[R,T]=(0,l.useState)("Soul"),[z,D]=(0,l.useState)((0,i.jsx)(i.Fragment,{})),[L,B]=(0,l.useState)(),[H,W]=(0,l.useState)(),[O,P]=(0,l.useState)(),[U,q]=(0,l.useState)(!0),[G,Z]=(0,l.useState)(),[V,Y]=(0,l.useState)(),[$,K]=(0,l.useState)(),J=(0,l.useRef)(),[X,Q]=(0,l.useState)([]),[ee,et]=(0,l.useState)(!1),[ei,el]=(0,l.useState)(),{isOpen:en,onOpen:er,onClose:ea}=(0,b.q)(),{user:es}=(0,h.s)(),{selectedSoulNft:ec,lootNfts:eu,soulNfts:ep,equipmentRefreshSignal:ex,fetchSoulNfts:em}=(0,eo.m)(),ef=(0,v.v9)(e=>e.windowReducer.selectedMarketplaceSoul),eg=(0,v.v9)(e=>e.web3Reducer.web3Provider),[ew,eb]=(0,l.useState)(),{socket:ej}=(0,ek.s)();async function eI(){ec&&(et(!0),p((0,ey.h)({id:"unstake-"+ec.id,text:"Unstaking!",soulId:ec.id,soulMetadata:ec.retrievedMetadata})),await (0,eR.Wi)(ec,eg).then(e=>{e?(ec.isStaked=!1,p((0,eS.lZ)(void 0)),p((0,eS.fi)(Math.random())),p((0,ey.h)({id:"unstake-"+ec.id,text:"Success!",waitingTime:2500,icon:"CHECK",soulId:ec.id,soulMetadata:ec.retrievedMetadata}))):p((0,ey.h)({id:"unstake-"+ec.id,text:"Failed!",waitingTime:2500,icon:"ERROR",soulId:ec.id,soulMetadata:ec.retrievedMetadata})),et(!1)}),p((0,eS.lZ)(void 0)),em())}(0,l.useEffect)(()=>
1{if(n){q(!0);let e=new AbortController;J.current=e,ep&&eM(ep.map(e=>e.id),Z)}},[ep,n]),(0,l.useEffect)(()=>{u||(u=(0,eN.F)())},[]),(0,l.useEffect)(()=>{ef?el(ef):el(ec)},[ef,ec]),(0,l.useEffect)(()=>{(async function(){var e,t,o,i,l;!(null==ei?void 0:ei.retrievedMetadata)&&(null==ei?void 0:ei.metadataUri)&&await (0,ev.ip)(null==ei?void 0:ei.metadataUri).then(e=>{ei.retrievedMetadata=e}).catch(e=>{}),(null==ei?void 0:null===(e=ei.retrievedMetadata)||void 0===e?void 0:e.properties)&&(null==ei?void 0:null===(t=ei.retrievedMetadata)||void 0===t?void 0:t.properties["Soul Class"])&&((null==ei?void 0:null===(o=ei.retrievedMetadata)||void 0===o?void 0:o.properties["Soul Class"].value)=="Berserker"?A("Berserker"):(null==ei?void 0:null===(i=ei.retrievedMetadata)||void 0===i?void 0:i.properties["Soul Class"].value)=="Alchemist"?A("Alchemist"):(null==ei?void 0:null===(l=ei.retrievedMetadata)||void 0===l?void 0:l.properties["Soul Class"].value)=="Ranger"&&A("Ranger"))})()},[ei]),(0,l.useEffect)(()=>{c((0,eN.R)(L))},[L,x]),(0,l.useEffect)(()=>{(0,eh.YB)(B,ei,eu,null==x?void 0:x.nftAsset)},[ei,x,ex]),(0,l.useEffect)(()=>{ei&&(L?(0,eh.Rj)(ei,L).then(e=>{e&&(ei.parts=e,K(e))}):K(ei.parts))},[ei,L]),(0,l.useEffect)(()=>{ei&&L&&(0,eh.mh)(Q,ei,eu,L)},[ei,L]),(0,l.useEffect)(()=>{eg&&eE()},[ec]);let eE=(0,l.useCallback)(()=>{ec&&(console.log("GETTING ENERGY",null==ec?void 0:ec.estraTokenId),(0,eT.lb)(ec,eg).then(e=>{void 0!=e&&(console.log("ENERGY",e),eb({energy:e.availableEnergy,timeOfRefill:0==e.seconds||void 0==e.seconds?void 0:new Date(Date.now()+1e3*e.seconds)}))}))},[ec]),eF=(0,l.useCallback)(e=>{let t=(0,eC.LW)(e,!0);return"0s"===t?"Now":t=t.replace(/,\s*$/,"")},[]),ez=(0,v.v9)(e=>e.windowReducer.activeWindows);return(0,i.jsx)(i.Fragment,{children:n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(N(),{nodeRef:w,handle:".handle",children:(0,i.jsxs)(j.M,{ref:w,w:"40%",h:"600px",minW:"1104px",maxW:"1104px",position:"absolute",left:g/5,top:"75",flexDirection:"column",backgroundColor:"#000a",paddingRight:"0px",className:r().modal,zIndex:(null==ez?void 0:ez.findIndex(e=>e==o))==0?1400:402,onClick:e=>{p((0,m.u)(o))},children:[(0,i.jsx)(E,{onClose:()=>{window.dispatchEvent(new Event("storage")),p((0,m.vl)(void 0)),p((0,m.zt)(!1))}}),(0,i.jsx)(a.k,{backgroundColor:"#1F232644",w:"100%",h:"95%",children:(0,i.jsx)(a.k,{w:"100%",h:"100%",flexDirection:"column",alignContent:"flex-start",alignItems:"stretch",justifyContent:"flex-start",children:(0,i.jsx)(s.g,{h:"100%",w:"100%",children:(0,i.jsxs)(C.x,{h:"100%",w:"100%",paddingLeft:"3px",paddingRight:"3px",backgroundImage:"paper_clean.png",backgroundSize:"cover",backgroundPosition:"bottom",children:[(0,i.jsxs)(d.U,{w:"100%",h:"10%",paddingLeft:"10px",paddingRight:"10px",paddingTop:"5px",pos:"relative",children:[(0,i.jsxs)(s.g,{marginBottom:ew&&ew.timeOfRefill?"0px":"30px",children:[(0,i.jsx)(y.z,{isDisabled:!!ef||(null==ec?void 0:ec.isListed),style:{backgroundColor:"#0000",borderWidth:"2px",borderColor:ef||(null==ec?void 0:ec.isListed)?"black":"#b00b00",color:ef||(null==ec?void 0:ec.isListed)?"black":"#b00b00",fontFamily:"evrloot",fontWeight:600,textTransform:"uppercase",borderRadius:"4px",boxShadow:ef||(null==ec?void 0:ec.isListed)?"0px 0px 0px black":"1px 1px 1px black"},_hover:{backgroundColor:"#000d",color:"white"},pos:"absolute",left:6,h:"25px",onClick:()=>{er()},children:ef||(null==ec?void 0:ec.isListed)?"LISTED ON MARKET":" CLICK TO UNSTAKE"}),ew&&ew.timeOfRefill&&(0,i.jsx)(C.x,{w:"300px",marginTop:"30px",marginLeft:"19px",children:(0,i.jsx)(S.u,{label:"Equipping locked because Soul was recently on an Expedition",children:(0,i.jsxs)(k.x,{fontFamily:"Grenze",fontSize:"16px",fontWeight:"light",lineHeight:"16px",letterSpacing:"0.02em",color:"#FAC70C",children:["Equip locked for ",eF(ew.timeOfRefill)]})})})]}),(0,i.jsx)(M,{soulNft:ei})]}),(0,i.jsx)(d.U,{w:"100%",h:"90%",paddingLeft:"10px",paddingRight:"10px",paddingBottom:"5px",paddingTop:"0px",children:(null==ei?void 0:ei.collectionName.toLowerCase().includes("souls"))||(null==ei?void 0:ei.collectionName.toLowerCase().includes("citizens"))?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.g,{h:"100%",w:"45%",children:(0,i.jsx)(e_,{composedParts:$,itemSize:_,equippedAssets:L,soulClass:F,inventoryChanges:X,setInventoryChanges:Q,disabled:!!ef||(null==ec?void 0:ec.isListed)||(null==ew?void 0:e
1w.timeOfRefill)||!ew})}),(0,i.jsx)(s.g,{h:"100%",w:"55%",paddingBottom:"33px",paddingRight:"10px",children:(0,i.jsx)(ed,{selectedMarketplaceSoul:ef,tabState:R,setTabState:T,itemSize:_,equippedAssets:L,soulClass:F,soulAttributes:u,allSoulsXPDict:O,nameMap:G,localLeaderboardIsLoading:U,relics:V})})]}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(C.x,{backgroundImage:"url(".concat((0,ev.WR)(null==ei?void 0:null===(t=ei.retrievedMetadata)||void 0===t?void 0:t.image),")"),backgroundSize:"cover",borderRadius:"25px",w:"400px",h:"400px",margin:"auto",position:"relative",_hover:{transform:"scale(1.25)",transition:"transform 0.5s ease"},transition:"transform 0.5s ease"},null==ei?void 0:ei.id)})})]})})})})]})}),(0,i.jsx)(eA.Z,{isOpen:en,onClose:ea,call:eI,isStaking:ee})]}):(0,i.jsx)(i.Fragment,{})})}),eD=o(33190),eL=o(59647),eB=o(33476),eH=o(40036),eW=o(24996);function eO(){let e=(0,v.I0)(),t=(0,w.useRouter)(),{user:o,authenticated:n}=(0,h.s)(),{playMusic:b,playSFX:j}=(0,eD.Q)();(0,eo.m)();let{socket:C}=(0,ek.s)(),y=(0,v.v9)(e=>e.windowReducer.marketplaceWindow),S=(0,v.v9)(e=>e.missionsReducer.ready),k=(0,v.v9)(e=>e.windowReducer.characterSheetWindow),[I,_]=(0,l.useState)(""),[N,E]=(0,l.useState)(),{itemInHand:F,isRefreshingNfts:M,fetchSoulNfts:A}=(0,eo.m)(),{isAllReady:R,resetLoading:T}=(0,eB.r)(),{soulNfts:z}=(0,v.v9)(e=>e.inventoryReducer),{connectedWallet:D}=(0,v.v9)(e=>e.web3Reducer),L=null==D?void 0:D.address.toLowerCase();return(0,l.useEffect)(()=>{T()},[]),(0,l.useEffect)(()=>{y||e((0,m.VZ)(!0))},[y]),(0,l.useEffect)(()=>{var e;(null===(e=t.query)||void 0===e?void 0:e.mId)?_(t.query.mId):t.route.includes("marketplace")&&_("marketplace")},[t.query]),(0,l.useEffect)(()=>{b("music.trakan.city")},[]),(0,l.useEffect)(()=>{C&&(!n||(M?(0,eL.Ug)():(null==z?void 0:z.length)||((0,eL.Ug)(),A())))},[C,n,M,z]),(0,l.useEffect)(()=>{R&&L&&(0,eH.un)().then(t=>{e((0,eW.rd)(t))})},[M,L,R]),(0,i.jsxs)(a.k,{className:r().simpleBackground,flexDirection:"column",justifyContent:"flex-start",alignItems:"stretch",w:"100%",overflow:"hidden",margin:0,h:"100%",bgImage:"/backgrounds/trakan_map_pink.jpg",children:[(0,i.jsx)(c.Z,{}),(0,i.jsx)(u.w,{context:"game",showEvm:!0}),!1===S?(0,i.jsx)(p.Z,{}):(0,i.jsx)(g.Z,{tradeId:I}),(0,i.jsx)(s.g,{position:"absolute",right:"59px",top:"6px",children:(0,i.jsx)(d.U,{})}),(0,i.jsx)(x.Z,{}),F&&(0,i.jsx)(f.Z,{itemInHand:F}),k&&(0,i.jsx)(ez,{isOpen:k,soulAttributes:N,setSoulAttributes:E})]})}},24996:function(e,t,o){"use strict";o.d(t,{Ao:function(){return s},Cf:function(){return i},Hq:function(){return x},J4:function(){return n},K4:function(){return r},LF:function(){return l},SS:function(){return a},ZU:function(){return d},it:function(){return h},rd:function(){return p},tJ:function(){return u},zA:function(){return c}});let i=e=>({type:"SET_TRADES",payload:e}),l=e=>({type:"REFRESH_TRADES"}),n=e=>({type:"SHOWN_TRADE",payload:e}),r=e=>({type:"IS_LOADING",payload:e}),a=e=>({type:"SET_TRADE_NOTIFICATIONS",payload:e}),s=()=>({type:"CLEAR_WITHDRAW_ESCROW_SELECTION"}),d=e=>({type:"ADD_TO_WITHDRAW_ESCROW_SELECTION",payload:e}),c=()=>({type:"REFRESH_ORDERBOOK"}),u=e=>({type:"SET_CURRENCY_CONVERSION",payload:e}),p=e=>({type:"SET_ORDER_BOOK_ALL_ACCEPTED_ITEMS",payload:e}),x=e=>({type:"SET_ORDER_BOOK_ORDER_ITEMS",payload:e}),h=e=>({type:"SET_MY_ORDERS",payload:e})},14991:function(e){e.exports={leafletContainer:"Mission_leafletContainer__lM_o3",fullOpacity:"Mission_fullOpacity__b_HXU",pulseOpacity:"Mission_pulseOpacity__eBAQt",missions:"Mission_missions___OLWf",themetextshadow:"Mission_themetextshadow__67xTa",lowerStack:"Mission_lowerStack__Ird3d",missionSelector:"Mission_missionSelector__YDS_U",actionSelect:"Mission_actionSelect__xh6VZ",actionSelectChosen:"Mission_actionSelectChosen__0dh0O",accessories:"Mission_accessories__vxT8Y",accessoriesChosen:"Mission_accessoriesChosen__UvlwD",progressBarWrapper:"Mission_progressBarWrapper__ePVwd",progressBarContainer:"Mission_progressBarContainer__2XmoK",progressBarCompleted:"Mission_progressBarCompleted__0Iu3b",progressBarLabel:"Mission_progressBarLabel__f0F5j",button:"Mission_button__t2D2I",rewardImages:"Mission_rewardImages__cseSh",revealReward:"Mission_revealReward__TKR1c",wiggle:"Mission_wiggle__NK7oC",validSlot:"Mission_validSlot__AyEFM",assigned:"Mission_assigned__nUtfw",notAssigned:"Mission_notAssigned__32ezm",boosterN
1otAssigned:"Mission_boosterNotAssigned__8G8BY",notAssignable:"Mission_notAssignable__QQzKi",opacity:"Mission_opacity__lfp0d"}},26580:function(e){e.exports={backgroundSoulclaim:"soulcards_backgroundSoulclaim__ZGzDg",networkText:"soulcards_networkText___rPzv",networkTextSmall:"soulcards_networkTextSmall__xce_w",themetextshadow:"soulcards_themetextshadow__5w7ng",textShadow:"soulcards_textShadow__Q2Oq_",bgBoxSoulClaim:"soulcards_bgBoxSoulClaim__TvfSO",listText:"soulcards_listText__024zK",transitionSoulClaim:"soulcards_transitionSoulClaim__zC1R8",transi:"soulcards_transi__qeHOF",soulClaimButton:"soulcards_soulClaimButton__SNrS7",soulClaimModal:"soulcards_soulClaimModal__c7mc7",soulClaimModalTest:"soulcards_soulClaimModalTest__eZ4v4",soulClaimModalCentered:"soulcards_soulClaimModalCentered__HPiDc",legendaryOrange:"soulcards_legendaryOrange__hT_ic",legendaryOrangeLine:"soulcards_legendaryOrangeLine__chakw",commonWhite:"soulcards_commonWhite__tUIRg",commonWhiteLine:"soulcards_commonWhiteLine__wL3qI",rareBlue:"soulcards_rareBlue__EdSBv",rareBlueLine:"soulcards_rareBlueLine__HW6Ze",lineText:"soulcards_lineText__hcKxY",borderOrange:"soulcards_borderOrange__algxw",borderBlue:"soulcards_borderBlue__Gj3FK",borderWhite:"soulcards_borderWhite___Trop",button:"soulcards_button__IbolB",wrapperCenter:"soulcards_wrapperCenter__7kBd7",wrapperCe:"soulcards_wrapperCe__Ewg8q",wrapperScroll:"soulcards_wrapperScroll__srFKd",contentTest:"soulcards_contentTest__oumzy",innerTest:"soulcards_innerTest__oNSc1",innerTest2:"soulcards_innerTest2__EhMjI",headerTest:"soulcards_headerTest__bfogt",imgShadow:"soulcards_imgShadow__pqTjr",emptyBox:"soulcards_emptyBox__UsgFt",centeredTextBox:"soulcards_centeredTextBox__puKAu",selectedCardOpacity:"soulcards_selectedCardOpacity__KqXlx",relCon:"soulcards_relCon__q983i",buttonImg:"soulcards_buttonImg__cGsgK",infoIcon:"soulcards_infoIcon__Td8CX",stepperWrapper:"soulcards_stepperWrapper__Sx1Zx",stepperItem:"soulcards_stepperItem__Sg8Yo",stepCounter:"soulcards_stepCounter__jsH5a",ok:"soulcards_ok__VmESF",step1:"soulcards_step1__fLemW",step2:"soulcards_step2__prAsT",step3:"soulcards_step3__OToLh",step4:"soulcards_step4__rm_B_",halfcircle:"soulcards_halfcircle__vawzj",alignLeft:"soulcards_alignLeft__gr77_",tooltipSoul:"soulcards_tooltipSoul__yjvcb",crop:"soulcards_crop__QD7dB",cropNft:"soulcards_cropNft__gHrRm",boxes:"soulcards_boxes__hCPgw",blackButton:"soulcards_blackButton__GoavO",berserker:"soulcards_berserker__SBBFN",ranger:"soulcards_ranger__w0ZM_",alchemist:"soulcards_alchemist__ANMNC",bgImg:"soulcards_bgImg__oA_na",absolutePos:"soulcards_absolutePos__K7jd2",visit:"soulcards_visit__RA2U3",data:"soulcards_data__PuS3W",itemTooltip:"soulcards_itemTooltip__ma_Cf",cropp:"soulcards_cropp__tF3Ff",soulSlide:"soulcards_soulSlide__rKyyl",absolutePosLeft:"soulcards_absolutePosLeft__U7nfn",absolutePosRight:"soulcards_absolutePosRight__TvWcj",selectBox:"soulcards_selectBox__aZ8Si",fadein:"soulcards_fadein___hrf0",rareItem:"soulcards_rareItem__zJ3_t",commonItem:"soulcards_commonItem__qTKRK",epicItem:"soulcards_epicItem__nL8y0",legendaryItem:"soulcards_legendaryItem__ZlAIM",backgroundSoulSelect:"soulcards_backgroundSoulSelect__zjuHE",stakingModal:"soulcards_stakingModal__nd7Qo"}}},function(e){e.O(0,[594,845,4663,509,2196,4838,6972,1095,5409,3549,526,1193,5452,5312,8143,937,2192,4167,7286,2898,3838,4423,8509,6286,1750,2888,9774,179],function(){return e(e.s=35610)}),_N_E=e.O()}]);

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