bootstrap.esm.js 145 KB
Newer Older
XhmikosR's avatar
Dist.  
XhmikosR committed
4001
4002
4003
4004
4005
4006
4007
        return data;
      };
    } else {
      offset.offset = this.config.offset;
    }

    return offset;
XhmikosR's avatar
XhmikosR committed
4008
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4009

XhmikosR's avatar
XhmikosR committed
4010
  _proto._getContainer = function _getContainer() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4011
4012
4013
4014
4015
4016
4017
4018
4019
    if (this.config.container === false) {
      return document.body;
    }

    if (isElement(this.config.container)) {
      return this.config.container;
    }

    return SelectorEngine.findOne(this.config.container);
XhmikosR's avatar
XhmikosR committed
4020
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4021

XhmikosR's avatar
XhmikosR committed
4022
  _proto._getAttachment = function _getAttachment(placement) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4023
    return AttachmentMap$1[placement.toUpperCase()];
XhmikosR's avatar
XhmikosR committed
4024
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4025

XhmikosR's avatar
XhmikosR committed
4026
4027
4028
4029
4030
  _proto._setListeners = function _setListeners() {
    var _this4 = this;

    var triggers = this.config.trigger.split(' ');
    triggers.forEach(function (trigger) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4031
      if (trigger === 'click') {
XhmikosR's avatar
XhmikosR committed
4032
4033
4034
        EventHandler.on(_this4.element, _this4.constructor.Event.CLICK, _this4.config.selector, function (event) {
          return _this4.toggle(event);
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4035
      } else if (trigger !== Trigger.MANUAL) {
XhmikosR's avatar
XhmikosR committed
4036
4037
4038
4039
4040
4041
4042
4043
        var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN;
        var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT;
        EventHandler.on(_this4.element, eventIn, _this4.config.selector, function (event) {
          return _this4._enter(event);
        });
        EventHandler.on(_this4.element, eventOut, _this4.config.selector, function (event) {
          return _this4._leave(event);
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4044
4045
      }
    });
XhmikosR's avatar
XhmikosR committed
4046
4047
4048
    EventHandler.on(SelectorEngine.closest(this.element, '.modal'), 'hide.bs.modal', function () {
      if (_this4.element) {
        _this4.hide();
XhmikosR's avatar
Dist.  
XhmikosR committed
4049
4050
4051
4052
      }
    });

    if (this.config.selector) {
XhmikosR's avatar
XhmikosR committed
4053
      this.config = _objectSpread({}, this.config, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4054
4055
4056
4057
4058
4059
        trigger: 'manual',
        selector: ''
      });
    } else {
      this._fixTitle();
    }
XhmikosR's avatar
XhmikosR committed
4060
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4061

XhmikosR's avatar
XhmikosR committed
4062
4063
  _proto._fixTitle = function _fixTitle() {
    var titleType = typeof this.element.getAttribute('data-original-title');
XhmikosR's avatar
Dist.  
XhmikosR committed
4064
4065
4066
4067
4068

    if (this.element.getAttribute('title') || titleType !== 'string') {
      this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
      this.element.setAttribute('title', '');
    }
XhmikosR's avatar
XhmikosR committed
4069
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4070

XhmikosR's avatar
XhmikosR committed
4071
4072
  _proto._enter = function _enter(event, context) {
    var dataKey = this.constructor.DATA_KEY;
XhmikosR's avatar
Dist.  
XhmikosR committed
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
    context = context || Data.getData(event.delegateTarget, dataKey);

    if (!context) {
      context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
      Data.setData(event.delegateTarget, dataKey, context);
    }

    if (event) {
      context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
    }

    if (context.getTipElement().classList.contains(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) {
      context._hoverState = HoverState.SHOW;
      return;
    }

    clearTimeout(context._timeout);
    context._hoverState = HoverState.SHOW;

    if (!context.config.delay || !context.config.delay.show) {
      context.show();
      return;
    }

XhmikosR's avatar
XhmikosR committed
4097
    context._timeout = setTimeout(function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
4098
4099
4100
4101
      if (context._hoverState === HoverState.SHOW) {
        context.show();
      }
    }, context.config.delay.show);
XhmikosR's avatar
XhmikosR committed
4102
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4103

XhmikosR's avatar
XhmikosR committed
4104
4105
  _proto._leave = function _leave(event, context) {
    var dataKey = this.constructor.DATA_KEY;
XhmikosR's avatar
Dist.  
XhmikosR committed
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
    context = context || Data.getData(event.delegateTarget, dataKey);

    if (!context) {
      context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
      Data.setData(event.delegateTarget, dataKey, context);
    }

    if (event) {
      context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
    }

    if (context._isWithActiveTrigger()) {
      return;
    }

    clearTimeout(context._timeout);
    context._hoverState = HoverState.OUT;

    if (!context.config.delay || !context.config.delay.hide) {
      context.hide();
      return;
    }

XhmikosR's avatar
XhmikosR committed
4129
    context._timeout = setTimeout(function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
4130
4131
4132
4133
      if (context._hoverState === HoverState.OUT) {
        context.hide();
      }
    }, context.config.delay.hide);
XhmikosR's avatar
XhmikosR committed
4134
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4135

XhmikosR's avatar
XhmikosR committed
4136
4137
  _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
    for (var trigger in this._activeTrigger) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4138
4139
4140
4141
4142
4143
      if (this._activeTrigger[trigger]) {
        return true;
      }
    }

    return false;
XhmikosR's avatar
XhmikosR committed
4144
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4145

XhmikosR's avatar
XhmikosR committed
4146
4147
4148
  _proto._getConfig = function _getConfig(config) {
    var dataAttributes = Manipulator.getDataAttributes(this.element);
    Object.keys(dataAttributes).forEach(function (dataAttr) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4149
4150
4151
4152
4153
4154
4155
4156
4157
      if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
        delete dataAttributes[dataAttr];
      }
    });

    if (config && typeof config.container === 'object' && config.container.jquery) {
      config.container = config.container[0];
    }

XhmikosR's avatar
XhmikosR committed
4158
    config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181

    if (typeof config.delay === 'number') {
      config.delay = {
        show: config.delay,
        hide: config.delay
      };
    }

    if (typeof config.title === 'number') {
      config.title = config.title.toString();
    }

    if (typeof config.content === 'number') {
      config.content = config.content.toString();
    }

    typeCheckConfig(NAME$6, config, this.constructor.DefaultType);

    if (config.sanitize) {
      config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
    }

    return config;
XhmikosR's avatar
XhmikosR committed
4182
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4183

XhmikosR's avatar
XhmikosR committed
4184
4185
  _proto._getDelegateConfig = function _getDelegateConfig() {
    var config = {};
XhmikosR's avatar
Dist.  
XhmikosR committed
4186
4187

    if (this.config) {
XhmikosR's avatar
XhmikosR committed
4188
      for (var key in this.config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4189
4190
4191
4192
4193
4194
4195
        if (this.constructor.Default[key] !== this.config[key]) {
          config[key] = this.config[key];
        }
      }
    }

    return config;
XhmikosR's avatar
XhmikosR committed
4196
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4197

XhmikosR's avatar
XhmikosR committed
4198
4199
4200
  _proto._cleanTipClass = function _cleanTipClass() {
    var tip = this.getTipElement();
    var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
XhmikosR's avatar
Dist.  
XhmikosR committed
4201
4202

    if (tabClass !== null && tabClass.length) {
XhmikosR's avatar
XhmikosR committed
4203
4204
4205
4206
4207
      tabClass.map(function (token) {
        return token.trim();
      }).forEach(function (tClass) {
        return tip.classList.remove(tClass);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
4208
    }
XhmikosR's avatar
XhmikosR committed
4209
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4210

XhmikosR's avatar
XhmikosR committed
4211
4212
  _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
    var popperInstance = popperData.instance;
XhmikosR's avatar
Dist.  
XhmikosR committed
4213
4214
4215
4216
4217
    this.tip = popperInstance.popper;

    this._cleanTipClass();

    this.addAttachmentClass(this._getAttachment(popperData.placement));
XhmikosR's avatar
XhmikosR committed
4218
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4219

XhmikosR's avatar
XhmikosR committed
4220
4221
4222
  _proto._fixTransition = function _fixTransition() {
    var tip = this.getTipElement();
    var initConfigAnimation = this.config.animation;
XhmikosR's avatar
Dist.  
XhmikosR committed
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233

    if (tip.getAttribute('x-placement') !== null) {
      return;
    }

    tip.classList.remove(ClassName$6.FADE);
    this.config.animation = false;
    this.hide();
    this.show();
    this.config.animation = initConfigAnimation;
  } // Static
XhmikosR's avatar
XhmikosR committed
4234
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4235

XhmikosR's avatar
XhmikosR committed
4236
  Tooltip._jQueryInterface = function _jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4237
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4238
      var data = Data.getData(this, DATA_KEY$6);
XhmikosR's avatar
Dist.  
XhmikosR committed
4239

XhmikosR's avatar
XhmikosR committed
4240
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251

      if (!data && /dispose|hide/.test(config)) {
        return;
      }

      if (!data) {
        data = new Tooltip(this, _config);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4252
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4253
4254
4255
4256
4257
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4258
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4259

XhmikosR's avatar
XhmikosR committed
4260
  Tooltip._getInstance = function _getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4261
    return Data.getData(element, DATA_KEY$6);
XhmikosR's avatar
XhmikosR committed
4262
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4263

XhmikosR's avatar
XhmikosR committed
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
  _createClass(Tooltip, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$6;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$4;
    }
  }, {
    key: "NAME",
    get: function get() {
      return NAME$6;
    }
  }, {
    key: "DATA_KEY",
    get: function get() {
      return DATA_KEY$6;
    }
  }, {
    key: "Event",
    get: function get() {
      return Event$7;
    }
  }, {
    key: "EVENT_KEY",
    get: function get() {
      return EVENT_KEY$6;
    }
  }, {
    key: "DefaultType",
    get: function get() {
      return DefaultType$4;
    }
  }]);

  return Tooltip;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
4303
4304
4305
4306
4307
4308
4309
4310
4311
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .tooltip to jQuery only if jQuery is present
 */


if (typeof jQuery !== 'undefined') {
XhmikosR's avatar
XhmikosR committed
4312
  var JQUERY_NO_CONFLICT$6 = jQuery.fn[NAME$6];
XhmikosR's avatar
Dist.  
XhmikosR committed
4313
4314
4315
  jQuery.fn[NAME$6] = Tooltip._jQueryInterface;
  jQuery.fn[NAME$6].Constructor = Tooltip;

XhmikosR's avatar
XhmikosR committed
4316
4317
  jQuery.fn[NAME$6].noConflict = function () {
    jQuery.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
XhmikosR's avatar
Dist.  
XhmikosR committed
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
    return Tooltip._jQueryInterface;
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
4328
4329
4330
4331
4332
4333
var NAME$7 = 'popover';
var VERSION$7 = '4.3.1';
var DATA_KEY$7 = 'bs.popover';
var EVENT_KEY$7 = "." + DATA_KEY$7;
var CLASS_PREFIX$1 = 'bs-popover';
var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
XhmikosR's avatar
Dist.  
XhmikosR committed
4334

XhmikosR's avatar
XhmikosR committed
4335
var Default$5 = _objectSpread({}, Tooltip.Default, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4336
4337
4338
4339
4340
4341
  placement: 'right',
  trigger: 'click',
  content: '',
  template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
});

XhmikosR's avatar
XhmikosR committed
4342
var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4343
4344
4345
  content: '(string|element|function)'
});

XhmikosR's avatar
XhmikosR committed
4346
var ClassName$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4347
4348
4349
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
4350
var Selector$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4351
4352
4353
  TITLE: '.popover-header',
  CONTENT: '.popover-body'
};
XhmikosR's avatar
XhmikosR committed
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
var Event$8 = {
  HIDE: "hide" + EVENT_KEY$7,
  HIDDEN: "hidden" + EVENT_KEY$7,
  SHOW: "show" + EVENT_KEY$7,
  SHOWN: "shown" + EVENT_KEY$7,
  INSERTED: "inserted" + EVENT_KEY$7,
  CLICK: "click" + EVENT_KEY$7,
  FOCUSIN: "focusin" + EVENT_KEY$7,
  FOCUSOUT: "focusout" + EVENT_KEY$7,
  MOUSEENTER: "mouseenter" + EVENT_KEY$7,
  MOUSELEAVE: "mouseleave" + EVENT_KEY$7
XhmikosR's avatar
Dist.  
XhmikosR committed
4365
4366
4367
4368
4369
4370
4371
4372
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
4373
4374
4375
4376
var Popover =
/*#__PURE__*/
function (_Tooltip) {
  _inheritsLoose(Popover, _Tooltip);
XhmikosR's avatar
Dist.  
XhmikosR committed
4377

XhmikosR's avatar
XhmikosR committed
4378
4379
  function Popover() {
    return _Tooltip.apply(this, arguments) || this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4380
4381
  }

XhmikosR's avatar
XhmikosR committed
4382
  var _proto = Popover.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4383

XhmikosR's avatar
XhmikosR committed
4384
4385
  // Overrides
  _proto.isWithContent = function isWithContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4386
    return this.getTitle() || this._getContent();
XhmikosR's avatar
XhmikosR committed
4387
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4388

XhmikosR's avatar
XhmikosR committed
4389
4390
4391
  _proto.addAttachmentClass = function addAttachmentClass(attachment) {
    this.getTipElement().classList.add(CLASS_PREFIX$1 + "-" + attachment);
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4392

XhmikosR's avatar
XhmikosR committed
4393
4394
  _proto.setContent = function setContent() {
    var tip = this.getTipElement(); // we use append for html objects to maintain js events
XhmikosR's avatar
Dist.  
XhmikosR committed
4395
4396
4397

    this.setElementContent(SelectorEngine.findOne(Selector$7.TITLE, tip), this.getTitle());

XhmikosR's avatar
XhmikosR committed
4398
    var content = this._getContent();
XhmikosR's avatar
Dist.  
XhmikosR committed
4399
4400
4401
4402
4403
4404
4405
4406
4407

    if (typeof content === 'function') {
      content = content.call(this.element);
    }

    this.setElementContent(SelectorEngine.findOne(Selector$7.CONTENT, tip), content);
    tip.classList.remove(ClassName$7.FADE);
    tip.classList.remove(ClassName$7.SHOW);
  } // Private
XhmikosR's avatar
XhmikosR committed
4408
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4409

XhmikosR's avatar
XhmikosR committed
4410
  _proto._getContent = function _getContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4411
    return this.element.getAttribute('data-content') || this.config.content;
XhmikosR's avatar
XhmikosR committed
4412
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4413

XhmikosR's avatar
XhmikosR committed
4414
4415
4416
  _proto._cleanTipClass = function _cleanTipClass() {
    var tip = this.getTipElement();
    var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
4417
4418

    if (tabClass !== null && tabClass.length > 0) {
XhmikosR's avatar
XhmikosR committed
4419
4420
4421
4422
4423
      tabClass.map(function (token) {
        return token.trim();
      }).forEach(function (tClass) {
        return tip.classList.remove(tClass);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
4424
4425
    }
  } // Static
XhmikosR's avatar
XhmikosR committed
4426
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4427

XhmikosR's avatar
XhmikosR committed
4428
  Popover._jQueryInterface = function _jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4429
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4430
      var data = Data.getData(this, DATA_KEY$7);
XhmikosR's avatar
Dist.  
XhmikosR committed
4431

XhmikosR's avatar
XhmikosR committed
4432
      var _config = typeof config === 'object' ? config : null;
XhmikosR's avatar
Dist.  
XhmikosR committed
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444

      if (!data && /dispose|hide/.test(config)) {
        return;
      }

      if (!data) {
        data = new Popover(this, _config);
        Data.setData(this, DATA_KEY$7, data);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4445
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4446
4447
4448
4449
4450
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4451
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4452

XhmikosR's avatar
XhmikosR committed
4453
  Popover._getInstance = function _getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4454
    return Data.getData(element, DATA_KEY$7);
XhmikosR's avatar
XhmikosR committed
4455
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4456

XhmikosR's avatar
XhmikosR committed
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
  _createClass(Popover, null, [{
    key: "VERSION",
    // Getters
    get: function get() {
      return VERSION$7;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$5;
    }
  }, {
    key: "NAME",
    get: function get() {
      return NAME$7;
    }
  }, {
    key: "DATA_KEY",
    get: function get() {
      return DATA_KEY$7;
    }
  }, {
    key: "Event",
    get: function get() {
      return Event$8;
    }
  }, {
    key: "EVENT_KEY",
    get: function get() {
      return EVENT_KEY$7;
    }
  }, {
    key: "DefaultType",
    get: function get() {
      return DefaultType$5;
    }
  }]);

  return Popover;
}(Tooltip);
XhmikosR's avatar
Dist.  
XhmikosR committed
4497
4498
4499
4500
4501
4502
4503
4504
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 */


if (typeof jQuery !== 'undefined') {
XhmikosR's avatar
XhmikosR committed
4505
  var JQUERY_NO_CONFLICT$7 = jQuery.fn[NAME$7];
XhmikosR's avatar
Dist.  
XhmikosR committed
4506
4507
4508
  jQuery.fn[NAME$7] = Popover._jQueryInterface;
  jQuery.fn[NAME$7].Constructor = Popover;

XhmikosR's avatar
XhmikosR committed
4509
4510
  jQuery.fn[NAME$7].noConflict = function () {
    jQuery.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
XhmikosR's avatar
Dist.  
XhmikosR committed
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
    return Popover._jQueryInterface;
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
4521
4522
4523
4524
4525
4526
var NAME$8 = 'scrollspy';
var VERSION$8 = '4.3.1';
var DATA_KEY$8 = 'bs.scrollspy';
var EVENT_KEY$8 = "." + DATA_KEY$8;
var DATA_API_KEY$6 = '.data-api';
var Default$6 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4527
4528
4529
4530
  offset: 10,
  method: 'auto',
  target: ''
};
XhmikosR's avatar
XhmikosR committed
4531
var DefaultType$6 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4532
4533
4534
4535
  offset: 'number',
  method: 'string',
  target: '(string|element)'
};
XhmikosR's avatar
XhmikosR committed
4536
4537
4538
4539
var Event$9 = {
  ACTIVATE: "activate" + EVENT_KEY$8,
  SCROLL: "scroll" + EVENT_KEY$8,
  LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6
XhmikosR's avatar
Dist.  
XhmikosR committed
4540
};
XhmikosR's avatar
XhmikosR committed
4541
var ClassName$8 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4542
4543
4544
  DROPDOWN_ITEM: 'dropdown-item',
  ACTIVE: 'active'
};
XhmikosR's avatar
XhmikosR committed
4545
var Selector$8 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4546
4547
4548
4549
4550
4551
4552
4553
  DATA_SPY: '[data-spy="scroll"]',
  NAV_LIST_GROUP: '.nav, .list-group',
  NAV_LINKS: '.nav-link',
  NAV_ITEMS: '.nav-item',
  LIST_ITEMS: '.list-group-item',
  DROPDOWN: '.dropdown',
  DROPDOWN_TOGGLE: '.dropdown-toggle'
};
XhmikosR's avatar
XhmikosR committed
4554
var OffsetMethod = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
  OFFSET: 'offset',
  POSITION: 'position'
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
4565
4566
4567
4568
4569
4570
var ScrollSpy =
/*#__PURE__*/
function () {
  function ScrollSpy(element, config) {
    var _this = this;

XhmikosR's avatar
Dist.  
XhmikosR committed
4571
4572
4573
    this._element = element;
    this._scrollElement = element.tagName === 'BODY' ? window : element;
    this._config = this._getConfig(config);
XhmikosR's avatar
XhmikosR committed
4574
    this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " ." + ClassName$8.DROPDOWN_ITEM);
XhmikosR's avatar
Dist.  
XhmikosR committed
4575
4576
4577
4578
    this._offsets = [];
    this._targets = [];
    this._activeTarget = null;
    this._scrollHeight = 0;
XhmikosR's avatar
XhmikosR committed
4579
4580
4581
    EventHandler.on(this._scrollElement, Event$9.SCROLL, function (event) {
      return _this._process(event);
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4582
4583
4584
4585
4586
4587
4588
4589
    this.refresh();

    this._process();

    Data.setData(element, DATA_KEY$8, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
4590
  var _proto = ScrollSpy.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4591

XhmikosR's avatar
XhmikosR committed
4592
4593
4594
  // Public
  _proto.refresh = function refresh() {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4595

XhmikosR's avatar
XhmikosR committed
4596
4597
4598
    var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
    var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
    var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
XhmikosR's avatar
Dist.  
XhmikosR committed
4599
4600
4601
    this._offsets = [];
    this._targets = [];
    this._scrollHeight = this._getScrollHeight();
XhmikosR's avatar
XhmikosR committed
4602
4603
4604
4605
    var targets = makeArray(SelectorEngine.find(this._selector));
    targets.map(function (element) {
      var target;
      var targetSelector = getSelectorFromElement(element);
XhmikosR's avatar
Dist.  
XhmikosR committed
4606
4607
4608
4609
4610
4611

      if (targetSelector) {
        target = SelectorEngine.findOne(targetSelector);
      }

      if (target) {
XhmikosR's avatar
XhmikosR committed
4612
        var targetBCR = target.getBoundingClientRect();
XhmikosR's avatar
Dist.  
XhmikosR committed
4613
4614
4615
4616
4617
4618
4619

        if (targetBCR.width || targetBCR.height) {
          return [Manipulator[offsetMethod](target).top + offsetBase, targetSelector];
        }
      }

      return null;
XhmikosR's avatar
XhmikosR committed
4620
4621
4622
4623
4624
4625
4626
4627
    }).filter(function (item) {
      return item;
    }).sort(function (a, b) {
      return a[0] - b[0];
    }).forEach(function (item) {
      _this2._offsets.push(item[0]);

      _this2._targets.push(item[1]);
XhmikosR's avatar
Dist.  
XhmikosR committed
4628
    });
XhmikosR's avatar
XhmikosR committed
4629
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4630

XhmikosR's avatar
XhmikosR committed
4631
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
    Data.removeData(this._element, DATA_KEY$8);
    EventHandler.off(this._scrollElement, EVENT_KEY$8);
    this._element = null;
    this._scrollElement = null;
    this._config = null;
    this._selector = null;
    this._offsets = null;
    this._targets = null;
    this._activeTarget = null;
    this._scrollHeight = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
4643
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4644

XhmikosR's avatar
XhmikosR committed
4645
4646
  _proto._getConfig = function _getConfig(config) {
    config = _objectSpread({}, Default$6, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
4647
4648

    if (typeof config.target !== 'string') {
XhmikosR's avatar
XhmikosR committed
4649
      var id = config.target.id;
XhmikosR's avatar
Dist.  
XhmikosR committed
4650
4651
4652
4653
4654
4655

      if (!id) {
        id = getUID(NAME$8);
        config.target.id = id;
      }

XhmikosR's avatar
XhmikosR committed
4656
      config.target = "#" + id;
XhmikosR's avatar
Dist.  
XhmikosR committed
4657
4658
4659
4660
    }

    typeCheckConfig(NAME$8, config, DefaultType$6);
    return config;
XhmikosR's avatar
XhmikosR committed
4661
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4662

XhmikosR's avatar
XhmikosR committed
4663
  _proto._getScrollTop = function _getScrollTop() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4664
    return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
XhmikosR's avatar
XhmikosR committed
4665
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4666

XhmikosR's avatar
XhmikosR committed
4667
  _proto._getScrollHeight = function _getScrollHeight() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4668
    return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
XhmikosR's avatar
XhmikosR committed
4669
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4670

XhmikosR's avatar
XhmikosR committed
4671
  _proto._getOffsetHeight = function _getOffsetHeight() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4672
    return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
XhmikosR's avatar
XhmikosR committed
4673
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4674

XhmikosR's avatar
XhmikosR committed
4675
4676
  _proto._process = function _process() {
    var scrollTop = this._getScrollTop() + this._config.offset;
XhmikosR's avatar
Dist.  
XhmikosR committed
4677

XhmikosR's avatar
XhmikosR committed
4678
    var scrollHeight = this._getScrollHeight();
XhmikosR's avatar
Dist.  
XhmikosR committed
4679

XhmikosR's avatar
XhmikosR committed
4680
    var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
XhmikosR's avatar
Dist.  
XhmikosR committed
4681
4682
4683
4684
4685
4686

    if (this._scrollHeight !== scrollHeight) {
      this.refresh();
    }

    if (scrollTop >= maxScroll) {
XhmikosR's avatar
XhmikosR committed
4687
      var target = this._targets[this._targets.length - 1];
XhmikosR's avatar
Dist.  
XhmikosR committed
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703

      if (this._activeTarget !== target) {
        this._activate(target);
      }

      return;
    }

    if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
      this._activeTarget = null;

      this._clear();

      return;
    }

XhmikosR's avatar
XhmikosR committed
4704
    var offsetLength = this._offsets.length;
XhmikosR's avatar
Dist.  
XhmikosR committed
4705

XhmikosR's avatar
XhmikosR committed
4706
4707
    for (var i = offsetLength; i--;) {
      var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
XhmikosR's avatar
Dist.  
XhmikosR committed
4708
4709
4710
4711
4712

      if (isActiveTarget) {
        this._activate(this._targets[i]);
      }
    }
XhmikosR's avatar
XhmikosR committed
4713
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4714

XhmikosR's avatar
XhmikosR committed
4715
  _proto._activate = function _activate(target) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4716
4717
4718
4719
    this._activeTarget = target;

    this._clear();

XhmikosR's avatar
XhmikosR committed
4720
4721
4722
    var queries = this._selector.split(',').map(function (selector) {
      return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4723

XhmikosR's avatar
XhmikosR committed
4724
    var link = SelectorEngine.findOne(queries.join(','));
XhmikosR's avatar
Dist.  
XhmikosR committed
4725
4726
4727
4728
4729
4730
4731

    if (link.classList.contains(ClassName$8.DROPDOWN_ITEM)) {
      SelectorEngine.findOne(Selector$8.DROPDOWN_TOGGLE, SelectorEngine.closest(link, Selector$8.DROPDOWN)).classList.add(ClassName$8.ACTIVE);
      link.classList.add(ClassName$8.ACTIVE);
    } else {
      // Set triggered link as active
      link.classList.add(ClassName$8.ACTIVE);
XhmikosR's avatar
XhmikosR committed
4732
      SelectorEngine.parents(link, Selector$8.NAV_LIST_GROUP).forEach(function (listGroup) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4733
4734
        // Set triggered links parents as active
        // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
XhmikosR's avatar
XhmikosR committed
4735
4736
4737
        SelectorEngine.prev(listGroup, Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).forEach(function (item) {
          return item.classList.add(ClassName$8.ACTIVE);
        }); // Handle special case when .nav-link is inside .nav-item
XhmikosR's avatar
Dist.  
XhmikosR committed
4738

XhmikosR's avatar
XhmikosR committed
4739
4740
4741
4742
        SelectorEngine.prev(listGroup, Selector$8.NAV_ITEMS).forEach(function (navItem) {
          SelectorEngine.children(navItem, Selector$8.NAV_LINKS).forEach(function (item) {
            return item.classList.add(ClassName$8.ACTIVE);
          });
XhmikosR's avatar
Dist.  
XhmikosR committed
4743
4744
4745
4746
4747
4748
4749
        });
      });
    }

    EventHandler.trigger(this._scrollElement, Event$9.ACTIVATE, {
      relatedTarget: target
    });
XhmikosR's avatar
XhmikosR committed
4750
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4751

XhmikosR's avatar
XhmikosR committed
4752
4753
4754
4755
4756
4757
  _proto._clear = function _clear() {
    makeArray(SelectorEngine.find(this._selector)).filter(function (node) {
      return node.classList.contains(ClassName$8.ACTIVE);
    }).forEach(function (node) {
      return node.classList.remove(ClassName$8.ACTIVE);
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4758
  } // Static
XhmikosR's avatar
XhmikosR committed
4759
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4760

XhmikosR's avatar
XhmikosR committed
4761
  ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4762
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4763
      var data = Data.getData(this, DATA_KEY$8);
XhmikosR's avatar
Dist.  
XhmikosR committed
4764

XhmikosR's avatar
XhmikosR committed
4765
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
4766
4767
4768
4769
4770
4771
4772

      if (!data) {
        data = new ScrollSpy(this, _config);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4773
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4774
4775
4776
4777
4778
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4779
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4780

XhmikosR's avatar
XhmikosR committed
4781
  ScrollSpy._getInstance = function _getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4782
    return Data.getData(element, DATA_KEY$8);
XhmikosR's avatar
XhmikosR committed
4783
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4784

XhmikosR's avatar
XhmikosR committed
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
  _createClass(ScrollSpy, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$8;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$6;
    }
  }]);

  return ScrollSpy;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
4799
4800
4801
4802
4803
4804
4805
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
4806
4807
4808
4809
EventHandler.on(window, Event$9.LOAD_DATA_API, function () {
  makeArray(SelectorEngine.find(Selector$8.DATA_SPY)).forEach(function (spy) {
    return new ScrollSpy(spy, Manipulator.getDataAttributes(spy));
  });
XhmikosR's avatar
Dist.  
XhmikosR committed
4810
4811
4812
4813
4814
4815
4816
4817
});
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 */

if (typeof jQuery !== 'undefined') {
XhmikosR's avatar
XhmikosR committed
4818
  var JQUERY_NO_CONFLICT$8 = jQuery.fn[NAME$8];
XhmikosR's avatar
Dist.  
XhmikosR committed
4819
4820
4821
  jQuery.fn[NAME$8] = ScrollSpy._jQueryInterface;
  jQuery.fn[NAME$8].Constructor = ScrollSpy;

XhmikosR's avatar
XhmikosR committed
4822
4823
  jQuery.fn[NAME$8].noConflict = function () {
    jQuery.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
XhmikosR's avatar
Dist.  
XhmikosR committed
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
    return ScrollSpy._jQueryInterface;
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
var NAME$9 = 'tab';
var VERSION$9 = '4.3.1';
var DATA_KEY$9 = 'bs.tab';
var EVENT_KEY$9 = "." + DATA_KEY$9;
var DATA_API_KEY$7 = '.data-api';
var Event$a = {
  HIDE: "hide" + EVENT_KEY$9,
  HIDDEN: "hidden" + EVENT_KEY$9,
  SHOW: "show" + EVENT_KEY$9,
  SHOWN: "shown" + EVENT_KEY$9,
  CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7
XhmikosR's avatar
Dist.  
XhmikosR committed
4845
};
XhmikosR's avatar
XhmikosR committed
4846
var ClassName$9 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4847
4848
4849
4850
4851
4852
  DROPDOWN_MENU: 'dropdown-menu',
  ACTIVE: 'active',
  DISABLED: 'disabled',
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
4853
var Selector$9 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
  DROPDOWN: '.dropdown',
  NAV_LIST_GROUP: '.nav, .list-group',
  ACTIVE: '.active',
  ACTIVE_UL: ':scope > li > .active',
  DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
  DROPDOWN_TOGGLE: '.dropdown-toggle',
  DROPDOWN_ACTIVE_CHILD: ':scope > .dropdown-menu .active'
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
4869
4870
4871
4872
var Tab =
/*#__PURE__*/
function () {
  function Tab(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4873
4874
4875
4876
4877
    this._element = element;
    Data.setData(this._element, DATA_KEY$9, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
4878
  var _proto = Tab.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4879

XhmikosR's avatar
XhmikosR committed
4880
4881
4882
  // Public
  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4883
4884
4885
4886
4887

    if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(ClassName$9.ACTIVE) || this._element.classList.contains(ClassName$9.DISABLED)) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
4888
4889
4890
4891
    var target;
    var previous;
    var listElement = SelectorEngine.closest(this._element, Selector$9.NAV_LIST_GROUP);
    var selector = getSelectorFromElement(this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
4892
4893

    if (listElement) {
XhmikosR's avatar
XhmikosR committed
4894
      var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;
XhmikosR's avatar
Dist.  
XhmikosR committed
4895
4896
4897
4898
      previous = makeArray(SelectorEngine.find(itemSelector, listElement));
      previous = previous[previous.length - 1];
    }

XhmikosR's avatar
XhmikosR committed
4899
    var hideEvent = null;
XhmikosR's avatar
Dist.  
XhmikosR committed
4900
4901
4902
4903
4904
4905
4906

    if (previous) {
      hideEvent = EventHandler.trigger(previous, Event$a.HIDE, {
        relatedTarget: this._element
      });
    }

XhmikosR's avatar
XhmikosR committed
4907
    var showEvent = EventHandler.trigger(this._element, Event$a.SHOW, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
      relatedTarget: previous
    });

    if (showEvent.defaultPrevented || hideEvent !== null && hideEvent.defaultPrevented) {
      return;
    }

    if (selector) {
      target = SelectorEngine.findOne(selector);
    }

    this._activate(this._element, listElement);

XhmikosR's avatar
XhmikosR committed
4921
    var complete = function complete() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4922
      EventHandler.trigger(previous, Event$a.HIDDEN, {
XhmikosR's avatar
XhmikosR committed
4923
        relatedTarget: _this._element
XhmikosR's avatar
Dist.  
XhmikosR committed
4924
      });
XhmikosR's avatar
XhmikosR committed
4925
      EventHandler.trigger(_this._element, Event$a.SHOWN, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4926
4927
4928
4929
4930
4931
4932
4933
4934
        relatedTarget: previous
      });
    };

    if (target) {
      this._activate(target, target.parentNode, complete);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
4935
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4936

XhmikosR's avatar
XhmikosR committed
4937
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4938
4939
4940
    Data.removeData(this._element, DATA_KEY$9);
    this._element = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
4941
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4942

XhmikosR's avatar
XhmikosR committed
4943
4944
  _proto._activate = function _activate(element, container, callback) {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4945

XhmikosR's avatar
XhmikosR committed
4946
4947
4948
    var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine.find(Selector$9.ACTIVE_UL, container) : SelectorEngine.children(container, Selector$9.ACTIVE);
    var active = activeElements[0];
    var isTransitioning = callback && active && active.classList.contains(ClassName$9.FADE);
XhmikosR's avatar
Dist.  
XhmikosR committed
4949

XhmikosR's avatar
XhmikosR committed
4950
4951
4952
    var complete = function complete() {
      return _this2._transitionComplete(element, active, callback);
    };
XhmikosR's avatar
Dist.  
XhmikosR committed
4953
4954

    if (active && isTransitioning) {
XhmikosR's avatar
XhmikosR committed
4955
      var transitionDuration = getTransitionDurationFromElement(active);
XhmikosR's avatar
Dist.  
XhmikosR committed
4956
4957
4958
4959
4960
4961
      active.classList.remove(ClassName$9.SHOW);
      EventHandler.one(active, TRANSITION_END, complete);
      emulateTransitionEnd(active, transitionDuration);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
4962
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4963

XhmikosR's avatar
XhmikosR committed
4964
  _proto._transitionComplete = function _transitionComplete(element, active, callback) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4965
4966
    if (active) {
      active.classList.remove(ClassName$9.ACTIVE);
XhmikosR's avatar
XhmikosR committed
4967
      var dropdownChild = SelectorEngine.findOne(Selector$9.DROPDOWN_ACTIVE_CHILD, active.parentNode);
XhmikosR's avatar
Dist.  
XhmikosR committed
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990

      if (dropdownChild) {
        dropdownChild.classList.remove(ClassName$9.ACTIVE);
      }

      if (active.getAttribute('role') === 'tab') {
        active.setAttribute('aria-selected', false);
      }
    }

    element.classList.add(ClassName$9.ACTIVE);

    if (element.getAttribute('role') === 'tab') {
      element.setAttribute('aria-selected', true);
    }

    reflow(element);

    if (element.classList.contains(ClassName$9.FADE)) {
      element.classList.add(ClassName$9.SHOW);
    }

    if (element.parentNode && element.parentNode.classList.contains(ClassName$9.DROPDOWN_MENU)) {
XhmikosR's avatar
XhmikosR committed
4991
      var dropdownElement = SelectorEngine.closest(element, Selector$9.DROPDOWN);
XhmikosR's avatar
Dist.  
XhmikosR committed
4992
4993

      if (dropdownElement) {
XhmikosR's avatar
XhmikosR committed
4994
4995
4996
        makeArray(SelectorEngine.find(Selector$9.DROPDOWN_TOGGLE)).forEach(function (dropdown) {
          return dropdown.classList.add(ClassName$9.ACTIVE);
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4997
4998
4999
5000
      }

      element.setAttribute('aria-expanded', true);
    }
For faster browsing, not all history is shown. View entire blame