(function(n,t){"use strict";typeof module!="undefined"&&module.exports?module.exports=t(require("jquery"),require("bootstrap")):typeof define=="function"&&define.amd?define("bootstrap-dialog",["jquery","bootstrap"],function(n){return t(n)}):n.BootstrapDialog=t(n.jQuery)})(this?this:window,function(n){"use strict";var r=n.fn.modal.Constructor,i=function(t,i){if(/4\.1\.\d+/.test(n.fn.modal.Constructor.VERSION))return new r(t,i);r.call(this,t,i)},t;return i.getModalVersion=function(){return typeof n.fn.modal.Constructor.VERSION=="undefined"?"v3.1":/3\.2\.\d+/.test(n.fn.modal.Constructor.VERSION)?"v3.2":/3\.3\.[1,2]/.test(n.fn.modal.Constructor.VERSION)?"v3.3":/4\.\d\.\d+/.test(n.fn.modal.Constructor.VERSION)?"v4.1":"v3.3.4"},i.ORIGINAL_BODY_PADDING=parseInt(n("body").css("padding-right")||0,10),i.METHODS_TO_OVERRIDE={},i.METHODS_TO_OVERRIDE["v3.1"]={},i.METHODS_TO_OVERRIDE["v3.2"]={hide:function(t){if(t&&t.preventDefault(),t=n.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()){this.isShown=!1;var i=this.getGlobalOpenedDialogs();i.length===0&&this.$body.removeClass("modal-open");this.resetScrollbar();this.escape();n(document).off("focusin.bs.modal");this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal");n.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",n.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()}}},i.METHODS_TO_OVERRIDE["v3.3"]={setScrollbar:function(){var n=i.ORIGINAL_BODY_PADDING;this.bodyIsOverflowing&&this.$body.css("padding-right",n+this.scrollbarWidth)},resetScrollbar:function(){var n=this.getGlobalOpenedDialogs();n.length===0&&this.$body.css("padding-right",i.ORIGINAL_BODY_PADDING)},hideModal:function(){this.$element.hide();this.backdrop(n.proxy(function(){var n=this.getGlobalOpenedDialogs();n.length===0&&this.$body.removeClass("modal-open");this.resetAdjustments();this.resetScrollbar();this.$element.trigger("hidden.bs.modal")},this))}},i.METHODS_TO_OVERRIDE["v3.3.4"]=n.extend({},i.METHODS_TO_OVERRIDE["v3.3"]),i.METHODS_TO_OVERRIDE["v4.1"]=n.extend({},i.METHODS_TO_OVERRIDE["v3.3"]),i.prototype={constructor:i,getGlobalOpenedDialogs:function(){var i=[];return n.each(t.dialogs,function(n,t){t.isRealized()&&t.isOpened()&&i.push(t)}),i}},i.prototype=n.extend(i.prototype,r.prototype,i.METHODS_TO_OVERRIDE[i.getModalVersion()]),t=function(i){this.defaultOptions=n.extend(!0,{id:t.newGuid(),buttons:[],data:{},onshow:null,onshown:null,onhide:null,onhidden:null},t.defaultOptions);this.indexedButtons={};this.registeredButtonHotkeys={};this.draggableData={isMouseDown:!1,mouseOffset:{}};this.realized=!1;this.opened=!1;this.initOptions(i);this.holdThisInstance()},t.BootstrapDialogModal=i,t.NAMESPACE="bootstrap-dialog",t.TYPE_DEFAULT="type-default",t.TYPE_INFO="type-info",t.TYPE_PRIMARY="type-primary",t.TYPE_SECONDARY="type-secondary",t.TYPE_SUCCESS="type-success",t.TYPE_WARNING="type-warning",t.TYPE_DANGER="type-danger",t.TYPE_DARK="type-dark",t.TYPE_LIGHT="type-light",t.DEFAULT_TEXTS={},t.DEFAULT_TEXTS[t.TYPE_DEFAULT]="Default",t.DEFAULT_TEXTS[t.TYPE_INFO]="Information",t.DEFAULT_TEXTS[t.TYPE_PRIMARY]="Primary",t.DEFAULT_TEXTS[t.TYPE_SECONDARY]="Secondary",t.DEFAULT_TEXTS[t.TYPE_SUCCESS]="Success",t.DEFAULT_TEXTS[t.TYPE_WARNING]="Warning",t.DEFAULT_TEXTS[t.TYPE_DANGER]="Danger",t.DEFAULT_TEXTS[t.TYPE_DARK]="Dark",t.DEFAULT_TEXTS[t.TYPE_LIGHT]="Light",t.DEFAULT_TEXTS.OK="OK",t.DEFAULT_TEXTS.CANCEL="Cancel",t.DEFAULT_TEXTS.CONFIRM="Confirmation",t.SIZE_NORMAL="size-normal",t.SIZE_SMALL="size-small",t.SIZE_WIDE="size-wide",t.SIZE_EXTRAWIDE="size-extrawide",t.SIZE_LARGE="size-large",t.BUTTON_SIZES={},t.BUTTON_SIZES[t.SIZE_NORMAL]="",t.BUTTON_SIZES[t.SIZE_SMALL]="btn-small",t.BUTTON_SIZES[t.SIZE_WIDE]="btn-block",t.BUTTON_SIZES[t.SIZE_LARGE]="btn-lg",t.ICON_SPINNER="glyphicon glyphicon-asterisk",t.BUTTONS_ORDER_CANCEL_OK="btns-order-cancel-ok",t.BUTTONS_ORDER_OK_CANCEL="btns-order-ok-cancel",t.Z_INDEX_BACKDROP=1040,t.Z_INDEX_MODAL=1050,t.defaultOptions={type:t.TYPE_PRIMARY,size:t.SIZE_NORMAL,cssClass:"",title:null,message:null,nl2br:!0,closable:!0,closeByBackdrop:!0,closeByKeyboard:!0,closeIcon:"&#215;",spinicon:t.ICON_SPINNER,autodestroy:!0,draggable:!1,animate:!0,description:"",tabindex:-1,btnsOrder:t.BUTTONS_ORDER_CANCEL_OK},t.configDefaultOptions=function(i){t.defaultOptions=n.extend(!0,t.defaultOptions,i)},t.dialogs={},t.openAll=function(){n.each(t.dialogs,function(n,t){t.open()})},t.closeAll=function(){n.each(t.dialogs,function(n,t){t.close()})},t.getDialog=function(n){var i=null;return typeof t.dialogs[n]!="undefined"&&(i=t.dialogs[n]),i},t.setDialog=function(n){return t.dialogs[n.getId()]=n,n},t.addDialog=function(n){return t.setDialog(n)},t.moveFocus=function(){var i=null;n.each(t.dialogs,function(n,t){t.isRealized()&&t.isOpened()&&(i=t)});i!==null&&i.getModal().focus()},t.METHODS_TO_OVERRIDE={},t.METHODS_TO_OVERRIDE["v3.1"]={updateZIndex:function(){var r,u;if(this.isOpened()){var f=t.Z_INDEX_BACKDROP,e=t.Z_INDEX_MODAL,i=0;n.each(t.dialogs,function(n,t){t.isRealized()&&t.isOpened()&&i++});r=this.getModal();u=this.getModalBackdrop(r);r.css("z-index",e+(i-1)*20);u.css("z-index",f+(i-1)*20)}return this},open:function(){return this.isRealized()||this.realize(),this.getModal().modal("show"),this.updateZIndex(),this}},t.METHODS_TO_OVERRIDE["v3.2"]={updateZIndex:t.METHODS_TO_OVERRIDE["v3.1"].updateZIndex,open:t.METHODS_TO_OVERRIDE["v3.1"].open},t.METHODS_TO_OVERRIDE["v3.3"]={},t.METHODS_TO_OVERRIDE["v3.3.4"]=n.extend({},t.METHODS_TO_OVERRIDE["v3.1"]),t.METHODS_TO_OVERRIDE["v4.0"]={getModalBackdrop:function(t){return n(t.data("bs.modal")._backdrop)},updateZIndex:t.METHODS_TO_OVERRIDE["v3.1"].updateZIndex,open:t.METHODS_TO_OVERRIDE["v3.1"].open,getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}},t.METHODS_TO_OVERRIDE["v4.1"]={getModalBackdrop:function(t){return n(t.data("bs.modal")._backdrop)},updateZIndex:t.METHODS_TO_OVERRIDE["v3.1"].updateZIndex,open:t.METHODS_TO_OVERRIDE["v3.1"].open,getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}},t.prototype={constructor:t,initOptions:function(t){return this.options=n.extend(!0,this.defaultOptions,t),this},holdThisInstance:function(){return t.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=n('<div class="modal" role="dialog" aria-hidden="true"><\/div>');return t.prop("id",this.getId()),t.attr("aria-labelledby",this.getId()+"_title"),t},getModal:function(){return this.$modal},setModal:function(n){return this.$modal=n,this},getModalBackdrop:function(n){return n.data("bs.modal").$backdrop},getModalForBootstrapDialogModal:function(){return this.getModal()},createModalDialog:function(){return n('<div class="modal-dialog"><\/div>')},getModalDialog:function(){return this.$modalDialog},setModalDialog:function(n){return this.$modalDialog=n,this},createModalContent:function(){return n('<div class="modal-content"><\/div>')},getModalContent:function(){return this.$modalContent},setModalContent:function(n){return this.$modalContent=n,this},createModalHeader:function(){return n('<div class="modal-header"><\/div>')},getModalHeader:function(){return this.$modalHeader},setModalHeader:function(n){return this.$modalHeader=n,this},createModalBody:function(){return n('<div class="modal-body"><\/div>')},getModalBody:function(){return this.$modalBody},setModalBody:function(n){return this.$modalBody=n,this},createModalFooter:function(){return n('<div class="modal-footer"><\/div>')},getModalFooter:function(){return this.$modalFooter},setModalFooter:function(n){return this.$modalFooter=n,this},createDynamicContent:function(n){var t=null;return t=typeof n=="function"?n.call(n,this):n,typeof t=="string"&&(t=this.formatStringContent(t)),t},formatStringContent:function(n){return this.options.nl2br?n.replace(/\r\n/g,"<br />").replace(/[\r\n]/g,"<br />"):n},setData:function(n,t){return this.options.data[n]=t,this},getData:function(n){return this.options.data[n]},setId:function(n){return this.options.id=n,this},getId:function(){return this.options.id},getType:function(){return this.options.type},setType:function(n){return this.options.type=n,this.updateType(),this},updateType:function(){if(this.isRealized()){var n=[t.TYPE_DEFAULT,t.TYPE_INFO,t.TYPE_PRIMARY,t.TYPE_SECONDARY,t.TYPE_SUCCESS,t.TYPE_WARNING,t.TYPE_DARK,t.TYPE_LIGHT,t.TYPE_DANGER];this.getModal().removeClass(n.join(" ")).addClass(this.getType())}return this},getSize:function(){return this.options.size},setSize:function(n){return this.options.size=n,this.updateSize(),this},updateSize:function(){if(this.isRealized()){var i=this;this.getModal().removeClass(t.SIZE_NORMAL).removeClass(t.SIZE_SMALL).removeClass(t.SIZE_WIDE).removeClass(t.SIZE_EXTRAWIDE).removeClass(t.SIZE_LARGE);this.getModal().addClass(this.getSize());this.getModalDialog().removeClass("modal-sm");this.getSize()===t.SIZE_SMALL&&this.getModalDialog().addClass("modal-sm");this.getModalDialog().removeClass("modal-lg");this.getSize()===t.SIZE_WIDE&&this.getModalDialog().addClass("modal-lg");this.getModalDialog().removeClass("modal-xl");this.getSize()===t.SIZE_EXTRAWIDE&&this.getModalDialog().addClass("modal-xl");n.each(this.options.buttons,function(t,r){var u=i.getButton(r.id),f=["btn-lg","btn-sm","btn-xs"],e=!1,o;typeof r.cssClass=="string"&&(o=r.cssClass.split(" "),n.each(o,function(t,i){n.inArray(i,f)!==-1&&(e=!0)}));e||(u.removeClass(f.join(" ")),u.addClass(i.getButtonSize()))})}return this},getCssClass:function(){return this.options.cssClass},setCssClass:function(n){return this.options.cssClass=n,this},getTitle:function(){return this.options.title},setTitle:function(n){return this.options.title=n,this.updateTitle(),this},updateTitle:function(){if(this.isRealized()){var n=this.getTitle()!==null?this.createDynamicContent(this.getTitle()):this.getDefaultText();this.getModalHeader().find("."+this.getNamespace("title")).html("").append(n).prop("id",this.getId()+"_title")}return this},getMessage:function(){return this.options.message},setMessage:function(n){return this.options.message=n,this.updateMessage(),this},updateMessage:function(){if(this.isRealized()){var n=this.createDynamicContent(this.getMessage());this.getModalBody().find("."+this.getNamespace("message")).html("").append(n)}return this},isClosable:function(){return this.options.closable},setClosable:function(n){return this.options.closable=n,this.updateClosable(),this},setCloseByBackdrop:function(n){return this.options.closeByBackdrop=n,this},canCloseByBackdrop:function(){return this.options.closeByBackdrop},setCloseByKeyboard:function(n){return this.options.closeByKeyboard=n,this},canCloseByKeyboard:function(){return this.options.closeByKeyboard},isAnimate:function(){return this.options.animate},setAnimate:function(n){return this.options.animate=n,this},updateAnimate:function(){return this.isRealized()&&this.getModal().toggleClass("fade",this.isAnimate()),this},getSpinicon:function(){return this.options.spinicon},setSpinicon:function(n){return this.options.spinicon=n,this},addButton:function(n){return this.options.buttons.push(n),this},addButtons:function(t){var i=this;return n.each(t,function(n,t){i.addButton(t)}),this},getButtons:function(){return this.options.buttons},setButtons:function(n){return this.options.buttons=n,this.updateButtons(),this},getButton:function(n){return typeof this.indexedButtons[n]!="undefined"?this.indexedButtons[n]:null},getButtonSize:function(){return typeof t.BUTTON_SIZES[this.getSize()]!="undefined"?t.BUTTON_SIZES[this.getSize()]:""},updateButtons:function(){return this.isRealized()&&(this.getButtons().length===0?this.getModalFooter().hide():this.getModalFooter().show().closest(".modal-footer").append(this.createFooterButtons())),this},isAutodestroy:function(){return this.options.autodestroy},setAutodestroy:function(n){this.options.autodestroy=n},getDescription:function(){return this.options.description},setDescription:function(n){return this.options.description=n,this},setTabindex:function(n){return this.options.tabindex=n,this},getTabindex:function(){return this.options.tabindex},updateTabindex:function(){return this.isRealized()&&this.getModal().attr("tabindex",this.getTabindex()),this},getDefaultText:function(){return t.DEFAULT_TEXTS[this.getType()]},getNamespace:function(n){return t.NAMESPACE+"-"+n},createHeaderContent:function(){var t=n("<div><\/div>");return t.addClass(this.getNamespace("header")),t.append(this.createTitleContent()),t.append(this.createCloseButton()),t},createTitleContent:function(){var t=n("<div><\/div>");return t.addClass(this.getNamespace("title")),t},createCloseButton:function(){var t=n("<div><\/div>"),i;t.addClass(this.getNamespace("close-button"));i=n('<button class="close" aria-label="close"><\/button>');i.append(this.options.closeIcon);t.append(i);t.on("click",{dialog:this},function(n){n.data.dialog.close()});return t},createBodyContent:function(){var t=n("<div><\/div>");return t.addClass(this.getNamespace("body")),t.append(this.createMessageContent()),t},createMessageContent:function(){var t=n("<div><\/div>");return t.addClass(this.getNamespace("message")),t},createFooterContent:function(){var t=n("<div><\/div>");return t.addClass(this.getNamespace("footer")),t},createFooterButtons:function(){var i=this,r=i.$modalFooter;return this.indexedButtons={},n.each(this.options.buttons,function(n,u){u.id||(u.id=t.newGuid());var f=i.createButton(u);i.indexedButtons[u.id]=f;r.append(f)}),r},createButton:function(t){var i=n('<button class="btn"><\/button>');i.prop("id",t.id);i.data("button",t);typeof t.icon!="undefined"&&n.trim(t.icon)!==""&&i.append(this.createButtonIcon(t.icon));typeof t.label!="undefined"&&i.append(t.label);typeof t.title!="undefined"&&i.attr("title",t.title);typeof t.cssClass!="undefined"&&n.trim(t.cssClass)!==""?i.addClass(t.cssClass):i.addClass("btn-secondary");typeof t.data=="object"&&t.data.constructor==={}.constructor&&n.each(t.data,function(n,t){i.attr("data-"+n,t)});typeof t.hotkey!="undefined"&&(this.registeredButtonHotkeys[t.hotkey]=i);i.on("click",{dialog:this,$button:i,button:t},function(n){var r=n.data.dialog,t=n.data.$button,i=t.data("button");return i.autospin&&t.toggleSpin(!0),typeof i.action=="function"?i.action.call(t,r,n):void 0});return this.enhanceButton(i),typeof t.enabled!="undefined"&&i.toggleEnable(t.enabled),i.addClass("bootstrap4-dialog-button"),i},enhanceButton:function(n){return n.dialog=this,n.toggleEnable=function(n){var t=this;return typeof n!="undefined"?t.prop("disabled",!n).toggleClass("disabled",!n):t.prop("disabled",!t.prop("disabled")),t},n.enable=function(){var n=this;return n.toggleEnable(!0),n},n.disable=function(){var n=this;return n.toggleEnable(!1),n},n.toggleSpin=function(t){var i=this,r=i.dialog,u=i.find("."+r.getNamespace("button-icon"));return typeof t=="undefined"&&(t=!(n.find(".icon-spin").length>0)),t?(u.hide(),n.prepend(r.createButtonIcon(r.getSpinicon()).addClass("icon-spin"))):(u.show(),n.find(".icon-spin").remove()),i},n.spin=function(){var n=this;return n.toggleSpin(!0),n},n.stopSpin=function(){var n=this;return n.toggleSpin(!1),n},this},createButtonIcon:function(t){var i=n("<span><\/span>");return i.addClass(this.getNamespace("button-icon")).addClass(t),i},enableButtons:function(t){return n.each(this.indexedButtons,function(n,i){i.toggleEnable(t)}),this},updateClosable:function(){return this.isRealized()&&this.getModalHeader().find("."+this.getNamespace("close-button")).toggle(this.isClosable()),this},onShow:function(n){return this.options.onshow=n,this},onShown:function(n){return this.options.onshown=n,this},onHide:function(n){return this.options.onhide=n,this},onHidden:function(n){return this.options.onhidden=n,this},isRealized:function(){return this.realized},setRealized:function(n){return this.realized=n,this},isOpened:function(){return this.opened},setOpened:function(n){return this.opened=n,this},handleModalEvents:function(){this.getModal().on("show.bs.modal",{dialog:this},function(n){var t=n.data.dialog,i;return t.setOpened(!0),t.isModalEvent(n)&&typeof t.options.onshow=="function"?(i=t.options.onshow(t),i===!1&&t.setOpened(!1),i):void 0});this.getModal().on("shown.bs.modal",{dialog:this},function(n){var t=n.data.dialog;t.isModalEvent(n)&&typeof t.options.onshown=="function"&&t.options.onshown(t)});this.getModal().on("hide.bs.modal",{dialog:this},function(n){var t=n.data.dialog,i;return t.setOpened(!1),t.isModalEvent(n)&&typeof t.options.onhide=="function"?(i=t.options.onhide(t),i===!1&&t.setOpened(!0),i):void 0});this.getModal().on("hidden.bs.modal",{dialog:this},function(i){var r=i.data.dialog;r.isModalEvent(i)&&typeof r.options.onhidden=="function"&&r.options.onhidden(r);r.isAutodestroy()&&(r.setRealized(!1),delete t.dialogs[r.getId()],n(this).remove());t.moveFocus();n(".modal").hasClass("in")&&n("body").addClass("modal-open")});this.getModal().on("keyup",{dialog:this},function(n){n.which===27&&n.data.dialog.isClosable()&&n.data.dialog.canCloseByKeyboard()&&n.data.dialog.close()});this.getModal().on("keyup",{dialog:this},function(t){var r=t.data.dialog,i;typeof r.registeredButtonHotkeys[t.which]!="undefined"&&(i=n(r.registeredButtonHotkeys[t.which]),i.prop("disabled")||i.is(":focus")||i.focus().trigger("click"))});return this},isModalEvent:function(n){return typeof n.namespace!="undefined"&&n.namespace==="bs.modal"},makeModalDraggable:function(){if(this.options.draggable){this.getModalHeader().addClass(this.getNamespace("draggable")).on("mousedown",{dialog:this},function(n){var t=n.data.dialog,i;t.draggableData.isMouseDown=!0;i=t.getModalDialog().offset();t.draggableData.mouseOffset={top:n.clientY-i.top,left:n.clientX-i.left}});this.getModal().on("mouseup mouseleave",{dialog:this},function(n){n.data.dialog.draggableData.isMouseDown=!1});n("body").on("mousemove",{dialog:this},function(n){var t=n.data.dialog;t.draggableData.isMouseDown&&t.getModalDialog().offset({top:n.clientY-t.draggableData.mouseOffset.top,left:n.clientX-t.draggableData.mouseOffset.left})})}return this},realize:function(){return this.initModalStuff(),this.getModal().addClass(t.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 i(this.getModalForBootstrapDialogModal(),{backdrop:this.isClosable()&&this.canCloseByBackdrop()?!0:"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}},t.prototype=n.extend(t.prototype,t.METHODS_TO_OVERRIDE[i.getModalVersion()]),t.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=Math.random()*16|0,i=n==="x"?t:t&3|8;return i.toString(16)})},t.show=function(n){return new t(n).open()},t.alert=function(){var r={},u={type:t.TYPE_PRIMARY,title:null,message:null,closable:!1,draggable:!1,buttonLabel:t.DEFAULT_TEXTS.OK,buttonHotkey:null,callback:null},i;if(r=typeof arguments[0]=="object"&&arguments[0].constructor==={}.constructor?n.extend(!0,u,arguments[0]):n.extend(!0,u,{message:arguments[0],callback:typeof arguments[1]!="undefined"?arguments[1]:null}),i=new t(r),i.setData("callback",r.callback),i.addButton({label:r.buttonLabel,hotkey:r.buttonHotkey,action:function(n){return typeof n.getData("callback")=="function"&&n.getData("callback").call(this,!0)===!1?!1:(n.setData("btnClicked",!0),n.close())}}),typeof i.options.onhide=="function")i.onHide(function(n){var t=!0;return(!n.getData("btnClicked")&&n.isClosable()&&typeof n.getData("callback")=="function"&&(t=n.getData("callback")(!1)),t===!1)?!1:this.onhide(n)}.bind({onhide:i.options.onhide}));else i.onHide(function(n){var t=!0;return!n.getData("btnClicked")&&n.isClosable()&&typeof n.getData("callback")=="function"&&(t=n.getData("callback")(!1)),t});return i.open()},t.confirm=function(){var i={},f={type:t.TYPE_PRIMARY,title:null,message:null,closable:!1,draggable:!1,btnCancelLabel:t.DEFAULT_TEXTS.CANCEL,btnCancelClass:null,btnCancelHotkey:null,btnOKLabel:t.DEFAULT_TEXTS.OK,btnOKClass:null,btnOKHotkey:null,btnsOrder:t.defaultOptions.btnsOrder,callback:null},r,u;return i=typeof arguments[0]=="object"&&arguments[0].constructor==={}.constructor?n.extend(!0,f,arguments[0]):n.extend(!0,f,{message:arguments[0],callback:typeof arguments[1]!="undefined"?arguments[1]:null}),i.btnOKClass===null&&(i.btnOKClass=["btn",i.type.split("-")[1]].join("-")),r=new t(i),r.setData("callback",i.callback),u=[{label:i.btnCancelLabel,cssClass:i.btnCancelClass,hotkey:i.btnCancelHotkey,action:function(n){return typeof n.getData("callback")=="function"&&n.getData("callback").call(this,!1)===!1?!1:n.close()}},{label:i.btnOKLabel,cssClass:i.btnOKClass,hotkey:i.btnOKHotkey,action:function(n){return typeof n.getData("callback")=="function"&&n.getData("callback").call(this,!0)===!1?!1:n.close()}}],i.btnsOrder===t.BUTTONS_ORDER_OK_CANCEL&&u.reverse(),r.addButtons(u),r.open()},t.warning=function(n){return new t({type:t.TYPE_WARNING,message:n}).open()},t.danger=function(n){return new t({type:t.TYPE_DANGER,message:n}).open()},t.success=function(n){return new t({type:t.TYPE_SUCCESS,message:n}).open()},t})