bootstrap.esm.js 145 KB
Newer Older
XhmikosR's avatar
Dist.  
XhmikosR committed
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012

    EventHandler.off(document, Event$6.FOCUSIN);
    Data.removeData(this._element, DATA_KEY$5);
    this._config = null;
    this._element = null;
    this._dialog = null;
    this._backdrop = null;
    this._isShown = null;
    this._isBodyOverflowing = null;
    this._ignoreBackdropClick = null;
    this._isTransitioning = null;
    this._scrollbarWidth = null;
XhmikosR's avatar
XhmikosR committed
3013
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3014

XhmikosR's avatar
XhmikosR committed
3015
  _proto.handleUpdate = function handleUpdate() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3016
3017
    this._adjustDialog();
  } // Private
XhmikosR's avatar
XhmikosR committed
3018
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3019

XhmikosR's avatar
XhmikosR committed
3020
  _proto._getConfig = function _getConfig(config) {
3021
    config = _objectSpread2({}, Default$3, {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
3022
3023
    typeCheckConfig(NAME$5, config, DefaultType$3);
    return config;
XhmikosR's avatar
XhmikosR committed
3024
3025
3026
3027
  };

  _proto._showElement = function _showElement(relatedTarget) {
    var _this3 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3028

XhmikosR's avatar
XhmikosR committed
3029
    var transition = this._element.classList.contains(ClassName$5.FADE);
XhmikosR's avatar
Dist.  
XhmikosR committed
3030

XhmikosR's avatar
XhmikosR committed
3031
3032
    var modalBody = SelectorEngine.findOne(Selector$5.MODAL_BODY, this._dialog);

XhmikosR's avatar
Dist.  
XhmikosR committed
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
    if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
      // Don't move modal's DOM position
      document.body.appendChild(this._element);
    }

    this._element.style.display = 'block';

    this._element.removeAttribute('aria-hidden');

    this._element.setAttribute('aria-modal', true);

XhmikosR's avatar
XhmikosR committed
3044
3045
    if (this._dialog.classList.contains(ClassName$5.SCROLLABLE) && modalBody) {
      modalBody.scrollTop = 0;
XhmikosR's avatar
Dist.  
XhmikosR committed
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
    } else {
      this._element.scrollTop = 0;
    }

    if (transition) {
      reflow(this._element);
    }

    this._element.classList.add(ClassName$5.SHOW);

    if (this._config.focus) {
      this._enforceFocus();
    }

XhmikosR's avatar
XhmikosR committed
3060
3061
3062
    var transitionComplete = function transitionComplete() {
      if (_this3._config.focus) {
        _this3._element.focus();
XhmikosR's avatar
Dist.  
XhmikosR committed
3063
3064
      }

XhmikosR's avatar
XhmikosR committed
3065
3066
3067
      _this3._isTransitioning = false;
      EventHandler.trigger(_this3._element, Event$6.SHOWN, {
        relatedTarget: relatedTarget
XhmikosR's avatar
Dist.  
XhmikosR committed
3068
3069
3070
3071
      });
    };

    if (transition) {
XhmikosR's avatar
XhmikosR committed
3072
      var transitionDuration = getTransitionDurationFromElement(this._dialog);
XhmikosR's avatar
Dist.  
XhmikosR committed
3073
3074
3075
3076
3077
      EventHandler.one(this._dialog, TRANSITION_END, transitionComplete);
      emulateTransitionEnd(this._dialog, transitionDuration);
    } else {
      transitionComplete();
    }
XhmikosR's avatar
XhmikosR committed
3078
3079
3080
3081
  };

  _proto._enforceFocus = function _enforceFocus() {
    var _this4 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3082
3083
3084

    EventHandler.off(document, Event$6.FOCUSIN); // guard against infinite focus loop

XhmikosR's avatar
XhmikosR committed
3085
3086
3087
    EventHandler.on(document, Event$6.FOCUSIN, function (event) {
      if (document !== event.target && _this4._element !== event.target && !_this4._element.contains(event.target)) {
        _this4._element.focus();
XhmikosR's avatar
Dist.  
XhmikosR committed
3088
3089
      }
    });
XhmikosR's avatar
XhmikosR committed
3090
3091
3092
3093
  };

  _proto._setEscapeEvent = function _setEscapeEvent() {
    var _this5 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3094
3095

    if (this._isShown && this._config.keyboard) {
XhmikosR's avatar
XhmikosR committed
3096
      EventHandler.on(this._element, Event$6.KEYDOWN_DISMISS, function (event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3097
        if (event.which === ESCAPE_KEYCODE$1) {
XhmikosR's avatar
XhmikosR committed
3098
          _this5._triggerBackdropTransition();
XhmikosR's avatar
Dist.  
XhmikosR committed
3099
3100
        }
      });
3101
    } else {
XhmikosR's avatar
Dist.  
XhmikosR committed
3102
3103
      EventHandler.off(this._element, Event$6.KEYDOWN_DISMISS);
    }
XhmikosR's avatar
XhmikosR committed
3104
3105
3106
3107
  };

  _proto._setResizeEvent = function _setResizeEvent() {
    var _this6 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3108
3109

    if (this._isShown) {
3110
3111
      EventHandler.on(window, Event$6.RESIZE, function () {
        return _this6._adjustDialog();
XhmikosR's avatar
XhmikosR committed
3112
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
3113
3114
3115
    } else {
      EventHandler.off(window, Event$6.RESIZE);
    }
XhmikosR's avatar
XhmikosR committed
3116
3117
3118
3119
  };

  _proto._hideModal = function _hideModal() {
    var _this7 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3120
3121
3122
3123
3124
3125
3126
3127
3128

    this._element.style.display = 'none';

    this._element.setAttribute('aria-hidden', true);

    this._element.removeAttribute('aria-modal');

    this._isTransitioning = false;

XhmikosR's avatar
XhmikosR committed
3129
    this._showBackdrop(function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
3130
3131
      document.body.classList.remove(ClassName$5.OPEN);

XhmikosR's avatar
XhmikosR committed
3132
      _this7._resetAdjustments();
XhmikosR's avatar
Dist.  
XhmikosR committed
3133

XhmikosR's avatar
XhmikosR committed
3134
      _this7._resetScrollbar();
XhmikosR's avatar
Dist.  
XhmikosR committed
3135

XhmikosR's avatar
XhmikosR committed
3136
      EventHandler.trigger(_this7._element, Event$6.HIDDEN);
XhmikosR's avatar
Dist.  
XhmikosR committed
3137
    });
XhmikosR's avatar
XhmikosR committed
3138
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3139

XhmikosR's avatar
XhmikosR committed
3140
  _proto._removeBackdrop = function _removeBackdrop() {
3141
    this._backdrop.parentNode.removeChild(this._backdrop);
XhmikosR's avatar
Dist.  
XhmikosR committed
3142

3143
    this._backdrop = null;
XhmikosR's avatar
XhmikosR committed
3144
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3145

XhmikosR's avatar
XhmikosR committed
3146
3147
3148
3149
  _proto._showBackdrop = function _showBackdrop(callback) {
    var _this8 = this;

    var animate = this._element.classList.contains(ClassName$5.FADE) ? ClassName$5.FADE : '';
XhmikosR's avatar
Dist.  
XhmikosR committed
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159

    if (this._isShown && this._config.backdrop) {
      this._backdrop = document.createElement('div');
      this._backdrop.className = ClassName$5.BACKDROP;

      if (animate) {
        this._backdrop.classList.add(animate);
      }

      document.body.appendChild(this._backdrop);
XhmikosR's avatar
XhmikosR committed
3160
3161
3162
      EventHandler.on(this._element, Event$6.CLICK_DISMISS, function (event) {
        if (_this8._ignoreBackdropClick) {
          _this8._ignoreBackdropClick = false;
XhmikosR's avatar
Dist.  
XhmikosR committed
3163
3164
3165
3166
3167
3168
3169
          return;
        }

        if (event.target !== event.currentTarget) {
          return;
        }

XhmikosR's avatar
XhmikosR committed
3170
        _this8._triggerBackdropTransition();
XhmikosR's avatar
Dist.  
XhmikosR committed
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
      });

      if (animate) {
        reflow(this._backdrop);
      }

      this._backdrop.classList.add(ClassName$5.SHOW);

      if (!animate) {
        callback();
        return;
      }

XhmikosR's avatar
XhmikosR committed
3184
      var backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop);
XhmikosR's avatar
Dist.  
XhmikosR committed
3185
3186
3187
3188
3189
      EventHandler.one(this._backdrop, TRANSITION_END, callback);
      emulateTransitionEnd(this._backdrop, backdropTransitionDuration);
    } else if (!this._isShown && this._backdrop) {
      this._backdrop.classList.remove(ClassName$5.SHOW);

XhmikosR's avatar
XhmikosR committed
3190
3191
      var callbackRemove = function callbackRemove() {
        _this8._removeBackdrop();
XhmikosR's avatar
Dist.  
XhmikosR committed
3192

3193
        callback();
XhmikosR's avatar
Dist.  
XhmikosR committed
3194
3195
3196
      };

      if (this._element.classList.contains(ClassName$5.FADE)) {
XhmikosR's avatar
XhmikosR committed
3197
3198
        var _backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop);

XhmikosR's avatar
Dist.  
XhmikosR committed
3199
        EventHandler.one(this._backdrop, TRANSITION_END, callbackRemove);
XhmikosR's avatar
XhmikosR committed
3200
        emulateTransitionEnd(this._backdrop, _backdropTransitionDuration);
XhmikosR's avatar
Dist.  
XhmikosR committed
3201
3202
3203
      } else {
        callbackRemove();
      }
3204
    } else {
XhmikosR's avatar
Dist.  
XhmikosR committed
3205
3206
      callback();
    }
XhmikosR's avatar
XhmikosR committed
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
  };

  _proto._triggerBackdropTransition = function _triggerBackdropTransition() {
    var _this9 = this;

    if (this._config.backdrop === 'static') {
      var hideEvent = EventHandler.trigger(this._element, Event$6.HIDE_PREVENTED);

      if (hideEvent.defaultPrevented) {
        return;
      }

      this._element.classList.add(ClassName$5.STATIC);

      var modalTransitionDuration = getTransitionDurationFromElement(this._element);
      EventHandler.one(this._element, TRANSITION_END, function () {
        _this9._element.classList.remove(ClassName$5.STATIC);
      });
      emulateTransitionEnd(this._element, modalTransitionDuration);

      this._element.focus();
    } else {
      this.hide();
    }
XhmikosR's avatar
Dist.  
XhmikosR committed
3231
3232
3233
  } // ----------------------------------------------------------------------
  // the following methods are used to handle overflowing modals
  // ----------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
3234
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3235

XhmikosR's avatar
XhmikosR committed
3236
3237
  _proto._adjustDialog = function _adjustDialog() {
    var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
XhmikosR's avatar
Dist.  
XhmikosR committed
3238
3239

    if (!this._isBodyOverflowing && isModalOverflowing) {
XhmikosR's avatar
XhmikosR committed
3240
      this._element.style.paddingLeft = this._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3241
3242
3243
    }

    if (this._isBodyOverflowing && !isModalOverflowing) {
XhmikosR's avatar
XhmikosR committed
3244
      this._element.style.paddingRight = this._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3245
    }
XhmikosR's avatar
XhmikosR committed
3246
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3247

XhmikosR's avatar
XhmikosR committed
3248
  _proto._resetAdjustments = function _resetAdjustments() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3249
3250
    this._element.style.paddingLeft = '';
    this._element.style.paddingRight = '';
XhmikosR's avatar
XhmikosR committed
3251
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3252

XhmikosR's avatar
XhmikosR committed
3253
3254
  _proto._checkScrollbar = function _checkScrollbar() {
    var rect = document.body.getBoundingClientRect();
XhmikosR's avatar
Dist.  
XhmikosR committed
3255
3256
    this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
    this._scrollbarWidth = this._getScrollbarWidth();
XhmikosR's avatar
XhmikosR committed
3257
3258
3259
  };

  _proto._setScrollbar = function _setScrollbar() {
XhmikosR's avatar
XhmikosR committed
3260
    var _this10 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3261
3262
3263
3264
3265

    if (this._isBodyOverflowing) {
      // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
      //   while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
      // Adjust fixed content padding
XhmikosR's avatar
XhmikosR committed
3266
3267
3268
      makeArray(SelectorEngine.find(Selector$5.FIXED_CONTENT)).forEach(function (element) {
        var actualPadding = element.style.paddingRight;
        var calculatedPadding = window.getComputedStyle(element)['padding-right'];
XhmikosR's avatar
Dist.  
XhmikosR committed
3269
        Manipulator.setDataAttribute(element, 'padding-right', actualPadding);
XhmikosR's avatar
XhmikosR committed
3270
        element.style.paddingRight = parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3271
3272
      }); // Adjust sticky content margin

XhmikosR's avatar
XhmikosR committed
3273
3274
3275
      makeArray(SelectorEngine.find(Selector$5.STICKY_CONTENT)).forEach(function (element) {
        var actualMargin = element.style.marginRight;
        var calculatedMargin = window.getComputedStyle(element)['margin-right'];
XhmikosR's avatar
Dist.  
XhmikosR committed
3276
        Manipulator.setDataAttribute(element, 'margin-right', actualMargin);
XhmikosR's avatar
XhmikosR committed
3277
        element.style.marginRight = parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3278
3279
      }); // Adjust body padding

XhmikosR's avatar
XhmikosR committed
3280
3281
      var actualPadding = document.body.style.paddingRight;
      var calculatedPadding = window.getComputedStyle(document.body)['padding-right'];
XhmikosR's avatar
Dist.  
XhmikosR committed
3282
      Manipulator.setDataAttribute(document.body, 'padding-right', actualPadding);
XhmikosR's avatar
XhmikosR committed
3283
      document.body.style.paddingRight = parseFloat(calculatedPadding) + this._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3284
3285
3286
    }

    document.body.classList.add(ClassName$5.OPEN);
XhmikosR's avatar
XhmikosR committed
3287
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3288

XhmikosR's avatar
XhmikosR committed
3289
  _proto._resetScrollbar = function _resetScrollbar() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3290
    // Restore fixed content padding
XhmikosR's avatar
XhmikosR committed
3291
3292
    makeArray(SelectorEngine.find(Selector$5.FIXED_CONTENT)).forEach(function (element) {
      var padding = Manipulator.getDataAttribute(element, 'padding-right');
XhmikosR's avatar
Dist.  
XhmikosR committed
3293
3294
3295
3296
3297
3298
3299

      if (typeof padding !== 'undefined') {
        Manipulator.removeDataAttribute(element, 'padding-right');
        element.style.paddingRight = padding;
      }
    }); // Restore sticky content and navbar-toggler margin

XhmikosR's avatar
XhmikosR committed
3300
3301
    makeArray(SelectorEngine.find("" + Selector$5.STICKY_CONTENT)).forEach(function (element) {
      var margin = Manipulator.getDataAttribute(element, 'margin-right');
XhmikosR's avatar
Dist.  
XhmikosR committed
3302
3303
3304
3305
3306
3307
3308

      if (typeof margin !== 'undefined') {
        Manipulator.removeDataAttribute(element, 'margin-right');
        element.style.marginRight = margin;
      }
    }); // Restore body padding

XhmikosR's avatar
XhmikosR committed
3309
    var padding = Manipulator.getDataAttribute(document.body, 'padding-right');
XhmikosR's avatar
Dist.  
XhmikosR committed
3310
3311
3312
3313
3314
3315
3316

    if (typeof padding === 'undefined') {
      document.body.style.paddingRight = '';
    } else {
      Manipulator.removeDataAttribute(document.body, 'padding-right');
      document.body.style.paddingRight = padding;
    }
XhmikosR's avatar
XhmikosR committed
3317
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3318

XhmikosR's avatar
XhmikosR committed
3319
  _proto._getScrollbarWidth = function _getScrollbarWidth() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3320
    // thx d.walsh
XhmikosR's avatar
XhmikosR committed
3321
    var scrollDiv = document.createElement('div');
XhmikosR's avatar
Dist.  
XhmikosR committed
3322
3323
    scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER;
    document.body.appendChild(scrollDiv);
XhmikosR's avatar
XhmikosR committed
3324
    var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
XhmikosR's avatar
Dist.  
XhmikosR committed
3325
3326
3327
    document.body.removeChild(scrollDiv);
    return scrollbarWidth;
  } // Static
XhmikosR's avatar
XhmikosR committed
3328
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3329

XhmikosR's avatar
XhmikosR committed
3330
  Modal.jQueryInterface = function jQueryInterface(config, relatedTarget) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3331
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
3332
      var data = Data.getData(this, DATA_KEY$5);
XhmikosR's avatar
Dist.  
XhmikosR committed
3333

3334
      var _config = _objectSpread2({}, Default$3, {}, Manipulator.getDataAttributes(this), {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
3335
3336
3337
3338
3339
3340
3341

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

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
3342
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
3343
3344
3345
3346
3347
3348
3349
        }

        data[config](relatedTarget);
      } else if (_config.show) {
        data.show(relatedTarget);
      }
    });
XhmikosR's avatar
XhmikosR committed
3350
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3351

XhmikosR's avatar
XhmikosR committed
3352
  Modal.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3353
    return Data.getData(element, DATA_KEY$5);
XhmikosR's avatar
XhmikosR committed
3354
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3355

XhmikosR's avatar
XhmikosR committed
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
  _createClass(Modal, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$5;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$3;
    }
  }]);

  return Modal;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
