{
  "version": 3,
  "sources": ["/cdn/shop/t/3/assets/tb-menu.js?x=1794560348747"],
  "sourcesContent": ["/* Adds the Toybox extras to Horizon's menus:\n   - mobile drawer: search box, quick links, help card, and the Vault tag on the Collectors item;\n   - dropdowns (desktop mega menu and mobile drawer): an icon beside each section heading and link.\n     Shop and Gifting icons use the colourful brand palette; Collectors icons are gold.\n     Brand links get a small badge with the brand's initials: in the brand's own colours under Shop,\n     and in navy and gold under Collectors.\n   Horizon re-renders the header after load (replacing its nodes), so the extras are (re)added whenever\n   the header or menu drawer changes, when the page finishes loading, and when a menu is hovered or opened.\n   (Performance, 2026-11-07: changes elsewhere on the page, such as the countdown ticking every second,\n   no longer trigger a re-scan of the menus. Original in assets/bak-20261107-tb-menu.js.)\n   Icons are matched on the link's text. To add an icon for a new menu link, add its text (lower case)\n   and an icon name below; the icon must also be listed in snippets/tb-menu-extras.liquid.\n   To add a brand badge, add the brand to BRANDS (Shop) or VAULT_BRANDS (Collectors).\n   Cart (2026-11-13): phones show the floating cart pill instead of a header cart icon, so the drawer's quick\n   links start with a Cart link to the full cart page, with the toy count from the header badge, and end with\n   Contact us so the six tiles make an even grid. Original in assets/bak-20261113-tb-menu.js. */\n(() => {\n  const ICONS = {\n    // Shop\n    'shop by category': 'grid', 'shop by brand': 'tag', 'shop by age': 'cake', 'shop by price': 'rupee',\n    'gifts by occasion': 'gift', 'featured': 'star',\n    'die-cast & model cars': 'die-cast', 'lego & building sets': 'building', 'dolls & pretend play': 'dolls',\n    'action figures & collectibles': 'figure', 'games & puzzles': 'games', 'rc cars & drones': 'rc',\n    'learning & creative': 'learning', 'fun & fidget': 'fun', 'electronic toys': 'sound-on', 'back to school': 'pencil',\n    'shop all toys': 'grid', 'all brands': 'tag',\n    '0\u20133 years': 'baby', '4\u20137 years': 'fun', '8\u201312 years': 'learning', 'teens': 'teen', 'adults & collectors': 'vault',\n    'under \u20B9500': 'rupee', '\u20B9500 \u2013 \u20B9999': 'rupee', '\u20B91,000 \u2013 \u20B92,499': 'rupee', '\u20B92,500 & above': 'rupee',\n    'birthdays': 'cake', 'diwali & festive': 'lamp', 'new baby': 'baby', 'good results': 'cap', 'gift cards': 'card', 'all gifts': 'gift',\n    'bestsellers': 'trend', 'new arrivals': 'sparkle', 'for boys': 'teen', 'for girls': 'teen', \"collector's vault\": 'vault',\n    // Gifting\n    'gift finder': 'magnify', 'shop by occasion': 'confetti', 'gift card': 'card', 'bulk gifting': 'box',\n    'find the perfect gift': 'sparkle', 'gifts under \u20B9500': 'rupee', 'gifts under \u20B91,000': 'rupee', 'gifts under \u20B92,500': 'rupee',\n    'gifts by age': 'cake', 'for the collector': 'vault', 'buy a gift card': 'card', 'gift wrap & messages': 'gift',\n    'gifting questions': 'question', 'party return gifts': 'confetti', 'corporate gifting': 'doc', 'get a bulk quote': 'chat'\n  };\n  // Collectors: shown in gold.\n  const GOLD = {\n    'collect by line': 'gem', 'collect by brand': 'crown', 'view the next drop': 'calendar',\n    'premium die-cast': 'die-cast', '1:64 scale': 'ruler', 'f1 & motorsport': 'flag', 'collector figures & kits': 'figure',\n    'explore the vault': 'vault', 'all vault brands': 'crown',\n    \"what's in this drop\": 'box', 'how pre-booking works': 'clock', 'get early access': 'lock', 'how we verify': 'shield'\n  };\n  // Shop brand badges: initials on the brand's own colours (a simple colour cue, not the brand's logo).\n  const BRANDS = {\n    'lego': ['L', '#E3000B', '#FFFFFF', '#FFD500'],\n    'hot wheels': ['HW', '#F26522', '#FFFFFF'],\n    'bburago': ['B', '#C8102E', '#FFFFFF'],\n    'maisto': ['M', '#14306E', '#FFFFFF', '#E31B23'],\n    'mini gt': ['GT', '#111111', '#FFFFFF', '#E10600'],\n    'funskool': ['F', '#0057B8', '#FFD200'],\n    'smartivity': ['S', '#F7941D', '#FFFFFF'],\n    'imagimake': ['i', '#E5007E', '#FFFFFF'],\n    'marble': ['Mb', '#1E4FD8', '#FFC93C']\n  };\n  // Collectors brand badges: the same initials style, in navy and gold.\n  const VAULT_BRANDS = {\n    'mini gt': 'GT', 'tarmac works': 'TW', 'spark': 'S', 'time micro': 'TM', 'bburago': 'B',\n    'maisto': 'M', 'zd toys': 'ZD', 'blokees': 'BK'\n  };\n\n  const keyOf = (t) => t.textContent.trim().toLowerCase().replace(/\\s+/g, ' ').replace(/[\u2018\u2019]/g, \"'\");\n\n  const badge = (text) => {\n    const el = document.createElement('span');\n    el.className = 'tb-mi tb-mi--brand' + (text.length > 1 ? ' tb-mi--brand-2' : '');\n    el.setAttribute('aria-hidden', 'true');\n    el.textContent = text;\n    return el;\n  };\n  const brandBadge = (b) => {\n    const el = badge(b[0]);\n    el.style.setProperty('--mi-bg', b[1]);\n    el.style.setProperty('--mi-fg', b[2]);\n    if (b[3]) el.style.setProperty('--mi-edge', b[3]);\n    return el;\n  };\n\n  const addIcons = () => {\n    const tpl = document.getElementById('tb-menu-icons');\n    if (!tpl) return;\n    document.querySelectorAll('.mega-menu__link .wrap-text, .menu-drawer .menu-drawer__menu-item-text').forEach((t) => {\n      const item = t.closest('a, summary');\n      if (!item || item.querySelector(':scope > .tb-mi')) return;\n      const key = keyOf(t);\n      const isVaultLink = item.matches('a[href*=\"/collections/vault-\"]');\n      let el = null;\n      let name = ICONS[key];\n      let gold = false;\n      if (isVaultLink && VAULT_BRANDS[key]) {\n        el = badge(VAULT_BRANDS[key]);\n        el.classList.add('tb-mi--gold');\n      } else {\n        if (!name && GOLD[key]) { name = GOLD[key]; gold = true; }\n        // Any other link inside Collectors that points at a collector collection gets a gold gem.\n        if (!name && isVaultLink) { name = 'gem'; gold = true; }\n        if (name) {\n          const icon = tpl.content.querySelector('[data-icon=\"' + name + '\"]');\n          if (!icon) return;\n          el = icon.cloneNode(true);\n          if (item.matches('.mega-menu__link--parent, .menu-drawer__menu-item--parent')) el.classList.add('tb-mi--head');\n          if (gold) el.classList.add('tb-mi--gold');\n        } else if (BRANDS[key] && item.matches('a[href*=\"filter.p.vendor\"]')) {\n          el = brandBadge(BRANDS[key]);\n        }\n      }\n      if (!el) return;\n      item.classList.add('tb-has-mi');\n      t.before(el);\n    });\n  };\n\n  const addDrawer = () => {\n    const nav = document.querySelector('.menu-drawer .menu-drawer__navigation');\n    if (!nav) return;\n    const drawer = nav.parentElement;\n    const top = document.getElementById('tb-menu-top');\n    const bottom = document.getElementById('tb-menu-bottom');\n    if (top && !drawer.querySelector('.tb-mm-search')) nav.before(top.content.cloneNode(true));\n    if (bottom && !drawer.querySelector('.tb-mm-extras')) {\n      const util = drawer.querySelector('.menu-drawer__utility-links');\n      (util || nav).after(bottom.content.cloneNode(true));\n    }\n    // Cart link first in the quick links, with the count kept by assets/tb-m-cartpill.js on the header badge.\n    const quick = drawer.querySelector('.tb-mm-quick');\n    if (quick && !quick.querySelector('.tb-mm-cart')) {\n      const root = (window.Shopify && window.Shopify.routes && window.Shopify.routes.root) || '/';\n      quick.insertAdjacentHTML('afterbegin', '<a class=\"tb-mm-cart\" href=\"' + root + 'cart\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M5 8h14l-1 12H6L5 8z\"/><path d=\"M9 8V6a3 3 0 016 0v2\"/></svg><span>Cart</span><b class=\"tb-mm-count\" data-tb-mm-cart hidden></b></a>');\n    }\n    // A sixth tile so the quick links make an even two-by-three grid.\n    if (quick && !quick.querySelector('.tb-mm-contact')) {\n      const root = (window.Shopify && window.Shopify.routes && window.Shopify.routes.root) || '/';\n      quick.insertAdjacentHTML('beforeend', '<a class=\"tb-mm-contact\" href=\"' + root + 'pages/contact\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M4 20l1.3-3.9A8 8 0 1 1 8 19z\"/></svg><span>Contact us</span></a>');\n    }\n    const cnt = drawer.querySelector('[data-tb-mm-cart]');\n    if (cnt) {\n      const from = document.querySelector('header-actions .cart-bubble__text-count');\n      const n = from ? parseInt(from.textContent, 10) || 0 : 0;\n      cnt.textContent = n > 99 ? '99+' : String(n);\n      cnt.hidden = !n;\n      cnt.closest('a').setAttribute('aria-label', n ? 'Cart, ' + n + (n === 1 ? ' item' : ' items') : 'Cart');\n    }\n    // Vault tag on the top-level Collectors item (a link, or a summary now that it has a submenu).\n    nav.querySelectorAll('.menu-drawer__menu-item-text').forEach((t) => {\n      if (t.querySelector('.tb-mm-tag') || t.closest('.menu-drawer__menu-item--child')) return;\n      if (t.textContent.trim().toLowerCase() !== 'collectors') return;\n      const s = document.createElement('span');\n      s.className = 'tb-mm-tag';\n      s.textContent = 'Vault';\n      t.append(s);\n    });\n  };\n\n  const add = () => {\n    try { addIcons(); } catch (e) { console.error('[Toybox] menu icons', e); }\n    try { addDrawer(); } catch (e) { console.error('[Toybox] menu drawer', e); }\n  };\n\n  let queued = 0;\n  const queue = () => {\n    if (queued) return;\n    queued = requestAnimationFrame(() => { queued = 0; add(); });\n  };\n\n  /* Only changes that touch the header or a menu matter: either inside the header / menu drawer,\n     or new nodes that are (or contain) a header, mega menu or menu drawer. */\n  const MENU_AREA = '#header-group, #header-component, header, header-drawer, .menu-drawer, .mega-menu';\n  const relevant = (muts) => {\n    for (const m of muts) {\n      const t = m.target.nodeType === 1 ? m.target : m.target.parentElement;\n      if (t && t.closest?.(MENU_AREA)) return true;\n      for (const n of m.addedNodes) {\n        if (n.nodeType === 1 && (n.matches?.(MENU_AREA) || n.querySelector?.(MENU_AREA))) return true;\n      }\n    }\n    return false;\n  };\n\n  const start = () => {\n    add();\n    // Watch the whole page: the header element itself can be swapped out, which would detach a narrower observer.\n    new MutationObserver((muts) => { if (relevant(muts)) queue(); }).observe(document.body, { childList: true, subtree: true });\n    window.addEventListener('load', add);\n    document.addEventListener('pointerover', (e) => { if (e.target.closest?.('header, .menu-drawer')) queue(); }, { passive: true });\n    document.addEventListener('focusin', (e) => { if (e.target.closest?.('header, .menu-drawer')) queue(); });\n    document.addEventListener('click', (e) => {\n      if (e.target.closest?.('header-drawer, .header__icon--menu, summary')) setTimeout(add, 0);\n    }, true);\n  };\n\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start); else start();\n  document.addEventListener('shopify:section:load', add);\n})();\n"],
  "mappings": "CAgBC,IAAM,CACL,MAAM,MAAQ,CAEZ,mBAAoB,OAAQ,gBAAiB,MAAO,cAAe,OAAQ,gBAAiB,QAC5F,oBAAqB,OAAQ,SAAY,OACzC,wBAAyB,WAAY,uBAAwB,WAAY,uBAAwB,QACjG,gCAAiC,SAAU,kBAAmB,QAAS,mBAAoB,KAC3F,sBAAuB,WAAY,eAAgB,MAAO,kBAAmB,WAAY,iBAAkB,SAC3G,gBAAiB,OAAQ,aAAc,MACvC,iBAAa,OAAQ,iBAAa,MAAO,kBAAc,WAAY,MAAS,OAAQ,sBAAuB,QAC3G,kBAAc,QAAS,6BAAe,QAAS,iCAAmB,QAAS,sBAAkB,QAC7F,UAAa,OAAQ,mBAAoB,OAAQ,WAAY,OAAQ,eAAgB,MAAO,aAAc,OAAQ,YAAa,OAC/H,YAAe,QAAS,eAAgB,UAAW,WAAY,OAAQ,YAAa,OAAQ,oBAAqB,QAEjH,cAAe,UAAW,mBAAoB,WAAY,YAAa,OAAQ,eAAgB,MAC/F,wBAAyB,UAAW,wBAAoB,QAAS,0BAAsB,QAAS,0BAAsB,QACtH,eAAgB,OAAQ,oBAAqB,QAAS,kBAAmB,OAAQ,uBAAwB,OACzG,oBAAqB,WAAY,qBAAsB,WAAY,oBAAqB,MAAO,mBAAoB,MACrH,EAEM,KAAO,CACX,kBAAmB,MAAO,mBAAoB,QAAS,qBAAsB,WAC7E,mBAAoB,WAAY,aAAc,QAAS,kBAAmB,OAAQ,2BAA4B,SAC9G,oBAAqB,QAAS,mBAAoB,QAClD,sBAAuB,MAAO,wBAAyB,QAAS,mBAAoB,OAAQ,gB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