/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Drupal, once) {
  var closeMessage = function closeMessage(message) {
    var messageContainer = message.querySelector('[data-drupal-selector="messages-container"]');
    var closeBtnWrapper = document.createElement('div');
    closeBtnWrapper.setAttribute('class', 'messages__button');
    var closeBtn = document.createElement('button');
    closeBtn.setAttribute('type', 'button');
    closeBtn.setAttribute('class', 'messages__close');
    var closeBtnText = document.createElement('span');
    closeBtnText.setAttribute('class', 'visually-hidden');
    closeBtnText.innerText = Drupal.t('Close message');
    messageContainer.appendChild(closeBtnWrapper);
    closeBtnWrapper.appendChild(closeBtn);
    closeBtn.appendChild(closeBtnText);
    closeBtn.addEventListener('click', function () {
      message.classList.add('hidden');
    });
  };
  Drupal.behaviors.messages = {
    attach: function attach(context) {
      once('messages', '[data-drupal-selector="messages"]', context).forEach(closeMessage);
    }
  };
  Drupal.olivero.closeMessage = closeMessage;
})(Drupal, once);