Файловый менеджер - Редактировать - /home/lmsyaran/public_html/j3/media/smartslider3/src/SmartSlider3/Application/Admin/Assets/dist/smartslider-backend.min.js
Назад
(function(t){var i=t;i._N2=i._N2||{_r:[],_d:[],r:function(){this._r.push(arguments)},d:function(){this._d.push(arguments)}};var s=t.document,n=s.documentElement,h,o,r=t.setTimeout,a=t.clearTimeout,c=i._N2,l=t.requestAnimationFrame,u=s.createElement.bind(s),d=function(){return u("div")},f=Object.assign,_=function(t,i){for(var s=Object(t),n=1;n<arguments.length;n++){var h=arguments[n];if(null!==h&&h!==o)for(var r in h)null!==h[r]&&Object.prototype.hasOwnProperty.call(h,r)&&("object"==typeof h[r]&&(h[r].constructor===Object||Array.isArray(h[r]))?(Array.isArray(h[r])?s[r]=[]:("object"!=typeof s[r]||Array.isArray(s[r]))&&(s[r]={}),s[r]=_(s[r],h[r])):s[r]=h[r])}return s},v=function(t,i){return t.getAttribute(i)},p=function(t,i,s){t.setAttribute(i,s)},m=function(t,i){for(var s in i)p(t,s,i[s])},b=function(t,i){t.removeAttribute(i)},g=function(t,i,s){t.forEach((function(t){p(t,i,s)}))},y=function(t,i){t.forEach((function(t){m(t,i)}))},w=function(t,i){t.forEach((function(t){L(t,i)}))},k=function(t,i){t.forEach((function(t){z(t,i)}))},x=function(t,i){return t.dataset[i]},S=function(t,i,s){t.dataset[i]=s},I=function(t,s){return i.getComputedStyle(t).getPropertyValue(s)},M=function(t,i,s){t.style.setProperty(i,s)},C=function(t,i){for(var s in i)M(t,s,i[s])},O=function(t,i){t.style.removeProperty(i)},N=function(t,i){i.forEach((function(i){O(t,i)}))},j=function(t,i,s){t.forEach((function(t){M(t,i,s)}))},A=function(t,i){t.forEach((function(t){C(t,i)}))},T=function(t,i){t.forEach((function(t){O(t,i)}))},P=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},F=function(t){t.forEach((function(t){P(t)}))},L=function(t,i){t.classList.add(i)},z=function(t,i){t.classList.remove(i)},E=function(t,i){return t.dispatchEvent(i)},D=function(t,i,s){return s=f({bubbles:!0,cancelable:!0},s),E(t,new Event(i,s))},R=function(t,i){return E(t,new Event(i,{bubbles:!1,cancelable:!1}))},U=function(t,i,s){return E(t,new CustomEvent(i,{bubbles:!1,cancelable:!1,detail:s}))},B=function(t,i,s,n){t.removeEventListener(i,s,n)},H=function(t){t.forEach((function(t){t()})),t.splice(0,t.length)},W=function(t,i,s,n){return n=n||{},t.addEventListener(i,s,n),t.removeEventListener.bind(t,i,s,n)},V=function(t,i,s,n){n=n||{},t.addEventListener(i,s,n)},G=function(t,i,s){t.addEventListener(i,s,{once:!0})},J=function(t,i,s){t.ssEvent&&t.ssEvent[i]&&t.ssEvent[i].forEach((function(t){t(s)}))},Y=function(t,i,s){t.ssEvent||(t.ssEvent={}),t.ssEvent[i]||(t.ssEvent[i]=[]),t.ssEvent[i].push(s)},Z=function(t,i,s){return Y(t,i,s),X.bind(t,i,s)},X=function(t,i){if(this.ssEvent&&this.ssEvent[t])for(var s=this.ssEvent[t],n=s.length-1;n>=0;n--)s[n]===i&&s.splice(n,1)},q=function(){return n.scrollTop},Q=function(t){n.scrollTop=t},K=function(){return n.scrollLeft},tt=function(t){return t.getBoundingClientRect().width},it=function(t){return t.getBoundingClientRect().height},st=function(t){return s.scrollingElement.scrollTop+t.getBoundingClientRect().top},nt=function(t){"complete"===s.readyState||"interactive"===s.readyState?t():s.addEventListener("DOMContentLoaded",t)},et=function(t,i,s,n){if(Math.abs(t.scrollTop-i)<1)n&&n();else{s=Math.max(300,s||300);var h=t.scrollTop,o=i-h,r=performance.now(),a=function(i){var c=Math.min(1,(i-r)/s);c<.5?c*=2*c:c=(4-2*c)*c-1,t.scrollTop=h+c*o,c<1?requestAnimationFrame(a):n&&n()};a(r)}},ht=function(t,i,n){var h=s.createElementNS("http://www.w3.org/2000/svg",t);return i&&(rt(h,i),n&&n.appendChild(h)),h},ot=function(t,i,s){t.setAttributeNS(null,i,s)},rt=function(t,i){for(var s in i)ot(t,s,i[s])},at=function(t){return t.charAt(0).toUpperCase()+t.slice(1)};nt((function(){h=s.body})),c.d("Base64",(function(){return{_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(t){var i,s,n,h,o,r,a,c="",l=0;for(t=function(t){t=t.replace(/\r\n/g,"\n");for(var i="",s=0;s<t.length;s++){var n=t.charCodeAt(s);n<128?i+=String.fromCharCode(n):n>127&&n<2048?(i+=String.fromCharCode(n>>6|192),i+=String.fromCharCode(63&n|128)):(i+=String.fromCharCode(n>>12|224),i+=String.fromCharCode(n>>6&63|128),i+=String.fromCharCode(63&n|128))}return i}(t);l<t.length;)h=(i=t.charCodeAt(l++))>>2,o=(3&i)<<4|(s=t.charCodeAt(l++))>>4,r=(15&s)<<2|(n=t.charCodeAt(l++))>>6,a=63&n,isNaN(s)?r=a=64:isNaN(n)&&(a=64),c=c+this._keyStr.charAt(h)+this._keyStr.charAt(o)+this._keyStr.charAt(r)+this._keyStr.charAt(a);return c},decode:function(t){var i,s,n,h,o,r,a="",c=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<t.length;)i=this._keyStr.indexOf(t.charAt(c++))<<2|(h=this._keyStr.indexOf(t.charAt(c++)))>>4,s=(15&h)<<4|(o=this._keyStr.indexOf(t.charAt(c++)))>>2,n=(3&o)<<6|(r=this._keyStr.indexOf(t.charAt(c++))),a+=String.fromCharCode(i),64!=o&&(a+=String.fromCharCode(s)),64!=r&&(a+=String.fromCharCode(n));return a=function(t){for(var i="",s=0,n=c1=c2=0;s<t.length;)(n=t.charCodeAt(s))<128?(i+=String.fromCharCode(n),s++):n>191&&n<224?(c2=t.charCodeAt(s+1),i+=String.fromCharCode((31&n)<<6|63&c2),s+=2):(c2=t.charCodeAt(s+1),c3=t.charCodeAt(s+2),i+=String.fromCharCode((15&n)<<12|(63&c2)<<6|63&c3),s+=3);return i}(a)}}})),c.r("$",(function(){var $=c.$;c._animationManager=null,c._browse=null,i.n2_=function(t){return c._localization&&c._localization[t]!==o?c._localization[t]:t},i.n2_sprintf=function(t){var i=arguments,s=1;return t.replace(/%s/g,(function(){return i[s++]}))},c._roundTo=5,c._roundHelper=function(t){return c._roundTo<=1?t:Math.round(t/c._roundTo)*c._roundTo},$.fn.n2opener=function(){return this.each((function(){console.error("deprecated $.fn.n2opener");var t=$(this).on("click",(function(e){t.toggleClass("n2-active")}));t.siblings("span").on("click",(function(e){t.toggleClass("n2-active")})),t.parent().on("mouseleave",(function(){t.removeClass("n2-active")})),t.find(".n2-button-menu").on("click",(function(e){e.stopPropagation(),t.removeClass("n2-active")}))}))},jQuery!==o&&jQuery(s).on("wp-collapse-menu",(function(){$(i).trigger("resize")})),c._deepDiff={map:function(t,i){if(this.isValue(t))return t!==o&&t!=i?t:o;for(var s in i)this.isFunction(i[s])||(t[s]=this.map(t[s],i[s]),(t[s]===o||$.isPlainObject(t[s])&&$.isEmptyObject(t[s])||this.isArray(t[s])&&0==t[s].length)&&delete t[s]);return t},isFunction:function(t){return"[object Function]"==={}.toString.apply(t)},isArray:function(t){return"[object Array]"==={}.toString.apply(t)},isObject:function(t){return"[object Object]"==={}.toString.apply(t)},isValue:function(t){return!this.isObject(t)&&!this.isArray(t)}},c._UnicodeToHTMLEntity=function(t){try{var i,s=/(?:[\uD800-\uDBFF][\uDC00-\uDFFF])/g;function n(t){for(var i,s,n,h=[],o=0;o<t.length;)55296==(63488&(i=t.charCodeAt(o)))?h.push((s=i,n=t.charCodeAt(++o),((1023&s)<<10)+(1023&n)+65536)):h.push(i),++o;return"&#"+h+";"}for(;i=s.exec(t);)t=t.substr(0,i.index)+n(t.substr(i.index,s.lastIndex-i.index))+t.substr(s.lastIndex)}catch(i){return console.error(i),t}return t}})),c.d("Popover",["$"],(function(){var $=c.$;function t(t){this.$container=t,this.$content=t.find(".n2_popover_content"),this.$exit=this.$content.find(".n2_popover_content_exit").on("click",this.hide.bind(this)),this.positionCallback=this.position.bind(this),this.$trigger=t.find(".n2_popover__trigger").on("click",this.show.bind(this))}return t.prototype.lazyLoad=function(){this.options=f({horizontal:"right",vertical:"below",relatedclass:!1},this.$container.data()),this.$content.appendTo("body"),this.$inner=this.$content.find(".n2_popover_content_inner"),this.$content.find(".n2_floating_menu__item").on("click",function(e){$(e.currentTarget).data("stay-open")||this.hide(e)}.bind(this)),this.lazyLoad=function(){}},t.prototype.position=function(){var t=this.$trigger[0].getBoundingClientRect(),s=this.$inner[0].getBoundingClientRect(),n=0,h=0,o=1;"left"===this.options.horizontal?(n=this.getXLeft(t,s))<0&&(n=this.getXRight(t,s)):(n=this.getXRight(t,s))<0&&(n=this.getXLeft(t,s)),"above"===this.options.vertical?(h=this.getYAbove(t,s))<0?h=this.getYBelow(t,s):o=3:(h=this.getYBelow(t,s))+s.height>i.innerHeight&&(h=this.getYAbove(t,s),o=3),this.$content.css({transform:"translate("+Math.round(n)+"px, "+Math.round(h)+"px)"}),this.$exit.css({order:String(o),height:t.height+5+"px"})},t.prototype.getXLeft=function(t,i){return t.x},t.prototype.getXRight=function(t,i){return t.x-i.width+t.width},t.prototype.getYAbove=function(t,i){return t.y-i.height-5},t.prototype.getYBelow=function(t,i){return t.y},t.prototype.show=function(e){e&&e.preventDefault(),this.lazyLoad(),this.options.relatedclass&&(this.$related=this.$container.closest("."+this.options.relatedclass),this.$related.addClass(this.options.relatedclass+"--popover-visible")),this.$content.addClass("n2_popover_content--visible").on("mouseleave",this.hide.bind(this)),this.position(),i.addEventListener("scroll",this.positionCallback,{capture:!0,passive:!0})},t.prototype.hide=function(e){this.$related&&(this.$related.removeClass(this.options.relatedclass+"--popover-visible"),delete this.$related),this.$content.off("mouseleave").removeClass("n2_popover_content--visible"),i.removeEventListener("scroll",this.positionCallback,{capture:!0,passive:!0})},t.prototype.setStates=function(t){this.$content.find("a[data-state]").each((function(){var i=$(this),s=i.data("state").match(/^(!)?(.*)$/);"!"===s[1]?i.toggleClass("n2_floating_menu__item--has-state",!t[s[2]]):i.toggleClass("n2_floating_menu__item--has-state",t[s[2]])}))},$.fn.nextendPopover=function(){return this.each((function(){var i=$(this);i.data("popover",new t(i))}))},t})),c.d("NextendHeadingPane",["$"],(function(){var $=c.$;function t(t,i,s,n){this.$node=t.data("pane",this),this.headings=i,this.contents=s,this.tabNames=[],this.headings.each(function(t,i){this.tabNames.push($(i).data("tab"))}.bind(this)),this.identifier=n,this._active=i.index(i.filter(".n2-active"));for(var h=0;h<i.length;h++)i.eq(h).on("click",this.switchToPane.bind(this,h));if(n){var o=localStorage.getItem(this.identifier+"-pane")||-1;if(-1!=o)return void this.switchToPane(o)}this.hideAndShow()}return t.prototype.switchToPane=function(t,e){e&&e.preventDefault(),this.headings.eq(this._active).removeClass("n2-active"),this.headings.eq(t).addClass("n2-active"),this._active=t,this.hideAndShow(),this.store(this._active),this.$node.triggerHandler("changetab")},t.prototype.hideAndShow=function(){$(this.contents[this._active]).css("display","block").trigger("activate");for(var t=0;t<this.contents.length;t++)t!=this._active&&$(this.contents[t]).css("display","none")},t.prototype.store=function(t){this.identifier&&localStorage.setItem(this.identifier+"-pane",t)},t.prototype.showTabs=function(t){for(var i=!1,s=0;s<this.tabNames.length;s++)"-1"!=t.indexOf(this.tabNames[s])?(this.headings.eq(s).css("display",""),$(this.contents[s]).css("display",""),(s==this._active||!1===i)&&(i=s)):(this.headings.eq(s).css("display","none"),$(this.contents[s]).css("display","none"));this.switchToPane(i)},t})),c.d("Window",(function(){var t=!1;var h={getTopOffset:function(){var i=s.getElementsByClassName("navbar-fixed-top");return i.length&&(t=i[0].getBoundingClientRect().height),h.getTopOffset=function(){return t},t},getBottomOffset:function(){return 0},getHeight:function(){return(i.innerHeight||n.clientHeight)-h.getTopOffset()},getWidth:function(){return i.innerWidth||n.clientWidth}};return h})),c.d("WindowManager",(function(){var t=["main"],i={};return{addWindow:function(i){t.push(i)},removeWindow:function(){t.pop()},getCurrentWindow:function(){return t[t.length-1]},actionPrevent:function(t){this.actionCancelPreventRelease(t),i[t]=requestAnimationFrame(this.actionPreventRelease.bind(this,t))},actionPreventFunction:function(t){return this.actionPrevent.bind(this,t)},actionCancelPreventRelease:function(t){i[t]!==o&&(cancelAnimationFrame(i[t]),delete i[t])},actionPreventRelease:function(t){delete i[t]},isActionPrevented:function(t){return i[t]!==o}}})),c.d("LoadingScreen",["$"],(function(){var t,i,s,$=c.$;c.r("documentReady",(function(){t=$('<div class="n2_loading_screen"><div class="n2_loading_screen__circle"></div></div>').appendTo("body")}));var n={startLoading:function(){i&&a(i),s=$.now(),t.addClass("n2_loading_screen--visible")},stopLoading:function(){var n=$.now()-s;n>=300?t.removeClass("n2_loading_screen--visible"):i=r((function(){t.removeClass("n2_loading_screen--visible")}),300-n)}};return n})),c.d("AjaxHelper",["$"],(function(){var $=c.$;function t(){}t.query={};var s={};return t.addAdminUrl=function(t,i){s[t]=i},t.getAdminUrl=function(t){return s[t]},t.addAjaxArray=function(i){for(var s in i)t.query[s]=i[s]},t.makeAjaxUrl=function(i,s){var n=i.split("?");n.length<2&&(n[1]="");var h=c.N2QueryString.parse(n[1]);if(s!==o)for(var r in s)h[r]=s[r];for(var r in t.query)h[r]=t.query[r];return c.N2QueryString.add_query_arg(h,n[0])},t.ajax=function(s){return c.LoadingScreen.startLoading(),s.data=s.data||{},$.ajax(s).always((function(s,n){c.LoadingScreen.stopLoading();try{if("success"!==n?s=JSON.parse(s.responseText):"string"==typeof s&&(s=JSON.parse(s)),s.redirect!==o)return c.LoadingScreen.startLoading(),void(i.location.href=s.redirect);t.notification(s)}catch(t){var h=/<body[^>]*>((.|[\n\r])*)<\/body>/im.exec(s.responseText);h?c.ModalSafeHTML(h[1]):console.error(s.responseText,s)}}))},t.notification=function(t){if(t.notification!==o&&t.notification)for(var i in t.notification)for(var s=0;s<t.notification[i].length;s++)c.Notification[i](t.notification[i][s][0],t.notification[i][s][1])},t.getJSON=function(t){return c.LoadingScreen.startLoading(),$.getJSON(t).always((function(){c.LoadingScreen.stopLoading()}))},t})),c.d("Esc",["$"],(function(){var $=c.$;function t(){this.FiLo=[],this.doc=$(s),this.isListening=!1}return t.prototype.add=function(t){this.FiLo.push(t),this.isListening||(this.doc.on("keydown.n2-esc",function(e){27!==e.keyCode&&8!==e.keyCode||($(e.target).is("input, textarea")?27===e.keyCode&&(e.preventDefault(),$(e.target).trigger("blur")):(e.preventDefault(),this.onClose()))}.bind(this)).on("n2Close.n2-esc",function(e){this.onClose()}.bind(this)),this.isListening=!0)},t.prototype.pop=function(){this.FiLo.pop(),0===this.FiLo.length&&(this.doc.off(".n2-esc"),this.isListening=!1)},t.prototype.onClose=function(){this.FiLo[this.FiLo.length-1]()&&this.pop()},new t})),c.d("tooltip",["$"],(function(){var $=c.$;function t(){this.$element=$('<div class="n2_tooltip"></div>'),this.timeout=null,this.$tipFor=null,nt(this.ready.bind(this))}function s(){this.isVisible=!1,this.$body=$("body"),this.$element=$('<div class="n2_tooltip"></div>').appendTo(this.$body)}return t.prototype.ready=function(){this.$element.appendTo("body"),this.add($("body"))},t.prototype.add=function(t){t.find("[data-n2tip]").off(".n2hastip").on({"mouseenter.n2hastip":this.onEnter.bind(this)})},t.prototype.addElement=function(t,i,s,n){t.data({n2tip:i,n2tipv:n,n2tiph:s}).off(".n2hastip").on({"mouseenter.n2hastip":this.onEnter.bind(this)})},t.prototype.removeElement=function(t){t.off(".n2hastip")},t.prototype.hide=function(){this.onLeave()},t.prototype.onEnter=function(e){this.lastE=e,this.timeout&&a(this.timeout),this.$tipFor=$(e.currentTarget).on({"mousemove.n2tip":this.onMove.bind(this),"mouseleave.n2tip":this.onLeave.bind(this)}),this.timeout=r(function(){var t=this.$tipFor.data("n2tipv"),i=this.$tipFor.data("n2tiph");t===o&&(t=10),i===o&&(i=10);var s=this.$tipFor.data("n2tip");"function"==typeof s&&(s=s.call()),this.$element.css({margin:t+"px "+i+"px"}).html(s).addClass("n2_tooltip--active"),this.onMove(this.lastE)}.bind(this),500)},t.prototype.onMove=function(e){this.lastE=e,this.$element.css({left:Math.min(e.clientX,i.innerWidth-this.$element.outerWidth()-30)+"px",top:Math.min(e.clientY,i.innerHeight-this.$element.height()-20)+"px"})},t.prototype.onLeave=function(){this.timeout&&a(this.timeout),this.$tipFor&&(this.$tipFor.off(".n2tip"),this.$tipFor=null,this.$element.removeClass("n2_tooltip--active").css("margin",""))},s.prototype.show=function(t,e){this.isVisible?this.$element.html(t):(this.isVisible=!0,this.$body.on("mousemove.tooltipMouse",this.mouseMove.bind(this)),this.mouseMove(e),this.$element.html(t).addClass("n2_tooltip--active"))},s.prototype.mouseMove=function(e){this.$element.css({left:Math.min(e.clientX+10,i.innerWidth-this.$element.outerWidth()-32)+"px",top:Math.min(e.clientY+10,i.innerHeight-this.$element.height()-40)+"px"})},s.prototype.hide=function(){this.$body.off("mousemove.tooltipMouse"),this.$element.removeClass("n2_tooltip--active").html(""),this.isVisible=!1},c._tooltip=new t,nt((function(){c._tooltipMouse=new s})),c._tooltip})),c.d("FormTipManager",["$"],(function(){var $=c.$,t=1;function s(i){this.$el=i,this.id=t++,this.isVisible=!1,this.$tip=!1,this.ui="el",this.$el.on({"mouseenter.formTip":this.onMouseEnter.bind(this),"mouseleave.formTip":this.onMouseLeave.bind(this)})}s.prototype.onMouseEnter=function(){this.mouseLeaveTimeout&&a(this.mouseLeaveTimeout),this.mouseEnterTimeout=r(this.onMouseEnterTimeout.bind(this),300)},s.prototype.onMouseEnterTimeout=function(){delete this.mouseEnterTimeout,this.isVisible||(this.ui="el",this.show(),this.isVisible=!0)},s.prototype.onMouseLeave=function(){this.mouseEnterTimeout&&a(this.mouseEnterTimeout),this.mouseLeaveTimeout=r(this.onMouseLeaveTimeout.bind(this),300)},s.prototype.onMouseLeaveTimeout=function(){delete this.mouseLeaveTimeout,this.isVisible&&"el"===this.ui&&this.hide()},s.prototype.show=function(){!1===this.$tip&&this.buildTip(),this.$tip.addClass("n2_form_tip--visible"),$(i).on("scroll.formTip"+this.id,this.positionTip.bind(this)).on("resize.formTip"+this.id,this.positionTip.bind(this)),this.positionTip()},s.prototype.hide=function(){$(i).off(".formTip"+this.id),this.$tip.removeClass("n2_form_tip--visible"),this.isVisible=!1},s.prototype.stopPropagation=function(e){e.stopPropagation()},s.prototype.buildTip=function(){this.$tip=$('<div class="n2_form_tip"></div>').on({mouseenter:this.onTipMouseEnter.bind(this),mouseleave:this.onTipMouseLeave.bind(this),mousedown:this.stopPropagation.bind(this),mouseup:this.stopPropagation.bind(this),click:this.stopPropagation.bind(this)}).appendTo("body"),$('<div class="n2_form_tip__overlay"></div>').appendTo(this.$tip);var t=$('<div class="n2_form_tip__content"></div>').appendTo(this.$tip);this.$el.data("tip-label")&&$('<div class="n2_form_tip__label"></div>').text(this.$el.data("tip-label")).appendTo(t),this.$description=$('<div class="n2_form_tip__description"></div>').html(this.$el.data("tip-description")).appendTo(t),this.$el.data("tip-link")&&$('<a class="n2_form_tip__link" href="'+this.$el.data("tip-link")+'" target="_blank">'+n2_("Open docs")+"</a>").appendTo(t)},s.prototype.setDescription=function(t){this.$description?this.$description.html(t):this.$el.data("tip-description",t)},s.prototype.onTipMouseEnter=function(){this.ui="tip"},s.prototype.onTipMouseLeave=function(){this.hide()},s.prototype.positionTip=function(){this.$tip.css({left:"0",top:"0"});var t,s,n=i.innerWidth,h=(i.innerHeight,this.$el[0].getBoundingClientRect()),o=this.$tip[0].getBoundingClientRect(),r={left:"0",top:"0"};(n2const.rtl.isRtl?h.left>o.width:n-h.left<o.width)?(t="right",r.left=h.left+h.width-o.width+"px"):(t="left",r.left=h.left+"px"),h.top>o.height?(s="bottom",r.top=h.top-o.height+"px"):(s="top",r.top=h.top+h.height+"px"),this.$tip.attr("data-position-horizontal",t).attr("data-position-vertical",s).css(r)};var n={add:function(t){t.find("[data-tip-description]").each((function(){var t=$(this);t.data("formTip")||t.data("formTip",new s(t))}))}};return c.r("windowLoad",(function(){n.add($("body"))})),n})),i.N2Color={hex2rgba:function(t){6===t.length&&(t+="ff");var i=parseInt(t,16);return[i>>24&255,i>>16&255,i>>8&255,(255&i)/255]},hex2rgbaCSS:function(t){return"RGBA("+N2Color.hex2rgba(t).join(",")+")"},hexdec:function(t){return t=(t+"").replace(/[^a-f0-9]/gi,""),parseInt(t,16)},hex2alpha:function(t){return 8!==t.length?1:((255&parseInt(t,16))/255).toFixed(3)},colorizeSVG:function(t,i){var s=t.split("base64,");return 1===s.length?t:(s[1]=c.Base64.encode(c.Base64.decode(s[1]).replace('fill="#FFF"','fill="#'+i.substr(0,6)+'"').replace('opacity="1"','opacity="'+N2Color.hex2alpha(i)+'"')),s.join("base64,"))},colorToSVG:function(t){var i=parseInt(t,16);return[t.substr(0,6),(255&i)/255]}},c.d("N2QueryString",(function(){"use strict";return{parse:function(t){return"string"!=typeof t?{}:(t=t.trim().replace(/^(\?|#)/,""))?t.trim().split("&").reduce((function(t,i){var s=i.replace(/\+/g," ").split("="),n=s[0],h=s[1];return n=decodeURIComponent(n),h=h===o?null:decodeURIComponent(h),t.hasOwnProperty(n)?Array.isArray(t[n])?t[n].push(h):t[n]=[t[n],h]:t[n]=h,t}),{}):{}},stringify:function(t){return t?Object.keys(t).map((function(i){var s=t[i];return Array.isArray(s)?s.map((function(t){return encodeURIComponent(i)+"[]="+encodeURIComponent(t)})).join("&"):encodeURIComponent(i)+"="+encodeURIComponent(s)})).join("&"):""},add_query_arg:function(t,i){var s=i.split("?");s.length<2&&(s[1]="");var n=this.parse(s[1]);for(var h in t)t.hasOwnProperty(h)&&(n[h]=t[h]);return s[0]+"?"+this.stringify(n)}}})),function(t){var i=[],s=[],n=[],h=[],o="0123456789abcdef".split(""),r=[],a=[],c=!1,l=0,u=0,d=[];if(t.Int32Array)s=new Int32Array(16),n=new Int32Array(16),h=new Int32Array(4),r=new Int32Array(4),a=new Int32Array(4),d=new Int32Array(4);else{var f;for(f=0;f<16;f++)s[f]=n[f]=0;for(f=0;f<4;f++)h[f]=r[f]=a[f]=d[f]=0}function _(t){for(var i=16;i--;){var s=i<<2;n[i]=t.charCodeAt(s)+(t.charCodeAt(s+1)<<8)+(t.charCodeAt(s+2)<<16)+(t.charCodeAt(s+3)<<24)}}function v(t,i,s,n,h,o,r){return((i+=t+n+r)<<h|i>>>o)+s<<0}function p(t){b(0,0,0,0,t),a[0]=d[0]+1732584193<<0,a[1]=d[1]-271733879<<0,a[2]=d[2]-1732584194<<0,a[3]=d[3]+271733878<<0}function m(t){b(a[0],a[1],a[2],a[3],t),a[0]=d[0]+a[0]<<0,a[1]=d[1]+a[1]<<0,a[2]=d[2]+a[2]<<0,a[3]=d[3]+a[3]<<0}function b(t,i,s,n,h){var o,r;c?(t=v((s^n)&i^n,t,i,h[0],7,25,-680876936),n=v((i^s)&t^s,n,t,h[1],12,20,-389564586),s=v((t^i)&n^i,s,n,h[2],17,15,606105819),i=v((n^t)&s^t,i,s,h[3],22,10,-1044525330)):(t=((t=h[0]-680876937)<<7|t>>>25)-271733879<<0,n=((n=h[1]-117830708+(2004318071&t^-1732584194))<<12|n>>>20)+t<<0,s=((s=h[2]-1126478375+((-271733879^t)&n^-271733879))<<17|s>>>15)+n<<0,i=((i=h[3]-1316259209+((n^t)&s^t))<<22|i>>>10)+s<<0),t=v((s^n)&i^n,t,i,h[4],7,25,-176418897),n=v((i^s)&t^s,n,t,h[5],12,20,1200080426),s=v((t^i)&n^i,s,n,h[6],17,15,-1473231341),i=v((n^t)&s^t,i,s,h[7],22,10,-45705983),t=v((s^n)&i^n,t,i,h[8],7,25,1770035416),n=v((i^s)&t^s,n,t,h[9],12,20,-1958414417),s=v((t^i)&n^i,s,n,h[10],17,15,-42063),i=v((n^t)&s^t,i,s,h[11],22,10,-1990404162),t=v((s^n)&i^n,t,i,h[12],7,25,1804603682),n=v((i^s)&t^s,n,t,h[13],12,20,-40341101),s=v((t^i)&n^i,s,n,h[14],17,15,-1502002290),i=v((n^t)&s^t,i,s,h[15],22,10,1236535329),t=v((i^s)&n^s,t,i,h[1],5,27,-165796510),n=v((t^i)&s^i,n,t,h[6],9,23,-1069501632),s=v((n^t)&i^t,s,n,h[11],14,18,643717713),i=v((s^n)&t^n,i,s,h[0],20,12,-373897302),t=v((i^s)&n^s,t,i,h[5],5,27,-701558691),n=v((t^i)&s^i,n,t,h[10],9,23,38016083),s=v((n^t)&i^t,s,n,h[15],14,18,-660478335),i=v((s^n)&t^n,i,s,h[4],20,12,-405537848),t=v((i^s)&n^s,t,i,h[9],5,27,568446438),n=v((t^i)&s^i,n,t,h[14],9,23,-1019803690),s=v((n^t)&i^t,s,n,h[3],14,18,-187363961),i=v((s^n)&t^n,i,s,h[8],20,12,1163531501),t=v((i^s)&n^s,t,i,h[13],5,27,-1444681467),n=v((t^i)&s^i,n,t,h[2],9,23,-51403784),s=v((n^t)&i^t,s,n,h[7],14,18,1735328473),i=v((s^n)&t^n,i,s,h[12],20,12,-1926607734),t=v((o=i^s)^n,t,i,h[5],4,28,-378558),n=v(o^t,n,t,h[8],11,21,-2022574463),s=v((r=n^t)^i,s,n,h[11],16,16,1839030562),i=v(r^s,i,s,h[14],23,9,-35309556),t=v((o=i^s)^n,t,i,h[1],4,28,-1530992060),n=v(o^t,n,t,h[4],11,21,1272893353),s=v((r=n^t)^i,s,n,h[7],16,16,-155497632),i=v(r^s,i,s,h[10],23,9,-1094730640),t=v((o=i^s)^n,t,i,h[13],4,28,681279174),n=v(o^t,n,t,h[0],11,21,-358537222),s=v((r=n^t)^i,s,n,h[3],16,16,-722521979),i=v(r^s,i,s,h[6],23,9,76029189),t=v((o=i^s)^n,t,i,h[9],4,28,-640364487),n=v(o^t,n,t,h[12],11,21,-421815835),s=v((r=n^t)^i,s,n,h[15],16,16,530742520),i=v(r^s,i,s,h[2],23,9,-995338651),t=v(s^(i|~n),t,i,h[0],6,26,-198630844),n=v(i^(t|~s),n,t,h[7],10,22,1126891415),s=v(t^(n|~i),s,n,h[14],15,17,-1416354905),i=v(n^(s|~t),i,s,h[5],21,11,-57434055),t=v(s^(i|~n),t,i,h[12],6,26,1700485571),n=v(i^(t|~s),n,t,h[3],10,22,-1894986606),s=v(t^(n|~i),s,n,h[10],15,17,-1051523),i=v(n^(s|~t),i,s,h[1],21,11,-2054922799),t=v(s^(i|~n),t,i,h[8],6,26,1873313359),n=v(i^(t|~s),n,t,h[15],10,22,-30611744),s=v(t^(n|~i),s,n,h[6],15,17,-1560198380),i=v(n^(s|~t),i,s,h[13],21,11,1309151649),t=v(s^(i|~n),t,i,h[4],6,26,-145523070),n=v(i^(t|~s),n,t,h[11],10,22,-1120210379),s=v(t^(n|~i),s,n,h[2],15,17,718787259),i=v(n^(s|~t),i,s,h[9],21,11,-343485551),d[0]=t,d[1]=i,d[2]=s,d[3]=n}h[0]=128,h[1]=32768,h[2]=8388608,h[3]=-2147483648,r[0]=0,r[1]=8,r[2]=16,r[3]=24,t.md5=t.md5||function(t,d,f){!function(t){var i,o;if(c=!1,l=u=(t+="").length,u>63){for(_(t.substring(0,64)),p(n),c=!0,i=128;i<=u;i+=64)_(t.substring(i-64,i)),m(n);t=t.substring(i-64),u=t.length}for(s[0]=0,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=0,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=0,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=0,i=0;i<u;i++)0==(o=i%4)?s[i>>2]=t.charCodeAt(i):s[i>>2]|=t.charCodeAt(i)<<r[o];if(s[i>>2]|=h[i%4],i>55)return c?m(s):(p(s),c=!0),m([0,0,0,0,0,0,0,0,0,0,0,0,0,0,l<<3,0]);s[14]=l<<3,c?m(s):p(s)}(d?t:function(t){for(var i=enc="",s=end=0,n=0,h=t.length;n<h;n++){var o=t.charCodeAt(n);o<128?end++:(enc=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),end>s&&(i+=t.slice(s,end)),i+=enc,s=end=n+1)}return end>s&&(i+=t.slice(s,h)),i}(t));var v=a[0];return i[1]=o[15&v],i[0]=o[15&(v>>=4)],i[3]=o[15&(v>>=4)],i[2]=o[15&(v>>=4)],i[5]=o[15&(v>>=4)],i[4]=o[15&(v>>=4)],i[7]=o[15&(v>>=4)],i[6]=o[15&(v>>=4)],v=a[1],i[9]=o[15&v],i[8]=o[15&(v>>=4)],i[11]=o[15&(v>>=4)],i[10]=o[15&(v>>=4)],i[13]=o[15&(v>>=4)],i[12]=o[15&(v>>=4)],i[15]=o[15&(v>>=4)],i[14]=o[15&(v>>=4)],v=a[2],i[17]=o[15&v],i[16]=o[15&(v>>=4)],i[19]=o[15&(v>>=4)],i[18]=o[15&(v>>=4)],i[21]=o[15&(v>>=4)],i[20]=o[15&(v>>=4)],i[23]=o[15&(v>>=4)],i[22]=o[15&(v>>=4)],v=a[3],i[25]=o[15&v],i[24]=o[15&(v>>=4)],i[27]=o[15&(v>>=4)],i[26]=o[15&(v>>=4)],i[29]=o[15&(v>>=4)],i[28]=o[15&(v>>=4)],i[31]=o[15&(v>>=4)],i[30]=o[15&(v>>=4)],f?i:i.join("")}}(i),c.d("CssInjection",(function(){function t(t,i){this.baseClassName=t,this.style=u("style"),this.style.setAttribute("data-base-class-name",t),this.style.setAttribute("type","text/css"),this.style.styleSheet?this.style.styleSheet.cssText=i:this.style.appendChild(s.createTextNode(i)),h.appendChild(this.style)}return t.prototype.getBaseClassName=function(){return this.baseClassName},t.prototype.destroy=function(){this.style.parentNode.removeChild(this.style)},t})),c.d("NextendCSS",(function(){function t(){this.style=""}return t.prototype.add=function(t,i){return new c.CssInjection(t,i)},t.prototype.deleteRule=function(t){for(var i=t.toLowerCase(),n=i.replace(".","\\."),h=s.styleSheets.length-1;h>=0;h--)for(var o=this._getRulesArray(h),r=0;o&&r<o.length;r++)if(o[r].selectorText){var a=o[r].selectorText.toLowerCase();a!=i&&a!=n||(s.styleSheets[h].cssRules?s.styleSheets[h].deleteRule(r):s.styleSheets[h].removeRule(r))}return!0},t.prototype._getRulesArray=function(t){var i=null;try{s.styleSheets[t].cssRules?i=s.styleSheets[t].cssRules:s.styleSheets[t].rules&&(i=s.styleSheets[t].rules)}catch(t){}return i},c._css=new t,c._css})),c.d("ImageHelper",(function(){function t(t){c._imageHelper=this,this.parameters=f({siteKeywords:[],imageUrls:[],wordpressUrl:"",placeholderImage:"",placeholderRepeatedImage:"",protocolRelative:1},t)}return t.prototype.protocolRelative=function(t){return this.parameters.protocolRelative?t.replace(/^http(s)?:\/\//,"//"):t},t.prototype.dynamic=function(t){for(var i=this.parameters.imageUrls,s=this.parameters.siteKeywords,n=this.protocolRelative(t),h=0;h<s.length;h++)if(0===n.indexOf(i[h])){t=s[h]+n.slice(i[h].length);break}return t},t.prototype.fixed=function(t){if("string"==typeof t)for(var i=this.parameters.imageUrls,s=this.parameters.siteKeywords,n=0;n<s.length;n++)if(0===t.indexOf(s[n])){t=i[n]+t.slice(s[n].length);break}return t},t.prototype.openLightbox=function(t){c.PlatformImageChooser.single(t)},t.prototype.openMultipleLightbox=function(t){c.PlatformImageChooser.multiple(t)},t.prototype.getPlaceholder=function(){return this.fixed(this.parameters.placeholderImage)},t.prototype.getRepeatedPlaceholder=function(){return this.fixed(this.parameters.placeholderRepeatedImage)},t})),c.d("PlatformImageChooser",["$"],(function(){var $=c.$;function t(){}return t.switchToDefaultSelector=function(e){e&&e.preventDefault(),localStorage.setItem("joomla-image-selector",""),this.defaultModal.show(),this.joomlaModal&&this.joomlaModal.hide()},t.switchToJoomlaSelector=function(e){e&&e.preventDefault(),localStorage.setItem("joomla-image-selector","1"),this.defaultModal.hide(),this.showJoomlaSelector()},t.single=function(t){if(this.joomlaModalSingle)c._browse.selected=[];else if(this.joomlaModalSingle=new c.ModalLightbox(n2_("Select image"),"joomla-image-selector"),!i.N2Joomla4){var s=c.UI.modalButton(n2_("Use Joomla selector"),"grey-dark").on("click",this.switchToJoomlaSelector.bind(this));this.joomlaModalSingle.addButton(s,!0).addClass("n2_modal_joomla_image_selector__legacy_button")}var n=i.jInsertFieldValue;this.joomlaModalSingle.addContent(c._browse.getNode("single",function(s){t(s),this.joomlaModalSingle.hide(),i.jInsertFieldValue=n}.bind(this))),i.jInsertFieldValue=function(s){t("$/"+s),this.joomlaModalSingle.hide(),i.jInsertFieldValue=n}.bind(this),this.defaultModal=this.joomlaModalSingle,localStorage.getItem("joomla-image-selector")?this.switchToJoomlaSelector():this.switchToDefaultSelector()},t.multiple=function(t){if(this.joomlaModalMultiple)this.joomlaModalMultiple.$modalBody.find(".n2_modal_filesystem_box--active").removeClass("n2_modal_filesystem_box--active"),c._browse.selected=[];else{if(this.joomlaModalMultiple=new c.ModalLightbox(n2_("Select image"),"joomla-image-selector"),!i.N2Joomla4){var s=c.UI.modalButton(n2_("Use Joomla selector"),"grey-dark").on("click",this.switchToJoomlaSelector.bind(this));this.joomlaModalMultiple.addButton(s,!0).addClass("n2_modal_joomla_image_selector__legacy_button")}var n=c.UI.modalButton(n2_("Select"),"green");this.joomlaModalMultiple.addButton(n),n.on("click",function(e){e.preventDefault();for(var s=c._browse.getSelected(),n=[],o=0;o<s.length;o++)n[o]={image:s[o],title:s[o].split("/").pop(),description:""};this.joomlaModalMultiple.hide(),t(n),i.jInsertFieldValue=h}.bind(this))}this.joomlaModalMultiple.addContent(c._browse.getNode("multiple"));var h=i.jInsertFieldValue;i.jInsertFieldValue=function(s){t([{image:"$/"+s,title:s,description:""}]),this.joomlaModalMultiple.hide(),i.jInsertFieldValue=h}.bind(this),this.defaultModal=this.joomlaModalMultiple,localStorage.getItem("joomla-image-selector")?this.switchToJoomlaSelector():this.switchToDefaultSelector()},t.showJoomlaSelector=function(){if(i.N2Joomla4)this.switchToDefaultSelector();else{if(!this.joomlaModal){this.joomlaModal=new c.ModalLightbox(n2_("Select image"),"joomla-image-selector-legacy");var t=c.UI.modalButton(n2_("Use default selector"),"grey-dark").on("click",this.switchToDefaultSelector.bind(this));this.joomlaModal.addButton(t,!0).addClass("n2_modal_joomla_image_selector__legacy_button"),this.joomlaModal.addContent($('<iframe src="index.php?option=com_media&view=images&tmpl=component&asset=com_content&author=&fieldid=notused&folder="></iframe>')),i.jModalClose=function(){this.joomlaModal.hide()}.bind(this)}this.joomlaModal.show()}},t})),c.d("AbstractModal",["$"],(function(){var $=c.$;function t(i,s){t.counter++,this.id=t.counter,this.type=i,this.buttons=[],this.options=f({hasClose:!0,width:!1,destroyOnHide:!1},s),this.$modal=$('<div class="n2 n2_modal" data-modal-type="'+this.type+'"></div>').appendTo("body"),this.options.hasClose&&$('<div class="n2_modal__overlay"></div>').on("click",this.hide.bind(this)).appendTo(this.$modal),this.$modalWindow=$('<div class="n2_modal__window"></div>').appendTo(this.$modal),!1!==this.options.width&&this.$modalWindow.css("width",this.options.width+"px"),this.renderModal()}return t.counter=0,t.prototype.renderModal=function(){},t.prototype.show=function(){s.activeElement&&s.activeElement!==h&&s.activeElement.blur(),c.WindowManager.addWindow("modal"),this.options.hasClose&&c.Esc.add(function(){return this.hide("esc"),!0}.bind(this)),this.$modal.addClass("n2_modal--visible")},t.prototype.hide=function(e){c.WindowManager.removeWindow(),"esc"!==e&&(c.Esc.pop(),e&&e.preventDefault()),this.$modal.removeClass("n2_modal--visible"),this.options.destroyOnHide&&this.$modal.remove(),s.activeElement&&s.activeElement!==h&&s.activeElement.blur()},t.prototype.getBody=function(){return this.$modalBody},t.prototype.addContent=function(t){t.appendTo(this.$modalBody)},t.prototype.clearButtons=function(){for(var t in this.buttons)this.buttons[t].remove();this.buttons=[],this.$modalButtons.html("").attr("data-buttons",0)},t.prototype.addButton=function(t,i){i=i||!1;var s=$('<div class="n2_modal__button"></div>').append(t);return i?s.prependTo(this.$modalButtons):s.appendTo(this.$modalButtons),this.buttons.push(s),this.$modalButtons.attr("data-buttons",this.buttons.length),s},t})),c.d("ModalDeleteConfirm",["$"],(function(){var $=c.$;function t(t,i){var s=new c.ModalSimple("delete",{destroyOnHide:!0});s.addContent(c.UI.modalIcon("ssi_48 ssi_48--delete","red")),s.addContent(c.UI.modalHeading(n2_("Are you sure?"))),s.addContent(c.UI.modalParagraphHTML(n2_sprintf("You're about to %s. ",t)+n2_sprintf("The deletion is irreversible, and it's not possible to recover %s.",t)).css("margin-bottom","19px"));var n=c.UI.modalButton(n2_("Cancel"),"grey").on("click",(function(e){e.preventDefault(),s.hide()}));s.addButton(n);var h=c.UI.modalButton(n2_("Delete"),"red").on("click",(function(e){e.preventDefault(),i(),s.hide(e)}));s.addButton(h),s.show()}return t.href=function(e,s,n){e.preventDefault(),t(n,(function(){i.location.href=$(s).attr("href")}))},t})),c.d("ModalIframe",["$","AbstractModal"],(function(){var $=c.$;function t(t,i){c.AbstractModal.prototype.constructor.call(this,t,f({},i))}return t.prototype=Object.create(c.AbstractModal.prototype),t.prototype.constructor=t,t.prototype.renderModal=function(){this.$modal.addClass("n2_modal--iframe"),this.$frame=$('<iframe name="'+this.type+'" src="about:blank" style="width: 100%;height:100%;" allowfullscreen></iframe>').appendTo(this.$modalWindow)},t.prototype.setSrc=function(t){this.$frame.attr("src",t)},t.prototype.hide=function(e){c.AbstractModal.prototype.hide.call(this,e),this.$frame.attr("src","about:blank")},t})),c.d("ModalLightbox",["$","AbstractModal"],(function(){var $=c.$;function t(t,i,s){this.title=t,c.AbstractModal.prototype.constructor.call(this,i,f({},s))}return t.prototype=Object.create(c.AbstractModal.prototype),t.prototype.constructor=t,t.prototype.renderModal=function(){if(this.$modal.addClass("n2_modal--lightbox"),this.$modalTopBar=$('<div class="n2_modal__top_bar"></div>').appendTo(this.$modalWindow),this.$title=$('<div class="n2_modal__top_bar_title"></div>').text(this.title).appendTo(this.$modalTopBar),this.$modalButtons=$('<div class="n2_modal__top_bar_buttons" data-buttons="0"></div>').appendTo(this.$modalTopBar),this.options.hasClose){var t=c.UI.modalButton(n2_("Close"),"grey-dark").on("click",this.hide.bind(this));this.addButton(t)}this.$modalBody=$('<div class="n2_modal__body"></div>').appendTo(this.$modalWindow)},t.prototype.setTitle=function(t){this.title=t,this.$title.text(t)},t})),c.d("ModalSimple",["$","AbstractModal"],(function(){var $=c.$;function t(t,i){c.AbstractModal.prototype.constructor.call(this,t,f({width:500},i))}return t.prototype=Object.create(c.AbstractModal.prototype),t.prototype.constructor=t,t.prototype.renderModal=function(){if(this.$modal.addClass("n2_modal--simple"),this.$modalBodyOuter=$('<div class="n2_modal__body_outer"></div>').appendTo(this.$modalWindow),this.options.hasClose){var t=$('<div class="n2_modal__close_wrap"></div>').appendTo(this.$modalBodyOuter);$('<div class="n2_modal__close"><i class="ssi_16 ssi_16--remove"></i></div>').on("click",this.hide.bind(this)).appendTo(t)}this.$modalBody=$('<div class="n2_modal__body"></div>').appendTo(this.$modalBodyOuter),this.$modalButtons=$('<div class="n2_modal__buttons" data-buttons="0"></div>').appendTo(this.$modalWindow)},t})),c.d("PreviewPopup",["$"],(function(){return function(t,s){var n=["height="+screen.availHeight,"width="+screen.availWidth,"toolbar=yes,scrollbars=yes,resizable=yes"].join(","),h=i.open(t,s,n);return h.moveTo(0,0),h.resizeTo(screen.availWidth,screen.availHeight),h}})),c.d("ModalCreateGroup",["$"],(function(){var t,$=c.$,i={manager:!1,ajaxUrl:""};var s={};return s.init=function(s,n){t===o&&(i.manager=s,i.ajaxUrl=n,function(){(t=new c.ModalSimple("create-group",{width:440})).addContent(c.UI.modalIcon("ssi_48 ssi_48--group","green")),t.addContent(c.UI.modalHeading(n2_("Create group")));var s=c.UI.modalFormRow(!0);t.addContent(s);var n=c.UI.modalFieldText(s,"group-name",n2_("Group name"),""),h=c.UI.modalButton(n2_("Create group"),"green");t.addButton(h),h.on("click",(function(e){e.preventDefault(),c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(i.ajaxUrl,{nextendaction:"createGroup"}),data:{title:n.val()},dataType:"json"}).done((function(s){if(0===parseInt(i.manager.groupID)){var n=$(s.data).insertBefore(i.manager.slidersContainer.find($(".n2_slider_box")).first());new c.Slider(i.manager,n),i.manager.initSliders()}t.hide(e),c.Notification.success(n2_("Group created"))}))}))}())},s.show=function(){t.show()},s})),c.d("ModalGeneratorRecordViewer",["$"],(function(){var $=c.$;return function(t,i){this.createRecordModal=new c.ModalSimple("generator-record-viewer",{width:1e3,destroyOnHide:!0}),this.createRecordModal.addContent(c.UI.modalIcon("ssi_48 ssi_48--data","blue")),this.createRecordModal.addContent(c.UI.modalHeading(n2_("Records"))),function(t,i,s){var n=$('<div class="n2_generator_records_table"></div>').css("grid-template-columns","40px repeat("+(i.length-1)+", auto)").appendTo(t),h=0;for($('<div class="n2_generator_records_table__heading" data-col="1"></div>').text(i[h]).appendTo(n),h=1;h<i.length;h++)$('<div class="n2_generator_records_table__heading"></div>').text(i[h]).appendTo(n);for(h=0;h<s.length;h++){var o=0;for($('<div class="n2_generator_records_table__heading" data-col="1"></div>').text(s[h][o]).appendTo(n),o=1;o<s[h].length;o++)$('<div class="n2_generator_records_table__cell"></div>').html(s[h][o]).appendTo(n)}}(this.createRecordModal.getBody(),t,i),this.createRecordModal.show()}})),c.d("ModalHotkey",["$"],(function(){var $=c.$;function t(){var t=this.getHotkeys();this.modal=new c.ModalSimple("hotkey",{width:800}),this.modal.addContent(c.UI.modalIcon("ssi_48 ssi_48--keyboard","blue")),this.modal.addContent(c.UI.modalHeading(n2_("Keyboard shortcuts")));var i=$('<div class="n2_modal__hotkey"></div>');this.modal.addContent(i);for(var s=0;s<t.length;s++)for(var n=$('<div class="n2_modal__hotkey_column"></div>').appendTo(i),h=0;h<t[s].length;h++){var o=t[s][h][0],r=t[s][h][1],a=$('<div class="n2_modal__hotkey_group"></div>').appendTo(n);$('<div class="n2_modal__hotkey_title">'+o+"</div>").appendTo(a);for(var l=0;l<r.length;l++){var u=$('<div class="n2_modal__hotkey_row"></div>').appendTo(a),d=r[l][0];$('<div class="n2_modal__hotkey_text">'+d+"</div>").appendTo(u);for(var f=$('<div class="n2_modal__hotkey_keys"></div>').appendTo(u),_=r[l][1],v=0;v<_.length;v++)$('<div class="n2_modal__hotkey_key">'+_[v]+"</div>").appendTo(f)}}var p=c.UI.modalButton(n2_("Got it"),"blue");this.modal.addButton(p),p.on("click",function(e){this.modal.hide()}.bind(this))}t.prototype.getHotkeys=function(){var t="ctrl",i=[],s=[];this.isMac()&&(t="cmd");var n=[n2_("General"),[[n2_("Content tab"),["q"]],[n2_("Style tab"),["w"]]]];i.push(n),n[1].push([n2_("Animation tab"),["e"]]),n[1].push([n2_("Add Layer"),["a"]],[n2_("Layer List"),["s"]]),n[1].push([n2_("Timeline"),["d"]]);var h=[n2_("View"),[[n2_("Preview"),[t,"1"]],[n2_("Desktop"),[t,"2"]],[n2_("Tablet"),[t,"3"]],[n2_("Mobile"),[t,"4"]]]];i.push(h);var o=[n2_("Adjust"),[[n2_("Move (Absolute)"),[n2_("Arrows")]],[n2_("Align (Absolute)"),[n2_("Numeric keys")]]]];i.push(o);var r=[n2_("Action"),[[n2_("Delete"),["del"]],[n2_("Duplicate"),[t,"d"]],[n2_("Copy"),[t,"c"]],[n2_("Paste"),[t,"v"]],[n2_("Undo"),[t,"z"]],[n2_("Redo"),[t,"shift","z"]],[n2_("Save"),[t,"s"]]]];r[1].push([n2_("Play animations"),["space"]]),s.push(r);var a=[n2_("Clear device specific settings"),[[n2_("Current layer, current device"),["shift","e"]],[n2_("Current layer, all devices"),["shift","alt","e"]],[n2_("All layers, current device"),["shift","r"]],[n2_("All layers, all devices"),["shift","alt","r"]]]];return s.push(a),[i,s]},t.prototype.isMac=function(){return navigator.platform.toUpperCase().indexOf("MAC")>=0},t.prototype.show=function(){this.modal.show()};var i=!1;function s(){}return s.show=function(){i||(i=new t),i.show()},s})),c.d("ModalSafeHTML",["$"],(function(){var $=c.$;return function(t){var s=new c.ModalSimple("safe-html",{destroyOnHide:!1,width:440});s.addContent(c.UI.modalHeading(n2_("Unexpected response")));var n=$(t.replace(/document\.write/g,"n2Write"));i.n2Write=function(t){s.addContent($("<span></span>").html(t))},n.each((function(t,i){s.addContent($(i))})),delete i.n2Write,s.show()}})),c.d("ModalUrlTabAction",["$"],(function(){function t(t){var i=c.UI.modalFormRow(!0).appendTo(t);this.$select=c.UI.modalSelect(i,"action",n2_("Action"),{ScrollTo:n2_("Scroll to"),ScrollToAlias:n2_("Scroll to alias"),ToSlide:n2_("Go to slide"),ToSlideID:n2_("Go to slide ID"),PreviousSlide:n2_("Previous slide"),NextSlide:n2_("Next slide"),SlideEvent:n2_("Slide event")},"ScrollTo").on("nextendChange",function(){this.changeActive(this.$select.val())}.bind(this)),this.actions={ScrollTo:new s(t),ScrollToAlias:new n(t),ToSlide:new h(t),ToSlideID:new r(t),PreviousSlide:new a(t),NextSlide:new l(t),SlideEvent:new u(t)}}function i(t){this.$container=c.UI.modalHiddenContainer(t)}function s(t){i.prototype.constructor.apply(this,arguments);var s=c.UI.modalFormRow(!0).appendTo(this.$container);this.$scrollToField=c.UI.modalFieldText(s,"scroll-to",n2_("Scroll to"),""),s.find(".n2_field__element").addClass("n2_field_autocomplete").addClass("n2_autocomplete_position_to"),c.AutocompleteSimple("modal-field-scroll-to",["top","bottom","beforeSlider","afterSlider","previousSlider","nextSlider"]);var n=c.UI.modalFormRow(!0).appendTo(this.$container);c.UI.modalTable(n,"scroll-to-examples",n2_("Examples"),[["top",n2_("Scrolls to the top of the page.")],["bottom",n2_("Scrolls to the bottom of the page.")],["jQuery selector",n2_('You can use any jQuery selector to scroll to a specific element on the page. Example: "#pricing" scrolls to the element with the id of "pricing".')]])}function n(t){i.prototype.constructor.apply(this,arguments);var s=c.UI.modalFormRow(!0).appendTo(this.$container);this.$aliasField=c.UI.modalFieldText(s,"scroll-to-alias",n2_("Slider alias"),"");var n=c.UI.modalFormRow(!0).appendTo(this.$container);c.UI.modalTable(n,"scroll-to-alias-examples",n2_("Examples"),[["myslider",n2_("Slider alias set at Slider settings > General")]])}function h(t){i.prototype.constructor.apply(this,arguments);var s=c.UI.modalFormRow().appendTo(this.$container);this.$toSlideField=c.UI.modalNumber(s,"to-slide",n2_("Slide index"),1),this.$toDirectionField=c.UI.modalSelect(s,"to-slide-direction",n2_("Direction"),{auto:n2_("Auto"),backward:n2_("Backward"),forward:n2_("Forward")},"auto");var n=c.UI.modalFormRow(!0).appendTo(this.$container);c.UI.modalTable(n,"to-slide-examples",n2_("Examples"),[[n2_sprintf(n2_("slide index: 2 %s direction: backward"),"<br>"),n2_("Switches to the second slide as if the previous arrow was pressed")],[n2_sprintf(n2_("slide index: 5 %s direction: forward"),"<br>"),n2_("Switches to the fifth slide as if the next arrow was pressed")]])}function r(t){i.prototype.constructor.apply(this,arguments);var s=c.UI.modalFormRow().appendTo(this.$container);this.$toSlideIDField=c.UI.modalNumber(s,"to-slide-id",n2_("Slide ID"),1,{min:1,wide:6}),this.$toSlideIDDirectionField=c.UI.modalSelect(s,"to-slide-id-direction",n2_("Direction"),{auto:n2_("Auto"),backward:n2_("Backward"),forward:n2_("Forward")},"auto");var n=c.UI.modalFormRow(!0).appendTo(this.$container);c.UI.modalTable(n,"to-slide-id-examples",n2_("Examples"),[[n2_sprintf(n2_("slide index: 2 %s direction: backward"),"<br>"),n2_("Switches to the slide with the #2 ID as if the previous arrow was pressed")],[n2_sprintf(n2_("slide index: 5 %s direction: forward"),"<br>"),n2_("Switches to the slide with the #5 ID as if the next arrow was pressed")]])}function a(t){i.prototype.constructor.apply(this,arguments)}function l(t){i.prototype.constructor.apply(this,arguments)}function u(t){i.prototype.constructor.apply(this,arguments);var s=c.UI.modalFormRow(!0).appendTo(this.$container);this.$slideEventField=c.UI.modalFieldText(s,"slide-event",n2_("Event name"),"");var n=c.UI.modalFormRow(!0).appendTo(this.$container);c.UI.modalTable(n,"slide-event-examples",n2_("Examples"),[["myevent",n2_("An event you use to trigger layer animation(s) with")]])}return t.prototype.changeActive=function(t,i){i=i||[],this.active&&this.actions[this.active]&&this.actions[this.active].hide(),this.active=t,this.actions[t].show.apply(this.actions[t],i)},t.prototype.show=function(t){var i="ScrollTo",s=[""],n=t.match(/([a-zA-Z]+)\[(.*?)\]/);n&&this.actions[n[1]]!==o&&(i=n[1],s=n[2].split(",")),this.$select.val(i).trigger("change"),this.changeActive(i,s)},t.prototype.getResult=function(){return this.active+"["+this.actions[this.active].getArgs().join(",")+"]"},i.prototype.show=function(){this.$container.addClass("n2_modal__container_hidden--visible")},i.prototype.hide=function(){this.$container.removeClass("n2_modal__container_hidden--visible")},i.prototype.getArgs=function(){return[]},s.prototype=Object.create(i.prototype),s.prototype.constructor=s,s.prototype.show=function(t){i.prototype.show.call(this),this.$scrollToField.val(t||"")},s.prototype.getArgs=function(){return[this.$scrollToField.val()]},n.prototype=Object.create(i.prototype),n.prototype.constructor=n,n.prototype.show=function(t){i.prototype.show.call(this),this.$aliasField.val(t||"")},n.prototype.getArgs=function(){return[this.$aliasField.val()]},h.prototype=Object.create(i.prototype),h.prototype.constructor=h,h.prototype.show=function(t,s){switch(i.prototype.show.call(this),this.$toSlideField.val(t||1),s){case"0":s="backward";break;case"1":s="forward";break;default:s="auto"}this.$toDirectionField.val(s).trigger("change")},h.prototype.getArgs=function(){var t=[this.$toSlideField.val()];switch(this.$toDirectionField.val()){case"backward":t.push(0);break;case"forward":t.push(1)}return t},r.prototype=Object.create(i.prototype),r.prototype.constructor=r,r.prototype.show=function(t,s){switch(i.prototype.show.call(this),this.$toSlideIDField.val(t||1),s){case"0":s="backward";break;case"1":s="forward";break;default:s="auto"}this.$toSlideIDDirectionField.val(s).trigger("change")},r.prototype.getArgs=function(){var t=[this.$toSlideIDField.val()];switch(this.$toSlideIDDirectionField.val()){case"backward":t.push(0);break;case"forward":t.push(1)}return t},a.prototype=Object.create(i.prototype),a.prototype.constructor=a,l.prototype=Object.create(i.prototype),l.prototype.constructor=l,u.prototype=Object.create(i.prototype),u.prototype.constructor=u,u.prototype.show=function(t){i.prototype.show.call(this),this.$slideEventField.val(t||"")},u.prototype.getArgs=function(){return[this.$slideEventField.val()]},t})),c.d("ModalUrlTabLightbox",["$"],(function(){function t(t){var i=c.UI.modalFormRow(!0).appendTo(t);this.$contentList=c.UI.modalTextarea(i,"content-list",n2_("Content List - One Per Line")),c.UI.modalButton(n2_("Choose images"),"green","small").css("margin-bottom","20px").on("click",function(e){e.preventDefault(),c._imageHelper.openMultipleLightbox(function(t){for(var i=this.$contentList.val().replace(/\n$/,""),s=0;s<t.length;s++)i+="\n"+t[s].image;this.$contentList.val(i.replace(/^\n/,""))}.bind(this))}.bind(this)).appendTo(t);var s=c.UI.modalFormRow(!0).appendTo(t);c.UI.modalTable(s,"lightbox-examples",n2_("Examples"),[["Image","https://smartslider3.com/image.jpg"],["YouTube","https://www.youtube.com/watch?v=3PPtkRU7D74"],["Vimeo","https://vimeo.com/144598279"],["Iframe","https://smartslider3.com"]]);var n=c.UI.modalFormRow(!0).appendTo(t);this.$titleList=c.UI.modalTextarea(n,"title-list",n2_("Titles - One Per Line"));var h=c.UI.modalFormRow().appendTo(t);this.$autoplayDuration=c.UI.modalNumber(h,"autoplay-duration",n2_("Autoplay duration"),0,{wide:3,unit:"ms"})}return t.prototype.show=function(t){var i=t.match(/lightbox\[(.+)\]/);if(i&&2===i.length)if("{"===i[1][0])try{var s=JSON.parse(i[1]);this.$contentList.val(s.urls.join("\n")),this.$titleList.val(s.titles.join("\n")),this.$autoplayDuration.val(s.autoplay)}catch(t){}else{var n=i[1].split(",");parseInt(n[n.length-1])>0&&(this.$autoplayDuration.val(parseInt(n[n.length-1])),n.pop()),this.$contentList.val(n.join("\n"))}else this.$contentList.val(""),this.$titleList.val(""),this.$autoplayDuration.val(0)},t.prototype.getResult=function(){return"lightbox["+JSON.stringify({urls:this.$contentList.val().split("\n"),titles:this.$titleList.val().split("\n"),autoplay:Math.max(0,parseInt(this.$autoplayDuration.val()))})+"]"},t})),c.d("ModalUrlTabUrl",["$"],(function(){var $=c.$;function t(t,i){this.modalManager=i,this.cache={};var s=c.UI.modalFormRow(!0).appendTo(t);this.$url=c.UI.modalFieldText(s,"url",n2_("URL"),"");var n=c.UI.modalFormRow(!0).appendTo(t);this.$searchKeyword=c.UI.modalFieldText(n,"search-keyword",n2_("Search keyword"),"").on("keyup",this.search.bind(this)).trigger("focus");var h=c.UI.modalFormRow(!0).appendTo(t);this.$postSelector=c.UI.modalSelectList(h,"url-post",n2_("Posts"),function(t){this.$url.val(t.link)}.bind(this),{mode:"insert"})}return t.prototype.show=function(t){this.$url.val(t),this.$searchKeyword.val(""),this.search()},t.prototype.search=function(){this.searchString=this.$searchKeyword.val(),this.getAjaxSearchResult(this.searchString).done(function(t){if(this.$searchKeyword.val()===this.searchString){this.$postSelector.removeOptions();for(var i=t.data,s=0;s<i.length;s++)this.$postSelector.addOption(i[s].title,i[s].info,i[s])}}.bind(this))},t.prototype.getAjaxSearchResult=function(t){return this.cache[t]===o&&(this.cache[t]=$.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.modalManager.ajaxUrl),data:{keyword:t},dataType:"json"})),this.cache[t]},t.prototype.getResult=function(){return this.$url.val()},t})),c.d("ModalUrl",["$"],(function(){function t(t){this.ajaxUrl=t,this.activeTab="",this.modal=new c.ModalSimple("url-modal"),this.modal.addContent(c.UI.modalIcon("ssi_48 ssi_48--link","green").css("margin-bottom","20px")),this.uiTabs=c.UI.modalTabs(this.modal.getBody(),"url-tabs",{url:n2_("URL"),lightbox:n2_("Lightbox"),action:n2_("Action")},this.onTabActiveChange.bind(this)),this.tabs={},this.tabs.url=new c.ModalUrlTabUrl(this.uiTabs.tabs.url.$content,this),this.tabs.lightbox=new c.ModalUrlTabLightbox(this.uiTabs.tabs.lightbox.$content),this.tabs.action=new c.ModalUrlTabAction(this.uiTabs.tabs.action.$content);var i=c.UI.modalButton(n2_("Insert"),"green");this.modal.addButton(i),i.on("click",function(e){e.preventDefault(),this.setCallback(this.tabs[this.activeTab].getResult()),this.modal.hide()}.bind(this))}t.prototype.onTabActiveChange=function(t){this.activeTab=t,this.tabs[t].show(this.originalValue)},t.prototype.show=function(t,i){this.originalValue=t,this.setCallback=i,t.match(/lightbox\[(.+)\]/)?this.uiTabs.setActiveTab("lightbox"):t.match(/ScrollTo|ScrollToAlias|SlideEvent|ToSlide|ToSlideID|\[(.+)\]/)||t.match(/PreviousSlide|NextSlide|\[\]/)?this.uiTabs.setActiveTab("action"):this.uiTabs.setActiveTab("url"),this.modal.show()};var i=!1;function s(){}return s.show=function(s,n,h){i||(i=new t(n)),i.show(s,h)},s})),c.d("UI",["$"],(function(){var $=c.$,t={modalButton:function(t,i,s){return $('<a class="n2_button n2_button--'+(s=s||"big")+" n2_button--"+i+'" href="#"><span class="n2_button__label">'+t+"</span></a>")},modalIcon:function(t,i){return $('<div class="n2_modal__icon n2_modal__icon--'+i+'"><i class="'+t+'"></i></div>')},modalHeading:function(t){return $('<div class="n2_modal__heading"></div>').text(t)},modalSubHeading:function(t){return $('<div class="n2_modal__subheading"></div>').text(t)},modalParagraph:function(t){return $('<div class="n2_modal__paragraph"></div>').text(t)},modalParagraphHTML:function(t){return $('<div class="n2_modal__paragraph"></div>').html(t)},modalInput:function(t,i,s,n){return $('<input class="n2_modal__input" type="'+i+'" id="'+t+'" name="'+t+'" value="'+s+'" '+(n!==o?'placeholder="'+n+'"':"")+">")},modalFormTable:function(t){var i=$('<div class="n2_form__table"></div>');return $('<div class="n2_form__table_label"></div>').append($('<div class="n2_form__table_label_title"></div>').text(t)).appendTo(i),{$table:i,$content:$('<div class="n2_form__table_preview"></div>').appendTo(i)}},modalFormContainer:function(t,i){return $('<div class="n2_modal__form_container" data-field="'+i+'"></div>').appendTo(t)},modalHiddenContainer:function(t){return $('<div class="n2_modal__container_hidden"></div>').appendTo(t)},modalFormRow:function(t){return $('<div class="n2_modal__form_row"></div>').toggleClass("n2_modal__form_row--fullwidth",!0===t)},modalFormRowLarge:function(t){return $('<div class="n2_modal__form_row n2_modal__form_row--large"></div>').toggleClass("n2_modal__form_row--fullwidth",!0===t)},modalFieldWrapper:function(t,i,s){var n=$('<div class="n2_field" data-field="'+i+'"></div>').appendTo(t);return!1===s?n.addClass("n2_field--label-none"):""===s&&n.addClass("n2_field--label-placeholder"),s&&$('<div class="n2_field__label"><label for="modal-field-'+i+'">'+s+"</label></div>").appendTo(n),{$field:n,$element:$('<div class="n2_field__element"></div>').appendTo(n)}},modalFieldText:function(i,s,n,h){var o=t.modalFieldWrapper(i,s,n),r=$('<div class="n2_field_text"></div>').appendTo(o.$element),a=$('<input type="text" id="modal-field-'+s+'" name="'+s+'" autocomplete="off">').val(h).appendTo(r);return new c.FormElementText("modal-field-"+s),a},modalOnOff:function(i,s,n,h,o){var r=t.modalFieldWrapper(i,s,n),a=$('<div class="n2_field_onoff"><div class="n2_field_onoff__slider"><div class="n2_field_onoff__slider_bullet"></div></div><div class="n2_field_onoff__labels"><div class="n2_field_onoff__label n2_field_onoff__label_off">'+n2_("Off")+'</div><div class="n2_field_onoff__label n2_field_onoff__label_on">'+n2_("On")+"</div></div></div>").appendTo(r.$element),l=$('<input id="modal-field-'+s+'" name="'+s+'" value="'+h+'" type="hidden" autocomplete="off">').val(h).appendTo(a);return new c.FormElementOnoff("modal-field-"+s,o),l},modalSelect:function(i,s,n,h,o,r){r=f({isMultiple:!1},r);var a=t.modalFieldWrapper(i,s,n),l=$('<input id="modal-field-'+s+'" name="'+s+'" value="'+o+'" type="hidden" autocomplete="off">').appendTo(a.$element),u=$('<select id="modal-field-'+s+'_select" name="select'+s+'" autocomplete="off"></select>');for(var d in r.isMultiple&&u.attr("multiple","multiple").attr("size","8"),h)u.append('<option value="'+d+'">'+h[d]+"</option>");return $('<div class="n2_field_select"></div>').append(u).appendTo(a.$element),new c.FormElementList("modal-field-"+s).insideChange(o),l},modalNumber:function(i,s,n,h,o){var r=100;switch((o=f({unit:!1,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,wide:4,sublabel:""},o)).wide){case 2:r=20;break;case 3:r=26;break;case 4:r=32;break;case 5:r=44;break;case 6:r=60}var a=t.modalFieldWrapper(i,s,n),l=$('<div class="n2_field_text n2_field_number"></div>').appendTo(a.$element);""!==o.sublabel&&$('<div class="n2_field_number__unit"></div>').text(o.sublabel).appendTo(l);var u=$('<input id="modal-field-'+s+'" name="'+s+'" value="'+h+'" type="text" autocomplete="off">').css("width",r+"px").appendTo(l);return o.unit&&$('<div class="n2_field_number__unit"></div>').text(o.unit).appendTo(l),new c.FormElementNumber("modal-field-"+s,o.min,o.max),u},modalTextarea:function(i,s,n){var h=t.modalFieldWrapper(i,s,n),o=$('<div class="n2_field_textarea"></div>').appendTo(h.$element);return $('<textarea name="'+s+'" autocomplete="off"></textarea>').appendTo(o)},modalTable:function(i,s,n,h){var o=t.modalFieldWrapper(i,s,n);o.$field.addClass("n2_field_table");for(var r=$('<div class="n2_field_table__content"></div>').css("grid-template-columns","repeat("+h[0].length+", auto)").appendTo(o.$element),a=0;a<h.length;a++)for(var c=0;c<h[a].length;c++)$('<div class="n2_field_table__cell">'+h[a][c]+"</div>").appendTo(r);return r},modalSelectList:function(i,s,n,h,o){o=f({mode:"select"},o);var r=t.modalFieldWrapper(i,s,n),a=$('<div class="n2_field_select_list"></div>').appendTo(r.$element);return{getField:function(){return r.$field},addOption:function(t,i,s){$('<div class="n2_field_select_list__option"></div>').on("click",function(t,e){"select"===o.mode&&(r.$field.find(".n2_field_select_list__option--selected").removeClass("n2_field_select_list__option--selected"),$(e.currentTarget).addClass("n2_field_select_list__option--selected")),h(t)}.bind(this,s)).append($('<div class="n2_field_select_list__option_primary"></div>').text(t)).append($('<div class="n2_field_select_list__option_secondary"></div>').text(i)).appendTo(a)},removeOptions:function(){a.html("")}}},modalGeneratorVariableList:function(t,i,s,n,h,o){t.addContent(this.modalHeading(n2_(s)));var r=c.UI.modalFormRow(!0);t.addContent(r);var a,l=c.UI.modalFieldWrapper(r,n,h),u=$('<div class="n2_generator_variables"></div>').appendTo(l.$element),d=[];if(Number.isInteger(i))for(var f=1;f<=i;f++)d[f]=f;else d=i;for(var _ in d){var v=$('<div class="n2_generator_variables__variable"></div>');v.text(_).on("click",function(t){a.removeClass("n2_generator_variables__variable--selected"),this.addClass("n2_generator_variables__variable--selected"),o(t)}.bind(v,_)).appendTo(u)}(a=u.find(".n2_generator_variables__variable")).eq(0).addClass("n2_generator_variables__variable--selected")},modalTabs:function(t,i,s,n){var h=$('<div class="n2_modal_tab"></div>').appendTo(t),o=$('<div class="n2_modal_tab__tabs"></div>').appendTo(h),r=$('<div class="n2_modal_tab__tabs_contents"></div>').appendTo(h),a=!1,c={};function l(t){a&&a!==t&&(c[a].$button.removeClass("n2_modal_tab__tabs_button--active"),c[a].$content.removeClass("n2_modal_tab__tabs_content--active")),c[a=t].$button.addClass("n2_modal_tab__tabs_button--active"),c[a].$content.addClass("n2_modal_tab__tabs_content--active"),n(a)}for(var u in s)c[u]={$button:$('<div class="n2_modal_tab__tabs_button" data-tab="'+u+'">'+s[u]+"</div>").on("click",l.bind(this,u)).appendTo(o),$content:$('<div class="n2_modal_tab__tabs_content" data-tab="'+u+'"></div>').appendTo(r)};return{tabs:c,setActiveTab:l}},modalFieldSelectIcon:function(i,s,n,h,o,r){var a=t.modalFieldWrapper(i,s,n),l=$('<div class="n2_field_select_icon"></div>').appendTo(a.$element);for(var u in h)$('<div class="n2_field_select_icon__option"></div>').attr("data-value",u).toggleClass("n2_field_select_icon__option--selected",u===o).append('<div class="n2_field_select_icon__option_icon"><i class="'+h[u].icon+'"></i></div>').append('<div class="n2_field_select_icon__option_label">'+h[u].label+"</div>").append('<div class="n2_field_select_icon__selected_marker"><i class="ssi_16 ssi_16--check"></i></div>').appendTo(l);var d=$('<input id="modal-field-'+s+'" name="'+s+'" value="'+o+'" type="hidden">').appendTo(a.$element);return new c.FormElementSelectIcon("modal-field-"+s,r),d},modalNotice:function(i,s,n){var h=t.modalFieldWrapper(i,"notice",n2_("Notice"));return $('<div class="n2_field_message n2_field_message--'+n+'"></div>').html(n2_(s)).appendTo(h.$element)}};return t})),c.d("AutocompleteSimple",["$"],(function(){var $=c.$;return function(t,i){var s=$("#"+t);new c.UIAutocomplete(s,{positionTo:".n2_autocomplete_position_to",y:-2,appendTo:function(){return s.closest(".n2_container_scrollable, body")},source:function(){return i},select:function(t,i){$(this).val(i.value).trigger("change")}})}}));const ct={DecToHex:function(t){var i=Math.round(t).toString(16);return 1===i.length?"0"+i:i},HexToDec:function(t){return parseInt(t,16)},HSVtoRGB:function(t,i,s){var n,h,o,r,a,c,l,u;switch(c=s*(1-i),l=s*(1-(a=6*t-(r=Math.floor(6*t)))*i),u=s*(1-(1-a)*i),r%6){case 0:n=s,h=u,o=c;break;case 1:n=l,h=s,o=c;break;case 2:n=c,h=s,o=u;break;case 3:n=c,h=l,o=s;break;case 4:n=u,h=c,o=s;break;case 5:n=s,h=c,o=l}return[Math.round(255*n),Math.round(255*h),Math.round(255*o)]},HSVtoHex6:function(t,i,s){var n=ct.HSVtoRGB(t,i,s);return ct.DecToHex(n[0])+ct.DecToHex(n[1])+ct.DecToHex(n[2])},RGBtoHSV:function(t,i,s){var n=Math.max(t,i,s),h=n-Math.min(t,i,s),o=h&&(n==t?(i-s)/h:n==i?2+(s-t)/h:4+(t-i)/h);return[60*(o<0?o+6:o)/360,n&&h/n,n/255]},Hex6toHSV:function(t){return ct.RGBtoHSV(ct.HexToDec(t.substr(0,2)),ct.HexToDec(t.substr(2,2)),ct.HexToDec(t.substr(4,2)))},Hex8toRGBA:function(t){var i=1;return 8===t.length?i=ct.HexToDec(t.substr(6,2))/255:3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),[ct.HexToDec(t.substr(0,2)),ct.HexToDec(t.substr(2,2)),ct.HexToDec(t.substr(4,2)),i]},Hex8toCssRGBA:function(t){for(var i=ct.Hex8toRGBA(t),s=0;s<i.length;s++)isNaN(i[s])&&(i[s]=0,i[3]=0);return"RGBA("+i.join(",")+")"}};c.d("ColorPicker",(function(){class t{constructor(t){this._i=t,this.mi=["000000","81898d","ced3d5","ffffff","55aa39","5cba3c","27ae60","2ecc71","357cbd","4594e1","01add3","00c1c4","bb4a28","d85935","e79d19","ecc31f","8757b2","9e74c2","e264af","ec87c0","000000CC","00000080","FFFFFFCC","FFFFFF80"],this.bi=[];var i=localStorage.getItem("n2-colors");i&&(this.bi=JSON.parse(i),this.bi.splice(6))}initUI(t){var i=d();L(i,"n2_color_picker__palette"),t.appendChild(i);for(var s=["000000","81898d","ced3d5","ffffff","55aa39","5cba3c","27ae60","2ecc71","357cbd","4594e1","01add3","00c1c4","bb4a28","d85935","e79d19","ecc31f","8757b2","9e74c2","e264af","ec87c0","000000CC","00000080","FFFFFFCC","FFFFFF80"],n=0;n<s.length;n++){var h=d();L(h,"n2_color_picker__palette_item"),L(h,"n2_checker_box"),8===s[n].length&&L(h,"n2_color_picker__palette_item_alpha"),M(h,"--palette-item-color",ct.Hex8toCssRGBA(s[n])),i.appendChild(h);var o=d();L(o,"n2_color_picker__palette_item_color"),h.appendChild(o),V(h,"click",this._i.setColor.bind(this._i,s[n]))}this.gi(t)}gi(t){this.wi=[];var i=d();L(i,"n2_color_picker__palette_history"),t.appendChild(i);for(var s=0;s<6;s++){var n=d();L(n,"n2_color_picker__palette_item"),L(n,"n2_checker_box"),S(n,"color","ffffffff"),M(n,"--palette-item-color","#fff"),i.appendChild(n);var h=d();L(h,"n2_color_picker__palette_item_color"),n.appendChild(h),this.wi.push(n),V(n,"click",function(e){this._i.setColor(x(e.currentTarget,"color"))}.bind(this))}this.ki()}ki(){for(var t=0;t<this.bi.length;t++)S(this.wi[t],"color",this.bi[t]),M(this.wi[t],"--palette-item-color",ct.Hex8toCssRGBA(this.bi[t]))}addHistoryColor(t){if(-1===this.mi.indexOf(t)&&-1===this.bi.indexOf(t)){this.bi.unshift(t),this.bi.splice(6);try{localStorage.setItem("n2-colors",JSON.stringify(this.bi))}catch(t){}this.ki()}}}class n{constructor(t){this._i=t,this.di=[]}initUI(t){this.xi=d(),L(this.xi,"n2_color_picker__picker_canvas"),t.appendChild(this.xi),this.Si=d(),L(this.Si,"n2_color_picker__picker_canvas_dot"),this.xi.appendChild(this.Si),this.xi.addEventListener("pointerdown",this.Ii.bind(this))}Ii(e){this.di.push(W(this._i.area,"pointermove",this.Mi.bind(this))),this.di.push(W(this._i.area,"pointerup",this.Ci.bind(this))),this.di.push(W(this._i.area,"pointerleave",this.Oi.bind(this))),this.Ni(e)}Mi(e){this.Ni(e)}Ci(e){this.Ni(e),this.ji()}Oi(e){this.ji()}ji(){H(this.di)}Ni(e){var t=this.xi.getBoundingClientRect(),i=Math.max(0,Math.min(t.width,e.clientX-t.left)),s=Math.max(0,Math.min(t.height,e.clientY-t.top));this.Si.style.setProperty("transform","translate("+i+"px, "+s+"px)"),this._i.setSaturationValue(i/t.width,1-s/t.height)}updateHue(t){this.xi.style.setProperty("background-color","#"+ct.HSVtoHex6(t,1,1))}sync(){var t=this._i.currentSaturation,i=this._i.currentValue,s=this.xi.getBoundingClientRect();this.Si.style.setProperty("transform","translate("+s.width*t+"px, "+s.height*(1-i)+"px)")}}class h{constructor(t){this._i=t,this.di=[]}initUI(t){this.Ai=d(),L(this.Ai,"n2_color_picker__picker_hue"),t.appendChild(this.Ai),this.Si=d(),L(this.Si,"n2_color_picker__picker_hue_dot"),this.Ai.appendChild(this.Si),this.Ai.addEventListener("pointerdown",this.Ii.bind(this))}Ii(e){this.di.push(W(this._i.area,"pointermove",this.Mi.bind(this))),this.di.push(W(this._i.area,"pointerup",this.Ci.bind(this))),this.di.push(W(this._i.area,"pointerleave",this.Oi.bind(this))),this.Ni(e)}Mi(e){this.Ni(e)}Ci(e){this.Ni(e),this.ji()}Oi(e){this.ji()}ji(){H(this.di)}Ni(e){var t=this.Ai.getBoundingClientRect(),i=Math.max(0,Math.min(t.height,e.clientY-t.top));this.Si.style.setProperty("transform","translateY("+i+"px)"),this._i.setHue(i/t.height)}sync(){var t=this._i.currentHue,i=this.Ai.getBoundingClientRect();this.Si.style.setProperty("transform","translateY("+i.height*t+"px)")}}class o{constructor(t){this._i=t,this.di=[]}initUI(t){var i=d();L(i,"n2_color_picker__picker_opacity"),L(i,"n2_checker_box"),t.appendChild(i),this.$i=d(),L(this.$i,"n2_color_picker__picker_opacity_inner"),i.appendChild(this.$i),this.Si=d(),L(this.Si,"n2_color_picker__picker_opacity_dot"),this.$i.appendChild(this.Si),this.$i.addEventListener("pointerdown",this.Ii.bind(this))}Ii(e){this.di.push(W(this._i.area,"pointermove",this.Mi.bind(this))),this.di.push(W(this._i.area,"pointerup",this.Ci.bind(this))),this.di.push(W(this._i.area,"pointerleave",this.Oi.bind(this))),this.Ni(e)}Mi(e){this.Ni(e)}Ci(e){this.Ni(e),this.ji()}Oi(e){this.ji()}ji(){H(this.di)}Ni(e){var t=this.$i.getBoundingClientRect(),i=Math.max(0,Math.min(t.height,e.clientY-t.top));this.Si.style.setProperty("transform","translateY("+i+"px)"),this._i.setOpacity(1-i/t.height)}update(){var t=this._i.rgb.join(",");this.$i.style.setProperty("background-image","linear-gradient(180deg, RGBA("+t+", 1) 0%, RGBA("+t+", 0) 100%)")}sync(){var t=this._i.currentOpacity,i=this.$i.getBoundingClientRect();this.Si.style.setProperty("transform","translateY("+i.height*(1-t)+"px)")}}return new class{constructor(){this.Ti=0,this.Pi=0,this.Fi=0,this.Li=0,this.di=[],this.zi=new t(this),this.Ei=new n(this),this.Di=new h(this),this.Ri=new o(this)}Ui(){this.Bi||(this.Bi=d(),L(this.Bi,"n2_color_picker"),this.zi.initUI(this.Bi),this.Ei.initUI(this.Bi),this.Di.initUI(this.Bi),this.Ri.initUI(this.Bi),s.body.appendChild(this.Bi))}get area(){return this.Bi}get rgb(){return ct.HSVtoRGB(this.Ti,this.Pi,this.Fi)}get rgba(){var t=ct.HSVtoRGB(this.Ti,this.Pi,this.Fi);return t.push(this.opacity),t}get hex(){return ct.HSVtoHex6(this.Ti,this.Pi,this.Fi)}get hexa(){return ct.HSVtoHex6(this.Ti,this.Pi,this.Fi)+ct.DecToHex(Math.round(255*this.opacity))}get opacity(){return this.Li}get cssRGB(){return"#"+this.hex}get cssRGBA(){return"RGBA("+this.rgba.join(",")+")"}get currentHue(){return this.Ti}get currentSaturation(){return this.Pi}get currentValue(){return this.Fi}get currentOpacity(){return this.Li}updateUI(){this.Ei.updateHue(this.Ti),this.Ri.update()}setHue(t){this.Ti=t,this.updateUI(),this.updateTargetValue()}setSaturationValue(t,i){this.Pi=t,this.Fi=i,this.updateUI(),this.updateTargetValue()}setOpacity(t){this.Li=t,this.updateTargetValue()}show(t,i,n,h,o){if(this.M=t,this.Hi=i,this.Wi=!1,(6!==i.length&&8!==i.length||i.length>0&&"{"===i.charAt(0))&&(i="ffffff"),this.Vi=n,this.Gi=h,this.Ji=o||function(){},this.Ui(),this.Vi?this.oi={width:390,height:184}:this.oi={width:360,height:156},this.Yi(),M(this.Bi,"display",""),this.Bi.classList.toggle("n2_color_picker--has-opacity",this.Vi),8===i.length?(this.Li=ct.HexToDec(i.substr(6,2))/255,i=i.substr(0,6)):this.Li=1,6===i.length){var r=ct.Hex6toHSV(i);this.Ti=r[0],this.Pi=r[1],this.Fi=r[2]}this.Di.sync(),this.Ei.sync(),this.Ri.sync(),this.updateUI(),this.di.push(W(s,"scroll",this.detach.bind(this))),this.di.push(W(s.body,"pointerdown",function(e){this.Bi===e.target||this.Bi.contains(e.target)||this.detach()}.bind(this),{capture:!0}))}detach(){var t=this.Vi?this.hexa:this.hex;this.Wi&&this.Hi!==t&&(this.Gi(t),this.zi.addHistoryColor(t)),M(this.Bi,"display","none"),H(this.di)}Yi(){var t=this.M.getBoundingClientRect(),s=t.top+t.height;s>i.innerHeight-this.oi.height-5&&(s=t.top-this.oi.height-5),C(this.Bi,{left:Math.min(t.left,i.innerWidth-this.oi.width-5)+"px",top:s+"px"})}updateTargetValue(){this.Wi=!0,this.Ji(this.Vi?this.hexa:this.hex)}setColor(t){var i=t;if(8===t.length?(this.Li=ct.HexToDec(t.substr(6,2))/255,i=i.substr(0,6)):this.Li=1,6===i.length){var s=ct.Hex6toHSV(i);this.Ti=s[0],this.Pi=s[1],this.Fi=s[2]}this.Di.sync(),this.Ei.sync(),this.Ri.sync(),this.updateUI(),this.updateTargetValue(),this.detach()}}})),c.d("Notification",["$"],(function(){var $=c.$;function t(){this.deferred=$.Deferred(),c.r("documentReady",this.ready.bind(this))}return t.prototype.ready=function(){this.$container=$('<div class="n2_notification_center n2_admin_ui"></div>').appendTo("body"),this.deferred.resolve()},t.prototype.error=function(t,i){i=f({wide:!1,heading:n2_("Oops, Something Went Wrong")},i);var s=new c.ModalSimple("notification error",{width:i.wide?1e3:440});s.addContent(c.UI.modalIcon("ssi_48 ssi_48--error","red")),s.addContent(c.UI.modalHeading(i.heading)),s.addContent(c.UI.modalParagraphHTML(t));var n=c.UI.modalButton(n2_("Got it"),"red");s.addButton(n),n.on("click",(function(e){e.preventDefault(),s.hide(e)})),s.show()},t.prototype.success=function(t){this.message("success",n2_("Success"),t,{timeout:3})},t.prototype.notice=function(t){this.message("notice",n2_("Notice"),t)},t.prototype.message=function(t,i,s,n){n=f({timeout:0},n);var h=$('<div class="n2_notification_center__message n2_notification_center__message--'+t+'"></div>').scrollTop(0).prependTo(this.$container);$('<div class="n2_notification_center__message_icon"><i class="ssi_24"></i></div>').appendTo(h);var o=$('<div class="n2_notification_center__message_content"></div>').appendTo(h);$('<div class="n2_notification_center__message_content_label">'+i+"</div>").appendTo(o),$('<div class="n2_notification_center__message_content_description">'+s+"</div>").appendTo(o),n.timeout?(h.one("mouseenter",(function(){h.remove()})),r((function(){h.remove()}),1e3*n.timeout)):$('<div class="n2_notification_center__message_action"></div>').text(n2_("Got it")).on("click",(function(){h.remove()})).appendTo(h),r(function(t){t.addClass("n2_notification_center__message--animate")}.bind(this,h),100)},new t})),c.d("Form",["$"],(function(){var $=c.$;function t(){this.skipChangeConfirm=!1,this.onChangeCallback=this.onChange.bind(this),s.formvalidator!==o&&(s.formvalidator.isValid=function(){return!0})}return t.prototype.setID=function(t){this.$form=$(t).data("form",this)},t.prototype.onReady=function(){this.window=$("#n2-admin")[0],this.initButtons(),this.resetChangeTracker(),this.registerBeforeUnload(),s.addEventListener("keydown",this.onKeyDown.bind(this),{capture:!0})},t.prototype.initButtons=function(){},t.prototype.resetChangeTracker=function(){this.hasChange=!1,this.window.addEventListener("nextendChange",this.onChangeCallback,{passive:!0,capture:!0}),this.window.addEventListener("change",this.onChangeCallback,{passive:!0,capture:!0}),this.$saveButton.addClass("n2_button--inactive")},t.prototype.onChange=function(){this.hasChange=!0,this.$saveButton.removeClass("n2_button--inactive"),this.window.removeEventListener("nextendChange",this.onChangeCallback,{passive:!0,capture:!0}),this.window.removeEventListener("change",this.onChangeCallback,{passive:!0,capture:!0})},t.prototype.onKeyDown=function(e){if(!e.defaultPrevented){var t=!1;e.ctrlKey||e.metaKey?83===e.keyCode&&(this.actionSave(),t=!0):27===e.keyCode&&("INPUT"!==e.target.tagName&&"textarea"!==e.target.tagName||(e.target.blur(),t=!0)),t&&e.preventDefault()}},t.prototype.isChanged=function(){return this.hasChange},t.prototype.registerBeforeUnload=function(){i.addEventListener("beforeunload",this.actionUnload.bind(this))},t.prototype.actionUnload=function(e){if(!this.skipChangeConfirm&&this.isChanged()){var t=n2_("The changes you made will be lost if you navigate away from this page.");return e.returnValue=t,t}},t.prototype.actionSave=function(){},t.prototype.afterSave=function(){this.resetChangeTracker()},t})),c.d("FormElement",(function(){function t(){this.connectedField=null,this.element.data("field",this)}return t.prototype.triggerOutsideChange=function(){this.element[0].dispatchEvent(new CustomEvent("outsideChange",{cancelable:!1,bubbles:!0,detail:{field:this}})),this.element[0].dispatchEvent(new CustomEvent("nextendChange",{cancelable:!1,bubbles:!0,detail:{field:this}}))},t.prototype.triggerInsideChange=function(){this.element[0].dispatchEvent(new CustomEvent("insideChange",{cancelable:!1,bubbles:!0,detail:{field:this}})),this.element[0].dispatchEvent(new CustomEvent("nextendChange",{cancelable:!1,bubbles:!0,detail:{field:this}}))},t.prototype.focus=function(t){this.connectedField&&this.connectedField.focus(t)},t})),c.d("FormElementAutocomplete",["$","FormElementText"],(function(){var $=c.$;function t(t,i){this.tags=i,c.FormElementText.prototype.constructor.call(this,t),this.parent.find(".n2_field_text__clear").on("click",this.clear.bind(this)),new c.UIAutocomplete(this.element,{positionTo:".n2_field_autocomplete",y:-2,appendTo:function(){return this.element.closest(".n2_container_scrollable, body")}.bind(this),source:function(){return this.tags}.bind(this),select:function(t,i){var s=this.value.split(/,/);s.pop(),s.push(i.value),s.push(""),this.value=s.join(","),$(this).trigger("change")}})}return t.prototype=Object.create(c.FormElementText.prototype),t.prototype.constructor=t,t.prototype.clear=function(e){e.preventDefault(),this.element.val(""),this.change()},t})),c.d("BasicCSSFont",["$","BasicCSSSkeleton"],(function(){var $=c.$;function t(){this._singular="font",this._prular="fonts",c.BasicCSSSkeleton.prototype.constructor.apply(this,arguments),this.form={afont:$("#layer-font-family"),color:$("#layer-font-color"),size:$("#layer-font-size"),weight:$("#layer-font-weight"),lineheight:$("#layer-font-lineheight"),align:$("#layer-font-textalign"),underline:$("#layer-font-decoration"),italic:$("#layer-font-decoration"),letterspacing:$("#layer-font-letterspacing"),wordspacing:$("#layer-font-wordspacing"),texttransform:$("#layer-font-texttransform"),tshadow:$("#layer-font-tshadow"),extra:$("#layer-font-extracss")},this.loaded()}return t.prototype=Object.create(c.BasicCSSSkeleton.prototype),t.prototype.constructor=t,t.prototype.activateVisual=function(t){this.activeVisual=t,this.setValue(c.CSSRendererFont.transformData(this.visuals[t].value,this.visuals[t].mode)),this.setStates(c.CSSRendererFont.rendererModes[this.visuals[t].mode].tabs),c.BasicCSSSkeleton.prototype.activateVisual.call(this,t)},t.prototype.setValue=function(t){this.value=c.CSSRendererFont.fixBold(t)},t.prototype._transformsize=function(t){return t.split("||").join("|*|")},t.prototype._setsize=function(t,i){t.size=i.replace("|*|","||")},t.prototype._transformweight=function(t){return parseInt(t)},t.prototype._setweight=function(t,i){t.weight=parseInt(i)},t.prototype._transformunderline=function(t){return[1==this.value[this.activeState].italic?"italic":"",1==t?"underline":""].join("||")},t.prototype._setunderline=function(t,i){var s=i.split("||");t.underline="underline"===s[1]?1:0},t.prototype._transformitalic=function(t){return[1==t?"italic":"",1==this.value[this.activeState].underline?"underline":""].join("||")},t.prototype._setitalic=function(t,i){var s=i.split("||");t.italic="italic"===s[0]?1:0},t})),c.d("BasicCSSSkeleton",["$"],(function(){var $=c.$;function t(t){this.hasVisuals=!1,this.isInsideChange=!1,this.isReload=!1,this.manager=t,this.$container=t.$container.find('.n2_fields_layer_window[data-field="fieldset-layer-window-basiccss-'+this._singular+'"]'),this.$relatedContainers=t.$container.find('.n2_fields_layer_window[data-parent-design="fieldset-layer-window-basiccss-'+this._singular+'"]'),this.$containers=this.$container.add(this.$relatedContainers).attr("data-state","0"),this.elementField=$("#layerbasiccss-"+this._singular+"-element").data("field"),this.elementField.element.on("nextendChange",function(){this.activateVisual(this.elementField.element.val()),this.activateState(0)}.bind(this)),this.stateField=$("#layerbasiccss-"+this._singular+"-state").data("field"),this.stateField.element.on("nextendChange",function(){this.activateState(this.stateField.element.val())}.bind(this)),this.relatedElementFields=[],this.relatedStateFields=[],this.$relatedContainers.each(function(t,i){var s=$(i),n=s.find("#layerbasiccss-"+s.data("singular")+"-element").data("field"),h=s.find("#layerbasiccss-"+s.data("singular")+"-state").data("field");n.element.on("outsideChange",function(t){this.elementField.insideChange(t.val())}.bind(this,n.element)),h.element.on("outsideChange",function(t){this.stateField.insideChange(t.val())}.bind(this,h.element)),this.relatedElementFields.push(n),this.relatedStateFields.push(h)}.bind(this)),this.$containers.find('.n2_form__table_label_field[data-design-feature="reset-to-normal"] a').on("click",function(e){e.preventDefault(),this.value[this.activeState]={},this._lazySave(e),this.activateState(this.activeState)}.bind(this)),this.activeVisual=0,this.activeState=0}return t.prototype.loaded=function(){for(var t in this.form)this.form[t].on({nextendChange:this.changeValue.bind(this,t)})},t.prototype.changeValue=function(t,e){this.isReload||("function"==typeof this["_set"+t]?this["_set"+t](this.value[this.activeState],this.form[t].val()):this.value[this.activeState][t]=this.form[t].val(),this._lazySave(e))},t.prototype._lazySave=NextendDeBounce((function(e){this.isInsideChange=!0;var t=this.getData();this.visuals[this.activeVisual].field.save(e,t),this.visuals[this.activeVisual].value=t,this.isInsideChange=!1}),50),t.prototype.save=function(t){for(var i in this.isInsideChange=!0,t)this.visualsByName[i].field.save({},t[i]),this.visualsByName[i].value=t[i];this.isInsideChange=!1},t.prototype.getData=function(){return JSON.stringify({data:this.value})},t.prototype.load=function(t,i){if(this.hasVisuals=i.length>0,this.$containers.attr("data-elements",i.length),this.hasVisuals){var s={};this.visuals=[],this.visualsByName={};for(var n=0;n<i.length;n++){var h=i[n];this.visualsByName[h.name]={value:t[h.name],mode:h.mode,field:h.field},h.field.element.off(".basiccss").on("outsideChange.basiccss",this.loadSingleValue.bind(this,n,h.name)),this.visuals.push(this.visualsByName[h.name]),s[n]=h.field.getLabel()}this.elementField.setOptions(s);for(n=0;n<this.relatedElementFields.length;n++)this.relatedElementFields[n].setOptions(s);this.activateVisual(0),this.activateState(0)}},t.prototype.loadSingleValue=function(t){this.isInsideChange||(this.visuals[t].value=this.visuals[t].field.element.val(),this.activeVisual==t&&(this.activateVisual(t),this.activateState(this.activeState)))},t.prototype.activateVisual=function(t){for(var i=0;i<this.relatedElementFields.length;i++)parseInt(this.relatedElementFields[i].element.val())!==t&&this.relatedElementFields[i].insideChange(t)},t.prototype.setValue=function(t){this.value=t},t.prototype.setStates=function(t){for(var i={},s=0;s<t.length;s++)i[s]=t[s];this.stateField.setOptions(i);for(s=0;s<this.relatedStateFields.length;s++)this.relatedStateFields[s].setOptions(i)},t.prototype.activateState=function(t){var i;for(var s in t=Math.max(0,parseInt(t)),this.isReload=!0,this.activeState=t,this.$containers.attr("data-state",t),i=0===t?this.value[0]:f({},this.value[0],this.value[t]))this.form[s]!==o&&("function"==typeof this["_transform"+s]?this.form[s].data("field").insideChange(this["_transform"+s](i[s])):this.form[s].data("field").insideChange(i[s]));for(var n=0;n<this.relatedStateFields.length;n++)parseInt(this.relatedStateFields[n].element.val())!==t&&this.relatedStateFields[n].insideChange(t);this.isReload=!1},t.prototype.serialize=function(){if(this.hasVisuals){var t={};for(var i in this.visualsByName)t[i]=this.visualsByName[i].value;return t}return{}},t.prototype.unSerialize=function(t){for(var i in t)t.hasOwnProperty(i)&&(this.visualsByName[i].field.save({},t[i]),this.visualsByName[i].value=t[i])},t})),c.d("BasicCSSStyle",["$","BasicCSSSkeleton"],(function(){var $=c.$;function t(){this._singular="style",this._prular="styles",c.BasicCSSSkeleton.prototype.constructor.apply(this,arguments),this.form={backgroundcolor:$("#layer-style-backgroundcolor"),opacity:$("#layer-style-opacity"),padding:$("#layer-style-padding"),border:$("#layer-style-border"),borderradius:$("#layer-style-borderradius"),boxshadow:$("#layer-style-boxshadow"),extra:$("#layer-style-extracss")},this.loaded()}return t.prototype=Object.create(c.BasicCSSSkeleton.prototype),t.prototype.constructor=t,t.prototype.activateVisual=function(t){this.activeVisual=t,this.setValue(c.CSSRendererStyle.transformData(this.visuals[t].value,this.visuals[t].mode)),this.setStates(c.CSSRendererStyle.rendererModes[this.visuals[t].mode].tabs),c.BasicCSSSkeleton.prototype.activateVisual.call(this,t)},t})),c.d("BasicCSS",["$"],(function(){var $=c.$;function t(t,i){this.inPresetList=!1,this.$container=$("#"+t),this.options=f({ajaxUrl:""},i),this.throttleSetTimeout=null,this.throttleExitTimeout=null,this.storage={},this.assets={font:new c.BasicCSSFont(this),style:new c.BasicCSSStyle(this)},this.$preset=$('<div class="n2_layer_window_design_preset"><div class="n2_layer_window_design_preset__label_container"><div class="n2_layer_window_design_preset__label">'+n2_("Preset")+'</div><i class="ssi_16 ssi_16--info" data-tip-description="'+n2_("You can use presets to save style settings for later use. Clicking on any preset will load its styling to your current layer, and the previous style settings will be lost.")+'" data-tip-label="'+n2_("Preset")+'"></i></div></div>').prependTo(this.$container),this.$notice=$('<div class="n2_layer_window_notice n2_layer_window_notice__device_icon"><div class="n2_field" data-field="layerslide-background-notice-image"><div class="n2_field__label"><label for="layerslide-background-notice-image">Note</label></div><div class="n2_field__element"><div class="n2_field_message n2_field_message--warning">'+n2_("Layer design options affect every device. If you need to make responsive adjustments, look for the options with the device icon.")+"</div></div></div></div>").prependTo(this.$container);var s=$('<div class="n2_layer_window_design_preset__fields"></div>').appendTo(this.$preset),n=$('<div class="n2_layer_window_design_preset__fields_secondary"></div>').appendTo(s);$('<a class="n2_layer_window_design_preset__button_secondary" href="#" data-n2tip="'+n2_("Reset style to default")+'"><i class="ssi_16 ssi_16--reset"></i></a>').on("click",function(e){e.preventDefault(),this.exitPresetList(this.defs,e)}.bind(this)).appendTo(n),$('<a class="n2_layer_window_design_preset__button_secondary" href="#" data-n2tip="'+n2_("Save style as new preset")+'"><i class="ssi_16 ssi_16--save"></i></a>').on("click",function(e){e.preventDefault(),this.saveAsNew()}.bind(this)).appendTo(n),this.$presets=$('<div class="n2_layer_window_design_preset__presets"></div>').insertAfter(this.$preset),$('<a class="n2_layer_window_design_preset__button_choose" data-n2tip="'+n2_("Load style")+'" href="#"><i class="ssi_16 ssi_16--plus"></i></a>').on("click",function(e){e.preventDefault(),this.showList()}.bind(this)).appendTo(s),$('<a class="n2_layer_window_design_preset__button_back" href="#"><i class="ssi_16 ssi_16--remove"></i></a>').on("click",function(e){e.preventDefault(),this.exitPresetList(!1,e)}.bind(this)).appendTo(s),c._basicCSS=this}return t.prototype.showList=function(){this.inPresetList=!0,this.lastState=this.serialize(),this.$presets.on("mouseleave",function(){this.throttledUnSerialize(this.lastState)}.bind(this)),$.when(this.loadType()).done(function(t){0===this.storage[this.type].data("presets")?(c.Notification.notice(n2_("You have not created any presets for this layer yet.")),this.deActivate()):(this.$presets.append(this.storage[this.type]),$(".n2_ss_layer_window").addClass("n2_ss_layer_window--show-presets"),$(".n2_ss_layer_window__tab_container").scrollTop(0))}.bind(this))},t.prototype.activate=function(t,i,s){this.inPresetList&&this.exitPresetList(!1),this.type&&this.type!==t&&this.storage[this.type]!==o&&this.storage[this.type].detach();var n=!1;for(var h in this.defs={font:[],style:[]},this.type=t,this.assets){for(var r=0;r<s[h].length;r++)this.defs[h][s[h][r].name]=s[h][r].def;this.assets[h].load(i,s[h]),n=n||this.assets[h].hasVisuals}this.$container.toggleClass("n2_ss_design_layer_window_design--visible",n)},t.prototype.deActivate=function(){this.inPresetList&&this.exitPresetList(!1)},t.prototype.serialize=function(){var t={};for(var i in this.assets)t[i]=this.assets[i].serialize();return t},t.prototype.unSerialize=function(t){this.assets.font.unSerialize(t.font),this.assets.style.unSerialize(t.style)},t.prototype.throttledUnSerialize=function(t){this._addThrottledRenderTimeout(this.unSerialize.bind(this,t))},t.prototype.saveAsNew=function(t){var i=new c.ModalSimple("section-save-as",{destroyOnHide:!1,width:440});i.addContent(c.UI.modalIcon("ssi_48 ssi_48--plus","green")),i.addContent(c.UI.modalHeading(n2_("Save as")));var s=c.UI.modalFormRow(!0);i.addContent(s);var n=c.UI.modalFieldText(s,"name",n2_("Name"),""),h=c.UI.modalButton(n2_("Save as"),"green");i.addButton(h),h.on("click",function(e){e.preventDefault();var t=n.val();""===t?c.Notification.error(n2_("Please fill the name field!")):c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.options.ajaxUrl,{nextendaction:"addVisual"}),data:{type:this.type,value:c.Base64.encode(JSON.stringify({name:t,data:this.serialize()}))},dataType:"json"}).done(function(t){$.when(this.loadType()).done(function(){this.addVisual(t.data.visual).prependTo(this.storage[this.type])}.bind(this)),i.hide(e),c.Notification.success(n2_("Preset saved."))}.bind(this))}.bind(this)),i.show()},t.prototype.loadType=function(){if(this.storage[this.type]===o){var t=$.Deferred(),s=function(i){this.storage[this.type]=$('<div class="n2_layer_window_design_preset__presets_list"></div>').data("presets",0);for(var s=0;s<i.length;s++)this.addVisual(i[s]);t.resolve()}.bind(this);i[this.type]===o?(this.storage[this.type]=t,c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.options.ajaxUrl,{nextendaction:"loadVisuals"}),data:{type:this.type},dataType:"json"}).done(function(t){s(t.data.visuals)}.bind(this))):s(i[this.type])}return this.storage[this.type]},t.prototype.addVisual=function(t){var i=t.value;"{"!==i[0]&&(i=c.Base64.decode(i));var s=JSON.parse(i),n=$('<div class="n2_layer_window_design_preset__preset_list_preset"><span>'+s.name+"</span></div>").on({mouseenter:function(t,e){this.throttledUnSerialize(t.data)}.bind(this,s),click:function(t,e){e.preventDefault(),this.exitPresetList(t,e)}.bind(this,s.data)}).appendTo(this.storage[this.type]);if(this.storage[this.type].data("presets",this.storage[this.type].data("presets")+1),t.id>1e4){var h=$('<div class="n2_layer_window_design_preset__preset_list_preset_buttons"></div>').appendTo(n);$('<div class="n2_layer_window_design_preset__preset_list_preset_button" data-n2tip="'+n2_("Overwrite preset")+'"><i class="ssi_16 ssi_16--save"></i></div>').on("click",function(t,i,e){e.stopPropagation(),c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.options.ajaxUrl,{nextendaction:"changeVisual"}),data:{visualId:t,value:c.Base64.encode(JSON.stringify({name:i,data:this.lastState})),type:this.type},dataType:"json"}).done(function(t){n.replaceWith(this.addVisual(t.data.visual)),this.storage[this.type].data("presets",this.storage[this.type].data("presets")-1),c.Notification.success(n2_("Preset saved."))}.bind(this))}.bind(this,t.id,s.name)).appendTo(h),$('<div class="n2_layer_window_design_preset__preset_list_preset_button"><i class="ssi_16 ssi_16--delete"></i></div>').on("click",function(t,e){e.preventDefault(),e.stopPropagation(),c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.options.ajaxUrl,{nextendaction:"deleteVisual"}),data:{visualId:t,type:this.type},dataType:"json"}).done(function(t){n.remove(),this.storage[this.type].data("presets",this.storage[this.type].data("presets")-1),c.Notification.success(n2_("Preset deleted."))}.bind(this))}.bind(this,t.id)).appendTo(h),c._tooltip.add(h)}return n},t.prototype.exitPresetList=function(t,e){this.throttleSetTimeout&&a(this.throttleSetTimeout),this.$presets.off("mouseleave"),t?(this.inPresetList=!1,this.unSerialize(t)):this.unSerialize(this.lastState),$(".n2_ss_layer_window").removeClass("n2_ss_layer_window--show-presets"),$(".n2_ss_layer_window__tab_container").scrollTop(0),this.inPresetList=!1},t.prototype._addThrottledRenderTimeout=function(t){this.throttleSetTimeout&&a(this.throttleSetTimeout),this.throttleSetTimeout=r(t,100)},t.prototype._addThrottledExitTimeout=function(t){this.throttleExitTimeout&&a(this.throttleExitTimeout),this.throttleExitTimeout=r(t,100)},t})),c.d("FormElementBreakpoint",["$"],(function(){var $=c.$;function t(t,i){this.$container=$("#"+t).find(".n2_field_breakpoint__breakpoint_container"),this.options=f({orientation:"",devices:[],fields:{},enables:!1,global:!1},i),this.hasEnables=!!this.options.enables,this.useGlobal=!1,this.$container.toggleClass("n2_field_breakpoint--with-enables",this.hasEnables),this.$orientationField=$("#"+this.options.orientation).on("nextendChange",this.onOrientationChanged.bind(this)),this.breakpoints={},$('<div class="n2_field_breakpoint__breakpoint_start"><div class="n2_field_breakpoint__breakpoint_label_container"><div class="n2_field_breakpoint__breakpoint_label">0</div></div></div>').prependTo(this.$container),this.$devices=this.$container.find(".n2_field_breakpoint__device"),this.options.global&&(this.$useGlobalField=$("#"+this.options.global.field).on("nextendChange",this.syncUseGlobal.bind(this)),this.useGlobal="1"===this.$useGlobalField.val(),this.syncUseGlobal());for(var s=!1,n=!1,h=0;h<this.$devices.length;h++){var r=this.createBreakpoint(this.$devices.eq(h),s);r!==o?(n?r.$breakpoint.insertBefore(r.$device):r.$breakpoint.insertAfter(r.$device),s=r):n=!0}this.options.global&&this.syncUseGlobal(),$('<div class="n2_field_breakpoint__breakpoint_end"><div class="n2_field_breakpoint__breakpoint_label_container"><div class="n2_field_breakpoint__breakpoint_label">∞</div></div></div>').appendTo(this.$container)}function i(t,i,s,n){this.parentField=t,this.prev=n,n&&n.setNext(this),this.next=!1,this.disableEdit=!1,this.orientation="portrait",this.device=i,this.$device=s,this.$breakpoint=$('<div class="n2_field_breakpoint__breakpoint" data-id="'+i+'"><div class="n2_field_breakpoint__breakpoint_divider"></div></div>'),this.$fieldPortrait=$("#"+t.options.fields[i+"-portrait"]),this.$fieldLandscape=$("#"+t.options.fields[i+"-landscape"]),this.$labelContainer=$('<div class="n2_field_breakpoint__breakpoint_label_container"></div>').appendTo(this.$breakpoint),$('<div class="n2_field_breakpoint__breakpoint_label_rename"><i class="ssi_16 ssi_16--rename"></i></div>').on("click",this.edit.bind(this)).appendTo(this.$labelContainer),this.$labelPortrait=$('<div class="n2_field_breakpoint__breakpoint_label" data-orientation="portrait"></div>').text(this.$fieldPortrait.val()).appendTo(this.$labelContainer),this.$labelLandscape=$('<div class="n2_field_breakpoint__breakpoint_label" data-orientation="landscape"></div>').text(this.$fieldLandscape.val()).appendTo(this.$labelContainer),t.hasEnables&&t.options.enables[i]&&(this.$enableField=$("#"+t.options.enables[i]),this.enableField=this.$enableField.data("field"),this.isEnabled=1===parseInt(this.$enableField.val()),this.syncEnabledClass(),this.$device.append('<div class="n2_field_breakpoint__device_disable"><i class="ssi_16 ssi_16--remove"></i></div>'),this.$device.on("click",this.toggleEnable.bind(this)))}return t.prototype.syncUseGlobal=function(){for(var t in this.useGlobal="1"===this.$useGlobalField.val(),this.breakpoints)this.breakpoints[t].syncUseGlobal(this.useGlobal)},t.prototype.createBreakpoint=function(t,s){var n=t.data("id");return"desktopportrait"!==n?(this.breakpoints[n]=new i(this,n,t,s),this.breakpoints[n]):o},t.prototype.onOrientationChanged=function(){var t=this.$orientationField.val();for(var i in this.breakpoints)this.breakpoints[i].setOrientation(t);this.$container.attr("data-orientation",t)},i.prototype.setOrientation=function(t){this.orientation=t},i.prototype.setNext=function(t){this.next=t},i.prototype.getValue=function(){return parseInt(this.$fieldPortrait.val())},i.prototype.syncUseGlobal=function(t){t?(this.disableEdit=!0,this.$labelPortrait.text(this.parentField.options.global.values[this.device+"-portrait"]),this.$labelLandscape.text(this.parentField.options.global.values[this.device+"-landscape"])):(this.disableEdit=!1,this.$labelPortrait.text(this.$fieldPortrait.val()),this.$labelLandscape.text(this.$fieldLandscape.val())),this.$labelContainer.toggleClass("n2_field_breakpoint__breakpoint_label_container--disable-edit",this.disableEdit)},i.prototype.toggleEnable=function(e){e.preventDefault(),this.isEnabled=!this.isEnabled,this.enableField.insideChange(this.isEnabled?1:0),this.syncEnabledClass()},i.prototype.syncEnabledClass=function(){this.$device.toggleClass("n2_field_breakpoint__device--enabled",this.isEnabled),this.$breakpoint.toggleClass("n2_field_breakpoint__breakpoint--enabled",this.isEnabled),$("body").attr("data-"+this.device,this.isEnabled?1:0)},i.prototype.edit=function(e){var t="portrait"===this.orientation?this.$labelPortrait:this.$labelLandscape,i="portrait"===this.orientation?this.$fieldPortrait:this.$fieldLandscape;this.disableEdit||"true"===t[0].contentEditable||(e.preventDefault(),new c.InlineTextEditor(t[0],{filter:this.onFilter.bind(this),onSave:this.onSave.bind(this,i,t),onCancel:this.onCancel.bind(this,i,t)}))},i.prototype.onFilter=function(t){return t.replace(/[^0-9]/gi,"").replace(/^[0]+/gi,"").substr(0,4)},i.prototype.onSave=function(t,i,s){(s=parseInt(s))?(s=Math.max(100,Math.min(99999,parseInt(s))),t.val(s).trigger("change"),i.text(s)):this.onCancel(t,i)},i.prototype.onCancel=function(t,i){i.text(parseInt(t.val()))},t})),c.d("FormElementButtonMoreLess",["$"],(function(){var $=c.$;function t(t,i){if(this.$button=$("#"+t).on("click",this.switchState.bind(this)),this.options=f({labelMore:"",labelLess:"",relatedFields:[]},i),this.shownMore=!1,this.relatedFields=$(""),i.relatedFields!==o&&i.relatedFields.length)for(var s=0;s<i.relatedFields.length;s++)this.relatedFields=this.relatedFields.add($('[data-field="'+i.relatedFields[s]+'"]'));this.syncState()}return t.prototype.switchState=function(e){e.preventDefault(),this.shownMore=!this.shownMore,this.shownMore?this.$button.text(this.options.labelLess):this.$button.text(this.options.labelMore),this.syncState()},t.prototype.syncState=function(){this.relatedFields.toggleClass("n2_form_element--hidden",!this.shownMore)},t})),c.d("FormElementCheckboxOnOff",["$","FormElement"],(function(){var $=c.$;function t(t,i){if(this.separator="||",this.element=$("#"+t),this.$parent=this.element.parent(),this.options=f({invert:!1},i),this.relatedFields=$(""),i.relatedFields!==o&&i.relatedFields.length){for(var s=0;s<i.relatedFields.length;s++)this.relatedFields=this.relatedFields.add($('[data-field="'+i.relatedFields[s]+'"]'));this.setValue(parseInt(this.element.val())?1:0)}c.FormElement.prototype.constructor.call(this),this.$parent.on("click",this.switchCheckbox.bind(this))}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.switchCheckbox=function(){this.setValue(parseInt(this.element.val())?0:1),this.triggerOutsideChange()},t.prototype.setValue=function(t){this.element.val(t);var i=!1;this.options.invert||1!==t?this.options.invert&&1!==t&&(i=!0):i=!0,this.$parent.toggleClass("n2_field_checkbox_onoff--active",i),this.relatedFields.toggleClass("n2_form_element--hidden",this.options.invert?i:!i)},t.prototype.insideChange=function(t){this.setValue(parseInt(t)?1:0),this.triggerInsideChange()},t})),c.d("FormElementColor",["$","FormElement"],(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.elementInner=this.element[0].parentNode.querySelector(".n2-field-color-preview-inner"),this.elementInnerSMW=c.MW.R(this.elementInner),this.alpha=1===i,this.element.on("change",this.onChange.bind(this)),this.text=this.element.data("field"),c.FormElement.prototype.constructor.call(this),this.syncUI(),V(this.elementInner,"click",this.showColorPicker.bind(this))}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.syncUI=function(){this.elementInnerSMW.background=ct.Hex8toCssRGBA(this.element.val())},t.prototype.showColorPicker=function(){c.ColorPicker.show(this.element[0].parentNode,this.element.val(),this.alpha,this.notifySaveCallback.bind(this),this.notifyChangeCallback.bind(this))},t.prototype.notifyChangeCallback=function(t){this.element.val(t),this.triggerOutsideChange(),this.syncUI()},t.prototype.notifySaveCallback=function(t){this.element.val(t),this.element.trigger("change")},t.prototype.onChange=function(e){var t=this.element.val(),i=t;if(0===t.length)t=this.alpha?"00000000":"000000";else{var s=/rgb\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)/i.exec(t);if(s&&(t=ct.DecToHex(s[1])+ct.DecToHex(s[2])+ct.DecToHex(s[3])),this.alpha){var n=/rgba\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3}), ?([0-9.]+)\)/i.exec(t);if(n){var h=+n[4];isNaN(h)&&(h=1),t=ct.DecToHex(n[1])+ct.DecToHex(n[2])+ct.DecToHex(n[3])+ct.DecToHex(Math.floor(255*h))}}"#"===t.charAt(0)&&(t=t.substr(1)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length&&this.alpha&&(t+="ff")}i!==t&&this.element.val(t),this.triggerInsideChange(),this.triggerOutsideChange(),this.syncUI(),e&&e.stopImmediatePropagation()},t.prototype.insideChange=function(t){this.element.val(t),this.triggerInsideChange(),this.syncUI()},t})),c.d("FormElementDecoration",["$","FormElement"],(function(){var $=c.$;function t(t,i){this.separator="||",this.element=$("#"+t),this.values=i,this.checkboxes=this.element.parent().find(".n2_field_decoration__option"),this.states=this.element.val().split(this.separator);for(var s=0;s<this.checkboxes.length;s++)this.states[s]!==o&&this.states[s]===this.values[s]||(this.states[s]=""),this.checkboxes.eq(s).on("click",this.switchCheckbox.bind(this,s));c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.switchCheckbox=function(t){this.states[t]===this.values[t]?(this.states[t]="",this.setSelected(t,0)):(this.states[t]=this.values[t],this.setSelected(t,1)),this.element.val(this.states.join(this.separator)),this.triggerOutsideChange()},t.prototype.insideChange=function(t){for(var i=t.split(this.separator),s=0;s<this.checkboxes.length;s++)i[s]===o||i[s]!==this.values[s]?(this.states[s]="",this.setSelected(s,0)):(this.states[s]=this.values[s],this.setSelected(s,1));this.element.val(this.states.join(this.separator)),this.triggerInsideChange()},t.prototype.setSelected=function(t,i){this.checkboxes.eq(t).toggleClass("n2_field_decoration__option--selected",1===i)},t})),c.d("FormElementDevice",["FormElementOnoff"],(function(){function t(t){c.FormElementOnoff.prototype.constructor.call(this,t,{values:{0:1,1:0}})}return t.prototype=Object.create(c.FormElementOnoff.prototype),t.prototype.constructor=t,t.prototype.detach=function(){this.onoff.detach()},t.prototype.syncOff=function(){this.onoff.removeClass("n2_field_radio__option--selected")},t.prototype.syncOn=function(){this.onoff.addClass("n2_field_radio__option--selected")},t})),c.d("FormElementDevices",["$","FormElementDevice"],(function(){var $=c.$;function t(t,i){this.$el=$("#"+t).data("field",this),this.fields={};for(var s=0;s<i.length;s++)this.fields[i[s]]=new c.FormElementDevice(t+"-"+i[s])}return t.prototype.setAvailableDevices=function(t){for(var i in t){var s=this.fields[i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()];!t[i]&&s&&s.detach()}this.$el.children().first().addClass("n2-first"),this.$el.children().last().addClass("n2-last")},t})),c.d("FormElementFolders",["FormElementText"],(function(){function t(t,i){c.FormElementText.prototype.constructor.call(this,t),this.parameters=i,this.parent.find(".n2_field_text__clear").on("click",this.clear.bind(this)),this.parent.find(".n2_field_text__choose").on("click",this.show.bind(this)),c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElementText.prototype),t.prototype.constructor=t,t.prototype.clear=function(e){e.preventDefault(),this.val("")},t.prototype.val=function(t){this.element.val(t),this.change()},t.prototype.show=function(e){e.preventDefault(),this.modal=new c.ModalLightbox(n2_("Choose folder"),"filesystem"),this.modal.addContent(c._browse.getNode("folder"));var t=c.UI.modalButton(n2_("Select"),"green").on("click",function(e){e.preventDefault(),this.modal.hide(e),this.val(c._browse.getCurrentFolder())}.bind(this));this.modal.addButton(t),this.modal.show()},t})),c.d("FormElementFontHidden",["$","FormElement"],(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.parameters=f({mode:"",label:""},i),c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return this.parameters.label},t.prototype.save=function(e,t){this.val(t)},t.prototype.val=function(t){this.element.val(t),this.triggerOutsideChange()},t.prototype.insideChange=function(t){this.element.val(t),this.triggerInsideChange()},t.prototype.renderFont=function(){return c.CSSRendererFont.addCSS("",c.CSSRendererFont.getClass(),this.element.val(),c.CSSRendererFont.rendererModes[this.parameters.mode])},t})),c.d("FormElementFont",["$","FormElement"],(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.parent=this.element.parent(),this.parameters=f({mode:"",label:"",style:"",style2:"",preview:""},i),c.FormElement.prototype.constructor.call(this),this.parent.on("click",this.show.bind(this))}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return this.parameters.label},t.prototype.show=function(e){e.preventDefault(),""!==this.parameters.style&&c._fontManager.setConnectedStyle(this.parameters.style),""!==this.parameters.style2&&c._fontManager.setConnectedStyle2(this.parameters.style2),c._fontManager.setFieldID(this.element.attr("id")),c._fontManager.show(this.element.val(),this.save.bind(this),{previewMode:this.parameters.mode,previewHTML:this.parameters.preview})},t.prototype.save=function(e,t){this.val(t)},t.prototype.val=function(t){this.element.val(t),this.triggerOutsideChange()},t.prototype.insideChange=function(t){this.element.val(t),this.triggerInsideChange()},t.prototype.renderFont=function(){return c.CSSRendererFont.addCSS("",c.CSSRendererFont.getClass(),this.element.val(),c.CSSRendererFont.rendererModes[this.parameters.mode])},t})),c.d("FormTabbed",["$"],(function(){var $=c.$;function t(t,i){if(this.options=f({toggleMode:!1,sessionID:""},i),this.id=t,this.$buttons=$('.n2_form__tab_button[data-related-form="'+t+'"]'),this.$tabs=$('.n2_form__tab[data-related-form="'+t+'"]'),this.$buttons.on("click",this.showTab.bind(this)),!this.options.toggleMode){var s=this.$buttons.eq(0).data("related-tab");""!==this.options.sessionID&&(s=localStorage.getItem(this.options.sessionID));var n=this.$buttons.filter('[data-related-tab="'+s+'"]');0===n.length&&(n=this.$buttons.eq(0)),n.triggerHandler("click")}}return t.prototype.showTab=function(e){e.preventDefault();var t=$(e.currentTarget),i=t.data("related-tab");this.$buttons.removeClass("n2_form__tab_button--active"),this.$tabs.removeClass("n2_form__tab--active"),this.options.toggleMode&&this.currentTab===i?delete this.currentTab:(t.addClass("n2_form__tab_button--active"),this.$tabs.filter('[data-tab="'+i+'"]').addClass("n2_form__tab--active"),this.currentTab=i,""!==this.options.sessionID&&localStorage.setItem(this.options.sessionID,i))},t})),c.d("FormElementIconTab",["$","FormElement"],(function(){var $=c.$;function t(t,i){if(this.options=f({relatedValueFields:[],relatedAttribute:""},i),this.parent=$("#"+t+"_icon_tab"),this.parent.find(".n2_field_icon_tab__option").each(function(t,i){$(i).on("click",function(e){this.onClick($(e.currentTarget))}.bind(this))}.bind(this)),this.element=$("#"+t).on("change",this.onHiddenChange.bind(this)),this.relatedValueFields=!1,this.options.relatedValueFields.length){var s=this.element.val();this.relatedValueFields=$("");for(var n=0;n<this.options.relatedValueFields.length;n++)for(var h,o=0;o<this.options.relatedValueFields[n].field.length;o++)(h=$('[data-field="'+this.options.relatedValueFields[n].field[o]+'"]').data("show-values",this.options.relatedValueFields[n].values)).toggleClass("n2_form_element--hidden",-1===this.options.relatedValueFields[n].values.indexOf(s)),this.relatedValueFields=this.relatedValueFields.add(h)}if(""!==this.options.relatedAttribute){var r=$("#n2-admin").attr("data-"+this.options.relatedAttribute,this.element.val());this.element.on("nextendChange",function(){r.attr("data-"+this.options.relatedAttribute,this.element.val())}.bind(this))}c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.onHiddenChange=function(){var t=this.element.val();t&&this.insideChange(t)},t.prototype.onClick=function(t){t.hasClass("n2_field_icon_tab__option--selected")||(this.parent.find(".n2_field_icon_tab__option--selected").removeClass("n2_field_icon_tab__option--selected"),t.addClass("n2_field_icon_tab__option--selected"),this.setHiddenValue(t.attr("data-ssoption")),this.triggerOutsideChange())},t.prototype.insideChange=function(t){this.setHiddenValue(t);var i=this.parent.find('.n2_field_icon_tab__option[data-ssoption="'+t+'"]');this.onClick(i),this.triggerInsideChange()},t.prototype.setHiddenValue=function(t){this.element.val(t),this.relatedValueFields&&this.relatedValueFields.each((function(){var i=$(this);i.toggleClass("n2_form_element--hidden",-1===i.data("show-values").indexOf(t))}))},t})),c.d("FormElementIcon2Manager",["$","FormElement"],(function(){var $=c.$;function t(t){this.element=$("#"+t),this.parent=this.element.parent(),c.FormElement.prototype.constructor.call(this),this.parent.find(".n2_field_chooser__clear").on("click",this.clear.bind(this)),this.parent.find(".n2_field_chooser__choose").on("click",this.openModal.bind(this)),this.$preview=this.parent.find(".n2_field_icon__preview").on("click",this.openModal.bind(this)),this.updateIsEmpty()}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.isEmpty=function(t){return""===t},t.prototype.clear=function(e){e.preventDefault(),this.val("")},t.prototype.insideChange=function(t){this.updatePreview(t),this.element.val(t),this.updateIsEmpty(),this.triggerInsideChange()},t.prototype.openModal=function(e){e&&e.preventDefault(),c.Icons.showModal(this.setIcon.bind(this),this.element.val())},t.prototype.val=function(t){this.element.val(t),this.updatePreview(t),this.updateIsEmpty(),this.triggerOutsideChange()},t.prototype.setIcon=function(t){this.val(t)},t.prototype.updateIsEmpty=function(){this.parent.toggleClass("n2_field_chooser--empty",this.isEmpty(this.element.val()))},t.prototype.updatePreview=function(t){var i=c.Icons.render(t);i?this.$preview.html('<i class="n2i '+i.class+'">'+i.ligature+"</i>"):this.$preview.html("")},t.prototype.focus=function(t){t&&this.openModal()},t})),c.d("FormElementImageList",["$","FormElement"],(function(){var $=c.$;function t(t,i,s){if(this.id=t,this.element=$("#"+t),this.$parent=this.element.parent(),this.$preview=this.$parent.find(".n2_field_image_list__preview"),this.$fields=this.$parent.find(".n2_field_image_list__fields"),this.$fields.length&&(this.field=this.$fields.find('input[type="text"]').data("field"),this.field.element.on("outsideChange",function(){var t=this.element.val();this.markSelected(t),this.renderPreview(t)}.bind(this))),this.$popover=!1,this.parameters=f({width:120,column:3,hasDisabled:!1,options:[]},i),this.realItemWidth=this.parameters.width+10,this.relatedFields=!1,s!==o&&s.length){this.relatedFields=$("");for(var n=0;n<s.length;n++)this.relatedFields=this.relatedFields.add($('[data-field="'+s[n]+'"]'));this.relatedFields.toggleClass("n2_form_element--hidden",this.isOff(this.element.val()))}c.FormElement.prototype.constructor.call(this),this.$parent.on("click",this.toggle.bind(this)),this.renderPreview(this.element.val())}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.stopPropagation=function(e){return e.originalEvent["handled"+this.id]!==o||(e.originalEvent["handled"+this.id]=!0,!1)},t.prototype.toggle=function(e){this.$parent.hasClass("n2_field_image_list--focus")?this.blur(e):this.focus(e)},t.prototype.focus=function(e){this.stopPropagation(e)||(this.$parent.addClass("n2_field_image_list--focus"),$("body").on("click."+this.id,this.blur.bind(this)),this.buildPopover(),this.markSelected(this.element.val()))},t.prototype.blur=function(e){this.stopPropagation(e)||(this.$parent.removeClass("n2_field_image_list--focus"),$("body").off("click."+this.id))},t.prototype.isOff=function(t){return"-1"===t},t.prototype.buildPopover=function(){if(!this.$popover){this.items={},this.$popover=$('<div class="n2_field_image_list__popover"></div>').on("click",this.stopPropagation.bind(this));var t=$('<div class="n2_field_image_list__popover_items"></div>').css("width",(this.realItemWidth+20)*this.parameters.column+"px").appendTo(this.$popover);for(var i in this.parameters.options){this.items[i]=$('<div class="n2_field_image_list__popover_item"></div>').css("width",this.realItemWidth+"px").on("click",this.selectOption.bind(this,i)).appendTo(t);var s=$('<div class="n2_field_image_list__popover_item_image"></div>').appendTo(this.items[i]);this.loadImage(this.parameters.options[i].url,s),this.parameters.options[i].label!==o&&$('<div class="n2_field_image_list__popover_item_label"></div>').text(this.parameters.options[i].label).appendTo(this.items[i])}this.parameters.hasDisabled&&(this.parameters.options[-1]={url:""},this.items[-1]=$('<div class="n2_field_image_list__popover_item"></div>').on("click",this.selectOption.bind(this,"-1")).append($('<div class="n2_field_image_list__popover_item_disabled"></div>').text(n2_("Disabled"))).appendTo(t)),this.$fields.appendTo(this.$popover),this.$parent.append(this.$popover),this.$items=this.$popover.find(".n2_field_image_list__popover_item")}},t.prototype.selectOption=function(t,e){this.setValue(t),this.markSelected(t),this.renderPreview(t),this.triggerOutsideChange(),this.blur(e)},t.prototype.setValue=function(t){this.element.val(t),this.relatedFields&&this.relatedFields.toggleClass("n2_form_element--hidden",this.isOff(t))},t.prototype.markSelected=function(t){this.$items.removeClass("n2_field_image_list__popover_item--selected"),this.field&&""!==this.field.element.val()||this.items[t].addClass("n2_field_image_list__popover_item--selected")},t.prototype.renderPreview=function(t){var i,s;this.$preview.html(""),this.field&&""!==this.field.element.val()?i=c._imageHelper.fixed(this.field.element.val()):"-1"!==t&&this.parameters.options[t]!==o&&(i=this.parameters.options[t].url,s=this.parameters.options[t].label),i!==o?(this.loadImage(i,this.$preview),s&&$('<div class="n2_field_image_list__preview_label"></div>').text(s).appendTo(this.$preview)):$('<div class="n2_field_image_list__preview_label"></div>').text(n2_("Disabled")).appendTo(this.$preview)},t.prototype.insideChange=function(t){this.parameters.options[t]!==o&&(this.setValue(t),this.markSelected(t),this.renderPreview(t),this.triggerInsideChange())},t.prototype.loadImage=function(t,i){this.getImage(t,"94b2c1").done((function(t){$('<img alt="" src="'+t+'">').prependTo(i)}))},t.prototype.getCurrentImage=function(t){var i=this.element.val(),s="";return this.parameters.options[i]&&(s=this.parameters.options[i].url),this.getImage(s,t)},t.prototype.getImage=function(t,i){var s=$.Deferred();return"svg"===t.split("?")[0].split(".").pop()?$.ajax({url:t,method:"GET",dataType:"text",data:{},success:function(t){var n=t.replace(/fill="#FFF"/gi,'fill="#'+i.substr(0,6)+'"').replace('opacity="1"','opacity="'+N2Color.hex2alpha(i)+'"');s.resolve("data:image/svg+xml;base64,"+btoa(n))}.bind(this)}):s.resolve(t),s},t})),c.d("FormElementImage",["$","FormElementText"],(function(){var $=c.$;function t(t,i){c.FormElementText.prototype.constructor.call(this,t),this.parameters=f({alt:!1},i),this.preview=this.parent.find(".n2_field_text_image__preview").on("click",this.open.bind(this)),this.element.on("nextendChange",this.makePreview.bind(this)),this.parent.find(".n2_field_text__choose").on("click",this.open.bind(this)),this.parent.find(".n2_field_text__clear").on("click",this.clear.bind(this)),this.$sizeLabel=$('<div class="n2_field_text_image__size_label"></div>').appendTo(this.parent),this.refreshSizeLabel()}return t.prototype=Object.create(c.FormElementText.prototype),t.prototype.constructor=t,t.prototype.clear=function(e){e.preventDefault(),this.val("")},t.prototype.val=function(t,i){(i=f({alt:!1},i)).alt&&""!==i.alt&&this.parameters.alt&&""!==this.parameters.alt&&$("#"+this.parameters.alt).val(i.alt).trigger("change"),this.element.val(t),this.change()},t.prototype.makePreview=function(){var t=this.element.val();"{"===t.substr(0,1)?this.preview.css("background-image",""):this.preview.css("background-image","url("+c._imageHelper.fixed(t)+")"),this.refreshSizeLabel()},t.prototype.open=function(e){e&&e.preventDefault(),c._imageHelper.openLightbox(this.val.bind(this))},t.prototype.focus=function(t){t&&this.open()},t.prototype.refreshSizeLabel=function(){this.$sizeLabel.removeClass("n2_field_text_image__size_label--visible");var t=this.element.val();if(""!==t&&"{"!==t.substr(0,1)){var i=new Image;i.addEventListener("load",function(){i.naturalWidth&&i.naturalHeight&&this.$sizeLabel.text(i.naturalWidth+"x"+i.naturalHeight).addClass("n2_field_text_image__size_label--visible")}.bind(this)),i.src=c._imageHelper.fixed(t)}},t})),c.d("FormElementImageManager",["$","FormElement"],(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.parent=this.element.parent(),$("#"+t+"_manage").on("click",this.show.bind(this)),this.parameters=i,this.imageField=this.element.data("field"),c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.show=function(e){e.preventDefault();var t=this.element.val();""===t?c.Notification.error(n2_("Image field can not be empty!")):c._imageManager.show(t,this.save.bind(this))},t.prototype.save=function(){},t.prototype.insideChange=function(t){this.element.val(t),this.updateIsEmpty(),this.triggerInsideChange()},t.prototype.updateIsEmpty=function(){this.parent.toggleClass("n2_field_text--empty",this.isEmpty(this.element.val()))},t.prototype.isEmpty=function(t){return""===t},t})),c.d("FormElementLayerWindowFocus",["$","UIDragTooltip"],(function(){var $=c.$,t=new c.UIDragTooltip("Focus");function i(t,i){this.$field=$("#"+t).on("mousedown",this.onMouseDown.bind(this)),this.onMouseMoveCallback=this.onMouseMove.bind(this),this.onMouseUpCallback=this.onMouseUp.bind(this),this.$image=this.$field.find(".n2_field_layer_window_focus__image").on({error:function(){this.$image.attr("src",c._imageHelper.fixed("$system$/images/placeholder/image.png"))}.bind(this)}),this.$dot=$('<div class="n2_field_layer_window_focus__dot"></div>').on("mouseenter",this.onMouseEnter.bind(this)).appendTo(this.$field),this.options=f({image:"",focusX:"",focusY:""},i),this.$imageField=$("#"+this.options.image).on("nextendChange",this.onImageChange.bind(this)),this.imageField=this.$imageField.data("field"),this.$focusXField=$("#"+this.options.focusX).on("nextendChange",this.onFocusXChange.bind(this)),this.focusXField=this.$focusXField.data("field"),this.$focusYField=$("#"+this.options.focusY).on("nextendChange",this.onFocusYChange.bind(this)),this.focusYField=this.$focusYField.data("field")}return i.prototype.onImageChange=function(){var t=c._imageHelper.fixed(c._currentEditor.generator.fill(this.$imageField.val()));this.image!==t&&(this.image=t,this.$image.attr("src",this.image))},i.prototype.onFocusXChange=function(){var t=this.$focusXField.val();t!==this.focusX&&(this.focusX=t,this.$dot.css("left",this.focusX+"%"))},i.prototype.onFocusYChange=function(){var t=this.$focusYField.val();t!==this.focusY&&(this.focusY=t,this.$dot.css("top",this.focusY+"%"))},i.prototype.onMouseDown=function(e){this.context={originalFocusX:this.$focusXField.val(),originalFocusY:this.$focusYField.val()},c.History.get().off(),t.dragShow(),this.onMouseMove(e),s.addEventListener("mousemove",this.onMouseMoveCallback),s.addEventListener("mouseup",this.onMouseUpCallback)},i.prototype.onMouseMove=function(e){e.preventDefault();var i=this.$field[0].getBoundingClientRect(),s=Math.max(Math.min(Math.round((e.clientX-i.left)/i.width*100),100),0),n=Math.max(Math.min(Math.round((e.clientY-i.top)/i.height*100),100),0);this.$focusXField.val(s).trigger("change"),this.$focusYField.val(n).trigger("change"),t.dragUpdate(e,"X: "+s+"%<br>Y: "+n+"%")},i.prototype.onMouseUp=function(e){this.$focusXField.val(this.context.originalFocusX).trigger("change"),this.$focusYField.val(this.context.originalFocusY).trigger("change"),c.History.get().on(),t.dragHide(),s.removeEventListener("mousemove",this.onMouseMoveCallback),s.removeEventListener("mouseup",this.onMouseUpCallback),this.onMouseMove(e),delete this.context},i.prototype.onMouseEnter=function(e){t.hoverShow(e,function(){return"X: "+this.$focusXField.val()+"%<br>Y: "+this.$focusYField.val()+"%"}.bind(this)),this.$dot.on({"mousemove.tooltip":function(e){t.hoverUpdatePosition(e)},"mouseleave.tooltip":function(){this.timeout&&(a(this.timeout),delete this.timeout),this.$dot.off(".tooltip"),t.hoverHide()}.bind(this)})},i})),c.d("FormElementList",["$","FormElement"],(function(){var $=c.$;function t(t,i){if(this.separator="||",this.options=f({relatedFields:[],relatedValueFields:[],relatedAttribute:""},i),this.element=$("#"+t).on("change",this.onHiddenChange.bind(this)),this.select=$("#"+t+"_select").on("change",this.onChange.bind(this)),this.relatedFields=!1,this.options.relatedFields.length){this.relatedFields=$("");for(var s=0;s<this.options.relatedFields.length;s++)this.relatedFields=this.relatedFields.add($('[data-field="'+this.options.relatedFields[s]+'"]'));this.relatedFields.toggleClass("n2_form_element--hidden",this.isOff(this.element.val()))}if(this.relatedValueFields=!1,this.options.relatedValueFields.length){var n=this.element.val();this.relatedValueFields=$("");for(s=0;s<this.options.relatedValueFields.length;s++)for(var h,o=0;o<this.options.relatedValueFields[s].field.length;o++)(h=$('[data-field="'+this.options.relatedValueFields[s].field[o]+'"]').data("show-values",this.options.relatedValueFields[s].values)).toggleClass("n2_form_element--hidden",-1===this.options.relatedValueFields[s].values.indexOf(n)),this.relatedValueFields=this.relatedValueFields.add(h)}if(""!==this.options.relatedAttribute){var r=$("#n2-admin").attr("data-"+this.options.relatedAttribute,this.element.val());this.element.on("nextendChange",function(){r.attr("data-"+this.options.relatedAttribute,this.element.val())}.bind(this))}c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.onHiddenChange=function(){var t=this.element.val();t&&t!==this.select.val()&&this.insideChange(t)},t.prototype.onChange=function(){var t=this.select.val();null!==t&&"object"==typeof t&&(t=t.join(this.separator)),this.setHiddenValue(t),this.triggerOutsideChange()},t.prototype.insideChange=function(t){"object"==typeof t?(this.select.val(t),t=t.join("||")):this.select.val(t),this.setHiddenValue(t),this.triggerInsideChange()},t.prototype.setHiddenValue=function(t){this.element.val(t),this.relatedFields&&this.relatedFields.toggleClass("n2_form_element--hidden",this.isOff(t)),this.relatedValueFields&&this.relatedValueFields.each((function(){var i=$(this);i.toggleClass("n2_form_element--hidden",-1===i.data("show-values").indexOf(t))}))},t.prototype.isOff=function(t){return""==t||"0"==t||"off"==t},t.prototype.setOptions=function(t){for(var i in this.select.html(""),t)$('<option value="'+i+'"></option>').text(t[i]).appendTo(this.select)},t})),c.d("FormElementMarginPadding",["FormElementMixed"],(function(){function t(t,i,s){this.linkedValues=!1,c.FormElementMixed.prototype.constructor.apply(this,arguments),this.$field=this.element.parent(),this.$field.find(".n2_field_margin_padding__pre_label").on("click",function(e){e.preventDefault(),this.linkedValues=!this.linkedValues,this.$field.toggleClass("n2_field_margin_padding--linked-values",this.linkedValues),this.linkedValues&&this.elements[0].trigger("change")}.bind(this)),this.refresh()}return t.prototype=Object.create(c.FormElementMixed.prototype),t.prototype.constructor=t,t.prototype.onFieldChange=function(){if(this.linkedValues)for(var t=this.elements[0].val(),i=1;i<4;i++)this.elements[i].data("field").insideChange(t);this.element.val(this.getValue()),this.triggerOutsideChange()},t.prototype.insideChange=function(t){c.FormElementMixed.prototype.insideChange.apply(this,arguments),this.refresh()},t.prototype.refresh=function(){this.linkedValues=!0;for(var t=this.elements[0].val(),i=1;i<4;i++)if(t!==this.elements[i].val()){this.linkedValues=!1;break}this.$field.toggleClass("n2_field_margin_padding--linked-values",this.linkedValues)},t.prototype.relatedFieldsOff=function(){return"0|*|0|*|0|*|0"===this.element.val()},t.prototype.isEmpty=function(t){return"|*||*||*|"===t||"0|*|0|*|0|*|0"===t},t})),c.d("FormElementMixed",["$","FormElement"],(function(){var $=c.$;function t(t,i,s){this.element=$("#"+t),this.elements=[];for(var n=0;n<i.length;n++)this.elements.push($("#"+i[n]).on("outsideChange",this.onFieldChange.bind(this)));this.separator=s,c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.onFieldChange=function(){this.element.val(this.getValue()),this.triggerOutsideChange()},t.prototype.insideChange=function(t){this.element.val(t);for(var i=t.split(this.separator),s=0;s<this.elements.length;s++)this.elements[s].data("field").insideChange(i[s]);this.triggerInsideChange()},t.prototype.getValue=function(){for(var t=[],i=0;i<this.elements.length;i++)t.push(this.elements[i].val());return t.join(this.separator)},t})),c.d("FormElementNumberSlider",["$"],(function(){var $=c.$;function t(t,i){this.localChange=!1,this.element=$("#"+t),this.$parent=this.element.parent().on({"mouseenter.n2slider":this.startSlider.bind(this,i)});var s=this.$parent.siblings(".n2_field_unit").find("> input");if(i.units&&s.length){var n=i.units;s.on("nextendChange",function(){i.min=n[s.val()+"Min"],i.max=n[s.val()+"SliderMax"],this.slider&&(this.uiSlider.setOption("min",i.min),this.uiSlider.setOption("max",i.max))}.bind(this))}}return t.prototype.startSlider=function(t,e){if(this.element.parent().off(".n2slider"),!this.slider){var i=$('<div class="n2_field_number__slider"></div>').appendTo(this.$parent),s=$('<div class="n2_field_number__slider_inner"></div>').appendTo(i);this.slider=$("<div></div>").appendTo(s).removeAttr("slide").prop("slide",!1),this.uiSlider=new c.UISlider(this.slider,f({start:function(){this.element.parent().addClass("n2-active")}.bind(this),stop:function(){this.element.parent().removeClass("n2-active")}.bind(this),sliding:function(e,t){this.localChange=!0,this.element.val(t.value).trigger("change"),this.localChange=!1}.bind(this)},t)),this.slider[0].slide!==o&&(this.slider[0].slide=null),this.element.on("nextendChange",function(){if(!this.localChange){var t=parseFloat(this.element.val());isFinite(t)&&this.uiSlider.setOption("value",t)}}.bind(this))}this.uiSlider.setOption("value",parseFloat(this.element.val()))},t})),c.d("FormElementNumber",["$","FormElement"],(function(){var $=c.$;function t(t,i,s,n){this.min=i,this.max=s,this.element=$("#"+t).on({focus:this._focus.bind(this),blur:this.blur.bind(this),change:this.change.bind(this)}),this.parent=this.element.parent();var h=this.parent.siblings(".n2-form-element-units").find("> input");n&&h.length&&h.on("nextendChange",function(){this.min=n[h.val()+"Min"],this.max=n[h.val()+"Max"]}.bind(this)),c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype._focus=function(){this.parent.addClass("n2_field_text--focus"),this.element.on("keypress.n2-text",function(e){13===e.which&&(this.element.off("keypress.n2-text"),this.element.trigger("blur"))}.bind(this))},t.prototype.blur=function(){this.parent.removeClass("n2_field_text--focus")},t.prototype.change=function(){var t=this.validate(this.element.val());!0===t?this.triggerOutsideChange():this.element.val(t).trigger("change")},t.prototype.insideChange=function(t){var i=this.validate(t);!0===i?this.element.val(t):this.element.val(i),this.triggerInsideChange()},t.prototype.validate=function(t){if(t!==o&&t.length>0&&"{"===t.charAt(0))return!0;var i=parseFloat(t);return isNaN(i)&&(i=0),(i=Math.max(this.min,Math.min(this.max,i)))+""===t||i},t.prototype.relatedFieldsOff=function(){return 0===parseInt(this.element.val())},t.prototype.isEmpty=function(t){return""===t||0===t},t})),c.d("FormElementOnoff",["$","FormElement"],(function(){var $=c.$;function t(t,i){for(var s in this.element=$("#"+t),this.options=f({values:{0:0,1:1},relatedFieldsOff:[],relatedFieldsOn:[],relatedAttribute:""},i),this.options.valuesDict={},this.options.values)this.options.valuesDict[this.options.values[s]]=s;if(this.options.relatedFieldsOff.length){this.relatedFieldsOff=$("");for(var n=0;n<this.options.relatedFieldsOff.length;n++)this.relatedFieldsOff=this.relatedFieldsOff.add($('[data-field="'+this.options.relatedFieldsOff[n]+'"]'))}else this.relatedFieldsOff=!1;if(this.options.relatedFieldsOn.length){this.relatedFieldsOn=$("");for(n=0;n<this.options.relatedFieldsOn.length;n++)this.relatedFieldsOn=this.relatedFieldsOn.add($('[data-field="'+this.options.relatedFieldsOn[n]+'"]'))}else this.relatedFieldsOn=!1;if(""!==this.options.relatedAttribute){var h=$("#n2-admin");h.attr("data-"+this.options.relatedAttribute,this.element.val()),this.element.on("nextendChange",function(){h.attr("data-"+this.options.relatedAttribute,this.element.val())}.bind(this))}this.onoff=this.element.parent().on({click:this.switch.bind(this),keydown:function(e){32===e.keyCode&&(e.stopPropagation(),e.preventDefault(),this.onoff.trigger("click"))}.bind(this)}),this.options.values[this.element.val()]?this.syncOn():this.syncOff(),c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.switch=function(){var t=this.options.values[this.element.val()]?0:1;this.element.val(this.options.valuesDict[t]),this.setSelected(t),this.triggerOutsideChange()},t.prototype.insideChange=function(t){var i=this.options.values[t];this.element.val(this.options.valuesDict[i]),this.setSelected(i),this.triggerInsideChange()},t.prototype.setSelected=function(t){t?this.syncOn():this.syncOff()},t.prototype.syncOff=function(){this.onoff.removeClass("n2_field_onoff--on").attr("aria-checked","false"),this.relatedFieldsOff&&this.relatedFieldsOff.removeClass("n2_form_element--hidden"),this.relatedFieldsOn&&this.relatedFieldsOn.addClass("n2_form_element--hidden")},t.prototype.syncOn=function(){this.onoff.addClass("n2_field_onoff--on").attr("aria-checked","true"),this.relatedFieldsOff&&this.relatedFieldsOff.addClass("n2_form_element--hidden"),this.relatedFieldsOn&&this.relatedFieldsOn.removeClass("n2_form_element--hidden")},t})),c.d("FormElementRadio",["$","FormElement"],(function(){var $=c.$;function t(t,i,s){if(this.element=$("#"+t),this.values=i,this.relatedFields=!1,s!==o&&s.length){this.relatedFields=$("");for(var n=0;n<s.length;n++)this.relatedFields=this.relatedFields.add($('[data-field="'+s[n]+'"]'));this.relatedFields.toggleClass("n2_form_element--hidden",this.isOff(this.element.val()))}this.parent=this.element.parent(),this.options=this.parent.find(".n2_field_radio__option");for(n=0;n<this.options.length;n++)this.options.eq(n).on("click",this.click.bind(this));c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.click=function(e){this.changeSelectedIndex(this.options.index(e.currentTarget))},t.prototype.changeSelectedIndex=function(t){var i=this.values[t];this.setValue(i),this.setSelected(t),this.triggerOutsideChange()},t.prototype.insideChange=function(t,i){var s=this.values.indexOf(t);-1===s&&(s=this.partialSearch(t)),-1===s&&i!==o&&(s=this.addOption(t,i)),-1!==s?(this.setValue(this.values[s]),this.setSelected(s),this.triggerInsideChange()):this.options.eq(0).trigger("click")},t.prototype.setSelected=function(t){this.options.removeClass("n2_field_radio__option--selected"),this.options.eq(t).addClass("n2_field_radio__option--selected")},t.prototype.partialSearch=function(t){t=t.replace(/^.*[\\\/]/,"");for(var i=0;i<this.values.length;i++)if(-1!==this.values[i].indexOf(t))return i;return-1},t.prototype.addOption=function(t,i){var s=this.values.push(t)-1;return i.appendTo(this.parent).on("click",this.click.bind(this)),this.options=this.options.add(i),s},t.prototype.addTabOption=function(t,i){var s=this.values.push(t)-1,n=$('<div class="n2_field_radio__option">'+i+"</div>").insertAfter(this.options.last()).on("click",this.click.bind(this));return this.options=this.options.add(n),s},t.prototype.removeTabOption=function(t){var i=this.values.indexOf(t),s=this.options.eq(i);this.options=this.options.not(s),s.remove(),this.values.splice(i,1)},t.prototype.moveTab=function(t,i){},t.prototype.setValue=function(t){this.element.val(t),this.relatedFields&&this.relatedFields.toggleClass("n2_form_element--hidden",this.isOff(t))},t.prototype.isOff=function(t){return""===t||"0"===t||0===t||"off"===t},t})),c.d("FormRelatedFields",["$"],(function(){var $=c.$;function t(t,i){this.$field=$("#"+t),this.options=f({relatedFieldsOn:[],relatedFieldsOff:[]},i),this.field=this.$field.data("field"),this.field&&this.field.relatedFieldsOff!==o?this.fieldChanged=this.fieldChangedCallback:this.fieldChanged=this.fieldChangedSimple,this.$field.on("nextendChange",this.fieldChanged.bind(this)),this.relatedFieldsOn=$("");for(var s=0;s<this.options.relatedFieldsOn.length;s++)this.relatedFieldsOn=this.relatedFieldsOn.add($('[data-field="'+this.options.relatedFieldsOn[s]+'"]'));this.relatedFieldsOff=$("");for(s=0;s<this.options.relatedFieldsOff.length;s++)this.relatedFieldsOff=this.relatedFieldsOff.add($('[data-field="'+this.options.relatedFieldsOff[s]+'"]'));this.fieldChanged()}return t.prototype.fieldChangedSimple=function(){var t=this.$field.val(),i=this.field.isEmpty(t);this.relatedFieldsOn.toggleClass("n2_form_element--hidden",i),this.relatedFieldsOff.toggleClass("n2_form_element--hidden",!i)},t.prototype.fieldChangedCallback=function(){var t=this.field.relatedFieldsOff();this.relatedFieldsOn.toggleClass("n2_form_element--hidden",t),this.relatedFieldsOff.toggleClass("n2_form_element--hidden",!t)},t})),c.d("FormElementRichText",["$","FormElementText"],(function(){var $=c.$;function t(t){c.FormElementText.prototype.constructor.apply(this,arguments),this.parent.find(".n2_field_textarea_rich__button").on("click",this.onButtonClick.bind(this))}return t.prototype=Object.create(c.FormElementText.prototype),t.prototype.constructor=t,t.prototype.onButtonClick=function(e){switch($(e.currentTarget).data("action")){case"bold":this.bold();break;case"italic":this.italic();break;case"link":this.link()}},t.prototype.bold=function(){this.wrapText("<b>","</b>")},t.prototype.italic=function(){this.wrapText("<i>","</i>")},t.prototype.link=function(){this.wrapText('<a href="#">',"</a>")},t.prototype.wrapText=function(t,i){var s=this.element,n=s.val().length,h=s[0].selectionStart,o=s[0].selectionEnd,r=t+s.val().substring(h,o)+i;s.val(s.val().substring(0,h)+r+s.val().substring(o,n)),this.triggerOutsideChange(),this.element.focus(),s[0].selectionEnd=o+t.length+i.length},t})),c.d("FormElementSelectIcon",["$","FormElement"],(function(){var $=c.$;function t(t,i){if(this.options=f({relatedFields:[],relatedValueFields:[]},i),this.element=$("#"+t),this.$parent=this.element.parent(),this.$options=this.$parent.find(".n2_field_select_icon__option").on("click",this.onSelect.bind(this)),this.relatedFields=!1,this.options.relatedFields.length){this.relatedFields=$("");for(var s=0;s<this.options.relatedFields.length;s++)this.relatedFields=this.relatedFields.add($('[data-field="'+this.options.relatedFields[s]+'"]'));this.relatedFields.toggleClass("n2_form_element--hidden",this.isOff(this.element.val()))}if(this.relatedValueFields=!1,this.options.relatedValueFields.length){var n=this.element.val();this.relatedValueFields=$("");for(s=0;s<this.options.relatedValueFields.length;s++)for(var h,o=0;o<this.options.relatedValueFields[s].field.length;o++)(h=$('[data-field="'+this.options.relatedValueFields[s].field[o]+'"]').data("show-values",this.options.relatedValueFields[s].values)).toggleClass("n2_form_element--hidden",-1===this.options.relatedValueFields[s].values.indexOf(n)),this.relatedValueFields=this.relatedValueFields.add(h)}c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.onSelect=function(e){var t=$(e.currentTarget);t.data("value")!==this.element.val()&&(this.$options.removeClass("n2_field_select_icon__option--selected"),t.addClass("n2_field_select_icon__option--selected"),this.setHiddenValue(t.data("value")),this.triggerOutsideChange())},t.prototype.insideChange=function(t){this.$options.removeClass("n2_field_select_icon__option--selected"),this.$options.filter('[data-value="'+t+'"]').addClass("n2_field_select_icon__option--selected"),this.setHiddenValue(t),this.triggerInsideChange()},t.prototype.setHiddenValue=function(t){this.element.val(t),this.relatedFields&&this.relatedFields.toggleClass("n2_form_element--hidden",this.isOff(t)),this.relatedValueFields&&this.relatedValueFields.each((function(){var i=$(this);i.toggleClass("n2_form_element--hidden",-1===i.data("show-values").indexOf(t))}))},t})),c.d("FormElementSkin",["$","FormElement"],(function(){var $=c.$;function t(t,i,s,n){this.element=$("#"+t),this.preId=i,this.skins=s,this.list=this.element.data("field"),this.fixedMode=n,this.firstOption=this.list.select.find("option").eq(0),this.originalText=this.firstOption.text(),this.element.on("outsideChange",this.onSkinSelect.bind(this)),c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.onSkinSelect=function(){var t=this.element.val();if("0"!==t){for(var i in t=this.skins[t].settings)if(t.hasOwnProperty(i)){var s=$("#"+this.preId+i);if(s.length)s.data("field").insideChange(t[i])}this.fixedMode||(this.changeFirstOptionText(n2_("Done")),this.list.insideChange("0"),r(this.changeFirstOptionText.bind(this,this.originalText),3e3))}},t.prototype.changeFirstOptionText=function(t){this.firstOption.text(t)},t.prototype.insideChange=function(t){this.element.val(t),this.list.insideChange(t)},t})),c.d("FormElementStyleHidden",["$","FormElement"],(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.parameters=f({mode:"",label:""},i),c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return this.parameters.label},t.prototype.save=function(e,t){this.val(t)},t.prototype.val=function(t){this.element.val(t),this.triggerOutsideChange()},t.prototype.insideChange=function(t){this.element.val(t),this.triggerInsideChange()},t.prototype.renderStyle=function(){return c.CSSRendererStyle.addCSS("",c.CSSRendererStyle.getClass(),this.element.val(),c.CSSRendererStyle.rendererModes[this.parameters.mode])},t})),c.d("FormElementStyle",["$","FormElement"],(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.parent=this.element.parent(),this.parameters=f({mode:"",label:"",font:"",font2:"",style2:"",preview:""},i),c.FormElement.prototype.constructor.call(this),this.parent.on("click",this.show.bind(this))}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return this.parameters.label},t.prototype.show=function(e){e.preventDefault(),""!==this.parameters.font&&c._styleManager.setConnectedFont(this.parameters.font),""!==this.parameters.font2&&c._styleManager.setConnectedFont2(this.parameters.font2),""!==this.parameters.style2&&c._styleManager.setConnectedStyle(this.parameters.style2),c._styleManager.setFieldID(this.element.attr("id")),c._styleManager.show(this.element.val(),this.save.bind(this),{previewMode:this.parameters.mode,previewHTML:this.parameters.preview})},t.prototype.save=function(e,t){this.val(t)},t.prototype.val=function(t){this.element.val(t),this.triggerOutsideChange()},t.prototype.insideChange=function(t){this.element.val(t),this.triggerInsideChange()},t.prototype.renderStyle=function(){return c.CSSRendererStyle.addCSS("",c.CSSRendererStyle.getClass(),this.element.val(),c.CSSRendererStyle.rendererModes[this.parameters.mode])},t})),c.d("FormElementSubformIcon",["$","FormElement"],(function(){var $=c.$;function t(t,i,s,n){this.id=t,this.ajaxUrl=i,this.element=$("#"+t).data("field",this),this.$parent=this.element.parent(),this.$targetContainer=$("#"+s),this.originalValue=n,this.form=this.element.closest("form"),this.$options=this.$parent.find(".n2_field_subform_icon__option").on("click",this.selectOption.bind(this)),c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.selectOption=function(e){var t=$(e.currentTarget),i=t.data("value");this.$options.removeClass("n2_field_subform_icon__option--selected"),t.addClass("n2_field_subform_icon__option--selected"),this.element.val(i),this.triggerOutsideChange(),this.loadSubform(i)},t.prototype.loadSubform=function(t){var i={values:[],value:t};t===this.originalValue&&(i.values=this.form.data("form").values),c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.ajaxUrl),data:i,dataType:"json"}).done(this.load.bind(this))},t.prototype.load=function(t){this.$targetContainer.html(t.data.html),eval(t.data.scripts),c.FormTipManager.add(this.$targetContainer)},t})),c.d("FormElementSubformImage",["$","FormElement"],(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.options=$("#"+i).find(".n2-subform-image-option"),this.subform=this.element.data("field"),this.active=this.getIndex(this.options.filter(".n2-active").get(0));for(var s=0;s<this.options.length;s++)this.options.eq(s).on("click",this.selectOption.bind(this));c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.selectOption=function(e){var t=this.getIndex(e.currentTarget);if(t!=this.active){this.options.eq(t).addClass("n2-active"),this.options.eq(this.active).removeClass("n2-active"),this.active=t;var i=this.subform.list.select.find("option").eq(t).val();this.subform.list.insideChange(i)}},t.prototype.getIndex=function(t){return this.options.indexOf(t)},t})),c.d("FormElementTab",["$","FormElement"],(function(){var $=c.$;function t(t,i){if(this.parent=$("#"+t+"_tab"),this.parent.find(".n2_field_tab__option").each(function(t,i){$(i).on("click",function(e){this.onClick($(e.currentTarget))}.bind(this))}.bind(this)),this.element=$("#"+t).on("change",this.onHiddenChange.bind(this)),this.relatedValueFields=!1,i.length){var s=this.element.val();this.relatedValueFields=$("");for(var n=0;n<i.length;n++)for(var h,o=0;o<i[n].field.length;o++)(h=$('[data-field="'+i[n].field[o]+'"]').data("show-values",i[n].values)).toggleClass("n2_form_element--hidden",-1===i[n].values.indexOf(s)),this.relatedValueFields=this.relatedValueFields.add(h)}c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.onHiddenChange=function(){var t=this.element.val();t&&this.insideChange(t)},t.prototype.onClick=function(t){t.hasClass("n2_field_tab__option--selected")||(this.parent.find(".n2_field_tab__option--selected").removeClass("n2_field_tab__option--selected"),t.addClass("n2_field_tab__option--selected"),this.setHiddenValue(t.attr("data-ssoption")),this.triggerOutsideChange())},t.prototype.insideChange=function(t){this.setHiddenValue(t),this.triggerInsideChange()},t.prototype.setHiddenValue=function(t){this.element.val(t),this.relatedValueFields&&this.relatedValueFields.each((function(){var i=$(this);i.toggleClass("n2_form_element--hidden",-1===i.data("show-values").indexOf(t))}))},t.prototype.setOptions=function(i,s,n,h){for(var o in h||(h=[]),s.html(""),i){var r=$('<div class="n2_field_tab__option" data-ssoption="'+o+'">'+i[o]+"</div>");n===o&&r.addClass("n2_field_tab__option--selected"),s.append(r),new t(s.attr("id").replace("_tab",""),h)}},t})),c.d("FormElementText",["$","FormElement"],(function(){var $=c.$;function t(t){this.element=$("#"+t).on({focus:this._focus.bind(this),blur:this._blur.bind(this),change:this.change.bind(this)}),this.tagName=this.element.prop("tagName"),this.parent=this.element.parent(),c.FormElement.prototype.constructor.call(this),this.updateIsEmpty()}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype._focus=function(){this.parent.addClass("n2_field_text--focus"),"TEXTAREA"!==this.tagName&&this.element.on("keypress.n2-text",function(e){13===e.which&&(this.element.off("keypress.n2-text"),this.element.trigger("blur"))}.bind(this))},t.prototype._blur=function(){this.parent.removeClass("n2_field_text--focus")},t.prototype.change=function(){this.updateIsEmpty(),this.triggerOutsideChange()},t.prototype.insideChange=function(t){this.element.val(t),this.updateIsEmpty(),this.triggerInsideChange()},t.prototype.updateIsEmpty=function(){this.parent.toggleClass("n2_field_text--empty",this.isEmpty(this.element.val()))},t.prototype.isEmpty=function(t){return""===t},t.prototype.focus=function(t){this.connectedField?this.connectedField.focus(t):t&&this.element.focus().select()},t})),c.d("FormElementUnits",["$","FormElement"],(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.$parent=this.element.parent(),this.options=this.$parent.find(".n2_field_unit__unit"),this.currentUnit=this.$parent.find(".n2_field_unit__current_unit"),this.values=i;for(var s=0;s<this.options.length;s++)this.options.eq(s).on("click",this.switch.bind(this,s));c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.switch=function(t,e){this.element.val(this.values[t]),this.setSelected(t),this.triggerOutsideChange()},t.prototype.insideChange=function(t){var i=this.values.indexOf(t);this.element.val(this.values[i]),this.setSelected(i),this.triggerInsideChange()},t.prototype.setSelected=function(t){this.currentUnit.html(this.options.eq(t).html())},t})),c.d("FormElementUpload",["$","FormElement"],(function(){var $=c.$;function t(t){this.element=$("#"+t).on("change",this.updateName.bind(this)),this.parent=this.element.parent(),this.$name=this.parent.find(".n2_field_chooser__label"),this.updateName(this.element.val()),c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.insideChange=function(t){this.updateName(),this.triggerInsideChange()},t.prototype.updateName=function(){var t=this.element[0].value;if(this.parent.toggleClass("n2_field_chooser--empty",""===t),this.isEmpty(t))this.$name.text(n2_("No file selected."));else{var i=t.split("\\").pop();this.$name.text(i)}},t.prototype.isEmpty=function(t){return""===t},t})),c.d("FormElementUrl",["$","FormElementText"],(function(){function t(t,i){c.FormElementText.prototype.constructor.call(this,t),this.parameters=i,this.button=this.parent.find(".n2_field_text__choose").on("click",this.open.bind(this)),this.element.siblings(".n2_field_text__clear").on("click",this.clear.bind(this))}return t.prototype=Object.create(c.FormElementText.prototype),t.prototype.constructor=t,t.prototype.isEmpty=function(t){return""===t||"#"===t},t.prototype.clear=function(e){e.preventDefault(),this.val("#")},t.prototype.val=function(t){this.element.val(t),this.change()},t.prototype.open=function(e){e.preventDefault(),this.element.val(),c.ModalUrl.show(this.element.val(),this.parameters.url,function(t){this.val(t)}.bind(this))},t})),c.r("$",(function(){var $=c.$;function t(t){return t+Math.floor(281474976710656*(1+Math.random())).toString(16)}$.fn.uid=function(i){var s=null;i=i||"n";do{s=t(i)}while($("#"+s).length>0);return s},$.fn.generateUniqueClass=function(i){var s=null;i=i||"n";do{s=t(i)}while($("."+s).length>0);return s}})),c.d("UIAutocomplete",["$","UIWidgetBase"],(function(){var $=c.$;function t(t,i){this.isRendered=!1,this.element=t,this.widgetName=this.widgetName||"UIAutocomplete",this.widgetEventPrefix="autocomplete",this.isActive=!1,this.allowBlur=!0,this.options=f({appendTo:"body",source:null,select:null,positionTo:"self",x:0,y:0},this.options,i),c.UIWidgetBase.prototype.constructor.apply(this,arguments),this.element.on({focus:this.focus.bind(this),blur:this.blur.bind(this)}),"self"===this.options.positionTo?this.positionTo=this.element:this.positionTo=this.element.closest(this.options.positionTo)}return t.prototype=Object.create(c.UIWidgetBase.prototype),t.prototype.constructor=t,t.prototype.focus=function(e){!1===this.isActive&&(this.showList(e),this.element.on("click."+this.widgetEventPrefix,this.showList.bind(this)),this.isActive=!0)},t.prototype.showList=function(e){"function"==typeof this.options.appendTo?this.options.appendTo=this.options.appendTo.call(i):this.options.appendTo=$(this.options.appendTo);var t=this.getList().appendTo(this.options.appendTo),s={left:0,top:0},n=this.positionTo.offset(),h=0;if(!this.options.appendTo.is($("body"))){(s=this.options.appendTo.offset()).top-=this.options.appendTo.scrollTop(),t.css("height","");var o=t.height(),r=this.options.appendTo[0].getBoundingClientRect(),a=this.positionTo[0].getBoundingClientRect(),c=Math.min(r.top+r.height-a.top-a.height-10,o);c<100&&c<o&&(c=Math.min(a.top-r.top-10,o),s.top=s.top+a.height+c),t.css("height",c+"px"),n2const.rtl.isRtl&&(h=r.width-this.options.appendTo[0].clientWidth)}t.css({left:n.left-s.left+this.options.x-h+"px",top:n.top+this.positionTo.outerHeight()-s.top+this.options.y+"px",minWidth:this.element.parent().outerWidth()+"px"}),t.off("."+this.widgetEventPrefix).on("mousedown."+this.widgetEventPrefix,function(e){$(e.target).is(t)&&(this.element.parent().addClass("focus2"),this.allowBlur=!1)}.bind(this)).on("mouseup."+this.widgetEventPrefix,function(e){$(e.target).is(t)&&(this.allowBlur=!0,this.element.focus(),this.element.parent().removeClass("focus2"))}.bind(this))},t.prototype.blur=function(e){this.allowBlur&&(this.hide(),this.element.off("."+this.widgetEventPrefix))},t.prototype.hide=function(){this.$list.detach(),this.isActive=!1},t.prototype.getList=function(){if(!this.isRendered){this.$list=$('<div class="n2_autocomplete_options"></div>').attr({unselectable:"on"}).on({wheel:function(e){e.stopPropagation()}});for(var t=this.options.source.call(this,this.ui()),i=0;i<t.length;i++)$('<div class="n2_autocomplete_option" tabindex="-1">'+t[i]+"</div>").on({mousedown:function(e){e.preventDefault()},click:function(t,e){this._trigger("select",e,{value:t}),this.hide()}.bind(this,t[i])}).appendTo(this.$list);this.isRendered=!0}return this.$list},t.prototype.ui=function(){return{}},t})),c.d("UIDraggableBar",["$","UIMouse"],(function(){"use strict";function t(t,i){this.element=t,this.widgetName=this.widgetName||"UIDraggable",this.widgetEventPrefix="drag",this.options=f({drag:null,start:null,stop:null},this.options,i),c.UIMouse.prototype.constructor.apply(this,arguments),this._mouseInit()}return t.prototype=Object.create(c.UIMouse.prototype),t.prototype.constructor=t,t.prototype._mouseStart=function(t){return this.currentData=this.originalData={margin:parseInt(this.element.css("marginLeft"))},this.originalMousePosition={left:t.pageX},this.element.addClass("nui-draggable-dragging"),this._trigger("start",t,this.ui()),this._mouseDrag(t),!0},t.prototype._mouseDrag=function(t){var i=t.pageX-this.originalMousePosition.left||0;return this.currentData={},this.currentData.margin=Math.max(0,this.originalData.margin+i),this._trigger("drag",t,this.ui()),this.element.css("marginLeft",this.currentData.margin+"px"),!0},t.prototype._mouseStop=function(t){return this._trigger("stop",t,this.ui()),!0},t.prototype.ui=function(){return{currentData:this.currentData}},t})),c.d("UIDraggableDelay",["$","UIMouse"],(function(){"use strict";function t(t,i){this.element=t,this.widgetName=this.widgetName||"UIDraggable",this.widgetEventPrefix="drag",this.options=f({drag:null,start:null,stop:null},this.options,i),c.UIMouse.prototype.constructor.apply(this,arguments),this._mouseInit()}return t.prototype=Object.create(c.UIMouse.prototype),t.prototype.constructor=t,t.prototype._mouseStart=function(t){return this.currentData=this.originalData={width:parseInt(this.element.width())},this.originalMousePosition={left:t.pageX},this.element.addClass("nui-draggable-dragging"),this._trigger("start",t,this.ui()),this._mouseDrag(t),!0},t.prototype._mouseDrag=function(t){var i=t.pageX-this.originalMousePosition.left||0;return this.currentData={},this.currentData.width=Math.max(0,this.originalData.width+i),this._trigger("drag",t,this.ui()),this.element.width(this.currentData.width+"px"),!0},t.prototype._mouseStop=function(t){return this._trigger("stop",t,this.ui()),!0},t.prototype.ui=function(){return{currentData:this.currentData}},t})),c.d("UIDraggable",["$","UIMouse"],(function(){var $=c.$;function t(t,i){this.element=t,this.widgetName=this.widgetName||"UIDraggable",this.widgetEventPrefix="drag",this.options=_({addClasses:!0,appendTo:"parent",axis:!1,containment:!1,cursor:"auto",cursorAt:!1,handle:!1,helper:"original",scroll:!0,scrollSensitivity:20,scrollSpeed:20,min:{top:!1,left:!1},drag:null,start:null,stop:null},this.options,i),c.UIMouse.prototype.constructor.apply(this,arguments),this.create()}t.prototype=Object.create(c.UIMouse.prototype),t.prototype.constructor=t,t.prototype.create=function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("nui-draggable"),this._setHandleClassName(),this._mouseInit()},t.prototype._setPositionRelative=function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},t.prototype._getHandle=function(t){return!this.options.handle||!!$(t.target).closest(this.element.find(this.options.handle)).length},t.prototype._setHandleClassName=function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("nui-draggable-handle")},t.prototype._mouseCapture=function(t){var i=this.options;return!(this.helper||i.disabled||$(t.target).closest(".nui_resize_absolute").length>0)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blurActiveElement(t),!0))},t.prototype.cancel=function(){return this.helper.is(".nui-draggable-dragging")?this._mouseUp(new $.Event("mouseup",{target:this.element[0]})):this._clear(),this},$.fn.nuiScrollParent=function(t){var i=this.css("position"),n="absolute"===i,h=t?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter((function(){var t=$(this);return(!n||"static"!==t.css("position"))&&h.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))})).eq(0);return"fixed"!==i&&o.length?o:$(this[0].ownerDocument||s)},t.prototype._mouseStart=function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("nui-draggable-dragging"),this._cacheHelperProportions(),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.nuiScrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter((function(){return"fixed"===$(this).css("position")})).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),this._mouseDrag(t,!0),!0)},t.prototype._mouseDrag=function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(!1===this._trigger("drag",t,s))return this._mouseUp(new $.Event("mouseup",t)),!1;this.position=s.position}return!1!==this.options.min.top&&(this.position.top=Math.max(this.position.top,this.options.min.top)),!1!==this.options.min.left&&(this.position.left=Math.max(this.position.left,this.options.min.left)),this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",!1},t.prototype._mouseStop=function(t){return!1!==this._trigger("stop",t)&&this._clear(),!1},t.prototype._mouseUp=function(t){return this.handleElement.is(t.target)&&this.element.trigger("focus"),c.UIMouse.prototype._mouseUp.call(this,t)},t.prototype._trigger=function(t,i,s){return s=s||this._uiHash(),c.UIWidgetBase.prototype._trigger.call(this,t,i,s)},t.prototype._uiHash=function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition}},t.prototype._createHelper=function(t){var i=this.options,s="function"==typeof i.helper,n=s?$(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},t.prototype._cacheHelperProportions=function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},t.prototype._cacheMargins=function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},t.prototype._refreshOffsets=function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},t.prototype._getParentOffset=function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&$.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},t.prototype._getRelativeOffset=function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),i=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(i?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(i?0:this.scrollParent.scrollLeft())}},t.prototype._convertPositionTo=function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n=this._isRootNode(this.scrollParent[0]);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)*s}},t.prototype._setContainment=function(){var t,s,n,o=this.options;this.document[0];this.relativeContainer=null,o.containment?"window"!==o.containment?"document"!==o.containment?o.containment.constructor!==Array?("parent"===o.containment&&(o.containment=this.helper[0].parentNode),(n=(s=$(o.containment))[0])&&(t=/(scroll|auto)/.test(s.css("overflow")),this.containment=[(parseInt(s.css("borderLeftWidth"),10)||0)+(parseInt(s.css("paddingLeft"),10)||0),(parseInt(s.css("borderTopWidth"),10)||0)+(parseInt(s.css("paddingTop"),10)||0),(t?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(s.css("borderRightWidth"),10)||0)-(parseInt(s.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(s.css("borderBottomWidth"),10)||0)-(parseInt(s.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=s)):this.containment=o.containment:this.containment=[0,0,h.scrollWidth-this.helperProportions.width-this.margins.left,h.scrollHeight-this.helperProportions.height-this.margins.top]:this.containment=[K()-this.offset.relative.left-this.offset.parent.left,q()-this.offset.relative.top-this.offset.parent.top,K()+i.innerWidth-this.helperProportions.width-this.margins.left,q()+i.innerHeight-this.helperProportions.height-this.margins.top]:this.containment=null},t.prototype._adjustOffsetFromHelper=function(t){"string"==typeof t&&(t=t.split(" ")),Array.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},t.prototype._isRootNode=function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},t.prototype._generatePosition=function(t,i){var s,n,h=this.options,o=this._isRootNode(this.scrollParent[0]),r=t.pageX,a=t.pageY;return o&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),i&&(this.containment&&(this.relativeContainer?(n=this.relativeContainer.offset(),s=[this.containment[0]+n.left,this.containment[1]+n.top,this.containment[2]+n.left,this.containment[3]+n.top]):s=this.containment,t.pageX-this.offset.click.left<s[0]&&(r=s[0]+this.offset.click.left),t.pageY-this.offset.click.top<s[1]&&(a=s[1]+this.offset.click.top),t.pageX-this.offset.click.left>s[2]&&(r=s[2]+this.offset.click.left),t.pageY-this.offset.click.top>s[3]&&(a=s[3]+this.offset.click.top)),"y"===h.axis&&(r=this.originalPageX),"x"===h.axis&&(a=this.originalPageY)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:o?0:this.offset.scroll.top),left:r-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:o?0:this.offset.scroll.left)}},t.prototype._clear=function(){this.helper.removeClass("nui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()};return t.prototype._blurActiveElement=function(t){var i,s=function(t){var i;try{i=t.activeElement}catch(t){i=h}return i||(i=h),i.nodeName||(i=h),i}(this.document[0]);$(t.target).closest(s).length||(i=s)&&"body"!==i.nodeName.toLowerCase()&&$(i).trigger("blur")},t})),c.d("UILayerWindow",["$","UIMouse"],(function(){var $=c.$;function t(t,i){this.element=t,this.widgetName=this.widgetName||"UILayerWindow",this.widgetEventPrefix="layerWindow",this.options=_(this.options,i),c.UIMouse.prototype.constructor.apply(this,arguments),this.create()}return t.prototype=Object.create(c.UIMouse.prototype),t.prototype.constructor=t,t.prototype.create=function(){this.bodyRect=h.getBoundingClientRect(),i.addEventListener("resize",function(){this.bodyRect=h.getBoundingClientRect(),this.limitHorizontal(this.left,this.width,!0),this.limitVertical(this.top,this.height,!0)}.bind(this),{passive:!0}),this.left=parseInt(localStorage.getItem("ssPanelLeft")),this.left||(this.left=200),this.top=parseInt(localStorage.getItem("ssPanelTop")),this.top||(this.top=100),this.width=355,this.height=parseInt(localStorage.getItem("ssPanelHeight")),this.height||(this.height=400),this.limitHorizontal(this.left,this.width),this.limitVertical(this.top,this.height),this._setupHandles(),this._mouseInit()},t.prototype._setupHandles=function(){this.$title=this.element.find(".n2_ss_layer_window__title_inner").on("mousedown",this._mouseDown.bind(this)),this.$resize=$('<div class="n2_ss_layer_window__resize"></div>').on("mousedown",this._mouseDown.bind(this)).appendTo(this.element)},t.prototype._mouseInit=function(){},t.prototype._mouseCapture=function(e){return this.$title.is(e.target)?(this.currentAction="move",!0):!!this.$resize.is(e.target)&&(this.currentAction="resize",!0)},t.prototype._mouseStart=function(e){var t=this.element[0].getBoundingClientRect();this.context={},"move"===this.currentAction?this.context.mouseDiff={x:e.clientX-t.left,y:e.clientY-t.top}:"resize"===this.currentAction&&(this.context.mouseDiff={y:e.clientY-t.top-t.height})},t.prototype._mouseDrag=function(e){"move"===this.currentAction?(this.limitHorizontal(e.clientX-this.context.mouseDiff.x,this.width),this.limitVertical(e.clientY-this.context.mouseDiff.y,this.height)):"resize"===this.currentAction&&this.limitVertical(this.top,e.clientY-this.top-this.context.mouseDiff.y)},t.prototype._mouseStop=function(e){"move"===this.currentAction?(this.limitHorizontal(e.clientX-this.context.mouseDiff.x,this.width,!0),this.limitVertical(e.clientY-this.context.mouseDiff.y,this.height,!0)):"resize"===this.currentAction&&this.limitVertical(this.top,e.clientY-this.top-this.context.mouseDiff.y,!0),delete this.currentAction},t.prototype.limitVertical=function(t,i,s){this.height=i,this.top=Math.min(Math.max(t,60),this.bodyRect.height-this.height),this.top<60&&(this.height=this.height+this.top-60,this.top=60),this.height=Math.max(this.height,200),this.element.css({top:this.top+"px",height:this.height+"px"}),s&&(localStorage.setItem("ssPanelTop",this.top),localStorage.setItem("ssPanelHeight",this.height))},t.prototype.limitHorizontal=function(t,i,s){this.left=Math.min(Math.max(t,50),this.bodyRect.width-i),this.element.css({left:this.left+"px"}),s&&localStorage.setItem("ssPanelLeft",this.left)},t})),c.d("UIMouse",["$","UIWidgetBase"],(function(){var $=c.$,t=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),i=!1;function n(t,i){this.widgetName=this.widgetName||"UIMouse",this.options=f({cancel:"input, textarea, button, select, option",distance:1,delay:0},this.options),c.UIWidgetBase.prototype.constructor.apply(this,arguments)}return $(s).on("mouseup",(function(){i=!1})),n.prototype=Object.create(c.UIWidgetBase.prototype),n.prototype.constructor=n,n.prototype._mouseInit=function(){var t=this;this.element.on("mousedown."+this.widgetName,(function(i){return t._mouseDown(i)})).on("click."+this.widgetName,(function(i){if(!0===$.data(i.target,t.widgetName+".preventClickEvent"))return $.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1}))},n.prototype._mouseDestroy=function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},n.prototype._mouseDown=function(t){if(!i){s.activeElement&&s.activeElement!==h&&s.activeElement.blur(),this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var n=this,o=1===t.which,a=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&$(t.target).closest(this.options.cancel).length;return!(o&&!a&&this._mouseCapture(t))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=r((function(){n.mouseDelayMet=!0}),this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===$.data(t.target,this.widgetName+".preventClickEvent")&&$.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return n._mouseMove(t)},this._mouseUpDelegate=function(t){return n._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),i=!0,!0))}},n.prototype._mouseMove=function(i){if(this._mouseMoved){if(t&&(!s.documentMode||s.documentMode<9)&&!i.button)return this._mouseUp(i);if(!i.which)if(i.originalEvent.altKey||i.originalEvent.ctrlKey||i.originalEvent.metaKey||i.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(i)}return(i.which||i.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(i),i.preventDefault()):(this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,i),this._mouseStarted?this._mouseDrag(i):this._mouseUp(i)),!this._mouseStarted)},n.prototype._mouseUp=function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted?(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&$.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)):this._mouseCancel(t),this._mouseDelayTimer&&(a(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,i=!1,t.preventDefault()},n.prototype._mouseDistanceMet=function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},n.prototype._mouseDelayMet=function(){return this.mouseDelayMet},n.prototype._mouseStart=function(){},n.prototype._mouseDrag=function(){},n.prototype._mouseStop=function(){},n.prototype._mouseCancel=function(){},n.prototype._mouseCapture=function(){return!0},n})),c.d("UIResizeBar",["$","UIMouse"],(function(){var $=c.$;function t(t,i){this.element=t,this.widgetName=this.widgetName||"UIResizable",this.widgetEventPrefix="resize",this.options=f({resize:null,start:null,stop:null},this.options,i),c.UIMouse.prototype.constructor.apply(this,arguments),this.create()}return t.prototype=Object.create(c.UIMouse.prototype),t.prototype.constructor=t,t.prototype.create=function(){this.options;this.element.addClass("nui_resize_bar"),this._setupHandles(),this._mouseInit(),this._trigger("create",null,{})},t.prototype._setupHandles=function(){var t=["e","w"];this.handles={},this.$handles=$();for(var i=0;i<t.length;i++){var s=t[i],n=$("<div>").addClass("nui_resize_bar__handle nui_resize_bar__handle--"+s).on({mousedown:function(t,e){this.currentHandle=t,this._mouseDown(e)}.bind(this,s)}).appendTo(this.element);this.handles[s]=n,this.$handles=this.$handles.add(n)}},t.prototype._mouseStart=function(t){this.currentData=this.originalData={margin:parseInt(this.element.css("marginLeft")),width:parseInt(this.element.width())},this.originalMousePosition={left:t.pageX};var i=this.handles[this.currentHandle].css("cursor");return $("body").css("cursor",i),this._trigger("start",t,this.ui()),!0},t.prototype._mouseDrag=function(t){var i=t.pageX-this.originalMousePosition.left||0;this.currentData={},"e"===this.currentHandle?(this.currentData.margin=this.originalData.margin,this.currentData.width=Math.max(0,this.originalData.width+i)):"w"===this.currentHandle&&(this.currentData.margin=Math.max(0,this.originalData.margin+i),this.currentData.width=Math.max(0,this.originalData.width-i)),this.currentData.width=Math.max(0,this.currentData.width),this._trigger("resize",t,this.ui()),this.element.css("marginLeft",this.currentData.margin+"px"),this.element.css("width",this.currentData.width+"px")},t.prototype._mouseStop=function(t){$("body").css("cursor","auto"),this._trigger("stop",t,this.ui())},t.prototype.ui=function(){return{currentData:this.currentData}},t})),c.d("UISlider",["$","UIMouse"],(function(){var $=c.$;function t(t,i){this.element=$(t),this.widgetName=this.widgetName||"UISlider",this.widgetEventPrefix="sliding",this.options=f({min:0,max:100,step:1,value:0,change:null,sliding:null,start:null,stop:null},this.options,i),c.UIMouse.prototype.constructor.apply(this,arguments),this.create()}return t.prototype=Object.create(c.UIMouse.prototype),t.prototype.constructor=t,t.prototype.create=function(){this._mouseSliding=!1,this._mouseInit(),this._calculateNewMax(),this.element.addClass("nui-slider nui-slider-horizontal"),this._refresh()},t.prototype.doAction=function(t){switch(c.UIWidgetBase.prototype.doAction.apply(this,arguments),t){case"value":return this._value()}},t.prototype.setOption=function(t,i){switch(c.UIWidgetBase.prototype.setOption.call(this,t,i),t){case"value":this._refreshValue(),this._change(null,0);break;case"step":case"min":case"max":this._calculateNewMax(),this._refreshValue()}},t.prototype._refresh=function(){this._createHandle(),this._refreshValue()},t.prototype._createHandle=function(){var t=this.element.find(".nui-slider-handle");t.length?this.handle=t:this.handle=$("<span></span>"),this.handle.addClass("nui-slider-handle").appendTo(this.element)},t.prototype._mouseCapture=function(t){var i,s,n=this.handle;return!this.options.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),!1!==this._start(t)&&(this._mouseSliding=!0,n.trigger("focus"),this._slide(t,s),!0))},t.prototype._mouseStart=function(){return this.lastValue=Number.MAX_VALUE,!0},t.prototype._mouseDrag=function(t){var i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i);return this.lastValue!=s&&(this._slide(t,s),this.lastValue=s),!1},t.prototype._mouseStop=function(t){return this._mouseSliding=!1,this._stop(t),this._change(t),!1},t.prototype._mouseCancel=function(e){this._trigger("cancel",e)},t.prototype._normValueFromMouse=function(t){var i,s,n,h;return i=this.elementSize.width,(s=(t.x-this.elementOffset.left)/i)>1&&(s=1),s<0&&(s=0),n=this._valueMax()-this._valueMin(),h=this._valueMin()+s*n,this._trimAlignValue(h)},t.prototype._trimAlignValue=function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var i=this.options.step>0?this.options.step:1,s=(t-this._valueMin())%i,n=t-s;return 2*Math.abs(s)>=i&&(n+=s>0?i:-i),parseFloat(n.toFixed(5))},t.prototype._calculateNewMax=function(){var t=this.options.max,i=this._valueMin(),s=this.options.step;(t=Math.round((t-i)/s)*s+i)>this.options.max&&(t-=s),this.max=parseFloat(t.toFixed(this._precision()))},t.prototype._precision=function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},t.prototype._precisionOf=function(t){var i=t.toString(),s=i.indexOf(".");return-1===s?0:i.length-s-1},t.prototype._change=function(t){this._mouseSliding||this._trigger("change",t,this._uiHash())},t.prototype.value=function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value()},t.prototype._value=function(){var t=this.options.value;return t=this._trimAlignValue(t)},t.prototype._valueMin=function(){return this.options.min},t.prototype._valueMax=function(){return this.max},t.prototype._refreshValue=function(){var t=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?(t-i)/(s-i)*100:0;this.handle.css("left",n+"%")},t.prototype._uiHash=function(t){return{handle:this.handle[0],value:t!==o?t:this.value()}},t.prototype._start=function(t){return this._trigger("start",t,this._uiHash())},t.prototype._slide=function(t,i){i!==this.value()&&!1!==this._trigger("sliding",t,this._uiHash(i))&&this.value(i)},t.prototype._stop=function(t){this._trigger("stop",t,this._uiHash())},t})),c.d("UISortable",["$","UIMouse"],(function(){var $=c.$;function t(t,i){this.element=t,this.widgetName=this.widgetName||"UISortable",this.widgetEventPrefix="sortable",this.options=f({items:"> *",handle:"",placeholder:!1,helper:"original",forcePlaceholderSize:!1,forceHelperSize:!1,axis:!1,droppables:!1},this.options,i),this.isOver=!1,c.UIMouse.prototype.constructor.apply(this,arguments),this.create()}return t.prototype=Object.create(c.UIMouse.prototype),t.prototype.constructor=t,t.prototype.create=function(){this._mouseInit()},t.prototype._mouseCapture=function(e){if(this.options.disabled)return!1;var t=null,i=$(e.target);if(""!==this.options.handle){var s=this.element.find(this.options.items+" "+this.options.handle);if(-1===s.index(i)&&!s.has(i).length)return!1}var n=this.element.find(this.options.items);return!!(t=-1!==n.index(i)?i:n.has(i)).length&&(this.currentItem=t,!0)},t.prototype._mouseStart=function(e){this._trigger("beforestart",e,{currentItem:this.currentItem}),this.context={e:e,original:{pageX:e.pageX,pageY:e.pageY,clientX:e.clientX,clientY:e.clientY,elementBCR:this.element[0].getBoundingClientRect(),currentItemBCR:this.currentItem[0].getBoundingClientRect()},offsetShift:{top:0,left:0},scrollCB:this._mouseScroll.bind(this)},this.element.addClass("n2-ui-sortable-in-progress"),this._cacheItems(),this.placeholder=$("<div></div>").addClass(this.options.placeholder||this.currentItem[0].className);var t={width:this.currentItem.width()+"px",height:this.currentItem.height()+"px"};"clone"===this.options.helper?this.helper=this.currentItem.clone():"clone_hide"===this.options.helper?(this.helper=this.currentItem.clone(),this.currentItem.css("display","none")):this.helper=this.currentItem,this.options.forceHelperSize&&this.helper.css(t),this.options.forcePlaceholderSize&&this.placeholder.css(t),this.helper.addClass("n2-ui-sortable-helper").css({position:"absolute",zIndex:"1000"}).appendTo(this.element),this._trigger("start",e,this.ui()),i.addEventListener("scroll",this.context.scrollCB,{capture:!0,passive:!0})},t.prototype._mouseDrag=function(e){this.context.e=e;var t=this.element[0].getBoundingClientRect(),i={};if(!this.options.axis||"x"===this.options.axis){var s=t.left+this.context.original.clientX-e.clientX;this.context.offsetShift.left=e.pageX-this.context.original.pageX-this.context.original.elementBCR.left+s,i.left=this.context.original.currentItemBCR.left-s+"px"}if(!this.options.axis||"y"===this.options.axis){var n=t.top+this.context.original.clientY-e.clientY;this.context.offsetShift.top=e.pageY-this.context.original.pageY-this.context.original.elementBCR.top+n,i.top=this.context.original.currentItemBCR.top-n+"px"}this.helper.css(i);var h=this._findClosestItem(e),o="before"===h[1]?this.items[Math.max(0,h[2]-1)]:this.items[Math.min(this.items.length-1,h[2])];"clone"===this.options.helper&&(h[0].is(this.currentItem)||$(o).is(this.currentItem))?this.placeholder.detach():this.positionPlaceholder(h),this.options.droppables&&("over"!==h[1]?this.isOver&&(this._trigger("out",e,this.ui()),this.isOver=!1):(this.isOver&&!this.isOver.is(h[0])&&(this._trigger("out",e,this.ui()),this.isOver=!1),this.isOver||(this.isOver=h[0],this._trigger("over",e,this.ui()))))},t.prototype.positionPlaceholder=function(t){switch(t[1]){case"before":this.placeholder.insertBefore(t[0]);break;case"after":this.placeholder.insertAfter(t[0]);break;case"over":this.placeholder.detach()}},t.prototype._mouseStop=function(e){this.context.e=e,this._trigger("beforestop",e,this.ui()),i.removeEventListener("scroll",this.context.scrollCB,{capture:!0,passive:!0}),this.placeholder.remove();var t=this._findClosestItem(e);switch(t[1]){case"before":this.currentItem.insertBefore(t[0]);break;case"after":this.currentItem.insertAfter(t[0])}this.helper.removeClass("n2-ui-sortable-helper").css({position:"",zIndex:"",left:"",top:""}),"clone"!==this.options.helper&&"clone_hide"!==this.options.helper||this.helper.remove(),"clone_hide"===this.options.helper&&this.currentItem.css("display",""),this.element.removeClass("n2-ui-sortable-in-progress"),"over"===t[1]?(this._trigger("drop",e,this.ui()),this._trigger("out",e,this.ui())):this._trigger("stop",e,this.ui()),this.currentItem=null},t.prototype._findClosestItem=function(e){for(var t,i,s,n=Number.MAX_VALUE,h=e.pageX-this.context.offsetShift.left,o=e.pageY-this.context.offsetShift.top,r=0;r<this.itemsData.length;r++){var a=this.itemsData[r];for(var c in a.side){var l=Math.sqrt(Math.pow((h-a.side[c].left)/a.width,2)+Math.pow((o-a.side[c].top)/a.height,2));l<n&&(n=l,t=a.item,i=c,"after"===c?s=r+1:"before"===c&&(s=r))}}return[t,i,s]},t.prototype.getItems=function(){return this.element.find(this.options.items)},t.prototype._cacheItems=function(){this.items=this.getItems(),this.itemsData=[];for(var t=0;t<this.items.length;t++)if("original"!==this.options.helper||this.items[t]!==this.currentItem[0]){var s=this.items.eq(t).offset(),n=this.items.eq(t).width(),h=this.items.eq(t).height(),o={};if(this.options.droppables&&!this.currentItem.hasClass(this.options.droppables)&&this.items.eq(t).hasClass(this.options.droppables)?(o.before={left:s.left+n/6,top:s.top+h/6},o.over={left:s.left+3*n/6,top:s.top+3*h/6},o.after={left:s.left+5*n/6,top:s.top+5*h/6}):(o.before={left:s.left+n/4,top:s.top+h/4},o.after={left:s.left+3*n/4,top:s.top+3*h/4}),i.n2const.isRTL()){var r=o.after;o.after=o.before,o.before=r}this.itemsData.push({item:this.items.eq(t),side:o,width:n,height:h})}},t.prototype._mouseScroll=function(){var e=this.context.e;s.dispatchEvent(new MouseEvent("mousemove",{clientX:e.clientX,clientY:e.clientY}))},t.prototype.ui=function(){return{placeholder:this.placeholder,helper:this.helper,item:this.currentItem,droppable:this.isOver}},t})),c.d("UIWidgetBase",["$"],(function(){var $=c.$;function t(t,i){var s=t[0];this.document=$(s.style?s.ownerDocument:s.document||s),this.window=$(this.document[0].defaultView||this.document[0].parentWindow),this.disabled=!1,this.plugins=[]}return t.prototype.setOption=function(t,i){return this.options[t]=i,this},t.prototype.destroy=function(){return this},t.prototype._trigger=function(t,i,s){var n,h,o=this.options[t];if(s=s||{},(i=$.Event(i)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],h=i.originalEvent)for(n in h)n in i||(i[n]=h[n]);return this.element.trigger(i,s),!("function"==typeof o&&!1===o.apply(this.element[0],[i].concat(s))||i.isDefaultPrevented())},t.prototype._triggerInteraction=function(){this.element.trigger("interaction")},t.addPlugin=function(t,i,s){for(var n in s)t.plugins[n]=t.plugins[n]||[],t.plugins[n].push([i,s[n]])},t.prototype.callPlugin=function(t,i,s){var n=this.constructor.plugins[t];if(n&&(s||this.element[0].parentNode&&11!==this.element[0].parentNode.nodeType))for(var h=0;h<n.length;h++)this.options[n[h][0]]&&n[h][1].apply(this.element,i)},t})),c.d("NextendVisualCore",["$"],(function(){function t(t,i){this.id=t.id,this.visualManager=i,this.setValue(t.value,!1),this.visual=t,this.visualManager.visuals[this.id]=this}return t.prototype.compare=function(t){for(var i=Math.max(this.value.length,t.length),s=0;s<i;s++)if(!this._compareTab(this.value[s]===o?{}:this.value[s],t[s]===o?{}:t[s]))return!1;return!0},t.prototype._compareTab=function(t,i){var s=Object.getOwnPropertyNames(t),n=Object.getOwnPropertyNames(i);if(0===t.length&&0===n.length)return!0;if(s.length!=n.length)return!1;for(var h=0;h<s.length;h++){var o=s[h];if(t[o]!==i[o])return!1}return!0},t.prototype.setValue=function(t,i){var s=null;if("string"==typeof t){var n=t;"{"!=n[0]?(this.base64=n,n=c.Base64.decode(n)):this.base64=c.Base64.encode(n),s=JSON.parse(n)}else s=t;this.name=s.name,this.value=s.data,i&&this.render()},t.prototype.isSystem=function(){return 1==this.visual.system},t.prototype.isEditable=function(){return 1==this.visual.editable},t.prototype.activate=function(e,t){e&&e.preventDefault(),this.visualManager.changeActiveVisual(this),"function"==typeof t?this.visualManager.controller.asyncVisualData(this.value,this.visualManager.showParameters,t):this.visualManager.controller.load(this.value,!1,this.visualManager.showParameters)},t.prototype.active=function(){},t.prototype.notActive=function(){},t.prototype.delete=function(e){e&&e.preventDefault(),this._delete()},t.prototype._delete=function(){return c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.visualManager.parameters.ajaxUrl,{nextendaction:"deleteVisual"}),data:{visualId:this.id},dataType:"json"}).done(function(t){t.data.visual;this.visualManager.activeVisual&&this.id==this.visualManager.activeVisual.id&&this.visualManager.changeActiveVisual(null),delete this.visualManager.visuals[this.id],delete this.set.visuals[this.id],this.row.remove(),this.visualManager.$.trigger("visualDelete",[this.id]),c.Notification.success(n2_("Deleted."))}.bind(this))},t.prototype.render=function(){},t.prototype.isUsed=function(){return!1},t})),c.d("NextendFragmentEditorController",["$","NextendFragmentEditorControllerWithEditor"],(function(){var $=c.$;function t(){c.NextendFragmentEditorControllerWithEditor.prototype.constructor.apply(this,arguments),this.clearTabButton=$("#n2-"+this.type+"-editor"+this.type+"-clear-tab").on("click",this.clearCurrentTab.bind(this)),this.$tabField=$("#n2-"+this.type+"-editor"+this.type+"-state").on("nextendChange.n2-editor",this.tabChanged.bind(this)),this.$tabContainer=$("#n2-"+this.type+"-editor"+this.type+"-state_tab")}return t.prototype=Object.create(c.NextendFragmentEditorControllerWithEditor.prototype),t.prototype.constructor=t,t.prototype.loadDefaults=function(){c.NextendFragmentEditorControllerWithEditor.prototype.loadDefaults.call(this),this.currentTabIndex=0,this._renderTimeout=!1,this._delayStart=0},t.prototype._load=function(t,i,s){this.currentVisual=[];for(var n=0;n<t.length;n++)this.currentVisual[n]=_(this.getCleanVisual(),t[n]);this.localModePreview={},this.mode=s.previewMode,!1===i&&(i=this.getTabs());for(n=this.currentVisual.length;n<i.length;n++)this.currentVisual[n]=this.getCleanVisual();if(!1!==s.previewHTML&&""!==s.previewHTML&&(this.localModePreview[s.previewMode]=s.previewHTML),this.setPreview(),!1===i){i=[];for(n=0;n<this.currentVisual.length;n++)i.push("#"+n)}this.setTabs(i)},t.prototype.getCleanVisual=function(){return{}},t.prototype.getTabs=function(){return[]},t.prototype.setTabs=function(t){for(var i=this.$tabField.data("field"),s={},n=0;n<t.length;n++)s[n]=t[n];i.setOptions(s,this.$tabContainer,"0"),i.insideChange("0")},t.prototype.tabChanged=function(){s.activeElement&&s.activeElement.blur();var t=this.$tabField.val();this.currentTabIndex=t,this.currentVisual[t]===o&&(this.currentVisual[t]={});var i=f({},this.currentVisual[0]);"0"!==t?(f(i,this.currentVisual[t]),this.clearTabButton.css("display","")):this.clearTabButton.css("display","none"),this.editor.load(i),this._tabChanged()},t.prototype._tabChanged=function(){this.renderCSS()},t.prototype.clearCurrentTab=function(e){e&&e.preventDefault(),this.currentVisual[this.currentTabIndex]={},this.tabChanged(),this.renderCSS()},t.prototype.setPreview=function(){},t.prototype.propertyChanged=function(e,t,i){this.isChanged=!0,this.currentVisual[this.currentTabIndex][t]=i,this.renderPreview()},t.prototype.renderPreview=function(){var t=$.now();this._renderTimeout?(a(this._renderTimeout),t-this._delayStart>100&&(this.renderCSS(),this._delayStart=t)):this._delayStart=t,this._renderTimeout=r(this.renderCSS.bind(this),33)},t.prototype.renderCSS=function(){this._renderTimeout=!1},t})),c.d("NextendFragmentEditorControllerWithEditor",["$"],(function(){var $=c.$;function t(){this.loadDefaults(),this.lightbox=$("#n2-lightbox-"+this.type),this.editor=this.initEditor(),this.editor.$.on("change",this.propertyChanged.bind(this))}return t.prototype.loadDefaults=function(){this.type="",this.isChanged=!1,this.visible=!1},t.prototype.pause=function(){},t.prototype.getEmptyVisual=function(){return[]},t.prototype.get=function(){return this.currentVisual},t.prototype.initEditor=function(){return new c.NextendFragmentEditor},t.prototype.propertyChanged=function(e,t,i){this.isChanged=!0,this.currentVisual[t]=i},t.prototype.load=function(t,i,s){this.isChanged=!1,this._load(t,i,s)},t.prototype._load=function(t,i,s){this.currentVisual=_({},t),this.loadToEditor()},t.prototype.loadToEditor=function(){this.editor.load(this.currentVisual)},t.prototype.show=function(){this.visible=!0,c.WindowManager.addWindow("visual")},t.prototype.close=function(){this.visible=!1,c.WindowManager.removeWindow()},t})),c.d("CSSRenderer","$",(function(){function t(){}return t.prototype.decodeData=function(t){if("object"==typeof t)return t;if(""===t)return!1;"{"!==t[0]&&(t=c.Base64.decode(t));var i=JSON.parse(t);return i.data!==o&&i.data},t.prototype.getCSS=function(t,i,s,n,h){h=f({deleteRule:!1},h);var o="",r=new RegExp("@pre","g"),a=new RegExp("@selector","g");for(var l in n.selectors){var u=l.replace(r,t).replace(a,i);o+=u+"{\n"+n.selectors[l]+"}\n",h.deleteRule&&c._css.deleteRule(u)}if(n.renderOptions.combined)for(var d=0;d<s.length;d++)o=o.replace(new RegExp("@tab"+d,"g"),this.render(s[d]));else for(d=0;d<s.length;d++)s[d]=f({},s[d]),o=o.replace(new RegExp("@tab"+d,"g"),this.render(s[d]));return o},t.prototype.render=function(t){var i=this.makeVisualData(t),s="",n="";for(var h in i.raw!==o&&(n=i.raw,delete i.raw),i)s+=this.deCase(h)+": "+i[h]+";\n";return s+=n},t.prototype.makeVisualData=function(t){var i={};for(var s in t)t.hasOwnProperty(s)&&"function"!=typeof t[s]&&this["makeStyle"+s](t[s],i);return i},t.prototype.deCase=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()}))},t})),c.d("NextendFragmentEditor","$",(function(){var $=c.$;function t(){this.fields={},this.$=$(this)}return t.prototype.load=function(t){this._off(),this._on()},t.prototype._on=function(){for(var t in this.fields)this.fields[t].element.on(this.fields[t].events)},t.prototype._off=function(){for(var t in this.fields)this.fields[t].element.off(".n2-editor")},t.prototype.trigger=function(t,i){this.$.trigger("change",[t,i])},t})),c.d("NextendVisualWithSet",["$","NextendVisualCore"],(function(){function t(t,i,s){this.set=i,c.NextendVisualCore.prototype.constructor.call(this,t,s)}return t.prototype=Object.create(c.NextendVisualCore.prototype),t.prototype.constructor=t,t.prototype.active=function(){var t=this.set.set.id;this.visualManager.changeSet(t),c.NextendVisualCore.prototype.active.call(this)},t})),c.d("NextendVisualWithSetRow",["$","NextendVisualWithSet"],(function(){var $=c.$;function t(){c.NextendVisualWithSet.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.NextendVisualWithSet.prototype),t.prototype.constructor=t,t.prototype.createRow=function(){return this.row=$('<div class="n2_fullscreen_editor__visual"></div>').append($('<div class="n2_fullscreen_editor__visual_label"></div>').text(this.name).on("click",this.activate.bind(this))),this.isSystem()||this.row.append($('<div class="n2_fullscreen_editor__visual_actions"></div>').append($('<div class="n2_fullscreen_editor__visual_action"><i class="ssi_16 ssi_16--delete"></i></div>').on("click",this.delete.bind(this)))),this.row},t.prototype.setValue=function(t,i){c.NextendVisualWithSet.prototype.setValue.call(this,t,i),this.row&&this.row.find(".n2_fullscreen_editor__visual_label").text(this.name)},t.prototype.active=function(){this.row.addClass("n2_fullscreen_editor__visual--active"),c.NextendVisualWithSet.prototype.active.call(this)},t.prototype.notActive=function(){this.row.removeClass("n2_fullscreen_editor__visual--active"),c.NextendVisualWithSet.prototype.notActive.call(this)},t})),c.d("NextendVisualWithSetRowMultipleSelection",["$","NextendVisualWithSetRow"],(function(){var $=c.$;function t(t,i,s){this.checked=!1,t.system=1,t.editable=0,c.NextendVisualWithSetRow.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.NextendVisualWithSetRow.prototype),t.prototype.constructor=t,t.prototype.createRow=function(){var t=c.NextendVisualWithSetRow.prototype.createRow.call(this);return this.checkbox=$('<div class="n2_fullscreen_editor__visual_select_tick"><i class="ssi_16 ssi_16--check"></i></div>').on("click",this.checkOrUnCheck.bind(this)).prependTo(t),t},t.prototype.setValue=function(t,i){this.name=t.name,this.value=t.data,this.row&&this.row.find(".n2_fullscreen_editor__visual_label").text(this.name),i&&this.render()},t.prototype.activate=function(e,t){e&&e.preventDefault(),this.visualManager.changeActiveVisual(this),this.visualManager.controller.setAnimationProperties(this.value)},t.prototype.checkOrUnCheck=function(e){e.preventDefault(),e.stopPropagation(),this.checked?this.unCheck():this.check()},t.prototype.check=function(){this.checked=!0,this.row.addClass("n2_fullscreen_editor__visual--selected"),this.activate()},t.prototype.unCheck=function(){this.checked=!1,this.row.removeClass("n2_fullscreen_editor__visual--selected"),this.activate()},t})),c.d("NextendVisualSetsManager","$",(function(){var $=c.$;return function(t){this.visualManager=t,this.$=$(this)}})),c.d("NextendVisualSet","$",(function(){var $=c.$;function t(t,i){this.set=t,this.visualManager=i,this.visualList=$('<div class="n2_fullscreen_editor__visual_list"></div>'),this.visualManager.sets[t.id]=this,""!==t.referencekey&&(this.visualManager.setsByReference[t.referencekey]=t),this.visualManager.setsSelector&&(this.option=$('<option value="'+t.id+'"></option>').text(t.value).appendTo(this.visualManager.setsSelector))}return t.prototype.active=function(){$.when(this._loadVisuals()).done(function(){this.visualList.appendTo(this.visualManager.visualListContainer)}.bind(this))},t.prototype.notActive=function(){this.visualList.detach()},t.prototype.loadVisuals=function(t){if(this.visuals===o){this.visuals={};for(var i=0;i<t.length;i++)this.addVisual(t[i])}},t.prototype._loadVisuals=function(){return null!=this.visuals||c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.visualManager.parameters.ajaxUrl,{nextendaction:"loadVisualsForSet"}),data:{setId:this.set.id},dataType:"json"}).done(function(t){this.loadVisuals(t.data.visuals)}.bind(this))},t.prototype.addVisual=function(t){return this.visuals[t.id]===o&&(this.visuals[t.id]=this.visualManager.createVisual(t,this),this.visualList.append(this.visuals[t.id].createRow())),this.visuals[t.id]},t.prototype.rename=function(t){this.set.value=t,this.option.text(t)},t.prototype.delete=function(){this.option.remove(),delete this.visualManager.sets[this.set.id]},t})),c.d("NextendVisualManagerCore","$",(function(){var $=c.$;function t(t){this.loadDefaults(),this.$=$(this),c["_"+this.type+"Manager"]=this,this.lightbox=$("#n2-lightbox-"+this.type),this.lightbox.find(".n2_fullscreen_editor__overlay").on("click",this.hide.bind(this)),this.visualListContainer=$('<div class="n2_fullscreen_editor__visual_list_container"></div>').appendTo(this.lightbox.find(".n2_fullscreen_editor__content_sidebar")),this.parameters=t,this.visuals={},this.controller=this.initController(),this.controller&&(this.renderer=this.controller.renderer),this.firstLoadVisuals(t.visuals),this.lightbox.find(".n2_fullscreen_editor__save_as_new").on("click",this.saveAsNew.bind(this)),this.cancelButton=this.lightbox.find(".n2_fullscreen_editor__cancel").on("click",this.hide.bind(this)),this.saveButton=this.lightbox.find(".n2_fullscreen_editor__save"),this.setVisual!==o&&this.saveButton.on("click",this.setVisual.bind(this))}return t.prototype.loadDefaults=function(){this.mode="linked",this.labels={visual:"visual",visuals:"visuals"},this.visualLoadDeferreds={},this.showParameters=!1},t.prototype.firstLoadVisuals=function(t){for(var i in t)this.sets[i].loadVisuals(t[i])},t.prototype.initController=function(){},t.prototype.getVisual=function(t){if(parseInt(t)>0){if(this.visuals[t]!==o)return this.visuals[t];if(this.visualLoadDeferreds[t]!==o)return this.visualLoadDeferreds[t];var i=$.Deferred();return this.visualLoadDeferreds[t]=i,this._loadVisualFromServer(t).done(function(){i.resolve(this.visuals[t]),delete this.visualLoadDeferreds[t]}.bind(this)).fail(function(){i.resolve({id:-1,name:n2_("Empty")}),delete this.visualLoadDeferreds[t]}.bind(this)),i}try{var s=t;return"{"!=s[0]&&(s=c.Base64.decode(s)),JSON.parse(s),{id:0,name:n2_("Static")}}catch(t){return{id:-1,name:n2_("Empty")}}},t.prototype._loadVisualFromServer=function(t){return c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.parameters.ajaxUrl,{nextendaction:"loadVisual"}),data:{visualId:t},dataType:"json"})},t.prototype.show=function(t,i,s){c.Esc.add(function(){return this.hide(),!0}.bind(this)),this.showParameters=f({previewMode:!1,previewHTML:!1},s),$("body").addClass("n2_body--fullscreen-editor-visible"),this.lightbox.addClass("n2_fullscreen_editor--visible"),this.loadDataToController(t),this.$.on("save",i),this._show()},t.prototype._show=function(){$(":focus").trigger("blur"),this.controller.show(),$(i).on({"keydown.visual":function(e){"TEXTAREA"===e.target.tagName||"INPUT"===e.target.tagName||e.target.isContentEditable||13===e.keyCode&&this.saveButton.trigger("click")}.bind(this)})},t.prototype.setAndClose=function(t){this.$.trigger("save",[t])},t.prototype.hide=function(e){this.controller.pause(),e!==o&&(e.preventDefault(),c.Esc.pop()),this.controller.close(),this.$.off("save"),$("body").removeClass("n2_body--fullscreen-editor-visible"),this.lightbox.removeClass("n2_fullscreen_editor--visible"),$(i).off("keydown.visual")},t.prototype.getDataFromController=function(t,i,s){return this.showParameters=f({previewMode:!1,previewHTML:!1},i),this.loadDataToController(t,s)},t.prototype.loadDataToController=function(t){this.isVisualData(t)?$.when(this.getVisual(t)).done(function(i){i.id>0?i.activate():console.error(t+" visual is not found linked")}.bind(this)):console.error(t+" visual not found")},t.prototype.isVisualData=function(t){return parseInt(t)>0},t.prototype.saveAsNew=function(e){e.preventDefault();var t=new c.ModalSimple("section-save-as",{destroyOnHide:!1,width:440});t.addContent(c.UI.modalIcon("ssi_48 ssi_48--plus","green")),t.addContent(c.UI.modalHeading(n2_("Save as")));var i=c.UI.modalFormRow(!0);t.addContent(i);var s=c.UI.modalFieldText(i,"name",n2_("Name"),""),n=c.UI.modalButton(n2_("Save as New"),"green");t.addButton(n),n.on("click",function(e){e.preventDefault();var i=s.val();""===i?c.Notification.error(n2_("Please fill the name field!")):this._saveAsNew(i).done(t.hide.bind(t,e),c.Notification.success(n2_("Saved.")))}.bind(this)),t.show()},t.prototype._saveAsNew=function(t){return c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.parameters.ajaxUrl,{nextendaction:"addVisual"}),data:{setId:this.getSetValue(),value:c.Base64.encode(JSON.stringify({name:t,data:this.controller.get("saveAsNew")}))},dataType:"json"}).done(function(t){var i=t.data.visual;this.changeActiveVisual(this.sets[i.referencekey].addVisual(i))}.bind(this))},t.prototype.saveActiveVisual=function(t){return c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.parameters.ajaxUrl,{nextendaction:"changeVisual"}),data:{visualId:this.activeVisual.id,value:this.getBase64(t)},dataType:"json"}).done(function(t){this.activeVisual.setValue(t.data.visual.value,!0)}.bind(this))},t.prototype.changeActiveVisual=function(t){this.activeVisual&&(this.activeVisual.notActive(),this.activeVisual=!1),t&&("static"==this.mode&&this.setMode("linked"),t.active(),this.activeVisual=t)},t.prototype.getBase64=function(t){return c.Base64.encode(JSON.stringify({name:t,data:this.controller.get("set")}))},t})),c.d("NextendVisualManagerMultipleSelection",["$","NextendVisualManagerVisibleSets"],(function(){var $=c.$;function t(t){c["_"+this.type+"Manager"]=this,this._lateInit=function(t){c.NextendVisualManagerVisibleSets.prototype.constructor.call(this,t)}.bind(this,t)}return t.prototype=Object.create(c.NextendVisualManagerVisibleSets.prototype),t.prototype.constructor=t,t.prototype.lateInit=function(){this.inited||(this.inited=!0,this._lateInit())},t.prototype.show=function(t,i,s){this.lateInit(),c.Esc.add(function(){return this.hide(),!0}.bind(this)),$("body").addClass("n2_body--fullscreen-editor-visible"),this.lightbox.addClass("n2_fullscreen_editor--visible");var n=0;if(""!=t)for(var h=t.split("||"),o=!1;n<h.length;n++)$.when(this.getVisual(h[n])).done((function(t){t&&t.check&&(t.check(),o||(o=!0,t.activate()))}));this.$.on("save",i),this.controller.start(s),0==n&&$.when(this.activeSet._loadVisuals()).done(function(){for(var t in this.activeSet.visuals){this.activeSet.visuals[t].activate();break}}.bind(this)),this._show()},t.prototype.setVisual=function(e){e.preventDefault(),this.setAndClose(this.getAsString()),this.hide(e)},t.prototype.getAsString=function(){var t=[];for(var i in this.sets){var s=this.sets[i];for(var n in s.visuals)s.visuals[n].checked&&t.push(s.visuals[n].id)}return 0==t.length&&this.activeVisual&&t.push(this.activeVisual.id),t.join("||")},t.prototype.hide=function(e){for(var t in c.NextendVisualManagerVisibleSets.prototype.hide.apply(this,arguments),this.sets){var i=this.sets[t];for(var s in i.visuals)i.visuals[s].unCheck()}},t})),c.d("NextendVisualManagerSetsAndMore",["$","NextendVisualManagerVisibleSets"],(function(){var $=c.$;function t(){c.NextendVisualManagerVisibleSets.prototype.constructor.apply(this,arguments),this.setMode(0)}return t.prototype=Object.create(c.NextendVisualManagerVisibleSets.prototype),t.prototype.constructor=t,t.prototype.setMode=function(t){if("static"==t&&this.changeActiveVisual(null),this.mode!=t){switch(t){case 0:this.cancelButton.css("display","none"),this.saveButton.off("click");break;case"static":default:this.cancelButton.css("display","inline-block"),this.saveButton.off("click").on("click",this.setVisualAsStatic.bind(this))}this.mode=t}},t.prototype.loadDataToController=function(t,i){if(parseInt(t)>0)$.when(this.getVisual(t)).done(function(t){t.id>0?(this.setMode("linked"),t.activate(o,i)):(this.setMode("static"),"function"==typeof i?this.controller.asyncVisualData("",this.showParameters,i):this.controller.load("",!1,this.showParameters))}.bind(this));else{var s="";this.setMode("static");try{s=this.getStaticData(t)}catch(t){}"function"==typeof i?this.controller.asyncVisualData(s,this.showParameters,i):this.controller.load(s,!1,this.showParameters)}},t.prototype.getStaticData=function(t){var i=t;"{"!==i[0]&&(i=c.Base64.decode(i));var s=JSON.parse(i).data;return s===o?"":s},t.prototype.setVisualAsStatic=function(e){e.preventDefault(),this.setAndClose(this.getBase64(n2_("Static"))),this.hide(e)},t})),c.d("NextendVisualManagerVisibleSets",["$","NextendVisualManagerCore"],(function(){var $=c.$;function t(){c.NextendVisualManagerCore.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.NextendVisualManagerCore.prototype),t.prototype.constructor=t,t.prototype.firstLoadVisuals=function(t){this.sets={},this.setsByReference={},this.setsSelector=$("#"+this.parameters.setsIdentifier+"sets_select");for(var i=0;i<this.parameters.sets.length;i++)this.newVisualSet(this.parameters.sets[i]);for(var s in this.initSetsManager(),t)this.sets[s].loadVisuals(t[s]);this.activeSet=this.sets[this.getSetValue()],this.activeSet.active(),this.setsSelector.length&&this.setsSelector.on("change",function(){this.activeSet.notActive(),this.activeSet=this.sets[this.getSetValue()],this.activeSet.active()}.bind(this))},t.prototype.initSetsManager=function(){new c.NextendVisualSetsManager(this)},t.prototype._loadVisualFromServer=function(t){return c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.parameters.ajaxUrl,{nextendaction:"loadSetByVisualId"}),data:{visualId:t},dataType:"json"}).done(function(t){this.sets[t.data.set.setId].loadVisuals(t.data.set.visuals)}.bind(this))},t.prototype.changeSet=function(t){this.getSetValue()!=t&&this.setsSelector.val(t).trigger("change")},t.prototype.changeSetById=function(t){this.sets[t]!==o&&this.changeSet(t)},t.prototype.newVisualSet=function(t){return new c.NextendVisualSet(t,this)},t.prototype.getSetValue=function(){return this.setsSelector.length?this.setsSelector.val():this.parameters.fixedSet},t})),c.d("NextendBrowse",["$"],(function(){var $=c.$,t={};function i(t){return $('<div class="n2_modal_filesystem_box n2_modal_filesystem_box--directory"><div class="n2_modal_filesystem_box__icon"><i class="ssi_64 ssi_64--folder"></i></div><div class="n2_modal_filesystem_box__label">'+t+"</div></div>")}function n(t,i){var s=$('<div class="n2_modal_filesystem_box n2_modal_filesystem_box--file" title="'+t+'"><div class="n2-button n2-button-icon n2-button-s n2-button-blue"><i class="ssi_16 ssi_16--check"></i></div><div class="n2_modal_filesystem_box__label">'+t+"</div></div>"),n=t.split(".").pop();return"mp4"!==n&&"mp3"!==n?$('<div class="n2_modal_filesystem_box__image"></div>').css("background-image","url("+encodeURI(c._imageHelper.fixed(i))+")").prependTo(s):$('<div class="n2_modal_filesystem_box__icon"><i class="ssi_64 ssi_64--dummy"></i></div>').prependTo(s),s}function h(t,i){this.url=t,this.uploadAllowed=parseInt(i),this.currentPath=localStorage.getItem("browsePath")||"",this.listeners=[];var s=null;this.node=$('<div class="n2_modal_filesystem__content"></div>').on("dragover",(function(e){null!==s?(a(s),s=null):$(e.currentTarget).addClass("n2-drag-over"),s=r((function(){$(e.currentTarget).removeClass("n2-drag-over"),s=null}),400)})),c._browse=this}return h.prototype.clear=function(){H(this.listeners),this.node.empty()},h.prototype.getNode=function(t,i){return this.clear(),this.node.attr("data-mode",t),this.mode=t,"multiple"===t&&(this.selected=[]),this.callback=i,this._loadPath(this.getCurrentFolder(),this._renderBoxes.bind(this)),this.node},h.prototype._renderBoxes=function(t){for(var s in this.clear(),localStorage.setItem("browsePath",this.getCurrentFolder()),$('<div class="n2_modal_filesystem__current_path">'+n2_("Current path")+": "+t.fullPath+"</div>").appendTo(this.node),this.uploadAllowed&&this.initUpload(),""!==t.path&&$('<div class="n2_modal_filesystem_box n2_modal_filesystem_box--directory-up"><div class="n2_modal_filesystem_box__icon"><i class="ssi_64 ssi_64--folderup"></i></div><div class="n2_modal_filesystem_box__label">'+n2_("Parent directory")+"</div></div>").appendTo(this.node).on("click",function(t){this._loadPath(t,this._renderBoxes.bind(this))}.bind(this,t.path+"/..")),t.directories)t.directories.hasOwnProperty(s)&&i(s).appendTo(this.node).on("click",function(t){this._loadPath(t,this._renderBoxes.bind(this))}.bind(this,t.directories[s]));for(var h in t.files)if(t.files.hasOwnProperty(h)){var o=n(h,t.files[h]).appendTo(this.node).on("click",this.clickImage.bind(this,t.files[h]));"multiple"===this.mode&&-1!==this.selected.indexOf(t.files[h])&&o.addClass("n2_modal_filesystem_box--active")}},h.prototype._loadPath=function(i,s){t[i]===o&&(t[i]=c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.url),data:{path:i},dataType:"json"})),$.when(t[i]).done(function(n){this.currentPath=n.data.path,t[n.data.path]=n,t[i]=n,s(n.data)}.bind(this))},h.prototype.initUpload=function(){$('<div class="n2_modal_filesystem_box n2_modal_filesystem_box--upload" id="n2-browse-upload"></div>').append('<div class="n2_modal_filesystem_box__icon"><i class="ssi_48 ssi_48--drop"></i></div>').append('<div class="n2_modal_filesystem_box__label">'+n2_("Drop files here")+"</div>").appendTo(this.node);var i=s.getElementById("n2-browse-upload");this.listeners.push(W(i,"dragover",function(e){e.preventDefault()}.bind(this))),this.listeners.push(W(i,"drop",function(e){e.preventDefault();var i=[];if(e.dataTransfer.items)for(var s=0;s<e.dataTransfer.items.length;s++)"file"===e.dataTransfer.items[s].kind&&i.push(e.dataTransfer.items[s].getAsFile());else for(s=0;s<e.dataTransfer.files.length;s++)i.push(e.dataTransfer.files[s]);if(i.length){var h=[];c.LoadingScreen.startLoading();for(s=0;s<i.length;s++)h.push(new Promise(function(h,o){var r=new XMLHttpRequest,a=new FormData;r.open("POST",c.AjaxHelper.makeAjaxUrl(this.url,{nextendaction:"upload"}),!0),r.onload=function(){var i=JSON.parse(r.response);i.data&&i.data.name?(t[i.data.path].data.files[i.data.name]=i.data.url,n(i.data.name,i.data.url).appendTo(this.node).on("click",this.clickImage.bind(this,i.data.url))):c.AjaxHelper.notification(i),h()}.bind(this),r.onerror=function(){o()},a.append("image",i[s]),a.append("path",this.currentPath),r.send(a)}.bind(this)));Promise.all(h).finally(function(){c.LoadingScreen.stopLoading()}.bind(this))}}.bind(this)))},h.prototype.clickImage=function(t,e){if("single"===this.mode)this.callback(t);else if("multiple"===this.mode){var i=this.selected.indexOf(t);-1===i?($(e.currentTarget).addClass("n2_modal_filesystem_box--active"),this.selected.push(t)):($(e.currentTarget).removeClass("n2_modal_filesystem_box--active"),this.selected.splice(i,1))}},h.prototype.getSelected=function(){return this.selected},h.prototype.getCurrentFolder=function(){return this.currentPath},h})),c.d("IconPack",["$"],(function(){var $=c.$;function t(t,i){this.currentQuery="",this.manager=t,this.data=i,this.$li=$('<div class="n2_modal_icons__list_item">'+i.label+"</div>").on("click",function(e){e.preventDefault(),this.activate()}.bind(this)).appendTo(this.manager.$list)}return t.prototype.load=function(){this.data.isLoaded===o&&($("head").append("<link rel='stylesheet' href='"+this.data.css+"' type='text/css' media='screen'>"),this.data.isLoaded=!0)},t.prototype.render=function(){if(this.table===o){for(var t in this.table=c.UI.modalFormTable(this.data.label),this.data.data)$('<div class="n2_modal_icons__icon" data-identifier="'+this.data.id+":"+t+'" data-kw="'+this.data.data[t].kw.toLowerCase()+'">'+this._render(t)+"</div>").on("click",function(e){this.manager.selectIcon($(e.currentTarget).data("identifier"),e)}.bind(this)).appendTo(this.table.$content);this.$icons=this.table.$content.find(".n2_modal_icons__icon")}},t.prototype.activate=function(){this.manager.activate(this),this.$li.addClass("n2_modal_icons__list_item--active"),this.load(),this.render(),this.search(this.manager.getQuery()),this.manager.$content.append(this.table.$table)},t.prototype.search=function(t){if(this.currentQuery!==t)if(t.length<=1)this.$icons.css("display","");else{var i=this.$icons.filter("[data-kw*='"+t+"']");this.$icons.not(i).css("display","none"),i.css("display","")}this.currentQuery=t},t.prototype.deActivate=function(){this.$li.removeClass("n2_modal_icons__list_item--active"),this.table.$table.detach()},t.prototype._render=function(t){return this.data.isLigature?'<i class="n2i '+this.data.class+'">'+t+"</i>":'<i class="n2i '+this.data.class+" "+this.data.prefix+t+'"></i>'},t.prototype.getIcon=function(t){return this.data.isLigature?{class:this.data.class,ligature:t}:{class:this.data.class+" "+this.data.prefix+t,ligature:""}},t})),c.d("Icons",["$"],(function(){var $=c.$;function t(t){for(var i in c.Icons=this,this.data=t,this.$list=$('<div class="n2_modal_icons__list"></div>'),this.iconPacks={},this.data)this.iconPacks[this.data[i].id]=new c.IconPack(this,this.data[i]);this.defaultId=Object.keys(this.iconPacks)[0]}return t.prototype.render=function(t){var i=t.split(":");if(2!==i.length)return!1;var s=i[0],n=i[1];if(this.iconPacks[s]===o)return!1;var h=this.iconPacks[s];return h.data.data[n]!==o&&(h.load(),h.getIcon(n))},t.prototype.showModal=function(t,i){this.callback=t;var s=!1;this.modal===o&&(s=!0,this.startModal());var n=!1,h=i.split(":");this.iconPacks[h[0]]!==o&&(this.iconPacks[h[0]].activate(),n=!0),s&&!n&&this.iconPacks[this.defaultId].activate(),this.modal.show()},t.prototype.selectIcon=function(t,e){this.callback(t),this.modal.hide(e)},t.prototype.startModal=function(){this.modal=new c.ModalLightbox(n2_("Icons"),"icons");var t=$('<div class="n2_modal__sidebar n2_form--dark"></div>');this.modal.addContent(t),this.$sidebar=$('<div class="n2_modal__sidebar_inner"></div>').appendTo(t);var i=$('<div class="n2_modal_icons__search_area"></div>').appendTo(this.$sidebar);this.$searchField=c.UI.modalFieldText(i,"search-icon",!1,"").attr("placeholder",n2_("Search")).on("keyup",function(e){this.activePack.search(this.$searchField.val())}.bind(this)),this.$list.appendTo(this.$sidebar);var s=$('<div class="n2_modal__content"></div>');this.$content=$('<div class="n2_modal__content_inner"></div>').appendTo(s),this.modal.addContent(s)},t.prototype.activate=function(t){this.activePack!==o&&this.activePack.deActivate(),this.activePack=t},t.prototype.getQuery=function(){return this.$searchField.val()},t})),c.d("NextendFontServiceGoogle",["$"],(function(){var $=c.$;function t(t,s,n,h){this.style=t,this.subset=s,this.fonts=n,this.loadedFamilies=h,$(i).on("n2Family",this.loadFamily.bind(this))}return t.prototype.loadFamily=function(e,t){var i=t.toLowerCase();return this.fonts[i]!==o&&-1===this.loadedFamilies.indexOf(this.fonts[i])?($("<link>").attr({rel:"stylesheet",type:"text/css",href:"//fonts.googleapis.com/css?family="+encodeURIComponent(this.fonts[i]+":"+this.style)+"&subset="+encodeURIComponent(this.subset)}).appendTo($("head")),this.loadedFamilies.push(this.fonts[i]),this.fonts[i]):t},t})),c.d("NextendFontEditor",["$","NextendFragmentEditor"],(function(){var $=c.$;function t(){c.NextendFragmentEditor.prototype.constructor.apply(this,arguments),this.fields={family:{element:$("#n2-font-editorfamily"),events:{"nextendChange.n2-editor":this.changeFamily.bind(this)}},color:{element:$("#n2-font-editorcolor"),events:{"outsideChange.n2-editor":this.changeColor.bind(this)}},size:{element:$("#n2-font-editorsize"),events:{"outsideChange.n2-editor":this.changeSize.bind(this)}},lineHeight:{element:$("#n2-font-editorlineheight"),events:{"outsideChange.n2-editor":this.changeLineHeight.bind(this)}},weight:{element:$("#n2-font-editorweight"),events:{"outsideChange.n2-editor":this.changeWeight.bind(this)}},decoration:{element:$("#n2-font-editordecoration"),events:{"outsideChange.n2-editor":this.changeDecoration.bind(this)}},align:{element:$("#n2-font-editortextalign"),events:{"outsideChange.n2-editor":this.changeAlign.bind(this)}},shadow:{element:$("#n2-font-editortshadow"),events:{"outsideChange.n2-editor":this.changeShadow.bind(this)}},letterSpacing:{element:$("#n2-font-editorletterspacing"),events:{"outsideChange.n2-editor":this.changeLetterSpacing.bind(this)}},wordSpacing:{element:$("#n2-font-editorwordspacing"),events:{"outsideChange.n2-editor":this.changeWordSpacing.bind(this)}},textTransform:{element:$("#n2-font-editortexttransform"),events:{"outsideChange.n2-editor":this.changeTextTransform.bind(this)}},css:{element:$("#n2-font-editorextracss"),events:{"outsideChange.n2-editor":this.changeCSS.bind(this)}}}}return t.prototype=Object.create(c.NextendFragmentEditor.prototype),t.prototype.constructor=t,t.prototype.load=function(t){this._off();var i=t.afont.split("||");this.fields.family.element.data("field").insideChange(i[0]),this.fields.color.element.data("field").insideChange(t.color),this.fields.size.element.data("field").insideChange(t.size.split("||").join("|*|")),this.fields.lineHeight.element.data("field").insideChange(t.lineheight),this.fields.weight.element.data("field").insideChange(t.weight),this.fields.decoration.element.data("field").insideChange([1==t.italic?"italic":"",1==t.underline?"underline":""].join("||")),this.fields.align.element.data("field").insideChange(t.align),this.fields.shadow.element.data("field").insideChange(t.tshadow.replace(/\|\|px/g,"")),this.fields.letterSpacing.element.data("field").insideChange(t.letterspacing),this.fields.wordSpacing.element.data("field").insideChange(t.wordspacing),this.fields.textTransform.element.data("field").insideChange(t.texttransform),this.fields.css.element.data("field").insideChange(t.extra),this._on()},t.prototype.changeFamily=function(){this.trigger("afont",this.fields.family.element.val())},t.prototype.changeColor=function(){this.trigger("color",this.fields.color.element.val())},t.prototype.changeSize=function(){this.trigger("size",this.fields.size.element.val().replace("|*|","||"))},t.prototype.changeLineHeight=function(){this.trigger("lineheight",this.fields.lineHeight.element.val())},t.prototype.changeWeight=function(){this.trigger("weight",this.fields.weight.element.val())},t.prototype.changeDecoration=function(){var t=this.fields.decoration.element.val(),i=0;-1!=t.indexOf("italic")&&(i=1),this.trigger("italic",i);var s=0;-1!=t.indexOf("underline")&&(s=1),this.trigger("underline",s)},t.prototype.changeAlign=function(){this.trigger("align",this.fields.align.element.val())},t.prototype.changeShadow=function(){this.trigger("tshadow",this.fields.shadow.element.val())},t.prototype.changeLetterSpacing=function(){this.trigger("letterspacing",this.fields.letterSpacing.element.val())},t.prototype.changeWordSpacing=function(){this.trigger("wordspacing",this.fields.wordSpacing.element.val())},t.prototype.changeTextTransform=function(){this.trigger("texttransform",this.fields.textTransform.element.val())},t.prototype.changeCSS=function(){this.trigger("extra",this.fields.css.element.val())},t})),c.d("NextendFontEditorController",["$","NextendFragmentEditorController"],(function(){var $=c.$;function t(){this.css=[],c.NextendFragmentEditorController.prototype.constructor.apply(this,arguments),this.preview=$('<div class="n2_form__table_preview"></div>').css("fontSize",c.CSSRendererFont.fontSize+"px").appendTo('.n2_form__table[data-field="table-font-preview"]'),this.initBackgroundColor()}return t.prototype=Object.create(c.NextendFragmentEditorController.prototype),t.prototype.constructor=t,t.prototype.loadDefaults=function(){c.NextendFragmentEditorController.prototype.loadDefaults.call(this),this.type="font",this.preview=null},t.prototype.initEditor=function(){return new c.NextendFontEditor},t.prototype.getCleanVisual=function(){return c.CSSRendererFont.getEmpty()},t.prototype.initBackgroundColor=function(){this.$background=$("#n2-font-editorpreview-background").on("nextendChange",function(){this.preview.css("background","#"+this.$background.val())}.bind(this)),this.preview.css("background","#"+this.$background.val())},t.prototype.getTabs=function(){return c.CSSRendererFont.rendererModes[this.mode].tabs},t.prototype.renderCSS=function(){this._renderTimeout=!1,this.clearCSS();var t=c.CSSRendererFont.addCSS("",this.getPreviewCssClass(),this.currentVisual,c.CSSRendererFont.rendererModes[this.mode]);this.css.push(t)},t.prototype.setPreview=function(){var t={fontClassName:this.getPreviewCssClass(),styleClassName:c._fontManager.styleClassName,styleClassName2:c._fontManager.styleClassName2},i="";this.localModePreview[this.mode]!==o?(this.preview.html(""),this.preview.append(c[this.localModePreview[this.mode]].renderFont(c._fontManager.fieldID,t))):(i=(i=c.CSSRendererFont.rendererModes[this.mode].preview).replace(/\{([^]*?)\}/g,(function(i,s){return t[s]})),this.preview.html(i))},t.prototype.getPreviewCssClass=function(){return"n2-"+this.type+"-editor-preview"},t.prototype.pause=function(){this.clearCSS()},t.prototype.clearCSS=function(){for(var t=0;t<this.css.length;t++)this.css[t].destroy();this.css=[]},t})),c.d("NextendFontManager",["$"],(function(){var $=c.$;function t(){this.$=$(this),this.showParameters=!1,this.type="font",this.css=[],this.styleClassName="",this.styleClassName2="",c._fontManager=this,this.lightbox=$("#n2-lightbox-"+this.type),this.lightbox.find(".n2_fullscreen_editor__overlay").on("click",this.hide.bind(this)),this.controller=this.initController(),this.lightbox.find(".n2_fullscreen_editor__cancel").on("click",this.hide.bind(this)),this.saveButton=this.lightbox.find(".n2_fullscreen_editor__save").on("click",this.setVisualAsStatic.bind(this))}return t.prototype.initController=function(){return new c.NextendFontEditorController},t.prototype.setFieldID=function(t){this.fieldID=t},t.prototype.setConnectedStyle=function(t){var i=$("#"+t).data("field").renderStyle();this.css.push(i),this.styleClassName=i.getBaseClassName()},t.prototype.setConnectedStyle2=function(t){var i=$("#"+t).data("field").renderStyle();this.css.push(i),this.styleClassName2=i.getBaseClassName()},t.prototype.setAndClose=function(t){this.$.trigger("save",[t])},t.prototype.setVisualAsStatic=function(e){e.preventDefault(),this.setAndClose(JSON.stringify({data:this.controller.get("set")})),this.hide(e)},t.prototype.hide=function(e){this.controller.pause();for(var t=0;t<this.css.length;t++)this.css[t].destroy();this.css=[],e!==o&&(e.preventDefault(),c.Esc.pop()),this.controller.close(),this.$.off("save"),$("body").removeClass("n2_body--fullscreen-editor-visible"),this.lightbox.removeClass("n2_fullscreen_editor--visible"),$(i).off("keydown.visual")},t.prototype.loadDataToController=function(t){this.controller.load(c.CSSRendererFont.parseRawData(t),!1,this.showParameters)},t.prototype.show=function(t,i,s){c.Esc.add(function(){return this.hide(),!0}.bind(this)),this.showParameters=f({previewMode:!1,previewHTML:!1},s),$("body").addClass("n2_body--fullscreen-editor-visible"),this.lightbox.addClass("n2_fullscreen_editor--visible"),this.loadDataToController(t),this.controller.show(),this.$.on("save",i),this._show()},t.prototype._show=function(){$(":focus").trigger("blur"),$(i).on({"keydown.visual":function(e){"TEXTAREA"===e.target.tagName||"INPUT"===e.target.tagName||e.target.isContentEditable||13===e.keyCode&&this.saveButton.trigger("click")}.bind(this)})},t})),c.d("CSSRendererFont",["$","CSSRenderer"],(function(){var $=c.$;function t(){}t.prototype=Object.create(c.CSSRenderer.prototype),t.prototype.constructor=t,t.prototype.getCSS=function(t,i,s,n,h){if(!1===(s=this.decodeData(s)))return"";if((s=f([],s))[0]=f(c.CSSRendererFont.getDefault(),s[0]),n.renderOptions.combined)for(var r=1;r<s.length;r++)if(s[r]=f({},s[r-1],s[r]),s[r].size===s[0].size)s[r].size="100||%";else{var a=s[0].size.split("||"),l=s[r].size.split("||");2===a.length&&2===l.length&&"px"===a[1]&&"px"===l[1]&&(s[r].size=Math.round(l[0]/a[0]*100)+"||%")}return t===o&&(t=c.CSSRendererFont.pre),c.CSSRenderer.prototype.getCSS.call(this,t,i,s,n,h)},t.prototype.makeStylecolor=function(t,i){i.color="#"+t.substr(0,6)+";\ncolor: "+N2Color.hex2rgbaCSS(t)},t.prototype.makeStylesize=function(t,i){var s=t.split("||");"px"===s[1]?i.fontSize=s[0]/c.CSSRendererFont.fontSize*100+"%":i.fontSize=t.replace("||","")},t.prototype.makeStyletshadow=function(t,i){var s=t.split("|*|");"0"==s[0]&&"0"==s[1]&&"0"==s[2]?i.textShadow="none":i.textShadow=s[0]+"px "+s[1]+"px "+s[2]+"px "+N2Color.hex2rgbaCSS(s[3])},t.prototype.makeStyleafont=function(t,i){for(var s=t.split(","),n=0;n<s.length;n++)s[n]=this.getFamily(s[n].replace(/^\s+|\s+$/gm,"").replace(/"|'/gm,""));i.fontFamily=s.join(",")},t.prototype.getFamily=function(t){var s=$(i).triggerHandler("n2Family",[t]);return s===o&&(s=t),"'"+s+"'"},t.prototype.makeStylelineheight=function(t,i){i.lineHeight=t},t.prototype.makeStyleweight=t.prototype.makeStylebold=function(t,i){i.fontWeight=1==t?"bold":t>1?t:"normal"},t.prototype.makeStyleitalic=function(t,i){i.fontStyle=1==t?"italic":"normal"},t.prototype.makeStyleunderline=function(t,i){i.textDecoration=1==t?"underline":"none"},t.prototype.makeStylealign=function(t,i){i.textAlign=t},t.prototype.makeStyleletterspacing=function(t,i){i.letterSpacing=t},t.prototype.makeStylewordspacing=function(t,i){i.wordSpacing=t},t.prototype.makeStyletexttransform=function(t,i){i.textTransform=t},t.prototype.makeStyleextra=function(t,i){i.raw=t};var s=1,n=new t,h={pre:"",defaultFamily:"Roboto,Arial",fontSize:16,rendererModes:{},getDefault:function(){return{color:"000000ff",size:"14||px",tshadow:"0|*|0|*|0|*|000000ff",afont:h.defaultFamily,lineheight:"1.5",weight:400,italic:0,underline:0,align:"left",letterspacing:"normal",wordspacing:"normal",texttransform:"none",extra:""}},getEmpty:function(){return{extra:""}},getClass:function(){return"n2-font-"+s++},addCSS:function(t,i,s,h,o){return c._css.add(i,n.getCSS.call(n,t,"."+i,s,h,o))},fixBold:function(t){for(var i=0;i<t.length;i++)t[i].bold!==o&&(t[i].weight!==o||(1===parseInt(t[i].bold)?t[i].weight=700:t[i].bold>0&&(t[i].weight=t[i].bold)),delete t[i].bold);return t},parseRawData:function(t){if(t.length>0){"{"!==t[0]&&(t=c.Base64.decode(t));try{var i=JSON.parse(t);if(i.data!==o)return i.data=this.fixBold(i.data),i.data[0]=f({},this.getDefault(),i.data[0]),i.data}catch(i){console.error("Unexpected data",t,i)}}return[this.getDefault()]},transformData:function(t,i){var s,n=this.parseRawData(t),h=this.rendererModes[i].tabs,o=[];for(s=0;s<n.length;s++)o[s]=_(this.getEmpty(),n[s]);for(s=o.length;s<h.length;s++)o[s]=this.getEmpty();return o}};return h})),c.d("NextendStyleEditor",["$","NextendFragmentEditor"],(function(){var $=c.$;function t(){c.NextendFragmentEditor.prototype.constructor.apply(this,arguments),this.fields={backgroundColor:{element:$("#n2-style-editorbackgroundcolor"),events:{"nextendChange.n2-editor":this.changeBackgroundColor.bind(this)}},opacity:{element:$("#n2-style-editoropacity"),events:{"outsideChange.n2-editor":this.changeOpacity.bind(this)}},padding:{element:$("#n2-style-editorpadding"),events:{"outsideChange.n2-editor":this.changePadding.bind(this)}},boxShadow:{element:$("#n2-style-editorboxshadow"),events:{"outsideChange.n2-editor":this.changeBoxShadow.bind(this)}},border:{element:$("#n2-style-editorborder"),events:{"outsideChange.n2-editor":this.changeBorder.bind(this)}},borderRadius:{element:$("#n2-style-editorborderradius"),events:{"outsideChange.n2-editor":this.changeBorderRadius.bind(this)}},extracss:{element:$("#n2-style-editorextracss"),events:{"outsideChange.n2-editor":this.changeExtraCSS.bind(this)}}}}return t.prototype=Object.create(c.NextendFragmentEditor.prototype),t.prototype.constructor=t,t.prototype.load=function(t){this._off(),this.fields.backgroundColor.element.data("field").insideChange(t.backgroundcolor),this.fields.opacity.element.data("field").insideChange(t.opacity),this.fields.padding.element.data("field").insideChange(t.padding),this.fields.boxShadow.element.data("field").insideChange(t.boxshadow),this.fields.border.element.data("field").insideChange(t.border),this.fields.borderRadius.element.data("field").insideChange(t.borderradius),this.fields.extracss.element.data("field").insideChange(t.extra),this._on()},t.prototype.changeBackgroundColor=function(){this.trigger("backgroundcolor",this.fields.backgroundColor.element.val())},t.prototype.changeOpacity=function(){this.trigger("opacity",this.fields.opacity.element.val())},t.prototype.changePadding=function(){this.trigger("padding",this.fields.padding.element.val())},t.prototype.changeBoxShadow=function(){this.trigger("boxshadow",this.fields.boxShadow.element.val())},t.prototype.changeBorder=function(){this.trigger("border",this.fields.border.element.val())},t.prototype.changeBorderRadius=function(){this.trigger("borderradius",this.fields.borderRadius.element.val())},t.prototype.changeExtraCSS=function(){this.trigger("extra",this.fields.extracss.element.val())},t})),c.d("NextendStyleEditorController",["$","NextendFragmentEditorController"],(function(){var $=c.$;function t(){this.css=[],c.NextendFragmentEditorController.prototype.constructor.apply(this,arguments),this.preview=$('<div class="n2_form__table_preview"></div>').css("fontSize","16px").appendTo('.n2_form__table[data-field="table-style-preview"]'),this.initBackgroundColor()}return t.prototype=Object.create(c.NextendFragmentEditorController.prototype),t.prototype.constructor=t,t.prototype.loadDefaults=function(){c.NextendFragmentEditorController.prototype.loadDefaults.call(this),this.type="style",this.preview=null},t.prototype.initEditor=function(){return new c.NextendStyleEditor},t.prototype.getCleanVisual=function(){return c.CSSRendererStyle.getEmpty()},t.prototype.initBackgroundColor=function(){this.$background=$("#n2-style-editorpreview-background").on("nextendChange",function(){this.preview.css("background","#"+this.$background.val())}.bind(this)),this.preview.css("background","#"+this.$background.val())},t.prototype.getTabs=function(){return c.CSSRendererStyle.rendererModes[this.mode].tabs},t.prototype.renderCSS=function(){this._renderTimeout=!1,this.clearCSS();var t=c.CSSRendererStyle.addCSS("",this.getPreviewCssClass(),this.currentVisual,c.CSSRendererStyle.rendererModes[this.mode]);this.css.push(t)},t.prototype.setPreview=function(){var t={styleClassName:this.getPreviewCssClass(),fontClassName:c._styleManager.fontClassName,fontClassName2:c._styleManager.fontClassName2,styleClassName2:c._styleManager.styleClassName2},i="";this.localModePreview[this.mode]!==o&&""!==this.localModePreview[this.mode]?(this.preview.html(""),this.preview.append(c[this.localModePreview[this.mode]].renderStyle(c._styleManager.fieldID,t))):(i=(i=c.CSSRendererStyle.rendererModes[this.mode].preview).replace(/\{([^]*?)\}/g,(function(i,s){return t[s]})),this.preview.html(i))},t.prototype.getPreviewCssClass=function(){return"n2-"+this.type+"-editor-preview"},t.prototype.pause=function(){this.clearCSS()},t.prototype.clearCSS=function(){for(var t=0;t<this.css.length;t++)this.css[t].destroy();this.css=[]},t})),c.d("NextendStyleManager",["$"],(function(){var $=c.$;function t(){this.$=$(this),this.showParameters=!1,this.type="style",this.css=[],this.styleClassName2="",this.fontClassName="",this.fontClassName2="",c._styleManager=this,this.lightbox=$("#n2-lightbox-"+this.type),this.lightbox.find(".n2_fullscreen_editor__overlay").on("click",this.hide.bind(this)),this.controller=this.initController(),this.controller&&(this.renderer=this.controller.renderer),this.lightbox.find(".n2_fullscreen_editor__cancel").on("click",this.hide.bind(this)),this.saveButton=this.lightbox.find(".n2_fullscreen_editor__save").on("click",this.setVisualAsStatic.bind(this))}return t.prototype.initController=function(){return new c.NextendStyleEditorController},t.prototype.setFieldID=function(t){this.fieldID=t},t.prototype.setConnectedStyle=function(t){var i=$("#"+t).data("field").renderStyle();this.css.push(i),this.styleClassName2=i.getBaseClassName()},t.prototype.setConnectedFont=function(t){var i=$("#"+t).data("field").renderFont();this.css.push(i),this.fontClassName=i.getBaseClassName()},t.prototype.setConnectedFont2=function(t){var i=$("#"+t).data("field").renderFont();this.css.push(i),this.fontClassName2=i.getBaseClassName()},t.prototype.setAndClose=function(t){this.$.trigger("save",[t])},t.prototype.setVisualAsStatic=function(e){e.preventDefault(),this.setAndClose(JSON.stringify({data:this.controller.get("set")})),this.hide(e)},t.prototype.hide=function(e){this.controller.pause();for(var t=0;t<this.css.length;t++)this.css[t].destroy();this.css=[],e!==o&&(e.preventDefault(),c.Esc.pop()),this.controller.close(),this.$.off("save"),$("body").removeClass("n2_body--fullscreen-editor-visible"),this.lightbox.removeClass("n2_fullscreen_editor--visible"),$(i).off("keydown.visual")},t.prototype.loadDataToController=function(t){this.controller.load(c.CSSRendererStyle.parseRawData(t),!1,this.showParameters)},t.prototype.show=function(t,i,s){c.Esc.add(function(){return this.hide(),!0}.bind(this)),this.showParameters=f({previewMode:!1,previewHTML:!1},s),$("body").addClass("n2_body--fullscreen-editor-visible"),this.lightbox.addClass("n2_fullscreen_editor--visible"),this.loadDataToController(t),this.controller.show(),this.$.on("save",i),this._show()},t.prototype._show=function(){$(":focus").trigger("blur"),$(i).on({"keydown.visual":function(e){"TEXTAREA"===e.target.tagName||"INPUT"===e.target.tagName||e.target.isContentEditable||13===e.keyCode&&this.saveButton.trigger("click")}.bind(this)})},t})),c.d("CSSRendererStyle",["CSSRenderer"],(function(){function t(){}t.prototype=Object.create(c.CSSRenderer.prototype),t.prototype.constructor=t,t.prototype.getCSS=function(t,i,s,n,h){return!1===(s=this.decodeData(s))?"":(s[0]=f(c.CSSRendererStyle.getDefault(),s[0]),t===o&&(t=c.CSSRendererStyle.pre),c.CSSRenderer.prototype.getCSS.call(this,t,i,s,n,h))},t.prototype.makeStylebackgroundcolor=function(t,i){i.background="#"+t.substr(0,6)+";\n\tbackground: "+N2Color.hex2rgbaCSS(t)},t.prototype.makeStyleopacity=function(t,i){i.opacity=parseInt(t)/100},t.prototype.makeStylepadding=function(t,i){for(var s=t.split("|*|"),n=s.pop(),h=0;h<s.length;h++)s[h]+=n;i.padding=s.join(" ")},t.prototype.makeStyleboxshadow=function(t,i){var s=t.split("|*|");"0"==s[0]&&"0"==s[1]&&"0"==s[2]&&"0"==s[3]?i.boxShadow="none":i.boxShadow=s[0]+"px "+s[1]+"px "+s[2]+"px "+s[3]+"px "+N2Color.hex2rgbaCSS(s[4])},t.prototype.makeStyleborder=function(t,i){var s=t.split("|*|");i.borderWidth=s[0]+"px",i.borderStyle=s[1],i.borderColor="#"+s[2].substr(0,6)+";\n\tborder-color:"+N2Color.hex2rgbaCSS(s[2])},t.prototype.makeStyleborderradius=function(t,i){t.split("|*|").push(""),i.borderRadius=t+"px"},t.prototype.makeStyleextra=function(t,i){i.raw=t};var i=1,s=new t;return{pre:"",rendererModes:{},getDefault:function(){return{backgroundcolor:"ffffff00",opacity:100,padding:"0|*|0|*|0|*|0|*|px",boxshadow:"0|*|0|*|0|*|0|*|000000ff",border:"0|*|solid|*|000000ff",borderradius:"0",extra:""}},getEmpty:function(){return{extra:""}},getClass:function(){return"n2-style-"+i++},addCSS:function(t,i,n,h,o){return c._css.add(i,s.getCSS.call(s,t,"."+i,n,h,o))},parseRawData:function(t){if(t.length>0){"{"!==t[0]&&(t=c.Base64.decode(t));try{var i=JSON.parse(t);if(i.data!==o)return i.data[0]=f({},this.getDefault(),i.data[0]),i.data}catch(i){console.error("Unexpected data",t,i)}}return[this.getDefault()]},transformData:function(t,i){var s,n=this.parseRawData(t),h=this.rendererModes[i].tabs,o=[];for(s=0;s<n.length;s++)o[s]=_(this.getEmpty(),n[s]);for(s=o.length;s<h.length;s++)o[s]=this.getEmpty();return o}}})),c.d("NextendImageEditor",["$","NextendFragmentEditor"],(function(){var $=c.$;function t(){this.previews=null,this.desktopImage="",c.NextendFragmentEditor.prototype.constructor.apply(this,arguments),this.fields={"desktop-retina-image":{element:$("#n2-image-editordesktop-retina-image"),events:{"nextendChange.n2-editor":this.changeImage.bind(this,"desktop-retina")}},"tablet-image":{element:$("#n2-image-editortablet-image"),events:{"nextendChange.n2-editor":this.changeImage.bind(this,"tablet")}},"mobile-image":{element:$("#n2-image-editormobile-image"),events:{"nextendChange.n2-editor":this.changeImage.bind(this,"mobile")}}},this.previews={desktop:$("#n2-image-editordesktop-preview"),"desktop-retina":$("#n2-image-editordesktop-retina-preview"),tablet:$("#n2-image-editortablet-preview"),mobile:$("#n2-image-editormobile-preview")}}return t.prototype=Object.create(c.NextendFragmentEditor.prototype),t.prototype.constructor=t,t.devices=["desktop-retina","tablet","mobile"],t.prototype.load=function(i,s){this._off(),this.desktopImage=i,this.makePreview("desktop",i);for(var n=0;n<t.devices.length;n++){var h=t.devices[n];s[h].image!==o&&(this.fields[h+"-image"].element.data("field").insideChange(s[h].image),this.makePreview(h,s[h].image))}this._on()},t.prototype.changeImage=function(t,e){var i=e.detail.field.element.val();this.makePreview(t,i),this.trigger(t,"image",i)},t.prototype.makePreview=function(t,i){return i?(this.previews[t].html('<img style="max-width:100%; max-height: 300px;" src="'+c._imageHelper.fixed(i)+'">'),!0):(this.previews[t].html(""),!1)},t.prototype.trigger=function(t,i,s){this.$.trigger("change",[t,i,s])},t})),c.d("NextendImageEditorController",["NextendFragmentEditorControllerWithEditor"],(function(){function t(){c.NextendFragmentEditorControllerWithEditor.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.NextendFragmentEditorControllerWithEditor.prototype),t.prototype.constructor=t,t.prototype.loadDefaults=function(){c.NextendFragmentEditorControllerWithEditor.prototype.loadDefaults.call(this),this.type="image",this.currentImage=""},t.prototype.get=function(t){return this.currentVisual},t.prototype.getEmptyVisual=function(){return{"desktop-retina":{image:""},tablet:{image:""},mobile:{image:""}}},t.prototype.initEditor=function(){return new c.NextendImageEditor},t.prototype._load=function(t,i,s){this.currentImage=t.visual.image,c.NextendFragmentEditorControllerWithEditor.prototype._load.call(this,t.value,i,s)},t.prototype.loadToEditor=function(){this.currentVisual=f({},this.getEmptyVisual(),this.currentVisual),this.editor.load(this.currentImage,this.currentVisual)},t.prototype.propertyChanged=function(e,t,i,s){this.isChanged=!0,this.currentVisual[t][i]=s},t})),c.d("NextendImage",["NextendVisualCore"],(function(){function t(){c.NextendVisualCore.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.NextendVisualCore.prototype),t.prototype.constructor=t,t.prototype.setValue=function(t,i){this.base64=t,this.value=JSON.parse(c.Base64.decode(t))},t.prototype.activate=function(e){e!==o&&e.preventDefault(),this.visualManager.changeActiveVisual(this),this.visualManager.controller.load(this,!1,this.visualManager.showParameters)},t})),c.d("NextendImageManager",["$","NextendVisualManagerCore"],(function(){var $=c.$;function t(){this.referenceKeys={},c.NextendVisualManagerCore.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.NextendVisualManagerCore.prototype),t.prototype.constructor=t,t.prototype.loadDefaults=function(){c.NextendVisualManagerCore.prototype.loadDefaults.apply(this,arguments),this.type="image",this.labels={visual:"image",visuals:"images"},this.fontClassName=""},t.prototype.initController=function(){return new c.NextendImageEditorController},t.prototype.createVisual=function(t){return new c.NextendImage(t,this)},t.prototype.firstLoadVisuals=function(t){for(var i=0;i<t.length;i++)this.referenceKeys[t[i].hash]=this.visuals[t[i].id]=this.createVisual(t[i])},t.prototype.getVisual=function(t){if(""!=t){var i=md5(t);if(this.referenceKeys[i]!==o)return this.referenceKeys[i];if(this.visualLoadDeferreds[i]!==o)return this.visualLoadDeferreds[i];var s=$.Deferred();return this.visualLoadDeferreds[i]=s,this._loadVisualFromServer(t).done(function(){s.resolve(this.referenceKeys[i]),delete this.visualLoadDeferreds[i]}.bind(this)).fail(function(){s.resolve({id:-1,name:n2_("Empty")}),delete this.visualLoadDeferreds[i]}.bind(this)),s}c.Notification.error(n2_("The image is empty"),{timeout:3})},t.prototype._loadVisualFromServer=function(t){return c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.parameters.ajaxUrl,{nextendaction:"loadVisualForImage"}),data:{image:t},dataType:"json"}).done(function(t){var i=t.data.visual;this.referenceKeys[i.hash]=this.visuals[i.id]=this.createVisual(i)}.bind(this))},t.prototype.isVisualData=function(t){return""!==t},t.prototype.setVisual=function(e){e.preventDefault(),this.controller.isChanged?this.saveActiveVisual(this.activeVisual.name).done(function(t){$(i).trigger(t.data.visual.hash,this.activeVisual.value),this.hide(e)}.bind(this)):this.hide(e)},t.prototype.getBase64=function(){return c.Base64.encode(JSON.stringify(this.controller.get("set")))},t.prototype.loadDataToController=function(t){$.when(this.getVisual(t)).done(function(i){i.id>0?i.activate():console.error(t+" visual is not found linked")}.bind(this))},t})),c.d("BrowserCompatibility",(function(){var t=52,s=18,n=55,h=10,o=68,r=604;return function(a){i.location.href.match(/nextendcontroller=(sliders|slider|slides|generator)/)&&!function(){var i=navigator.userAgent,a=i.match(/Firefox\/([0-9]+)/);if(a&&parseInt(a[1])>=t)return!0;if((a=i.match(/Edge\/([0-9]+)/))&&parseInt(a[1])>=s)return!0;if((a=i.match(/OPR\/([0-9]+)/))&&parseInt(a[1])>=n)return!0;if((a=i.match(/Version\/([0-9]+)[0-9. ]*?Safari/))&&parseInt(a[1])>=h)return!0;if((a=i.match(/Chrome\/([0-9]+)/))&&parseInt(a[1])>=o)return!0;if((a=i.match(/Safari\/([0-9]+)/))&&parseInt(a[1])>=r)return!0;return!1}()&&(i.location=a)}})),c.d("ContextMenu",["$"],(function(){var t,n,h,r,a,l,u,d,_,v,$=c.$;function p(e){n[0]===e.target||$.contains(n[0],e.target)||v&&(v===e.target||$.contains(v,e.target))||m()}function m(){0===t&&(x(),y(),r[0].removeEventListener("mouseover",b,{passive:!0,capture:!0}),r[0].removeEventListener("mouseleave",g,{passive:!0,capture:!0}),n.remove(),n=o,r=o,a=o,u=o,s.removeEventListener("mousedown",p,{passive:!0,capture:!0}),s.removeEventListener("pointerdown",p,{passive:!0,capture:!0}),cancelAnimationFrame(this.frame),i.removeEventListener("scroll",m,{passive:!0,capture:!0}),i.removeEventListener("resize",m),i.removeEventListener("blur",m),d.onClose&&d.onClose.call(i))}function b(e){var t=$(e.target);if(t.hasClass("n2_context_menu__item")||(t=t.closest(".n2_context_menu__item")),(!a||t[0]!==a[0])&&(x(),(a=t).length)){var s=a.data("items");s!==o&&(a.addClass("n2_context_menu__item--active"),(u=a.data("submenu"))||(u=function(t,s){for(var o=s.getBoundingClientRect(),r=$('<div class="n2_context_menu__sub_menu"></div>').appendTo(n),a=0;a<t.length;a++)switch(t[a].type){case"onoff":new M(r,t[a]);break;default:new I(r,t[a])}var c,l,u=r.width();l=n2const.rtl.isRtl?o.left<u:o.left+o.width+u<i.innerWidth;c=l?Math.round(o.width-3):-Math.round(u-3);return r.css({left:c+"px",top:Math.round(Math.min(o.top,i.innerHeight-r.height()-5)-h.top)+"px"}),r[0].addEventListener("mouseover",w,{passive:!0,capture:!0}),r[0].addEventListener("mouseleave",w,{passive:!0,capture:!0}),r}(s,a[0]),a.data("submenu",u)),u.addClass("n2_context_menu__sub_menu--active"))}g(e)}function g(e){var t=$(e.target);t.hasClass("n2_context_menu__item")||(t=t.closest(".n2_context_menu__item")),l&&t[0]===l[0]||(y(),(l=t).length&&l.data("item").onFocus())}function y(){if(l&&l.length){var t=l.data("item");t&&t.onBlur(),l=o}}function w(e){var t=$(e.target);t.hasClass("n2_context_menu__item")||(t=t.closest(".n2_context_menu__item")),_&&t[0]===_[0]||(k(),(_=t).length&&_.data("item").onFocus())}function k(){if(_&&_.length){var t=_.data("item");t&&t.onBlur(),_=o}}function x(){u!==o&&(k(),u.removeClass("n2_context_menu__sub_menu--active"),u=o,_=o,a.removeClass("n2_context_menu__item--active"))}function S(t,i){this.$item=$('<div class="n2_context_menu__item"></div>').data("item",this).appendTo(t),i.color!==o&&this.$item.addClass("n2_context_menu__item--color-"+i.color),this.setData(i)}function I(t,i){S.prototype.constructor.call(this,t,i)}function M(t,i){I.prototype.constructor.call(this,t,i),this.$item.addClass("n2_context_menu__item_onoff")}return S.prototype.setData=function(t){this.data=t,this.$item.html(""),this.render(t),t.items!==o&&this.$item.data("items",t.items)},S.prototype.render=function(t){t.render(this.$item)},S.prototype.onClick=function(){!1!==this.data.action.call(i,this)&&m()},S.prototype.onFocus=function(){this.data.focus!==o&&this.data.focus.call()},S.prototype.onBlur=function(){this.data.blur!==o&&this.data.blur.call()},I.prototype=Object.create(S.prototype),I.prototype.constructor=I,I.prototype.render=function(t){this.$icon=$('<i class="n2_context_menu__item_icon '+t.icon+'"></i>').appendTo(this.$item),this.$label=$('<div class="n2_context_menu__item_label"></div>').appendTo(this.$item),"function"==typeof t.label?t.label.call(this,this):this.$label.text(t.label),this.$item.off("click"),t.action!==o?(this.$item.on("click",this.onClick.bind(this)),this.$item.addClass("n2_context_menu__item--has-action")):this.$item.removeClass("n2_context_menu__item--has-action")},M.prototype=Object.create(I.prototype),M.prototype.constructor=M,M.prototype.render=function(t){this.isOn=!!t.isOn.call(this),this.syncClass(),$('<i class="n2_context_menu__item_icon ssi_16"></i>').appendTo(this.$item),this.$label=$('<div class="n2_context_menu__item_label"></div>').appendTo(this.$item),"function"==typeof t.label?t.label.call(this,this.$label):this.$label.text(t.label),this.$item.off("click"),this.$item.on("click",this.toggle.bind(this)),this.$item.addClass("n2_context_menu__item--has-action")},M.prototype.syncClass=function(){this.$item.toggleClass("n2_context_menu__item_onoff--on",this.isOn)},M.prototype.toggle=function(){this.isOn=!this.isOn,this.syncClass(),this.data.action(this.isOn)},function(a,c,l){if(t=0,d=f({x:0,y:0,horizontalAlign:"right",verticalAlign:"bottom",onClose:!1,forceLtr:!1},l),n===o||(m(),v!==a)){n=$('<div class="n2_context_menu"></div>').appendTo("body"),d.forceLtr&&n.attr("dir","ltr"),r=$('<div class="n2_context_menu__inner"></div>').appendTo(n),c.sort((function(t,i){return t.priority-i.priority}));for(var u=0;u<c.length;u++)switch(c[u].type){case"raw":new S(r,c[u]);break;case"onoff":new M(r,c[u]);break;default:new I(r,c[u])}var _={top:"auto",right:"auto",bottom:"auto",left:"auto"};if(a instanceof Element){v=a;var y=a.getBoundingClientRect();if("right"===d.horizontalAlign?_.left=Math.min(y.left+d.x,i.innerWidth-r.width()-d.x-10)+"px":"left"===d.horizontalAlign&&(_.left=y.right-r.width()-d.x+"px"),"bottom"===d.verticalAlign){var w=y.top+y.height+d.y;w<=i.innerHeight-r.height()-10?_.top=w+"px":_.bottom=i.innerHeight-y.top+d.y+"px"}else"top"===d.verticalAlign&&(y.top-10>=r.height()?_.bottom=i.innerHeight-y.top+d.y+"px":_.top=y.top+y.height+d.y+"px")}else v=!1,_.left=Math.min(a.clientX+1,i.innerWidth-r.width()-10)+"px",_.top=Math.min(a.clientY+1,i.innerHeight-r.height()-10)+"px";return n.css(_),h=r[0].getBoundingClientRect(),r[0].addEventListener("mouseover",b,{passive:!0,capture:!0}),r[0].addEventListener("mouseleave",g,{passive:!0,capture:!0}),s.addEventListener("mousedown",p,{passive:!0,capture:!0}),s.addEventListener("pointerdown",p,{passive:!0,capture:!0}),this.frame=requestAnimationFrame((function(){i.addEventListener("scroll",m,{passive:!0,capture:!0})})),i.addEventListener("resize",m),i.addEventListener("blur",m),{lock:function(){t++},unlock:function(){t--,t=Math.max(t,0)}}}}})),c.d("DashboardInfo",["$"],(function(){var $=c.$;function t(){this.isVisible=!1,this.blurInteractionCallback=this.blurInteraction.bind(this),this.blurCallback=this.blur.bind(this),c.r("documentReady",this.onReady.bind(this))}return t.prototype.onReady=function(){this.$info=$(".n2_dashboard_info"),this.$button=this.$info.find("> .n2_button_plain_icon").on("click",this.toggleInfo.bind(this))},t.prototype.toggleInfo=function(e){e.preventDefault(),this.isVisible?this.hideInfo():this.showInfo()},t.prototype.showInfo=function(){this.isVisible||(this.isVisible=!this.isVisible,s.addEventListener("mousedown",this.blurInteractionCallback,{passive:!0,capture:!0}),i.addEventListener("scroll",this.blurCallback,{passive:!0,capture:!0}),this.syncClass())},t.prototype.hideInfo=function(){this.isVisible&&(this.isVisible=!this.isVisible,this.syncClass(),s.removeEventListener("mousedown",this.blurInteractionCallback,{passive:!0,capture:!0}),i.removeEventListener("scroll",this.blurCallback,{passive:!0,capture:!0}))},t.prototype.syncClass=function(){this.$info.toggleClass("n2_dashboard_info--visible",this.isVisible)},t.prototype.blur=function(){this.hideInfo()},t.prototype.blurInteraction=function(e){this.$info[0]===e.target||$.contains(this.$info[0],e.target)||this.hideInfo()},t})),c.d("DeviceChanger",["$"],(function(){var $=c.$;function t(t,i){this.slider=t,this.containerElement=i,this.activeStates={hover:!1,drag:!1},this.devices={},this.slider.stages.done("ResponsiveStart",this.onResponsiveStart.bind(this))}function i(t,i,s,n){this.deviceChanger=t,this.device=i,this.data=s,this.icon=n,this.$button=$('<div class="n2_device_tester_devices__device" data-device="'+i+'"><i class="ssi_24 '+n+'"></i></div>').on("click",this.activate.bind(this)).appendTo(t.$containerDevices),t.registerDevice(i,this)}function n(t){this.trailSize=160,this.deviceChanger=t;var i=$('<div class="n2_device_tester_zoom"></div>').appendTo(t.$deviceTester);this.$min=$('<div class="n2_device_tester_zoom__min_label">0</div>').appendTo(i),this.mouseMoveDelegate=this.onMouseMove.bind(this),this.mouseUpDelegate=this.onMouseUp.bind(this),this.$zoomInner=$('<div class="n2_device_tester_zoom__inner"></div>').on("mousedown",this.onMouseDown.bind(this)).appendTo(i),this.$max=$('<div class="n2_device_tester_zoom__max_label">3000</div>').appendTo(i),$('<div class="n2_device_tester_zoom__trail"></div>').appendTo(this.$zoomInner),this.$editorSize=$('<div class="n2_device_tester_zoom__editor_size"></div>').appendTo(this.$zoomInner),this.$handle=$('<div class="n2_device_tester_zoom__handle"></div>').appendTo(this.$zoomInner),this.$handleLabel=$('<div class="n2_device_tester_zoom__handle_label"></div>').appendTo(this.$handle)}return t.prototype.registerDevice=function(t,i){this.devices[t]=i},t.prototype.setActiveState=function(t,i){this.activeStates[t]=i,this.$deviceChanger.toggleClass("n2_device_changer--active",this.activeStates.hover||this.activeStates.drag)},t.prototype.onResponsiveStart=function(){var t;this.$deviceChanger=$(".n2_device_changer").on({mouseenter:function(){t&&(a(t),t=o),this.setActiveState("hover",!0)}.bind(this),mouseleave:function(){t=r(function(){this.setActiveState("hover",!1)}.bind(this),500)}.bind(this)}),this.$icon=this.$deviceChanger.find(".n2_device_changer__button .ssi_24"),this.responsive=this.slider.responsive,this.container=this.containerElement?$(this.containerElement):$(this.responsive.containerElement.closest(".n2_slider_preview_area__inner, .n2_slide_editor_slider__editor")),this.$deviceTester=this.$deviceChanger.find(".n2_device_tester"),this.$containerDevices=$('<div class="n2_device_tester_devices"></div>').appendTo(this.$deviceTester),this.resizer=new n(this);var s=this.responsive.parameters.enabledDevices;s.mobilePortrait&&new i(this,"mobilePortrait",this.responsive.parameters.sizes.mobilePortrait,"ssi_24--mobileportrait"),s.mobileLandscape&&new i(this,"mobileLandscape",this.responsive.parameters.sizes.mobileLandscape,"ssi_24--mobileportraitlarge"),s.tabletPortrait&&new i(this,"tabletPortrait",this.responsive.parameters.sizes.tabletPortrait,"ssi_24--tabletportrait"),s.tabletLandscape&&new i(this,"tabletLandscape",this.responsive.parameters.sizes.tabletLandscape,"ssi_24--tabletportraitlarge"),new i(this,"desktopPortrait",this.responsive.parameters.sizes.desktopPortrait,"ssi_24--desktop").activate(),s.desktopLandscape&&new i(this,"desktopLandscape",this.responsive.parameters.sizes.desktopLandscape,"ssi_24--desktoplandscape"),this.responsive.identifyDeviceID=this.proxyIdentifyDeviceID.bind(this)},t.prototype.setDevice=function(t,i,s,n){this.device&&(this.devices[this.device].markInActive(),this.$icon.removeClass(this.devices[this.device].icon)),this.device=t,$("body").attr("data-device",t),this.devices[this.device].markActive(),this.$icon.addClass(this.devices[this.device].icon),this.width=i,this.minWidth=s,this.maxWidth=n,this.resizer.setLimits(s,n,i),this.resizer.setValue(this.width),this.container.width(this.width+"px"),this.slider.stages.resolved("Resized")&&this.responsive.doResize()},t.prototype.setWidth=function(t){(t=Math.max(Math.min(t,this.maxWidth),this.minWidth))!==this.width&&(this.width=t,this.resizer.setValue(t),this.container.width(this.width+"px"),this.responsive.doResize())},t.prototype.proxyIdentifyDeviceID=function(){return this.slider.sliderElement.ownerDocument.defaultView._N2.SmartSliderResponsive.DeviceMode[this.device.toLowerCase()]},i.prototype.markActive=function(){this.$button.addClass("n2_device_tester_devices__device--active")},i.prototype.markInActive=function(){this.$button.removeClass("n2_device_tester_devices__device--active")},i.prototype.activate=function(){this.deviceChanger.setDevice(this.device,this.data.width,this.data.min,this.data.max)},n.prototype.setLimits=function(t,i,s){this.min=t,this.$min.text(t),this.max=i,this.$max.text(i),this.editorSize=s,this.onePxToReal=(i-t)/this.trailSize,this.$editorSize.css("left",Math.round((s-t)/(i-t)*this.trailSize)+"px")},n.prototype.setValue=function(t){this.$handleLabel.text(t),this.$handle.css("left",Math.round((t-this.min)/(this.max-this.min)*this.trailSize)+"px")},n.prototype.onMouseDown=function(e){e.preventDefault(),$("body").addClass("n2_body--resize-editor"),this.resizeContext={clientX:this.$zoomInner[0].getBoundingClientRect().left,width:this.deviceChanger.width},s.addEventListener("mousemove",this.mouseMoveDelegate),s.addEventListener("mouseup",this.mouseUpDelegate),this.deviceChanger.setActiveState("drag",!0),this.onMouseMove(e)},n.prototype.onMouseMove=function(e){var t=Math.round(this.min+(e.clientX-this.resizeContext.clientX)*this.onePxToReal);Math.abs(this.editorSize-t)<2*this.onePxToReal&&(t=this.editorSize),this.deviceChanger.setWidth(t)},n.prototype.onMouseUp=function(e){s.removeEventListener("mousemove",this.mouseMoveDelegate),s.removeEventListener("mouseup",this.mouseUpDelegate),this.deviceChanger.setActiveState("drag",!1),$("body").removeClass("n2_body--resize-editor")},t})),c.d("License",["$","EditorAbstract"],(function(){var $=c.$;function t(i){this.options=f({activated:!1,maybeActive:!1,activationUrl:"",activationArgs:{},ajaxUrl:""},i),t.instance=this,this.setActivated(this.options.activated)}return t.get=function(){return t.instance},t.prototype.isActivated=function(t,i){var s=$.Deferred();return this.options.activated?this.options.maybeActive?s.resolve():c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.options.ajaxUrl,{nextendaction:"check",cacheAccepted:t+0,showErrors:i+0}),dataType:"json"}).done(function(){s.resolve()}.bind(this)).fail(function(){s.reject()}.bind(this)):s.reject(),s},t.prototype.setActivated=function(t){this.options.activated=t,n.setAttribute("data-ss3-activated",this.options.activated?"1":"0")},t.prototype.showActivationModal=function(){var t=$.Deferred();return this.isActivated(!0,!1).done(function(){t.resolve()}.bind(this)).fail(function(){this.displayModal(t,!1)}.bind(this)),t},t.prototype.showActivationModalSkippable=function(){var t=$.Deferred();return this.isActivated(!0,!1).done(function(){t.resolve()}.bind(this)).fail(function(){this.displayModal(t,!0)}.bind(this)),t},t.prototype.displayModal=function(i,s){var n=new c.ModalSimple("activate",{destroyOnHide:!1});n.addContent(c.UI.modalIcon("ssi_48 ssi_48--protect","green")),n.addContent(c.UI.modalHeading(n2_("Activate Smart Slider 3 Pro")));var h=c.UI.modalFormRow();if(n.addContent(h),n.addContent(c.UI.modalParagraph(n2_("Activation is required to unlock all features!")+" "+n2_("Register Smart Slider 3 Pro on this domain to enable auto update, slider templates and slide library."))),s){var o=c.UI.modalButton(n2_("Skip"),"grey");n.addButton(o),o.on("click",function(e){e.preventDefault(),i.resolve(),n.hide()}.bind(this))}var r=c.UI.modalButton(n2_("Activate"),"green");n.addButton(r),r.on("click",function(e){t.instance.activate(i),i.done(function(){n.hide()}.bind(this,e))}.bind(this)),n.show()},t.prototype.startActivation=function(){var t=$.Deferred();return this.isActivated(!0,!1).done(function(){t.resolve()}.bind(this)).fail(function(){this.activate(t)}.bind(this)),t},t.prototype.activate=function(t){t.fail(function(){this.options.maybeActive=!1}.bind(this)),this.closePopup!==o&&this.closePopup();var s=this,n=function(e){if("https://secure.nextendweb.com"===e.origin&&e.source===s.popup){var i=e[e.message?"message":"data"];try{i=JSON.parse(i),s.onMessageReceived(i,t)}catch(e){console.error(e)}}};i.addEventListener("message",n,!1),this.closePopup=function(){this.popup.close(),i.removeEventListener("message",n,!1),delete this.popup,delete this.closePopup}.bind(this),this.popup=this.popupCenter(this.options.activationUrl,"authorize-window",980,800)},t.prototype.onMessageReceived=function(t,i){if(t.action)switch(t.action){case"ready":this.send({action:"authorize",data:this.options.activationArgs});break;case"license":this.addLicenseKey(i,t.license_key)}},t.prototype.send=function(t){this.popup.postMessage(JSON.stringify(t),"*")},t.prototype.addLicenseKey=function(t,i){c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.options.ajaxUrl,{nextendaction:"add"}),data:{licenseKey:i},dataType:"json"}).done(function(i){i.data.valid&&(this.setActivated(!0),this.options.maybeActive=!0,t.resolve(),c.Notification.notice(n2_("Smart Slider 3 activated!")),$("#n2-ss-add-license-key").remove())}.bind(this))},t.prototype.popupCenter=function(t,s,h,r){var a=navigator.userAgent,c=function(){return/\b(iPhone|iP[ao]d)/.test(a)||/\b(iP[ao]d)/.test(a)||/Android/i.test(a)||/Mobile/i.test(a)},l=i.screenX!==o?i.screenX:i.screenLeft,u=i.screenY!==o?i.screenY:i.screenTop,d=i.outerWidth!==o?i.outerWidth:n.clientWidth,f=i.outerHeight!==o?i.outerHeight:n.clientHeight-22,_=c()?null:h,v=c()?null:r,p=l<0?i.screen.width+l:l,m=parseInt(p+(d-_)/2,10),b=parseInt(u+(f-v)/2.5,10),g=[];null!==_&&g.push("width="+_),null!==v&&g.push("height="+v),g.push("left="+m),g.push("top="+b),g.push("scrollbars=1");var y=i.open(t,s,g.join(","));return i.focus&&y.focus(),y},t})),c.d("SliderPreview",["$","UIDragTooltip"],(function(){var t,$=c.$,n=new c.UIDragTooltip("Resize");function h(){t={desktopPortrait:n2_("Desktop"),desktopLandscape:n2_("Large desktop"),tabletPortrait:n2_("Tablet"),tabletLandscape:n2_("Large tablet"),mobilePortrait:n2_("Mobile"),mobileLandscape:n2_("Large mobile")},this.frameScrollTop=0,this.scale=1,this.activeInfo=!1,this.sliderInfos={},this.isIframeContext=i.parent!==i,this.isIframeContext?(this.$parentDocument=i.parent._N2.$(i.parent.document),s.addEventListener("wheel",function(e){e.preventDefault()}.bind(this),{passive:!1}),i.addEventListener("message",function(e){var t={};try{t=JSON.parse(e.data)}catch(e){}switch(t.action){case"cancel":this.$parentDocument.triggerHandler("n2Close");break;case"scrollTop":this.updateFrameScrollTop(t.data);break;case"device_info":this.updateDeviceInfo(t.data)}}.bind(this),!1),s.addEventListener("keydown",function(e){e.defaultPrevented||27===e.keyCode&&(e.preventDefault(),this.$parentDocument.triggerHandler("n2Close"))}.bind(this)),$(".n2_preview_slider__close").on("click",function(e){e.preventDefault(),this.$parentDocument.triggerHandler("n2Close")}.bind(this))):i.addEventListener("message",function(e){var t={};try{t=JSON.parse(e.data)}catch(e){}switch(t.action){case"scrollTop":this.updateFrameScrollTop(t.data);break;case"device_info":this.updateDeviceInfo(t.data)}}.bind(this),!1),this.init(),this.$frame=$(".n2_preview__device_screen_inner iframe"),$(".n2_preview form").trigger("submit")}function l(t){return t.replace(/[^0-9]/gi,"").replace(/^[0]+/gi,"").substr(0,5)}function u(t,i,s,n){this.sliderPreview=t,this.label=i,this.width=s,this.height=n,t.devices.push(this),this.$bar=$('<div class="n2_preview__ruler_device"><div></div></div>').on({mouseenter:function(){this.sliderPreview.setTempLabel(this.getLabel())}.bind(this),mouseleave:function(){this.sliderPreview.resetLabel()}.bind(this),click:function(){this.sliderPreview.setDimensions(this.width,this.height),this.sliderPreview.setCurrentDevice(this)}.bind(this)}).prependTo(t.$ruler),this.refreshScale()}function d(t,i){this.sliderPreview=t,this.id=i,this.top=0,this.$tip=$('<div class="n2_preview__slider_info"></div>').appendTo(this.sliderPreview.$infoState)}return h.prototype.init=function(){this.$fieldWidth=$(".n2_preview_toolbar__width").on("click",function(){"true"!==this.$fieldWidth[0].contentEditable&&new c.InlineTextEditor(this.$fieldWidth[0],{filter:l,onSave:function(t){(t=parseInt(t))?this.setWidth(t):this.onResize()}.bind(this),onCancel:function(){this.onResize()}.bind(this)})}.bind(this)),this.$fieldHeight=$(".n2_preview_toolbar__height").on("click",function(){"true"!==this.$fieldHeight[0].contentEditable&&new c.InlineTextEditor(this.$fieldHeight[0],{filter:l,onSave:function(t){(t=parseInt(t))?this.setHeight(t):this.onResize()}.bind(this),onCancel:function(){this.onResize()}.bind(this)})}.bind(this)),this.$fieldScale=$(".n2_preview_toolbar__scale").on("change",function(){this.setScale(this.$fieldScale.val()/100)}.bind(this)),this.devices=[],this.$ruler=$(".n2_preview__ruler"),new u(this,n2_("Mobile")+" S",375,667),new u(this,n2_("Mobile")+" L",425,756),new u(this,n2_("Tablet"),768,1024),new u(this,n2_("Laptop"),1024,768),new u(this,n2_("Laptop")+" L",1440,900),new u(this,"Full HD",1920,1080),new u(this,"4K",2560,1440),this.$label=$(".n2_preview__ruler_label"),this.$infoState=$(".n2_preview__device_info_state"),this.$infoTip=$(".n2_preview__device_info .ssi_16"),this.$screen=$(".n2_preview__device_screen"),this.$notification=$('<div class="n2_preview__notification_scale"></div>').appendTo(this.$screen),this.$screenInner=$(".n2_preview__device_screen_inner"),$(".n2_preview__resize_width").on("mousedown",function(e){e.preventDefault(),n.dragShow(),$("body").addClass("n2_body--resize-horizontal");var t=e.clientX,i=Math.floor(this.$screenInner.width()/this.scale);n.dragUpdate(e,n2_("Width")+": "+Math.max(320,Math.ceil(i))+"px"),$(s).on({"mousemove.resize":function(e){var s=Math.floor(i-2*(t-e.clientX)/this.scale);this.setWidth(s),this.removeCurrentDevice(),n.dragUpdate(e,n2_("Width")+": "+Math.max(320,Math.ceil(s))+"px")}.bind(this),"mouseup.resize":function(){n.dragHide(),$(s).off(".resize"),$("body").removeClass("n2_body--resize-horizontal")},"mouseleave.resize":function(){n.dragHide(),$(s).off(".resize"),$("body").removeClass("n2_body--resize-horizontal")}})}.bind(this)),$(".n2_preview__resize_height").on("mousedown",function(e){e.preventDefault(),n.dragShow(),$("body").addClass("n2_body--resize-vertical");var t=e.clientY,i=Math.floor(this.$screenInner.height()/this.scale);n.dragUpdate(e,n2_("Height")+": "+Math.max(320,i)+"px"),$(s).on({"mousemove.resize":function(e){var s=Math.floor(i-(t-e.clientY)/this.scale);this.setHeight(s),this.removeCurrentDevice(),n.dragUpdate(e,n2_("Height")+": "+Math.max(320,s)+"px")}.bind(this),"mouseup.resize":function(){n.dragHide(),$(s).off(".resize"),$("body").removeClass("n2_body--resize-vertical")}})}.bind(this)),$(".n2_button_preview_orientation").on("click",function(e){e.preventDefault(),this.removeCurrentDevice(),this.setDimensions(this.$screenInner.height()/this.scale,this.$screenInner.width()/this.scale)}.bind(this)),$(".n2_button_preview_reload").on("click",function(e){e.preventDefault(),this.reload()}.bind(this)),$(i).on("resize",this.onResize.bind(this)),this.onResize(),this.$ruler.addClass("n2_preview__ruler--ready")},h.prototype.reload=function(){$(".n2_preview form").trigger("submit")},h.prototype.onResize=function(){this.$fieldWidth.text(Math.floor(this.$screenInner.width()/this.scale)),this.$fieldHeight.text(Math.floor(this.$screenInner.height()/this.scale))},h.prototype.displayNotification=function(t){this.notificationTimeout&&a(this.notificationTimeout),this.$notification.text(t).addClass("n2_preview__notification_scale--visible"),this.notificationTimeout=r(function(){this.$notification.removeClass("n2_preview__notification_scale--visible"),delete this.notificationTimeout}.bind(this),600)},h.prototype.setScale=function(t){this.displayNotification(100*t+"%");var i=this.scale;this.scale=t,$("body").addClass("n2_body--scale-preview"),r((function(){$("body").removeClass("n2_body--scale-preview")}),1500),this.$screen=$(".n2_preview__device_screen");var s=this.$screenInner.width(),n=this.$screenInner.height();this.$frame.css({transform:"scale("+this.scale+")",width:1/this.scale*100+"%",height:1/this.scale*100+"%",marginLeft:(100-1/this.scale*100)/2+"%",marginRight:(100-1/this.scale*100)/2+"%"});for(var h=0;h<this.devices.length;h++)this.devices[h].refreshScale();this._setDimensions(s/i,n/i),this.onResize()},h.prototype.setDimensions=function(t,i){var s=this.$screen.width(),n=this.$screen.height(),h=Math.max(25,25*Math.floor(100*Math.min(1,s/t,n/i)/25));parseInt(this.$fieldScale.val())!==h&&h<=100&&this.$fieldScale.val(h).trigger("change"),this._setDimensions(t,i)},h.prototype._setDimensions=function(t,i){this.setWidth(t),this.setHeight(i)},h.prototype.setWidth=function(t){t=Math.floor(Math.max(320,t)*this.scale),this.$screenInner.css("maxWidth",t+"px"),this.$fieldWidth.text(Math.floor(this.$screenInner.width()/this.scale))},h.prototype.setHeight=function(t){t=Math.floor(Math.max(320,t)*this.scale),this.$screenInner.css("maxHeight",t+"px"),this.$fieldHeight.text(Math.floor(this.$screenInner.height()/this.scale))},h.prototype.setCurrentDevice=function(t){this.currentDevice&&this.currentDevice!==t&&this.removeCurrentDevice(),this.currentDevice=t,this.resetLabel()},h.prototype.removeCurrentDevice=function(){this.currentDevice&&(this.currentDevice.deActivate(),delete this.currentDevice,this.resetLabel())},h.prototype.setTempLabel=function(t){this.currentDevice&&this.currentDevice.deActivate(),this.$label.text(t)},h.prototype.resetLabel=function(){this.currentDevice?(this.$label.text(this.currentDevice.getLabel()),this.currentDevice.activate()):this.$label.text("")},h.prototype.setInfo=function(t,i,s,n){this.$infoState.text(t);var h=[];h.push("<b>"+n2_("Orientation")+": </b>"+(i?n2_("Landscape"):n2_("Portrait"))),s<=0?h.push("<b>"+n2_("Size")+": </b>"+n2_sprintf(n2_("Below %s pixels."),n)):n>=1e5?h.push("<b>"+n2_("Size")+": </b>"+n2_sprintf(n2_("Above %s pixels."),s)):h.push("<b>"+n2_("Size")+": </b>"+n2_sprintf(n2_("Between %s and %s pixels."),s,n)),this.$infoTip.data("formTip")?this.$infoTip.data("formTip").setDescription(h.join("<br>")):this.$infoTip.data("tip-description",h.join("<br>"))},h.prototype.updateFrameScrollTop=function(t){this.frameScrollTop=t.scrollTop,this.updateActive()},h.prototype.updateDeviceInfo=function(t){this.sliderInfos[t.id]===o&&(this.sliderInfos[t.id]=new d(this,t.id)),this.sliderInfos[t.id].update(t),this.updateActive()},h.prototype.updateActive=function(){var t=!1,i=Number.POSITIVE_INFINITY;for(var s in this.sliderInfos)this.sliderInfos[s].top<i&&(i=this.sliderInfos[s].top,t=this.sliderInfos[s]);for(var s in this.sliderInfos)this.sliderInfos[s].top<=this.frameScrollTop&&t.top<this.sliderInfos[s].top&&(t=this.sliderInfos[s]);this.activeInfo!==t&&(this.activeInfo=t,this.updateInfo(t))},h.prototype.updateInfo=function(t){this.activeInfo===t&&this.setInfo(this.activeInfo.device,this.activeInfo.isLandscape,this.activeInfo.minScreenWidth,this.activeInfo.maxScreenWidth)},u.prototype.activate=function(){this.$bar.addClass("n2_preview__ruler_device--active")},u.prototype.deActivate=function(){this.$bar.removeClass("n2_preview__ruler_device--active")},u.prototype.getLabel=function(){return this.label+" "+this.width+" x "+this.height+"px"},u.prototype.refreshScale=function(){var t=this.width*this.sliderPreview.scale;this.$bar.css({width:t+"px",marginLeft:-t/2+"px"})},d.prototype.update=function(i){this.device=t[i.device],this.isLandscape=i.isLandscape,this.minScreenWidth=i.minScreenWidth,this.maxScreenWidth=i.maxScreenWidth,this.top=i.top,this.sliderPreview.updateInfo(this)},h})),c.d("SliderChangeType","$",(function(){var $=c.$;function t(t){c._changeSliderType=this,this.options=f({types:{},currentType:"simple",ajaxUrl:""},t),c.r("documentReady",this.onReady.bind(this))}return t.prototype.onReady=function(){$(".n2_slider_action__change_slider_type").on("click",this.showModal.bind(this))},t.prototype.showModal=function(e){e&&e.preventDefault();var t=new c.ModalSimple("activate",{destroyOnHide:!0,width:630});t.addContent(c.UI.modalIcon("ssi_48 ssi_48--convert","blue")),t.addContent(c.UI.modalHeading(n2_("Change slider type")));var i=c.UI.modalFormRow(!0);t.addContent(i),c.UI.modalNotice(i,n2_("Changing your slider type is irreversible. After changing your slider type, <b>you will lose all slider type related settings</b>."),"notice");var s=c.UI.modalFormRow(!0);t.addContent(s);var n=c.UI.modalFieldSelectIcon(s,"slider-type",n2_("Slider type"),this.options.types,this.options.currentType),h=c.UI.modalButton(n2_("Convert"),"blue");t.addButton(h),h.on("click",function(e){e.preventDefault(),this.convertSliderType(n.val()),t.hide()}.bind(this)),t.show()},t.prototype.convertSliderType=function(t){this.options.currentType!==t&&c.AjaxHelper.ajax({type:"POST",url:this.options.ajaxUrl,data:{targetSliderType:t},dataType:"json"}).done((function(){i.location.reload()}))},t})),c.d("CreateSlider","$",(function(){var $=c.$;function t(t,s,n,h,o,r){this.groupID=t,this.ajaxUrl=s,this.userEmail=h,this.shouldSkipLicenseModal=n,this.skipNewsletter=o,this.importUrl=r,$(".n2_slider_manager__new_slider").on("click",this.createProject.bind(this)),"createslider"===i.location.hash.substring(1)&&this.createProject()}return t.prototype.createProject=function(){var t=new c.ModalSimple("new-project",{destroyOnHide:!0,width:1e3}),i=$('<div class="n2_new_project"></div>');t.addContent(i),$('<div class="n2_new_project__heading"></div>').text(n2_("What do you want to create today?")).appendTo(i),$('<div class="n2_new_project__sub_heading"></div>').text(n2_("Use our powerful visual editor, or simply import one of our existing template.")).appendTo(i);var s=$('<div class="n2_new_project__boxes"></div>').appendTo(i),n=$('<div class="n2_new_project__box"></div>').on("click",function(e){t.hide(e),this.shouldSkipLicenseModal?this.createSlider():c.License.get().showActivationModalSkippable().done(this.createSlider.bind(this))}.bind(this)).appendTo(s);$('<div class="n2_new_project__box_illustration"><img src="'+c._imageHelper.fixed("$ss3-admin$/images/sliders/newproject.svg")+'" alt="" width="160" /></div>').appendTo(n),$('<div class="n2_new_project__box_heading"></div>').text(n2_("Create a New Project")).appendTo(n),$('<div class="n2_new_project__box_sub_heading"></div>').text(n2_("Start a new project from scratch and build exactly what you’ve imagined. You can easily customize every pixels and create anything with layers.")).appendTo(n);var h=$('<div class="n2_new_project__box"></div>').on("click",function(e){c.License.get().showActivationModal().done(this.showExampleSlidersWindow.bind(this)),t.hide(e)}.bind(this)).appendTo(s);$('<div class="n2_new_project__box_illustration"><img src="'+c._imageHelper.fixed("$ss3-admin$/images/sliders/template.svg")+'" alt="" width="160" /></div>').appendTo(h),$('<div class="n2_new_project__box_heading"></div>').text(n2_("Start with a Template")).appendTo(h),$('<div class="n2_new_project__box_sub_heading"></div>').text(n2_("Start with a template and make it your own with the innovative drag and drop interface. You can choose from hundreds of premade templates.")).appendTo(h),$('<a class="n2_new_project__import" href="'+this.importUrl+'"></a>').text(n2_("or import your own files")).appendTo(i),t.show()},t.prototype.createSlider=function(){var t=new c.ModalSimple("create-new-project",{destroyOnHide:!0,width:900}),i=$('<div class="n2_create_new_project"></div>');t.addContent(i),$('<div class="n2_create_new_project__heading"></div>').text(n2_("Create new project")).appendTo(i);var s=c.UI.modalFormRowLarge().appendTo(i),n=c.UI.modalFieldSelectIcon(s,"project-type",n2_("Project type"),{slider:{icon:"ssi_64 ssi_64--fullwidthslider",label:n2_("Slider")},block:{icon:"ssi_64 ssi_64--block",label:n2_("Block")}},"slider"),h=function(){var t=n.val(),i="simple";o.toggleClass("n2_form_element--hidden","block"===t),i=a.val(),"block"===t&&(i="block"),m.toggleClass("n2_form_element--hidden","showcase"!==i&&"carousel"!==i),g.toggleClass("n2_form_element--hidden","showcase"!==i&&"carousel"!==i);var s=v.data("field");"simple"!==i&&"block"!==i?("fullpage"===v.val()&&s.insideChange("fullwidth"),s.select.find('option[value="fullpage"]').remove()):0===s.select.find('option[value="fullpage"]').length&&s.select.append('<option value="fullpage">'+n2_("Full page")+"</option>")};n.on("nextendChange",h);var o=c.UI.modalFormContainer(i,"slider-settings-container"),r=c.UI.modalFormRowLarge().appendTo(o),a=c.UI.modalFieldSelectIcon(r,"slider-type",n2_("Slider type"),{simple:{icon:"ssi_64 ssi_64--slider",label:n2_("Simple")},carousel:{icon:"ssi_64 ssi_64--carousel",label:n2_("Carousel")},showcase:{icon:"ssi_64 ssi_64--showcase",label:n2_("Showcase")}},"simple");a.on("nextendChange",h),c.UI.modalSubHeading(n2_("Settings")).appendTo(i);var l=c.UI.modalFormRow().appendTo(i),u=c.UI.modalFieldText(l,"project-name",n2_("Name"),n2_("My project")).css("width","200px"),d=c.UI.modalNumber(l,"slider-width",n2_("Width"),1200,{min:200,unit:"px"}),f=c.UI.modalNumber(l,"slider-height",n2_("Height"),600,{min:100,unit:"px"}),_={boxed:n2_("Boxed"),fullwidth:n2_("Full width"),fullpage:n2_("Full page")},v=c.UI.modalSelect(l,"slider-responsive-mode",n2_("Layout"),_,"fullwidth"),p=c.UI.modalNumber(l,"slide-width",n2_("Slide width"),600,{min:200,unit:"px"}),m=p.closest(".n2_field"),b=c.UI.modalNumber(l,"slide-height",n2_("Slide height"),400,{min:100,unit:"px"}),g=b.closest(".n2_field"),y=c.UI.modalButton(n2_("Create"),"green").on("click",function(e){e.preventDefault();var t={groupID:this.groupID,projectName:u.val(),projectType:n.val(),sliderWidth:parseInt(d.val()),sliderHeight:parseInt(f.val()),responsiveMode:v.val()};t.sliderType=a.val(),t.slideWidth=parseInt(p.val()),t.slideHeight=parseInt(b.val()),c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"create"}),data:t,dataType:"json"}).done(function(t){c.LoadingScreen.startLoading()}.bind(this))}.bind(this));t.addButton(y),h(),t.show()},t.prototype.showExampleSlidersWindow=function(){var t=this;$("body").css("overflow","hidden");var s=$('<iframe src="//smartslider3.com/demo-import/?pro=1&version='+N2SS3VERSION+"&utm_campaign="+N2SS3C+"&utm_source=import-slider-frame&utm_medium=smartslider-"+N2PLATFORM+'-pro"></iframe>').css({position:"fixed",zIndex:1e5,left:0,top:0,width:"100%",height:"100%"}).appendTo("body"),n=function(){$("body").css("overflow",""),s.remove(),i.removeEventListener("message",h,!1)},h=function(e){if("http://smartslider3.com"===e.origin||"https://smartslider3.com"===e.origin){var i,s=e.data;switch(s.key){case"importSlider":return i=s.data.href,void c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(t.ajaxUrl,{nextendaction:"importDemo"}),data:{groupID:t.groupID,key:c.Base64.encode(i.replace(/^(http(s)?:)?\/\//,"//"))},dataType:"json"}).fail((function(){}));case"closeWindow":n()}}};c.Esc.add(function(){return n(),!0}.bind(this)),i.addEventListener("message",h,!1)},t.prototype.joinCommunity=function(t){var i=function(e,t){c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(c.AjaxHelper.getAdminUrl("ss3-admin"),{nextendcontroller:"settings",nextendaction:t||"dismissNewsletterSampleSliders"}),dataType:"json"})};this.modal=new c.ModalSimple("url-modal"),this.modal.addContent(c.UI.modalIcon("ssi_48 ssi_48--newsletter","purple")),this.modal.addContent(c.UI.modalHeading(n2_("Join The Smart Slider 3 Community"))),this.modal.addContent(c.UI.modalParagraph(n2_("Join more than 120,000 subscribers and get access to the latest slider templates, tips, tutorials and other exclusive contents directly to your inbox.")).css("margin-bottom","12px")),this.modal.$modalBody.css("text-align","center");var s=$("<form></form>");s.append(c.UI.modalInput("EMAIL","email","","example@google.com")),s.append(c.UI.modalInput(N2PLATFORM.toUpperCase(),"hidden","Yes")),s.append(c.UI.modalInput("SOURCE","hidden","Smart Slider 3")),this.modal.addContent(s);var n=c.UI.modalButton(n2_("Subscribe"),"purple");this.modal.addButton(n),n.on("click",function(e){c.AjaxHelper.ajax({type:"POST",url:"https://secure.nextendweb.com/mailchimp/subscribe.php",data:s.serialize(),dataType:"json"}).done((function(){t()})),i(0,"subscribed")}.bind(this)),this.modal.$modalBodyOuter.find(".n2_modal__close").on("click",(function(e){i(),t()})),this.modal.show()},t})),c.d("SliderEdit","$",(function(){var $=c.$;function t(t){this.options=f({previewInNewWindow:!1,saveAjaxUrl:"",previewUrl:"",ajaxUrl:"",formData:{}},t),this.url=this.options.ajaxUrl,this.values=this.options.formData,c.Form.prototype.constructor.call(this),c.r("documentReady",this.onReady.bind(this))}return t.prototype=Object.create(c.Form.prototype),t.prototype.constructor=t,t.prototype.onReady=function(){this.setID("#n2-ss-edit-slider-form"),c.Form.prototype.onReady.call(this),this.$form.on("submit",this.onSaveSubmit.bind(this)),this.initPreview()},t.prototype.onKeyDown=function(e){var t=!1;return(e.ctrlKey||e.metaKey)&&49===e.keyCode&&(this.showPreview(),t=!0),t?e.preventDefault():t=c.Form.prototype.onKeyDown.call(this,e),t},t.prototype.initButtons=function(){this.$saveButton=$(".n2_slider_settings_save").on("click",this.actionSave.bind(this)),$(".n2_slider_settings_back").on("click",this.actionCancel.bind(this))},t.prototype.actionSave=function(e){e&&e.preventDefault(),this.skipChangeConfirm=!0,this.$form.trigger("submit")},t.prototype.actionCancel=function(e){e&&e.preventDefault(),i.location=e.currentTarget.href},t.prototype.onSaveSubmit=function(e){this.$form.attr("target")===o&&(e.preventDefault(),c.AjaxHelper.ajax({type:"POST",url:this.options.saveAjaxUrl,data:this.$form.serialize(),dataType:"json",success:this.onAfterSave.bind(this)}))},t.prototype.onAfterSave=function(t){if($(".n2_header__heading_primary").text($("#slidertitle").val()),t&&t.data&&t.data.changedFields){for(var i in t.data.changedFields)t.data.changedFields.hasOwnProperty(i)&&$("#"+i).val(t.data.changedFields[i]);if(t.data.changedFields.slideralias!==o){var s=t.data.changedFields[i],n=$('.n2_ss_slider_publish__option_code[data-mode="alias"]');n.length||(n=$('<div class="n2_ss_slider_publish__option_code" data-mode="alias"></div>').insertAfter($('.n2_ss_slider_publish__option_code[data-mode="id"]'))),s?n.text('[smartslider3 alias="'+s+'"]'):n.remove()}}this.afterSave()},t.prototype.initPreview=function(){this.options.previewInNewWindow||(this.modal=new c.ModalIframe("preview-slider")),$(".n2_top_bar_main__preview").on("click",function(e){e.preventDefault(),this.showPreview()}.bind(this))},t.prototype.showPreview=function(){"main"===c.WindowManager.getCurrentWindow()&&(this.options.previewInNewWindow?c.PreviewPopup("","preview-slider"):this.modal.show(),this.$form.attr({action:c.AjaxHelper.makeAjaxUrl(this.options.previewUrl,{nextendaction:this.options.previewInNewWindow?"index":"slider"}),target:"preview-slider"}).trigger("submit").attr({action:this.formAction,target:null}))},t})),c.d("SliderImport","$",(function(){var $=c.$;function t(t){c.Form.prototype.constructor.call(this),c.r("documentReady",this.onReady.bind(this))}return t.prototype=Object.create(c.Form.prototype),t.prototype.constructor=t,t.prototype.onReady=function(){this.setID("#n2-ss-form-slider-import"),c.Form.prototype.onReady.call(this),this.$localImportSwitch=$("#sliderupload_or_local"),this.$localImport=$("#sliderlocal-import-file"),this.$uploadImport=$("#sliderimport-file"),this.$form.on("submit",this.onSubmit.bind(this))},t.prototype.onChange=function(){this.hasChange=!1,parseInt(this.$localImportSwitch.val())?""!==this.$localImport.val()&&(this.hasChange=!0):""!==this.$uploadImport.val()&&(this.hasChange=!0),this.$saveButton.toggleClass("n2_button--inactive",!this.hasChange)},t.prototype.initButtons=function(){this.$saveButton=$(".n2_slider_import").on("click",this.actionSave.bind(this)),$(".n2_slider_import_back").on("click",this.actionCancel.bind(this))},t.prototype.actionSave=function(e){e&&e.preventDefault(),this.skipChangeConfirm=!0,this.$form.trigger("submit"),this.afterSave()},t.prototype.actionCancel=function(e){e&&e.preventDefault(),i.location=e.currentTarget.href},t.prototype.onSubmit=function(e){e.preventDefault();var t=new FormData(this.$form[0]);c.AjaxHelper.ajax({type:"POST",contentType:!1,url:this.$form.attr("action"),processData:!1,data:t,dataType:"json"})},t})),c.d("ManageSliders","$",(function(){var $=c.$;function t(t,i,s){this.groupID=t,this.exportAllUrl=i.exportAllUrl,this.ajaxUrl=i.ajaxUrl,this.previewUrl=i.previewUrl,this.importUrl=i.importUrl,this.sliders=[],this.sliderPanel=$(".n2_slider_manager"),this.orderBy="ordering"===this.sliderPanel.data("orderby"),this.slidersContainer=this.sliderPanel.find(".n2_slider_manager__content");for(var n=this.slidersContainer.find(".n2_slider_box"),h=0;h<n.length;h++)this.sliders.push(new c.Slider(this,n.eq(h)));this.changed(),this.initOrderable(),this.create=new c.CreateSlider(t,this.ajaxUrl,s,i.userEmail,i.skipNewsletter,this.importUrl),$(".n2_slider_create_group").on("click",function(e){e.preventDefault(),this.showCreateGroup()}.bind(this)),this.initBulk()}return t.prototype.showCreateGroup=function(){c.ModalCreateGroup.init(this,this.ajaxUrl),c.ModalCreateGroup.show()},t.prototype.changed=function(){$("html").attr("data-sliders",this.sliders.length)},t.prototype.initSliders=function(){for(var t=this.slidersContainer.find(".n2_slider_box"),s=[],n=0;n<t.length;n++){var h=t.eq(n).data("slider");s.push(h)}this.sliders=s,this.changed(),$(i).triggerHandler("SmartSliderSidebarSlidersChanged")},t.prototype.initOrderable=function(){if(this.orderBy){var t={helper:"clone",items:"> .n2_slider_box",stop:this.saveOrder.bind(this),placeholder:"n2_slider_manager__sortable_placeholder",distance:10,droppables:"n2_slider_box--group"};t.over=function(e,t){t.droppable.addClass("n2_slider_box--drop-target"),t.helper.addClass("n2_slider_box--drop-instance")}.bind(this),t.out=function(e,t){t.helper.removeClass("n2_slider_box--drop-instance"),t.droppable.removeClass("n2_slider_box--drop-target")}.bind(this),t.drop=function(e,t){this._addToGroup("move",t.droppable.data("slider").getId(),[t.item.data("slider").getId()])}.bind(this),this.uiSortable=new c.UISortable(this.slidersContainer,t)}},t.prototype.saveOrder=function(e,t){var s,n=this.slidersContainer.find(".n2_slider_box"),h=[],o=[],r=[];for(s=0;s<n.length;s++){var a=n.eq(s).data("slider");h.push(a),o.push(a.getId())}for(s=0;s<this.sliders.length;s++)r.push(this.sliders[s].getId());if(JSON.stringify(r)!==JSON.stringify(o)){$(i).triggerHandler("SmartSliderSidebarSlidersOrderChanged");c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendcontroller:"sliders",nextendaction:"order"}),data:{groupID:this.groupID,sliderorder:o,isReversed:"DESC"===this.sliderPanel.data("orderbydirection")?1:0}}),this.sliders=h}},t.prototype.trashSliders=function(t,i){c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendcontroller:"sliders",nextendaction:"trash"}),type:"POST",data:{groupID:this.groupID,sliders:t}}).done(function(){for(var t=0;t<i.length;t++)i[t].remove();this.initSliders(),this.leaveBulk()}.bind(this))},t.prototype.duplicateSliders=function(t,i){for(var s=0;s<this.sliders.length;s++)this.sliders[s].selected&&this.sliders[s].duplicate($.Event("click",{currentTarget:null}))},t.prototype.exportSliders=function(t,s){i.location.href=c.N2QueryString.add_query_arg({sliders:t},this.exportAllUrl)},t.prototype.initBulk=function(){this.selection=[],this.isBulkSelection=!1,$("#n2_slider_manager_bulk_actions a[data-action]").on("click",function(e){switch(e.preventDefault(),$(e.currentTarget).data("action")){case"duplicate":this.bulkAction("duplicateSliders",!1);break;case"trash":this.bulkAction("trashSliders",!1);break;case"export":this.bulkAction("exportSliders",!1);break;case"select-all":this.bulkSelect((function(t){t.select()}));break;case"select-none":this.bulkSelect((function(t){t.deSelect()}))}}.bind(this))},t.prototype.addSelection=function(t){0===this.selection.length&&this.enterBulk(),this.selection.push(t)},t.prototype.removeSelection=function(t){this.selection.splice(this.selection.indexOf(t),1),0===this.selection.length&&this.leaveBulk()},t.prototype.bulkSelect=function(t){for(var i=0;i<this.sliders.length;i++)t(this.sliders[i])},t.prototype.bulkAction=function(t,i){var s=[],n=[];this.bulkSelect((function(t){!t.selected||i&&t.isGroup||(s.push(t),n.push(t.getId()))})),n.length?(this[t](n,s),this.leaveBulk()):i?c.Notification.notice("Please select one or more sliders for the action!"):c.Notification.notice("Please select one or more sliders or groups for the action!")},t.prototype.enterBulk=function(){this.isBulkSelection||(this.isBulkSelection=!0,this.orderBy&&this.uiSortable.setOption("disabled",!0),$("body").addClass("n2_body--bulk-select"))},t.prototype.leaveBulk=function(){if(this.isBulkSelection){this.orderBy&&this.uiSortable.setOption("disabled",!1),$("body").removeClass("n2_body--bulk-select");for(var t=0;t<this.sliders.length;t++)this.sliders[t].deSelect();this.selection=[],this.isBulkSelection=!1}},t.prototype.changeGroup=function(t){c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"getGroupInfoBySliderID"}),data:{sliderID:t},dataType:"json"}).done(function(i){var s=i.data.groups,n=i.data.linkedTo,h=new c.ModalSimple("create-group",{destroyOnHide:!0,width:440});h.addContent(c.UI.modalIcon("ssi_48 ssi_48--group","green")),h.addContent(c.UI.modalHeading(n2_("Change group")));var o=c.UI.modalFormRow(!0);h.addContent(o);for(var r={0:n2_("Dashboard")},a=0;a<s.length;a++)r[s[a].id]=s[a].title;var l=c.UI.modalSelect(o,"linkedTo",n2_("Groups"),r,n,{isMultiple:!0}),u=c.UI.modalButton(n2_("Set"),"green");h.addButton(u),u.on("click",function(e){e.preventDefault();var i,s=""===l.val()?["0"]:l.val().split("||"),o=[],r=[];for(i=0;i<n.length;i++)-1===s.indexOf(n[i])&&o.push(n[i]);for(i=0;i<s.length;i++)-1===n.indexOf(s[i])&&r.push(s[i]);(o.length||r.length)&&c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"changeGroup"}),data:{sliderID:t,toLink:r,toDelete:o},dataType:"json"}).done(function(){for(var i=0;i<o.length;i++)if(o[i]===this.groupID){$('.n2_slider_box[data-sliderid="'+t+'"]').data("slider").remove(),this.initSliders();for(var s=0;s<r.length;s++){var n=$('.n2_slider_box--group[data-sliderid="'+r[s]+'"] .n2_slider_box__footer_children_count');n.html(parseInt(n.html())+1)}break}this.leaveBulk(),h.hide()}.bind(this))}.bind(this)),h.show()}.bind(this))},t.prototype._addToGroup=function(t,i,s){return c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"addToGroup"}),data:{currentGroupID:this.groupID,groupID:i,actionType:t,sliders:s},dataType:"json"}).done(function(n){if("move"===t){for(var h=0;h<s.length;h++)$('.n2_slider_box[data-sliderid="'+s[h]+'"]').data("slider").remove();this.initSliders()}var o=$('.n2_slider_box--group[data-sliderid="'+i+'"] .n2_slider_box__footer_children_count');o.html(parseInt(o.html())+s.length)}.bind(this))},t})),c.d("ParticleAdminManager","$",(function(){var $=c.$,t={preset:0,custom:"",color:"FFFFFF80","line-color":"FFFFFF66",speed:2,number:28,hover:"off",click:"off",mobile:0};function s(s,n){i.ssForceFullHorizontalSelector=".n2_slider_preview_area__inner",c.r("#n2-ss-"+s,function(){this.slider=c["#n2-ss-"+s],this.types=n,this.fields={},this.values=f({},t),this.isReady=!1,this.registerFields(),this.slider.ready(this.onVisible.bind(this)),this.updateParticle=NextendThrottle(this.updateParticle,33),i.parent!==i&&$(i).on("keydown keyup keypress",function(e){27==e.keyCode&&this.postMessage("cancel")}.bind(this)),$("#n2-ss-form-cancel").on("click",function(e){e.preventDefault(),this.postMessage("cancel")}.bind(this)),$("#n2-ss-form-save").on("click",function(e){e.preventDefault(),this.postMessage("save",this.getValues())}.bind(this)),i.addEventListener("message",this.onMessage.bind(this),!1),this.slider.ready(function(){this.postMessage("ready")}.bind(this))}.bind(this))}return s.prototype.getValues=function(){if("0"==this.values.preset)return JSON.stringify(!1);var t=f({},this.values);return""!=t.custom&&(t.custom=JSON.parse(t.custom.replace(/\/\*.*?\*\//,""))),JSON.stringify(t)},s.prototype.postMessage=function(t){var i=!1;arguments.length>1&&(i=arguments[1]),parent.postMessage(JSON.stringify({action:t,data:i}),"*")},s.prototype.onMessage=function(i){if(i.source==parent)try{var s=JSON.parse(i.data);switch(s.action){case"load":try{var n=JSON.parse(s.data);!1===n?this.loadValues(t):this.loadValues(n)}catch(i){this.loadValues(t)}}}catch(t){console.error(t)}},s.prototype.registerFields=function(){this.registerField("preset"),this.registerField("mobile"),this.registerField("color"),this.registerField("line-color"),this.registerField("speed"),this.registerField("number"),this.registerField("hover"),this.registerField("click"),this.registerField("custom")},s.prototype.onVisible=function(){this.isReady=!0,this.updateParticle()},s.prototype.updateParticle=function(){var t=this.slider.plugins.get("particleJS");if(t){var s=this.getValue("preset");if(0==s)return $(i).trigger("resize"),void(t.pJS&&(t.pJS.pJS.fn.vendors.destroypJS(),t.pJS=!1));var n={};if("custom"==s){$(i).trigger("resize");var h=this.getValue("custom").replace(/\/\*.*?\*\//,"");if(""==h)return void(t.pJS&&(t.pJS.pJS.fn.vendors.destroypJS(),t.pJS=!1));try{n=JSON.parse(h)}catch(t){alert("Invalid JSON data in custom field.")}}else{$(i).trigger("resize"),n=JSON.parse(this.types[s]);var o=N2Color.colorToSVG(this.getValue("color"));n.particles.color.value=o[0],n.particles.opacity.value=o[1];var r=N2Color.colorToSVG(this.getValue("line-color"));n.particles.line_linked.color=r[0],n.particles.line_linked.opacity=r[1],n.particles.number.value=this.getValue("number"),n.particles.move.speed=parseInt(this.getValue("speed"));var a=this.getValue("hover");"0"==a?n.interactivity.events.onhover.enable=0:(n.interactivity.events.onhover.enable=1,n.interactivity.events.onhover.mode=a);var c=this.getValue("click");"0"==c?n.interactivity.events.onclick.enable=0:(n.interactivity.events.onclick.enable=1,n.interactivity.events.onclick.mode=c)}if(n.interactivity.detect_on=this.slider.sliderElement,t.pJS){var l=t.pJS.pJS;_(t.pJS.pJS,n),l.tmp.obj={size_value:l.particles.size.value,size_anim_speed:l.particles.size.anim.speed,move_speed:l.particles.move.speed,line_linked_distance:l.particles.line_linked.distance,line_linked_width:l.particles.line_linked.width,mode_grab_distance:l.interactivity.modes.grab.distance,mode_bubble_distance:l.interactivity.modes.bubble.distance,mode_bubble_size:l.interactivity.modes.bubble.size,mode_repulse_distance:l.interactivity.modes.repulse.distance},t.pJS.pJS.fn.particlesRefresh()}else t.start(n)}},s.prototype.registerField=function(t){this.fields[t]=$("#slider"+t).on("nextendChange",function(){this.values[t]=this.fields[t].val(),this.isReady&&this.updateParticle()}.bind(this))},s.prototype.loadValues=function(i){for(var s in"object"==typeof i.custom&&(i.custom=JSON.stringify(i.custom,null,2)),this.values=f({},t,i),this.fields)this.fields[s].data("field").insideChange(this.getValue(s))},s.prototype.getValue=function(t){return this.values[t]},s})),c.d("SelectSlider","$",(function(){var $=c.$,t=!1;function s(){this.cache={},this.ajaxUrl=c.AjaxHelper.makeAjaxUrl(c.AjaxHelper.getAdminUrl("ss3-admin"),{nextendcontroller:"sliders",nextendaction:"list"}),this.modal=new c.ModalLightbox("","select-slider"),this.modal.insertButton=c.UI.modalButton(n2_("Insert"),"green").addClass("n2_button--inactive"),this.modal.addButton(this.modal.insertButton),this.modal.insertButton.on("click",function(e){this.insertSlider(e)}.bind(this)),this.$content=$('<div class="n2_modal_select_slider"></div>'),this.modal.addContent(this.$content)}return s.prototype.setSkipGroup=function(t){this.skipGroup=t},s.prototype.setTitle=function(t){this.modal.setTitle(t)},s.prototype.displayList=function(t){t===o&&(t=0),this.cache[t]===o?c.AjaxHelper.ajax({url:this.ajaxUrl,type:"POST",data:{parentID:t}}).done(function(t,i){this.cache[t]=i.data,this.renderResponse(t,i.data)}.bind(this,t)):this.renderResponse(t,this.cache[t])},s.prototype.renderResponse=function(t,i){(this.$content.html(""),this.selectedSlider=[0],this.modal.insertButton.addClass("n2_button--inactive"),t>0)&&($('<div class="n2_slider_box__content"></div>').append($('<div class="n2_modal_select_slider__box n2_slider_box"></div>').append($('<div class="n2_slider_box__icon n2_slider_box__icon_grey"></div>').append($('<div class="n2_slider_box__icon_container"><i class="ssi_64 ssi_64--folderup"></i></div>')).append($('<div class="n2_slider_box__icon_text">'+n2_("Up")+"</div>")))).appendTo(this.$content).on("click",this.displayList.bind(this,0)),this.skipGroup||$('<div class="n2_slider_box__content"></div>').append($('<div class="n2_modal_select_slider__box n2_slider_box"></div>').append($('<div class="n2_slider_box__icon n2_slider_box__icon_grey"></div>').append($('<div class="n2_slider_box__icon_container"><i class="ssi_64 ssi_64--folder"></i></div>')).append($('<div class="n2_slider_box__icon_text">'+n2_("Insert group")+"</div>")))).appendTo(this.$content).on("click",function(e){this.selectedSlider=[t],this.insertSlider(e)}.bind(this)));for(var s=0;s<i.length;s++){var n=i[s],h=$('<div class="n2_slider_box__slider_identifiers"></div>').append($('<div class="n2_slider_box__slider_identifier"></div>').text("#"+n.id));n.isGroup&&h.append($('<div class="n2_slider_box__slider_identifier"></div>').text(n2_("Group"))),n.alias&&h.append($('<div class="n2_slider_box__slider_identifier"></div>').text(n.alias));var o="ssi_64 ssi_64--image";n.isGroup&&(o="ssi_64 ssi_64--folder");var r=$('<div class="n2_slider_box__icon"><div class="n2_slider_box__icon_container"><i class="'+o+'"></i></div></div>'),a=$('<div class="n2_slider_box__content"></div>').append(h);""===n.thumbnail&&a.append(r);var c=$('<div class="n2_slider_box__footer"></div>');n.isGroup&&c.append($('<div class="n2_slider_box__footer_icon"><i class="ssi_16 ssi_16--folderclosed"></i></div>'));var l=$('<div class="n2_modal_select_slider__box n2_slider_box"></div>').css("background-image","url("+n.thumbnail+")").append(a).append(c.append($('<div class="n2_slider_box__footer_title"></div>').text(n.title)).append($('<div class="n2_slider_box__footer_children_count"></div>').text(n.childrenCount))).appendTo(this.$content);n.isGroup?l.addClass("n2_slider_box--group").on("click",this.displayList.bind(this,n.id)):l.addClass("n2_slider_box--slider").on("click",this.select.bind(this,n.id,n.alias,t))}},s.prototype.select=function(t,i,s,e){this.$content.find(".n2_slider_box--selected").removeClass("n2_slider_box--selected"),$(e.currentTarget).addClass("n2_slider_box--selected"),this.selectedSlider=[t,i,s],this.modal.insertButton.removeClass("n2_button--inactive")},s.prototype.insertSlider=function(e){var t=this.selectedSlider[0],s=this.selectedSlider[1],n=this.selectedSlider[2];0!==t&&(this.callback.call(i,t,s,n),this.modal.hide(e))},s.prototype.show=function(t){this.callback=t,this.displayList(),this.modal.show()},function(i,n,h){!1===t&&(t=new s),t.setSkipGroup(h),t.setTitle(i),t.show(n)}})),c.d("ShapeDividerAdminManager","$",(function(){var $=c.$,t={type:"0",color:"FFFFFFFF",color2:"FFFFFF80",desktopportraitwidth:100,desktoplandscapewidth:100,tabletportraitwidth:100,tabletlandscapewidth:100,mobileportraitwidth:100,mobilelandscapewidth:100,desktopportraitheight:100,desktoplandscapeheight:100,tabletportraitheight:50,tabletlandscapeheight:50,mobileportraitheight:25,mobilelandscapeheight:25,flip:0,animate:0,speed:100,scroll:0};function n(t,i){this.sliderID=t,this.types=i,this.$frame=$("#n2_shape_divider__frame"),this.frameWindow=this.$frame[0].contentWindow,s.getElementById("n2_shape_divider__frame_form").submit(),V(this.$frame[0],"load",this.onFrameReady.bind(this))}function h(i,s,n,h){this.slider=i,this.manager=s,this.types=n,this.side=h,this.devicePrefix="desktopportrait",this.isDeviceBased={},this.fields={},this.values=f({},t),this.tweens=[],this.renderDivider=NextendThrottle(this.renderDivider,33),this.slider.ready(this.onVisible.bind(this))}n.prototype.onFrameReady=function(){this.frameWindow._N2&&this.frameWindow._N2.r("#n2-ss-"+this.sliderID,function(){this.slider=this.frameWindow._N2["#n2-ss-"+this.sliderID],new c.DeviceChanger(this.slider,s.querySelector(".n2_slider_preview_area__inner")),this.top=new h(this.slider,this,this.types,"top"),this.bottom=new h(this.slider,this,this.types,"bottom"),i.parent!==i&&$(i).on("keydown keyup keypress",function(e){27==e.keyCode&&this.postMessage("cancel")}.bind(this)),$("#n2-ss-form-cancel").on("click",function(e){e.preventDefault(),this.postMessage("cancel")}.bind(this)),$("#n2-ss-form-save").on("click",function(e){e.preventDefault(),this.postMessage("save",this.getValues())}.bind(this)),i.addEventListener("message",this.onMessage.bind(this),!1),this.slider.ready(function(){this.postMessage("ready"),this.initDeviceSwitcherShortcut()}.bind(this))}.bind(this))},n.prototype.getValues=function(){return JSON.stringify({top:this.top.getValues(),bottom:this.bottom.getValues()})},n.prototype.postMessage=function(t){var i=!1;arguments.length>1&&(i=arguments[1]),parent.postMessage(JSON.stringify({action:t,data:i}),"*")},n.prototype.onMessage=function(i){if(i.source==parent)try{switch((n=JSON.parse(i.data)).action){case"load":try{var s=JSON.parse(n.data);this.top.loadValues(s.top),this.bottom.loadValues(s.bottom)}catch(i){this.top.loadValues(t),this.bottom.loadValues(t)}}}catch(t){console.error(t)}else if(i.source===this.$frame[0].contentWindow){var n={};try{n=JSON.parse(i.data)}catch(t){}switch(n.action){case"cancel":this.postMessage("cancel")}}},n.prototype.initDeviceSwitcherShortcut=function(){var t=$("#n2-admin").find('[data-field="table-shapedivider"]'),i=$('<div id="n2-ss-devicespecific-settings"></div>'),s=this.slider.parameters.responsive.enabledDevices,n={desktopLandscape:"ssi_16--desktoplandscape",desktopPortrait:"ssi_16--desktopportrait",tabletLandscape:"ssi_16--tabletportraitlarge",tabletPortrait:"ssi_16--tabletportrait",mobileLandscape:"ssi_16--mobileportraitlarge",mobilePortrait:"ssi_16--mobileportrait"};for(var h in s)s[h]&&i.append('<i class="ssi_16 '+n[h]+'" data-device="'+h+'"></i>');var o={mouseenter:function(e){i.appendTo(e.currentTarget)}.bind(this),mouseleave:function(e){i.detach()}.bind(this)},r=t.find("[data-devicespecific] label").parent(),a=$('<div class="n2_field__label_modifier ssi_16 ssi_16--minidesktopportrait"></div>').on(o);r.prepend(a),i.find(".ssi_16").on({click:function(e){e.preventDefault();var t=$(e.currentTarget);$('.n2_device_tester_devices__device[data-device="'+t.data("device")+'"]').trigger("click")}.bind(this)})},h.prototype.loadValues=function(i){for(var s in this.values=f({},t,i),this.renderDivider(),this.fields)this.fields[s].data("field").insideChange(this.getValue(s))},h.prototype.getValues=function(){return 0!=this.values.type&&this.values},h.prototype.onVisible=function(){this.$shapeContainer=$(this.slider.getSlideBackgroundContainer()),this.registerField("type",!1),this.$fieldGroups=this.fields.type.closest(".n2-element").find(".n2-mixed-group").slice(1).css("display","none"),this.registerField("color",!1),this.registerField("color2",!1),this.$color2Container=this.fields.color2.closest(".n2_field").addClass("n2_form_element--hidden"),this.registerField("flip",!1),this.registerField("animate",!1),this.registerField("speed",!1),this.registerField("width",!0),this.registerField("height",!0),this.registerField("scroll",!1),V(this.slider.sliderElement,"SliderDeviceOrientation",this.onDeviceChange.bind(this))},h.prototype.onDeviceChange=function(e){for(var t in this.devicePrefix=e.detail.device.toLowerCase(),this.isDeviceBased)this.isDeviceBased[t]&&this.fields[t].data("field").insideChange(this.getValue(t));this.renderDivider()},h.prototype.renderDivider=function(){if(this.tweens.length){for(var t=0;t<this.tweens.length;t++)this.tweens[t].kill();this.tweens=[]}P(this.slider.sliderElement.querySelector(".n2-ss-shape-divider-"+this.side));var i=this.getValue("type");if(0==i?this.$fieldGroups.css("display","none"):this.$fieldGroups.css("display",""),this.$color2Container.toggleClass("n2_form_element--hidden",!i.match(/bi\-/)),"0"!=i&&this.types[i]!==o){var s=this.types[i].replace(/#000000/g,N2Color.hex2rgbaCSS(this.getValue("color"))).replace(/#000010/g,N2Color.hex2rgbaCSS(this.getValue("color2")));"bottom"===this.side?s=parseInt(this.getValue("flip"))?r.mirror(s,!0,!0):r.mirror(s,!1,!0):parseInt(this.getValue("flip"))&&(s=r.mirror(s,!0,!1));var n=$("<div class='n2-ss-shape-divider n2-ss-shape-divider-"+this.side+"' style='height:"+this.getValue("height")+"px;'><div style='width:"+this.getValue("width")+"%;margin-left:"+-(this.getValue("width")-100)/2+"%;' class='n2-ss-shape-divider-inner'>"+s+"</div></div>").appendTo(this.$shapeContainer);if(parseInt(this.getValue("animate"))){var h=n[0].querySelector("svg"),a=h.querySelectorAll("*"),l=100/(this.getValue("speed")||100);if(x(h,"yoyo"))for(var u={onComplete:function(){this.reverse()},onReverseComplete:function(){this.restart()}},d=0;d<a.length;d++)this.tweens.push(c.J.to(a[d],+v(a[d],"duration")*l,f({attr:{d:v(a[d],"to-d")},delay:0,ease:"easeInOut"},u,{delay:+v(a[d],"delay"),ease:v(a[d],"ease")})));else{var _=new c.H({onComplete:function(){this.restart()}});for(d=0;d<a.length;d++)_.to(a[d],+v(a[d],"duration")*l,f({attr:{d:v(a[d],"to-d")},delay:0,ease:"easeOutCubic"},{delay:+v(a[d],"delay"),ease:v(a[d],"ease")}),0);_.set({},{},"+=2"),this.tweens.push(_)}}else n[0].querySelectorAll("path").forEach((function(t){t.setAttribute("d",t.getAttribute("to-d"))}))}},h.prototype.registerField=function(t,i){this.isDeviceBased[t]=i,this.fields[t]=$("#slidershapedivider-"+this.side+"-"+t).on("nextendChange",function(){i?this.values[this.devicePrefix+t]=this.fields[t].val():this.values[t]=this.fields[t].val(),this.renderDivider()}.bind(this))},h.prototype.getValue=function(t){return this.isDeviceBased[t]?this.values[this.devicePrefix+t]==o||""==this.values[this.devicePrefix+t]?this.values["desktopportrait"+t]:this.values[this.devicePrefix+t]:this.values[t]};var r={viewBoxX:0,viewBoxY:0,mirror:function(t,i,s){var n;if(i&&s)n=this.xy;else if(i)n=this.x;else{if(!s)return t;n=this.y}var h=t.match(/(viewBox)=['"](.*?)['"]/i),o=h[h.length-1].split(" ");return this.viewBoxX=parseInt(o[2]),this.viewBoxY=parseInt(o[3]),t.replace(/d=[\'"](.*?)[\'"]/gi,n.bind(this))},x:function(t,i){var s,n,h=(i=i.substr(0,i.length-1)).split(" "),o="";for(n=0;n<h.length;n++){var r=h[n].substr(0,1);s=h[n].substr(1).split(",");for(var a=0;a<s.length;a+=2)switch(r){case"l":case"m":case"h":case"c":case"s":case"q":case"t":s[a]=-parseFloat(s[a]);break;case"L":case"M":case"H":case"C":case"S":case"Q":case"T":s[a]=this.viewBoxX-parseFloat(s[a])}o+=r+s.join(",")}return'd="'+o+'z"'},y:function(t,i){var s,n,h=(i=i.substr(0,i.length-1)).split(" "),o="";for(n=0;n<h.length;n++){var r=h[n].substr(0,1);s=h[n].substr(1).split(",");for(var a=0;a<s.length;a+=2)switch(r){case"v":s[a]=-parseFloat(s[a]);break;case"V":s[a]=this.viewBoxY-parseFloat(s[a]);break;case"l":case"m":case"c":case"s":case"q":case"t":s[a+1]=-parseFloat(s[a+1]);break;case"L":case"M":case"C":case"S":case"Q":case"T":s[a+1]=this.viewBoxY-parseFloat(s[a+1])}o+=r+s.join(",")}return'd="'+o+'z"'},xy:function(t,i){var s,n,h=(i=i.substr(0,i.length-1)).split(" "),o="";for(n=0;n<h.length;n++){var r=h[n].substr(0,1);s=h[n].substr(1).split(",");for(var a=0;a<s.length;a+=2)switch(r){case"h":case"v":s[a]=-parseFloat(s[a]);break;case"H":s[a]=this.viewBoxX-parseFloat(s[a]);break;case"V":s[a]=this.viewBoxY-parseFloat(s[a]);break;case"l":case"m":case"c":case"s":case"q":case"t":s[a]=-parseFloat(s[a]),s[a+1]=-parseFloat(s[a+1]);break;case"L":case"M":case"C":case"S":case"Q":case"T":s[a]=this.viewBoxX-parseFloat(s[a]),s[a+1]=this.viewBoxY-parseFloat(s[a+1])}o+=r+s.join(",")}return'd="'+o+'z"'}};return n})),c.d("Slider","$",(function(){var $=c.$;function t(t,i){this.selected=!1,this.manager=t,this.box=i.data("slider",this),this.isGroup=!!this.box.data("group"),this.editUrl=this.box.find(".n2_slider_box__slider_overlay_edit_button").attr("href"),this.box.on("contextmenu",this.onContextMenu.bind(this)),this.box.find(".n2_slider_box__slider_select_tick").on("click",function(e){e.stopPropagation(),e.preventDefault(),this.invertSelection()}.bind(this)),this.$more=this.box.find(".n2_slider_box__slider_action_more").on("click",this.onMore.bind(this)),this.initRename()}return t.prototype.getId=function(){return this.box.data("sliderid")},t.prototype.onContextMenu=function(e){e.preventDefault(),this.showContextMenu(e)},t.prototype.onMore=function(e){e.preventDefault(),this.showContextMenu(this.$more[0])},t.prototype.showContextMenu=function(t){var i=[];i.push({priority:10,label:n2_("Preview"),icon:"ssi_16 ssi_16--eye",action:this.preview.bind(this)}),this.isGroup||i.push({priority:10,label:n2_("Change group"),icon:"ssi_16 ssi_16--folderclosed",action:this.changeGroup.bind(this)}),i.push({priority:55,label:n2_("Duplicate"),icon:"ssi_16 ssi_16--duplicate",action:this.duplicate.bind(this)}),i.push({priority:1e3,label:n2_("Move to trash"),icon:"ssi_16 ssi_16--delete",action:this.trash.bind(this),color:"red"}),this.box.addClass("n2_slider_box--context-menu"),c.ContextMenu(t,i,{y:5,horizontalAlign:"left",onClose:function(){this.box.removeClass("n2_slider_box--context-menu")}.bind(this)})},t.prototype.preview=function(){i.open(c.N2QueryString.add_query_arg({sliderid:this.getId()},this.manager.previewUrl),"_blank")},t.prototype.changeGroup=function(){this.manager.changeGroup(this.getId())},t.prototype.duplicate=function(){var i=$.Deferred();return c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.manager.ajaxUrl,{nextendcontroller:"slider",nextendaction:"duplicate",sliderid:this.getId()})}).done(function(s){var n=$(s.data).insertAfter(this.box),h=new t(this.manager,n);this.manager.initSliders(),i.resolve(h)}.bind(this)),i},t.prototype.trash=function(){this.manager.trashSliders([this.getId()],[this])},t.prototype.remove=function(){this.box.remove()},t.prototype.invertSelection=function(e){e&&e.preventDefault(),this.selected?this.deSelect():this.select()},t.prototype.select=function(){this.selected||(this.selected=!0,this.box.addClass("n2_slider_box--bulk-selected"),this.manager.addSelection(this))},t.prototype.deSelect=function(){this.selected&&(this.selected=!1,this.box.removeClass("n2_slider_box--bulk-selected"),this.manager.removeSelection(this))},t.prototype.initRename=function(){this.dblClickTimeout=!1,this.$label=this.box.find(".n2_slider_box__footer_title").on("click",function(e){"true"!==this.$label[0].contentEditable&&(this.dblClickTimeout?(a(this.dblClickTimeout),this.dblClickTimeout=!1,this.editName()):this.dblClickTimeout=r(function(){i.location=this.editUrl,this.dblClickTimeout=!1}.bind(this),500))}.bind(this)),this.title=this.$label.text().trim(),this.$label.text(this.title)},t.prototype.editName=function(){new c.InlineTextEditor(this.$label[0],{onSave:function(t){this.title!==t&&c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.manager.ajaxUrl,{nextendcontroller:"slider",nextendaction:"rename",sliderid:this.getId(),title:t})}).done(function(){this.title=t}.bind(this)).fail(function(){this.$label.text(this.title)}.bind(this))}.bind(this),onCancel:function(){this.$label.text(this.title)}.bind(this),onTab:function(e){for(var t=$(".n2_slider_box__footer_title"),i=0;i<t.length;i++)if(this.$label.is(t[i])){e.shiftKey?i--:i++;break}i<0?i=t.length-1:i>=t.length&&(i=0),t.eq(i).trigger("click").trigger("click")}.bind(this)})},t})),c.d("SlidersTrash","$",(function(){var $=c.$;function t(t){this.options=t,this.$container=$(".n2_slider_trash");for(var i=this.$container.find(".n2_slider_box"),n=0;n<i.length;n++)new s(this,i.eq(n));this.$emptyTrashButton=$(".n2_slider_empty_trash").on("click",this.emptyTrash.bind(this)),this.refreshEmptyTrashStatus()}function s(t,i){this.manager=t,this.$box=i,this.$box.on("contextmenu",this.onContextMenu.bind(this)),this.$box.find(".n2_slider_box__slider_overlay_restore_button").on("click",this.restore.bind(this)),this.$more=this.$box.find(".n2_slider_box__slider_action_more").on("click",this.onMore.bind(this))}return t.prototype.emptyTrash=function(e){e.preventDefault(),this.isEmpty()||c.ModalDeleteConfirm(n2_("empty the trash"),function(){c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.options.ajaxUrl,{nextendcontroller:"sliders",nextendaction:"emptyTrash"}),type:"POST"}).done(function(){this.$container.find(".n2_slider_box").remove(),this.refreshEmptyTrashStatus()}.bind(this))}.bind(this))},t.prototype.isEmpty=function(){return 0===this.$container.find(".n2_slider_box").length},t.prototype.refreshEmptyTrashStatus=function(){var t=this.isEmpty();this.$container.toggleClass("n2_slider_trash--empty",t),this.$emptyTrashButton.toggleClass("n2_button--inactive",t)},s.prototype.getId=function(){return this.$box.data("sliderid")},s.prototype.onContextMenu=function(e){e.preventDefault(),this.showContextMenu(e)},s.prototype.onMore=function(e){e.preventDefault(),this.showContextMenu(this.$more[0])},s.prototype.showContextMenu=function(t){var i=[];i.push({priority:20,label:n2_("Preview"),icon:"ssi_16 ssi_16--eye",action:this.preview.bind(this)}),i.push({priority:30,label:n2_("Delete permanently"),icon:"ssi_16 ssi_16--delete",action:this.deletePermanently.bind(this),color:"red"}),this.$box.addClass("n2_slider_box--context-menu"),c.ContextMenu(t,i,{y:5,horizontalAlign:"left",onClose:function(){this.$box.removeClass("n2_slider_box--context-menu"),this.manager.refreshEmptyTrashStatus()}.bind(this)})},s.prototype.restore=function(e){e.preventDefault(),c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.manager.options.ajaxUrl,{nextendcontroller:"slider",nextendaction:"restore"}),type:"POST",data:{slider:this.getId()}}).done(function(){this.$box.remove(),this.manager.refreshEmptyTrashStatus()}.bind(this))},s.prototype.preview=function(){i.open(c.N2QueryString.add_query_arg({sliderid:this.getId()},this.manager.options.previewUrl),"_blank")},s.prototype.deletePermanently=function(){c.ModalDeleteConfirm(n2_("delete this slider"),function(){c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.manager.options.ajaxUrl,{nextendcontroller:"slider",nextendaction:"deletePermanently"}),type:"POST",data:{slider:this.getId()}}).done(function(t){this.$box.remove();for(var i=t.data.sliderIDs,s=0;s<i.length;s++)$('.n2_slider_manager__box[data-sliderid="'+i[s]+'"]').remove();this.manager.refreshEmptyTrashStatus()}.bind(this))}.bind(this))},t})),c.d("NextendSplitTextAnimation",["$","NextendVisualWithSetRow"],(function(){function t(){c.NextendVisualWithSetRow.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.NextendVisualWithSetRow.prototype),t.prototype.constructor=t,t.prototype.activate=function(e){e!==o&&e.preventDefault(),this.visualManager.changeActiveVisual(this),this.value.transformOrigin!==o&&this.visualManager.controller.loadTransformOrigin(this.value.transformOrigin),this.visualManager.controller.load(this.value.animation,!1,this.visualManager.showParameters)},t})),c.d("NextendSplitTextAnimationEditor",["$","NextendFragmentEditor"],(function(){var $=c.$;function t(){c.NextendFragmentEditor.prototype.constructor.apply(this,arguments),this.fields={mode:{element:$("#n2-splittextanimation-editormode"),events:{"outsideChange.n2-editor":this.changeMode.bind(this)}},sort:{element:$("#n2-splittextanimation-editorsort"),events:{"outsideChange.n2-editor":this.changeSort.bind(this)}},duration:{element:$("#n2-splittextanimation-editorduration"),events:{"outsideChange.n2-editor":this.changeDuration.bind(this)}},stagger:{element:$("#n2-splittextanimation-editorstagger"),events:{"outsideChange.n2-editor":this.changeStagger.bind(this)}},easing:{element:$("#n2-splittextanimation-editoreasing"),events:{"outsideChange.n2-editor":this.changeEasing.bind(this)}},opacity:{element:$("#n2-splittextanimation-editoropacity"),events:{"outsideChange.n2-editor":this.changeOpacity.bind(this)}},offset:{element:$("#n2-splittextanimation-editoroffset"),events:{"outsideChange.n2-editor":this.changeOffset.bind(this)}},rotate:{element:$("#n2-splittextanimation-editorrotate"),events:{"outsideChange.n2-editor":this.changeRotate.bind(this)}},scale:{element:$("#n2-splittextanimation-editorscale"),events:{"outsideChange.n2-editor":this.changeScale.bind(this)}},transformOrigin:{element:$("#n2-splittextanimation-editortransformorigin"),events:{"outsideChange.n2-editor":this.changeTransformOrigin.bind(this)}}}}return t.prototype=Object.create(c.NextendFragmentEditor.prototype),t.prototype.constructor=t,t.prototype.load=function(t){this._off(),"lines"===t.mode&&(t.mode="words"),this.fields.mode.element.data("field").insideChange(t.mode),t.sort||(t.sort="normal"),this.fields.sort.element.data("field").insideChange(t.sort),this.fields.duration.element.data("field").insideChange(1e3*t.duration),this.fields.stagger.element.data("field").insideChange(1e3*t.stagger),this.fields.easing.element.data("field").insideChange(t.ease),this.fields.opacity.element.data("field").insideChange(100*t.opacity),this.fields.offset.element.data("field").insideChange(t.x+"|*|"+t.y),this.fields.rotate.element.data("field").insideChange(t.rotationX+"|*|"+t.rotationY+"|*|"+t.rotationZ),this.fields.scale.element.data("field").insideChange(100*t.scale),this.fields.transformOrigin.element.data("field").insideChange(c._splittextanimationManager.controller.transformOrigin),this._on()},t.prototype.changeMode=function(){this.trigger("mode",this.fields.mode.element.val())},t.prototype.changeSort=function(){this.trigger("sort",this.fields.sort.element.val())},t.prototype.changeDuration=function(){this.trigger("duration",this.fields.duration.element.val()/1e3)},t.prototype.changeStagger=function(){this.trigger("stagger",this.fields.stagger.element.val()/1e3)},t.prototype.changeEasing=function(){this.trigger("ease",this.fields.easing.element.val())},t.prototype.changeOpacity=function(){this.trigger("opacity",this.fields.opacity.element.val()/100)},t.prototype.changeOffset=function(){var t=this.fields.offset.element.val().split("|*|");this.trigger("x",t[0]),this.trigger("y",t[1])},t.prototype.changeRotate=function(){var t=this.fields.rotate.element.val().split("|*|");this.trigger("rotationX",t[0]),this.trigger("rotationY",t[1]),this.trigger("rotationZ",t[2])},t.prototype.changeScale=function(){this.trigger("scale",this.fields.scale.element.val()/100)},t.prototype.changeTransformOrigin=function(){c._splittextanimationManager.controller.refreshTransformOrigin(this.fields.transformOrigin.element.val(),!0)},t})),c.d("NextendSplitTextAnimationEditorController",["$","NextendFragmentEditorControllerWithEditor"],(function(){var $=c.$;function t(){this.timeline=new c.H,c.NextendFragmentEditorControllerWithEditor.prototype.constructor.apply(this,arguments),this.preview=$('<div class="n2_form__table_preview"></div>').css("fontSize","16px").appendTo('.n2_form__table[data-field="table-splittextanimation-preview"]'),this.initBackgroundColor()}return t.prototype=Object.create(c.NextendFragmentEditorControllerWithEditor.prototype),t.prototype.constructor=t,t.prototype.loadDefaults=function(){c.NextendFragmentEditorControllerWithEditor.prototype.loadDefaults.call(this),this.type="splittextanimation",this.group="in",this.preview=null,this.playing=!1,this.transformOrigin="0|*|0|*|0",this.mySplitText=null,this.repeatTimeout=null},t.prototype.initEditor=function(){return new c.NextendSplitTextAnimationEditor},t.prototype._load=function(t,i,s){""===t&&(t={}),this.group=s.group,c.NextendFragmentEditorControllerWithEditor.prototype._load.call(this,_({},this.getEmptyVisual(),t),i,s),this.render(s.previewHTML)},t.prototype.propertyChanged=function(e,t,i){c.NextendFragmentEditorControllerWithEditor.prototype.propertyChanged.call(this,e,t,i),this.refreshTimeline()},t.prototype.get=function(t){return"saveAsNew"==t?{transformOrigin:this.transformOrigin,animation:this.currentVisual}:this.currentVisual},t.prototype.getEmptyVisual=function(){return{mode:"chars",sort:"normal",duration:.4,stagger:.05,ease:"easeOutCubic",opacity:1,scale:1,x:0,y:0,rotationX:0,rotationY:0,rotationZ:0}},t.prototype.initBackgroundColor=function(){this.$background=$("#n2-splittextanimation-editorpreview-background").on("nextendChange",function(){this.preview.css("background","#"+this.$background.val())}.bind(this)),this.preview.css("background","#"+this.$background.val())},t.prototype.render=function(t){var i={fontClassName:c._splittextanimationManager.fontClassName,styleClassName:c._splittextanimationManager.styleClassName,width:Math.ceil(c._activeLayer.layer.width()),text:$("#item_headingheading").val().replace(/\n/g,"<br>")};t=t.replace(/\{([^]*?)\}/g,(function(t,s){return i[s]})),this.preview.html(t),this.visible&&this.refreshTimeline()},t.prototype.refreshTimeline=function(){this.killPreview();var t=f({},this.currentVisual),i=t.mode;this.mySplitText=new c.K(this.preview.find($('span[class^="n2-font-"]'))[0],"chars"===i);var s=[];switch(t.mode){case"lines":case"words":s=this.mySplitText.words;break;default:s=this.mySplitText.chars}delete t.mode,this.timeline=new c.H;var n=t.duration,h=t.stagger;delete t.duration,delete t.stagger,c.MW.X(c.MW.D(s),{transformOrigin:this.transformOrigin.split("|*|").join("% ")+"px"});var o=null;switch(t.sort){case"reversed":s.reverse();break;case"random":!function(t,i,s,n){for(s=t.length;s;)i=Math.random()*s--|0,n=t[s],t[s]=t[i],t[i]=n}(s);break;case"side":case"center":var a=[];for(o=[];s.length>1;)a.push(s.shift()),o.push(s.pop());1==s.length&&a.push(s.shift()),s=a,"center"==t.sort&&(s.reverse(),o.reverse());break;case"sideShifted":case"centerShifted":for(a=[];s.length>1;)a.push(s.shift()),a.push(s.pop());1==s.length&&a.push(s.shift()),s=a,"centerShifted"==t.sort&&s.reverse()}if(delete t.sort,"out"==this.group){var l=this.getEmptyVisual();delete l.mode,delete l.sort,delete l.duration,delete l.easing,delete l.stagger,this.timeline.staggerFromTo(s,n,l,t,-h,.3),o&&o.length&&this.timeline.staggerFromTo(o,n,l,t,-h,.3)}else this.timeline.staggerFrom(s,n,t,h,.3),o&&o.length&&this.timeline.staggerFrom(o,n,t,h,.3);this.timeline.eventCallback("onComplete",function(){this.repeatTimeout=r(function(){this.timeline.play(0,!1)}.bind(this),1e3)}.bind(this)),this.timeline.play()},t.prototype.killPreview=function(){this.repeatTimeout&&a(this.repeatTimeout),this.timeline.pause(),this.mySplitText&&this.mySplitText.revert()},t.prototype.show=function(){this.loadTransformOrigin(c._splittextanimationManager.transformOriginElement.val()),c.NextendFragmentEditorControllerWithEditor.prototype.show.call(this),this.refreshTimeline()},t.prototype.close=function(){this.killPreview(),c.NextendFragmentEditorControllerWithEditor.prototype.close.call(this)},t.prototype.loadTransformOrigin=function(t){this.editor.fields.transformOrigin.element.data("field").insideChange(t),this.refreshTransformOrigin(t,!1)},t.prototype.refreshTransformOrigin=function(t,i){this.transformOrigin=t,c.MW.R(this.preview.parent()[0]).perspective=1e3,i&&this.refreshTimeline()},t})),c.d("NextendSplitTextAnimationManager",["$","NextendVisualManagerSetsAndMore"],(function(){var $=c.$;function t(){this.css=[],c.NextendVisualManagerSetsAndMore.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.NextendVisualManagerSetsAndMore.prototype),t.prototype.constructor=t,t.prototype.loadDefaults=function(){c.NextendVisualManagerSetsAndMore.prototype.loadDefaults.apply(this,arguments),this.type="splittextanimation",this.labels={visual:"Text animation",visuals:"Text animations"},this.styleClassName="",this.fontClassName=""},t.prototype.initController=function(){return new c.NextendSplitTextAnimationEditorController},t.prototype.createVisual=function(t,i){return new c.NextendSplitTextAnimation(t,i,this)},t.prototype.setConnectedStyle=function(t){var i=$("#"+t).data("field").renderStyle();this.css.push(i),this.styleClassName=i.getBaseClassName()},t.prototype.setConnectedFont=function(t){var i=$("#"+t).data("field").renderFont();this.css.push(i),this.fontClassName=i.getBaseClassName()},t.prototype.setVisualAsStatic=function(e){if(null!==this.transformOriginElement){var t=this.transformOriginElement.data("field");t.insideChange(this.controller.transformOrigin),t.triggerOutsideChange()}switch(e.preventDefault(),this.mode){case"static":this.setAndClose(this.getBase64(n2_("Static"))),this.hide(e);break;default:c.NextendVisualManagerSetsAndMore.prototype.setVisualAsStatic.call(this,e)}},t.prototype.getBase64=function(t){return c.Base64.encode(JSON.stringify({name:t,data:this.controller.get("set")}))},t.prototype.hide=function(e){c.NextendVisualManagerSetsAndMore.prototype.hide.call(this,e);for(var t=0;t<this.css.length;t++)this.css[t].destroy();this.css=[]},t.prototype.show=function(t,i,s){this.transformOriginElement=s.transformOrigin,c.NextendVisualManagerSetsAndMore.prototype.show.call(this,t,i,s),""==t&&$.when(this.activeSet._loadVisuals()).done(function(){for(var t in this.activeSet.visuals){this.activeSet.visuals[t].activate();break}}.bind(this))},t})),c.d("GroupEdit","$",(function(){var $=c.$;function t(t){this.options=f({previewInNewWindow:!1,saveAjaxUrl:"",previewUrl:"",ajaxUrl:"",formData:{}},t),this.url=this.options.ajaxUrl,this.values=this.options.formData,c.Form.prototype.constructor.call(this),c.r("documentReady",this.onReady.bind(this))}return t.prototype=Object.create(c.Form.prototype),t.prototype.constructor=t,t.prototype.onReady=function(){this.setID("#n2-ss-edit-group-form"),c.Form.prototype.onReady.call(this),this.$form.on("submit",this.onSaveSubmit.bind(this)),this.initPreview()},t.prototype.onKeyDown=function(e){var t=!1;return(e.ctrlKey||e.metaKey)&&49===e.keyCode&&(this.showPreview(),t=!0),t?e.preventDefault():t=c.Form.prototype.onKeyDown.call(this,e),t},t.prototype.initButtons=function(){this.$saveButton=$(".n2_group_settings_save").on("click",this.actionSave.bind(this)),$(".n2_group_settings_back").on("click",this.actionCancel.bind(this))},t.prototype.actionSave=function(e){e&&e.preventDefault(),this.skipChangeConfirm=!0,this.$form.trigger("submit")},t.prototype.actionCancel=function(e){e&&e.preventDefault(),i.location=e.currentTarget.href},t.prototype.onSaveSubmit=function(e){this.$form.attr("target")===o&&(e.preventDefault(),c.AjaxHelper.ajax({type:"POST",url:this.options.saveAjaxUrl,data:this.$form.serialize(),dataType:"json",success:this.onAfterSave.bind(this)}))},t.prototype.onAfterSave=function(t){if($(".n2_header__heading_primary").text($("#slidertitle").val()),t&&t.data&&t.data.changedFields){for(var i in t.data.changedFields)t.data.changedFields.hasOwnProperty(i)&&$("#"+i).val(t.data.changedFields[i]);if(t.data.changedFields.slideralias!==o){var s=t.data.changedFields[i],n=$('.n2_ss_slider_publish__option_code[data-mode="alias"]');n.length||(n=$('<div class="n2_ss_slider_publish__option_code" data-mode="alias"></div>').insertAfter($('.n2_ss_slider_publish__option_code[data-mode="id"]'))),s?n.text('[smartslider3 alias="'+s+'"]'):n.remove()}}this.afterSave()},t.prototype.initPreview=function(){this.options.previewInNewWindow||(this.modal=new c.ModalIframe("preview-slider")),$(".n2_top_bar_main__preview").on("click",this.showPreview.bind(this))},t.prototype.showPreview=function(e){e&&e.preventDefault(),this.options.previewInNewWindow?c.PreviewPopup("","preview-slider"):this.modal.show(),this.$form.attr({action:c.AjaxHelper.makeAjaxUrl(this.options.previewUrl,{nextendaction:this.options.previewInNewWindow?"index":"slider"}),target:"preview-slider"}).trigger("submit").attr({action:this.formAction,target:null})},t})),c.d("FormElementAnimationManager",["$","FormElement"],(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.parent=this.element.parent(),this.managerIdentifier=i,this.parent.find(".n2_field_chooser__choose, .n2_field_chooser__label").on("click",this.show.bind(this)),this.parent.find(".n2_field_chooser__clear").on("click",this.clear.bind(this)),this.$name=this.parent.find(".n2_field_chooser__label"),this.updateName(this.element.val()),c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.show=function(e){e.preventDefault(),c["_"+this.managerIdentifier].show(this.element.val(),this.save.bind(this))},t.prototype.clear=function(e){e.preventDefault(),e.stopPropagation(),this.val("")},t.prototype.save=function(e,t){this.val(t)},t.prototype.val=function(t){this.element.val(t),this.updateName(t),this.triggerOutsideChange()},t.prototype.insideChange=function(t){this.element.val(t),this.updateName(t),this.triggerInsideChange()},t.prototype.updateName=function(t){var i;this.parent.toggleClass("n2_field_chooser--empty",""===t),i=""===t?n2_("Disabled"):n2_("Enabled"),this.$name.text(i)},t.prototype.isEmpty=function(t){return""===t},t})),c.d("FormElementColumns",["$","FormElement"],(function(){var $=c.$;function t(t){this.denominators={1:100,2:100,3:144,4:100,5:100,6:144},this.element=$("#"+t),c.FormElement.prototype.constructor.call(this),this.$c=$("#"+t).parent(),this.$container=this.$c.find(".n2_field_columns__content"),this.containerWidth=280,this.maxWidth=0,new c.UISortable(this.$container,{axis:"x",items:".n2_field_columns__column",helper:"clone_hide",start:function(e,t){this.$container.addClass("n2-sortable-currently-sorted"),t.placeholder.css({width:t.item.width()+"px",visibility:"hidden"});var i=this.$container.find(".n2_field_columns__column");t.item.data("index",i.index(t.item))}.bind(this),stop:function(e,t){var i=this.$container.find(".n2_field_columns__column"),s=t.item.data("index"),n=i.index(t.item);s!=n&&(this.currentRow.moveColOrOrder(s,n),t.item.data("index",null)),this.makeResizable(),this.$container.removeClass("n2-sortable-currently-sorted")}.bind(this)}),this.$c.find(".n2_field_columns__add").on({click:function(){this.currentRow.createCol()}.bind(this)})}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.getDenominator=function(t){return this.denominators[t]===o&&(this.denominators[t]=15*t),this.denominators[t]},t.prototype.setRow=function(t){this.currentRow=t,this.insideChange(t.getColumnsOrdered())},t.prototype.setValue=function(t){},t.prototype.insideChange=function(t){this.start(t)},t.prototype.activateColumn=function(e){var t=this.$container.find(".n2_field_columns__column").index(e.currentTarget);this.currentRow.activateColumn(t,e)},t.prototype.start=function(t){this.percentages=[];for(var i=t.split("+"),s=0;s<i.length;s++)this.percentages.push(new Fraction(i[s]));this.refreshMaxWidth(),this.$container.empty();for(s=0;s<this.percentages.length;s++){var n=$('<div class="n2_field_columns__column">').on("click",this.activateColumn.bind(this)).appendTo(this.$container);c._tooltip.addElement(n,n2_("Column")),this.updateColumn(n,this.percentages[s])}this.makeResizable()},t.prototype.refreshMaxWidth=function(){this.maxWidth=this.containerWidth-16*(this.percentages.length-1)},t.prototype.updateColumn=function(t,i){t.css("width",this.maxWidth*i.valueOf()+"px").html(Math.round(100*i.valueOf()*10)/10+"%")},t.prototype.makeResizable=function(){this.handles&&this.handles.remove(),this.$columns=this.$container.find(".n2_field_columns__column"),$('<div class="n2_field_columns__handle"><div class="ssi_16 ssi_16--divide"></div></div>').insertAfter(this.$columns.not(this.$columns.last())),this.handles=this.$container.find(".n2_field_columns__handle").on("mousedown",this._resizeStart.bind(this))},t.prototype._resizeStart=function(e){var t=this.handles.index(e.currentTarget),i=this.$container.offset().left+8;this.resizeContext={index:t,cLeft:i,$currentCol:this.$columns.eq(t),$nextCol:this.$columns.eq(t+1),startX:Math.max(0,Math.min(e.clientX-i,this.containerWidth))},this._resizeMove(e),$("html").off(".resizecol").on({"mousemove.resizecol":this._resizeMove.bind(this),"mouseup.resizecol mouseleave.resizecol":this._resizeStop.bind(this)})},t.prototype._resizeMove=function(e){e.preventDefault();var t=Math.max(0,Math.min(e.clientX-this.resizeContext.cLeft,this.containerWidth)),i=this.getDenominator(this.percentages.length),s=new Fraction(Math.round((t-this.resizeContext.startX)/(this.maxWidth/i)),i);s.compare(this.percentages[this.resizeContext.index].clone().mul(-1))<0&&(s=this.percentages[this.resizeContext.index].clone().mul(-1)),s.compare(this.percentages[this.resizeContext.index+1])>0&&(s=this.percentages[this.resizeContext.index+1].clone());var n=this.percentages[this.resizeContext.index].add(s),h=this.percentages[this.resizeContext.index+1].sub(s);this.updateColumn(this.resizeContext.$currentCol,n),this.updateColumn(this.resizeContext.$nextCol,h);var o=f([],this.percentages);return o[this.resizeContext.index]=n,o[this.resizeContext.index+1]=h,this.onColumnWidthChange(o),[n,h]},t.prototype._resizeStop=function(e){var t=this._resizeMove(e);this.percentages[this.resizeContext.index]=t[0],this.percentages[this.resizeContext.index+1]=t[1],$("html").off(".resizecol"),delete this.resizeContext,this.currentRow.setRealColsWidth(this.percentages)},t.prototype.onColumnWidthChange=function(t){for(var i=[],s=0;s<t.length;s++)i.push(t[s].valueOf());this.currentRow.updateColumnWidth(i)},t})),c.d("FormElementControlTypePicker",["$","FormElement"],(function(){var $=c.$;function t(t,i){this.options=f({ajaxUrl:"",target:"",originalValue:""},i),this.id=t,this.element=$("#"+t);var s=this.element.parent();this.$items=s.find(".n2_field_control_type_picker__item"),this.target=$("#"+this.options.target),this.form=this.element.closest("form"),this.element.on("nextendChange",this.loadSubform.bind(this)),this.$items.on("click",function(e){this.selectOption($(e.currentTarget).data("controltype"))}.bind(this)),this.markSelected(this.options.originalValue),c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.loadSubform=function(){var t=this.element.val(),i=[];t===this.options.originalValue&&(i=this.form.data("form").values);var s={values:i,value:t};c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.options.ajaxUrl),data:s,dataType:"json"}).done(this.load.bind(this))},t.prototype.load=function(t){this.target.html(t.data.html),eval(t.data.scripts),c.FormTipManager.add(this.target)},t.prototype.selectOption=function(t){this.setValue(t),this.markSelected(t),this.triggerOutsideChange()},t.prototype.setValue=function(t){this.element.val(t)},t.prototype.markSelected=function(t){this.$items.removeClass("n2_field_control_type_picker__item--selected");for(var i=0;i<this.$items.length;i++){if(this.$items.eq(i).data("controltype")===t)$(this.$items[i]).addClass("n2_field_control_type_picker__item--selected")}},t})),c.d("FormElementDatePicker",["$","FormElement"],(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.elements=[],this.elements.push($("#"+i[0]).on("outsideChange",this.onFieldOnOffChange.bind(this)));for(var s=1;s<i.length;s++)this.elements.push($("#"+i[s]).on("outsideChange",this.onFieldChange.bind(this)));c.FormElement.prototype.constructor.call(this),this.syncOnOff(),this.fixDate()}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.getValue=function(){if(1===parseInt(this.elements[0].val())){var t=[this.elements[1].val(),this.pad(this.elements[2].val()),this.pad(this.elements[3].val())],i=[this.pad(this.elements[4].val()),this.pad(this.elements[5].val()),"00"];return t.join("-")+" "+i.join(":")}return this.getEmptyDate()},t.prototype.onFieldOnOffChange=function(){if(1===parseInt(this.elements[0].val())&&"0000"===this.elements[1].val()){var t=new Date,i=[t.getFullYear(),this.pad(t.getMonth()+1),this.pad(t.getDate())],s=[this.pad(t.getHours()),this.pad(t.getMinutes()),"00"];this.insideChange(i.join("-")+" "+s.join(":"))}this.onFieldChange()},t.prototype.onFieldChange=function(){this.fixDate()||(this.element.val(this.getValue()),this.triggerOutsideChange())},t.prototype.insideChange=function(t){if(this.element.val(t),t===this.getEmptyDate())this.elements[0].data("field").insideChange(0);else{var i=t.split(" "),s=i[0].split("-"),n=i[1].split(":");this.elements[0].data("field").insideChange(1),this.elements[1].data("field").insideChange(s[0]),this.elements[2].data("field").insideChange(s[1]),this.elements[3].data("field").insideChange(s[2]),this.elements[4].data("field").insideChange(n[0]),this.elements[5].data("field").insideChange(n[1]),this.fixDate()}this.triggerInsideChange()},t.prototype.syncOnOff=function(){this.element.val()===this.getEmptyDate()?this.elements[0].data("field").insideChange(0):this.elements[0].data("field").insideChange(1)},t.prototype.getEmptyDate=function(){return"0000-00-00 00:00:00"},t.prototype.pad=function(t,i){i=i||2;for(var s=t+"";s.length<i;)s="0"+s;return s},t.prototype.fixDate=function(){if(1===parseInt(this.elements[0].val())){for(var t=this.elements[1].val(),i=this.elements[2].val(),s=this.elements[3].val(),n=this.elements[3].data("field").select,h=new Date(t,i,0).getDate(),o=n[0].length,r=o;r>0;r--)n[0][r-1].removeAttribute("hidden");for(var a=o;a>h;a--)n[0][a-1].setAttribute("hidden","hidden");if(s>h)return this.elements[3].data("field").insideChange(h),this.onFieldChange(),!0}return!1},t})),function(t){"use strict";var i={s:1,n:0,d:1};function s(t,i){return isNaN(t=parseInt(t,10))&&n(),t*i}function n(){throw"Invalid Param"}var h=function(t,h){var r,a=0,c=1,l=1,u=0,d=0,f=0,_=1,v=1,p=0,m=1,b=1,g=1,y=1e7;if(t===o||null===t);else if(h!==o)l=(a=t)*(c=h);else switch(typeof t){case"object":"d"in t&&"n"in t?(a=t.n,c=t.d,"s"in t&&(a*=t.s)):0 in t?(a=t[0],1 in t&&(c=t[1])):n(),l=a*c;break;case"number":if(t<0&&(l=t,t=-t),t%1==0)a=t;else if(t>0){for(t>=1&&(t/=v=Math.pow(10,Math.floor(1+Math.log(t)/Math.LN10)));m<=y&&g<=y;){if(t===(r=(p+b)/(m+g))){m+g<=y?(a=p+b,c=m+g):g>m?(a=b,c=g):(a=p,c=m);break}t>r?(p+=b,m+=g):(b+=p,g+=m),m>y?(a=b,c=g):(a=p,c=m)}a*=v}else(isNaN(t)||isNaN(h))&&(c=a=NaN);break;case"string":if("-"===(m=t.match(/\d+|./g))[p]?(l=-1,p++):"+"===m[p]&&p++,m.length===p+1?d=s(m[p++],l):"."===m[p+1]||"."===m[p]?("."!==m[p]&&(u=s(m[p++],l)),(++p+1===m.length||"("===m[p+1]&&")"===m[p+3]||"'"===m[p+1]&&"'"===m[p+3])&&(d=s(m[p],l),_=Math.pow(10,m[p].length),p++),("("===m[p]&&")"===m[p+2]||"'"===m[p]&&"'"===m[p+2])&&(f=s(m[p+1],l),v=Math.pow(10,m[p+1].length)-1,p+=3)):"/"===m[p+1]||":"===m[p+1]?(d=s(m[p],l),_=s(m[p+2],1),p+=3):"/"===m[p+3]&&" "===m[p+1]&&(u=s(m[p],l),d=s(m[p+2],l),_=s(m[p+4],1),p+=5),m.length<=p){l=a=f+(c=_*v)*u+v*d;break}default:n()}if(0===c)throw"DIV/0";i.s=l<0?-1:1,i.n=Math.abs(a),i.d=Math.abs(c)},r=function(t,i){if(!t)return i;if(!i)return t;for(;;){if(!(t%=i))return i;if(!(i%=t))return t}};function a(t,s){if(!(this instanceof a))return new a(t,s);h(t,s),t=a.REDUCE?r(i.d,i.n):1,this.s=i.s,this.n=i.n/t,this.d=i.d/t}a.REDUCE=1,a.prototype={s:1,n:0,d:1,abs:function(){return new a(this.n,this.d)},neg:function(){return new a(-this.s*this.n,this.d)},add:function(t,s){return h(t,s),new a(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(t,s){return h(t,s),new a(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(t,s){return h(t,s),new a(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(t,s){return h(t,s),new a(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return new a(this)},mod:function(t,s){return isNaN(this.n)||isNaN(this.d)?new a(NaN):t===o?new a(this.s*this.n%this.d,1):(h(t,s),0===i.n&&0===this.d&&a(0,0),new a(this.s*i.d*this.n%(i.n*this.d),i.d*this.d))},gcd:function(t,s){return h(t,s),new a(r(i.n,this.n),i.d*this.d/r(i.d,this.d))},lcm:function(t,s){return h(t,s),0===i.n&&0===this.n?new a:new a(i.n*this.n/r(i.n,this.n),r(i.d,this.d))},ceil:function(t){return t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d)?new a(NaN):new a(Math.ceil(t*this.s*this.n/this.d),t)},floor:function(t){return t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d)?new a(NaN):new a(Math.floor(t*this.s*this.n/this.d),t)},round:function(t){return t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d)?new a(NaN):new a(Math.round(t*this.s*this.n/this.d),t)},inverse:function(){return new a(this.s*this.d,this.n)},pow:function(t){return t<0?new a(Math.pow(this.s*this.d,-t),Math.pow(this.n,-t)):new a(Math.pow(this.s*this.n,t),Math.pow(this.d,t))},equals:function(t,s){return h(t,s),this.s*this.n*i.d==i.s*i.n*this.d},compare:function(t,s){h(t,s);var n=this.s*this.n*i.d-i.s*i.n*this.d;return(0<n)-(n<0)},divisible:function(t,s){return h(t,s),!(!(i.n*this.d)||this.n*i.d%(i.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(t){var i,s="",n=this.n,h=this.d;return this.s<0&&(s+="-"),1===h?s+=n:(t&&(i=Math.floor(n/h))>0&&(s+=i,s+=" ",n%=h),s+=n,s+="/",s+=h),s},toLatex:function(t){var i,s="",n=this.n,h=this.d;return this.s<0&&(s+="-"),1===h?s+=n:(t&&(i=Math.floor(n/h))>0&&(s+=i,n%=h),s+="\\frac{",s+=n,s+="}{",s+=h,s+="}"),s},toContinued:function(){var t,i=this.n,s=this.d,n=[];do{n.push(Math.floor(i/s)),t=i%s,i=s,s=t}while(1!==i);return n},toString:function(){var t,i=this.n,s=this.d;if(isNaN(i)||isNaN(s))return"NaN";a.REDUCE||(i/=t=r(i,s),s/=t);for(var n=String(i).split(""),h=0,o=[~this.s?"":"-","",""],c="",l=function(t,i){for(;i%2==0;i/=2);for(;i%5==0;i/=5);if(1===i)return 0;for(var s=10%i,n=1;1!==s;n++)if(s=10*s%i,n>2e3)return 0;return n}(0,s),u=function(t,i,s){for(var n=1,h=function(t,e,i){for(var s=1;e>0;t=t*t%i,e>>=1)1&e&&(s=s*t%i);return s}(10,s,i),o=0;o<300;o++){if(n===h)return o;n=10*n%i,h=10*h%i}return 0}(0,s,l),d=-1,f=1,_=15+l+u+n.length,v=0;v<_;v++,h*=10){if(v<n.length?h+=Number(n[v]):(f=2,d++),l>0)if(d===u)o[f]+=c+"(",c="";else if(d===l+u){o[f]+=c+")";break}h>=s?(o[f]+=c+(h/s|0),c="",h%=s):f>1?c+="0":o[f]&&(o[f]+="0")}return o[0]+=o[1]||"0",o[2]?o[0]+"."+o[2]:o[0]}},t.Fraction=a}(i),c.d("FormElementLayerPicker",["$","FormElement"],(function(){var t,$=c.$,i=0,n=1,h=3,o=4,r='<div class="n2_ss_absolute_parent_picker__overlay n2_ss_absolute_parent_picker__overlay--tile" data-align="left" data-valign="top"></div><div class="n2_ss_absolute_parent_picker__overlay n2_ss_absolute_parent_picker__overlay--tile" data-align="center" data-valign="top" style="left:33%;top:0;"></div><div class="n2_ss_absolute_parent_picker__overlay n2_ss_absolute_parent_picker__overlay--tile" data-align="right" data-valign="top" style="left:66%;top:0;width:34%;"></div><div class="n2_ss_absolute_parent_picker__overlay n2_ss_absolute_parent_picker__overlay--tile" data-align="left" data-valign="middle" style="left:0;top:33%;"></div><div class="n2_ss_absolute_parent_picker__overlay n2_ss_absolute_parent_picker__overlay--tile" data-align="center" data-valign="middle" style="left:33%;top:33%; "></div><div class="n2_ss_absolute_parent_picker__overlay n2_ss_absolute_parent_picker__overlay--tile" data-align="right" data-valign="middle" style="left:66%;top:33%;width:34%;"></div><div class="n2_ss_absolute_parent_picker__overlay n2_ss_absolute_parent_picker__overlay--tile" data-align="left" data-valign="bottom" style="left:0;top:66%;height:34%;"></div><div class="n2_ss_absolute_parent_picker__overlay n2_ss_absolute_parent_picker__overlay--tile" data-align="center" data-valign="bottom" style="left:33%;top:66%;height:34%;"></div><div class="n2_ss_absolute_parent_picker__overlay n2_ss_absolute_parent_picker__overlay--tile" data-align="right" data-valign="bottom" style="left:66%;top:66%;width:34%;height:34%;"></div>';function a(){t&&(z(t,"n2_layer_parent_highlight"),t=!1)}function l(n){this.status=i,this.element=$("#"+n),this.$parent=this.element.parent(),this.overlays=null,this.$picker=this.$parent.find(".n2_ss_absolute_parent_picker").on("click",function(e){e.preventDefault(),a(),""===this.element.val()?this.click(e):this.change("")}.bind(this)),this.$picker.on({mouseenter:function(){var i=this.element.val();!function(i){t&&a(),i&&(L(i,"n2_layer_parent_highlight"),t=i)}(s.getElementById(i))}.bind(this),mouseleave:function(){a()}.bind(this)}),c.FormElement.prototype.constructor.call(this)}return l.prototype=Object.create(c.FormElement.prototype),l.prototype.constructor=l,l.prototype.click=function(e){this.status===i?(this.data={parent:null,parentVAlign:null,parentHAlign:null,child:c._currentEditor.fragmentEditor.getActiveLayer().layer,childVAlign:null,childHAlign:null},$("body").on("mousedown.n2-ss-parent-linker",function(e){$(e.target).hasClass("n2_ss_absolute_parent_picker__overlay")||this.destroy()}.bind(this)),c.Esc.add(function(){return this.destroy(),!1}.bind(this)),this.pickParent(e)):(this.data=null,this.change(""),this.destroy())},l.prototype.getAbsoluteLayers=function(t){for(var i=[],s=t.getSortedLayers(),n=0;n<s.length;n++)switch(s[n].placement.getType()){case"absolute":i.push(s[n].layer[0])}return i},l.prototype.getSiblingLayers=function(t){var i=t.group.container.getSortedLayers(),s=i.indexOf(t);return s>-1&&i.splice(s,1),i},l.prototype.pickParent=function(e){this.data.childLayer=this.data.child.data("layerObject");var t=this.getSiblingLayers(this.data.childLayer),i=function(s){var n,h=s.getProperty("id");if(""!==h){var o=[];for(n=t.length-1;n>=0;n--)h===t[n].getProperty("parentid")&&(o.push(t[n]),t.splice(n,1));for(n=o.length-1;n>=0;n--)i(o[n])}};if(i(this.data.childLayer),0===t.length)c.Notification.error(n2_("There is no layer available to be parent of the current layer!")),this.destroy();else{for(var s=[],h=0;h<t.length;h++)s.push(t[h].layer);this.status=n,c._tooltipMouse.show(n2_("Pick the parent layer!"),e),$('<div class="n2_ss_absolute_parent_picker__overlay"></div>').on("click",function(e){e.preventDefault(),e.stopPropagation(),this.data.parent=$(e.currentTarget).parent(),this._destroy(),this.pickParentAlign(e)}.bind(this)).appendTo(s)}},l.prototype.pickParentAlign=function(e){this.status=h,c._tooltipMouse.show(n2_("Pick the align point of the parent layer!"),e),this.data.parent.addClass("n2_ss_absolute_parent_picker__component--focused");var t=$(r).appendTo(this.data.parent).on("click",function(e){e.preventDefault(),e.stopPropagation();var i=$(e.currentTarget);this.data.parentHAlign=i.data("align"),this.data.parentVAlign=i.data("valign"),i.off("click").addClass("n2_ss_absolute_parent_picker__overlay--selected"),this.data.parent.removeClass("n2_ss_absolute_parent_picker__component--focused"),t.not(i).remove(),this.pickChildAlign(e)}.bind(this))},l.prototype.pickChildAlign=function(e){this.status=o,c._tooltipMouse.show(n2_("Pick the align point of the child layer!"),e),this.data.child.addClass("n2_ss_absolute_parent_picker__component--focused");$(r).appendTo(this.data.child).on("click",function(e){e.preventDefault(),e.stopPropagation();var t=$(e.currentTarget);this.data.childHAlign=t.data("align"),this.data.childVAlign=t.data("valign"),this.data.child.removeClass("n2_ss_absolute_parent_picker__component--focused"),this.done()}.bind(this))},l.prototype.done=function(){this.data.child.data("layerObject").placement.current.parentPicked(this.data.parent.data("layerObject"),this.data.parentHAlign,this.data.parentVAlign,this.data.childHAlign,this.data.childVAlign),this.destroy()},l.prototype._destroy=function(){this.data.parent&&this.data.parent.removeClass("n2_ss_absolute_parent_picker__component--focused"),this.data.child.removeClass("n2_ss_absolute_parent_picker__component--focused"),$(".n2_ss_absolute_parent_picker__overlay").remove()},l.prototype.destroy=function(){c._tooltipMouse.hide(),this._destroy(),$("body").off(".n2-ss-parent-linker"),c.Esc.pop(),this.status=i},l.prototype.change=function(t){this.element.val(t).trigger("change"),this._setValue(t),this.triggerOutsideChange()},l.prototype.insideChange=function(t){this.element.val(t),this._setValue(t),this.triggerInsideChange()},l.prototype._setValue=function(t){this.$picker.toggleClass("n2_ss_absolute_parent_picker--active",!this.isEmpty(t))},l.prototype.isEmpty=function(t){return""===t||null===t},l})),c.d("FormElementPostAnimationManager",["$","FormElementAnimationManager"],(function(){function t(){this.empty=!0,c.FormElementAnimationManager.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.FormElementAnimationManager.prototype),t.prototype.constructor=t,t.prototype.clear=function(e){e.preventDefault(),e.stopPropagation();var t=this.element.val().split("|*|");t[2]="",this.val(t.join("|*|"))},t.prototype.updateName=function(t){var i=t.split("|*|");t=i[2],c.FormElementAnimationManager.prototype.updateName.call(this,t)},t.prototype.relatedFieldsOff=function(){return""===this.element.val().split("|*|")[2]},t})),c.d("FormElementSliderWidgetArea",["$","FormElement"],(function(){var $=c.$;function t(t){this.element=$("#"+t),this.area=this.element.parent(),this.areas=this.area.find(".n2_field_widget_area__area"),this.areas.on("click",this.chooseArea.bind(this)),c.FormElement.prototype.constructor.call(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.chooseArea=function(e){var t=parseInt($(e.target).data("area"));this.element.val(t),this.setSelected(t),this.triggerOutsideChange()},t.prototype.insideChange=function(t){t=parseInt(t),this.element.val(t),this.setSelected(t),this.triggerInsideChange()},t.prototype.setSelected=function(t){this.areas.removeClass("n2_field_widget_area__area--selected"),this.areas.eq(t-1).addClass("n2_field_widget_area__area--selected")},t})),c.d("FormElementWidgetPosition","$",(function(){var $=c.$;function t(t){this.id=t,this.$element=$("#"+t),this.$label=this.$element.find(".n2_field_widget_position__label"),this.$positionElement=$("#"+t+"-area").on("nextendChange",this.onPositionChange.bind(this)),this.positionValue=this.$positionElement.val(),this.$offsetElement=$("#"+t+"-offset").on("nextendChange",this.onOffsetChange.bind(this)),this.offsetValue=this.$offsetElement.val(),this.$positionMode=$("#"+t+"-mode").on("nextendChange",this.onModeChange.bind(this)),this.modeValue=this.$positionMode.val(),this.refreshLabel(),this.$element.on("click",this.toggle.bind(this)),this.$element.find(".n2_field_widget_position__popover").on("click",this.stopPropagation.bind(this))}return t.prototype.stopPropagation=function(e){return e.originalEvent["handled"+this.id]!==o||(e.originalEvent["handled"+this.id]=!0,!1)},t.prototype.toggle=function(e){this.$element.hasClass("n2_field_widget_position--focus")?this.blur(e):this.focus(e)},t.prototype.focus=function(e){this.stopPropagation(e)||(this.$element.addClass("n2_field_widget_position--focus"),$("body").on("click."+this.id,this.blur.bind(this)))},t.prototype.blur=function(e){this.stopPropagation(e)||(this.$element.removeClass("n2_field_widget_position--focus"),$("body").off("click."+this.id))},t.prototype.refreshLabel=function(){var t="";if("advanced"===this.modeValue)t=n2_("Advanced");else{switch(parseInt(this.positionValue)){case 1:t=n2_sprintf(n2_("Outer %s"),n2_("Top"));break;case 2:t=n2_("Top")+" "+n2_("Left");break;case 3:t=n2_("Top")+" "+n2_("Center");break;case 4:t=n2_("Top")+" "+n2_("Right");break;case 5:t=n2_sprintf(n2_("Outer %s"),n2_("Left"));break;case 6:t=n2_("Middle")+" "+n2_("Left");break;case 7:t=n2_("Middle")+" "+n2_("Right");break;case 8:t=n2_sprintf(n2_("Outer %s"),n2_("Right"));break;case 9:t=n2_("Bottom")+" "+n2_("Left");break;case 10:t=n2_("Bottom")+" "+n2_("Center");break;case 11:t=n2_("Bottom")+" "+n2_("Right");break;case 12:t=n2_sprintf(n2_("Outer %s"),n2_("Bottom"))}0!==parseInt(this.offsetValue)&&(t+=" + "+this.offsetValue+"px")}this.$label.text(t)},t.prototype.onPositionChange=function(){this.positionValue=this.$positionElement.val(),this.refreshLabel()},t.prototype.onOffsetChange=function(){this.offsetValue=this.$offsetElement.val(),this.refreshLabel()},t.prototype.onModeChange=function(){this.modeValue=this.$positionMode.val(),this.refreshLabel()},t})),c.d("GeneratorAdd","$",(function(){var $=c.$;function t(t){c.Form.prototype.constructor.call(this),c.r("documentReady",this.onReady.bind(this))}return t.prototype=Object.create(c.Form.prototype),t.prototype.constructor=t,t.prototype.onReady=function(){this.setID("#n2-ss-form-generator-add"),c.Form.prototype.onReady.call(this),this.$form.on("submit",this.onSubmit.bind(this))},t.prototype.resetChangeTracker=function(){},t.prototype.initButtons=function(){this.$saveButton=$(".n2_generator_add").on("click",this.actionSave.bind(this)),$(".n2_generator_add_cancel").on("click",this.actionCancel.bind(this))},t.prototype.actionSave=function(e){e&&e.preventDefault(),this.skipChangeConfirm=!0,this.$form.trigger("submit"),this.afterSave()},t.prototype.actionCancel=function(e){e&&e.preventDefault(),i.location=e.currentTarget.href},t.prototype.onSubmit=function(e){e.preventDefault(),c.AjaxHelper.ajax({type:"POST",url:this.$form.attr("action"),data:this.$form.serialize(),dataType:"json"})},t})),c.d("GeneratorConfigure","$",(function(){var $=c.$;function t(t){c.Form.prototype.constructor.call(this),c.r("documentReady",this.onReady.bind(this))}return t.prototype=Object.create(c.Form.prototype),t.prototype.constructor=t,t.prototype.onReady=function(){this.setID("#n2-ss-form-generator-configure"),c.Form.prototype.onReady.call(this),this.$form.on("submit",this.onSubmit.bind(this))},t.prototype.initButtons=function(){this.$saveButton=$(".n2_generator_configuration_save").on("click",this.actionSave.bind(this)),$(".n2_generator_configuration_cancel").on("click",this.actionCancel.bind(this))},t.prototype.actionSave=function(e){e&&e.preventDefault(),this.skipChangeConfirm=!0,this.$form.trigger("submit"),this.afterSave()},t.prototype.actionCancel=function(e){e&&e.preventDefault(),i.location=e.currentTarget.href},t.prototype.onSubmit=function(e){e.preventDefault(),c.AjaxHelper.ajax({type:"POST",url:this.$form.attr("action"),data:this.$form.serialize(),dataType:"json"})},t})),c.d("GeneratorEdit","$",(function(){var $=c.$;function t(t){c.Form.prototype.constructor.call(this),this.options=f({previewInNewWindow:!1,previewUrl:""},t),c.r("documentReady",this.onReady.bind(this))}return t.prototype=Object.create(c.Form.prototype),t.prototype.constructor=t,t.prototype.onReady=function(){this.setID("#n2-ss-form-generator-edit"),c.Form.prototype.onReady.call(this),this.$form.on("submit",this.onSubmit.bind(this)),this.initPreview()},t.prototype.initButtons=function(){this.$saveButton=$(".n2_generator_settings_save").on("click",this.actionSave.bind(this)),$(".n2_generator_settings_back").on("click",this.actionCancel.bind(this))},t.prototype.actionSave=function(e){e&&e.preventDefault(),this.skipChangeConfirm=!0,this.$form.trigger("submit"),this.afterSave()},t.prototype.actionCancel=function(e){e&&e.preventDefault(),i.location=e.currentTarget.href},t.prototype.onSubmit=function(e){!0!==this.$form.data("preview")&&(e.preventDefault(),c.AjaxHelper.ajax({type:"POST",url:this.$form.attr("action"),data:this.$form.serialize(),dataType:"json"}))},t.prototype.initPreview=function(){this.options.previewInNewWindow||(this.modal=new c.ModalIframe("preview-slider")),$("#n2-ss-preview").on("click",function(e){e.preventDefault(),this.$form.data("preview",!0),this.options.previewInNewWindow?c.PreviewPopup("","preview-slider"):this.modal.show();var t=this.$form.attr("action");this.$form.attr({action:c.AjaxHelper.makeAjaxUrl(this.options.previewUrl,{nextendaction:this.options.previewInNewWindow?"index":"generator"}),target:"preview-slider"}).trigger("submit").attr({action:t,target:null}),this.$form.data("preview",!1)}.bind(this))},t})),c.d("FieldRecordViewer","$",(function(){var $=c.$;function t(t,i){this.ajaxUrl=i,this.$element=$("#"+t).on("click",this.showRecords.bind(this)),this.$form=this.$element.closest("form")}return t.prototype.showRecords=function(e){e.preventDefault(),c.AjaxHelper.ajax({type:"POST",url:this.ajaxUrl,data:this.$form.serialize(),dataType:"json"}).done((function(t){null!==t.data&&c.ModalGeneratorRecordViewer(t.data.headings,t.data.rows)}))},t})),c.d("FormElementAutoPlayPicker",["$","FormElementMixed"],(function(){var $=c.$;function t(t,i,s){this.separator=s,c.FormElementMixed.prototype.constructor.apply(this,arguments),this.$element=this.element.parent(),this.id=t,this.$label=this.$element.find(".n2_field_autoplaypicker__label"),this.refreshLabel(),this.$element.on("click",this.toggle.bind(this)),this.$element.find(".n2_field_autoplaypicker__popover").on("click",this.stopPropagation.bind(this))}return t.prototype=Object.create(c.FormElementMixed.prototype),t.prototype.constructor=t,t.prototype.onFieldChange=function(){c.FormElementMixed.prototype.onFieldChange.call(this),this.refreshLabel()},t.prototype.insideChange=function(t){c.FormElementMixed.prototype.insideChange.call(this,t),this.refreshLabel()},t.prototype.refreshLabel=function(){var t=this.getValue().split(this.separator),i=parseInt(t[0]),s=t[1],n=t[2],h="";"slide"===s?h=n2_sprintf(n2_("Switches %s slide(s)."),i):"loop"===s?"current"===n?h=n2_sprintf(n2_("Loops %s and stops before starting slide."),i):"next"===n&&(h=n2_sprintf(n2_("Loops %s and returns to starting slide."),i)):"slideindex"===s&&(h=n2_sprintf(n2_("Switches to the %s. slide."),i)),this.$label.text(h)},t.prototype.stopPropagation=function(e){return e.originalEvent["handled"+this.id]!==o||(e.originalEvent["handled"+this.id]=!0,!1)},t.prototype.toggle=function(e){this.$element.hasClass("n2_field_autoplaypicker--focus")?this.blur(e):this.focus(e)},t.prototype.focus=function(e){this.stopPropagation(e)||(this.$element.addClass("n2_field_autoplaypicker--focus"),$("body").on("click."+this.id,this.blur.bind(this)))},t.prototype.blur=function(e){this.stopPropagation(e)||(this.$element.removeClass("n2_field_autoplaypicker--focus"),$("body").off("click."+this.id))},t})),c.d("FormElementParticleManager",["$","FormElement"],(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.parent=this.element.parent(),c.FormElement.prototype.constructor.call(this),this.options=f({editUrl:""},i),this.parent.find(".n2_field_chooser__clear").on("click",this.clear.bind(this)),this.parent.find(".n2_field_chooser__choose, .n2_field_chooser__label").on("click",this.show.bind(this)),this.$name=this.parent.find(".n2_field_chooser__label"),this.updateName(this.element.val()),this.updateIsEmpty(),this.form=$("#n2-ss-edit-slider-form"),this.formAction=this.form.attr("action"),this.onMessage=function(t){if(t.source===this.iframeWindow)try{var i=JSON.parse(t.data);switch(i.action){case"ready":this.iframeReadyDeferred.resolve();break;case"save":this.val(i.data),this.removeLightbox();break;case"cancel":this.removeLightbox()}}catch(t){}}.bind(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.show=function(e){e.preventDefault(),c.LoadingScreen.startLoading(),this.iframeReadyDeferred=$.Deferred(),this.$lightbox=$('<div class="n2_fullscreen_editor n2_fullscreen_editor--visible"><div class="n2_fullscreen_editor__overlay"></div></div>').appendTo("body");var t=$('<div class="n2_fullscreen_editor__window"></div>').appendTo(this.$lightbox),s=$('<iframe name="n2-ss-particleframe"></iframe>').appendTo(t);this.form.attr({action:this.options.editUrl,target:"n2-ss-particleframe"}).submit().attr({action:this.formAction,target:null}),this.iframeWindow=s[0].contentWindow||s[0].contentDocument,i.addEventListener("message",this.onMessage,!1),this.iframeReadyDeferred.done(function(){this.iframeWindow.postMessage(JSON.stringify({action:"load",data:this.element.val()}),"*"),c.LoadingScreen.stopLoading(),s.focus()}.bind(this))},t.prototype.removeLightbox=function(){this.$lightbox.remove(),this.$lightbox=null,i.removeEventListener("message",this.onMessage,!1)},t.prototype.clear=function(e){e.preventDefault(),e.stopPropagation();var t=this.element.val().split("|*|");t[2]="",this.val(t.join("|*|"))},t.prototype.change=function(){this.updateIsEmpty(),this.triggerOutsideChange()},t.prototype.save=function(e,t){this.val(t)},t.prototype.val=function(t){this.element.val(t),this.updateName(t),this.change()},t.prototype.insideChange=function(t){this.updateName(t),c.FormElementText.prototype.insideChange.call(this,t)},t.prototype.updateName=function(t){var i="";try{i=JSON.parse(t)?n2_("Enabled"):n2_("Disabled")}catch(t){i=n2_("Disabled")}this.$name.text(i)},t.prototype.updateIsEmpty=function(){this.parent.toggleClass("n2_field_chooser--empty",this.isEmpty(this.element.val()))},t.prototype.isEmpty=function(t){try{if(JSON.parse(t))return!1}catch(t){}return!0},t})),c.d("FormElementShapeDividerManager",["$","FormElement"],(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.parent=this.element.parent(),c.FormElement.prototype.constructor.call(this),this.options=f({editUrl:""},i),this.parent.find(".n2_field_chooser__clear").on("click",this.clear.bind(this)),this.parent.find(".n2_field_chooser__choose, .n2_field_chooser__label").on("click",this.show.bind(this)),this.$name=this.parent.find(".n2_field_chooser__label"),this.updateName(this.element.val()),this.updateIsEmpty(),this.form=$("#n2-ss-edit-slider-form"),this.formAction=this.form.attr("action"),this.onMessage=function(t){if(t.source===this.iframeWindow)try{var i=JSON.parse(t.data);switch(i.action){case"ready":this.iframeReadyDeferred.resolve();break;case"save":this.val(i.data),this.removeLightbox();break;case"cancel":this.removeLightbox()}}catch(t){}}.bind(this)}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.show=function(e){e.preventDefault(),c.LoadingScreen.startLoading(),this.iframeReadyDeferred=$.Deferred(),this.$lightbox=$('<div class="n2_fullscreen_editor n2_fullscreen_editor--visible"><div class="n2_fullscreen_editor__overlay"></div></div>').appendTo("body");var t=$('<div class="n2_fullscreen_editor__window"></div>').appendTo(this.$lightbox),s=$('<iframe name="n2-ss-shapedividerframe"></iframe>').appendTo(t);this.form.attr({action:this.options.editUrl,target:"n2-ss-shapedividerframe"}).trigger("submit").attr({action:this.formAction,target:null}),this.iframeWindow=s[0].contentWindow||s[0].contentDocument,i.addEventListener("message",this.onMessage,!1),this.iframeReadyDeferred.done(function(){this.iframeWindow.postMessage(JSON.stringify({action:"load",data:this.element.val()}),"*"),c.LoadingScreen.stopLoading(),s.trigger("focus")}.bind(this))},t.prototype.removeLightbox=function(){this.$lightbox.remove(),this.$lightbox=null,i.removeEventListener("message",this.onMessage,!1)},t.prototype.clear=function(e){e.preventDefault(),this.val("")},t.prototype.change=function(){this.updateIsEmpty(),this.triggerOutsideChange()},t.prototype.save=function(e,t){this.val(t)},t.prototype.val=function(t){this.element.val(t),this.updateName(t),this.change()},t.prototype.insideChange=function(t){this.updateName(t),c.FormElementText.prototype.insideChange.call(this,t)},t.prototype.updateName=function(t){var i="";try{var s=JSON.parse(t);i=s.top&&s.bottom?n2_("Top and bottom"):s.top?n2_("Top"):s.bottom?n2_("Bottom"):n2_("Disabled")}catch(t){i=n2_("Disabled")}this.$name.text(i)},t.prototype.updateIsEmpty=function(){this.parent.toggleClass("n2_field_chooser--empty",this.isEmpty(this.element.val()))},t.prototype.isEmpty=function(t){try{var i=JSON.parse(t);if(i.top||i.bottom)return!1}catch(t){}return!0},t})),c.d("FormElementSplitTextAnimationManager",["$","FormElement"],(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.parent=this.element.parent(),c.FormElement.prototype.constructor.call(this),this.parameters=f({linkedRelatedFields:!1},i),this.parent.find(".n2_field_chooser__clear").on("click",this.clear.bind(this)),this.parent.find(".n2_field_chooser__choose, .n2_field_chooser__label").on("click",this.show.bind(this)),this.$name=this.parent.find(".n2_field_chooser__label"),this.updateName(this.element.val()),this.updateIsEmpty(),this.hideRelatedFields()}return t.prototype=Object.create(c.FormElement.prototype),t.prototype.constructor=t,t.prototype.isEmpty=function(t){return""===t},t.prototype.show=function(e){e.preventDefault(),this.parameters.font&&c._splittextanimationManager.setConnectedFont(this.parameters.font),this.parameters.style&&c._splittextanimationManager.setConnectedStyle(this.parameters.style),c._splittextanimationManager.show(this.element.val(),this.save.bind(this),{previewMode:"0",previewHTML:this.parameters.preview,group:this.parameters.group,transformOrigin:$("#"+this.parameters.transformOrigin)})},t.prototype.clear=function(e){e.preventDefault(),this.val("")},t.prototype.change=function(){this.updateIsEmpty(),this.hideRelatedFields(),this.triggerOutsideChange()},t.prototype.save=function(e,t){this.val(t)},t.prototype.val=function(t){this.element.val(t),this.updateName(t),this.change()},t.prototype.insideChange=function(t){this.updateName(t),c.FormElementText.prototype.insideChange.call(this,t),this.hideRelatedFields()},t.prototype.updateName=function(t){this.isEmpty(t)?this.$name.text(n2_("Disabled")):this.$name.text(n2_("Enabled"))},t.prototype.updateIsEmpty=function(){this.parent.toggleClass("n2_field_chooser--empty",this.isEmpty(this.element.val()))},t.prototype.isEmpty=function(t){return""===t},t.prototype.hideRelatedFields=function(){if(this.parameters.linkedRelatedFields&&this.parameters.linkedRelatedFields.linkedFields&&this.parameters.linkedRelatedFields.relatedFields){for(var t=!1,i=this.parameters.linkedRelatedFields.linkedFields,s=this.parameters.linkedRelatedFields.relatedFields,n=0;n<i.length;n++){var h=$("#"+i[n]);this.isEmpty(this.element.val())&&h.data("field")&&h.data("field").isEmpty(h.val())&&(t=!0)}for(n=0;n<s.length;n++){var o=$('[data-field="'+s[n]+'"]');o&&o.toggleClass("n2_form_element--hidden",t)}}},t})),c.d("FormElementFacebookAlbums","$",(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.select=this.element.parent().find("select"),this.relatedField=$("#generatorfacebook-id").on("nextendChange",this.refreshList.bind(this)),this.url=i}return t.prototype.refreshList=function(e){c.AjaxHelper.ajax({url:this.url,data:{method:"getAlbums",facebookID:this.relatedField.val()}}).done(function(t){for(var i in this.select.find("option").remove(),t.data)$('<option value="'+i+'"></option>').text(t.data[i]).appendTo(this.select);this.select.val(this.select.find("option:first").val()).trigger("change")}.bind(this))},t})),c.d("FormElementFacebookToken","$",(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.element.parent().find(".n2_field_text__choose_text").on("click",this.requestToken.bind(this)),this.url=i}return t.prototype.requestToken=function(e){e.preventDefault(),c.AjaxHelper.ajax({url:this.url,data:$("#n2-ss-form-generator-configure").serialize()}).done((function(t){var s=(screen.width-600)/2,n=(screen.height-600)/2;i.open(t.data.authUrl,"Facebook authentication","width=600,height=600,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left="+s+",top="+n)}))},t})),c.d("FormElementFlickrToken","$",(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.element.parent().find(".n2_field_text__choose_text").on("click",this.requestToken.bind(this)),this.url=i}return t.prototype.requestToken=function(e){e.preventDefault(),c.AjaxHelper.ajax({url:this.url,data:$("#n2-ss-form-generator-configure").serialize()}).done((function(t){var s=(screen.width-1200)/2,n=(screen.height-1e3)/2;i.open(t.data.authUrl,"Flickr authentication","width=1200,height=1000,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left="+s+",top="+n)}))},t})),c.d("FormElementTwitterToken","$",(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.element.parent().find(".n2_field_text__choose_text").on("click",this.requestToken.bind(this)),this.url=i}return t.prototype.requestToken=function(e){e.preventDefault(),c.AjaxHelper.ajax({url:this.url,data:$("#n2-ss-form-generator-configure").serialize()}).done((function(t){var s=(screen.width-1e3)/2,n=(screen.height-600)/2;i.open(t.data.authUrl,"Twitter authentication","width=1000,height=600,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left="+s+",top="+n)}))},t})),c.d("FormElementVimeoToken",(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.element.parent().find(".n2_field_text__choose_text").on("click",this.requestToken.bind(this)),this.url=i}return t.prototype.requestToken=function(e){e.preventDefault(),c.AjaxHelper.ajax({url:this.url,data:$("#n2-ss-form-generator-configure").serialize()}).done((function(t){var s=(screen.width-1e3)/2,n=(screen.height-600)/2;i.open(t.data.authUrl,"Vimeo authentication","width=1000,height=600,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left="+s+",top="+n)}))},t})),c.d("FormElementYouTubePlaylists","$",(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.select=this.element.parent().find("select"),this.relatedField=$("#generatorchannel-id").on("nextendChange",this.refreshList.bind(this)),this.url=i}return t.prototype.refreshList=function(e){c.AjaxHelper.ajax({url:this.url,data:{method:"getPlayListsAjax",channelID:this.relatedField.val()}}).done(function(t){for(var i in this.select.find("option").remove(),t.data)$('<option value="'+i+'"></option>').text(t.data[i]).appendTo(this.select);this.select.val(this.select.find("option:first").val()).trigger("change")}.bind(this))},t})),c.d("FormElementYoutubeToken","$",(function(){var $=c.$;function t(t,i){this.element=$("#"+t),this.element.parent().find(".n2_field_text__choose_text").on("click",this.requestToken.bind(this)),this.url=i}return t.prototype.requestToken=function(e){e.preventDefault(),c.AjaxHelper.ajax({url:this.url,data:$("#n2-ss-form-generator-configure").serialize()}).done((function(t){var s=(screen.width-1e3)/2,n=(screen.height-600)/2;i.open(t.data.authUrl,"YouTube authentication","width=1000,height=600,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left="+s+",top="+n)}))},t})),c.d("SettingsFonts","$",(function(){var $=c.$;function t(t){c.Form.prototype.constructor.call(this),c.r("documentReady",this.onReady.bind(this))}return t.prototype=Object.create(c.Form.prototype),t.prototype.constructor=t,t.prototype.onReady=function(){this.setID("#n2-ss-form-settings-fonts"),c.Form.prototype.onReady.call(this),this.$form.on("submit",this.onSubmit.bind(this))},t.prototype.initButtons=function(){this.$saveButton=$(".n2_settings_save").on("click",this.actionSave.bind(this))},t.prototype.actionSave=function(e){e&&e.preventDefault(),this.skipChangeConfirm=!0,this.$form.trigger("submit"),this.afterSave()},t.prototype.onSubmit=function(e){e.preventDefault(),c.AjaxHelper.ajax({type:"POST",url:this.$form.attr("action"),data:this.$form.serialize(),dataType:"json"})},t})),c.d("SettingsFramework","$",(function(){var $=c.$;function t(t){c.Form.prototype.constructor.call(this),c.r("documentReady",this.onReady.bind(this))}return t.prototype=Object.create(c.Form.prototype),t.prototype.constructor=t,t.prototype.onReady=function(){this.setID("#n2-ss-form-settings-framework"),c.Form.prototype.onReady.call(this),this.$form.on("submit",this.onSubmit.bind(this))},t.prototype.initButtons=function(){this.$saveButton=$(".n2_settings_save").on("click",this.actionSave.bind(this))},t.prototype.actionSave=function(e){e&&e.preventDefault(),this.skipChangeConfirm=!0,this.$form.trigger("submit"),this.afterSave()},t.prototype.onSubmit=function(e){e.preventDefault(),c.AjaxHelper.ajax({type:"POST",url:this.$form.attr("action"),data:this.$form.serialize(),dataType:"json"})},t})),c.d("SettingsGeneral","$",(function(){var $=c.$;function t(t){c.Form.prototype.constructor.call(this),c.r("documentReady",this.onReady.bind(this))}return t.prototype=Object.create(c.Form.prototype),t.prototype.constructor=t,t.prototype.onReady=function(){this.setID("#n2-ss-form-settings-general"),c.Form.prototype.onReady.call(this),this.$form.on("submit",this.onSubmit.bind(this))},t.prototype.initButtons=function(){this.$saveButton=$(".n2_settings_save").on("click",this.actionSave.bind(this))},t.prototype.actionSave=function(e){e&&e.preventDefault(),this.skipChangeConfirm=!0,this.$form.trigger("submit"),this.afterSave()},t.prototype.onSubmit=function(e){e.preventDefault(),c.AjaxHelper.ajax({type:"POST",url:this.$form.attr("action"),data:this.$form.serialize(),dataType:"json"})},t})),c.d("SettingsItemDefaults","$",(function(){var $=c.$;function t(t){c.Form.prototype.constructor.call(this),c.r("documentReady",this.onReady.bind(this))}return t.prototype=Object.create(c.Form.prototype),t.prototype.constructor=t,t.prototype.onReady=function(){this.setID("#n2-ss-form-settings-item-defaults"),c.Form.prototype.onReady.call(this),this.$form.on("submit",this.onSubmit.bind(this))},t.prototype.initButtons=function(){this.$saveButton=$(".n2_settings_save").on("click",this.actionSave.bind(this))},t.prototype.actionSave=function(e){e&&e.preventDefault(),this.skipChangeConfirm=!0,this.$form.trigger("submit"),this.afterSave()},t.prototype.onSubmit=function(e){e.preventDefault(),c.AjaxHelper.ajax({type:"POST",url:this.$form.attr("action"),data:this.$form.serialize(),dataType:"json"})},t})),c.d("Slide","$",(function(){var $=c.$;function t(t,i){this.selected=!1,this.manager=t,this.box=i.data("slide",this),this.editUrl=this.box.find(".n2_slide_box__slide_overlay_edit_button").attr("href"),this.isEdited=this.box.hasClass("n2_slide_box--currently-edited"),this.box.on("contextmenu",this.onContextMenu.bind(this)),this.box.find(".n2_slide_box__footer_status_published, .n2_slide_box__footer_status_unpublished").on("click",this.switchPublished.bind(this)),this.box.find(".n2_slide_box__slide_select_tick").on("click",function(e){e.preventDefault(),this.invertSelection()}.bind(this)),this.$more=this.box.find(".n2_slide_box__slide_action_more").on("click",this.onMore.bind(this)),this.initRename()}return t.prototype.onContextMenu=function(e){e.preventDefault(),this.showContextMenu(e)},t.prototype.onMore=function(e){e.preventDefault(),this.showContextMenu(this.$more[0])},t.prototype.showContextMenu=function(t){var i=[];i.push({priority:55,label:n2_("Duplicate"),icon:"ssi_16 ssi_16--duplicate",action:this.duplicate.bind(this)}),i.push({priority:55,label:n2_("Copy"),icon:"ssi_16 ssi_16--copy",action:this.copy.bind(this)}),this.box.hasClass("n2_slide_box--published")?i.push({priority:55,label:n2_("Unpublish"),icon:"ssi_16 ssi_16--filledremove",action:this.unpublish.bind(this)}):i.push({priority:55,label:n2_("Publish"),icon:"ssi_16 ssi_16--filledcheck",action:this.publish.bind(this)}),this.box.hasClass("n2_slide_box--has-generator")&&i.push({priority:55,label:n2_("Edit generator"),icon:"ssi_16 ssi_16--cog",action:this.goToEditGenerator.bind(this)}),this.box.hasClass("n2_slide_box--first-slide")||this.box.hasClass("n2_slide_box--static-overlay")||i.push({priority:55,label:n2_("Set as first"),icon:"ssi_16 ssi_16--star",action:function(){this.setFirst()}.bind(this)}),this.box.hasClass("n2_slide_box--static-overlay")&&i.push({priority:55,label:n2_("Convert to slide"),icon:"ssi_16 ssi_16--paste",action:this.convertToSlide.bind(this)}),i.push({priority:1e3,label:n2_("Delete"),icon:"ssi_16 ssi_16--delete",action:function(){this.delete()}.bind(this),color:"red"}),this.box.addClass("n2_slide_box--context-menu"),c.ContextMenu(t,i,{y:5,horizontalAlign:n2const.isRTL()?"right":"left",onClose:function(){this.box.removeClass("n2_slide_box--context-menu")}.bind(this)})},t.prototype.getSliderId=function(){return this.box.data("sliderid")},t.prototype.getId=function(){return this.box.data("slideid")},t.prototype.setFirst=function(e){e&&e.preventDefault(),c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.manager.ajaxUrl,{nextendaction:"first"}),type:"POST",data:{id:this.getId()}}).done(function(){this.manager.unsetFirst(),this.box.addClass("n2_slide_box--first-slide")}.bind(this))},t.prototype.unsetFirst=function(){this.box.removeClass("n2_slide_box--first-slide")},t.prototype.publish=function(){this.switchPublished()},t.prototype.unpublish=function(){this.switchPublished()},t.prototype.switchPublished=function(e){e&&e.preventDefault(),this.isPublished()?this.manager.unPublishSlides([this.getId()],[this]):this.manager.publishSlides([this.getId()],[this])},t.prototype.isPublished=function(){return this.box.hasClass("n2_slide_box--published")},t.prototype.published=function(){this.box.addClass("n2_slide_box--published")},t.prototype.unPublished=function(){this.box.removeClass("n2_slide_box--published")},t.prototype.duplicate=function(){var i=$.Deferred();return c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.manager.ajaxUrl,{nextendcontroller:"slides",nextendaction:"duplicate",sliderid:this.getSliderId(),slideid:this.getId()})}).done(function(s){var n=$(s.data).insertAfter(this.box),h=new t(this.manager,n);this.manager.initSlides(),i.resolve(h),c._tooltip.add(n)}.bind(this)),i},t.prototype.delete=function(e){e&&e.preventDefault(),this.manager.deleteSlides([this.getId()],[this])},t.prototype.deleted=function(){this.box.remove()},t.prototype.invertSelection=function(e){e&&e.preventDefault(),this.selected?this.deSelect():this.select()},t.prototype.select=function(){this.selected||(this.selected=!0,this.box.addClass("n2_slide_box--bulk-selected"),this.manager.addSelection(this))},t.prototype.deSelect=function(){this.selected&&(this.selected=!1,this.box.removeClass("n2_slide_box--bulk-selected"),this.manager.removeSelection(this))},t.prototype.goToEditGenerator=function(){i.location=this.box.data("generator-edit")},t.prototype.copy=function(){c.SelectSlider(n2_("Copy slide to")+" ...",function(t,i,s){c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.manager.ajaxUrl,{nextendcontroller:"slides",nextendaction:"copy",targetGroupID:s,targetSliderID:t,sliderid:this.getSliderId(),slideid:this.getId()})})}.bind(this),!0)},t.prototype.initRename=function(){this.dblClickTimeout=!1,this.$label=this.box.find(".n2_slide_box__footer_title").on("click",function(e){"true"!==this.$label[0].contentEditable&&(this.dblClickTimeout?(a(this.dblClickTimeout),this.dblClickTimeout=!1,this.editName()):this.dblClickTimeout=r(function(){this.isEdited||(i.location=this.editUrl),this.dblClickTimeout=!1}.bind(this),500))}.bind(this)),this.title=this.$label.text().trim(),this.$label.text(this.title)},t.prototype.editName=function(){new c.InlineTextEditor(this.$label[0],{onSave:function(t){this.title!==t&&c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.manager.ajaxUrl,{nextendcontroller:"slides",nextendaction:"rename",slideid:this.getId(),title:t})}).done(function(){this.title=t,this.isEdited&&(c.History.get().off(),c._currentEditor.fragmentEditor.mainContainer.outsideStoreProperty(o,"title",t,"slideTitleRename"),c.History.get().on())}.bind(this)).fail(function(){this.$label.text(this.title)}.bind(this))}.bind(this),onCancel:function(){this.$label.text(this.title)}.bind(this),onTab:function(e){for(var t=$(".n2_slide_box__footer_title"),i=0;i<t.length;i++)if(this.$label.is(t[i])){e.shiftKey?i--:i++;break}i<0?i=t.length-1:i>=t.length&&(i=0),t.eq(i).trigger("click").trigger("click")}.bind(this)})},t.prototype.convertToSlide=function(){c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.manager.ajaxUrl,{nextendcontroller:"slides",nextendaction:"convertToSlide",sliderid:this.getSliderId(),slideid:this.getId()})}).done(function(){this.box.removeClass("n2_slide_box--static-overlay"),this.box.find(".n2_slide_box__details_static_slide").remove()}.bind(this))},t})),c.d("SlidesManager","$",(function(){var $=c.$;function t(t,s,h,o,a){this.quickPostModal=null,this.parameters=s,this.slides=[],this.options=f({sliderUrl:""},t),this.url=t.url,this.ajaxUrl=t.ajaxUrl,this.contentAjaxUrl=t.contentAjaxUrl,this.$slideManager=$(".n2_slide_manager"),this.slidesContainer=$(".n2_slide_manager__content"),this.initSlidesOrderable();for(var l=this.slidesContainer.find(".n2_slide_box"),u=0;u<l.length;u++)this.slides.push(new c.Slide(this,l.eq(u)));if(n.setAttribute("data-slides",this.slides.length),$(".n2_slide_manager__add_slide, .n2_slide_manager__dummy_slide").on("click",function(){this.$slideManager.toggleClass("n2_slide_manager--add-slide")}.bind(this)),$(".n2_slide_manager__add_slide_action[data-action]").on("click",function(e){switch(e.preventDefault(),$(e.currentTarget).data("action")){case"image":this.addQuickImage(e);break;case"empty-slide":e.preventDefault(),this.createSlide("empty-slide");break;case"post":this.addQuickPost(e);break;case"static-overlay":e.preventDefault(),this.createSlide("static-overlay")}}.bind(this)),$(".n2-box-slide-dummy").on("click",this.addQuickImage.bind(this)),$(".n2_slide_manager__block_notice_button").on("click",this.changeSliderType.bind(this)),"changeslidertype"===i.location.hash.substring(1)&&(i.location.hash="",this.changeSliderType()),this.initBulk(),!h){var d=this.slidesContainer[0];V(d,"dragover",function(e){e.preventDefault()}.bind(this)),V(d,"drop",function(e){e.preventDefault();var t=[];if(e.dataTransfer.items)for(var i=0;i<e.dataTransfer.items.length;i++)"file"===e.dataTransfer.items[i].kind&&t.push(e.dataTransfer.items[i].getAsFile());else for(i=0;i<e.dataTransfer.files.length;i++)t.push(e.dataTransfer.files[i]);if(t.length){var s=[],n=[];c.LoadingScreen.startLoading();for(i=0;i<t.length;i++)n.push(new Promise((function(n,h){var r=new XMLHttpRequest,l=new FormData;r.open("POST",o,!0),r.onload=function(){var t=JSON.parse(r.response);t.data&&t.data.name?s.push({title:t.data.name.replace(/\.[^/.]+$/,""),description:"",image:t.data.url}):c.AjaxHelper.notification(t),n()},r.onerror=function(){h()},l.append("image",t[i]),l.append("path","/"+a),r.send(l)})));Promise.all(n).finally(function(){s.length?this._addQuickImages(s):r((function(){c.LoadingScreen.stopLoading()}),100),s=[]}.bind(this))}}.bind(this))}}return t.prototype.changed=function(){},t.prototype.initSlidesOrderable=function(){this.uiSortable=new c.UISortable(this.slidesContainer,{items:".n2_slide_box",stop:this.saveSlideOrder.bind(this),placeholder:"n2_slide_manager__sortable_placeholder",distance:10,helper:"clone"})},t.prototype.saveSlideOrder=function(){for(var t=this.slidesContainer.find(".n2_slide_box"),s=[],n=[],h=[],o=0;o<t.length;o++){var r=t.eq(o).data("slide");s.push(r),n.push(r.getId())}for(o=0;o<this.slides.length;o++)h.push(this.slides[o].getId());if(JSON.stringify(h)!==JSON.stringify(n)){$(i).triggerHandler("SmartSliderSidebarSlidesOrderChanged");c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendcontroller:"slides",nextendaction:"order"}),data:{slideorder:n}}),this.slides=s,this.changed()}},t.prototype.initSlides=function(){for(var t=this.slidesContainer.find(".n2_slide_box"),s=[],h=0;h<t.length;h++){var o=t.eq(h).data("slide");s.push(o)}this.slides=s,this.changed(),$(i).triggerHandler("SmartSliderSidebarSlidesChanged"),n.setAttribute("data-slides",this.slides.length)},t.prototype.unsetFirst=function(){for(var t=0;t<this.slides.length;t++)this.slides[t].unsetFirst();this.changed()},t.prototype.addBoxes=function(t){t.appendTo(this.slidesContainer),t.addClass("n2_slide_box--just-added").each(function(t,i){new c.Slide(this,$(i))}.bind(this)),this.initSlides(),r((function(){t.removeClass("n2_slide_box--just-added")}),200)},t.prototype.createSlide=function(t,i){return c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"create",type:t}),data:i}).done(function(t){this.addBoxes($(t.data))}.bind(this))},t.prototype.addQuickImage=function(e){e.preventDefault(),c._imageHelper.openMultipleLightbox(this._addQuickImages.bind(this))},t.prototype._addQuickImages=function(t){for(var i=[],s=0;s<t.length;s++)t[s].image.match(/\.(mp4)/i)||i.push(t[s]);i.length&&this.createSlide("image",{images:c.Base64.encode(JSON.stringify(i))})},t.prototype.addQuickPost=function(e){if(e.preventDefault(),!this.quickPostModal){var t=this,i={},s=function(t){return i[t]===o&&(i[t]=c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.contentAjaxUrl),data:{keyword:t},dataType:"json"})),i[t]}.bind(this);this.quickPostModal=new c.ModalSimple("create-quick-post"),this.quickPostModal.addContent(c.UI.modalIcon("ssi_48 ssi_48--post","green")),this.quickPostModal.addContent(c.UI.modalHeading(n2_("Add post")));var n=c.UI.modalFormRow(!0);this.quickPostModal.addContent(n);var h=c.UI.modalFieldText(n,"keyword",n2_("Search keyword"),""),r="",a=c.UI.modalFormRow(!0);this.quickPostModal.addContent(a);var l=!1,u=c.UI.modalSelectList(a,"quick-post",n2_("Posts"),(function(t){l=t}));h.on("keyup",function(){r=h.val(),s(r).done(function(t){if(h.val()===r){u.removeOptions();for(var i=t.data,s=0;s<i.length;s++)u.addOption(i[s].title,i[s].info,i[s])}}.bind(this))}.bind(this)).trigger("keyup").focus();var d=c.UI.modalButton(n2_("Add post"),"green");this.quickPostModal.addButton(d),d.on("click",function(){l?t._addQuickPost(this.quickPostModal,l):c.Notification.error(n2_("Please select a Post first!"))}.bind(this))}this.quickPostModal.show()},t.prototype._addQuickPost=function(t,i){i.image||(i.image=""),this.createSlide("post",{post:i}),t&&this.quickPostModal.hide()},t.prototype.initBulk=function(){this.selection=[],this.isBulkSelection=!1,$("#n2_slide_manager_bulk_actions a[data-action]").on("click",function(e){switch(e.preventDefault(),$(e.currentTarget).data("action")){case"duplicate":this.bulkAction("duplicateSlides");break;case"copy":this.bulkAction("copySlides");break;case"delete":this.bulkAction("deleteSlides");break;case"publish":this.bulkAction("publishSlides");break;case"unpublish":this.bulkAction("unPublishSlides");break;case"select-all":this.bulkSelect((function(t){t.select()}));break;case"select-none":this.bulkSelect((function(t){t.deSelect()}));break;case"select-published":this.bulkSelect((function(t){t.box.hasClass("n2_slide_box--published")?t.select():t.deSelect()}));break;case"select-unpublished":this.bulkSelect((function(t){t.box.hasClass("n2_slide_box--published")?t.deSelect():t.select()}))}}.bind(this)),$(".n2-bulk-actions a").on("click",function(e){var t=$(e.currentTarget).data("action");t&&(e.preventDefault(),this.bulkAction(t))}.bind(this))},t.prototype.addSelection=function(t){0==this.selection.length&&this.enterBulk(),this.selection.push(t)},t.prototype.removeSelection=function(t){this.selection.splice(this.selection.indexOf(t),1),0==this.selection.length&&this.leaveBulk()},t.prototype.bulkSelect=function(t){for(var i=0;i<this.slides.length;i++)t(this.slides[i])},t.prototype.bulkAction=function(t){var i=[],s=[];this.bulkSelect((function(t){t.selected&&(i.push(t),s.push(t.getId()))})),s.length?this[t](s,i):c.Notification.notice("Please select one or more slides for the action!")},t.prototype.enterBulk=function(){this.isBulkSelection||(this.isBulkSelection=!0,this.uiSortable.setOption("disabled",!0),$(".n2_slide_manager").addClass("n2_slide_manager--bulk-select"))},t.prototype.leaveBulk=function(){if(this.isBulkSelection){this.uiSortable.setOption("disabled",!1),$(".n2_slide_manager").removeClass("n2_slide_manager--bulk-select");for(var t=0;t<this.slides.length;t++)this.slides[t].deSelect();this.selection=[],this.isBulkSelection=!1}},t.prototype.deleteSlides=function(t,s){var n=s.length>1?n2_("delete these slides"):n2_("delete this slide"),h=parseInt($(".n2-ss-currently-edited-slide").attr("data-id"));c.ModalDeleteConfirm(n,function(){c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"delete"}),type:"POST",data:{slides:t}}).done(function(){for(var n=0;n<s.length;n++)s[n].deleted();this.initSlides(),this.leaveBulk(),-1!==t.indexOf(h)&&(i.location=this.options.sliderUrl)}.bind(this))}.bind(this))},t.prototype.duplicateSlides=function(t,i){for(var s=0;s<this.slides.length;s++)this.slides[s].selected&&this.slides[s].duplicate($.Event("click",{currentTarget:null}))},t.prototype.copySlides=function(t){c.SelectSlider(n2_("Copy slide to")+" ...",function(i,s,n){c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"copySlides",targetGroupID:n,targetSliderID:i}),type:"POST",data:{slides:t}})}.bind(this),!0)},t.prototype.publishSlides=function(t,i){c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"publish"}),type:"POST",data:{slides:t}}).done(function(){for(var t=0;t<i.length;t++)i[t].published();this.changed()}.bind(this))},t.prototype.unPublishSlides=function(t,i){c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"unpublish"}),type:"POST",data:{slides:t}}).done(function(){for(var t=0;t<i.length;t++)i[t].unPublished();this.changed()}.bind(this))},t.prototype.changeSliderType=function(e){c._changeSliderType!==o&&(e&&e.preventDefault(),c._changeSliderType.showModal())},t})),c.d("SmartSliderSlideBackgroundAdmin",["$","SmartSliderSlideBackground"],(function(){var $=c.$;function t(t,i,s){this.types={color:"SmartSliderAdminSlideBackgroundColor",image:"SmartSliderAdminSlideBackgroundImage",video:"SmartSliderAdminSlideBackgroundVideo"},this.allowVisualLoad=!0,this.slider=t.slider,c.SmartSliderSlideBackground.prototype.constructor.call(this,t,i,s)}return t.prototype=Object.create(c.SmartSliderSlideBackground.prototype),t.prototype.constructor=t,t.prototype.setRelatedSectionSlide=function(t){this.sectionSlide=t},t.prototype.setVisualLoad=function(t){this.allowVisualLoad=t},t.prototype.setType=function(t){"color"===t?(this.elements.color||this.createColorElement(!0),this.elements.image&&(this.elements.image.kill(),this.elements.image=!1),this.elements.video&&(this.elements.video.kill(),this.elements.video=!1)):"image"===t?(this.elements.color||this.createColorElement(!0),this.elements.image||this.createImageElement(),this.elements.video&&(this.elements.video.kill(),this.elements.video=!1)):"video"===t&&(this.elements.image&&(this.elements.image.kill(),this.elements.image=!1),this.elements.color||this.createColorElement(!0),this.elements.video||this.createVideoElement())},t.prototype.setMode=function(t){"default"===t&&(t=this.slider.editor.options.slideBackgroundMode),S(this.element,"mode",t),this.elements.image&&this.elements.image.updateMode(t,this.mode),this.mode=t},t.prototype.setFocus=function(t,i){this.elements.image&&this.elements.image.updateFocus(t,i)},t.prototype.setImageOpacity=function(t){this.elements.image&&this.elements.image.updateOpacity(t)},t.prototype.setBlur=function(t){this.elements.image&&this.elements.image.updateBlur(t)},t.prototype.createColorElement=function(t){t=t||!1;var i=d();L(i,"n2-ss-slide-background-color"),this.element.appendChild(i),this.elements.color=new c[this.types.color](this,i),t&&this.elements.color.update(this.sectionSlide.getProperty("backgroundColor"),this.sectionSlide.getProperty("backgroundGradient"),this.sectionSlide.getProperty("backgroundColorEnd"),this.sectionSlide.getProperty("backgroundColorOverlay"))},t.prototype.updateColor=function(t,i,s,n){this.elements.color||this.createColorElement(),this.elements.color.update(t,i,s,n)},t.prototype.createImageElement=function(){var t=c._currentEditor.generator.fill(this.sectionSlide.getProperty("backgroundImage"));if(""!==t){var i=c._imageHelper.fixed(t),s=d(),n=u("picture"),h=u("img");s.appendChild(n),n.appendChild(h),L(s,"n2-ss-slide-background-image"),S(s,"hash",md5(t)),S(s,"desktop",i),S(s,"blur",this.sectionSlide.getProperty("backgroundImageBlur")),C(s,{opacity:this.sectionSlide.getProperty("backgroundImageOpacity")/100,backgroundPosition:c._currentEditor.generator.fill(this.sectionSlide.getProperty("backgroundFocusX"))+"% "+c._currentEditor.generator.fill(this.sectionSlide.getProperty("backgroundFocusY"))+"%"}),this.element.appendChild(s),this.elements.image=new c[this.types.image](this.slide,this.manager,this,[s]),this.elements.image.preLoadAdmin(t)}},t.prototype.setImage=function(t){t?this.elements.image?this.elements.image.setDesktopSrc(t):""!==t&&(null===t.match(/\.(png|jpg|jpeg|gif|webp|svg)/i)?(c.Notification.error("The background image format is not correct! The supported image formats are: png, jpg, jpeg, gif, webp, svg."),$("#layerslide-backgroundImage").val("").trigger("change")):"image"===this.sectionSlide.getProperty("background-type")&&this.createImageElement()):this.elements.image&&(this.elements.image.kill(),this.elements.image=!1)},t.prototype.setThumbnail=function(t,i){var s=$("#layerslide-thumbnail");""===t||!t.match(/\.(png|jpg|jpeg|gif|webp|svg)/i)||""!==s.val()&&s.val()!==i||s.val(t).trigger("change")},t.prototype.createVideoElement=function(){var t=c._imageHelper.fixed(c._currentEditor.generator.fill(this.sectionSlide.getProperty("backgroundVideoMp4")));if(""!==t)if(null===t.toLowerCase().match(/\.(mp4)$/))c.Notification.error("The background video format is not correct! Only MP4 videos are supported."),$("#slidebackgroundVideoMp4").val("").trigger("change");else{var i=u("video"),s=u("source");p(s,"type","video/mp4"),s.src=t,i.appendChild(s),i.muted=!0,i.loop=!0,i.preload="auto",i.playsinline="playsinline",i.webkitPlaysinline="webkit-playsinline",L(i,"n2-ss-slide-background-video"),S(i,"mode",this.sectionSlide.getProperty("backgroundVideoMode")),this.element.appendChild(i),this.elements.video=new c[this.types.video](this.slide,this,i),this.elements.video.updateOpacity(this.sectionSlide.getProperty("backgroundVideoOpacity"))}},t.prototype.setVideo=function(){this.elements.video&&this.elements.video.kill(),this.createVideoElement()},t.prototype.setVideoMode=function(t){this.elements.video&&this.elements.video.updateVideoMode(t)},t.prototype.setVideoOpacity=function(t){this.elements.video&&this.elements.video.updateOpacity(t)},t})),c.d("SlideEdit","$",(function(){var $=c.$;function t(t){this.options=f({ajaxUrl:"",slideAsFile:0,nextendAction:"",previewInNewWindow:!1,previewUrl:"",sliderElementID:"",slideEditorOptions:{}},t),this.editor=new c.EditorSlide(this,this.options.sliderElementID,this.options.slideEditorOptions),c.Form.prototype.constructor.call(this),c.r("documentReady",this.onReady.bind(this))}return t.prototype=Object.create(c.Form.prototype),t.prototype.constructor=t,t.prototype.onReady=function(){"create"===this.options.nextendAction&&this.initBackgroundOpen(),this.setID("#n2-ss-form-slide-edit"),c.Form.prototype.onReady.call(this),this.initPreview()},t.prototype.initBackgroundOpen=function(){c.r(["$","windowLoad"],(function(){(0,c.$)(".n2_form__tab_button[data-related-tab=n2_form__tab_slide_slide-background]").trigger("click")}))},t.prototype.resetChangeTracker=function(){this.hasChange=!1,s.addEventListener("historyChange",this.onChangeCallback,{passive:!0,capture:!0}),this.$saveButton.addClass("n2_button--inactive")},t.prototype.onChange=function(){this.hasChange=!0,this.$saveButton.removeClass("n2_button--inactive"),s.removeEventListener("historyChange",this.onChangeCallback,{passive:!0,capture:!0})},t.prototype.initButtons=function(){this.$saveButton=$(".n2_slide_settings_save").on("click",this.actionSave.bind(this)),$(".n2_slide_settings_back").on("click",this.actionCancel.bind(this)),$(".n2_slide_generator_static_save").on("click",function(e){this.actionSave(e,!0)}.bind(this))},t.prototype.actionSave=function(e,t){e&&e.preventDefault(),c.LayerNavigationTimeline.get().timelineControl.exitPreviewMode();var s=this.editor.getFormData();if(!0===t&&(s.generatorStatic="1"),this.options.slideAsFile&&typeof i.FormData!==o&&i.File!==o){var n=new FormData;try{n.append("slide",new Blob([s.slide]),"slide.txt")}catch(e){try{n.append("slide",new Blob([s.slide]))}catch(e){try{n.append("slide",new File([s.slide],"slide.txt"))}catch(e){c.Notification.notice('Your browser does not support File api, please disable "Send slide as file" option in the global settings.')}}}for(var h in delete s.slide,s)n.append(h,s[h]);c.AjaxHelper.ajax({url:c.AjaxHelper.makeAjaxUrl(this.options.ajaxUrl),type:"POST",data:n,contentType:!1,processData:!1}).done(this.afterSave.bind(this))}else c.AjaxHelper.ajax({type:"POST",url:c.AjaxHelper.makeAjaxUrl(this.options.ajaxUrl),data:s,dataType:"json"}).done(this.afterSave.bind(this))},t.prototype.actionCancel=function(e){e&&e.preventDefault(),i.location=e.currentTarget.href},t.prototype.afterSave=function(){var t=this.editor.fragmentEditor.mainContainer,i=$(".n2_admin_editor__ui_slide_manager .n2_slide_box--currently-edited ");i.find(".n2_slide_box__footer_title").text(t.getProperty("title")),i.find(".n2_slide_box__content").css("background-image","url("+c._imageHelper.fixed(this.editor.generator.fill(t.getProperty("thumbnail")||t.getProperty("backgroundImage")||"$ss3-frontend$/images/placeholder/image.png"))+")");var s=[];parseInt(t.getProperty("desktopLandscape"))||s.push(n2_("Large desktop")),parseInt(t.getProperty("desktopPortrait"))||s.push(n2_("Desktop")),parseInt(t.getProperty("tabletLandscape"))||s.push(n2_("Large tablet")),parseInt(t.getProperty("tabletPortrait"))||s.push(n2_("Tablet")),parseInt(t.getProperty("mobileLandscape"))||s.push(n2_("Large mobile")),parseInt(t.getProperty("mobilePortrait"))||s.push(n2_("Mobile"));var n="";s.length&&(n=n2_sprintf(n2_("This slide is hidden on the following devices: %s"),s.join(", "))),i.find(".n2_slide_box__footer_status_hidden").data("n2tip",n),c.Form.prototype.afterSave.call(this)},t.prototype.initPreview=function(){this.options.previewInNewWindow||(this.modal=new c.ModalIframe("preview-slider")),$("#n2-ss-preview").on("click",function(e){e.preventDefault(),this.options.previewInNewWindow?c.PreviewPopup("","preview-slider"):this.modal.show();var t=$('<form style="display:none;"></form>').attr({method:"post",action:c.AjaxHelper.makeAjaxUrl(this.options.previewUrl,{nextendaction:"slide",frame:this.options.previewInNewWindow?0:1}),target:"preview-slider"}).appendTo("body"),i=this.editor.getFormData();$('<input name="slide">').val(i.slide).appendTo(t),t.trigger("submit")}.bind(this))},t})),c.d("EditorAbstract","$",(function(){var $=c.$;function t(t,s){var n,h;h=navigator.userAgent.toLowerCase(),(n=-1!==h.indexOf("msie")&&parseInt(h.split("msie")[1]))&&n<10&&alert(i.ss2lang.The_editor_was_tested_under_Internet_Explorer_10_Firefox_and_Chrome_Please_use_one_of_the_tested_browser),this.readyDeferred=$.Deferred(),this.sliderElementID=t,this.readyDeferred.done(function(){c.d("SSEditor",function(){return this}.bind(this))}.bind(this)),this.options=f({isUploadDisabled:!0,uploadUrl:"",uploadDir:"",settingsGoProUrl:"",sectionLibraryFree:!0,sectionLibraryUrl:"",sectionLibraryGoProUrl:""},s),c._currentEditor=this,this.frontend=null,this.generator=null,this.fragmentEditor=null,this.$editedElement=null,this.editedInstance=null,c.r(["$","documentReady"],function(){n2const.fonts.then(this.startEditor.bind(this))}.bind(this))}return t.prototype.startEditor=function(){},t.prototype.ready=function(t){this.readyDeferred.done(t)},t.prototype.getSelf=function(){return this},t.prototype.getAvailableDeviceModes=function(){return{desktopPortrait:1,desktopLandscape:0,tabletPortrait:1,tabletLandscape:0,mobilePortrait:1,mobileLandscape:0}},t.prototype.getGeneratorVariables=function(){return this.$editedElement.data("variables")},t.prototype.getMainContainerElement=function(){return this.$editedElement.find(".n2-ss-layers-container").addBack().last()},t})),c.d("EditorSlide",["$","EditorAbstract"],(function(){var $=c.$;function t(t,i,s){this.slideEdit=t,c.EditorAbstract.prototype.constructor.call(this,i,f({slideBackgroundMode:"fill"},s)),this.onTickCallback=this.onTick.bind(this)}return t.prototype=Object.create(c.EditorAbstract.prototype),t.prototype.constructor=t,t.prototype.startEditor=function(){c.r("#"+this.sliderElementID,function(){var t=c["#"+this.sliderElementID];this.frontend=t,this.frontend.editor=this,c._pre="div#"+this.frontend.elementID+" ",this.frontend.visible(this.sliderStarted.bind(this))}.bind(this))},t.prototype.sliderStarted=function(){$("body").addClass("n2-ss-slider-visible"),this.$editedElement=$(this.frontend.sliderElement.querySelector(".n2-ss-currently-edited-slide")),this.editedInstance=this.$editedElement[0].ssSlide,this.generator=new c.Generator(this),this.generator.registerGlobalField("slide","name","#layerslide-title"),this.generator.registerGlobalField("slide","description","#layerslide-description"),this.getMainContainerElement().on({updateSize:this.updateSize.bind(this),interaction:this.updateSize.bind(this)}),this.fragmentEditor=new c.FragmentEditor(this,$(this.getFrontendSlide().element),this.options);var t=this.getFrontendElement();V(t[0],"SliderDeviceOrientation",this.fragmentEditor.onChangeDeviceOrientation.bind(this.fragmentEditor)),V(t[0],"SliderResize",function(e){this.fragmentEditor.onResize(e.detail.ratios)}.bind(this)),this.readyDeferred.resolve()},t.prototype.getFormData=function(){return{guides:c.Base64.encode(JSON.stringify(this.fragmentEditor.canvasSettings.ruler.toArray())),slide:c.Base64.encode(c._UnicodeToHTMLEntity(JSON.stringify(this.fragmentEditor.getData())))}},t.prototype.getAvailableDeviceModes=function(){return this.frontend.responsive.parameters.enabledDevices},t.prototype.getSlideBackground=function(){return this.$editedElement[0].ssSlideBackground},t.prototype.getFrontendElement=function(){return $(this.frontend.sliderElement)},t.prototype.getFrontendSlide=function(){return this.editedInstance},t.prototype.getHorizontalRatio=function(){return this.frontend.responsive.ratios.slideW},t.prototype.getVerticalRatio=function(){return this.frontend.responsive.ratios.slideH},t.prototype.updateSize=function(){this.Zi||(this.frontend.responsive.doResize(),c.i.add(this.onTickCallback),this.Zi=!0)},t.prototype.onTick=function(){c.i.remove(this.onTickCallback),this.frontend.responsive.doResize(),delete this.Zi},t.prototype.getDeviceMode=function(){return this.frontend.responsive.getNormalizedModeString()},t})),c.d("Generator",["$","EditorAbstract"],(function(){var $=c.$;function t(t){this.editor=t,this._refreshTimeout=null,this.modal=!1,this.group=0,this.editor.generator=this;var i=this.editor.getGeneratorVariables();if(i){for(var s in this.variables=i,this.variables)!isNaN(parseFloat(s))&&isFinite(s)&&(this.group=Math.max(this.group,parseInt(s)+1));this.fill=this.generatorFill,this.group>0&&(this.registerField=this.generatorRegisterField,this.button=$('<div class="n2_field_generator_data_button"><div class="n2_field_generator_data_button_icon"><i class="ssi_16 ssi_16--data"></i></div><div class="n2_field_generator_data_button_label">'+n2_("Data")+"</div></div>").on("click",function(e){this.showModal()}.bind(this)),$("body").addClass("n2_ss_body--dynamic-slide"))}else this.variables=null}return t.prototype.isDynamicSlide=function(){return this.group>0},t.prototype.splitTokens=function(t){for(var i=[],s="",n=0,h=0;h<t.length;h++){var o=t[h];","===o&&0===n?(i.push(s),s=""):(s+=o,"("===o?n++:")"===o&&n--)}return s.length&&i.push(s),i},t.prototype.fill=function(t){return t},t.prototype.generatorFill=function(t){return"string"==typeof t?t.replace(/{((([a-z]+)\(([^}]+)\))|([a-zA-Z0-9][a-zA-Z0-9_\/]*))}/g,this.parseFunction.bind(this)):t},t.prototype.parseFunction=function(t,i,s,n,h,r){if(r===o){for(var a=this.splitTokens(h),c=0;c<a.length;c++)a[c]=this.parseVariable(a[c]);return"function"==typeof this[n]?this[n].apply(this,a):t}return this.parseVariable(r)},t.prototype.parseVariable=function(t){var i=t.match(/^("|')(.*)("|')$/);if(i)return i[2];var s=t.match(/((([a-z]+)\(([^}]+)\)))/);if(s)return this.parseFunction.apply(this,s);var n=t.match(/([a-zA-Z][0-9a-zA-Z_]*)(\/([0-9a-z]+))?/);if(n){var h=n[3];if(h===o)h=0;else{var r=parseInt(h);isNaN(r)||(h=Math.max(h,1)-1)}return this.variables[h]!==o&&this.variables[h][n[1]]!==o?this.variables[h][n[1]]:""}return t},t.prototype.fallback=function(t,i){return""==t?i:t},t.prototype.cleanhtml=function(t){return this.stripTags(t,"<p><a><b><br /><br/><br><i>")},t.prototype.stripTags=function(t,i){i=(((i||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");return t.replace(/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi,"").replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,(function(t,s){return i.indexOf("<"+s.toLowerCase()+">")>-1?t:""}))},t.prototype.removehtml=function(t){return $("<div>"+t+"</div>").text()},t.prototype.splitbychars=function(t,i,s){return t.substr(i,s)},t.prototype.splitbywords=function(t,i,s){var n=t,h=n.length,o=Math.max(0,0==i?0:n.indexOf(" ",i)),r=Math.max(0,s>h?h:n.indexOf(" ",s));return 0==r&&s<=h&&(r=h),n.substr(o,r)},t.prototype.findimage=function(t,i){var s=t,n=/(<img.*?src=[\'"](.*?)[\'"][^>]*>)|(background(-image)??\s*?:.*?url\((["|\']?)?(.+?)(["|\']?)?\))/gi,h=[],r=null;for(i=i!==o?parseInt(i)-1:0;r=n.exec(s);)r[2]!==o?h.push(r[2]):r[6]!==o&&h.push(r[6]);return h.length?h.length>i?h[i]:h[h.length-1]:""},t.prototype.findlink=function(t,i){var s=t,n=/href=["\']?([^"\'>]+)["\']?/gi,h=[],r=null;for(i=i!==o?parseInt(i)-1:0;r=n.exec(s);)r[1]!==o&&h.push(r[1]);return h.length?h.length>i?h[i]:h[h.length-1]:""},t.prototype.removevarlink=function(t){return String(t).replace(/<a href=\"(.*?)\">(.*?)<\/a>/g,"")},t.prototype.removelinebreaks=function(t){return String(t).replace(/\r?\n|\r/g,"")},t.prototype.registerFields=function(t){for(var i=0;i<t.length;i++)this.registerField(t[i])},t.prototype.registerGlobalField=function(t,i,s){null!==this.variables&&(s=$(s).on("outsideChange",function(){this.variables[t][i]=s.val(),this.refresh()}.bind(this)))},t.prototype.registerField=function(t){},t.prototype.generatorRegisterField=function(t){var i=(t=$(t)).parent();i.on({mouseenter:function(){this.activeField=t,this.button.prependTo(i)}.bind(this)})},t.prototype.getModal=function(){if(!this.selectVariableModal){var t={key:"",group:1,filter:"no",split:"no",splitStart:0,splitLength:300,findImage:0,findImageIndex:1,findLink:0,findLinkIndex:1,removeVarLink:0,removelinebreaks:0},i=function(){var i=t.key+"/"+t.group;return 0!=t.findImage&&(i="findimage("+i+","+Math.max(1,t.findImageIndex)+")"),0!=t.findLink&&(i="findlink("+i+","+Math.max(1,t.findLinkIndex)+")"),0!=t.removeVarLink&&(i="removevarlink("+i+")"),0!=t.removelinebreaks&&(i="removelinebreaks("+i+")"),"no"!=t.filter&&(i=t.filter+"("+i+")"),"no"!=t.split&&t.splitStart>=0&&t.splitLength>0&&(i=t.split+"("+i+","+t.splitStart+","+t.splitLength+")"),"{"+i+"}"},s=function(){a.text(this.fill(i()))}.bind(this);this.selectVariableModal=new c.ModalSimple("generator-insert-variable",{width:760}),this.selectVariableModal.addContent(c.UI.modalIcon("ssi_48 ssi_48--data","blue")),this.group>1&&c.UI.modalGeneratorVariableList(this.selectVariableModal,this.group,"Select group","group","Groups",(function(i){t.group=i,s()})),c.UI.modalGeneratorVariableList(this.selectVariableModal,this.variables[0],"Insert variable","variable","Variables",(function(i){t.key=i,s()})),t.key=Object.keys(this.variables[0])[0];var n=c.UI.modalFormRow();this.selectVariableModal.addContent(n),c.UI.modalSelect(n,"filter-select",n2_("Filter"),{no:n2_("No"),cleanhtml:n2_("Clean HTML"),removehtml:n2_("Remove HTML")},"no").on("nextendChange",(function(){t.filter=$(this).val(),s()})),c.UI.modalSelect(n,"split-select",n2_("Split by Chars"),{no:n2_("No"),splitbychars:n2_("Strict"),splitbywords:n2_("Respect words")},"no").on("nextendChange",(function(){t.split=$(this).val(),s()})),c.UI.modalNumber(n,"split-start","",0,{wide:2,sublabel:"start"}).on("nextendChange",(function(){t.splitStart=$(this).val(),s()})),c.UI.modalNumber(n,"split-length","",300,{wide:3,sublabel:"length"}).on("nextendChange",(function(){t.splitLength=$(this).val(),s()}));var h=c.UI.modalFormRow();this.selectVariableModal.addContent(h),c.UI.modalOnOff(h,"find-image",n2_("Find image"),0).on("nextendChange",(function(){t.findImage=$(this).val(),s()})),c.UI.modalNumber(h,"find-image-index","",1,{wide:2,sublabel:"index"}).on("nextendChange",(function(){t.findImageIndex=$(this).val(),s()})),c.UI.modalOnOff(h,"find-link",n2_("Find link"),0).on("nextendChange",(function(){t.findLink=$(this).val(),s()})),c.UI.modalNumber(h,"find-link-index","",1,{wide:2,sublabel:"index"}).on("nextendChange",(function(){t.findLinkIndex=$(this).val(),s()})),c.UI.modalOnOff(h,"remove-link",n2_("Remove links"),0).on("nextendChange",(function(){t.removeVarLink=$(this).val(),s()})),c.UI.modalOnOff(h,"remove-line-break",n2_("Remove line breaks"),0).on("nextendChange",(function(){t.removelinebreaks=$(this).val(),s()}));var o=c.UI.modalFormRow(!0);this.selectVariableModal.addContent(o);var r=c.UI.modalFieldWrapper(o,"result",n2_("Result")),a=$('<div class="n2_generator_result"></div>').appendTo(r.$element),l=c.UI.modalButton(n2_("Insert"),"green");this.selectVariableModal.addButton(l),l.on("click",function(e){e.preventDefault(),this.insert(i()),this.selectVariableModal.hide()}.bind(this)),s()}return this.selectVariableModal},t.prototype.showModal=function(){this.getModal().show()},t.prototype.insert=function(t){this.activeField.val(t).trigger("change")},t.prototype.refresh=function(){this._refreshTimeout&&(a(this._refreshTimeout),this._refreshTimeout=null),this._refreshTimeout=r(this._refresh.bind(this),100)},t.prototype._refresh=function(){for(var t=this.editor.fragmentEditor.mainContainer.container.getAllLayers(),i=0;i<t.length;i++)"layer"===t[i].type&&t[i].item.reRender()},t})),c.d("Historical","$",(function(){"use strict";function t(i){for(var s in t.prototype)i.prototype[s]=t.prototype[s]}return t.prototype.setSelf=function(t){t===o&&console.error(t),this.self!==o&&this.self!==this&&this.self.setSelf(t),this.self=t,this.onSelfChange()},t.prototype.getSelf=function(){return this.self===o?this.self=this:this.self!==this&&(this.self=this.self.getSelf()),this.self},t.prototype.onSelfChange=function(){},t})),c.d("History","$",(function(){var t,$=c.$;function i(){this.historyStates=50,this.enabled=0!==this.historyStates,this.historyActionInProgress=!1,this.historyAddAllowed=!0,this.isBatched=!1,this.currentBatch=this,this.index=-1,this.stackedOff=[],this.tasks=[],this.preventUndoRedo=!1,this.undoBTN=$(".n2_ss_history_action--undo").on({click:this.undo.bind(this)}),this.redoBTN=$(".n2_ss_history_action--redo").on({click:this.redo.bind(this)})}function n(t){this.parent=t,this.tasks=[]}function h(t){switch(t){case"skipForwardUndos":this.undo=function(){return!1}}}function o(t,i,s,n){this.that=t,this.undoAction=i,this.redoAction=s,this.context=n||[]}function a(){o.prototype.constructor.apply(this,arguments)}return c.r("documentReady",(function(){t=new i})),i.get=function(){return t},i.prototype.updateUI=function(){this.undoBTN.toggleClass("n2_ss_history_action--allowed",0!==this.index&&this.tasks.length>0),this.redoBTN.toggleClass("n2_ss_history_action--allowed",this.index>-1&&this.index<this.tasks.length),s.dispatchEvent(new CustomEvent("historyChange",{cancelable:!1,bubbles:!1}))},i.prototype.throttleUndoRedo=function(){return!!this.preventUndoRedo||(this.preventUndoRedo=!0,r(function(){this.preventUndoRedo=!1}.bind(this),100),!1)},i.prototype.isEnabled=function(){return this.enabled&&this.historyAddAllowed},i.prototype.startBatch=function(){if(this.isEnabled()){var t=new n(this.currentBatch);return this.currentBatch._add(t),this.currentBatch=t,t}return!1},i.prototype.endBatch=function(){this.isEnabled()&&(this.currentBatch.parent,this.currentBatch=this.currentBatch.parent)},i.prototype.addControl=function(t){return this.currentBatch._add(new h(t))},i.prototype.addSimple=function(t,i,s,n){return!!this.isEnabled()&&this.currentBatch._add(new o(t,i,s,n))},i.prototype.addValue=function(t,i,s){if(this.isEnabled()){if(this.isBatched||this.currentBatch!==this)for(var n=this.getCurrentBatchStack(),h=0;h<n.length;h++)if(n[h].isEqual(t,i,s))return n.push(n.splice(h,1)[0]),n[n.length-1];return this.currentBatch._add(new a(t,i,i,s))}return!1},i.prototype.getCurrentBatchStack=function(){return this.currentBatch!==this?this.currentBatch.tasks:this.tasks[this.tasks.length-1]},i.prototype._add=function(t){return-1!==this.index&&this.tasks.splice(this.index,this.tasks.length),this.index=-1,this.isBatched?this.tasks[this.tasks.length-1].push(t):(this.tasks.push([t]),this.isBatched=!0,r(function(){this.isBatched=!1}.bind(this),100)),this.tasks.length>this.historyStates&&this.tasks.shift(),this.updateUI(),t},i.prototype.off=function(){this.historyAddAllowed=!1,this.stackedOff.push(1)},i.prototype.on=function(){this.stackedOff.pop(),0===this.stackedOff.length&&(this.historyAddAllowed=!0)},i.prototype.undo=function(e){if(e&&e.preventDefault(),this.throttleUndoRedo())return!1;if(this.historyActionInProgress=!0,this.off(),-1===this.index?this.index=this.tasks.length-1:this.index--,this.index>=0)for(var t=this.tasks[this.index],i=t.length-1;i>=0&&t[i].undo();i--);else this.index=0;return this.on(),this.historyActionInProgress=!1,this.updateUI(),!0},i.prototype.redo=function(e){if(e&&e.preventDefault(),this.throttleUndoRedo())return!1;if(this.historyActionInProgress=!0,this.off(),-1!==this.index&&this.index<this.tasks.length){var t=this.tasks[this.index];this.index++;for(var i=0;i<t.length&&t[i].redo();i++);}return this.on(),this.historyActionInProgress=!1,this.updateUI(),!0},i.prototype.actionInProgress=function(){return this.historyActionInProgress},n.prototype._add=function(t){return this.tasks.push(t),t},n.prototype.undo=function(){for(var t=0;t<this.tasks.length&&this.tasks[t].undo();t++);return!0},n.prototype.redo=function(){for(var t=0;t<this.tasks.length&&this.tasks[t].redo();t++);return!0},n.prototype.isEqual=function(){return!1},h.prototype.undo=function(){return!0},h.prototype.redo=function(){return!0},h.prototype.isEqual=function(){return!1},o.prototype.undo=function(){return this.undoAction.apply(this.that.getSelf(),this.context),!0},o.prototype.redo=function(){return this.redoAction.apply(this.that.getSelf(),this.context),!0},o.prototype.isEqual=function(){return!1},a.prototype=Object.create(o.prototype),a.prototype.constructor=a,a.prototype.setValues=function(t,i){this.undoValue=t,this.redoValue=i},a.prototype.undo=function(){return this.context.unshift(this.undoValue),this.undoAction.apply(this.that.getSelf(),this.context),this.context.shift(),!0},a.prototype.redo=function(){return this.context.unshift(this.redoValue),this.redoAction.apply(this.that.getSelf(),this.context),this.context.shift(),!0},a.prototype.isEqual=function(t,i,s){if(t===this.that&&i===this.undoAction){for(var n=0;n<s.length;n++)if(s[n]!==this.context[n])return!1;return this.setValues=function(t,i){this.redoValue=i}.bind(this),!0}return!1},i})),c.d("InlineTextEditor","$",(function(){function t(t,s){this.destroyed=!1,this.el=t,t.contentEditable=!0,this.options=f({onSave:function(){},onCancel:function(){},onTab:function(e){},filter:!1},s),this.listeners=[],this.selectAll(),this.addListener("blur",this.onBlur.bind(this),i),this.addListener("input",this.onInput.bind(this)),this.addListener("blur",this.onBlur.bind(this)),this.addListener("keydown",this.onKeydown.bind(this)),this.addListener("mousedown",this.stopPropagation.bind(this)),this.addListener("mouseup",this.stopPropagation.bind(this)),this.addListener("click",this.stopPropagation.bind(this))}function n(t){for(var i=[],s=0;s<t.childNodes.length;s++)t.childNodes[s].childNodes.length?i.push.apply(i,n(t.childNodes[s])):i.push(t.childNodes[s].textContent);return i}return t.prototype.addListener=function(t,i,s){(s=s||this.el).addEventListener(t,i),this.listeners.push({el:s,eventName:t,callback:i})},t.prototype.stopPropagation=function(e){e.stopPropagation()},t.prototype.onBlur=function(){this.destroy();var t=this.filterText(this.el.textContent);this.el.scrollLeft=0,this.el.scrollTop=0,this.options.onSave(t)},t.prototype.cancel=function(){this.destroy(),this.options.onCancel()},t.prototype.destroy=function(){this.selectNone();for(var t=0;t<this.listeners.length;t++)this.listeners[t].el.removeEventListener(this.listeners[t].eventName,this.listeners[t].callback);this.el.contentEditable=!1},t.prototype.onKeydown=function(e){e.defaultPrevented||(13===e.keyCode?(this.onBlur(),e.preventDefault()):27===e.keyCode?(this.cancel(),e.preventDefault()):9===e.keyCode&&(this.onBlur(),this.options.onTab(e),e.preventDefault()))},t.prototype.onInput=function(){var t=this.el.textContent,i=n(this.el),s=this.filterText(i.join(" "));if(this.el.innerHTML!==s){var h=this.getCaretPosition(),o=t.length;this.el.innerHTML=s.replace(/ /g," "),this.setCaretPosition(h-(o-s.length))}},t.prototype.filterText=function(t){return t=t.replace(/[\s]/gi," ").replace(/\s+/g," "),this.options.filter&&(t=this.options.filter(t)),t},t.prototype.getCaretPosition=function(){var t=i.getSelection().getRangeAt(0),s=t.toString().length,n=t.cloneRange();return n.selectNodeContents(this.el),n.setEnd(t.endContainer,t.endOffset),n.toString().length-s},t.prototype.setCaretPosition=function(t){t=Math.max(0,Math.min(this.el.textContent.length,t));var n=i.getSelection(),h=s.createRange();h.setStart(this.el.childNodes.length?this.el.childNodes[0]:this.el,t),h.collapse(!0),n.removeAllRanges(),n.addRange(h)},t.prototype.selectAll=function(){var t=this.el;this.el.childNodes.length&&(t=this.el.childNodes[0]);var n=i.getSelection(),h=s.createRange();h.setStart(t,0),h.setEnd(t,this.el.textContent.length),n.removeAllRanges(),n.addRange(h)},t.prototype.selectNone=function(){i.getSelection().removeAllRanges()},t})),c.d("SmartSliderAdminSlideBackgroundColor",["SmartSliderSlideBackgroundColor"],(function(){function t(t,i){c.SmartSliderSlideBackgroundColor.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.SmartSliderSlideBackgroundColor.prototype),t.prototype.constructor=t,t.prototype.update=function(t,i,s,n){t=this.fixColor(t),p(this.el,"data-overlay",parseInt(n)?1:0),"off"!==i?this.updateGradient(t,i,s):this.updateColor(t)},t.prototype.updateColor=function(t){"00"!==t.substr(6,8)?M(this.el,"background",N2Color.hex2rgbaCSS(t)):O(this.el,"background")},t.prototype.updateGradient=function(t,i,s){switch(s=this.fixColor(s),i){case"horizontal":M(this.el,"background","linear-gradient(to right, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(s)+" 100%)");break;case"vertical":M(this.el,"background","linear-gradient(to bottom, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(s)+" 100%)");break;case"diagonal1":M(this.el,"background","linear-gradient(45deg, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(s)+" 100%)");break;case"diagonal2":M(this.el,"background","linear-gradient(135deg, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(s)+" 100%)");break;default:O(this.el,"background")}},t.prototype.fixColor=function(t){return t.length&&"#"===t.charAt(0)&&6===(t=t.substring(1)).length&&(t+="ff"),t},t})),c.d("SmartSliderAdminSlideBackgroundImage",["$","SmartSliderSlideBackgroundImage"],(function(){var $=c.$;function t(t,i,s,n){this.hash=x(n[0],"hash"),this.src={desktop:x(n[0],"srcDesktop"),tablet:x(n[0],"srcTablet"),mobile:x(n[0],"srcMobile")},c.SmartSliderSlideBackgroundImage.prototype.constructor.apply(this,arguments),this.listenImageManager()}return t.prototype=Object.create(c.SmartSliderSlideBackgroundImage.prototype),t.prototype.constructor=t,t.prototype.listenImageManager=function(){""!==this.hash&&$(i).on(this.hash,this.onImageManagerChanged.bind(this))},t.prototype.notListenImageManager=function(){""!==this.hash&&$(i).off(this.hash,null,this.onImageManagerChanged.bind(this))},t.prototype.onImageManagerChanged=function(e,t){this.src.tablet=t.tablet.image,this.src.mobile=t.mobile.image,this.onSlideDeviceChanged(this.manager.device)},t.prototype.preLoadAdmin=function(t){this.src.desktop=c._imageHelper.fixed(t),this.setSrc(this.src.desktop),this.preLoad(),""!==t&&this.background.allowVisualLoad&&(this.notListenImageManager(),this._promise.then(function(){$.when(c._imageManager.getVisual(t)).done(function(t){this.onImageManagerChanged(null,t.value),this.listenImageManager()}.bind(this))}.bind(this)))},t.prototype.setDesktopSrc=function(t){if(this.notListenImageManager(),this.src.desktop=t,this.hash=md5(t),""!==t&&this.background.allowVisualLoad){var i=new Image;i.addEventListener("load",function(){$.when(c._imageManager.getVisual(t)).done(function(t){this.onImageManagerChanged(null,t.value),this.listenImageManager()}.bind(this))}.bind(this),!1),i.src=c._imageHelper.fixed(t)}else this.src={desktop:c._imageHelper.fixed(t),tablet:"",mobile:""},this.setSrc(c._imageHelper.fixed(t))},t.prototype.setSrc=function(t){t=c._imageHelper.fixed(t);for(var i=0;i<this.imageElements.length;i++)p(this.imageElements[i].querySelector("img"),"src",t);""===t&&this.onImageLoaded()},t.prototype.onSlideDeviceChanged=function(t){var i=this.src.desktop;"mobilePortrait"===t||"mobileLandscape"===t?this.src.mobile?i=this.src.mobile:this.src.tablet&&(i=this.src.tablet):"tabletPortrait"!==t&&"tabletLandscape"!==t||this.src.tablet&&(i=this.src.tablet),i?this.setSrc(i):this.setSrc("")},t.prototype.startFixed=function(){},t.prototype.updateMode=function(t,i){if("blurfit"===t&&1===this.imageElements.length){var s=this.imageElements[0].cloneNode(!0);this.imageElements[0].parentNode.insertBefore(s,this.imageElements[0]),this.imageElements.unshift(s),C(s,{margin:"-14px",padding:"14px"}),M(s.children[0],"filter","blur(7px)")}"blurfit"===i&&"blurfit"!==t&&P(this.imageElements.shift())},t.prototype.updateFocus=function(t,i){A(this.imageElements,{"--ss-o-pos-x":t+"%","--ss-o-pos-y":i+"%"})},t.prototype.updateOpacity=function(t){j(this.imageElements,"opacity",t/100)},t.prototype.updateBlur=function(t){var i=this.imageElements[this.imageElements.length-1];t>0?(C(i,{margin:"-"+2*t+"px",padding:2*t+"px"}),M(i.children[0],"filter","blur("+t+"px)")):(N(i,["margin","padding"]),O(i.children[0],"filter")),this.blur=t},t.prototype.kill=function(){this.notListenImageManager(),F(this.imageElements)},t})),c.d("SmartSliderAdminSlideBackgroundVideo",["SmartSliderSlideBackgroundVideo"],(function(){function t(t,i,s){c.SmartSliderSlideBackgroundVideo.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.SmartSliderSlideBackgroundVideo.prototype),t.prototype.constructor=t,t.prototype.onReady=function(){this.isReady||(this.isReady=!0,this.safePause(),this.slider.ready(function(){G(this.video,"n2playvideo",function(){this.background.fadeOut()}.bind(this)),this.setState("ready",!0),this.setState("scroll",!0)}.bind(this)))},t.prototype.updateVideoMode=function(t){p(this.video,"data-mode",t)},t.prototype.updateOpacity=function(t){M(this.video,"opacity",t/100)},t.prototype.kill=function(){P(this.video)},t})),c.d("LayerContainer","$",(function(){var $=c.$;function t(t){this.component=t,this.$ul=$('<div class="n2_layer_navigation_list_layer__children"></div>').data("container",this),this.childrenSelector="> .n2-ss-layer",this.layerContainerElement=t.layer}return t.prototype.setLayerContainerElement=function(t){this.layerContainerElement=t},t.prototype.startWithExistingNodes=function(t){for(var i=this.layerContainerElement.find(this.childrenSelector),s=0;s<i.length;s++)this._loadNode(i.eq(s),t);this.component.onChildCountChange()},t.prototype._loadNode=function(t,i){var s;switch(t.data("sstype")){case"content":s=new c.Content(this.component.fragmentEditor,this.component);break;case"layer":s=new c.Layer(this.component.fragmentEditor,this.component);break;case"row":s=new c.Row(this.component.fragmentEditor,this.component);break;case"col":s=new c.Col(this.component.fragmentEditor,this.component)}return!!s&&(s.load(t,i),i||s.sync(),s)},t.prototype.getLayerCount=function(){return this.layerContainerElement.find(this.childrenSelector).length},t.prototype.getLayerIndex=function(t){return this.layerContainerElement.find(this.childrenSelector).index(t)},t.prototype.getSortedLayers=function(){var t=[];return this.layerContainerElement.find(this.childrenSelector).each((function(i,s){var n=$(s).data("layerObject");n!==o&&t.push(n)})),t},t.prototype.append=function(t){t.appendTo(this.layerContainerElement);var i=this._loadNode(t,!1);return this.component.onChildCountChange(),i},t.prototype.insertAt=function(t,i){var s=this.getSortedLayers();i>=s.length?t.appendTo(this.layerContainerElement):t.insertBefore(s[i].layer);var n=this._loadNode(t,!1);return this.component.onChildCountChange(),n},t.prototype.insert=function(t){t.getRootElement().appendTo(this.layerContainerElement)},t.prototype.insertLayerAt=function(t,i){var s=this.getSortedLayers(),n=t.group,h=s.indexOf(t);h>-1&&h<i&&i++,i>=s.length?t.getRootElement().appendTo(this.layerContainerElement):t.getRootElement().insertBefore(s[i].getRootElement()),this.syncLayerRow(t),n!==this.component&&(n.onChildCountChange(),t.layer.triggerHandler("LayerAbsoluteUnavailable")),n.triggerLayerResized(),this.component.triggerLayerResized()},t.prototype.syncLayerRow=function(t){var i,s="slide"===this.component.type;(i=s?t.getRootElement().prevAll(".n2-ss-layer").first().data("layerObject"):t.getRootElement().nextAll(".n2-ss-layer").first().data("layerObject"))!==o?t.layerRow.insertBefore(i.layerRow):this.$ul.append(t.layerRow),t.animations&&t.animations.syncRow(i,s)},t.prototype.getChildLayersRecursive=function(t){for(var i=this.getSortedLayers(),s=[],n=0;n<i.length;n++)t?s.push(i[n].layer[0]):s.push(i[n]),i[n].container&&s.push.apply(s,i[n].container.getChildLayersRecursive(t));return s},t.prototype.moveLayersToGroup=function(t,i){i=i||[];for(var s=[],n=0;n<t.length;n++){var h=t[n],r=h.group,a=h.getIndex();i[n]!==o?this.insertLayerAt(h,i[n]):this.insert(h),h.changeGroup(a,this.component),this!==r&&-1===s.indexOf(r)&&s.push(r)}for(n=0;n<s.length;n++)s[n].update()},t.prototype.activateFirst=function(){var t=this.getSortedLayers();t.length>0&&t[t.length-1].activate()},t.prototype.resetModes=function(t){for(var i=this.getSortedLayers(),s=0;s<i.length;s++)i[s].resetMode(t),i[s].container!==o&&i[s].container.resetModes(t)},t.prototype.copyModes=function(t,i){for(var s=this.getSortedLayers(),n=0;n<s.length;n++)s[n].copyMode(t,i),s[n].container!==o&&s[n].container.copyModes(t,i)},t.prototype.changeEditorModes=function(t){for(var i=this.getSortedLayers(),s=0;s<i.length;s++)i[s].changeEditorMode(t),i[s].container!==o&&i[s].container.changeEditorModes(t)},t.prototype.renderModeProperties=function(){for(var t=this.getSortedLayers(),i=0;i<t.length;i++)t[i].renderModeProperties(),t[i].container!==o&&t[i].container.renderModeProperties()},t.prototype.getAllLayers=function(t){t=t||[];for(var i=this.getSortedLayers(),s=0;s<i.length;s++)t.push(i[s]),i[s].container!==o&&i[s].container.getAllLayers(t);return t},t.prototype.getData=function(t){t=f({layersIncluded:!0,itemsIncluded:!0},t);var i=[],s=this.getSortedLayers();if("slide"===this.component.type)for(var n=s.length-1;n>=0;n--)i.push(s[n].getData(t));else for(n=0;n<s.length;n++)i.push(s[n].getData(t));return i},t.prototype.getHTML=function(t){for(var i=this.getSortedLayers(),s=[],n=0;n<i.length;n++)s.push(i[n].getHTML(t));return s},t.prototype.getDroppables=function(t){for(var i=[],s=this.getSortedLayers(),n=0;n<s.length;n++)if(s[n]!==t){var h=s[n].getDroppable();"object"==typeof h&&i.push(h),"hidden"!==h&&s[n].container&&i.push.apply(i,s[n].container.getDroppables(t))}return i},t.prototype.getLLDroppables=function(t){var i=[],s=this.component.getLLDroppable(t);s&&i.push(s);for(var n=this.getSortedLayers(),h=0;h<n.length;h++)n[h].container&&n[h]!==t&&i.push.apply(i,n[h].container.getLLDroppables(t));return i},t})),c.d("EditorContextualBarAbstract","$",(function(){var $=c.$;function t(t){this.interactionManager=t,this.forceEnabledCounter=0,this.disabledCounter=1,this.component=!1,this.Xi=this.Xi.bind(this),this.$contextual=$('<div class="n2_layer_contextual"></div>').on({contextmenu:this.interactionManager.handleContextMenu.bind(this.interactionManager)}).appendTo(this.interactionManager.$containerInner);var i=$('<div class="n2_layer_contextual__inner"></div>').appendTo(this.$contextual);this.$contextualLabel=$('<div class="n2_layer_contextual__label"></i></div>').appendTo(i),this.$buttonResponsiveTools=$('<div class="n2_layer_contextual__button n2_layer_contextual__button--responsive-tools"><i class="ssi_16 ssi_16--fontresize"></i></div>').appendTo(i),this.$buttonMore=$('<div class="n2_layer_contextual__button"><i class="ssi_16 ssi_16--more"></i></div>').appendTo(i)}return t.prototype.enableActiveForced=function(){this.forceEnabledCounter++,this._enable()},t.prototype.disableActiveForced=function(){this.forceEnabledCounter=Math.max(0,this.forceEnabledCounter-1),this._disable()},t.prototype.disable=function(){this.disabledCounter++,this._disable()},t.prototype._disable=function(){0===this.forceEnabledCounter&&1===this.disabledCounter&&this.blurComponent()},t.prototype.enable=function(){this.disabledCounter=Math.max(0,this.disabledCounter-1),this._enable()},t.prototype._enable=function(){(this.forceEnabledCounter>0||0===this.disabledCounter)&&this.focusComponent()},t.prototype.refreshPosition=function(){(this.interactionManager.isHover&&0===this.disabledCounter||this.forceEnabledCounter>0)&&this.positionBar()},t.prototype.positionBar=function(){this.Xi(),c.i.add(this.Xi)},t.prototype.Xi=function(){if(this.component&&!this.component.isDeleted){var t=this.component.layer[0].getBoundingClientRect(),i={top:t.top-this.interactionManager.innerOffset.top+"px"};parseInt(i.top)<28?(i.top=parseInt(i.top)+28+"px",this.$contextual.addClass("n2_layer_contextual--invert")):this.$contextual.removeClass("n2_layer_contextual--invert"),"left"===this.component.contextualBarPosition?i.left=t.left-this.interactionManager.innerOffset.left+"px":"center"===this.component.contextualBarPosition&&(i.left=Math.floor(t.left-this.interactionManager.innerOffset.left+t.width/2-this.$contextual.width()/2)+"px"),this.$contextual.css(i)}c.i.remove(this.Xi)},t.prototype.onProxyMouseDown=function(e){this.component&&(e=e.originalEvent,this.component.layer[0].dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,button:e.button,buttons:e.buttons})))},t})),c.d("EditorContextualBarActive",["$","EditorContextualBarAbstract"],(function(){"use strict";function t(t){this.contextualMenuActive=!1,this.responsiveToolsActive=!1,c.EditorContextualBarAbstract.prototype.constructor.call(this,t),this.$contextual.addClass("n2_layer_contextual--active").on("mousedown",this.onProxyMouseDown.bind(this)),this.$contextualLabel.on("click",this.actionDisplayLayerWindow.bind(this)),this.$buttonResponsiveTools.on("click",this.actionResponsiveTools.bind(this)),this.$buttonMore.on("click",this.actionContextualMenu.bind(this))}return t.prototype=Object.create(c.EditorContextualBarAbstract.prototype),t.prototype.constructor=t,t.prototype.changeActiveComponent=function(t){this.blurComponent(),this.component=t,this.$contextualLabel.text(this.component.getUILabel()),this.$contextual.data("layerObject",this.component).toggleClass("n2_layer_contextual--has-responsive-tools",this.component.hasResponsiveTools()),this.focusComponent(),this.component.hasResponsiveTools()&&this.responsiveToolsActive&&this.showResponsiveTools()},t.prototype.blurComponent=function(){this.component&&!this.component.isDeleteStarted&&(this.$contextual.removeClass("n2_layer_contextual--visible"),this.component.layer.removeClass("n2_layer_contextual_active_layer"),this.component.editorUI.normalSizing&&this.component.editorUI.normalSizing.removeClass("nui-enabled"),this.component.editorUI.margin&&this.component.editorUI.margin.removeClass("nui-enabled"),this.component.editorUI.padding&&this.component.editorUI.padding.removeClass("nui-enabled"),this.component.editorUI.absoluteCC&&this.component.editorUI.absoluteCC.removeClass("nui-enabled"),this.component.editorUI.resize&&this.component.editorUI.resize.removeClass("nui-enabled"),this.component.editorUI.columns&&this.component.editorUI.columns.hideHandles(),this.component.layer.off(".contextualBarActive"))},t.prototype.focusComponent=function(){if((0===this.disabledCounter||this.forceEnabledCounter>0)&&!this.component.isDeleted){this.positionBar();var t="blue";this.component.isAbsolute()&&(t="purple"),this.$contextual.attr("data-color",t).addClass("n2_layer_contextual--visible"),this.component.layer.addClass("n2_layer_contextual_active_layer"),this.component.editorUI.normalSizing&&this.component.editorUI.normalSizing.addClass("nui-enabled"),this.component.editorUI.margin&&this.component.editorUI.margin.addClass("nui-enabled"),this.component.editorUI.padding&&this.component.editorUI.padding.addClass("nui-enabled"),this.component.editorUI.absoluteCC&&this.component.editorUI.absoluteCC.addClass("nui-enabled"),this.component.editorUI.resize&&this.component.editorUI.resize.addClass("nui-enabled"),this.component.editorUI.columns&&this.component.editorUI.columns.showHandles(),this.component.layer.on({"LayerDeleted.contextualBarActive":this.onLayerDelete.bind(this),"interaction.contextualBarActive":this.onLayerChange.bind(this),"LayerShowChange.contextualBarActive":this.onLayerChange.bind(this)})}},t.prototype.onLayerDelete=function(){this.$contextual.removeClass("n2_layer_contextual--visible")},t.prototype.onLayerChange=function(){this.refreshPosition()},t.prototype.actionDisplayLayerWindow=function(){this.interactionManager.fragmentEditor.layerWindow.show(this.component)},t.prototype.actionResponsiveTools=function(){this.responsiveToolsActive?this.hideResponsiveTools():this.showResponsiveTools()},t.prototype.showResponsiveTools=function(){this.hideResponsiveToolsTimeout&&a(this.hideResponsiveToolsTimeout),this.$buttonResponsiveTools.hasClass("n2_layer_contextual__button--active")||(this.responsiveToolsActive=!0,this.$buttonResponsiveTools.addClass("n2_layer_contextual__button--active"),this.component.onContextResponsiveTools(this.$contextual[0],function(){this.$buttonResponsiveTools.removeClass("n2_layer_contextual__button--active"),this.hideResponsiveToolsTimeout=r(this.hideResponsiveTools.bind(this),300)}.bind(this)))},t.prototype.hideResponsiveTools=function(){this.responsiveToolsActive=!1,this.$buttonResponsiveTools.removeClass("n2_layer_contextual__button--active")},t.prototype.actionContextualMenu=function(){this.contextualMenuActive?this.hideContextualMenu():this.showContextualMenu()},t.prototype.showContextualMenu=function(t){this.hideContextualMenuTimeout&&a(this.hideContextualMenuTimeout),!t&&this.$buttonMore.hasClass("n2_layer_contextual__button--active")||(this.contextualMenuActive=!0,this.$buttonMore.addClass("n2_layer_contextual__button--active"),this.component.onContextMenu(this.$contextual[0],{onClose:function(){this.hideContextualMenuTimeout=r(this.hideContextualMenu.bind(this),300)}.bind(this)}))},t.prototype.hideContextualMenu=function(){this.contextualMenuActive=!1,this.$buttonMore.removeClass("n2_layer_contextual__button--active")},t})),c.d("EditorContextualBarHoverSection",["$","EditorContextualBarHover"],(function(){var $=c.$;function t(t){c.EditorContextualBarHover.prototype.constructor.call(this,t),this.$contextual.addClass("n2_layer_contextual--hover-section")}return t.prototype=Object.create(c.EditorContextualBarHover.prototype),t.prototype.constructor=t,t.prototype.handleMouseOver=function(e){this.processHoveredElement(this.findRelatedSection(e.target))},t.prototype.processMouseCoordinates=function(t,i){this.processHoveredElement(this.findRelatedSection(s.elementFromPoint(t,i)))},t.prototype.findRelatedSection=function(t){var i,s,n=$(t);if("slide"===n.attr("data-sstype"))i=n;else if(!(i=n.closest('.n2-ss-layer[data-sstype="slide"]')).length)return(s=n.hasClass("n2_layer_contextual")?n:n.closest(".n2_layer_contextual")).length?this.findRelatedSection(s.data("layerObject").layer[0]):!!this.component&&this.component;return i!==o&&i.data("layerObject")},t.prototype.blurComponent=function(){this.$contextual.removeClass("n2_layer_contextual--visible")},t.prototype.focusComponent=function(){0===this.disabledCounter&&this.component&&(this.positionBar(),this.refreshActiveState(),this.$contextual.attr("data-color","grey").addClass("n2_layer_contextual--visible"))},t})),c.d("EditorContextualBarHover",["$","EditorContextualBarAbstract"],(function(){"use strict";function t(t){this.namespace=this.namespace||"contextualBarHover",c.EditorContextualBarAbstract.prototype.constructor.call(this,t),this.$contextual.addClass("n2_layer_contextual--hover").on("mousedown",this.onProxyMouseDown.bind(this)),this.$contextualLabel.on("click",this.actionActivate.bind(this)),this.$buttonResponsiveTools.on("click",this.actionActivateWithResponsiveTools.bind(this)),this.$buttonMore.on("click",this.actionActivateWithContextualMenu.bind(this)),this.interactionManager.$container[0].addEventListener("mouseover",this.handleMouseOver.bind(this),{passive:!0,capture:!0})}return t.prototype=Object.create(c.EditorContextualBarAbstract.prototype),t.prototype.constructor=t,t.prototype.handleMouseOver=function(e){this.processHoveredElement(this.interactionManager.findRelatedComponent(e.target))},t.prototype.processMouseCoordinates=function(t,i){this.processHoveredElement(this.interactionManager.findRelatedComponent(s.elementFromPoint(t,i)))},t.prototype.processHoveredElement=function(t){t!==this.component&&(this.blurComponent(),this.component=t,this.component&&(this.$contextualLabel.text(this.component.getUILabel()),this.$contextual.data("layerObject",this.component).toggleClass("n2_layer_contextual--has-responsive-tools",this.component.hasResponsiveTools()),this.focusComponent()))},t.prototype.blurComponent=function(){this.$contextual.removeClass("n2_layer_contextual--visible"),this.component&&!this.component.isDeleteStarted&&(this.component.layer.removeClass("n2_layer_contextual_hover_layer"),this.component.layer.off("interaction."+this.namespace),this.component.markOut())},t.prototype.focusComponent=function(){if((0===this.disabledCounter||this.forceEnabledCounter>0)&&this.component&&!this.component.isDeleted){this.positionBar(),this.refreshActiveState(),this.component.layer.addClass("n2_layer_contextual_hover_layer");var t="grey";this.component.isAbsolute()&&(t="purple"),this.$contextual.attr("data-color",t).addClass("n2_layer_contextual--visible"),this.component.layer.on("LayerDeleted."+this.namespace,this.onLayerDelete.bind(this)),this.component.layer.on("interaction."+this.namespace,this.onLayerInteraction.bind(this)),this.component.markOver()}},t.prototype.onLayerDelete=function(){this.$contextual.removeClass("n2_layer_contextual--visible")},t.prototype.onLayerInteraction=function(){this.refreshPosition()},t.prototype.actionActivate=function(e){this.component.activate(e)},t.prototype.actionActivateWithResponsiveTools=function(e){this.component.activate(!1),this.interactionManager.contextualBarActive.showResponsiveTools()},t.prototype.actionActivateWithContextualMenu=function(e){this.interactionManager.contextualBarActive.responsiveToolsActive&&this.interactionManager.contextualBarActive.hideResponsiveTools(),this.component.activate(!1),this.interactionManager.contextualBarActive.showContextualMenu(!0)},t.prototype.refreshActiveState=function(){this.$contextual.toggleClass("n2_layer_contextual--hover-active",this.interactionManager.activeComponent===this.component)},t})),c.d("LayerDataStorage",(function(){"use strict";function t(){this.isDeviceProp={},this.propertyScope={},this.property={},this.deviceProperty={desktopPortrait:{},desktopLandscape:{},tabletPortrait:{},tabletLandscape:{},mobilePortrait:{},mobileLandscape:{}},this.advancedProperties={}}return t.prototype.getMode=function(){return this.fragmentEditor.getMode()},t.prototype.getProperties=function(){var t={};for(var i in this.property)if(this.advancedProperties[i]!==o){if(i===this.advancedProperties[i].getName()){var s=this.property[i],n=this.advancedProperties[i].getBaseName();this.property[i]===o&&(s=this.property[n]),t[n]=s}}else t[i]=this.property[i];return t},t.prototype.getRawProperty=function(t){if(this.isDeviceProp[t]){var i=this.getMode(),s=this.deviceProperty[i];return s[t]!==o?s[t]:o}return this.property[t]},t.prototype.getProperty=function(t){if(this.isDeviceProp[t]){var i=this.getMode(),s=this.deviceProperty[i],n=this.deviceProperty.desktopPortrait;if(s[t]!==o)return s[t];if(n[t]!==o)return n[t]}return this.property[t]},t.prototype.historyStore=function(t,i,s){this.isDeleteStarted||(this.store(s,i,t,!0,"history"),this.isDeviceProp[i]&&s!==this.getMode()||this.$.trigger("propertyChanged",[i,this.getProperty(i)]))},t.prototype.store=function(t,i,s,n,h){var o,r;t=t||this.getMode(),this.isDeviceProp[i]?(o=this.deviceProperty[t][i],r=this.getProperty(i)):r=o=this.property[i];var a=c.History.get().addValue(this,this.historyStore,[i,t]);a&&a.setValues(o,s),this.property[i]=s,this.isDeviceProp[i]&&(this.deviceProperty[t][i]=s),n&&this.render(i,r,h)},t.prototype.render=function(t,i,s){this.propertyScope[t]["_sync"+t]!==o&&this.propertyScope[t]["_sync"+t](i,s)},t.prototype.isDimensionPropertyAccepted=function(t){return(t+"").match(/[0-9]+%/)||"auto"===t},t.prototype.changeEditorMode=function(t){var i=parseInt(this.property[t]);this.layer.triggerHandler("LayerShowChange",[t,i]),this.renderModeProperties(!1)},t.prototype.renderModeProperties=function(t){for(var i in this.isDeviceProp)this.isDeviceProp[i]&&(this.property[i]=this.getProperty(i),this.$.trigger("propertyChanged",[i,this.property[i]]))},t.prototype.historyResetMode=function(t,i){this.deviceProperty[i]=f({},t),i===this.fragmentEditor.getMode()&&this.renderModeProperties(!0)},t.prototype.resetMode=function(t){if("desktopPortrait"!==t){var i=c.History.get().addValue(this,this.historyResetMode,[t]);for(var s in i&&i.setValues(f({},this.deviceProperty[t]),{}),this.deviceProperty[t])this.deviceProperty[t][s]=undefined;t===this.fragmentEditor.getMode()&&this.renderModeProperties(!0),this.animations&&this.animations.clearDeviceSpecific(t)}},t.prototype.copyMode=function(t,i){if(t!==i){var s=this.deviceProperty[i];this.deviceProperty[i]=f({},this.deviceProperty[i],this.deviceProperty[t]);var n=c.History.get().addValue(this,this.historyResetMode,[i]);n&&n.setValues(s,this.deviceProperty[i])}},t.prototype._getDefault=function(t,i){return this.originalProperties[t]!==o?this.originalProperties[t]:i},t.prototype.createProperty=function(t,i,s,n){this.isDeviceProp[t]=!1,this.propertyScope[t]=n||this,s?(this.property[t]=s.data(t.toLowerCase()),this.property[t]!==o&&null!==this.property[t]||(this.property[t]=this._getDefault(t,i))):this.property[t]=this._getDefault(t,i)},t.prototype.createAdvancedProperty=function(t,i,s){var n=t.getNames();for(var h in n)this.advancedProperties[h]=t,this.createProperty(h,n[h],i,s)},t.prototype.syncAdvancedField=function(t){var i=this.advancedProperties[t].getName(),s=this.property[i];this.property[i]===o&&(s=this.property[t]),this.fragmentEditor.layerOptions.updateField(i,s)},t.prototype.createDeviceProperty=function(t,i,s,n){var h,r;if(this.isDeviceProp[t]=!0,this.propertyScope[t]=n||this,s){for(h in this.deviceProperty)this.deviceProperty[h][t]=s.data(h.toLowerCase()+t.toLowerCase()),""===this.deviceProperty[h][t]&&(this.deviceProperty[h][t]=o);for(h in this.deviceProperty)this.deviceProperty[h][t]!==o&&""!==this.deviceProperty[h][t]||(r=this._getDefault(h.toLowerCase()+t.toLowerCase()))!==o&&(this.deviceProperty[h][t]=r);for(h in i)this.deviceProperty[h][t]!==o&&""!==this.deviceProperty[h][t]||(this.deviceProperty[h][t]=i[h])}else{for(h in i)this.deviceProperty[h][t]=i[h];for(h in this.deviceProperty)(r=this._getDefault(h.toLowerCase()+t.toLowerCase()))!==o&&(this.deviceProperty[h][t]=r)}this.property[t]=this.deviceProperty.desktopPortrait[t]},t.prototype.removeProperty=function(t){if(delete this.property[t],this.layer.removeData(t.toLowerCase()).removeAttr("data-"+t.toLowerCase()),this.isDeviceProp[t])for(var i in this.deviceProperty)delete this.deviceProperty[i][t],this.layer.removeData(i.toLowerCase()+t.toLowerCase()).removeAttr("data-"+i.toLowerCase()+t.toLowerCase());delete this.isDeviceProp[t],delete this.propertyScope[t]},t.prototype.removeProperties=function(t){for(var i=0;i<t.length;i++)this.removeProperty(t[i])},t.prototype.getPropertiesData=function(t){for(var i={},s=0;s<t.length;s++){var n=t[s];if(this.property[n]!==o&&(i[n]=this.property[n]),this.isDeviceProp[n])for(var h in this.deviceProperty)this.deviceProperty[h][n]!==o&&(i[h.toLowerCase()+n]=this.deviceProperty[h][n])}return i},t.prototype.setProperty=function(t,i,s){this.advancedProperties[t]!==o&&(t=this.advancedProperties[t].getName()),this.propertyScope[t]!==o?"function"==typeof this.propertyScope[t]["setProperty"+t]?this.propertyScope[t]["setProperty"+t](t,i,s):this._setProperty(t,i,s):"function"==typeof this["setProperty"+t]&&this["setProperty"+t](t,i,s)},t.prototype._setProperty=function(t,i,s){this.store(o,t,i,!0,s),"manager"!==s&&this.$.trigger("propertyChanged",[t,this.getProperty(t)])},t.prototype.onSyncFields=function(){},t.prototype.resetStyleMode=function(t){for(var i in this.advancedProperties)this.advancedProperties[i].resetMode(t)},t.prototype.outsideStoreProperty=function(t,i,s,n){this.store(t,i,s,!0,n),t!==o&&t!==this.getMode()||this.$.trigger("propertyChanged",[i,this.getProperty(i)])},t})),c.d("FragmentEditorHotkey","$",(function(){var $=c.$,t=16,n={97:"left",98:"center",99:"right",100:"left",101:"center",102:"right",103:"left",104:"center",105:"right"},h={97:"bottom",98:"bottom",99:"bottom",100:"middle",101:"middle",102:"middle",103:"top",104:"top",105:"top"};function r(t){this.fragmentEditor=t,this.keysPressed={},this.keyIntervals={},s.addEventListener("keydown",this.onKeyDown.bind(this),{capture:!0}),s.addEventListener("keyup",this.onKeyUp.bind(this),{capture:!0})}return r.prototype.onKeyDown=function(e){if(!e.defaultPrevented){var s,o=c.LayerNavigationTimeline.get();if(s=o.timelineControl&&o.timelineControl.isActivated(),"TEXTAREA"!==e.target.tagName&&"INPUT"!==e.target.tagName&&!e.target.isContentEditable&&!s&&"main"===c.WindowManager.getCurrentWindow()){var r=this.fragmentEditor.activeLayer,a=e.keyCode,l=!1;if(a>=49&&a<=57)3===(e.location||e.keyLocation||0)&&(a+=48);if(e.shiftKey&&!e.ctrlKey&&!e.metaKey)if(69===a){var u=[];e.altKey?(u=["desktopLandscape","tabletLandscape","tabletPortrait","mobileLandscape","mobilePortrait"],c.Notification.success(n2_("Clear device specific settings")+" - "+n2_("Current layer, all devices"))):(u.push(this.fragmentEditor.getMode()),c.Notification.success(n2_("Clear device specific settings")+" - "+n2_("Current layer, current device")));for(var d=0;d<u.length;d++)r.resetMode(u[d]);l=!0}else if(82===a){u=[];var f=this.fragmentEditor.mainContainer.container.getAllLayers();f.unshift(this.fragmentEditor.mainContainer),e.altKey?(u=["desktopLandscape","tabletLandscape","tabletPortrait","mobileLandscape","mobilePortrait"],c.Notification.success(n2_("Clear device specific settings")+" - "+n2_("All layers, all devices"))):(u.push(this.fragmentEditor.getMode()),c.Notification.success(n2_("Clear device specific settings")+" - "+n2_("All layers, current device")));for(var _=0;_<f.length;_++)for(d=0;d<u.length;d++)f[_].resetMode(u[d]);l=!0}if(e.ctrlKey||e.metaKey)if(90===a)e.shiftKey?c.History.get().redo()&&(l=!0):c.History.get().undo()&&(l=!0);else if(67===a)0===i.getSelection().toString().length&&(this.fragmentEditor.clipboard.copy(),l=!0);else if(86===a)this.fragmentEditor.clipboard.paste(),l=!0;else if(49===a)$("#n2-ss-preview").trigger("click"),l=!0;else if(50===a){var v=$('.n2_device_tester_devices__device[data-device="desktopPortrait"]');if(v.hasClass("n2_device_tester_devices__device--active")){var p=$('.n2_device_tester_devices__device[data-device="desktopLandscape"]');p.length&&p.trigger("click")}else v.trigger("click");l=!0}else if(51===a){var m=$('.n2_device_tester_devices__device[data-device="tabletPortrait"]');if(m.hasClass("n2_device_tester_devices__device--active")){var b=$('.n2_device_tester_devices__device[data-device="tabletLandscape"]');b.length&&b.trigger("click")}else m.trigger("click");l=!0}else if(52===a){var g=$('.n2_device_tester_devices__device[data-device="mobilePortrait"]');if(g.hasClass("n2_device_tester_devices__device--active")){var y=$('.n2_device_tester_devices__device[data-device="mobileLandscape"]');y.length&&y.trigger("click")}else g.trigger("click");l=!0}if(!l&&r)if(e.ctrlKey||e.metaKey)68===a&&(this.fragmentEditor.duplicate(),l=!0);else if(46===a||8===a)this.fragmentEditor.delete(),l=!0;else if(a===t)this.keysPressed[a]=1;else if(38===a)"absolute"===r.placement.getType()&&(this.keyIntervals[a]||(this.layerMoveUp(),this.keyIntervals[a]=setInterval(this.layerMoveUp.bind(this),100)),l=!0);else if(40===a)"absolute"===r.placement.getType()&&(this.keyIntervals[a]||(this.layerMoveDown(),this.keyIntervals[a]=setInterval(this.layerMoveDown.bind(this),100)),l=!0);else if(37===a)"absolute"===r.placement.getType()&&(this.keyIntervals[a]||(this.layerMoveLeft(),this.keyIntervals[a]=setInterval(this.layerMoveLeft.bind(this),100)),l=!0);else if(39===a)"absolute"===r.placement.getType()&&(this.keyIntervals[a]||(this.layerMoveRight(),this.keyIntervals[a]=setInterval(this.layerMoveRight.bind(this),100)),l=!0);else if(a>=97&&a<=105&&"absolute"===r.placement.getType()){var w=n[a],k=h[a],x=!1;this.fragmentEditor.layerOptions.forms.placement.absolute.align.val()===w&&this.fragmentEditor.layerOptions.forms.placement.absolute.valign.val()===k&&(x=!0),this.fragmentEditor.layerOptions.layerFeatures.horizontalAlign(w,x),this.fragmentEditor.layerOptions.layerFeatures.verticalAlign(k,x),l=!0}l||e.ctrlKey||e.metaKey||(81===a?this.fragmentEditor.addLayer.visible||(r.activate(!0),this.fragmentEditor.layerWindow.tab.displayTab("content"),l=!0):87===a?this.fragmentEditor.addLayer.visible||(r.activate(!0),this.fragmentEditor.layerWindow.tab.displayTab("style"),l=!0):69===a?this.fragmentEditor.addLayer.visible||(r.activate(!0),this.fragmentEditor.layerWindow.tab.displayTab("animations"),l=!0):65===a?(this.fragmentEditor.addLayer.toggleActive(),l=!0):83===a?this.fragmentEditor.addLayer.visible||(r.activate(!0),this.fragmentEditor.layerWindow.toggleLayerList(),l=!0):68===a&&(this.fragmentEditor.addLayer.visible||this.fragmentEditor.layerWindow.isLayerListAttached||(this.fragmentEditor.layerNavigation.toggleActive(),l=!0))),l&&e.preventDefault()}}},r.prototype.onKeyUp=function(e){this.keyIntervals[e.keyCode]!==o&&(clearInterval(this.keyIntervals[e.keyCode]),delete this.keyIntervals[e.keyCode]),e.keyCode===t&&this.keysPressed[16]!==o&&(this.keysPressed[16]=0)},r.prototype.layerMoveUp=function(){this.fragmentEditor.activeLayer.moveY(-1*(this.keysPressed[16]?10:1))},r.prototype.layerMoveDown=function(){this.fragmentEditor.activeLayer.moveY(this.keysPressed[16]?10:1)},r.prototype.layerMoveLeft=function(){this.fragmentEditor.activeLayer.moveX(-1*(this.keysPressed[16]?10:1))},r.prototype.layerMoveRight=function(){this.fragmentEditor.activeLayer.moveX(this.keysPressed[16]?10:1)},r})),c.d("EditorInteractionManager","$",(function(){var $=c.$;function t(t){this.fragmentEditor=t,this.isHover=!1,this.state={drag:!1},this.$container=$(".n2_admin_editor__content").on({click:this.handleMouseClick.bind(this)}),this.$containerInner=this.$container.find(".n2_slide_editor_slider__editor_inner").one("mouseover",this.mouseEnter.bind(this)).on({mouseenter:this.mouseEnter.bind(this),mouseleave:this.mouseLeave.bind(this),dblclick:this.handleDoubleClick.bind(this),contextmenu:this.handleContextMenu.bind(this)}),this.storeInnerOffset(),s.addEventListener("mousemove",this.onMouseMove.bind(this),{passive:!0,capture:!0}),this.contextualBarHoverSection=new c.EditorContextualBarHoverSection(this),this.contextualBarHover=new c.EditorContextualBarHover(this),this.contextualBarActive=new c.EditorContextualBarActive(this),i.addEventListener("resize",this.refreshPosition.bind(this),{passive:!0,capture:!0}),s.addEventListener("scroll",this.refreshPosition.bind(this),{passive:!0,capture:!0}),s.addEventListener("EditorInvalidated",this.refreshPosition.bind(this)),V(this.fragmentEditor.editor.frontend.sliderElement,"SliderResize",this.refreshPosition.bind(this))}return t.prototype.changeActiveComponent=function(t){this.activeComponent=t,this.contextualBarActive.changeActiveComponent(t),this.contextualBarHoverSection.refreshActiveState(),this.contextualBarHover.refreshActiveState(),this.lastMouseMoveEvent!==o&&(this.contextualBarHoverSection.processMouseCoordinates(this.lastMouseMoveEvent.clientX,this.lastMouseMoveEvent.clientY),this.contextualBarHover.processMouseCoordinates(this.lastMouseMoveEvent.clientX,this.lastMouseMoveEvent.clientY))},t.prototype.onMouseMove=function(e){this.lastMouseMoveEvent=e},t.prototype.refreshPosition=function(){this.storeInnerOffset(),this.contextualBarActive.refreshPosition(),this.contextualBarHover.refreshPosition(),this.contextualBarHoverSection.refreshPosition()},t.prototype.mouseEnter=function(){this.isHover||(this.isHover=!0,this.enable(),this.syncHover())},t.prototype.mouseLeave=function(){this.isHover&&(this.isHover=!1,this.disable(),this.syncHover())},t.prototype.enable=function(){this.contextualBarHoverSection.enable(),this.contextualBarHover.enable(),this.contextualBarActive.enable()},t.prototype.disable=function(){this.contextualBarActive.disable(),this.contextualBarHover.disable(),this.contextualBarHoverSection.disable()},t.prototype.syncHover=function(){this.$container.toggleClass("n2_admin_editor__content--hover",this.isHover)},t.prototype.storeInnerOffset=function(){this.innerOffset=this.$containerInner[0].getBoundingClientRect()},t.prototype.handleMouseClick=function(e){if(!c.WindowManager.isActionPrevented("ComponentActivate")){var t=this.findRelatedComponent($(e.target));t?t.activate(e):this.fragmentEditor.layerWindow.requestHide()}},t.prototype.handleDoubleClick=function(e){var t=$(e.target);if(t.closest(".n2-ss-layer").length){var i=this.findRelatedComponent(t);i&&i===this.activeComponent&&this.activeComponent.doubleClick(e)}},t.prototype.handleContextMenu=function(e){var t=this.findRelatedComponent($(e.target));t&&(e.preventDefault(),t.onContextMenu(e))},t.prototype.findRelatedComponent=function(t){var i,s=$(t);return s.hasClass("n2-ss-layer")?i=s:(i=s.closest(".n2-ss-layer")).length||(i=s.hasClass("n2_layer_contextual")?s:s.closest(".n2_layer_contextual")),i!==o&&i.data("layerObject")},t})),c.d("FragmentClipboard","$",(function(){"use strict";function t(t){this.fragmentEditor=t}return t.prototype.copy=function(){var t=this.fragmentEditor.activeLayer;this.fragmentEditor.isSectionSlide(t)?this.sectionCopy():this.componentCopy(t)},t.prototype.paste=function(){var t=this.fragmentEditor.activeLayer;this.fragmentEditor.isSectionSlide(t)?this.sectionPaste():this.componentPaste(t)},t.prototype.sectionHasClipboard=function(){return!!localStorage.getItem("clipboardSection")},t.prototype.sectionCopy=function(){var t=this.fragmentEditor.getSectionData();localStorage.setItem("clipboardSection",JSON.stringify(t))},t.prototype.sectionPaste=function(){var t=localStorage.getItem("clipboardSection");t&&(t=JSON.parse(t),this.fragmentEditor.manipulator.sectionReplace(this.fragmentEditor.mainContainer,t))},t.prototype.componentHasClipboard=function(){return!!localStorage.getItem("clipboardLayers")},t.prototype.componentCopy=function(t){if(this.fragmentEditor.isSectionSlide(t))alert("copy section");else{var i;i=this.fragmentEditor.isCol(t)||this.fragmentEditor.isContent(t)?t.container.getSortedLayers():[t];var s=this.getComponentsData(i);s.length&&localStorage.setItem("clipboardLayers",JSON.stringify(s))}},t.prototype.componentPaste=function(t){var i=localStorage.getItem("clipboardLayers");if(i){var s=JSON.parse(i);if(s.length){var n,h=s[0].pm;"normal"===h?(n=t===o?this.fragmentEditor.mainContainer.getTargetGroupDefault():this.fragmentEditor.isCol(t)||this.fragmentEditor.isContent(t)?t:this.fragmentEditor.isRow(t)?t.container.getSortedLayers()[0]:"normal"===t.placement.getType()?t.group:this.fragmentEditor.mainContainer.getTargetGroupDefault(),this.fragmentEditor.manipulator.addLayers(s,n)):"absolute"===h&&(n=t===o?this.fragmentEditor.mainContainer.getTargetGroupAbsolute():t.container?t:t.group,this.fragmentEditor.manipulator.addLayers(s,n))}}},t.prototype.getComponentsData=function(t){if(t===o)return[];for(var i=[],s=[],n=0;n<t.length;n++)t[n].getDataWithChildren(i,s);return i},t})),c.d("FragmentEditor","$",(function(){var $=c.$;function t(t,i,n){this.mode="desktopPortrait",this.editor=t,this.$editedElement=i,this.ready=$.Deferred(),this.$=$(this),t.fragmentEditor=this,$(".n2_slide_editor_slider__editor").attr("dir",$("html").attr("dir")),this.qi=s.querySelector('style[data-related="n2-ss-0"]').sheet,this.addLayer=new c.AddLayer(this),this.layerWindow=new c.LayerWindow(this),this.layerOptions=new c.ComponentSettings(this),this.layerNavigation=new c.LayerNavigation(this),this.manipulator=new c.FragmentManipulator(this),this.clipboard=new c.FragmentClipboard(this),this.mainContainer=new c.SectionSlide(this),this.canvasUIManager=new c.UICanvas(this.mainContainer.layer,this),this.itemEditor=new c.ItemManager(this,n),this.mainContainer.lateInit(),this._initDeviceModeChange(),this.canvasSettings=new c.CanvasSettings(this),this.layerOptions.startFeatures(),this.pointerManager=new c.EditorInteractionManager(this),new c.FragmentEditorHotkey(this),this.mainContainer.activate(!0)}function i(t,s){for(var n=t.cssRules,h=n.length-1;h>=0;h--)n[h].selectorText&&n[h].selectorText.match(s)?t.deleteRule(h):n[h]instanceof CSSMediaRule&&i(n[h],s)}return t.prototype.getMode=function(){return this.mode},t.prototype.getResponsiveRatioHorizontal=function(){return this.editor.getHorizontalRatio()},t.prototype.getResponsiveRatioVertical=function(){return this.editor.getVerticalRatio()},t.prototype.isRow=function(t){return t instanceof c.Row},t.prototype.isCol=function(t){return t instanceof c.Col},t.prototype.isLayer=function(t){return t instanceof c.Layer},t.prototype.isContent=function(t){return t instanceof c.Content},t.prototype.isSectionSlide=function(t){return t instanceof c.SectionSlide},t.prototype._initDeviceModeChange=function(){$("#layer-clear-device-specific-changes, #layer-slide-clear-device-specific-changes").on("click",this.onClearDeviceSpecificChanges.bind(this));var t=this.editor.getAvailableDeviceModes();$("#layerslide-show").data("field").setAvailableDevices(t),$("#layershow").data("field").setAvailableDevices(t),this.refreshMode(),this.ready.resolve()},t.prototype.refreshMode=function(){this.mode=this.editor.getDeviceMode(),this.mainContainer.changeEditorMode(this.mode)},t.prototype.onChangeDeviceOrientation=function(){this.refreshMode()},t.prototype.onResize=function(t){this.mainContainer.onResize(t),this.canvasSettings.ruler&&this.canvasSettings.ruler.onResize()},t.prototype.onClearDeviceSpecificChanges=function(){if(this.activeLayer){var t=this.getMode();this.activeLayer.resetMode(t)}},t.prototype.copyOrResetMode=function(t){var i=this.getMode();"desktopPortrait"===i?"desktopPortrait"!==t&&this.mainContainer.container.resetModes(t):t===i?this.mainContainer.container.resetModes(t):this.mainContainer.container.copyModes(i,t)},t.prototype.getSnap=function(t,i){var s=$();if(this.canvasSettings.get("n2-ss-snap-to-enabled")){this.mainContainer===t&&(s=s.add(".n2-ruler-user-guide"));for(var n=t.container.getSortedLayers(),h=0;h<n.length;h++)"absolute"===n[h].placement.getType()&&(s=s.add(n[h].layer))}return s.filter(":visible").not(i.layer)},t.prototype.getHTML=function(){for(var t=$("<div></div>"),i=this.mainContainer.container.getAllLayers(),s=0;s<i.length;s++)t.append(i[s].getHTML(!0));return t.html()},t.prototype.getData=function(){return this.mainContainer.getData()},t.prototype.getSectionData=function(){return this.mainContainer.getSectionData()},t.prototype.loadComponentWithNode=function(t,i,s,n){var h=t.container.append(i);return n&&this.refreshMode(),h},t.prototype.insertComponentWithNode=function(t,i,s,n,h){var o=t.container.insertAt(i,s);return h&&this.refreshMode(),o},t.prototype.resetActiveLayer=function(){var t=this.mainContainer.container.getSortedLayers();t.length&&t[t.length-1].activate()},t.prototype.changeActiveLayer=function(t){var i=this.activeLayer;i&&!i.isDeleted&&(i.$.off("propertyChanged.editor").off(".active"),i.deActivate()),this.activeLayer=t,c._activeLayer=t,t&&(this.pointerManager.changeActiveComponent(t),this.layerOptions.changeActiveComponent(t,t.type,t.getSubType(),t.placement.getType(),t.getProperties()),t.$.on({"propertyChanged.editor":this.layerOptions.onUpdateField.bind(this.layerOptions),"placementChanged.active":function(e,i,s){this.layerOptions.changeActiveComponentPlacement(i,t.property)}.bind(this)})),this.$.trigger("activeLayerChanged")},t.prototype.getActiveLayer=function(){return this.activeLayer},t.prototype.highlight=function(t){this.pointerManager.contextualBarHover.enableActiveForced(),this.pointerManager.contextualBarHover.processHoveredElement(t),this.hoverZIndexInterval&&clearInterval(this.hoverZIndexInterval),this.hoverZIndexInterval=setInterval(function(){this.toggleClass("n2_layer_layer_list_hover--force-zindex")}.bind(t.layer),800)},t.prototype.deHighlight=function(t){this.pointerManager.contextualBarHover.disableActiveForced(),this.hoverZIndexInterval&&clearInterval(this.hoverZIndexInterval),t.isDeleted||t.layer.removeClass("n2_layer_layer_list_hover--force-zindex")},t.prototype.delete=function(){this.activeLayer.delete()},t.prototype.duplicate=function(){this.activeLayer.duplicate(!0)},t.prototype.getSelf=function(){return this},t.prototype.removeRules=function(t){i(this.qi,t)},t})),c.d("FragmentManipulator","$",(function(){var $=c.$;function t(t){this.fragmentEditor=t}return t.prototype.deleteLayers=function(){for(var t=this.fragmentEditor.mainContainer.container.getSortedLayers(),i=0;i<t.length;i++)t[i].delete()},t.prototype.sectionReplace=function(t,i){this._idTranslation={};var s=_({},i),n=t.container,h=this.dataToLayers(_([],s.layers).reverse()),r=[];this.deleteLayers(),t.mainContent.remove();for(var a=0;a<h.length;a++)r.push(n.append(h[a]));c.History.get().startBatch();var l={};for(var u in t.removeProperty("padding"),t.createDeviceProperty("padding",{desktopPortrait:"10|*|10|*|10|*|10"}),t.deviceProperty)for(var d in t.isDeviceProp)if(t.isDeviceProp[d]){var f=u.toLowerCase()+d;s[f]!==o?(l[d]=!0,t.outsideStoreProperty(u,d,s[f],!0,"sectionReplace"),delete s[f]):!0===l[d]&&t.outsideStoreProperty(u,d,o,!0,"sectionReplace")}for(var v in t.property)s[v]!==o&&(t.outsideStoreProperty(o,v,s[v],!0,"sectionReplace"),delete s[v]);return c.History.get().addSimple(this,this.historyDeleteAll,this.historyReplaceLayers,[t,s,r,n.getAllLayers()]),c.History.get().endBatch(),this.fragmentEditor.refreshMode(),c.ImagesLoaded(n.layerContainerElement[0]).finally(this.fragmentEditor.refreshMode.bind(this.fragmentEditor)),this.fragmentEditor.getActiveLayer()||r.length>0&&r[0].activate(),r},t.prototype.historyDeleteAll=function(t,i,s){for(var n=0;n<s.length;n++)s[n].getSelf().delete();t.mainContent.getSelf().remove()},t.prototype.historyReplaceLayers=function(t,i,s,n){this.sectionReplace(t,i);for(var h=t.container.getAllLayers(),o=0;o<n.length;o++)n[o].setSelf(h[o])},t.prototype.addLayers=function(t,i){this._idTranslation={};for(var s=this.dataToLayers(_([],t)),n=[],h=0;h<s.length;h++)n.push(i.container.append(s[h]));return this.fragmentEditor.refreshMode(),c.History.get().addSimple(this,this.historyDeleteLayers,this.historyAddLayers,[t,n,i]),n},t.prototype.historyDeleteLayers=function(t,i,s){for(var n=0;n<i.length;n++)i[n].getSelf().delete()},t.prototype.historyAddLayers=function(t,i,s){for(var n=this.addLayers(t,s.getSelf()),h=0;h<i.length;h++)i[h].setSelf(n[h])},t.prototype.dataToLayers=function(t,i){for(var s=[],n=0;n<t.length;n++)switch(t[n].type){case"row":s.push(this.buildRowNode(t[n],i));break;case"col":s.push(this.buildColNode(t[n],i));break;case"content":s.push(this.buildContentNode(t[n],i));break;case"layer":default:s.push(this.buildLayerNode(t[n],i))}return s},t.prototype._buildNodePrepareID=function(t,i){if(i.id){var s=$.fn.uid(),n=!1;"object"==typeof this._idTranslation[i.id]&&(n=this._idTranslation[i.id]),this._idTranslation[i.id]=s,i.id=s,t.attr("id",s),n&&n.resolve(i.id,s)}if(i.parentid)switch(typeof this._idTranslation[i.parentid]){case"string":i.parentid=this._idTranslation[i.parentid];break;case"undefined":this._idTranslation[i.parentid]=$.Deferred();case"object":this._idTranslation[i.parentid].done(function(t,i,s){t.data("parentid",s)}.bind(this,t));break;default:i.parentid=""}},t.prototype._buildNodeAnimations=function(t){"object"==typeof t.animations&&(t.animations=JSON.stringify(t.animations))},t.prototype.buildContentNode=function(t,i){var s=$("<div class='n2-ss-layer' data-sstype='content'></div>"),n=$("<div class='n2-ss-section-main-content n2-ss-layer-with-background n2-ss-layer-content'></div>").appendTo(s);for(var h in this._buildNodeAnimations(t),t)s.data(h,t[h]);return i!==o&&s.appendTo(i),this.dataToLayers(t.layers,n),s},t.prototype.buildRowNode=function(t,i){var s=$("<div class='n2-ss-layer' data-sstype='row'></div>"),n=$("<div class='n2-ss-layer-row n2-ss-layer-with-background'></div>").appendTo(s);for(var h in this._buildNodePrepareID(s,t),this._buildNodeAnimations(t),t)s.data(h,t[h]);return i!==o&&s.appendTo(i),this.dataToLayers(t.cols,n),s},t.prototype.buildColNode=function(t,i){var s=$("<div class='n2-ss-layer' data-sstype='col'></div>"),n=$("<div class='n2-ss-layer-col n2-ss-layer-with-background n2-ss-layer-content'></div>").appendTo(s);for(var h in this._buildNodeAnimations(t),t)s.data(h,t[h]);return i!==o&&s.appendTo(i),this.dataToLayers(t.layers,n),s},t.prototype.buildLayerNode=function(t,i){var s=$("<div class='n2-ss-layer' data-sstype='layer'></div>").attr("style",t.style);for(var n in this._buildNodePrepareID(s,t),t.items!==o&&(t.item=t.items[0],delete t.items),$('<div class="n2-ss-item n2-ss-item-'+t.item.type+'"></div>').data("item",t.item.type).data("itemvalues",t.item.values).appendTo(s),delete t.style,delete t.item,this._buildNodeAnimations(t),t)s.data(n,t[n]);return i!==o&&s.appendTo(i),s},t.prototype.getSelf=function(){return this},t})),c.d("AddLayer","$",(function(){var $=c.$;function t(t){this.fragmentEditor=t,this.sectionLibraryFree=t.editor.options.sectionLibraryFree,this.sectionLibraryUrl=t.editor.options.sectionLibraryUrl,this.sectionLibraryGoProUrl=t.editor.options.sectionLibraryGoProUrl;try{localStorage.removeItem("SectionFreeThemeorion_dark"),localStorage.removeItem("SectionFreeThemeorion_darkMetaDate"),localStorage.removeItem("SectionFreeThemeorion_light"),localStorage.removeItem("SectionFreeThemeorion_lightMetaDate"),localStorage.removeItem("SectionFreeThemes"),localStorage.removeItem("SectionFreeThemesMetaDate"),localStorage.removeItem("SectionProThemeorion_dark"),localStorage.removeItem("SectionProThemeorion_darkMetaDate"),localStorage.removeItem("SectionProThemeorion_light"),localStorage.removeItem("SectionProThemeorion_lightMetaDate"),localStorage.removeItem("SectionProThemes"),localStorage.removeItem("SectionProThemesMetaDate")}catch(t){}this.visible=!1,this.$editor=$(".n2_admin_editor"),this.$editorOverlay=$(".n2_admin_editor_overlay"),this.$addLayer=$(".n2_add_layer"),$(".n2_add_layer__bar_button_add").on("click",function(e){e.preventDefault(),this.toggleActive()}.bind(this)),this.$addLayer.find(".n2_add_layer_box"),this.hideInteractionCallback=this.hideInteraction.bind(this),this.onKeyDownCallback=this.onKeyDown.bind(this),this.initTabs(),this.initPositionChanger()}return t.prototype.hide=function(){this.visible=!0,this.toggleActive()},t.prototype.hideInteraction=function(e){$.contains(this.$addLayer[0],e.target)||this.$addLayer.is(e.target)||this.hide()},t.prototype.onKeyDown=function(e){27===e.keyCode&&(e.stopImmediatePropagation(),e.preventDefault(),this.hide())},t.prototype.toggleActive=function(){this.visible=!this.visible,$("body").toggleClass("n2_body--show-add-more",this.visible),this.$editorOverlay.toggleClass("n2_admin_editor_overlay--show-add-more",this.visible),this.visible?(this.$editor[0].addEventListener("click",this.hideInteractionCallback,{capture:!0}),s.addEventListener("keydown",this.onKeyDownCallback,{capture:!0})):(this.$editor[0].removeEventListener("click",this.hideInteractionCallback,{capture:!0}),s.removeEventListener("keydown",this.onKeyDownCallback,{capture:!0}),this.setPosition("default"))},t.prototype.initTabs=function(){this.$buttons=$(".n2_add_layer__more_tab_button").on("click"),this.$tabs=$(".n2_add_layer__more_tab"),this.valuesDict={};for(var t=0;t<this.$buttons.length;t++){var i=this.$buttons.eq(t),s=i.data("related-tab");this.valuesDict[s]={index:t,$button:i,$tab:this.$tabs.filter('[data-tab="'+s+'"]')},i.on("click",this.displayTab.bind(this,s))}this.displayTab("layers")},t.prototype.displayTab=function(t,e){e&&e.preventDefault(),this.activeTabName!==t&&(this.activeTabName=t,this.$buttons.removeClass("n2_add_layer__more_tab_button--active"),this.$tabs.removeClass("n2_add_layer__more_tab--active"),this.valuesDict[t].$button.addClass("n2_add_layer__more_tab_button--active"),this.valuesDict[t].$tab.addClass("n2_add_layer__more_tab--active"),"library"===t&&this.initLibrary())},t.prototype.initPositionChanger=function(){this.currentPosition="default",this.$position=this.$addLayer.find(".n2_add_layer_position"),this.$position.find(".n2_add_layer_position__default_label").on("click",this.setPosition.bind(this,"default")),this.$position.find(".n2_add_layer_position__absolute_label").on("click",this.setPosition.bind(this,"absolute")),this.$position.find(".n2_add_layer_position__switch").on("click",this.togglePosition.bind(this))},t.prototype.setPosition=function(t){this.currentPosition=t,this.$position.attr("data-position",t)},t.prototype.togglePosition=function(){this.setPosition("default"===this.currentPosition?"absolute":"default")},t.prototype.getPosition=function(){return this.currentPosition},t.prototype.initLibrary=function(){this.initLibrary=function(){},this.activeThemeID=!1,this.themes={},this.$themesTitle=$('<div class="n2_add_layer_library__title"></div>').appendTo(this.valuesDict.library.$tab),$('<div class="n2_add_layer_library__title_label"></div>').text(n2_("Theme")).appendTo(this.$themesTitle),this.displayThemes()},t.prototype.displayThemes=function(){c.AjaxHelper.ajax({type:"GET",url:this.sectionLibraryUrl+"/themes/",dataType:"json"}).done(function(t){this.onThemesLoaded(t.themes)}.bind(this))},t.prototype.onThemesLoaded=function(t){for(var i=$('<div class="n2_field_select"></div>').appendTo(this.$themesTitle),s=$('<select name="library-theme" autocomplete="off"></select>').appendTo(i),n=0;n<t.length;n++)s.append('<option value="'+t[n].id+'">'+t[n].label+"</option>");this.displayTheme(t[0].id),s.on("change",function(){this.displayTheme(s.val())}.bind(this))},t.prototype.displayTheme=function(t){this.activeThemeID!==t&&(this.activeThemeID&&this.themes[this.activeThemeID].removeClass("n2_add_layer_library__theme--active"),this.activeThemeID=t,this.themes[t]===o?c.AjaxHelper.ajax({type:"GET",url:this.sectionLibraryUrl+"/theme/"+t,dataType:"json"}).done(function(t,i){this.onThemeLoaded(i.theme)}.bind(this,t)):this.themes[t].addClass("n2_add_layer_library__theme--active"))},t.prototype.onThemeLoaded=function(t){if(function(t,i){t=t.split("."),i=i.split(".");for(var s=Math.min(t.length,i.length),n=0;n<s;++n){if(t[n]=parseInt(t[n],10),i[n]=parseInt(i[n],10),t[n]>i[n])return!0;if(t[n]<i[n])return!1}return t.length===i.length||t.length>=i.length}(N2SS3VERSION,t.version)){var i=$('<div class="n2_add_layer_library__theme n2_add_layer_library__theme--active"></div>').appendTo(this.valuesDict.library.$tab);this.themes[t.id]=i;for(var s=0;s<t.categories.length;s++){var n=t.categories[s],h=$('<div class="n2_add_layer_library_tag"></div>').appendTo(i),o=$('<div class="n2_add_layer_library_tag__title"></div>').on("click",function(t){t.toggleClass("n2_add_layer_library_tag--active")}.bind(this,h)).appendTo(h);$('<div class="n2_add_layer_library_tag__title_label"></div>').text(n.label).appendTo(o),$('<div class="n2_add_layer_library_tag__title_opener"><i class="ssi_16 ssi_16--buttonarrow"></i></div>').appendTo(o);for(var r=$('<div class="n2_add_layer_library_tag__sections"></div>').appendTo(h),a=0;a<n.sections.length;a++){var l=n.sections[a],u=$('<div class="n2_add_layer_library_tag__section"><img src="'+l.thumbnail+'" alt=""></div>').appendTo(r);l.isPro&&u.append('<div class="n2_add_layer_library_tag__section_pro">Pro</div>'),!l.isPro||l.isPro&&!this.sectionLibraryFree?u.addClass("n2_add_layer_library_tag__section--available").on("click",this.insertSection.bind(this,l.data)):u.append('<div class="n2_add_layer_library_tag__section_overlay"><div>'+n2_("This section requires activated Pro version.")+"</div></div>")}}}else this.activeThemeID=!1,c.Notification.error(n2_sprintf(n2_("%s or newer required for this feature."),"Smart Slider "+t.version))},t.prototype.insertSection=function(t){this.fragmentEditor.manipulator.sectionReplace(this.fragmentEditor.mainContainer,t)},t})),c.d("LayerFeatures","$",(function(){"use strict";var t={left:0,center:1,right:2,top:0,middle:1,bottom:2};function i(t,i){this.fields=t,this.fragmentEditor=i,this.layerDefault={align:null,valign:null}}return i.prototype.horizontalAlign=function(i,s){this.fields.align.val()!=i?this.fields.align.data("field").options.eq(t[i]).trigger("click"):s&&this.fields.left.val(0).trigger("change"),c._activeLayer.layer.trigger("interaction")},i.prototype.verticalAlign=function(i,s){this.fields.valign.val()!=i?this.fields.valign.data("field").options.eq(t[i]).trigger("click"):s&&this.fields.top.val(0).trigger("change"),c._activeLayer.layer.trigger("interaction")},i})),c.d("LayerNavigation","$",(function(){var $=c.$,t=33;function s(t){this.fragmentEditor=t,this.forceOpened=[],this.scrollBarHeight=0,this.visible=!1,this.tlHeight=parseInt(localStorage.getItem("ssLayersHeight")||200),this.$editorContent=$(".n2_admin_editor__content"),this.$editorOverlay=$(".n2_admin_editor_overlay"),this.$layerNavigation=this.$container=$('<div class="n2_layer_navigation" dir="ltr"></div>').appendTo(this.$editorOverlay),this.$scrollPanes=$('<div class="n2_layer_navigation_list"></div>').appendTo(this.$layerNavigation);var i=$('<div class="n2_layer_navigation_list_title"></div>').appendTo(this.$scrollPanes);$('<div class="n2_layer_navigation_list_title__hide n2_slide_editor_timeline_toggle n2_slide_editor_timeline_toggle--hide"><i class="ssi_16 ssi_16--remove"></i></div>').appendTo(i),$(".n2_slide_editor_timeline_toggle ").on("click",function(e){e.preventDefault(),this.toggleActive()}.bind(this)),$('<div class="n2_layer_navigation_list_title__label">'+n2_("Timeline")+"</div>").appendTo(i),this.$layerListContainer=$('<div class="n2_layer_navigation_list_layers"></div>').appendTo(this.$scrollPanes),this.layerNavigationTimeline=new c.LayerNavigationTimeline(t,this),this.fixScroll(),this.topBar=$(".n2_layer_navigation_list_title"),$(".n2_layer_navigation_list_title__label").on("mousedown",this.resizeStart.bind(this)),"1"===localStorage.getItem("ssLayersShown")&&this.show(),this.interaction=new c.LayerNavigationInteraction(this,this.fragmentEditor,this.$layerNavigation)}return s.prototype.onAttach=function(t){this.attachedToLayerWindow=t,this.scrollToActiveLayer()},s.prototype.onDetach=function(){delete this.attachedToLayerWindow,this.scrollToActiveLayer()},s.prototype.addScrollPane=function(t){this.$scrollPanes=this.$scrollPanes.add(t)},s.prototype.setScrollTop=function(t){this.$scrollPanes.each((function(){this.scrollTop=t}))},s.prototype.scrollToActiveLayer=function(){this.onActivateLayer(this.fragmentEditor.activeLayer)},s.prototype.onActivateLayer=function(t){if(this.forceOpened.length)for(var i=0;i<this.forceOpened.length;i++)this.forceOpened[i].removeForceOpen();this.forceOpened=[];for(var s=t.group;s;)"row"!==s.type&&"col"!==s.type&&"content"!==s.type||(this.forceOpened.push(s),s.forceOpen()),s=s.group;var n=this.$scrollPanes.scrollTop(),h=0,o=t;do{h+=o.layerRow.get(0).offsetTop,o=o.group}while(o);(h<n||h>n+this.$scrollPanes.height()-66-this.scrollBarHeight)&&this.setScrollTop(h)},s.prototype.fixScroll=function(){this.scrollBarHeight>0&&this.$layerListContainer.css("padding-bottom",this.scrollBarHeight+"px"),this.$scrollPanes.on({wheel:this.onWheel.bind(this),scroll:this.onScroll.bind(this)})},s.prototype.onScroll=function(e){e.preventDefault(),this.setScrollTop($(e.currentTarget).scrollTop())},s.prototype.onWheel=function(e){if(!e.shiftKey){e.preventDefault();var i=this.$scrollPanes.scrollTop();e.originalEvent.deltaY>0?i+=t:i-=t,i=Math.round(i/t)*t,this.setScrollTop(i)}},s.prototype.resizeStart=function(e){e.preventDefault(),this.startY=e.clientY,this.height=this.$layerNavigation.height(),$("body").on({"mousemove.n2-ss-tl-resize":this.resizeMove.bind(this),"mouseup.n2-ss-tl-resize":this.resizeStop.bind(this),"mouseleave.n2-ss-tl-resize":this.resizeStop.bind(this)})},s.prototype.resizeMove=function(e){e.preventDefault(),this.setLayerNavigationHeight(this._calculateDesiredHeight(e))},s.prototype.resizeStop=function(e){e.preventDefault(),$("body").off(".n2-ss-tl-resize");var t=this._calculateDesiredHeight(e);this.setLayerNavigationHeight(t),this.tlHeight=t,localStorage.setItem("ssLayersHeight",t+""),$("#n2-admin").triggerHandler("resize")},s.prototype._calculateDesiredHeight=function(e){var t=this.startY-e.clientY+this.height-24;return this.__calculateDesiredHeight(t)},s.prototype.__calculateDesiredHeight=function(s){var n=Math.max(1,Math.round(Math.min(s,i.innerHeight/2)/t)-1);return this.scrollBarHeight+n*t+48},s.prototype.hide=function(){this.visible=!0,this.toggleActive()},s.prototype.show=function(){this.visible=!1,this.toggleActive()},s.prototype.toggleActive=function(){this.visible=!this.visible,this.$editorOverlay.toggleClass("n2_admin_editor_overlay--show-layer-navigation",this.visible),this.visible?(this.fragmentEditor.addLayer.hide(),this.setLayerNavigationHeight(this.tlHeight)):this.$editorContent.css("paddingBottom","0"),localStorage.setItem("ssLayersShown",this.visible?"1":"0")},s.prototype.setLayerNavigationHeight=function(t){t=Math.max(48,t),this.$layerNavigation.height(t+"px"),this.$editorContent.css("paddingBottom",t+"px"),this.layerNavigationTimeline!==o&&this.layerNavigationTimeline.onResize(),c._triggerResize()},s})),c.d("LayerNavigationInteraction","$",(function(){var $=c.$;function t(t,i,s){this.hoveredComponent=!1,this.layerNavigation=t,this.fragmentEditor=i,this.$container=s.on({click:this.handleMouseClick.bind(this),mouseleave:this.handleMouseLeave.bind(this),contextmenu:this.handleContextMenu.bind(this)}),s[0].addEventListener("mouseover",this.handleMouseOver.bind(this),{passive:!0,capture:!0})}return t.prototype.handleMouseClick=function(e){if(!c.WindowManager.isActionPrevented("ComponentRowActivate")){var t=this.findRelatedComponent(e.target);t&&(t.activate(e),this.detachFromLayerWindow())}},t.prototype.detachFromLayerWindow=function(){this.layerNavigation.attachedToLayerWindow&&this.layerNavigation.attachedToLayerWindow.detachLayerList()},t.prototype.handleMouseLeave=function(){this.hoveredComponent&&(this.fragmentEditor.deHighlight(this.hoveredComponent),this.hoveredComponent=!1)},t.prototype.handleMouseOver=function(e){this.hoveredComponent&&this.fragmentEditor.deHighlight(this.hoveredComponent),this.hoveredComponent=this.findRelatedComponent(e.target),this.hoveredComponent&&this.fragmentEditor.highlight(this.hoveredComponent)},t.prototype.handleContextMenu=function(e){var t=this.findRelatedComponent(e.target);t&&(e.preventDefault(),t.onContextMenu(e))},t.prototype.findRelatedComponent=function(t){var i,s=$(t);if(s.hasClass("n2_layer_navigation_list_layer"))i=s;else if(!(i=s.closest(".n2_layer_navigation_list_layer")).length)if(s.hasClass("n2_timeline_layer__animations"))i=s;else if(!(i=s.closest(".n2_timeline_layer__animations")).length)return!1;return i.data("layer")},t})),c.d("LayerWindow","$",(function(){var $=c.$;function t(t){this.admin=$("#n2-admin"),this.$editorOverlay=$(".n2_admin_editor_overlay"),this.sidebar=$("#n2-ss-layer-window"),this.title=this.sidebar.find(".n2_ss_layer_window__title_inner"),this.$inner=this.sidebar.find(".n2_ss_layer_window__crop"),this.fragmentEditor=t,this.tab=new c.LayerWindowTab(this),this.initLayerList();var i=this.sidebar.find(".n2_ss_layer_window__title_nav_right");$('<div class="n2_ss_layer_window__title_nav_button"><i class="ssi_16 ssi_16--remove"></i></div>').on("click",function(e){this.hide()}.bind(this)).appendTo(i),new c.UILayerWindow(this.sidebar),this.initDeviceSwitcherShortcut()}return t.prototype.show=function(t){this.cancelHideRequest(),this.setTitle(t),$("body").addClass("n2_body--layer-window-visible")},t.prototype.requestHide=function(){this.cancelHideRequest(),this.hideRequestID=requestAnimationFrame(this.hide.bind(this))},t.prototype.cancelHideRequest=function(){this.hideRequestID!==o&&(cancelAnimationFrame(this.hideRequestID),delete this.hideRequestID)},t.prototype.hide=function(){delete this.hideRequestID,$("body").removeClass("n2_body--layer-window-visible")},t.prototype.setTitle=function(t){this.title.html(t.getName())},t.prototype.initLayerList=function(){this.isLayerListAttached=!1;var t=this.sidebar.find(".n2_ss_layer_window__title_nav_left");$('<div class="n2_ss_layer_window__title_nav_button n2_ss_layer_window__title_nav_button_layer_list"><i class="ssi_16 ssi_16--layer"></i></div>').attr("data-n2tip",n2_("Layer List")).on("click",this.toggleLayerList.bind(this)).appendTo(t),c._tooltip.add(t),this.detachLayerListClickCallback=this.detachLayerListClick.bind(this)},t.prototype.toggleLayerList=function(e){this.isLayerListAttached?this.detachLayerList():this.attachLayerList()},t.prototype.attachLayerList=function(){$("body").addClass("n2_body--attached-layer-list"),this.$editorOverlay.addClass("n2_admin_editor_overlay--attached-layer-list"),this.fragmentEditor.layerNavigation.$container.appendTo(this.$inner),this.fragmentEditor.layerNavigation.onAttach(this),s.addEventListener("click",this.detachLayerListClickCallback,{passive:!0,capture:!0}),this.isLayerListAttached=!0},t.prototype.detachLayerList=function(){this.fragmentEditor.layerNavigation.$container[0].dispatchEvent(new MouseEvent("mouseover",{view:i})),this.$editorOverlay.removeClass("n2_admin_editor_overlay--attached-layer-list"),$("body").removeClass("n2_body--attached-layer-list"),this.fragmentEditor.layerNavigation.$container.insertAfter(this.sidebar),this.fragmentEditor.layerNavigation.onDetach(),s.removeEventListener("click",this.detachLayerListClickCallback,{passive:!0,capture:!0}),this.isLayerListAttached=!1},t.prototype.detachLayerListClick=function(e){$.contains(this.sidebar[0],e.target)||this.sidebar.is(e.target)||$(e.target).closest(".n2_context_menu").length||this.detachLayerList()},t.prototype.initDeviceSwitcherShortcut=function(){var t=$('<div id="n2-ss-devicespecific-settings"></div>'),i=this.fragmentEditor.editor.getAvailableDeviceModes(),s={desktopLandscape:"ssi_16--desktoplandscape",desktopPortrait:"ssi_16--desktopportrait",tabletLandscape:"ssi_16--tabletportraitlarge",tabletPortrait:"ssi_16--tabletportrait",mobileLandscape:"ssi_16--mobileportraitlarge",mobilePortrait:"ssi_16--mobileportrait"};for(var n in i)i[n]&&t.append('<i class="ssi_16 '+s[n]+'" data-device="'+n+'"></i>');var h={mouseenter:function(e){t.appendTo(e.currentTarget)}.bind(this),mouseleave:function(e){t.detach()}.bind(this)},o=this.sidebar.find("[data-devicespecific] label").parent(),r=$('<div class="n2_field__label_modifier ssi_16 ssi_16--minidesktopportrait"></div>').on(h);o.prepend(r),t.find(".ssi_16").on({click:function(e){e.preventDefault();var t=$(e.currentTarget);$('.n2_device_tester_devices__device[data-device="'+t.data("device")+'"]').trigger("click")}.bind(this)})},t})),c.d("LayerWindowTab","$",(function(){var $=c.$;function t(t){this.layerWindow=t,this.activeTabName="",this.activePanelNames=[],this.$buttons=$(".n2_ss_layer_window__tab_button"),this.$buttonsContainer=this.$buttons.parent(),this.$scrollable=$(".n2_ss_layer_window__tab_container"),this.$tabs=$(".n2_ss_layer_window__tab"),this.valuesDict={};for(var i=0;i<this.$buttons.length;i++){var s=this.$buttons.eq(i),n=s.data("related-tab");this.valuesDict[n]={index:i,$button:s,$tab:this.$tabs.filter('[data-tab="'+n+'"]')},s.on("click",this.displayTab.bind(this,n))}this.panels={};var h=this.$tabs.find(".n2_ss_layer_window__tab_panel");for(i=0;i<h.length;i++){var r=h.eq(i).data("panel");this.panels[r]===o?this.panels[r]=h.eq(i):this.panels[r]=this.panels[r].add(h[i])}}return t.prototype.displayTab=function(t,e){e&&e.preventDefault(),c._basicCSS.deActivate(),this.activeTabName!==t&&this.valuesDict[t]&&this.valuesDict[t].$tab.hasClass("n2_ss_layer_window__tab--allowed")&&(this.$buttons.removeClass("n2_ss_layer_window__tab_button--active"),this.$tabs.removeClass("n2_ss_layer_window__tab--active"),this.valuesDict[t].$button.addClass("n2_ss_layer_window__tab_button--active"),this.valuesDict[t].$tab.addClass("n2_ss_layer_window__tab--active"),this.activeTabName=t,c.LayerNavigationTimeline.get().layerWindowEditor.loadDataForLayer(),this.$scrollable.scrollTop(0))},t.prototype.setPanel=function(t,i){var s;for(s=0;s<this.activePanelNames.length;s++)this.panels[this.activePanelNames[s]].removeClass("n2_ss_layer_window__tab_panel--active");for(this.activePanelNames=t,s=0;s<this.activePanelNames.length;s++)this.panels[this.activePanelNames[s]].addClass("n2_ss_layer_window__tab_panel--active");this.setAllowedTabs(i)},t.prototype.setAllowedTabs=function(t){for(var i in this.$buttons.removeClass("n2_ss_layer_window__tab_button--allowed"),this.valuesDict)this.valuesDict[i].$tab.removeClass("n2_ss_layer_window__tab--allowed");for(var s=!1,n=0;n<t.length;n++){var h=t[n];this.valuesDict[h]!==o&&(h===this.activeTabName&&(s=!0),this.valuesDict[h].$button.addClass("n2_ss_layer_window__tab_button--allowed"),this.valuesDict[h].$tab.addClass("n2_ss_layer_window__tab--allowed"))}s||this.valuesDict[t[0]].$button.trigger("click"),this.$buttonsContainer.attr("data-visible-tabs",t.length)},t.prototype.getActiveTabName=function(){return this.activeTabName},t})),c.d("PositionDisplay","$",(function(){var $=c.$;function t(){this.currentSource="",nt(this._ready.bind(this))}return t.prototype._ready=function(){this.$body=$("body"),this.$el=$('<div class="n2_tooltip n2_tooltip_position"></div>').appendTo(".n2_admin_editor_overlay,.n2_admin")},t.prototype.show=function(t){""===this.currentSource&&(this.currentSource=t,this.$el.addClass("n2_tooltip--active"),this.$body.addClass("n2_body--tooltip-position-active"))},t.prototype.update=function(e,t,i){this.currentSource===t&&(i!==o&&this.$el.html(i),this.$el.css({left:e.clientX+10+"px",top:e.clientY+10+"px"}))},t.prototype.hide=function(t){this.currentSource!==t&&t!==o||(this.$body.removeClass("n2_body--tooltip-position-active"),this.$el.removeClass("n2_tooltip--active"),this.currentSource="")},t.get=function(){var i=new t;return t.get=function(){return i},i},t})),c.d("Ruler","$",(function(){var $=c.$;function t(t,s){this.editor=t,this.showGuides=1,this.guides=[],this.scale=10,this.$scrollArea=$(".n2_admin_editor__content_inner"),$(".n2_ruler_corner").on("click",function(){this.editor.fragmentEditor.canvasSettings.toggle("n2-ss-ruler-enabled")}.bind(this));var l,u,d=this.$scrollArea[0],_=function(){return l===o&&(l={top:d.scrollTop,left:d.scrollLeft,behavior:"auto"}),u&&a(u),u=r((function(){l=o}),500),l};this.vertical=$(".n2_ruler--vertical").on("wheel",function(e){e.preventDefault();var t=1;1!==e.originalEvent.deltaMode&&2!==e.originalEvent.deltaMode||(t=40);var i=_();e.originalEvent.deltaY&&(e.originalEvent.shiftKey?i.left+=e.originalEvent.deltaY*t:i.top+=e.originalEvent.deltaY*t),e.originalEvent.deltaX&&(i.left+=e.originalEvent.deltaX*t),i.left=Math.min(Math.max(0,i.left),d.scrollWidth-d.clientWidth),i.top=Math.min(Math.max(0,i.top),d.scrollHeight-d.clientHeight),d.scrollTo(i)}.bind(this)),this.$verticalInner=this.vertical.find(".n2_ruler__inner"),this.horizontal=$(".n2_ruler--horizontal").on("wheel",function(e){e.preventDefault();var t=1;1!==e.originalEvent.deltaMode&&2!==e.originalEvent.deltaMode||(t=40);var i=_();e.originalEvent.deltaY&&(e.originalEvent.shiftKey?i.left+=e.originalEvent.deltaY*t:i.top+=e.originalEvent.deltaY*t),e.originalEvent.deltaX&&(i.left+=e.originalEvent.deltaX*t),i.left=Math.min(Math.max(0,i.left),d.scrollWidth-d.clientWidth),i.top=Math.min(Math.max(0,i.top),d.scrollHeight-d.clientHeight),d.scrollTo(i)}.bind(this)).appendTo(".n2_admin_editor_overlay__middle_center"),this.$horizontalInner=this.horizontal.find(".n2_ruler__inner"),this.verticalMarks=$(),this.horizontalMarks=$(),this.onResize(),$(i).on("resize",this.onResize.bind(this)),this.$scrollArea.on("scroll",this.syncScroll.bind(this)),this.syncScroll(),this.$horizontalInner.on("mousedown",function(e){this.showGuides&&new n(this,this.horizontal,this.$horizontalInner,e)}.bind(this)),this.$verticalInner.on("mousedown",function(e){this.showGuides&&new h(this,this.vertical,this.$verticalInner,e)}.bind(this));try{s=f({vertical:[],horizontal:[]},JSON.parse(c.Base64.decode(s)));for(var v=0;v<s.horizontal.length;v++){new n(this,this.horizontal,this.$horizontalInner).setPosition(s.horizontal[v])}for(v=0;v<s.vertical.length;v++){new h(this,this.vertical,this.$verticalInner).setPosition(s.vertical[v])}}catch(t){}this.measureToolVertical(),this.measureToolHorizontal()}function s(t,i,s,e){this.ruler=t,this.container=i,this.containerInner=s,this.position=0,this.guide=$('<div class="n2_ruler__guide n2-ruler-user-guide"><div class="n2_ruler__guide_border"></div></div>').appendTo(i),$('<div class="n2_ruler__guide_handle"><i class="ssi_missing ssi_16 ssi_16--remove"></i></div>').on("mousedown",function(e){e.preventDefault(),e.stopPropagation(),this.delete()}.bind(this)).appendTo(this.guide),this.ruler.addGuide(this),e&&this.create(e)}function n(){s.prototype.constructor.apply(this,arguments)}function h(){s.prototype.constructor.apply(this,arguments)}return t.prototype.addGuide=function(t){this.guides.push(t)},t.prototype.removeGuide=function(t){this.guides.splice(this.guides.indexOf(t),1)},t.prototype.clearGuides=function(){for(var t=this.guides.length-1;t>=0;t--)this.guides[t].delete()},t.prototype.syncScroll=function(){this.horizontal[0].scrollLeft=this.$scrollArea[0].scrollLeft,this.vertical[0].scrollTop=this.$scrollArea[0].scrollTop},t.prototype.onResize=function(){for(var t=this.$scrollArea[0].scrollWidth,i=this.$scrollArea[0].scrollHeight,s=Math.round(Math.max(t+100,this.$scrollArea.width()-this.vertical.width()-30)/this.scale),n=this.horizontalMarks.length;n<s;n++){var h=$('<div class="n2_ruler_mark"></div>').appendTo(this.$horizontalInner);n%10==0?h.addClass("n2_ruler_mark--large").append('<div class="n2_ruler_mark__label">'+n/10*100+"</div>"):h.addClass("n2_ruler_mark--small")}for(n=s;n<this.horizontalMarks.length;n++)this.horizontalMarks.eq(n).remove();this.horizontalMarks=this.$horizontalInner.find(".n2_ruler_mark");var o=Math.round((i+100)/this.scale);for(n=this.verticalMarks.length;n<o;n++){h=$('<div class="n2_ruler_mark"></div>').appendTo(this.$verticalInner);n%10==0?h.addClass("n2_ruler_mark--large").append('<div class="n2_ruler_mark__label">'+n/10*100+"</div>"):h.addClass("n2_ruler_mark--small")}for(n=o;n<this.verticalMarks.length;n++)this.verticalMarks.eq(n).remove();this.verticalMarks=this.$verticalInner.find(".n2_ruler_mark")},t.prototype.toArray=function(){for(var t={horizontal:[],vertical:[]},i=0;i<this.guides.length;i++)this.guides[i]instanceof n?t.horizontal.push(this.guides[i].position):this.guides[i]instanceof h&&t.vertical.push(this.guides[i].position);return t},t.prototype.measureToolVertical=function(){var t,i=$('<div class="n2_ruler__guide n2_ruler__guide--measure"><div class="n2_ruler__guide_border"></div></div>').css("display","none").appendTo(this.vertical),s=!1,n=function(){s||(s=!0,i.css("display",""),c.PositionDisplay.get().show("Guide"))}.bind(this),h=function(){s&&(s=!1,i.css("display","none"),c.PositionDisplay.get().hide("Guide"))}.bind(this),o=function(e){t=e;var s=Math.max(e.pageY-this.$verticalInner[0].getBoundingClientRect().top,0);i.css("top",s+"px"),c.PositionDisplay.get().update(e,"Guide",s+"px")}.bind(this);this.vertical.on({mouseenter:function(e){this.showGuides&&(n(),this.vertical.on({"mousemove.n2-ruler-measure-tool":o,"scroll.n2-ruler-measure-tool":function(){o(t)}}))}.bind(this),mouseleave:function(){this.vertical.off(".n2-ruler-measure-tool"),h()}.bind(this)})},t.prototype.measureToolHorizontal=function(){var t,i=$('<div class="n2_ruler__guide n2_ruler__guide--measure"><div class="n2_ruler__guide_border"></div></div>').css("display","none").appendTo(this.horizontal),s=!1,n=function(){s||(s=!0,i.css("display",""),c.PositionDisplay.get().show("Guide"))}.bind(this),h=function(){s&&(s=!1,i.css("display","none"),c.PositionDisplay.get().hide("Guide"))}.bind(this),o=function(e){t=e;var s=Math.max(e.pageX-this.$horizontalInner[0].getBoundingClientRect().left,0);i.css("left",s+"px"),c.PositionDisplay.get().update(e,"Guide",s+"px")}.bind(this);this.horizontal.on({mouseenter:function(e){this.showGuides&&(n(),this.horizontal.on({"mousemove.n2-ruler-measure-tool":o,"scroll.n2-ruler-measure-tool":function(){o(t)}}))}.bind(this),mouseleave:function(){this.horizontal.off(".n2-ruler-measure-tool"),h()}.bind(this)})},s.prototype._position=function(t,e){return Math.max(0,t)},s.prototype.setPosition=function(t){this.position=t,this.positionRender(this.position)},s.prototype.delete=function(){this.ruler.removeGuide(this),this.guide.remove()},s.prototype.create=function(e){},n.prototype=Object.create(s.prototype),n.prototype.constructor=n,n.prototype.create=function(e){this.position=this._position(e.pageX-this.containerInner[0].getBoundingClientRect().left,e),this.positionRender(this.position)},n.prototype.rawPositionRender=function(t){this.guide.css("left",Math.max(0,t))},n.prototype.positionRender=function(t){this.guide.css("left",Math.max(0,t))},h.prototype=Object.create(s.prototype),h.prototype.constructor=h,h.prototype.create=function(e){this.position=this._position(e.pageY-this.containerInner[0].getBoundingClientRect().top,e),this.positionRender(this.position)},h.prototype.rawPositionRender=function(t){this.guide.css("top",Math.max(0,t))},h.prototype.positionRender=function(t){this.guide.css("top",Math.max(0,t))},t})),c.d("CanvasSettings","$",(function(){var $=c.$;function t(t){this.$button=$('<a class="n2_button_plain_icon n2_button_plain_icon--medium" href="#"><i class="ssi_24 ssi_24--more"></i></a>').on("click",this.onContextMenu.bind(this)).prependTo(".n2_add_layer__bar_bottom"),c._tooltip.addElement(this.$button,n2_("Editor settings"),10,-20),this.fragmentEditor=t,this.settings={},this.callbacks={},this.guideSubItems=[],this.snapTo(),this.roundTo(),this.startRuler()}return t.prototype.onContextMenu=function(e){e.preventDefault(),this.$button.addClass("n2_button_plain_icon--active");var t=[];t.push({priority:30,label:n2_("Guide settings"),icon:"ssi_16 ssi_16--grid",items:this.guideSubItems}),t.push({priority:50,label:n2_("Keyboard shortcuts"),icon:"ssi_16 ssi_16--keyboard",action:function(){c.ModalHotkey.show()}}),c.ContextMenu(this.$button[0],t,{verticalAlign:"bottom",x:35,y:-30,onClose:function(){this.$button.removeClass("n2_button_plain_icon--active")}.bind(this)})},t.prototype._addSettings=function(t,i,s,n){this.settings[t]=parseInt(localStorage.getItem(t)||s),this.callbacks[t]=n,this.guideSubItems.push({type:"onoff",label:i,isOn:function(t){return this.settings[t]}.bind(this,t),action:function(t,i){this.set(t,i)}.bind(this,t)}),n(this.settings[t],!0)},t.prototype._addAction=function(t,i,s,n){this.guideSubItems.push({label:i,icon:s,action:n})},t.prototype.set=function(t,i){i=i?1:0,this.settings[t]=i,localStorage.setItem(t,i),this.callbacks[t].call(this,i,!1)},t.prototype.toggle=function(t){this.set(t,!this.settings[t])},t.prototype.get=function(t){return this.settings[t]},t.prototype.snapTo=function(){this._addSettings("n2-ss-snap-to-enabled",n2_("Smart snap"),1,(function(t){}))},t.prototype.roundTo=function(){this._addSettings("n2-ss-round-to-enabled",n2_("Round to 5px"),1,(function(t){c._roundTo=1===t?5:1}))},t.prototype.startRuler=function(){this.ruler=new c.Ruler(this.fragmentEditor.editor,$("#slideguides").val()),this._addSettings("n2-ss-ruler-enabled",n2_("Ruler"),1,function(t){$("body").toggleClass("n2_body--ruler",1===t)}.bind(this)),this._addAction("n2-ss-clear-guides",n2_("Clear guides"),"ssi_16 ssi_16--delete",function(){this.ruler.clearGuides()}.bind(this))},t})),c.d("UICanvasItem",["$","UIMouse"],(function(){"use strict";function t(t,i){this.element=t,this.widgetName=this.widgetName||"UICanvasItem",this.widgetEventPrefix="canvasItem",this.options=f({canvasUIManager:null,layer:!1,$layer:null,distance:5},this.options,i),c.UIMouse.prototype.constructor.apply(this,arguments),this.create()}return t.prototype=Object.create(c.UIMouse.prototype),t.prototype.constructor=t,t.prototype.create=function(){"function"==typeof this.options.$layer&&(this.options.$layer=this.options.$layer.call(this,this)),this._mouseInit()},t.prototype._mouseCapture=function(e,t){return this.options.canvasUIManager._mouseCapture(e,t)},t.prototype._mouseStart=function(t,i,s){var n=this.options.canvasUIManager._mouseStart(t,this.options.$layer,this.options.layer);return this._trigger("start"),n},t.prototype._mouseDrag=function(t){return this.options.canvasUIManager._mouseDrag(t)},t.prototype._mouseStop=function(t,i){this._trigger("end");var s=this.options.canvasUIManager._mouseStop(t,i);return c.WindowManager.actionPrevent("ComponentActivate"),s},t.prototype.destroy=function(){return this._mouseDestroy(),this},t})),c.d("UICanvas",["$","UIWidgetBase"],(function(){var $=c.$;function t(t,i){this.element=t,this.fragmentEditor=i,this.widgetName=this.widgetName||"UICanvas",$(this.element).data("UICanvas",this),this.widgetEventPrefix="canvas",this._scrollCallback=this._scroll.bind(this),c.UIWidgetBase.prototype.constructor.apply(this,arguments)}function i(t,i,n,h,o){this.uiCanvas=t,this.fragmentEditor=t.fragmentEditor,this.onKeyDownCallback=this.onKeyDown.bind(this),this.fragmentEditor.pointerManager.disable(),this.context={action:"move",placement:"default",placeholder:$('<div class="n2-ss-layer-placeholder"></div>'),scroll:this.uiCanvas.getScrollOffset(),scrollOffsetModifier:{left:0,top:0},mouse:{offset:{left:i.pageX,top:i.pageY}},$layer:n,layer:h};var r={position:"absolute",left:0,top:0,right:"auto",bottom:"auto"};if(h?("absolute"===h.placement.getType()?(this.context.placement="absolute",this.context.relativeToGroup=h.group,this.context.$relativeToParent=n.parent()):(this.context.relativeToGroup=o,this.context.$relativeToParent=this.context.relativeToGroup.layer),this.context.layerOffset=n.offset(),this.context.originalIndex=h.getIndex(),"default"===this.context.placement&&(r.width=n[0].offsetWidth+1)):(this.context.action="create",this.context.placement=i.ctrlKey||i.metaKey?"absolute":this.fragmentEditor.addLayer.getPosition(),this.context.relativeToGroup=o,this.context.$relativeToParent=this.context.relativeToGroup.layer,this.context.layerOffset={left:0,top:0}),this.context.canvas={offset:this.context.$relativeToParent.offset(),size:{width:this.context.$relativeToParent.outerWidth(),height:this.context.$relativeToParent.outerHeight()}},h?(c.MW.U(n[0]).addClass("n2_layer_drag__dragging"),"default"===this.context.placement&&(this.context.$clone=$('<div class="n2-ss-layer-clone"></div>').height(n.outerHeight(!0)).insertAfter(n),n.appendTo(o.layer))):n.appendTo("body"),c.MW.U(n[0]).addClass("n2-ss-layer--drag"),n.css(r),this.margins={left:+n.css("marginLeft")||0,top:+n.css("marginTop")||0},this.context.size={width:n.outerWidth(),height:n.outerHeight()},this.context.droppables=o.getDroppables(this.context.placement,h),"default"===this.context.placement)for(var a=0;a<this.context.droppables.length;a++)c.MW.U(this.context.droppables[a].layer.layer[0]).addClass("n2_layer_drag_target_groups");this._cacheContainers(),this.snapStart(),s.addEventListener("keydown",this.onKeyDownCallback,{capture:!0})}t.prototype=Object.create(c.UIWidgetBase.prototype),t.prototype.constructor=t,t.prototype.getScrollOffset=function(){return this.getScrollOffsetRecursive(this.element[0],{top:0,left:0})},t.prototype.getScrollOffsetRecursive=function(t,i){return null===t||t.scrollTop===o||t.scrollLeft===o?i:(i.top+=t.scrollTop,i.left+=t.scrollLeft,this.getScrollOffsetRecursive(t.parentNode,i))},t.prototype._scroll=function(){var t=this.getScrollOffset();this.interaction.setScrollOffset(t.top,t.left)},t.prototype._mouseCapture=function(e){return 0===$(e.target).closest(".nui_resize_absolute__handle, .nui_resize_normal__handle, .nui_spacing__handle").length},t.prototype._mouseStart=function(e,t,n){s.addEventListener("scroll",this._scrollCallback,{passive:!0,capture:!0}),c.MW.U(s.body).addClass("n2_body--drag-layer"),this.interaction=new i(this,e,t,n,this.fragmentEditor.mainContainer),this.interaction.drag(e)},t.prototype._mouseDrag=function(e){this.interaction&&this.interaction.drag(e)},t.prototype._mouseStop=function(e){s.removeEventListener("scroll",this._scrollCallback,{passive:!0,capture:!0}),this.interaction&&this.interaction.stop(e),c.MW.U(s.body).removeClass("n2_body--drag-layer"),delete this.interaction},t.prototype.cancel=function(){delete this.interaction},i.prototype.drag=function(t){this.lastEvent=t;var i,s={x:t.pageX-this.context.scrollOffsetModifier.left,y:t.pageY-this.context.scrollOffsetModifier.top};i="create"===this.context.action?{top:t.pageY-this.context.canvas.offset.top-20,left:t.pageX-this.context.canvas.offset.left-20}:{top:this.context.layerOffset.top-this.context.canvas.offset.top+t.pageY-this.context.mouse.offset.top-this.context.scrollOffsetModifier.top-this.margins.top,left:this.context.layerOffset.left-this.context.canvas.offset.left+t.pageX-this.context.mouse.offset.left-this.context.scrollOffsetModifier.left-this.margins.left};var n=this._findInnerContainer(s.x,s.y);if(!1===n&&"move"===this.context.action&&(n=this.context.droppables[0]),n)if("normal"===n.placement){n.layers===o&&(n.layers=this._cacheContainerLayers(n));var h=this._findNormalIndex(s,n);h>0?(this.context.placeholder.css("order",n.layers[h-1].layer.layer.css("order")),this.context.placeholder.insertAfter(n.layers[h-1].layer.layer)):(this.context.placeholder.css("order",0),this.context.placeholder.prependTo(n.$container)),this.context.targetIndex=h}else this.context.placeholder.detach();else this.context.placeholder.detach();this.context.targetContainer&&this.context.targetContainer!==n&&c.MW.U(this.context.targetContainer.layer.layer[0]).removeClass("n2_layer_drag_target_group"),this.context.targetContainer=n,n&&c.MW.U(n.layer.layer[0]).addClass("n2_layer_drag_target_group"),this.context.layer&&"absolute"===this.context.placement&&this.context.layer.placement.current.triggerLayerResized(),"create"===this.context.action&&(i.left+=this.context.canvas.offset.left,i.top+=this.context.canvas.offset.top),this.snapDrag(t,{left:i.left+this.context.canvas.offset.left,top:i.top+this.context.canvas.offset.top},i),i.left=Math.round(i.left),i.top=Math.round(i.top);var r=c.MW.R(this.context.$layer[0]);r.xAbs=i.left-r.xPAbs/100*this.context.$layer[0].offsetWidth,r.yAbs=i.top-r.yPAbs/100*this.context.$layer[0].offsetHeight,this.displayPosition(t,i),this.Qi=i},i.prototype.stop=function(e){var t=$.Deferred();this.ended(t);var i=this.context.targetIndex,s=this.context.targetContainer;if("create"===this.context.action)s?this.fragmentEditor.itemEditor.createWithDrag(e,t,this.context.placement,this.context.$layer,s,i):t.resolve(),this.context.$layer.detach();else if("move"===this.context.action){if(s===o&&(s=this.fragmentEditor.mainContainer.layer),"absolute"===this.context.placement)this.context.layer.placement.current.setPosition(this.Qi.left,this.Qi.top);else if("default"===this.context.placement){var n=c.MW.R(this.context.$layer[0]);switch(n.xAbs=0,n.yAbs=0,N(this.context.$layer[0],["position","width","left","top","bottom","right"]),s.layer.type){case"content":case"col":i>0?this.context.$layer.insertAfter(s.layers[i-1].layer.layer):this.context.$layer.prependTo(s.$container),this.context.layer.onCanvasUpdate(this.context.originalIndex,s.layer,i)}}t.resolve()}this.context.layer&&this.context.layer.placement.current.triggerLayerResized()},i.prototype.ended=function(t){if(s.removeEventListener("keydown",this.onKeyDownCallback,{capture:!0}),this.context.placeholder.remove(),"default"===this.context.placement){for(var i=0;i<this.context.droppables.length;i++)c.MW.U(this.context.droppables[i].layer.layer[0]).removeClass("n2_layer_drag_target_groups");"move"===this.context.action&&this.context.$clone.remove()}this.context.targetContainer&&c.MW.U(this.context.targetContainer.layer.layer[0]).removeClass("n2_layer_drag_target_group"),c.MW.U(this.context.$layer[0]).removeClass("n2-ss-layer--drag"),c.MW.U(this.context.$layer[0]).removeClass("n2_layer_drag__dragging"),this.snapStop(),this.hidePosition(),t!==o?t.done(function(){this.fragmentEditor.pointerManager.enable()}.bind(this)):(this.fragmentEditor.pointerManager.enable(),this.uiCanvas.cancel())},i.prototype.refresh=function(){this.drag(this.lastEvent)},i.prototype.setScrollOffset=function(t,i){this.context.scrollOffsetModifier.top=this.context.scroll.top-t,this.context.scrollOffsetModifier.left=this.context.scroll.left-i,this.refresh()},i.prototype.displayPosition=function(e,t){this.context.targetContainer&&"absolute"===this.context.targetContainer.placement?(c.PositionDisplay.get().show("Canvas"),"create"===this.context.action&&(t.left-=this.context.canvas.offset.left,t.top-=this.context.canvas.offset.top),c.PositionDisplay.get().update(e,"Canvas","L: "+(parseInt(t.left)||0)+"px<br>T: "+(parseInt(t.top)||0)+"px")):this.hidePosition()},i.prototype.hidePosition=function(){c.PositionDisplay.get().hide("Canvas")},i.prototype._cacheContainers=function(){for(var t=0;t<this.context.droppables.length;t++){var i=this.context.droppables[t];i.offset=i.$container.offset(),i.size={width:i.$container.outerWidth(),height:i.$container.outerHeight()},i.offset.right=i.offset.left+i.size.width,i.offset.bottom=i.offset.top+i.size.height}},i.prototype._findInnerContainer=function(t,i){for(var s=this.context.droppables.length-1;s>=0;s--){var n=this.context.droppables[s];if(n.offset.left<=t&&n.offset.right>=t&&n.offset.top<=i&&n.offset.bottom>=i)return n}return!1},i.prototype._cacheContainerLayers=function(t){for(var i=[],s=t.layer.container.getSortedLayers(),n=0;n<s.length;n++){var h={isAbsolute:"absolute"===s[n].placement.getType(),layer:s[n]};h.offset=h.layer.layer.offset(),h.size={width:h.layer.layer.outerWidth(),height:h.layer.layer.outerHeight()},h.offset.right=h.offset.left+h.size.width/2,h.offset.bottom=h.offset.top+h.size.height/2,i.push(h)}return i},i.prototype._findNormalIndex=function(t,i){var s,n,h=-1;switch(i.axis){case"y":for(n=0;n<i.layers.length;n++)if(!(s=i.layers[n]).isAbsolute&&t.y<=s.offset.bottom){h=n;break}break;case"x":for(n=0;n<i.layers.length;n++)if(!(s=i.layers[n]).isAbsolute&&t.x<=s.offset.right){h=n;break}}return-1===h&&(h=i.layers.length),h},i.prototype.onKeyDown=function(e){if(27===e.keyCode){if(e.stopImmediatePropagation(),e.preventDefault(),"move"===this.context.action)if("absolute"===this.context.placement)this.context.layer.placement.updatePosition();else if("default"===this.context.placement){var t=c.MW.R(this.context.$layer[0]);t.xAbs=0,t.yAbs=0,N(this.context.$layer[0],["position","width","left","top","bottom","right"]),this.context.$layer.insertAfter(this.context.$clone)}this.ended()}},i.prototype.snapStart=function(){if("move"===this.context.action&&"absolute"===this.context.placement){this.$gridHorizontal=$('<div class="n2_smartguide n2_smartguide--vertical"></div>').appendTo(this.context.$relativeToParent),this.$gridVertical=$('<div class="n2_smartguide n2_smartguide--horizontal"></div>').appendTo(this.context.$relativeToParent),this.elements=[],this.snapLayers=[];var t=this.fragmentEditor.getSnap(this.context.relativeToGroup,this.context.layer);t&&t.length&&t.each(function(t,i){var s=i.getBoundingClientRect(),n=$(i);this.elements.push({item:i,width:s.width,height:s.height,top:Math.round(s.top),left:Math.round(s.left),backgroundColor:""}),n.hasClass("n2-ss-layer")&&this.snapLayers.push(n[0])}.bind(this)),c.MW.U(this.snapLayers).addClass("n2_layer_drag_snap_to");var i=this.context.$relativeToParent[0].getBoundingClientRect();this.elements.push({width:i.width,height:i.height,top:Math.round(i.top),left:Math.round(i.left),backgroundColor:"#ff4aff"})}};return i.prototype.snapDrag=function(e,t,i){if("move"===this.context.action&&"absolute"===this.context.placement){var s=!1,n=!1,h=5,o=5;if(this.$gridVertical.css({display:"none"}),this.$gridHorizontal.css({display:"none"}),this.context.targetContainer&&"absolute"===this.context.targetContainer.placement){var r=e.ctrlKey||e.metaKey,a=e.altKey;if(r&&a)return;r?s=!0:a&&(n=!0);var c=t.left,l=c+this.context.size.width,u=t.top,d=u+this.context.size.height,f=(c+l)/2,_=(u+d)/2;if(!s)for(var v=this.elements.length-1;v>=0&&0!==h;v--){var p=this.elements[v].left,m=p+this.elements[v].width,b=(p+m)/2,g=!0;(y=Math.abs(p-l))<h?(i.left=p-this.context.size.width-this.context.canvas.offset.left,this.setSnapHorizontalLine(i.left+this.context.size.width)):(y=Math.abs(p-c))<h?(i.left=p-this.context.canvas.offset.left,this.setSnapHorizontalLine(i.left)):(y=Math.abs(m-c))<h?(i.left=m-this.context.canvas.offset.left,this.setSnapHorizontalLine(i.left)):(y=Math.abs(m-l))<h?(i.left=m-this.context.size.width-this.context.canvas.offset.left,this.setSnapHorizontalLine(i.left+this.context.size.width)):(y=Math.abs(b-l))<h?(i.left=b-this.context.size.width-this.context.canvas.offset.left,this.setSnapHorizontalLine(i.left+this.context.size.width)):(y=Math.abs(b-c))<h?(i.left=b-this.context.canvas.offset.left,this.setSnapHorizontalLine(i.left)):(y=Math.abs(b-f))<h?(i.left=b-this.context.size.width/2-this.context.canvas.offset.left,this.setSnapHorizontalLine(i.left+this.context.size.width/2)):g=!1,g&&(s=this.elements[v],h=Math.min(y,h))}if(!n)for(v=this.elements.length-1;v>=0&&0!==o;v--){var y,w=this.elements[v].top,k=w+this.elements[v].height,x=(w+k)/2,S=!0;(y=Math.abs(w-d))<o?(i.top=w-this.context.size.height-this.context.canvas.offset.top,this.setSnapVerticalLine(i.top+this.context.size.height)):(y=Math.abs(w-u))<o?(i.top=w-this.context.canvas.offset.top,this.setSnapVerticalLine(i.top)):(y=Math.abs(k-u))<o?(i.top=k-this.context.canvas.offset.top,this.setSnapVerticalLine(i.top)):(y=Math.abs(k-d))<o?(i.top=k-this.context.size.height-this.context.canvas.offset.top,this.setSnapVerticalLine(i.top+this.context.size.height)):(y=Math.abs(x-d))<o?(i.top=x-this.context.size.height-this.context.canvas.offset.top,this.setSnapVerticalLine(i.top+this.context.size.height)):(y=Math.abs(x-u))<o?(i.top=x-this.context.canvas.offset.top,this.setSnapVerticalLine(i.top)):(y=Math.abs(x-_))<o?(i.top=x-this.context.size.height/2-this.context.canvas.offset.top,this.setSnapVerticalLine(i.top+this.context.size.height/2)):S=!1,S&&(n=this.elements[v],o=Math.min(y,o))}s&&!0!==s&&this.$gridHorizontal.css("backgroundColor",s.backgroundColor),n&&!0!==n&&this.$gridVertical.css("backgroundColor",n.backgroundColor)}}},i.prototype.setSnapHorizontalLine=function(t){this.$gridHorizontal.css({left:t,display:"block"})},i.prototype.setSnapVerticalLine=function(t){this.$gridVertical.css({top:t,display:"block"})},i.prototype.snapStop=function(){"move"===this.context.action&&"absolute"===this.context.placement&&(c.MW.U(this.snapLayers).removeClass("n2_layer_drag_snap_to"),this.$gridVertical.remove(),this.$gridHorizontal.remove())},t})),c.d("UIColumns",["$","UIMouse"],(function(){var $=c.$;function t(t,i,s){this.element=t,this.fragmentEditor=i,this.active=0,this.created=!1,this.invalidated=!1,this.isHandlesVisible=!1,this.widgetName=this.widgetName||"UIColumns",this.widgetEventPrefix="columns",this.options=f({columns:"1",gutter:0,denominators:{1:100,2:100,3:144,4:100,5:100,6:144},drag:null,start:null,stop:null},this.options,s),c.UIMouse.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.UIMouse.prototype),t.prototype.constructor=t,t.prototype.showHandles=function(){this.isHandlesVisible=!0,this.handles&&this.handles.addClass("ui-column-width-handle--visible")},t.prototype.hideHandles=function(){this.isHandlesVisible=!1,this.handles&&this.handles.removeClass("ui-column-width-handle--visible")},t.prototype.create=function(){this.created||(this.created=!0,this._setupHandles(),$(i).on("resize",this._resize.bind(this)),this._mouseInit())},t.prototype.destroy=function(){return this._mouseDestroy(),this.element.removeData("uiNextendColumns").off(".columns").find("> .ui-column-width-handle").remove(),this},t.prototype.getDenominator=function(t){return this.options.denominators[t]===o&&(this.options.denominators[t]=15*t),this.options.denominators[t]},t.prototype._setupHandles=function(){var t,i=this.options;this.fractions=[];for(var s=i.columns.split("+"),n=0;n<s.length;n++)this.fractions.push(new Fraction(s[n]));this.currentDenominator=this.getDenominator(this.fractions.length);var h=0;for(n=0;n<this.fractions.length-1;n++)t=$("<div class='ui-column-width-handle'>"),h+=100*this.fractions[n].valueOf(),t.data("i",n).data("percent",h).appendTo(this.element).on("mousedown",this._mouseDown.bind(this));this.handles=this.element.find("> .ui-column-width-handle"),this.handles.toggleClass("ui-column-width-handle--visible",this.isHandlesVisible),this._resize()},t.prototype._resize=function(){if(this.active){this.paddingLeft=parseInt(this.element.css("paddingLeft")),this.paddingRight=parseInt(this.element.css("paddingRight"));var t=this.element.width();this.outerWidth=t+this.paddingLeft+this.paddingRight,this.innerWidth=t-this.handles.length*this.options.gutter;for(var i=0;i<this.handles.length;i++){var s=this.handles.eq(i).data("percent");this._updateResizer(i,s)}}else this.invalidated=!0},t.prototype._updateResizer=function(t,i){this.handles.eq(t).css({left:i+"%",marginLeft:-2+this.paddingLeft+(t+.5)*this.options.gutter+(this.innerWidth-this.outerWidth)*i/100+"px"})},t.prototype._removeHandles=function(){this.handles.remove()},t.prototype.setOption=function(t,i){switch(c.UIWidgetBase.prototype.setOption.apply(this,arguments),t){case"active":this.active=i,this.active&&(this.create(),this.invalidated&&this._resize());break;case"columns":this.created&&(this._removeHandles(),this._setupHandles());break;case"gutter":this._resize()}},t.prototype._mouseCapture=function(t){var i,s=!1;for(i=0;i<this.handles.length;i++)this.handles[i]===t.target&&(s=!0);return!this.options.disabled&&s},t.prototype._mouseStart=function(t){this.fragmentEditor.pointerManager.contextualBarHover.disable();var i=$(t.target).data("i"),s=this.element.offset().left+10,n=this.element.width()-20;this.resizeContext={index:i,cLeft:s,containerWidth:n,startX:Math.max(0,Math.min(t.clientX-s,n))},this.currentFractions=[],this.currentPercent=[];for(var h=0;h<this.fractions.length;h++)this.currentFractions.push(this.fractions[h].clone()),this.currentPercent.push(this.fractions[h].valueOf());return this.resizing=!0,$("body").css("cursor","ew-resize"),this.element.addClass("ui-column-width-resizing"),this._trigger("start",t,this.ui()),!0},t.prototype._mouseDrag=function(t){var i=Math.max(0,Math.min(t.clientX-this.resizeContext.cLeft,this.resizeContext.containerWidth)),s=new Fraction(Math.round((i-this.resizeContext.startX)/(this.resizeContext.containerWidth/this.currentDenominator)),this.currentDenominator);s.compare(this.fractions[this.resizeContext.index].clone().mul(-1))<0&&(s=this.fractions[this.resizeContext.index].clone().mul(-1)),s.compare(this.fractions[this.resizeContext.index+1])>0&&(s=this.fractions[this.resizeContext.index+1].clone()),this.currentFractions[this.resizeContext.index]=this.fractions[this.resizeContext.index].add(s),this.currentFractions[this.resizeContext.index+1]=this.fractions[this.resizeContext.index+1].sub(s);var n=0;this.currentPercent=[];for(var h=0;h<this.currentFractions.length;h++){var o=this.currentFractions[h].valueOf();this.currentPercent.push(o),n+=100*o,this._updateResizer(h,n)}this._trigger("colwidth",t,this.ui()),this._triggerInteraction()},t.prototype._mouseStop=function(t){return this.resizing=!1,$("body").css("cursor","auto"),this._trigger("stop",t,this.ui()),this.fractions=this.currentFractions,this._triggerInteraction(),this.fragmentEditor.pointerManager.contextualBarHover.enable(),c.WindowManager.actionPrevent("ComponentActivate"),!1},t.prototype.ui=function(){return{element:this.element,originalFractions:this.fractions,currentFractions:this.currentFractions,currentPercent:this.currentPercent,index:this.resizeContext.index}},t})),c.d("UILayerListItem",["$","UIMouse"],(function(){"use strict";function t(t,i){this.element=t,this.widgetName=this.widgetName||"UILayerListItem",this.widgetEventPrefix="layerListItem",this.options=f({UIManager:null,layer:!1,$layer:null,distance:2},this.options,i),c.UIMouse.prototype.constructor.apply(this,arguments),this.create()}return t.prototype=Object.create(c.UIMouse.prototype),t.prototype.constructor=t,t.prototype.create=function(){this._mouseInit()},t.prototype._mouseCapture=function(t,i){return this.options.UIManager._mouseCapture(this.options,t,i)},t.prototype._mouseStart=function(t,i,s){return this._trigger("start"),this.options.UIManager._mouseStart(this.options,t,i,s)},t.prototype._mouseDrag=function(t){return this.options.UIManager._mouseDrag(this.options,t)},t.prototype._mouseStop=function(t,i){return this.options.UIManager._mouseStop(this.options,t,i)},t.prototype.destroy=function(){return this._mouseDestroy(),this},t})),c.d("UILayerList",["$","UIWidgetBase"],(function(){var $=c.$;function t(t,i){this.element=t,this.widgetName=this.widgetName||"UILayerList",this.widgetEventPrefix="layerList",this.options=f({mainContainer:null,$scrolled:null},this.options,i),this.interaction=!1,this.onKeyDownCallback=this.onKeyDown.bind(this),c.UIWidgetBase.prototype.constructor.apply(this,arguments),this.create()}return t.prototype=Object.create(c.UIWidgetBase.prototype),t.prototype.constructor=t,t.prototype.create=function(){this.scrollTimeout=null},t.prototype._mouseCapture=function(t,i,s){return t.$item[0]!==this.options.mainContainer.layerRow[0]},t.prototype._mouseStart=function(t,i,n,h){this.interaction=!0,this.scrolledTop=this.options.$scrolled.offset().top,this.scrolledHeight=this.options.$scrolled.height(),this.scrolledScroll=this.options.$scrolled.scrollTop(),this.scrolledMaxHeight=this.options.$scrolled[0].scrollHeight-this.scrolledHeight,this.context={placeholder:$('<div class="n2_layer_navigation_list_layers__sortable_placeholder"></div>'),mouse:{y:i.pageY,topModifier:t.$item.offset().top-i.pageY},$item:t.$item,$clone:t.$item.clone()},this.context.$clone.addClass("n2_layer_navigation_list_layer--sorted").appendTo(this.options.$scrolled),this.context.droppables=this.options.mainContainer.getLLDroppables(t.layer),this._cacheContainers(),s.addEventListener("keydown",this.onKeyDownCallback,{capture:!0}),this._trigger("start",i),this._mouseDrag(t,i)},t.prototype._scrollUp=function(){this.scrolledTop>0&&null===this.scrollTimeout&&(this.scrollTimeout=setInterval(function(){this.scrolledScroll-=33,this.options.$scrolled.scrollTop(this.scrolledScroll)}.bind(this),150),this.scrolledScroll-=33,this.options.$scrolled.scrollTop(this.scrolledScroll))},t.prototype._scrollDown=function(){null===this.scrollTimeout&&(this.scrollTimeout=setInterval(function(){this.scrolledScroll+=33,this.options.$scrolled.scrollTop(Math.min(this.scrolledScroll,this.scrolledMaxHeight))}.bind(this),150),this.scrolledScroll+=33,this.options.$scrolled.scrollTop(Math.min(this.scrolledScroll,this.scrolledMaxHeight)))},t.prototype._mouseDrag=function(t,i){if(this.interaction){this.scrolledTop=this.options.$scrolled.offset().top,this.scrolledHeight>140&&(i.pageY<this.scrolledTop+33+48?this._scrollUp():i.pageY>this.scrolledTop+this.scrolledHeight-33?this._scrollDown():(clearInterval(this.scrollTimeout),this.scrollTimeout=null)),this.scrolledScroll=this.options.$scrolled.scrollTop();var s=i.pageY-this.scrolledTop+this.scrolledScroll,n=this._findInnerContainer(s);!1===n&&(n=this.context.droppables[0]),n.layers===o&&(n.layers=this._cacheContainerLayers(n));var h=this._findNormalIndex(s,n);h>0?this.context.placeholder.insertAfter(n.layers[h-1].layer.layerRow):this.context.placeholder.prependTo(n.$container),this.context.targetIndex=h,this.context.targetContainer&&this.context.targetContainer!==n&&this.context.targetContainer.layer.layerRow.removeClass("n2_layer_navigation_list_layer--drop"),this.context.targetContainer=n,this.context.targetContainer.layer.layerRow.addClass("n2_layer_navigation_list_layer--drop"),this.context.$clone.css({top:s+this.context.mouse.topModifier+"px"})}},t.prototype._mouseStop=function(t,i,s){if(this.interaction){this.ended(!0);var n=this.context.targetIndex,h=this.context.targetContainer,o=-1;if(0===this.context.targetContainer.layers.length)o=0;else{var r=!1,a=!1;this.context.targetContainer.layers[n]&&(r=this.context.targetContainer.layers[n].layer),this.context.targetContainer.layers[n-1]&&(a=this.context.targetContainer.layers[n-1].layer),r===t.layer||a===t.layer?o=-1:"slide"===h.layer.type?r?o=r.getIndex()+1:a&&(o=a.getIndex()):a?o=a.getIndex()+1:r&&(o=r.getIndex())}if(o>=0){var l=t.layer.getIndex();h.layer===t.layer.group&&o>l&&o--,"col"===t.layer.type?h.layer.moveCol(l,o):(h.layer.container.insertLayerAt(t.layer,o),t.layer.onCanvasUpdate(l,h.layer,o))}delete this.context,this._trigger("stop",i)}c.WindowManager.actionPrevent("ComponentRowActivate"),this.interaction=!1},t.prototype.cancel=function(){this.interaction=!1,delete this.context},t.prototype.ended=function(t){s.removeEventListener("keydown",this.onKeyDownCallback,{capture:!0}),null!==this.scrollTimeout&&(clearInterval(this.scrollTimeout),this.scrollTimeout=null),this.context.placeholder.remove(),this.context.$clone.remove(),this.context.targetContainer.layer.layerRow.removeClass("n2_layer_navigation_list_layer--drop"),t||this.cancel()},t.prototype.onKeyDown=function(e){27===e.keyCode&&(e.stopImmediatePropagation(),e.preventDefault(),this.ended())},t.prototype._cacheContainers=function(){for(var t=0;t<this.context.droppables.length;t++){var i=this.context.droppables[t];i.top=i.$container.offset().top-this.scrolledTop+this.scrolledScroll-15,i.height=i.$container.outerHeight(),i.bottom=i.top+i.height+15}},t.prototype._findInnerContainer=function(t){for(var i=this.context.droppables.length-1;i>=0;i--){var s=this.context.droppables[i];if(s.top<=t&&s.bottom>=t)return s}return!1},t.prototype._cacheContainerLayers=function(t){for(var i=[],s=t.layer.container.getSortedLayers(),n=0;n<s.length;n++){var h={layer:s[n]};h.top=h.layer.layerRow.offset().top-this.scrolledTop+this.scrolledScroll,h.height=h.layer.layerRow.outerHeight(),h.bottom=h.top+h.height/2,h.index=n,i.push(h)}return"slide"===t.layer.type&&i.reverse(),i},t.prototype._findNormalIndex=function(t,i){for(var s=0;s<i.layers.length;s++){if(t<=i.layers[s].bottom)return s}return i.layers.length},t})),c.d("UIDragTooltip","$",(function(){"use strict";function t(t){this.name=t,this.isShown=!1,this.isShownForHover=!1,this.isShownForDrag=!1,this.e=null,this.hoverTipCallback=null,this.tip=c.PositionDisplay.get()}return t.prototype.hoverShow=function(e,t){this.e=e,this.hoverTipCallback=t,this.isShownForHover=!0,this.show()},t.prototype.hoverUpdatePosition=function(e){this.isShownForHover&&!this.isShownForDrag&&(this.e=e,this.tip.update(this.e,this.name))},t.prototype.hoverHide=function(){this.isShownForHover=!1,this.hide()},t.prototype.dragShow=function(){this.isShownForDrag=!0,this.show()},t.prototype.dragUpdate=function(e,t){this.e=e,this.tip.update(e,this.name,t)},t.prototype.dragHide=function(){this.isShownForDrag=!1,this.hide(),this.isShownForHover&&this.tip.update(this.e,this.name,this.hoverTipCallback.call())},t.prototype.show=function(){this.isShown||(this.tip.show(this.name),this.isShownForDrag||this.tip.update(this.e,this.name,this.hoverTipCallback.call()),this.isShown=!0)},t.prototype.hide=function(){!this.isShown||this.isShownForHover||this.isShownForDrag||(this.tip.hide(this.name),this.isShown=!1)},t})),c.d("UIResizeAbsolute",["$","UIMouse"],(function(){var $=c.$;function t(t,i,s){this.element=t,this.fragmentEditor=i,this.widgetName=this.widgetName||"UIResizeAbsolute",$(this.element).data("UIResizeAbsolute",this),this.widgetEventPrefix="resize",this.options=f({resize:null,start:null,stop:null},this.options,s),this.Ki=this.element[0].parentNode,c.UIMouse.prototype.constructor.apply(this,arguments),this.create()}return t.prototype=Object.create(c.UIMouse.prototype),t.prototype.constructor=t,t.plugins={},t.prototype.create=function(){this.element.addClass("nui_resize_absolute"),this._setupHandles(),this._mouseInit(),this._trigger("create",null,{})},t.prototype._setupHandles=function(){var t,i,s,n=["n","e","s","w","se","sw","ne","nw"],h=this;this.$handles=$(),this.handles={};for(var o=0;o<n.length;o++)i="nui_resize_absolute__handle--"+(t=n[o]),s=$("<div>").addClass("nui_resize_absolute__handle "+i).attr("data-handle",t).on("mousedown",this._mouseDown.bind(this)),this.handles[t]=s,this.$handles=this.$handles.add(s),this.element.append(s);this.$handles.on("mouseover",(function(){h.resizing||(this.className&&(s=this.className.match(/nui_resize_absolute__handle--(se|sw|ne|nw|n|e|s|w)/i)),h.axis=s&&s[1]?s[1]:"se")}))},t.prototype._mouseCapture=function(t){var i,s,n=!1;for(i in this.handles)((s=this.handles[i][0])===t.target||$.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},t.prototype._removeHandles=function(){this.$handles.remove()},t.prototype._mouseStart=function(t){var i,s,n;return $("body").addClass("n2_body--resize-absolute").css("cursor",this.axis+"-resize").addClass("n2_body--inherit-cursor"),this.element.addClass("nui_resize_absolute--resizing"),this.fragmentEditor.pointerManager.disable(),this.resizing=!0,this.elementSMW=c.MW.R(this.element[0]),this.originalRect=this.element[0].getBoundingClientRect(),i=this.elementSMW.xAbs+this.elementSMW.xPAbs/100*this.originalRect.width,s=this.elementSMW.yAbs+this.elementSMW.yPAbs/100*this.originalRect.height,this.elementSMW.xAbs=i,this.elementSMW.xPAbs=0,this.elementSMW.yAbs=s,this.elementSMW.yPAbs=0,this.position={left:i,top:s},this.size={width:this.originalRect.width,height:this.originalRect.height},this.originalPosition={left:i,top:s},this.ts={left:t.pageX,top:t.pageY},this.ss=this._change[this.axis].bind(this),n=this.handles[this.axis].css("cursor"),$("body").css("cursor","auto"===n?this.axis+"-resize":n),this._propagate("start",t),!0},t.prototype._mouseDrag=function(t){var i=this.ss(t,t.pageX-this.ts.left,t.pageY-this.ts.top);return i.left!==o&&(this.position.left=i.left),i.top!==o&&(this.position.top=i.top),i.height!==o&&(this.size.height=Math.max(10,i.height)),i.width!==o&&(this.size.width=Math.max(10,i.width)),this._propagate("resize",t),this.position.left=Math.round(this.position.left),this.position.top=Math.round(this.position.top),this.size.width=Math.round(this.size.width),this.size.height=Math.round(this.size.height),this.elementSMW.yAbs=this.position.top,this.elementSMW.xAbs=this.position.left,this.elementSMW.width=this.size.width,this.elementSMW.height=this.size.height,this._trigger("resize",t,this.ui()),!1},t.prototype._mouseStop=function(t){return this.resizing=!1,this._propagate("stop",t),this.fragmentEditor.pointerManager.enable(),this.element.removeClass("nui_resize_absolute--resizing"),$("body").removeClass("n2_body--resize-absolute").css("cursor","").removeClass("n2_body--inherit-cursor"),c.WindowManager.actionPrevent("ComponentActivate"),!1},t.prototype._change={e:function(t,i){return{width:this.originalRect.width+i}},w:function(t,i){return{left:this.originalPosition.left+i,width:this.originalRect.width-i}},n:function(t,i,s){return{top:this.originalPosition.top+s,height:this.originalRect.height-s}},s:function(t,i,s){return{height:this.originalRect.height+s}},se:function(t,i,s){return f(this._change.s.apply(this,arguments),this._change.e.apply(this,arguments))},sw:function(t,i,s){return f(this._change.s.apply(this,arguments),this._change.w.apply(this,arguments))},ne:function(t,i,s){return f(this._change.n.apply(this,arguments),this._change.e.apply(this,arguments))},nw:function(t,i,s){return f(this._change.n.apply(this,arguments),this._change.w.apply(this,arguments))}},t.prototype._propagate=function(t,i){this.callPlugin(t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},t.prototype.ui=function(){return{originalRect:this.originalRect,rect:this.element[0].getBoundingClientRect(),element:this.element,position:this.position,size:this.size,axis:this.axis}},t.prototype.destroy=function(){for(var t in this._mouseDestroy(),this.element.removeClass("nui_resize_absolute").removeData(this.widgetName),this.handles)this.handles[t].remove();return this},c.UIWidgetBase.addPlugin(t,"smartguides",{start:function(t,i){var s=$(this).data("UIResizeAbsolute"),n=s.options;if(s.gridH=$('<div class="n2_smartguide n2_smartguide--horizontal"></div>').appendTo(s.Ki),s.gridV=$('<div class="n2_smartguide n2_smartguide--vertical"></div>').appendTo(s.Ki),s.gridH2=$('<div class="n2_smartguide n2_smartguide--horizontal"></div>').appendTo(s.Ki),s.gridV2=$('<div class="n2_smartguide n2_smartguide--vertical"></div>').appendTo(s.Ki),s.elements=[],s.$snapLayers=$(),"function"==typeof n.smartguides){var h=n.smartguides();if(h){var o=s.Ki.getBoundingClientRect();h.each((function(){if(this!==s.element[0]){var t=$(this),i=this.getBoundingClientRect();s.elements.push({item:this,left:Math.round(i.left-o.left),top:Math.round(i.top-o.top),width:i.width,height:i.height}),t.hasClass("n2-ss-layer")&&(s.$snapLayers=s.$snapLayers.add(t))}})),s.$snapLayers.addClass("n2_layer_resize_snap_to"),s.elements.push({item:$(s.Ki),width:o.width,height:o.height,top:0,left:0})}}},stop:function(t,i){var s=$(this).data("UIResizeAbsolute");s.$snapLayers.removeClass("n2_layer_resize_snap_to"),s.gridH.remove(),s.gridV.remove(),s.gridH2.remove(),s.gridV2.remove()},resize:function(t,i){var s,n=$(this).data("UIResizeAbsolute"),h=n.options.tolerance;n.gridV.css({display:"none"}),n.gridH.css({display:"none"}),n.gridV2.css({display:"none"}),n.gridH2.css({display:"none"});var o=n.elements[n.elements.length-1];function r(t){n.gridV.css({left:Math.min(t,o.width-1)+"px",display:"block"})}function a(t){n.gridV2.css({left:Math.min(t,o.width-1)+"px",display:"block"})}function c(t){n.gridH.css({top:Math.min(t,o.height-1)+"px",display:"block"})}function l(t){n.gridH2.css({top:Math.min(t,o.height-1)+"px",display:"block"})}var u=t.ctrlKey||t.metaKey,d=t.altKey;if(!u||!d)for(var f=i.position.left,_=f+i.size.width,v=i.position.top,p=v+i.size.height,m=n.elements.length-1;m>=0;m--){var b=n.elements[m].left,g=b+n.elements[m].width,y=n.elements[m].top,w=y+n.elements[m].height;if(!u){var k=(b+g)/2;Math.abs(b-_)<=h?(i.size.width=b-i.position.left,r(i.position.left+i.size.width)):Math.abs(b-f)<=h?(s=i.position.left-b,i.position.left=b,i.size.width+=s,r(i.position.left)):Math.abs(k-f)<=h&&(s=i.position.left-k,i.position.left=k,i.size.width+=s,r(i.position.left)),Math.abs(g-f)<=h?(s=i.position.left-g,i.position.left=g,i.size.width+=s,a(i.position.left)):Math.abs(g-_)<=h?(i.size.width=g-i.position.left,a(i.position.left+i.size.width)):Math.abs(k-_)<=h&&(i.size.width=k-i.position.left,a(i.position.left+i.size.width))}if(!d){var x=(y+w)/2;Math.abs(y-p)<=h?(i.size.height=y-i.position.top,c(y)):Math.abs(y-v)<=h?(s=i.position.top-y,i.position.top=y,i.size.height+=s,c(i.position.top)):Math.abs(x-v)<=h&&(s=i.position.top-x,i.position.top=x,i.size.height+=s,c(i.position.top)),Math.abs(w-v)<=h?(s=i.position.top-w,i.position.top=w,i.size.height+=s,l(i.position.top)):Math.abs(w-p)<=h?(i.size.height=w-i.position.top,l(i.position.top+i.size.height)):Math.abs(x-p)<=h&&(i.size.height=x-i.position.top,l(i.position.top+i.size.height))}}}}),t})),c.d("UIResizeNormal",["$","UIMouse","UIDragTooltip"],(function(){var $=c.$,t=new c.UIDragTooltip("NormalSizing");function i(t,i,s){this.element=t,this.fragmentEditor=i,this.widgetName=this.widgetName||"UIResizeNormal",this.widgetEventPrefix="normalsizing",this.multiplier=1,this.options=f({maxWidth:!0,height:!1,syncWidth:!1,start:null,resizeMaxWidth:null,resizeHeight:null,stopMaxWidth:null,stopHeight:null},this.options,s),c.UIMouse.prototype.constructor.apply(this,arguments),this.create()}return i.prototype=Object.create(c.UIMouse.prototype),i.prototype.constructor=i,i.prototype.setMaxWidth=function(t){this.handles.e.toggleClass("nui_resize_normal__handle--none",t<0),this.handles.w.toggleClass("nui_resize_normal__handle--none",t<0)},i.prototype.create=function(){this._setupHandles(),this._mouseInit()},i.prototype.destroy=function(){for(var t in this._mouseDestroy(),this.element.removeData(this.widgetName),this.handles)this.handles[t].remove();return this},i.prototype._setupHandles=function(){var t,i,s=this.options,n=[];for(s.maxWidth&&(n.push("w"),n.push("e")),s.height&&n.push("s"),this.handles={},this.$handles=$(),t=0;t<n.length;t++){var h=n[t];i=$('<div class="nui_resize_normal__handle nui_resize_normal__handle--'+h+'">').on("mouseenter",this.onMouseEnter.bind(this,h)),this.handles[h]=i,this.$handles=this.$handles.add(i),this.element.append(i)}},i.prototype.onMouseEnter=function(i,e){var s=e;this.timeout=r(function(){delete this.timeout,t.hoverShow(s,function(){if("e"===i||"w"===i){var t=this.element.css("maxWidth");return"Max width: "+("px"===t.substr(-2)?t:"none")}if("s"===i)return"Height: "+this.element.height()+"px"}.bind(this))}.bind(this),500),this.handles[i].on({"mousemove.tooltip":function(e){s=e,t.hoverUpdatePosition(e)},"mouseleave.tooltip":function(){this.timeout&&(a(this.timeout),delete this.timeout),this.handles[i].off(".tooltip"),t.hoverHide()}.bind(this)})},i.prototype._removeHandles=function(){this.$handles.remove()},i.prototype._mouseCapture=function(t){for(var i in this.handles)if(this.handles[i][0]===t.target)return this.currentHandle=i,!this.options.disabled;return!1},i.prototype._mouseStart=function(i){switch(this.fragmentEditor.pointerManager.contextualBarHover.disable(),t.dragShow(),this.originalMousePosition={left:i.pageX,top:i.pageY},this.currentHandle){case"w":case"e":this.originalValue=this.element.width(),this.maxWidth=this.element.parent().width(),this._trigger("start",i,"maxwidth"),"center"===this.element.css("align-self")?this.multiplier=2:this.multiplier=1,$("body").css("cursor",this.currentHandle+"-resize").addClass("n2_body--inherit-cursor");break;case"s":this.originalValue=this.element.height(),this._trigger("start",i,"height"),$("body").css("cursor","s-resize").addClass("n2_body--inherit-cursor")}return!0},i.prototype._parse_movement_s=function(e){return e.pageY-this.originalMousePosition.top},i.prototype._parse_movement_e=function(e){return(e.pageX-this.originalMousePosition.left)*this.multiplier},i.prototype._parse_movement_w=function(e){return(this.originalMousePosition.left-e.pageX)*this.multiplier},i.prototype._mouseDrag=function(i){var s=this.options;switch(this.currentValue=c._roundHelper(this.originalValue+this["_parse_movement_"+this.currentHandle].call(this,i)),this.currentHandle){case"w":case"e":this.currentValue<=this.maxWidth?(this.element.css("maxWidth",this.currentValue+"px"),s.syncWidth&&this.element.css("width",this.currentValue+"px"),this.setMaxWidth(this.currentValue)):(this.element.css("maxWidth","none"),s.syncWidth&&this.element.css("width",""),this.currentValue=0,this.setMaxWidth(-1)),t.dragUpdate(i,"Max width: "+(0===this.currentValue?"none":this.currentValue+"px"));break;case"s":this.currentValue=Math.max(1,this.currentValue),this.element.height(this.currentValue+"px"),t.dragUpdate(i,"Height: "+this.currentValue+"px")}this._triggerInteraction()},i.prototype._mouseStop=function(i){var s=this.options;switch(this.currentValue=c._roundHelper(this.originalValue+this["_parse_movement_"+this.currentHandle].call(this,i)),t.dragHide(),this.currentHandle){case"w":case"e":this.currentValue<=this.maxWidth?(this.element.css("maxWidth",this.currentValue+"px"),s.syncWidth&&this.element.css("width",""),this.setMaxWidth(this.currentValue)):(this.element.css("maxWidth","none"),s.syncWidth&&this.element.css("width",""),this.currentValue=0,this.setMaxWidth(-1)),this._trigger("stopMaxWidth",i,{value:this.currentValue});break;case"s":this.currentValue=Math.max(1,this.currentValue),this.element.height(this.currentValue+"px"),this._trigger("stopHeight",i,{value:this.currentValue})}return $("body").css("cursor","").removeClass("n2_body--inherit-cursor"),this._triggerInteraction(),this.fragmentEditor.pointerManager.contextualBarHover.enable(),c.WindowManager.actionPrevent("ComponentActivate"),!1},i})),c.d("UISpacingMargin",["$","UISpacing"],(function(){"use strict";function t(t,i,s){this.options=f({mode:"margin",label:"Margin",sync:{n:"margin-top",e:"margin-right",s:"margin-bottom",w:"margin-left"}},s),c.UISpacing.prototype.constructor.call(this,t,i)}return t.prototype=Object.create(c.UISpacing.prototype),t.prototype.constructor=t,t.prototype.updateElementProp=function(t,i){M(this.element[0],"--"+t,i+"px")},t})),c.d("UISpacingPadding",["$","UISpacing"],(function(){"use strict";function t(t,i,s){this.options=f({mode:"padding",label:"Padding",sync:{n:"padding-top",e:"padding-right",s:"padding-bottom",w:"padding-left"}},s),c.UISpacing.prototype.constructor.call(this,t,i)}return t.prototype=Object.create(c.UISpacing.prototype),t.prototype.constructor=t,t.prototype.limitValue=function(t){return Math.max(0,t)},t})),c.d("UISpacing",["$","UIMouse","UIDragTooltip"],(function(){"use strict";var $=c.$,t=new c.UIDragTooltip("Spacing"),i={n:"height",e:"width",s:"height",w:"width"};function s(t,i){this.element=t,this.fragmentEditor=i,this.widgetName=this.widgetName||"UISpacing",this.widgetEventPrefix="spacing",this.options=f({syncInv:{n:"s",e:"w",s:"n",w:"e"},side:{n:"top",e:"right",s:"bottom",w:"left"},drag:null,start:null,stop:null},this.options),c.UIMouse.prototype.constructor.apply(this,arguments),this.create()}return s.prototype=Object.create(c.UIMouse.prototype),s.prototype.constructor=s,s.prototype.create=function(){this._setupHandles(),this._mouseInit()},s.prototype.destroy=function(){for(var t in this._mouseDestroy(),this.element.removeData(this.widgetName),this.handles)this.handles[t].remove();return this},s.prototype._setupHandles=function(){var t=["n","e","s","w"];this.handles={},this.$handles=$();for(var i=0;i<t.length;i++){var s=t[i],n=$("<div>").addClass("nui_spacing__handle nui_spacing__handle--"+this.options.mode+" nui_spacing__handle--"+s).on("mouseenter",this.onMouseEnter.bind(this,s)).on("mousedown",this._mouseDown.bind(this)).appendTo(this.element);this.handles[s]=n,this.$handles=this.$handles.add(n)}},s.prototype.onMouseEnter=function(i,e){var s=e;this.timeout=r(function(){delete this.timeout,t.hoverShow(s,function(){return this.options.label+" "+this.options.side[i]+": "+this.element.css(this.options.sync[i])}.bind(this))}.bind(this),500),this.handles[i].on({"mousemove.tooltip":function(e){s=e,t.hoverUpdatePosition(e)},"mouseleave.tooltip":function(){this.timeout&&(a(this.timeout),delete this.timeout),this.handles[i].off(".tooltip"),t.hoverHide()}.bind(this)})},s.prototype._removeHandles=function(){this.$handles.remove()},s.prototype._parse_movement_n=function(e){return e.pageY-this.originalMousePosition.top},s.prototype._parse_movement_w=function(e){return e.pageX-this.originalMousePosition.left},s.prototype._parse_movement_s=function(e){return e.pageY-this.originalMousePosition.top},s.prototype._parse_movement_e=function(e){return this.originalMousePosition.left-e.pageX},s.prototype._mouseCapture=function(e){var t,i=!1;for(var s in this.handles)((t=this.handles[s][0])===e.target||$.contains(t,e.target))&&$(t).hasClass("nui-enabled")&&(i=!0);return!this.options.disabled&&i},s.prototype.updatePositionDisplay=function(e){var i=this.options.label+" "+this.options.side[this.direction]+": "+this.currentValue+"px<br>";this.wasShiftPressed&&(i+=this.options.label+" "+this.options.side[this.options.syncInv[this.direction]]+": "+this.currentValue+"px<br>"),t.dragUpdate(e,i)},s.prototype._mouseStart=function(e){var i;for(var s in this.fragmentEditor.pointerManager.contextualBarActive.enableActiveForced(),this.fragmentEditor.pointerManager.contextualBarHover.disable(),t.dragShow(),this.wasShiftPressed=!1,this.handles)if((i=this.handles[s][0])===e.target||$.contains(i,e.target)){this.direction=s;break}return this.syncProperty=this.options.sync[this.direction],this.originalValue=parseInt(this.element.css(this.syncProperty)),this.invSyncProperty=this.options.sync[this.options.syncInv[this.direction]],this.invOriginalValue=parseInt(this.element.css(this.invSyncProperty)),this.resizing=!0,this.originalMousePosition={left:e.pageX,top:e.pageY},this.currentValue=this.originalValue,this.handles[this.direction].addClass("nui_spacing__handle--spacing"),$("body").css("cursor",this.direction+"-resize").addClass("n2_body--inherit-cursor"),$("body").on("keydown."+this.widgetEventPrefix,this._keyDown.bind(this)).on("keyup."+this.widgetEventPrefix,this._keyUp.bind(this)),this._trigger("start",e,this.ui()),!0},s.prototype._keyDown=function(e){e.shiftKey&&!this.wasShiftPressed&&(this.wasShiftPressed=!0,this.updateElementProp(this.invSyncProperty,this.currentValue),this.setSize(this.options.syncInv[this.direction],this.currentValue),this._trigger("spacing",e,this.ui()),this.updatePositionDisplay(e),this._triggerInteraction())},s.prototype._keyUp=function(e){!e.shiftKey&&this.wasShiftPressed&&(this.wasShiftPressed=!1,this.updateElementProp(this.invSyncProperty,this.invOriginalValue),this.setSize(this.options.syncInv[this.direction],this.invOriginalValue),this._trigger("spacing",e,this.ui()),this.updatePositionDisplay(e),this._triggerInteraction())},s.prototype._mouseDrag=function(e){this.movement=this["_parse_movement_"+this.direction].call(this,e),this.currentValue=this.limitValue(c._roundHelper(this.originalValue+this.movement)),this.updateElementProp(this.syncProperty,this.currentValue),this.setSize(this.direction,this.currentValue),e.shiftKey?(this.wasShiftPressed=!0,this.updateElementProp(this.invSyncProperty,this.currentValue),this.setSize(this.options.syncInv[this.direction],this.currentValue)):this.wasShiftPressed&&(this.wasShiftPressed=!1,this.updateElementProp(this.invSyncProperty,this.invOriginalValue),this.setSize(this.options.syncInv[this.direction],this.invOriginalValue)),this._trigger("spacing",e,this.ui()),this._triggerInteraction(),this.updatePositionDisplay(e)},s.prototype._mouseStop=function(e){return this.movement=this["_parse_movement_"+this.direction].call(this,e),this.currentValue=this.limitValue(c._roundHelper(this.originalValue+this.movement)),this.updateElementProp(this.syncProperty,this.currentValue),e.shiftKey?this.updateElementProp(this.invSyncProperty,this.currentValue):this.wasShiftPressed&&this.updateElementProp(this.invSyncProperty,this.invOriginalValue),this.resizing=!1,$("body").off("."+this.widgetEventPrefix),this.handles[this.direction].removeClass("nui_spacing__handle--spacing"),$("body").css("cursor","").removeClass("n2_body--inherit-cursor"),this._trigger("stop",e,this.ui()),t.dragHide(),this._triggerInteraction(),this.fragmentEditor.pointerManager.contextualBarActive.disableActiveForced(),this.fragmentEditor.pointerManager.contextualBarHover.enable(),c.WindowManager.actionPrevent("ComponentActivate"),!1},s.prototype.limitValue=function(t){return t},s.prototype.ui=function(){var t={};return t[this.options.side[this.direction]]=this.currentValue,this.wasShiftPressed&&(t[this.options.side[this.options.syncInv[this.direction]]]=this.currentValue),{element:this.element,changed:t}},s.prototype.setOption=function(t,i){if(c.UIWidgetBase.prototype.setOption.apply(this,arguments),"current"===t){var s=i.split(" ");this.setSize("n",s[0]),this.setSize("e",s[1]),this.setSize("s",s[2]),this.setSize("w",s[3])}},s.prototype.updateElementProp=function(t,i){this.element.css(t,i+"px")},s.prototype.setSize=function(t,s){var n,h=!1;"number"==typeof s?(s<0&&(h=!0,s*=-1),n=s+"px"):("-"===s.substr(0,1)&&(h=!0,s=s.substr(1)),n=s),this.handles[t].css(i[t],n),this.handles[t].toggleClass("nui_spacing__handle--negative",h),this.handles[t].toggleClass("nui_spacing__handle--zero",0===parseFloat(s))},s})),c.d("PlacementAbsolute",["$","PlacementAbstract"],(function(){var $=c.$,t={raf:!1,ratios:null,isThrottled:!1,layers:[]};function i(t,i,s){this.type="absolute",this.transferredProperties={},c.PlacementAbstract.prototype.constructor.apply(this,arguments),this.doThrottledTheResize=this.doTheResize,this.parentIsVisible=!0}return i.prototype=Object.create(c.PlacementAbstract.prototype),i.prototype.constructor=i,i.getRegistryDataToFields=function(t){return{parentid:$("#layerparentid"),parentalign:$("#layerparentalign"),parentvalign:$("#layerparentvalign"),left:$("#layerleft"),top:$("#layertop"),responsiveposition:$("#layerresponsive-position"),width:$("#layerwidth"),height:$("#layerheight"),responsivesize:$("#layerresponsive-size"),align:$("#layeralign"),valign:$("#layervalign"),adaptivefont:$("#layeradaptive-font")}},i.prototype.start=function(){this.$layer=this.layer.layer,this.$layerRow=this.layer.layerRow},i.prototype.preActivation=function(t){if("normal"===t.type){var i=this.layer.getProperty("height");i>0&&(this.transferredProperties.height=i)}},i.prototype.activated=function(t){this.ns=c.MW.R(this.layer.layer[0]);var i=this.$layer.data("parentid");i?$("#"+i).length>0?this.activatedAfterParentReady(t):r(function(){this.activatedAfterParentReady(t),this.sync()}.bind(this),300):this._activated(t)},i.prototype.activatedAfterParentReady=function(t){var i=this.$layer.data("parentid");if(i){var s=$("#"+i);if(s.length>0){var n=s.data("layerObject");n?n.readyDeferred.done(this._activated.bind(this,t)):s.on("layerStarted",function(e,i){i.readyDeferred.done(this._activated.bind(this,t))}.bind(this))}else this.$layer.data("parentid",""),this._activated(t)}else this._activated(t)},i.prototype._activated=function(t){this.loadProperties(f(t,this.transferredProperties)),this.transferredProperties={},this.es(),this.hs(),this.layer.layerRow.addClass("n2_layer_navigation_list_layer--absolute"),$('<div class="n2_layer_navigation_list_layer__title_action"><div class="n2_layer_navigation_list_layer__title_absolute_marker" data-n2tip="Absolute">A</div></div>').prependTo(this.layer.layerTitle.find(".n2_layer_navigation_list_layer__title_actions"))},i.cleanLayer=function(t){var i=["desktopPortrait","desktopLandscape","tabletPortrait","tabletLandscape","mobilePortrait","mobileLandscape"];this.ns.xAbs=0,this.ns.xPAbs=0,this.ns.yAbs=0,this.ns.yPAbs=0,t.removeAttr("data-align").removeAttr("data-valign").css({width:"",height:"","text-align":""});for(var s=["parentid","responsiveposition","responsivesize","parentalign","parentvalign","align","valign","left","top","width","height"],n={},h=0;h<s.length;h++){var o=s[h].toLowerCase();n[o]=t.data(o),t.removeAttr(o),t.removeData(o);for(var r=0;r<i.length;r++){var a=i[r].toLowerCase();n[a+o]=t.data(a+o),t.removeAttr(a+o),t.removeData(a+o)}}return n},i.prototype.deActivated=function(t){this.layer.layerRow.removeClass("n2_layer_navigation_list_layer--absolute"),this.layer.layerTitle.find(".n2_layer_navigation_list_layer__title_absolute_marker").remove();var i=this.layer.getProperty("parentid");i&&""!=i&&(this.$layer.removeAttr("data-parentid"),this.unSubscribeParent()),this.$layer.removeAttr("data-align").removeAttr("data-valign").css({left:"",top:"",right:"",bottom:"",width:"",height:"","text-align":""}),this.ns.xAbs=0,this.ns.xPAbs=0,this.ns.yAbs=0,this.ns.yPAbs=0,this.alignMarker.remove(),this.uiResizeAbsolute.destroy(),this.$layer.off(".n2-ss-absolute"),this.$layer.triggerHandler("LayerAbsoluteUnavailable");var s=["parentid","responsiveposition","responsivesize","parentalign","parentvalign","align","valign","left","top","width","height"],n=this.layer.getPropertiesData(s);return this.layer.removeProperties(s),n},i.prototype.loadProperties=function(t){this.layer.createProperty("parentid",null,this.layer.layer,this),this.layer.createProperty("responsiveposition",1,this.layer.layer,this),this.layer.createProperty("responsivesize",1,this.layer.layer,this),this.layer.createDeviceProperty("parentalign",{desktopPortrait:"center"},this.layer.layer,this),this.layer.createDeviceProperty("parentvalign",{desktopPortrait:"middle"},this.layer.layer,this),this.layer.createDeviceProperty("align",{desktopPortrait:t.align||"center"},this.layer.layer,this),this.layer.createDeviceProperty("valign",{desktopPortrait:t.valign||"middle"},this.layer.layer,this),this.layer.createDeviceProperty("left",{desktopPortrait:t.left||0},this.layer.layer,this),this.layer.createDeviceProperty("top",{desktopPortrait:t.top||0},this.layer.layer,this),this.layer.createDeviceProperty("width",{desktopPortrait:t.width||"auto"},this.layer.layer,this),this.layer.createDeviceProperty("height",{desktopPortrait:t.height||"auto"},this.layer.layer,this),this.layer.createProperty("adaptivefont",1,this.layer.layer,this);var i=this.layer.layer;this.subscribeParentCallbacks={},this.layer.getProperty("parentid")&&this.subscribeParent(),i.attr({"data-align":this.layer.getProperty("align"),"data-valign":this.layer.getProperty("valign")})},i.prototype.es=function(){this.alignMarker=$('<div class="n2-ss-layer-cc"></div>').attr("data-handle","cc").appendTo(this.$layer),this.layer.editorUI.absoluteCC=this.alignMarker},i.prototype.hs=function(){this._resizableJustClick=!1,this.uiResizeAbsolute=new c.UIResizeAbsolute(this.$layer,this.layer.fragmentEditor,{_containment:this.$layer[0].parentNode,start:this.os.bind(this),resize:this.rs.bind(this),stop:this.cs.bind(this),create:function(){this.$layer.find(".nui_resize_absolute__handle, .n2-ss-layer-cc").on({mousedown:function(e){this._resizableJustClick=[e.clientX,e.clientY]}.bind(this),mouseup:function(e){if(this._resizableJustClick&&Math.abs(Math.sqrt(Math.pow(this._resizableJustClick[0]-e.clientX,2)+Math.pow(this._resizableJustClick[1]-e.clientY,2)))<1){var t=$(e.currentTarget),i=this.fragmentEditor.layerOptions.layerFeatures;switch(t.data("handle")){case"nw":i.horizontalAlign("left",!1),i.verticalAlign("top",!1);break;case"w":i.horizontalAlign("left",!1),i.verticalAlign("middle",!1);break;case"sw":i.horizontalAlign("left",!1),i.verticalAlign("bottom",!1);break;case"n":i.horizontalAlign("center",!1),i.verticalAlign("top",!1);break;case"cc":i.horizontalAlign("center",!1),i.verticalAlign("middle",!1);break;case"s":i.horizontalAlign("center",!1),i.verticalAlign("bottom",!1);break;case"ne":i.horizontalAlign("right",!1),i.verticalAlign("top",!1);break;case"e":i.horizontalAlign("right",!1),i.verticalAlign("middle",!1);break;case"se":i.horizontalAlign("right",!1),i.verticalAlign("bottom",!1)}}this._resizableJustClick=!1}.bind(this)})}.bind(this),smartguides:function(){return this.fragmentEditor.getSnap(this.layer.group,this.layer)}.bind(this),tolerance:5}),this.layer.editorUI.resize=this.uiResizeAbsolute.$handles,this.$layer.on({"mousedown.n2-ss-absolute":function(e){0===e.button&&0===$(e.target).closest(".nui_resize_absolute__handle, .nui_resize_normal__handle, .nui_spacing__handle").length&&(c.PositionDisplay.get().show("Canvas"),c.PositionDisplay.get().update(e,"Canvas","W: "+parseInt(this.$layer.width())+"px<br>H: "+parseInt(this.$layer.height())+"px"),s.activeElement&&s.activeElement.blur(),s.addEventListener("mouseup",(function(){c.PositionDisplay.get().hide("Canvas")}),{capture:!0,once:!0}))}.bind(this)})},i.prototype.os=function(t,i){this._resizableJustClick&&(this._resizableJustClick=!1),this.rs(t,i),c.PositionDisplay.get().show("Canvas")},i.prototype.rs=function(e,t){c.PositionDisplay.get().update(e,"Canvas","W: "+t.rect.width+"px<br>H: "+t.rect.height+"px"),this.triggerLayerResized()},i.prototype.cs=function(t,i){var s=!1;if("n"===i.axis||"s"===i.axis||i.originalRect.width===i.rect.width){var n=this.layer.getProperty("width");this.layer.isDimensionPropertyAccepted(n)&&(s=!0,this._syncwidth())}var h=!1;if("e"===i.axis||"w"===i.axis||i.originalRect.height===i.rect.height){n=this.layer.getProperty("height");this.layer.isDimensionPropertyAccepted(n)&&(h=!0,this._syncheight())}var o=this.fragmentEditor.getResponsiveRatioHorizontal(),r=this.isSingleAxis()?this.fragmentEditor.getResponsiveRatioHorizontal():this.fragmentEditor.getResponsiveRatioVertical();parseInt(this.layer.getProperty("responsivesize"))||(o=r=1);var a=null;s||(a=Math.round(i.rect.width*(1/o)));var l=null;h||(l=Math.round(i.rect.height*(1/r))),this._setPosition(null,null,i.position.left,i.position.top,a,l,!0),this.triggerLayerResized(),c.PositionDisplay.get().hide("Canvas")},i.prototype._setPosition=function(t,i,s,n,h,r,a){var l=this.layer.getMode();null===t&&(t=this.layer.getProperty("align")),null===i&&(i=this.layer.getProperty("valign")),null===s?s=this.layer.getProperty("left"):a&&(s=this.calculatePositionLeft(t,s)),null===n?n=this.layer.getProperty("top"):a&&(n=this.calculatePositionTop(i,n)),null===h&&(h=this.layer.getProperty("width")),null===r&&(r=this.layer.getProperty("height"));var u=c.History.get().addValue(this.layer,this.layer.historyStoreOnPlacement,["historyStorePosition",l]);u&&u.setValues({align:this.layer.getRawProperty("align"),valign:this.layer.getRawProperty("valign"),left:this.layer.getRawProperty("left"),top:this.layer.getRawProperty("top"),width:this.layer.getRawProperty("width"),height:this.layer.getRawProperty("height")},{align:t,valign:i,left:s,top:n,width:h,height:r}),c.History.get().off(),this.layer.store(o,"width",h,!0,"layer"),this.layer.$.trigger("propertyChanged",["width",h]),this.layer.store(o,"height",r,!0,"layer"),this.layer.$.trigger("propertyChanged",["height",r]),this.layer.store(o,"align",t,!0,"layer"),this.layer.$.trigger("propertyChanged",["align",t]),this.layer.store(o,"valign",i,!0,"layer"),this.layer.$.trigger("propertyChanged",["valign",i]),this.layer.store(o,"left",s,!0,"layer"),this.layer.$.trigger("propertyChanged",["left",s]),this.layer.store(o,"top",n,!0,"layer"),this.layer.$.trigger("propertyChanged",["top",n]),c.History.get().on()},i.prototype.historyStorePosition=function(t,i){this.layer.historyStore(t.align,"align",i),this.layer.historyStore(t.valign,"valign",i),this.layer.historyStore(t.width,"width",i),this.layer.historyStore(t.height,"height",i),this.layer.historyStore(t.left,"left",i),this.layer.historyStore(t.top,"top",i),this.triggerLayerResized()},i.prototype.calculatePositionLeft=function(t,i){var s=this.fragmentEditor.getResponsiveRatioHorizontal();parseInt(this.layer.getProperty("responsiveposition"))||(s=1);var n={left:0,leftMultiplier:1};if(this.parentLayerPlacement&&this.parentLayerPlacement.isVisible()){var h=this.parentLayerPlacement.getPositionSize();if(this.parentLayerPlacement.current instanceof c.PlacementAbsolute){var o=this.parentLayerPlacement.layer.layer[0],r=c.MW.R(o);h.width=o.offsetWidth,h.height=o.offsetHeight,h.left+=r.xAbs+r.xPAbs/100*h.width,h.top+=r.yAbs+r.yPAbs/100*h.height}switch(this.layer.getProperty("parentalign")){case"right":n.left=h.left+this.parent.layer[0].offsetWidth;break;case"center":n.left=h.left+Math.round(this.parent.layer[0].offsetWidth/2);break;default:n.left=h.left}}else{var a=this.$layer.parent();switch(t){case"center":n.left+=Math.round(a[0].offsetWidth/2);break;case"right":n.left+=a[0].offsetWidth}}switch(t){case"left":i=-Math.round((n.left-i)*(1/s));break;case"center":i=-Math.round((n.left-i-this.$layer.width()/2)*(1/s));break;case"right":i=-Math.round((n.left-i-this.$layer.width())*(1/s))}return i},i.prototype.calculatePositionTop=function(t,i){var s=this.isSingleAxis()?this.fragmentEditor.getResponsiveRatioHorizontal():this.fragmentEditor.getResponsiveRatioVertical();parseInt(this.layer.getProperty("responsiveposition"))||(s=1);var n={top:0,topMultiplier:1};if(this.parentLayerPlacement&&this.parentLayerPlacement.isVisible()){var h=this.parentLayerPlacement.getPositionSize();if(this.parentLayerPlacement.current instanceof c.PlacementAbsolute){var o=this.parentLayerPlacement.layer.layer[0],r=c.MW.R(o);h.width=o.offsetWidth,h.height=o.offsetHeight,h.left+=r.xAbs+r.xPAbs/100*h.width,h.top+=r.yAbs+r.yPAbs/100*h.height}switch(this.layer.getProperty("parentvalign")){case"bottom":n.top=h.top+this.parent.layer[0].offsetHeight;break;case"middle":n.top=h.top+Math.round(this.parent.layer[0].offsetHeight/2);break;default:n.top=h.top}}else{var a=this.$layer.parent();switch(t){case"middle":n.top+=Math.round(a[0].offsetHeight/2);break;case"bottom":n.top+=a[0].offsetHeight}}switch(t){case"top":i=-Math.round((n.top-i)*(1/s));break;case"middle":i=-Math.round((n.top-i-this.$layer.height()/2)*(1/s));break;case"bottom":i=-Math.round((n.top-i-this.$layer.height())*(1/s))}return i},i.prototype.moveX=function(t){this._setPosition(null,null,this.layer.getProperty("left")+t,null,null,null,!1)},i.prototype.moveY=function(t){this._setPosition(null,null,null,this.layer.getProperty("top")+t,null,null,!1)},i.prototype.setPositionLeft=function(t){t=this.calculatePositionLeft(this.layer.getProperty("align"),t),this.layer.store(o,"left",t,!0),this.layer.$.trigger("propertyChanged",["left",t])},i.prototype.setPositionTop=function(t){t=this.calculatePositionTop(this.layer.getProperty("valign"),t),this.layer.store(o,"top",t,!0),this.layer.$.trigger("propertyChanged",["top",t])},i.prototype.setPosition=function(t,i){this.setPositionLeft(t),this.setPositionTop(i)},i.prototype.setDeviceBasedAlign=function(){var t=this.layer.getMode();this.layer.deviceProperty[t].align===o&&this.layer.setProperty("align",this.layer.getProperty("align"),"layer"),this.layer.deviceProperty[t].valign===o&&this.layer.setProperty("valign",this.layer.getProperty("valign"),"layer")},i.prototype.setPropertyresponsiveposition=i.prototype.setPropertyresponsivesize=function(t,i,s){this.layer._setProperty(t,parseInt(i),s)},i.prototype.setPropertywidth=i.prototype.setPropertyheight=function(t,i,s){var n=i;this.layer.isDimensionPropertyAccepted(i)||(n=~~i)!=i&&this.layer.$.trigger("propertyChanged",[t,n]),r(function(){this.onResize(!1)}.bind(this),50),this.layer._setProperty(t,n,s)},i.prototype.setPropertyleft=i.prototype.setPropertytop=function(t,i,s){var n=~~i;n!=i&&this.layer.$.trigger("propertyChanged",[t,n]),this.layer._setProperty(t,n,s)},i.prototype.render=function(t){this["_sync"+t]()},i.prototype.renderWithModifier=function(t,i,s){try{"width"!=t&&"height"!=t||!this.layer.isDimensionPropertyAccepted(i)?this["_sync"+t](Math.round(i*s)):this["_sync"+t](i)}catch(i){console.error("_sync"+t)}},i.prototype.startResize=function(){this.doTheResize({slideW:this.fragmentEditor.getResponsiveRatioHorizontal(),slideH:this.isSingleAxis()?this.fragmentEditor.getResponsiveRatioHorizontal():this.fragmentEditor.getResponsiveRatioVertical()},!0,!0)},i.prototype.onResize=function(t){this.resize({slideW:this.fragmentEditor.getResponsiveRatioHorizontal(),slideH:this.isSingleAxis()?this.fragmentEditor.getResponsiveRatioHorizontal():this.fragmentEditor.getResponsiveRatioVertical()},t)},i.prototype.resize=function(t,i){this.parent&&!i||this.addToResizeCollection(this,t,!1)},i.prototype.addToResizeCollection=function(i,s,n){t.ratios=s,t.isThrottled=n;for(var h=0;h<t.layers.length;h++)if(t.layers[h]===this){t.layers.splice(h,1);break}t.layers.push(i),!1===t.raf&&(t.raf=!0,requestAnimationFrame((function(){var i=t;t={raf:!1,ratios:null,isThrottled:!1,layers:[]};for(var s=0;s<i.layers.length;s++)i.layers[s].isDeleted||i.layers[s].doTheResize(i.ratios,!0,i.isThrottled)}))),this.triggerLayerResized(n,s)},i.prototype._syncresponsiveposition=function(){this.onResize(!0)},i.prototype._syncwidth=function(){var t=this.layer.getProperty("width");if(!this.layer.isDimensionPropertyAccepted(t)){if(parseInt(this.layer.getProperty("responsivesize")))t*=this.fragmentEditor.getResponsiveRatioHorizontal();t+="px"}this.$layer.css("width",t)},i.prototype._syncheight=function(){var t=this.layer.getProperty("height");if(!this.layer.isDimensionPropertyAccepted(t)){if(parseInt(this.layer.getProperty("responsivesize")))t*=this.isSingleAxis()?this.fragmentEditor.getResponsiveRatioHorizontal():this.fragmentEditor.getResponsiveRatioVertical();t+="px"}this.$layer.css("height",t)},i.prototype._syncparentalign=function(){var t=this.layer.getProperty("parentalign");this.$layer.data("parentalign",t);var i=this.getParent();i&&i.placement.current.onResize(!1)},i.prototype._syncparentvalign=function(){var t=this.layer.getProperty("parentvalign");this.$layer.data("parentvalign",t);var i=this.getParent();i&&i.placement.current.onResize(!1)},i.prototype._syncleft=function(){var t=this.ns,i=this.layer.getProperty("align"),s=this.layer.getProperty("left");if(parseInt(this.layer.getProperty("responsiveposition"))&&(s*=this.fragmentEditor.getResponsiveRatioHorizontal()),this.parentLayerPlacement&&this.parentLayerPlacement.isVisible()){var n=this.parentLayerPlacement.getPositionSize(),h={left:0};if(this.parentLayerPlacement.current instanceof c.PlacementAbsolute){var o=this.parentLayerPlacement.layer.layer[0],r=c.MW.R(o);n.width=o.offsetWidth,n.height=o.offsetHeight,n.left+=r.xAbs+r.xPAbs/100*n.width,n.top+=r.yAbs+r.yPAbs/100*n.height}switch(this.layer.getProperty("parentalign")){case"right":h.left=n.left+n.width;break;case"center":h.left=n.left+n.width/2;break;default:h.left=n.left}switch(i){case"right":t.xAbs=Math.round(h.left+s),t.xPAbs=-100;break;case"center":t.xAbs=Math.round(h.left+s),t.xPAbs=-50;break;default:t.xAbs=Math.round(h.left+s),t.xPAbs=0}}else{var a=this.layer.layer[0].parentNode.offsetWidth;switch(i){case"right":t.xAbs=Math.round(a+s),t.xPAbs=-100;break;case"center":t.xAbs=Math.round(a/2+s),t.xPAbs=-50;break;default:t.xAbs=Math.round(s),t.xPAbs=0}}this.triggerLayerResized()},i.prototype._synctop=function(){var t=this.ns,i=this.layer.getProperty("valign"),s=this.layer.getProperty("top");if(parseInt(this.layer.getProperty("responsiveposition"))&&(s*=this.isSingleAxis()?this.fragmentEditor.getResponsiveRatioHorizontal():this.fragmentEditor.getResponsiveRatioVertical()),this.parentLayerPlacement&&this.parentLayerPlacement.isVisible()){var n=this.parentLayerPlacement.getPositionSize(),h={height:0};if(this.parentLayerPlacement.current instanceof c.PlacementAbsolute){var o=this.parentLayerPlacement.layer.layer[0],r=c.MW.R(o);n.width=o.offsetWidth,n.height=o.offsetHeight,n.left+=r.xAbs+r.xPAbs/100*n.width,n.top+=r.yAbs+r.yPAbs/100*n.height}switch(this.layer.getProperty("parentvalign")){case"bottom":h.top=n.top+n.height;break;case"middle":h.top=n.top+n.height/2;break;default:h.top=n.top}switch(i){case"bottom":t.yAbs=Math.round(h.top+s),t.yPAbs=-100;break;case"middle":t.yAbs=Math.round(h.top+s),t.yPAbs=-50;break;default:t.yAbs=Math.round(h.top+s),t.yPAbs=0}}else{var a=this.layer.layer[0].parentNode.offsetHeight;switch(i){case"bottom":t.yAbs=Math.round(a+s),t.yPAbs=-100;break;case"middle":t.yAbs=Math.round(a/2+s),t.yPAbs=-50;break;default:t.yAbs=Math.round(s),t.yPAbs=0}}this.triggerLayerResized()},i.prototype._syncresponsivesize=function(){this.onResize(!0)},i.prototype.historyStoreDoubleProp=function(t,i,s,n){i==this.layer.getMode()?(this.layer._setProperty(s,t.value,"history"),this.layer._setProperty(n,t.value2,"history")):(this.layer.deviceProperty[i][s]=t.value,this.layer.deviceProperty[i][n]=t.value2,this.layer.$.trigger("propertyChanged",[s,this.layer.getProperty(s)]),this.layer.$.trigger("propertyChanged",[n,this.layer.getProperty(n)]),this.layer.render(s,null,"history"),this.layer.render(n,null,"history"))},i.prototype.setPropertyalign=function(t,i,s){var n=this.layer.getProperty(t),h=this.layer.getRawProperty("left");c.History.get().off(),this.layer._setProperty(t,i,s),c.History.get().on();var o=c.History.get().addValue(this.layer,this.layer.historyStoreOnPlacement,["historyStoreDoubleProp",this.layer.getMode(),"align","left"]);o&&o.setValues({value:n,value2:h},{value:i,value2:this.layer.getRawProperty("left")})},i.prototype.setPropertyvalign=function(t,i,s){var n=this.layer.getProperty(t),h=this.layer.getRawProperty("top");c.History.get().off(),this.layer._setProperty(t,i,s),c.History.get().on();var o=c.History.get().addValue(this.layer,this.layer.historyStoreOnPlacement,["historyStoreDoubleProp",this.layer.getMode(),"valign","top"]);o&&o.setValues({value:n,value2:h},{value:i,value2:this.layer.getRawProperty("top")})},i.prototype._syncalign=function(t,i){var s=this.layer.getProperty("align");this.$layer.attr("data-align",s),"history"!==i&&s!=t&&this.setPositionLeft(Math.round(this.ns.xAbs+this.ns.xPAbs/100*this.$layer[0].offsetWidth))},i.prototype._syncvalign=function(t,i){var s=this.layer.getProperty("valign");this.$layer.attr("data-valign",s),"history"!==i&&s!=t&&this.setPositionTop(Math.round(this.ns.yAbs+this.ns.yPAbs/100*this.$layer[0].offsetHeight))},i.prototype.fit=function(){var t=this.$layer[0];if(t.scrollWidth>0&&t.scrollHeight>0){var i=!1;if(this.layer.item&&(i=this.layer.item.fitLayer()),!i){this.layer.setProperty("width","auto","layer"),this.layer.setProperty("height","auto","layer");var s=this.$layer.width();Math.abs(this.fragmentEditor.mainContainer.layer.width()-this.$layer.position().left-s)<2&&this.layer.setProperty("width",s,"layer")}}},i.prototype.hide=function(t){this.layer.store(o,t||this.layer.getMode(),0,!0)},i.prototype.show=function(t){this.layer.store(o,t||this.layer.getMode(),1,!0)},i.prototype.changeStatus=function(t,i){},i.prototype.getParent=function(){return!!this.layer.getProperty("parentid")&&$("#"+this.layer.getProperty("parentid")).data("layerObject")},i.prototype.subscribeParent=function(){var t=$("#"+this.layer.property.parentid);this.parent&&!t.is(this.parent.layer)&&(this.parent.layer.off(this.subscribeParentCallbacks),this.parent=!1),this.parent||(this.subscribeParentCallbacks={LayerResized:function(){this.resizeParent.apply(this,arguments)}.bind(this),LayerDeleted:function(e){this.layer.setProperty("parentid","","layer")}.bind(this),LayerAbsoluteUnavailable:function(){this.onLayerAbsoluteUnavailable()}.bind(this),LayerShowChange:function(e,t,i){this.layer.getMode()===t&&(this.parentIsVisible=i)}.bind(this),"n2-ss-activate":function(){this.$layerRow.addClass("n2-parent-active")}.bind(this),"n2-ss-deactivate":function(){this.$layerRow.removeClass("n2-parent-active")}.bind(this),LayerGetDataWithChildren:function(e,t,i){this.layer.getDataWithChildren(t,i)}.bind(this)},this.parent=t.data("layerObject"),this.parentLayerPlacement=this.parent.placement,this.parent.layer.on(this.subscribeParentCallbacks),this.$layer.on("LayerAbsoluteUnavailable.absolute",this.onLayerAbsoluteUnavailable.bind(this)),this.$layer.addClass("n2-ss-layer-has-parent"))},i.prototype.onLayerAbsoluteUnavailable=function(){this.layer.setProperty("parentid","","layer")},i.prototype.unSubscribeParent=function(t){if(this.$layerRow.removeClass("n2-parent-active"),this.$layer.removeClass("n2-ss-layer-has-parent"),this.parent&&(this.$layer.off("LayerAbsoluteUnavailable.absolute"),this.parent.layer.off(this.subscribeParentCallbacks),this.parent=!1,delete this.parentLayerPlacement,this.subscribeParentCallbacks={},"delete"!==t)){var i=this.$layer.position();this._setPosition(null,null,i.left,i.top,null,null,!0)}},i.prototype.unlink=function(e){e&&e.preventDefault(),this.layer.setProperty("parentid","","layer")},i.prototype.parentPicked=function(t,i,s,n,h){var o;for(var r in this.layer.setProperty("parentid","","layer"),this.layer.setProperty("align",n,"layer"),this.layer.setProperty("valign",h,"layer"),this.layer.setProperty("parentalign",i,"layer"),this.layer.setProperty("parentvalign",s,"layer"),this.layer.setProperty("parentid",t.requestID(),"layer"),this.layer.deviceProperty)"desktopPortrait"!==r&&(this.layer.deviceProperty[r].left=o,this.layer.deviceProperty[r].top=o,this.layer.deviceProperty[r].valign=o,this.layer.deviceProperty[r].align=o)},i.prototype._syncparentid=function(){var t=this.layer.getProperty("parentid");t&&""!==t?c.History.get().actionInProgress()?r(this._linkToParentID.bind(this,t,!0),100):this._linkToParentID(t,!1):(this.$layer.removeAttr("data-parentid"),this.unSubscribeParent())},i.prototype._linkToParentID=function(t,i){if(0===$("#"+t).length)this.layer.setProperty("parentid","","layer");else if(!this.parent)if(this.$layer.attr("data-parentid",t).addClass("n2-ss-layer-has-parent"),this.subscribeParent(),i)c.History.get().off(),this._setPosition(null,null,null,null,null,null,!0),c.History.get().on();else{var s=this.$layer.position();this._setPosition(null,null,s.left,s.top,null,null,!0)}},i.prototype._renderModeProperties=function(t){this.$layer.attr("data-align",this.layer.property.align),this.$layer.attr("data-valign",this.layer.property.valign),t&&this.onResize(!0)},i.prototype.doLinearResize=function(t){this.doThrottledTheResize(t,!0)},i.prototype.doTheResize=function(t,i,s){this.layer.isDeleteStarted||(this.render("width"),this.render("height"),this.render("left"),this.render("top"),i||this.triggerLayerResized(s,t))},i.prototype.resizeParent=function(e,t,i){this.addToResizeCollection(this,t,i)},i.prototype.resizeParentLocal=function(){this.resizeParent(o,{slideW:this.fragmentEditor.getResponsiveRatioHorizontal(),slideH:this.isSingleAxis()?this.fragmentEditor.getResponsiveRatioHorizontal():this.fragmentEditor.getResponsiveRatioVertical()},!1)},i.prototype.sync=function(){this._syncalign(null,"history"),this._syncvalign(null,"history"),this._syncwidth(),this._syncheight(),this._synctop(),this._syncleft(),this._syncparentid()},i.prototype.delete=function(){this.layer.getProperty("parentid")&&this.unSubscribeParent("delete")},i})),c.d("PlacementContent",["$","PlacementAbstract"],(function(){"use strict";function t(t,i,s){this.type="content",c.PlacementAbstract.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.PlacementAbstract.prototype),t.prototype.constructor=t,t})),c.d("PlacementDefault",["$","PlacementAbstract"],(function(){"use strict";function t(t,i,s){this.type="default",c.PlacementAbstract.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.PlacementAbstract.prototype),t.prototype.constructor=t,t})),c.d("PlacementNormal",["$","PlacementAbstract"],(function(){var $=c.$;function t(t,i,s){this.type="normal",this.transferredProperties={},c.PlacementAbstract.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.PlacementAbstract.prototype),t.prototype.constructor=t,t.getRegistryDataToFields=function(t){return{margin:$("#layernormal-margin"),height:$("#layernormal-height"),maxwidth:$("#layernormal-maxwidth"),selfalign:$("#layernormal-selfalign")}},t.prototype.preActivation=function(t){if("absolute"===t.type&&this.layer.item&&this.layer.item.needHeight){var i=this.layer.getProperty("height");i.match&&i.match(/[0-9]+%$/)?this.transferredProperties.height=Math.max(100,parseInt(this.$layer.parent()[0].offsetHeight*parseInt(i)/100)):i>0&&(this.transferredProperties.height=i)}},t.prototype.activated=function(t){this.loadProperties(f(t,this.transferredProperties)),this.transferredProperties={},this.startUISpacing(),this.startUISizing(),this.$layer.on({mousedown:function(e){e.stopPropagation()}})},t.prototype.loadProperties=function(t){this.layer.createDeviceProperty("margin",{desktopPortrait:"0|*|0|*|0|*|0"},this.layer.layer,this),this.layer.createDeviceProperty("height",{desktopPortrait:t.height||0},this.layer.layer,this),this.layer.createDeviceProperty("maxwidth",{desktopPortrait:0},this.layer.layer,this),this.layer.createDeviceProperty("selfalign",{desktopPortrait:"inherit"},this.layer.layer,this)},t.cleanLayer=function(t){var i=["desktopPortrait","desktopLandscape","tabletPortrait","tabletLandscape","mobilePortrait","mobileLandscape"];t.css({position:"",margin:"",height:"",maxWidth:""});for(var s=["margin","height","maxwidth","selfalign"],n={},h=0;h<s.length;h++){var o=s[h].toLowerCase();n[o]=t.data(o),t.removeAttr(o),t.removeData(o);for(var r=0;r<i.length;r++){var a=i[r].toLowerCase();n[o]=t.data(a+o),t.removeAttr(a+o),t.removeData(a+o)}}return n},t.prototype.deActivated=function(t){this.layer.$.off(".placementnormal"),this.uiSpacing.destroy(),delete this.layer.editorUI.normalSizing,this.uiResizeNormal.destroy();var i=["margin","height","maxwidth","selfalign"],s=this.layer.getPropertiesData(i);return this.layer.removeProperties(i),this.layer.layer.css({position:"",margin:"",height:"",maxWidth:""}),s},t.prototype._renderModeProperties=function(t){this._syncmargin(),this._syncheight(),this._syncmaxwidth(),this._syncselfalign()},t.prototype._syncmargin=function(){var t=this.layer.getProperty("margin").split("|*|");t.splice(4),C(this.layer.layer[0],{"--margin-top":t[0]+"px","--margin-right":t[1]+"px","--margin-bottom":t[2]+"px","--margin-left":t[3]+"px"}),this.layer.update(),this.uiSpacing.setOption("current",t.join("px ")+"px")},t.prototype.startUISpacing=function(){this.uiSpacing=new c.UISpacingMargin(this.$layer,this.layer.fragmentEditor,{stop:this.onSpacingStop.bind(this)}),this.layer.editorUI.margin=this.uiSpacing.$handles},t.prototype.onSpacingStop=function(t,i){var s=this.layer.getProperty("margin").split("|*|");for(var n in i.changed){var h=i.changed[n];switch(n){case"top":s[0]=Math.round(h);break;case"right":s[1]=Math.round(h);break;case"bottom":s[2]=Math.round(h);break;case"left":s[3]=Math.round(h)}}this.layer.setProperty("margin",s.join("|*|")),$("#layernormal-margin").data("field").insideChange(s.join("|*|"))},t.prototype.startUISizing=function(){var t=!1;this.layer.item&&this.layer.item.needHeight&&(t=!0),this.uiResizeNormal=new c.UIResizeNormal(this.$layer,this.layer.fragmentEditor,{height:t,syncWidth:!0,stopMaxWidth:function(e,t){this.layer.setProperty("maxwidth",t.value)}.bind(this),stopHeight:function(e,t){this.layer.setProperty("height",t.value)}.bind(this)}),this.layer.editorUI.normalSizing=this.uiResizeNormal.$handles},t.prototype._syncheight=function(){var t=parseInt(this.layer.getProperty("height"));t>0?this.layer.layer.css("height",t+"px"):this.layer.layer.css("height",""),this.layer.update()},t.prototype._syncmaxwidth=function(){var t=parseInt(this.layer.getProperty("maxwidth"));t<=0||isNaN(t)?(this.layer.layer.css("maxWidth",""),this.uiResizeNormal.setMaxWidth(-1)):(this.layer.layer.css("maxWidth",t+"px"),this.uiResizeNormal.setMaxWidth(t)),this.layer.update()},t.prototype._syncselfalign=function(){c.ComponentAbstract.selfAlignToStyle(this.layer.layer,this.layer.getProperty("selfalign")),this.layer.update()},t.prototype.sync=function(){this._syncmargin(),this._syncheight(),this._syncmaxwidth()},t})),c.d("Placement","$",(function(){"use strict";function t(t){this.layer=t,this.fragmentEditor=t.fragmentEditor,this.modes={},this.current=o}return t.prototype.allow=function(t){switch(t){case"default":this.modes.default=new c.PlacementDefault(this,this.layer,this.fragmentEditor);break;case"absolute":this.modes.absolute=new c.PlacementAbsolute(this,this.layer,this.fragmentEditor);break;case"normal":this.modes.normal=new c.PlacementNormal(this,this.layer,this.fragmentEditor)}},t.prototype.start=function(){for(var t in this.modes)this.modes[t].start()},t.prototype.setMode=function(t,i){var s,n=!1;(i=i||{},this.modes[t]!==o)?this.current!==this.modes[t]&&(this.current&&(this.modes[t].preActivation(this.current),s=this.current.type,n=this.current.deActivated(this.modes[t])),this.current=this.modes[t],this.layer.layer.attr("data-pm",this.current.type),this.current.activated(i),this.layer.$.triggerHandler("placementChanged",[this.current.type,s])):console.error("Layer placement("+t+") not allowed for this component",this.layer);return n},t.prototype.getType=function(){return this.current.type},t.prototype.startResize=function(){this.current.startResize()},t.prototype.onResize=function(t){"function"==typeof this.current.onResize&&this.current.onResize(t)},t.prototype.updatePosition=function(){this.layer.group.update(),this.layer.layer.trigger("interaction")},t.prototype.doLinearResize=function(t){this.current&&this.current.doLinearResize(t)},t.prototype.sync=function(){this.current.sync()},t.prototype.renderModeProperties=function(t){this.layer.adjustFontSize(!1),this.current._renderModeProperties(t)},t.prototype.delete=function(){this.current.delete()},t.prototype.isVisible=function(){return 1!=+x(this.layer.layer[0],"hide"+this.layer.getMode().toLowerCase())},t.prototype.getPositionSize=function(){var t=this.layer.layer[0];return{left:t.offsetLeft,top:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight}},t})),c.d("PlacementAbstract",["$","Placement"],(function(){"use strict";function t(t,i,s){this.placement=t,this.layer=i,this.fragmentEditor=s,this._triggerLayerResizedThrottled=NextendThrottle(this._triggerLayerResized,30)}return t.prototype.start=function(){this.$layer=this.layer.layer},t.prototype.startResize=function(){},t.prototype.preActivation=function(t){},t.prototype.activated=function(){},t.prototype.deActivated=function(t){return!1},t.prototype._renderModeProperties=function(t){},t.prototype._hide=function(){},t.prototype._show=function(){},t.prototype.doLinearResize=function(t){},t.prototype.sync=function(){},t.prototype.delete=function(){},t.prototype.changeStatus=function(t,i){},t.prototype.onResize=function(t){this.triggerLayerResized(t)},t.prototype.isSingleAxis=function(){if("slide"===this.layer.group.type){if(!this.parent)return!1;if("absolute"===this.parent.placement.getType())return!1}return!0},t.prototype.triggerLayerResized=function(t,i){t?this._triggerLayerResized(t,i):this._triggerLayerResizedThrottled(!0,i)},t.prototype._triggerLayerResized=function(t,i){this.layer.isDeleted||this.$layer.triggerHandler("LayerResized",[i||{slideW:this.fragmentEditor.getResponsiveRatioHorizontal(),slideH:this.isSingleAxis()?this.fragmentEditor.getResponsiveRatioHorizontal():this.fragmentEditor.getResponsiveRatioVertical()},t||!1])},t})),c.d("AnimatedHeadingItemAdmin",["$","FrontendItemAnimatedHeading"],(function(){var $=c.$;function t(t,i){c.FrontendItemAnimatedHeading.prototype.constructor.call(this,t,i)}return t.prototype=Object.create(c.FrontendItemAnimatedHeading.prototype),t.prototype.constructor=t,t.prototype.kill=function(){this.timeline&&(this.timeline.kill(),delete this.timeline);for(var t=0;t<this.Mt.length;t++)this.Mt[t].call(this);this.Mt=[]},t.prototype.delete=function(){$(this.layerElement).off(".animatedHeading"),H(this.listeners),this.extraAnimation&&(this.extraAnimation.remove(),delete this.extraAnimation),this.kill()},t.prototype.start=function(){$(this.layerElement).triggerHandler("deleteAnimatedHeading"),c.r("SSEditor",this.started.bind(this))},t.prototype.started=function(){c.FrontendItemAnimatedHeading.prototype.started.apply(this,arguments),this.layer=$(this.layerElement).data("layerObject"),this.layer.$.on("textAlignUpdated.animatedHeading",this.refreshJustifyContent.bind(this)),$(this.layerElement).on("deleteAnimatedHeading.animatedHeading",this.delete.bind(this)),this.getTimeline(),this.listeners.push(W(this.layerElement,"AnimationSetZero",this.setZero.bind(this)));var t="in";1===parseInt(this.loop)&&(t="loop"),this.layer.readyDeferred.done(function(){this.extraAnimation=new c.TimelineAnimationExtra(this.layer,"animatedHeading",t,{label:n2_("Animated heading"),delay:this.delay,duration:this.totalDuration,setDelay:this.changeIn.bind(this)})}.bind(this))},t.prototype.changeIn=function(t){$("#item_animatedHeadingdelay").val(1e3*t).trigger("change")},t.prototype.setZero=function(){this.timeline.time(0).invalidate()},t})),c.d("CounterItemAdmin",["$","FrontendItemCounter"],(function(){var $=c.$;function t(){c.FrontendItemCounter.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.FrontendItemCounter.prototype),t.prototype.constructor=t,t.prototype.delete=function(){this.$layer.off(".counter"),H(this.listeners),this.extraAnimation&&(this.extraAnimation.remove(),delete this.extraAnimation)},t.prototype.start=function(){this.$layer=$(this.layerElement),this.$layer.triggerHandler("deleteCounter"),c.r("SSEditor",this.started.bind(this))},t.prototype.started=function(){c.FrontendItemCounter.prototype.started.apply(this,arguments),this.layer=this.$layer.data("layerObject"),this.$layer.on("deleteCounter.counter",this.delete.bind(this)),this.setZero(),this.listeners.push(W(this.$layer[0],"AnimationSetZero",this.setZero.bind(this))),this.layer.readyDeferred.done(function(){this.extraAnimation=new c.TimelineAnimationExtra(this.layer,"counter","in",{label:"Counter",delay:this.delay,duration:this.timeline.totalDuration(),setDelay:this.changeDelay.bind(this),setDuration:this.changeDuration.bind(this)})}.bind(this))},t.prototype.changeDelay=function(t){$("#item_"+this.data.name+"animationdelay").val(1e3*t).trigger("change")},t.prototype.changeDuration=function(t){$("#item_"+this.data.name+"animationduration").val(1e3*t).trigger("change")},t.prototype.setZero=function(e){this.timeline.progress(1)},t.prototype.extendTimeline=function(t,i,s){this.timeline.time(0),c.FrontendItemCounter.prototype.extendTimeline.apply(this,arguments)},t})),c.d("HighlightedHeadingItemAdmin",["$","FrontendItemHighlightedHeading"],(function(){var $=c.$;function t(t,i){c.FrontendItemHighlightedHeading.prototype.constructor.call(this,t,i)}return t.prototype=Object.create(c.FrontendItemHighlightedHeading.prototype),t.prototype.constructor=t,t.prototype.delete=function(){this.$layer.off(".highlightedHeading"),H(this.listeners),this.extraAnimation&&(this.extraAnimation.remove(),delete this.extraAnimation)},t.prototype.clean=function(){$(this.layerElement).triggerHandler("deleteHeadingHighlight")},t.prototype.start=function(){this.$layer=$(this.layerElement),c.r("SSEditor",this.started.bind(this))},t.prototype.started=function(){c.FrontendItemHighlightedHeading.prototype.started.apply(this,arguments),this.layer=this.$layer.data("layerObject"),this.layer.$.on("textAlignUpdated",this.refreshJustifyContent.bind(this)),this.$layer.on("deleteHeadingHighlight.highlightedHeading",this.delete.bind(this)),this.setZero(),this.listeners.push(W(this.layerElement,"AnimationSetZero",this.setZero.bind(this)));var t="in";1===parseInt(this.loop)&&(t="loop"),this.layer.readyDeferred.done(function(){this.extraAnimation=new c.TimelineAnimationExtra(this.layer,"highlight",t,{label:n2_("Highlighted heading"),delay:this.delay,duration:this.totalDuration,setDelay:this.changeIn.bind(this)})}.bind(this))},t.prototype.changeIn=function(t){$("#item_highlightedHeadingdelay").val(1e3*t).trigger("change")},t.prototype.setZero=function(){for(var t=0;t<this.paths.length;t++){var i=Math.round(1.05*(this.paths[t].getTotalLength()||2e3));c.MW.R(this.paths[t]).setValues({opacity:1,"stroke-dasharray":i+" "+i})}},t.prototype.getLoopTimeline=function(){return this.getTimeline().invalidate()},t.prototype.extendTimeline=function(t,i,s){var n=this.getTimeline();n.time(0),t.add(n,0),n.invalidate().paused(!1)},t})),c.d("Item","$",(function(){var $=c.$;function t(t,s,n){this.type===o&&(this.type=t.data("item")),this.needHeight=this.constructor.needHeight||!1,this.fragmentEditor=n.fragmentEditor,this.generator=this.fragmentEditor.editor.generator,this.self=this,this.$item=t,this.layer=s,this.itemEditor=n,this.css=[],this.fonts=[],this.styles=[],this.needFill=[],this.values=this.$item.data("itemvalues"),"object"!=typeof this.values&&(this.values=JSON.parse(this.values)),this.pre="div#"+this.fragmentEditor.editor.frontend.elementID+" ",this.defaultValues=n.getItemForm(this.type).values,this.added(),this.$item.data("item",this),this.$item.appendTo(this.layer.getContent()),this.layer.item=this,0===this.$item.children().length&&this.reRender(),$("<div></div>").addClass("n2-ss-item-overlay").css("zIndex","89").appendTo(this.$item),this.$item.find("a").on("click",(function(e){e.preventDefault()})),$(i).trigger("ItemCreated")}return t.needHeight=!1,c.Historical(t),t.prototype.getLabel=function(){return this.type},t.prototype.hasTextScale=function(){return!0},t.prototype.changeValue=function(t,i){this===this.itemEditor.activeItem?$("#item_"+this.type+t).data("field").insideChange(i):this.values[t]=i},t.prototype.activate=function(t,i){this.itemEditor.setActiveItem(this,t,i)&&(c._basicCSS.activate("ss3item"+this.type,this.values,{font:this.fonts,style:this.styles}),this.itemEditor.lastValues[this.type]=this.values)},t.prototype.deActivate=function(){c._basicCSS.deActivate()},t.prototype.render=function(t,i){this.layer.layer.triggerHandler("itemRender"),this.$item.html(""),this.parseAll(t),this._render(t),this.itemEditor.lastValues[this.type]=this.values=i,$("<div></div>").addClass("n2-ss-item-overlay").css("zIndex","89").appendTo(this.$item),c.ImagesLoaded(this.$item[0]).finally(this.layer.update.bind(this.layer)),this.$item.find("a").on("click",(function(e){e.preventDefault()}))},t.prototype._render=function(t){},t.prototype.reRender=function(t){this.values=f({},this.getDefault(),this.values,t),this.render(f({},this.values),this.values)},t.prototype.delete=function(){this.$item.remove(),this.itemEditor.activeItem==this&&(this.itemEditor.activeItem=null)},t.prototype.getHTML=function(t){return t?"["+this.type+' values="'+c.Base64.encode(JSON.stringify(this.values))+'"]':$('<div class="n2-ss-item n2-ss-item-'+this.type+'"></div>').attr("data-item",this.type).attr("data-itemvalues",JSON.stringify(this.values))},t.prototype.getData=function(){return{type:this.type,values:this.values}},t.prototype.getDefault=function(){return{}},t.prototype.added=function(){},t.prototype.addedFont=function(t,i){var s=$("#item_"+this.type+i);s.length&&this.fonts.push({mode:t,name:i,field:s.data("field"),def:this.defaultValues[i]})},t.prototype.addedStyle=function(t,i){var s=$("#item_"+this.type+i);s.length&&this.styles.push({mode:t,name:i,field:s.data("field"),def:this.defaultValues[i]})},t.prototype.parseAll=function(t){for(var i=0;i<this.css.length;i++)this.css[i].destroy();this.css=[];for(i=0;i<this.fonts.length;i++)""===t[this.fonts[i].name]?t[this.fonts[i].name+"class"]=this.fonts[i].className="":(t[this.fonts[i].name+"class"]=this.fonts[i].className=c.CSSRendererFont.getClass(),this.css.push(c.CSSRendererFont.addCSS(c._pre,this.fonts[i].className,t[this.fonts[i].name],c.CSSRendererFont.rendererModes[this.fonts[i].mode])));for(i=0;i<this.styles.length;i++)""===t[this.styles[i].name]?t[this.styles[i].name+"class"]=this.styles[i].className="":(t[this.styles[i].name+"class"]=this.styles[i].className=c.CSSRendererStyle.getClass(),this.css.push(c.CSSRendererStyle.addCSS(c._pre,this.styles[i].className,t[this.styles[i].name],c.CSSRendererStyle.rendererModes[this.styles[i].mode])));for(i=0;i<this.needFill.length;i++)t[this.needFill[i]]!==o&&(t[this.needFill[i]]=this.generator.fill(t[this.needFill[i]]+""))},t.prototype.resizeLayerToImage=function(t){var i=this.layer,s=$("<img>").attr("src",t).on("load",function(){var t=s[0].width,n=s[0].height;if(t>0&&n>0){var h=this.fragmentEditor.editor.getMainContainerElement(),o=h.width(),r=h.height();t>o&&(n=n*o/t,t=o),n>r&&(t=t*r/n),c.History.get().off(),i.setProperty("width",t),i.setProperty("height","auto"),c.History.get().on()}}.bind(this))},t.prototype.fitLayer=function(t){return!1},t})),c.d("ItemManager","$",(function(){var $=c.$;function t(t,i){if(this.suppressChange=!1,this.activeItemOriginalData=null,this.fragmentEditor=t,this.lastValues={},this.startItems(),this.forms={},this.activeForm=!1,!i.isUploadDisabled){var n=s.getElementById("n2-ss-slide-canvas-container");V(n,"dragover",function(e){e.preventDefault()}.bind(this)),V(n,"drop",function(e){e.preventDefault();var t=[];if(e.dataTransfer.items)for(var s=0;s<e.dataTransfer.items.length;s++)"file"===e.dataTransfer.items[s].kind&&t.push(e.dataTransfer.items[s].getAsFile());else for(s=0;s<e.dataTransfer.files.length;s++)t.push(e.dataTransfer.files[s]);if(t.length){var n=[];c.LoadingScreen.startLoading();for(s=0;s<t.length;s++)n.push(new Promise(function(n,h){var o=new XMLHttpRequest,r=new FormData;o.open("POST",i.uploadUrl,!0),o.onload=function(){var t=JSON.parse(o.response);if(t.data&&t.data.name){var i=this.createLayerItem(this.fragmentEditor.mainContainer.getTargetGroupDefault(),{item:"image"});i.item.reRender({image:t.data.url}),i.item.activate()}else c.AjaxHelper.notification(t);n()}.bind(this),o.onerror=function(){h()},r.append("image",t[s]),r.append("path","/"+i.uploadDir),o.send(r)}.bind(this)));Promise.all(n).finally(function(){c.LoadingScreen.stopLoading()}.bind(this))}}.bind(this))}}return t.prototype.setActiveItem=function(t,i,s){if(t!==this.activeItem||s){this.activeItemOriginalData=null;var n=t.type;this.activeItem&&this.activeItem.deActivate(),this.activeForm=this.getItemForm(n);var h=f({},this.activeForm.values,t.values);for(var o in this.activeItem=t,this.suppressChange=!0,h){var r=$("#item_"+n+o).data("field");r&&r.insideChange(h[o])}return this.suppressChange=!1,i&&this.focusFirst(),!0}return!1},t.prototype.focusFirst=function(){var t=this.activeForm.fields.eq(0).data("field");this.fragmentEditor.editor.generator.isDynamicSlide()&&t.connectedField&&t.connectedField instanceof c.FormElementImage||t.focus(!0)},t.prototype.startItems=function(){for(var t=$(".n2_add_layer_box"),i=0;i<t.length;i++)new c.UICanvasItem(t.eq(i),{canvasUIManager:this.fragmentEditor.canvasUIManager,$layer:function(){return this.element.clone()},start:function(){this.fragmentEditor.addLayer.hide()}.bind(this)});t.on("click",function(e){var t;t="absolute"===(e.ctrlKey||e.metaKey?"absolute":this.fragmentEditor.addLayer.getPosition())?this.fragmentEditor.mainContainer.getTargetGroupAbsolute():this.fragmentEditor.mainContainer.getTargetGroupDefault(),this.createLayerItem(t,$(e.currentTarget).data(),"click"),this.fragmentEditor.addLayer.hide()}.bind(this)),$(".n2_add_layer__bar_button[data-add-layer-shortcut]").on({click:function(e){e.preventDefault(),$('.n2_add_layer_box[data-item="'+$(e.currentTarget).data("add-layer-shortcut")+'"]').trigger(e)}.bind(this),mousedown:function(e){$('.n2_add_layer_box[data-item="'+$(e.currentTarget).data("add-layer-shortcut")+'"]').trigger(e)}.bind(this)})},t.prototype.createWithDrag=function(e,t,i,s,n,h){var o;if("absolute"===i){var r=this.fragmentEditor.mainContainer.layer[0].getBoundingClientRect();(o=this.createLayerItem(n.layer,s.data(),"click")).layer.one("LayerCreated",function(){var i="auto"===o.layer[0].style.width,s=e.clientX-r.left;i&&(s=Math.min(s,o.group.layer.width()-o.layer.width()-5)),o.placement.current.setPosition(s,e.clientY-r.top),t.resolve()}.bind(this))}else c.History.get().startBatch(),o=this.createLayerItem(n.layer,s.data(),"click"),c.History.get().addControl("skipForwardUndos"),n.layer.container.insertLayerAt(o,h),o.changeGroup(!1,n.layer),c.History.get().endBatch(),t.resolve()},t.prototype.createLayerItem=function(t,i,s,n){var h,o=i.item;if(o.match(/^structure-/))(h=new c.Row(this.fragmentEditor,t,{})).create(o),h.layer.one("LayerCreated",(function(){h.highlightStructure()}));else{var r=this.getItemForm(o),a={};switch(o){case"image":"slide"===t.type?a.size="100%|*|auto":a.size="auto|*|auto"}var l=$("<div></div>").attr("data-item",o).data("itemvalues",_({},r.values,this.getLastValues(o),a)).addClass("n2-ss-item n2-ss-item-"+o);h=this._createLayer(l,t,f($('.n2_add_layer_box[data-item="'+o+'"]').data("layerproperties"),n)),c.History.get().addSimple(this,this.historyDelete,this.historyCreate,[t,h,i])}return h.layer.one("LayerCreated",function(){"click"===s?h.activate(!0):h.activate(),this.fragmentEditor.layerWindow.tab.displayTab("content")}.bind(this)),h},t.prototype.getLastValues=function(t){return this.lastValues[t]!==o?this.lastValues[t]:{}},t.prototype.getItemClass=function(t){var i="Item"+c.StringHelper.capitalize(t);return c[i]===o?"Item":i},t.prototype._createLayer=function(t,i,s){var n=this.fragmentEditor.layerOptions.layerFeatures.layerDefault;for(var h in n)null!==n[h]&&(s[h]=n[h]);var o=new c.Layer(this.fragmentEditor,i,s);return o.create(o._createLayer().append(t)),o.renderModeProperties(),o},t.prototype.getItemForm=function(t){if(this.forms[t]===o){var s=$('.n2_ss_layer_window__tab_panel[data-panel="item/'+t+'"]'),n={form:s,values:i["itemValues/"+t],fields:s.find('[name^="item_"]'),fieldNameRegexp:new RegExp("item_"+t+"\\[(.*?)\\]","")};n.fields.on({nextendChange:this.updateCurrentItem.bind(this),keydown:this.updateCurrentItemDeBounced.bind(this)}),this.forms[t]=n}return this.forms[t]},t.prototype.updateCurrentItem=function(e){if(!this.suppressChange){null===this.activeItemOriginalData&&(this.activeItemOriginalData=f({},this.activeItem.values));var t={},i={};if(this.activeForm.fields.each(function(s,n){var h=(n=$(n)).attr("name").match(this.activeForm.fieldNameRegexp)[1];i[h]=t[h]=n.val()}.bind(this)),e&&"nextendChange"===e.type){var s=c.History.get().addValue(this,this.historyUpdateCurrentItem,[this.activeItem]);s&&s.setValues(this.activeItemOriginalData,f({},i)),this.activeItemOriginalData=null}this.activeItem.render(f({},this.activeItem.getDefault(),t),i)}},t.prototype.historyUpdateCurrentItem=function(t,i){var s=i.getSelf();s.reRender(_({},t)),s.values=t,this.activeItem===s&&s.activate(!1,!0)},t.prototype.updateCurrentItemDeBounced=NextendDeBounce((function(e){this.updateCurrentItem(e)}),100),t.prototype.historyDelete=function(t,i){i.getSelf().delete()},t.prototype.historyCreate=function(t,i,s){var n=this.createLayerItem(t.getSelf(),s);i.setSelf(n)},t.prototype.getSelf=function(){return this},t})),c.d("HeadingItemSplitTextAdmin",["$","FrontendItemHeadingSplitText"],(function(){var $=c.$;function t(t,i,s,n,h,o,r,a){if(""!=h)try{h=JSON.parse(c.Base64.decode(h))}catch(t){h=!1}else h=!1;if(""!=r)try{r=JSON.parse(c.Base64.decode(r))}catch(t){r=!1}else r=!1;h||$("#"+i).closest(".n2-ss-layer").triggerHandler("layerExtraAnimationRemoved"),(h||r)&&(this.ls=!1,c.FrontendItemHeadingSplitText.prototype.constructor.call(this,t,i,s,n,h,o,r,a))}return t.prototype=Object.create(c.FrontendItemHeadingSplitText.prototype),t.prototype.constructor=t,t.prototype.delete=function(){this.ls=!0,delete this.layerElement.n2SplitText,H(this.listeners),this.extraAnimationIn&&(this.extraAnimationIn.remove(),delete this.extraAnimationIn),this.extraAnimationOut&&(this.extraAnimationOut.remove(),delete this.extraAnimationOut)},t.prototype.start=function(t,i,s,n,h,o){this.layerElement.n2SplitText&&this.layerElement.n2SplitText.delete(),this.layerElement.n2SplitText=this,this.$layer=$(this.layerElement),c.r("SSEditor",this.started.bind(this,t,i,s,n,h,o))},t.prototype.started=function(t,i,s,n,h,o){this.ls||(c.FrontendItemHeadingSplitText.prototype.started.apply(this,arguments),this.setZero(),this.listeners.push(W(this.layerElement,"AnimationSetZero",this.setZero.bind(this))),this.layer=this.$layer.data("layerObject"),s&&this.layer.readyDeferred.done(function(){this.extraAnimationIn=new c.TimelineAnimationExtra(this.layer,"splitText","in",{label:n2_("Text animation in"),delay:n,duration:this.in.totalDuration,setDelay:this.changeIn.bind(this),click:this.editIn.bind(this)})}.bind(this)),h&&this.layer.readyDeferred.done(function(){this.extraAnimationOut=new c.TimelineAnimationExtra(this.layer,"splitText","out",{label:n2_("Text animation out"),delay:o,duration:this.out.totalDuration,setDelay:this.changeOut.bind(this),click:this.editOut.bind(this)})}.bind(this)))},t.prototype.changeIn=function(t){$("#item_headingsplit-text-delay-in").val(1e3*t).trigger("change")},t.prototype.editIn=function(t){$("#item_headingsplit-text-animation-in").parent().find(".n2-form-element-button").trigger("click")},t.prototype.changeOut=function(t){$("#item_headingsplit-text-delay-out").val(1e3*t).trigger("change")},t.prototype.editOut=function(t){$("#item_headingsplit-text-animation-out").parent().find(".n2-form-element-button").trigger("click")},t.prototype.setZero=function(e,t){var i={opacity:1,scale:1,x:0,y:0,rotationX:0,rotationY:0,rotationZ:0};c.MW.X(c.MW.D(this.splitText.words),i),c.MW.X(c.MW.D(this.splitText.chars),i),this.in.invalidate=!0,this.out.invalidate=!0},t})),c.d("PluginAnimatable","$",(function(){"use strict";function t(t){this.component=t,t.isAnimatable=!0}return t.prototype.addProperties=function(t){this.component.createProperty("mouseenter","",t),this.component.createProperty("click","",t),this.component.createProperty("mouseleave","",t),this.component.createProperty("play","",t),this.component.createProperty("pause","",t),this.component.createProperty("stop","",t)},t})),c.d("PluginShowOn","$",(function(){"use strict";function t(t){this.component=t}return t.prototype.addProperties=function(t){this.component.createProperty("desktopPortrait",1,t,this),this.component.createProperty("desktopLandscape",1,t,this),this.component.createProperty("tabletPortrait",1,t,this),this.component.createProperty("tabletLandscape",1,t,this),this.component.createProperty("mobilePortrait",1,t,this),this.component.createProperty("mobileLandscape",1,t,this)},t.prototype._syncdesktopPortrait=function(){var t=this.component.getProperty("desktopPortrait");this.component.syncShowOnDevice("desktopPortrait",t)},t.prototype._synctabletPortrait=function(){var t=this.component.getProperty("tabletPortrait");this.component.syncShowOnDevice("tabletPortrait",t)},t.prototype._syncmobilePortrait=function(){var t=this.component.getProperty("mobilePortrait");this.component.syncShowOnDevice("mobilePortrait",t)},t.prototype._syncdesktopLandscape=function(){var t=this.component.getProperty("desktopLandscape");this.component.syncShowOnDevice("desktopLandscape",t)},t.prototype._synctabletLandscape=function(){var t=this.component.getProperty("tabletLandscape");this.component.syncShowOnDevice("tabletLandscape",t)},t.prototype._syncmobileLandscape=function(){var t=this.component.getProperty("mobileLandscape");this.component.syncShowOnDevice("mobileLandscape",t)},t})),c.d("Col",["$","ContentAbstract"],(function(){var $=c.$;function t(t,i,s){this.label="Column",this.type="col",this.innerContainer="> .n2-ss-layer-col",this.localStyle=[{group:"normal",selector:"-inner",css:{}},{group:"hover",selector:"-inner:HOVER",css:{}}],c.ContentAbstract.prototype.constructor.call(this,t,i,s),this.placement.allow("default")}return t.prototype=Object.create(c.ContentAbstract.prototype),t.prototype.constructor=t,t.getRegistryDataToFields=function(t){var i={maxwidth:$("#layercol-maxwidth"),padding:$("#layercol-padding"),inneralign:$("#layercol-inneralign"),verticalalign:$("#layercol-verticalalign"),href:$("#layercol-href"),"href-target":$("#layercol-href-target"),"aria-label":$("#layercol-aria-label"),bgimage:$("#layercol-background-image"),bgimagex:$("#layercol-background-focus-x"),bgimagey:$("#layercol-background-focus-y"),stylemode:$("#layerfields-col-background-mode"),bgcolor:$("#layercol-background-color"),bgcolorgradient:$("#layercol-background-gradient"),bgcolorgradientend:$("#layercol-background-color-end"),borderradius:$("#layercol-border-radius"),boxshadow:$("#layercol-boxshadow"),borderwidth:$("#layercol-border-width"),borderstyle:$("#layercol-border-style"),bordercolor:$("#layercol-border-color"),opened:$("#layercol-opened"),colwidth:$("#layercol-colwidth"),order:$("#layercol-order")};return t.initStyleMode("column",i.stylemode,["#layerfields-col-border-mode"]),t.fragmentEditor.editor.generator.registerField(i.href),t.fragmentEditor.editor.generator.registerField(i.bgimage),t.fragmentEditor.editor.generator.registerField(i.bgcolor),t.fragmentEditor.editor.generator.registerField(i.bgcolorgradientend),i},t.prototype.getIcon=function(){return"ssi_16 ssi_16--column"},t.prototype._createLayer=function(){return $('<div class="n2-ss-layer"><div class="n2-ss-layer-col n2-ss-layer-with-background n2-ss-layer-content"></div></div>').attr("data-sstype",this.type)},t.prototype.addProperties=function(t){c.ContentAbstract.prototype.addProperties.call(this,t),this.createProperty("colwidth","1",t),this.createProperty("href","",t),this.createProperty("href-target","_self",t),this.createProperty("aria-label","",t),this.createAdvancedProperty(new c.LayerAdvancedProperty("borderradius",0,{"-hover":o},this,"stylemode"),t),this.createAdvancedProperty(new c.LayerAdvancedProperty("boxshadow","0|*|0|*|0|*|0|*|00000080",{"-hover":o},this,"stylemode"),t),this.createAdvancedProperty(new c.LayerAdvancedProperty("borderwidth","0|*|0|*|0|*|0",{"-hover":o},this,"stylemode"),t),this.createAdvancedProperty(new c.LayerAdvancedProperty("borderstyle","solid",{"-hover":o},this,"stylemode"),t),this.createAdvancedProperty(new c.LayerAdvancedProperty("bordercolor","ffffffff",{"-hover":o},this,"stylemode"),t),this.createDeviceProperty("order",{desktopPortrait:0},t)},t.prototype.create=function(t){c.ContentAbstract.prototype.create.apply(this,arguments),this._syncorder(),this._syncborder(),this._syncborderradius(),this._syncboxshadow(),this._onReady()},t.prototype.load=function(t,i){c.ContentAbstract.prototype.load.call(this,t,i),this._syncorder(),this._syncborder(),this._syncborderradius(),this._syncboxshadow(),this._onReady()},t.prototype.createRow=function(){this.$content=this.layer.find(".n2-ss-layer-content:first"),this.container=new c.LayerContainer(this),this.container.setLayerContainerElement(this.$content),this.addClassElement(this.layer),this.addClassElement(this.$content,"-inner"),this._createLayerListRow();var t=$('<div class="n2_layer_navigation_list_layer__title_label_folder" data-action="open-close"><i class="ssi_16"></i></div>').prependTo(this.$rowLabel).on("click",this.switchOpened.bind(this));c._tooltip.addElement(t,n2_("Open/Close")),this.container.$ul.appendTo(this.layerRow),this.readyDeferred.done(this._syncopened.bind(this))},t.prototype.getPlacement=function(){return"default"},t.prototype._start=function(t){c.ContentAbstract.prototype._start.call(this,t),t&&(this.layer.addClass("n2_layer_col_highlight"),r(function(){this.isDeleted||this.layer.removeClass("n2_layer_col_highlight")}.bind(this),2e3))},t.prototype.getRealOrder=function(){var t=this.getProperty("order");return 0==t?10:t},t.prototype._syncorder=function(){var t=this.getProperty("order");0==t?this.layer.css("order",""):this.layer.css("order",String(2*t)),this.group.refreshUI()},t.prototype._synccolwidth=function(){this.widthPercentage=100*new Fraction(this.getProperty("colwidth")).valueOf()},t.prototype.getWidthPercentage=function(){return this.widthPercentage},t.prototype.setTemporaryWidth=function(){},t.prototype._synchref=t.prototype["_synchref-target"]=t.prototype["_syncaria-label"]=function(){},t.prototype._syncborderradius=t.prototype["_syncborderradius-hover"]=function(){var t=this.getProperty("borderradius");t>0?this.addLocalStyle("normal","borderradius","border-radius:"+t+"px;"):this.addLocalStyle("normal","borderradius","");var i=this.getProperty("borderradius-hover");i&&i!=t?this.addLocalStyle("hover","borderradius","border-radius:"+i+"px;"):this.addLocalStyle("hover","borderradius","")},t.prototype._syncborderwidth=t.prototype._syncbordercolor=t.prototype._syncborderstyle=t.prototype["_syncborderstyle-hover"]=t.prototype["_syncbordercolor-hover"]=t.prototype["_syncborderwidth-hover"]=function(){this._syncborder()},t.prototype._syncborder=function(){var t=this.getProperty("borderstyle"),i=this.getProperty("bordercolor"),s=this.getProperty("borderwidth");this.addLocalStyle("normal","border",this.getBorderCSS(t,i,s));var n="",h=!1,r=this.getProperty("borderstyle-hover"),a=this.getProperty("bordercolor-hover"),c=this.getProperty("borderwidth-hover");r!==o&&r!=t&&(h=!0),a!==o&&a!=i&&(h=!0),c!==o&&c!=s&&(h=!0),h&&(r===o&&(r=t),a===o&&(a=i),c===o&&(c=s),n=this.getBorderCSS(r,a,c)),this.addLocalStyle("hover","border",n),this.update()},t.prototype.getBorderCSS=function(t,i,s){var n="";if("none"!==t){n+="border-color:"+N2Color.hex2rgbaCSS(i)+";",n+="border-style:"+t+";";n+="border-width:"+(s=s.split("|*|")).join("px ")+"px;"}return n},t.prototype._syncboxshadow=t.prototype["_syncboxshadow-hover"]=function(){var t=this.getProperty("boxshadow");this.addLocalStyle("normal","boxshadow",this.getBoxShadowCSS(t.split("|*|")));var i="",s=this.getProperty("boxshadow-hover");s!==o&&s!=t&&(i=this.getBoxShadowCSS(s.split("|*|"))),this.addLocalStyle("hover","boxshadow",i)},t.prototype.getBoxShadowCSS=function(t){return 0==t[0]&&0==t[1]&&0==t[2]&&0==t[3]||0==N2Color.hex2alpha(t[4])?"":"box-shadow:"+t[0]+"px "+t[1]+"px "+t[2]+"px "+t[3]+"px "+N2Color.hex2rgbaCSS(t[4])+";"},t.prototype.delete=function(){this.group.container.getLayerCount()>1?this._delete():this.group.delete()},t.prototype.renderModeProperties=function(t){this._syncorder(),c.ContentAbstract.prototype.renderModeProperties.call(this,t)},t.prototype.setPropertystylemode=function(){c.ContentAbstract.prototype.setPropertystylemode.apply(this,arguments),this.syncAdvancedField("borderradius"),this.syncAdvancedField("boxshadow"),this.syncAdvancedField("borderwidth"),this.syncAdvancedField("borderstyle"),this.syncAdvancedField("bordercolor")},t.prototype.getOrderedIndex=function(){return this.group.getOrderedColumns().indexOf(this)},t.prototype.getContextMenuItems=function(){var t=c.ComponentCommonAbstract.prototype.getContextMenuItems.call(this);return t.push({priority:55,label:n2_("Duplicate"),icon:"ssi_16 ssi_16--duplicate",action:this.duplicate.bind(this)}),t.push({priority:1e3,label:n2_("Delete"),icon:"ssi_16 ssi_16--delete",action:this.delete.bind(this),color:"red"}),t},t}));var lt=["$","Historical","LayerDataStorage"];c.d("ComponentAbstract",lt,(function(){var $=c.$,t=0;function n(s,h,r){this.supports=this.supports||[],this.supports.push("PluginShowOn"),this.isActive=!1,this.isAnimatable=!1,this.container=o,this.plugins=[];for(var a=0;a<this.supports.length;a++)this.plugins.push(new c[this.supports[a]](this));this.isRenameAllowed=this.isRenameAllowed!==o&&this.isRenameAllowed,this.contextualBarPosition=this.contextualBarPosition||"left",this.editorUI={},this.showsOnCurrent=!0,this.counter=++t,i.layers[this.counter]=this,this.self=this,this.originalProperties=r||{},c.LayerDataStorage.prototype.constructor.call(this),this.readyDeferred=$.Deferred(),this.isDeleteStarted=!1,this.isDeleted=!1,this.$=$(this),this.proxyRefreshTextAlign=this.refreshTextAlign.bind(this),this.status=n.STATUS.UNDEFINED,this.fragmentEditor=s,this.group=h,this.classElements=[],this.localStyleSyncThrottled=NextendThrottle(this.localStyleSync,50),this.placement=new c.Placement(this)}return i.layers=[],n.STATUS={UNDEFINED:0,NORMAL:1,LOCKED:2,HIDDEN:3},n.STATUS_INV={0:"UNDEFINED",1:"NORMAL",2:"LOCKED",3:"HIDDEN"},n.selfAlignToStyle=function(t,i){var s=t[0].style;"left"===i?s.setProperty("align-self","var(--ss-fs)"):"center"===i?s.setProperty("align-self",i):"right"===i?s.setProperty("align-self","var(--ss-fe)"):s.removeProperty("align-self")},n.innerAlignToStyle=function(t,i){var s=t[0].style;"left"===i?(s.textAlign=i,s.setProperty("--ssselfalign","var(--ss-fs)")):"center"===i?(s.textAlign=i,s.setProperty("--ssselfalign",i)):"right"===i?(s.textAlign=i,s.setProperty("--ssselfalign","var(--ss-fe)")):(s.removeProperty("text-align"),s.removeProperty("--ssselfalign"))},n.prototype=Object.create(c.LayerDataStorage.prototype),n.prototype.constructor=n,c.Historical(n),n.prototype.onSelfChange=function(){this.animations.setSelf(this.self.animations)},n.prototype.getUILabel=function(){return this.label},n.prototype.hasUp=function(){return!1},n.prototype.up=function(e){e.stopImmediatePropagation()},n.prototype.addProperties=function(t){this.createDeviceProperty("fontsize",{desktopPortrait:100},t),this.callPlugin("addProperties",t)},n.prototype.callPlugin=function(t){for(var i=Array.prototype.slice.call(arguments,1),s=0;s<this.plugins.length;s++)this.plugins[s][t]!==o&&this.plugins[s][t].apply(this.plugins[s],i)},n.prototype.getSubType=function(){return""},n.prototype._hide=function(){this.layer.css("display","none"),this.showsOnCurrent=!1,this.update()},n.prototype._show=function(){parseInt(this.property[this.fragmentEditor.getMode()])&&(this.layer.css("display",""),this.showsOnCurrent=!0),this.update()},n.prototype.getRootElement=function(){return this.layer},n.prototype.create=function(t){this.addProperties(!1),this.layer=t,this.animations=new c.BackendLayerAnimationController(this),this.layer.addClass("n2_layer--creation-in-progress"),this.layer.data("layerObject",this),this.layer.triggerHandler("layerStarted",[this]),this.group.container.insert(this),this.group.onChildCountChange(),this.onBeforeStart(),this.$.triggerHandler("create"),this._start(!0)},n.prototype.load=function(t,i){this.addProperties(t),this.layer=t.data("layerObject",this),this.animations=new c.BackendLayerAnimationController(this),this.layer.triggerHandler("layerStarted",[this]),this.onBeforeStart(),this.$.triggerHandler("load"),this._start(!1);var s=t.data("status");null!==s&&s!==o?this.changeStatus(s):this.changeStatus(n.STATUS.NORMAL),i||this.regenerateUniqueClass();var h=this.getProperty("uniqueclass");h&&this.fragmentEditor.removeRules(h)},n.prototype.onBeforeStart=function(){},n.prototype._start=function(t){},n.prototype.afterStart=function(t){t?c.ImagesLoaded(this.layer[0]).finally(function(){this.isDeleteStarted||(this.placement.startResize(),this.layer.css("visibility",""),this.layer.triggerHandler("LayerCreated"),this.layer.removeClass("n2_layer--creation-in-progress"),s.dispatchEvent(new CustomEvent("EditorInvalidated")))}.bind(this)):(this.placement.startResize(),this.layer.css("visibility",""))},n.prototype.updateAnimations=function(){},n.prototype.createLayerAnimations=function(t,i){var s=[];if(this.container)for(var n=this.container.getSortedLayers(),h=0;h<n.length;h++)s.push.apply(s,n[h].createLayerAnimations(t,i));return s},n.prototype._onReady=function(){this.originalProperties={},this.readyDeferred.resolve()},n.prototype.isReady=function(){return"resolved"===this.readyDeferred.state()},n.prototype.getLabel=function(){return this.label},n.prototype.getName=function(){return this.getDefaultName()},n.prototype.getIcon=function(){return"ssi_16 ssi_16--layer"},n.prototype.getDefaultName=function(){return this.label},n.prototype.setGroup=function(t){this.group.$.off("textAlignUpdated.sslayer"+this.counter),this.group=t,t.container.syncLayerRow(this),this.group.$.on("textAlignUpdated.sslayer"+this.counter,this.proxyRefreshTextAlign)},n.prototype.changeGroup=function(t,i){var s=this.group;s.$.off("textAlignUpdated.sslayer"+this.counter),this.group=i,i.container.syncLayerRow(this),i.$.on("textAlignUpdated.sslayer"+this.counter,this.proxyRefreshTextAlign),this.userGroupChange(s,t,i,this.getIndex()),s.update()},n.prototype.userGroupChange=function(t,i,s,n){if(t===s)this.userIndexChange(i,n);else{var h=c.History.get().addValue(this,this.historyUserGroupChange,[]);h&&h.setValues({historyGroup:t,index:i},{historyGroup:s,index:n})}},n.prototype.historyUserGroupChange=function(t){var i=this.group,s=t.historyGroup.getSelf(),n=t.index;s.container.insertLayerAt(this,n),this.group.$.off("refreshTextAlign.sslayer"+this.counter),this.group=s,s.container.syncLayerRow(this),s.onChildCountChange(),i.update()},n.prototype.userIndexChange=function(t,i){var s=c.History.get().addValue(this,this.historyUserIndexChange);s&&s.setValues(t,i),this.group.container.insertLayerAt(this,i)},n.prototype.historyUserIndexChange=function(t){this.group.container.insertLayerAt(this,t)},n.prototype.getLayerListParent=function(){return this.group.container.$ul},n.prototype._createLayerListRow=function(t){this.layerRow=$('<div class="n2_layer_navigation_list_layer"></div>').attr("data-type",this.type).data("layer",this).appendTo(this.getLayerListParent()),this.$rowLabel=$('<div class="n2_layer_navigation_list_layer__title_label"></div>'),this.layerTitleSpan=$('<div class="n2_layer_navigation_list_layer__title_label_text">'+this.getName()+"</div>").appendTo(this.$rowLabel),this.layerTitle=$('<div class="n2_layer_navigation_list_layer__title"></div>').append(this.$rowLabel).appendTo(this.layerRow),this.$layerRowActions=$('<div class="n2_layer_navigation_list_layer__title_actions"></div>').appendTo(this.layerTitle),t!==o&&this.$layerRowActions.append(t),this.$layerRowMore=$('<div class="n2_layer_navigation_list_layer__title_action"><i class="ssi_16 ssi_16--more"></i></div>').on("click",function(){c.WindowManager.actionPrevent("ComponentRowActivate"),this.onContextMenu(this.$layerRowMore[0],{y:6})}.bind(this)).appendTo(this.$layerRowActions),c._tooltip.add(this.layerRow),new c.UILayerListItem(this.layerRow,{UIManager:this.fragmentEditor.mainContainer.layerListUIManager,layer:this,$item:this.layerRow}),this.$layerRowIcon=$('<div class="n2_layer_navigation_list_layer__title_label_icon"><i class="'+this.getIcon()+'"></i></div>').prependTo(this.$rowLabel)},n.prototype.update=function(){this.readyDeferred.done(this.placement.updatePosition.bind(this.placement))},n.prototype.getHTML=function(t){var i=this._createLayer();for(var s in i.attr("data-pm",this.placement.getType()),this.property)"width"!=s&&"height"!=s&&"left"!=s&&"top"!=s&&i.attr("data-"+s.toLowerCase(),this.property[s]);for(var s in this.deviceProperty)for(var n in this.deviceProperty[s])i.attr("data-"+s.toLowerCase()+n,this.deviceProperty[s][n]);for(var s in this.deviceProperty.desktop)i.css(s,this.deviceProperty.desktop[s]+"px");if(this.container!==o){var h=i;this.innerContainer!==o&&(h=i.find(this.innerContainer)),h.append(this.container.getHTML(t))}var r=this.getProperty("id");return""!==r&&i.attr("id",r),this.status>c.ComponentAbstract.STATUS.NORMAL&&i.attr("data-status",this.status),i.attr("data-animv2",this.animations.getAnimationsCode()),i},n.prototype.duplicate=function(t){var i=this.getHTML(!1);if("absolute"===this.placement.getType()){var s=i.attr("id");s&&(s=$.fn.uid(),i.attr("id",s),i.attr("data-id",s)),i.attr("data-parentid")?(i.data("desktopportraittop",0),i.data("desktopportraitleft",0)):(i.data("desktopportraittop",i.data("desktopportraittop")+40),i.data("desktopportraitleft",i.data("desktopportraitleft")+40)),i.attr("data-parentid","")}var n=this.fragmentEditor.insertComponentWithNode(this.group,i,this.getIndex()+1,!1,!0);return this.layerRow.trigger("mouseleave"),t&&n.activate(),c.History.get().addSimple(this,this.historyDeleteDuplicated,this.historyDuplicate,[n,!!n.container&&n.container.getAllLayers()]),n},n.prototype.historyDeleteDuplicated=function(t){t.getSelf().delete()},n.prototype.historyDuplicate=function(t,i){var s=this.duplicate(!1);if(t.setSelf(s),i)for(var n=s.container.getAllLayers(),h=0;h<n.length;h++)i[h].setSelf(n[h])},n.prototype.historyDelete=function(){this.delete()},n.prototype.historyRestore=function(t,i,s,n){var h=this.fragmentEditor.insertComponentWithNode(this.group.getSelf(),t.clone(),s,!1,!0);if(this.setSelf(h),n)for(var o=h.container.getAllLayers(),r=0;r<o.length;r++)n[r].setSelf(o[r])},n.prototype.delete=function(){c.PositionDisplay.get().hide(),c._tooltip.onLeave(),this._delete()},n.prototype._delete=function(){if(this.isDeleteStarted=!0,this.fragmentEditor.getActiveLayer()===this&&(c.WindowManager.actionPrevent("ComponentRowActivate"),this.fragmentEditor.mainContainer.activate()),c.History.get().startBatch(),c.History.get().addSimple(this,this.historyRestore,this.historyDelete,[this.getHTML(!1),this.group,this.getIndex(),!!this.container&&this.container.getAllLayers()]),this.deActivate(),this.container!==o){c.History.get().off();for(var t=this.container.getSortedLayers(),i=0;i<t.length;i++)t[i]._delete();c.History.get().on()}c.History.get().endBatch(),this.item!==o&&this.item.delete(),this.placement.delete(),this.layer.trigger("mouseup"),this.isDeleted=!0,this.fragmentEditor.mainContainer.layerDeleted(this),this.layer.triggerHandler("LayerDeleted"),this.getRootElement().remove(),this.layerRow.remove(),this.group.isDeleteStarted||(this.group.update(),this.group.$.off("refreshTextAlign.sslayer"+this.counter)),this.$.trigger("layerDeleted"),delete this.layer,delete this.itemEditor,delete this.animation,this.group.onChildCountChange()},n.prototype.getData=function(t){var i={type:this.type,pm:this.placement.getType()};i.animv2=this.animations.getData(),this.status>c.ComponentAbstract.STATUS.NORMAL&&(i.status=this.status);var s=f({},this.property);for(var n in this.deviceProperty)for(var h in this.deviceProperty[n]){delete s[h];var r=this.deviceProperty[n][h];if(r!==o){switch(h){case"width":case"height":this.isDimensionPropertyAccepted(r)||(r=parseFloat(r));break;case"fontsize":case"left":case"top":case"gutter":case"wrap":r=parseFloat(r)}i[n.toLowerCase()+h]=r}}for(var a in s)i[a.toLowerCase()]=s[a];return i},n.prototype.onChildCountChange=function(){},n.prototype.getDataWithChildren=function(t,i){return-1===i.indexOf(this)&&(i.push(this),t.push(this.getData({layersIncluded:!0,itemsIncluded:!0})),this.layer.triggerHandler("LayerGetDataWithChildren",[t,i])),t},n.prototype.markOver=function(){this.layer.addClass("n2-ss-mouse-over"),this.group&&this.group.markEnter()},n.prototype.markOut=function(){this.layer.removeClass("n2-ss-mouse-over"),this.group&&this.group.markLeave()},n.prototype.markEnter=function(e){this.layer.addClass("n2-ss-mouse-hover"),this.group.markEnter()},n.prototype.markLeave=function(e){this.layer.removeClass("n2-ss-mouse-hover"),this.group.markLeave()},n.prototype.sync=function(){if(this._syncid(),this.container)for(var t=this.container.getSortedLayers(),i=0;i<t.length;i++)t[i].sync();this.placement.sync()},n.prototype._syncid=function(){var t=this.getProperty("id");""===t?this.layer.removeAttr("id"):this.layer.attr("id",t)},n.prototype.requestID=function(){var t=this.getProperty("id");return""===t&&(t=$.fn.uid(),this.setProperty("id",t,"layer")),t},n.prototype.requestUniqueClass=function(){var t=this.getProperty("uniqueclass");return t||(t=$.fn.generateUniqueClass("n-uc-"),c.History.get().off(),this.setProperty("uniqueclass",t,"layer"),c.History.get().on()),t},n.prototype.regenerateUniqueClass=function(){this.getProperty("uniqueclass")&&this.setProperty("uniqueclass",$.fn.generateUniqueClass("n-uc-"),"layer")},n.prototype._syncuniqueclass=function(){for(var t=this.getProperty("uniqueclass"),i=0;i<this.classElements.length;i++)this.classElements[i].$el.removeClass((function(t,i){return(i.match(/n-uc-[a-z0-9\-]+/gi)||[]).join(" ")})).addClass(t+this.classElements[i].postfix)},n.prototype.adjustFontSize=function(t){M(this.layer[0],"--ssfont-scale",this.getFontSize()/100),t&&this.update()},n.prototype.getFontSize=function(){return parseInt(this.getProperty("fontsize"))},n.prototype._syncfontsize=function(){this.adjustFontSize(!0)},n.prototype.refreshTextAlign=function(){this.$.triggerHandler("textAlignUpdated")},n.prototype.setPropertydesktopPortrait=n.prototype.setPropertydesktopLandscape=n.prototype.setPropertytabletPortrait=n.prototype.setPropertytabletLandscape=n.prototype.setPropertymobilePortrait=n.prototype.setPropertymobileLandscape=function(t,i,s){this._setProperty(t,parseInt(i),s)},n.prototype.formSetdesktopPortrait=function(t,i){t.currentForm.desktopPortrait.data("field").insideChange(i)},n.prototype.formSetdesktopLandscape=function(t,i){t.currentForm.desktopLandscape.data("field").insideChange(i)},n.prototype.formSettabletPortrait=function(t,i){t.currentForm.tabletPortrait.data("field").insideChange(i)},n.prototype.formSettabletLandscape=function(t,i){t.currentForm.tabletLandscape.data("field").insideChange(i)},n.prototype.formSetmobilePortrait=function(t,i){t.currentForm.mobilePortrait.data("field").insideChange(i)},n.prototype.formSetmobileLandscape=function(t,i){t.currentForm.mobileLandscape.data("field").insideChange(i)},n.prototype.getContents=function(){return!1},n.prototype.renderModeProperties=function(t){c.LayerDataStorage.prototype.renderModeProperties.call(this),this.placement.renderModeProperties(t)},n.prototype.getIndex=function(){return this.group.container.getLayerIndex(this.layer)},n.prototype.toString=function(){return this.type+" #"+this.counter},n.prototype.historyStoreOnPlacement=function(){var t=Array.prototype.slice.call(arguments);t.splice(1,1),this.placement.current[arguments[1]].apply(this.placement.current,t)},n.prototype.getDroppable=function(){return!1},n.prototype.onCanvasUpdate=function(t,i,s){if(this.group===i)t!==s&&this.userIndexChange(t,s);else{var n;if(this.fragmentEditor.isCol(this.group))for(n=this;n&&(!n.placement||"absolute"!==n.placement.getType());)n=n.group;this.changeGroup(t,i),i.onChildCountChange();for(var h=this;h&&(!h.placement||"absolute"!==h.placement.getType());)h=h.group;n&&n!==h&&n.placement.updatePosition(),h&&h.placement.updatePosition()}},n.prototype.toggleHideShow=function(){c.WindowManager.actionPrevent("ComponentRowActivate"),this.status===c.ComponentAbstract.STATUS.HIDDEN?this.setStatusNormal():this.changeStatus(c.ComponentAbstract.STATUS.HIDDEN)},n.prototype.setStatusNormal=function(){this.changeStatus(n.STATUS.NORMAL)},n.prototype.changeStatus=function(t){var i=this.status;switch(t===this.status&&(t=n.STATUS.NORMAL),this.status){case n.STATUS.HIDDEN:this.getRootElement().removeAttr("data-visibility"),this.layerTitle.removeClass("n2_layer_navigation_list_layer__title--hidden")}switch(this.status=t,this.status){case n.STATUS.HIDDEN:this.getRootElement().attr("data-visibility","hidden"),this.layerTitle.addClass("n2_layer_navigation_list_layer__title--hidden")}this.placement.current.changeStatus(i,this.status)},n.prototype.moveX=function(t){"absolute"===this.placement.getType()&&(this.placement.current.moveX(t),this.fragmentEditor.pointerManager.refreshPosition())},n.prototype.moveY=function(t){"absolute"===this.placement.getType()&&(this.placement.current.moveY(t),this.fragmentEditor.pointerManager.refreshPosition())},n.prototype.localStyleSync=function(){if(this.localStyle!==o){var t=[],i="";this.$localStyle!==o&&(this.$localStyle.remove(),delete this.$localStyle);for(var n=0;n<this.localStyle.length;n++){var h="@rule"+this.localStyle[n].selector,r="";if(t.push(h),1!==Object.keys(this.localStyle[n].css).length||this.localStyle[n].css.transition===o){for(var a in this.localStyle[n].css)r+=this.localStyle[n].css[a];""!==r&&(i+=h+"{"+r+"}")}}var l=this.getProperty("uniqueclass");if(l)for(n=0;n<t.length;n++)c._css.deleteRule(t[n].replace(/@rule/g,c._pre+"."+l));if(""!==i){l||(l=this.requestUniqueClass());var u=s.createElement("style");u.appendChild(s.createTextNode(i.replace(/@rule/g,c._pre+"."+l))),s.head.appendChild(u),this.$localStyle=$(u)}}},n.prototype.addLocalStyle=function(t,i,s){for(var n=0;n<this.localStyle.length;n++)if(this.localStyle[n].group===t){""===s?this.localStyle[n].css[i]!==o&&delete this.localStyle[n].css[i]:this.localStyle[n].css[i]=s,this.localStyleSyncThrottled();break}},n.prototype.addClassElement=function(t,i){arguments.length<2&&(i=""),this.classElements.push({$el:t,postfix:i})},n.prototype.setState=function(t,i){},n.prototype.activate=function(t,i){t?this.fragmentEditor.layerWindow.show(this):this.fragmentEditor.layerWindow.setTitle(this),this.fragmentEditor.getActiveLayer()!==this&&(this.layerRow.addClass("n2_layer_navigation_list_layer--active"),this.layer.addClass("n2-active"),this.layer.triggerHandler("n2-ss-activate"),this.fragmentEditor.changeActiveLayer(this),this.fragmentEditor.layerNavigation.onActivateLayer(this)),this.isActive=!0},n.prototype.deActivate=function(){this.isActive=!1,this.layer===o&&console.error(),this.layer.removeClass("n2-active"),this.layerRow.removeClass("n2_layer_navigation_list_layer--active"),this.layer.triggerHandler("n2-ss-deactivate")},n.prototype.isAbsolute=function(){return"absolute"===this.placement.getType()},n.prototype.doubleClick=function(){},n.prototype.hasResponsiveTools=function(){return!1},n.prototype.onContextMenu=function(t,i){i=i||{};var s=this.getContextMenuItems();this.isActive||this.activate(),this.fragmentEditor.pointerManager.contextualBarActive.enableActiveForced(),i.onClose===o?i.onClose=this.onContextMenuBlur.bind(this):i.onClose=function(t){t.call(),this.onContextMenuBlur()}.bind(this,i.onClose),c.ContextMenu(t,s,i)},n.prototype.onContextMenuBlur=function(){this.fragmentEditor.pointerManager.contextualBarActive.disableActiveForced()},n.prototype.getContextMenuItems=function(){var t=[],i=this.getContextMenuCopySubItems(),s=this.getContextMenuPasteSubItems();if(i.length&&t.push({priority:60,label:n2_("Copy"),icon:"ssi_16 ssi_16--copy",items:i}),s.length&&t.push({priority:70,label:n2_("Paste"),icon:"ssi_16 ssi_16--paste",items:s}),this.group){for(var n={priority:50,label:n2_("Parent"),icon:"ssi_16 ssi_16--up",action:function(){this.group.activate(!0)}.bind(this),focus:function(){this.group.layer.addClass("n2_layer_context_menu_target")}.bind(this),blur:function(){this.group.layer.removeClass("n2_layer_context_menu_target")}.bind(this)},h=[],o=this.group,r=0;r<6&&o;r++)h.push({label:o.getLabel(),icon:o.getIcon(),action:function(){this.activate(!0)}.bind(o),focus:function(t){t.layer.addClass("n2_layer_context_menu_target")}.bind(this,o),blur:function(t){t.layer.removeClass("n2_layer_context_menu_target")}.bind(this,o)}),o=o.group;h.length&&(n.items=h),t.push(n)}return t},n.prototype.getContextMenuCopySubItems=function(){return[]},n.prototype.getContextMenuPasteSubItems=function(){var t=[];return this.fragmentEditor.clipboard.componentHasClipboard()&&t.push({label:n2_("Layer(s)"),icon:"ssi_16 ssi_16--layer",action:function(){this.fragmentEditor.clipboard.componentPaste(this)}.bind(this)}),t},n.prototype.syncShowOnDevice=function(t,i){this.getMode()===t&&((i=parseInt(i))?this._show():this._hide(),this.layer.triggerHandler("LayerShowChange",[t,i]),this.placement.current.triggerLayerResized())},n.prototype.triggerLayerResized=function(){if(this.container)for(var t=this.container.getSortedLayers(),i=0;i<t.length;i++)t[i].triggerLayerResized();this.placement.current.triggerLayerResized()},n})),c.d("ComponentCommonAbstract",["$","ComponentAbstract"],(function(){var $=c.$;function t(t,i,s){this.supports=this.supports||[],this.supports.push("PluginAnimatable"),this.isRenameAllowed=this.isRenameAllowed===o||this.isRenameAllowed,this.wraps={},this._lastClasses=!1,c.ComponentAbstract.prototype.constructor.call(this,t,i,s)}return t.prototype=Object.create(c.ComponentAbstract.prototype),t.prototype.constructor=t,t.getRegistryDataToFields=function(t){var i=t.fragmentEditor.editor.getAvailableDeviceModes(),s={id:$("#layerid"),uniqueclass:$("#layeruniqueclass"),desktopPortrait:$("#layershow-desktop-portrait"),tabletPortrait:$("#layershow-tablet-portrait"),mobilePortrait:$("#layershow-mobile-portrait"),zindex:$("#layerzindex"),class:$("#layerclass"),generatorvisible:$("#layergenerator-visible"),crop:$("#layercrop"),rotation:$("#layerrotation"),parallax:$("#layerparallax"),fontsize:$("#layerfont-size"),mouseenter:$("#layeronmouseenter"),click:$("#layeronclick"),mouseleave:$("#layeronmouseleave"),play:$("#layeronplay"),pause:$("#layeronpause"),stop:$("#layeronstop")};return s.desktopLandscape=$("#layershow-desktop-landscape"),s.tabletLandscape=$("#layershow-tablet-landscape"),s.mobileLandscape=$("#layershow-mobile-landscape"),t.fragmentEditor.editor.generator.registerField(s.class),t.fragmentEditor.editor.generator.registerField(s.generatorvisible),i.tabletPortrait||s.tabletPortrait.closest(".n2_field_radio__option").css("display","none"),i.mobilePortrait||s.mobilePortrait.closest(".n2_field_radio__option").css("display","none"),i.desktopLandscape||s.desktopLandscape.closest(".n2_field_radio__option").css("display","none"),i.tabletLandscape||s.tabletLandscape.closest(".n2_field_radio__option").css("display","none"),i.mobileLandscape||s.mobileLandscape.closest(".n2_field_radio__option").css("display","none"),s},t.prototype.hasUp=function(){return!0},t.prototype.up=function(e){e.stopImmediatePropagation(),this.group.activate(e)},t.prototype.addProperties=function(t){this.createProperty("id","",t,this),this.createProperty("uniqueclass",null,t,this),this.createProperty("generatorvisible","",t),this.createProperty("zindex",2,t),this.createProperty("class","",t),this.createProperty("crop","visible",t),this.createProperty("rotation",0,t),this.createProperty("parallax",0,t),c.ComponentAbstract.prototype.addProperties.call(this,t)},t.prototype.onBeforeStart=function(){this.isRenameAllowed&&(this.createProperty("name",this.getName(),this.layer),this.createProperty("nameSynced",1,this.layer))},t.prototype.hasTextScale=function(){return!0},t.prototype.hasResponsiveTools=function(){return!0},t.prototype.onContextResponsiveTools=function(t,i){this.isActive||this.activate();var s=c.ContextMenu(t,[{type:"raw",render:function(t){var i=$('<div class="n2_layer_contextual_responsive_tools"></div>').appendTo(t),n=$('<div class="n2_layer_contextual_responsive_tools__hide"><i class="ssi_16"></i></div>').toggleClass("n2_layer_contextual_responsive_tools__hide--hidden",!this.getRawProperty(this.getMode())).appendTo(i).on("click",function(){var t=this.getMode(),i=this.getProperty(t)?0:1;this.setProperty(t,i),n.toggleClass("n2_layer_contextual_responsive_tools__hide--hidden",!i)}.bind(this));if(this.hasTextScale()){var h=$('<div class="n2_layer_contextual_responsive_tools__text_scale"></div>').appendTo(i),o=this.fragmentEditor.layerOptions.currentForm.fontsize,r=this.getFontSize(),a=$("<div></div>").width("50px").appendTo(h),l=$('<input type="number" min="10" max="990" step="10">').on("change",(function(){o.val(this.value).trigger("change")})).width("26px").val(r).appendTo(h);$('<div class="n2_layer_contextual_responsive_tools__text_scale_percent">%</div>').appendTo(h),new c.UISlider(a,f({start:function(){this.fragmentEditor.pointerManager.disable(),s.lock()}.bind(this),stop:function(e,t){l.val(t.value).trigger("change"),this.fragmentEditor.pointerManager.enable(),s.unlock()}.bind(this),cancel:function(){this.fragmentEditor.pointerManager.enable(),s.unlock()}.bind(this),sliding:function(e,t){l.val(t.value).trigger("change")}.bind(this)},{min:30,max:120,step:10,value:r}))}}.bind(this)}],{forceLtr:!0,verticalAlign:"top",onClose:function(){i!==o&&i.call()}.bind(this)})},t.prototype.getContextMenuItems=function(){var t=c.ComponentAbstract.prototype.getContextMenuItems.call(this),i={desktopPortrait:n2_("Desktop"),desktopLandscape:n2_("Large desktop"),tabletPortrait:n2_("Tablet"),tabletLandscape:n2_("Large tablet"),mobilePortrait:n2_("Mobile"),mobileLandscape:n2_("Large mobile")},s=this.fragmentEditor.editor.getAvailableDeviceModes(),n=[],h=function(t,i){return{label:i,icon:"ssi_16 ssi_16--eye",action:function(s){return s.setData(o(t,i)),this.setProperty(t,0),!1}.bind(this)}}.bind(this),o=function(t,i){return{label:i,icon:"ssi_16 ssi_16--hide",action:function(s){return s.setData(h(t,i)),this.setProperty(t,1),!1}.bind(this)}}.bind(this);for(var r in s)s[r]&&(parseInt(this.getProperty(r))?n.push(h(r,i[r])):n.push(o(r,i[r])));return t.push({priority:57,label:n2_("Hide on"),icon:"ssi_16 ssi_16--hide",items:n}),t},t.prototype.getName=function(){return this.property.nameSynced?this.getDefaultName():this.property.name||this.getDefaultName()},t.prototype.editName=function(){this.activate(!1),new c.InlineTextEditor(this.layerTitleSpan[0],{onSave:function(t){this.rename(t,!0)}.bind(this),onCancel:function(){this.layerTitleSpan.text(this.getName())}.bind(this),onTab:function(e){for(var t=$(".n2_layer_navigation_list_layer__title_label_rename"),i=0;i<t.length;i++)if(this.$layerRowRename.is(t[i])){e.shiftKey?i--:i++;break}i<0?i=t.length-1:i>=t.length&&(i=0),t.eq(i).trigger("click")}.bind(this)})},t.prototype.rename=function(t,i){(this.property.nameSynced||i)&&(i&&(this.property.nameSynced=0),""===t&&(i&&(this.property.nameSynced=1),t=this.getDefaultName()),t=t.trim().substr(0,35),this.property.name!==t&&(this.property.name=t,this.$.trigger("layerRenamed",t)),this.layerTitleSpan.text(t),this===this.fragmentEditor.activeLayer&&this.fragmentEditor.layerWindow.setTitle(this))},t.prototype.getPlacement=function(){var t=this.layer.data("pm");return t!==o?t:"slide"===this.group.type?"absolute":"normal"},t.prototype._start=function(t){this.createRow();var i=this.layer.find("> .n2-ss-layer-mask");i.length&&(this.wraps.mask=i),this._synccrop(),this._syncrotation(),this._synczindex(),this.placement.start(),this.placement.setMode(this.getPlacement(),this.originalProperties),this.animations.init(),this.setGroup(this.group),this.fragmentEditor.$.triggerHandler("layerCreated",this),this.animations.load(),t&&this.$.triggerHandler("created"),this.afterStart(t)},t.prototype._createLayerListRow=function(t){c.ComponentAbstract.prototype._createLayerListRow.call(this,t),this.isRenameAllowed&&(this.$layerRowRename=$('<div class="n2_layer_navigation_list_layer__title_label_rename"><i class="ssi_16 ssi_16--rename"></i></div>').on("click",function(){c.WindowManager.actionPrevent("ComponentRowActivate"),this.editName()}.bind(this)).insertAfter(this.$layerRowIcon),c._tooltip.addElement(this.$layerRowRename,n2_("Rename"))),this.$layerRowIcon.attr("data-action","hide-show").on("click",this.toggleHideShow.bind(this)),c._tooltip.addElement(this.$layerRowIcon,n2_("Show/Hide in editor"))},t.prototype.updateAnimations=function(){c.LayerNavigationTimeline.get().layerWindowEditor.update(this),this.layerTitle.toggleClass("n2_layer_navigation_list_layer__title--has-animations",this.animations.hasAnimation())},t.prototype.createLayerAnimations=function(t,i){var s=[];if(this.animations){var n=this.layer[0],h=x(n,"animatableselector");h&&((n=n.querySelector(h)).relatedLayer=n);var o=new c.FrontendLayerAnimationManager(this,this.layer[0],n,this.fragmentEditor.editor.frontend.getPerspective());o.setLinear(this,this.fragmentEditor.editor.getDeviceMode(),t,i)&&s.push(o)}if(this.container)for(var r=this.container.getSortedLayers(),a=0;a<r.length;a++)s.push.apply(s,r[a].createLayerAnimations(t,i));return s},t.prototype.changeEditorMode=function(t){parseInt(this.property[t])?this._show():this._hide(),c.LayerDataStorage.prototype.changeEditorMode.call(this,t)},t.prototype._synccrop=function(){var t=this.getProperty("crop");if("auto"===t&&(t="hidden"),"mask"===t){t="hidden";var i=d();i.className="n2-ss-layer-mask n2-ss-layer-wrapper",this.addWrap("mask",i)}else this.removeWrap("mask"),this.layer.data("animatableselector",null);this.layer.css("overflow",t)},t.prototype._syncrotation=function(){c.MW.R(this.layer[0]).layerRotation=parseFloat(this.getProperty("rotation"))||0},t.prototype._synczindex=function(){var t=parseInt(this.getProperty("zindex"));isNaN(t)||2===t?this.layer.css("zIndex",""):this.layer.css("zIndex",""+t)},t.prototype._syncclass=function(){!1!==this._lastClasses&&this.layer.removeClass(this._lastClasses);var t=this.fragmentEditor.editor.generator.fill(this.getProperty("class"));t&&""!=t?(this.layer.addClass(t),this._lastClasses=t):this._lastClasses=!1},t.prototype.addWrap=function(t,i){if(this.wraps[t]===o){var s=$(i);switch(this.wraps[t]=s,t){case"mask":s.appendTo(this.layer),s.append(this.getContents()),this.layer.data("animatableselector",".n2-ss-layer-mask")}}return this.wraps[t]},t.prototype.removeWrap=function(t){if(this.wraps[t]!==o){switch(t){case"mask":this.layer.append(this.getContents())}this.wraps[t].remove(),delete this.wraps[t]}},t.prototype.getContextMenuCopySubItems=function(){var t=c.ComponentAbstract.prototype.getContextMenuCopySubItems.call(this);return this.isAnimatable&&this.animations.hasAnimation()&&t.push({label:n2_("Animation"),icon:"ssi_16 ssi_16--animation",action:function(){localStorage.setItem("layerAnimationCopied",JSON.stringify(this.animations.getData()))}.bind(this)}),t},t.prototype.getContextMenuPasteSubItems=function(){var t=c.ComponentAbstract.prototype.getContextMenuPasteSubItems.call(this);if(this.isAnimatable){var i=localStorage.getItem("layerAnimationCopied");null!==i&&t.push({label:n2_("Animation"),icon:"ssi_16 ssi_16--animation",action:function(){this.animations.loadData(JSON.parse(i))}.bind(this)})}return t},t.prototype.convertToNormal=function(){if("layer"===this.type||"row"===this.type){for(var t=this.fragmentEditor.mainContainer.mainContent,i=this.group;i;){if("content"===i.type||"col"===i.type){t=i;break}i=i.group}if(this.layer.css({position:"relative",width:"",left:"",top:""}),t!==this.group){var s=this.getIndex();t.container.insertLayerAt(this,0),this.onCanvasUpdate(s,t,0)}var n=this.placement.setMode("normal"),h=c.History.get().addValue(this,this.historyConvertPlacement,[]);h&&h.setValues({placement:"absolute",placementData:n},{placement:"normal"})}},t.prototype.convertToAbsolute=function(){if("layer"===this.type||"row"===this.type){this.getIndex(),this.group;var t=this.layer.width(),i=this.layer.height();c.History.get().startBatch();var s=this.placement.setMode("absolute"),n=c.History.get().addValue(this,this.historyConvertPlacement,[]);n&&n.setValues({placement:"normal",placementData:s},{placement:"absolute"}),c.History.get().addControl("skipForwardUndos"),"layer"===this.type&&this.item&&(this.item.needHeight||(i="auto")),this.placement.current._setPosition("center","middle",0,0,t,i,!1),c.History.get().endBatch()}},t.prototype.historyConvertPlacement=function(t){t.placementData&&this.layer.data(t.placementData),this.placement.setMode(t.placement),t.placementData&&this.placement.sync()},t})),c.d("Content",["$","ContentAbstract"],(function(){var $=c.$;function t(t,i,s){this.label=n2_("Content"),this.type="content",this.isRenameAllowed=!1,this.innerContainer="> .n2-ss-layer-content",this._defaults=f({verticalalign:"center",selfalign:"center"},this._defaults),this.localStyle=[{group:"normal",selector:"-inner",css:{}},{group:"hover",selector:"-inner:HOVER",css:{}}],c.ContentAbstract.prototype.constructor.call(this,t,i,s),this.placement.allow("default"),i.setMainContent(this)}return t.prototype=Object.create(c.ContentAbstract.prototype),t.prototype.constructor=t,t.getRegistryDataToFields=function(t){var i={maxwidth:$("#layercontent-maxwidth"),selfalign:$("#layercontent-selfalign"),padding:$("#layercontent-padding"),inneralign:$("#layercontent-inneralign"),verticalalign:$("#layercontent-verticalalign"),stylemode:$("#layerfields-content-background-mode"),bgcolor:$("#layercontent-background-color"),bgimage:$("#layercontent-background-image"),bgimagex:$("#layercontent-background-focus-x"),bgimagey:$("#layercontent-background-focus-y"),bgcolorgradient:$("#layercontent-background-gradient"),bgcolorgradientend:$("#layercontent-background-color-end"),opened:$("#layercontent-opened")};return t.initStyleMode("content",i.stylemode,[]),t.fragmentEditor.editor.generator.registerField(i.bgimage),t.fragmentEditor.editor.generator.registerField(i.bgcolor),t.fragmentEditor.editor.generator.registerField(i.bgcolorgradientend),i},t.prototype.getIcon=function(){return"ssi_16 ssi_16--content"},t.prototype.addProperties=function(t){c.ContentAbstract.prototype.addProperties.call(this,t),this.createDeviceProperty("selfalign",{desktopPortrait:this._defaults.selfalign||"inherit"},t)},t.prototype.getRootElement=function(){return this.layer},t.prototype.getBackgroundElement=function(){return this.layer},t.prototype.getPlacement=function(){return"default"},t.prototype._createLayer=function(){return $('<div class="n2-ss-layer n2-ss-content-empty"><div class="n2-ss-section-main-content n2-ss-layer-with-background n2-ss-layer-content"></div></div>').attr("data-sstype",this.type)},t.prototype.createRow=function(){this.$content=this.layer.find(".n2-ss-layer-content:first"),this.addClassElement(this.layer),this.addClassElement(this.$content,"-inner"),this.container=new c.LayerContainer(this),this.container.setLayerContainerElement(this.$content),this._createLayerListRow();var t=$('<div class="n2_layer_navigation_list_layer__title_label_folder" data-action="open-close"><i class="ssi_16"></i></div>').on("click",this.switchOpened.bind(this)).prependTo(this.$rowLabel);c._tooltip.addElement(t,n2_("Open/Close")),this.container.$ul.appendTo(this.layerRow),this.readyDeferred.done(this._syncopened.bind(this))},t.prototype.create=function(){c.ContentAbstract.prototype.create.call(this),this._syncselfalign(),this._onReady()},t.prototype.load=function(t,i){c.ContentAbstract.prototype.load.call(this,t,i),this._syncselfalign(),this._onReady()},t.prototype.delete=function(){for(var t=this.container.getSortedLayers(),i=0;i<t.length;i++)t[i].delete()},t.prototype.remove=function(){this._delete()},t.prototype.update=function(){this.group.update()},t.prototype.onChildCountChange=function(){var t=this.container.getSortedLayers();this.layer.toggleClass("n2-ss-content-empty",0===t.length)},t.prototype.renderModeProperties=function(t){c.ContentAbstract.prototype.renderModeProperties.call(this,t),this._syncselfalign()},t.prototype._syncselfalign=function(){c.ComponentAbstract.selfAlignToStyle(this.layer,this.getProperty("selfalign")),this.update()},t.prototype.duplicate=function(t){},t})),c.d("ContentAbstract",["$","LayerContainer","ComponentCommonAbstract"],(function(){var $=c.$;function t(t,i,s){this._defaults=f({verticalalign:"center"},this._defaults),this._syncbgThrottled=NextendThrottle(this._syncbgThrottled,50),this.stylemode="",c.ComponentCommonAbstract.prototype.constructor.call(this,t,i,s)}return t.prototype=Object.create(c.ComponentCommonAbstract.prototype),t.prototype.constructor=t,t.prototype.addProperties=function(t){this.createProperty("opened",1,t,this),c.ComponentCommonAbstract.prototype.addProperties.call(this,t),this.createProperty("bgimage","",t),this.createProperty("bgimagex",50,t),this.createProperty("bgimagey",50,t),this.createAdvancedProperty(new c.LayerAdvancedProperty("bgcolor","00000000",{"-hover":o},this,"stylemode"),t),this.createAdvancedProperty(new c.LayerAdvancedProperty("bgcolorgradient","off",{"-hover":o},this,"stylemode"),t),this.createAdvancedProperty(new c.LayerAdvancedProperty("bgcolorgradientend","00000000",{"-hover":o},this,"stylemode"),t),this.createDeviceProperty("verticalalign",{desktopPortrait:this._defaults.verticalalign},t),this.createDeviceProperty("maxwidth",{desktopPortrait:0},t),this.createDeviceProperty("inneralign",{desktopPortrait:"inherit"},t),this.createDeviceProperty("padding",{desktopPortrait:"10|*|10|*|10|*|10"},t)},t.prototype.getBackgroundElement=function(){return this.$content},t.prototype.getPaddingElement=function(){return this.$content},t.prototype.create=function(t){c.ComponentCommonAbstract.prototype.create.apply(this,arguments),this.initUI(),this._syncverticalalign(),this._syncmaxwidth(),this._syncpadding(),this._syncinneralign(),this._syncbgThrottled()},t.prototype.load=function(t,i){c.ComponentCommonAbstract.prototype.load.call(this,t,i),this.initUI(),this._syncverticalalign(),this._syncmaxwidth(),this._syncpadding(),this._syncinneralign(),this._syncbgThrottled(),this.container.startWithExistingNodes(i)},t.prototype.initUI=function(){this.uiSpacing=new c.UISpacingPadding(this.getPaddingElement(),this.fragmentEditor,{stop:this.onSpacingStop.bind(this)}),this.editorUI.padding=this.uiSpacing.$handles,this.uiResizeNormal=new c.UIResizeNormal(this.layer,this.fragmentEditor,{stopMaxWidth:function(e,t){this.setProperty("maxwidth",t.value)}.bind(this)}),this.editorUI.normalSizing=this.uiResizeNormal.$handles},t.prototype.doubleClick=function(){$('[data-tab="layer"]').trigger("click")},t.prototype.onSpacingStop=function(t,i){var s=this.getPadding().split("|*|");for(var n in i.changed){var h=i.changed[n];switch(n){case"top":s[0]=Math.round(h);break;case"right":s[1]=Math.round(h);break;case"bottom":s[2]=Math.round(h);break;case"left":s[3]=Math.round(h)}}this.setProperty("padding",s.join("|*|")),$("#layercol-padding").data("field").insideChange(s.join("|*|"))},t.prototype.switchOpened=function(e){e.preventDefault(),c.WindowManager.actionPrevent("ComponentRowActivate"),this.layerRow.hasClass("n2_layer_navigation_list_layer--closed")?this.setProperty("opened",1):this.setProperty("opened",0)},t.prototype._syncopened=function(){this.getProperty("opened")?(this.layerRow.removeClass("n2_layer_navigation_list_layer--closed"),this.container.$ul.css("display",""),this.layer.triggerHandler("opened")):(this.layerRow.addClass("n2_layer_navigation_list_layer--closed"),this.container.$ul.css("display","none"),this.layer.triggerHandler("closed"))},t.prototype.forceOpen=function(){this.layerRow.hasClass("n2_layer_navigation_list_layer--closed")&&(this.layerRow.removeClass("n2_layer_navigation_list_layer--closed"),this.container.$ul.css("display",""),this.layer.triggerHandler("opened"))},t.prototype.removeForceOpen=function(){this.getProperty("opened")||this.layerRow.hasClass("n2_layer_navigation_list_layer--closed")||(this.layerRow.addClass("n2_layer_navigation_list_layer--closed"),this.container.$ul.css("display","none"),this.layer.triggerHandler("closed"))},t.prototype.getPadding=function(){return this.getProperty("padding")},t.prototype._syncpadding=function(){var t=this.getPadding().split("|*|");t.splice(4);var i=t.join("px ")+"px";this.getPaddingElement().css("padding",i),this.update(),this.uiSpacing&&this.uiSpacing.setOption("current",i)},t.prototype._syncmaxwidth=function(){var t=parseInt(this.getProperty("maxwidth"));t<=0||isNaN(t)?(this.layer.css("maxWidth","none"),this.uiResizeNormal.setMaxWidth(-1)):(this.layer.css("maxWidth",t+"px"),this.uiResizeNormal.setMaxWidth(t)),this.update()},t.prototype.getInnerAlign=function(){return this.getProperty("inneralign")},t.prototype._syncinneralign=function(){c.ComponentAbstract.innerAlignToStyle(this.$content,this.getInnerAlign()),this.refreshTextAlign(),this.update()},t.prototype.getVerticalAlign=function(){return this.getProperty("verticalalign")},t.prototype._syncverticalalign=function(){this.$content.css("justify-content",this.getVerticalAlign()),this.update()},t.prototype._syncbgimage=t.prototype._syncbgimagex=t.prototype._syncbgimagey=t.prototype._syncbgcolor=t.prototype._syncbgcolorgradient=t.prototype._syncbgcolorgradientend=t.prototype["_syncbgcolor-hover"]=t.prototype["_syncbgcolorgradient-hover"]=t.prototype["_syncbgcolorgradientend-hover"]=function(){this._syncbgThrottled()},t.prototype._syncbgThrottled=function(){var t="",i=this.fragmentEditor.editor.generator.fill(this.getProperty("bgimage"));if(""!==i){var s=parseInt(this.getProperty("bgimagex"));isFinite(s)||(s=50);var n=parseInt(this.getProperty("bgimagey"));isFinite(n)||(n=50),t+='--n2bgimage:URL("'+c._imageHelper.fixed(i)+'");',t+="background-position:50% 50%,"+s+"% "+n+"%;"}var h=this.fragmentEditor.editor.generator.fill(this.getProperty("bgcolor")),r=this.getProperty("bgcolorgradient"),a=this.fragmentEditor.editor.generator.fill(this.getProperty("bgcolorgradientend")),l=this.getBackgroundCSS(h,r,a,t)+t;this.addLocalStyle("normal","bgcolor",l);var u="",d=!1,f=this.getProperty("bgcolor-hover"),_=this.getProperty("bgcolorgradient-hover"),v=this.getProperty("bgcolorgradientend-hover");f!==o&&f!==h&&(d=!0),_!==o&&_!==r&&(d=!0),v!==o&&v!==a&&(d=!0),d&&(f===o&&(f=h),_===o&&(_=r),v===o&&(v=a),u=this.getBackgroundCSS(f,_,v,t)+t),this.addLocalStyle("hover","bgcolor",u)},t.prototype.getBackgroundCSS=function(t,i,s,n){if(0!==N2Color.hex2alpha(t)||"off"!==i&&0!==N2Color.hex2alpha(s))switch(i){case"horizontal":return"--n2bggradient:linear-gradient(to right, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(s)+" 100%);";case"vertical":return"--n2bggradient:linear-gradient(to bottom, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(s)+" 100%);";case"diagonal1":return"--n2bggradient:linear-gradient(45deg, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(s)+" 100%);";case"diagonal2":return"--n2bggradient:linear-gradient(135deg, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(s)+" 100%);";case"off":default:return""!==n?"--n2bggradient: linear-gradient("+N2Color.hex2rgbaCSS(t)+", "+N2Color.hex2rgbaCSS(t)+");":"background-color:"+N2Color.hex2rgbaCSS(t)+";"}return""},t.prototype.getData=function(t){var i=c.ComponentCommonAbstract.prototype.getData.call(this,t);return t.layersIncluded&&(i.layers=this.container.getData(t)),i},t.prototype.onChildCountChange=function(){this.layer.toggleClass("n2-ss-content-empty",0===this.container.getLayerCount()),this.update()},t.prototype.renderModeProperties=function(t){c.ComponentCommonAbstract.prototype.renderModeProperties.call(this,t),this._syncverticalalign(),this._syncmaxwidth(),this._syncpadding(),this._syncinneralign()},t.prototype.getDroppable=function(){return this.layer.is(":visible")&&this.status!==c.ComponentAbstract.STATUS.HIDDEN?{$container:this.$content,layer:this,placement:"normal",axis:"y"}:"hidden"},t.prototype.getLLDroppable=function(t){if(this.getProperty("opened")){if("absolute"===t.placement.getType())return{$container:this.container.$ul,layer:this};if("normal"===t.placement.getType())switch(t.type){case"layer":case"row":return{$container:this.container.$ul,layer:this}}}return!1},t.prototype.getContents=function(){return this.$content},t.prototype.setPropertystylemode=function(t,i,s){this.stylemode=i,this.syncAdvancedField("bgcolor"),this.syncAdvancedField("bgcolorgradient"),this.syncAdvancedField("bgcolorgradientend")},t.prototype.onSyncFields=function(){this.fragmentEditor.layerOptions.updateField("stylemode",this.stylemode)},t.prototype.getContextMenuCopySubItems=function(){var t=c.ComponentCommonAbstract.prototype.getContextMenuCopySubItems.call(this);return t.push({label:n2_("Child layers"),icon:"ssi_16 ssi_16--layer",action:function(){this.fragmentEditor.clipboard.componentCopy(this)}.bind(this)}),t},t})),c.d("Layer",["$","ComponentCommonAbstract"],(function(){var $=c.$;function t(t,i,s){this.label=n2_("Layer"),this.type="layer",this.item=null,this.parent=!1,this.itemEditor=t.itemEditor,c.ComponentCommonAbstract.prototype.constructor.call(this,t,i,s),this.placement.allow("normal"),this.placement.allow("absolute")}return t.prototype=Object.create(c.ComponentCommonAbstract.prototype),t.prototype.constructor=t,t.prototype.getSubType=function(){return this.item.type},t.prototype.getLabel=function(){return this.item.getLabel()},t.prototype.hasTextScale=function(){return this.item.hasTextScale()},t.prototype.create=function(){c.ComponentCommonAbstract.prototype.create.apply(this,arguments),this._onReady()},t.prototype.load=function(t,i){c.ComponentCommonAbstract.prototype.load.call(this,t,i),this._onReady()},t.prototype.onBeforeStart=function(){var t=this.layer.find(".n2-ss-item");new(c[this.itemEditor.getItemClass(t.data("item"))])(t,this,this.itemEditor),new c.UICanvasItem(this.layer,{canvasUIManager:this.fragmentEditor.canvasUIManager,layer:this,$layer:this.layer}),this.item.needHeight&&this.layer.addClass("n2-ss-layer--need-height"),c.ComponentCommonAbstract.prototype.onBeforeStart.call(this)},t.prototype.doubleClick=function(){$('[data-related-tab="content"]').trigger("click"),this.item.itemEditor.focusFirst()},t.prototype.getDefaultName=function(){return this.item.getLabel()},t.prototype.getContent=function(){var t=this.layer,i=t.data("animatableselector");return i&&(t=$(t[0].querySelector(i))),t},t.prototype._createLayer=function(){return $('<div class="n2-ss-layer"></div>').attr("data-sstype",this.type)},t.prototype.createRow=function(){this._createLayerListRow()},t.prototype.activate=function(t,i){c.ComponentCommonAbstract.prototype.activate.call(this,t,i),this.item?this.item.activate(i):console.error("The layer do not have item on it!")},t.prototype.getHTML=function(t){var i=c.ComponentCommonAbstract.prototype.getHTML.call(this,t),s=this.item.getHTML(t);return i.attr("style",i.attr("style")+this.getStyleText()).append(s),i},t.prototype.getData=function(t){var i=c.ComponentCommonAbstract.prototype.getData.call(this,t);return t.itemsIncluded&&(i.item=this.item.getData()),i},t.prototype.getStyleText=function(){var t="",i=this.property.crop;return"auto"!==i&&"mask"!==i||(i="hidden"),t+="overflow:"+i+";"},t.prototype.getContents=function(){return this.item.$item},t.prototype.onSelfChange=function(){c.ComponentCommonAbstract.prototype.onSelfChange.call(this),this.item.setSelf(this.self.item)},t.prototype.getContextMenuItems=function(){var t=c.ComponentCommonAbstract.prototype.getContextMenuItems.call(this);return t.push({priority:55,label:n2_("Duplicate"),icon:"ssi_16 ssi_16--duplicate",action:this.duplicate.bind(this)}),t.push({priority:1e3,label:n2_("Delete"),icon:"ssi_16 ssi_16--delete",action:this.delete.bind(this),color:"red"}),t},t.prototype.getContextMenuCopySubItems=function(){var t=c.ComponentCommonAbstract.prototype.getContextMenuCopySubItems.call(this);return t.unshift({label:n2_("Layer"),icon:"ssi_16 ssi_16--layer",action:function(){this.fragmentEditor.clipboard.componentCopy(this)}.bind(this)}),t},t})),c.d("LayerAdvancedProperty","$",(function(){"use strict";function t(t,i,s,n,h){this.basename=t,this.def=i,this.modesDef=s,this.obj=n,this.propName=h}return t.prototype.getBaseName=function(){return this.basename},t.prototype.getNames=function(){var t={};for(var i in t[this.basename]=this.def,this.modesDef)t[this.basename+i]=this.modesDef[i];return t},t.prototype.getCurrentMode=function(){return this.obj[this.propName]},t.prototype.getName=function(){var t=this.getCurrentMode();return""!==t?this.basename+t:this.basename},t.prototype.getDefault=function(){var t=this.getCurrentMode();return""!==t?this.modesDef[t]:this.def},t.prototype.resetMode=function(t){if(this.propName===t){var i=this.getCurrentMode();if(""!==i){var s=this.obj.property[this.basename+i];this.obj.property[this.basename+i]=this.modesDef[i],this.obj.syncAdvancedField(this.basename),this.obj.render(this.basename+i,s,"manager")}}},t})),c.d("Row",["$","LayerContainer","ComponentCommonAbstract"],(function(){var $=c.$;function t(t,i,s){this.label=n2_("Row"),this.type="row",this._syncbgThrottled=NextendThrottle(this._syncbgThrottled,50),this.innerContainer="> .n2-ss-layer-row > .n2-ss-layer-row-inner",this.localStyle=[{group:"normal",selector:"-inner",css:{}},{group:"hover",selector:"-inner:HOVER",css:{}}],this.columnsField=$("#layerrow-columns").data("field"),this.refreshUI=NextendDeBounce(this.refreshUI,100),this.stylemode="",c.ComponentCommonAbstract.prototype.constructor.call(this,t,i,s),this.placement.allow("normal"),this.placement.allow("absolute")}return t.prototype=Object.create(c.ComponentCommonAbstract.prototype),t.prototype.constructor=t,t.getRegistryDataToFields=function(t){var i={padding:$("#layerrow-padding"),gutter:$("#layerrow-gutter"),fullwidth:$("#layerrow-fullwidth"),stretch:$("#layerrow-stretch"),wrapafter:$("#layerrow-wrap-after"),inneralign:$("#layerrow-inneralign"),href:$("#layerrow-href"),"href-target":$("#layerrow-href-target"),"aria-label":$("#layerrow-aria-label"),bgimage:$("#layerrow-background-image"),bgimagex:$("#layerrow-background-focus-x"),bgimagey:$("#layerrow-background-focus-y"),stylemode:$("#layerfields-row-background-mode"),bgcolor:$("#layerrow-background-color"),bgcolorgradient:$("#layerrow-background-gradient"),bgcolorgradientend:$("#layerrow-background-color-end"),borderwidth:$("#layerrow-border-width"),borderstyle:$("#layerrow-border-style"),bordercolor:$("#layerrow-border-color"),borderradius:$("#layerrow-border-radius"),boxshadow:$("#layerrow-boxshadow"),opened:$("#layerrow-opened")};return t.initStyleMode("row",i.stylemode,["#layerfields-row-border-mode"]),t.fragmentEditor.editor.generator.registerField(i.href),t.fragmentEditor.editor.generator.registerField(i.bgimage),t.fragmentEditor.editor.generator.registerField(i.bgcolor),t.fragmentEditor.editor.generator.registerField(i.bgcolorgradientend),i},t.prototype.getIcon=function(){return"ssi_16 ssi_16--row"},t.prototype.addProperties=function(t){this.createProperty("opened",1,t,this),c.ComponentCommonAbstract.prototype.addProperties.call(this,t),this.createProperty("href","",t),this.createProperty("href-target","_self",t),this.createProperty("aria-label","",t),this.createProperty("bgimage","",t),this.createProperty("bgimagex",50,t),this.createProperty("bgimagey",50,t),this.createAdvancedProperty(new c.LayerAdvancedProperty("bgcolor","00000000",{"-hover":o},this,"stylemode"),t),this.createAdvancedProperty(new c.LayerAdvancedProperty("bgcolorgradient","off",{"-hover":o},this,"stylemode"),t),this.createAdvancedProperty(new c.LayerAdvancedProperty("bgcolorgradientend","00000000",{"-hover":o},this,"stylemode"),t),this.createAdvancedProperty(new c.LayerAdvancedProperty("borderwidth","0|*|0|*|0|*|0",{"-hover":o},this,"stylemode"),t),this.createAdvancedProperty(new c.LayerAdvancedProperty("borderstyle","solid",{"-hover":o},this,"stylemode"),t),this.createAdvancedProperty(new c.LayerAdvancedProperty("bordercolor","ffffffff",{"-hover":o},this,"stylemode"),t),this.createAdvancedProperty(new c.LayerAdvancedProperty("borderradius",0,{"-hover":o},this,"stylemode"),t),this.createAdvancedProperty(new c.LayerAdvancedProperty("boxshadow","0|*|0|*|0|*|0|*|00000080",{"-hover":o},this,"stylemode"),t),this.createProperty("fullwidth",1,t),this.createProperty("stretch",0,t),this.createDeviceProperty("inneralign",{desktopPortrait:"inherit"},t),this.createDeviceProperty("padding",{desktopPortrait:"10|*|10|*|10|*|10"},t),this.createDeviceProperty("gutter",{desktopPortrait:20},t),this.createDeviceProperty("wrapafter",{desktopPortrait:0,mobilePortrait:1,mobileLandscape:1},t)},t.prototype.historyDeleteSelf=function(){this.delete()},t.prototype.historyCreateSelf=function(t,i,s){var n=new c.Row(this.fragmentEditor,t.getSelf(),{});n.create(i),this.setSelf(n);for(var h=n.container.getSortedLayers(),o=0;o<h.length;o++)s[o].setSelf(h[o])},t.prototype.create=function(t){var i,s=function(t){return $("<div class='n2-ss-layer'></div>").append($("<div class='n2-ss-layer-row n2-ss-layer-with-background'></div>").append($("<div class='n2-ss-layer-row-inner'></div>").append(t))).attr("data-sstype","row")},n=function(t){return $("<div class='n2-ss-layer' data-sstype='col'></div>").append($("<div class='n2-ss-layer-col n2-ss-layer-with-background n2-ss-layer-content'></div>").append(t))};switch(t){case"structure-2col":i=s([n(),n()]);break;case"structure-3col":i=s([n(),n(),n()]);break;case"structure-1col":default:i=s([n()])}"slide"===this.group.type&&(this.originalProperties=f({width:"100%",align:"center",valign:"top",top:20},this.originalProperties)),c.ComponentCommonAbstract.prototype.create.call(this,i),this.initUI(),this.container.startWithExistingNodes(!1),this._syncpadding(),this._syncinneralign(),this._syncfullwidth(),this._syncstretch(),this._syncbgThrottled(),this._syncborder(),this._syncborderradius(),this._syncboxshadow(),this.renderModeProperties(),this.container.renderModeProperties(),c.History.get().addSimple(this,this.historyDeleteSelf,this.historyCreateSelf,[this.group,t,this.container.getSortedLayers()]),this._onReady()},t.prototype.load=function(t,i){c.ComponentCommonAbstract.prototype.load.call(this,t,i),this.initUI(),this.container.startWithExistingNodes(i),this._syncpadding(),this._syncinneralign(),this._syncfullwidth(),this._syncstretch(),this._syncbgThrottled(),this._syncborder(),this._syncborderradius(),this._syncboxshadow(),this._onReady()},t.prototype.initUI=function(){new c.UICanvasItem(this.layer,{canvasUIManager:this.fragmentEditor.canvasUIManager,layer:this,$layer:this.layer}),this.uiSpacing=new c.UISpacingPadding(this.$row,this.fragmentEditor,{stop:this.cs.bind(this)}),this.editorUI.padding=this.uiSpacing.$handles,this.editorUI.columns=this.uiColumns=new c.UIColumns(this.$row,this.fragmentEditor,{columns:"1",gutter:this.getGutter(),start:function(e,t){c.PositionDisplay.get().show("Columns")}.bind(this),colwidth:function(e,t){this.updateColumnWidth(t.currentPercent),c.PositionDisplay.get().update(e,"Columns",Math.round(100*t.currentPercent[t.index])+"% — "+Math.round(100*t.currentPercent[t.index+1])+"%")}.bind(this),stop:function(e,t){c.PositionDisplay.get().hide("Columns"),this.setRealColsWidth(t.currentFractions)}.bind(this)})},t.prototype.doubleClick=function(){$('[data-tab="row"]').trigger("click")},t.prototype.cs=function(t,i){var s=this.getPadding().split("|*|");for(var n in i.changed){var h=i.changed[n];switch(n){case"top":s[0]=Math.round(h);break;case"right":s[1]=Math.round(h);break;case"bottom":s[2]=Math.round(h);break;case"left":s[3]=Math.round(h)}}this.setProperty("padding",s.join("|*|")),$("#layerrow-padding").data("field").insideChange(s.join("|*|"))},t.prototype._createLayer=function(){return $('<div class="n2-ss-layer"><div class="n2-ss-layer-row n2-ss-layer-with-background"><div class="n2-ss-layer-row-inner"></div></div></div>').attr("data-sstype",this.type)},t.prototype.historyDeleteCol=function(t,i){i.getSelf().delete()},t.prototype.historyCreateCol=function(t,i){var s=t.getSelf().createCol();i.setSelf(s)},t.prototype.createCol=function(){var t=new c.Col(this.fragmentEditor,this,{});return c.History.get().addSimple(this,this.historyDeleteCol,this.historyCreateCol,[this,t]),t.create(t._createLayer()),this.isReady()&&this.placement.updatePosition(),t},t.prototype.createRow=function(){this.$row=this.layer.find(".n2-ss-layer-row:first"),this.$rowInner=this.$row.find(".n2-ss-layer-row-inner:first"),0===this.$rowInner.length&&(this.$rowInner=$('<div class="n2-ss-layer-row-inner"></div>').append(this.$row.find("> *")).appendTo(this.$row)),this.container=new c.LayerContainer(this),this.container.setLayerContainerElement(this.$rowInner),this.addClassElement(this.layer),this.addClassElement(this.$row,"-inner"),this._createLayerListRow();var t=$('<div class="n2_layer_navigation_list_layer__title_label_folder" data-action="open-close"><i class="ssi_16"></i></div>').prependTo(this.$rowLabel).on("click",this.switchOpened.bind(this));c._tooltip.addElement(t,n2_("Open/Close")),this.container.$ul.appendTo(this.layerRow),this.readyDeferred.done(this._syncopened.bind(this))},t.prototype.activate=function(){c.ComponentCommonAbstract.prototype.activate.apply(this,arguments),this.columnsField.setRow(this),this.uiColumns.setOption("active",1)},t.prototype.deActivate=function(){this.uiColumns.setOption("active",0),c.ComponentCommonAbstract.prototype.deActivate.apply(this,arguments)},t.prototype.switchOpened=function(e){e.preventDefault(),c.WindowManager.actionPrevent("ComponentRowActivate"),this.layerRow.hasClass("n2_layer_navigation_list_layer--closed")?this.setProperty("opened",1):this.setProperty("opened",0)},t.prototype._syncopened=function(){this.getProperty("opened")?(this.layerRow.removeClass("n2_layer_navigation_list_layer--closed"),this.container.$ul.css("display",""),this.layer.triggerHandler("opened")):(this.layerRow.addClass("n2_layer_navigation_list_layer--closed"),this.container.$ul.css("display","none"),this.layer.triggerHandler("closed"))},t.prototype.forceOpen=function(){this.layerRow.hasClass("n2_layer_navigation_list_layer--closed")&&(this.layerRow.removeClass("n2_layer_navigation_list_layer--closed"),this.container.$ul.css("display",""),this.layer.triggerHandler("opened"))},t.prototype.removeForceOpen=function(){this.getProperty("opened")||this.layerRow.hasClass("n2_layer_navigation_list_layer--closed")||(this.layerRow.addClass("n2_layer_navigation_list_layer--closed"),this.container.$ul.css("display","none"),this.layer.triggerHandler("closed"))},t.prototype.getSortedColumns=function(){for(var t=this.container.getSortedLayers(),i=[],s=0;s<t.length;s++)t[s]instanceof c.Col&&i.push(t[s]);return i},t.prototype.getColumns=function(){for(var t=this.getSortedColumns(),i=[],s=0;s<t.length;s++)i.push(t[s].getProperty("colwidth"));return i.join("+")},t.prototype.getColumnsOrdered=function(){for(var t=this.getOrderedColumns(),i=[],s=0;s<t.length;s++)i.push(t[s].getProperty("colwidth"));return i.join("+")},t.prototype.getPadding=function(){return this.getProperty("padding")},t.prototype._syncpadding=function(){var t=this.getPadding().split("|*|");t.splice(4);var i=t.join("px ")+"px";this.$row.css("padding",i),this.uiSpacing&&this.uiSpacing.setOption("current",i),this.update()},t.prototype.refreshColumnsWidth=function(){var t,i=parseInt(this.getProperty("wrapafter")),s=this.getGutter(),n=s/2,h=this.getOrderedColumnsVisible();for(this.$rowInner.css({width:"calc(100% + "+(s+1)+"px)",margin:"-"+n+"px"}),t=0;t<h.length;t++)h[t].layer.css("margin",n+"px");if(i>0)if(this.$row.attr("data-row-wrapped","1"),this.$rowInner.css("flex-wrap","wrap"),this.isFullWidth()&&i<=h.length){var o,r=new Array(Math.ceil(h.length/i)).fill(0);for(t=0;t<h.length;t++)r[o=Math.floor(t/i)]+=h[t].getWidthPercentage();for(t=0;t<h.length;t++)o=Math.floor(t/i),h[t].layer.css("width","calc("+h[t].getWidthPercentage()/r[o]*100+"% - "+s+"px)")}else for(t=0;t<h.length;t++)h[t].layer.css("width","auto");else if(this.$row.attr("data-row-wrapped","0"),this.$rowInner.css("flex-wrap",""),this.isFullWidth())for(t=0;t<h.length;t++)h[t].layer.css("width",h[t].getWidthPercentage()+"%");else for(t=0;t<h.length;t++)h[t].layer.css("width","auto")},t.prototype.getGutter=function(){return this.getProperty("gutter")},t.prototype._syncgutter=function(){this.refreshColumnsWidth(),this.update()},t.prototype._syncwrapafter=function(){this.isDeleted||this.isDeleteStarted||(this.refreshColumnsWidth(),this.update())},t.prototype.getOrderedColumns=function(){return this.getSortedColumns().sort((function(t,i){return t.getRealOrder()-i.getRealOrder()}))},t.prototype.getOrderedColumnsVisible=function(){return this.getOrderedColumns().filter((function(t){return t.showsOnCurrent}))},t.prototype.getInnerAlign=function(){return this.getProperty("inneralign")},t.prototype._syncinneralign=function(){c.ComponentAbstract.innerAlignToStyle(this.$row,this.getInnerAlign()),this.refreshTextAlign()},t.prototype._syncfullwidth=function(){this.layer.toggleClass("n2-ss-layer--block",this.isFullWidth()),this.layer.toggleClass("n2-ss-layer--auto",!this.isFullWidth()),this.refreshColumnsWidth(),this.update()},t.prototype.isFullWidth=function(){return 1===parseInt(this.getProperty("fullwidth"))},t.prototype._syncstretch=function(){this.layer.toggleClass("n2-ss-stretch-layer",1==this.getProperty("stretch"))},t.prototype._syncborderwidth=t.prototype._syncbordercolor=t.prototype._syncborderstyle=t.prototype["_syncborderstyle-hover"]=t.prototype["_syncbordercolor-hover"]=t.prototype["_syncborderwidth-hover"]=function(){this._syncborder()},t.prototype._syncborder=function(){var t=this.getProperty("borderstyle"),i=this.getProperty("bordercolor"),s=this.getProperty("borderwidth");this.addLocalStyle("normal","border",this.getBorderCSS(t,i,s));var n="",h=!1,r=this.getProperty("borderstyle-hover"),a=this.getProperty("bordercolor-hover"),c=this.getProperty("borderwidth-hover");r!==o&&r!=t&&(h=!0),a!==o&&a!=i&&(h=!0),c!==o&&c!=s&&(h=!0),h&&(r===o&&(r=t),a===o&&(a=i),c===o&&(c=s),n=this.getBorderCSS(r,a,c)),this.addLocalStyle("hover","border",n),this.update()},t.prototype.getBorderCSS=function(t,i,s){var n="";if("none"!==t){n+="border-color:"+N2Color.hex2rgbaCSS(i)+";",n+="border-style:"+t+";";n+="border-width:"+(s=s.split("|*|")).join("px ")+"px;"}return n},t.prototype._syncborderradius=t.prototype["_syncborderradius-hover"]=function(){var t=this.getProperty("borderradius");t>=0&&this.addLocalStyle("normal","borderradius","border-radius:"+t+"px;");var i=this.getProperty("borderradius-hover");i&&i!=t?this.addLocalStyle("hover","borderradius","border-radius:"+i+"px;"):this.addLocalStyle("hover","borderradius","")},t.prototype._syncboxshadow=t.prototype["_syncboxshadow-hover"]=function(){var t=this.getProperty("boxshadow");this.addLocalStyle("normal","boxshadow",this.getBoxShadowCSS(t.split("|*|")));var i="",s=this.getProperty("boxshadow-hover");s!==o&&s!=t&&(i=this.getBoxShadowCSS(s.split("|*|"))),this.addLocalStyle("hover","boxshadow",i)},t.prototype.getBoxShadowCSS=function(t){return 0==t[0]&&0==t[1]&&0==t[2]&&0==t[3]||0==N2Color.hex2alpha(t[4])?"":"box-shadow:"+t[0]+"px "+t[1]+"px "+t[2]+"px "+t[3]+"px "+N2Color.hex2rgbaCSS(t[4])+";"},t.prototype._synchref=t.prototype["_synchref-target"]=t.prototype["_syncaria-label"]=function(){},t.prototype._syncbgimage=t.prototype._syncbgimagex=t.prototype._syncbgimagey=t.prototype._syncbgcolor=t.prototype._syncbgcolorgradient=t.prototype._syncbgcolorgradientend=t.prototype["_syncbgcolor-hover"]=t.prototype["_syncbgcolorgradient-hover"]=t.prototype["_syncbgcolorgradientend-hover"]=function(){this._syncbgThrottled()},t.prototype._syncbgThrottled=function(){var t="",i=this.fragmentEditor.editor.generator.fill(this.getProperty("bgimage"));if(""!==i){var s=parseInt(this.getProperty("bgimagex"));isFinite(s)||(s=50);var n=parseInt(this.getProperty("bgimagey"));isFinite(n)||(n=50),t+='--n2bgimage:URL("'+c._imageHelper.fixed(i)+'");',t+="background-position:50% 50%,"+s+"% "+n+"%;"}var h=this.fragmentEditor.editor.generator.fill(this.getProperty("bgcolor")),r=this.getProperty("bgcolorgradient"),a=this.fragmentEditor.editor.generator.fill(this.getProperty("bgcolorgradientend")),l=this.getBackgroundCSS(h,r,a,t)+t;this.addLocalStyle("normal","bgcolor",l);var u="",d=!1,f=this.getProperty("bgcolor-hover"),_=this.getProperty("bgcolorgradient-hover"),v=this.getProperty("bgcolorgradientend-hover");f!==o&&f!=h&&(d=!0),_!==o&&_!=r&&(d=!0),v!==o&&v!=a&&(d=!0),d&&(f===o&&(f=h),_===o&&(_=r),v===o&&(v=a),u=this.getBackgroundCSS(f,_,v,t)+t),this.addLocalStyle("hover","bgcolor",u)},t.prototype.getBackgroundCSS=function(t,i,s,n){if(0!==N2Color.hex2alpha(t)||"off"!==i&&0!==N2Color.hex2alpha(s))switch(i){case"horizontal":return"--n2bggradient:linear-gradient(to right, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(s)+" 100%);";case"vertical":return"--n2bggradient:linear-gradient(to bottom, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(s)+" 100%);";case"diagonal1":return"--n2bggradient:linear-gradient(45deg, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(s)+" 100%);";case"diagonal2":return"--n2bggradient:linear-gradient(135deg, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(s)+" 100%);";case"off":default:return""!==n?"--n2bggradient: linear-gradient("+N2Color.hex2rgbaCSS(t)+", "+N2Color.hex2rgbaCSS(t)+");":"background-color:"+N2Color.hex2rgbaCSS(t)+";"}return""},t.prototype.getData=function(t){var i=c.ComponentCommonAbstract.prototype.getData.call(this,t);return t.itemsIncluded&&(i.cols=this.container.getData(t)),i},t.prototype.moveCol=function(t,i){this._moveCol(t,i);var s=c.History.get().addValue(this,this.historyMoveCol,[]);s&&s.setValues({oldIndex:i,newIndex:t},{oldIndex:t,newIndex:i})},t.prototype.moveColOrOrder=function(t,i){var s,n,h,o=this.container.getSortedLayers(),r=this.getSortedColumns(),a=r[t],c=r[i];for(s=0;s<o.length;s++)if(o[s]===a){n=s;break}for(s=0;s<o.length;s++)if(o[s]===c){h=s;break}if("desktopPortrait"===this.getMode())this.moveCol(n,h);else{var l=this.getOrderedColumns(),u=l[n];for(l.splice(n,1),l.splice(h,0,u),s=0;s<l.length;s++)l[s].setProperty("order",s+1);this.refreshUI()}},t.prototype._moveCol=function(t,i){var s=this.container.getSortedLayers();this.container.insertLayerAt(s[t],i),this.refreshUI()},t.prototype.historyMoveCol=function(t){this._moveCol(t.oldIndex,t.newIndex)},t.prototype.setRealColsWidth=function(t){for(var i=this.getOrderedColumns(),s=0;s<t.length;s++)i[s].setProperty("colwidth",t[s].toFraction());this.refreshColumnsWidth(),this.update(),this.refreshUI()},t.prototype.updateColumnWidth=function(t){var i,s=this.getOrderedColumns(),n=[];for(i=0;i<s.length;i++)n.push(s[i].getWidthPercentage()),s[i].widthPercentage=100*t[i];for(this.refreshColumnsWidth(),i=0;i<s.length;i++)s[i].widthPercentage=n[i];this.update()},t.prototype.activateColumn=function(t,e){this.container.getSortedLayers()[t].activate(e)},t.prototype.onChildCountChange=function(){if(!this.isDeleted&&!this.isDeleteStarted){var t=this.getSortedColumns(),i=t.length;if(i){for(var s=this.getColumns().split("+"),n=0,h=0;h<s.length;h++)n=new Fraction(s[h]).add(n);if(1!=n.valueOf())for(h=0;h<i;h++)t[h].setProperty("colwidth","1/"+i);else for(h=0;h<i;h++)t[h]._synccolwidth();this.refreshUI()}this._syncgutter()}},t.prototype.renderModeProperties=function(t){c.ComponentCommonAbstract.prototype.renderModeProperties.call(this,t),this._syncpadding(),this._syncinneralign(),this._syncgutter(),this.isActive&&this.columnsField.setRow(this)},t.prototype.highlightStructure=function(t){t=t||4e3,this.isStructureHighlighted&&(a(this.isStructureHighlighted),this.isStructureHighlighted=!1);var i=this.getSortedColumns();this.layer.addClass("n2_layer_highlight_row_structure");for(var s=0;s<i.length;s++)i[s].layer.addClass("n2_layer_highlight_row_structure");this.isStructureHighlighted=r(function(){if(!this.isDeleted){this.layer.removeClass("n2_layer_highlight_row_structure");for(var t=0;t<i.length;t++)i[t].isDeleted||i[t].layer.removeClass("n2_layer_highlight_row_structure")}}.bind(this),t)},t.prototype.refreshUI=function(){this.isDeleteStarted||(this.isActive&&this.columnsField.setRow(this),this.refreshColumnsWidth(),this.uiColumns.setOption("columns",this.getColumnsOrdered()))},t.prototype.getLLDroppable=function(t){if(this.getProperty("opened")){if("absolute"===t.placement.getType())return{$container:this.container.$ul,layer:this};switch(t.type){case"col":if(t.group===this)return{$container:this.container.$ul,layer:this}}}return!1},t.prototype.getContents=function(){return this.$row},t.prototype.setPropertystylemode=function(t,i,s){this.stylemode=i,this.syncAdvancedField("bgcolor"),this.syncAdvancedField("bgcolorgradient"),this.syncAdvancedField("bgcolorgradientend"),this.syncAdvancedField("borderradius"),this.syncAdvancedField("boxshadow"),this.syncAdvancedField("borderwidth"),this.syncAdvancedField("borderstyle"),this.syncAdvancedField("bordercolor")},t.prototype.onSyncFields=function(){this.fragmentEditor.layerOptions.updateField("stylemode",this.stylemode)},t.prototype.getContextMenuItems=function(){var t=c.ComponentCommonAbstract.prototype.getContextMenuItems.call(this);return t.push({priority:55,label:n2_("Duplicate"),icon:"ssi_16 ssi_16--duplicate",action:this.duplicate.bind(this)}),t.push({priority:1e3,label:n2_("Delete"),icon:"ssi_16 ssi_16--delete",action:this.delete.bind(this),color:"red"}),t},t.prototype.getContextMenuCopySubItems=function(){var t=c.ComponentCommonAbstract.prototype.getContextMenuCopySubItems.call(this);return t.unshift({label:this.label,icon:"ssi_16 ssi_16--layer",action:function(){this.fragmentEditor.clipboard.componentCopy(this)}.bind(this)}),t},t})),c.d("SectionSlide",["$","LayerContainer","ComponentAbstract"],(function(){var $=c.$;function t(t){this.label=n2_("Slide"),this.type="slide",this.contextualBarPosition="center",this.$=t.$,this.isMainGroup=!0,c.ComponentAbstract.prototype.constructor.call(this,t,!1),this.placement.allow("default"),this.layer=this.fragmentEditor.editor.getMainContainerElement().find('.n2-ss-layer[data-sstype="slide"]'),this.layerListUIManager=new c.UILayerList(this.layer,{mainContainer:this,$scrolled:$(".n2_layer_navigation_list")})}return t.prototype=Object.create(c.ComponentAbstract.prototype),t.prototype.constructor=t,t.prototype.getPaddingElement=function(){return this.layer},t.prototype.lateInit=function(){this.load(this.layer,!0),this.getProperty("static-slide")||(this.slideBackground=this.fragmentEditor.editor.getSlideBackground(),this.slideBackground.setRelatedSectionSlide(this))},t.getRegistryDataToFields=function(i){var s=i.fragmentEditor.editor.getAvailableDeviceModes(),n={title:$("#layerslide-title"),publish_up:$("#layerslide-publish_up"),publish_down:$("#layerslide-publish_down"),published:$("#layerslide-published"),description:$("#layerslide-description"),thumbnail:$("#layerslide-thumbnail"),"record-slides":$("#layerslide-slide-generator-slides"),thumbnailType:$("#layerslide-thumbnailType"),ligthboxImage:$("#layerslide-ligthboxImage"),"background-type":$("#layerslide-background-type"),backgroundImage:$("#layerslide-backgroundImage"),backgroundFocusX:$("#layerslide-backgroundFocusX"),backgroundFocusY:$("#layerslide-backgroundFocusY"),backgroundImageOpacity:$("#layerslide-backgroundImageOpacity"),backgroundImageBlur:$("#layerslide-backgroundImageBlur"),backgroundAlt:$("#layerslide-backgroundAlt"),backgroundTitle:$("#layerslide-backgroundTitle"),backgroundColor:$("#layerslide-backgroundColor"),backgroundGradient:$("#layerslide-backgroundGradient"),backgroundColorEnd:$("#layerslide-backgroundColorEnd"),backgroundColorOverlay:$("#layerslide-backgroundColorOverlay"),backgroundMode:$("#layerslide-backgroundMode"),href:$("#layerslide-href"),"href-target":$("#layerslide-href-target"),"aria-label":$("#layerslide-aria-label"),"slide-duration":$("#layerslide-slide-duration"),padding:$("#layerslide-padding")};n.desktopPortrait=$("#layerslide-show-desktop-portrait"),n.desktopLandscape=$("#layerslide-show-desktop-landscape"),n.tabletPortrait=$("#layerslide-show-tablet-portrait"),n.tabletLandscape=$("#layerslide-show-tablet-landscape"),n.mobilePortrait=$("#layerslide-show-mobile-portrait"),n.mobileLandscape=$("#layerslide-show-mobile-landscape"),n.backgroundVideoMp4=$("#layerslide-backgroundVideoMp4"),n.backgroundVideoOpacity=$("#layerslide-backgroundVideoOpacity"),n.backgroundVideoMuted=$("#layerslide-backgroundVideoMuted"),n.backgroundVideoLoop=$("#layerslide-backgroundVideoLoop"),n.backgroundVideoReset=$("#layerslide-backgroundVideoReset"),n.backgroundVideoMode=$("#layerslide-backgroundVideoMode");for(var h=0;h<t.externalDataToField.length;h++)n[t.externalDataToField[h].name]=$("#"+t.externalDataToField[h].id);return s.desktopLandscape||n.desktopLandscape.closest(".n2_field_radio__option").css("display","none"),s.tabletPortrait||n.tabletPortrait.closest(".n2_field_radio__option").css("display","none"),s.tabletLandscape||n.tabletLandscape.closest(".n2_field_radio__option").css("display","none"),s.mobilePortrait||n.mobilePortrait.closest(".n2_field_radio__option").css("display","none"),s.mobileLandscape||n.mobileLandscape.closest(".n2_field_radio__option").css("display","none"),i.fragmentEditor.editor.generator.registerField(n.title),i.fragmentEditor.editor.generator.registerField(n.description),i.fragmentEditor.editor.generator.registerField(n.thumbnail),i.fragmentEditor.editor.generator.registerField(n.backgroundImage),i.fragmentEditor.editor.generator.registerField(n.backgroundFocusX),i.fragmentEditor.editor.generator.registerField(n.backgroundFocusY),i.fragmentEditor.editor.generator.registerField(n.backgroundAlt),i.fragmentEditor.editor.generator.registerField(n.backgroundTitle),i.fragmentEditor.editor.generator.registerField(n.backgroundColor),i.fragmentEditor.editor.generator.registerField(n.backgroundColorEnd),i.fragmentEditor.editor.generator.registerField(n.href),i.fragmentEditor.editor.generator.registerField(n.backgroundVideoMp4),n},t.externalDataToField=[],t.addExternalDataToField=function(i){t.externalDataToField.push.apply(t.externalDataToField,i)},t.prototype.getIcon=function(){return"ssi_16 ssi_16--image"},t.prototype.addProperties=function(i){this.createProperty("title",n2_("Slide"),i),this.createProperty("publish_up","0000-00-00 00:00:00",i),this.createProperty("publish_down","0000-00-00 00:00:00",i),this.createProperty("published",1,i),this.createProperty("description","",i),this.createProperty("record-slides",5,i),this.createProperty("thumbnail","",i),this.createProperty("thumbnailType","default",i),this.createProperty("static-slide",0,i),this.createProperty("slide-duration",0,i),this.createProperty("ligthboxImage","",i);for(var s=0;s<t.externalDataToField.length;s++)this.createProperty(t.externalDataToField[s].name,t.externalDataToField[s].def,i);c.ComponentAbstract.prototype.addProperties.call(this,i),this.createProperty("href","",i),this.createProperty("href-target","",i),this.createProperty("aria-label","",i),this.createProperty("background-type","color",i),this.createProperty("backgroundColor","ffffff00",i),this.createProperty("backgroundGradient","off",i),this.createProperty("backgroundColorEnd","ffffff00",i),this.createProperty("backgroundColorOverlay",0,i),this.createProperty("backgroundImage","",i),this.createProperty("backgroundFocusX",50,i),this.createProperty("backgroundFocusY",50,i),this.createProperty("backgroundImageOpacity",100,i),this.createProperty("backgroundImageBlur",0,i),this.createProperty("backgroundAlt","",i),this.createProperty("backgroundTitle","",i),this.createProperty("backgroundMode","default",i),this.createProperty("backgroundVideoMp4","",i),this.createProperty("backgroundVideoOpacity",100,i),this.createProperty("backgroundVideoMuted",1,i),this.createProperty("backgroundVideoLoop",1,i),this.createProperty("backgroundVideoReset",1,i),this.createProperty("backgroundVideoMode","fill",i),this.createDeviceProperty("padding",{desktopPortrait:"10|*|10|*|10|*|10"},i)},t.prototype.load=function(t,i){c.ComponentAbstract.prototype.load.call(this,t,i),this.initUI(),this._syncpadding(),this.container.startWithExistingNodes(i),this._onReady()},t.prototype.onSpacingStop=function(t,i){var s=this.getPadding().split("|*|");for(var n in i.changed){var h=i.changed[n];switch(n){case"top":s[0]=Math.round(h);break;case"right":s[1]=Math.round(h);break;case"bottom":s[2]=Math.round(h);break;case"left":s[3]=Math.round(h)}}this.setProperty("padding",s.join("|*|")),$("#layerslide-padding").data("field").insideChange(s.join("|*|"))},t.prototype.initUI=function(){this.uiSpacing=new c.UISpacingPadding(this.getPaddingElement(),this.fragmentEditor,{stop:this.onSpacingStop.bind(this)}),this.editorUI.padding=this.uiSpacing.$handles},t.prototype.createRow=function(){this.container=new c.LayerContainer(this),this._createLayerListRow(),this.container.$ul.appendTo(this.layerRow)},t.prototype._start=function(t){this.createRow(),this.placement.start(),this.placement.setMode("default",this.originalProperties),this.animations.init(),this.setGroup(this.group),this.fragmentEditor.$.triggerHandler("layerCreated",this),this.animations.load(),t&&this.$.triggerHandler("created"),this.afterStart(t)},t.prototype.changeEditorMode=function(t){c.LayerDataStorage.prototype.changeEditorMode.call(this,t),this.container.changeEditorModes(t)},t.prototype.getLayerListParent=function(){return $(".n2_layer_navigation_list_layers")},t.prototype.setGroup=function(t){},t.prototype["_syncbackground-type"]=function(){this.slideBackground.setType(this.getProperty("background-type"))},t.prototype.syncBackgroundColor=function(){var t,i=c._currentEditor.generator.fill(this.getProperty("backgroundColor")),s=this.getProperty("backgroundGradient");"off"!==s&&(t=c._currentEditor.generator.fill(this.getProperty("backgroundColorEnd"))),this.slideBackground.updateColor(i,s,t,this.getProperty("backgroundColorOverlay"))},t.prototype._syncbackgroundColor=t.prototype.syncBackgroundColor,t.prototype._syncbackgroundGradient=t.prototype.syncBackgroundColor,t.prototype._syncbackgroundColorEnd=t.prototype.syncBackgroundColor,t.prototype._syncbackgroundColorOverlay=t.prototype.syncBackgroundColor,t.prototype._syncbackgroundImage=function(t,i){var s=this.getProperty("backgroundImage");this.slideBackground.setImage(c._currentEditor.generator.fill(s)),this.slideBackground.setThumbnail(s,t)},t.prototype.syncBackgroundFocus=function(){this.slideBackground.setFocus(c._currentEditor.generator.fill(this.getProperty("backgroundFocusX")),c._currentEditor.generator.fill(this.getProperty("backgroundFocusY")))},t.prototype._syncbackgroundFocusX=t.prototype.syncBackgroundFocus,t.prototype._syncbackgroundFocusY=t.prototype.syncBackgroundFocus,t.prototype._syncbackgroundImageOpacity=function(){this.slideBackground.setImageOpacity(this.getProperty("backgroundImageOpacity"))},t.prototype._syncbackgroundImageBlur=function(){this.slideBackground.setBlur(this.getProperty("backgroundImageBlur"))},t.prototype._syncbackgroundMode=function(){this.slideBackground.setMode(this.getProperty("backgroundMode"))},t.prototype._syncbackgroundVideoMp4=function(){this.slideBackground.setVideo()},t.prototype._syncbackgroundVideoMode=function(){this.slideBackground.setVideoMode(this.getProperty("backgroundVideoMode"))},t.prototype._syncbackgroundVideoOpacity=function(){this.slideBackground.setVideoOpacity(this.getProperty("backgroundVideoOpacity"))},t.prototype.getPadding=function(){return this.getProperty("padding")},t.prototype._syncpadding=function(){var t=this.getPadding().split("|*|").join("px ")+"px";this.getPaddingElement().css("padding",t),this.update(),this.uiSpacing&&this.uiSpacing.setOption("current",t)},t.prototype.syncShowOnDevice=function(t,i){},t.prototype.renderModeProperties=function(t){c.ComponentCommonAbstract.prototype.renderModeProperties.call(this,t),this._syncpadding()},t.prototype.getData=function(t){var i,s={type:this.type},n=f({},this.property);for(var h in this.deviceProperty)for(i in this.deviceProperty[h]){delete n[i];var r=this.deviceProperty[h][i];r!==o&&(s[h.toLowerCase()+i]=r)}for(i in n)switch(i){case"desktopPortrait":case"desktopLandscape":case"tabletPortrait":case"tabletLandscape":case"mobilePortrait":case"mobileLandscape":s[i.toLowerCase()]=n[i];break;default:s[i]=n[i]}return s.layers=this.container.getData(t),s},t.prototype.getSectionData=function(t){var i,s,n,h={type:this.type},r=["background-type","backgroundAlt","backgroundColor","backgroundColorEnd","backgroundColorOverlay","backgroundFocusX","backgroundFocusY","backgroundGradient","backgroundImage","backgroundImageBlur","backgroundImageOpacity","backgroundMode","backgroundTitle","backgroundVideoLoop","backgroundVideoMode","backgroundVideoMp4","backgroundVideoMuted","backgroundVideoReset","backgroundVideoOpacity","href","href-target","aria-label"],a=["padding"];for(var c in this.deviceProperty)for(i=0;i<a.length;i++)s=a[i],(n=this.deviceProperty[c][s])!==o&&(h[c.toLowerCase()+s]=n);for(i=0;i<r.length;i++)s=r[i],(n=this.property[s])!==o&&(h[s]=n);return h.layers=this.container.getData(t),h},t.prototype.getLLDroppable=function(t){if("absolute"===t.placement.getType()||"content"===t.type)switch(t.type){case"layer":case"row":case"content":return{$container:this.container.$ul,layer:this}}return!1},t.prototype.update=function(){},t.prototype.onChildCountChange=function(){},t.prototype.markEnter=function(e){},t.prototype.markLeave=function(e){},t.prototype.getSelf=function(){return this},t.prototype.getLLDroppables=function(t){return this.container.getLLDroppables(t)},t.prototype.getDroppables=function(t,i){return"absolute"===t?[this.getDroppable()]:this.container.getDroppables(i)},t.prototype.getDroppable=function(){return{$container:this.layer,layer:this,placement:"absolute"}},t.prototype.onResize=function(t){for(var i=this.getEverySortedLayers(),s=0;s<i.length;s++)i[s].placement.doLinearResize(t)},t.prototype.getEverySortedLayers=function(){for(var t=this.container.getChildLayersRecursive(!1),i={},s=t.length-1;s>=0;s--)t[s].property.parentid!==o&&t[s].property.parentid&&(i[t[s].property.parentid]===o&&(i[t[s].property.parentid]=[]),i[t[s].property.parentid].push(t[s]),t.splice(s,1));for(s=0;s<t.length;s++)t[s].property.id!==o&&t[s].property.id&&i[t[s].property.id]!==o&&(i[t[s].property.id].unshift(0),i[t[s].property.id].unshift(s+1),t.splice.apply(t,i[t[s].property.id]),delete i[t[s].property.id]);return t},t.prototype.getTargetGroupDefault=function(){var t=this.mainContent,i=this.fragmentEditor.getActiveLayer();return this.fragmentEditor.isCol(i)||this.fragmentEditor.isContent(i)?t=i:this.fragmentEditor.isRow(i)?t=i.container.getSortedLayers()[0]:"normal"===i.placement.getType()&&(t=i.group),t},t.prototype.getTargetGroupAbsolute=function(){return this},t.prototype.setMainContent=function(t){this.mainContent=t},t.prototype.layerDeleted=function(t){this._afterLayerDeletedDeBounced(t)},t.prototype._afterLayerDeletedDeBounced=NextendDeBounce((function(t){var i=this.fragmentEditor.getActiveLayer();i&&!i.isDeleted||this.fragmentEditor.resetActiveLayer()}),50),t.prototype.delete=function(){for(var t=this.container.getSortedLayers(),i=0;i<t.length;i++)t[i].delete()},t.prototype.duplicate=function(){},t.prototype.isAbsolute=function(){return!1},t.prototype.getContextMenuCopySubItems=function(){var t=c.ComponentAbstract.prototype.getContextMenuCopySubItems.call(this);return t.push({label:n2_("Slide"),icon:"ssi_16 ssi_16--image",action:function(){this.fragmentEditor.clipboard.sectionCopy()}.bind(this)}),t},t.prototype.getContextMenuPasteSubItems=function(){var t=c.ComponentAbstract.prototype.getContextMenuPasteSubItems.call(this);return this.fragmentEditor.clipboard.sectionHasClipboard()&&t.unshift({label:n2_("Slide"),icon:"ssi_16 ssi_16--image",action:function(){this.fragmentEditor.clipboard.sectionPaste()}.bind(this)}),t},t.prototype.update=function(){this.fragmentEditor.editor.getMainContainerElement().triggerHandler("updateSize")},t})),c.d("ComponentSettings","$",(function(){var $=c.$;function t(t){this.fragmentEditor=t,this.componentType=o,this.placementType=o,$("html").attr("data-component","").attr("data-placement",""),this.currentForm={},this.forms={undefined:null,placement:{absolute:c.PlacementAbsolute.getRegistryDataToFields(this),normal:c.PlacementNormal.getRegistryDataToFields(this),default:{}},component:{slide:c.SectionSlide.getRegistryDataToFields(this),content:c.Content.getRegistryDataToFields(this),row:c.Row.getRegistryDataToFields(this),col:c.Col.getRegistryDataToFields(this),layer:{}},global:c.ComponentCommonAbstract.getRegistryDataToFields(this)};var i=$("#layerposition-default").data("field");i.element.on("outsideChange",function(){i.insideChange("default"),this.currentLayer.convertToAbsolute()}.bind(this));var s=$("#layerposition-absolute").data("field");s.element.on("outsideChange",function(){s.insideChange("absolute"),this.currentLayer.convertToNormal()}.bind(this))}return t.prototype.initStyleMode=function(t,i,s){for(var n=[],h=$('.n2_ss_layer_window__tab_panel[data-panel="'+t+'"] .n2_fields_layer_window[data-fieldset-type="style-mode"]').attr("data-state",""),o=0;o<s.length;o++)n.push($(s[o]).data("field"));for(var r=0;r<n.length;r++)n[r].element.on("outsideChange",function(t){i.data("field").select.val(t.val()).trigger("change")}.bind(this,n[r].element));i.on("nextendChange",function(){var t=i.val();h.attr("data-state",t);for(var s=0;s<n.length;s++)t!==n[s].element.val()&&n[s].insideChange(t)}.bind(this)),h.find('.n2_form__table_label_field[data-style-mode-feature="reset-to-normal"] a').on("click",function(e){e.preventDefault(),this.resetStyleMode("stylemode")}.bind(this))},t.prototype.changeActiveComponent=function(t,i,s,n,h){var o=this.fragmentEditor.layerWindow.tab;switch(this.currentLayer&&"slide"===this.currentLayer.type&&o.displayTab("content"),this.currentLayer=t,$("html").attr("data-component",i).attr("data-component-sub",s),i){case"slide":o.setPanel(["slide"],["content","style"]),o.displayTab("style");break;case"content":o.setPanel(["content","common"],["content","style","animations"]);break;case"row":o.setPanel(["row","common"],["content","style","animations"]);break;case"col":o.setPanel(["column","common"],["content","style","animations"]);break;case"layer":o.setPanel(["item/"+t.item.type,"item","common"],["content","style","animations"])}this.componentType=i,this.changeActiveComponentPlacement(n),this.syncFields(h)},t.prototype.changeActiveComponentPlacement=function(t,i){$("html").attr("data-placement",t),this.placementType=t,this.syncFields(i)},t.prototype.syncFields=function(t){if("object"==typeof t){for(var i in this.currentForm=f({},this.forms.global,this.forms.component[this.componentType],this.forms.placement[this.placementType]),t)t[i]!==o&&this.updateField(i,t[i]);for(var s in this.currentLayer.onSyncFields(),this.currentForm)this.currentForm[s].off(".layeroptions").on("outsideChange.layeroptions",this.activeComponentPropertyChanged.bind(this,s))}},t.prototype.onUpdateField=function(e,t,i){e.target===this.currentLayer&&this.updateField(t,i)},t.prototype.updateField=function(t,i){var s;if("function"==typeof this.currentLayer["formSet"+t])this.currentLayer["formSet"+t](this,i);else if(this.currentLayer.advancedProperties[t]){var n=this.currentLayer.advancedProperties[t];if(n.getName()===t){var h=n.getBaseName();this.currentForm[h]&&(s=this.currentForm[h].data("field"))&&(i===o&&(i=this.currentLayer.property[h]),s.insideChange(i))}}else this.currentForm[t]!==o&&(s=this.currentForm[t].data("field"))&&s.insideChange(i)},t.prototype.activeComponentPropertyChanged=function(t,e){if(this.currentLayer&&!this.currentLayer.isDeleted)this.updateLayerProperty(t);else{var i=this.currentForm[t].data("field");i!==o&&null!==i&&i.insideChange("")}},t.prototype.updateLayerProperty=function(t){var i=this.currentForm[t].val();this.currentLayer.setProperty(t,i,"manager")},t.prototype.startFeatures=function(){this.layerFeatures=new c.LayerFeatures(this.forms.placement.absolute,this.fragmentEditor)},t.prototype.resetStyleMode=function(t,e){this.currentLayer.resetStyleMode(t)},t})),c.d("ItemButton",["$","Item"],(function(){var $=c.$;function t(){this.type="button",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Button")},t.prototype.added=function(){this.needFill=["content","class"],this.addedFont("link","font"),this.addedStyle("button","style"),this.generator.registerFields(["#item_buttoncontent","#item_buttonhref","#item_buttonclass"])},t.prototype.parseAll=function(t){t.classes="";var i=1===parseInt(t.fullwidth);this.layer.layer.toggleClass("n2-ss-layer--auto",!i),i||(t.classes+=" n2-ss-button-container--non-full-width"),parseInt(t.nowrap)&&(t.classes+=" n2-ss-nowrap"),c.Item.prototype.parseAll.apply(this,arguments)},t.prototype._render=function(t){var i=$('<div class="n2-ss-button-container n2-ow '+t.fontclass+" "+t.classes+'"></div>'),s=$('<a href="#" onclick="return false;" class="'+t.styleclass+" "+t.class+' n2-ow"></a>').appendTo(i),n=$("<div><div>"+t.content+"</div></div>").appendTo(s);if(t.icon){var h=c.Icons.render(t.icon);if(h){s.attr("data-iconplacement",t.iconplacement);var o=$('<span class="n2i '+h.class+'" style="font-size:'+t.iconsize+'%;">'+h.ligature+"</span>");"right"===t.iconplacement?o.css("marginLeft",t.iconspacing/100+"em").appendTo(n):o.css("marginRight",t.iconspacing/100+"em").prependTo(n)}}this.$item.append(i)},t})),c.d("ItemHeading",["$","Item"],(function(){var $=c.$;function t(){this.type="heading",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Heading")},t.prototype.getDefault=function(){return{href:"",font:"",style:""}},t.prototype.added=function(){this.needFill=["heading","class"],this.addedFont("hover","font"),this.addedStyle("heading","style"),this.generator.registerFields(["#item_headingheading","#item_headinghref","#item_headingclass"])},t.prototype.parseAll=function(t){t.uid=$.fn.uid();var i=1===parseInt(t.fullwidth);this.layer.layer.toggleClass("n2-ss-layer--auto",!i),t.display=i?"block":"inline-block",t.extrastyle=parseInt(t.nowrap)?"white-space: nowrap;":"",t.heading=$("<div>"+t.heading+"</div>").html().replace(/\n/g,"<br>"),t["split-text-animation-in"]===o&&(t["split-text-animation-in"]="",t["split-text-delay-in"]=0,t["split-text-animation-out"]="",t["split-text-delay-out"]=0,t["split-text-transform-origin"]="50|*|50|*|0",t["split-text-backface-visibility"]=1),t.splitTextIn=t["split-text-animation-in"],t.splitTextDelayIn=t["split-text-delay-in"]/1e3,t.splitTextOut=t["split-text-animation-out"],t.splitTextDelayOut=t["split-text-delay-out"]/1e3,t.splitTextTransformOrigin=t["split-text-transform-origin"].split("|*|").join("% ")+"%",t.splitTextBackfaceVisibility=parseInt(t["split-text-backface-visibility"])?"visible":"hidden",c.Item.prototype.parseAll.apply(this,arguments),"#"==t.href||""==t.href?(t.afontclass="",t.astyleclass=""):(t.afontclass=t.fontclass,t.fontclass="",t.astyleclass=t.styleclass,t.styleclass="")},t.prototype._render=function(t){var i=$('<div class="n2-ow"></div>'),s=$('<div id="'+t.uid+'" style="'+t.extrastyle+'"></div>').addClass("n2-ow "+t.fontclass+" "+t.styleclass+" "+t.class).css({display:t.display}).appendTo(i);"#"==t.href||""==t.href?s.html(t.heading):s.append($('<a style="display:'+t.display+';" href="#" class="'+t.afontclass+" "+t.astyleclass+' n2-ow" onclick="return false;">'+t.heading+"</a>")),this.$item.append(i),t.splitTextIn||t.splitTextOut?new c.HeadingItemSplitTextAdmin(this.fragmentEditor.editor.frontend,t.uid,t.splitTextTransformOrigin,t.splitTextBackfaceVisibility,t.splitTextIn,t.splitTextDelayIn,t.splitTextOut,t.splitTextDelayOut):this.layer.layer[0].n2SplitText&&this.layer.layer[0].n2SplitText.delete(),c.LayerNavigationTimeline.get().refreshDuration()},t})),c.d("ItemImage",["$","Item"],(function(){var $=c.$;function t(){this.type="image",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Image")},t.prototype.hasTextScale=function(){return!1},t.prototype.getDefault=function(){return{size:"auto|*|auto",href:"",style:""}},t.prototype.added=function(){this.needFill=["image","cssclass"],this.addedStyle("box","style"),this.generator.registerFields(["#item_imageimage","#item_imagealt","#item_imagetitle","#item_imagehref","#item_imagecssclass"])},t.prototype.parseAll=function(t){var i=t.size.split("|*|");t.width=i[0],t.height=i[1],delete t.size,c.Item.prototype.parseAll.apply(this,arguments),t.image!==this.fragmentEditor.editor.generator.fill(this.values.image)?(t.image=c._imageHelper.fixed(t.image),"absolute"===this.layer.placement.getType()&&this.resizeLayerToImage(c._imageHelper.fixed(t.image))):t.image=c._imageHelper.fixed(t.image)},t.prototype.fitLayer=function(){return"absolute"===this.layer.placement.getType()&&this.resizeLayerToImage(c._imageHelper.fixed(this.values.image)),!0},t.prototype._render=function(t){var i=$('<div class="'+t.styleclass+' n2-ss-item-image n2-ss-item-content n2-ow-all"></div>'),s=i;"#"!==t.href&&""!==t.href&&(s=$('<a href="#" onclick="return false;" style="background: none !important;"></a>').appendTo(i));var n=$('<img class="'+t.cssclass+'" src="'+t.image+'">').appendTo(s);t.width&&"auto"!==t.width&&n.css("width",t.width),t.height&&"auto"!==t.height&&n.css("height",t.height),this.$item.append(i)},t})),c.d("ItemText",["$","Item"],(function(){var $=c.$;function t(){this.type="text",c.Item.prototype.constructor.apply(this,arguments)}function i(t){var i=!(arguments.length>1&&arguments[1]!==o)||arguments[1],s=[];if(""===t.trim())return"";if(-1!==(t+="\n").indexOf("<pre")){var h=t.split("</pre>"),r=h.pop();t="";for(var a=0;a<h.length;a++){var c=h[a],l=c.indexOf("<pre");if(-1!==l){var u="<pre wp-pre-tag-"+a+"></pre>";s.push([u,c.substr(l)+"</pre>"]),t+=c.substr(0,l)+u}else t+=c}t+=r}var d="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";-1!==(t=n(t=(t=(t=(t=t.replace(/<br\s*\/?>\s*<br\s*\/?>/g,"\n\n")).replace(new RegExp("(<"+d+"[\\s/>])","g"),"\n\n$1")).replace(new RegExp("(</"+d+">)","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("<option")&&(t=(t=t.replace(/\s*<option/g,"<option")).replace(/<\/option>\s*/g,"</option>")),-1!==t.indexOf("</object>")&&(t=(t=(t=t.replace(/(<object[^>]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"</object>")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===t.indexOf("<source")&&-1===t.indexOf("<track")||(t=(t=(t=t.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==t.indexOf("<figcaption")&&(t=(t=t.replace(/\s*(<figcaption[^>]*>)/,"$1")).replace(/<\/figcaption>\s*/,"</figcaption>"));var f=(t=t.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return t="",f.forEach((function(i){t+="<p>"+i.replace(/^\n*|\n*$/g,"")+"</p>\n"})),t=(t=(t=(t=(t=(t=(t=(t=t.replace(/<p>\s*<\/p>/g,"")).replace(/<p>([^<]+)<\/(div|address|form)>/g,"<p>$1</p></$2>")).replace(new RegExp("<p>\\s*(</?"+d+"[^>]*>)\\s*</p>","g"),"$1")).replace(/<p>(<li.+?)<\/p>/g,"$1")).replace(/<p><blockquote([^>]*)>/gi,"<blockquote$1><p>")).replace(/<\/blockquote><\/p>/g,"</p></blockquote>")).replace(new RegExp("<p>\\s*(</?"+d+"[^>]*>)","g"),"$1")).replace(new RegExp("(</?"+d+"[^>]*>)\\s*</p>","g"),"$1"),i&&(t=(t=(t=(t=t.replace(/<(script|style).*?<\/\\1>/g,(function(t){return t[0].replace(/\n/g,"<WPPreserveNewline />")}))).replace(/<br>|<br\/>/g,"<br />")).replace(/(<br \/>)?\s*\n/g,(function(t,i){return i?t:"<br />\n"}))).replace(/<WPPreserveNewline \/>/g,"\n")),t=(t=(t=t.replace(new RegExp("(</?"+d+"[^>]*>)\\s*<br />","g"),"$1")).replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"</p>"),s.forEach((function(i){var s=i[0],n=i[1];t=t.replace(s,n)})),-1!==t.indexOf("\x3c!-- wpnl --\x3e")&&(t=t.replace(/\s?<!-- wpnl -->\s?/g,"\n")),t}t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Text")},t.prototype.getDefault=function(){return{content:"","content-mobile-enabled":0,contentmobile:"","content-tablet-enabled":0,contenttablet:"",font:"",style:""}},t.prototype.added=function(){this.needFill=["content","contenttablet","contentmobile"],this.addedFont("paragraph","font"),this.addedStyle("heading","style"),this.generator.registerFields(["#item_textcontent","#item_textcontenttablet","#item_textcontentmobile"])},t.prototype.parseAll=function(t){c.Item.prototype.parseAll.apply(this,arguments),t.p=i(t.content),t.ptablet=i(t.contenttablet),t.pmobile=i(t.contentmobile)},t.prototype._render=function(t){var i,s=!1,n=!1;1===parseInt(t["content-mobile-enabled"])&&(s=!0,$('<div class="n2-ow n2-ow-all">'+t.pmobile+"</div>").attr({"data-hide-desktoplandscape":1,"data-hide-desktopportrait":1,"data-hide-tabletlandscape":1,"data-hide-tabletportrait":1}).appendTo(this.$item)),1===parseInt(t["content-tablet-enabled"])&&(n=!0,i={"data-hide-desktoplandscape":1,"data-hide-desktopportrait":1},s?(i["data-hide-mobilelandscape"]=1,i["data-hide-mobileportrait"]=1):s=!0,$('<div class="n2-ow n2-ow-all">'+t.ptablet+"</div>").attr(i).appendTo(this.$item)),i={},s&&(i["data-hide-mobilelandscape"]=1,i["data-hide-mobileportrait"]=1),n&&(i["data-hide-tabletlandscape"]=1,i["data-hide-tabletportrait"]=1),$('<div class="n2-ow n2-ow-all">'+t.p+"</div>").attr(i).appendTo(this.$item),this.$item.find("p").addClass(t.fontclass+" "+t.styleclass)};var s=new RegExp("(<((?=!--|!\\[CDATA\\[)((?=!-)!(?:-(?!->)[^\\-]*)*(?:--\x3e)?|!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?)|[^>]*>?))");function n(t,i){for(var n=function(t){for(var i,n=[],h=t;i=h.match(s);){var o=i.index;n.push(h.slice(0,o)),n.push(i[0]),h=h.slice(o+i[0].length)}return h.length&&n.push(h),n}(t),h=!1,o=Object.keys(i),r=1;r<n.length;r+=2)for(var a=0;a<o.length;a++){var c=o[a];if(-1!==n[r].indexOf(c)){n[r]=n[r].replace(new RegExp(c,"g"),i[c]),h=!0;break}}return h&&(t=n.join("")),t}return t})),c.d("ItemVimeo",["$","Item"],(function(){"use strict";var $=c.$;function t(){this.type="vimeo",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return"Vimeo"},t.prototype.hasTextScale=function(){return!1},t.prototype.added=function(){this.needFill=["vimeourl"],this.generator.registerField("#item_vimeovimeourl")},t.prototype.parseAll=function(t){var i=this.values.vimeourl!=t.vimeourl;if(c.Item.prototype.parseAll.apply(this,arguments),""==t.image&&(t.image="$ss3-frontend$/images/placeholder/video.png"),t.image=c._imageHelper.fixed(t.image),i&&""!=t.vimeourl){var s=/https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/,n=t.vimeourl.match(s),h=!1;n?h=n[3]:t.vimeourl.match(/^[0-9]+$/)&&(h=t.vimeourl),h?c.AjaxHelper.getJSON("https://vimeo.com/api/v2/video/"+encodeURI(h)+".json").done(function(t){$("#item_vimeoimage").val(t[0].thumbnail_large).trigger("change")}.bind(this)).fail((function(i){0==t.privateurl&&c.Notification.error("Video not found or private.")})):c.Notification.error("The provided URL does not match any known Vimeo url or code.")}},t.prototype._render=function(t){var i="";"custom"===t["aspect-ratio"]&&(i="padding-top:"+t["aspect-ratio-height"]/t["aspect-ratio-width"]*100+"%");var s=$('<div class="n2_ss_video_player n2-ow-all"><div class="n2_ss_video_player__placeholder" style="'+i+'"></div></div>').attr("data-aspect-ratio",t["aspect-ratio"]).css({background:"url("+t.image+") no-repeat 50% 50%",backgroundSize:"cover"});if(parseInt(t.playbutton)||t.playbutton===o){var n="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OCA0OCI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGN4PSIyNCIgY3k9IjI0IiByPSIyNCIgZmlsbD0iIzAwMCIgb3BhY2l0eT0iLjYiLz48cGF0aCBmaWxsPSIjRkZGIiBkPSJNMTkuOCAzMmMtLjEyNCAwLS4yNDctLjAyOC0uMzYtLjA4LS4yNjQtLjExNi0uNDM2LS4zNzUtLjQ0LS42NjRWMTYuNzQ0Yy4wMDUtLjI5LjE3Ni0uNTUuNDQtLjY2Ni4yNzMtLjEyNi41OTItLjEuODQuMDdsMTAuNCA3LjI1N2MuMi4xMzIuMzIuMzU1LjMyLjU5NXMtLjEyLjQ2My0uMzIuNTk1bC0xMC40IDcuMjU2Yy0uMTQuMS0uMzEuMTUtLjQ4LjE1eiIvPjwvZz48L3N2Zz4=",h="";t.playbuttonimage&&(n=c._imageHelper.fixed(t.playbuttonimage)),t.playbuttonwidth&&(h+="width:"+t.playbuttonwidth+"px;"),t.playbuttonheight&&(h+="height:"+t.playbuttonheight+"px;"),$('<div class="n2_ss_video_player__cover"><img class="n2_ss_video_play_btn" style="'+h+'" src="'+n+'"></div>').appendTo(s)}this.$item.append(s)},t.prototype.fitLayer=function(){return!0},t})),c.d("ItemYoutube",["$","Item"],(function(){"use strict";var $=c.$;function t(){this.type="youtube",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return"YouTube"},t.prototype.hasTextScale=function(){return!1},t.prototype.added=function(){this.needFill=["youtubeurl","image","start"],this.generator.registerFields(["#item_youtubeyoutubeurl","#item_youtubeimage","#item_youtubestart"])},t.prototype.parseAll=function(t){var i=this.values.youtubeurl!==t.youtubeurl;if(c.Item.prototype.parseAll.apply(this,arguments),""===t.image&&(t.image="$ss3-frontend$/images/placeholder/video.png"),t.image=c._imageHelper.fixed(t.image),i){var s=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/,n=t.youtubeurl.match(s);if(n){var h="https://i.ytimg.com/vi/"+n[2]+"/hqdefault.jpg";"{video_url}"===this.values.youtubeurl&&(h="https://i.ytimg.com/vi/{video_id}/hqdefault.jpg"),r((function(){$("#item_youtubeimage").val(h).trigger("change")}),100)}}},t.prototype.fitLayer=function(){return!0},t.prototype._render=function(t){var i="";"custom"===t["aspect-ratio"]&&(i="padding-top:"+t["aspect-ratio-height"]/t["aspect-ratio-width"]*100+"%");var s=$('<div class="n2_ss_video_player n2-ow-all"><div class="n2_ss_video_player__placeholder" style="'+i+'"></div></div>').attr("data-aspect-ratio",t["aspect-ratio"]).css({background:"url("+t.image+") no-repeat 50% 50%",backgroundSize:"cover"});if(parseInt(t.playbutton)||t.playbutton===o){var n="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OCA0OCI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGN4PSIyNCIgY3k9IjI0IiByPSIyNCIgZmlsbD0iIzAwMCIgb3BhY2l0eT0iLjYiLz48cGF0aCBmaWxsPSIjRkZGIiBkPSJNMTkuOCAzMmMtLjEyNCAwLS4yNDctLjAyOC0uMzYtLjA4LS4yNjQtLjExNi0uNDM2LS4zNzUtLjQ0LS42NjRWMTYuNzQ0Yy4wMDUtLjI5LjE3Ni0uNTUuNDQtLjY2Ni4yNzMtLjEyNi41OTItLjEuODQuMDdsMTAuNCA3LjI1N2MuMi4xMzIuMzIuMzU1LjMyLjU5NXMtLjEyLjQ2My0uMzIuNTk1bC0xMC40IDcuMjU2Yy0uMTQuMS0uMzEuMTUtLjQ4LjE1eiIvPjwvZz48L3N2Zz4=",h="";t.playbuttonimage&&(n=c._imageHelper.fixed(t.playbuttonimage)),t.playbuttonwidth&&(h+="width:"+t.playbuttonwidth+"px;"),t.playbuttonheight&&(h+="height:"+t.playbuttonheight+"px;"),$('<div class="n2_ss_video_player__cover"><img class="n2_ss_video_play_btn" style="'+h+'" src="'+n+'"></div>').appendTo(s)}this.$item.append(s)},t})),c.d("BgAnimationEditor",["$","NextendFragmentEditorControllerWithEditor"],(function(){var $=c.$;function t(){this.parameters={shiftedBackgroundAnimation:0},this.$css=$("<style></style>").appendTo("head"),this.preview=$('<div class="n2_form__table_preview n2_ss_background_animation_preview"></div>').appendTo('.n2_form__table[data-field="table-background-animation-preview"]');var t=$('<div class="n2_ss_background_animation_preview__slider"></div>').appendTo(this.preview);this.bgAnimationElement=d(),this.bgAnimationElement.className="n2_ss_background_animation_preview__animation_container",t[0].appendChild(this.bgAnimationElement);$('<div class="n2_ss_background_animation_preview__slide"></div>').append($('<div class="n2_ss_background_animation_preview__slide_background"></div>').append($('<div class="n2_ss_background_animation_preview__slide_background_image"></div>'))).appendTo(t).clone().appendTo(t);this.backgroundAnimations={color:"eeeeeeff"},c.NextendFragmentEditorControllerWithEditor.prototype.constructor.call(this,!1),this.slides=t.find(".n2_ss_background_animation_preview__slide"),this.slides.eq(1).css("opactiy",0),this.bgImages=t.find(".n2_ss_background_animation_preview__slide_background");var i=[c._imageHelper.fixed("$ss3-frontend$/images/placeholder/image.png"),c._imageHelper.fixed("$ss3-frontend$/images/placeholder/video.png")];t.find(".n2_ss_background_animation_preview__slide_background_image").each((function(t){$(this).css("backgroundImage","url("+i[t]+")")})),this.$colorField=$("#n2-background-animationcolor").on("nextendChange",this.changeColor.bind(this))}return t.prototype=Object.create(c.NextendFragmentEditorControllerWithEditor.prototype),t.prototype.constructor=t,t.prototype.loadDefaults=function(){c.NextendFragmentEditorControllerWithEditor.prototype.loadDefaults.call(this),this.type="backgroundanimation",this.current=0,this.animationProperties=!1},t.prototype.get=function(){return null},t.prototype.load=function(t,i,s,n){},t.prototype.setTabs=function(t){},t.prototype.start=function(t){t.color!==o?(this.$colorField.data("field").insideChange(t.color),this.backgroundAnimations.color=t.color):($("#n2-tab-background-animation-form").remove(),this.$css.html(".n2-bganim-side,.n2-bganim-tile-overlay-colored{background: "+(c._currentEditor.frontend.parameters.bgAnimations.color||"#333333")+";}")),this.animationProperties&&(this.timeline?this.timeline.play():this.next())},t.prototype.changeColor=function(){this.backgroundAnimations.color=this.$colorField.val(),this.$css.html(".n2-bganim-side,.n2-bganim-tile-overlay-colored{background: "+N2Color.hex2rgbaCSS(this.backgroundAnimations.color)+";}")},t.prototype.pause=function(){this.timeline&&this.timeline.pause()},t.prototype.next=function(){this.timeline=new c.H({paused:!0,onComplete:this.ended.bind(this)});var t=this.bgImages[this.current],i=this.bgImages[1-this.current];this.currentAnimation=new c["SmartSliderBackgroundAnimation"+this.animationProperties.type](this,t,i,this.animationProperties,1,0);var s=c.MW.R(this.slides[this.current]),n=c.MW.R(this.slides[1-this.current]);s.zIndex=2,n.zIndex=3,this.timeline.to(s,.5,{opacity:0},this.currentAnimation.getExtraDelay()),this.timeline.to(n,.5,{opacity:1},this.currentAnimation.getExtraDelay()),this.currentAnimation.postSetup(),this.timeline.set({},{},"+=0.5"),this.current=1-this.current,this.timeline.play()},t.prototype.ended=function(){this.currentAnimation&&this.currentAnimation.ended(),this.next()},t.prototype.setAnimationProperties=function(t){var i=this.animationProperties;this.animationProperties=t,i||this.next()},t})),c.d("BgAnimationManager",["$","NextendVisualManagerMultipleSelection"],(function(){var $=c.$;function t(){this.type="backgroundanimation",c.NextendVisualManagerMultipleSelection.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.NextendVisualManagerMultipleSelection.prototype),t.prototype.constructor=t,t.prototype.loadDefaults=function(){c.NextendVisualManagerMultipleSelection.prototype.loadDefaults.apply(this,arguments),this.type="backgroundanimation",this.labels={visual:"Background animation",visuals:"Background animations"}},t.prototype.initController=function(){return new c.BgAnimationEditor},t.prototype.createVisual=function(t,i){return new c.NextendVisualWithSetRowMultipleSelection(t,i,this)},t.prototype.show=function(t,i){var s={};if(c._currentEditor)s.color=c._currentEditor.fragmentEditor.activeLayer.getProperty("background-animation-color");else{var n=$("#sliderbackground-animation-color");n.length&&(s.color=n.val())}c.NextendVisualManagerMultipleSelection.prototype.show.call(this,t,i,s)},t.prototype.getAsString=function(){var t=$("#sliderbackground-animation-color,#layerslide-background-animation-color");return t.length&&t.val($("#n2-background-animationcolor").val()).trigger("outsideChange"),c.NextendVisualManagerMultipleSelection.prototype.getAsString.call(this)},t})),c.d("PostBgAnimationEditor",["$","NextendFragmentEditorControllerWithEditor"],(function(){var $=c.$;function t(){c.NextendFragmentEditorControllerWithEditor.prototype.constructor.call(this,!1);var t=$('<div class="n2_form__table_preview"></div>').appendTo('.n2_form__table[data-field="table-post-background-preview"]');this.bgAnimationElement=$('<div class="n2_ss_post_background_preview"></div>').appendTo(t).on("click",this.clickFocusPoint.bind(this)),this.bgImage=$('<div class="n2_ss_post_background_preview__slide"></div>').appendTo(this.bgAnimationElement),this.us=c.MW.R(this.bgImage[0]),$('<img src="'+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/image.png")+'" alt="">').appendTo(this.bgImage),$('<div class="n2-ss-slide-background-image" style="background-image:url('+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/image.png")+')"></div>').appendTo(this.bgImage),this.transformOriginFieldX=$("#n2-post-backgroundtransformorigin-x").on("nextendChange",this.changeFocusX.bind(this)),this.transformOriginFieldY=$("#n2-post-backgroundtransformorigin-y").on("nextendChange",this.changeFocusY.bind(this))}return t.prototype=Object.create(c.NextendFragmentEditorControllerWithEditor.prototype),t.prototype.constructor=t,t.prototype.loadDefaults=function(){c.NextendFragmentEditorControllerWithEditor.prototype.loadDefaults.call(this),this.type="postbackgroundanimation",this.tween=null,this.animationProperties=!1,this.transformOriginX=50,this.transformOriginY=50},t.prototype.clickFocusPoint=function(e){var t=this.bgAnimationElement.offset(),i=Math.round((e.pageX-t.left)/this.bgAnimationElement.width()*100),s=Math.round((e.pageY-t.top)/this.bgAnimationElement.height()*100);this.transformOriginFieldX.data("field").insideChange(i),this.transformOriginFieldY.data("field").insideChange(s)},t.prototype.changeFocusX=function(){this.transformOriginX=this.transformOriginFieldX.val(),this.animationProperties&&this.setAnimationProperties(this.animationProperties)},t.prototype.changeFocusY=function(){this.transformOriginY=this.transformOriginFieldY.val(),this.animationProperties&&this.setAnimationProperties(this.animationProperties)},t.prototype.setImage=function(){if(c._currentEditor!==o){var t=c._currentEditor.frontend;if(t!==o){if(this.bgImage.html(""),t.currentSlide.background.elements.image)for(var i=t.currentSlide.background.elements.image.imageElements,s=0;s<i.length;s++)this.bgImage.append(i[s].cloneNode(!0));else console.error("Background image missing");var n=this.bgAnimationElement.parent().width()-40,h=t.responsive.resizeContext.sliderWidth,r=t.responsive.resizeContext.sliderHeight;h>n&&(r=r*n/h,h=n),this.bgAnimationElement.css({width:h,height:r})}}},t.prototype.get=function(){return null},t.prototype.load=function(t,i,s,n){},t.prototype.setTabs=function(t){},t.prototype.start=function(t){this.setImage(),this.transformOriginFieldX.data("field").insideChange(t[0]),this.transformOriginFieldY.data("field").insideChange(t[1])},t.prototype.pause=function(){this.tween&&this.tween.pause()},t.prototype.next=function(){var t=_({},this.animationProperties);t.from.transformOrigin===o&&(this.us.transformOrigin=this.transformOriginX+"% "+this.transformOriginY+"%"),t.to.delay=.5,t.to.onComplete=this.next.bind(this),this.tween=c.J.fromTo(this.us,t.duration,t.from,t.to)},t.prototype.setAnimationProperties=function(t){this.animationProperties=t,this.pause(),this.us.setValues({scale:1,x:0,y:0,rotationZ:1e-4,transformOrigin:"50% 50%"}),this.next()},t})),c.d("PostBgAnimationManager",["$","NextendVisualManagerMultipleSelection"],(function(){function t(){this.type="postbackgroundanimation",c.NextendVisualManagerMultipleSelection.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.NextendVisualManagerMultipleSelection.prototype),t.prototype.constructor=t,t.prototype.loadDefaults=function(){c.NextendVisualManagerMultipleSelection.prototype.loadDefaults.apply(this,arguments),this.type="postbackgroundanimation",this.labels={visual:"Ken Burns effect",visuals:"Ken Burns effects"}},t.prototype.initController=function(){return new c.PostBgAnimationEditor},t.prototype.createVisual=function(t,i){return new c.NextendVisualWithSetRowMultipleSelection(t,i,this)},t.prototype.show=function(t,i){var s=[];""!==t&&(t=t.split("|*|"),s[0]=t[0],s[1]=t[1],t=t[2]),c.NextendVisualManagerMultipleSelection.prototype.show.call(this,t,i,s)},t.prototype.getAsString=function(){return this.controller.transformOriginX+"|*|"+this.controller.transformOriginY+"|*|"+c.NextendVisualManagerMultipleSelection.prototype.getAsString.call(this)},t})),c.d("ItemAnimatedHeading",["$","Item"],(function(){var $=c.$;function t(){this.type="animatedHeading",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Animated heading")},t.prototype.getDefault=function(){return{font:"",style:"","font-highlight":"","style-highlight":""}},t.prototype.added=function(){this.needFill=["before-text","animated-text","after-text"],this.addedFont("highlight","font"),this.addedStyle("highlight","style"),this.generator.registerFields(["#item_animatedHeadingbefore-text","#item_animatedHeadinganimated-text","#item_animatedHeadingafter-text","#linkitem_animatedHeadinglink-1","#item_animatedHeadingclass"])},t.prototype.parseAll=function(t){t.uid=$.fn.uid(),t.display="inline-block",t.priority=2,t.class="",c.Item.prototype.parseAll.apply(this,arguments),t.afontclass="",t.astyleclass=""},t.prototype._render=function(t){var i=$('<div id="'+t.uid+'" class="n2-ss-animated-heading-wrapper n2-ow-all '+t.fontclass+" "+t.styleclass+'"></div>'),s=t["before-text"],n=t["animated-text"].split(/\r\n|\r|\n/),h=t["after-text"],o="";if(""!==s&&(o+='<ss-text class="n2-ss-animated-heading-before">'+s+"</ss-text> "),n.length){"#"===t.href||""===t.href?o+="<ss-text ":o+='<a href="#" ',o+='class="n2-highlighted n2-ss-animated-heading-i" data-animation-type="'+t.type+'" data-color="'+N2Color.hex2rgbaCSS(t.color)+'" data-animate-width="'+t["animate-width"]+'" data-delay="'+t.delay+'" data-speed="'+t.speed+'" data-show-duration="'+t["show-duration"]+'" data-loop="'+t.loop+'">',o+='<div class="n2-ss-animated-heading-i2">';for(var r=0;r<n.length;r++)""!==n[r].trim()&&(o+='<div class="n2-ss-animated-heading-i-text">'+n[r]+"</div>");o+="</div>","#"===t.href||""===t.href?o+="</ss-text>":o+="</a>"}""!==h&&(o+=' <ss-text class="n2-ss-animated-heading-after">'+h+"</ss-text>"),i.html(o),this.$item.append(i),new c.AnimatedHeadingItemAdmin(i.find(".n2-ss-animated-heading-i").get(0),this.fragmentEditor.editor.frontend)},t})),c.d("ItemArea",["$","Item"],(function(){var $=c.$;function t(){this.type="area",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.needHeight=!0,t.prototype.getLabel=function(){return n2_("Area")},t.prototype.hasTextScale=function(){return!1},t.prototype.parseAll=function(t){t.width=parseInt(t.width),t.height=parseInt(t.height),t.width>0?t.width+="px":t.width="100%",t.height>0?t.height+="px":t.height="100%",t.colora=N2Color.hex2rgbaCSS(t.color),t.color2a=N2Color.hex2rgbaCSS(t.color2),t.borderWidth=t.borderWidth.split("|*|"),t.borderColora=N2Color.hex2rgbaCSS(t.borderColor),t.borderRadius=t.borderRadius+"px"},t.prototype.fitLayer=function(){return!0},t.prototype._render=function(t){var i=$('<div class="n2-ow" style="box-sizing: border-box;'+t.css+'"></div>').css({width:t.width,height:t.height,backgroundColor:t.colora,borderWidth:t.borderWidth.join("px ")+"px",borderStyle:t.borderStyle,borderColor:t.borderColora,borderRadius:t.borderRadius});switch(t.gradient){case"horizontal":i.css("background","linear-gradient(to right, "+t.colora+" 0%,"+t.color2a+" 100%)");break;case"vertical":i.css("background","linear-gradient(to bottom, "+t.colora+" 0%,"+t.color2a+" 100%)");break;case"diagonal1":i.css("background","linear-gradient(45deg, "+t.colora+" 0%,"+t.color2a+" 100%)");break;case"diagonal2":i.css("background","linear-gradient(135deg, "+t.colora+" 0%,"+t.color2a+" 100%)")}this.$item.append(i)},t})),c.d("ItemAudio",["$","Item"],(function(){var $=c.$;function t(){this.type="audio",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Audio")},t.prototype.hasTextScale=function(){return!1},t.prototype.added=function(){this.needFill=["audio_mp3"],this.generator.registerField("#item_videovideo_mp4")},t.prototype._render=function(t){var i="#"+t.color2,s=N2Color.hex2rgbaCSS(t.color2+"33"),n=$('<div class="n2-ss-item-audio-bar n2-ow n2-ow-all" data-state="paused" data-volume="1"></div>');if(parseInt(t.show)){if(n.css("background-color",N2Color.hex2rgbaCSS(t.color)),parseInt(t.fullwidth)||n.css({display:"inline-flex",verticalAlign:"top"}),$('<div class="n2-ss-item-audio-play"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="'+i+'" d="M20 15.99c0 .41-.21.772-.52.967l-6.867 4.87c-.003 0-.006.002-.01.004l-.003.004c-.158.1-.342.156-.54.156-.585 0-1.06-.504-1.06-1.125v-9.752c0-.622.475-1.126 1.06-1.126.198 0 .382.058.54.157l.004.002.01.006 6.865 4.868c.31.196.52.556.52.97z"/></svg></div>').appendTo(n),$('<div class="n2-ss-item-audio-pause"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="'+i+'" d="M17 22V10h4v12h-4zm-6-12h4v12h-4V10z"/></svg></div>').appendTo(n),parseInt(t["show-progress"])){var h=$('<div class="n2-ss-item-audio-progress-container"></div>').appendTo(n),o=$('<div class="n2-ss-item-audio-progress" style="background-color:'+s+';"></div>').appendTo(h);$('<div class="n2-ss-item-audio-progress-playhead" style="width:50%;background-color:'+i+';"></div>').appendTo(o)}if(parseInt(t["show-time"])&&$('<div class="n2-ss-item-audio-time" style="color:'+i+';">01:35 / 03:10</div>').appendTo(n),parseInt(t["show-volume"])){$('<div class="n2-ss-item-audio-unmute"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="'+i+'" d="M15 22h-1l-4-4H9c-.45 0-1-.527-1-1v-3c0-.474.55-1 1-1h1l4-4h1v13z"/></div>').appendTo(n),$('<div class="n2-ss-item-audio-mute"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="'+i+'" d="M15 22h-1l-4-4H9c-.45 0-1-.527-1-1v-3c0-.474.55-1 1-1h1l4-4h1v13zm3.147-1.954l-.06.002c-.215 0-.423-.09-.577-.25l-.11-.116c-.286-.3-.32-.776-.078-1.117.612-.865.935-1.892.935-2.968 0-1.158-.367-2.244-1.06-3.14-.266-.342-.24-.837.055-1.148l.11-.115c.162-.172.38-.265.618-.25.23.012.446.126.592.313.963 1.236 1.472 2.737 1.472 4.34 0 1.49-.45 2.912-1.3 4.106-.143.2-.36.324-.597.342zm3.38 2.65c-.15.183-.363.293-.59.303H20.9c-.215 0-.423-.09-.577-.25l-.107-.114c-.3-.314-.32-.817-.048-1.158 1.32-1.644 2.045-3.733 2.045-5.88 0-2.236-.778-4.387-2.19-6.058-.285-.34-.27-.853.034-1.174l.107-.112c.16-.168.365-.26.603-.252.225.006.438.11.587.287C23.06 10.303 24 12.9 24 15.596c0 2.595-.878 5.116-2.474 7.1z"/></svg></div>').appendTo(n);var r=$('<div class="n2-ss-item-audio-volume-container"></div>').appendTo(n),a=$('<div class="n2-ss-item-audio-volume" style="background-color:'+s+';"></div>').appendTo(r);$('<div class="n2-ss-item-audio-volumehead" style="background-color:'+i+';"></div>').appendTo(a)}}else n.css("color",i).html("Audio layer");this.$item.append(n)},t})),c.d("ItemCaption",["$","Item"],(function(){var $=c.$;function t(){this.type="caption",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Caption")},t.prototype.added=function(){this.needFill=["content","description","image"],this.addedFont("paragraph","fonttitle"),this.addedFont("paragraph","font"),this.generator.registerFields(["#item_captionimage","#item_captioncontent","#item_captionhref"])},t.prototype.parseAll=function(t){t.uid=$.fn.uid(),t.colora=N2Color.hex2rgbaCSS(t.color),t.colorhex=t.color.substr(0,6);var i=t.animation.split("|*|");t.mode=i[0],t.direction=i[1],t.scale=parseInt(i[2]),c.Item.prototype.parseAll.apply(this,arguments),t.image!=this.fragmentEditor.editor.generator.fill(this.values.image)&&"absolute"==this.layer.placement.getType()&&this.resizeLayerToImage(c._imageHelper.fixed(t.image)),t.image=c._imageHelper.fixed(t.image)},t.prototype.fitLayer=function(){return"absolute"==this.layer.placement.getType()&&this.resizeLayerToImage(c._imageHelper.fixed(this.values.image)),!0},t.prototype._render=function(t){var i,s,n=$('<div id="'+t.uid+'" class="n2-ss-item-caption n2-ow-all n2-ss-item-caption-'+t.mode+'" data-direction="'+t.direction+'"></div>').append($('<div class="n2-ss-img-wrapper"></div>').append('<img src="'+t.image+'">')),h=$('<div class="n2-ss-item-caption-content"></div>').css({background:t.colora,justifyContent:t.verticalalign}).appendTo(n);switch(t.content&&h.append('<div class="'+t.fonttitleclass+' n2-div-h4">'+t.content+"</div>"),t.description&&h.append('<p class="'+t.fontclass+'">'+t.description+"</p>"),this.$item.append(n),t.direction){case"top":i="yP",s=-1;break;case"right":i="xP",s=1;break;case"bottom":i="yP",s=1;break;case"left":i="xP",s=-1}new c.FrontendItemCaption(this.fragmentEditor.editor.frontend,t.uid,t.mode,i,s,t.scale)},t})),c.d("ItemCirclecounter",["$","Item"],(function(){var $=c.$;function t(){this.type="circlecounter",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Circle counter")},t.prototype.added=function(){this.needFill=["label"],this.addedFont("simple","font"),this.addedFont("simple","fontlabel"),this.generator.registerField("#item_circlecounterlabel")},t.prototype._render=function(t){this.layer.layer.addClass("n2-ss-layer--auto"),t.value=parseInt(t.value),t.min=Math.min(0,t.value),t.strokewidth=parseInt(t.strokewidth),t.size=Math.max(parseInt(t.size),t.strokewidth+1),t.startvalue=Math.max(parseInt(t.startvalue),t.min),t.total=Math.max(Math.max(parseInt(t.total),t.startvalue),t.value);var i=(Math.min(t.startvalue,t.total)-t.min)/(t.total-t.min),s=(Math.min(t.value,t.total)-t.min)/(t.total-t.min),n=$('<div class="n2-ss-item-circlecounter-counting-div '+t.fontclass+' n2-ow"></div>'),h=t.size/2,o=(t.size-t.strokewidth)/2,r=Math.PI*o*2,a=(1-i)*r,l='<svg class="svg" viewBox="0 0 '+t.size+" "+t.size+'" style="width:'+t.size+"px;height:"+t.size+'px;" preserveAspectRatio="xMinYMin meet">';l+='<circle class="fl-bar-bg" r="'+o+'" cx="'+h+'" cy="'+h+'" stroke="#'+t.color.substr(0,6)+'" stroke-opacity="'+N2Color.hex2alpha(t.color)+'" stroke-width="'+t.strokewidth+'" stroke-dashoffset="0" stroke-dasharray="'+r+'" fill="transparent"></circle>',l+='<circle class="fl-bar" r="'+o+'" cx="'+h+'" cy="'+h+'" stroke="#'+t.color2.substr(0,6)+'" stroke-opacity="'+N2Color.hex2alpha(t.color2)+'" stroke-width="'+t.strokewidth+'" stroke-dasharray="'+r+'" stroke-dashoffset="'+a+'" transform="rotate(-90 '+h+" "+h+')" fill="transparent"></circle>',l+="</svg>";var u=$.fn.uid(),d=$('<div id="'+u+'" class="n2-ow n2-ss-item-circlecounter-svg-container">'+l+"</div>").css({width:t.size+"px"}),f=$('<div class="n2-ow n2-ss-item-circlecounter-svg-overlay"></div>').appendTo(d);n.appendTo(f);d.find("circle").eq(1);if(this.$item.append(d),t.label){var _=$('<div class="'+t.fontlabelclass+' n2-ow">'+t.label+"</div>");switch(t.labelplacement){case"before":_.insertBefore(d);break;case"innerbefore":_.insertBefore(n);break;case"innerafter":_.insertAfter(n);break;default:_.insertAfter(d)}}0==t.animationduration&&this.$item.closest(".n2-ss-layer").triggerHandler("deleteCounter"),new c.CounterItemAdmin(this.fragmentEditor.editor.frontend,u,{name:"circlecounter",c:r,counting:".n2-ss-item-circlecounter-counting-div",displayMode:"circle",display:"circle + circle",delay:t.animationdelay,duration:t.animationduration,fromPercent:i,min:t.min,post:t.post,pre:t.pre,toPercent:s,total:t.total}),c.LayerNavigationTimeline.get().refreshDuration()},t})),c.d("ItemCounter",["$","Item"],(function(){var $=c.$;function t(){this.type="counter",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Counter")},t.prototype.added=function(){this.needFill=["label","value","startvalue"],this.addedFont("simple","font"),this.addedFont("simple","fontlabel"),this.generator.registerField("#item_counterlabel"),this.generator.registerField("#item_countervalue"),this.generator.registerField("#item_counterstartvalue")},t.prototype._render=function(t){this.layer.layer.addClass("n2-ss-layer--auto"),t.value=parseInt(t.value),t.min=Math.min(0,t.value),t.startvalue=Math.max(parseInt(t.startvalue),t.min),t.total=Math.max(Math.max(100,t.startvalue),t.value);var i=(Math.min(t.startvalue,t.total)-t.min)/(t.total-t.min),s=(Math.min(t.value,t.total)-t.min)/(t.total-t.min),n=$.fn.uid(),h=$('<div id="'+n+'"><div class="n2-ss-item-counter-counting-div '+t.fontclass+' n2-ow">'+t.pre+100*s+t.post+"</div></div>");if(this.$item.append(h),t.label){var o=$('<div class="'+t.fontlabelclass+' n2-ow">'+t.label+"</div>");switch(t.labelplacement){case"before":o.insertBefore(h);break;default:o.insertAfter(h)}}0==t.animationduration&&this.$item.closest(".n2-ss-layer").triggerHandler("deleteCounter"),new c.CounterItemAdmin(this.fragmentEditor.editor.frontend,n,{name:"counter",counting:".n2-ss-item-counter-counting-div",displayMode:!1,delay:t.animationdelay,duration:t.animationduration,fromPercent:i,min:t.min,post:t.post,pre:t.pre,toPercent:s,total:t.total}),c.LayerNavigationTimeline.get().refreshDuration()},t})),c.d("ItemHighlightedHeading",["$","Item"],(function(){"use strict";var $=c.$;function t(){this.type="highlightedHeading",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.svg={},t.prototype.getLabel=function(){return n2_("Highlighted heading")},t.prototype.getDefault=function(){return{font:"",style:"","font-highlight":"","style-highlight":""}},t.prototype.added=function(){this.needFill=["before-text","highlighted-text","after-text"],this.addedFont("highlight","font"),this.addedStyle("highlight","style"),this.generator.registerFields(["#item_highlightedHeadingbefore-text","#item_highlightedHeadinghighlighted-text","#item_highlightedHeadingafter-text","#item_highlightedHeadinghref"])},t.prototype.parseAll=function(t){t.uid=$.fn.uid(),t.display="inline-block",t.priority=2,t.class="",c.Item.prototype.parseAll.apply(this,arguments),t.afontclass="",t.astyleclass=""},t.prototype._render=function(i){var s=$('<div id="'+i.uid+'" class="n2-ss-highlighted-heading-wrapper '+i.fontclass+" "+i.styleclass+'"></div>'),n=i["before-text"],h=i["highlighted-text"],r=i["after-text"],a="";if(""!==n&&(a+='<div class="n2-ss-highlighted-heading-before">'+n+"</div>"),""!=h){var l="";if(t.svg[i.type]!==o)l=t.svg[i.type],a+="<style>"+("div#n2-ss-0 #"+i.uid+" svg path{stroke: #"+i.color.substr(0,6)+";stroke-opacity: "+N2Color.hex2alpha(i.color)+";stroke-width: "+i.width+"px;}")+"</style>";"#"===i.href||""===i.href?a+="<div ":a+='<a href="#" ',a+='class="n2-highlighted n2-ss-highlighted-heading-highlighted n2-ow" data-highlight="'+i.type+'" data-animate="'+i.animate+'" data-delay="'+i.delay+'" data-duration="'+i.duration+'" data-loop="'+i.loop+'" data-loop-delay="'+i["loop-delay"]+'" data-front="'+i.front+'"><div class="n2-ss-highlighted-heading-highlighted-text">'+h+"</div>"+l,"#"===i.href||""===i.href?a+="</div>":a+="</a>"}""!==r&&(a+='<div class="n2-ss-highlighted-heading-after">'+r+"</div>"),s.html(a),this.$item.append(s);var u=s.find(".n2-ss-highlighted-heading-highlighted");u.length&&new c.HighlightedHeadingItemAdmin(u.get(0),this.fragmentEditor.editor.frontend),c.LayerNavigationTimeline.get().refreshDuration()},t})),c.d("ItemHtml",["$","Item"],(function(){var $=c.$;function t(){this.type="html",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("HTML")},t.prototype.hasTextScale=function(){return!1},t.prototype.added=function(){this.needFill=["html"],this.generator.registerField("#item_htmlhtml")},t.prototype._render=function(t){var i=$("<div>").css("text-align",t.textalign).html(t.html);t.css.trim()&&i.append('<style type="text/css">'+t.css+"</style>"),this.$item.append(i)},t})),c.d("ItemList",["$","Item"],(function(){var $=c.$;function t(){this.type="list",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("List")},t.prototype.added=function(){this.needFill=["content"],this.addedFont("list","font"),this.addedStyle("heading","liststyle"),this.addedStyle("heading","itemstyle"),this.generator.registerField("#item_listcontent")},t.prototype._render=function(t){for(var i=$('<ol class="'+t.liststyleclass+" "+t.fontclass+' n2-ow" style="list-style-type: '+t.type+'"></ol>'),s=t.content.split("\n"),n=0;n<s.length;n++)i.append('<li class="'+t.itemstyleclass+'">'+s[n]+"</li>");this.$item.append(i)},t})),c.d("ItemIcon2",["$","Item"],(function(){var $=c.$;function t(){this.type="icon2",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Icon")},t.prototype.added=function(){this.addedStyle("box","style")},t.prototype.parseAll=function(t){t.uid=$.fn.uid();var i=c.Icons.render(t.icon);i?(t.ligature=i.ligature,t.iconclass=i.class):(t.ligature=n2_("Icon not found"),t.iconclass=""),this.layer.layer.addClass("n2-ss-layer--auto"),c.Item.prototype.parseAll.apply(this,arguments)},t.prototype._render=function(t){var i=$('<span class="n2i '+t.styleclass+" "+t.uid+" "+t.iconclass+'">'+t.ligature+"</span>").css("fontSize",t.size/16*100+"%"),s=c._pre+" ."+t.uid+"{color:"+N2Color.hex2rgbaCSS(t.color)+";}";N2Color.hex2alpha(t.colorhover)>0&&(s+=c._pre+" ."+t.uid+":HOVER{color:"+N2Color.hex2rgbaCSS(t.colorhover)+";}"),i.append("<style>"+s+"</style>"),this.$item.append(i)},t})),c.d("ItemIframe",["$","Item"],(function(){var $=c.$;function t(){this.type="iframe",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.needHeight=!0,t.prototype.getLabel=function(){return n2_("Iframe")},t.prototype.hasTextScale=function(){return!1},t.prototype.added=function(){this.needFill=["url"],this.generator.registerField("#item_iframeurl")},t.prototype.parseAll=function(t){var i=t.size.split("|*|");t.width=i[0],t.height=i[1],delete t.size,c.Item.prototype.parseAll.apply(this,arguments)},t.prototype._render=function(t){var i=$('<iframe sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin" src="'+t.url+'" class="n2-ow" width="'+t.width+'" height="'+t.height+'" style="border:0;min-height:50px;"></iframe>');this.$item.append(i)},t})),c.d("ItemImagearea",["$","Item"],(function(){"use strict";var $=c.$;function t(){this.type="imagearea",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.needHeight=!0,t.prototype.getLabel=function(){return n2_("Image area")},t.prototype.hasTextScale=function(){return!1},t.prototype.added=function(){this.needFill=["image"],this.generator.registerFields(["#item_imageareaimage","#item_imageareahref","#item_imageareaalt"])},t.prototype.parseAll=function(t){c.Item.prototype.parseAll.apply(this,arguments),t.image=c._imageHelper.fixed(t.image)},t.prototype.fitLayer=function(){return!0},t.prototype._render=function(t){var i=$('<img src="'+t.image+'" class="n2-ow n2-ss-item-image-area">').css({objectFit:t.fillmode,objectPosition:t.positionx+"% "+t.positiony+"%"});this.$item.append(i)},t})),c.d("ItemImagebox",["$","Item"],(function(){var $=c.$;function t(){this.type="imagebox",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Image box")},t.prototype.added=function(){this.needFill=["image","heading","description"],this.addedFont("hover","fonttitle"),this.addedFont("paragraph","fontdescription"),this.addedStyle("box","style"),this.generator.registerFields(["#item_imageboximage","#item_imageboximagealt","#item_imageboxheading","#item_imageboxdescription","#item_imageboxhref"])},t.prototype.parseAll=function(t){t.classes="";var i=1===parseInt(t.fullwidth);this.layer.layer.toggleClass("n2-ss-layer--auto",!i),c.Item.prototype.parseAll.apply(this,arguments)},t.prototype._render=function(t){var i=$('<div class="n2-ss-item-imagebox-container n2-ow-all '+t.classes+'" data-layout="'+t.layout+'"></div>').addClass(t.styleclass),s=$('<div class="n2-ss-item-imagebox-image"></div>').appendTo(i),n=$('<div class="n2-ss-item-imagebox-content"></div>').css("padding",t.padding.split("|*|").join("px ")+"px").appendTo(i);if(c.ComponentAbstract.innerAlignToStyle(i,t.inneralign),"left"!==t.layout&&"right"!==t.layout||i.css("align-items",t.verticalalign),t.icon&&"icon"===t.imagetype){var h=c.Icons.render(t.icon);$('<i class="n2i '+h.class+'">'+h.ligature+"</i>").css({fontSize:t.iconsize/16*100+"%",color:N2Color.hex2rgbaCSS(t.iconcolor)}).appendTo(s)}else if(t.image){var o=$('<img src="'+c._imageHelper.fixed(t.image)+'">').appendTo(s);"top"===t.layout||"bottom"===t.layout?o.css({maxWidth:t.imagewidth+"%"}):s.css({maxWidth:t.imagewidth+"%"})}else s.remove();t.heading&&$('<div class="'+t.fonttitleclass+'">'+t.heading+"</div>").appendTo(n),t.description&&$('<div class="'+t.fontdescriptionclass+'">'+t.description+"</div>").appendTo(n),this.$item.append(i)},t})),c.d("ItemInput",["$","Item"],(function(){var $=c.$;function t(){this.type="input",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Input")},t.prototype.getDefault=function(){return{font:"",style:""}},t.prototype.added=function(){this.needFill=["placeholder","buttonlabel","class"],this.addedStyle("heading","style"),this.addedFont("simple","inputfont"),this.addedStyle("heading","inputstyle"),this.addedFont("hover","buttonfont"),this.addedStyle("heading","buttonstyle"),this.generator.registerFields(["#item_inputname","#item_inputplaceholder","#item_inputbuttonlabel","#item_inputaction","#item_inputparameters","#item_inputclass"])},t.prototype._render=function(t){var i=$('<div class="n2-ss-item-input-form '+t.styleclass+" "+t.class+' n2-ow"></div>');i.append('<div class="n2-input n2-ow '+t.inputfontclass+" "+t.inputstyleclass+'">'+t.placeholder+"</div>"),""!=t.buttonlabel.trim()&&i.append('<div class="n2-form-button n2-ow '+t.buttonfontclass+" "+t.buttonstyleclass+'">'+t.buttonlabel+"</div>"),this.$item.append(i)},t})),c.d("ItemProgressbar",["$","Item"],(function(){var $=c.$;function t(){this.type="progressbar",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Progress bar")},t.prototype.added=function(){this.needFill=["label"],this.addedFont("simple","font"),this.addedFont("simple","fontlabel"),this.generator.registerField("#item_progressbarlabel")},t.prototype._render=function(t){t.value=parseInt(t.value),t.min=Math.min(0,t.value),t.startvalue=Math.max(parseInt(t.startvalue),t.min),t.total=Math.max(Math.max(parseInt(t.total),t.startvalue),t.value);var i=(Math.min(t.startvalue,t.total)-t.min)/(t.total-t.min),s=(Math.min(t.value,t.total)-t.min)/(t.total-t.min);t.total!==t.min?(s=(Math.min(t.value,t.total)-t.min)/(t.total-t.min),i=0==t.animationduration?s:(Math.min(t.startvalue,t.total)-t.min)/(t.total-t.min)):(t.animationduration=0,i=s=0);var n=$.fn.uid(),h=$('<div id="'+n+'" class="n2-ow n2-ss-item-progressbar-container"></div>'),o=$('<div class="n2-ow n2-ss-item-progressbar"></div>').css({backgroundColor:N2Color.hex2rgbaCSS(t.color)}).appendTo(h),r=$('<div class="n2-ow n2-ss-item-progressbar-inner"></div>').css({backgroundColor:N2Color.hex2rgbaCSS(t.color2),width:100*i+"%"}).appendTo(o),a=$('<div class="n2-ss-item-progressbar-counting '+t.fontclass+' n2-ow"></div>').html(t.pre+(t.min+i*(t.total-t.min)).toFixed(0)+t.post).appendTo(r);if(t.label){var l=$('<div class="n2-ss-item-progressbar-label n2-ow '+t.fontlabelclass+'">'+t.label+"</div>");switch(t.labelplacement){case"before":l.prependTo(h);break;case"over":l.insertBefore(a);break;default:l.appendTo(h)}}this.$item.append(h),0==t.animationduration&&this.$item.closest(".n2-ss-layer").triggerHandler("deleteCounter"),new c.CounterItemAdmin(this.fragmentEditor.editor.frontend,n,{name:"progressbar",counting:".n2-ss-item-progressbar-counting",display:".n2-ss-item-progressbar-inner",displayMode:"width",delay:t.animationdelay,duration:t.animationduration,fromPercent:i,min:t.min,post:t.post,pre:t.pre,toPercent:s,total:t.total}),c.LayerNavigationTimeline.get().refreshDuration()},t})),c.d("ItemTransition",["$","Item"],(function(){var $=c.$;function t(){this.type="transition",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Transition")},t.prototype.hasTextScale=function(){return!1},t.prototype.added=function(){this.needFill=["image","image2"],this.generator.registerFields(["#item_transitionimage","#item_transitionimage2","#item_transitionalt","#item_transitionalt2","#linkitem_transitionlink-1"])},t.prototype.parseAll=function(t){t.uid=$.fn.uid(),c.Item.prototype.parseAll.apply(this,arguments);var i=t.image;t.image=c._imageHelper.fixed(t.image),t.image2=c._imageHelper.fixed(t.image2),i!==this.fragmentEditor.editor.generator.fill(this.values.image)&&"absolute"===this.layer.placement.getType()&&this.resizeLayerToImage(c._imageHelper.fixed(t.image))},t.prototype._render=function(t){var i=$('<div id="'+t.uid+'" class="n2-ss-item-transition n2-ow-all"></div>'),s=i;""!=t.href&&"#"!=t.href&&(s=$('<a href="#" onclick="return false;"></a>').appendTo(i));var n=$('<div class="n2-ss-item-transition-inner"></div>').appendTo(s);$('<img src="'+t.image+'" class="n2-ss-item-transition-image1">').appendTo(n),$('<img src="'+t.image2+'" class="n2-ss-item-transition-image2">').appendTo(n),this.$item.append(i),new c.FrontendItemTransition(this.fragmentEditor.editor.frontend,t.uid,t.animation)},t.prototype.fitLayer=function(){return"absolute"===this.layer.placement.getType()&&this.resizeLayerToImage(c._imageHelper.fixed(this.values.image)),!0},t})),c.d("ItemVideo",["$","Item"],(function(){"use strict";var $=c.$;function t(){this.type="video",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Video")},t.prototype.hasTextScale=function(){return!1},t.prototype.added=function(){this.needFill=["video_mp4","poster"],this.generator.registerField("#item_videovideo_mp4","#item_videoposter")},t.prototype.fitLayer=function(){return!0},t.prototype.parseAll=function(t){var i,s,n;this.values.video_mp4!==t.video_mp4&&(i=c._imageHelper.fixed(t.video_mp4),s=$.Deferred(),n=u("video"),n.addEventListener("loadedmetadata",(function(){var t=this.videoHeight,i=this.videoWidth;s.resolve({height:t,width:i})}),!1),n.src=i,s).done(function(t){var i=$("#item_videoaspect-ratio_select"),s=t.width/t.height;r(s===16/9?function(){i.val("16:9").trigger("change")}:1.6===s?function(){i.val("16:10").trigger("change")}:s===4/3?function(){i.val("4:3").trigger("change")}:function(){i.val("custom").trigger("change"),$("#item_videoaspect-ratio-width").val(t.width).trigger("change"),$("#item_videoaspect-ratio-height").val(t.height).trigger("change")},100)}.bind(this)),""===t.poster&&(t.poster="$ss3-frontend$/images/placeholder/video.png"),t.poster=c._imageHelper.fixed(t.poster)},t.prototype._render=function(t){var i="";"custom"===t["aspect-ratio"]&&(i="padding-top:"+t["aspect-ratio-height"]/t["aspect-ratio-width"]*100+"%");var s=$('<div class="n2_ss_video_player n2-ss-item-content n2-ss-item-video-container n2-ow-all"><div class="n2_ss_video_player__placeholder" style="'+i+'"></div></div>').attr("data-aspect-ratio",t["aspect-ratio"]).css({background:"url("+t.poster+") no-repeat 50% 50%",backgroundSize:"cover"});if(parseInt(t.playbutton)||t.playbutton===o){var n="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OCA0OCI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGN4PSIyNCIgY3k9IjI0IiByPSIyNCIgZmlsbD0iIzAwMCIgb3BhY2l0eT0iLjYiLz48cGF0aCBmaWxsPSIjRkZGIiBkPSJNMTkuOCAzMmMtLjEyNCAwLS4yNDctLjAyOC0uMzYtLjA4LS4yNjQtLjExNi0uNDM2LS4zNzUtLjQ0LS42NjRWMTYuNzQ0Yy4wMDUtLjI5LjE3Ni0uNTUuNDQtLjY2Ni4yNzMtLjEyNi41OTItLjEuODQuMDdsMTAuNCA3LjI1N2MuMi4xMzIuMzIuMzU1LjMyLjU5NXMtLjEyLjQ2My0uMzIuNTk1bC0xMC40IDcuMjU2Yy0uMTQuMS0uMzEuMTUtLjQ4LjE1eiIvPjwvZz48L3N2Zz4=",h="";t.playbuttonimage&&(n=c._imageHelper.fixed(t.playbuttonimage)),t.playbuttonwidth&&(h+="width:"+t.playbuttonwidth+"px;"),t.playbuttonheight&&(h+="height:"+t.playbuttonheight+"px;"),$('<div class="n2_ss_video_player__cover"><img class="n2_ss_video_play_btn" style="'+h+'" src="'+n+'"></div>').appendTo(s)}this.$item.append(s)},t})),c.d("ItemJoomlamodule",["$","Item"],(function(){"use strict";function t(){this.type="joomlamodule",c.Item.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.Item.prototype),t.prototype.constructor=t,t.prototype.getLabel=function(){return n2_("Joomla module")},t.prototype.hasTextScale=function(){return!1},t.prototype._render=function(t){this.$item.append("<div>{"+t.positiontype+" "+t.positionvalue+"}</div>")},t})),c.d("BackendLayerAnimationController",["$","Historical"],(function(){var $=c.$,t={repeatable:0,startDelay:0,endDelay:0,loopRepeatSelfOnly:0,inPlayEvent:"",loopPlayEvent:"",loopPauseEvent:"",loopStopEvent:"",outPlayEvent:""};function i(t){this.ready=$.Deferred(),this._loaded=!1,this.active=!1,this.layer=t}return c.Historical(i),i.prototype.onReadyListener=function(t){this.ready.done(t)},i.prototype.init=function(){if(this.layerNavigationTimeline=c.LayerNavigationTimeline.get(),this.sidebar=this.layer.layerRow,this.contentArea=$('<div class="n2_timeline_layer"></div>'),this.content=$('<div class="n2_timeline_layer__animations"></div>').data("layer",this.layer).appendTo(this.contentArea),this.layer.container!==o&&(this.containerArea=$('<div class="n2_timeline_layer__children"></div>').appendTo(this.contentArea)),this.getTargetTimelineContainer().append(this.contentArea),this.layer.layer.on({"n2-ss-activate":function(){this.content.addClass("n2_timeline_layer__animations--active")}.bind(this),"n2-ss-deactivate":function(){this.content.removeClass("n2_timeline_layer__animations--active")}.bind(this),opened:function(){this.contentArea.removeClass("n2_timeline_layer--closed")}.bind(this),closed:function(){this.contentArea.addClass("n2_timeline_layer--closed")}.bind(this)}),this.layer.isAnimatable){var t=$('<div class="n2_timeline_animation_group" data-group="in"></div>').appendTo(this.content),i=$('<div class="n2_timeline_animation_group" data-group="loop"></div>').appendTo(this.content),s=$('<div class="n2_timeline_animation_group" data-group="out"></div>').appendTo(this.content);this.structure={in:{holders:[$('<div class="n2_timeline_animation_group__row" data-row="1"></div>').appendTo(t),$('<div class="n2_timeline_animation_group__row" data-row="2"></div>').appendTo(t)],length:0},loop:{holders:[$('<div class="n2_timeline_animation_group__row" data-row="1"></div>').appendTo(i),$('<div class="n2_timeline_animation_group__row" data-row="2"></div>').appendTo(i)],length:0},out:{holders:[$('<div class="n2_timeline_animation_group__row" data-row="1"></div>').appendTo(s),$('<div class="n2_timeline_animation_group__row" data-row="2"></div>').appendTo(s)],length:0}},$('<div data-n2tip="'+n2_("Add animation")+'" class="n2_layer_navigation_list_layer__title_action n2_layer_navigation_list_layer__title_action--add-animation"><i class="ssi_16 ssi_16--animation"></i></div>').on("click",function(e){c.WindowManager.actionPrevent("ComponentRowActivate"),this.layer.activate(!0),$('.n2_ss_layer_window .n2_ss_layer_window__tab_button[data-related-tab="animations"]').trigger("click"),$('.n2_ss_layer_window .n2_container_animation__button[data-related-tab="in"]').triggerHandler("click"),this.layer.fragmentEditor.layerNavigation.interaction.detachFromLayerWindow()}.bind(this)).insertBefore(this.layer.$layerRowActions.find(".n2_layer_navigation_list_layer__title_action:last-child")),$('<div data-n2tip="'+n2_("Remove animations")+'" class="n2_layer_navigation_list_layer__title_action n2_layer_navigation_list_layer__title_action--remove-animation"><i class="ssi_16 ssi_16--clearanimation"></i></div>').on("click",function(){c.WindowManager.actionPrevent("ComponentRowActivate"),this.layer.activate(!0),this.deleteEveryGroup()}.bind(this)).insertBefore(this.layer.$layerRowActions.find(".n2_layer_navigation_list_layer__title_action:last-child")),c._tooltip.add(this.layer.layerRow)}this.layer.$.on({"layerDeleted.animations":this.deleted.bind(this)})},i.prototype.onSelfChange=function(){for(var t in this.animationTypes)this.animationTypes[t].setSelf(this.self.animationTypes[t])},i.prototype.load=function(){if(this.layer.isAnimatable&&!1===this._loaded){var i=this.layer.layer.data("animv2");this.data={},f(this.data,t);try{i!==o&&("object"!=typeof i&&(i=JSON.parse(i)),f(this.data,i))}catch(t){}for(var s in this.animationTypes={basic:new c.TimelineAnimationBasic(this),reveal:new c.TimelineAnimationReveal(this)},this.animationTypes)this.animationTypes[s].start(this.data[s]),delete this.data[s];this._loaded=!0,this.onUpdate(),this.ready.resolve()}},i.prototype.deleted=function(){this.contentArea.remove(),this.layer.$.off(".animations")},i.prototype.syncRow=function(t,i){t!==o?this.contentArea.insertBefore(t.animations.contentArea):this.getTargetTimelineContainer().append(this.contentArea)},i.prototype.getTargetTimelineContainer=function(){return this.layer.isMainGroup?this.layerNavigationTimeline.contentContainer:this.layer.group.animations.containerArea},i.prototype.onUpdate=function(){this.renderRepeatable(this.data.repeatable),this.renderStartDelay(this.data.startDelay),this.renderEndDelay(this.data.endDelay),this.content.toggleClass("n2_timeline_layer__animations--has-animation",!!(this.structure.in.length||this.structure.loop.length||this.structure.out.length)),this.layer.updateAnimations();var t=Math.max(Math.max(Math.max(1,this.structure.in.length),this.structure.loop.length),this.structure.out.length);this.content.attr("data-rows",t),this.layer.layerTitle.attr("data-rows",t),this.fixTimelineTotalDuration()},i.prototype.getEditor=function(t){return!!this.structure[t].primary&&this.structure[t].primary.getEditor()},i.prototype.loadData=function(i){var s;for(s in this.structure)this.structure[s].primary&&this.structure[s].primary.remove();for(s in this.data=_({},t,i),this.animationTypes)if(this.data[s]!==o){var n=this.data[s];delete this.data[s],this.animationTypes[s].loadData(n)}this.onUpdate()},i.prototype.replaceGroupData=function(t,i){this.animationTypes[i.type].replaceGroupDataWithPreset(t,i)},i.prototype.setData=function(t,i){if(this.data[t]!==o&&this.data[t]!==i){var s=c.History.get().addValue(this,this.historySetData,[t]);s&&s.setValues(this.data[t],i),this._setData(t,i)}},i.prototype.historySetData=function(t,i){this._setData(i,t)},i.prototype._setData=function(t,i){this.data[t]=i,this.onUpdate()},i.prototype.getAnimationsCode=function(){if(!1===this._loaded)return this.layer.layer.data("animv2");var t=this.getData();return JSON.stringify(t)},i.prototype.getData=function(){var i=f({},this.data);for(var s in this.animationTypes){var n=this.animationTypes[s].getData(!0);!1!==n&&(i[s]=n)}var h=c._deepDiff.map(i,t);return $.isEmptyObject(h)?"":h},i.prototype.hasAnimation=function(){for(var t in this.animationTypes)if(this.animationTypes[t].hasAnimation())return!0;return!1},i.prototype.fixTimelineTotalDuration=function(){this.layerNavigationTimeline.refreshDuration()},i.prototype.addPrimaryAnimation=function(t,i){this.structure[t].primary!==o&&this.structure[t].primary.remove(),i.setHolder(this.structure[t].holders[0]),this.structure[t].primary=i,this.structure[t].length++},i.prototype.removePrimaryAnimation=function(t,i){this.structure[t].primary&&this.structure[t].primary===i&&(delete this.structure[t].primary,this.structure[t].length--,this.onUpdate())},i.prototype.addExtraAnimation=function(t,i,s){this.structure[t].length++,this.structure[t][i]=this,s.bar.bar.appendTo(this.structure[t].holders[1]),this.onUpdate()},i.prototype.removeExtraAnimation=function(t,i,s){delete this.structure[t][i],this.structure[t].length--,this.onUpdate()},i.prototype.deleteEveryGroup=function(){this.setData("startDelay",0),this.setData("endDelay",0),this.removeGroup("in"),this.removeGroup("loop"),this.removeGroup("out"),this.onUpdate()},i.prototype.removeGroup=function(t){this.structure[t].primary&&this.structure[t].primary.remove()},i.prototype.createUIStartDelay=function(){this.$startDelayContainer===o&&(this.$startDelayContainer=$('<div class="n2_timeline_animation_repeat n2_timeline_animation_repeat--start"></div>').prependTo(this.content),new c.UIDraggableDelay(this.$startDelayContainer,{drag:function(e,t){t.currentData.width=this.layerNavigationTimeline.normalizeOffsetX(t.currentData.width);var i=this.layerNavigationTimeline.offsetXToDuration(t.currentData.width);i>=.15?this.$startDelayContainer.text(1e3*i):this.$startDelayContainer.text("")}.bind(this),stop:function(e,t){var i=this.layerNavigationTimeline.offsetXToDuration(t.currentData.width);this.setData("startDelay",i)}.bind(this)}))},i.prototype.createUIEndDelay=function(){this.$endDelayContainer===o&&(this.$endDelayContainer=$('<div class="n2_timeline_animation_repeat n2_timeline_animation_repeat--end"></div>').appendTo(this.content),new c.UIDraggableDelay(this.$endDelayContainer,{drag:function(e,t){t.currentData.width=this.layerNavigationTimeline.normalizeOffsetX(t.currentData.width);var i=this.layerNavigationTimeline.offsetXToDuration(t.currentData.width);i>=.15?this.$endDelayContainer.text(1e3*i):this.$endDelayContainer.text("")}.bind(this),stop:function(e,t){var i=this.layerNavigationTimeline.offsetXToDuration(t.currentData.width);this.setData("endDelay",i)}.bind(this)}))},i.prototype.renderRepeatable=function(t){t&&(this.createUIStartDelay(),this.createUIEndDelay()),this.content.toggleClass("n2_timeline_layer__animations--repeated",!!t)},i.prototype.renderStartDelay=function(t){this.$startDelayContainer!==o&&(this.$startDelayContainer.width(this.layerNavigationTimeline.durationToOffsetX(t)+"px"),t>=.15?this.$startDelayContainer.text(1e3*t):this.$startDelayContainer.text(""))},i.prototype.renderEndDelay=function(t){this.$endDelayContainer!==o&&(this.$endDelayContainer.width(this.layerNavigationTimeline.durationToOffsetX(t)+"px"),t>=.15?this.$endDelayContainer.text(1e3*t):this.$endDelayContainer.text(""))},i.prototype.clearDeviceSpecific=function(t){this.animationTypes&&this.animationTypes.basic.clearDeviceSpecific(t)},i})),c.d("LayerWindowAnimationEditor",["$","TimelineAnimationBasicEditor"],(function(){var $=c.$;function t(t){for(var s in this.$presetsList={in:!1,loop:!1,out:!1},this.presets=f({in:{},loop:{},out:{}},i.ss3LayerAnimationPresets),delete i.ss3LayerAnimationPresets,this.currentEditor=!1,this.insideUpdate=!1,this.timeline=null,this.animationManager=t,this.currentTab=0,this.$container=$('.n2_container_animation[data-field="animation-animation"]'),this.$buttons=this.$container.find("> .n2_container_animation__buttons > .n2_container_animation__button").on("click",this.showTab.bind(this)),this.$tabs=this.$container.find("> .n2_container_animation__tabs > .n2_container_animation__tab"),this.$buttons.eq(0).triggerHandler("click"),this.tabsDict={in:{index:0,$tab:this.$tabs.eq(0)},loop:{index:1,$tab:this.$tabs.eq(1)},out:{index:2,$tab:this.$tabs.eq(2)},events:{index:3,$tab:this.$tabs.eq(3)}},this.activeLayer=null,this.animationManager.fragmentEditor.$.on("activeLayerChanged",this.loadDataForLayer.bind(this)),this.editors={basic:new c.TimelineAnimationBasicEditor(this),reveal:new c.TimelineAnimationRevealEditor(this)},this.globalForm={inPlayEvent:{input:$("#layerin-play-event"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}},outPlayEvent:{input:$("#layerout-play-event"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}},loopPlayEvent:{input:$("#layerloop-play-event"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}},loopPauseEvent:{input:$("#layerloop-pause-event"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}},loopStopEvent:{input:$("#layerloop-stop-event"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}},repeatable:{input:$("#layerrepeatable"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return parseInt(this.input.val())}},startDelay:{input:$("#layerstart-delay"),set:function(t){this.input.data("field").insideChange(1e3*t)},get:function(){return parseInt(this.input.val())/1e3}},endDelay:{input:$("#layerend-delay"),set:function(t){this.input.data("field").insideChange(1e3*t)},get:function(){return parseInt(this.input.val())/1e3}},loopRepeatSelfOnly:{input:$("#layerloop-repeat-self-only"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return parseInt(this.input.val())}}},this.globalForm)this.globalForm[s].input.on("outsideChange.n2-editor",function(t,e){this.insideUpdate=!0,this.activeLayer.animations.setData(t,this.globalForm[t].get()),this.insideUpdate=!1}.bind(this,s));$("body").on("timelinePlay",this.previewCancel.bind(this))}return t.prototype.showTab=function(e){e.preventDefault();var t=$(e.currentTarget),i=t.data("related-tab");this.currentTab!==i&&(this.$buttons.removeClass("n2_container_animation__button--active"),this.$tabs.removeClass("n2_container_animation__tab--active"),t.addClass("n2_container_animation__button--active"),this.$tabs.filter('[data-tab="'+i+'"]').addClass("n2_container_animation__tab--active"),this.currentTab=i,this.updateCurrentTab())},t.prototype.loadDataForLayer=function(){if("animations"===this.animationManager.fragmentEditor.layerWindow.tab.getActiveTabName()){var t=this.animationManager.getActiveLayer();this.activeLayer!==t&&(this.activeLayer=t,this.updateCurrentTab())}},t.prototype.updateEventsTab=function(){var t=this.activeLayer.animations;for(var i in t.data)this.globalForm[i]!==o&&this.globalForm[i].get()!==t.data[i]&&this.globalForm[i].set(t.data[i])},t.prototype.updateCurrentTab=function(){if(this.activeLayer&&!this.insideUpdate)if("events"===this.currentTab)this.updateEventsTab();else{var t=this.tabsDict[this.currentTab].$tab,i=this.currentTab,s=this.activeLayer.animations;this.onBeforeClearAnimationsTab(),t.empty();var n=s.getEditor(i);n?(this.currentEditor=n,n.display(t)):(this.previewCancel(),this.getPresetList(i).appendTo(t))}},t.prototype.onBeforeClearAnimationsTab=function(){if(this.currentEditor)this.currentEditor.close(),this.currentEditor=!1;else for(var t in this.$presetsList)this.$presetsList[t]&&this.$presetsList[t].detach()},t.prototype.getPresetList=function(t){if(!1===this.$presetsList[t]){var i,s=this.presets[t],n=$('<div class="n2_layer_window_animations_presets"></div>'),h=$('<div class="n2_layer_window_animations_presets__buttons"></div>').appendTo(n),o=0;for(var r in s){i=$('<div class="n2_layer_window_animations_presets__presets"></div>').appendTo(n),$('<div class="n2_layer_window_animations_presets__button"><i class="ssi_24 '+s[r].icon+'"></i><div class="n2_layer_window_animations_presets__button_label">'+s[r].label+"</div></div>").data("ul",i).attr("data-group",r).on("click",(function(){var t=$(this),i=t.parent(),s=i.data("active");s&&(s.removeClass("n2_layer_window_animations_presets__button--active"),s.data("ul").removeClass("n2_layer_window_animations_presets__presets--active")),i.data("active",t),t.addClass("n2_layer_window_animations_presets__button--active"),t.data("ul").addClass("n2_layer_window_animations_presets__presets--active")})).appendTo(h);for(var a=0;a<s[r].a.length;a++){var c=s[r].a;$('<div class="n2_layer_window_animations_presets__preset"></div>').appendTo(i).on({mouseenter:this.previewPlay.bind(this,t,c[a]),mouseleave:this.previewCancel.bind(this),click:this.replaceWithPreset.bind(this,t,c[a])}).text(c[a].name)}o++}if(1===o)i.addClass("n2_layer_window_animations_presets__presets--active"),h.remove();else for(h.find(".n2_layer_window_animations_presets__button").eq(0).triggerHandler("click");o%4!=0;o++)$("<div></div>").appendTo(h);this.$presetsList[t]=n}return this.$presetsList[t]},t.prototype.previewPlay=function(t,i){this.editors[i.type]!==o&&(this.previewEditor=this.editors[i.type],this.previewEditor.previewPreset(t,_({},i)))},t.prototype.previewCancel=function(){this.previewEditor&&(this.previewEditor.previewCancel(),this.previewEditor=!1)},t.prototype.replaceWithPreset=function(t,i,e){e.preventDefault(),this.previewCancel(),this.activeLayer.animations.replaceGroupData(t,_({},i))},t.prototype.update=function(t){t===this.activeLayer&&this.updateCurrentTab()},t})),c.d("LayerNavigationTimeline","$",(function(){var $=c.$;function t(s,n){this.fragmentEditor=s,this.layerNavigation=n,this.oneSecWidth=200,this.oneSecMs=1e3,this.fps=20,this.pxToFrame=this.oneSecWidth/this.fps,n.$layerNavigation.addClass("n2_layer_navigation--has_timeline"),this.$timeline=$('<div class="n2_timeline"></div>').appendTo(n.$layerNavigation),this.$timelineInner=$('<div class="n2_timeline__inner_pane"></div>').appendTo(this.$timeline),t.instance=this,this.initTimeFrame(),this.contentContainer=$('<div class="n2_timeline_layers"></div>').appendTo(this.$timelineInner),this._extendTimeFrame(0),this.initCurrentTimeIndicator(),this.timelineControl=new c.TimelineControl(this),this.layerWindowEditor=new c.LayerWindowAnimationEditor(this),this.layerNavigation.addScrollPane(this.$timeline),this.layerNavigation.scrollBarHeight=n2const.getScrollbarSize(),this.onResize(),$(i).on("resize",this.onResize.bind(this))}return t.get=function(){return t.instance},t.prototype.onResize=function(){this.slideCTI.height(this.layerNavigation.$layerNavigation.height()-n2const.getScrollbarSize()-3+"px")},t.prototype.durationToOffsetX=function(t){return t*this.oneSecWidth},t.prototype.offsetXToDuration=function(t){return t/this.oneSecWidth},t.prototype.normalizeOffsetX=function(t){return Math.round(t/this.pxToFrame)*this.pxToFrame},t.prototype.getActiveLayer=function(){return this.fragmentEditor.getActiveLayer()},t.prototype.initTimeFrame=function(){this.timeMarker=$('<div class="n2_timeline__time_frames"></div>').appendTo(this.$timelineInner),$('<div class="n2_timeline__time_frames_overlay"></div>').append('<svg><defs><symbol id="n2-timeline-big"><rect y="2" width="1" height="46" fill="currentColor" /></symbol><symbol id="n2-timeline-medium"><rect y="38" width="1" height="10" fill="currentColor" /></symbol><symbol id="n2-timeline-small"><rect y="43" width="1" height="5" fill="currentColor" /></symbol></defs><pattern id="n2-timeline-pattern" viewBox="0 0 200 48" width="200" height="48" patternUnits="userSpaceOnUse"><use xlink:href="#n2-timeline-big" x="0" /><use xlink:href="#n2-timeline-small" x="10" /><use xlink:href="#n2-timeline-medium" x="20" /><use xlink:href="#n2-timeline-small" x="30" /><use xlink:href="#n2-timeline-medium" x="40" /><use xlink:href="#n2-timeline-small" x="50" /><use xlink:href="#n2-timeline-medium" x="60" /><use xlink:href="#n2-timeline-small" x="70" /><use xlink:href="#n2-timeline-medium" x="80" /><use xlink:href="#n2-timeline-small" x="90" /><use xlink:href="#n2-timeline-medium" x="100" /><use xlink:href="#n2-timeline-small" x="110" /><use xlink:href="#n2-timeline-medium" x="120" /><use xlink:href="#n2-timeline-small" x="130" /><use xlink:href="#n2-timeline-medium" x="140" /><use xlink:href="#n2-timeline-small" x="150" /><use xlink:href="#n2-timeline-medium" x="160" /><use xlink:href="#n2-timeline-small" x="170" /><use xlink:href="#n2-timeline-medium" x="180" /><use xlink:href="#n2-timeline-small" x="190" /></pattern><rect fill="url(#n2-timeline-pattern)" width="100%" height="100%"/></svg>').appendTo(this.timeMarker).on("mousedown",function(e){var t=this.offsetXToDuration(e.pageX-$(e.currentTarget).offset().left-21);this.disablePreviewModeWidthCTI(t)||this.setCTI(t),this.slideCTI.trigger(e),$(s).one("mouseup",function(e){this.timelineControl.unHold(),this.slideCTI.trigger(e)}.bind(this))}.bind(this))},t.prototype.refreshDuration=NextendDeBounce((function(){this._extendTimeFrame(this.getMinimumSlideDuration())}),200),t.prototype._extendTimeFrame=function(t){t=Math.floor(t)+1;var i=this.timeMarker.find(".n2_timeline__one_second"),s=i.length;for(t<10&&(t=10),s>t&&(i.slice(t).remove(),s=t);s<=t;s++)$('<div class="n2_timeline__one_second">'+s+"s</div>").appendTo(this.timeMarker);this.$timelineInner.css("width",s*this.oneSecWidth+21+"px").removeClass("n2_timeline__inner_pane--calculate-duration"),c._triggerResize()},t.prototype.getMinimumSlideDuration=function(){return this.$timelineInner.addClass("n2_timeline__inner_pane--calculate-duration"),this.offsetXToDuration(this.$timeline[0].scrollWidth-20)},t.prototype.initCurrentTimeIndicator=function(){this.slideCTI=$('<div class="n2_timeline__cti"><div class="n2_timeline__cti_dot"></div></div>').appendTo(this.timeMarker),new c.UIDraggable(this.slideCTI,{axis:"x",cursor:"ew-resize",start:function(t,i){this.timelineControl.enterPreviewMode(),this.timelineControl.pause(),this.slideDurationPx=this.timelineControl.timeline.totalDuration()*this.oneSecWidth}.bind(this),drag:function(t,i){i.position.left=Math.max(i.position.left,-.05*this.oneSecWidth),i.position.left=Math.min(i.position.left,this.slideDurationPx),this.setCTI(this.offsetXToDuration(i.position.left))}.bind(this),stop:function(t,i){this.timelineControl.unHold(),this.disablePreviewModeWidthCTI(this.offsetXToDuration(i.position.left)),delete this.slideDurationPx}.bind(this)})},t.prototype.disablePreviewModeWidthCTI=function(t){return(null==t||t<0)&&this.timelineControl.exitPreviewMode()},t.prototype.setCTI=function(t){this.timelineControl.setPosition(Math.max(0,t)),this.timelineControl.hold()},t.prototype.appendRow=function(t,i){t.group.isMainGroup?this.contentContainer.append(i):t.group.animations.contentArea.append(i)},t})),c.d("TimelineAnimationAbstract",["$","Historical"],(function(){"use strict";function t(t,i){this.needBar===o&&(this.needBar=!0),this.layerNavigationTimeline=c.LayerNavigationTimeline.get(),this.data=t,this.group=i,this.needBar&&(this.bar=new c.TimelineBar(this,this.getBarOptions()),this.bar.renderDelay(this.data.delay),this.bar.renderDuration(this.data.duration))}return c.Historical(t),t.prototype.getBarOptions=function(){return{class:"n2_timeline_animation_bar n2_timeline_animation_bar--"+this.group,draggable:!0,resizable:!0,draggableEnd:function(e,t){this.setDelay(t.delay),this.fixTimelineTotalDuration()}.bind(this),resizableStop:function(e,t){this.setDelay(t.delay),this.setDuration(t.duration),this.fixTimelineTotalDuration()}.bind(this),click:this.click.bind(this)}},t.prototype.getBar=function(){return this.bar.bar},t.prototype.click=function(e){},t.prototype.getDelay=function(){return this.data.delay},t.prototype.setDelay=function(t){this.setData("delay",t)},t.prototype.setDuration=function(t){this.setData("duration",t)},t.prototype.animationChanged=function(){this.needBar&&(this.bar.renderDelay(this.data.delay),this.bar.renderDuration(this.data.duration),this.fixTimelineTotalDuration())},t.prototype.whenDeleted=function(){this.needBar&&this.bar.remove()},t.prototype.fixTimelineTotalDuration=function(){this.animationType.fixTimelineTotalDuration()},t})),c.d("TimelineAnimationExtra",["$","TimelineAnimationAbstract"],(function(){"use strict";function t(t,i,s,n){this.layer=t,this.name=i,this.group=s,this.options=f({label:!1,delay:0,duration:0,setDelay:o,setDuration:o,click:o},n),this.bar=new c.TimelineBar(this,{label:this.options.label,class:"n2_timeline_animation_bar n2_timeline_animation_bar--extra",draggable:"function"==typeof this.options.setDelay,resizable:"function"==typeof this.options.setDuration,click:this.click.bind(this),draggableEnd:this.draggableEnd.bind(this),resizableStop:this.resizableStop.bind(this)}),this.bar.renderDelay(this.options.delay),this.bar.renderDuration(this.options.duration),this.setController(t.animations)}return t.prototype.setController=function(t){this.controller=t,this.controller.addExtraAnimation(this.group,this.name,this)},t.prototype.getName=function(){return this.name},t.prototype.getGroup=function(){return this.group},t.prototype.getDelay=function(){return this.options.delay},t.prototype.draggableEnd=function(e,t){this.layer.activate(),"function"==typeof this.options.setDelay&&this.options.setDelay.call(this,t.delay)},t.prototype.resizableStop=function(e,t){this.layer.activate(),"function"==typeof this.options.setDelay&&this.options.setDelay.call(this,t.delay),"function"==typeof this.options.setDuration&&this.options.setDuration.call(this,t.duration)},t.prototype.click=function(e){"function"==typeof this.options.click?(this.layer.activate(),this.options.click.call(this,e)):this.layer.activate(e)},t.prototype.remove=function(){this.bar.remove(),delete this.bar,this.controller.removeExtraAnimation(this.group,this.name,this)},t})),c.d("TimelineBar","$",(function(){var $=c.$;function t(t,i){this.options=f({label:!1,class:"",draggable:!1,resizable:!1,draggableEnd:o,resizableStop:o,click:o},i),this.animation=t,this.layerNavigationTimeline=c.LayerNavigationTimeline.get(),this.delay=$('<div class="n2_timeline_animation_bar__delay"></div>'),this.duration=$('<div class="n2_timeline_animation_bar__duration"></div>'),!1!==this.options.label&&this.duration.html(this.options.label),this.bar=$('<div class="'+this.options.class+'"></div>').data("animation",this).append(this.delay).append(this.duration),this.options.draggable&&new c.UIDraggableBar(this.bar,{drag:function(e,t){t.currentData.margin=this.layerNavigationTimeline.normalizeOffsetX(t.currentData.margin),this.renderDelay(this.layerNavigationTimeline.offsetXToDuration(t.currentData.margin))}.bind(this),stop:function(e,t){c.WindowManager.actionPrevent("ComponentRowActivate");var i=this.layerNavigationTimeline.offsetXToDuration(t.currentData.margin);this.renderDelay(i),this.fire("draggableEnd",e,{delay:i})}.bind(this)}),this.options.resizable&&new c.UIResizeBar(this.bar,{resize:function(e,t){var i=this.layerNavigationTimeline.normalizeOffsetX(t.currentData.margin),s=t.currentData.margin-i;t.currentData.margin=i,t.currentData.width=this.layerNavigationTimeline.normalizeOffsetX(t.currentData.width+s),this.renderDelay(this.layerNavigationTimeline.offsetXToDuration(t.currentData.margin)),this.renderDuration(this.layerNavigationTimeline.offsetXToDuration(t.currentData.width))}.bind(this),stop:function(e,t){c.WindowManager.actionPrevent("ComponentRowActivate");var i=this.layerNavigationTimeline.offsetXToDuration(t.currentData.margin),s=this.layerNavigationTimeline.offsetXToDuration(t.currentData.width);this.renderDelay(i),this.renderDuration(s),this.fire("resizableStop",e,{delay:i,duration:s})}.bind(this)}),this.bar.on("click",this.fire.bind(this,"click"))}return t.prototype.renderDelay=function(t){this.bar.css("marginLeft",this.layerNavigationTimeline.durationToOffsetX(t)+"px"),this.delay.toggleClass("n2_timeline_animation_bar__delay--small",t<.15).text(Math.round(t*this.layerNavigationTimeline.oneSecMs))},t.prototype.renderDuration=function(t){this.bar.css({width:this.layerNavigationTimeline.durationToOffsetX(t)+"px"}),!1===this.options.label?this.duration.text(Math.round(t*this.layerNavigationTimeline.oneSecMs)):"function"==typeof this.options.label&&this.duration.text(this.options.label.call(this,t))},t.prototype.remove=function(){this.bar.remove()},t.prototype.detach=function(){this.bar.detach()},t.prototype.fire=function(t,e,i){"function"==typeof this.options[t]&&this.options[t].call(this,e,i)},t})),c.d("TimelineControl","$",(function(){var $=c.$,t=0,s=1,n=2,h=3,o=4;function a(t){this.status=0,this.layerNavigationTimeline=t,this.fragmentEditor=t.fragmentEditor,this.$overlay=$('<div class="n2_timeline_overlay_playing"></div>').appendTo("body").on("mousedown",function(e){this.exitPreviewMode()}.bind(this)),this.$playButton=$(".n2_timeline_control_play_pause").on({click:this.onPlayButton.bind(this)}),$(i).on("keydown",function(e){"INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName||e.target.isContentEditable||(0===e.keyCode||32===e.keyCode?this.onPlayButton(e):27===e.keyCode&&this.onStopButton(e))}.bind(this)),$(".n2_timeline_layers").on("mousedown",this.exitPreviewMode.bind(this,!1))}return a.prototype.isActivated=function(){return this.status!==t},a.prototype.onStopButton=function(e){e.preventDefault(),e.stopPropagation(),this.status!==t&&this.exitPreviewMode()},a.prototype.onPlayButton=function(e){e.preventDefault(),$("body").triggerHandler("timelinePlay"),r(function(){switch(this.status){case t:this.enterPreviewMode(),this.play();break;case s:this.play();break;case h:this.exitPreviewMode()}}.bind(this),100)},a.prototype.enterPreviewMode=function(){if(this.status===t){$("body").addClass("n2_body--timeline-preview");var i=this.fragmentEditor.editor.getHorizontalRatio(),n=this.fragmentEditor.editor.getVerticalRatio();this.animations=this.fragmentEditor.mainContainer.createLayerAnimations(i,n),this.timeline=new c.H({paused:1,onComplete:function(){this.timeline.totalDuration()>0&&this.timeline.restart()}.bind(this)});for(var h=0;h<this.animations.length;h++){var o=this.animations[h];o.timeline&&(this.timeline.add(o.timeline,0),o.timeline.paused(!1))}var r=this.timeline.totalDuration(),a={left:c.LayerNavigationTimeline.get().durationToOffsetX(r),ease:"linear"};this.timeline.fromTo(this.layerNavigationTimeline.slideCTI,r,{left:0},a,0),this.status=s}},a.prototype.exitPreviewMode=function(e){if(this.status!==t){e&&(e.preventDefault(),e.stopPropagation()),this.status===h&&this.pause();for(var i=0;i<this.animations.length;i++)this.animations[i].resetToEditor();this.timeline.kill(),$("body").removeClass("n2_body--timeline-preview"),this.layerNavigationTimeline.slideCTI.css("left","-10px"),this.status=t}},a.prototype.play=function(){return this.status===s&&(this.status=h,this.$playButton.addClass("n2_timeline_control_play_pause--playing"),this.timeline.play(),!0)},a.prototype.pause=function(){return this.status===h&&(this.status=s,this.$playButton.removeClass("n2_timeline_control_play_pause--playing"),this.timeline.pause(),!0)},a.prototype.hold=function(){this.status===s?this.status=n:this.status===h&&(this.status=o,this.timeline.pause())},a.prototype.unHold=function(){this.status===n?this.status=s:this.status===o&&(this.status=h,this.timeline.play())},a.prototype.setPosition=function(t){this.enterPreviewMode(),this.timeline.seek(t)},a})),c.d("TimelineAnimationGroupAbstract",["$","Historical"],(function(){function t(t,i,s,n){this.animationType=t,this.group=i,this.defaults=s,this.data=_({},s,n)}return c.Historical(t),t.prototype.remove=function(){},t.prototype.setHolder=function(t){this.$holder=t},t.prototype.getData=function(t){var i=_({},this.data);return t?c._deepDiff.map(i,this.defaults):i},t.prototype.setData=function(t,i){if(this.data[t]!==o&&this.data[t]!==i){var s=c.History.get().addValue(this,this.historySetData,[t]);s&&s.setValues(this.data[t],i),this._setData(t,i)}},t.prototype.historySetData=function(t,i){this._setData(i,t)},t.prototype._setData=function(t,i){this.data[t]=i,"function"==typeof this["onChange_"+t]&&this["onChange_"+t](i),this.editorGroup&&this.editorGroup.outsideChange(t,i)},t})),c.d("TimelineAnimationTypeAbstract",["$","Historical"],(function(){"use strict";function t(t){for(var i in this.controller=t,this.layer=t.layer,this.groups=this.groups||{},this.defaults={},this.groups)this.defaults[i]=!1}return c.Historical(t),t.prototype.start=function(t){for(var i in this.data=f({},this.defaults,t),this.data)this.createGroup(i,this.data[i])},t.prototype.fixTimelineTotalDuration=function(){this.controller.fixTimelineTotalDuration()},t.prototype.loadData=function(t){for(var i in this.data=f({},this.defaults,t),this.groups)this.replaceGroupData(i,this.data[i])},t.prototype.hasAnimation=function(t){if(t!==o)return!!this.groups[t];for(var i in this.groups)if(this.groups[i])return!0;return!1},t.prototype.replaceGroupDataWithPreset=function(t,i){this.replaceGroupData(t,i)},t.prototype.replaceGroupData=function(t,i){!1===this.groups[t]?this.createGroup(t,i,!0):this.getGroup(t).replace(i)},t.prototype.getGroup=function(t){return this.groups[t]},t.prototype.createGroup=function(t,i,s){return!1},t.prototype.onGroupNotAnimated=function(t){this.groups[t.group]=!1,this.controller.removePrimaryAnimation(t.group,t)},t.prototype.getData=function(t){var i=!1,s={};for(var n in this.groups)this.groups[n]&&(s[n]=this.groups[n].getData(t),i=!0);return!!i&&s},t.prototype.onGroupAnimated=function(t){this.groups[t.group]=t,this.controller.addPrimaryAnimation(t.group,t)},t.prototype.onSelfChange=function(){for(var t in this.groups)this.groups[t]&&this.groups[t].setSelf(this.getSelf().groups[t])},t})),c.d("TimelineAnimationBasic",["$","TimelineAnimationTypeAbstract"],(function(){"use strict";function t(){this.groups={in:!1,loop:!1,out:!1},c.TimelineAnimationTypeAbstract.apply(this,arguments)}return t.prototype=Object.create(c.TimelineAnimationTypeAbstract.prototype),t.prototype.constructor=t,t.prototype.createGroup=function(t,i,s){if(!1!==i)switch(t){case"in":return new c.TimelineAnimationBasicGroupIn(this,i,s);case"loop":return new c.TimelineAnimationBasicGroupLoop(this,i,s);case"out":return new c.TimelineAnimationBasicGroupOut(this,i,s)}return!1},t.prototype.clearDeviceSpecific=function(t){for(var i in this.groups)this.groups[i]&&this.groups[i].clearDeviceSpecific(t)},t})),c.d("TimelineAnimationBasicEditor","$",(function(){var $=c.$,t=null;function i(i){t=this,this.animationEditor=i,this.animationManager=i.animationManager,this.$container=$('<div class="n2_layer_window_animations_editor"></div>'),this.editorKeyFrame=new c.TimelineAnimationBasicEditorKeyFrame(this),this.groups={in:new c.TimelineAnimationBasicEditorGroupIn(this),loop:new c.TimelineAnimationBasicEditorGroupLoop(this),out:new c.TimelineAnimationBasicEditorGroupOut(this)},this.$heading=$('<div class="n2_layer_window_animations_editor__title"></div>').appendTo(this.$container),this.$headingButtonsLeft=$('<div class="n2_layer_window_animations_editor__title_left"></div>').appendTo(this.$heading),this.$buttonPlay=$('<div class="n2_layer_window_animations_editor__button_play"><i class="ssi_16 ssi_16--play"></i></div>').on("click",function(){this.toggleTimeline()}.bind(this)).appendTo(this.$headingButtonsLeft),$('<div class="n2_layer_window_animations_editor__label">'+n2_("Layer Animation - Basic")+"</div>").appendTo(this.$heading),this.$headingButtonsRight=$('<div class="n2_layer_window_animations_editor__title_right"></div>').appendTo(this.$heading),this.$buttonSettings=$('<div class="n2_layer_window_animations_editor__button_settings"><i class="ssi_16 ssi_16--cog"></i></div>').on("click",function(e){e.preventDefault();var t=!this.$container.hasClass("n2_layer_window_animations_editor--settings");this.$container.toggleClass("n2_layer_window_animations_editor--settings",t),this.$buttonSettings.toggleClass("n2_layer_window_animations_editor__button_settings--active",t)}.bind(this)).appendTo(this.$headingButtonsRight),$('<div class="n2_layer_window_animations_editor__button_delete"><i class="ssi_16 ssi_16--delete"></i></div>').on("click",function(e){e.preventDefault(),this.activatedGroupEditor.activatedAnimationGroup.remove()}.bind(this)).appendTo(this.$headingButtonsRight),this.$keyFramesContainer=$('<div class="n2_layer_window_animations_editor_basic"></div>').appendTo(this.$container),new c.UISortable(this.$keyFramesContainer,{axis:"y",helper:"clone_hide",forcePlaceholderSize:!0,items:".n2_layer_window_animations_editor_basic__keyframe",handle:".n2_layer_window_animations_editor_basic__keyframe_label",beforestart:function(e,t){this.$keyFramesContainer.css("height",this.$keyFramesContainer.height()+"px"),t.currentItem.hasClass("n2_layer_window_animations_editor_basic__keyframe--active")&&this.$keyFramesContainer.addClass("n2_layer_window_animations_editor_basic__keyframe--sort")}.bind(this),start:function(e,t){t.item.data("index",t.item.index())}.bind(this),stop:function(e,t){var i=t.item.data("index"),s=t.item.index();i!==s&&this.activatedGroupEditor.moveKeyFrame(i,s),this.$keyFramesContainer.css("height",""),this.$keyFramesContainer.removeClass("n2_layer_window_animations_editor_basic__keyframe--sort")}.bind(this)}),$('<div class="n2_layer_window_animations_editor_basic__button_add_keyframe">'+n2_("Add keyframe")+"</div>").on("click",function(e){this.activatedGroupEditor.createKeyFrame()}.bind(this)).appendTo($('<div class="n2_layer_window_animations_editor_basic__add_keyframe"></div>').appendTo(this.$container)),this.fragmentEditor=this.animationManager.fragmentEditor,this.editorSlide=this.fragmentEditor.editor,V(this.editorSlide.getFrontendElement()[0],"SliderDeviceOrientation",this.onChangeDeviceOrientation.bind(this)),this.editorKeyFrame.setDevice(this.editorSlide.getDeviceMode()),$("body").on("timelinePlay",this.previewCancel.bind(this))}return i.get=function(){return t},i.prototype.onChangeDeviceOrientation=function(){this.editorKeyFrame.setDevice(this.editorSlide.getDeviceMode())},i.prototype.activateWithGroup=function(t){this.activatedGroupEditor=this.groups[t.group],this.groups[t.group].activate(t)},i.prototype.display=function(t){this.activatedGroupEditor.display(),this.$container.appendTo(t),this.$heading.off("singlepreview").on({"mouseleave.singlepreview":this.destroyTimeline.bind(this)})},i.prototype.toggleTimeline=function(){this.timeline?this.destroyTimeline():this.preview().play()},i.prototype.close=function(){this.editorKeyFrame.close(),this.activatedGroupEditor.close(),this.$keyFramesContainer.children().detach(),this.$container.detach()},i.prototype.destroyTimeline=function(){this.timeline&&($("body").removeClass("n2-ss-animation-play-single"),this.timeline.destroy()),this.timeline=null,this.$buttonPlay.removeClass("n2_layer_window_animations_editor__button_play--active")},i.prototype.previewPreset=function(t,i){return this.preview(i,t).play(),this.destroyTimeline.bind(this)},i.prototype.preview=function(t,i){t=t||this.activatedGroupEditor.activatedAnimationGroup.getData(),i=i||this.activatedGroupEditor.group,this.destroyTimeline(),this.$buttonPlay.addClass("n2_layer_window_animations_editor__button_play--active"),$("body").addClass("n2-ss-animation-play-single");var s=this.animationManager.getActiveLayer().layer,n=s,h=n.data("animatableselector");return h&&(n=$(n[0].querySelector(h))),this.timeline=new c.TimelineAnimationBasicEditorPreview(this,s,n,i,t),this.timeline},i.prototype.previewCancel=function(){this.destroyTimeline()},i})),c.d("TimelineAnimationBasicEditorGroup","$",(function(){function t(t,i){for(var s in this.editor=t,this.editorKeyFrame=t.editorKeyFrame,this.group=i,this.fields=this.fields||{},this.fields)this.fields[s].input.on("outsideChange.n2-editor",this.changeGlobalInlineField.bind(this,s))}return t.prototype.outsideChange=function(t,i){this.fields[t]!==o&&this.fields[t].get()!==i&&this.fields[t].set(i)},t.prototype.changeGlobalInlineField=function(t,e){this.activatedAnimationGroup.setData(t,this.fields[t].get()),this.editor.preview().playOnce()},t.prototype.activate=function(t){this.activatedAnimationGroup=t,t.connectEditor(this)},t.prototype.close=function(){this.$form.detach(),this.activatedAnimationGroup.close(),delete this.activatedAnimationGroup},t.prototype.display=function(){for(var t in this.$form.insertAfter(this.editor.$heading),this.fields)this.fields[t].get()!==this.activatedAnimationGroup.data[t]&&this.fields[t].set(this.activatedAnimationGroup.data[t]);for(var i=0;i<this.activatedAnimationGroup.keyFrames.length;i++)this.addKeyFrame(this.activatedAnimationGroup.keyFrames[i]);this.activatedAnimationGroup.activateFirstKeyFrame()},t.prototype.addKeyFrame=function(t){t.getEditorElement().appendTo(this.editor.$keyFramesContainer)},t.prototype.insertKeyFrame=function(t,i){var s=i-1;s<0?t.getEditorElement().prependTo(this.editor.$keyFramesContainer):t.getEditorElement().insertAfter(this.activatedAnimationGroup.keyFrames[s].getEditorElement())},t.prototype.reAppendKeyFrames=function(){for(var t=this.activatedAnimationGroup.keyFrames.length-1;t>=0;t--)this.activatedAnimationGroup.keyFrames[t].getEditorElement().prependTo(this.editor.$keyFramesContainer)},t.prototype.activateKeyFrame=function(t){this.editorKeyFrame.activate(t)},t.prototype.createKeyFrame=function(){this.activatedAnimationGroup.addEmptyKeyFrame()},t.prototype.setKeyFrameCount=function(t){this.editor.$keyFramesContainer.toggleClass("n2_layer_window_animations_editor_basic--single-keyframe",1===t)},t.prototype.moveKeyFrame=function(t,i){this.activatedAnimationGroup.moveKeyFrame(t,i)},t})),c.d("TimelineAnimationBasicEditorKeyFrame","$",(function(){var $=c.$;function t(t){for(var i in this.editor=t,this.$form=$('.n2_fields_layer_window[data-field="fieldset-layer-window-layer-animation-basic-form"]').detach(),this.fields={duration:{input:this.$form.find("#layer-anim-duration"),set:function(t){this.field.insideChange(Math.round(1e3*t))},get:function(){return this.input.val()/1e3}},delay:{input:this.$form.find("#layer-anim-delay"),set:function(t){this.field.insideChange(Math.round(1e3*t))},get:function(){return this.input.val()/1e3}},ease:{input:this.$form.find("#layer-anim-ease"),set:function(t){this.field.insideChange(t)},get:function(){return this.input.val()}},opacity:{input:this.$form.find("#layer-anim-opacity"),set:function(t){this.field.insideChange(Math.round(100*t))},get:function(){return this.input.val()/100}},n2blur:{input:this.$form.find("#layer-anim-n2blur"),set:function(t){this.field.insideChange(t)},get:function(){return this.input.val()}},x:{isDeviceSpecific:!0,input:this.$form.find("#layer-anim-x"),set:function(t){this.field.insideChange(t)},get:function(){return this.input.val()}},y:{isDeviceSpecific:!0,input:this.$form.find("#layer-anim-y"),set:function(t){this.field.insideChange(t)},get:function(){return this.input.val()}},z:{input:this.$form.find("#layer-anim-z"),set:function(t){this.field.insideChange(t)},get:function(){return this.input.val()}},rotationX:{input:this.$form.find("#layer-anim-rotationX"),set:function(t){this.field.insideChange(t)},get:function(){return this.input.val()}},rotationY:{input:this.$form.find("#layer-anim-rotationY"),set:function(t){this.field.insideChange(t)},get:function(){return this.input.val()}},rotationZ:{input:this.$form.find("#layer-anim-rotationZ"),set:function(t){this.field.insideChange(t)},get:function(){return this.input.val()}},scaleX:{input:this.$form.find("#layer-anim-scaleX"),set:function(t){this.field.insideChange(Math.round(100*t))},get:function(){return this.input.val()/100}},scaleY:{input:this.$form.find("#layer-anim-scaleY"),set:function(t){this.field.insideChange(Math.round(100*t))},get:function(){return this.input.val()/100}},skewX:{input:this.$form.find("#layer-anim-skew"),set:function(t){this.field.insideChange(Math.round(t))},get:function(){return Math.round(this.input.val())}}},this.fields)this.fields[i].field=this.fields[i].input.data("field"),this.fields[i].input.on("outsideChange.n2-editor",this.changeInlineField.bind(this,i))}return t.prototype.setDevice=function(t){if(this.device=t,this._editedKeyFrame!==o){var i=this._editedKeyFrame;for(var s in this.fields){var n=i.get(s,!!this.fields[s].isDeviceSpecific&&this.device);this.fields[s].get()!==n&&this.fields[s].set(n)}}},t.prototype.changeInlineField=function(t,e){this._editedKeyFrame.setData(t,this.fields[t].get(),!!this.fields[t].isDeviceSpecific&&this.device),this.editor.preview().playOnce()},t.prototype.outsideChange=function(t,i,s){s!==o&&s!==this.device||this.fields[t]===o||this.fields[t].get()===i||this.fields[t].set(i)},t.prototype.activate=function(t){if(this._editedKeyFrame!==t){for(var i in this.close(),this._editedKeyFrame=t,this._editedKeyFrame.connectEditor(this),this.fields){var s=t.get(i,!!this.fields[i].isDeviceSpecific&&this.device);this.fields[i].get()!==s&&this.fields[i].set(s)}this.$form.appendTo(t.getEditorElement()),this.$form.parent().addClass("n2_layer_window_animations_editor_basic__keyframe--active")}},t.prototype.close=function(){this.$form.parent().removeClass("n2_layer_window_animations_editor_basic__keyframe--active"),this.$form.detach(),this._editedKeyFrame&&(this._editedKeyFrame.close(),delete this._editedKeyFrame)},t})),c.d("TimelineAnimationBasicEditorPreview","$",(function(){"use strict";var t={opacity:1,x:0,y:0,z:0,rotationX:0,rotationY:0,rotationZ:0,scaleX:1,scaleY:1,skewX:0,n2blur:0};function i(i,s,n,h,o){this.editor=i,this.timeline=null,this.device=this.editor.animationManager.fragmentEditor.editor.getDeviceMode(),this.isAbsolute="absolute"===s.data("pm"),this.preview=n,this.group=h,this.currentVisual=o.keyFrames,this.transformOrigin=o.transformOrigin||"50|*|50|*|0",this.specialZero=o.specialZero||0,this.isAbsolute?(this.horizontalRatio=i.animationManager.fragmentEditor.getResponsiveRatioHorizontal(),this.verticalRatio=i.animationManager.fragmentEditor.getResponsiveRatioVertical()):(this.horizontalRatio=1,this.verticalRatio=1),this.startValues=f({},t),this.createTimeline()}return i.prototype.setStartValues=function(t){f(this.startValues,t),delete this.startValues.duration,delete this.startValues.delay,delete this.startValues.ease},i.prototype.createTimeline=function(){this.timeline&&this.timeline.pause(0),this.timeline=new c.H({paused:1});var t=[];_(t,this.currentVisual);for(var i=0;i<t.length;i++)t[i]=f({duration:.8,delay:0,ease:"easeOutCubic",opacity:1,x:0,y:0,z:0,rotationX:0,rotationY:0,rotationZ:0,scaleX:1,scaleY:1,skewX:0,n2blur:0},t[i]),t[i].delay>.5&&(t[i].delay=.5);switch(this.group){case"in":this.buildTimelineIn(this.timeline,this.preview[0],t);break;case"loop":this.buildTimelineLoop(this.timeline,this.preview[0],t);break;case"out":this.buildTimelineOut(this.timeline,this.preview[0],t);break;default:console.log(this.group+" animation is not supported!")}c.MW.R(this.preview[0]).setValues(f({transformOrigin:this.transformOrigin.split("|*|").join("% ")+"px"},this.startValues)),this.timeline.totalDuration()>0&&this.timeline.set({},{},"+=1.5")},i.prototype.play=function(){this.timeline.totalDuration()>0&&(this.timeline.eventCallback("onComplete",function(){this.timeline.play(0,!1)}.bind(this)),this.timeline.play())},i.prototype.playOnce=function(){this.timeline.eventCallback("onComplete",function(){this.editor.destroyTimeline()}.bind(this)),this.timeline.play()},i.prototype.destroy=function(){this.timeline&&(this.timeline.pause(),this.repeatTimeout&&a(this.repeatTimeout),this.timeline.progress(1,!0),c.MW.R(this.preview[0]).setValues({opacity:1,x:0,y:0,z:0,rotationX:0,rotationY:0,rotationZ:0,scaleX:1,scaleY:1,skewX:0,n2blur:0})),this.timeline=null},i.prototype.adjustKeyFrameWithDevice=function(t){return"desktopPortrait"!==this.device&&t[this.device]!==o&&(t[this.device].x!==o&&(t.x=t[this.device].x),t[this.device].y!==o&&(t.y=t[this.device].y)),delete t.desktopLandscape,delete t.tabletLandscape,delete t.tabletPortrait,delete t.mobileLandscape,delete t.mobilePortrait,t},i.prototype.setCurrentZero=function(t){c.MW.R(t).setValues(f({},this.currentZero))},i.prototype.buildTimelineIn=function(i,s,n){this.currentZero=t,this.specialZero&&n.length>0&&(this.currentZero=this.adjustKeyFrameWithDevice(n.pop()),delete this.currentZero.name,this.currentZero.x=this.currentZero.x*this.horizontalRatio,this.currentZero.y=this.currentZero.y*this.verticalRatio,this.currentZero.rotationX=-this.currentZero.rotationX,this.currentZero.rotationY=-this.currentZero.rotationY,this.currentZero.rotationZ=-this.currentZero.rotationZ,this.setCurrentZero(s),this.setStartValues(this.currentZero));var h=0,o=this._buildAnimationChainIn(n,this.currentZero);if(o.length>0){for(var r=0;r<o.length;r++)i.to(c.MW.R(s),o[r].duration,o[r].to,h),h+=o[r].duration+o[r].to.delay;this.setStartValues(o[0].from)}},i.prototype._buildAnimationChainIn=function(t,i){for(var s=[{from:i}],n=t.length-1;n>=0;n--){var h=this.adjustKeyFrameWithDevice(t[n]),o=h.delay,r=h.duration,a=h.ease;delete h.delay,delete h.duration,delete h.ease,delete h.name;var c=s[0].from;h.x=-h.x*this.horizontalRatio,h.y=-h.y*this.verticalRatio,h.z=-h.z,h.rotationX=-h.rotationX,h.rotationY=-h.rotationY,h.rotationZ=-h.rotationZ,s.unshift({duration:r,from:h,to:f({},c,{ease:a,delay:o})})}return s.pop(),s},i.prototype.buildTimelineLoop=function(t,i,s){var n=this._buildAnimationChainLoop(s);if(n.length>0){for(var h=0;h<n.length;h++)t.to(c.MW.R(i),n[h].duration,n[h].to);this.setStartValues(n[0].from)}},i.prototype._buildAnimationChainLoop=function(i){for(var s,n=0;n<i.length;n++)i[n]=this.adjustKeyFrameWithDevice(i[n]);if(delete i[0].name,1===i.length){var h=i[0];if((s=f({},t)).duration=h.duration,s.ease=h.ease,(360==h.rotationX||360==h.rotationY||360==h.rotationZ)&&1==h.opacity&&0==h.x&&0==h.y&&0==h.z&&1==h.scaleX&&1==h.scaleY&&0==h.skewX&&0==h.n2blur)return[{duration:i[0].duration,from:f({},t),to:i[0]}];i.unshift(s)}var o=[{duration:i[n=0].duration,to:i[n]}];for(n++;n<i.length;n++){var r=(s=i[n]).duration;delete s.duration,delete s.name;var a=f({},o[o.length-1].to);delete a.delay,delete a.ease,s.x=s.x*this.horizontalRatio,s.y=s.y*this.verticalRatio,o.push({duration:r,from:a,to:s})}return o.push({duration:o[0].duration,from:f({},o[o.length-1].to),to:f({},o[0].to)}),o.shift(),o},i.prototype.buildTimelineOut=function(t,i,s){var n=0,h=this._buildAnimationChainOut(s);if(h.length>0){for(var o=0;o<h.length;o++)t.to(c.MW.R(i),h[o].duration,h[o].to,n),n+=h[o].duration+h[o].to.delay;this.setStartValues(h[0].from)}},i.prototype._buildAnimationChainOut=function(i){for(var s=[{to:t}],n=0;n<i.length;n++){var h=this.adjustKeyFrameWithDevice(i[n]),o=h.duration;delete h.duration,delete h.name;var r=f({},s[s.length-1].to);delete r.delay,delete r.ease,h.x=h.x*this.horizontalRatio,h.y=h.y*this.verticalRatio,s.push({duration:o,from:r,to:h})}return s.shift(),s},i})),c.d("TimelineAnimationBasicEditorGroupIn",["$","TimelineAnimationBasicEditorGroup"],(function(){var $=c.$;function t(t){this.$form=$('.n2_fields_layer_window[data-field="fieldset-layer-window-layer-animation-basic-form-in"]').detach(),c.FormTipManager.add(this.$form),this.fields={specialZero:{input:this.$form.find("#layerbasic-in-special-zero"),set:function(t){this.input.data("field").insideChange(parseInt(t)?1:0)},get:function(){return parseInt(this.input.val())?1:0}},transformOrigin:{input:this.$form.find("#layerbasic-in-transformorigin"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}}},c.TimelineAnimationBasicEditorGroup.call(this,t,"in")}return t.prototype=Object.create(c.TimelineAnimationBasicEditorGroup.prototype),t.prototype.constructor=t,t})),c.d("TimelineAnimationBasicEditorGroupLoop",["$","TimelineAnimationBasicEditorGroup"],(function(){var $=c.$;function t(t){this.$form=$('.n2_fields_layer_window[data-field="fieldset-layer-window-layer-animation-basic-form-loop"]').detach(),c.FormTipManager.add(this.$form),this.fields={repeatCount:{input:this.$form.find("#layerbasic-loop-repeat-count"),set:function(t){this.input.val(parseInt(t))},get:function(){return parseInt(this.input.val())}},repeatStartDelay:{input:this.$form.find("#layerbasic-loop-repeat-start-delay"),set:function(t){this.input.val(Math.round(1e3*parseFloat(t)))},get:function(){return parseInt(this.input.val())/1e3}},transformOrigin:{input:this.$form.find("#layerbasic-loop-transformorigin"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}}},c.TimelineAnimationBasicEditorGroup.call(this,t,"loop")}return t.prototype=Object.create(c.TimelineAnimationBasicEditorGroup.prototype),t.prototype.constructor=t,t})),c.d("TimelineAnimationBasicEditorGroupOut",["$","TimelineAnimationBasicEditorGroup"],(function(){var $=c.$;function t(t){this.$form=$('.n2_fields_layer_window[data-field="fieldset-layer-window-layer-animation-basic-form-out"]').detach(),c.FormTipManager.add(this.$form),this.fields={transformOrigin:{input:this.$form.find("#layerbasic-out-transformorigin"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}}},c.TimelineAnimationBasicEditorGroup.call(this,t,"out")}return t.prototype=Object.create(c.TimelineAnimationBasicEditorGroup.prototype),t.prototype.constructor=t,t})),c.d("TimelineAnimationBasicGroup",["$","TimelineAnimationGroupAbstract"],(function(){var $=c.$;function t(t,i,s,n,h){c.TimelineAnimationGroupAbstract.call(this,t,i,s,n),h=h||!1,this.keyFrames=[],this.load(),h&&c.History.get().addSimple(this,this._remove,this.historyResurrect,[this.getData(!0),f([],this.keyFrames)])}return t.prototype=Object.create(c.TimelineAnimationGroupAbstract.prototype),t.prototype.constructor=t,t.prototype.onSelfChange=function(){for(var t=0;t<this.keyFrames.length;t++)this.keyFrames[t].setSelf(this.self.keyFrames[t])},t.prototype.load=function(){if(this.data.keyFrames.length>0){this.animationType.onGroupAnimated(this);for(var t=0;t<this.data.keyFrames.length;t++)this.addKeyFrameByData(this.data.keyFrames[t])}delete this.data.keyFrames,this.animationType.controller.onUpdate()},t.prototype.addEmptyKeyFrame=function(){var t=this._addEmptyKeyFrame();c.History.get().addSimple(this,this._removeHistoricalKeyFrame,this._addHistoricalKeyFrame,[t]),t.activate()},t.prototype._addEmptyKeyFrame=function(){var t=this.addKeyFrameByData({});return this.editorGroup&&this.editorGroup.addKeyFrame(t),t},t.prototype._removeHistoricalKeyFrame=function(t){(t=t.getSelf())._remove(this.keyFrames.length-1)},t.prototype._addHistoricalKeyFrame=function(t){var i=this._addEmptyKeyFrame();t.setSelf(i)},t.prototype.addKeyFrameByData=function(t){var i=new c.BasicTimelineKeyFrame(this,t,this.group),s=i.getBar();return this.$holder.append(s),this.keyFrames.push(i),this.onUpdateKeyFrame(),i},t.prototype.insertAnimation=function(t,i){var s=new c.BasicTimelineKeyFrame(this,t,this.group),n=s.getBar(),h=i-1;return h<0?this.$holder.prepend(n):n.insertAfter(this.keyFrames[h].getBar()),this.editorGroup&&this.editorGroup.insertKeyFrame(s,i),this.keyFrames.splice(i,0,s),this.onUpdateKeyFrame(),s},t.prototype.remove=function(){c.History.get().addSimple(this,this.historyResurrect,this._remove,[this.getData(!0),f([],this.keyFrames)]),this._remove()},t.prototype._remove=function(){this.clear(),this.data=f({},this.defaults),this.animationType.onGroupNotAnimated(this)},t.prototype.historyResurrect=function(t,i){this.data=_({},this.defaults,t),this.load();for(var s=0;s<this.keyFrames.length;s++)i[s].setSelf(this.keyFrames[s])},t.prototype.clear=function(){for(var t=0;t<this.keyFrames.length;t++)this.keyFrames[t].whenDeleted();this.keyFrames=[]},t.prototype.replace=function(t){this.remove(),this._replace(t),c.History.get().addSimple(this,this._remove,this.historyResurrect,[this.getData(!0),f([],this.keyFrames)])},t.prototype._replace=function(t){for(var i in this.data=_({},this.data,t),this.data)this.defaults[i]===o&&delete this.data[i];this.load()},t.prototype.getEditor=function(){var t=c.TimelineAnimationBasicEditor.get();return t.activateWithGroup(this),t},t.prototype.hasAnimation=function(){return!!this.keyFrames.length},t.prototype.getData=function(t){var i=_({},this.data);i.keyFrames=[];for(var s=0;s<this.keyFrames.length;s++)i.keyFrames.push(this.keyFrames[s].getData(t));return t?c._deepDiff.map(i,this.defaults):i},t.prototype.edit=function(e,t){this.animationType.layer.activate(e),$('.n2_ss_layer_window .n2_ss_layer_window__tab_button[data-related-tab="animations"]').trigger("click"),$('.n2_ss_layer_window .n2_container_animation__button[data-related-tab="'+this.group+'"]').triggerHandler("click"),t?this.activateKeyFrame(t):this.activateFirstKeyFrame()},t.prototype.connectEditor=function(t){this.editorGroup=t,this.editorGroup.setKeyFrameCount(this.keyFrames.length)},t.prototype.close=function(){delete this.editorGroup},t.prototype.activateKeyFrame=function(t){this.editorGroup.activateKeyFrame(t)},t.prototype.activateFirstKeyFrame=function(){this.activateKeyFrame(this.keyFrames[0])},t.prototype.removeKeyFrameByIndex=function(t){t>=0&&(this.keyFrames.splice(t,1),this.onUpdateKeyFrame())},t.prototype.getKeyFrameIndex=function(t){return this.keyFrames.indexOf(t)},t.prototype.onUpdateKeyFrame=function(){this.editorGroup&&this.editorGroup.setKeyFrameCount(this.keyFrames.length),this.animationType.fixTimelineTotalDuration()},t.prototype.moveKeyFrame=function(t,i){this._moveKeyFrame(t,i);var s=c.History.get().addValue(this,this.historyMoveKeyFrame,[]);s&&s.setValues({oldIndex:i,newIndex:t},{oldIndex:t,newIndex:i})},t.prototype.historyMoveKeyFrame=function(t){this._moveKeyFrame(t.oldIndex,t.newIndex)},t.prototype._moveKeyFrame=function(t,i){var s=this.keyFrames[t];this.keyFrames.splice(t,1),this.keyFrames.splice(i,0,s),this.editorGroup&&this.editorGroup.reAppendKeyFrames();for(var n=0;n<this.keyFrames.length;n++)this.keyFrames[n].needBar&&this.$holder.append(this.keyFrames[n].getBar())},t.prototype.clearDeviceSpecific=function(t){for(var i=0;i<this.keyFrames.length;i++)this.keyFrames[i].clearDeviceSpecific(t)},t})),c.d("TimelineAnimationBasicGroupIn",["$","TimelineAnimationBasicGroup"],(function(){"use strict";function t(t,i,s){c.TimelineAnimationBasicGroup.prototype.constructor.call(this,t,"in",{specialZero:0,transformOrigin:"50|*|50|*|0",keyFrames:[]},i,s),this.specialZeroInChanged()}return t.prototype=Object.create(c.TimelineAnimationBasicGroup.prototype),t.prototype.constructor=t,t.prototype.specialZeroInChanged=function(){this.specialZeroKeyFrame!==o&&(this.specialZeroKeyFrame.setSpecialZero(!1),delete this.specialZeroKeyFrame),this.isLayerSpecialZero()&&(this.specialZeroKeyFrame=this.keyFrames[this.keyFrames.length-1],this.specialZeroKeyFrame.setSpecialZero(!0)),this.animationType.fixTimelineTotalDuration()},t.prototype.isLayerSpecialZero=function(){return this.data.specialZero},t.prototype.onChange_specialZero=function(t){this.specialZeroInChanged()},t.prototype._addEmptyKeyFrame=function(){var t=c.TimelineAnimationBasicGroup.prototype._addEmptyKeyFrame.apply(this,arguments);return this.specialZeroInChanged(),t},t.prototype._moveKeyFrame=function(){c.TimelineAnimationBasicGroup.prototype._moveKeyFrame.apply(this,arguments),this.specialZeroInChanged()},t})),c.d("TimelineAnimationBasicGroupLoop",["$","TimelineAnimationBasicGroup"],(function(){"use strict";function t(t,i,s){this.dummyAnimation=null,c.TimelineAnimationBasicGroup.prototype.constructor.call(this,t,"loop",{repeatCount:0,repeatStartDelay:0,transformOrigin:"50|*|50|*|0",keyFrames:[]},i,s)}return t.prototype=Object.create(c.TimelineAnimationBasicGroup.prototype),t.prototype.constructor=t,t.prototype.addKeyFrameByData=function(t){var i=new c.BasicTimelineKeyFrameLoop(this,t,this.group);return this.keyFrames.push(i),this.onUpdateKeyFrame(),i},t.prototype.insertAnimation=function(t,i){var s=new c.BasicTimelineKeyFrameLoop(this,t,this.group);return this.keyFrames.splice(i,0,s),this.onUpdateKeyFrame(),s},t.prototype._remove=function(){this.dummyAnimation&&this.dummyAnimation.whenDeleted(),c.TimelineAnimationBasicGroup.prototype._remove.apply(this,arguments)},t.prototype.historyResurrect=function(){c.TimelineAnimationBasicGroup.prototype.historyResurrect.apply(this,arguments),this.refreshBar()},t.prototype.refreshBar=function(){if(this.keyFrames.length>0){null===this.dummyAnimation&&(this.dummyAnimation=new c.BasicTimelineAnimationLoopDummy(this));var t=this.dummyAnimation.getBar();this.$holder.append(t),this.dummyAnimation.refresh()}},t.prototype.onChange_repeatStartDelay=function(t){this.dummyAnimation.setRepeatStartDelay(t)},t.prototype.onChange_repeatCount=function(){this.dummyAnimation.refresh()},t.prototype.onUpdateKeyFrame=function(){this.refreshBar(),c.TimelineAnimationBasicGroup.prototype.onUpdateKeyFrame.call(this)},t})),c.d("BasicTimelineAnimationLoopDummy",["$","TimelineAnimationAbstract"],(function(){"use strict";function t(t){this.basicGroup=t,c.TimelineAnimationAbstract.prototype.constructor.call(this,{duration:0,delay:0},"loop")}return t.prototype=Object.create(c.TimelineAnimationAbstract.prototype),t.prototype.constructor=t,t.prototype.setDelay=function(t){this.basicGroup.setData("repeatStartDelay",t)},t.prototype.getDelay=function(){return this.basicGroup.data.repeatStartDelay},t.prototype.refresh=function(){var t=this.basicGroup.data,i=this.basicGroup.keyFrames.length;if(0!==i){var s=0,n=0;if(1===i){var h=this.basicGroup.keyFrames[0].getData();n=360!=h.rotationX&&360!=h.rotationY&&360!=h.rotationZ||1!=h.opacity||0!=h.x||0!=h.y||0!=h.z||1!=h.scaleX||1!=h.scaleY||0!=h.skewX||0!=h.n2blur?2*(h.duration+h.delay):h.duration+h.delay}else{s=this.basicGroup.keyFrames[i-1].getData().duration;for(var o=0;o<i;o++){var r=this.basicGroup.keyFrames[o].getData();n+=r.duration+r.delay}}0!==t.repeatCount&&(n*=t.repeatCount),this.data.duration=n+s,this.data.delay=t.repeatStartDelay,this.animationChanged()}else this.bar.bar.detach()},t.prototype.renderDuration=function(t){var i;i=0===this.basicGroup.data.repeatCount?n2_("Loop"):Math.round(t*this.layerNavigationTimeline.oneSecMs),this.duration.html(i)},t.prototype.getBarOptions=function(){var t=c.TimelineAnimationAbstract.prototype.getBarOptions.call(this);return t.resizable=!1,delete t.resizableStop,t.label=function(t){return 0===this.basicGroup.data.repeatCount?n2_("Loop"):Math.round(t*this.layerNavigationTimeline.oneSecMs)}.bind(this),t},t.prototype.whenDeleted=function(){this.bar.detach()},t.prototype.setRepeatStartDelay=function(t){this.data.delay=t,this.animationChanged()},t.prototype.fixTimelineTotalDuration=function(){this.basicGroup.animationType.fixTimelineTotalDuration()},t.prototype.click=function(e){e.stopPropagation(),this.basicGroup.edit(e)},t})),c.d("TimelineAnimationBasicGroupOut",["$","TimelineAnimationBasicGroup"],(function(){"use strict";function t(t,i,s){c.TimelineAnimationBasicGroup.prototype.constructor.call(this,t,"out",{transformOrigin:"50|*|50|*|0",keyFrames:[]},i,s)}return t.prototype=Object.create(c.TimelineAnimationBasicGroup.prototype),t.prototype.constructor=t,t})),c.d("BasicTimelineKeyFrame",["$","TimelineAnimationAbstract"],(function(){var $=c.$;function t(t,i,s){this.basicGroup=t,this.group=s,this.$editorElement=!1,this.isSpecialZero=!1,c.TimelineAnimationAbstract.prototype.constructor.call(this,_({},c.BasicTimelineKeyFrame.defaults,i),s)}return t.prototype=Object.create(c.TimelineAnimationAbstract.prototype),t.prototype.constructor=t,t.defaults={duration:.8,delay:0,ease:"easeOutCubic",opacity:1,x:0,y:0,z:0,rotationX:0,rotationY:0,rotationZ:0,scaleX:1,scaleY:1,skewX:0,n2blur:0,desktopLandscape:{},tabletLandscape:{},tabletPortrait:{},mobileLandscape:{},mobilePortrait:{}},t.prototype.setData=function(t,i,s){var n=this.data;if(s&&"desktopPortrait"!==s&&(n=this.data[s]),n[t]!==i){var h=c.History.get().addValue(this,this.historySetData,[t,s]);h&&h.setValues(n[t],i),this._setData(n,t,i,s)}},t.prototype.historySetData=function(t,i,s){var n=this.data;s&&"desktopPortrait"!==s&&(n=this.data[s]),this._setData(n,i,t,s)},t.prototype._setData=function(t,i,s,n){t[i]=s,this.animationChanged(),this.editorKeyFrame&&this.editorKeyFrame.outsideChange(i,s,n),this.$editorElement&&this.updateKeyFrameLabel()},t.prototype.get=function(t,i){return i&&"desktopPortrait"!==i&&this.data[i][t]!==o?this.data[i][t]:this.data[t]},t.prototype.clearDeviceSpecific=function(t){this.setData("x",o,t),this.setData("y",o,t)},t.prototype.getOptimizedData=function(){return c._deepDiff.map(_({},this.data),c.BasicTimelineKeyFrame.defaults)},t.prototype.getData=function(t){return t?c._deepDiff.map(_({},this.data),c.BasicTimelineKeyFrame.defaults):_({},this.data)},t.prototype.connectEditor=function(t){this.editorKeyFrame=t},t.prototype.close=function(){this.editorKeyFrame&&delete this.editorKeyFrame},t.prototype.getEditorElement=function(){if(!1===this.$editorElement){this.$editorElement=$('<div class="n2_layer_window_animations_editor_basic__keyframe"></div>');var t=$('<div class="n2_layer_window_animations_editor_basic__keyframe_title"></div>').on("click",this.activate.bind(this)).appendTo(this.$editorElement);this.$keyFrameLabel=$('<div class="n2_layer_window_animations_editor_basic__keyframe_label"></div>').appendTo(t),this.updateKeyFrameLabel(),$('<div class="n2_layer_window_animations_editor_basic__keyframe_delete"><i class="ssi_16 ssi_16--delete"></i></div>').on("click",function(e){e.preventDefault(),e.stopPropagation(),this.remove()}.bind(this)).appendTo(t)}return this.$editorElement},t.prototype.updateKeyFrameLabel=function(){var t=this.getOptimizedData(),i=[];for(var s in delete t.duration,delete t.delay,delete t.ease,t)switch(typeof t[s]){case"string":case"number":i.push(s+": "+t[s])}this.$keyFrameLabel.text((this.isSpecialZero?n2_("Special Zero")+" - ":"")+(i.length?i.join(" | "):n2_("Keyframe")))},t.prototype.whenDeleted=function(){this.editorKeyFrame&&(this.editorKeyFrame.close(),delete this.editorKeyFrame),!1!==this.$editorElement&&this.$editorElement.remove(),c.TimelineAnimationAbstract.prototype.whenDeleted.call(this)},t.prototype.activate=function(){this.basicGroup.activateKeyFrame(this)},t.prototype.click=function(e){c.WindowManager.actionPrevent("ComponentRowActivate"),this.basicGroup.edit(e,this)},t.prototype.fixTimelineTotalDuration=function(){this.basicGroup.animationType.fixTimelineTotalDuration()},t.prototype.remove=function(){if(this.basicGroup.keyFrames.length>1){var t=this.basicGroup.getKeyFrameIndex(this);this._remove(t),-1!==t&&c.History.get().addSimple(this,this.historyResurrect,this._remove,[t,this.getData(!0)])}},t.prototype._remove=function(t){var i=!!this.editorKeyFrame;this.whenDeleted(),-1!==t&&this.basicGroup.removeKeyFrameByIndex(t),i&&this.basicGroup.activateFirstKeyFrame()},t.prototype.historyResurrect=function(t,i){var s=this.basicGroup.insertAnimation(i,t);this.setSelf(s)},t.prototype.setSpecialZero=function(t){this.isSpecialZero=t,t?this.getBar().css("display","none"):this.getBar().css("display",""),this.$editorElement&&this.updateKeyFrameLabel()},t})),c.d("BasicTimelineKeyFrameLoop",["$","BasicTimelineKeyFrame"],(function(){"use strict";function t(t,i,s){this.needBar=!1,c.BasicTimelineKeyFrame.prototype.constructor.apply(this,arguments)}return t.prototype=Object.create(c.BasicTimelineKeyFrame.prototype),t.prototype.constructor=t,t.prototype.animationChanged=function(){this.basicGroup.dummyAnimation.refresh()},t})),c.d("TimelineAnimationReveal",["$","TimelineAnimationTypeAbstract"],(function(){"use strict";function t(){this.groups={in:!1,out:!1},c.TimelineAnimationTypeAbstract.apply(this,arguments)}return t.prototype=Object.create(c.TimelineAnimationTypeAbstract.prototype),t.prototype.constructor=t,t.prototype.replaceGroupDataWithPreset=function(t,i){this.replaceGroupData(t,i.data)},t.prototype.createGroup=function(t,i,s){return!1!==i&&new c.TimelineAnimationRevealGroup(this,t,i,s)},t})),c.d("TimelineAnimationRevealGroup",["$","TimelineAnimationGroupAbstract","TimelineAnimationAbstract"],(function(){var $=c.$;function t(t,i,s,n){c.TimelineAnimationGroupAbstract.call(this,t,i,{from:"top",fromease:"easeOutCubic",to:"bottom",toease:"easeOutCubic",content:"",duration:2,delay:0,color:"ffffff"},s),n=n||!1,c.TimelineAnimationAbstract.prototype.constructor.call(this,this.data,i),this.load(),n&&c.History.get().addSimple(this,this._remove,this.historyResurrect,[this.getData(!0)])}for(var i in t.prototype=Object.create(c.TimelineAnimationGroupAbstract.prototype),t.prototype.constructor=t,c.TimelineAnimationAbstract.prototype)t.prototype[i]=c.TimelineAnimationAbstract.prototype[i];return t.prototype.setHolder=function(t){this.$holder=t,t.append(this.getBar())},t.prototype.getEditor=function(){var t=c.TimelineAnimationRevealEditor.get();return t.activateWithGroup(this),t},t.prototype.load=function(){this.animationChanged(),this.animationType.onGroupAnimated(this),this.animationType.controller.onUpdate()},t.prototype.remove=function(){c.History.get().addSimple(this,this.historyResurrect,this._remove,[this.getData(!0)]),this._remove()},t.prototype._remove=function(){this.data=f({},this.defaults),this.whenDeleted(),this.animationType.onGroupNotAnimated(this)},t.prototype.historyResurrect=function(t){this.data=_({},this.defaults,t),this.load()},t.prototype.replace=function(t){this.remove(),!1!==t&&(this._replace(t),c.History.get().addSimple(this,this._remove,this.historyResurrect,[this.getData(!0)]))},t.prototype._replace=function(t){for(var i in this.data=_({},this.data,t),this.data)this.defaults[i]===o&&delete this.data[i];this.load()},t.prototype.onChange_duration=function(){this.animationChanged()},t.prototype.onChange_delay=function(){this.animationChanged()},t.prototype.connectEditor=function(t){this.editorGroup=t},t.prototype.click=function(e){e.stopPropagation(),this.edit(e)},t.prototype.edit=function(e){this.animationType.layer.activate(e),$('.n2_ss_layer_window .n2_ss_layer_window__tab_button[data-related-tab="animations"]').trigger("click"),$('.n2_ss_layer_window .n2_container_animation__button[data-related-tab="'+this.group+'"]').triggerHandler("click")},t.prototype.whenDeleted=function(){this.bar.detach()},t.prototype.getData=function(t){return _({},this.data)},t})),c.d("TimelineAnimationRevealEditor","$",(function(){var $=c.$,t=null;function i(i){for(var s in t=this,this.animationEditor=i,this.animationManager=i.animationManager,this.$container=$('<div class="n2_layer_window_animations_editor"></div>'),this.$heading=$('<div class="n2_layer_window_animations_editor__title"></div>').on({"mouseleave.singlepreview":this.destroyTimeline.bind(this)}).appendTo(this.$container),this.$headingButtonsLeft=$('<div class="n2_layer_window_animations_editor__title_left"></div>').appendTo(this.$heading),this.$buttonPlay=$('<div class="n2_layer_window_animations_editor__button_play"><i class="ssi_16 ssi_16--play"></i></div>').on("click",function(e){this.toggleTimeline()}.bind(this)).appendTo(this.$headingButtonsLeft),$('<div class="n2_layer_window_animations_editor__label">'+n2_("Layer Animation - Reveal")+"</div>").appendTo(this.$heading),this.$headingButtonsRight=$('<div class="n2_layer_window_animations_editor__title_right"></div>').appendTo(this.$heading),$('<div class="n2_layer_window_animations_editor__button_delete"><i class="ssi_16 ssi_16--delete"></i></div>').on("click",function(e){this.activatedAnimationGroup.remove()}.bind(this)).appendTo(this.$headingButtonsRight),this.$form=$('.n2_fields_layer_window[data-field="fieldset-layer-window-layer-animation-reveal-form"]').appendTo(this.$container),this.fields={from:{input:this.$form.find("#layer-reveal-from"),$select:this.$form.find("#layer-reveal-from_select"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}},fromease:{input:this.$form.find("#layer-reveal-from-ease"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}},to:{input:this.$form.find("#layer-reveal-to"),$select:this.$form.find("#layer-reveal-to_select"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}},toease:{input:this.$form.find("#layer-reveal-to-ease"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}},content:{input:this.$form.find("#layer-reveal-content"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}},duration:{input:this.$form.find("#layer-reveal-duration"),set:function(t){this.input.val(parseInt(1e3*t))},get:function(){return this.input.val()/1e3}},delay:{input:this.$form.find("#layer-reveal-delay"),set:function(t){this.input.val(parseInt(1e3*t))},get:function(){return this.input.val()/1e3}},color:{input:this.$form.find("#layer-reveal-color"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}}},this.fields)this.fields[s].input.on("outsideChange.n2-editor",this.changeInlineField.bind(this,s));$("body").on("timelinePlay",this.previewCancel.bind(this))}return i.get=function(){return t},i.prototype.activateWithGroup=function(t){if(this.activatedAnimationGroup!==t){switch(this.close(),this.activatedAnimationGroup=t,this.activatedAnimationGroup.connectEditor(this),t.group){case"in":this.fields.from.$select.find('option[value="no"]').removeAttr("disabled");break;case"out":this.fields.from.$select.find('option[value="no"]').attr("disabled","disabled")}for(var i in this.fields)this.fields[i].get()!==t.data[i]&&this.fields[i].set(t.data[i])}},i.prototype.display=function(t){this.$container.appendTo(t)},i.prototype.close=function(){this.$container.detach()},i.prototype.changeInlineField=function(t,e){this.activatedAnimationGroup.setData(t,this.fields[t].get()),this.preview().playOnce()},i.prototype.outsideChange=function(t,i){this.fields[t]!==o&&this.fields[t].get()!==i&&this.fields[t].set(i)},i.prototype.toggleTimeline=function(){this.timeline?this.destroyTimeline():this.preview().play()},i.prototype.destroyTimeline=function(){this.timeline&&($("body").removeClass("n2-ss-animation-play-single"),this.timeline.destroy()),this.timeline=null,this.$buttonPlay.removeClass("n2_layer_window_animations_editor__button_play--active")},i.prototype.previewPreset=function(t,i){return this.preview(i,t).play(),this.destroyTimeline.bind(this)},i.prototype.preview=function(t,i){return t=t&&t.data?t.data:this.activatedAnimationGroup.getData(),i=i||this.activatedAnimationGroup.group,this.destroyTimeline(),this.$buttonPlay.addClass("n2_layer_window_animations_editor__button_play--active"),$("body").addClass("n2-ss-animation-play-single"),this.timeline=new c.TimelineAnimationRevealPreview(this,this.animationManager.getActiveLayer().layer,i,t),this.timeline},i.prototype.previewCancel=function(){this.destroyTimeline()},i})),c.d("TimelineAnimationRevealPreview","$",(function(){"use strict";var t={from:"top",fromease:"easeOutCubic",to:"bottom",toease:"easeOutCubic",content:"",duration:2,delay:0,color:"ffffff"};function i(t,i,s,n){this.editor=t,this.group=s,this.animatableElement=i[0];var h=x(i[0],"animatableselector");switch(h&&(this.animatableElement=i[0].querySelector(h)),this.revealedElement=this.animatableElement.querySelector(".n2-ss-layer-content,.n2-ss-layer-row,.n2-ss-item,.n2-ss-item-content"),this.revealedElementSMW=c.MW.R(this.revealedElement),this.timeline=new c.H({paused:!0}),this[s]=this._initGroup(s,n),s){case"in":this.extendTimelineIn(this.timeline);break;case"out":this.extendTimelineOut(this.timeline)}this.timeline.totalDuration()>0&&this.timeline.set({},{},"+=1.5")}return i.prototype.play=function(){this.timeline.totalDuration()>0&&(this.timeline.eventCallback("onComplete",function(){this.timeline.play(0,!1)}.bind(this)),this.timeline.play())},i.prototype.playOnce=function(){this.timeline.eventCallback("onComplete",function(){this.editor.destroyTimeline()}.bind(this)),this.timeline.play()},i.prototype.destroy=function(){this.timeline.pause(),this.repeatTimeout&&a(this.repeatTimeout),this.timeline.progress(1,!0),P(this[this.group].clip.remove()),c.MW.Y(this.revealedElementSMW,["transform","opacity","n2AutoAlpha"])},i.prototype._initGroup=function(i,s){var n=d();n.className="n2-ss-reveal-clip";var h={revealedElement:this.revealedElement,revealedElementSMW:this.revealedElementSMW,options:f({},t,s),clip:n,clipSMW:c.MW.R(n)};return h.revealedElementSMW.n2AutoAlpha=1,this.animatableElement.appendChild(n),h},i.prototype.extendTimelineIn=function(t){c.FrontendLayerAnimationsRevealAnimation.in(t,this.in)},i.prototype.extendTimelineOut=function(t){c.FrontendLayerAnimationsRevealAnimation.out(t,this.out)},i})),c.d("SmartSliderAdminWidgetArrowImage",["$"],(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){if("sliderwidget-arrow-style"===t){var n,h=d(),o=d(),r=u("img"),a="sliderwidget-arrow-previous",l=s.getElementById(a+"-image");return l&&l.value?n=l.value:+s.getElementById("sliderwidget-arrow-mirror").value||(a="sliderwidget-arrow-next",(l=s.getElementById(a+"-image"))&&(n=l.value)),M(o,"display","inline-block"),o.className=i.styleClassName,h.appendChild(o),M(r,"display","block"),o.appendChild(r),n?p(r,"src",c._imageHelper.fixed(n)):$("#"+a).data("field").getCurrentImage(s.getElementById(a+"-color").value).done((function(t){p(r,"src",t)})),h}},t})),c.d("SmartSliderAdminWidgetAutoplayImage",["$"],(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){if("sliderwidget-autoplay-style"===t){var s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName),n=$('<img style="display: block;">').appendTo(s),h=$("#sliderwidget-autoplay-play-image").val();return h?n.attr("src",c._imageHelper.fixed(h)):$("#sliderwidget-autoplay-play").data("field").getCurrentImage($("#sliderwidget-autoplay-play-color").val()).done((function(t){n.attr("src",t)})),s}},t})),c.d("SmartSliderAdminWidgetBarHorizontal",["$"],(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){if("sliderwidget-bar-style"===t){var s=$("#sliderwidget-bar-separator").val(),n=$("<div></div>").css({width:"100%",boxSizing:"border-box"}).addClass(i.styleClassName);return $("<span>Slide title</span>").addClass(i.fontClassName).attr("href","#").appendTo(n),$("<span>"+s+"Slide description which is longer than the title</span>").addClass(i.fontClassName2).appendTo(n),n}},t.renderFont=function(t,i){var s;return"sliderwidget-bar-font-title"===t?(s=$("<div></div>").css({width:"100%",boxSizing:"border-box"}).addClass(i.styleClassName),$("<span>Slide title</span>").addClass(i.fontClassName).attr("href","#").appendTo(s),s):"sliderwidget-bar-font-description"===t?(s=$("<div></div>").css({width:"100%",boxSizing:"border-box"}).addClass(i.styleClassName),$("<span>Slide description which is longer than the title</span>").addClass(i.fontClassName).attr("href","#").appendTo(s),s):void 0},t})),c.d("SmartSliderAdminWidgetBulletTransition",["$"],(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){var s;return"sliderwidget-bullet-style"===t?(s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName2),$("<div></div>").css({display:"inline-block","vertical-align":"top"}).addClass(i.styleClassName).appendTo(s),$("<div></div>").css({display:"inline-block","vertical-align":"top"}).addClass(i.styleClassName+" n2-active").appendTo(s),$("<div></div>").css({display:"inline-block","vertical-align":"top"}).addClass(i.styleClassName).appendTo(s)):"sliderwidget-bullet-bar"===t&&(s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName),$("<div></div>").css({display:"inline-block","vertical-align":"top"}).addClass(i.styleClassName2).appendTo(s),$("<div></div>").css({display:"inline-block","vertical-align":"top"}).addClass(i.styleClassName2+" n2-active").appendTo(s),$("<div></div>").css({display:"inline-block","vertical-align":"top"}).addClass(i.styleClassName2).appendTo(s)),s},t})),c.d("SmartSliderAdminWidgetBulletThumbnail",["$"],(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){if("sliderwidget-bullet-thumbnail-style"===t){var s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName);return $("<div></div>").css({width:$("#sliderwidget-bullet-thumbnail-width").val()+"px",height:$("#sliderwidget-bullet-thumbnail-height").val()+"px",overflow:"hidden",background:'url("'+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/image.png")+'")',"background-size":"cover"}).appendTo(s),s}},t})),c.d("SmartSliderAdminWidgetThumbnailBasic",["$"],(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){var s,n,h=$("#sliderwidget-thumbnail-width").val(),o=$("#sliderwidget-thumbnail-height").val();return"sliderwidget-thumbnail-style-bar"===t?(s=$("<div></div>").css({overflow:"hidden",width:2.5*h+"px"}).addClass(i.styleClassName),n=$("<div></div>").css("width","200%").appendTo(s),$("<div></div>").css({display:"inline-block",verticalAlign:"top",width:h+"px",height:o+"px",backgroundImage:'url("'+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/image.png")+'")'}).addClass(i.styleClassName2).appendTo(n),$("<div></div>").css({display:"inline-block",verticalAlign:"top",width:h+"px",height:o+"px",backgroundImage:'url("'+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/video.png")+'")'}).addClass(i.styleClassName2+" n2-active").appendTo(n),$("<div></div>").css({display:"inline-block",verticalAlign:"top",width:h+"px",height:o+"px",backgroundImage:'url("'+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/image.png")+'")'}).addClass(i.styleClassName2).appendTo(n),s):"sliderwidget-thumbnail-style-slides"===t?(s=$("<div></div>").css({overflow:"hidden",width:"480px"}).addClass(i.styleClassName2),n=$("<div></div>").css("width","200%").appendTo(s),$("<div></div>").css({display:"inline-block",verticalAlign:"top",width:h+"px",height:o+"px",backgroundImage:'url("'+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/image.png")+'")'}).addClass(i.styleClassName).appendTo(n),$("<div></div>").css({display:"inline-block",verticalAlign:"top",width:h+"px",height:o+"px",backgroundImage:'url("'+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/video.png")+'")'}).addClass(i.styleClassName+" n2-active").appendTo(n),$("<div></div>").css({display:"inline-block",verticalAlign:"top",width:h+"px",height:o+"px",backgroundImage:'url("'+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/image.png")+'")'}).addClass(i.styleClassName).appendTo(n),s):"sliderwidget-thumbnail-title-style"===t?$("<span>Slide title</span>").addClass(i.styleClassName+" "+i.fontClassName):void 0},t.renderFont=function(t,i){return"sliderwidget-thumbnail-title-font"===t?$("<span>Slide title</span>").addClass(i.styleClassName+" "+i.fontClassName):"sliderwidget-thumbnail-description-font"===t?$("<span>Slide description with long long text...</span>").addClass(i.styleClassName+" "+i.fontClassName):void 0},t})),c.d("SmartSliderAdminWidgetArrowImage",["$"],(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){if("sliderwidget-arrow-style"===t){var n,h=d(),o=d(),r=u("img"),a="sliderwidget-arrow-previous",l=s.getElementById(a+"-image");return l&&l.value?n=l.value:+s.getElementById("sliderwidget-arrow-mirror").value||(a="sliderwidget-arrow-next",(l=s.getElementById(a+"-image"))&&(n=l.value)),M(o,"display","inline-block"),o.className=i.styleClassName,h.appendChild(o),M(r,"display","block"),o.appendChild(r),n?p(r,"src",c._imageHelper.fixed(n)):$("#"+a).data("field").getCurrentImage(s.getElementById(a+"-color").value).done((function(t){p(r,"src",t)})),h}},t})),c.d("SmartSliderAdminWidgetAutoplayImage",["$"],(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){if("sliderwidget-autoplay-style"===t){var s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName),n=$('<img style="display: block;">').appendTo(s),h=$("#sliderwidget-autoplay-play-image").val();return h?n.attr("src",c._imageHelper.fixed(h)):$("#sliderwidget-autoplay-play").data("field").getCurrentImage($("#sliderwidget-autoplay-play-color").val()).done((function(t){n.attr("src",t)})),s}},t})),c.d("SmartSliderAdminWidgetBarHorizontal",["$"],(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){if("sliderwidget-bar-style"===t){var s=$("#sliderwidget-bar-separator").val(),n=$("<div></div>").css({width:"100%",boxSizing:"border-box"}).addClass(i.styleClassName);return $("<span>Slide title</span>").addClass(i.fontClassName).attr("href","#").appendTo(n),$("<span>"+s+"Slide description which is longer than the title</span>").addClass(i.fontClassName2).appendTo(n),n}},t.renderFont=function(t,i){var s;return"sliderwidget-bar-font-title"===t?(s=$("<div></div>").css({width:"100%",boxSizing:"border-box"}).addClass(i.styleClassName),$("<span>Slide title</span>").addClass(i.fontClassName).attr("href","#").appendTo(s),s):"sliderwidget-bar-font-description"===t?(s=$("<div></div>").css({width:"100%",boxSizing:"border-box"}).addClass(i.styleClassName),$("<span>Slide description which is longer than the title</span>").addClass(i.fontClassName).attr("href","#").appendTo(s),s):void 0},t})),c.d("SmartSliderAdminWidgetBulletTransition",["$"],(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){var s;return"sliderwidget-bullet-style"===t?(s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName2),$("<div></div>").css({display:"inline-block","vertical-align":"top"}).addClass(i.styleClassName).appendTo(s),$("<div></div>").css({display:"inline-block","vertical-align":"top"}).addClass(i.styleClassName+" n2-active").appendTo(s),$("<div></div>").css({display:"inline-block","vertical-align":"top"}).addClass(i.styleClassName).appendTo(s)):"sliderwidget-bullet-bar"===t&&(s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName),$("<div></div>").css({display:"inline-block","vertical-align":"top"}).addClass(i.styleClassName2).appendTo(s),$("<div></div>").css({display:"inline-block","vertical-align":"top"}).addClass(i.styleClassName2+" n2-active").appendTo(s),$("<div></div>").css({display:"inline-block","vertical-align":"top"}).addClass(i.styleClassName2).appendTo(s)),s},t})),c.d("SmartSliderAdminWidgetBulletThumbnail",["$"],(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){if("sliderwidget-bullet-thumbnail-style"===t){var s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName);return $("<div></div>").css({width:$("#sliderwidget-bullet-thumbnail-width").val()+"px",height:$("#sliderwidget-bullet-thumbnail-height").val()+"px",overflow:"hidden",background:'url("'+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/image.png")+'")',"background-size":"cover"}).appendTo(s),s}},t})),c.d("SmartSliderAdminWidgetThumbnailBasic",["$"],(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){var s,n,h=$("#sliderwidget-thumbnail-width").val(),o=$("#sliderwidget-thumbnail-height").val();return"sliderwidget-thumbnail-style-bar"===t?(s=$("<div></div>").css({overflow:"hidden",width:2.5*h+"px"}).addClass(i.styleClassName),n=$("<div></div>").css("width","200%").appendTo(s),$("<div></div>").css({display:"inline-block",verticalAlign:"top",width:h+"px",height:o+"px",backgroundImage:'url("'+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/image.png")+'")'}).addClass(i.styleClassName2).appendTo(n),$("<div></div>").css({display:"inline-block",verticalAlign:"top",width:h+"px",height:o+"px",backgroundImage:'url("'+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/video.png")+'")'}).addClass(i.styleClassName2+" n2-active").appendTo(n),$("<div></div>").css({display:"inline-block",verticalAlign:"top",width:h+"px",height:o+"px",backgroundImage:'url("'+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/image.png")+'")'}).addClass(i.styleClassName2).appendTo(n),s):"sliderwidget-thumbnail-style-slides"===t?(s=$("<div></div>").css({overflow:"hidden",width:"480px"}).addClass(i.styleClassName2),n=$("<div></div>").css("width","200%").appendTo(s),$("<div></div>").css({display:"inline-block",verticalAlign:"top",width:h+"px",height:o+"px",backgroundImage:'url("'+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/image.png")+'")'}).addClass(i.styleClassName).appendTo(n),$("<div></div>").css({display:"inline-block",verticalAlign:"top",width:h+"px",height:o+"px",backgroundImage:'url("'+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/video.png")+'")'}).addClass(i.styleClassName+" n2-active").appendTo(n),$("<div></div>").css({display:"inline-block",verticalAlign:"top",width:h+"px",height:o+"px",backgroundImage:'url("'+c._imageHelper.fixed("$ss3-frontend$/images/placeholder/image.png")+'")'}).addClass(i.styleClassName).appendTo(n),s):"sliderwidget-thumbnail-title-style"===t?$("<span>Slide title</span>").addClass(i.styleClassName+" "+i.fontClassName):void 0},t.renderFont=function(t,i){return"sliderwidget-thumbnail-title-font"===t?$("<span>Slide title</span>").addClass(i.styleClassName+" "+i.fontClassName):"sliderwidget-thumbnail-description-font"===t?$("<span>Slide description with long long text...</span>").addClass(i.styleClassName+" "+i.fontClassName):void 0},t})),c.d("SmartSliderAdminWidgetArrowGrow","$",(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){if("sliderwidget-arrow-style"===t){var s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName),n=$('<img style="display: block;">').appendTo(s);return $("#sliderwidget-arrow-previous").data("field").getCurrentImage($("#sliderwidget-arrow-previous-color").val()).done((function(t){n.attr("src",t)})),s}},t.renderFont=function(t,i){if("sliderwidget-arrow-font"===t){var s=$("<div></div>").addClass(i.fontClassName);return $("<a>Slide title</a>").css({"line-height":"48px",display:"inline-block"}).attr("href","#").addClass(i.styleClassName).on("click",(function(){return!1})).appendTo(s),s}},t})),c.d("SmartSliderAdminWidgetArrowReveal","$",(function(){var $=c.$;function t(){}return t.renderFont=function(t,i){if("sliderwidget-arrow-title-font"===t){var s=$("<div></div>").addClass(i.fontClassName);return $("<a>"+n2_("Slide title")+"</a>").attr("href","#").on("click",(function(){return!1})).appendTo(s),s}},t})),c.d("SmartSliderAdminWidgetArrowText","$",(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){if("sliderwidget-arrow-style"===t){var s=$("#sliderwidget-arrow-previous-label").val(),n=$("<div></div>").addClass(i.fontClassName);return $("<a>"+s+"</a>").addClass(i.styleClassName).attr("href","#").on("click",(function(e){return!1})).appendTo(n),n}},t.renderFont=function(t,i){if("sliderwidget-arrow-font"===t){var s=$("#sliderwidget-arrow-previous-label").val(),n=$("<div></div>").addClass(i.fontClassName);return $("<a>"+s+"</a>").addClass(i.styleClassName).attr("href","#").on("click",(function(e){return!1})).appendTo(n),n}},t})),c.d("SmartSliderAdminWidgetBarVertical","$",(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){if("sliderwidget-bar-style"===t){var s=$("<div></div>").css("width","300px").addClass(i.styleClassName);return $("<div>Slide title</div>").addClass(i.fontClassName).appendTo(s),$("<div>Slide description which is longer than the title</div>").addClass(i.fontClassName2).appendTo(s),s}},t.renderFont=function(t,i){var s;return"sliderwidget-bar-font-title"===t?(s=$("<div></div>").css("width","300px").addClass(i.styleClassName),$("<span>Slide title</span>").addClass(i.fontClassName).appendTo(s),s):"sliderwidget-bar-font-description"===t?(s=$("<div></div>").css("width","300px").addClass(i.styleClassName),$("<span>Slide description which is longer than the title</span>").addClass(i.fontClassName).appendTo(s),s):void 0},t})),c.d("SmartSliderAdminWidgetBulletNumbers","$",(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){var s;return"sliderwidget-bullet-style"===t?(s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName2),$("<div>1</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName).appendTo(s),$("<div>2</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName+" n2-active").appendTo(s),$("<div>3</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName).appendTo(s),$("<div>4</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName).appendTo(s),s):"sliderwidget-bullet-bar"===t?(s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName),$("<div>1</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName2+" "+i.fontClassName).appendTo(s),$("<div>2</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName2+" "+i.fontClassName+" n2-active").appendTo(s),$("<div>3</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName2+" "+i.fontClassName).appendTo(s),$("<div>4</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName2+" "+i.fontClassName).appendTo(s),s):void 0},t.renderFont=function(t,i){if("sliderwidget-bullet-font"===t){var s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName2);return $("<div>1</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName).appendTo(s),$("<div>2</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName+" n2-active").appendTo(s),$("<div>3</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName).appendTo(s),$("<div>4</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName).appendTo(s),s}},t})),c.d("SmartSliderAdminWidgetBulletText","$",(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){var s;return"sliderwidget-bullet-style"===t?(s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName2),$("<div>Nextendweb</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName).appendTo(s),$("<div>Smart Slider</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName+" n2-active").appendTo(s),$("<div>Accordion Menu</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName).appendTo(s),$("<div>Features</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName).appendTo(s),s):"sliderwidget-bullet-bar"===t?(s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName),$("<div>Nextendweb</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName2+" "+i.fontClassName).appendTo(s),$("<div>Smart Slider</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName2+" "+i.fontClassName+" n2-active").appendTo(s),$("<div>Accordion Menu</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName2+" "+i.fontClassName).appendTo(s),$("<div>Features</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName2+" "+i.fontClassName).appendTo(s),s):void 0},t.renderFont=function(t,i){if("sliderwidget-bullet-font"===t){var s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName2);return $("<div>Nextendweb</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName).appendTo(s),$("<div>Smart Slider</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName+" n2-active").appendTo(s),$("<div>Accordion Menu</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName).appendTo(s),$("<div>Features</div>").css({display:"inline-block",verticalAlign:"top"}).addClass(i.styleClassName+" "+i.fontClassName).appendTo(s),s}},t})),c.d("SmartSliderAdminWidgetFullScreenImage","$",(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){if("sliderwidget-fullscreen-style"===t){var s=$("<div></div>").css("display","inline-block").addClass(i.styleClassName),n=$('<img style="display: block;">').appendTo(s),h=$("#sliderwidget-fullscreen-tonormal-image").val();return""!==h?n.attr("src",c._imageHelper.fixed(h)):$("#sliderwidget-fullscreen-tonormal").data("field").getCurrentImage($("#sliderwidget-fullscreen-tonormal-color").val()).done((function(t){n.attr("src",t)})),s}},t})),c.d("SmartSliderAdminWidgetIndicatorPie","$",(function(){var $=c.$;function t(){}return t.renderStyle=function(t,i){if("sliderwidget-indicator-style"===t){var s=parseInt($("#sliderwidget-indicator-size").val()),n=parseInt($("#sliderwidget-indicator-thickness").val()),h=$("#sliderwidget-indicator-bar").val(),o=$("<div></div>").css("display","inline-block").addClass(i.styleClassName);$('<svg><circle cx="'+(s+4)/2+'" cy="'+(s+4)/2+'" r="'+(2-n/100)*s/4+'" stroke-width="'+s/2*n/100+'" stroke="#'+h.substr(0,6)+'" stroke-opacity="'+N2Color.hex2alpha(h)+'" fill="none"></circle></svg>').css({display:"block"}).attr({height:s+4,width:s+4}).appendTo(o);return o}},t})),c.d("smartslider-backend")})(window);
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 1.59 |
proxy
|
phpinfo
|
Настройка