parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,c=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return c=t.done,t},e:function(t){a=!0,u=t},f:function(){try{c||null==r.return||r.return()}finally{if(a)throw u}}}}function i(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var u=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),E(e),h}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;E(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:S(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),h}},r}var n=this&&this.__awaiter||function(t,r,e,n){return new(e||(e=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(r){i(r)}}function u(t){try{c(n.throw(t))}catch(r){i(r)}}function c(t){t.done?o(t.value):new e(function(r){r(t.value)}).then(a,u)}c((n=n.apply(t,r||[])).next())})},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var i=o(require("./models/equipment/EquipmentSkills")),a=7;exports.MAX_RARITY=a;var u=83;exports.TORSO_UP_ID=u;var c={name:"None",type:-1,defense:{base:0,max:0,maxLr:0},resistance:[0,0,0,0,0],category:-1,slots:0,rarity:0,skills:new i.default};exports.DUMMY_PIECE=c;var s=function(t){return n(r,void 0,void 0,e().mark(function r(){return e().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,fetch(t);case 2:return r.abrupt("return",r.sent.json());case 3:case"end":return r.stop()}},r)}))},f=function(t){return n(r,void 0,void 0,e().mark(function r(){var n;return e().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,s(t);case 2:return n=r.sent,r.abrupt("return",n.map(function(t){var r=new i.default;for(var e in t.skills){var n=t.skills[e];r.set(parseInt(e),n)}return Object.assign({},t,{skills:r})}));case 4:case"end":return r.stop()}},r)}))},l=function(){return n(r,void 0,void 0,e().mark(function t(){return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",f("./head.json"));case 1:case"end":return t.stop()}},t)}))};exports.getHead=l;var p=function(){return n(r,void 0,void 0,e().mark(function t(){return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",f("./chest.json"));case 1:case"end":return t.stop()}},t)}))};exports.getChest=p;var h=function(){return n(r,void 0,void 0,e().mark(function t(){return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",f("./arms.json"));case 1:case"end":return t.stop()}},t)}))};exports.getArms=h;var v=function(){return n(r,void 0,void 0,e().mark(function t(){return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",f("./waist.json"));case 1:case"end":return t.stop()}},t)}))};exports.getWaist=v;var d=function(){return n(r,void 0,void 0,e().mark(function t(){return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",f("./legs.json"));case 1:case"end":return t.stop()}},t)}))};exports.getLegs=d;var y=function(){return n(r,void 0,void 0,e().mark(function t(){return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",f("./decorations.json"));case 1:case"end":return t.stop()}},t)}))};exports.getDecorations=y;var m=function(){return n(r,void 0,void 0,e().mark(function t(){var r,n,o;return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s("./skill-names.json");case 2:for(o in r=t.sent,n=new Map,r)n.set(parseInt(o),r[o]);return t.abrupt("return",n);case 6:case"end":return t.stop()}},t)}))};exports.getSkillNameMap=m;var g=function(){return n(r,void 0,void 0,e().mark(function t(){return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",s("./skill-categories.json"));case 1:case"end":return t.stop()}},t)}))};exports.getSkillCategories=g;var w=function(){return n(r,void 0,void 0,e().mark(function t(){var r,n,o,i;return e().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s("./skills.json");case 2:for(i in r=t.sent,n=new Map,o=function(t){var e=parseInt(t);n.set(e,r[t].map(function(t){return Object.assign({},t,{requiredSkill:e})}))},r)o(i);return t.abrupt("return",n);case 7:case"end":return t.stop()}},t)}))};exports.getSkillActivationMap=w; },{"./models/equipment/EquipmentSkills":"gZ5g"}],"cuDj":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.range=function(e,r){return Array.from({length:r-e},function(r,t){return t+e})}; },{}],"XByd":[function(require,module,exports) { "use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),function(e){e[e.HEAD=0]="HEAD",e[e.CHEST=1]="CHEST",e[e.ARMS=2]="ARMS",e[e.WAIST=3]="WAIST",e[e.LEGS=4]="LEGS",e[e.CHARM=5]="CHARM",e[e.WEAPON=6]="WEAPON"}(e||(e={})),exports.default=e; },{}],"E1k7":[function(require,module,exports) { "use strict";function t(t){return e(t)||n(t)||u(t)||r()}function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function e(t){if(Array.isArray(t))return l(t)}function o(t,r){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=u(t))||r&&t&&"number"==typeof t.length){n&&(t=n);var e=0,o=function(){};return{s:o,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function i(t,r){return c(t)||f(t,r)||u(t,r)||a()}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t,r){if(t){if("string"==typeof t)return l(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,r):void 0}}function l(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){i=!0,l=e},f:function(){try{c||null==n.return||n.return()}finally{if(i)throw l}}}}function o(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n')),a=0,o=Array.from(e.skills.keys());a".concat(n.get(l),""))),r.appendChild(u.htmlToElement("".concat(e.skills.get(l),"")))}var c=Array.from(e.skills.keys()).length;for(var i in m.range(c,2))r.appendChild(u.htmlToElement("")),r.appendChild(u.htmlToElement(""));r.appendChild(u.htmlToElement("".concat(e.slots,"")));var d=u.htmlToElement('X');d.addEventListener("click",function(){return b(t,n)}),r.appendChild(d),document.getElementById("charm-table").children[0].appendChild(r)},I=function(e,t){var n=i.default.Instance.add(e);E(e,n-1,t),f(t)},b=function(e,t){i.default.Instance.remove(e),y(e),f(t)},k=function(e){var t=i.default.Instance.serialize(e),n=new Blob([t],{type:"text/plain"}),r=document.getElementById("charm-download"),a=window.URL.createObjectURL(n);r.href=a,r.download="charms.csv",r.click()},C=function(e){e.preventDefault(),document.getElementById("charm-upload").click()},w=function(e){var t=document.getElementById("charm-upload");t.files&&t.files[0].text().then(function(t){try{i.default.Instance.deserialize(t,e),f(e),g(),i.default.Instance.get().forEach(function(t,n){E(t,n,e)})}catch(n){alert("Could not process file")}})},B=function(e){var t=parseInt(document.getElementById("charm-slots").value),n=[1,2].map(function(e){return{id:parseInt(document.getElementById("charm-skill-".concat(e,"-name")).value),points:parseInt(document.getElementById("charm-skill-".concat(e,"-points")).value)}});if(0!==t||n.some(function(e){return h(e.id,e.points)})){var r=new s.default(n.filter(function(e){return h(e.id,e.points)}).map(function(e){return[e.id,e.points]})),a={name:i.default.getCharmName(r,t,e),slots:t,category:d.default.CHARM,rarity:0,skills:r};I(a,e)}},A=function(e){document.getElementById("charm-add").addEventListener("click",function(){return B(e)}),document.getElementById("charm-export").addEventListener("click",function(){return k(e)}),document.getElementById("charm-import").addEventListener("click",function(e){return C(e)}),document.getElementById("charm-upload").addEventListener("change",function(){return w(e)})},T=function(){for(var e=document.getElementsByClassName("charm-points-pick"),t=0,n=Array.from(e);t').concat(c,"\n ")))}}catch(i){l.e(i)}finally{l.f()}}},S=function(t,n,r){for(var a=document.getElementsByClassName("charm-skill-pick"),o=function(){var a=c[l],o=r.map(function(e,t){return u.htmlToElement('\n \n '))});n.forEach(function(e){if(0!==e.length){var n=e[0],r=n.category,a=n.requiredSkill,l=t.get(a),c=u.htmlToElement('\n \n "));o[r].appendChild(c)}}),o.unshift(u.htmlToElement('\n \n ')),a.append.apply(a,e(o)),a.getElementsByTagName("option")[0].selected=!0},l=0,c=Array.from(a);l0,category:parseInt(e.parentElement.getAttribute("data-category"))}})};exports.getSkillActivations=i;var c=function(t){for(var r in t){var i=t[r],c=e.htmlToElement('\n
\n \n
\n "));document.getElementById("search-skill-picker").appendChild(c)}},n=function(t){t.forEach(function(t){t.filter(function(e){return e.isPositive}).reverse().forEach(function(t){var r=e.htmlToElement('\n
\n \n
').concat(t.name,"
\n
\n "));document.getElementById("search-picker-category-".concat(t.category)).appendChild(r)})})},a=function(){for(var e=Array.from(document.getElementsByClassName("search-picker-activation")),t=function(){var e=i[r];e.addEventListener("click",function(t){var r=t.target,i=e.children[0];"INPUT"!==r.tagName&&(i.checked=!i.checked);var c=e.children[1];i.checked?c.classList.add("highlighted"):c.classList.remove("highlighted")})},r=0,i=e;r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,l=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw l}}}}function i(t,e){if(t){if("string"==typeof t)return l(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0})}},{key:"getSlotsExceptChest",value:function(){return this.equipment.filter(function(t){return t.category!==h.default.CHEST}).map(function(t){return t.slots}).filter(function(t){return t>0})}},{key:"copy",value:function(){return new e(this.equipment.map(function(t){return t}),new p.default(this.skills),this.score,this.totalSlots,this.torsoUp)}},{key:"addPiece",value:function(e){if(e.skills.has(c.TORSO_UP_ID))this.torsoUp++;else if(e.category===h.default.CHEST&&this.torsoUp>0){var r,n=o(e.skills);try{for(n.s();!(r=n.n()).done;){var i=t(r.value,2),l=i[0],a=i[1];this.skills.add(l,a*(this.torsoUp+1))}}catch(u){n.e(u)}finally{n.f()}}else this.skills.addSkills(e.skills);this.equipment[e.category]=e,this.score=this.score+e.score,this.totalSlots=this.totalSlots+e.slots}}]),e}();exports.default=d; },{"../../data-provider/data-provider.module":"mrro","../../data-provider/models/equipment/EquipmentCategory":"XByd","../../data-provider/models/equipment/EquipmentSkills":"gZ5g"}],"pNrS":[function(require,module,exports) { "use strict";function e(e){return n(e)||r(e)||s(e)||t()}function t(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function n(e){if(Array.isArray(e))return f(e)}function a(e,t){return u(e)||o(e,t)||s(e,t)||i()}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],o=!0,u=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);o=!0);}catch(l){u=!0,a=l}finally{try{o||null==r.return||r.return()}finally{if(u)throw a}}return i}}function u(e){if(Array.isArray(e))return e}function l(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=s(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw i}}}}function s(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?t.applyTorsoUpToChest(a,e.torsoUp):a,this.head=e.equipment[m.default.HEAD],this.arms=e.equipment[m.default.ARMS],this.waist=e.equipment[m.default.WAIST],this.legs=e.equipment[m.default.LEGS],this.charm=e.equipment[m.default.CHARM],this.decos=r.decos,this.evaluation=this.evaluate(e,r,n)}return y(t,[{key:"getPieces",value:function(){return[this.head,this.chest,this.arms,this.waist,this.legs]}},{key:"evaluate",value:function(t,r,n){var i,o={base:0,max:0},u=[0,0,0,0,0],s=l(this.getPieces());try{for(s.s();!(i=s.n()).done;){var f=i.value;o.base+=f.defense.base,o.max+=f.defense.max,u=f.resistance.map(function(e,t){return e+u[t]})}}catch(w){s.e(w)}finally{s.f()}var c=new h.default;r.decos.forEach(function(e){return c.addSkills(e.skills)});var d=new h.default(t.skills);d.addSkills(new h.default(c));var y,p=[],m=l(d);try{var v=function(){var t=a(y.value,2),r=t[0],i=t[1];if(Math.abs(i)<10)return"continue";var o=n.get(r).filter(function(e){return e.isPositive?i>=e.requiredPoints:i<=e.requiredPoints});p.push.apply(p,e(o))};for(m.s();!(y=m.n()).done;)v()}catch(w){m.e(w)}finally{m.f()}var b={defense:o,resistance:u,activations:p,skills:d,torsoUp:t.torsoUp};return this.evaluation=b,b}}],[{key:"applyTorsoUpToChest",value:function(e,t){var r=new h.default(e.skills);return r.multiply(t+1),Object.assign({},e,{skills:r})}}]),t}();exports.default=v; },{"../../data-provider/models/equipment/EquipmentSkills":"gZ5g","../../data-provider/models/equipment/EquipmentCategory":"XByd"}],"Zol7":[function(require,module,exports) { "use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),function(e){e[e.ALL=0]="ALL",e[e.BLADEMASTER=1]="BLADEMASTER",e[e.GUNNER=2]="GUNNER"}(e||(e={})),exports.default=e; },{}],"MMJS":[function(require,module,exports) { "use strict";function r(r){return a(r)||n(r)||t(r)||e()}function e(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function t(r,e){if(r){if("string"==typeof r)return i(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(r,e):void 0}}function n(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function a(r){if(Array.isArray(r))return i(r)}function i(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t0})};exports.filterHasSkill=d;var y=function(r,e){return e===u.MAX_RARITY?r:r.filter(function(r){return p(r,e)})};exports.applyRarityFilter=y;var m=function(r,e){for(var t,n=[],a=function(){var e=o[i];if(r.find(function(r){return r.slots===e})){var t={name:"".concat(e," Slot Charm"),slots:e,category:f.default.CHARM,rarity:0,skills:new s.default};return n.push(t),"break"}},i=0,o=[3,2,1];i=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){e=e.call(r)},n:function(){var r=e.next();return i=r.done,r},e:function(r){u=!0,a=r},f:function(){try{i||null==e.return||e.return()}finally{if(u)throw a}}}}function f(r,t){if(r){if("string"==typeof r)return s(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?s(r,t):void 0}}function s(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);el)return 0;u===l?n.push(1):n.push(2)}return Math.max.apply(Math,n)};exports.decoPermWorseOrSameAsComparison=h;var b=function(t){var e=new Map(Array.from(t.entries()).map(function(t){var e=o(t,2),n=e[0],a=e[1];return[n,Math.max.apply(Math,r(a.map(function(r){return r.score})))]}));return e.set(0,0),e};exports.getDecoSlotScoreMap=b;var S=function(r,t){return r.filter(function(e,n){for(var o=!1,a=0;an&&1===u){o=!0;break}}return!o})};exports.pruneDecoPermutations=S; },{"../data-provider/data-provider.module":"mrro","../data-provider/models/equipment/EquipmentSkills":"gZ5g"}],"z7Uc":[function(require,module,exports) { "use strict";function t(t){return n(t)||r(t)||o(t)||e()}function e(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function n(t){if(Array.isArray(t))return l(t)}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=o(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,u=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){a=!0,l=t},f:function(){try{u||null==r.return||r.return()}finally{if(a)throw l}}}}function o(t,e){if(t){if("string"==typeof t)return l(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}var i=o().mark(l);function a(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=c(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function c(t,e){if(t){if("string"==typeof t)return u(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=r)){o.next=12;break}return o.next=10,p;case 10:o.next=13;break;case 12:return o.delegateYield(l(t,e,r,p,h),"t0",13);case 13:o.next=3;break;case 15:o.next=20;break;case 17:o.prev=17,o.t1=o.catch(1),u.e(o.t1);case 20:return o.prev=20,u.f(),o.finish(20);case 23:case"end":return o.stop()}},i,null,[[1,17,20,23]])}Object.defineProperty(exports,"__esModule",{value:!0});var f=function(){function t(r,n){var o=this;e(this,t),this.decorationsOfSkillMap=new Map,this.calculations=new Map;var i,c=a(n);try{var u=function(){var t=i.value[0],e=r.filter(function(e){return e.skills.get(t)>0}).sort(function(e,r){return r.skills.get(t)-e.skills.get(t)});o.decorationsOfSkillMap.set(t,e),o.calculations.set(t,new Map)};for(c.s();!(i=c.n()).done;)u()}catch(l){c.e(l)}finally{c.f()}}return n(t,[{key:"calculateMinRequiredSlots",value:function(e,r){var n=this.decorationsOfSkillMap.get(e);if(0===n.length)return t.DUMMY_SCORE;var o,i=t.DUMMY_SCORE,c=a(l(n,e,r,0,0));try{for(c.s();!(o=c.n()).done;){var u=o.value;u=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}var s=l().mark(q),f=l().mark(O);function p(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=h(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function h(t,e){if(t){if("string"==typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=n)){l.next=12;break}return l.next=10,c;case 10:l.next=14;break;case 12:if(!(c.score+r[o]0)){l.next=16;break}return l.delegateYield(q(t,c,r,n,o-1),"t0",16);case 16:l.next=3;break;case 18:l.next=23;break;case 20:l.prev=20,l.t1=l.catch(1),a.e(l.t1);case 23:return l.prev=23,a.f(),l.finish(23);case 26:case"end":return l.stop()}},s,null,[[1,20,23,26]])}function O(t,e,r,n){var o,a,i,u,c;return l().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:o=e[n],a=p(t.get(o)),l.prev=2,a.s();case 4:if((i=a.n()).done){l.next=19;break}if(u=i.value,(c=r.copy()).addPerm(u,o),!(c.requiredSlots<=0)){l.next=13;break}return l.next=11,c;case 11:l.next=15;break;case 13:if(!(c.unusedSlotsSum0)){l.next=17;break}return l.delegateYield(O(t,e,c,n-1),"t0",17);case 17:l.next=4;break;case 19:l.next=24;break;case 21:l.prev=21,l.t1=l.catch(2),a.e(l.t1);case 24:return l.prev=24,a.f(),l.finish(24);case 27:case"end":return l.stop()}},f,null,[[2,21,24,27]])}var j=function(t,e){var r=e+1,n=t.score*r,o=t.decos.map(function(t){var e=new g.default(t.skills);return e.multiply(r),Object.assign({},t,{affectedByTorsoUp:!0,name:t.name.concat(" (TorsoUp)"),skills:e})}),a=new g.default(t.skills);return a.multiply(r),{score:n,decos:o,skills:a}},_=function(t,e,r,n,o){var i,u=function(t,e){if(e.requiredSlots<=0)return e;if(!(e.unusedSlotsSum0&&c>0){var f,h=t.getSlotsExceptChest().concat(e.weaponSlots?e.weaponSlots:[]),d=s-c,v=new k.default(n,d,l),y=p(o.get(c));try{for(y.s();!(f=y.n()).done;){var b=f.value,w=j(b,t.torsoUp),S=v.copy();S.addPerm(w,c);var x=u(h,S);if(x){i=x;break}}}catch(E){y.e(E)}finally{y.f()}}else{i=u(t.getSlots().concat(e.weaponSlots?e.weaponSlots:[]),new k.default(n,t.totalSlots+e.weaponSlots,l))}return i},P=function(t,r,n,o,a){var i=new g.default(o.skillActivations.map(function(t){return[t.requiredSkill,t.requiredPoints]})),u=A(r,i),c=x.getDecoSlotScoreMap(u),l=L(o.armorType),s=x.getScoreFromSkillMap(i,i)-c.get(o.weaponSlots),f=new E.default(r,i),h=t;h.push(n);var d=h.map(function(t){return t.map(function(t){var e=c.get(t.slots)+x.getScoreFromSkillMap(t.skills,i);return Object.assign({},t,{score:e})})}),v=Math.max.apply(Math,e(d[1].map(function(t){return t.score}))),y=[d[1],d[0].map(function(t){return x.scoreTorsoUpPieces(t,v)}),d[2],d[3].map(function(t){return x.scoreTorsoUpPieces(t,v)}),d[4].map(function(t){return x.scoreTorsoUpPieces(t,v)}),d[5]].map(function(t){return t.sort(function(t,e){return e.score-t.score})}),m=[0],b=0;y.map(function(t){return t[0].score}).forEach(function(t){b+=t,m.push(b)});var S,k=0,O=[],j=p(q(y,l,m,s,y.length-1));try{for(j.s();!(S=j.n()).done;){var P=S.value;console.log(P);var T=_(P,o,i,f,u);if(T){var M=new w.default(P,T,a.skillActivation);if(O.push(M),k===o.limit-1)break;k++}}}catch(D){j.e(D)}finally{j.f()}return O},T=function(t,e,r,n,o){var a=t.map(function(t,e){return S.applyArmorFilter(t,n.armorRarity,n.armorType,e,n.skillActivations)}),i=S.applyCharmFilter(r,n.skillActivations),u=S.applyRarityFilter(e,n.decoRarity).filter(function(t){return S.filterHasSkill(t,n.skillActivations)});return P(a,u,i,n,o)};exports.search=T; },{"../data-provider/data-provider.module":"mrro","../data-provider/models/equipment/EquipmentCategory":"XByd","../data-provider/models/equipment/EquipmentSkills":"gZ5g","../scorer/models/ArmorEvaluation":"aAyu","./models/ArmorSet":"pNrS","../data-filter/data-filter.module":"MMJS","../scorer/scorer.module":"zX0v","../scorer/models/DecoEvaluation":"z7Uc","../scorer/models/DecoMinSlotMap":"Ra9L"}],"qhuQ":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getGlobalSettings=function(){var e=document.getElementById("armor-type"),t=document.getElementById("weapon-slots"),r=document.getElementById("armor-rarity"),a=document.getElementById("deco-rarity"),n=document.getElementById("search-limit");return{armorType:parseInt(e.value),weaponSlots:parseInt(t.value),armorRarity:parseInt(r.value),decoRarity:parseInt(a.value),limit:parseInt(n.value)}}; },{}],"sJIk":[function(require,module,exports) { "use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t){return o(t)||r(t)||c(t)||n()}function n(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function o(t){if(Array.isArray(t))return s(t)}function a(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=c(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function i(t,e){return h(t)||u(t,e)||c(t,e)||l()}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;S(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:A(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}var f=d().mark(m);Object.defineProperty(exports,"__esModule",{value:!0});var p=require("../../helper/html.helper");function m(t){var e,n,r,o;return d().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:e=w(),n=document.createElement("div"),e.appendChild(n),r=Array.from(t.values()).reduce(function(t,e){return t+e.length},0),o=0;case 5:if(!(o\n Skill\n Weapon\n Head\n Chest\n Arms\n Waist\n Legs\n Charm\n Deco\n Total\n Active\n \n '),l=Array.from(t.evaluation.skills.entries()).sort(function(t,e){var n=i(t,2),r=(n[0],n[1]),o=i(e,2);o[0];return o[1]-r}).map(function(e){var r=i(e,2),o=r[0],l=r[1],c=document.createElement("tr"),s=t.decos.map(function(t){return t.skills.get(o)}).reduce(function(t,e){return t+e},0);c.appendChild(p.htmlToElement("".concat(n.skillName.get(o)?n.skillName.get(o):"",""))),c.appendChild(p.htmlToElement(""));var u,h=a(t.getPieces());try{for(h.s();!(u=h.n()).done;){var d=u.value;c.append(p.htmlToElement("".concat(d.skills.get(o)?d.skills.get(o):"","")))}}catch(m){h.e(m)}finally{h.f()}c.append(p.htmlToElement("".concat(t.charm.skills.get(o)?t.charm.skills.get(o):"",""))),c.append(p.htmlToElement("".concat(s||"",""))),c.append(p.htmlToElement("".concat(l,"")));var f=t.evaluation.activations.find(function(t){return t.requiredSkill===o});return f&&c.append(p.htmlToElement("').concat(f.name,""))),c}),c=document.createElement("tr");c.appendChild(p.htmlToElement("Slots")),[r.weaponSlots].concat(e(t.getPieces().map(function(t){return t.slots})),[t.charm.slots]).forEach(function(t){return c.appendChild(p.htmlToElement("".concat(t,"")))});var s=p.htmlToElement('
');s.appendChild(o),l.forEach(function(t){return s.appendChild(t)}),s.appendChild(c);var u,h=new Map,d=a(t.decos);try{for(d.s();!(u=d.n()).done;){var f=u.value.name;h.set(f,1+(h.get(f)||0))}}catch(w){d.e(w)}finally{d.f()}var m=Array.from(h.entries()).map(function(t){var e=i(t,2),n=e[0],r=e[1];return"".concat(r," x ").concat(n)}).join(", "),v=p.htmlToElement("\n
".concat(m,"
\n ")),y=p.htmlToElement(''),g=p.htmlToElement(''),b=p.htmlToElement('
');return b.appendChild(s),g.appendChild(b),y.appendChild(g),b.appendChild(v),y},g=function(t,e,n){for(var r=n.skillActivations,o=t.evaluation.activations.filter(function(t){return!t.isPositive||!r.find(function(e){return e.requiredSkill===t.requiredSkill})||r.find(function(e){return e.requiredSkill===t.requiredSkill&&t.requiredPoints>e.requiredPoints})}).sort(function(t,e){return e.requiredPoints-t.requiredPoints}).map(function(t){return'').concat(t.name,"")}),a=p.htmlToElement(''),i=p.htmlToElement('\n \n '.concat(t.head.name,"\n ").concat(t.chest.name,"\n ").concat(t.arms.name,"\n ").concat(t.waist.name,"\n ").concat(t.legs.name,"\n ").concat(t.charm.name,"\n ")),l=p.htmlToElement('\n \n \n

DEF '.concat(t.evaluation.defense.max,'

\n

FIR ').concat(t.evaluation.resistance[0],'

\n

WAT ').concat(t.evaluation.resistance[1],'

\n

ICE ').concat(t.evaluation.resistance[2],'

\n

THN ').concat(t.evaluation.resistance[3],'

\n

DRG ').concat(t.evaluation.resistance[4],'

\n ').concat(o.join(""),"\n \n ")),c=function(){return y(t,e,n)},s=0,u=[i,l];s'));r.appendChild(p.htmlToElement("".concat(t.name,""))),r.addEventListener("click",function(){b(r)}),e.appendChild(r)};for(r.s();!(n=r.n()).done;)o()}catch(i){r.e(i)}finally{r.f()}}else e.appendChild(p.htmlToElement('\n