/* Scoped to: history-template-history-faq */
(function() {
  'use strict';
  var componentRoots = document.querySelectorAll('[data-component-slug="history-template-history-faq"]');
  componentRoots.forEach(function(componentRoot) {
    // Helper to query within component, with fallback to document for sibling elements
    var $ = function(sel) { 
      return componentRoot.querySelector(sel) || document.querySelector('[data-component-slug="history-template-history-faq"] ~ ' + sel) || document.querySelector(sel);
    };
    var $$ = function(sel) { 
      var results = componentRoot.querySelectorAll(sel);
      return results.length ? results : document.querySelectorAll(sel);
    };
    // Original component JS runs in this scope
    (function () { setTimeout(function () { var allowMultiple = "{{allow_multiple_open}}" === "true"; var items = document.querySelectorAll(".faq-item"); if (!items.length) return; items.forEach(function (item) { item.addEventListener("click", function () { var isActive = item.classList.contains("active"); if (!allowMultiple) { items.forEach(function (i) { i.classList.remove("active"); }); } if (!isActive) item.classList.add("active"); }); }); }, 0); })();
  });
})();