bootstrap.bundle.js 209 KB
Newer Older
XhmikosR's avatar
Dist    
XhmikosR committed
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066

  };

  var ScrollSpy =
  /*#__PURE__*/
  function () {
    function ScrollSpy(element, config) {
      var _this = this;

      this._element = element;
      this._scrollElement = element.tagName === 'BODY' ? window : element;
      this._config = this._getConfig(config);
      this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " " + Selector$8.DROPDOWN_ITEMS);
      this._offsets = [];
      this._targets = [];
      this._activeTarget = null;
      this._scrollHeight = 0;
      $(this._scrollElement).on(Event$8.SCROLL, function (event) {
        return _this._process(event);
      });
      this.refresh();

      this._process();
    } // Getters


    var _proto = ScrollSpy.prototype;

    // Public
    _proto.refresh = function refresh() {
      var _this2 = this;

      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;
      this._offsets = [];
      this._targets = [];
      this._scrollHeight = this._getScrollHeight();
      var targets = [].slice.call(document.querySelectorAll(this._selector));
      targets.map(function (element) {
        var target;
        var targetSelector = Util.getSelectorFromElement(element);

        if (targetSelector) {
          target = document.querySelector(targetSelector);
        }

        if (target) {
          var targetBCR = target.getBoundingClientRect();

          if (targetBCR.width || targetBCR.height) {
            // TODO (fat): remove sketch reliance on jQuery position/offset
            return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
          }
        }

        return null;
      }).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]);
      });
Mark Otto's avatar
dist    
Mark Otto committed
6067
    };
XhmikosR's avatar
Dist    
XhmikosR committed
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098

    _proto.dispose = function dispose() {
      $.removeData(this._element, DATA_KEY$8);
      $(this._scrollElement).off(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


    _proto._getConfig = function _getConfig(config) {
      config = _objectSpread({}, Default$6, typeof config === 'object' && config ? config : {});

      if (typeof config.target !== 'string') {
        var id = $(config.target).attr('id');

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

        config.target = "#" + id;
      }

      Util.typeCheckConfig(NAME$8, config, DefaultType$6);
      return config;
Mark Otto's avatar
dist    
Mark Otto committed
6099
    };
XhmikosR's avatar
Dist    
XhmikosR committed
6100
6101
6102

    _proto._getScrollTop = function _getScrollTop() {
      return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
Mark Otto's avatar
dist    
Mark Otto committed
6103
    };
XhmikosR's avatar
Dist    
XhmikosR committed
6104
6105
6106

    _proto._getScrollHeight = function _getScrollHeight() {
      return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
Mark Otto's avatar
dist    
Mark Otto committed
6107
    };
Mark Otto's avatar
dist  
Mark Otto committed
6108

XhmikosR's avatar
Dist    
XhmikosR committed
6109
6110
    _proto._getOffsetHeight = function _getOffsetHeight() {
      return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
Mark Otto's avatar
dist    
Mark Otto committed
6111
    };
Mark Otto's avatar
dist  
Mark Otto committed
6112

XhmikosR's avatar
Dist    
XhmikosR committed
6113
6114
    _proto._process = function _process() {
      var scrollTop = this._getScrollTop() + this._config.offset;
Mark Otto's avatar
dist    
Mark Otto committed
6115

XhmikosR's avatar
Dist    
XhmikosR committed
6116
6117
6118
6119
6120
      var scrollHeight = this._getScrollHeight();

      var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();

      if (this._scrollHeight !== scrollHeight) {
Mark Otto's avatar
dist    
Mark Otto committed
6121
        this.refresh();
XhmikosR's avatar
Dist    
XhmikosR committed
6122
      }
Mark Otto's avatar
dist    
Mark Otto committed
6123

XhmikosR's avatar
Dist    
XhmikosR committed
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
      if (scrollTop >= maxScroll) {
        var target = this._targets[this._targets.length - 1];

        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;
      }

      var offsetLength = this._offsets.length;

      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]);

        if (isActiveTarget) {
          this._activate(this._targets[i]);
        }
      }
    };

    _proto._activate = function _activate(target) {
      this._activeTarget = target;

      this._clear();
Mark Otto's avatar
dist  
Mark Otto committed
6157

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

XhmikosR's avatar
Dist    
XhmikosR committed
6162
      var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
Mark Otto's avatar
dist  
Mark Otto committed
6163

XhmikosR's avatar
Dist    
XhmikosR committed
6164
6165
6166
6167
6168
6169
6170
      if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) {
        $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE);
        $link.addClass(ClassName$8.ACTIVE);
      } else {
        // Set triggered link as active
        $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active
        // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
Mark Otto's avatar
dist  
Mark Otto committed
6171

XhmikosR's avatar
Dist    
XhmikosR committed
6172
        $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).addClass(ClassName$8.ACTIVE); // Handle special case when .nav-link is inside .nav-item
