{
  "version": 3,
  "sources": ["/cdn/shop/t/48/assets/sat-department-alias-patch.js?x=2"],
  "sourcesContent": ["/*\n * Merchant: \"go through and put items where they need to be\" \u2014 a full audit\n * of the catalog found roughly 150 real, in-stock products that never show\n * up under any of the six built-in department chips (Field Gear/Uniforms/\n * Aviation/Comms/Load-Bearing), only under \"All\": Collective imports whose\n * own product.type is either blank or a real-but-differently-spelled value\n * (\"Sleeping Bag\", \"Rucksack\", \"Holster\", \"Outerwear\", \"Watches\" \u2014 never\n * exactly \"Field Gear\"/\"Uniforms\"/etc.), so the built-in filter's plain\n * p.cat===activeCat check never matches them.\n *\n * Rather than overwrite product.type to force a match \u2014 which would blur\n * real, specific catalog data for no reason, the same call already made for\n * Modern Tactical/Other/Knives in assets/sat-modern-department-patch.js \u2014\n * this adds a small, additive tag convention: tagging a product with the\n * exact department name (\"Field Gear\", \"Uniforms\", \"Aviation\", \"Comms\" or\n * \"Load-Bearing\") surfaces it under that chip too, without touching its own\n * product.type or the CATEGORY the product detail modal shows for it. See\n * snippets/sat-bootstrap.liquid for where deptOverride is computed and\n * where the same tag convention now also drives a sensible default `cat`\n * for the (much smaller) set of products with no product.type at all.\n *\n * Wraps SATComponent.prototype.visibleProducts once more, only for the five\n * built-in department labels \u2014 the four extra chips (Modern Tactical/Other/\n * Books/Knives) are untouched, already handled by\n * assets/sat-modern-department-patch.js. Loads after that patch (so it only\n * ever needs to special-case real built-in labels) and before\n * assets/sat-random-sort-patch.js, so the extra matches get shuffled and\n * search-filtered exactly like the rest of that department's listing.\n */\n(function () {\n  'use strict';\n  if (!window.SATComponent) { return; }\n\n  var BUILTIN_DEPARTMENTS = ['Field Gear', 'Uniforms', 'Aviation', 'Comms', 'Load-Bearing'];\n\n  var proto = window.SATComponent.prototype;\n\n  var origVisibleProducts = proto.visibleProducts;\n  proto.visibleProducts = function () {\n    var activeCat = this.state.activeCat;\n    if (BUILTIN_DEPARTMENTS.indexOf(activeCat) === -1) { return origVisibleProducts.call(this); }\n    var base = origVisibleProducts.call(this);\n    var q = String(this.state.query || '').trim().toLowerCase();\n    var extra = this._products.filter(function (p) {\n      if (p.cat === activeCat || p.deptOverride !== activeCat) { return false; }\n      var qOk = !q || (p.name + ' ' + p.cat + ' ' + p.era + ' ' + p.id + ' ' + p.blurb).toLowerCase().indexOf(q) !== -1;\n      return qOk;\n    });\n    if (!extra.length) { return base; }\n    var combined = base.concat(extra);\n    if (this.state.sortBy === 'Price, Low to High') { combined.sort(function (a, b) { return a.price - b.price; }); }\n    if (this.state.sortBy === 'Price, High to Low') { combined.sort(function (a, b) { return b.price - a.price; }); }\n    if (this.state.sortBy === 'Oldest Era') { combined.sort(function (a, b) { return a.era.localeCompare(b.era); }); }\n    return combined;\n  };\n})();\n"],
  "mappings": "CA6BC,UAAY,CACX,aACA,GAAK,OAAO,aAEZ,KAAI,oBAAsB,CAAC,aAAc,WAAY,WAAY,QAAS,cAAc,EAEpF,MAAQ,OAAO,aAAa,UAE5B,oBAAsB,MAAM,gBAChC,MAAM,gBAAkB,UAAY,CAClC,IAAI,UAAY,KAAK,MAAM,UAC3B,GAAI,oBAAoB,QAAQ,SAAS,IAAM,GAAM,OAAO,oBAAoB,KAAK,IAAI,EACzF,IAAI,KAAO,oBAAoB,KAAK,IAAI,EACpC,EAAI,OAAO,KAAK,MAAM,OAAS,EAAE,EAAE,KAAK,EAAE,YAAY,EACtD,MAAQ,KAAK,UAAU,OAAO,SAAU,EAAG,CAC7C,GAAI,EAAE,MAAQ,WAAa,EAAE,eAAiB,UAAa,MAAO,GAClE,IAAI,IAAM,CAAC,IAAM,EAAE,KAAO,IAAM,EAAE,IAAM,IAAM,EAAE,IAAM,IAAM,EAAE,GAAK,IAAM,EAAE,OAAO,YAAY,EAAE,QAAQ,CAAC,IAAM,GAC/G,OAAO,GACT,CAAC,EACD,GAAI,CAAC,MAAM,OAAU,OAAO,KAC5B,IAAI,SAAW,KAAK,OAAO,KAAK,EAChC,OAAI,KAAK,MAAM,SAAW,sBAAwB,SAAS,KAAK,SAAU,EAAG,EAAG,CAAE,OAAO,EAAE,MAAQ,EAAE,KAAO,CAAC,EACzG,KAAK,MAAM,SAAW,sBAAwB,SAAS,KAAK,SAAU,EAAG,EAAG,CAAE,OAAO,EAAE,MAAQ,EAAE,KAAO,CAAC,EACzG,KAAK,MAAM,SAAW,cAAgB,SAAS,KAAK,SAAU,EAAG,EAAG,CAAE,OAAO,EAAE,IAAI,cAAc,EAAE,GAAG,CAAG,CAAC,EACvG,QACT,EACF,GAAG",
  "names": []
}