3370
3371
3372
3373
3374
3375
3376
3377
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


EventHandler.on(document, Event$6.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) {
XhmikosR's avatar
XhmikosR committed
3378
  var _this11 = this;
XhmikosR's avatar
XhmikosR committed
3379

XhmikosR's avatar
XhmikosR committed
3380
  var target = getElementFromSelector(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
3381
3382
3383
3384
3385

  if (this.tagName === 'A' || this.tagName === 'AREA') {
    event.preventDefault();
  }

XhmikosR's avatar
XhmikosR committed
3386
  EventHandler.one(target, Event$6.SHOW, function (showEvent) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3387
3388
3389
3390
3391
    if (showEvent.defaultPrevented) {
      // only register focus restorer if modal will actually get shown
      return;
    }

XhmikosR's avatar
XhmikosR committed
3392
    EventHandler.one(target, Event$6.HIDDEN, function () {
XhmikosR's avatar
XhmikosR committed
3393
3394
      if (isVisible(_this11)) {
        _this11.focus();
XhmikosR's avatar
Dist.  
XhmikosR committed
3395
3396
3397
      }
    });
  });
XhmikosR's avatar
XhmikosR committed
3398
  var data = Data.getData(target, DATA_KEY$5);
XhmikosR's avatar
Dist.  
XhmikosR committed
3399
3400

  if (!data) {
3401
3402
    var config = _objectSpread2({}, Manipulator.getDataAttributes(target), {}, Manipulator.getDataAttributes(this));

XhmikosR's avatar
Dist.  
XhmikosR committed
3403
3404
3405
3406
3407
    data = new Modal(target, config);
  }

  data.show(this);
});
XhmikosR's avatar
XhmikosR committed
3408
var $$6 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
3409
3410
3411
3412
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
3413
 * add .modal to jQuery only if jQuery is present