Mark Otto's avatar
dist    
Mark Otto committed
6173

XhmikosR's avatar
Dist    
XhmikosR committed
6174
6175
        $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE);
      }
Mark Otto's avatar
dist    
Mark Otto committed
6176

XhmikosR's avatar
Dist    
XhmikosR committed
6177
6178
6179
6180
      $(this._scrollElement).trigger(Event$8.ACTIVATE, {
        relatedTarget: target
      });
    };
Mark Otto's avatar
dist    
Mark Otto committed
6181

XhmikosR's avatar
Dist    
XhmikosR committed
6182
    _proto._clear = function _clear() {
XhmikosR's avatar
Dist    
XhmikosR committed
6183
6184
6185
6186
6187
      [].slice.call(document.querySelectorAll(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
6188
    }; // Static
Mark Otto's avatar
dist    
Mark Otto committed
6189

Mark Otto's avatar
dist  
Mark Otto committed
6190

XhmikosR's avatar
Dist    
XhmikosR committed
6191
6192
6193
    ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var data = $(this).data(DATA_KEY$8);
Mark Otto's avatar
dist  
Mark Otto committed
6194

XhmikosR's avatar
Dist    
XhmikosR committed
6195
        var _config = typeof config === 'object' && config;
Mark Otto's avatar
dist  
Mark Otto committed
6196

XhmikosR's avatar
Dist    
XhmikosR committed
6197
6198
6199
6200
        if (!data) {
          data = new ScrollSpy(this, _config);
          $(this).data(DATA_KEY$8, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
6201

XhmikosR's avatar
Dist    
XhmikosR committed
6202
6203
6204
        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
Mark Otto's avatar
dist    
Mark Otto committed
6205
          }
Mark Otto's avatar
dist    
Mark Otto committed
6206

XhmikosR's avatar
Dist    
XhmikosR committed
6207
          data[config]();
Mark Otto's avatar
dist  
Mark Otto committed
6208
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6209
6210
      });
    };
Mark Otto's avatar
dist    
Mark Otto committed
6211

XhmikosR's avatar
Dist    
XhmikosR committed
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
    _createClass(ScrollSpy, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$8;
      }
    }, {
      key: "Default",
      get: function get() {
        return Default$6;
      }
    }]);
Mark Otto's avatar
dist  
Mark Otto committed
6223

XhmikosR's avatar
Dist    
XhmikosR committed
6224
6225
6226
6227
6228
6229
6230
    return ScrollSpy;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
6231
6232


XhmikosR's avatar
Dist    
XhmikosR committed
6233
6234
6235
  $(window).on(Event$8.LOAD_DATA_API, function () {
    var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY));
    var scrollSpysLength = scrollSpys.length;
Mark Otto's avatar
dist  
Mark Otto committed
6236

XhmikosR's avatar
Dist    
XhmikosR committed
6237
6238
    for (var i = scrollSpysLength; i--;) {
      var $spy = $(scrollSpys[i]);
Mark Otto's avatar
dist    
Mark Otto committed
6239

XhmikosR's avatar
Dist    
XhmikosR committed
6240
6241
6242
6243
6244
6245
6246
6247
      ScrollSpy._jQueryInterface.call($spy, $spy.data());
    }
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist    
Mark Otto committed
6248

