diff --git a/build/159.js b/build/159.js index 4763ddd..1912f91 100644 --- a/build/159.js +++ b/build/159.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaoticbackup=self.webpackChunkchaoticbackup||[]).push([[159],{159:(e,t,n)=>{n.r(t),n.d(t,{default:()=>oe});var r=n(7462),a=n(1721),l=n(7294),i=n(2188),c=n(798),s=n(5977),o=n(5323),u=n(3727),m=n(2195);function g(){function e(e){e.preventDefault(),e.stopPropagation()}var t=o.Z.tribes.map((function(t,n){return l.createElement("li",{key:n,className:"dropdown"},l.createElement(u.rU,{to:" ",className:"dropbtn",onClick:e},t),l.createElement("div",{className:"dropdown-content"},l.createElement(u.rU,{to:"/portal/"+t},"All"),l.createElement(u.rU,{to:"/portal/Creatures/"+t}," Creatures"),l.createElement(u.rU,{to:"/portal/Mugic/"+t}," Mugic")))}));return l.createElement("div",{className:"navbar"},l.createElement("ul",null,l.createElement("li",null,l.createElement(u.rU,{to:"/portal/"},"Home")),l.createElement("li",null,l.createElement(u.rU,{to:"/portal/Search"},l.createElement(m.QZ,null),"Search")),l.createElement("li",{className:"dropdown"},l.createElement(u.rU,{to:" ",onClick:e,className:"dropbtn"},"Types"),l.createElement("div",{className:"dropdown-content"},l.createElement(u.rU,{to:"/portal/Attacks"},"Attacks"),l.createElement(u.rU,{to:"/portal/Battlegear"},"Battlegear"),l.createElement(u.rU,{to:"/portal/Creatures"},"Creatures"),l.createElement(u.rU,{to:"/portal/Locations"},"Locations"),l.createElement(u.rU,{to:"/portal/Mugic"},"Mugic"))),t))}var p,d,h,E,f,x,$,v,b,y,w=n(3269),Z=n(7326),k=n(3229),C=(p=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;ac&&(i=0,m++,r+1s&&(r=0,l=0,m=0))},n.render=function(){var t=n.width/o,i=n.height/u,c=e.width/2-t/2,s=e.height/2-i/2;n.context.clearRect(c,s,t,i),n.context.drawImage(a,c,s,t,i,c,s,t,i),n.context.drawImage(n.image,t*r,i*l,t,i,c,s,t,i)},n}({context:e.getContext("2d"),width:448,height:448,image:l,w_frames:7,h_frames:7,frames:47,ticksPerFrame:4}),l.addEventListener("load",(function e(){t.coin&&(window.requestAnimationFrame(e),t.coin.update(),t.coin.render())})),l.src=o.Z.base_image+"0B6oyUfwoM3u1cC1vaGVkU1J1ZzQ"}},n.render=function(){return l.createElement(l.Fragment,null,l.createElement("canvas",{ref:this.updateCanvas.bind(this),height:"600px"}))},t}(l.Component),d=(0,k.Z)(p.prototype,"coin",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),p),R=n(3050),I=n.n(R),N=n(7804),F=n(7768);function L(e,t){return e.gsx$name.toLowerCase().replace(/\(unused\)[ ]/,"")>t.gsx$name.toLowerCase().replace(/\(unused\)[ ]/,"")?1:-1}function U(e,t){var n;return["Attacks","Battlegear","Creatures","Locations","Mugic"].includes(e.gsx$type)&&(n="/portal/"+e.gsx$type+"/"+e.gsx$name),n?l.createElement("div",{key:t},l.createElement(N.vj,(0,r.Z)({as:u.rU},F.Z.link,{to:n}),e.gsx$name),l.createElement("br",null)):l.createElement("div",{key:t,style:{display:"none"}})}function _(e,t,n){var a=null;return["Attacks","Battlegear","Creatures","Locations","Mugic"].includes(e.gsx$type)&&(n||(n="/portal/"+e.gsx$type+"/"+e.gsx$name),a=o.Z.cards[e.gsx$type.toLowerCase()].findOne({gsx$name:e.gsx$name})),a&&n?l.createElement("div",{key:t,className:"nav_item"},l.createElement(N.vj,(0,r.Z)({as:u.rU,to:n},F.Z.link),l.createElement("span",null,a.gsx$name.split(",")[0].replace(/\(Unused\)[ ]/,"")),l.createElement("br",null),l.createElement("img",{className:"thumb",src:o.Z.base_image+(a.gsx$thumb?a.gsx$thumb:o.Z.thumb_missing)}))):(console.warn("missing: "+e.gsx$name),l.createElement("div",{key:t,style:{display:"none"},className:"nav_item"}))}var W,A,O,B,D,M,P,z=(0,c.f3)((function(e,t,n){return t}))($=(0,c.Pi)((v=function(e){function t(t){var n;return n=e.call(this,t)||this,(0,w.Z)(n,"input",b,(0,Z.Z)(n)),(0,w.Z)(n,"query",y,(0,Z.Z)(n)),n.search=function(e){e.preventDefault(),e.stopPropagation(),n.props.history.push("/portal/Search/?"+encodeURIComponent(n.query)),n.input=n.query},n.query=n.input=decodeURIComponent(n.props.location.search.substr(1)),n}return(0,a.Z)(t,e),t.prototype.render=function(){var e=this;return l.createElement("div",{className:"search"},l.createElement("form",{onSubmit:this.search},l.createElement("input",{type:"text",value:this.query,autoFocus:!0,onChange:function(t){return e.query=t.target.value}}),l.createElement("button",{type:"submit"},l.createElement(m.QZ,null))),l.createElement(S,{string:this.input}))},t}(l.Component),b=(0,k.Z)(v.prototype,"input",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),y=(0,k.Z)(v.prototype,"query",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$=v))||$)||$,S=(0,c.f3)((function(e,t,n){return t}))(h=(0,c.Pi)((E=function(e){function t(){var t;return t=e.call(this)||this,(0,w.Z)(t,"loaded",f,(0,Z.Z)(t)),(0,w.Z)(t,"loading",x,(0,Z.Z)(t)),t.filter=new(I())("filter.db"),t}return(0,a.Z)(t,e),t.prototype.render=function(){var e=this;if(0==this.loaded)return 0==this.loading&&(this.loading=!0,o.Z.LoadDB([{portal:"attacks"},{portal:"battlegear"},{portal:"creatures"},{portal:"locations"},{portal:"mugic"},{cards:"attacks"},{cards:"battlegear"},{cards:"creatures"},{cards:"locations"},{cards:"mugic"}]).then((function(){e.loaded=!0,e.loading=!1})).catch((function(){}))),l.createElement(m.gb,null);var t=this.props.string;if(""==t)return l.createElement("div",{style:{minHeight:"50px"}});var n=this.filter.addCollection("filter"),r=n.addDynamicView("filter");r.applySimpleSort("gsx$name");var a,i=o.Z.portal.attacks.chain(),c=o.Z.portal.battlegear.chain(),s=o.Z.portal.creatures.chain(),u=o.Z.portal.locations.chain(),g=o.Z.portal.mugic.chain();i=i.find({$or:[{gsx$attributes:{$regex:new RegExp(t,"i")}},{gsx$background:{$regex:new RegExp(t,"i")}},{gsx$details:{$regex:new RegExp(t,"i")}}]}),c=c.find({$or:[{gsx$attributes:{$regex:new RegExp(t,"i")}},{gsx$background:{$regex:new RegExp(t,"i")}},{gsx$details:{$regex:new RegExp(t,"i")}}]}),s=s.find({$or:[{gsx$appearance:{$regex:new RegExp(t,"i")}},{gsx$background:{$regex:new RegExp(t,"i")}},{gsx$specialabilities:{$regex:new RegExp(t,"i")}},{gsx$details:{$regex:new RegExp(t,"i")}}]}),u=u.find({$or:[{gsx$localfeatures:{$regex:new RegExp(t,"i")}},{gsx$background:{$regex:new RegExp(t,"i")}},{gsx$details:{$regex:new RegExp(t,"i")}}]}),g=g.find({$or:[{gsx$background:{$regex:new RegExp(t,"i")}},{gsx$details:{$regex:new RegExp(t,"i")}}]}),(a=i.data()).forEach((function(e){delete e.$loki})),n.insert(a),(a=c.data()).forEach((function(e){delete e.$loki})),n.insert(a),(a=s.data()).forEach((function(e){delete e.$loki})),n.insert(a),(a=u.data()).forEach((function(e){delete e.$loki})),n.insert(a),(a=g.data()).forEach((function(e){delete e.$loki})),n.insert(a);var p,d=r.data().map((function(e,t){return U(e,t)}));this.filter.removeCollection("filter");var h=[].concat(o.Z.portal.attacks.find({gsx$name:{$regex:new RegExp(t,"i")}}),o.Z.portal.battlegear.find({gsx$name:{$regex:new RegExp(t,"i")}}),o.Z.portal.creatures.find({gsx$name:{$regex:new RegExp(t,"i")}}),o.Z.portal.locations.find({gsx$name:{$regex:new RegExp(t,"i")}}),o.Z.portal.mugic.find({gsx$name:{$regex:new RegExp(t,"i")}}),o.Z.cards.attacks.chain().find({gsx$name:{$regex:new RegExp(t,"i")}}).where((function(e){return""!=e.gsx$splash})).data(),o.Z.cards.battlegear.chain().find({gsx$name:{$regex:new RegExp(t,"i")}}).where((function(e){return""!=e.gsx$splash})).data(),o.Z.cards.creatures.chain().find({gsx$name:{$regex:new RegExp(t,"i")}}).where((function(e){return""!=e.gsx$splash})).data(),o.Z.cards.locations.chain().find({gsx$name:{$regex:new RegExp(t,"i")}}).where((function(e){return""!=e.gsx$splash})).data(),o.Z.cards.mugic.chain().find({gsx$name:{$regex:new RegExp(t,"i")}}).where((function(e){return""!=e.gsx$splash})).data()).sort(L).filter((function(e,t,n){return 0==t||e.gsx$name!=n[t-1].gsx$name})).map((function(e,t){return _(e,t)}));if(0==d.length){var E=[].concat(o.Z.cards.attacks.chain().find({gsx$artist:{$regex:new RegExp(t,"i")}}).where((function(e){return""!=e.gsx$splash})).data(),o.Z.cards.battlegear.chain().find({gsx$artist:{$regex:new RegExp(t,"i")}}).where((function(e){return""!=e.gsx$splash})).data(),o.Z.cards.creatures.chain().find({gsx$artist:{$regex:new RegExp(t,"i")}}).where((function(e){return""!=e.gsx$splash})).data(),o.Z.cards.locations.chain().find({gsx$artist:{$regex:new RegExp(t,"i")}}).where((function(e){return""!=e.gsx$splash})).data(),o.Z.cards.mugic.chain().find({gsx$artist:{$regex:new RegExp(t,"i")}}).where((function(e){return""!=e.gsx$splash})).data()).sort((function(e,t){return e.gsx$name>t.gsx$name?1:-1})).map((function(e,t){return U(e,t)}));E.length>0?(p="Art contributed by "+t+":",d=E):p="No Results Found"}else p="Results containing "+t+":";return l.createElement("div",{className:"results"},l.createElement("hr",null),h.length>0&&l.createElement(l.Fragment,null,l.createElement("div",{className:"entry_nav"},h),l.createElement("hr",null)),l.createElement("div",null,p),d)},t}(l.Component),f=(0,k.Z)(E.prototype,"loaded",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),x=(0,k.Z)(E.prototype,"loading",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),h=E))||h)||h,q=(0,c.f3)((function(e,t,n){return t}))(W=(0,c.Pi)((A=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a=4&&o.Z.tribes.includes(c[3])?c[3]:null;g?c.length>4&&(n=!1,a=l.createElement(s.AW,{path:this.props.match.url+"/"+g+"/:card",component:this.props.component})):c.length>3&&(n=!1,a=l.createElement(s.AW,{path:this.props.match.url+"/:card",component:this.props.component})),r=g?g+" "+this.props.type:this.props.type,i=(g?o.Z.portal[t].chain().find({gsx$tribe:g}).data():o.Z.portal[t].chain().data()).sort(L).map((function(t,n){return _(t,n,g?"/portal/"+e.props.type+"/"+t.gsx$tribe+"/"+encodeURIComponent(t.gsx$name):"/portal/"+e.props.type+"/"+encodeURIComponent(t.gsx$name))}))}else c.length>3&&(n=!1,a=l.createElement(s.AW,{path:this.props.match.url+"/:card",component:this.props.component})),r=this.props.type,i=o.Z.portal[t].data.sort(L).map((function(e,t){return _(e,t)}));return n?l.createElement("div",{className:"entry "+t+" base_path"},l.createElement("div",{className:"cat_title"},r),l.createElement("div",{className:"entry_nav"},i)):l.createElement("div",{className:"entry "+t},l.createElement("div",{className:"entry_content"},a),l.createElement("div",{className:"cat_title"},l.createElement(u.rU,{to:"/portal/"+this.props.type},r)),l.createElement("div",{className:"entry_nav"},i))},t}(l.Component),O=(0,k.Z)(A.prototype,"loaded",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),B=(0,k.Z)(A.prototype,"loading",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),W=A))||W)||W;function Q(e){var t=e.name.split(",");return l.createElement(l.Fragment,null,l.createElement("span",null,t[0]),t.length>1&&l.createElement("span",{className:"bigger"},l.createElement("br",null),t[1].trim()))}function T(e){var t=[];return e.artist.split(/(?=, )/).forEach((function(e,n){t.push(l.createElement(u.rU,{key:n,to:"/portal/Search/?"+e.replace(", ","")},e))})),l.createElement("div",{className:"artist"},t)}var H,j=(0,c.f3)((function(e,t,n){return t}))(D=(0,c.Pi)((M=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a=5?decodeURIComponent(e[4]):4==e.length?decodeURIComponent(e[3]):void 0,n=o.Z.portal.creatures.findOne({gsx$name:t}),a=o.Z.cards.creatures.findOne({gsx$name:t});if(n){for(var i=n.gsx$tribe,c=[],s=0;s=0})," ",l.createElement(m.W_,{element:"air",value:a.gsx$elements.toLowerCase().indexOf("air")>=0})," ",l.createElement(m.W_,{element:"earth",value:a.gsx$elements.toLowerCase().indexOf("earth")>=0})," ",l.createElement(m.W_,{element:"water",value:a.gsx$elements.toLowerCase().indexOf("water")>=0})),l.createElement("hr",null),l.createElement("div",null,l.createElement("strong",null,"Mugic Ability: "),c)),col2:g.map((function(e,t){return l.createElement(l.Fragment,{key:t},l.createElement("div",null,l.createElement("strong",null,e[0],":"),l.createElement("br",null),e[1]),t!==g.length-1&&l.createElement("hr",null))}))})}if(a&&a.gsx$splash){for(var p=a.gsx$tribe,d=[],h=0;h=0})," ",l.createElement(m.W_,{element:"air",value:a.gsx$elements.toLowerCase().indexOf("air")>=0})," ",l.createElement(m.W_,{element:"earth",value:a.gsx$elements.toLowerCase().indexOf("earth")>=0})," ",l.createElement(m.W_,{element:"water",value:a.gsx$elements.toLowerCase().indexOf("water")>=0})),l.createElement("hr",null),l.createElement("div",null,l.createElement("strong",null,"Mugic Ability: "),d))})}return l.createElement(m.uW,{location:this.props.location})},t}(l.Component))||H)||H,ae=(0,c.f3)((function(e,t,n){return t}))(V=(0,c.Pi)(V=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.Z)(t,e),t.prototype.render=function(){var e=this.props.location.pathname.split("/");""==e[e.length-1]&&e.pop();var t=e.length>=5?decodeURIComponent(e[4]):4==e.length?decodeURIComponent(e[3]):void 0,n=o.Z.portal.mugic.findOne({gsx$name:t}),r=o.Z.cards.mugic.findOne({gsx$name:t}),a=function(e){var t=[];if(0==r.gsx$cost)t.push(l.createElement("span",{key:0},"0"));else if("x"==r.gsx$cost.toLowerCase())t.push(l.createElement("span",{key:0},"X"));else for(var n=0;n4)?l.createElement("div",{className:"entry tribe base_path"},l.createElement("div",{className:"cat_title"},r),l.createElement("div",{className:"entry_nav"},g)):l.createElement("div",{className:"entry tribe"},l.createElement("div",{className:"entry_content"},l.createElement(s.AW,{path:this.props.match.url+"/Creatures/:card",component:re}),l.createElement(s.AW,{path:this.props.match.url+"/Mugic/:card",component:ae})),l.createElement("div",{className:"cat_title"},l.createElement(u.rU,{to:"/portal/"+r},r)),l.createElement("div",{className:"entry_nav"},g))},t}(l.Component),X=(0,k.Z)(J.prototype,"loaded",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Y=(0,k.Z)(J.prototype,"loading",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),G=J))||G)||G,ie=(0,c.f3)((function(e,t,n){return t}))(K=(0,c.Pi)(K=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.Z)(t,e),t.prototype.render=function(){var e=this.props.location.pathname.split("/");if(""==e[e.length-1]&&e.pop(),4!==e.length)return l.createElement(m.uW,{location:this.props.location});var t=decodeURIComponent(e[3]),n=o.Z.portal.attacks.findOne({gsx$name:t}),r=o.Z.cards.attacks.findOne({gsx$name:t});if(n){var a=[];return n.gsx$attributes&&a.push(["Attributes",n.gsx$attributes]),n.gsx$background&&a.push(["Background",n.gsx$background]),n.gsx$details&&a.push(["Details",n.gsx$details]),l.createElement(j,{card:r,col2:a.map((function(e,t){return l.createElement(l.Fragment,{key:t},l.createElement("div",null,l.createElement("strong",null,e[0],":"),l.createElement("br",null),e[1]),t!==a.length-1&&l.createElement("hr",null))}))})}return r&&r.gsx$splash?l.createElement(j,{card:r}):l.createElement(m.uW,{location:this.props.location})},t}(l.Component))||K)||K,ce=(0,c.f3)((function(e,t,n){return t}))(ee=(0,c.Pi)(ee=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.Z)(t,e),t.prototype.render=function(){var e=this.props.location.pathname.split("/");if(""==e[e.length-1]&&e.pop(),4!==e.length)return l.createElement(m.uW,{location:this.props.location});var t=decodeURIComponent(e[3]),n=o.Z.portal.battlegear.findOne({gsx$name:t}),r=o.Z.cards.battlegear.findOne({gsx$name:t});if(n){var a=[];return n.gsx$attributes&&a.push(["Attributes",n.gsx$attributes]),n.gsx$background&&a.push(["Background",n.gsx$background]),n.gsx$details&&a.push(["Details",n.gsx$details]),l.createElement(j,{card:r,col2:a.map((function(e,t){return l.createElement(l.Fragment,{key:t},l.createElement("div",null,l.createElement("strong",null,e[0],":"),l.createElement("br",null),e[1]),t!==a.length-1&&l.createElement("hr",null))}))})}return r&&r.gsx$splash?l.createElement(j,{card:r}):l.createElement(m.uW,{location:this.props.location})},t}(l.Component))||ee)||ee,se=(0,c.f3)((function(e,t,n){return t}))(te=(0,c.Pi)(te=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.Z)(t,e),t.prototype.render=function(){var e=this.props.location.pathname.split("/");if(""==e[e.length-1]&&e.pop(),4!==e.length)return l.createElement(m.uW,{location:this.props.location});var t=decodeURIComponent(e[3]),n=o.Z.portal.locations.findOne({gsx$name:t}),r=o.Z.cards.locations.findOne({gsx$name:t});if(n){var a=[];return n.gsx$localfeatures&&a.push(["Local Features",n.gsx$localfeatures]),n.gsx$background&&a.push(["Background",n.gsx$background]),n.gsx$details&&a.push(["Details",n.gsx$details]),l.createElement(j,{card:r,col0:l.createElement(l.Fragment,null,r.gsx$initiative&&l.createElement("div",null,l.createElement("strong",null,"Initiative: "),l.createElement(m.a3,{initiative:r.gsx$initiative,notitle:"true"}))),col2:a.map((function(e,t){return l.createElement(l.Fragment,{key:t},l.createElement("div",null,l.createElement("strong",null,e[0],":"),l.createElement("br",null),e[1]),t!==a.length-1&&l.createElement("hr",null))}))})}return r&&r.gsx$splash?l.createElement(j,{card:r,col0:l.createElement(l.Fragment,null,r.gsx$initiative&&l.createElement("div",null,l.createElement("strong",null,"Initiative: "),l.createElement(m.a3,{initiative:r.gsx$initiative,notitle:"true"})))}):l.createElement(m.uW,{location:this.props.location})},t}(l.Component))||te)||te,oe=(0,c.f3)((function(e,t,n){return t}))(ne=(0,c.Pi)(ne=function(e){function t(){return e.apply(this,arguments)||this}(0,a.Z)(t,e);var n=t.prototype;return n.componentDidUpdate=function(){window.scrollTo({top:220,left:0,behavior:"smooth"})},n.render=function(){var e=this.props.match.url,t=o.Z.tribes.map((function(t,n){return l.createElement(s.AW,{key:n,path:e+"/"+t,component:le})}));return l.createElement("div",{className:"portal"},l.createElement(g,null),l.createElement(s.rs,null,l.createElement(s.AW,{exact:!0,path:e,component:C}),l.createElement(s.AW,{path:e+"/Search",component:z}),l.createElement(s.AW,{path:e+"/Attacks",render:function(e){return l.createElement(q,(0,r.Z)({},e,{type:"Attacks",component:ie}))}}),l.createElement(s.AW,{path:e+"/Battlegear",render:function(e){return l.createElement(q,(0,r.Z)({},e,{type:"Battlegear",component:ce}))}}),l.createElement(s.AW,{path:e+"/Creatures",render:function(e){return l.createElement(q,(0,r.Z)({},e,{type:"Creatures",component:re}))}}),l.createElement(s.AW,{path:e+"/Locations",render:function(e){return l.createElement(q,(0,r.Z)({},e,{type:"Locations",component:se}))}}),l.createElement(s.AW,{path:e+"/Mugic",render:function(e){return l.createElement(q,(0,r.Z)({},e,{type:"Mugic",component:ae}))}}),t))},t}(l.Component))||ne)||ne}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaoticbackup=self.webpackChunkchaoticbackup||[]).push([[159],{159:(e,t,n)=>{n.r(t),n.d(t,{default:()=>se});var r=n(7462),a=n(1721),l=n(7294),i=n(2188),c=n(798),o=n(5977),s=n(5323),u=n(3727),m=n(2195);function g(){function e(e){e.preventDefault(),e.stopPropagation()}var t=s.Z.tribes.map((function(t,n){return l.createElement("li",{key:n,className:"dropdown"},l.createElement(u.rU,{to:" ",className:"dropbtn",onClick:e},t),l.createElement("div",{className:"dropdown-content"},l.createElement(u.rU,{to:"/portal/"+t},"All"),l.createElement(u.rU,{to:"/portal/Creatures/"+t}," Creatures"),l.createElement(u.rU,{to:"/portal/Mugic/"+t}," Mugic")))}));return l.createElement("div",{className:"navbar"},l.createElement("ul",null,l.createElement("li",null,l.createElement(u.rU,{to:"/portal/"},"Home")),l.createElement("li",null,l.createElement(u.rU,{to:"/portal/Search"},l.createElement(m.QZ,null),"Search")),l.createElement("li",{className:"dropdown"},l.createElement(u.rU,{to:" ",onClick:e,className:"dropbtn"},"Types"),l.createElement("div",{className:"dropdown-content"},l.createElement(u.rU,{to:"/portal/Attacks"},"Attacks"),l.createElement(u.rU,{to:"/portal/Battlegear"},"Battlegear"),l.createElement(u.rU,{to:"/portal/Creatures"},"Creatures"),l.createElement(u.rU,{to:"/portal/Locations"},"Locations"),l.createElement(u.rU,{to:"/portal/Mugic"},"Mugic"))),t))}var p,d,h,E,f,x,$,v,b,y,w=n(3269),Z=n(7326),k=n(3229),C=(p=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;ac&&(i=0,m++,r+1o&&(r=0,l=0,m=0))},n.render=function(){var t=n.width/s,i=n.height/u,c=e.width/2-t/2,o=e.height/2-i/2;n.context.clearRect(c,o,t,i),n.context.drawImage(a,c,o,t,i,c,o,t,i),n.context.drawImage(n.image,t*r,i*l,t,i,c,o,t,i)},n}({context:e.getContext("2d"),width:448,height:448,image:l,w_frames:7,h_frames:7,frames:47,ticksPerFrame:4}),l.addEventListener("load",(function e(){t.coin&&(window.requestAnimationFrame(e),t.coin.update(),t.coin.render())})),l.src=s.Z.base_image+"0B6oyUfwoM3u1cC1vaGVkU1J1ZzQ"}},n.render=function(){return l.createElement(l.Fragment,null,l.createElement("canvas",{ref:this.updateCanvas.bind(this),height:"600px"}))},t}(l.Component),d=(0,k.Z)(p.prototype,"coin",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),p),F=n(3050),R=n.n(F),I=n(7804),N=n(7768);function L(e,t){return e.gsx$name.toLowerCase().replace(/\(unused\)[ ]/,"")>t.gsx$name.toLowerCase().replace(/\(unused\)[ ]/,"")?1:-1}function U(e,t){var n;return["Attacks","Battlegear","Creatures","Locations","Mugic"].includes(e.gsx$type)&&(n="/portal/"+e.gsx$type+"/"+e.gsx$name),n?l.createElement("div",{key:t},l.createElement(I.vj,(0,r.Z)({as:u.rU},N.Z.link,{to:n}),e.gsx$name),l.createElement("br",null)):l.createElement("div",{key:t,style:{display:"none"}})}function W(e,t,n){var a=null;return["Attacks","Battlegear","Creatures","Locations","Mugic"].includes(e.gsx$type)&&(n||(n="/portal/"+e.gsx$type+"/"+e.gsx$name),a=s.Z.cards[e.gsx$type.toLowerCase()].findOne({gsx$name:e.gsx$name})),a&&n?l.createElement("div",{key:t,className:"nav_item"},l.createElement(I.vj,(0,r.Z)({as:u.rU,to:n},N.Z.link),l.createElement("span",null,a.gsx$name.split(",")[0].replace(/\(Unused\)[ ]/,"")),l.createElement("br",null),l.createElement("img",{className:"thumb",src:s.Z.base_image+(a.gsx$thumb?a.gsx$thumb:s.Z.thumb_missing)}))):(console.warn("missing: "+e.gsx$name),l.createElement("div",{key:t,style:{display:"none"},className:"nav_item"}))}var _,A,O,B,D,M,P,z=(0,c.f3)((function(e,t,n){return t}))($=(0,c.Pi)((v=function(e){function t(t){var n;return n=e.call(this,t)||this,(0,w.Z)(n,"input",b,(0,Z.Z)(n)),(0,w.Z)(n,"query",y,(0,Z.Z)(n)),n.search=function(e){e.preventDefault(),e.stopPropagation(),n.props.history.push("/portal/Search/?"+encodeURIComponent(n.query)),n.input=n.query},n.query=n.input=decodeURIComponent(n.props.location.search.substr(1)),n}return(0,a.Z)(t,e),t.prototype.render=function(){var e=this;return l.createElement("div",{className:"search"},l.createElement("form",{onSubmit:this.search},l.createElement("input",{type:"text",value:this.query,autoFocus:!0,onChange:function(t){return e.query=t.target.value}}),l.createElement("button",{type:"submit"},l.createElement(m.QZ,null))),l.createElement(S,{string:this.input}))},t}(l.Component),b=(0,k.Z)(v.prototype,"input",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),y=(0,k.Z)(v.prototype,"query",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$=v))||$)||$,S=(0,c.f3)((function(e,t,n){return t}))(h=(0,c.Pi)((E=function(e){function t(){var t;return t=e.call(this)||this,(0,w.Z)(t,"loaded",f,(0,Z.Z)(t)),(0,w.Z)(t,"loading",x,(0,Z.Z)(t)),t.filter=new(R())("filter.db"),t}return(0,a.Z)(t,e),t.prototype.render=function(){var e=this;if(0==this.loaded)return 0==this.loading&&(this.loading=!0,s.Z.LoadDB([{portal:"attacks"},{portal:"battlegear"},{portal:"creatures"},{portal:"locations"},{portal:"mugic"},{cards:"attacks"},{cards:"battlegear"},{cards:"creatures"},{cards:"locations"},{cards:"mugic"}]).then((function(){e.loaded=!0,e.loading=!1})).catch((function(){}))),l.createElement(m.gb,null);var t=this.props.string;if(""==t)return l.createElement("div",{style:{minHeight:"50px"}});var n=this.filter.addCollection("filter"),r=n.addDynamicView("filter");r.applySimpleSort("gsx$name");var a,i=s.Z.portal.attacks.chain(),c=s.Z.portal.battlegear.chain(),o=s.Z.portal.creatures.chain(),u=s.Z.portal.locations.chain(),g=s.Z.portal.mugic.chain();i=i.find({$or:[{gsx$attributes:{$regex:new RegExp(t,"i")}},{gsx$background:{$regex:new RegExp(t,"i")}},{gsx$details:{$regex:new RegExp(t,"i")}}]}),c=c.find({$or:[{gsx$attributes:{$regex:new RegExp(t,"i")}},{gsx$background:{$regex:new RegExp(t,"i")}},{gsx$details:{$regex:new RegExp(t,"i")}}]}),o=o.find({$or:[{gsx$appearance:{$regex:new RegExp(t,"i")}},{gsx$background:{$regex:new RegExp(t,"i")}},{gsx$specialabilities:{$regex:new RegExp(t,"i")}},{gsx$details:{$regex:new RegExp(t,"i")}}]}),u=u.find({$or:[{gsx$localfeatures:{$regex:new RegExp(t,"i")}},{gsx$background:{$regex:new RegExp(t,"i")}},{gsx$details:{$regex:new RegExp(t,"i")}}]}),g=g.find({$or:[{gsx$background:{$regex:new RegExp(t,"i")}},{gsx$details:{$regex:new RegExp(t,"i")}}]}),(a=i.data()).forEach((function(e){delete e.$loki})),n.insert(a),(a=c.data()).forEach((function(e){delete e.$loki})),n.insert(a),(a=o.data()).forEach((function(e){delete e.$loki})),n.insert(a),(a=u.data()).forEach((function(e){delete e.$loki})),n.insert(a),(a=g.data()).forEach((function(e){delete e.$loki})),n.insert(a);var p,d=r.data().map((function(e,t){return U(e,t)}));this.filter.removeCollection("filter");var h=[].concat(s.Z.portal.attacks.find({gsx$name:{$regex:new RegExp(t,"i")}}),s.Z.portal.battlegear.find({gsx$name:{$regex:new RegExp(t,"i")}}),s.Z.portal.creatures.find({gsx$name:{$regex:new RegExp(t,"i")}}),s.Z.portal.locations.find({gsx$name:{$regex:new RegExp(t,"i")}}),s.Z.portal.mugic.find({gsx$name:{$regex:new RegExp(t,"i")}}),s.Z.cards.attacks.chain().find({gsx$name:{$regex:new RegExp(t,"i")}}).where(s.Z.hasFullart).data(),s.Z.cards.battlegear.chain().find({gsx$name:{$regex:new RegExp(t,"i")}}).where(s.Z.hasFullart).data(),s.Z.cards.creatures.chain().find({gsx$name:{$regex:new RegExp(t,"i")}}).where(s.Z.hasFullart).data(),s.Z.cards.locations.chain().find({gsx$name:{$regex:new RegExp(t,"i")}}).where(s.Z.hasFullart).data(),s.Z.cards.mugic.chain().find({gsx$name:{$regex:new RegExp(t,"i")}}).where(s.Z.hasFullart).data()).sort(L).filter((function(e,t,n){return 0==t||e.gsx$name!=n[t-1].gsx$name})).map((function(e,t){return W(e,t)}));if(0==d.length){var E=[].concat(s.Z.cards.attacks.chain().find({gsx$artist:{$regex:new RegExp(t,"i")}}).where(s.Z.hasFullart).data(),s.Z.cards.battlegear.chain().find({gsx$artist:{$regex:new RegExp(t,"i")}}).where(s.Z.hasFullart).data(),s.Z.cards.creatures.chain().find({gsx$artist:{$regex:new RegExp(t,"i")}}).where(s.Z.hasFullart).data(),s.Z.cards.locations.chain().find({gsx$artist:{$regex:new RegExp(t,"i")}}).where(s.Z.hasFullart).data(),s.Z.cards.mugic.chain().find({gsx$artist:{$regex:new RegExp(t,"i")}}).where(s.Z.hasFullart).data()).sort((function(e,t){return e.gsx$name>t.gsx$name?1:-1})).map((function(e,t){return U(e,t)}));E.length>0?(p="Art contributed by "+t+":",d=E):p="No Results Found"}else p="Results containing "+t+":";return l.createElement("div",{className:"results"},l.createElement("hr",null),h.length>0&&l.createElement(l.Fragment,null,l.createElement("div",{className:"entry_nav"},h),l.createElement("hr",null)),l.createElement("div",null,p),d)},t}(l.Component),f=(0,k.Z)(E.prototype,"loaded",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),x=(0,k.Z)(E.prototype,"loading",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),h=E))||h)||h,q=(0,c.f3)((function(e,t,n){return t}))(_=(0,c.Pi)((A=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a=4&&s.Z.tribes.includes(c[3])?c[3]:null;g?c.length>4&&(n=!1,a=l.createElement(o.AW,{path:this.props.match.url+"/"+g+"/:card",component:this.props.component})):c.length>3&&(n=!1,a=l.createElement(o.AW,{path:this.props.match.url+"/:card",component:this.props.component})),r=g?g+" "+this.props.type:this.props.type,i=(g?s.Z.portal[t].chain().find({gsx$tribe:g}).data():s.Z.portal[t].chain().data()).sort(L).map((function(t,n){return W(t,n,g?"/portal/"+e.props.type+"/"+t.gsx$tribe+"/"+encodeURIComponent(t.gsx$name):"/portal/"+e.props.type+"/"+encodeURIComponent(t.gsx$name))}))}else c.length>3&&(n=!1,a=l.createElement(o.AW,{path:this.props.match.url+"/:card",component:this.props.component})),r=this.props.type,i=s.Z.portal[t].data.sort(L).map((function(e,t){return W(e,t)}));return n?l.createElement("div",{className:"entry "+t+" base_path"},l.createElement("div",{className:"cat_title"},r),l.createElement("div",{className:"entry_nav"},i)):l.createElement("div",{className:"entry "+t},l.createElement("div",{className:"entry_content"},a),l.createElement("div",{className:"cat_title"},l.createElement(u.rU,{to:"/portal/"+this.props.type},r)),l.createElement("div",{className:"entry_nav"},i))},t}(l.Component),O=(0,k.Z)(A.prototype,"loaded",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),B=(0,k.Z)(A.prototype,"loading",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),_=A))||_)||_;function Q(e){var t=e.name.split(",");return l.createElement(l.Fragment,null,l.createElement("span",null,t[0]),t.length>1&&l.createElement("span",{className:"bigger"},l.createElement("br",null),t[1].trim()))}function T(e){var t=[];return e.artist.split(/(?=, )/).forEach((function(e,n){t.push(l.createElement(u.rU,{key:n,to:"/portal/Search/?"+e.replace(", ","")},e))})),l.createElement("div",{className:"artist"},t)}var H,j=(0,c.f3)((function(e,t,n){return t}))(D=(0,c.Pi)((M=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a=5?decodeURIComponent(e[4]):4==e.length?decodeURIComponent(e[3]):void 0,n=s.Z.portal.creatures.findOne({gsx$name:t}),a=s.Z.cards.creatures.findOne({gsx$name:t});if(n){for(var i=n.gsx$tribe,c=[],o=0;o=0})," ",l.createElement(m.W_,{element:"air",value:a.gsx$elements.toLowerCase().indexOf("air")>=0})," ",l.createElement(m.W_,{element:"earth",value:a.gsx$elements.toLowerCase().indexOf("earth")>=0})," ",l.createElement(m.W_,{element:"water",value:a.gsx$elements.toLowerCase().indexOf("water")>=0})),l.createElement("hr",null),l.createElement("div",null,l.createElement("strong",null,"Mugic Ability: "),c)),col2:g.map((function(e,t){return l.createElement(l.Fragment,{key:t},l.createElement("div",null,l.createElement("strong",null,e[0],":"),l.createElement("br",null),e[1]),t!==g.length-1&&l.createElement("hr",null))}))})}if(a&&s.Z.hasFullart(a)){for(var p=a.gsx$tribe,d=[],h=0;h=0})," ",l.createElement(m.W_,{element:"air",value:a.gsx$elements.toLowerCase().indexOf("air")>=0})," ",l.createElement(m.W_,{element:"earth",value:a.gsx$elements.toLowerCase().indexOf("earth")>=0})," ",l.createElement(m.W_,{element:"water",value:a.gsx$elements.toLowerCase().indexOf("water")>=0})),l.createElement("hr",null),l.createElement("div",null,l.createElement("strong",null,"Mugic Ability: "),d))})}return l.createElement(m.uW,{location:this.props.location})},t}(l.Component))||H)||H,ae=(0,c.f3)((function(e,t,n){return t}))(V=(0,c.Pi)(V=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.Z)(t,e),t.prototype.render=function(){var e=this.props.location.pathname.split("/");""==e[e.length-1]&&e.pop();var t=e.length>=5?decodeURIComponent(e[4]):4==e.length?decodeURIComponent(e[3]):void 0,n=s.Z.portal.mugic.findOne({gsx$name:t}),r=s.Z.cards.mugic.findOne({gsx$name:t}),a=function(e){var t=[];if(0==r.gsx$cost)t.push(l.createElement("span",{key:0},"0"));else if("x"==r.gsx$cost.toLowerCase())t.push(l.createElement("span",{key:0},"X"));else for(var n=0;n4)?l.createElement("div",{className:"entry tribe base_path"},l.createElement("div",{className:"cat_title"},r),l.createElement("div",{className:"entry_nav"},g)):l.createElement("div",{className:"entry tribe"},l.createElement("div",{className:"entry_content"},l.createElement(o.AW,{path:this.props.match.url+"/Creatures/:card",component:re}),l.createElement(o.AW,{path:this.props.match.url+"/Mugic/:card",component:ae})),l.createElement("div",{className:"cat_title"},l.createElement(u.rU,{to:"/portal/"+r},r)),l.createElement("div",{className:"entry_nav"},g))},t}(l.Component),X=(0,k.Z)(J.prototype,"loaded",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Y=(0,k.Z)(J.prototype,"loading",[i.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),G=J))||G)||G,ie=(0,c.f3)((function(e,t,n){return t}))(K=(0,c.Pi)(K=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.Z)(t,e),t.prototype.render=function(){var e=this.props.location.pathname.split("/");if(""==e[e.length-1]&&e.pop(),4!==e.length)return l.createElement(m.uW,{location:this.props.location});var t=decodeURIComponent(e[3]),n=s.Z.portal.attacks.findOne({gsx$name:t}),r=s.Z.cards.attacks.findOne({gsx$name:t});if(n){var a=[];return n.gsx$attributes&&a.push(["Attributes",n.gsx$attributes]),n.gsx$background&&a.push(["Background",n.gsx$background]),n.gsx$details&&a.push(["Details",n.gsx$details]),l.createElement(j,{card:r,col2:a.map((function(e,t){return l.createElement(l.Fragment,{key:t},l.createElement("div",null,l.createElement("strong",null,e[0],":"),l.createElement("br",null),e[1]),t!==a.length-1&&l.createElement("hr",null))}))})}return r&&s.Z.hasFullart(r)?l.createElement(j,{card:r}):l.createElement(m.uW,{location:this.props.location})},t}(l.Component))||K)||K,ce=(0,c.f3)((function(e,t,n){return t}))(ee=(0,c.Pi)(ee=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.Z)(t,e),t.prototype.render=function(){var e=this.props.location.pathname.split("/");if(""==e[e.length-1]&&e.pop(),4!==e.length)return l.createElement(m.uW,{location:this.props.location});var t=decodeURIComponent(e[3]),n=s.Z.portal.battlegear.findOne({gsx$name:t}),r=s.Z.cards.battlegear.findOne({gsx$name:t});if(n){var a=[];return n.gsx$attributes&&a.push(["Attributes",n.gsx$attributes]),n.gsx$background&&a.push(["Background",n.gsx$background]),n.gsx$details&&a.push(["Details",n.gsx$details]),l.createElement(j,{card:r,col2:a.map((function(e,t){return l.createElement(l.Fragment,{key:t},l.createElement("div",null,l.createElement("strong",null,e[0],":"),l.createElement("br",null),e[1]),t!==a.length-1&&l.createElement("hr",null))}))})}return r&&s.Z.hasFullart(r)?l.createElement(j,{card:r}):l.createElement(m.uW,{location:this.props.location})},t}(l.Component))||ee)||ee,oe=(0,c.f3)((function(e,t,n){return t}))(te=(0,c.Pi)(te=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.Z)(t,e),t.prototype.render=function(){var e=this.props.location.pathname.split("/");if(""==e[e.length-1]&&e.pop(),4!==e.length)return l.createElement(m.uW,{location:this.props.location});var t=decodeURIComponent(e[3]),n=s.Z.portal.locations.findOne({gsx$name:t}),r=s.Z.cards.locations.findOne({gsx$name:t});if(n){var a=[];return n.gsx$localfeatures&&a.push(["Local Features",n.gsx$localfeatures]),n.gsx$background&&a.push(["Background",n.gsx$background]),n.gsx$details&&a.push(["Details",n.gsx$details]),l.createElement(j,{card:r,col0:l.createElement(l.Fragment,null,r.gsx$initiative&&l.createElement("div",null,l.createElement("strong",null,"Initiative: "),l.createElement(m.a3,{initiative:r.gsx$initiative,notitle:"true"}))),col2:a.map((function(e,t){return l.createElement(l.Fragment,{key:t},l.createElement("div",null,l.createElement("strong",null,e[0],":"),l.createElement("br",null),e[1]),t!==a.length-1&&l.createElement("hr",null))}))})}return r&&s.Z.hasFullart(r)?l.createElement(j,{card:r,col0:l.createElement(l.Fragment,null,r.gsx$initiative&&l.createElement("div",null,l.createElement("strong",null,"Initiative: "),l.createElement(m.a3,{initiative:r.gsx$initiative,notitle:"true"})))}):l.createElement(m.uW,{location:this.props.location})},t}(l.Component))||te)||te,se=(0,c.f3)((function(e,t,n){return t}))(ne=(0,c.Pi)(ne=function(e){function t(){return e.apply(this,arguments)||this}(0,a.Z)(t,e);var n=t.prototype;return n.componentDidUpdate=function(){window.scrollTo({top:220,left:0,behavior:"smooth"})},n.render=function(){var e=this.props.match.url,t=s.Z.tribes.map((function(t,n){return l.createElement(o.AW,{key:n,path:e+"/"+t,component:le})}));return l.createElement("div",{className:"portal"},l.createElement(g,null),l.createElement(o.rs,null,l.createElement(o.AW,{exact:!0,path:e,component:C}),l.createElement(o.AW,{path:e+"/Search",component:z}),l.createElement(o.AW,{path:e+"/Attacks",render:function(e){return l.createElement(q,(0,r.Z)({},e,{type:"Attacks",component:ie}))}}),l.createElement(o.AW,{path:e+"/Battlegear",render:function(e){return l.createElement(q,(0,r.Z)({},e,{type:"Battlegear",component:ce}))}}),l.createElement(o.AW,{path:e+"/Creatures",render:function(e){return l.createElement(q,(0,r.Z)({},e,{type:"Creatures",component:re}))}}),l.createElement(o.AW,{path:e+"/Locations",render:function(e){return l.createElement(q,(0,r.Z)({},e,{type:"Locations",component:oe}))}}),l.createElement(o.AW,{path:e+"/Mugic",render:function(e){return l.createElement(q,(0,r.Z)({},e,{type:"Mugic",component:ae}))}}),t))},t}(l.Component))||ne)||ne}}]); \ No newline at end of file diff --git a/build/main.js b/build/main.js index 999df83..77c5b9b 100644 --- a/build/main.js +++ b/build/main.js @@ -1 +1 @@ -(()=>{var e,t,n,r,a,i={2195:(e,t,n)=>{"use strict";n.d(t,{$U:()=>h,dR:()=>E,At:()=>b,I1:()=>d,U9:()=>B,W_:()=>m,Q$:()=>g,a3:()=>l,gb:()=>N,_t:()=>v,WC:()=>u,VG:()=>s,uW:()=>A,uq:()=>y,QZ:()=>k,Fo:()=>p,Ky:()=>w,kp:()=>i});var r=n(7294),a=n(7768);function i(e){var t="";return e.data.unique&&(t+="Unique, "),e.data.loyal&&(t+="Loyal","M'arrillian"==e.data.tribe&&(t+=" - M'arrillians or Minions"),"1"!=e.data.loyal&&(t+=" - "+e.data.loyal)),e.data.legendary&&(t=t?"Legendary, "+t:"Legendary"),""===(t=t.replace(/,\s+$/,""))?r.createElement(r.Fragment,null):r.createElement("div",{style:{fontWeight:"Bold"}},t)}function l(e){var t=e.initiative,n=null;return["Danian","Generic","Mipedian","OverWorld","UnderWorld","M'arrillian"].indexOf(t)>-1?n=r.createElement("img",{className:"icon16",style:{verticalAlign:"middle"},src:("/public/img/icons/tribes/"+t+".png").toLowerCase()}):["courage","power","speed","wisdom"].indexOf(t.toLowerCase())>-1?n=r.createElement("img",{className:"icon16",style:{verticalAlign:"middle"},src:("/public/img/icons/disciplines/"+t+".png").toLowerCase()}):["fire","air","earth","water"].indexOf(t.toLowerCase())>-1?n=r.createElement("img",{className:"icon16",style:{verticalAlign:"middle"},src:("/public/img/icons/elements/"+t+".png").toLowerCase()}):"mugic counter"==t.toLowerCase()&&(n=r.createElement("img",{className:"icon16",style:{verticalAlign:"middle"},src:"/public/img/icons/mugic/generic.png".toLowerCase()})),r.createElement("span",null,!e.notitle&&"Initiative: ",n," ",t)}var c=n(5934),o=n.n(c);function s(e){var t=e.name.split(",");return r.createElement("div",null,r.createElement("span",{className:"name"},r.createElement("span",{className:"bigger"},t[0]),t.length>1&&r.createElement(r.Fragment,null,r.createElement("span",{style:{opacity:"0"}},","),r.createElement("span",{className:"subname"},t[1]))))}function u(e){var t=("/public/img/icons/mugic/"+((e.tribe||"generic")+(null!=e.amount?"_"+e.amount:""))+".png").toLowerCase();return r.createElement("img",{className:e.size||"icon20",src:t,alt:"MC"})}function m(e){return e.value?r.createElement("img",{className:e.size||"icon20",src:("/public/img/icons/elements/"+e.element+".png").toLowerCase()}):r.createElement("img",{className:e.size||"icon20",src:("/public/img/icons/elements/"+e.element+"-inactive.png").toLowerCase()})}function p(e){return r.createElement("img",{className:e.size||"icon16",src:("/public/img/icons/tribes/"+e.tribe+".png").toLowerCase()})}function d(e){return r.createElement("img",{className:e.size||"icon16",src:("/public/img/icons/disciplines/"+e.discipline+".png").toLowerCase()})}function g(e){var t=e.flavortext;return t?r.createElement("div",{className:"flavortext"},t):r.createElement(r.Fragment,null)}function h(e){var t=[{regex:/([0-9x]*){{mc}}/i,fn:function(t,n){return n.length>1&&""!=n[1]?r.createElement(u,{key:t,tribe:e.tribe,amount:n[1].toLowerCase(),size:"icon14"}):r.createElement(u,{key:t,tribe:e.tribe,size:"icon14"})}},{regex:new RegExp(/(\b((fire)|(air)|(earth)|(water)))/i),fn:function(e,t){return r.createElement("span",{key:e},r.createElement(m,{element:t[0].replace(/\b/,""),value:"true",size:"icon14"}),t[0])}},{regex:/(courage)|(power)|(wisdom)|(speed)/i,fn:function(e,t){return r.createElement("span",{key:e},r.createElement(d,{discipline:t[0],size:"icon14"}),t[0])}},{regex:/(danian)|(generic)|(mipedian)|(overworld)|(underworld)|(m'arrillian)/i,fn:function(e,t){return r.createElement("span",{key:e},r.createElement(p,{tribe:t[0],size:"icon14"}),t[0])}}];return r.createElement("div",{className:e.type||"ability"},o()(t)(e.ability))}var f=n(5323);function E(e){var t="attack"+(e.bp&&e.bp>=0?"_"+e.bp:"");return r.createElement("img",{className:e.size||"icon16",src:"/public/img/icons/attack/"+t+".png"})}function b(e){return r.createElement("img",{className:e.size||"icon16",src:"/public/img/icons/battlegear.png"})}function v(e){return r.createElement("img",{className:e.size||"icon16",src:"/public/img/icons/location.png"})}function y(e){var t=e.set,n=e.rarity,a=e.iconOnly,i=void 0!==a&&a;return r.createElement("span",null,"PE1"!==t&&r.createElement("img",{className:e.size||"icon16",style:{verticalAlign:"middle"},src:("/public/img/icons/set/"+t+"/"+n+".png").toLowerCase()}),!i&&r.createElement(r.Fragment,null,f.Z.sets[e.set]," | ",e.rarity))}function w(e){return r.createElement("p",{style:a.Z.p},"This page is currently under construction")}function A(e){return r.createElement("p",{style:a.Z.p},"404 route not found - ",a.Z.code(e.location.pathname))}function N(e){return r.createElement("span",null,"Loading...")}function B(e){return r.createElement("form",{action:"https://www.paypal.com/cgi-bin/webscr",method:"post",target:"_blank"},r.createElement("input",{type:"hidden",name:"cmd",value:"_s-xclick"}),r.createElement("input",{type:"hidden",name:"encrypted",value:"-----BEGIN PKCS7-----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-----END PKCS7-----"}),r.createElement("a",{href:"https://www.paypal.com/cgi-bin/webscr"},r.createElement("input",{type:"image",src:"/public/img/btn_donate_SM.gif",border:"0",name:"submit",alt:"PayPal Donate"})))}function k(e){return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",className:"magnifying-glass"},r.createElement("g",{fillRule:"evenodd"},r.createElement("path",{d:"M21.747 20.524l-4.872-4.871a.864.864 0 1 0-1.222 1.222l4.871 4.872a.864.864 0 1 0 1.223-1.223z"}),r.createElement("path",{d:"M3.848 10.763a6.915 6.915 0 0 1 6.915-6.915 6.915 6.915 0 0 1 6.915 6.915 6.915 6.915 0 0 1-6.915 6.915 6.915 6.915 0 0 1-6.915-6.915zm-1.729 0a8.643 8.643 0 0 0 8.644 8.644 8.643 8.643 0 0 0 8.644-8.644 8.643 8.643 0 0 0-8.644-8.644 8.643 8.643 0 0 0-8.644 8.644z"})))}},5323:(e,t,n)=>{"use strict";n.d(t,{Z:()=>k});var r,a,i=n(5861),l=n(3269),c=n(3144),o=n(3229),s=n(7757),u=n.n(s),m=(n(7147),n(2188)),p=n(3050),d=n.n(p),g=new(n(9585).Z),h=(r=function(){function e(e,t){var n=this;(0,l.Z)(this,"building",a,this),this.purgeDB=function(){["attacks","battlegear","creatures","locations","mugic"].forEach((function(e){n.db.removeCollection(e)})),n.db.saveDatabase()},this.api=e,this.format=t,this.setupDB(t)}var t=e.prototype;return t.setupType=function(){var e=(0,i.Z)(u().mark((function e(t,n,r){var a,l,c,o,s=this;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.building.hasOwnProperty(t)){e.next=22;break}if(a=t.charAt(0).toUpperCase()+t.slice(1),"built"!=(l=this.building[t].get())){e.next=7;break}return e.abrupt("return",this.api.getSpreadsheetTime(this.api.urls[a][this.format]).then((function(e){var a=g.get(s.format+"_"+t);return a?new Date(e)>new Date(a)?(s[t].clear(),s.building[t].set("setup"),s.setupType(t,n,r)):n():(g.set(s.format+"_"+t,e,{path:"/"}),n())})).catch((function(){return n()})));case 7:if("building"!=l){e.next=12;break}return c=(0,m.N7)(this.building[t],(function(e){c(),n()})),e.abrupt("return",c);case 12:if("setup"!=l){e.next=20;break}if(0!=this[t].data.length){e.next=18;break}return this.building[t].set("building"),e.abrupt("return",this.api.parseSpreadsheetData(this.api.urls[a][this.format],a,!0).then(function(){var e=(0,i.Z)(u().mark((function e(r){var i;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s[t].insert(r),s.building[t].set("built"),e.prev=2,e.next=5,s.api.getSpreadsheetTime(s.api.urls[a][s.format]);case 5:i=e.sent,g.set(s.format+"_"+t,i,{path:"/"}),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(2);case 11:return e.abrupt("return",n());case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}()).catch((function(){return r()})));case 18:return this.building[t].set("built"),e.abrupt("return",n());case 20:e.next=25;break;case 22:return this.building[t]=m.LO.box("wait"),o=(0,m.N7)(this.building[t],(function(){return o(),s.setupType(t,n)})),e.abrupt("return",o);case 25:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),t.setupDB=function(e){var t=new(d())("chaotic_"+e+".db",{autosave:!0,autoload:!0,autoloadCallback:function(){var e=this;["attacks","battlegear","creatures","locations","mugic"].forEach((function(n){var r=t.getCollection(n);null===r||0===r.data.length?(e[n]=t.addCollection(n),e.building[n]?e.building[n].set("setup"):e.building[n]=m.LO.box("setup")):(e[n]=r,e.building[n]?e.building[n].set("built"):e.building[n]=m.LO.box("built"))}))}.bind(this),autosaveInterval:4e3,persistenceMethod:"localStorage"});this.db=t},e}(),a=(0,o.Z)(r.prototype,"building",[m.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),(0,o.Z)(r.prototype,"setupType",[m.aD],Object.getOwnPropertyDescriptor(r.prototype,"setupType"),r.prototype),(0,o.Z)(r.prototype,"setupDB",[m.aD],Object.getOwnPropertyDescriptor(r.prototype,"setupDB"),r.prototype),r);const f=h,E=JSON.parse('[{"type":"Creatures","subtype":"cards","url":"1fUFYhG1NLLkSTzrdbevm6ZMKNP6xLiKUZvM1sY10pVI"},{"type":"Creatures","subtype":"portal","url":"1eGQsy2kYk7HfnQetsjobMqank4bg6iWOOaSYykg3Yec"},{"type":"Mugic","subtype":"cards","url":"1rOMFKnWaz6XmhD43YFpcemWGzEok9IgtKCoiPMwA35s"},{"type":"Mugic","subtype":"portal","url":"1tEuwPGixJH2A03YtYL6Ar-MSFvtfrlaveT98GwJhw1g"},{"type":"Attacks","subtype":"cards","url":"1yXFijC2hN1vybU3ejdINYoTOTG62qCkpPLPsiYUEEyo"},{"type":"Attacks","subtype":"portal","url":"1KUk5J-3ZeMlEBXOfDb2h4GUUJK_0_yOq0EUDitQgNa8"},{"type":"Battlegear","subtype":"cards","url":"1UUEPAEHZwmH52AJj2Jtskf6d4z5XIFEBb3HT-FTAcgs"},{"type":"Battlegear","subtype":"portal","url":"1S5AVw-E_sFO257uzajauP31bOI0LPmrbTcUzSpa2i60"},{"type":"Locations","subtype":"cards","url":"15QPS08iq6pkyMFsYuDsKIXX8LQmQ8MUoJeeNtjU54Xo"},{"type":"Locations","subtype":"portal","url":"1U07n2keHNxL-6y5zUcHlb220zT9A_MrVEansOAMQFCA"}]');var b,v,y,w,A,N;function B(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=null),t<0?Promise.reject(n):e().catch((function(n){return B(e,t-1,n)}))}const k=(N=A=function(){function e(){(0,l.Z)(this,"portal",v,this),(0,l.Z)(this,"cards",y,this),(0,l.Z)(this,"urls",w,this);try{var e={};E.forEach((function(t){var n=t.type,r=t.subtype,a=t.url;e[n]||(e[n]={}),e[n][r]=a})),this.urls=e,this.portal=new f(this,"portal"),this.cards=new f(this,"cards")}catch(e){this.portal=null,this.cards=null,this.urls=null,console.error("setting up database failed",e)}}e.getInstance=function(){return e.instance||(e.instance=new e),e.instance};var t=e.prototype;return t.path=function(e){return"https://sheets.googleapis.com/v4/spreadsheets/"+e+"/values/Sheet1?key="+this.key},t.getSpreadsheetTime=function(){var e=(0,i.Z)(u().mark((function e(t){var n,r,a;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="https://content.googleapis.com/drive/v3/files/"+t+"?fields=modifiedTime&key="+this.key,e.next=3,fetch(n);case 3:if(200!==(r=e.sent).status){e.next=10;break}return e.next=7,r.json();case 7:if(!("modifiedTime"in(a=e.sent))){e.next=10;break}return e.abrupt("return",Promise.resolve(a.modifiedTime));case 10:return e.abrupt("return",Promise.reject());case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getSpreadsheetData=function(){var e=(0,i.Z)(u().mark((function e(t,n){var r,a;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===n&&(n=!1),r=this.path(t),a=function(){var e=(0,i.Z)(u().mark((function e(){var t,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(r);case 2:if(404!==(t=e.sent).status){e.next=5;break}throw new Error("Can't Open File");case 5:return e.prev=5,e.next=8,t.json();case 8:return n=e.sent,e.abrupt("return",n.values);case 12:throw e.prev=12,e.t0=e.catch(5),new Error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[5,12]])})));return function(){return e.apply(this,arguments)}}(),e.abrupt("return",B(a,n?3:0));case 4:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t.parseSpreadsheetData=function(){var e=(0,i.Z)(u().mark((function e(t,n,r){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===r&&(r=!1),e.abrupt("return",this.getSpreadsheetData(t,r).then((function(e){if(e.length<2)return[];var t=e.shift().map((function(e){return e.toLowerCase().replace(" ","")}));return e.map((function(e){for(var r={gsx$type:n},a=0;a{"use strict";var r,a=n(7294),i=n(3935),l=n(3727),c=n(5977),o=n(684),s=n(5323),u=n(2195),m=n(1721),p=n(798),d=(0,p.f3)((function(e,t,n){return t}))(r=(0,p.Pi)(r=function(e){function t(){return e.apply(this,arguments)||this}return(0,m.Z)(t,e),t.prototype.render=function(){return a.createElement("div",null,a.createElement("span",null,"This page is not yet available"))},t}(a.Component))||r)||r,g=(0,o.ZP)((function(){return Promise.all([n.e(736),n.e(631)]).then(n.bind(n,631))}),{fallback:a.createElement(u.gb,null)}),h=(0,o.ZP)((function(){return n.e(640).then(n.bind(n,8640))}),{fallback:a.createElement(u.gb,null)}),f=(0,o.ZP)((function(){return Promise.all([n.e(736),n.e(159)]).then(n.bind(n,159))}),{fallback:a.createElement(u.gb,null)}),E=(0,o.ZP)((function(){return Promise.all([n.e(736),n.e(510)]).then(n.bind(n,7510))}),{fallback:a.createElement(u.gb,null)});function b(){return a.createElement(c.rs,null,a.createElement(c.AW,{path:"/beta/collection",component:E}),a.createElement(c.AW,{path:"/beta"},(function(e){var t=e.location;return a.createElement(c.l_,{to:t.pathname.replace("/beta","")})})),a.createElement(c.AW,{component:v}))}function v(){return a.createElement(c.rs,null,a.createElement(c.AW,{exact:!0,path:"/",component:h}),a.createElement(c.AW,{path:"/PageNotFound",component:u.uW}),a.createElement(c.AW,{path:"/UnderConstruction",component:u.Ky}),a.createElement(c.AW,{path:"/EnterTheCode",component:g}),a.createElement(c.AW,{path:"/create",component:d}),a.createElement(c.AW,{path:"/collection",component:E}),a.createElement(c.AW,{path:"/portal",component:f}))}function y(e){var t="ENG",n=a.createElement(b,null);return a.createElement(a.Fragment,null,a.createElement("div",{className:"fix-pgBkgrnd-repeat-x"},a.createElement("div",{className:"fix-img-bkgrnd fix-img-bkgrnd_05"})),a.createElement("div",{className:"pgBkgrnd-repeat-x"},a.createElement("div",{className:"img-bkgrnd"},a.createElement("div",{className:"content-wrap"},a.createElement("div",{className:"legacy legacy-header"},a.createElement("div",{className:"header"},a.createElement("div",{id:"nav"},a.createElement("div",{className:"zero-clear-line headerSpriteNav-wrap"},a.createElement("ul",{id:"unity-sprite",className:t},a.createElement("li",{id:"unity-nav1",className:t}),a.createElement("li",{id:"unity-nav2",className:t},a.createElement(l.rU,{to:"/collection/"},a.createElement("span",null,"Collect"))),a.createElement("li",{id:"unity-nav3",className:t},a.createElement("a",{href:"https://chaoticbackup.forumotion.com/f11-deck-building"},a.createElement("span",null,"Build"))),a.createElement("li",{id:"unity-nav4",className:t},a.createElement("a",{href:"https://chaoticbackup.forumotion.com/f16-trading-buying-and-selling"},a.createElement("span",null,"Trade"))),a.createElement("li",{id:"unity-nav5",className:t},a.createElement(l.rU,{to:"/"},a.createElement("span",null,"Home"))),a.createElement("li",{id:"unity-nav6",className:t},a.createElement("a",{href:"https://chaoticbackup.forumotion.com"},a.createElement("span",null,"Forums"))),a.createElement("li",{id:"unity-nav7",className:t},a.createElement(l.rU,{to:"/portal/"},a.createElement("span",null,"Portal"))),a.createElement("li",{id:"unity-nav8",className:t},a.createElement("a",{href:"https://chaoticrecode.com"},a.createElement("span",null,"Play"))),a.createElement("li",{id:"unity-nav9",className:t})),a.createElement("ul",{id:"unityETC-sprite",className:t},a.createElement("li",{id:"unity-nav10",className:t},a.createElement(l.rU,{to:"/EnterTheCode"},a.createElement("span",null,"Enter the Code")))))))),a.createElement("div",{className:"banner-ad-top"}),a.createElement("div",{className:"legacy content"},a.createElement("div",{className:"left-column"},a.createElement("div",{className:"full-width clear-line",style:{marginBottom:"5px"}})),a.createElement("div",{className:"full-column"},a.createElement("div",{className:"pods-wrap pad5px-btm"},a.createElement("div",{className:"clear-line full-width"},a.createElement("div",{className:"adPod-top-wrap"},a.createElement("div",{className:"videoAdPod-topleft"},a.createElement("div",{className:"videoAdPod-topLeft-repeat-x"})),a.createElement("div",{className:"videoAdPod-topright"},a.createElement("div",{className:"videoAdPod-topRight-repeat-x"})))),a.createElement("div",{className:"content-area-repeat-xy"},a.createElement("div",{className:"content-area-top-repeat-x"},a.createElement("div",{className:"content-area-left-repeat-y"},a.createElement("div",{className:"content-area-right-repeat-y"},a.createElement("div",{className:"content-area-inner-space"},a.createElement("div",{id:"player"},n)))))),a.createElement("div",{className:"content-btm-wrap"},a.createElement("div",{className:"content-area-btm-left"},a.createElement("div",{className:"content-left-btm-repeat-x"})),a.createElement("div",{className:"content-area-btm-right"},a.createElement("div",{className:"content-right-btm-repeat-x"}))))),a.createElement("div",{className:"right-column"},a.createElement("div",{className:"full-width clear-line",style:{marginBottom:"5px"}}))),a.createElement("div",{className:"banner-ad-bottom"}),a.createElement("div",{className:"legacy legacy-footer"},a.createElement("div",{className:"footer-wrap"},a.createElement("div",{className:"footer-repeat-x"},a.createElement("div",{className:"footer-left"},a.createElement("div",{className:"footer-right"},a.createElement("div",{className:"footer-text"},a.createElement("div",{className:"footer-search"},a.createElement("br",null),a.createElement("br",null),a.createElement(u.U9,null)),a.createElement("div",{className:"footer-nav"},a.createElement("div",{className:"copyright"},"©2008 Chaotic USA Entertainment Group, Inc.",a.createElement("br",null),"U.S. Pat 5810666 and 5954332 and other pending patent applications. All Rights Reserved.")),a.createElement("div",{className:"footer-language"},a.createElement("a",{href:"#",onClick:function(e){e.stopPropagation(),e.preventDefault(),s.Z.purgeDB()},className:"page-options",title:"Change Language"},a.createElement("img",{src:"/public/img/flag_usa_.gif",alt:"English (Change Language)",width:"40",height:"27"}),a.createElement("br",null),"English (Change Language)"))))))))))))}(0,i.render)(a.createElement(l.VK,null,a.createElement(y,{path:"/*",href:"/"})),document.getElementById("root"))},7768:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(5403),a=Object.create(r.Z);a.root={backgroundColor:"#F0F0F0",fontFamily:"helvetica neue, helvetica, sans-serif",fontWeight:"300",fontSize:"16px",letterSpacing:"0.025em",padding:"3vh 0 12vh 0",width:"500px",maxWidth:"calc(100vw - 40px)",position:"relative",left:"50vw",WebkitTransform:"translate(-50%, 0)",MozTransform:"translate(-50%, 0)",msTransform:"translate(-50%, 0)",OTransform:"translate(-50%, 0)",transform:"translate(-50%, 0)",WebkitTextSizeAdjust:"none",MozTextSizeAdjust:"none",msTextSizeAdjust:"none",textSizeAdjust:"none"},a.title={fontSize:"20px",marginBottom:"0.5vh"};const i=a},5403:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(7462),a=n(7294),i={normal:{borderBottom:"1px dotted rgb(66, 140, 195)"},hover:{borderBottom:"1px solid rgb(66, 140, 195)",color:"rgb(66, 140, 195)"},active:"hover",touchActive:{borderBottom:"1px dashed rgb(66, 140, 195)",color:"rgb(66, 140, 195)"},focusFromTab:{outline:"2px solid rgb(0, 152, 0)",outlineOffset:"2px",color:"black"},touchActiveTapOnly:!0},l={};Object.keys(i).forEach((function(e){"touchActiveTapOnly"!==e&&(l["onParent"+e.slice(0,1).toUpperCase()+e.slice(1)]=i[e])}));const c={link:i,childLink:l,p:{margin:"3vh 0",lineHeight:"1.4"},code:function(e){return a.createElement("code",{style:{fontFamily:"monospace",fontSize:"15px",paddingLeft:"2px"}},e)},li:function(e,t){return a.createElement("li",(0,r.Z)({style:{paddingLeft:"18px",textIndent:"-15px",margin:"0.5vh 0",listStyle:"none"}},t),a.createElement("span",{style:{paddingRight:"7px"}},"–"),e)}}},693:()=>{}},l={};function c(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return i[e].call(n.exports,n,n.exports,c),n.exports}c.m=i,e=[],c.O=(t,n,r,a)=>{if(!n){var i=1/0;for(u=0;u=a)&&Object.keys(c.O).every((e=>c.O[e](n[o])))?n.splice(o--,1):(l=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[n,r,a]},c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},c.d=(e,t)=>{for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce(((t,n)=>(c.f[n](e,t),t)),[])),c.u=e=>e+".js",c.miniCssF=e=>e+".css",c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},n="chaoticbackup:",c.l=(e,r,a,i)=>{if(t[e])t[e].push(r);else{var l,o;if(void 0!==a)for(var s=document.getElementsByTagName("script"),u=0;u{l.onerror=l.onload=null,clearTimeout(d);var a=t[e];if(delete t[e],l.parentNode&&l.parentNode.removeChild(l),a&&a.forEach((e=>e(r))),n)return n(r)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=p.bind(null,l.onerror),l.onload=p.bind(null,l.onload),o&&document.head.appendChild(l)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.p="/build/",r=e=>new Promise(((t,n)=>{var r=c.miniCssF(e),a=c.p+r;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),r=0;r{var a=document.createElement("link");a.rel="stylesheet",a.type="text/css",a.onerror=a.onload=i=>{if(a.onerror=a.onload=null,"load"===i.type)n();else{var l=i&&("load"===i.type?"missing":i.type),c=i&&i.target&&i.target.href||t,o=new Error("Loading CSS chunk "+e+" failed.\n("+c+")");o.code="CSS_CHUNK_LOAD_FAILED",o.type=l,o.request=c,a.parentNode.removeChild(a),r(o)}},a.href=t,document.head.appendChild(a)})(e,a,t,n)})),a={179:0},c.f.miniCss=(e,t)=>{a[e]?t.push(a[e]):0!==a[e]&&{159:1,510:1,631:1,640:1}[e]&&t.push(a[e]=r(e).then((()=>{a[e]=0}),(t=>{throw delete a[e],t})))},(()=>{var e={179:0};c.f.j=(t,n)=>{var r=c.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var a=new Promise(((n,a)=>r=e[t]=[n,a]));n.push(r[2]=a);var i=c.p+c.u(t),l=new Error;c.l(i,(n=>{if(c.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var a=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",l.name="ChunkLoadError",l.type=a,l.request=i,r[1](l)}}),"chunk-"+t,t)}},c.O.j=t=>0===e[t];var t=(t,n)=>{var r,a,[i,l,o]=n,s=0;if(i.some((t=>0!==e[t]))){for(r in l)c.o(l,r)&&(c.m[r]=l[r]);if(o)var u=o(c)}for(t&&t(n);sc(6981)));var o=c.O(void 0,[736],(()=>c(8953)));o=c.O(o)})(); \ No newline at end of file +(()=>{var e,t,n,r,a,i={2195:(e,t,n)=>{"use strict";n.d(t,{$U:()=>h,dR:()=>b,At:()=>E,I1:()=>d,U9:()=>B,W_:()=>m,Q$:()=>g,a3:()=>l,gb:()=>x,_t:()=>v,WC:()=>u,VG:()=>o,uW:()=>A,uq:()=>y,QZ:()=>N,Fo:()=>p,Ky:()=>w,kp:()=>i});var r=n(7294),a=n(7768);function i(e){var t="";return e.data.unique&&(t+="Unique, "),e.data.loyal&&(t+="Loyal","M'arrillian"==e.data.tribe&&(t+=" - M'arrillians or Minions"),"1"!=e.data.loyal&&(t+=" - "+e.data.loyal)),e.data.legendary&&(t=t?"Legendary, "+t:"Legendary"),""===(t=t.replace(/,\s+$/,""))?r.createElement(r.Fragment,null):r.createElement("div",{style:{fontWeight:"Bold"}},t)}function l(e){var t=e.initiative,n=null;return["Danian","Generic","Mipedian","OverWorld","UnderWorld","M'arrillian"].indexOf(t)>-1?n=r.createElement("img",{className:"icon16",style:{verticalAlign:"middle"},src:("/public/img/icons/tribes/"+t+".png").toLowerCase()}):["courage","power","speed","wisdom"].indexOf(t.toLowerCase())>-1?n=r.createElement("img",{className:"icon16",style:{verticalAlign:"middle"},src:("/public/img/icons/disciplines/"+t+".png").toLowerCase()}):["fire","air","earth","water"].indexOf(t.toLowerCase())>-1?n=r.createElement("img",{className:"icon16",style:{verticalAlign:"middle"},src:("/public/img/icons/elements/"+t+".png").toLowerCase()}):"mugic counter"==t.toLowerCase()&&(n=r.createElement("img",{className:"icon16",style:{verticalAlign:"middle"},src:"/public/img/icons/mugic/generic.png".toLowerCase()})),r.createElement("span",null,!e.notitle&&"Initiative: ",n," ",t)}var c=n(5934),s=n.n(c);function o(e){var t=e.name.split(",");return r.createElement("div",null,r.createElement("span",{className:"name"},r.createElement("span",{className:"bigger"},t[0]),t.length>1&&r.createElement(r.Fragment,null,r.createElement("span",{style:{opacity:"0"}},","),r.createElement("span",{className:"subname"},t[1]))))}function u(e){var t=("/public/img/icons/mugic/"+((e.tribe||"generic")+(null!=e.amount?"_"+e.amount:""))+".png").toLowerCase();return r.createElement("img",{className:e.size||"icon20",src:t,alt:"MC"})}function m(e){return e.value?r.createElement("img",{className:e.size||"icon20",src:("/public/img/icons/elements/"+e.element+".png").toLowerCase()}):r.createElement("img",{className:e.size||"icon20",src:("/public/img/icons/elements/"+e.element+"-inactive.png").toLowerCase()})}function p(e){return r.createElement("img",{className:e.size||"icon16",src:("/public/img/icons/tribes/"+e.tribe+".png").toLowerCase()})}function d(e){return r.createElement("img",{className:e.size||"icon16",src:("/public/img/icons/disciplines/"+e.discipline+".png").toLowerCase()})}function g(e){var t=e.flavortext;return t?r.createElement("div",{className:"flavortext"},t):r.createElement(r.Fragment,null)}function h(e){var t=[{regex:/([0-9x]*){{mc}}/i,fn:function(t,n){return n.length>1&&""!=n[1]?r.createElement(u,{key:t,tribe:e.tribe,amount:n[1].toLowerCase(),size:"icon14"}):r.createElement(u,{key:t,tribe:e.tribe,size:"icon14"})}},{regex:new RegExp(/(\b((fire)|(air)|(earth)|(water)))/i),fn:function(e,t){return r.createElement("span",{key:e},r.createElement(m,{element:t[0].replace(/\b/,""),value:"true",size:"icon14"}),t[0])}},{regex:/(courage)|(power)|(wisdom)|(speed)/i,fn:function(e,t){return r.createElement("span",{key:e},r.createElement(d,{discipline:t[0],size:"icon14"}),t[0])}},{regex:/(danian)|(generic)|(mipedian)|(overworld)|(underworld)|(m'arrillian)/i,fn:function(e,t){return r.createElement("span",{key:e},r.createElement(p,{tribe:t[0],size:"icon14"}),t[0])}}];return r.createElement("div",{className:e.type||"ability"},s()(t)(e.ability))}var f=n(5323);function b(e){var t="attack"+(e.bp&&e.bp>=0?"_"+e.bp:"");return r.createElement("img",{className:e.size||"icon16",src:"/public/img/icons/attack/"+t+".png"})}function E(e){return r.createElement("img",{className:e.size||"icon16",src:"/public/img/icons/battlegear.png"})}function v(e){return r.createElement("img",{className:e.size||"icon16",src:"/public/img/icons/location.png"})}function y(e){var t=e.set,n=e.rarity,a=e.iconOnly,i=void 0!==a&&a;return r.createElement("span",null,"PE1"!==t&&r.createElement("img",{className:e.size||"icon16",style:{verticalAlign:"middle"},src:("/public/img/icons/set/"+t+"/"+n+".png").toLowerCase()}),!i&&r.createElement(r.Fragment,null,f.Z.sets[e.set]," | ",e.rarity))}function w(e){return r.createElement("p",{style:a.Z.p},"This page is currently under construction")}function A(e){return r.createElement("p",{style:a.Z.p},"404 route not found - ",a.Z.code(e.location.pathname))}function x(e){return r.createElement("span",null,"Loading...")}function B(e){return r.createElement("form",{action:"https://www.paypal.com/cgi-bin/webscr",method:"post",target:"_blank"},r.createElement("input",{type:"hidden",name:"cmd",value:"_s-xclick"}),r.createElement("input",{type:"hidden",name:"encrypted",value:"-----BEGIN PKCS7-----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-----END PKCS7-----"}),r.createElement("a",{href:"https://www.paypal.com/cgi-bin/webscr"},r.createElement("input",{type:"image",src:"/public/img/btn_donate_SM.gif",border:"0",name:"submit",alt:"PayPal Donate"})))}function N(e){return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",className:"magnifying-glass"},r.createElement("g",{fillRule:"evenodd"},r.createElement("path",{d:"M21.747 20.524l-4.872-4.871a.864.864 0 1 0-1.222 1.222l4.871 4.872a.864.864 0 1 0 1.223-1.223z"}),r.createElement("path",{d:"M3.848 10.763a6.915 6.915 0 0 1 6.915-6.915 6.915 6.915 0 0 1 6.915 6.915 6.915 6.915 0 0 1-6.915 6.915 6.915 6.915 0 0 1-6.915-6.915zm-1.729 0a8.643 8.643 0 0 0 8.644 8.644 8.643 8.643 0 0 0 8.644-8.644 8.643 8.643 0 0 0-8.644-8.644 8.643 8.643 0 0 0-8.644 8.644z"})))}},5323:(e,t,n)=>{"use strict";n.d(t,{Z:()=>N});var r,a,i=n(5861),l=n(3269),c=n(3144),s=n(3229),o=n(7757),u=n.n(o),m=(n(7147),n(2188)),p=n(3050),d=n.n(p),g=new(n(9585).Z),h=(r=function(){function e(e,t){var n=this;(0,l.Z)(this,"building",a,this),this.purgeDB=function(){["attacks","battlegear","creatures","locations","mugic"].forEach((function(e){n.db.removeCollection(e)})),n.db.saveDatabase()},this.api=e,this.format=t,this.setupDB(t)}var t=e.prototype;return t.setupType=function(){var e=(0,i.Z)(u().mark((function e(t,n,r){var a,l,c,s,o=this;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.building.hasOwnProperty(t)){e.next=22;break}if(a=t.charAt(0).toUpperCase()+t.slice(1),"built"!=(l=this.building[t].get())){e.next=7;break}return e.abrupt("return",this.api.getSpreadsheetTime(this.api.urls[a][this.format]).then((function(e){var a=g.get(o.format+"_"+t);return a?new Date(e)>new Date(a)?(o[t].clear(),o.building[t].set("setup"),o.setupType(t,n,r)):n():(g.set(o.format+"_"+t,e,{path:"/"}),n())})).catch((function(){return n()})));case 7:if("building"!=l){e.next=12;break}return c=(0,m.N7)(this.building[t],(function(e){c(),n()})),e.abrupt("return",c);case 12:if("setup"!=l){e.next=20;break}if(0!=this[t].data.length){e.next=18;break}return this.building[t].set("building"),e.abrupt("return",this.api.parseSpreadsheetData(this.api.urls[a][this.format],a,!0).then(function(){var e=(0,i.Z)(u().mark((function e(r){var i;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o[t].insert(r),o.building[t].set("built"),e.prev=2,e.next=5,o.api.getSpreadsheetTime(o.api.urls[a][o.format]);case 5:i=e.sent,g.set(o.format+"_"+t,i,{path:"/"}),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(2);case 11:return e.abrupt("return",n());case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}()).catch((function(){return r()})));case 18:return this.building[t].set("built"),e.abrupt("return",n());case 20:e.next=25;break;case 22:return this.building[t]=m.LO.box("wait"),s=(0,m.N7)(this.building[t],(function(){return s(),o.setupType(t,n)})),e.abrupt("return",s);case 25:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),t.setupDB=function(e){var t=new(d())("chaotic_"+e+".db",{autosave:!0,autoload:!0,autoloadCallback:function(){var e=this;["attacks","battlegear","creatures","locations","mugic"].forEach((function(n){var r=t.getCollection(n);null===r||0===r.data.length?(e[n]=t.addCollection(n),e.building[n]?e.building[n].set("setup"):e.building[n]=m.LO.box("setup")):(e[n]=r,e.building[n]?e.building[n].set("built"):e.building[n]=m.LO.box("built"))}))}.bind(this),autosaveInterval:4e3,persistenceMethod:"localStorage"});this.db=t},e}(),a=(0,s.Z)(r.prototype,"building",[m.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),(0,s.Z)(r.prototype,"setupType",[m.aD],Object.getOwnPropertyDescriptor(r.prototype,"setupType"),r.prototype),(0,s.Z)(r.prototype,"setupDB",[m.aD],Object.getOwnPropertyDescriptor(r.prototype,"setupDB"),r.prototype),r);const f=h,b=JSON.parse('[{"type":"Creatures","subtype":"cards","url":"1fUFYhG1NLLkSTzrdbevm6ZMKNP6xLiKUZvM1sY10pVI"},{"type":"Creatures","subtype":"portal","url":"1eGQsy2kYk7HfnQetsjobMqank4bg6iWOOaSYykg3Yec"},{"type":"Mugic","subtype":"cards","url":"1rOMFKnWaz6XmhD43YFpcemWGzEok9IgtKCoiPMwA35s"},{"type":"Mugic","subtype":"portal","url":"1tEuwPGixJH2A03YtYL6Ar-MSFvtfrlaveT98GwJhw1g"},{"type":"Attacks","subtype":"cards","url":"1yXFijC2hN1vybU3ejdINYoTOTG62qCkpPLPsiYUEEyo"},{"type":"Attacks","subtype":"portal","url":"1KUk5J-3ZeMlEBXOfDb2h4GUUJK_0_yOq0EUDitQgNa8"},{"type":"Battlegear","subtype":"cards","url":"1UUEPAEHZwmH52AJj2Jtskf6d4z5XIFEBb3HT-FTAcgs"},{"type":"Battlegear","subtype":"portal","url":"1S5AVw-E_sFO257uzajauP31bOI0LPmrbTcUzSpa2i60"},{"type":"Locations","subtype":"cards","url":"15QPS08iq6pkyMFsYuDsKIXX8LQmQ8MUoJeeNtjU54Xo"},{"type":"Locations","subtype":"portal","url":"1U07n2keHNxL-6y5zUcHlb220zT9A_MrVEansOAMQFCA"}]');var E,v,y,w,A,x;function B(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=null),t<0?Promise.reject(n):e().catch((function(n){return B(e,t-1,n)}))}const N=(x=A=function(){function e(){var e=this;(0,l.Z)(this,"portal",v,this),(0,l.Z)(this,"cards",y,this),(0,l.Z)(this,"urls",w,this),this.hasFullart=function(e){return Boolean(void 0!==e.gsx$if&&""!==e.gsx$if)||Boolean(void 0!==e.gsx$splash&&""!==e.gsx$splash)||Boolean(void 0!==e.gsx$alt&&""!==e.gsx$alt)},this.cardFullart=function(t){return t.gsx$if&&""!==t.gsx$if?t.gsx$if:t.gsx$splash&&""!==t.gsx$splash?e.base_image+t.gsx$splash:t.gsx$alt?t.gsx$alt:e.card_back};try{var t={};b.forEach((function(e){var n=e.type,r=e.subtype,a=e.url;t[n]||(t[n]={}),t[n][r]=a})),this.urls=t,this.portal=new f(this,"portal"),this.cards=new f(this,"cards")}catch(e){this.portal=null,this.cards=null,this.urls=null,console.error("setting up database failed",e)}}e.getInstance=function(){return e.instance||(e.instance=new e),e.instance};var t=e.prototype;return t.path=function(e){return"https://sheets.googleapis.com/v4/spreadsheets/"+e+"/values/Sheet1?key="+this.key},t.getSpreadsheetTime=function(){var e=(0,i.Z)(u().mark((function e(t){var n,r,a;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="https://content.googleapis.com/drive/v3/files/"+t+"?fields=modifiedTime&key="+this.key,e.next=3,fetch(n);case 3:if(200!==(r=e.sent).status){e.next=10;break}return e.next=7,r.json();case 7:if(!("modifiedTime"in(a=e.sent))){e.next=10;break}return e.abrupt("return",Promise.resolve(a.modifiedTime));case 10:return e.abrupt("return",Promise.reject());case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getSpreadsheetData=function(){var e=(0,i.Z)(u().mark((function e(t,n){var r,a;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===n&&(n=!1),r=this.path(t),a=function(){var e=(0,i.Z)(u().mark((function e(){var t,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(r);case 2:if(404!==(t=e.sent).status){e.next=5;break}throw new Error("Can't Open File");case 5:return e.prev=5,e.next=8,t.json();case 8:return n=e.sent,e.abrupt("return",n.values);case 12:throw e.prev=12,e.t0=e.catch(5),new Error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[5,12]])})));return function(){return e.apply(this,arguments)}}(),e.abrupt("return",B(a,n?3:0));case 4:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t.parseSpreadsheetData=function(){var e=(0,i.Z)(u().mark((function e(t,n,r){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===r&&(r=!1),e.abrupt("return",this.getSpreadsheetData(t,r).then((function(e){if(e.length<2)return[];var t=e.shift().map((function(e){return e.toLowerCase().replace(" ","")}));return e.map((function(e){for(var r={gsx$type:n},a=0;a{"use strict";var r,a=n(7294),i=n(3935),l=n(3727),c=n(5977),s=n(684),o=n(5323),u=n(2195),m=n(1721),p=n(798),d=(0,p.f3)((function(e,t,n){return t}))(r=(0,p.Pi)(r=function(e){function t(){return e.apply(this,arguments)||this}return(0,m.Z)(t,e),t.prototype.render=function(){return a.createElement("div",null,a.createElement("span",null,"This page is not yet available"))},t}(a.Component))||r)||r,g=(0,s.ZP)((function(){return Promise.all([n.e(736),n.e(631)]).then(n.bind(n,631))}),{fallback:a.createElement(u.gb,null)}),h=(0,s.ZP)((function(){return n.e(640).then(n.bind(n,8640))}),{fallback:a.createElement(u.gb,null)}),f=(0,s.ZP)((function(){return Promise.all([n.e(736),n.e(159)]).then(n.bind(n,159))}),{fallback:a.createElement(u.gb,null)}),b=(0,s.ZP)((function(){return Promise.all([n.e(736),n.e(510)]).then(n.bind(n,7510))}),{fallback:a.createElement(u.gb,null)});function E(){return a.createElement(c.rs,null,a.createElement(c.AW,{path:"/beta/collection",component:b}),a.createElement(c.AW,{path:"/beta"},(function(e){var t=e.location;return a.createElement(c.l_,{to:t.pathname.replace("/beta","")})})),a.createElement(c.AW,{component:v}))}function v(){return a.createElement(c.rs,null,a.createElement(c.AW,{exact:!0,path:"/",component:h}),a.createElement(c.AW,{path:"/PageNotFound",component:u.uW}),a.createElement(c.AW,{path:"/UnderConstruction",component:u.Ky}),a.createElement(c.AW,{path:"/EnterTheCode",component:g}),a.createElement(c.AW,{path:"/create",component:d}),a.createElement(c.AW,{path:"/collection",component:b}),a.createElement(c.AW,{path:"/portal",component:f}))}function y(e){var t="ENG",n=a.createElement(E,null);return a.createElement(a.Fragment,null,a.createElement("div",{className:"fix-pgBkgrnd-repeat-x"},a.createElement("div",{className:"fix-img-bkgrnd fix-img-bkgrnd_05"})),a.createElement("div",{className:"pgBkgrnd-repeat-x"},a.createElement("div",{className:"img-bkgrnd"},a.createElement("div",{className:"content-wrap"},a.createElement("div",{className:"legacy legacy-header"},a.createElement("div",{className:"header"},a.createElement("div",{id:"nav"},a.createElement("div",{className:"zero-clear-line headerSpriteNav-wrap"},a.createElement("ul",{id:"unity-sprite",className:t},a.createElement("li",{id:"unity-nav1",className:t}),a.createElement("li",{id:"unity-nav2",className:t},a.createElement(l.rU,{to:"/collection/"},a.createElement("span",null,"Collect"))),a.createElement("li",{id:"unity-nav3",className:t},a.createElement("a",{href:"https://chaoticbackup.forumotion.com/f11-deck-building"},a.createElement("span",null,"Build"))),a.createElement("li",{id:"unity-nav4",className:t},a.createElement("a",{href:"https://chaoticbackup.forumotion.com/f16-trading-buying-and-selling"},a.createElement("span",null,"Trade"))),a.createElement("li",{id:"unity-nav5",className:t},a.createElement(l.rU,{to:"/"},a.createElement("span",null,"Home"))),a.createElement("li",{id:"unity-nav6",className:t},a.createElement("a",{href:"https://chaoticbackup.forumotion.com"},a.createElement("span",null,"Forums"))),a.createElement("li",{id:"unity-nav7",className:t},a.createElement(l.rU,{to:"/portal/"},a.createElement("span",null,"Portal"))),a.createElement("li",{id:"unity-nav8",className:t},a.createElement("a",{href:"https://chaoticrecode.com"},a.createElement("span",null,"Play"))),a.createElement("li",{id:"unity-nav9",className:t})),a.createElement("ul",{id:"unityETC-sprite",className:t},a.createElement("li",{id:"unity-nav10",className:t},a.createElement(l.rU,{to:"/EnterTheCode"},a.createElement("span",null,"Enter the Code")))))))),a.createElement("div",{className:"banner-ad-top"}),a.createElement("div",{className:"legacy content"},a.createElement("div",{className:"left-column"},a.createElement("div",{className:"full-width clear-line",style:{marginBottom:"5px"}})),a.createElement("div",{className:"full-column"},a.createElement("div",{className:"pods-wrap pad5px-btm"},a.createElement("div",{className:"clear-line full-width"},a.createElement("div",{className:"adPod-top-wrap"},a.createElement("div",{className:"videoAdPod-topleft"},a.createElement("div",{className:"videoAdPod-topLeft-repeat-x"})),a.createElement("div",{className:"videoAdPod-topright"},a.createElement("div",{className:"videoAdPod-topRight-repeat-x"})))),a.createElement("div",{className:"content-area-repeat-xy"},a.createElement("div",{className:"content-area-top-repeat-x"},a.createElement("div",{className:"content-area-left-repeat-y"},a.createElement("div",{className:"content-area-right-repeat-y"},a.createElement("div",{className:"content-area-inner-space"},a.createElement("div",{id:"player"},n)))))),a.createElement("div",{className:"content-btm-wrap"},a.createElement("div",{className:"content-area-btm-left"},a.createElement("div",{className:"content-left-btm-repeat-x"})),a.createElement("div",{className:"content-area-btm-right"},a.createElement("div",{className:"content-right-btm-repeat-x"}))))),a.createElement("div",{className:"right-column"},a.createElement("div",{className:"full-width clear-line",style:{marginBottom:"5px"}}))),a.createElement("div",{className:"banner-ad-bottom"}),a.createElement("div",{className:"legacy legacy-footer"},a.createElement("div",{className:"footer-wrap"},a.createElement("div",{className:"footer-repeat-x"},a.createElement("div",{className:"footer-left"},a.createElement("div",{className:"footer-right"},a.createElement("div",{className:"footer-text"},a.createElement("div",{className:"footer-search"},a.createElement("br",null),a.createElement("br",null),a.createElement(u.U9,null)),a.createElement("div",{className:"footer-nav"},a.createElement("div",{className:"copyright"},"©2008 Chaotic USA Entertainment Group, Inc.",a.createElement("br",null),"U.S. Pat 5810666 and 5954332 and other pending patent applications. All Rights Reserved.")),a.createElement("div",{className:"footer-language"},a.createElement("a",{href:"#",onClick:function(e){e.stopPropagation(),e.preventDefault(),o.Z.purgeDB()},className:"page-options",title:"Change Language"},a.createElement("img",{src:"/public/img/flag_usa_.gif",alt:"English (Change Language)",width:"40",height:"27"}),a.createElement("br",null),"English (Change Language)"))))))))))))}(0,i.render)(a.createElement(l.VK,null,a.createElement(y,{path:"/*",href:"/"})),document.getElementById("root"))},7768:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(5403),a=Object.create(r.Z);a.root={backgroundColor:"#F0F0F0",fontFamily:"helvetica neue, helvetica, sans-serif",fontWeight:"300",fontSize:"16px",letterSpacing:"0.025em",padding:"3vh 0 12vh 0",width:"500px",maxWidth:"calc(100vw - 40px)",position:"relative",left:"50vw",WebkitTransform:"translate(-50%, 0)",MozTransform:"translate(-50%, 0)",msTransform:"translate(-50%, 0)",OTransform:"translate(-50%, 0)",transform:"translate(-50%, 0)",WebkitTextSizeAdjust:"none",MozTextSizeAdjust:"none",msTextSizeAdjust:"none",textSizeAdjust:"none"},a.title={fontSize:"20px",marginBottom:"0.5vh"};const i=a},5403:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(7462),a=n(7294),i={normal:{borderBottom:"1px dotted rgb(66, 140, 195)"},hover:{borderBottom:"1px solid rgb(66, 140, 195)",color:"rgb(66, 140, 195)"},active:"hover",touchActive:{borderBottom:"1px dashed rgb(66, 140, 195)",color:"rgb(66, 140, 195)"},focusFromTab:{outline:"2px solid rgb(0, 152, 0)",outlineOffset:"2px",color:"black"},touchActiveTapOnly:!0},l={};Object.keys(i).forEach((function(e){"touchActiveTapOnly"!==e&&(l["onParent"+e.slice(0,1).toUpperCase()+e.slice(1)]=i[e])}));const c={link:i,childLink:l,p:{margin:"3vh 0",lineHeight:"1.4"},code:function(e){return a.createElement("code",{style:{fontFamily:"monospace",fontSize:"15px",paddingLeft:"2px"}},e)},li:function(e,t){return a.createElement("li",(0,r.Z)({style:{paddingLeft:"18px",textIndent:"-15px",margin:"0.5vh 0",listStyle:"none"}},t),a.createElement("span",{style:{paddingRight:"7px"}},"–"),e)}}},693:()=>{}},l={};function c(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return i[e].call(n.exports,n,n.exports,c),n.exports}c.m=i,e=[],c.O=(t,n,r,a)=>{if(!n){var i=1/0;for(u=0;u=a)&&Object.keys(c.O).every((e=>c.O[e](n[s])))?n.splice(s--,1):(l=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[n,r,a]},c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},c.d=(e,t)=>{for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce(((t,n)=>(c.f[n](e,t),t)),[])),c.u=e=>e+".js",c.miniCssF=e=>e+".css",c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},n="chaoticbackup:",c.l=(e,r,a,i)=>{if(t[e])t[e].push(r);else{var l,s;if(void 0!==a)for(var o=document.getElementsByTagName("script"),u=0;u{l.onerror=l.onload=null,clearTimeout(d);var a=t[e];if(delete t[e],l.parentNode&&l.parentNode.removeChild(l),a&&a.forEach((e=>e(r))),n)return n(r)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=p.bind(null,l.onerror),l.onload=p.bind(null,l.onload),s&&document.head.appendChild(l)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.p="/build/",r=e=>new Promise(((t,n)=>{var r=c.miniCssF(e),a=c.p+r;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),r=0;r{var a=document.createElement("link");a.rel="stylesheet",a.type="text/css",a.onerror=a.onload=i=>{if(a.onerror=a.onload=null,"load"===i.type)n();else{var l=i&&("load"===i.type?"missing":i.type),c=i&&i.target&&i.target.href||t,s=new Error("Loading CSS chunk "+e+" failed.\n("+c+")");s.code="CSS_CHUNK_LOAD_FAILED",s.type=l,s.request=c,a.parentNode.removeChild(a),r(s)}},a.href=t,document.head.appendChild(a)})(e,a,t,n)})),a={179:0},c.f.miniCss=(e,t)=>{a[e]?t.push(a[e]):0!==a[e]&&{159:1,510:1,631:1,640:1}[e]&&t.push(a[e]=r(e).then((()=>{a[e]=0}),(t=>{throw delete a[e],t})))},(()=>{var e={179:0};c.f.j=(t,n)=>{var r=c.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var a=new Promise(((n,a)=>r=e[t]=[n,a]));n.push(r[2]=a);var i=c.p+c.u(t),l=new Error;c.l(i,(n=>{if(c.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var a=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",l.name="ChunkLoadError",l.type=a,l.request=i,r[1](l)}}),"chunk-"+t,t)}},c.O.j=t=>0===e[t];var t=(t,n)=>{var r,a,[i,l,s]=n,o=0;if(i.some((t=>0!==e[t]))){for(r in l)c.o(l,r)&&(c.m[r]=l[r]);if(s)var u=s(c)}for(t&&t(n);oc(6981)));var s=c.O(void 0,[736],(()=>c(8953)));s=c.O(s)})(); \ No newline at end of file diff --git a/src/components/SpreadsheetData/API.ts b/src/components/SpreadsheetData/API.ts index f221ca0..5d9a83d 100644 --- a/src/components/SpreadsheetData/API.ts +++ b/src/components/SpreadsheetData/API.ts @@ -1,190 +1,209 @@ -import 'whatwg-fetch'; -import { observable } from "mobx"; -import CollectionDB from './CollectionDB'; -import spreadsheet_data from './meta_spreadsheet.json'; -import { Card } from '../common/definitions'; - -type card_type = 'attacks' | 'battlegear' | 'creatures' | 'locations' | 'mugic'; - -type data_type = 'cards' | 'portal'; - -function retry (fn: () => any, retries=0, err=null) { - if (retries < 0) { - return Promise.reject(err); - } - return fn().catch((err: any) => { - return retry(fn, (retries - 1), err); - }); -} - -class API { - @observable portal; - @observable cards; - @observable urls; - private static instance: API; - - get base_image() { return "https://drive.google.com/uc?id=" } - get thumb_missing() { return "1JYjPzkv74IhzlHTyVh2niTDyui73HSfp" } - get card_back() { return "https://i.imgur.com/xbeDBRJ.png" } - // such secure, much wow - get key() { - return ["AIz", "aSy", "Bfq", "09-", "tBi", "78b", "nH6", "6f1", "Lkn", "zGD", "XM9", "Zu9", "JG0"].join(""); - } - - private constructor () { - // This sets up urls and kicks off db - try { - const urls = {}; - spreadsheet_data.forEach(({ type, subtype, url }) => { - if (!urls[type]) urls[type] = {}; - urls[type][subtype] = url; - }); - this.urls = urls; - - this.portal = new CollectionDB(this, 'portal'); - this.cards = new CollectionDB(this, 'cards'); - } - catch (err) { - this.portal = null; - this.cards = null; - this.urls = null; - console.error('setting up database failed', err); - } - } - - // Singleton - static getInstance(): API { - if (!API.instance) { API.instance = new API() } - return API.instance; - } - - path(spreadsheetID: string) { - return `https://sheets.googleapis.com/v4/spreadsheets/${spreadsheetID}/values/Sheet1?key=${this.key}`; - } - - async getSpreadsheetTime(spreadsheetId: string) { - const url = `https://content.googleapis.com/drive/v3/files/${spreadsheetId}?fields=modifiedTime&key=${this.key}`; - const response = await fetch(url); - - if (response.status === 200) { - const json = await response.json(); - if ("modifiedTime" in json) { - return Promise.resolve(json.modifiedTime); - } - } - return Promise.reject(); - } - - async getSpreadsheetData(spreadsheetId: string, doRetry: boolean = false) { - const url = this.path(spreadsheetId); - - const cmd = async () => { - const response = await fetch(url); - - if (response.status === 404) { - throw new Error("Can't Open File"); - } - - try { - const json = await response.json(); - return json.values; - } catch (err) { - throw new Error(err); - } - }; - - return retry(cmd, doRetry ? 3 : 0); - } - - // Wrapper that transforms spreadsheet data into expected object - async parseSpreadsheetData(spreadsheetId: string, cardType: string, doRetry: boolean = false) { - return this.getSpreadsheetData(spreadsheetId, doRetry) - .then((data: Array>) => { - if (data.length < 2) return []; - - const header = data.shift()!.map((h: string) => h.toLowerCase().replace(" ", "")); - const cards = data.map((card: string[]) => { - const obj = { "gsx$type": cardType }; - - for (let i = 0; i < header.length; i++) { - obj[`gsx$${header[i]}`] = card[i]; - } - - return obj; - }); - - return cards; - }); - } - - // Input format - // [{cards: 'attacks'}, {portal: 'attacks'}] - async LoadDB(input: { [key in data_type]?: card_type }[]) { - if (this.urls && this.portal && this.cards) { - return Promise.all(input.map((item) => { - return new Promise((resolve, reject) => { - if ('cards' in item) { - return this.cards!.setupType(item.cards, resolve, reject); - } - else if ('portal' in item) { - return this.portal!.setupType(item.portal, resolve, reject); - } - else { - console.error('key must be cards or portal'); - return reject(); - } - }); - })); - } - else return Promise.reject(); - } - - /* Wrappers for images */ - cardImage(card: Card) { - if (card.gsx$ic && card.gsx$ic !== '') { - return card.gsx$ic; - } else if (card.gsx$image && card.gsx$image !== '') { - return this.base_image + card.gsx$image; - } else { - return this.card_back; - } - } - - get tribes() { - return ["Danian", "Generic", "Mipedian", "M'arrillian", "OverWorld", "UnderWorld"]; - } - - // For the conversion of shorthand in database - get sets() { - return { - "DOP": "Dawn of Perim", - "ZOTH": "Zenith of the Hive", - "SS": "Silent Sands", - "MI": "Beyond the Doors", - "ROTO": "Rise of the Oligarch", - "TOTT": "Turn of the Tide", - "FUN": "Forged Unity", - "AU": "Alliance Unraveled", - "FAS": "Fire and Stone", - "OP1": "Organized Play 1", - "PE1": "Premium Edition 1", - "SAS": "Storm and Sea", - "EE": "Elemental Emperors", - "BR": "Beyond Rare", - "LR": "League Rewards", - "PROMO": "Promotional", - "PROTO": "Prototype" - }; - } - - purgeDB() { - if (this.cards) this.cards.purgeDB(); - if (this.portal) this.portal.purgeDB(); - setTimeout(() => { - window.location.reload(); - }, 300); - } - -} - -export default API; +import 'whatwg-fetch'; +import { observable } from "mobx"; +import CollectionDB from './CollectionDB'; +import spreadsheet_data from './meta_spreadsheet.json'; +import { Card } from '../common/definitions'; + +type card_type = 'attacks' | 'battlegear' | 'creatures' | 'locations' | 'mugic'; + +type data_type = 'cards' | 'portal'; + +function retry (fn: () => any, retries=0, err=null) { + if (retries < 0) { + return Promise.reject(err); + } + return fn().catch((err: any) => { + return retry(fn, (retries - 1), err); + }); +} + +class API { + @observable portal; + @observable cards; + @observable urls; + private static instance: API; + + get base_image() { return "https://drive.google.com/uc?id=" } + get thumb_missing() { return "1JYjPzkv74IhzlHTyVh2niTDyui73HSfp" } + get card_back() { return "https://i.imgur.com/xbeDBRJ.png" } + // such secure, much wow + get key() { + return ["AIz", "aSy", "Bfq", "09-", "tBi", "78b", "nH6", "6f1", "Lkn", "zGD", "XM9", "Zu9", "JG0"].join(""); + } + + private constructor () { + // This sets up urls and kicks off db + try { + const urls = {}; + spreadsheet_data.forEach(({ type, subtype, url }) => { + if (!urls[type]) urls[type] = {}; + urls[type][subtype] = url; + }); + this.urls = urls; + + this.portal = new CollectionDB(this, 'portal'); + this.cards = new CollectionDB(this, 'cards'); + } + catch (err) { + this.portal = null; + this.cards = null; + this.urls = null; + console.error('setting up database failed', err); + } + } + + // Singleton + static getInstance(): API { + if (!API.instance) { API.instance = new API() } + return API.instance; + } + + path(spreadsheetID: string) { + return `https://sheets.googleapis.com/v4/spreadsheets/${spreadsheetID}/values/Sheet1?key=${this.key}`; + } + + async getSpreadsheetTime(spreadsheetId: string) { + const url = `https://content.googleapis.com/drive/v3/files/${spreadsheetId}?fields=modifiedTime&key=${this.key}`; + const response = await fetch(url); + + if (response.status === 200) { + const json = await response.json(); + if ("modifiedTime" in json) { + return Promise.resolve(json.modifiedTime); + } + } + return Promise.reject(); + } + + async getSpreadsheetData(spreadsheetId: string, doRetry: boolean = false) { + const url = this.path(spreadsheetId); + + const cmd = async () => { + const response = await fetch(url); + + if (response.status === 404) { + throw new Error("Can't Open File"); + } + + try { + const json = await response.json(); + return json.values; + } catch (err) { + throw new Error(err); + } + }; + + return retry(cmd, doRetry ? 3 : 0); + } + + // Wrapper that transforms spreadsheet data into expected object + async parseSpreadsheetData(spreadsheetId: string, cardType: string, doRetry: boolean = false) { + return this.getSpreadsheetData(spreadsheetId, doRetry) + .then((data: Array>) => { + if (data.length < 2) return []; + + const header = data.shift()!.map((h: string) => h.toLowerCase().replace(" ", "")); + const cards = data.map((card: string[]) => { + const obj = { "gsx$type": cardType }; + + for (let i = 0; i < header.length; i++) { + obj[`gsx$${header[i]}`] = card[i]; + } + + return obj; + }); + + return cards; + }); + } + + // Input format + // [{cards: 'attacks'}, {portal: 'attacks'}] + async LoadDB(input: { [key in data_type]?: card_type }[]) { + if (this.urls && this.portal && this.cards) { + return Promise.all(input.map((item) => { + return new Promise((resolve, reject) => { + if ('cards' in item) { + return this.cards!.setupType(item.cards, resolve, reject); + } + else if ('portal' in item) { + return this.portal!.setupType(item.portal, resolve, reject); + } + else { + console.error('key must be cards or portal'); + return reject(); + } + }); + })); + } + else return Promise.reject(); + } + + /* Wrappers for images */ + cardImage(card: Card) { + if (card.gsx$ic && card.gsx$ic !== '') { + return card.gsx$ic; + } else if (card.gsx$image && card.gsx$image !== '') { + return this.base_image + card.gsx$image; + } else { + return this.card_back; + } + } + + hasFullart = (card: Card) => ( + Boolean(card.gsx$if !== undefined && card.gsx$if !== '') || + Boolean(card.gsx$splash !== undefined && card.gsx$splash !== '') || + Boolean(card.gsx$alt !== undefined && card.gsx$alt !== '') + ); + + /* Wrapper for full art */ + cardFullart = (card: Card) => { + if (card.gsx$if && card.gsx$if !== '') { + return card.gsx$if; + } else if (card.gsx$splash && card.gsx$splash !== '') { + return this.base_image + card.gsx$splash; + } else if (card.gsx$alt) { + return card.gsx$alt; + } else { + return this.card_back; + } + }; + + get tribes() { + return ["Danian", "Generic", "Mipedian", "M'arrillian", "OverWorld", "UnderWorld"]; + } + + // For the conversion of shorthand in database + get sets() { + return { + "DOP": "Dawn of Perim", + "ZOTH": "Zenith of the Hive", + "SS": "Silent Sands", + "MI": "Beyond the Doors", + "ROTO": "Rise of the Oligarch", + "TOTT": "Turn of the Tide", + "FUN": "Forged Unity", + "AU": "Alliance Unraveled", + "FAS": "Fire and Stone", + "OP1": "Organized Play 1", + "PE1": "Premium Edition 1", + "SAS": "Storm and Sea", + "EE": "Elemental Emperors", + "BR": "Beyond Rare", + "LR": "League Rewards", + "PROMO": "Promotional", + "PROTO": "Prototype" + }; + } + + purgeDB() { + if (this.cards) this.cards.purgeDB(); + if (this.portal) this.portal.purgeDB(); + setTimeout(() => { + window.location.reload(); + }, 300); + } + +} + +export default API; diff --git a/src/components/portal/Search.js b/src/components/portal/Search.js index ad75e82..01fc750 100644 --- a/src/components/portal/Search.js +++ b/src/components/portal/Search.js @@ -1,214 +1,214 @@ -import React from 'react'; -import API from '../SpreadsheetData'; -import { Loading } from '../Snippets'; -import { observable } from "mobx"; -import { observer, inject } from 'mobx-react'; -import loki from 'lokijs'; -import { SearchButton } from '../Snippets'; -import { sortCardName, text_link, thumb_link } from './Category/common.tsx'; - -@inject((stores, props, context) => props) @observer -export default class SearchPortal extends React.Component { - @observable input; - @observable query; - - constructor(props) { - super(props); - // this.search = this.search.bind(this); - this.query = this.input = decodeURIComponent(this.props.location.search.substr(1)); - } - - render() { - return (
-
- this.query = e.target.value} /> - -
- -
); - } - - search = (event) => { - event.preventDefault(); - event.stopPropagation(); - - this.props.history.push('/portal/Search/?'+encodeURIComponent(this.query)); - this.input = this.query; - } -} - -@inject((stores, props, context) => props) @observer -class DBSearch extends React.Component { - @observable loaded = false; - @observable loading = false; - - constructor() { - super(); - this.filter = new loki("filter.db"); - } - - render() { - if (this.loaded == false) { - if (this.loading == false) { - this.loading = true; - API.LoadDB([ - { 'portal': 'attacks' }, { 'portal': 'battlegear' }, { 'portal': 'creatures' }, { 'portal': 'locations' }, { 'portal': 'mugic' }, - { 'cards': 'attacks' }, { 'cards': 'battlegear' }, { 'cards': 'creatures' }, { 'cards': 'locations' }, { 'cards': 'mugic' } - ]).then(() => { - this.loaded = true; - this.loading = false; - }) - .catch(() => {}); - } - return (); - } - - const { string } = this.props; - - // No search - if (string == "") { - return (
); - } - - const filter = this.filter.addCollection('filter'); - var pview = filter.addDynamicView('filter'); - pview.applySimpleSort('gsx$name'); - - let attackResults = API.portal.attacks.chain(); - let battlegearResults = API.portal.battlegear.chain(); - let creatureResults = API.portal.creatures.chain(); - let locationResults = API.portal.locations.chain(); - let mugicResults = API.portal.mugic.chain(); - - // Attributes Background Details - attackResults = attackResults.find({ '$or': [ - { 'gsx$attributes': { '$regex': new RegExp(string, 'i') }}, - { 'gsx$background': { '$regex': new RegExp(string, 'i') }}, - { 'gsx$details': { '$regex': new RegExp(string, 'i') }} - ]}); - - // Attributes Background Details - battlegearResults = battlegearResults.find({ '$or': [ - { 'gsx$attributes': { '$regex': new RegExp(string, 'i') }}, - { 'gsx$background': { '$regex': new RegExp(string, 'i') }}, - { 'gsx$details': { '$regex': new RegExp(string, 'i') }} - ]}); - // Appearance Background Special Abilities Details - creatureResults = creatureResults.find({ '$or': [ - { 'gsx$appearance': { '$regex': new RegExp(string, 'i') }}, - { 'gsx$background': { '$regex': new RegExp(string, 'i') }}, - { 'gsx$specialabilities': { '$regex': new RegExp(string, 'i') }}, - { 'gsx$details': { '$regex': new RegExp(string, 'i') }} - ]}); - // Local Features Background Details - locationResults = locationResults.find({ '$or': [ - { 'gsx$localfeatures': { '$regex': new RegExp(string, 'i') }}, - { 'gsx$background': { '$regex': new RegExp(string, 'i') }}, - { 'gsx$details': { '$regex': new RegExp(string, 'i') }} - ]}); - // Background Details - mugicResults = mugicResults.find({ '$or': [ - { 'gsx$background': { '$regex': new RegExp(string, 'i') }}, - { 'gsx$details': { '$regex': new RegExp(string, 'i') }} - ]}); - - let temp; - - temp = attackResults.data(); - temp.forEach(function(v){ delete v.$loki }); - filter.insert(temp); - - temp = battlegearResults.data(); - temp.forEach(function(v){ delete v.$loki }); - filter.insert(temp); - - temp = creatureResults.data(); - temp.forEach(function(v){ delete v.$loki }); - filter.insert(temp); - - temp = locationResults.data(); - temp.forEach(function(v){ delete v.$loki }); - filter.insert(temp); - - temp = mugicResults.data(); - temp.forEach(function(v){ delete v.$loki }); - filter.insert(temp); - - let content = pview.data().map((val, i) => text_link(val, i)); - this.filter.removeCollection('filter'); - - let header; - - // This prioritizes names in the results - const names = [].concat( - API.portal.attacks.find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}), - API.portal.battlegear.find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}), - API.portal.creatures.find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}), - API.portal.locations.find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}), - API.portal.mugic.find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}), - API.cards.attacks.chain() - .find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}) - .where((obj) => {return (obj.gsx$splash != ('') )}).data(), - API.cards.battlegear.chain() - .find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}) - .where((obj) => {return (obj.gsx$splash != ('') )}).data(), - API.cards.creatures.chain() - .find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}) - .where((obj) => {return (obj.gsx$splash != ('') )}).data(), - API.cards.locations.chain() - .find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}) - .where((obj) => {return (obj.gsx$splash != ('') )}).data(), - API.cards.mugic.chain() - .find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}) - .where((obj) => {return (obj.gsx$splash != ('') )}).data() - ) - .sort(sortCardName) - // dedupe fullart results - .filter((val, i, arr) => (i == 0 || val.gsx$name != arr[i - 1].gsx$name)) - .map((val, i) => thumb_link(val, i)); - - // Check Artists - if (content.length == 0) { - const artists = [].concat( - API.cards.attacks.chain() - .find({ 'gsx$artist': { '$regex': new RegExp(string, 'i') }}) - .where((obj) => {return (obj.gsx$splash != ('') )}).data(), - API.cards.battlegear.chain() - .find({ 'gsx$artist': { '$regex': new RegExp(string, 'i') }}) - .where((obj) => {return (obj.gsx$splash != ('') )}).data(), - API.cards.creatures.chain() - .find({ 'gsx$artist': { '$regex': new RegExp(string, 'i') }}) - .where((obj) => {return (obj.gsx$splash != ('') )}).data(), - API.cards.locations.chain() - .find({ 'gsx$artist': { '$regex': new RegExp(string, 'i') }}) - .where((obj) => {return (obj.gsx$splash != ('') )}).data(), - API.cards.mugic.chain() - .find({ 'gsx$artist': { '$regex': new RegExp(string, 'i') }}) - .where((obj) => {return (obj.gsx$splash != ('') )}).data() - ) - .sort((a, b) => (a.gsx$name > b.gsx$name) ? 1 : -1) - .map((val, i) => text_link(val, i)); - - if (artists.length > 0) { - header = `Art contributed by ${string}:`; - content = artists; - } - else { - header = 'No Results Found'; - } - } - else { - header = `Results containing ${string}:`; - } - - return (
-
- {names.length > 0 && <> -
{names}
-
- } -
{header}
- {content} -
); - } -} +import React from 'react'; +import API from '../SpreadsheetData'; +import { Loading } from '../Snippets'; +import { observable } from "mobx"; +import { observer, inject } from 'mobx-react'; +import loki from 'lokijs'; +import { SearchButton } from '../Snippets'; +import { sortCardName, text_link, thumb_link } from './Category/common.tsx'; + +@inject((stores, props, context) => props) @observer +export default class SearchPortal extends React.Component { + @observable input; + @observable query; + + constructor(props) { + super(props); + // this.search = this.search.bind(this); + this.query = this.input = decodeURIComponent(this.props.location.search.substr(1)); + } + + render() { + return (
+
+ this.query = e.target.value} /> + +
+ +
); + } + + search = (event) => { + event.preventDefault(); + event.stopPropagation(); + + this.props.history.push('/portal/Search/?'+encodeURIComponent(this.query)); + this.input = this.query; + } +} + +@inject((stores, props, context) => props) @observer +class DBSearch extends React.Component { + @observable loaded = false; + @observable loading = false; + + constructor() { + super(); + this.filter = new loki("filter.db"); + } + + render() { + if (this.loaded == false) { + if (this.loading == false) { + this.loading = true; + API.LoadDB([ + { 'portal': 'attacks' }, { 'portal': 'battlegear' }, { 'portal': 'creatures' }, { 'portal': 'locations' }, { 'portal': 'mugic' }, + { 'cards': 'attacks' }, { 'cards': 'battlegear' }, { 'cards': 'creatures' }, { 'cards': 'locations' }, { 'cards': 'mugic' } + ]).then(() => { + this.loaded = true; + this.loading = false; + }) + .catch(() => {}); + } + return (); + } + + const { string } = this.props; + + // No search + if (string == "") { + return (
); + } + + const filter = this.filter.addCollection('filter'); + var pview = filter.addDynamicView('filter'); + pview.applySimpleSort('gsx$name'); + + let attackResults = API.portal.attacks.chain(); + let battlegearResults = API.portal.battlegear.chain(); + let creatureResults = API.portal.creatures.chain(); + let locationResults = API.portal.locations.chain(); + let mugicResults = API.portal.mugic.chain(); + + // Attributes Background Details + attackResults = attackResults.find({ '$or': [ + { 'gsx$attributes': { '$regex': new RegExp(string, 'i') }}, + { 'gsx$background': { '$regex': new RegExp(string, 'i') }}, + { 'gsx$details': { '$regex': new RegExp(string, 'i') }} + ]}); + + // Attributes Background Details + battlegearResults = battlegearResults.find({ '$or': [ + { 'gsx$attributes': { '$regex': new RegExp(string, 'i') }}, + { 'gsx$background': { '$regex': new RegExp(string, 'i') }}, + { 'gsx$details': { '$regex': new RegExp(string, 'i') }} + ]}); + // Appearance Background Special Abilities Details + creatureResults = creatureResults.find({ '$or': [ + { 'gsx$appearance': { '$regex': new RegExp(string, 'i') }}, + { 'gsx$background': { '$regex': new RegExp(string, 'i') }}, + { 'gsx$specialabilities': { '$regex': new RegExp(string, 'i') }}, + { 'gsx$details': { '$regex': new RegExp(string, 'i') }} + ]}); + // Local Features Background Details + locationResults = locationResults.find({ '$or': [ + { 'gsx$localfeatures': { '$regex': new RegExp(string, 'i') }}, + { 'gsx$background': { '$regex': new RegExp(string, 'i') }}, + { 'gsx$details': { '$regex': new RegExp(string, 'i') }} + ]}); + // Background Details + mugicResults = mugicResults.find({ '$or': [ + { 'gsx$background': { '$regex': new RegExp(string, 'i') }}, + { 'gsx$details': { '$regex': new RegExp(string, 'i') }} + ]}); + + let temp; + + temp = attackResults.data(); + temp.forEach(function(v){ delete v.$loki }); + filter.insert(temp); + + temp = battlegearResults.data(); + temp.forEach(function(v){ delete v.$loki }); + filter.insert(temp); + + temp = creatureResults.data(); + temp.forEach(function(v){ delete v.$loki }); + filter.insert(temp); + + temp = locationResults.data(); + temp.forEach(function(v){ delete v.$loki }); + filter.insert(temp); + + temp = mugicResults.data(); + temp.forEach(function(v){ delete v.$loki }); + filter.insert(temp); + + let content = pview.data().map((val, i) => text_link(val, i)); + this.filter.removeCollection('filter'); + + let header; + + // This prioritizes names in the results + const names = [].concat( + API.portal.attacks.find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}), + API.portal.battlegear.find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}), + API.portal.creatures.find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}), + API.portal.locations.find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}), + API.portal.mugic.find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}), + API.cards.attacks.chain() + .find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}) + .where(API.hasFullart).data(), + API.cards.battlegear.chain() + .find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}) + .where(API.hasFullart).data(), + API.cards.creatures.chain() + .find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}) + .where(API.hasFullart).data(), + API.cards.locations.chain() + .find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}) + .where(API.hasFullart).data(), + API.cards.mugic.chain() + .find({ 'gsx$name': { '$regex': new RegExp(string, 'i') }}) + .where(API.hasFullart).data() + ) + .sort(sortCardName) + // dedupe fullart results + .filter((val, i, arr) => (i == 0 || val.gsx$name != arr[i - 1].gsx$name)) + .map((val, i) => thumb_link(val, i)); + + // Check Artists + if (content.length == 0) { + const artists = [].concat( + API.cards.attacks.chain() + .find({ 'gsx$artist': { '$regex': new RegExp(string, 'i') }}) + .where(API.hasFullart).data(), + API.cards.battlegear.chain() + .find({ 'gsx$artist': { '$regex': new RegExp(string, 'i') }}) + .where(API.hasFullart).data(), + API.cards.creatures.chain() + .find({ 'gsx$artist': { '$regex': new RegExp(string, 'i') }}) + .where(API.hasFullart).data(), + API.cards.locations.chain() + .find({ 'gsx$artist': { '$regex': new RegExp(string, 'i') }}) + .where(API.hasFullart).data(), + API.cards.mugic.chain() + .find({ 'gsx$artist': { '$regex': new RegExp(string, 'i') }}) + .where(API.hasFullart).data() + ) + .sort((a, b) => (a.gsx$name > b.gsx$name) ? 1 : -1) + .map((val, i) => text_link(val, i)); + + if (artists.length > 0) { + header = `Art contributed by ${string}:`; + content = artists; + } + else { + header = 'No Results Found'; + } + } + else { + header = `Results containing ${string}:`; + } + + return (
+
+ {names.length > 0 && <> +
{names}
+
+ } +
{header}
+ {content} +
); + } +} diff --git a/src/components/portal/Single/Attack.js b/src/components/portal/Single/Attack.js index 6d637de..449a0f5 100644 --- a/src/components/portal/Single/Attack.js +++ b/src/components/portal/Single/Attack.js @@ -52,7 +52,7 @@ export default class SingleAttack extends React.Component { ); } else if (card_data) { - if (card_data.gsx$splash) { + if (API.hasFullart(card_data)) { return (); } } diff --git a/src/components/portal/Single/Battlegear.js b/src/components/portal/Single/Battlegear.js index 6958257..4a9b339 100644 --- a/src/components/portal/Single/Battlegear.js +++ b/src/components/portal/Single/Battlegear.js @@ -51,7 +51,7 @@ export default class SingleBattlegear extends React.Component { />); } else if (card_data) { - if (card_data.gsx$splash) { + if (API.hasFullart(card_data)) { return (); } } diff --git a/src/components/portal/Single/Creature.js b/src/components/portal/Single/Creature.js index 05f5b59..9eb4e1c 100644 --- a/src/components/portal/Single/Creature.js +++ b/src/components/portal/Single/Creature.js @@ -1,178 +1,178 @@ -import React from 'react'; -import { Interactive } from 'react-interactive'; -import { Link } from 'react-router-dom'; -import API from '../../SpreadsheetData'; -import s from '../../../styles/app.style'; -import { observer, inject } from 'mobx-react'; -import Single from './_base'; -import { PageNotFound, Element, Mugic, Discipline, Tribe } from '../../Snippets'; - -function Artist(props) { - const artists = []; - props.artist.split(/(?=, )/).forEach((artist, i) => { - artists.push({artist}); - }); - return (
{artists}
); -} - -@inject((stores, props, context) => props) @observer -export default class SingleCreature extends React.Component { - - // ** Process the tribe ** // - // /portal/Creatures/{Tribe}/{Name} - // /portal/{Tribe}/Creatures/{Name} - // The first / gets counted - render() { - - const path = this.props.location.pathname.split("/"); - if (path[path.length-1] == "") path.pop(); // Remove trailing backslash - - const name = (() => { - if (path.length >= 5) return decodeURIComponent(path[4]); - if (path.length == 4) return decodeURIComponent(path[3]); - })(); - - const creature = API.portal.creatures.findOne({ 'gsx$name': name }); - const card_data = API.cards.creatures.findOne({ 'gsx$name': name }); - - if (creature) { - const tribe = creature.gsx$tribe; - - const mugic = []; - for (let i = 0; i < parseInt(card_data.gsx$mugicability || 0); i++) { - mugic.push(); - } - - const col2 = []; - if (creature.gsx$attributes) { - col2.push(["Appearance", creature.gsx$attributes]); - } - if (creature.gsx$background) { - col2.push(["Background", creature.gsx$background]); - } - if (creature.gsx$details) { - col2.push(["Details", creature.gsx$details]); - } - if (creature.gsx$battlegear) { - col2.push(["Favorite Battlegear(s)", creature.gsx$battlegear.split(/[;]+\s*/).map((item, i) => -

{item}

- )]); - } - if (creature.gsx$location) { - col2.push(["Favorite Location(s)", creature.gsx$location.split(/[;]+\s*/).map((item, i) => -

{item}

- )]); - } - if (creature.gsx$height) { - col2.push(["Height (ft)", creature.gsx$height]); - } - if (creature.gsx$specialabilities) { - col2.push(["Special Abilities", creature.gsx$specialabilities]); - } - if (creature.gsx$weight) { - col2.push(["Weight (lb)", creature.gsx$weight]); - } - - return ( -
- Tribe: -   - {tribe} -
-
-
- Disciplines: - {card_data.gsx$courage}  - {card_data.gsx$power}  - {card_data.gsx$wisdom}  - {card_data.gsx$speed} -
-
-
- Energy: - {card_data.gsx$energy} -
-
-
- Elements: - =0} />  - =0} />  - =0} />  - =0} /> -
-
-
- Mugic Ability: - {mugic} -
- } - col2={ - col2.map((val, i) => { - return ( -
- {val[0]}:
- {val[1]} -
- {i !== col2.length - 1 &&
} -
); - }) - } - />); - } - else if (card_data) { - if (card_data.gsx$splash) { - const tribe = card_data.gsx$tribe; - - const mugic = []; - for (let i = 0; i < parseInt(card_data.gsx$mugicability || 0); i++) { - mugic.push(); - } - - return ( -
- Tribe: -   - {tribe} -
-
-
- Disciplines: - {card_data.gsx$courage} -   - {card_data.gsx$power} -   - {card_data.gsx$speed} -   - {card_data.gsx$wisdom} - -
-
-
- Energy: - {card_data.gsx$energy} -
-
-
- Elements: - =0} />  - =0} />  - =0} />  - =0} /> -
-
-
- Mugic Ability: - {mugic} -
- } - />); - } - } - - return (); - } -} +import React from 'react'; +import { Interactive } from 'react-interactive'; +import { Link } from 'react-router-dom'; +import API from '../../SpreadsheetData'; +import s from '../../../styles/app.style'; +import { observer, inject } from 'mobx-react'; +import Single from './_base'; +import { PageNotFound, Element, Mugic, Discipline, Tribe } from '../../Snippets'; + +function Artist(props) { + const artists = []; + props.artist.split(/(?=, )/).forEach((artist, i) => { + artists.push({artist}); + }); + return (
{artists}
); +} + +@inject((stores, props, context) => props) @observer +export default class SingleCreature extends React.Component { + + // ** Process the tribe ** // + // /portal/Creatures/{Tribe}/{Name} + // /portal/{Tribe}/Creatures/{Name} + // The first / gets counted + render() { + + const path = this.props.location.pathname.split("/"); + if (path[path.length-1] == "") path.pop(); // Remove trailing backslash + + const name = (() => { + if (path.length >= 5) return decodeURIComponent(path[4]); + if (path.length == 4) return decodeURIComponent(path[3]); + })(); + + const creature = API.portal.creatures.findOne({ 'gsx$name': name }); + const card_data = API.cards.creatures.findOne({ 'gsx$name': name }); + + if (creature) { + const tribe = creature.gsx$tribe; + + const mugic = []; + for (let i = 0; i < parseInt(card_data.gsx$mugicability || 0); i++) { + mugic.push(); + } + + const col2 = []; + if (creature.gsx$attributes) { + col2.push(["Appearance", creature.gsx$attributes]); + } + if (creature.gsx$background) { + col2.push(["Background", creature.gsx$background]); + } + if (creature.gsx$details) { + col2.push(["Details", creature.gsx$details]); + } + if (creature.gsx$battlegear) { + col2.push(["Favorite Battlegear(s)", creature.gsx$battlegear.split(/[;]+\s*/).map((item, i) => +

{item}

+ )]); + } + if (creature.gsx$location) { + col2.push(["Favorite Location(s)", creature.gsx$location.split(/[;]+\s*/).map((item, i) => +

{item}

+ )]); + } + if (creature.gsx$height) { + col2.push(["Height (ft)", creature.gsx$height]); + } + if (creature.gsx$specialabilities) { + col2.push(["Special Abilities", creature.gsx$specialabilities]); + } + if (creature.gsx$weight) { + col2.push(["Weight (lb)", creature.gsx$weight]); + } + + return ( +
+ Tribe: +   + {tribe} +
+
+
+ Disciplines: + {card_data.gsx$courage}  + {card_data.gsx$power}  + {card_data.gsx$wisdom}  + {card_data.gsx$speed} +
+
+
+ Energy: + {card_data.gsx$energy} +
+
+
+ Elements: + =0} />  + =0} />  + =0} />  + =0} /> +
+
+
+ Mugic Ability: + {mugic} +
+ } + col2={ + col2.map((val, i) => { + return ( +
+ {val[0]}:
+ {val[1]} +
+ {i !== col2.length - 1 &&
} +
); + }) + } + />); + } + else if (card_data) { + if (API.hasFullart(card_data)) { + const tribe = card_data.gsx$tribe; + + const mugic = []; + for (let i = 0; i < parseInt(card_data.gsx$mugicability || 0); i++) { + mugic.push(); + } + + return ( +
+ Tribe: +   + {tribe} +
+
+
+ Disciplines: + {card_data.gsx$courage} +   + {card_data.gsx$power} +   + {card_data.gsx$speed} +   + {card_data.gsx$wisdom} + +
+
+
+ Energy: + {card_data.gsx$energy} +
+
+
+ Elements: + =0} />  + =0} />  + =0} />  + =0} /> +
+
+
+ Mugic Ability: + {mugic} +
+ } + />); + } + } + + return (); + } +} diff --git a/src/components/portal/Single/Location.js b/src/components/portal/Single/Location.js index ed9cc3e..9c82e4e 100644 --- a/src/components/portal/Single/Location.js +++ b/src/components/portal/Single/Location.js @@ -58,7 +58,7 @@ export default class SingleLocation extends React.Component { />); } else if (card_data) { - if (card_data.gsx$splash) { + if (API.hasFullart(card_data)) { return ( diff --git a/src/components/portal/Single/Mugic.js b/src/components/portal/Single/Mugic.js index b00a6af..67ae565 100644 --- a/src/components/portal/Single/Mugic.js +++ b/src/components/portal/Single/Mugic.js @@ -78,7 +78,7 @@ export default class SingleMugic extends React.Component { />); } else if (card_data) { - if (card_data.gsx$splash) { + if (API.hasFullart(card_data)) { const tribe = card_data.gsx$tribe; return (
× - +
- {card.gsx$splash && ( + {API.hasFullart(card) && (
{/**/} - {card.gsx$splash && ( - - )} +
)}