XhmikosR's avatar
Dist.  
XhmikosR committed
3414
3415
 */

3416
3417
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
3418
3419
3420
3421
if ($$6) {
  var JQUERY_NO_CONFLICT$5 = $$6.fn[NAME$5];
  $$6.fn[NAME$5] = Modal.jQueryInterface;
  $$6.fn[NAME$5].Constructor = Modal;
XhmikosR's avatar
Dist.  
XhmikosR committed
3422

XhmikosR's avatar
XhmikosR committed
3423
3424
3425
  $$6.fn[NAME$5].noConflict = function () {
    $$6.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
    return Modal.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
3426
3427
3428
3429
3430
3431
3432
3433
3434
  };
}

/**
 * --------------------------------------------------------------------------
 * Bootstrap (v4.3.1): util/sanitizer.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */
XhmikosR's avatar
XhmikosR committed
3435
3436
var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
XhmikosR's avatar
Dist.  
XhmikosR committed
3437
3438
3439
3440
3441
3442
/**
 * A pattern that recognizes a commonly useful subset of URLs that are safe.
 *
 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
 */

XhmikosR's avatar
XhmikosR committed
3443
var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
XhmikosR's avatar
Dist.  
XhmikosR committed
3444
3445
3446
3447
3448
3449
/**
 * A pattern that matches safe data URLs. Only matches image, video and audio types.
 *
 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
 */

