{
  "version": 3,
  "sources": ["/cdn/shop/t/48/assets/sat-home-featured-patch.js?x=1665"],
  "sourcesContent": ["/*\n * Home \"Featured This Week\" \u2014 6 real, in-stock items, tag-driven.\n *\n * Loaded after sat-app.js (defer, in order) and before the app's first render, so\n * it wraps SATComponent.prototype.renderVals before SAT.mount() ever calls it.\n * Which 6 products show is entirely the merchant's call: tag a product \"featured\"\n * on its Shopify product page and it takes a slot; edit that product's title,\n * price, photo, description, or era on the product page and the card updates on\n * its own \u2014 no theme or code edit either way.\n *\n * The filtering happens here in JS against window.SAT_DATA.products (which now\n * carries each product's tags \u2014 see snippets/sat-bootstrap.liquid) rather than in\n * Liquid: Shopify's `where` filter does an exact-match on a property, not an\n * array-contains check, so `sat_products | where: 'tags', 'featured'` never\n * actually matched a tag and silently always fell back to the first 6 products.\n * `tags.indexOf('featured') !== -1` below is the real check.\n *\n * Ordering within whichever pool ends up on screen \u2014 the tagged set, or the\n * full catalog when nothing's tagged \u2014 used to just be catalog order (Shopify's\n * own default sort), which put whatever the merchant happened to add last (or\n * first) in the storefront's single most visible spot for no reason tied to\n * the business. Sorted now by assets/sat-sales-rank.js's shared\n * bestSellersFirst() \u2014 real order-count-and-revenue data from this shop's own\n * analytics, in-stock items ahead of sold-out ones \u2014 the same ranking The\n * Southern Air Import's home-page teaser sorts by (assets/sat-import-pager-\n * patch.js), so the two most visible product spots on the site never\n * disagree about what's actually selling. It's a ranking signal, not a\n * filter: a product with no sales history yet still shows (falls to the back\n * of its pool, not out of it), and the merchant's own \"featured\" tag still\n * overrides all of this by choosing the pool in the first place.\n */\n(function () {\n  'use strict';\n  if (!window.SATComponent) { return; }\n\n  var orig = window.SATComponent.prototype.renderVals;\n  window.SATComponent.prototype.renderVals = function () {\n    var out = orig.call(this);\n    var self = this;\n    var pool = (self._products || []).filter(function (p) {\n      return p.tags && p.tags.indexOf('featured') !== -1;\n    });\n    if (!pool.length) pool = self._products || [];\n    var ranked = window.SATSalesRank ? window.SATSalesRank.bestSellersFirst(pool) : pool;\n    var items = ranked.slice(0, 6);\n\n    for (var i = 0; i < 6; i++) {\n      (function (i) {\n        var p = items[i];\n        var key = function (k) { return 'hf' + i + k; };\n        if (!p) {\n          out[key('Show')] = 'none';\n          out[key('Id')] = '';\n          out[key('Photo')] = '';\n          out[key('SlotId')] = 'hf-empty-' + i;\n          out[key('Name')] = '';\n          out[key('Blurb')] = '';\n          out[key('PriceLabel')] = '';\n          out[key('EraLabel')] = '';\n          out[key('StockLabel')] = '';\n          out[key('Open')] = function () {};\n          return;\n        }\n        out[key('Show')] = 'block';\n        out[key('Id')] = p.id;\n        out[key('Photo')] = p.photo || '';\n        out[key('SlotId')] = 'hf-' + p.id;\n        out[key('Name')] = p.name;\n        out[key('Blurb')] = p.blurb;\n        out[key('PriceLabel')] = '$' + p.price;\n        out[key('EraLabel')] = p.era ? (p.era + ' record') : 'In Stock';\n        out[key('StockLabel')] = p.stock <= 0 ? 'Sold Out' : (p.stock > 5 ? 'In Stock' : 'Only ' + p.stock + ' On File');\n        out[key('Open')] = function () {\n          self.setState({ detailId: p.id });\n          self.noteSeen(p.id, p.name);\n          self.siteTone('b', 0.045);\n        };\n      })(i);\n    }\n    return out;\n  };\n})();\n"],
  "mappings": "CA+BC,UAAY,CACX,aACA,GAAK,OAAO,aAEZ,KAAI,KAAO,OAAO,aAAa,UAAU,WACzC,OAAO,aAAa,UAAU,WAAa,UAAY,CACrD,IAAI,IAAM,KAAK,KAAK,IAAI,EACpB,KAAO,KACP,MAAQ,KAAK,WAAa,CAAC,GAAG,OAAO,SAAU,EAAG,CACpD,OAAO,EAAE,MAAQ,EAAE,KAAK,QAAQ,UAAU,IAAM,EAClD,CAAC,EACI,KAAK,SAAQ,KAAO,KAAK,WAAa,CAAC,GAI5C,QAHI,OAAS,OAAO,aAAe,OAAO,aAAa,iBAAiB,IAAI,EAAI,KAC5E,MAAQ,OAAO,MAAM,EAAG,CAAC,EAEpB,EAAI,EAAG,EAAI,EAAG,KACpB,SAAUA,G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