import { _ as _applyDecoratedDescriptor, a as _initializerDefineProperty } from '../_rollupPluginBabelHelpers-9wjJaosZ.js';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { guidFor } from '@ember/object/internals';
import Service from '@ember/service';

var _class, _descriptor;
let EuiToasterService = (_class = class EuiToasterService extends Service {
  constructor(...args) {
    super(...args);
    _initializerDefineProperty(this, "toasts", _descriptor, this);
  }
  show(props) {
    if (!props.id) {
      props.id = guidFor(props);
    }
    this.toasts = [...this.toasts, props];
  }
  remove(toastToRemove) {
    this.toasts = this.toasts.filter(toast => toast !== toastToRemove);
  }
}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "toasts", [tracked], {
  configurable: true,
  enumerable: true,
  writable: true,
  initializer: function () {
    return [];
  }
}), _applyDecoratedDescriptor(_class.prototype, "show", [action], Object.getOwnPropertyDescriptor(_class.prototype, "show"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "remove", [action], Object.getOwnPropertyDescriptor(_class.prototype, "remove"), _class.prototype)), _class);

export { EuiToasterService as default };
//# sourceMappingURL=eui-toaster.js.map
