function noty(t){var o=0,n={animateOpen:"animation.open",animateClose:"animation.close",easing:"animation.easing",speed:"animation.speed",onShow:"callback.onShow",onShown:"callback.afterShow",onClose:"callback.onClose",onClosed:"callback.afterClose"};return $.each(t,function(e,s){if(n[e]){o++;var i=n[e].split(".");t[i[0]]||(t[i[0]]={}),t[i[0]][i[1]]=s?s:function(){},delete t[e]}}),t.closeWith||(t.closeWith=$.noty.defaults.closeWith),t.hasOwnProperty("closeButton")&&(o++,t.closeButton&&t.closeWith.push("button"),delete t.closeButton),t.hasOwnProperty("closeOnSelfClick")&&(o++,t.closeOnSelfClick&&t.closeWith.push("click"),delete t.closeOnSelfClick),t.hasOwnProperty("closeOnSelfOver")&&(o++,t.closeOnSelfOver&&t.closeWith.push("hover"),delete t.closeOnSelfOver),t.hasOwnProperty("custom")&&(o++,"null"!=t.custom.container&&(t.custom=t.custom.container)),t.hasOwnProperty("cssPrefix")&&(o++,delete t.cssPrefix),"noty_theme_default"==t.theme&&(o++,t.theme="default"),t.hasOwnProperty("dismissQueue")||(t.dismissQueue="topLeft"==t.layout||"topRight"==t.layout||"bottomLeft"==t.layout||"bottomRight"==t.layout?!0:!1),t.buttons&&$.each(t.buttons,function(t,n){n.click&&(o++,n.onClick=n.click,delete n.click),n.type&&(o++,n.addClass=n.type,delete n.type)}),o&&console.warn("You are using noty v2 with v1.x.x options. @deprecated until v2.2.0 - Please update your options."),jQuery.notyRenderer.init(t)}"function"!=typeof Object.create&&(Object.create=function(t){function o(){}return o.prototype=t,new o}),function(t){var o={init:function(o){return this.options=t.extend({},t.noty.defaults,o),this.options.layout=this.options.custom?t.noty.layouts.inline:t.noty.layouts[this.options.layout],this.options.theme=t.noty.themes[this.options.theme],delete o.layout,delete o.theme,this.options=t.extend({},this.options,this.options.layout.options),this.options.id="noty_"+(new Date).getTime()*Math.floor(1e6*Math.random()),this.options=t.extend({},this.options,o),this._build(),this},_build:function(){var o=t('
').attr("id",this.options.id);if(o.append(this.options.template).find(".noty_text").html(this.options.text),this.$bar=null!==this.options.layout.parent.object?t(this.options.layout.parent.object).css(this.options.layout.parent.css).append(o):o,this.options.buttons){this.options.closeWith=[],this.options.timeout=!1;var n=t("").addClass("noty_buttons");null!==this.options.layout.parent.object?this.$bar.find(".noty_bar").append(n):this.$bar.append(n);var e=this;t.each(this.options.buttons,function(o,n){var s=t("").addClass(n.addClass?n.addClass:"gray").html(n.text).appendTo(e.$bar.find(".noty_buttons")).bind("click",function(){t.isFunction(n.onClick)&&n.onClick.call(s,e)})})}this.$message=this.$bar.find(".noty_message"),this.$closeButton=this.$bar.find(".noty_close"),this.$buttons=this.$bar.find(".noty_buttons"),t.noty.store[this.options.id]=this},show:function(){var o=this;return t(o.options.layout.container.selector).append(o.$bar),o.options.theme.style.apply(o),"function"===t.type(o.options.layout.css)?this.options.layout.css.apply(o.$bar):o.$bar.css(this.options.layout.css||{}),o.$bar.addClass(o.options.layout.addClass),o.options.layout.container.style.apply(t(o.options.layout.container.selector)),o.options.theme.callback.onShow.apply(this),t.inArray("click",o.options.closeWith)>-1&&o.$bar.css("cursor","pointer").one("click",function(){o.close()}),t.inArray("hover",o.options.closeWith)>-1&&o.$bar.one("mouseenter",function(){o.close()}),t.inArray("button",o.options.closeWith)>-1&&o.$closeButton.one("click",function(){o.close()}),-1==t.inArray("button",o.options.closeWith)&&o.$closeButton.remove(),o.options.callback.onShow&&o.options.callback.onShow.apply(o),o.$bar.animate(o.options.animation.open,o.options.animation.speed,o.options.animation.easing,function(){o.options.callback.afterShow&&o.options.callback.afterShow.apply(o),o.shown=!0}),o.options.timeout&&o.$bar.delay(o.options.timeout).promise().done(function(){o.close()}),this},close:function(){if(!this.closed){var o=this;if(!this.shown)return void t.each(t.noty.queue,function(n,e){e.options.id==o.options.id&&t.noty.queue.splice(n,1)});o.$bar.addClass("i-am-closing-now"),o.options.callback.onClose&&o.options.callback.onClose.apply(o),o.$bar.clearQueue().stop().animate(o.options.animation.close,o.options.animation.speed,o.options.animation.easing,function(){o.options.callback.afterClose&&o.options.callback.afterClose.apply(o)}).promise().done(function(){o.options.modal&&(t.notyRenderer.setModalCount(-1),0==t.notyRenderer.getModalCount()&&t(".noty_modal").fadeOut("fast",function(){t(this).remove()})),t.notyRenderer.setLayoutCountFor(o,-1),0==t.notyRenderer.getLayoutCountFor(o)&&t(o.options.layout.container.selector).remove(),o.$bar.remove(),o.$bar=null,o.closed=!0,delete t.noty.store[o.options.id],o.options.theme.callback.onClose.apply(o),o.options.dismissQueue||(t.noty.ontap=!0,t.notyRenderer.render())})}},setText:function(t){return this.closed||(this.options.text=t,this.$bar.find(".noty_text").html(t)),this},setType:function(t){return this.closed||(this.options.type=t,this.options.theme.style.apply(this),this.options.theme.callback.onShow.apply(this)),this},closed:!1,shown:!1};t.notyRenderer={},t.notyRenderer.init=function(n){var e=Object.create(o).init(n);return e.options.force?t.noty.queue.unshift(e):t.noty.queue.push(e),t.notyRenderer.render(),"object"==t.noty.returns?e:e.options.id},t.notyRenderer.render=function(){var o=t.noty.queue[0];"object"===t.type(o)?o.options.dismissQueue?t.notyRenderer.show(t.noty.queue.shift()):t.noty.ontap&&(t.notyRenderer.show(t.noty.queue.shift()),t.noty.ontap=!1):t.noty.ontap=!0},t.notyRenderer.show=function(o){o.options.modal&&(t.notyRenderer.createModalFor(o),t.notyRenderer.setModalCount(1)),0==t(o.options.layout.container.selector).length?o.options.custom?o.options.custom.append(t(o.options.layout.container.object).addClass("i-am-new")):t("body").append(t(o.options.layout.container.object).addClass("i-am-new")):t(o.options.layout.container.selector).removeClass("i-am-new"),t.notyRenderer.setLayoutCountFor(o,1),o.show()},t.notyRenderer.createModalFor=function(o){0==t(".noty_modal").length&&t("").addClass("noty_modal").data("noty_modal_count",0).css(o.options.theme.modal.css).prependTo(t("body")).fadeIn("fast")},t.notyRenderer.getLayoutCountFor=function(o){return t(o.options.layout.container.selector).data("noty_layout_count")||0},t.notyRenderer.setLayoutCountFor=function(o,n){return t(o.options.layout.container.selector).data("noty_layout_count",t.notyRenderer.getLayoutCountFor(o)+n)},t.notyRenderer.getModalCount=function(){return t(".noty_modal").data("noty_modal_count")||0},t.notyRenderer.setModalCount=function(o){return t(".noty_modal").data("noty_modal_count",t.notyRenderer.getModalCount()+o)},t.fn.noty=function(o){return o.custom=t(this),t.notyRenderer.init(o)},t.noty={},t.noty.queue=[],t.noty.ontap=!0,t.noty.layouts={},t.noty.themes={},t.noty.returns="object",t.noty.store={},t.noty.get=function(o){return t.noty.store.hasOwnProperty(o)?t.noty.store[o]:!1},t.noty.close=function(o){return t.noty.get(o)?t.noty.get(o).close():!1},t.noty.setText=function(o,n){return t.noty.get(o)?t.noty.get(o).setText(n):!1},t.noty.setType=function(o,n){return t.noty.get(o)?t.noty.get(o).setType(n):!1},t.noty.clearQueue=function(){t.noty.queue=[]},t.noty.closeAll=function(){t.noty.clearQueue(),t.each(t.noty.store,function(t,o){o.close()})};var n=window.alert;t.noty.consumeAlert=function(o){window.alert=function(n){o?o.text=n:o={text:n},t.notyRenderer.init(o)}},t.noty.stopConsumeAlert=function(){window.alert=n},t.noty.defaults={layout:"top",theme:"default",type:"alert",text:"",dismissQueue:!0,template:' ',animation:{open:{height:"toggle"},close:{height:"toggle"},easing:"swing",speed:500},timeout:!1,force:!1,modal:!1,closeWith:["click"],callback:{onShow:function(){},afterShow:function(){},onClose:function(){},afterClose:function(){}},buttons:!1},t(window).resize(function(){t.each(t.noty.layouts,function(o,n){n.container.style.apply(t(n.container.selector))})})}(jQuery);