diff --git a/README.md b/README.md
index d27af8d..9c625d8 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
+Version 4.3.4 - 1 May 2020
+
Bootstrap-Dialog for Bootstrap 4.3.1
## Fully compatible with Bootstrap 4.3.1
@@ -50,7 +52,7 @@ bower install bootstrap-dialog
Or
```
-bower install bootstrap3-dialog
+bower install bootstrap4-dialog#https://github.com/GedMarc/bootstrap4-dialog.git
```
================
@@ -58,7 +60,7 @@ bower install bootstrap3-dialog
## Install using npm
```
-npm install --save bootstrap3-dialog
+npm install --save bootstrap4-dialog
```
================
diff --git a/dist/js/bootstrap-dialog.js b/dist/js/bootstrap-dialog.js
index 05edce5..e7de661 100644
--- a/dist/js/bootstrap-dialog.js
+++ b/dist/js/bootstrap-dialog.js
@@ -1,4 +1,16 @@
-
+/* global define */
+
+/* ================================================
+ * Make use of Bootstrap's modal more monkey-friendly.
+ *
+ * For Bootstrap 3.
+ *
+ * javanoob@hotmail.com
+ *
+ * https://github.com/nakupanda/bootstrap3-dialog
+ *
+ * Licensed under The MIT License.
+ * ================================================ */
(function (root, factory) {
"use strict";
@@ -322,13 +334,6 @@
BootstrapDialog.METHODS_TO_OVERRIDE = {};
BootstrapDialog.METHODS_TO_OVERRIDE['v3.1'] = {
- handleModalBackdropEvent: function () {
- this.getModal().on('click', { dialog: this }, function (event) {
- event.target === this && event.data.dialog.isClosable() && event.data.dialog.canCloseByBackdrop() && event.data.dialog.close();
- });
-
- return this;
- },
/**
* To make multiple opened dialogs look better.
*
@@ -361,7 +366,6 @@
}
};
BootstrapDialog.METHODS_TO_OVERRIDE['v3.2'] = {
- handleModalBackdropEvent: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['handleModalBackdropEvent'],
updateZIndex: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['updateZIndex'],
open: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['open']
};
@@ -371,7 +375,6 @@
getModalBackdrop: function ($modal) {
return $($modal.data('bs.modal')._backdrop);
},
- handleModalBackdropEvent: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['handleModalBackdropEvent'],
updateZIndex: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['updateZIndex'],
open: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['open'],
getModalForBootstrapDialogModal: function () {
@@ -382,7 +385,6 @@
getModalBackdrop: function ($modal) {
return $($modal.data('bs.modal')._backdrop);
},
- handleModalBackdropEvent: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['handleModalBackdropEvent'],
updateZIndex: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['updateZIndex'],
open: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['open'],
getModalForBootstrapDialogModal: function () {
@@ -546,14 +548,14 @@
updateType: function () {
if (this.isRealized()) {
var types = [BootstrapDialog.TYPE_DEFAULT,
- BootstrapDialog.TYPE_INFO,
- BootstrapDialog.TYPE_PRIMARY,
- BootstrapDialog.TYPE_SECONDARY,
- BootstrapDialog.TYPE_SUCCESS,
- BootstrapDialog.TYPE_WARNING,
- BootstrapDialog.TYPE_DARK,
- BootstrapDialog.TYPE_LIGHT,
- BootstrapDialog.TYPE_DANGER];
+ BootstrapDialog.TYPE_INFO,
+ BootstrapDialog.TYPE_PRIMARY,
+ BootstrapDialog.TYPE_SECONDARY,
+ BootstrapDialog.TYPE_SUCCESS,
+ BootstrapDialog.TYPE_WARNING,
+ BootstrapDialog.TYPE_DARK,
+ BootstrapDialog.TYPE_LIGHT,
+ BootstrapDialog.TYPE_DANGER];
this.getModal().removeClass(types.join(' ')).addClass(this.getType());
}
@@ -1129,9 +1131,6 @@
}
});
- // Backdrop, I did't find a way to change bs3 backdrop option after the dialog is popped up, so here's a new wheel.
- this.handleModalBackdropEvent();
-
// ESC key support
this.getModal().on('keyup', { dialog: this }, function (event) {
event.which === 27 && event.data.dialog.isClosable() && event.data.dialog.canCloseByKeyboard() && event.data.dialog.close();
@@ -1148,13 +1147,6 @@
return this;
},
- handleModalBackdropEvent: function () {
- this.getModal().on('click', { dialog: this }, function (event) {
- $(event.target).hasClass('modal-backdrop') && event.data.dialog.isClosable() && event.data.dialog.canCloseByBackdrop() && event.data.dialog.close();
- });
-
- return this;
- },
isModalEvent: function (event) {
return typeof event.namespace !== 'undefined' && event.namespace === 'bs.modal';
},
@@ -1198,7 +1190,7 @@
this.getModalHeader().append(this.createHeaderContent());
this.getModalBody().append(this.createBodyContent());
this.getModal().data('bs.modal', new BootstrapDialogModal(this.getModalForBootstrapDialogModal(), { //FIXME for BootstrapV4
- backdrop: 'static',
+ backdrop: (this.isClosable() && this.canCloseByBackdrop()) ? true : 'static',
keyboard: false,
show: false
}));
diff --git a/dist/js/bootstrap-dialog.min.js b/dist/js/bootstrap-dialog.min.js
index fa1421e..5b251b8 100644
--- a/dist/js/bootstrap-dialog.min.js
+++ b/dist/js/bootstrap-dialog.min.js
@@ -1 +1 @@
-!function(t,e){"use strict";"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery"),require("bootstrap")):"function"==typeof define&&define.amd?define("bootstrap-dialog",["jquery","bootstrap"],function(t){return e(t)}):t.BootstrapDialog=e(t.jQuery)}(this?this:window,function(d){"use strict";function e(t,e){if(/4\.1\.\d+/.test(d.fn.modal.Constructor.VERSION))return new o(t,e);o.call(this,t,e)}var o=d.fn.modal.Constructor;e.getModalVersion=function(){return void 0===d.fn.modal.Constructor.VERSION?"v3.1":/3\.2\.\d+/.test(d.fn.modal.Constructor.VERSION)?"v3.2":/3\.3\.[1,2]/.test(d.fn.modal.Constructor.VERSION)?"v3.3":/4\.\d\.\d+/.test(d.fn.modal.Constructor.VERSION)?"v4.1":"v3.3.4"},e.ORIGINAL_BODY_PADDING=parseInt(d("body").css("padding-right")||0,10),(e.METHODS_TO_OVERRIDE={})["v3.1"]={},e.METHODS_TO_OVERRIDE["v3.2"]={hide:function(t){t&&t.preventDefault(),t=d.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,0===this.getGlobalOpenedDialogs().length&&this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),d(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),d.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",d.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())}},e.METHODS_TO_OVERRIDE["v3.3"]={setScrollbar:function(){var t=e.ORIGINAL_BODY_PADDING;this.bodyIsOverflowing&&this.$body.css("padding-right",t+this.scrollbarWidth)},resetScrollbar:function(){0===this.getGlobalOpenedDialogs().length&&this.$body.css("padding-right",e.ORIGINAL_BODY_PADDING)},hideModal:function(){this.$element.hide(),this.backdrop(d.proxy(function(){0===this.getGlobalOpenedDialogs().length&&this.$body.removeClass("modal-open"),this.resetAdjustments(),this.resetScrollbar(),this.$element.trigger("hidden.bs.modal")},this))}},e.METHODS_TO_OVERRIDE["v3.3.4"]=d.extend({},e.METHODS_TO_OVERRIDE["v3.3"]),e.METHODS_TO_OVERRIDE["v4.1"]=d.extend({},e.METHODS_TO_OVERRIDE["v3.3"]),e.prototype={constructor:e,getGlobalOpenedDialogs:function(){var o=[];return d.each(a.dialogs,function(t,e){e.isRealized()&&e.isOpened()&&o.push(e)}),o}},e.prototype=d.extend(e.prototype,o.prototype,e.METHODS_TO_OVERRIDE[e.getModalVersion()]);var a=function(t){this.defaultOptions=d.extend(!0,{id:a.newGuid(),buttons:[],data:{},onshow:null,onshown:null,onhide:null,onhidden:null},a.defaultOptions),this.indexedButtons={},this.registeredButtonHotkeys={},this.draggableData={isMouseDown:!1,mouseOffset:{}},this.realized=!1,this.opened=!1,this.initOptions(t),this.holdThisInstance()};return a.BootstrapDialogModal=e,a.NAMESPACE="bootstrap-dialog",a.TYPE_DEFAULT="type-default",a.TYPE_INFO="type-info",a.TYPE_PRIMARY="type-primary",a.TYPE_SECONDARY="type-secondary",a.TYPE_SUCCESS="type-success",a.TYPE_WARNING="type-warning",a.TYPE_DANGER="type-danger",a.TYPE_DARK="type-dark",a.TYPE_LIGHT="type-light",a.DEFAULT_TEXTS={},a.DEFAULT_TEXTS[a.TYPE_DEFAULT]="Default",a.DEFAULT_TEXTS[a.TYPE_INFO]="Information",a.DEFAULT_TEXTS[a.TYPE_PRIMARY]="Primary",a.DEFAULT_TEXTS[a.TYPE_SECONDARY]="Secondary",a.DEFAULT_TEXTS[a.TYPE_SUCCESS]="Success",a.DEFAULT_TEXTS[a.TYPE_WARNING]="Warning",a.DEFAULT_TEXTS[a.TYPE_DANGER]="Danger",a.DEFAULT_TEXTS[a.TYPE_DARK]="Dark",a.DEFAULT_TEXTS[a.TYPE_LIGHT]="Light",a.DEFAULT_TEXTS.OK="OK",a.DEFAULT_TEXTS.CANCEL="Cancel",a.DEFAULT_TEXTS.CONFIRM="Confirmation",a.SIZE_NORMAL="size-normal",a.SIZE_SMALL="size-small",a.SIZE_WIDE="size-wide",a.SIZE_EXTRAWIDE="size-extrawide",a.SIZE_LARGE="size-large",a.BUTTON_SIZES={},a.BUTTON_SIZES[a.SIZE_NORMAL]="",a.BUTTON_SIZES[a.SIZE_SMALL]="btn-small",a.BUTTON_SIZES[a.SIZE_WIDE]="btn-block",a.BUTTON_SIZES[a.SIZE_LARGE]="btn-lg",a.ICON_SPINNER="glyphicon glyphicon-asterisk",a.BUTTONS_ORDER_CANCEL_OK="btns-order-cancel-ok",a.BUTTONS_ORDER_OK_CANCEL="btns-order-ok-cancel",a.Z_INDEX_BACKDROP=1040,a.Z_INDEX_MODAL=1050,a.defaultOptions={type:a.TYPE_PRIMARY,size:a.SIZE_NORMAL,cssClass:"",title:null,message:null,nl2br:!0,closable:!0,closeByBackdrop:!0,closeByKeyboard:!0,closeIcon:"×",spinicon:a.ICON_SPINNER,autodestroy:!0,draggable:!1,animate:!0,description:"",tabindex:-1,btnsOrder:a.BUTTONS_ORDER_CANCEL_OK},a.configDefaultOptions=function(t){a.defaultOptions=d.extend(!0,a.defaultOptions,t)},a.dialogs={},a.openAll=function(){d.each(a.dialogs,function(t,e){e.open()})},a.closeAll=function(){d.each(a.dialogs,function(t,e){e.close()})},a.getDialog=function(t){var e=null;return void 0!==a.dialogs[t]&&(e=a.dialogs[t]),e},a.setDialog=function(t){return a.dialogs[t.getId()]=t},a.addDialog=function(t){return a.setDialog(t)},a.moveFocus=function(){var o=null;d.each(a.dialogs,function(t,e){e.isRealized()&&e.isOpened()&&(o=e)}),null!==o&&o.getModal().focus()},a.METHODS_TO_OVERRIDE={},a.METHODS_TO_OVERRIDE["v3.1"]={handleModalBackdropEvent:function(){return this.getModal().on("click",{dialog:this},function(t){t.target===this&&t.data.dialog.isClosable()&&t.data.dialog.canCloseByBackdrop()&&t.data.dialog.close()}),this},updateZIndex:function(){if(this.isOpened()){var t=a.Z_INDEX_BACKDROP,e=a.Z_INDEX_MODAL,o=0;d.each(a.dialogs,function(t,e){e.isRealized()&&e.isOpened()&&o++});var n=this.getModal(),i=this.getModalBackdrop(n);n.css("z-index",e+20*(o-1)),i.css("z-index",t+20*(o-1))}return this},open:function(){return this.isRealized()||this.realize(),this.getModal().modal("show"),this.updateZIndex(),this}},a.METHODS_TO_OVERRIDE["v3.2"]={handleModalBackdropEvent:a.METHODS_TO_OVERRIDE["v3.1"].handleModalBackdropEvent,updateZIndex:a.METHODS_TO_OVERRIDE["v3.1"].updateZIndex,open:a.METHODS_TO_OVERRIDE["v3.1"].open},a.METHODS_TO_OVERRIDE["v3.3"]={},a.METHODS_TO_OVERRIDE["v3.3.4"]=d.extend({},a.METHODS_TO_OVERRIDE["v3.1"]),a.METHODS_TO_OVERRIDE["v4.0"]={getModalBackdrop:function(t){return d(t.data("bs.modal")._backdrop)},handleModalBackdropEvent:a.METHODS_TO_OVERRIDE["v3.1"].handleModalBackdropEvent,updateZIndex:a.METHODS_TO_OVERRIDE["v3.1"].updateZIndex,open:a.METHODS_TO_OVERRIDE["v3.1"].open,getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}},a.METHODS_TO_OVERRIDE["v4.1"]={getModalBackdrop:function(t){return d(t.data("bs.modal")._backdrop)},handleModalBackdropEvent:a.METHODS_TO_OVERRIDE["v3.1"].handleModalBackdropEvent,updateZIndex:a.METHODS_TO_OVERRIDE["v3.1"].updateZIndex,open:a.METHODS_TO_OVERRIDE["v3.1"].open,getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}},a.prototype={constructor:a,initOptions:function(t){return this.options=d.extend(!0,this.defaultOptions,t),this},holdThisInstance:function(){return a.addDialog(this),this},initModalStuff:function(){return this.setModal(this.createModal()).setModalDialog(this.createModalDialog()).setModalContent(this.createModalContent()).setModalHeader(this.createModalHeader()).setModalBody(this.createModalBody()).setModalFooter(this.createModalFooter()),this.getModal().append(this.getModalDialog()),this.getModalDialog().append(this.getModalContent()),this.getModalContent().append(this.getModalHeader()).append(this.getModalBody()).append(this.getModalFooter()),this},createModal:function(){var t=d('
');return t.prop("id",this.getId()),t.attr("aria-labelledby",this.getId()+"_title"),t},getModal:function(){return this.$modal},setModal:function(t){return this.$modal=t,this},getModalBackdrop:function(t){return t.data("bs.modal").$backdrop},getModalForBootstrapDialogModal:function(){return this.getModal()},createModalDialog:function(){return d('')},getModalDialog:function(){return this.$modalDialog},setModalDialog:function(t){return this.$modalDialog=t,this},createModalContent:function(){return d('')},getModalContent:function(){return this.$modalContent},setModalContent:function(t){return this.$modalContent=t,this},createModalHeader:function(){return d('')},getModalHeader:function(){return this.$modalHeader},setModalHeader:function(t){return this.$modalHeader=t,this},createModalBody:function(){return d('')},getModalBody:function(){return this.$modalBody},setModalBody:function(t){return this.$modalBody=t,this},createModalFooter:function(){return d('')},getModalFooter:function(){return this.$modalFooter},setModalFooter:function(t){return this.$modalFooter=t,this},createDynamicContent:function(t){var e=null;return"string"==typeof(e="function"==typeof t?t.call(t,this):t)&&(e=this.formatStringContent(e)),e},formatStringContent:function(t){return this.options.nl2br?t.replace(/\r\n/g,"
").replace(/[\r\n]/g,"
"):t},setData:function(t,e){return this.options.data[t]=e,this},getData:function(t){return this.options.data[t]},setId:function(t){return this.options.id=t,this},getId:function(){return this.options.id},getType:function(){return this.options.type},setType:function(t){return this.options.type=t,this.updateType(),this},updateType:function(){if(this.isRealized()){var t=[a.TYPE_DEFAULT,a.TYPE_INFO,a.TYPE_PRIMARY,a.TYPE_SECONDARY,a.TYPE_SUCCESS,a.TYPE_WARNING,a.TYPE_DARK,a.TYPE_LIGHT,a.TYPE_DANGER];this.getModal().removeClass(t.join(" ")).addClass(this.getType())}return this},getSize:function(){return this.options.size},setSize:function(t){return this.options.size=t,this.updateSize(),this},updateSize:function(){if(this.isRealized()){var s=this;this.getModal().removeClass(a.SIZE_NORMAL).removeClass(a.SIZE_SMALL).removeClass(a.SIZE_WIDE).removeClass(a.SIZE_EXTRAWIDE).removeClass(a.SIZE_LARGE),this.getModal().addClass(this.getSize()),this.getModalDialog().removeClass("modal-sm"),this.getSize()===a.SIZE_SMALL&&this.getModalDialog().addClass("modal-sm"),this.getModalDialog().removeClass("modal-lg"),this.getSize()===a.SIZE_WIDE&&this.getModalDialog().addClass("modal-lg"),this.getModalDialog().removeClass("modal-xl"),this.getSize()===a.SIZE_EXTRAWIDE&&this.getModalDialog().addClass("modal-xl"),d.each(this.options.buttons,function(t,e){var o=s.getButton(e.id),n=["btn-lg","btn-sm","btn-xs"],i=!1;if("string"==typeof e.cssClass){var a=e.cssClass.split(" ");d.each(a,function(t,e){-1!==d.inArray(e,n)&&(i=!0)})}i||(o.removeClass(n.join(" ")),o.addClass(s.getButtonSize()))})}return this},getCssClass:function(){return this.options.cssClass},setCssClass:function(t){return this.options.cssClass=t,this},getTitle:function(){return this.options.title},setTitle:function(t){return this.options.title=t,this.updateTitle(),this},updateTitle:function(){if(this.isRealized()){var t=null!==this.getTitle()?this.createDynamicContent(this.getTitle()):this.getDefaultText();this.getModalHeader().find("."+this.getNamespace("title")).html("").append(t).prop("id",this.getId()+"_title")}return this},getMessage:function(){return this.options.message},setMessage:function(t){return this.options.message=t,this.updateMessage(),this},updateMessage:function(){if(this.isRealized()){var t=this.createDynamicContent(this.getMessage());this.getModalBody().find("."+this.getNamespace("message")).html("").append(t)}return this},isClosable:function(){return this.options.closable},setClosable:function(t){return this.options.closable=t,this.updateClosable(),this},setCloseByBackdrop:function(t){return this.options.closeByBackdrop=t,this},canCloseByBackdrop:function(){return this.options.closeByBackdrop},setCloseByKeyboard:function(t){return this.options.closeByKeyboard=t,this},canCloseByKeyboard:function(){return this.options.closeByKeyboard},isAnimate:function(){return this.options.animate},setAnimate:function(t){return this.options.animate=t,this},updateAnimate:function(){return this.isRealized()&&this.getModal().toggleClass("fade",this.isAnimate()),this},getSpinicon:function(){return this.options.spinicon},setSpinicon:function(t){return this.options.spinicon=t,this},addButton:function(t){return this.options.buttons.push(t),this},addButtons:function(t){var o=this;return d.each(t,function(t,e){o.addButton(e)}),this},getButtons:function(){return this.options.buttons},setButtons:function(t){return this.options.buttons=t,this.updateButtons(),this},getButton:function(t){return void 0!==this.indexedButtons[t]?this.indexedButtons[t]:null},getButtonSize:function(){return void 0!==a.BUTTON_SIZES[this.getSize()]?a.BUTTON_SIZES[this.getSize()]:""},updateButtons:function(){return this.isRealized()&&(0===this.getButtons().length?this.getModalFooter().hide():this.getModalFooter().show().closest(".modal-footer").append(this.createFooterButtons())),this},isAutodestroy:function(){return this.options.autodestroy},setAutodestroy:function(t){this.options.autodestroy=t},getDescription:function(){return this.options.description},setDescription:function(t){return this.options.description=t,this},setTabindex:function(t){return this.options.tabindex=t,this},getTabindex:function(){return this.options.tabindex},updateTabindex:function(){return this.isRealized()&&this.getModal().attr("tabindex",this.getTabindex()),this},getDefaultText:function(){return a.DEFAULT_TEXTS[this.getType()]},getNamespace:function(t){return a.NAMESPACE+"-"+t},createHeaderContent:function(){var t=d("");return t.addClass(this.getNamespace("header")),t.append(this.createTitleContent()),t.append(this.createCloseButton()),t},createTitleContent:function(){var t=d("");return t.addClass(this.getNamespace("title")),t},createCloseButton:function(){var t=d("");t.addClass(this.getNamespace("close-button"));var e=d('');return e.append(this.options.closeIcon),t.append(e),t.on("click",{dialog:this},function(t){t.data.dialog.close()}),t},createBodyContent:function(){var t=d("");return t.addClass(this.getNamespace("body")),t.append(this.createMessageContent()),t},createMessageContent:function(){var t=d("");return t.addClass(this.getNamespace("message")),t},createFooterContent:function(){var t=d("");return t.addClass(this.getNamespace("footer")),t},createFooterButtons:function(){var n=this,i=n.$modalFooter;return this.indexedButtons={},d.each(this.options.buttons,function(t,e){e.id||(e.id=a.newGuid());var o=n.createButton(e);n.indexedButtons[e.id]=o,i.append(o)}),i},createButton:function(t){var o=d('');return o.prop("id",t.id),o.data("button",t),void 0!==t.icon&&""!==d.trim(t.icon)&&o.append(this.createButtonIcon(t.icon)),void 0!==t.label&&o.append(t.label),void 0!==t.title&&o.attr("title",t.title),void 0!==t.cssClass&&""!==d.trim(t.cssClass)?o.addClass(t.cssClass):o.addClass("btn-secondary"),"object"==typeof t.data&&t.data.constructor==={}.constructor&&d.each(t.data,function(t,e){o.attr("data-"+t,e)}),void 0!==t.hotkey&&(this.registeredButtonHotkeys[t.hotkey]=o),o.on("click",{dialog:this,$button:o,button:t},function(t){var e=t.data.dialog,o=t.data.$button,n=o.data("button");if(n.autospin&&o.toggleSpin(!0),"function"==typeof n.action)return n.action.call(o,e,t)}),this.enhanceButton(o),void 0!==t.enabled&&o.toggleEnable(t.enabled),o.addClass("bootstrap4-dialog-button"),o},enhanceButton:function(n){return n.dialog=this,n.toggleEnable=function(t){return void 0!==t?this.prop("disabled",!t).toggleClass("disabled",!t):this.prop("disabled",!this.prop("disabled")),this},n.enable=function(){return this.toggleEnable(!0),this},n.disable=function(){return this.toggleEnable(!1),this},n.toggleSpin=function(t){var e=this.dialog,o=this.find("."+e.getNamespace("button-icon"));return void 0===t&&(t=!(0");return e.addClass(this.getNamespace("button-icon")).addClass(t),e},enableButtons:function(o){return d.each(this.indexedButtons,function(t,e){e.toggleEnable(o)}),this},updateClosable:function(){return this.isRealized()&&this.getModalHeader().find("."+this.getNamespace("close-button")).toggle(this.isClosable()),this},onShow:function(t){return this.options.onshow=t,this},onShown:function(t){return this.options.onshown=t,this},onHide:function(t){return this.options.onhide=t,this},onHidden:function(t){return this.options.onhidden=t,this},isRealized:function(){return this.realized},setRealized:function(t){return this.realized=t,this},isOpened:function(){return this.opened},setOpened:function(t){return this.opened=t,this},handleModalEvents:function(){return this.getModal().on("show.bs.modal",{dialog:this},function(t){var e=t.data.dialog;if(e.setOpened(!0),e.isModalEvent(t)&&"function"==typeof e.options.onshow){var o=e.options.onshow(e);return!1===o&&e.setOpened(!1),o}}),this.getModal().on("shown.bs.modal",{dialog:this},function(t){var e=t.data.dialog;e.isModalEvent(t)&&"function"==typeof e.options.onshown&&e.options.onshown(e)}),this.getModal().on("hide.bs.modal",{dialog:this},function(t){var e=t.data.dialog;if(e.setOpened(!1),e.isModalEvent(t)&&"function"==typeof e.options.onhide){var o=e.options.onhide(e);return!1===o&&e.setOpened(!0),o}}),this.getModal().on("hidden.bs.modal",{dialog:this},function(t){var e=t.data.dialog;e.isModalEvent(t)&&"function"==typeof e.options.onhidden&&e.options.onhidden(e),e.isAutodestroy()&&(e.setRealized(!1),delete a.dialogs[e.getId()],d(this).remove()),a.moveFocus(),d(".modal").hasClass("in")&&d("body").addClass("modal-open")}),this.handleModalBackdropEvent(),this.getModal().on("keyup",{dialog:this},function(t){27===t.which&&t.data.dialog.isClosable()&&t.data.dialog.canCloseByKeyboard()&&t.data.dialog.close()}),this.getModal().on("keyup",{dialog:this},function(t){var e=t.data.dialog;if(void 0!==e.registeredButtonHotkeys[t.which]){var o=d(e.registeredButtonHotkeys[t.which]);o.prop("disabled")||o.is(":focus")||o.focus().trigger("click")}}),this},handleModalBackdropEvent:function(){return this.getModal().on("click",{dialog:this},function(t){d(t.target).hasClass("modal-backdrop")&&t.data.dialog.isClosable()&&t.data.dialog.canCloseByBackdrop()&&t.data.dialog.close()}),this},isModalEvent:function(t){return void 0!==t.namespace&&"bs.modal"===t.namespace},makeModalDraggable:function(){return this.options.draggable&&(this.getModalHeader().addClass(this.getNamespace("draggable")).on("mousedown",{dialog:this},function(t){var e=t.data.dialog;e.draggableData.isMouseDown=!0;var o=e.getModalDialog().offset();e.draggableData.mouseOffset={top:t.clientY-o.top,left:t.clientX-o.left}}),this.getModal().on("mouseup mouseleave",{dialog:this},function(t){t.data.dialog.draggableData.isMouseDown=!1}),d("body").on("mousemove",{dialog:this},function(t){var e=t.data.dialog;e.draggableData.isMouseDown&&e.getModalDialog().offset({top:t.clientY-e.draggableData.mouseOffset.top,left:t.clientX-e.draggableData.mouseOffset.left})})),this},realize:function(){return this.initModalStuff(),this.getModal().addClass(a.NAMESPACE).addClass(this.getCssClass()),this.updateSize(),this.getDescription()&&this.getModal().attr("aria-describedby",this.getDescription()),this.getModalHeader().append(this.createHeaderContent()),this.getModalBody().append(this.createBodyContent()),this.getModal().data("bs.modal",new e(this.getModalForBootstrapDialogModal(),{backdrop:"static",keyboard:!1,show:!1})),this.makeModalDraggable(),this.handleModalEvents(),this.setRealized(!0),this.updateButtons(),this.updateType(),this.updateTitle(),this.updateMessage(),this.updateClosable(),this.updateAnimate(),this.updateSize(),this.updateTabindex(),this},open:function(){return this.isRealized()||this.realize(),this.getModal().modal("show"),this},close:function(){return this.isRealized()||this.realize(),this.getModal().modal("hide"),this}},a.prototype=d.extend(a.prototype,a.METHODS_TO_OVERRIDE[e.getModalVersion()]),a.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})},a.show=function(t){return new a(t).open()},a.alert=function(){var t={},e={type:a.TYPE_PRIMARY,title:null,message:null,closable:!1,draggable:!1,buttonLabel:a.DEFAULT_TEXTS.OK,buttonHotkey:null,callback:null};t="object"==typeof arguments[0]&&arguments[0].constructor==={}.constructor?d.extend(!0,e,arguments[0]):d.extend(!0,e,{message:arguments[0],callback:void 0!==arguments[1]?arguments[1]:null});var o=new a(t);return o.setData("callback",t.callback),o.addButton({label:t.buttonLabel,hotkey:t.buttonHotkey,action:function(t){return("function"!=typeof t.getData("callback")||!1!==t.getData("callback").call(this,!0))&&(t.setData("btnClicked",!0),t.close())}}),"function"==typeof o.options.onhide?o.onHide(function(t){var e=!0;return!t.getData("btnClicked")&&t.isClosable()&&"function"==typeof t.getData("callback")&&(e=t.getData("callback")(!1)),!1!==e&&(e=this.onhide(t))}.bind({onhide:o.options.onhide})):o.onHide(function(t){var e=!0;return!t.getData("btnClicked")&&t.isClosable()&&"function"==typeof t.getData("callback")&&(e=t.getData("callback")(!1)),e}),o.open()},a.confirm=function(){var t={},e={type:a.TYPE_PRIMARY,title:null,message:null,closable:!1,draggable:!1,btnCancelLabel:a.DEFAULT_TEXTS.CANCEL,btnCancelClass:null,btnCancelHotkey:null,btnOKLabel:a.DEFAULT_TEXTS.OK,btnOKClass:null,btnOKHotkey:null,btnsOrder:a.defaultOptions.btnsOrder,callback:null};null===(t="object"==typeof arguments[0]&&arguments[0].constructor==={}.constructor?d.extend(!0,e,arguments[0]):d.extend(!0,e,{message:arguments[0],callback:void 0!==arguments[1]?arguments[1]:null})).btnOKClass&&(t.btnOKClass=["btn",t.type.split("-")[1]].join("-"));var o=new a(t);o.setData("callback",t.callback);var n=[{label:t.btnCancelLabel,cssClass:t.btnCancelClass,hotkey:t.btnCancelHotkey,action:function(t){return("function"!=typeof t.getData("callback")||!1!==t.getData("callback").call(this,!1))&&t.close()}},{label:t.btnOKLabel,cssClass:t.btnOKClass,hotkey:t.btnOKHotkey,action:function(t){return("function"!=typeof t.getData("callback")||!1!==t.getData("callback").call(this,!0))&&t.close()}}];return t.btnsOrder===a.BUTTONS_ORDER_OK_CANCEL&&n.reverse(),o.addButtons(n),o.open()},a.warning=function(t,e){return new a({type:a.TYPE_WARNING,message:t}).open()},a.danger=function(t,e){return new a({type:a.TYPE_DANGER,message:t}).open()},a.success=function(t,e){return new a({type:a.TYPE_SUCCESS,message:t}).open()},a});
\ No newline at end of file
+(function(a,b){if(typeof module!=="undefined"&&module.exports){module.exports=b(require("jquery"),require("bootstrap"))}else{if(typeof define==="function"&&define.amd){define("bootstrap-dialog",["jquery","bootstrap"],function(c){return b(c)})}else{a.BootstrapDialog=b(a.jQuery)}}}(this?this:window,function(d){var b=d.fn.modal.Constructor;var c=function(f,e){if(/4\.1\.\d+/.test(d.fn.modal.Constructor.VERSION)){return new b(f,e)}else{b.call(this,f,e)}};c.getModalVersion=function(){var e=null;if(typeof d.fn.modal.Constructor.VERSION==="undefined"){e="v3.1"}else{if(/3\.2\.\d+/.test(d.fn.modal.Constructor.VERSION)){e="v3.2"}else{if(/3\.3\.[1,2]/.test(d.fn.modal.Constructor.VERSION)){e="v3.3"}else{if(/4\.\d\.\d+/.test(d.fn.modal.Constructor.VERSION)){e="v4.1"}else{e="v3.3.4"}}}}return e};c.ORIGINAL_BODY_PADDING=parseInt((d("body").css("padding-right")||0),10);c.METHODS_TO_OVERRIDE={};c.METHODS_TO_OVERRIDE["v3.1"]={};c.METHODS_TO_OVERRIDE["v3.2"]={hide:function(g){if(g){g.preventDefault()}g=d.Event("hide.bs.modal");this.$element.trigger(g);if(!this.isShown||g.isDefaultPrevented()){return}this.isShown=false;var f=this.getGlobalOpenedDialogs();if(f.length===0){this.$body.removeClass("modal-open")}this.resetScrollbar();this.escape();d(document).off("focusin.bs.modal");this.$element.removeClass("in").attr("aria-hidden",true).off("click.dismiss.bs.modal");d.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",d.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()}};c.METHODS_TO_OVERRIDE["v3.3"]={setScrollbar:function(){var e=c.ORIGINAL_BODY_PADDING;if(this.bodyIsOverflowing){this.$body.css("padding-right",e+this.scrollbarWidth)}},resetScrollbar:function(){var e=this.getGlobalOpenedDialogs();if(e.length===0){this.$body.css("padding-right",c.ORIGINAL_BODY_PADDING)}},hideModal:function(){this.$element.hide();this.backdrop(d.proxy(function(){var e=this.getGlobalOpenedDialogs();if(e.length===0){this.$body.removeClass("modal-open")}this.resetAdjustments();this.resetScrollbar();this.$element.trigger("hidden.bs.modal")},this))}};c.METHODS_TO_OVERRIDE["v3.3.4"]=d.extend({},c.METHODS_TO_OVERRIDE["v3.3"]);c.METHODS_TO_OVERRIDE["v4.1"]=d.extend({},c.METHODS_TO_OVERRIDE["v3.3"]);c.prototype={constructor:c,getGlobalOpenedDialogs:function(){var e=[];d.each(a.dialogs,function(g,f){if(f.isRealized()&&f.isOpened()){e.push(f)}});return e}};c.prototype=d.extend(c.prototype,b.prototype,c.METHODS_TO_OVERRIDE[c.getModalVersion()]);var a=function(e){this.defaultOptions=d.extend(true,{id:a.newGuid(),buttons:[],data:{},onshow:null,onshown:null,onhide:null,onhidden:null},a.defaultOptions);this.indexedButtons={};this.registeredButtonHotkeys={};this.draggableData={isMouseDown:false,mouseOffset:{}};this.realized=false;this.opened=false;this.initOptions(e);this.holdThisInstance()};a.BootstrapDialogModal=c;a.NAMESPACE="bootstrap-dialog";a.TYPE_DEFAULT="type-default";a.TYPE_INFO="type-info";a.TYPE_PRIMARY="type-primary";a.TYPE_SECONDARY="type-secondary";a.TYPE_SUCCESS="type-success";a.TYPE_WARNING="type-warning";a.TYPE_DANGER="type-danger";a.TYPE_DARK="type-dark";a.TYPE_LIGHT="type-light";a.DEFAULT_TEXTS={};a.DEFAULT_TEXTS[a.TYPE_DEFAULT]="Default";a.DEFAULT_TEXTS[a.TYPE_INFO]="Information";a.DEFAULT_TEXTS[a.TYPE_PRIMARY]="Primary";a.DEFAULT_TEXTS[a.TYPE_SECONDARY]="Secondary";a.DEFAULT_TEXTS[a.TYPE_SUCCESS]="Success";a.DEFAULT_TEXTS[a.TYPE_WARNING]="Warning";a.DEFAULT_TEXTS[a.TYPE_DANGER]="Danger";a.DEFAULT_TEXTS[a.TYPE_DARK]="Dark";a.DEFAULT_TEXTS[a.TYPE_LIGHT]="Light";a.DEFAULT_TEXTS.OK="OK";a.DEFAULT_TEXTS.CANCEL="Cancel";a.DEFAULT_TEXTS.CONFIRM="Confirmation";a.SIZE_NORMAL="size-normal";a.SIZE_SMALL="size-small";a.SIZE_WIDE="size-wide";a.SIZE_EXTRAWIDE="size-extrawide";a.SIZE_LARGE="size-large";a.BUTTON_SIZES={};a.BUTTON_SIZES[a.SIZE_NORMAL]="";a.BUTTON_SIZES[a.SIZE_SMALL]="btn-small";a.BUTTON_SIZES[a.SIZE_WIDE]="btn-block";a.BUTTON_SIZES[a.SIZE_LARGE]="btn-lg";a.ICON_SPINNER="glyphicon glyphicon-asterisk";a.BUTTONS_ORDER_CANCEL_OK="btns-order-cancel-ok";a.BUTTONS_ORDER_OK_CANCEL="btns-order-ok-cancel";a.Z_INDEX_BACKDROP=1040;a.Z_INDEX_MODAL=1050;a.defaultOptions={type:a.TYPE_PRIMARY,size:a.SIZE_NORMAL,cssClass:"",title:null,message:null,nl2br:true,closable:true,closeByBackdrop:true,closeByKeyboard:true,closeIcon:"×",spinicon:a.ICON_SPINNER,autodestroy:true,draggable:false,animate:true,description:"",tabindex:-1,btnsOrder:a.BUTTONS_ORDER_CANCEL_OK};a.configDefaultOptions=function(e){a.defaultOptions=d.extend(true,a.defaultOptions,e)};a.dialogs={};a.openAll=function(){d.each(a.dialogs,function(f,e){e.open()})};a.closeAll=function(){d.each(a.dialogs,function(f,e){e.close()})};a.getDialog=function(f){var e=null;if(typeof a.dialogs[f]!=="undefined"){e=a.dialogs[f]}return e};a.setDialog=function(e){a.dialogs[e.getId()]=e;return e};a.addDialog=function(e){return a.setDialog(e)};a.moveFocus=function(){var e=null;d.each(a.dialogs,function(g,f){if(f.isRealized()&&f.isOpened()){e=f}});if(e!==null){e.getModal().focus()}};a.METHODS_TO_OVERRIDE={};a.METHODS_TO_OVERRIDE["v3.1"]={updateZIndex:function(){if(this.isOpened()){var g=a.Z_INDEX_BACKDROP;var h=a.Z_INDEX_MODAL;var i=0;d.each(a.dialogs,function(j,k){if(k.isRealized()&&k.isOpened()){i++}});var f=this.getModal();var e=this.getModalBackdrop(f);f.css("z-index",h+(i-1)*20);e.css("z-index",g+(i-1)*20)}return this},open:function(){!this.isRealized()&&this.realize();this.getModal().modal("show");this.updateZIndex();return this}};a.METHODS_TO_OVERRIDE["v3.2"]={updateZIndex:a.METHODS_TO_OVERRIDE["v3.1"]["updateZIndex"],open:a.METHODS_TO_OVERRIDE["v3.1"]["open"]};a.METHODS_TO_OVERRIDE["v3.3"]={};a.METHODS_TO_OVERRIDE["v3.3.4"]=d.extend({},a.METHODS_TO_OVERRIDE["v3.1"]);a.METHODS_TO_OVERRIDE["v4.0"]={getModalBackdrop:function(e){return d(e.data("bs.modal")._backdrop)},updateZIndex:a.METHODS_TO_OVERRIDE["v3.1"]["updateZIndex"],open:a.METHODS_TO_OVERRIDE["v3.1"]["open"],getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}};a.METHODS_TO_OVERRIDE["v4.1"]={getModalBackdrop:function(e){return d(e.data("bs.modal")._backdrop)},updateZIndex:a.METHODS_TO_OVERRIDE["v3.1"]["updateZIndex"],open:a.METHODS_TO_OVERRIDE["v3.1"]["open"],getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}};a.prototype={constructor:a,initOptions:function(e){this.options=d.extend(true,this.defaultOptions,e);return this},holdThisInstance:function(){a.addDialog(this);return this},initModalStuff:function(){this.setModal(this.createModal()).setModalDialog(this.createModalDialog()).setModalContent(this.createModalContent()).setModalHeader(this.createModalHeader()).setModalBody(this.createModalBody()).setModalFooter(this.createModalFooter());this.getModal().append(this.getModalDialog());this.getModalDialog().append(this.getModalContent());this.getModalContent().append(this.getModalHeader()).append(this.getModalBody()).append(this.getModalFooter());return this},createModal:function(){var e=d('');e.prop("id",this.getId());e.attr("aria-labelledby",this.getId()+"_title");return e},getModal:function(){return this.$modal},setModal:function(e){this.$modal=e;return this},getModalBackdrop:function(e){return e.data("bs.modal").$backdrop},getModalForBootstrapDialogModal:function(){return this.getModal()},createModalDialog:function(){return d('')},getModalDialog:function(){return this.$modalDialog},setModalDialog:function(e){this.$modalDialog=e;return this},createModalContent:function(){return d('')},getModalContent:function(){return this.$modalContent},setModalContent:function(e){this.$modalContent=e;return this},createModalHeader:function(){return d('')},getModalHeader:function(){return this.$modalHeader},setModalHeader:function(e){this.$modalHeader=e;return this},createModalBody:function(){return d('')},getModalBody:function(){return this.$modalBody},setModalBody:function(e){this.$modalBody=e;return this},createModalFooter:function(){return d('')},getModalFooter:function(){return this.$modalFooter},setModalFooter:function(e){this.$modalFooter=e;return this},createDynamicContent:function(f){var e=null;if(typeof f==="function"){e=f.call(f,this)}else{e=f}if(typeof e==="string"){e=this.formatStringContent(e)}return e},formatStringContent:function(e){if(this.options.nl2br){return e.replace(/\r\n/g,"
").replace(/[\r\n]/g,"
")}return e},setData:function(e,f){this.options.data[e]=f;return this},getData:function(e){return this.options.data[e]},setId:function(e){this.options.id=e;return this},getId:function(){return this.options.id},getType:function(){return this.options.type},setType:function(e){this.options.type=e;this.updateType();return this},updateType:function(){if(this.isRealized()){var e=[a.TYPE_DEFAULT,a.TYPE_INFO,a.TYPE_PRIMARY,a.TYPE_SECONDARY,a.TYPE_SUCCESS,a.TYPE_WARNING,a.TYPE_DARK,a.TYPE_LIGHT,a.TYPE_DANGER];this.getModal().removeClass(e.join(" ")).addClass(this.getType())}return this},getSize:function(){return this.options.size},setSize:function(e){this.options.size=e;this.updateSize();return this},updateSize:function(){if(this.isRealized()){var e=this;this.getModal().removeClass(a.SIZE_NORMAL).removeClass(a.SIZE_SMALL).removeClass(a.SIZE_WIDE).removeClass(a.SIZE_EXTRAWIDE).removeClass(a.SIZE_LARGE);this.getModal().addClass(this.getSize());this.getModalDialog().removeClass("modal-sm");if(this.getSize()===a.SIZE_SMALL){this.getModalDialog().addClass("modal-sm")}this.getModalDialog().removeClass("modal-lg");if(this.getSize()===a.SIZE_WIDE){this.getModalDialog().addClass("modal-lg")}this.getModalDialog().removeClass("modal-xl");if(this.getSize()===a.SIZE_EXTRAWIDE){this.getModalDialog().addClass("modal-xl")}d.each(this.options.buttons,function(g,i){var k=e.getButton(i.id);var f=["btn-lg","btn-sm","btn-xs"];var j=false;if(typeof i.cssClass==="string"){var h=i.cssClass.split(" ");d.each(h,function(l,m){if(d.inArray(m,f)!==-1){j=true}})}if(!j){k.removeClass(f.join(" "));k.addClass(e.getButtonSize())}})}return this},getCssClass:function(){return this.options.cssClass},setCssClass:function(e){this.options.cssClass=e;return this},getTitle:function(){return this.options.title},setTitle:function(e){this.options.title=e;this.updateTitle();return this},updateTitle:function(){if(this.isRealized()){var e=this.getTitle()!==null?this.createDynamicContent(this.getTitle()):this.getDefaultText();this.getModalHeader().find("."+this.getNamespace("title")).html("").append(e).prop("id",this.getId()+"_title")}return this},getMessage:function(){return this.options.message},setMessage:function(e){this.options.message=e;this.updateMessage();return this},updateMessage:function(){if(this.isRealized()){var e=this.createDynamicContent(this.getMessage());this.getModalBody().find("."+this.getNamespace("message")).html("").append(e)}return this},isClosable:function(){return this.options.closable},setClosable:function(e){this.options.closable=e;this.updateClosable();return this},setCloseByBackdrop:function(e){this.options.closeByBackdrop=e;return this},canCloseByBackdrop:function(){return this.options.closeByBackdrop},setCloseByKeyboard:function(e){this.options.closeByKeyboard=e;return this},canCloseByKeyboard:function(){return this.options.closeByKeyboard},isAnimate:function(){return this.options.animate},setAnimate:function(e){this.options.animate=e;return this},updateAnimate:function(){if(this.isRealized()){this.getModal().toggleClass("fade",this.isAnimate())}return this},getSpinicon:function(){return this.options.spinicon},setSpinicon:function(e){this.options.spinicon=e;return this},addButton:function(e){this.options.buttons.push(e);return this},addButtons:function(f){var e=this;d.each(f,function(g,h){e.addButton(h)});return this},getButtons:function(){return this.options.buttons},setButtons:function(e){this.options.buttons=e;this.updateButtons();return this},getButton:function(e){if(typeof this.indexedButtons[e]!=="undefined"){return this.indexedButtons[e]}return null},getButtonSize:function(){if(typeof a.BUTTON_SIZES[this.getSize()]!=="undefined"){return a.BUTTON_SIZES[this.getSize()]}return""},updateButtons:function(){if(this.isRealized()){if(this.getButtons().length===0){this.getModalFooter().hide()}else{this.getModalFooter().show().closest(".modal-footer").append(this.createFooterButtons())}}return this},isAutodestroy:function(){return this.options.autodestroy},setAutodestroy:function(e){this.options.autodestroy=e},getDescription:function(){return this.options.description},setDescription:function(e){this.options.description=e;return this},setTabindex:function(e){this.options.tabindex=e;return this},getTabindex:function(){return this.options.tabindex},updateTabindex:function(){if(this.isRealized()){this.getModal().attr("tabindex",this.getTabindex())}return this},getDefaultText:function(){return a.DEFAULT_TEXTS[this.getType()]},getNamespace:function(e){return a.NAMESPACE+"-"+e},createHeaderContent:function(){var e=d("");e.addClass(this.getNamespace("header"));e.append(this.createTitleContent());e.append(this.createCloseButton());return e},createTitleContent:function(){var e=d("");e.addClass(this.getNamespace("title"));return e},createCloseButton:function(){var f=d("");f.addClass(this.getNamespace("close-button"));var e=d('');e.append(this.options.closeIcon);f.append(e);f.on("click",{dialog:this},function(g){g.data.dialog.close()});return f},createBodyContent:function(){var e=d("");e.addClass(this.getNamespace("body"));e.append(this.createMessageContent());return e},createMessageContent:function(){var e=d("");e.addClass(this.getNamespace("message"));return e},createFooterContent:function(){var e=d("");e.addClass(this.getNamespace("footer"));return e},createFooterButtons:function(){var e=this;var f=e.$modalFooter;this.indexedButtons={};d.each(this.options.buttons,function(g,h){if(!h.id){h.id=a.newGuid()}var i=e.createButton(h);e.indexedButtons[h.id]=i;f.append(i)});return f},createButton:function(e){var f=d('');f.prop("id",e.id);f.data("button",e);if(typeof e.icon!=="undefined"&&d.trim(e.icon)!==""){f.append(this.createButtonIcon(e.icon))}if(typeof e.label!=="undefined"){f.append(e.label)}if(typeof e.title!=="undefined"){f.attr("title",e.title)}if(typeof e.cssClass!=="undefined"&&d.trim(e.cssClass)!==""){f.addClass(e.cssClass)}else{f.addClass("btn-secondary")}if(typeof e.data==="object"&&e.data.constructor==={}.constructor){d.each(e.data,function(g,h){f.attr("data-"+g,h)})}if(typeof e.hotkey!=="undefined"){this.registeredButtonHotkeys[e.hotkey]=f}f.on("click",{dialog:this,$button:f,button:e},function(i){var h=i.data.dialog;var j=i.data.$button;var g=j.data("button");if(g.autospin){j.toggleSpin(true)}if(typeof g.action==="function"){return g.action.call(j,h,i)}});this.enhanceButton(f);if(typeof e.enabled!=="undefined"){f.toggleEnable(e.enabled)}f.addClass("bootstrap4-dialog-button");return f},enhanceButton:function(e){e.dialog=this;e.toggleEnable=function(f){var g=this;if(typeof f!=="undefined"){g.prop("disabled",!f).toggleClass("disabled",!f)}else{g.prop("disabled",!g.prop("disabled"))}return g};e.enable=function(){var f=this;f.toggleEnable(true);return f};e.disable=function(){var f=this;f.toggleEnable(false);return f};e.toggleSpin=function(i){var h=this;var g=h.dialog;var f=h.find("."+g.getNamespace("button-icon"));if(typeof i==="undefined"){i=!(e.find(".icon-spin").length>0)}if(i){f.hide();e.prepend(g.createButtonIcon(g.getSpinicon()).addClass("icon-spin"))}else{f.show();e.find(".icon-spin").remove()}return h};e.spin=function(){var f=this;f.toggleSpin(true);return f};e.stopSpin=function(){var f=this;f.toggleSpin(false);return f};return this},createButtonIcon:function(f){var e=d("");e.addClass(this.getNamespace("button-icon")).addClass(f);return e},enableButtons:function(e){d.each(this.indexedButtons,function(g,f){f.toggleEnable(e)});return this},updateClosable:function(){if(this.isRealized()){this.getModalHeader().find("."+this.getNamespace("close-button")).toggle(this.isClosable())}return this},onShow:function(e){this.options.onshow=e;return this},onShown:function(e){this.options.onshown=e;return this},onHide:function(e){this.options.onhide=e;return this},onHidden:function(e){this.options.onhidden=e;return this},isRealized:function(){return this.realized},setRealized:function(e){this.realized=e;return this},isOpened:function(){return this.opened},setOpened:function(e){this.opened=e;return this},handleModalEvents:function(){this.getModal().on("show.bs.modal",{dialog:this},function(g){var f=g.data.dialog;f.setOpened(true);if(f.isModalEvent(g)&&typeof f.options.onshow==="function"){var e=f.options.onshow(f);if(e===false){f.setOpened(false)}return e}});this.getModal().on("shown.bs.modal",{dialog:this},function(f){var e=f.data.dialog;e.isModalEvent(f)&&typeof e.options.onshown==="function"&&e.options.onshown(e)});this.getModal().on("hide.bs.modal",{dialog:this},function(f){var e=f.data.dialog;e.setOpened(false);if(e.isModalEvent(f)&&typeof e.options.onhide==="function"){var g=e.options.onhide(e);if(g===false){e.setOpened(true)}return g}});this.getModal().on("hidden.bs.modal",{dialog:this},function(f){var e=f.data.dialog;e.isModalEvent(f)&&typeof e.options.onhidden==="function"&&e.options.onhidden(e);if(e.isAutodestroy()){e.setRealized(false);delete a.dialogs[e.getId()];d(this).remove()}a.moveFocus();if(d(".modal").hasClass("in")){d("body").addClass("modal-open")}});this.getModal().on("keyup",{dialog:this},function(e){e.which===27&&e.data.dialog.isClosable()&&e.data.dialog.canCloseByKeyboard()&&e.data.dialog.close()});this.getModal().on("keyup",{dialog:this},function(f){var e=f.data.dialog;if(typeof e.registeredButtonHotkeys[f.which]!=="undefined"){var g=d(e.registeredButtonHotkeys[f.which]);!g.prop("disabled")&&!g.is(":focus")&&g.focus().trigger("click")}});return this},isModalEvent:function(e){return typeof e.namespace!=="undefined"&&e.namespace==="bs.modal"},makeModalDraggable:function(){if(this.options.draggable){this.getModalHeader().addClass(this.getNamespace("draggable")).on("mousedown",{dialog:this},function(g){var f=g.data.dialog;f.draggableData.isMouseDown=true;var e=f.getModalDialog().offset();f.draggableData.mouseOffset={top:g.clientY-e.top,left:g.clientX-e.left}});this.getModal().on("mouseup mouseleave",{dialog:this},function(e){e.data.dialog.draggableData.isMouseDown=false});d("body").on("mousemove",{dialog:this},function(f){var e=f.data.dialog;if(!e.draggableData.isMouseDown){return}e.getModalDialog().offset({top:f.clientY-e.draggableData.mouseOffset.top,left:f.clientX-e.draggableData.mouseOffset.left})})}return this},realize:function(){this.initModalStuff();this.getModal().addClass(a.NAMESPACE).addClass(this.getCssClass());this.updateSize();if(this.getDescription()){this.getModal().attr("aria-describedby",this.getDescription())}this.getModalHeader().append(this.createHeaderContent());this.getModalBody().append(this.createBodyContent());this.getModal().data("bs.modal",new c(this.getModalForBootstrapDialogModal(),{backdrop:(this.isClosable()&&this.canCloseByBackdrop())?true:"static",keyboard:false,show:false}));this.makeModalDraggable();this.handleModalEvents();this.setRealized(true);this.updateButtons();this.updateType();this.updateTitle();this.updateMessage();this.updateClosable();this.updateAnimate();this.updateSize();this.updateTabindex();return this},open:function(){!this.isRealized()&&this.realize();this.getModal().modal("show");return this},close:function(){!this.isRealized()&&this.realize();this.getModal().modal("hide");return this}};a.prototype=d.extend(a.prototype,a.METHODS_TO_OVERRIDE[c.getModalVersion()]);a.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(g){var f=Math.random()*16|0,e=g==="x"?f:(f&3|8);return e.toString(16)})};a.show=function(e){return new a(e).open()};a.alert=function(){var g={};var e={type:a.TYPE_PRIMARY,title:null,message:null,closable:false,draggable:false,buttonLabel:a.DEFAULT_TEXTS.OK,buttonHotkey:null,callback:null};if(typeof arguments[0]==="object"&&arguments[0].constructor==={}.constructor){g=d.extend(true,e,arguments[0])}else{g=d.extend(true,e,{message:arguments[0],callback:typeof arguments[1]!=="undefined"?arguments[1]:null})}var f=new a(g);f.setData("callback",g.callback);f.addButton({label:g.buttonLabel,hotkey:g.buttonHotkey,action:function(h){if(typeof h.getData("callback")==="function"&&h.getData("callback").call(this,true)===false){return false}h.setData("btnClicked",true);return h.close()}});if(typeof f.options.onhide==="function"){f.onHide(function(h){var i=true;if(!h.getData("btnClicked")&&h.isClosable()&&typeof h.getData("callback")==="function"){i=h.getData("callback")(false)}if(i===false){return false}i=this.onhide(h);return i}.bind({onhide:f.options.onhide}))}else{f.onHide(function(h){var i=true;if(!h.getData("btnClicked")&&h.isClosable()&&typeof h.getData("callback")==="function"){i=h.getData("callback")(false)}return i})}return f.open()};a.confirm=function(){var g={};var h={type:a.TYPE_PRIMARY,title:null,message:null,closable:false,draggable:false,btnCancelLabel:a.DEFAULT_TEXTS.CANCEL,btnCancelClass:null,btnCancelHotkey:null,btnOKLabel:a.DEFAULT_TEXTS.OK,btnOKClass:null,btnOKHotkey:null,btnsOrder:a.defaultOptions.btnsOrder,callback:null};if(typeof arguments[0]==="object"&&arguments[0].constructor==={}.constructor){g=d.extend(true,h,arguments[0])}else{g=d.extend(true,h,{message:arguments[0],callback:typeof arguments[1]!=="undefined"?arguments[1]:null})}if(g.btnOKClass===null){g.btnOKClass=["btn",g.type.split("-")[1]].join("-")}var e=new a(g);e.setData("callback",g.callback);var f=[{label:g.btnCancelLabel,cssClass:g.btnCancelClass,hotkey:g.btnCancelHotkey,action:function(i){if(typeof i.getData("callback")==="function"&&i.getData("callback").call(this,false)===false){return false}return i.close()}},{label:g.btnOKLabel,cssClass:g.btnOKClass,hotkey:g.btnOKHotkey,action:function(i){if(typeof i.getData("callback")==="function"&&i.getData("callback").call(this,true)===false){return false}return i.close()}}];if(g.btnsOrder===a.BUTTONS_ORDER_OK_CANCEL){f.reverse()}e.addButtons(f);return e.open()};a.warning=function(e,f){return new a({type:a.TYPE_WARNING,message:e}).open()};a.danger=function(e,f){return new a({type:a.TYPE_DANGER,message:e}).open()};a.success=function(e,f){return new a({type:a.TYPE_SUCCESS,message:e}).open()};return a}));
\ No newline at end of file
diff --git a/src/js/bootstrap-dialog.min.js b/src/js/bootstrap-dialog.min.js
index bef492f..5b251b8 100644
--- a/src/js/bootstrap-dialog.min.js
+++ b/src/js/bootstrap-dialog.min.js
@@ -1 +1 @@
-(function(a,b){if(typeof module!=="undefined"&&module.exports){module.exports=b(require("jquery"),require("bootstrap"))}else{if(typeof define==="function"&&define.amd){define("bootstrap-dialog",["jquery","bootstrap"],function(c){return b(c)})}else{a.BootstrapDialog=b(a.jQuery)}}}(this?this:window,function(d){var b=d.fn.modal.Constructor;var c=function(f,e){if(/4\.1\.\d+/.test(d.fn.modal.Constructor.VERSION)){return new b(f,e)}else{b.call(this,f,e)}};c.getModalVersion=function(){var e=null;if(typeof d.fn.modal.Constructor.VERSION==="undefined"){e="v3.1"}else{if(/3\.2\.\d+/.test(d.fn.modal.Constructor.VERSION)){e="v3.2"}else{if(/3\.3\.[1,2]/.test(d.fn.modal.Constructor.VERSION)){e="v3.3"}else{if(/4\.\d\.\d+/.test(d.fn.modal.Constructor.VERSION)){e="v4.1"}else{e="v3.3.4"}}}}return e};c.ORIGINAL_BODY_PADDING=parseInt((d("body").css("padding-right")||0),10);c.METHODS_TO_OVERRIDE={};c.METHODS_TO_OVERRIDE["v3.1"]={};c.METHODS_TO_OVERRIDE["v3.2"]={hide:function(g){if(g){g.preventDefault()}g=d.Event("hide.bs.modal");this.$element.trigger(g);if(!this.isShown||g.isDefaultPrevented()){return}this.isShown=false;var f=this.getGlobalOpenedDialogs();if(f.length===0){this.$body.removeClass("modal-open")}this.resetScrollbar();this.escape();d(document).off("focusin.bs.modal");this.$element.removeClass("in").attr("aria-hidden",true).off("click.dismiss.bs.modal");d.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",d.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()}};c.METHODS_TO_OVERRIDE["v3.3"]={setScrollbar:function(){var e=c.ORIGINAL_BODY_PADDING;if(this.bodyIsOverflowing){this.$body.css("padding-right",e+this.scrollbarWidth)}},resetScrollbar:function(){var e=this.getGlobalOpenedDialogs();if(e.length===0){this.$body.css("padding-right",c.ORIGINAL_BODY_PADDING)}},hideModal:function(){this.$element.hide();this.backdrop(d.proxy(function(){var e=this.getGlobalOpenedDialogs();if(e.length===0){this.$body.removeClass("modal-open")}this.resetAdjustments();this.resetScrollbar();this.$element.trigger("hidden.bs.modal")},this))}};c.METHODS_TO_OVERRIDE["v3.3.4"]=d.extend({},c.METHODS_TO_OVERRIDE["v3.3"]);c.METHODS_TO_OVERRIDE["v4.1"]=d.extend({},c.METHODS_TO_OVERRIDE["v3.3"]);c.prototype={constructor:c,getGlobalOpenedDialogs:function(){var e=[];d.each(a.dialogs,function(g,f){if(f.isRealized()&&f.isOpened()){e.push(f)}});return e}};c.prototype=d.extend(c.prototype,b.prototype,c.METHODS_TO_OVERRIDE[c.getModalVersion()]);var a=function(e){this.defaultOptions=d.extend(true,{id:a.newGuid(),buttons:[],data:{},onshow:null,onshown:null,onhide:null,onhidden:null},a.defaultOptions);this.indexedButtons={};this.registeredButtonHotkeys={};this.draggableData={isMouseDown:false,mouseOffset:{}};this.realized=false;this.opened=false;this.initOptions(e);this.holdThisInstance()};a.BootstrapDialogModal=c;a.NAMESPACE="bootstrap-dialog";a.TYPE_DEFAULT="type-default";a.TYPE_INFO="type-info";a.TYPE_PRIMARY="type-primary";a.TYPE_SECONDARY="type-secondary";a.TYPE_SUCCESS="type-success";a.TYPE_WARNING="type-warning";a.TYPE_DANGER="type-danger";a.TYPE_DARK="type-dark";a.TYPE_LIGHT="type-light";a.DEFAULT_TEXTS={};a.DEFAULT_TEXTS[a.TYPE_DEFAULT]="Default";a.DEFAULT_TEXTS[a.TYPE_INFO]="Information";a.DEFAULT_TEXTS[a.TYPE_PRIMARY]="Primary";a.DEFAULT_TEXTS[a.TYPE_SECONDARY]="Secondary";a.DEFAULT_TEXTS[a.TYPE_SUCCESS]="Success";a.DEFAULT_TEXTS[a.TYPE_WARNING]="Warning";a.DEFAULT_TEXTS[a.TYPE_DANGER]="Danger";a.DEFAULT_TEXTS[a.TYPE_DARK]="Dark";a.DEFAULT_TEXTS[a.TYPE_LIGHT]="Light";a.DEFAULT_TEXTS.OK="OK";a.DEFAULT_TEXTS.CANCEL="Cancel";a.DEFAULT_TEXTS.CONFIRM="Confirmation";a.SIZE_NORMAL="size-normal";a.SIZE_SMALL="size-small";a.SIZE_WIDE="size-wide";a.SIZE_EXTRAWIDE="size-extrawide";a.SIZE_LARGE="size-large";a.BUTTON_SIZES={};a.BUTTON_SIZES[a.SIZE_NORMAL]="";a.BUTTON_SIZES[a.SIZE_SMALL]="btn-small";a.BUTTON_SIZES[a.SIZE_WIDE]="btn-block";a.BUTTON_SIZES[a.SIZE_LARGE]="btn-lg";a.ICON_SPINNER="glyphicon glyphicon-asterisk";a.BUTTONS_ORDER_CANCEL_OK="btns-order-cancel-ok";a.BUTTONS_ORDER_OK_CANCEL="btns-order-ok-cancel";a.Z_INDEX_BACKDROP=1040;a.Z_INDEX_MODAL=1050;a.defaultOptions={type:a.TYPE_PRIMARY,size:a.SIZE_NORMAL,cssClass:"",title:null,message:null,nl2br:true,closable:true,closeByBackdrop:true,closeByKeyboard:true,closeIcon:"×",spinicon:a.ICON_SPINNER,autodestroy:true,draggable:false,animate:true,description:"",tabindex:-1,btnsOrder:a.BUTTONS_ORDER_CANCEL_OK};a.configDefaultOptions=function(e){a.defaultOptions=d.extend(true,a.defaultOptions,e)};a.dialogs={};a.openAll=function(){d.each(a.dialogs,function(f,e){e.open()})};a.closeAll=function(){d.each(a.dialogs,function(f,e){e.close()})};a.getDialog=function(f){var e=null;if(typeof a.dialogs[f]!=="undefined"){e=a.dialogs[f]}return e};a.setDialog=function(e){a.dialogs[e.getId()]=e;return e};a.addDialog=function(e){return a.setDialog(e)};a.moveFocus=function(){var e=null;d.each(a.dialogs,function(g,f){if(f.isRealized()&&f.isOpened()){e=f}});if(e!==null){e.getModal().focus()}};a.METHODS_TO_OVERRIDE={};a.METHODS_TO_OVERRIDE["v3.1"]={handleModalBackdropEvent:function(){this.getModal().on("click",{dialog:this},function(e){e.target===this&&e.data.dialog.isClosable()&&e.data.dialog.canCloseByBackdrop()&&e.data.dialog.close()});return this},updateZIndex:function(){if(this.isOpened()){var g=a.Z_INDEX_BACKDROP;var h=a.Z_INDEX_MODAL;var i=0;d.each(a.dialogs,function(j,k){if(k.isRealized()&&k.isOpened()){i++}});var f=this.getModal();var e=this.getModalBackdrop(f);f.css("z-index",h+(i-1)*20);e.css("z-index",g+(i-1)*20)}return this},open:function(){!this.isRealized()&&this.realize();this.getModal().modal("show");this.updateZIndex();return this}};a.METHODS_TO_OVERRIDE["v3.2"]={updateZIndex:a.METHODS_TO_OVERRIDE["v3.1"]["updateZIndex"],open:a.METHODS_TO_OVERRIDE["v3.1"]["open"]};a.METHODS_TO_OVERRIDE["v3.3"]={};a.METHODS_TO_OVERRIDE["v3.3.4"]=d.extend({},a.METHODS_TO_OVERRIDE["v3.1"]);a.METHODS_TO_OVERRIDE["v4.0"]={getModalBackdrop:function(e){return d(e.data("bs.modal")._backdrop)},updateZIndex:a.METHODS_TO_OVERRIDE["v3.1"]["updateZIndex"],open:a.METHODS_TO_OVERRIDE["v3.1"]["open"],getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}};a.METHODS_TO_OVERRIDE["v4.1"]={getModalBackdrop:function(e){return d(e.data("bs.modal")._backdrop)},updateZIndex:a.METHODS_TO_OVERRIDE["v3.1"]["updateZIndex"],open:a.METHODS_TO_OVERRIDE["v3.1"]["open"],getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}};a.prototype={constructor:a,initOptions:function(e){this.options=d.extend(true,this.defaultOptions,e);return this},holdThisInstance:function(){a.addDialog(this);return this},initModalStuff:function(){this.setModal(this.createModal()).setModalDialog(this.createModalDialog()).setModalContent(this.createModalContent()).setModalHeader(this.createModalHeader()).setModalBody(this.createModalBody()).setModalFooter(this.createModalFooter());this.getModal().append(this.getModalDialog());this.getModalDialog().append(this.getModalContent());this.getModalContent().append(this.getModalHeader()).append(this.getModalBody()).append(this.getModalFooter());return this},createModal:function(){var e=d('');e.prop("id",this.getId());e.attr("aria-labelledby",this.getId()+"_title");return e},getModal:function(){return this.$modal},setModal:function(e){this.$modal=e;return this},getModalBackdrop:function(e){return e.data("bs.modal").$backdrop},getModalForBootstrapDialogModal:function(){return this.getModal()},createModalDialog:function(){return d('')},getModalDialog:function(){return this.$modalDialog},setModalDialog:function(e){this.$modalDialog=e;return this},createModalContent:function(){return d('')},getModalContent:function(){return this.$modalContent},setModalContent:function(e){this.$modalContent=e;return this},createModalHeader:function(){return d('')},getModalHeader:function(){return this.$modalHeader},setModalHeader:function(e){this.$modalHeader=e;return this},createModalBody:function(){return d('')},getModalBody:function(){return this.$modalBody},setModalBody:function(e){this.$modalBody=e;return this},createModalFooter:function(){return d('')},getModalFooter:function(){return this.$modalFooter},setModalFooter:function(e){this.$modalFooter=e;return this},createDynamicContent:function(f){var e=null;if(typeof f==="function"){e=f.call(f,this)}else{e=f}if(typeof e==="string"){e=this.formatStringContent(e)}return e},formatStringContent:function(e){if(this.options.nl2br){return e.replace(/\r\n/g,"
").replace(/[\r\n]/g,"
")}return e},setData:function(e,f){this.options.data[e]=f;return this},getData:function(e){return this.options.data[e]},setId:function(e){this.options.id=e;return this},getId:function(){return this.options.id},getType:function(){return this.options.type},setType:function(e){this.options.type=e;this.updateType();return this},updateType:function(){if(this.isRealized()){var e=[a.TYPE_DEFAULT,a.TYPE_INFO,a.TYPE_PRIMARY,a.TYPE_SECONDARY,a.TYPE_SUCCESS,a.TYPE_WARNING,a.TYPE_DARK,a.TYPE_LIGHT,a.TYPE_DANGER];this.getModal().removeClass(e.join(" ")).addClass(this.getType())}return this},getSize:function(){return this.options.size},setSize:function(e){this.options.size=e;this.updateSize();return this},updateSize:function(){if(this.isRealized()){var e=this;this.getModal().removeClass(a.SIZE_NORMAL).removeClass(a.SIZE_SMALL).removeClass(a.SIZE_WIDE).removeClass(a.SIZE_EXTRAWIDE).removeClass(a.SIZE_LARGE);this.getModal().addClass(this.getSize());this.getModalDialog().removeClass("modal-sm");if(this.getSize()===a.SIZE_SMALL){this.getModalDialog().addClass("modal-sm")}this.getModalDialog().removeClass("modal-lg");if(this.getSize()===a.SIZE_WIDE){this.getModalDialog().addClass("modal-lg")}this.getModalDialog().removeClass("modal-xl");if(this.getSize()===a.SIZE_EXTRAWIDE){this.getModalDialog().addClass("modal-xl")}d.each(this.options.buttons,function(g,i){var k=e.getButton(i.id);var f=["btn-lg","btn-sm","btn-xs"];var j=false;if(typeof i.cssClass==="string"){var h=i.cssClass.split(" ");d.each(h,function(l,m){if(d.inArray(m,f)!==-1){j=true}})}if(!j){k.removeClass(f.join(" "));k.addClass(e.getButtonSize())}})}return this},getCssClass:function(){return this.options.cssClass},setCssClass:function(e){this.options.cssClass=e;return this},getTitle:function(){return this.options.title},setTitle:function(e){this.options.title=e;this.updateTitle();return this},updateTitle:function(){if(this.isRealized()){var e=this.getTitle()!==null?this.createDynamicContent(this.getTitle()):this.getDefaultText();this.getModalHeader().find("."+this.getNamespace("title")).html("").append(e).prop("id",this.getId()+"_title")}return this},getMessage:function(){return this.options.message},setMessage:function(e){this.options.message=e;this.updateMessage();return this},updateMessage:function(){if(this.isRealized()){var e=this.createDynamicContent(this.getMessage());this.getModalBody().find("."+this.getNamespace("message")).html("").append(e)}return this},isClosable:function(){return this.options.closable},setClosable:function(e){this.options.closable=e;this.updateClosable();return this},setCloseByBackdrop:function(e){this.options.closeByBackdrop=e;return this},canCloseByBackdrop:function(){return this.options.closeByBackdrop},setCloseByKeyboard:function(e){this.options.closeByKeyboard=e;return this},canCloseByKeyboard:function(){return this.options.closeByKeyboard},isAnimate:function(){return this.options.animate},setAnimate:function(e){this.options.animate=e;return this},updateAnimate:function(){if(this.isRealized()){this.getModal().toggleClass("fade",this.isAnimate())}return this},getSpinicon:function(){return this.options.spinicon},setSpinicon:function(e){this.options.spinicon=e;return this},addButton:function(e){this.options.buttons.push(e);return this},addButtons:function(f){var e=this;d.each(f,function(g,h){e.addButton(h)});return this},getButtons:function(){return this.options.buttons},setButtons:function(e){this.options.buttons=e;this.updateButtons();return this},getButton:function(e){if(typeof this.indexedButtons[e]!=="undefined"){return this.indexedButtons[e]}return null},getButtonSize:function(){if(typeof a.BUTTON_SIZES[this.getSize()]!=="undefined"){return a.BUTTON_SIZES[this.getSize()]}return""},updateButtons:function(){if(this.isRealized()){if(this.getButtons().length===0){this.getModalFooter().hide()}else{this.getModalFooter().show().closest(".modal-footer").append(this.createFooterButtons())}}return this},isAutodestroy:function(){return this.options.autodestroy},setAutodestroy:function(e){this.options.autodestroy=e},getDescription:function(){return this.options.description},setDescription:function(e){this.options.description=e;return this},setTabindex:function(e){this.options.tabindex=e;return this},getTabindex:function(){return this.options.tabindex},updateTabindex:function(){if(this.isRealized()){this.getModal().attr("tabindex",this.getTabindex())}return this},getDefaultText:function(){return a.DEFAULT_TEXTS[this.getType()]},getNamespace:function(e){return a.NAMESPACE+"-"+e},createHeaderContent:function(){var e=d("");e.addClass(this.getNamespace("header"));e.append(this.createTitleContent());e.append(this.createCloseButton());return e},createTitleContent:function(){var e=d("");e.addClass(this.getNamespace("title"));return e},createCloseButton:function(){var f=d("");f.addClass(this.getNamespace("close-button"));var e=d('');e.append(this.options.closeIcon);f.append(e);f.on("click",{dialog:this},function(g){g.data.dialog.close()});return f},createBodyContent:function(){var e=d("");e.addClass(this.getNamespace("body"));e.append(this.createMessageContent());return e},createMessageContent:function(){var e=d("");e.addClass(this.getNamespace("message"));return e},createFooterContent:function(){var e=d("");e.addClass(this.getNamespace("footer"));return e},createFooterButtons:function(){var e=this;var f=e.$modalFooter;this.indexedButtons={};d.each(this.options.buttons,function(g,h){if(!h.id){h.id=a.newGuid()}var i=e.createButton(h);e.indexedButtons[h.id]=i;f.append(i)});return f},createButton:function(e){var f=d('');f.prop("id",e.id);f.data("button",e);if(typeof e.icon!=="undefined"&&d.trim(e.icon)!==""){f.append(this.createButtonIcon(e.icon))}if(typeof e.label!=="undefined"){f.append(e.label)}if(typeof e.title!=="undefined"){f.attr("title",e.title)}if(typeof e.cssClass!=="undefined"&&d.trim(e.cssClass)!==""){f.addClass(e.cssClass)}else{f.addClass("btn-secondary")}if(typeof e.data==="object"&&e.data.constructor==={}.constructor){d.each(e.data,function(g,h){f.attr("data-"+g,h)})}if(typeof e.hotkey!=="undefined"){this.registeredButtonHotkeys[e.hotkey]=f}f.on("click",{dialog:this,$button:f,button:e},function(i){var h=i.data.dialog;var j=i.data.$button;var g=j.data("button");if(g.autospin){j.toggleSpin(true)}if(typeof g.action==="function"){return g.action.call(j,h,i)}});this.enhanceButton(f);if(typeof e.enabled!=="undefined"){f.toggleEnable(e.enabled)}f.addClass("bootstrap4-dialog-button");return f},enhanceButton:function(e){e.dialog=this;e.toggleEnable=function(f){var g=this;if(typeof f!=="undefined"){g.prop("disabled",!f).toggleClass("disabled",!f)}else{g.prop("disabled",!g.prop("disabled"))}return g};e.enable=function(){var f=this;f.toggleEnable(true);return f};e.disable=function(){var f=this;f.toggleEnable(false);return f};e.toggleSpin=function(i){var h=this;var g=h.dialog;var f=h.find("."+g.getNamespace("button-icon"));if(typeof i==="undefined"){i=!(e.find(".icon-spin").length>0)}if(i){f.hide();e.prepend(g.createButtonIcon(g.getSpinicon()).addClass("icon-spin"))}else{f.show();e.find(".icon-spin").remove()}return h};e.spin=function(){var f=this;f.toggleSpin(true);return f};e.stopSpin=function(){var f=this;f.toggleSpin(false);return f};return this},createButtonIcon:function(f){var e=d("");e.addClass(this.getNamespace("button-icon")).addClass(f);return e},enableButtons:function(e){d.each(this.indexedButtons,function(g,f){f.toggleEnable(e)});return this},updateClosable:function(){if(this.isRealized()){this.getModalHeader().find("."+this.getNamespace("close-button")).toggle(this.isClosable())}return this},onShow:function(e){this.options.onshow=e;return this},onShown:function(e){this.options.onshown=e;return this},onHide:function(e){this.options.onhide=e;return this},onHidden:function(e){this.options.onhidden=e;return this},isRealized:function(){return this.realized},setRealized:function(e){this.realized=e;return this},isOpened:function(){return this.opened},setOpened:function(e){this.opened=e;return this},handleModalEvents:function(){this.getModal().on("show.bs.modal",{dialog:this},function(g){var f=g.data.dialog;f.setOpened(true);if(f.isModalEvent(g)&&typeof f.options.onshow==="function"){var e=f.options.onshow(f);if(e===false){f.setOpened(false)}return e}});this.getModal().on("shown.bs.modal",{dialog:this},function(f){var e=f.data.dialog;e.isModalEvent(f)&&typeof e.options.onshown==="function"&&e.options.onshown(e)});this.getModal().on("hide.bs.modal",{dialog:this},function(f){var e=f.data.dialog;e.setOpened(false);if(e.isModalEvent(f)&&typeof e.options.onhide==="function"){var g=e.options.onhide(e);if(g===false){e.setOpened(true)}return g}});this.getModal().on("hidden.bs.modal",{dialog:this},function(f){var e=f.data.dialog;e.isModalEvent(f)&&typeof e.options.onhidden==="function"&&e.options.onhidden(e);if(e.isAutodestroy()){e.setRealized(false);delete a.dialogs[e.getId()];d(this).remove()}a.moveFocus();if(d(".modal").hasClass("in")){d("body").addClass("modal-open")}});this.getModal().on("keyup",{dialog:this},function(e){e.which===27&&e.data.dialog.isClosable()&&e.data.dialog.canCloseByKeyboard()&&e.data.dialog.close()});this.getModal().on("keyup",{dialog:this},function(f){var e=f.data.dialog;if(typeof e.registeredButtonHotkeys[f.which]!=="undefined"){var g=d(e.registeredButtonHotkeys[f.which]);!g.prop("disabled")&&!g.is(":focus")&&g.focus().trigger("click")}});return this},handleModalBackdropEvent:function(){this.getModal().on("click",{dialog:this},function(e){d(e.target).hasClass("modal-backdrop")&&e.data.dialog.isClosable()&&e.data.dialog.canCloseByBackdrop()&&e.data.dialog.close()});return this},isModalEvent:function(e){return typeof e.namespace!=="undefined"&&e.namespace==="bs.modal"},makeModalDraggable:function(){if(this.options.draggable){this.getModalHeader().addClass(this.getNamespace("draggable")).on("mousedown",{dialog:this},function(g){var f=g.data.dialog;f.draggableData.isMouseDown=true;var e=f.getModalDialog().offset();f.draggableData.mouseOffset={top:g.clientY-e.top,left:g.clientX-e.left}});this.getModal().on("mouseup mouseleave",{dialog:this},function(e){e.data.dialog.draggableData.isMouseDown=false});d("body").on("mousemove",{dialog:this},function(f){var e=f.data.dialog;if(!e.draggableData.isMouseDown){return}e.getModalDialog().offset({top:f.clientY-e.draggableData.mouseOffset.top,left:f.clientX-e.draggableData.mouseOffset.left})})}return this},realize:function(){this.initModalStuff();this.getModal().addClass(a.NAMESPACE).addClass(this.getCssClass());this.updateSize();if(this.getDescription()){this.getModal().attr("aria-describedby",this.getDescription())}this.getModalHeader().append(this.createHeaderContent());this.getModalBody().append(this.createBodyContent());this.getModal().data("bs.modal",new c(this.getModalForBootstrapDialogModal(),{backdrop:(this.isClosable()&&this.canCloseByBackdrop())?true:"static",keyboard:false,show:false}));this.makeModalDraggable();this.handleModalEvents();this.setRealized(true);this.updateButtons();this.updateType();this.updateTitle();this.updateMessage();this.updateClosable();this.updateAnimate();this.updateSize();this.updateTabindex();return this},open:function(){!this.isRealized()&&this.realize();this.getModal().modal("show");return this},close:function(){!this.isRealized()&&this.realize();this.getModal().modal("hide");return this}};a.prototype=d.extend(a.prototype,a.METHODS_TO_OVERRIDE[c.getModalVersion()]);a.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(g){var f=Math.random()*16|0,e=g==="x"?f:(f&3|8);return e.toString(16)})};a.show=function(e){return new a(e).open()};a.alert=function(){var g={};var e={type:a.TYPE_PRIMARY,title:null,message:null,closable:false,draggable:false,buttonLabel:a.DEFAULT_TEXTS.OK,buttonHotkey:null,callback:null};if(typeof arguments[0]==="object"&&arguments[0].constructor==={}.constructor){g=d.extend(true,e,arguments[0])}else{g=d.extend(true,e,{message:arguments[0],callback:typeof arguments[1]!=="undefined"?arguments[1]:null})}var f=new a(g);f.setData("callback",g.callback);f.addButton({label:g.buttonLabel,hotkey:g.buttonHotkey,action:function(h){if(typeof h.getData("callback")==="function"&&h.getData("callback").call(this,true)===false){return false}h.setData("btnClicked",true);return h.close()}});if(typeof f.options.onhide==="function"){f.onHide(function(h){var i=true;if(!h.getData("btnClicked")&&h.isClosable()&&typeof h.getData("callback")==="function"){i=h.getData("callback")(false)}if(i===false){return false}i=this.onhide(h);return i}.bind({onhide:f.options.onhide}))}else{f.onHide(function(h){var i=true;if(!h.getData("btnClicked")&&h.isClosable()&&typeof h.getData("callback")==="function"){i=h.getData("callback")(false)}return i})}return f.open()};a.confirm=function(){var g={};var h={type:a.TYPE_PRIMARY,title:null,message:null,closable:false,draggable:false,btnCancelLabel:a.DEFAULT_TEXTS.CANCEL,btnCancelClass:null,btnCancelHotkey:null,btnOKLabel:a.DEFAULT_TEXTS.OK,btnOKClass:null,btnOKHotkey:null,btnsOrder:a.defaultOptions.btnsOrder,callback:null};if(typeof arguments[0]==="object"&&arguments[0].constructor==={}.constructor){g=d.extend(true,h,arguments[0])}else{g=d.extend(true,h,{message:arguments[0],callback:typeof arguments[1]!=="undefined"?arguments[1]:null})}if(g.btnOKClass===null){g.btnOKClass=["btn",g.type.split("-")[1]].join("-")}var e=new a(g);e.setData("callback",g.callback);var f=[{label:g.btnCancelLabel,cssClass:g.btnCancelClass,hotkey:g.btnCancelHotkey,action:function(i){if(typeof i.getData("callback")==="function"&&i.getData("callback").call(this,false)===false){return false}return i.close()}},{label:g.btnOKLabel,cssClass:g.btnOKClass,hotkey:g.btnOKHotkey,action:function(i){if(typeof i.getData("callback")==="function"&&i.getData("callback").call(this,true)===false){return false}return i.close()}}];if(g.btnsOrder===a.BUTTONS_ORDER_OK_CANCEL){f.reverse()}e.addButtons(f);return e.open()};a.warning=function(e,f){return new a({type:a.TYPE_WARNING,message:e}).open()};a.danger=function(e,f){return new a({type:a.TYPE_DANGER,message:e}).open()};a.success=function(e,f){return new a({type:a.TYPE_SUCCESS,message:e}).open()};return a}));
\ No newline at end of file
+(function(a,b){if(typeof module!=="undefined"&&module.exports){module.exports=b(require("jquery"),require("bootstrap"))}else{if(typeof define==="function"&&define.amd){define("bootstrap-dialog",["jquery","bootstrap"],function(c){return b(c)})}else{a.BootstrapDialog=b(a.jQuery)}}}(this?this:window,function(d){var b=d.fn.modal.Constructor;var c=function(f,e){if(/4\.1\.\d+/.test(d.fn.modal.Constructor.VERSION)){return new b(f,e)}else{b.call(this,f,e)}};c.getModalVersion=function(){var e=null;if(typeof d.fn.modal.Constructor.VERSION==="undefined"){e="v3.1"}else{if(/3\.2\.\d+/.test(d.fn.modal.Constructor.VERSION)){e="v3.2"}else{if(/3\.3\.[1,2]/.test(d.fn.modal.Constructor.VERSION)){e="v3.3"}else{if(/4\.\d\.\d+/.test(d.fn.modal.Constructor.VERSION)){e="v4.1"}else{e="v3.3.4"}}}}return e};c.ORIGINAL_BODY_PADDING=parseInt((d("body").css("padding-right")||0),10);c.METHODS_TO_OVERRIDE={};c.METHODS_TO_OVERRIDE["v3.1"]={};c.METHODS_TO_OVERRIDE["v3.2"]={hide:function(g){if(g){g.preventDefault()}g=d.Event("hide.bs.modal");this.$element.trigger(g);if(!this.isShown||g.isDefaultPrevented()){return}this.isShown=false;var f=this.getGlobalOpenedDialogs();if(f.length===0){this.$body.removeClass("modal-open")}this.resetScrollbar();this.escape();d(document).off("focusin.bs.modal");this.$element.removeClass("in").attr("aria-hidden",true).off("click.dismiss.bs.modal");d.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",d.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()}};c.METHODS_TO_OVERRIDE["v3.3"]={setScrollbar:function(){var e=c.ORIGINAL_BODY_PADDING;if(this.bodyIsOverflowing){this.$body.css("padding-right",e+this.scrollbarWidth)}},resetScrollbar:function(){var e=this.getGlobalOpenedDialogs();if(e.length===0){this.$body.css("padding-right",c.ORIGINAL_BODY_PADDING)}},hideModal:function(){this.$element.hide();this.backdrop(d.proxy(function(){var e=this.getGlobalOpenedDialogs();if(e.length===0){this.$body.removeClass("modal-open")}this.resetAdjustments();this.resetScrollbar();this.$element.trigger("hidden.bs.modal")},this))}};c.METHODS_TO_OVERRIDE["v3.3.4"]=d.extend({},c.METHODS_TO_OVERRIDE["v3.3"]);c.METHODS_TO_OVERRIDE["v4.1"]=d.extend({},c.METHODS_TO_OVERRIDE["v3.3"]);c.prototype={constructor:c,getGlobalOpenedDialogs:function(){var e=[];d.each(a.dialogs,function(g,f){if(f.isRealized()&&f.isOpened()){e.push(f)}});return e}};c.prototype=d.extend(c.prototype,b.prototype,c.METHODS_TO_OVERRIDE[c.getModalVersion()]);var a=function(e){this.defaultOptions=d.extend(true,{id:a.newGuid(),buttons:[],data:{},onshow:null,onshown:null,onhide:null,onhidden:null},a.defaultOptions);this.indexedButtons={};this.registeredButtonHotkeys={};this.draggableData={isMouseDown:false,mouseOffset:{}};this.realized=false;this.opened=false;this.initOptions(e);this.holdThisInstance()};a.BootstrapDialogModal=c;a.NAMESPACE="bootstrap-dialog";a.TYPE_DEFAULT="type-default";a.TYPE_INFO="type-info";a.TYPE_PRIMARY="type-primary";a.TYPE_SECONDARY="type-secondary";a.TYPE_SUCCESS="type-success";a.TYPE_WARNING="type-warning";a.TYPE_DANGER="type-danger";a.TYPE_DARK="type-dark";a.TYPE_LIGHT="type-light";a.DEFAULT_TEXTS={};a.DEFAULT_TEXTS[a.TYPE_DEFAULT]="Default";a.DEFAULT_TEXTS[a.TYPE_INFO]="Information";a.DEFAULT_TEXTS[a.TYPE_PRIMARY]="Primary";a.DEFAULT_TEXTS[a.TYPE_SECONDARY]="Secondary";a.DEFAULT_TEXTS[a.TYPE_SUCCESS]="Success";a.DEFAULT_TEXTS[a.TYPE_WARNING]="Warning";a.DEFAULT_TEXTS[a.TYPE_DANGER]="Danger";a.DEFAULT_TEXTS[a.TYPE_DARK]="Dark";a.DEFAULT_TEXTS[a.TYPE_LIGHT]="Light";a.DEFAULT_TEXTS.OK="OK";a.DEFAULT_TEXTS.CANCEL="Cancel";a.DEFAULT_TEXTS.CONFIRM="Confirmation";a.SIZE_NORMAL="size-normal";a.SIZE_SMALL="size-small";a.SIZE_WIDE="size-wide";a.SIZE_EXTRAWIDE="size-extrawide";a.SIZE_LARGE="size-large";a.BUTTON_SIZES={};a.BUTTON_SIZES[a.SIZE_NORMAL]="";a.BUTTON_SIZES[a.SIZE_SMALL]="btn-small";a.BUTTON_SIZES[a.SIZE_WIDE]="btn-block";a.BUTTON_SIZES[a.SIZE_LARGE]="btn-lg";a.ICON_SPINNER="glyphicon glyphicon-asterisk";a.BUTTONS_ORDER_CANCEL_OK="btns-order-cancel-ok";a.BUTTONS_ORDER_OK_CANCEL="btns-order-ok-cancel";a.Z_INDEX_BACKDROP=1040;a.Z_INDEX_MODAL=1050;a.defaultOptions={type:a.TYPE_PRIMARY,size:a.SIZE_NORMAL,cssClass:"",title:null,message:null,nl2br:true,closable:true,closeByBackdrop:true,closeByKeyboard:true,closeIcon:"×",spinicon:a.ICON_SPINNER,autodestroy:true,draggable:false,animate:true,description:"",tabindex:-1,btnsOrder:a.BUTTONS_ORDER_CANCEL_OK};a.configDefaultOptions=function(e){a.defaultOptions=d.extend(true,a.defaultOptions,e)};a.dialogs={};a.openAll=function(){d.each(a.dialogs,function(f,e){e.open()})};a.closeAll=function(){d.each(a.dialogs,function(f,e){e.close()})};a.getDialog=function(f){var e=null;if(typeof a.dialogs[f]!=="undefined"){e=a.dialogs[f]}return e};a.setDialog=function(e){a.dialogs[e.getId()]=e;return e};a.addDialog=function(e){return a.setDialog(e)};a.moveFocus=function(){var e=null;d.each(a.dialogs,function(g,f){if(f.isRealized()&&f.isOpened()){e=f}});if(e!==null){e.getModal().focus()}};a.METHODS_TO_OVERRIDE={};a.METHODS_TO_OVERRIDE["v3.1"]={updateZIndex:function(){if(this.isOpened()){var g=a.Z_INDEX_BACKDROP;var h=a.Z_INDEX_MODAL;var i=0;d.each(a.dialogs,function(j,k){if(k.isRealized()&&k.isOpened()){i++}});var f=this.getModal();var e=this.getModalBackdrop(f);f.css("z-index",h+(i-1)*20);e.css("z-index",g+(i-1)*20)}return this},open:function(){!this.isRealized()&&this.realize();this.getModal().modal("show");this.updateZIndex();return this}};a.METHODS_TO_OVERRIDE["v3.2"]={updateZIndex:a.METHODS_TO_OVERRIDE["v3.1"]["updateZIndex"],open:a.METHODS_TO_OVERRIDE["v3.1"]["open"]};a.METHODS_TO_OVERRIDE["v3.3"]={};a.METHODS_TO_OVERRIDE["v3.3.4"]=d.extend({},a.METHODS_TO_OVERRIDE["v3.1"]);a.METHODS_TO_OVERRIDE["v4.0"]={getModalBackdrop:function(e){return d(e.data("bs.modal")._backdrop)},updateZIndex:a.METHODS_TO_OVERRIDE["v3.1"]["updateZIndex"],open:a.METHODS_TO_OVERRIDE["v3.1"]["open"],getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}};a.METHODS_TO_OVERRIDE["v4.1"]={getModalBackdrop:function(e){return d(e.data("bs.modal")._backdrop)},updateZIndex:a.METHODS_TO_OVERRIDE["v3.1"]["updateZIndex"],open:a.METHODS_TO_OVERRIDE["v3.1"]["open"],getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}};a.prototype={constructor:a,initOptions:function(e){this.options=d.extend(true,this.defaultOptions,e);return this},holdThisInstance:function(){a.addDialog(this);return this},initModalStuff:function(){this.setModal(this.createModal()).setModalDialog(this.createModalDialog()).setModalContent(this.createModalContent()).setModalHeader(this.createModalHeader()).setModalBody(this.createModalBody()).setModalFooter(this.createModalFooter());this.getModal().append(this.getModalDialog());this.getModalDialog().append(this.getModalContent());this.getModalContent().append(this.getModalHeader()).append(this.getModalBody()).append(this.getModalFooter());return this},createModal:function(){var e=d('');e.prop("id",this.getId());e.attr("aria-labelledby",this.getId()+"_title");return e},getModal:function(){return this.$modal},setModal:function(e){this.$modal=e;return this},getModalBackdrop:function(e){return e.data("bs.modal").$backdrop},getModalForBootstrapDialogModal:function(){return this.getModal()},createModalDialog:function(){return d('')},getModalDialog:function(){return this.$modalDialog},setModalDialog:function(e){this.$modalDialog=e;return this},createModalContent:function(){return d('')},getModalContent:function(){return this.$modalContent},setModalContent:function(e){this.$modalContent=e;return this},createModalHeader:function(){return d('')},getModalHeader:function(){return this.$modalHeader},setModalHeader:function(e){this.$modalHeader=e;return this},createModalBody:function(){return d('')},getModalBody:function(){return this.$modalBody},setModalBody:function(e){this.$modalBody=e;return this},createModalFooter:function(){return d('')},getModalFooter:function(){return this.$modalFooter},setModalFooter:function(e){this.$modalFooter=e;return this},createDynamicContent:function(f){var e=null;if(typeof f==="function"){e=f.call(f,this)}else{e=f}if(typeof e==="string"){e=this.formatStringContent(e)}return e},formatStringContent:function(e){if(this.options.nl2br){return e.replace(/\r\n/g,"
").replace(/[\r\n]/g,"
")}return e},setData:function(e,f){this.options.data[e]=f;return this},getData:function(e){return this.options.data[e]},setId:function(e){this.options.id=e;return this},getId:function(){return this.options.id},getType:function(){return this.options.type},setType:function(e){this.options.type=e;this.updateType();return this},updateType:function(){if(this.isRealized()){var e=[a.TYPE_DEFAULT,a.TYPE_INFO,a.TYPE_PRIMARY,a.TYPE_SECONDARY,a.TYPE_SUCCESS,a.TYPE_WARNING,a.TYPE_DARK,a.TYPE_LIGHT,a.TYPE_DANGER];this.getModal().removeClass(e.join(" ")).addClass(this.getType())}return this},getSize:function(){return this.options.size},setSize:function(e){this.options.size=e;this.updateSize();return this},updateSize:function(){if(this.isRealized()){var e=this;this.getModal().removeClass(a.SIZE_NORMAL).removeClass(a.SIZE_SMALL).removeClass(a.SIZE_WIDE).removeClass(a.SIZE_EXTRAWIDE).removeClass(a.SIZE_LARGE);this.getModal().addClass(this.getSize());this.getModalDialog().removeClass("modal-sm");if(this.getSize()===a.SIZE_SMALL){this.getModalDialog().addClass("modal-sm")}this.getModalDialog().removeClass("modal-lg");if(this.getSize()===a.SIZE_WIDE){this.getModalDialog().addClass("modal-lg")}this.getModalDialog().removeClass("modal-xl");if(this.getSize()===a.SIZE_EXTRAWIDE){this.getModalDialog().addClass("modal-xl")}d.each(this.options.buttons,function(g,i){var k=e.getButton(i.id);var f=["btn-lg","btn-sm","btn-xs"];var j=false;if(typeof i.cssClass==="string"){var h=i.cssClass.split(" ");d.each(h,function(l,m){if(d.inArray(m,f)!==-1){j=true}})}if(!j){k.removeClass(f.join(" "));k.addClass(e.getButtonSize())}})}return this},getCssClass:function(){return this.options.cssClass},setCssClass:function(e){this.options.cssClass=e;return this},getTitle:function(){return this.options.title},setTitle:function(e){this.options.title=e;this.updateTitle();return this},updateTitle:function(){if(this.isRealized()){var e=this.getTitle()!==null?this.createDynamicContent(this.getTitle()):this.getDefaultText();this.getModalHeader().find("."+this.getNamespace("title")).html("").append(e).prop("id",this.getId()+"_title")}return this},getMessage:function(){return this.options.message},setMessage:function(e){this.options.message=e;this.updateMessage();return this},updateMessage:function(){if(this.isRealized()){var e=this.createDynamicContent(this.getMessage());this.getModalBody().find("."+this.getNamespace("message")).html("").append(e)}return this},isClosable:function(){return this.options.closable},setClosable:function(e){this.options.closable=e;this.updateClosable();return this},setCloseByBackdrop:function(e){this.options.closeByBackdrop=e;return this},canCloseByBackdrop:function(){return this.options.closeByBackdrop},setCloseByKeyboard:function(e){this.options.closeByKeyboard=e;return this},canCloseByKeyboard:function(){return this.options.closeByKeyboard},isAnimate:function(){return this.options.animate},setAnimate:function(e){this.options.animate=e;return this},updateAnimate:function(){if(this.isRealized()){this.getModal().toggleClass("fade",this.isAnimate())}return this},getSpinicon:function(){return this.options.spinicon},setSpinicon:function(e){this.options.spinicon=e;return this},addButton:function(e){this.options.buttons.push(e);return this},addButtons:function(f){var e=this;d.each(f,function(g,h){e.addButton(h)});return this},getButtons:function(){return this.options.buttons},setButtons:function(e){this.options.buttons=e;this.updateButtons();return this},getButton:function(e){if(typeof this.indexedButtons[e]!=="undefined"){return this.indexedButtons[e]}return null},getButtonSize:function(){if(typeof a.BUTTON_SIZES[this.getSize()]!=="undefined"){return a.BUTTON_SIZES[this.getSize()]}return""},updateButtons:function(){if(this.isRealized()){if(this.getButtons().length===0){this.getModalFooter().hide()}else{this.getModalFooter().show().closest(".modal-footer").append(this.createFooterButtons())}}return this},isAutodestroy:function(){return this.options.autodestroy},setAutodestroy:function(e){this.options.autodestroy=e},getDescription:function(){return this.options.description},setDescription:function(e){this.options.description=e;return this},setTabindex:function(e){this.options.tabindex=e;return this},getTabindex:function(){return this.options.tabindex},updateTabindex:function(){if(this.isRealized()){this.getModal().attr("tabindex",this.getTabindex())}return this},getDefaultText:function(){return a.DEFAULT_TEXTS[this.getType()]},getNamespace:function(e){return a.NAMESPACE+"-"+e},createHeaderContent:function(){var e=d("");e.addClass(this.getNamespace("header"));e.append(this.createTitleContent());e.append(this.createCloseButton());return e},createTitleContent:function(){var e=d("");e.addClass(this.getNamespace("title"));return e},createCloseButton:function(){var f=d("");f.addClass(this.getNamespace("close-button"));var e=d('');e.append(this.options.closeIcon);f.append(e);f.on("click",{dialog:this},function(g){g.data.dialog.close()});return f},createBodyContent:function(){var e=d("");e.addClass(this.getNamespace("body"));e.append(this.createMessageContent());return e},createMessageContent:function(){var e=d("");e.addClass(this.getNamespace("message"));return e},createFooterContent:function(){var e=d("");e.addClass(this.getNamespace("footer"));return e},createFooterButtons:function(){var e=this;var f=e.$modalFooter;this.indexedButtons={};d.each(this.options.buttons,function(g,h){if(!h.id){h.id=a.newGuid()}var i=e.createButton(h);e.indexedButtons[h.id]=i;f.append(i)});return f},createButton:function(e){var f=d('');f.prop("id",e.id);f.data("button",e);if(typeof e.icon!=="undefined"&&d.trim(e.icon)!==""){f.append(this.createButtonIcon(e.icon))}if(typeof e.label!=="undefined"){f.append(e.label)}if(typeof e.title!=="undefined"){f.attr("title",e.title)}if(typeof e.cssClass!=="undefined"&&d.trim(e.cssClass)!==""){f.addClass(e.cssClass)}else{f.addClass("btn-secondary")}if(typeof e.data==="object"&&e.data.constructor==={}.constructor){d.each(e.data,function(g,h){f.attr("data-"+g,h)})}if(typeof e.hotkey!=="undefined"){this.registeredButtonHotkeys[e.hotkey]=f}f.on("click",{dialog:this,$button:f,button:e},function(i){var h=i.data.dialog;var j=i.data.$button;var g=j.data("button");if(g.autospin){j.toggleSpin(true)}if(typeof g.action==="function"){return g.action.call(j,h,i)}});this.enhanceButton(f);if(typeof e.enabled!=="undefined"){f.toggleEnable(e.enabled)}f.addClass("bootstrap4-dialog-button");return f},enhanceButton:function(e){e.dialog=this;e.toggleEnable=function(f){var g=this;if(typeof f!=="undefined"){g.prop("disabled",!f).toggleClass("disabled",!f)}else{g.prop("disabled",!g.prop("disabled"))}return g};e.enable=function(){var f=this;f.toggleEnable(true);return f};e.disable=function(){var f=this;f.toggleEnable(false);return f};e.toggleSpin=function(i){var h=this;var g=h.dialog;var f=h.find("."+g.getNamespace("button-icon"));if(typeof i==="undefined"){i=!(e.find(".icon-spin").length>0)}if(i){f.hide();e.prepend(g.createButtonIcon(g.getSpinicon()).addClass("icon-spin"))}else{f.show();e.find(".icon-spin").remove()}return h};e.spin=function(){var f=this;f.toggleSpin(true);return f};e.stopSpin=function(){var f=this;f.toggleSpin(false);return f};return this},createButtonIcon:function(f){var e=d("");e.addClass(this.getNamespace("button-icon")).addClass(f);return e},enableButtons:function(e){d.each(this.indexedButtons,function(g,f){f.toggleEnable(e)});return this},updateClosable:function(){if(this.isRealized()){this.getModalHeader().find("."+this.getNamespace("close-button")).toggle(this.isClosable())}return this},onShow:function(e){this.options.onshow=e;return this},onShown:function(e){this.options.onshown=e;return this},onHide:function(e){this.options.onhide=e;return this},onHidden:function(e){this.options.onhidden=e;return this},isRealized:function(){return this.realized},setRealized:function(e){this.realized=e;return this},isOpened:function(){return this.opened},setOpened:function(e){this.opened=e;return this},handleModalEvents:function(){this.getModal().on("show.bs.modal",{dialog:this},function(g){var f=g.data.dialog;f.setOpened(true);if(f.isModalEvent(g)&&typeof f.options.onshow==="function"){var e=f.options.onshow(f);if(e===false){f.setOpened(false)}return e}});this.getModal().on("shown.bs.modal",{dialog:this},function(f){var e=f.data.dialog;e.isModalEvent(f)&&typeof e.options.onshown==="function"&&e.options.onshown(e)});this.getModal().on("hide.bs.modal",{dialog:this},function(f){var e=f.data.dialog;e.setOpened(false);if(e.isModalEvent(f)&&typeof e.options.onhide==="function"){var g=e.options.onhide(e);if(g===false){e.setOpened(true)}return g}});this.getModal().on("hidden.bs.modal",{dialog:this},function(f){var e=f.data.dialog;e.isModalEvent(f)&&typeof e.options.onhidden==="function"&&e.options.onhidden(e);if(e.isAutodestroy()){e.setRealized(false);delete a.dialogs[e.getId()];d(this).remove()}a.moveFocus();if(d(".modal").hasClass("in")){d("body").addClass("modal-open")}});this.getModal().on("keyup",{dialog:this},function(e){e.which===27&&e.data.dialog.isClosable()&&e.data.dialog.canCloseByKeyboard()&&e.data.dialog.close()});this.getModal().on("keyup",{dialog:this},function(f){var e=f.data.dialog;if(typeof e.registeredButtonHotkeys[f.which]!=="undefined"){var g=d(e.registeredButtonHotkeys[f.which]);!g.prop("disabled")&&!g.is(":focus")&&g.focus().trigger("click")}});return this},isModalEvent:function(e){return typeof e.namespace!=="undefined"&&e.namespace==="bs.modal"},makeModalDraggable:function(){if(this.options.draggable){this.getModalHeader().addClass(this.getNamespace("draggable")).on("mousedown",{dialog:this},function(g){var f=g.data.dialog;f.draggableData.isMouseDown=true;var e=f.getModalDialog().offset();f.draggableData.mouseOffset={top:g.clientY-e.top,left:g.clientX-e.left}});this.getModal().on("mouseup mouseleave",{dialog:this},function(e){e.data.dialog.draggableData.isMouseDown=false});d("body").on("mousemove",{dialog:this},function(f){var e=f.data.dialog;if(!e.draggableData.isMouseDown){return}e.getModalDialog().offset({top:f.clientY-e.draggableData.mouseOffset.top,left:f.clientX-e.draggableData.mouseOffset.left})})}return this},realize:function(){this.initModalStuff();this.getModal().addClass(a.NAMESPACE).addClass(this.getCssClass());this.updateSize();if(this.getDescription()){this.getModal().attr("aria-describedby",this.getDescription())}this.getModalHeader().append(this.createHeaderContent());this.getModalBody().append(this.createBodyContent());this.getModal().data("bs.modal",new c(this.getModalForBootstrapDialogModal(),{backdrop:(this.isClosable()&&this.canCloseByBackdrop())?true:"static",keyboard:false,show:false}));this.makeModalDraggable();this.handleModalEvents();this.setRealized(true);this.updateButtons();this.updateType();this.updateTitle();this.updateMessage();this.updateClosable();this.updateAnimate();this.updateSize();this.updateTabindex();return this},open:function(){!this.isRealized()&&this.realize();this.getModal().modal("show");return this},close:function(){!this.isRealized()&&this.realize();this.getModal().modal("hide");return this}};a.prototype=d.extend(a.prototype,a.METHODS_TO_OVERRIDE[c.getModalVersion()]);a.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(g){var f=Math.random()*16|0,e=g==="x"?f:(f&3|8);return e.toString(16)})};a.show=function(e){return new a(e).open()};a.alert=function(){var g={};var e={type:a.TYPE_PRIMARY,title:null,message:null,closable:false,draggable:false,buttonLabel:a.DEFAULT_TEXTS.OK,buttonHotkey:null,callback:null};if(typeof arguments[0]==="object"&&arguments[0].constructor==={}.constructor){g=d.extend(true,e,arguments[0])}else{g=d.extend(true,e,{message:arguments[0],callback:typeof arguments[1]!=="undefined"?arguments[1]:null})}var f=new a(g);f.setData("callback",g.callback);f.addButton({label:g.buttonLabel,hotkey:g.buttonHotkey,action:function(h){if(typeof h.getData("callback")==="function"&&h.getData("callback").call(this,true)===false){return false}h.setData("btnClicked",true);return h.close()}});if(typeof f.options.onhide==="function"){f.onHide(function(h){var i=true;if(!h.getData("btnClicked")&&h.isClosable()&&typeof h.getData("callback")==="function"){i=h.getData("callback")(false)}if(i===false){return false}i=this.onhide(h);return i}.bind({onhide:f.options.onhide}))}else{f.onHide(function(h){var i=true;if(!h.getData("btnClicked")&&h.isClosable()&&typeof h.getData("callback")==="function"){i=h.getData("callback")(false)}return i})}return f.open()};a.confirm=function(){var g={};var h={type:a.TYPE_PRIMARY,title:null,message:null,closable:false,draggable:false,btnCancelLabel:a.DEFAULT_TEXTS.CANCEL,btnCancelClass:null,btnCancelHotkey:null,btnOKLabel:a.DEFAULT_TEXTS.OK,btnOKClass:null,btnOKHotkey:null,btnsOrder:a.defaultOptions.btnsOrder,callback:null};if(typeof arguments[0]==="object"&&arguments[0].constructor==={}.constructor){g=d.extend(true,h,arguments[0])}else{g=d.extend(true,h,{message:arguments[0],callback:typeof arguments[1]!=="undefined"?arguments[1]:null})}if(g.btnOKClass===null){g.btnOKClass=["btn",g.type.split("-")[1]].join("-")}var e=new a(g);e.setData("callback",g.callback);var f=[{label:g.btnCancelLabel,cssClass:g.btnCancelClass,hotkey:g.btnCancelHotkey,action:function(i){if(typeof i.getData("callback")==="function"&&i.getData("callback").call(this,false)===false){return false}return i.close()}},{label:g.btnOKLabel,cssClass:g.btnOKClass,hotkey:g.btnOKHotkey,action:function(i){if(typeof i.getData("callback")==="function"&&i.getData("callback").call(this,true)===false){return false}return i.close()}}];if(g.btnsOrder===a.BUTTONS_ORDER_OK_CANCEL){f.reverse()}e.addButtons(f);return e.open()};a.warning=function(e,f){return new a({type:a.TYPE_WARNING,message:e}).open()};a.danger=function(e,f){return new a({type:a.TYPE_DANGER,message:e}).open()};a.success=function(e,f){return new a({type:a.TYPE_SUCCESS,message:e}).open()};return a}));
\ No newline at end of file