(o=>{function s(e,t){this.$el=e,this.ACTIVE_CLASS="open",this.initialized=!1,this.defaults={removeOnClose:!1,perfectScrollbar:!0,afterInit:()=>{}},this.settings=o.extend({},this.defaults,t),this.triggerMethod=(t,i)=>{"function"==typeof this[t]&&this[t](i)},this.setOptions=function(t){this.settings=o.extend({},this.settings,t=t||{})},this.getOptions=function(){return this.settings},this.update=function(t){this.setOptions(t)},this.setHeight=function(t){this.$el.find(".modal-content-wrap").height(t)},this.init=function(){var i=this;!1===i.initialized&&(this.settings.dynamic&&(e.addClass("minimog-modal"),e.html(''),this.settings.afterInit(this)),e.on("click",".modal-overlay, .button-close-modal",function(t){t.preventDefault(),t.stopPropagation(),i.close()}),o(document.body).on("keyup",function(t){27===t.keyCode&&i.close()}),i.initialized=!0,o(document.body).trigger("MinimogModalInit",[e]),i.open())},this.open=function(){var t=this;o(".minimog-modal").filter("."+t.ACTIVE_CLASS).removeClass(t.ACTIVE_CLASS).attr("aria-hidden","true").prop("hidden",!0),t.init(),e.addClass(t.ACTIVE_CLASS).attr("aria-hidden","false").prop("hidden",!1),window.minimog.Helpers.setBodyOverflow(),this.settings.perfectScrollbar&&o.fn.perfectScrollbar&&!window.minimog.Helpers.isHandheld()&&e.find(".modal-content-wrap").perfectScrollbar(),o(document.body).trigger("MinimogModalOpen",[e]),e.trigger("MinimogModalOpen")},this.close=function(){e.removeClass(this.ACTIVE_CLASS).attr("aria-hidden","true").prop("hidden",!0),window.minimog.Helpers.unsetBodyOverflow(),o(document.body).trigger("MinimogModalClose",[e]),e.trigger("MinimogModalClose"),this.settings.removeOnClose&&e.remove()},this.init()}let d="minimogModal";o.fn.extend({MinimogModal:function(e,n){return this.length?"options"===e?o.data(this.get(0),d).getOptions():this.each(function(){let t=o(this),i=o.data(this,d);i?i.triggerMethod(e,n):(i=new s(t,e),o.data(this,d,i))}):this}})})(jQuery); ;