XhmikosR's avatar
XhmikosR committed
3450
var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
XhmikosR's avatar
Dist.  
XhmikosR committed
3451

XhmikosR's avatar
XhmikosR committed
3452
3453
var allowedAttribute = function allowedAttribute(attr, allowedAttributeList) {
  var attrName = attr.nodeName.toLowerCase();
XhmikosR's avatar
Dist.  
XhmikosR committed
3454
3455
3456
3457
3458
3459
3460
3461
3462

  if (allowedAttributeList.indexOf(attrName) !== -1) {
    if (uriAttrs.indexOf(attrName) !== -1) {
      return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
    }

    return true;
  }

XhmikosR's avatar
XhmikosR committed
3463
3464
3465
  var regExp = allowedAttributeList.filter(function (attrRegex) {
    return attrRegex instanceof RegExp;
  }); // Check if a regular expression validates the attribute.
XhmikosR's avatar
Dist.  
XhmikosR committed
3466

XhmikosR's avatar
XhmikosR committed
3467
  for (var i = 0, l = regExp.length; i < l; i++) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3468
3469
3470
3471
3472
3473
3474
3475
    if (attrName.match(regExp[i])) {
      return true;
    }
  }

  return false;
};

XhmikosR's avatar
XhmikosR committed
3476
var DefaultWhitelist = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
  // Global attributes allowed on any supplied element below.
  '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  a: ['target', 'href', 'title', 'rel'],
  area: [],
  b: [],
  br: [],
  col: [],
  code: [],
  div: [],
  em: [],
  hr: [],
  h1: [],
  h2: [],
  h3: [],
  h4: [],
  h5: [],
  h6: [],
  i: [],
  img: ['src', 'alt', 'title', 'width', 'height'],
  li: [],
  ol: [],
  p: [],
  pre: [],
  s: [],
  small: [],
  span: [],
  sub: [],
  sup: [],
  strong: [],
  u: [],
  ul: []
};
function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
  if (!unsafeHtml.length) {
    return unsafeHtml;
  }

  if (sanitizeFn && typeof sanitizeFn === 'function') {
    return sanitizeFn(unsafeHtml);
  }

