");e.addClass("ls-su"),n.addClass("ls-su-inner"),o.addClass("ls-su-content"),t.parent().prepend(e.append(n.append(o)));var a=["borderRightStyle","borderRightWidth","borderRightColor","borderLeftStyle","borderLeftWidth","borderLeftColor","borderBottomStyle","borderBottomWidth","borderBottomColor","backgroundColor"];for(i=0;i
").text(t.title).prependTo(e.$alert)),t.width&&e.$alert.css("width",t.width),t.text&&(e.$text=$("").html(t.text).appendTo(e.$alert)),t.textAlign&&e.$text.css("text-align",t.textAlign),t.type||(t.type=e.defaults.type);let n=e.defaults.buttons[t.type];t.buttons&&(n=$.extend(!0,{},n,t.buttons)),e.$buttons=$("").appendTo(e.$alert);for(let a in n){let i=n[a],s=$("").attr("data-smart-alert-button-type",a).on("click."+e.nameSpace,(function(n){t.clickedButton=a,e.close(t)})).appendTo(e.$buttons);var o=[];for(let t in i)switch(t){case"label":s.text(i[t]);break;case"enter":o.push("enter");break;case"esc":o.push("esc");break;case"callback":s.on("click.custom"+e.nameSpace,(function(){i[t]()}))}s.attr("data-smart-alert-action",o.join(" "))}this.$alert.addClass("lse-visible"),this.$overlay.addClass("lse-visible"),this.options=t},confirm:function(t,e,n){2===arguments.length&&"function"==typeof e&&(n=e,e=t,t=""),this.open({title:t,text:e,type:"confirm",onConfirm:n})},close:function(t){t=t||this.options,this.$alert.removeAttr("class style").html(""),this.$overlay.removeClass("lse-visible"),$(document).off("keydown."+this.nameSpace),window.LS_preventKeyboardShortcuts=!1,t.onClose&&t.onClose(t.clickedButton),t.onConfirm&&"ok"===t.clickedButton&&t.onConfirm(),delete this.opened,delete this.options},getAttention:function(){let t=this;t.$alert.addClass("lse-get-attention"),setTimeout((function(){t.$alert.removeClass("lse-get-attention")}),400)}}},lsCommon.init()}));