XhmikosR's avatar
Dist    
XhmikosR committed
6249
6250
  $.fn[NAME$8] = ScrollSpy._jQueryInterface;
  $.fn[NAME$8].Constructor = ScrollSpy;
Mark Otto's avatar
dist  
Mark Otto committed
6251

XhmikosR's avatar
Dist    
XhmikosR committed
6252
6253
6254
6255
  $.fn[NAME$8].noConflict = function () {
    $.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
    return ScrollSpy._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
6256

XhmikosR's avatar
Dist    
XhmikosR committed
6257
6258
6259
6260
6261
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist    
Mark Otto committed
6262

XhmikosR's avatar
Dist    
XhmikosR committed
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
  var NAME$9 = 'tab';
  var VERSION$9 = '4.1.3';
  var DATA_KEY$9 = 'bs.tab';
  var EVENT_KEY$9 = "." + DATA_KEY$9;
  var DATA_API_KEY$7 = '.data-api';
  var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9];
  var Event$9 = {
    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
  };
  var ClassName$9 = {
    DROPDOWN_MENU: 'dropdown-menu',
    ACTIVE: 'active',
    DISABLED: 'disabled',
    FADE: 'fade',
    SHOW: 'show'
  };
  var Selector$9 = {
    DROPDOWN: '.dropdown',
    NAV_LIST_GROUP: '.nav, .list-group',
    ACTIVE: '.active',
    ACTIVE_UL: '> li > .active',
    DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
    DROPDOWN_TOGGLE: '.dropdown-toggle',
    DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
    /**
     * ------------------------------------------------------------------------
     * Class Definition
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
6296

XhmikosR's avatar
Dist    
XhmikosR committed
6297
  };
Mark Otto's avatar
dist    
Mark Otto committed
6298

XhmikosR's avatar
Dist    
XhmikosR committed
6299
6300
6301
6302
6303
6304
  var Tab =
  /*#__PURE__*/
  function () {
    function Tab(element) {
      this._element = element;
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
6305

Mark Otto's avatar
dist    
Mark Otto committed
6306

XhmikosR's avatar
Dist    
XhmikosR committed
6307
    var _proto = Tab.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
6308

XhmikosR's avatar
Dist    
XhmikosR committed
6309
6310
6311
    // Public
    _proto.show = function show() {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
6312

XhmikosR's avatar
Dist    
XhmikosR committed
6313
6314
6315
      if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
6316

XhmikosR's avatar
Dist    
XhmikosR committed
6317
6318
6319
6320
6321
6322
      var target;
      var previous;
      var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0];
      var selector = Util.getSelectorFromElement(this._element);

      if (listElement) {
XhmikosR's avatar
Dist    
XhmikosR committed
6323
        var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;
XhmikosR's avatar
Dist    
XhmikosR committed
6324
6325
6326
        previous = $.makeArray($(listElement).find(itemSelector));
        previous = previous[previous.length - 1];
      }
Mark Otto's avatar
dist  
Mark Otto committed
6327

XhmikosR's avatar
Dist    
XhmikosR committed
6328
6329
6330
6331
6332
6333
      var hideEvent = $.Event(Event$9.HIDE, {
        relatedTarget: this._element
      });
      var showEvent = $.Event(Event$9.SHOW, {
        relatedTarget: previous
      });
Mark Otto's avatar
dist    
Mark Otto committed
6334

XhmikosR's avatar
Dist    
XhmikosR committed
6335
6336
6337
      if (previous) {
        $(previous).trigger(hideEvent);
      }
Mark Otto's avatar
dist    
Mark Otto committed
6338

XhmikosR's avatar
Dist    
XhmikosR committed
6339
      $(this._element).trigger(showEvent);
Mark Otto's avatar
dist  
Mark Otto committed
6340

XhmikosR's avatar
Dist    
XhmikosR committed
6341
6342
6343
      if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
6344

XhmikosR's avatar
Dist    
XhmikosR committed
6345
6346
6347
      if (selector) {
        target = document.querySelector(selector);
      }
Mark Otto's avatar
dist    
Mark Otto committed
6348

XhmikosR's avatar
Dist    
XhmikosR committed
6349
      this._activate(this._element, listElement);
Mark Otto's avatar
dist  
Mark Otto committed
6350

XhmikosR's avatar
Dist    
XhmikosR committed
6351
6352
6353
6354
6355
6356
      var complete = function complete() {
        var hiddenEvent = $.Event(Event$9.HIDDEN, {
          relatedTarget: _this._element
        });
        var shownEvent = $.Event(Event$9.SHOWN, {
          relatedTarget: previous
Mark Otto's avatar
dist    
Mark Otto committed
6357
        });
XhmikosR's avatar
Dist    
XhmikosR committed
6358
6359
        $(previous).trigger(hiddenEvent);
        $(_this._element).trigger(shownEvent);
Mark Otto's avatar
dist    
Mark Otto committed
6360
      };
Mark Otto's avatar
dist  
Mark Otto committed
6361

XhmikosR's avatar
Dist    
XhmikosR committed
6362
6363
6364
6365
6366
6367
      if (target) {
        this._activate(target, target.parentNode, complete);
      } else {
        complete();
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
6368

XhmikosR's avatar
Dist    
XhmikosR committed
6369
6370
6371
6372
    _proto.dispose = function dispose() {
      $.removeData(this._element, DATA_KEY$9);
      this._element = null;
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
6373

Mark Otto's avatar
dist    
Mark Otto committed
6374

XhmikosR's avatar
Dist    
XhmikosR committed
6375
6376
    _proto._activate = function _activate(element, container, callback) {
      var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
6377

XhmikosR's avatar
Dist    
XhmikosR committed
6378
      var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector$9.ACTIVE_UL) : $(container).children(Selector$9.ACTIVE);
XhmikosR's avatar
Dist    
XhmikosR committed
6379
6380
6381
6382
6383
      var active = activeElements[0];
      var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE);

      var complete = function complete() {
        return _this2._transitionComplete(element, active, callback);
Mark Otto's avatar
dist    
Mark Otto committed
6384
      };
Mark Otto's avatar
dist    
Mark Otto committed
6385

XhmikosR's avatar
Dist    
XhmikosR committed
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
      if (active && isTransitioning) {
        var transitionDuration = Util.getTransitionDurationFromElement(active);
        $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
      } else {
        complete();
      }
    };

    _proto._transitionComplete = function _transitionComplete(element, active, callback) {
      if (active) {
        $(active).removeClass(ClassName$9.ACTIVE);
        var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0];

        if (dropdownChild) {
          $(dropdownChild).removeClass(ClassName$9.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
6401
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6402
6403
6404

        if (active.getAttribute('role') === 'tab') {
          active.setAttribute('aria-selected', false);
Mark Otto's avatar
dist    
Mark Otto committed
6405
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6406
      }
Mark Otto's avatar
dist  
Mark Otto committed
6407

XhmikosR's avatar
Dist    
XhmikosR committed
6408
6409
6410
6411
6412
      $(element).addClass(ClassName$9.ACTIVE);

      if (element.getAttribute('role') === 'tab') {
        element.setAttribute('aria-selected', true);
      }
Mark Otto's avatar
dist    
Mark Otto committed
6413

XhmikosR's avatar
Dist    
XhmikosR committed
6414
6415
      Util.reflow(element);
      $(element).addClass(ClassName$9.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
6416

XhmikosR's avatar
Dist    
XhmikosR committed
6417
6418
      if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) {
        var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0];
Mark Otto's avatar
dist    
Mark Otto committed
6419

XhmikosR's avatar
Dist    
XhmikosR committed
6420
6421
6422
6423
        if (dropdownElement) {
          var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE));
          $(dropdownToggleList).addClass(ClassName$9.ACTIVE);
        }
Mark Otto's avatar
dist  
Mark Otto committed
6424

XhmikosR's avatar
Dist    
XhmikosR committed
6425
        element.setAttribute('aria-expanded', true);
Mark Otto's avatar
dist    
Mark Otto committed
6426
      }
Mark Otto's avatar
dist    
Mark Otto committed
6427

XhmikosR's avatar
Dist    
XhmikosR committed
6428
6429
6430
6431
6432
      if (callback) {
        callback();
      }
    }; // Static

Mark Otto's avatar
dist  
Mark Otto committed
6433

XhmikosR's avatar
Dist    
XhmikosR committed
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
    Tab._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var $this = $(this);
        var data = $this.data(DATA_KEY$9);

        if (!data) {
          data = new Tab(this);
          $this.data(DATA_KEY$9, data);
        }

        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
          }

          data[config]();
        }
      });