XhmikosR's avatar
XhmikosR committed
3518
3519
3520
3521
  var domParser = new window.DOMParser();
  var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
  var whitelistKeys = Object.keys(whiteList);
  var elements = makeArray(createdDocument.body.querySelectorAll('*'));
XhmikosR's avatar
Dist.  
XhmikosR committed
3522

XhmikosR's avatar
XhmikosR committed
3523
3524
3525
  var _loop = function _loop(i, len) {
    var el = elements[i];
    var elName = el.nodeName.toLowerCase();
XhmikosR's avatar
Dist.  
XhmikosR committed
3526
3527
3528

    if (whitelistKeys.indexOf(elName) === -1) {
      el.parentNode.removeChild(el);
XhmikosR's avatar
XhmikosR committed
3529
      return "continue";
XhmikosR's avatar
Dist.  
XhmikosR committed
3530
3531
    }

XhmikosR's avatar
XhmikosR committed
3532
3533
3534
    var attributeList = makeArray(el.attributes);
    var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
    attributeList.forEach(function (attr) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3535
3536
3537
3538
      if (!allowedAttribute(attr, whitelistedAttributes)) {
        el.removeAttribute(attr.nodeName);
      }
    });
XhmikosR's avatar
XhmikosR committed
3539
3540
3541
  };

  for (var i = 0, len = elements.length; i < len; i++) {
3542
    var _ret = _loop(i);
XhmikosR's avatar
XhmikosR committed
3543
3544

    if (_ret === "continue") continue;
XhmikosR's avatar
Dist.  
XhmikosR committed
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
  }

  return createdDocument.body.innerHTML;
}

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

XhmikosR's avatar
XhmikosR committed
3556
3557
3558
3559
3560
3561
3562
3563
var NAME$6 = 'tooltip';
var VERSION$6 = '4.3.1';
var DATA_KEY$6 = 'bs.tooltip';
var EVENT_KEY$6 = "." + DATA_KEY$6;
var CLASS_PREFIX = 'bs-tooltip';
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
var DefaultType$4 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
  animation: 'boolean',
  template: 'string',
  title: '(string|element|function)',
  trigger: 'string',
  delay: '(number|object)',
  html: 'boolean',
  selector: '(string|boolean)',
  placement: '(string|function)',
  offset: '(number|string|function)',
  container: '(string|element|boolean)',
  fallbackPlacement: '(string|array)',
  boundary: '(string|element)',
  sanitize: 'boolean',
  sanitizeFn: '(null|function)',
XhmikosR's avatar
XhmikosR committed
3578
3579
  whiteList: 'object',
  popperConfig: '(null|object)'
XhmikosR's avatar
Dist.  
XhmikosR committed
3580
};
XhmikosR's avatar
XhmikosR committed
3581
var AttachmentMap$1 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3582
3583
3584
3585
3586
3587
  AUTO: 'auto',
  TOP: 'top',
  RIGHT: 'right',
  BOTTOM: 'bottom',
  LEFT: 'left'
};
XhmikosR's avatar
XhmikosR committed
3588
var Default$4 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
  animation: true,
  template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div></div>',
  trigger: 'hover focus',
  title: '',
  delay: 0,
  html: false,
  selector: false,
  placement: 'top',
  offset: 0,
  container: false,
  fallbackPlacement: 'flip',
  boundary: 'scrollParent',
  sanitize: true,
  sanitizeFn: null,
XhmikosR's avatar
XhmikosR committed
3603
3604
  whiteList: DefaultWhitelist,
  popperConfig: null
