if(typeof jQuery=="undefined")throw new Error("jquery-confirm requires jQuery");var jconfirm,Jconfirm;if(function(n,t){n.fn.confirm=function(t,i){return typeof t=="undefined"&&(t={}),typeof t=="string"&&(t={content:t,title:i?i:!1}),n(this).each(function(){var i=n(this);if(i.attr("jc-attached")){console.warn("jConfirm has already been attached to this element ",i[0]);return}i.on("click",function(r){var u,f,e,o;r.preventDefault();u=n.extend({},t);i.attr("data-title")&&(u.title=i.attr("data-title"));i.attr("data-content")&&(u.content=i.attr("data-content"));typeof u.buttons=="undefined"&&(u.buttons={});u.$target=i;i.attr("href")&&Object.keys(u.buttons).length==0&&(f=n.extend(!0,{},jconfirm.pluginDefaults.defaultButtons,(jconfirm.defaults||{}).defaultButtons||{}),e=Object.keys(f)[0],u.buttons=f,u.buttons[e].action=function(){location.href=i.attr("href")});u.closeIcon=!1;o=n.confirm(u)});i.attr("jc-attached",!0)}),n(this)};n.confirm=function(t,i){if(typeof t=="undefined"&&(t={}),typeof t=="string"&&(t={content:t,title:i?i:!1}),typeof t.buttons!="object"&&(t.buttons={}),Object.keys(t.buttons).length==0){var r=n.extend(!0,{},jconfirm.pluginDefaults.defaultButtons,(jconfirm.defaults||{}).defaultButtons||{});t.buttons=r}return jconfirm(t)};n.alert=function(t,i){if(typeof t=="undefined"&&(t={}),typeof t=="string"&&(t={content:t,title:i?i:!1}),typeof t.buttons!="object"&&(t.buttons={}),Object.keys(t.buttons).length==0){var r=n.extend(!0,{},jconfirm.pluginDefaults.defaultButtons,(jconfirm.defaults||{}).defaultButtons||{}),u=Object.keys(r)[0];t.buttons[u]=r[u]}return jconfirm(t)};n.dialog=function(n,t){return typeof n=="undefined"&&(n={}),typeof n=="string"&&(n={content:n,title:t?t:!1,closeIcon:function(){}}),n.buttons={},typeof n.closeIcon=="undefined"&&(n.closeIcon=function(){}),n.confirmKeys=[13],jconfirm(n)};jconfirm=function(t){var i,r;return typeof t=="undefined"&&(t={}),i=n.extend(!0,{},jconfirm.pluginDefaults),jconfirm.defaults&&(i=n.extend(!0,i,jconfirm.defaults)),i=n.extend(!0,{},i,t),r=new Jconfirm(i),jconfirm.instances.push(r),r};Jconfirm=function(t){n.extend(this,t);this._init()};Jconfirm.prototype={_init:function(){var t=this;jconfirm.instances.length||(jconfirm.lastFocused=n("body").find(":focus"));this._id=Math.round(Math.random()*99999);this.contentParsed=n(document.createElement("div"));this.lazyOpen||setTimeout(function(){t.open()},0)},_buildHTML:function(){var t=this,i,r;this._parseAnimation(this.animation,"o");this._parseAnimation(this.closeAnimation,"c");this._parseBgDismissAnimation(this.backgroundDismissAnimation);this._parseColumnClass(this.columnClass);this._parseTheme(this.theme);this._parseType(this.type);i=n(this.template);i.find(".jconfirm-box").addClass(this.animationParsed).addClass(this.backgroundDismissAnimationParsed).addClass(this.typeParsed);this.typeAnimated&&i.find(".jconfirm-box").addClass("jconfirm-type-animated");this.useBootstrap?(i.find(".jc-bs3-row").addClass(this.bootstrapClasses.row),i.find(".jc-bs3-row").addClass("justify-content-md-center justify-content-sm-center justify-content-xs-center justify-content-lg-center"),i.find(".jconfirm-box-container").addClass(this.columnClassParsed),this.containerFluid?i.find(".jc-bs3-container").addClass(this.bootstrapClasses.containerFluid):i.find(".jc-bs3-container").addClass(this.bootstrapClasses.container)):i.find(".jconfirm-box").css("width",this.boxWidth);this.titleClass&&i.find(".jconfirm-title-c").addClass(this.titleClass);i.addClass(this.themeParsed);r="jconfirm-box"+this._id;i.find(".jconfirm-box").attr("aria-labelledby",r).attr("tabindex",-1);i.find(".jconfirm-content").attr("id",r);this.bgOpacity!==null&&i.find(".jconfirm-bg").css("opacity",this.bgOpacity);this.rtl&&i.addClass("jconfirm-rtl");this.$el=i.appendTo(this.container);this.$jconfirmBoxContainer=this.$el.find(".jconfirm-box-container");this.$jconfirmBox=this.$body=this.$el.find(".jconfirm-box");this.$jconfirmBg=this.$el.find(".jconfirm-bg");this.$title=this.$el.find(".jconfirm-title");this.$titleContainer=this.$el.find(".jconfirm-title-c");this.$content=this.$el.find("div.jconfirm-content");this.$contentPane=this.$el.find(".jconfirm-content-pane");this.$icon=this.$el.find(".jconfirm-icon-c");this.$closeIcon=this.$el.find(".jconfirm-closeIcon");this.$holder=this.$el.find(".jconfirm-holder");this.$btnc=this.$el.find(".jconfirm-buttons");this.$scrollPane=this.$el.find(".jconfirm-scrollpane");t.setStartingPoint();this._contentReady=n.Deferred();this._modalReady=n.Deferred();this.$holder.css({"padding-top":this.offsetTop,"padding-bottom":this.offsetBottom});this.setTitle();this.setIcon();this._setButtons();this._parseContent();this.initDraggable();this.isAjax&&this.showLoading(!1);n.when(this._contentReady,this._modalReady).then(function(){t.isAjaxLoading?setTimeout(function(){t.isAjaxLoading=!1;t.setContent();t.setTitle();t.setIcon();setTimeout(function(){t.hideLoading(!1);t._updateContentMaxHeight()},100);typeof t.onContentReady=="function"&&t.onContentReady()},50):(t._updateContentMaxHeight(),t.setTitle(),t.setIcon(),typeof t.onContentReady=="function"&&t.onContentReady());t.autoClose&&t._startCountDown()});this._watchContent();this.animation==="none"&&(this.animationSpeed=1,this.animationBounce=1);this.$body.css(this._getCSS(this.animationSpeed,this.animationBounce));this.$contentPane.css(this._getCSS(this.animationSpeed,1));this.$jconfirmBg.css(this._getCSS(this.animationSpeed,1));this.$jconfirmBoxContainer.css(this._getCSS(this.animationSpeed,1))},_typePrefix:"jconfirm-type-",typeParsed:"",_parseType:function(n){this.typeParsed=this._typePrefix+n},setType:function(n){var t=this.typeParsed;this._parseType(n);this.$jconfirmBox.removeClass(t).addClass(this.typeParsed)},themeParsed:"",_themePrefix:"jconfirm-",setTheme:function(n){var t=this.theme;this.theme=n||this.theme;this._parseTheme(this.theme);t&&this.$el.removeClass(t);this.$el.addClass(this.themeParsed);this.theme=n},_parseTheme:function(t){var i=this;t=t.split(",");n.each(t,function(r,u){u.indexOf(i._themePrefix)===-1&&(t[r]=i._themePrefix+n.trim(u))});this.themeParsed=t.join(" ").toLowerCase()},backgroundDismissAnimationParsed:"",_bgDismissPrefix:"jconfirm-hilight-",_parseBgDismissAnimation:function(t){var i=t.split(","),r=this;n.each(i,function(t,u){u.indexOf(r._bgDismissPrefix)===-1&&(i[t]=r._bgDismissPrefix+n.trim(u))});this.backgroundDismissAnimationParsed=i.join(" ").toLowerCase()},animationParsed:"",closeAnimationParsed:"",_animationPrefix:"jconfirm-animation-",setAnimation:function(n){this.animation=n||this.animation;this._parseAnimation(this.animation,"o")},_parseAnimation:function(t,i){var r,f,u;return i=i||"o",r=t.split(","),f=this,n.each(r,function(t,i){i.indexOf(f._animationPrefix)===-1&&(r[t]=f._animationPrefix+n.trim(i))}),u=r.join(" ").toLowerCase(),i==="o"?this.animationParsed=u:this.closeAnimationParsed=u,u},setCloseAnimation:function(n){this.closeAnimation=n||this.closeAnimation;this._parseAnimation(this.closeAnimation,"c")},setAnimationSpeed:function(n){this.animationSpeed=n||this.animationSpeed},columnClassParsed:"",setColumnClass:function(n){if(!this.useBootstrap){console.warn("cannot set columnClass, useBootstrap is set to false");return}this.columnClass=n||this.columnClass;this._parseColumnClass(this.columnClass);this.$jconfirmBoxContainer.addClass(this.columnClassParsed)},_updateContentMaxHeight:function(){var i=n(t).height()-(this.$jconfirmBox.outerHeight()-this.$contentPane.outerHeight())-(this.offsetTop+this.offsetBottom);this.$contentPane.css({"max-height":i+"px"})},setBoxWidth:function(n){if(this.useBootstrap){console.warn("cannot set boxWidth, useBootstrap is set to true");return}this.boxWidth=n;this.$jconfirmBox.css("width",n)},_parseColumnClass:function(n){n=n.toLowerCase();var t;switch(n){case"xl":case"xlarge":t="col-md-12";break;case"l":case"large":t="col-md-8 col-md-offset-2";break;case"m":case"medium":t="col-md-6 col-md-offset-3";break;case"s":case"small":t="col-md-4 col-md-offset-4";break;case"xs":case"xsmall":t="col-md-2 col-md-offset-5";break;default:t=n}this.columnClassParsed=t},initDraggable:function(){var i=this,r=this.$titleContainer;if(this.resetDrag(),this.draggable){r.on("mousedown",function(n){r.addClass("jconfirm-hand");i.mouseX=n.clientX;i.mouseY=n.clientY;i.isDrag=!0});n(t).on("mousemove."+this._id,function(n){i.isDrag&&(i.movingX=n.clientX-i.mouseX+i.initialX,i.movingY=n.clientY-i.mouseY+i.initialY,i.setDrag())});n(t).on("mouseup."+this._id,function(){r.removeClass("jconfirm-hand");i.isDrag&&(i.isDrag=!1,i.initialX=i.movingX,i.initialY=i.movingY)})}},resetDrag:function(){this.isDrag=!1;this.initialX=0;this.initialY=0;this.movingX=0;this.movingY=0;this.mouseX=0;this.mouseY=0;this.$jconfirmBoxContainer.css("transform","translate(0px, 0px)")},setDrag:function(){var r,u;if(this.draggable){this.alignMiddle=!1;var e=this.$jconfirmBox.outerWidth(),o=this.$jconfirmBox.outerHeight(),s=n(t).width(),h=n(t).height(),i=this,f=1;(i.movingX%f==0||i.movingY%f==0)&&(i.dragWindowBorder&&(r=s/2-e/2,u=h/2-o/2,u-=i.dragWindowGap,r-=i.dragWindowGap,r+i.movingX<0?i.movingX=-r:r-i.movingX<0&&(i.movingX=r),u+i.movingY<0?i.movingY=-u:u-i.movingY<0&&(i.movingY=u)),i.$jconfirmBoxContainer.css("transform","translate("+i.movingX+"px, "+i.movingY+"px)"))}},_scrollTop:function(){if(typeof pageYOffset!="undefined")return pageYOffset;var t=document.body,n=document.documentElement;return n=n.clientHeight?n:t,n.scrollTop},_watchContent:function(){var i=this,r;this._timer&&clearInterval(this._timer);r=0;this._timer=setInterval(function(){var u,f,e;i.smoothContent&&(u=i.$content.outerHeight()||0,u!==r&&(i.$contentPane.css({height:u}).scrollTop(0),r=u),f=n(t).height(),e=i.offsetTop+i.offsetBottom+i.$jconfirmBox.height()-i.$contentPane.height()+i.$content.height(),e<\/button>').html(t.buttons[r].text).addClass(t.buttons[r].btnClass).prop("disabled",t.buttons[r].isDisabled).css("display",t.buttons[r].isHidden?"none":"").click(function(n){n.preventDefault();var i=t.buttons[r].action.apply(t,[t.buttons[r]]);t.onAction.apply(t,[r,t.buttons[r]]);t._stopCountDown();(typeof i=="undefined"||i)&&t.close()});t.buttons[r].el=f;t.buttons[r].setText=function(n){f.html(n)};t.buttons[r].addClass=function(n){f.addClass(n)};t.buttons[r].removeClass=function(n){f.removeClass(n)};t.buttons[r].disable=function(){t.buttons[r].isDisabled=!0;f.prop("disabled",!0)};t.buttons[r].enable=function(){t.buttons[r].isDisabled=!1;f.prop("disabled",!1)};t.buttons[r].show=function(){t.buttons[r].isHidden=!1;f.css("display","")};t.buttons[r].hide=function(){t.buttons[r].isHidden=!0;f.css("display","none")};t["$_"+r]=t["$$"+r]=f;t.$btnc.append(f)});i===0&&this.$btnc.hide();this.closeIcon===null&&i===0&&(this.closeIcon=!0);this.closeIcon?(this.closeIconClass&&(r='<\/i>',this.$closeIcon.html(r)),this.$closeIcon.click(function(n){var u,r,i,f;n.preventDefault();u=!1;r=!1;i=typeof t.closeIcon=="function"?t.closeIcon():t.closeIcon;typeof i=="string"&&typeof t.buttons[i]!="undefined"?(u=i,r=!1):r=typeof i=="undefined"||!!i==!0?!0:!1;u&&(f=t.buttons[u].action.apply(t),r=typeof f=="undefined"||!!f);r&&t.close()}),this.$closeIcon.show()):this.$closeIcon.hide()},setTitle:function(n,t){if(t=t||!1,typeof n!="undefined")if(typeof n=="string")this.title=n;else if(typeof n=="function"){typeof n.promise=="function"&&console.error("Promise was returned from title function, this is not supported.");var i=n();this.title=typeof i=="string"?i:!1}else this.title=!1;(!this.isAjaxLoading||t)&&(this.$title.html(this.title||""),this.updateTitleContainer())},setIcon:function(n,t){if(t=t||!1,typeof n!="undefined")if(typeof n=="string")this.icon=n;else if(typeof n=="function"){var i=n();this.icon=typeof i=="string"?i:!1}else this.icon=!1;(!this.isAjaxLoading||t)&&(this.$icon.html(this.icon?'<\/i>':""),this.updateTitleContainer())},updateTitleContainer:function(){this.title||this.icon?this.$titleContainer.show():this.$titleContainer.hide()},setContentPrepend:function(n){n&&this.contentParsed.prepend(n)},setContentAppend:function(n){n&&this.contentParsed.append(n)},setContent:function(n,t){t=!!t;var i=this;(n&&this.contentParsed.html("").append(n),!this.isAjaxLoading||t)&&(this.$content.html(""),this.$content.append(this.contentParsed),setTimeout(function(){i.$body.find("input[autofocus]:visible:first").focus()},100))},loadingSpinner:!1,showLoading:function(n){this.loadingSpinner=!0;this.$jconfirmBox.addClass("loading");n&&this.$btnc.find("button").prop("disabled",!0)},hideLoading:function(n){this.loadingSpinner=!1;this.$jconfirmBox.removeClass("loading");n&&this.$btnc.find("button").prop("disabled",!1)},ajaxResponse:!1,contentParsed:"",isAjax:!1,isAjaxLoading:!1,_parseContent:function(){var t=this,r=" ",i,u;typeof this.content=="function"&&(i=this.content.apply(this),typeof i=="string"?this.content=i:typeof i=="object"&&typeof i.always=="function"?(this.isAjax=!0,this.isAjaxLoading=!0,i.always(function(n,i,r){t.ajaxResponse={data:n,status:i,xhr:r};t._contentReady.resolve(n,i,r);typeof t.contentLoaded=="function"&&t.contentLoaded(n,i,r)}),this.content=r):this.content=r);typeof this.content=="string"&&this.content.substr(0,4).toLowerCase()==="url:"&&(this.isAjax=!0,this.isAjaxLoading=!0,u=this.content.substring(4,this.content.length),n.get(u).done(function(n){t.contentParsed.html(n)}).always(function(n,i,r){t.ajaxResponse={data:n,status:i,xhr:r};t._contentReady.resolve(n,i,r);typeof t.contentLoaded=="function"&&t.contentLoaded(n,i,r)}));this.content||(this.content=r);this.isAjax||(this.contentParsed.html(this.content),this.setContent(),t._contentReady.resolve())},_stopCountDown:function(){clearInterval(this.autoCloseInterval);this.$cd&&this.$cd.remove()},_startCountDown:function(){var r=this,u=this.autoClose.split("|"),t,f,i;if(u.length!==2)return console.error("Invalid option for autoClose. example 'close|10000'"),!1;if(t=u[0],f=parseInt(u[1]),typeof this.buttons[t]=="undefined")return console.error("Invalid button key '"+t+"' for autoClose"),!1;i=Math.ceil(f/1e3);this.$cd=n(' ('+i+")<\/span>").appendTo(this["$_"+t]);this.autoCloseInterval=setInterval(function(){r.$cd.html(" ("+(i-=1)+") ");i<=0&&(r["$$"+t].trigger("click"),r._stopCountDown())},1e3)},_getKey:function(n){switch(n){case 192:return"tilde";case 13:return"enter";case 16:return"shift";case 9:return"tab";case 20:return"capslock";case 17:return"ctrl";case 91:return"win";case 18:return"alt";case 27:return"esc";case 32:return"space"}var t=String.fromCharCode(n);return/^[A-z0-9]+$/.test(t)?t.toLowerCase():!1},reactOnKey:function(t){var e=this,f=n(".jconfirm"),r,u,i;if(f.eq(f.length-1)[0]!==this.$el[0]||(r=t.which,this.$content.find(":input").is(":focus")&&/13|32/.test(r)))return!1;u=this._getKey(r);u==="esc"&&this.escapeKey&&(this.escapeKey===!0?this.$scrollPane.trigger("click"):(typeof this.escapeKey=="string"||typeof this.escapeKey=="function")&&(i=typeof this.escapeKey=="function"?this.escapeKey():this.escapeKey,i&&(typeof this.buttons[i]=="undefined"?console.warn("Invalid escapeKey, no buttons found with key "+i):this["$_"+i].trigger("click"))));n.each(this.buttons,function(n,t){t.keys.indexOf(u)!=-1&&e["$_"+n].trigger("click")})},setDialogCenter:function(){console.info("setDialogCenter is deprecated, dialogs are centered with CSS3 tables")},_unwatchContent:function(){clearInterval(this._timer)},close:function(){var i=this;return typeof this.onClose=="function"&&this.onClose(),this._unwatchContent(),n(t).unbind("resize."+this._id),n(t).unbind("keyup."+this._id),n(t).unbind("jcKeyDown."+this._id),this.draggable&&(n(t).unbind("mousemove."+this._id),n(t).unbind("mouseup."+this._id),this.$titleContainer.unbind("mousedown")),i.$el.removeClass(i.loadedClass),n("body").removeClass("jconfirm-no-scroll-"+i._id),i.$jconfirmBoxContainer.removeClass("jconfirm-no-transition"),setTimeout(function(){i.$body.addClass(i.closeAnimationParsed);i.$jconfirmBg.addClass("jconfirm-bg-h");var r=i.closeAnimation==="none"?1:i.animationSpeed;setTimeout(function(){var h,r,u,s;for(i.$el.remove(),h=jconfirm.instances,r=jconfirm.instances.length-1,r;r>=0;r--)jconfirm.instances[r]._id===i._id&&jconfirm.instances.splice(r,1);if(!jconfirm.instances.length&&i.scrollToPreviousElement&&jconfirm.lastFocused&&jconfirm.lastFocused.length&&n.contains(document,jconfirm.lastFocused[0])){if(u=jconfirm.lastFocused,i.scrollToPreviousElementAnimate){var e=n(t).scrollTop(),f=jconfirm.lastFocused.offset().top,o=n(t).height();f>e&&fs||Math.abs(u)>h)return!1;this.$jconfirmBoxContainer.css("transform","translate("+u+"px, "+r+"px)")},_open:function(){var n=this;typeof n.onOpenBefore=="function"&&n.onOpenBefore();this.$body.removeClass(this.animationParsed);this.$jconfirmBg.removeClass("jconfirm-bg-h");this.$body.focus();n.$jconfirmBoxContainer.css("transform","translate(0px, 0px)");setTimeout(function(){n.$body.css(n._getCSS(n.animationSpeed,1));n.$body.css({"transition-property":n.$body.css("transition-property")+", margin"});n.$jconfirmBoxContainer.addClass("jconfirm-no-transition");n._modalReady.resolve();typeof n.onOpen=="function"&&n.onOpen();n.$el.addClass(n.loadedClass)},this.animationSpeed)},loadedClass:"jconfirm-open",isClosed:function(){return!this.$el||this.$el.css("display")===""},isOpen:function(){return!this.isClosed()},toggle:function(){this.isOpen()?this.close():this.open()}};jconfirm.instances=[];jconfirm.lastFocused=!1;jconfirm.pluginDefaults={template:'
<\/div>