Mark Otto's avatar
dist    
Mark Otto committed
6452
    };
Mark Otto's avatar
dist  
Mark Otto committed
6453

XhmikosR's avatar
Dist    
XhmikosR committed
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
    _createClass(Tab, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$9;
      }
    }]);

    return Tab;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */


  $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) {
    event.preventDefault();

    Tab._jQueryInterface.call($(this), 'show');
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */

  $.fn[NAME$9] = Tab._jQueryInterface;
  $.fn[NAME$9].Constructor = Tab;

  $.fn[NAME$9].noConflict = function () {
    $.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
    return Tab._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
6488
6489

  /**
XhmikosR's avatar
Dist    
XhmikosR committed
6490
6491
6492
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
6493
   */
Mark Otto's avatar
dist    
Mark Otto committed
6494

XhmikosR's avatar
Dist    
XhmikosR committed
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
  var NAME$a = 'toast';
  var VERSION$a = '4.1.3';
  var DATA_KEY$a = 'bs.toast';
  var EVENT_KEY$a = "." + DATA_KEY$a;
  var JQUERY_NO_CONFLICT$a = $.fn[NAME$a];
  var Event$a = {
    CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a,
    HIDE: "hide" + EVENT_KEY$a,
    HIDDEN: "hidden" + EVENT_KEY$a,
    SHOW: "show" + EVENT_KEY$a,
    SHOWN: "shown" + EVENT_KEY$a
  };
  var ClassName$a = {
    FADE: 'fade',
    HIDE: 'hide',
    SHOW: 'show'
  };
  var DefaultType$7 = {
    animation: 'boolean',
    autohide: 'boolean',
    delay: 'number'
  };
  var Default$7 = {
    animation: true,
    autohide: true,
    delay: 500
  };
  var Selector$a = {
    DATA_DISMISS: '[data-dismiss="toast"]'
Mark Otto's avatar
dist    
Mark Otto committed
6524
6525
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
6526
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
6527
6528
     * ------------------------------------------------------------------------
     */
XhmikosR's avatar
Dist    
XhmikosR committed
6529

XhmikosR's avatar
Dist    
XhmikosR committed
6530
  };
Mark Otto's avatar
dist  
Mark Otto committed
6531

XhmikosR's avatar
Dist    
XhmikosR committed
6532
6533
6534
6535
6536
6537
6538
  var Toast =
  /*#__PURE__*/
  function () {
    function Toast(element, config) {
      this._element = element;
      this._config = this._getConfig(config);
      this._timeout = null;
Mark Otto's avatar
dist  
Mark Otto committed
6539

XhmikosR's avatar
Dist    
XhmikosR committed
6540
6541
      this._setListeners();
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
6542
6543


XhmikosR's avatar
Dist    
XhmikosR committed
6544
    var _proto = Toast.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
6545

XhmikosR's avatar
Dist    
XhmikosR committed
6546
6547
6548
    // Public
    _proto.show = function show() {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
6549

XhmikosR's avatar
Dist    
XhmikosR committed
6550
      $(this._element).trigger(Event$a.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
6551

XhmikosR's avatar
Dist    
XhmikosR committed
6552
6553
6554
      if (this._config.animation) {
        this._element.classList.add(ClassName$a.FADE);
      }
Mark Otto's avatar
dist  
Mark Otto committed
6555

XhmikosR's avatar
Dist    
XhmikosR committed
6556
6557
      var complete = function complete() {
        $(_this._element).trigger(Event$a.SHOWN);
Mark Otto's avatar
dist  
Mark Otto committed
6558

XhmikosR's avatar
Dist    
XhmikosR committed
6559
6560
        if (_this._config.autohide) {
          _this.hide();
Mark Otto's avatar
dist    
Mark Otto committed
6561
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6562
      };
Mark Otto's avatar
dist  
Mark Otto committed
6563

XhmikosR's avatar
Dist    
XhmikosR committed
6564
      this._element.classList.add(ClassName$a.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
6565

XhmikosR's avatar
Dist    
XhmikosR committed
6566
6567
6568
6569
6570
6571
6572
      if (this._config.animation) {
        var transitionDuration = Util.getTransitionDurationFromElement(this._element);
        $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
      } else {
        complete();
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
6573

XhmikosR's avatar
Dist    
XhmikosR committed
6574
6575
    _proto.hide = function hide(withoutTimeout) {
      var _this2 = this;
Mark Otto's avatar
dist    
Mark Otto committed
6576

XhmikosR's avatar
Dist    
XhmikosR committed
6577
6578
6579
      if (!this._element.classList.contains(ClassName$a.SHOW)) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
6580

XhmikosR's avatar
Dist    
XhmikosR committed
6581
      $(this._element).trigger(Event$a.HIDE);
XhmikosR's avatar
Dist    
XhmikosR committed
6582

XhmikosR's avatar
Dist    
XhmikosR committed
6583
6584
6585
6586
6587
6588
6589
6590
      if (withoutTimeout) {
        this._close();
      } else {
        this._timeout = setTimeout(function () {
          _this2._close();
        }, this._config.delay);
      }
    };
XhmikosR's avatar
Dist    
XhmikosR committed
6591

XhmikosR's avatar
Dist    
XhmikosR committed
6592
6593
6594
    _proto.dispose = function dispose() {
      clearTimeout(this._timeout);
      this._timeout = null;
Mark Otto's avatar
dist  
Mark Otto committed
6595

XhmikosR's avatar
Dist    
XhmikosR committed
6596
6597
6598
      if (this._element.classList.contains(ClassName$a.SHOW)) {
        this._element.classList.remove(ClassName$a.SHOW);
      }
Mark Otto's avatar
dist  
Mark Otto committed
6599

XhmikosR's avatar
Dist    
XhmikosR committed
6600
6601
6602
6603
6604
      $(this._element).off(Event$a.CLICK_DISMISS);
      $.removeData(this._element, DATA_KEY$a);
      this._element = null;
      this._config = null;
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
6605
6606


XhmikosR's avatar
Dist    
XhmikosR committed
6607
6608
6609
6610
6611
6612
6613
6614
    _proto._getConfig = function _getConfig(config) {
      config = _objectSpread({}, Default$7, $(this._element).data(), typeof config === 'object' && config ? config : {});
      Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
      return config;
    };

    _proto._setListeners = function _setListeners() {
      var _this3 = this;
Mark Otto's avatar
dist    
Mark Otto committed
6615

XhmikosR's avatar
Dist    
XhmikosR committed
6616
6617
6618
6619
      $(this._element).on(Event$a.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () {
        return _this3.hide(true);
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
6620

XhmikosR's avatar
Dist    
XhmikosR committed
6621
6622
    _proto._close = function _close() {
      var _this4 = this;
Mark Otto's avatar
dist  
Mark Otto committed
6623

XhmikosR's avatar
Dist    
XhmikosR committed
6624
6625
6626
      var complete = function complete() {
        $(_this4._element).trigger(Event$a.HIDDEN);
      };
XhmikosR's avatar
Dist    
XhmikosR committed
6627

XhmikosR's avatar
Dist    
XhmikosR committed
6628
      this._element.classList.remove(ClassName$a.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
6629

XhmikosR's avatar
Dist    
XhmikosR committed
6630
6631
6632
6633
6634
6635
6636
      if (this._config.animation) {
        var transitionDuration = Util.getTransitionDurationFromElement(this._element);
        $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
      } else {
        complete();
      }
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
6637

XhmikosR's avatar
Dist    
XhmikosR committed
6638

XhmikosR's avatar
Dist    
XhmikosR committed
6639
6640
6641
6642
    Toast._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var $element = $(this);
        var data = $element.data(DATA_KEY$a);
Mark Otto's avatar
dist  
Mark Otto committed
6643

XhmikosR's avatar
Dist    
XhmikosR committed
6644
        var _config = typeof config === 'object' && config;
Mark Otto's avatar
dist  
Mark Otto committed
6645

XhmikosR's avatar
Dist    
XhmikosR committed
6646
6647
6648
6649
        if (!data) {
          data = new Toast(this, _config);
          $element.data(DATA_KEY$a, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
6650

XhmikosR's avatar
Dist    
XhmikosR committed
6651
6652
6653
        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
Mark Otto's avatar
dist  
Mark Otto committed
6654
          }
Mark Otto's avatar
dist    
Mark Otto committed
6655

XhmikosR's avatar
Dist    
XhmikosR committed
6656
          data[config](this);
XhmikosR's avatar
Dist    
XhmikosR committed
6657
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6658
6659
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
6660

XhmikosR's avatar
Dist    
XhmikosR committed
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
    _createClass(Toast, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$a;
      }
    }, {
      key: "DefaultType",
      get: function get() {
        return DefaultType$7;
      }
    }]);
Mark Otto's avatar
dist  
Mark Otto committed
6672

XhmikosR's avatar
Dist    
XhmikosR committed
6673
6674
6675
6676
6677
6678
6679
    return Toast;
  }();
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */
XhmikosR's avatar
Dist    
XhmikosR committed
6680

Mark Otto's avatar
dist    
Mark Otto committed
6681

XhmikosR's avatar
Dist    
XhmikosR committed
6682
6683
  $.fn[NAME$a] = Toast._jQueryInterface;
  $.fn[NAME$a].Constructor = Toast;
Mark Otto's avatar
dist  
Mark Otto committed
6684

XhmikosR's avatar
Dist    
XhmikosR committed
6685
6686
6687
6688
  $.fn[NAME$a].noConflict = function () {
    $.fn[NAME$a] = JQUERY_NO_CONFLICT$a;
    return Toast._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
6689

Mark Otto's avatar
dist    
Mark Otto committed
6690
6691
  /**
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
6692
   * Bootstrap (v4.1.3): index.js
Mark Otto's avatar
dist    
Mark Otto committed
6693
6694
6695
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
6696

XhmikosR's avatar
Dist    
XhmikosR committed
6697
6698
  (function () {
    if (typeof $ === 'undefined') {
Mark Otto's avatar
dist    
Mark Otto committed
6699
6700
      throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
    }
Mark Otto's avatar
dist  
Mark Otto committed
6701

XhmikosR's avatar
Dist    
XhmikosR committed
6702
    var version = $.fn.jquery.split(' ')[0].split('.');
Mark Otto's avatar
dist    
Mark Otto committed
6703
6704
6705
6706
6707
    var minMajor = 1;
    var ltMajor = 2;
    var minMinor = 9;
    var minPatch = 1;
    var maxMajor = 4;
Mark Otto's avatar
dist    
Mark Otto committed
6708

Mark Otto's avatar
dist    
Mark Otto committed
6709
6710
6711
    if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
      throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
    }
XhmikosR's avatar
Dist    
XhmikosR committed
6712
  })();
Mark Otto's avatar
dist    
Mark Otto committed
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723

  exports.Util = Util;
  exports.Alert = Alert;
  exports.Button = Button;
  exports.Carousel = Carousel;
  exports.Collapse = Collapse;
  exports.Dropdown = Dropdown;
  exports.Modal = Modal;
  exports.Popover = Popover;
  exports.Scrollspy = ScrollSpy;
  exports.Tab = Tab;
XhmikosR's avatar
Dist    
XhmikosR committed
6724
  exports.Toast = Toast;
Mark Otto's avatar
dist    
Mark Otto committed
6725
6726
6727
  exports.Tooltip = Tooltip;

  Object.defineProperty(exports, '__esModule', { value: true });
Mark Otto's avatar
dist  
Mark Otto committed
6728

Mark Otto's avatar
dist    
Mark Otto committed
6729
})));
Mark Otto's avatar
dist    
Mark Otto committed
6730
//# sourceMappingURL=bootstrap.bundle.js.map
For faster browsing, not all history is shown. View entire blame