XhmikosR's avatar
Dist.  
XhmikosR committed
3605
};
XhmikosR's avatar
XhmikosR committed
3606
var HoverState = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3607
3608
3609
  SHOW: 'show',
  OUT: 'out'
};
XhmikosR's avatar
XhmikosR committed
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
var Event$7 = {
  HIDE: "hide" + EVENT_KEY$6,
  HIDDEN: "hidden" + EVENT_KEY$6,
  SHOW: "show" + EVENT_KEY$6,
  SHOWN: "shown" + EVENT_KEY$6,
  INSERTED: "inserted" + EVENT_KEY$6,
  CLICK: "click" + EVENT_KEY$6,
  FOCUSIN: "focusin" + EVENT_KEY$6,
  FOCUSOUT: "focusout" + EVENT_KEY$6,
  MOUSEENTER: "mouseenter" + EVENT_KEY$6,
  MOUSELEAVE: "mouseleave" + EVENT_KEY$6
XhmikosR's avatar
Dist.  
XhmikosR committed
3621
};
XhmikosR's avatar
XhmikosR committed
3622
var ClassName$6 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3623
3624
3625
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
3626
var Selector$6 = {
Mark Otto's avatar
dist v5    
Mark Otto committed
3627
  TOOLTIP_INNER: '.tooltip-inner'
XhmikosR's avatar
Dist.  
XhmikosR committed
3628
};
XhmikosR's avatar
XhmikosR committed
3629
var Trigger = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3630
3631
3632
3633
3634
  HOVER: 'hover',
  FOCUS: 'focus',
  CLICK: 'click',
  MANUAL: 'manual'
};
XhmikosR's avatar
XhmikosR committed
3635
3636
3637
3638
3639
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
3640

XhmikosR's avatar
XhmikosR committed
3641
3642
3643
3644
var Tooltip =
/*#__PURE__*/
function () {
  function Tooltip(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
    if (typeof Popper === 'undefined') {
      throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org)');
    } // private


    this._isEnabled = true;
    this._timeout = 0;
    this._hoverState = '';
    this._activeTrigger = {};
    this._popper = null; // Protected

    this.element = element;
    this.config = this._getConfig(config);
    this.tip = null;

    this._setListeners();

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


XhmikosR's avatar
XhmikosR committed
3666
  var _proto = Tooltip.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
3667

XhmikosR's avatar
XhmikosR committed
3668
3669
  // Public
  _proto.enable = function enable() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3670
    this._isEnabled = true;
XhmikosR's avatar
XhmikosR committed
3671
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3672

XhmikosR's avatar
XhmikosR committed
3673
  _proto.disable = function disable() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3674
    this._isEnabled = false;
XhmikosR's avatar
XhmikosR committed
3675
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3676

XhmikosR's avatar
XhmikosR committed
3677
  _proto.toggleEnabled = function toggleEnabled() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3678
    this._isEnabled = !this._isEnabled;
XhmikosR's avatar
XhmikosR committed
3679
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3680

XhmikosR's avatar
XhmikosR committed
3681
  _proto.toggle = function toggle(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3682
3683
3684
3685
3686
    if (!this._isEnabled) {
      return;
    }

    if (event) {
XhmikosR's avatar
XhmikosR committed
3687
3688
      var dataKey = this.constructor.DATA_KEY;
      var context = Data.getData(event.delegateTarget, dataKey);
XhmikosR's avatar
Dist.  
XhmikosR committed
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710

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

      context._activeTrigger.click = !context._activeTrigger.click;

      if (context._isWithActiveTrigger()) {
        context._enter(null, context);
      } else {
        context._leave(null, context);
      }
    } else {
      if (this.getTipElement().classList.contains(ClassName$6.SHOW)) {
        this._leave(null, this);

        return;
      }

      this._enter(null, this);
    }
XhmikosR's avatar
XhmikosR committed
3711
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3712

XhmikosR's avatar
XhmikosR committed
3713
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3714
3715
3716
    clearTimeout(this._timeout);
    Data.removeData(this.element, this.constructor.DATA_KEY);
    EventHandler.off(this.element, this.constructor.EVENT_KEY);
Mark Otto's avatar
dist v5    
Mark Otto committed
3717
    EventHandler.off(SelectorEngine.closest(this.element, '.modal'), 'hide.bs.modal', this._hideModalHandler);
XhmikosR's avatar
Dist.  
XhmikosR committed
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727

    if (this.tip) {
      this.tip.parentNode.removeChild(this.tip);
    }

    this._isEnabled = null;
    this._timeout = null;
    this._hoverState = null;
    this._activeTrigger = null;

XhmikosR's avatar
XhmikosR committed
3728
    if (this._popper) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3729
3730
3731
3732
3733
3734
3735
      this._popper.destroy();
    }

    this._popper = null;
    this.element = null;
    this.config = null;
    this.tip = null;
XhmikosR's avatar
XhmikosR committed
3736
3737
3738
3739
  };

  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3740
