"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _default = function _default() {
  var accordionClass = '.muy-accordion';
  var accordions = $(accordionClass);
  accordions.map(function () {
    var accordion = $(this);
    var title = $(this).find('.accordion-header');
    var content = $(this).find('.accordion-content');
    var accordionGroup = accordion.data('accordion-group');
    var othersInGroup = $("".concat(accordionClass, "[data-accordion-group=\"").concat(accordionGroup, "\"]")).filter(function () {
      return this != accordion[0];
    });
    var othersContentsInGroup = $("".concat(accordionClass, "[data-accordion-group=\"").concat(accordionGroup, "\"] .accordion-content")).filter(function () {
      return this != content[0];
    });
    title.on('click', function (e) {
      e.preventDefault();
      othersContentsInGroup.slideUp();
      othersInGroup.removeClass('open');
      content.slideToggle();
      accordion.toggleClass('open');
    });
  });
};

exports["default"] = _default;