
/*
	* Kreatura Modal Window
	*
	* (c) 2019-2026 Kreatura Media, AgeraWeb, George K., John G.
	*
*/



jQuery(document).ready(function(t){window.kmw={defaults:{kmw:"Kreatura Modal Window",version:"1.9.0",releaseDate:"2026. 07. 08.",zIndex:1e5,elementName:"kmw",browserIsSafari:!!navigator.userAgent.match(/(iPhone|iPod|iPad|Safari)/i)&&!navigator.userAgent.match(/(Opera|Chrome|Edge)/i)},opened:[],init:function(){kmw.functions.setMarkup(),t(document).on("click",".kmw-open, [data-kmw=open]",function(){kmw.modal.open(t(this).data())})},functions:{checkVersions:function(t,e){for(var n=t.split("."),i=e.split("."),a=0;a<n.length;++a){if(i.length==a)return!1;if(parseInt(n[a])!=parseInt(i[a]))return!(parseInt(n[a])>parseInt(i[a]))}return n.length,i.length,!0},parseContent:function(e){return 0===e.indexOf("#")||0===e.indexOf(".")?t(e).html():e},removeUID:function(t){window.kmw.opened=window.kmw.opened.filter(function(e){return e!=t})},setMarkup:function(){("registerElement"in document||"customElements"in window)&&(kmw.modal.defaults.markup=kmw.modal.defaults.markup.replace(/div/g,"kmw-div"),kmw.overlay.defaults.markup=kmw.overlay.defaults.markup.replace(/div/g,"kmw-div"))},setState:function(t,e,n){t.data("kmw-state",e),t.removeClass("animating-out animating-in visible hidden"),t.addClass(e),t.is(".kmw-modal-container")&&"animating-in"===e&&n&&window.kmw.opened.push(n.uid)},stringToObject:function(e){for(var n,i={},a=e.split(";"),o=0;o<a.length;o++)-1!==a[o].indexOf(":")&&((n=a[o].split(":"))[1]=t.trim(n[1].toLowerCase()),i[t.trim(n[0].toLowerCase())]=n[1]);return i}},callback:function(t){return{element:t[0],$element:t,data:t.data("kmw-settings")}},modal:{defaults:{markup:'<div class="kmw-modal-container"><div class="kmw-modal"><div class="kmw-sidebar kmw-sidebar-left"><div class="kmw-sidebar-header"></div><div class="kmw-sidebar-inner"><div class="kmw-sidebar-content"></div></div></div><div class="kmw-sidebar kmw-sidebar-sub"><div class="kmw-sidebar-header"></div><div class="kmw-sidebar-inner"><div class="kmw-sidebar-content"></div></div></div><div class="kmw-modal-bg"><div class="kmw-modal-header"></div><div class="kmw-modal-inner"><div class="kmw-modal-content"></div></div></div><div class="kmw-sidebar kmw-sidebar-right"><div class="kmw-sidebar-header"></div><div class="kmw-sidebar-inner"><div class="kmw-sidebar-content"></div></div></div></div></div>',into:"body",id:null,uid:null,clip:!0,closeButton:!0,closeButtonStyle:"",closeButtonAutoStyle:!0,closeOnEscape:!0,width:"100%",height:"100%",minWidth:800,minHeight:250,maxWidth:800,maxHeight:"auto",padding:40,headerTopPaddigModifier:1,headerBottomPaddigModifier:1,closeButtonPositionModifier:1.3,spacing:40,theme:"light",zIndex:!1,outerClasses:"",modalStyle:"",modalClasses:"",modalScrollClasses:"",contentStyle:"",contentClasses:"",title:"",content:"",sidebar:null,sidebarScrollClasses:"",animationIn:"scale",animationOut:null,onOpen:null,onClose:null,onBeforeOpen:null,onBeforeClose:null,overlay:!0,overlaySettings:{}},open:function(e){if(kmw.functions.checkVersions("1.8.0",t.fn.jquery)){var n;if((n="string"==typeof e?t.extend(!0,{},kmw.modal.defaults,{content:e}):t.extend(!0,{},kmw.modal.defaults,e)).uid=n.uid||"kmw-"+Math.random().toString(36).substr(2,9),t('.kmw-modal-container[data-kmw-uid="'+n.uid+'"]').length)return;if("string"==typeof n.modalStyle&&(n.modalStyle=kmw.functions.stringToObject(n.modalStyle)),"string"==typeof n.contentStyle&&(n.contentStyle=kmw.functions.stringToObject(n.contentStyle)),"string"==typeof n.closeButtonStyle&&(n.closeButtonStyle=kmw.functions.stringToObject(n.closeButtonStyle)),n.overlay&&(n.overlaySettings.uid=n.uid,n.overlaySettings.into=n.into,n.$overlay=kmw.overlay.open(n.overlaySettings,n)),n.minWidth=Math.min(n.minWidth,n.maxWidth),kmw.defaults.browserIsSafari)var i=t('<div class="kmw-modal-outer"></div>').attr("data-kmw-uid",n.uid).appendTo(t(n.into));var a=t(n.markup).css({visibility:"hidden",display:"block",left:n.spacing,top:n.spacing,right:n.spacing,bottom:n.spacing,minWidth:n.minWidth,minHeight:n.minHeight}).attr("data-kmw-uid",n.uid).appendTo(i||t(n.into));(i||a).addClass(n.outerClasses).css({zIndex:n.zIndex||kmw.defaults.zIndex++});var o=a.find(".kmw-modal").addClass(n.modalClasses+" kmw-theme-"+n.theme).css({width:n.width,height:n.height,minWidth:n.minWidth,minHeight:n.minHeight,maxWidth:n.maxWidth,maxHeight:n.maxHeight}).css(n.modalStyle).attr("id",n.id);if(n.effects&&o.addClass("kmw-effects"),n.closeButton)var s=t('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="times" class="svg-inline--fa fa-times fa-w-11" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path fill="currentColor" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path></svg>').addClass("kmw-modal-close").css(n.closeButtonStyle).appendTo(o).on("click",function(){kmw.modal.close(a)});var d=o.find(".kmw-modal-header").css({margin:"0 "+n.padding+"px"}),r=o.find(".kmw-modal-inner").css({paddingLeft:n.padding,paddingRight:n.padding,marginTop:n.padding,marginBottom:n.padding}).addClass(n.modalScrollClasses),l=o.find(".kmw-modal-content").addClass(n.contentClasses).css(n.contentStyle);n.content instanceof jQuery?(n.$content=n.content instanceof jQuery?n.content:t(n.content).first(),n.$contentParent=n.$content.parent(),n.$nextSibling=n.$content.next(),n.$content.appendTo(l)):"string"==typeof n.content&&l.html(kmw.functions.parseContent(n.content));var c,m={};if(n.sidebar){var u=function(e,i,a){var s,d,r,l,c,u,w,g=n.sidebar[e],h=o.find(i);if(g){if(h.css({width:g.width||100}),g.merged&&h.addClass("kmw-merged"),g.attributes)for(let t in g.attributes)"class"===t?h.addClass(g.attributes[t]):h.attr(t,g.attributes[t]);h.prepend('<div class="kmw-sidebar-bg-helper"></div>'),s=h.find(".kmw-sidebar-header").css({marginLeft:"left"===a?n.padding:g.merged?0:n.padding,marginRight:"right"===a?n.padding:g.merged?0:n.padding}),d=h.find(".kmw-sidebar-inner").css({paddingLeft:"left"===a?n.padding:g.merged?0:n.padding,paddingRight:"right"===a?n.padding:g.merged?0:n.padding,marginTop:n.padding,marginBottom:n.padding}).addClass(n.sidebarScrollClasses),r=h.find(".kmw-sidebar-content"),g.content instanceof jQuery?(g.$content=g.content,g.$contentParent=g.$content.parent(),g.$nextSibling=g.$content.next(),g.$content.appendTo(r)):"string"==typeof g.content&&r.html(kmw.functions.parseContent(g.content||"")),u=function(e){g.$generatedTitle=t("<kmw-h1>"+e+"</kmw-h1>").addClass("kmw-sidebar-title").prependTo(s)},l=r.find(".kmw-sidebar-title"),!g.title&&l.length&&(g.title=l.html(),g.$titleParent=l.parent(),g.$title=l,l.remove()),g.title&&u(g.title),w=function(t){g.$generatedToolbar=t.css({marginTop:n.padding/5*2}).appendTo(s)},(c=h.find(".kmw-sidebar-toolbar")).length&&(g.$toolbarParent=c.parent(),g.$toolbar=c),g.$toolbar&&w(g.$toolbar),s.children().length&&(s.css({padding:n.padding*n.headerTopPaddigModifier+"px 0 "+n.padding*n.headerBottomPaddigModifier+"px 0"}),d.css({marginTop:0})),m[e]={$sidebar:h,$header:s,$inner:d,$content:r,settings:g},o.addClass("kmw-has-"+e.toLowerCase()+"-sidebar")}};u("left",".kmw-sidebar-left","left"),u("sub",".kmw-sidebar-sub","sub"),u("right",".kmw-sidebar-right","right"),m.left&&(c=m.left.$sidebar)}var w=l.find(".kmw-modal-title");!n.title&&w.length&&(n.title=w.html(),n.$titleParent=w.parent(),n.$title=w,w.remove()),n.title&&(n.title,t("<kmw-h1>"+n.title+"</kmw-h1>").addClass("kmw-modal-title").prependTo(d)),c&&c.find("kmw-menuitem.kmw-active").click();var g=l.find(".kmw-modal-toolbar");if(g.length&&(n.$toolbarParent=g.parent(),n.$toolbar=g),n.$toolbar&&(b=n.$toolbar,b.css({marginTop:n.padding/5*2}).appendTo(d)),n.closeButton&&n.closeButtonAutoStyle&&s.css({transform:"translate("+(s.outerWidth()-n.padding)*n.closeButtonPositionModifier+"px,"+(n.padding-s.outerHeight())*n.closeButtonPositionModifier+"px)"}),d.children().length&&(d.css({padding:n.padding*n.headerTopPaddigModifier+"px 0 "+n.padding*n.headerBottomPaddigModifier+"px 0"}),r.css({marginTop:0})),n.sidebar){t.each(m,function(t,e){e.settings.customHeaderHeight||(e.$header.css({padding:d.css("padding")}),e.$inner.css({marginTop:0}))});var h=function(){t.each(m,function(t,e){e.settings.customHeaderHeight||e.$header.css({height:d.height()})})};h(),setTimeout(function(){h()},80),t(window).on("resize."+n.uid,function(){h()})}if("auto"==n.maxHeight){o.css({height:"auto",maxHeight:"100%"});var f=function(){var e=t(window).height(),i=e-2*n.spacing-(d.children().length?d.outerHeight()+n.padding:2*n.padding);r.css({maxHeight:i}),n.sidebar&&t.each(m,function(t,a){i=e-2*n.spacing-(a.$header.children().length||!a.settings.customHeaderHeight?a.$header.outerHeight()+n.padding:2*n.padding),a.$inner.css({maxHeight:i})})};f(),setTimeout(function(){f()},99),t(window).on("resize."+n.uid,function(){f()})}else if("100%"==n.maxHeight){var p=function(){var e=t(window).height(),i=e-2*n.spacing-(d.children().length?d.outerHeight()+n.padding:2*n.padding);r.css({height:i}),n.sidebar&&t.each(m,function(t,a){i=e-2*n.spacing-(a.$header.children().length||!a.settings.customHeaderHeight?a.$header.outerHeight()+n.padding:2*n.padding),a.$inner.css({height:i})})};p(),setTimeout(function(){p()},99),t(window).on("resize."+n.uid,function(){p()})}else{o.css({height:"auto",maxHeight:n.maxHeight});var k=function(){var e=t(window).height();o.css({height:e-2*n.spacing});var i=o.height()-(d.children().length?d.outerHeight()+n.padding:2*n.padding);r.css({height:"100%",maxHeight:i}),n.sidebar&&t.each(m,function(t,e){i=o.height()-(e.$header.children().length||!e.settings.customHeaderHeight?e.$header.outerHeight()+n.padding:2*n.padding),e.$inner.css({height:i})})};k(),setTimeout(function(){k()},99),t(window).on("resize."+n.uid,function(){k()})}var v=function(){document.documentElement.style.setProperty("--kmw-inner-height",r.height()+"px")};return v(),setTimeout(function(){v()},99),t(window).on("resize."+n.uid,function(){v()}),n.closeOnEscape&&t(document).on("keydown."+n.uid,function(e){if(!kmw.preventCloseOnEscape&&!t("lse-smart-alert.lse-visible").length&&27==e.which){var i=window.kmw.opened[window.kmw.opened.length-1];"forced"!==n.closeOnEscape&&i!==n.uid||kmw.modal.close(a)}}),n.clip&&t("body").addClass("kmw-prevent-scroll"),a.data("kmw-settings",n),kmw.transition.open(a),a}var b;console.log(kmw.defaults.kmw+":","jQuery 1.8 or newer required!")},close:function(e,n){(n=n||{}).overlaySettings=n.overlaySettings||{},(e=e||t(".kmw-modal-container"))instanceof jQuery==!1&&(e=t('.kmw-modal-container[data-kmw-uid="'+e+'"]')),e.each(function(){var e=t(this),i=t.extend(!0,e.data("kmw-settings"),n);if(i.onBeforeClose&&!1===i.onBeforeClose(window.kmw.callback(e)))return!0;window.kmw.functions.removeUID(i.uid),i.afterClose=function(){i.$contentParent&&i.$content.appendTo(i.$contentParent),i.sidebar&&t.each(i.sidebar,function(t,e){e.$contentParent&&e.$content.appendTo(e.$contentParent)}),i.$title&&i.$titleParent&&i.$title.prependTo(i.$titleParent),i.sidebar&&t.each(i.sidebar,function(t,e){e.$title&&e.$titleParent&&e.$title.prependTo(e.$titleParent)}),i.$toolbar&&i.$toolbarParent&&i.$toolbar.prependTo(i.$toolbarParent),i.sidebar&&t.each(i.sidebar,function(t,e){e.$toolbar&&e.$toolbarParent&&e.$toolbar.prependTo(e.$toolbarParent)}),i.clip&&t("body").removeClass("kmw-prevent-scroll"),t(document).off("keydown."+i.uid),t(window).off("resize."+i.uid)},i.$overlay&&t('.kmw-overlay[data-kmw-uid="'+i.uid+'"]').length&&kmw.overlay.close(i.$overlay,n.overlaySettings),kmw.transition.close(e)})}},overlay:{defaults:{markup:'<div class="kmw-overlay"></div>',into:"body",uid:null,closeOnClick:!0,theme:"light",zIndex:!1,customStyle:"",customClasses:"",animationIn:"fade",animationOut:null,onOpen:null,onClose:null,onBeforeOpen:null,onBeforeClose:null},open:function(e,n){var i=t.extend(!0,{},kmw.overlay.defaults,e),a=i.uid?i.uid:"kmw-"+Math.random().toString(36).substr(2,9),o=e.theme?e.theme:n?n.theme:i.theme;if(!t('.kmw-overlay[data-kmw-uid="'+a+'"]').length){"string"==typeof i.customStyle&&(i.customStyle=kmw.functions.stringToObject(i.customStyle));var s=t(i.markup).addClass(i.customClasses+" kmw-theme-"+o).css(i.customStyle).css({visibility:"hidden",display:"block",zIndex:i.zIndex||kmw.defaults.zIndex++}).attr("data-kmw-uid",i.uid).appendTo(t(i.into));return i.closeOnClick&&s.on("click",function(){t('.kmw-modal-container[data-kmw-uid="'+i.uid+'"]').length?kmw.modal.close(t('.kmw-modal-container[data-kmw-uid="'+i.uid+'"]')):kmw.overlay.close(s)}),s.data("kmw-settings",i),kmw.transition.open(s),s}},close:function(e,n){n=n||{},e instanceof jQuery==!1&&(e=t('.kmw-overlay[data-kmw-uid="'+e+'"]')),t.extend(!0,e.data("kmw-settings"),n),e.length&&kmw.transition.close(e)}},transition:{data:{default:{duration:.6,easeIn:Quint.easeOut,easeOut:Quint.easeIn,delay:0,css:{display:"block",visibility:"visible"}},fade:{easeIn:Quart.easeOut,easeOut:Quart.easeIn,duration:.4,css:{opacity:0}},flyLeft:{css:{x:function(){return-t(window).width()}}},flyRight:{css:{x:function(){return t(window).width()}}},flyTop:{css:{y:function(){return-t(window).height()}}},flyBottom:{css:{y:function(){return t(window).height()}}},rotateLeft:{css:{opacity:0,x:function(){return-t(window).width()/4},rotationY:-30,transformPerspective:function(){return 2*t(document).width()}}},rotateRight:{css:{opacity:0,x:function(){return t(window).width()/4},rotationY:30,transformPerspective:function(){return 2*t(document).width()}}},rotateTop:{css:{opacity:0,y:function(){return-t(window).height()/4},rotationX:30,transformPerspective:function(){return 2*t(document).height()}}},rotateBottom:{css:{opacity:0,y:function(){return t(window).height()/4},rotationX:-30,transformPerspective:function(){return 2*t(document).height()}}},scale:{easeIn:Quart.easeOut,easeOut:Quart.easeIn,duration:.4,css:{opacity:0,scaleX:.5,scaleY:.5}},elasticScale:{easeIn:Back.easeOut,easeOut:Back.easeIn,css:{opacity:0,scaleX:.75,scaleY:1.2}}},open:function(e){var n=e.data("kmw-settings")||{};window.kmw.functions.setState(e,"animating-in",n),n.onBeforeOpen&&n.onBeforeOpen(window.kmw.callback(e)),n.animationIn?"string"==typeof n.animationIn?n.animationIn=t.extend({},kmw.transition.data[n.animationIn]):n.animationIn.name&&(n.animationIn=t.extend(!0,{},kmw.transition.data[n.animationIn.name],n.animationIn)):n.animationIn={};var i=kmw.transition.setProperties(t.extend(!0,{},kmw.transition.data.default,n.animationIn),"In");i.css=t.extend({},i.css,kmw.transition.data.default.css);var a=TweenMax.fromTo(e[0],i.duration,{css:i.css},{delay:i.delay,ease:i.ease,x:0,y:0,rotation:0,rotationX:0,rotationY:0,scaleX:1,scaleY:1,skewX:0,skewY:0,opacity:1,onComplete:function(){n.onOpen&&n.onOpen(window.kmw.callback(e)),window.kmw.functions.setState(e,"visible")}});e.data("kmwTweenIn",a),e.data("kmwTweenData",i)},setProperties:function(t,e){for(var n in t)-1!==n.indexOf(e)&&(t[n.split(e)[0]]=t[n]);return t},close:function(e){switch(e.attr("data-kmw-state")){case"animating-in":e.data("kmwTweenIn").pause();break;case"animating-out":return}window.kmw.functions.setState(e,"animating-out");var n,i=e.data("kmw-settings")||{};i.animationOut?("string"==typeof i.animationOut?i.animationOut=t.extend({},kmw.transition.data[i.animationOut]):i.animationOut.name&&(i.animationOut=t.extend(!0,{},kmw.transition.data[i.animationOut.name],i.animationOut)),n=t.extend(!0,{},kmw.transition.data.default,i.animationOut)):(n=e.data("kmwTweenData"),i.animationOut={}),n=kmw.transition.setProperties(n,"Out"),tweenOut=TweenMax.fromTo(e[0],n.duration,{transformPerspective:n.css.transformPerspective||0},{delay:n.delay,ease:n.ease,css:n.css,onComplete:function(){i.onClose&&i.onClose(window.kmw.callback(e)),i.afterClose&&i.afterClose(),window.kmw.functions.setState(e,"hidden"),kmw.defaults.browserIsSafari&&e.closest(".kmw-modal-outer").length?e.closest(".kmw-modal-outer").remove():e.remove()}}),e.data("kmwTweenOut",tweenOut)}}},kmw.init()});