3741
3742
3743
3744
3745

    if (this.element.style.display === 'none') {
      throw new Error('Please use show on visible elements');
    }

    if (this.isWithContent() && this._isEnabled) {
XhmikosR's avatar
XhmikosR committed
3746
3747
3748
      var showEvent = EventHandler.trigger(this.element, this.constructor.Event.SHOW);
      var shadowRoot = findShadowRoot(this.element);
      var isInTheDom = shadowRoot === null ? this.element.ownerDocument.documentElement.contains(this.element) : shadowRoot.contains(this.element);
XhmikosR's avatar
Dist.  
XhmikosR committed
3749
3750
3751
3752
3753

      if (showEvent.defaultPrevented || !isInTheDom) {
        return;
      }

XhmikosR's avatar
XhmikosR committed
3754
3755
      var tip = this.getTipElement();
      var tipId = getUID(this.constructor.NAME);
XhmikosR's avatar
Dist.  
XhmikosR committed
3756
3757
3758
3759
3760
3761
3762
3763
      tip.setAttribute('id', tipId);
      this.element.setAttribute('aria-describedby', tipId);
      this.setContent();

      if (this.config.animation) {
        tip.classList.add(ClassName$6.FADE);
      }

XhmikosR's avatar
XhmikosR committed
3764
      var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
XhmikosR's avatar
Dist.  
XhmikosR committed
3765

XhmikosR's avatar
XhmikosR committed
3766
      var attachment = this._getAttachment(placement);
XhmikosR's avatar
Dist.  
XhmikosR committed
3767

3768
      this._addAttachmentClass(attachment);
XhmikosR's avatar
Dist.  
XhmikosR committed
3769

XhmikosR's avatar
XhmikosR committed
3770
      var container = this._getContainer();
XhmikosR's avatar
Dist.  
XhmikosR committed
3771
3772
3773
3774
3775
3776
3777
3778

      Data.setData(tip, this.constructor.DATA_KEY, this);

      if (!this.element.ownerDocument.documentElement.contains(this.tip)) {
        container.appendChild(tip);
      }

      EventHandler.trigger(this.element, this.constructor.Event.INSERTED);
XhmikosR's avatar
XhmikosR committed
3779
      this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
XhmikosR's avatar
Dist.  
XhmikosR committed
3780
3781
3782
3783
3784
3785
      tip.classList.add(ClassName$6.SHOW); // If this is a touch-enabled device we add extra
      // empty mouseover listeners to the body's immediate children;
      // only needed because of broken event delegation on iOS
      // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html

      if ('ontouchstart' in document.documentElement) {
XhmikosR's avatar
XhmikosR committed
3786
        makeArray(document.body.children).forEach(function (element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3787
3788
3789
3790
          EventHandler.on(element, 'mouseover', noop());
        });
      }

XhmikosR's avatar
XhmikosR committed
3791
3792
3793
      var complete = function complete() {
        if (_this.config.animation) {
          _this._fixTransition();
XhmikosR's avatar
Dist.  
XhmikosR committed
3794
3795
        }

XhmikosR's avatar
XhmikosR committed
3796
3797
3798
        var prevHoverState = _this._hoverState;
        _this._hoverState = null;
        EventHandler.trigger(_this.element, _this.constructor.Event.SHOWN);
XhmikosR's avatar
Dist.  
XhmikosR committed
3799
3800

        if (prevHoverState === HoverState.OUT) {
XhmikosR's avatar
XhmikosR committed
3801
          _this._leave(null, _this);
XhmikosR's avatar
Dist.  
XhmikosR committed
3802
3803
3804
3805
        }
      };

      if (this.tip.classList.contains(ClassName$6.FADE)) {
XhmikosR's avatar
XhmikosR committed
3806
        var transitionDuration = getTransitionDurationFromElement(this.tip);
XhmikosR's avatar
Dist.  
XhmikosR committed
3807
3808
3809
3810
3811
3812
        EventHandler.one(this.tip, TRANSITION_END, complete);
        emulateTransitionEnd(this.tip, transitionDuration);
      } else {
        complete();
      }
    }
XhmikosR's avatar
XhmikosR committed
3813
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3814

3815
  _proto.hide = function hide() {
XhmikosR's avatar
XhmikosR committed
3816
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3817

XhmikosR's avatar
XhmikosR committed
3818
3819
3820
3821
    var tip = this.getTipElement();

    var complete = function complete() {
      if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3822
3823
3824
        tip.parentNode.removeChild(tip);
      }

XhmikosR's avatar
XhmikosR committed
3825
3826
3827
      _this2._cleanTipClass();

      _this2.element.removeAttribute('aria-describedby');
XhmikosR's avatar
Dist.  
XhmikosR committed
3828

XhmikosR's avatar
XhmikosR committed
3829
      EventHandler.trigger(_this2.element, _this2.constructor.Event.HIDDEN);
XhmikosR's avatar
Dist.  
XhmikosR committed
3830

3831
      _this2._popper.destroy();
XhmikosR's avatar
Dist.  
XhmikosR committed
3832
3833
    };

XhmikosR's avatar
XhmikosR committed
3834
    var hideEvent = EventHandler.trigger(this.element, this.constructor.Event.HIDE);
