{
  "version": 3,
  "sources": ["/cdn/shop/t/17/assets/airgrilles-itemno-pin-prismoon-v1.js?b=20260813a"],
  "sourcesContent": ["/* prismoon: exact item-no match pin for the search page (v1, 2026-08-13)\n   Scope guard: does NOTHING unless the search query is exactly an item number\n   (NNNNNN-N). Every other search renders exactly as before.\n   1) exact row already on the page -> move it to the top of the tbody + badge\n   2) exact row not on this page    -> lazy-load the item-no map, fetch the\n      product JSON and show a slim \"exact match\" bar above the table\n   Revert: remove the <script> + CSS block from the search section\n   (backup: theme-backups/itemno-pin-20260813). */\n(function () {\n  var PAT = /^\\d{5,7}-\\d{1,3}$/;\n  var self = document.currentScript;\n  var mapUrl = self ? self.getAttribute('data-map-url') : '';\n  var q = '';\n  try {\n    q = (new URLSearchParams(window.location.search).get('q') || '').trim();\n  } catch (e) { return; }\n  if (!PAT.test(q)) return;\n\n  function cellOf(tr) {\n    return tr.querySelector('[data-col=\"item_no\"]') || tr.querySelector('[data-col=\"image\"]');\n  }\n\n  function findRow() {\n    var body = document.querySelector('[data-airgrilles-qo3-body]');\n    if (!body) return null;\n    var rows = body.querySelectorAll('tr[data-airgrilles-qo3-row]');\n    for (var i = 0; i < rows.length; i++) {\n      var cell = cellOf(rows[i]);\n      if (!cell) continue;\n      var txt = (cell.textContent || '').trim();\n      if (txt === q || txt.split(/\\s+/).indexOf(q) > -1) return rows[i];\n    }\n    return null;\n  }\n\n  function pin(tr) {\n    var body = tr.parentNode;\n    if (!body) return;\n    if (body.firstElementChild !== tr) body.insertBefore(tr, body.firstElementChild);\n    tr.classList.add('is-exact-match');\n    // the item number itself carries the highlight: no extra badge line, so the\n    // image keeps its full size and nothing collides with the special-price ribbon\n    var link = tr.querySelector('.airgrilles-qo3__image-item');\n    if (link) link.classList.add('is-exact-match-code');\n  }\n\n  function bar(product) {\n    if (document.querySelector('.airgrilles-qo3__exactbar')) return;\n    var wrap = document.querySelector('.airgrilles-qo3__table-wrap');\n    if (!wrap || !wrap.parentNode) return;\n    var a = document.createElement('a');\n    a.className = 'airgrilles-qo3__exactbar';\n    a.href = product.url || ('/products/' + product.handle);\n    var img = product.featured_image || (product.images && product.images[0]);\n    a.innerHTML =\n      (img ? '<img src=\"' + String(img).split('?')[0] + '?width=120\" alt=\"\" loading=\"lazy\">' : '') +\n      '<span class=\"airgrilles-qo3__exactbar-code\">Item #' + q + '</span>' +\n      '<span class=\"airgrilles-qo3__exactbar-title\"></span>' +\n      '<span class=\"airgrilles-qo3__exactbar-cta\">View product &rsaquo;</span>';\n    a.querySelector('.airgrilles-qo3__exactbar-title').textContent = product.title || '';\n    wrap.parentNode.insertBefore(a, wrap);\n  }\n\n  function fallback() {\n    if (!mapUrl || window.__agItemnoFallbackDone) return;\n    window.__agItemnoFallbackDone = true;\n    var s = document.createElement('script');\n    s.src = mapUrl;\n    s.onload = function () {\n      var map = window.AIRGRILLES_ITEMNO_MAP || {};\n      var handle = map[q];\n      if (!handle) return;\n      fetch('/products/' + handle + '.js', { headers: { Accept: 'application/json' } })\n        .then(function (r) { return r.ok ? r.json() : null; })\n        .then(function (p) { if (p) bar(p); })\n        .catch(function () {});\n    };\n    document.head.appendChild(s);\n  }\n\n  function run() {\n    var tr = findRow();\n    if (tr) pin(tr); else fallback();\n  }\n\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run);\n  else run();\n  // the table script re-sorts rows (sold-out to the bottom) after its own init,\n  // so re-assert the pin once things settle; pin() is idempotent\n  window.addEventListener('load', function () { setTimeout(run, 60); });\n  setTimeout(run, 700);\n})();\n"],
  "mappings": "CAQC,UAAY,CACX,IAAI,IAAM,oBACN,KAAO,SAAS,cAChB,OAAS,KAAO,KAAK,aAAa,cAAc,EAAI,GACpD,EAAI,GACR,GAAI,CACF,GAAK,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAI,GAAG,GAAK,IAAI,KAAK,CACxE,OAAS,EAAG,CAAE,MAAQ,CACtB,GAAI,CAAC,IAAI,KAAK,CAAC,EAAG,OAElB,SAAS,OAA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