XhmikosR's avatar
Dist.  
XhmikosR committed
3835
3836
3837
3838
3839
3840
3841
3842
3843

    if (hideEvent.defaultPrevented) {
      return;
    }

    tip.classList.remove(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra
    // empty mouseover listeners we added for iOS support

    if ('ontouchstart' in document.documentElement) {
XhmikosR's avatar
XhmikosR committed
3844
3845
3846
      makeArray(document.body.children).forEach(function (element) {
        return EventHandler.off(element, 'mouseover', noop);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
3847
3848
3849
3850
3851
3852
3853
    }

    this._activeTrigger[Trigger.CLICK] = false;
    this._activeTrigger[Trigger.FOCUS] = false;
    this._activeTrigger[Trigger.HOVER] = false;

    if (this.tip.classList.contains(ClassName$6.FADE)) {
XhmikosR's avatar
XhmikosR committed
3854
      var transitionDuration = getTransitionDurationFromElement(tip);
XhmikosR's avatar
Dist.  
XhmikosR committed
3855
3856
3857
3858
3859
3860
3861
      EventHandler.one(tip, TRANSITION_END, complete);
      emulateTransitionEnd(tip, transitionDuration);
    } else {
      complete();
    }

    this._hoverState = '';
XhmikosR's avatar
XhmikosR committed
3862
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3863

XhmikosR's avatar
XhmikosR committed
3864
  _proto.update = function update() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3865
3866
3867
3868
    if (this._popper !== null) {
      this._popper.scheduleUpdate();
    }
  } // Protected
XhmikosR's avatar
XhmikosR committed
3869
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3870

XhmikosR's avatar
XhmikosR committed
3871
  _proto.isWithContent = function isWithContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3872
    return Boolean(this.getTitle());
XhmikosR's avatar
XhmikosR committed
3873
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3874

XhmikosR's avatar
XhmikosR committed
3875
  _proto.getTipElement = function getTipElement() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3876
3877
3878
3879
    if (this.tip) {
      return this.tip;
    }

XhmikosR's avatar
XhmikosR committed
3880
    var element = document.createElement('div');
XhmikosR's avatar
Dist.  
XhmikosR committed
3881
3882
3883
    element.innerHTML = this.config.template;
    this.tip = element.children[0];
    return this.tip;
XhmikosR's avatar
XhmikosR committed
3884
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3885

XhmikosR's avatar
XhmikosR committed
3886
3887
  _proto.setContent = function setContent() {
    var tip = this.getTipElement();
XhmikosR's avatar
Dist.  
XhmikosR committed
3888
3889
3890
    this.setElementContent(SelectorEngine.findOne(Selector$6.TOOLTIP_INNER, tip), this.getTitle());
    tip.classList.remove(ClassName$6.FADE);
    tip.classList.remove(ClassName$6.SHOW);
XhmikosR's avatar
XhmikosR committed
3891
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3892

XhmikosR's avatar
XhmikosR committed
3893
  _proto.setElementContent = function setElementContent(element, content) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3894
3895
3896
3897
    if (element === null) {
      return;
    }

3898
    if (typeof content === 'object' && isElement(content)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
      if (content.jquery) {
        content = content[0];
      } // content is a DOM node or a jQuery


      if (this.config.html) {
        if (content.parentNode !== element) {
          element.innerHTML = '';
          element.appendChild(content);
        }
      } else {
        element.innerText = content.textContent;
      }

      return;
    }

    if (this.config.html) {
      if (this.config.sanitize) {
        content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
      }

      element.innerHTML = content;
    } else {
      element.innerText = content;
    }
XhmikosR's avatar
XhmikosR committed
3925
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3926

XhmikosR's avatar
XhmikosR committed
3927
3928
  _proto.getTitle = function getTitle() {
    var title = this.element.getAttribute('data-original-title');
XhmikosR's avatar
Dist.  
XhmikosR committed
3929
3930
3931
3932
3933
3934
3935

    if (!title) {
      title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
    }

    return title;
  } // Private
XhmikosR's avatar
XhmikosR committed
3936
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3937

XhmikosR's avatar
XhmikosR committed
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
  _proto._getPopperConfig = function _getPopperConfig(attachment) {
    var _this3 = this;

    var defaultBsConfig = {
      placement: attachment,
      modifiers: {
        offset: this._getOffset(),
        flip: {
          behavior: this.config.fallbackPlacement
        },
        arrow: {
          element: "." + this.constructor.NAME + "-arrow"
        },
        preventOverflow: {
          boundariesElement: this.config.boundary
        }
      },
      onCreate: function onCreate(data) {
        if (data.originalPlacement !== data.placement) {
          _this3._handlePopperPlacementChange(data);
        }
      },
      onUpdate: function onUpdate(data) {
        return _this3._handlePopperPlacementChange(data);
      }
    };
    return _objectSpread2({}, defaultBsConfig, {}, this.config.popperConfig);
  };

3967
3968
3969
3970
  _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
    this.getTipElement().classList.add(CLASS_PREFIX + "-" + attachment);
  };

XhmikosR's avatar
XhmikosR committed
3971
  _proto._getOffset = function _getOffset() {
XhmikosR's avatar
XhmikosR committed
3972
    var _this4 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3973

XhmikosR's avatar
XhmikosR committed
3974
    var offset = {};
XhmikosR's avatar
Dist.  
XhmikosR committed
3975
3976

    if (typeof this.config.offset === 'function') {
XhmikosR's avatar
XhmikosR committed
3977
      offset.fn = function (data) {
XhmikosR's avatar
XhmikosR committed
3978
        data.offsets = _objectSpread2({}, data.offsets, {}, _this4.config.offset(data.offsets, _this4.element) || {});
XhmikosR's avatar
Dist.  
XhmikosR committed
3979
3980
3981
3982
3983
3984
3985
        return data;
      };
    } else {
      offset.offset = this.config.offset;
    }

    return offset;
XhmikosR's avatar
XhmikosR committed
3986
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3987

XhmikosR's avatar
XhmikosR committed
3988
  _proto._getContainer = function _getContainer() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3989
3990
3991
3992
3993
3994
3995
3996
3997
    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
3998
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3999

XhmikosR's avatar
XhmikosR committed
4000
  _proto._getAttachment = function _getAttachment(placement) {
For faster browsing, not all history is shown. View entire blame