smartslider-backend.min.js 384 KB
N2Require("ContextMenu",[],[],function(t,e,i){function n(e,i){this.isActive=!1,this.$el=e.data("nextendcontextmenu",this),this.parameters=t.extend({selector:!1,onShow:function(){}},i),this.$menu=t('<div class="n2-context-menu"></div>').on("mousedown",function(){nextend.context.setMouseDownArea("context-menu")}).appendTo("body"),this.parameters.selector?this.$el.on("contextmenu",this.parameters.selector,t.proxy(this.onShowContextMenu,this)):this.$el.on("contextmenu",t.proxy(this.onShowContextMenu,this))}return n.prototype.onShowContextMenu=function(e){e.preventDefault(),this.clearItems(),this.parameters.onShow.call(this,e,this),this.hasItems&&(e.stopPropagation(),this.isActive=!0,this.$menu.css({left:e.pageX,top:e.pageY}),t("html").on("mouseleave.nextendcontextmenu, click.nextendcontextmenu",t.proxy(this.onHide,this))),this.$menu.toggleClass("n2-active",this.hasItems)},n.prototype.onHide=function(){t("html").off(".nextendcontextmenu"),this.$menu.removeClass("n2-active"),this.isActive=!1},n.prototype.clearItems=function(){this.isActive&&this.onHide(),this.hasItems=!1,this.$menu.html("")},n.prototype.addItem=function(e,i,n){this.hasItems=!0,this.$menu.append(t('<div><i class="n2-i '+i+'"></i><span>'+e+"</span></div>").on("click",n))},t.fn.nextendContextMenu=function(e){return this.each(function(){new n(t(this),e)})},n}),N2Require("License",["SlideAdmin"],["smartSlider"],function(t,e,i,n){function r(e,n,r,s){i.license=this,this.addLicenseModal=!1,this.hasKey=e,this.maybeActive=n,this.ajaxUrl=r,this.buyLicenseUrl=s,this.boxAddLicense=t(".n2-box-add-license"),this.boxDeAuthorize=t(".n2-box-license-activated"),window.addLicense=t.proxy(this.addLicense,this),window.checkLicense=t.proxy(this.checkLicense,this)}return r.prototype.checkLicense=function(t,e){return NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"check",cacheAccepted:t+0,verbose:e+0}),dataType:"json"})},r.prototype.addLicense=function(e){if(e=e||0,this._deferred=t.Deferred(),!this.addLicenseModal){var i=this,n=!1,r={show:function(){n=!1,this.controls.find(".n2-button-grey").on("click",t.proxy(function(t){t.preventDefault(),i._deferred.resolve(),this.hide(t)},this));var e=this.controls.find(".n2-button-green"),r=this.content.find(".n2-form").on("submit",function(t){t.preventDefault(),e.trigger("click")});r.append(this.createInput(n2_("License key"),"license-key","width: 440px;")),r.append('<span style="font-size:12px;margin: 0 10px;">'+n2_printf("%sGet your license key here%s or %sbuy a new%s!",'<a href="https://secure.nextendweb.com/?utm_source=smartslider3-pro&utm_medium=smartslider&utm_campaign=forgot-license" target="_blank">',"</a>",'<a href="'+i.buyLicenseUrl+'" target="_blank">',"</a>")+"</span>");var s=t("#license-key").val("").focus();e.on("click",t.proxy(function(e){NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(i.ajaxUrl,{nextendaction:"add"}),data:{licenseKey:s.val().replace(/\s/g,"")},dataType:"json"}).done(t.proxy(function(t){t.data.valid&&(i.boxAddLicense.addClass("n2-ss-license-has-active-key"),i.boxDeAuthorize.removeClass("n2-ss-license-no-active-key"),i.hasKey=!0,i.maybeActive=!0,n=!0,this.hide(e),i._deferred.resolve(),nextend.notificationCenter.notice(n2_("Smart Slider 3 activated!")))},this))},this))},hide:function(){n||"pending"!=i._deferred.state()||i._deferred.reject()}};this.addLicenseModal=new NextendModal({zero:{size:[500,240],title:n2_("Add license"),back:!1,close:!0,content:'<form class="n2-form"></form>',controls:['<a href="#" class="n2-button n2-button-normal n2-button-l n2-radius-s n2-button-green n2-uc n2-h4">'+n2_("Authorize")+"</a>"],fn:r},skippable:{size:[500,240],title:n2_("Add license"),back:!1,close:!0,content:'<form class="n2-form"></form>',controls:['<a href="#" class="n2-button n2-button-normal n2-button-l n2-radius-s n2-button-grey n2-uc n2-h4">'+n2_("Skip")+"</a>",'<a href="#" class="n2-button n2-button-normal n2-button-l n2-radius-s n2-button-green n2-uc n2-h4">'+n2_("Authorize")+"</a>"],fn:r}})}return e?this.addLicenseModal.show("skippable"):this.addLicenseModal.show(),this._deferred},r.prototype.isActiveAsync=function(e){var i=t.Deferred(),n=t.proxy(function(){this.addLicense(e).done(function(){i.resolve()}).fail(function(){i.reject()})},this);return this.hasKey?this.maybeActive?i.resolve():this.checkLicense(!0,!1).done(function(){i.resolve()}).fail(function(){n()}):n(),i.fail(t.proxy(function(){this.maybeActive=!1},this)),i},r}),function(t,e,i){function n(){NextendVisualManagerSetsAndMore.prototype.constructor.apply(this,arguments)}function r(){NextendVisualWithSetRow.prototype.constructor.apply(this,arguments)}n.prototype=Object.create(NextendVisualManagerSetsAndMore.prototype),n.prototype.constructor=n,n.prototype.loadDefaults=function(){NextendVisualManagerSetsAndMore.prototype.loadDefaults.apply(this,arguments),this.type="splittextanimation",this.labels={visual:"Split text animation",visuals:"Split text animations"},this.styleClassName="",this.fontClassName=""},n.prototype.initController=function(){return new NextendSplitTextAnimationEditorController},n.prototype.createVisual=function(t,e){return new r(t,e,this)},n.prototype.setConnectedStyle=function(t){this.styleClassName=e("#"+t).data("field").renderStyle()},n.prototype.setConnectedFont=function(t){this.fontClassName=e("#"+t).data("field").renderFont()},n.prototype.setVisualAsStatic=function(t){if(null!==this.transformOriginElement){var e=this.transformOriginElement.data("field");e.insideChange(this.controller.transformOrigin),e.triggerOutsideChange()}switch(t.preventDefault(),this.mode){case"static":this.setAndClose(this.getBase64(n2_("Static"))),this.hide(t);break;default:NextendVisualManagerSetsAndMore.prototype.setVisualAsStatic.call(this,t)}},n.prototype.getBase64=function(t){return Base64.encode(JSON.stringify({name:t,data:this.controller.get("set")}))},n.prototype.show=function(t,i,n){this.transformOriginElement=n.transformOrigin,NextendVisualManagerSetsAndMore.prototype.show.call(this,t,i,n),""==t&&e.when(this.activeSet._loadVisuals()).done(e.proxy(function(){for(var t in this.activeSet.visuals){this.activeSet.visuals[t].activate();break}},this))},i.NextendSplitTextAnimationManager=n,r.prototype=Object.create(NextendVisualWithSetRow.prototype),r.prototype.constructor=r,r.prototype.activate=function(t){"undefined"!=typeof t&&t.preventDefault(),this.visualManager.changeActiveVisual(this),"undefined"!=typeof this.value.transformOrigin&&this.visualManager.controller.loadTransformOrigin(this.value.transformOrigin),this.visualManager.controller.load(this.value.animation,!1,this.visualManager.showParameters)},i.NextendSplitTextAnimation=r}(nextend.smartSlider,n2,window),function($,scope){function NextendSplitTextAnimationEditorController(){this.timeline=new NextendTimeline,NextendVisualEditorControllerWithEditor.prototype.constructor.apply(this,arguments),this.preview=$("#n2-splittextanimation-editor-preview").css({fontSize:"16px",margin:"100px 30px"}),this.initBackgroundColor()}function NextendSplitTextAnimationEditor(){NextendVisualEditor.prototype.constructor.apply(this,arguments),this.fields={mode:{element:$("#n2-splittextanimation-editormode"),events:{"outsideChange.n2-editor":$.proxy(this.changeMode,this)}},sort:{element:$("#n2-splittextanimation-editorsort"),events:{"outsideChange.n2-editor":$.proxy(this.changeSort,this)}},duration:{element:$("#n2-splittextanimation-editorduration"),events:{"outsideChange.n2-editor":$.proxy(this.changeDuration,this)}},stagger:{element:$("#n2-splittextanimation-editorstagger"),events:{"outsideChange.n2-editor":$.proxy(this.changeStagger,this)}},easing:{element:$("#n2-splittextanimation-editoreasing"),events:{"outsideChange.n2-editor":$.proxy(this.changeEasing,this)}},opacity:{element:$("#n2-splittextanimation-editoropacity"),events:{"outsideChange.n2-editor":$.proxy(this.changeOpacity,this)}},offset:{element:$("#n2-splittextanimation-editoroffset"),events:{"outsideChange.n2-editor":$.proxy(this.changeOffset,this)}},rotate:{element:$("#n2-splittextanimation-editorrotate"),events:{"outsideChange.n2-editor":$.proxy(this.changeRotate,this)}},scale:{element:$("#n2-splittextanimation-editorscale"),events:{"outsideChange.n2-editor":$.proxy(this.changeScale,this)}},transformOrigin:{element:$("#n2-splittextanimation-editortransformorigin"),events:{"outsideChange.n2-editor":$.proxy(this.changeTransformOrigin,this)}}}}NextendSplitTextAnimationEditorController.prototype=Object.create(NextendVisualEditorControllerWithEditor.prototype),NextendSplitTextAnimationEditorController.prototype.constructor=NextendSplitTextAnimationEditorController,NextendSplitTextAnimationEditorController.prototype.loadDefaults=function(){NextendVisualEditorControllerWithEditor.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},NextendSplitTextAnimationEditorController.prototype.initRenderer=function(){return new NextendVisualRenderer(this)},NextendSplitTextAnimationEditorController.prototype.initEditor=function(){return new NextendSplitTextAnimationEditor},NextendSplitTextAnimationEditorController.prototype._load=function(t,e,i){this.group=i.group,NextendVisualEditorControllerWithEditor.prototype._load.call(this,$.extend(!0,{},this.getEmptyVisual(),t),e,i),this.render(i.previewHTML)},NextendSplitTextAnimationEditorController.prototype.propertyChanged=function(t,e,i){NextendVisualEditorControllerWithEditor.prototype.propertyChanged.call(this,t,e,i),this.refreshTimeline()},NextendSplitTextAnimationEditorController.prototype.get=function(t){return"saveAsNew"==t?{transformOrigin:this.transformOrigin,animation:this.currentVisual}:this.currentVisual},NextendSplitTextAnimationEditorController.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}},NextendSplitTextAnimationEditorController.prototype.initBackgroundColor=function(){new N2Classes.FormElementText("n2-splittextanimation-editor-background-color"),new N2Classes.FormElementColor("n2-splittextanimation-editor-background-color",0);var t=this.lightbox.find(".n2-editor-preview-box");$("#n2-splittextanimation-editor-background-color").on("nextendChange",function(){t.css("background","#"+$(this).val())})},NextendSplitTextAnimationEditorController.prototype.render=function(html){var fontClassName=nextend.splittextanimationManager.fontClassName,styleClassName=nextend.splittextanimationManager.styleClassName;html=html.replace(/\{([^]*?)\}/g,function(match,script){return eval(script)}),this.preview.html(html),this.visible&&this.refreshTimeline()},NextendSplitTextAnimationEditorController.prototype.refreshTimeline=function(){this.killPreview();var t=$.extend({},this.currentVisual),e=t.mode;"chars"==e&&(e+=",words"),this.mySplitText=new NextendSplitText(this.preview.find("span"),{type:e});var i=[];switch(t.mode){case"words":i=this.mySplitText.words;break;case"lines":i=this.mySplitText.lines;break;default:i=this.mySplitText.chars}delete t.mode,this.timeline=new NextendTimeline({repeat:-1});var n=t.duration,r=t.stagger;delete t.duration,delete t.stagger,NextendTween.set(i,{transformOrigin:this.transformOrigin.split("|*|").join("% ")+"px"});var s=null;switch(t.sort){case"reversed":i.reverse();break;case"random":var o=function(t,e,i,n){for(i=t.length;i;)e=Math.random()*i--|0,n=t[i],t[i]=t[e],t[e]=n};o(i);break;case"side":case"center":var a=[];for(s=[];i.length>1;)a.push(i.shift()),s.push(i.pop());1==i.length&&a.push(i.shift()),i=a,"center"==t.sort&&(i.reverse(),s.reverse());break;case"sideShifted":case"centerShifted":for(var a=[];i.length>1;)a.push(i.shift()),a.push(i.pop());1==i.length&&a.push(i.shift()),i=a,"centerShifted"==t.sort&&i.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(i,n,l,t,-r,.3),s&&s.length&&this.timeline.staggerFromTo(s,n,l,t,-r,.3)}else this.timeline.staggerFrom(i,n,t,r,.3),s&&s.length&&this.timeline.staggerFrom(s,n,t,r,.3);this.timeline.eventCallback("onComplete",$.proxy(function(){this.repeatTimeout=setTimeout($.proxy(function(){this.timeline.play(0,!1)},this),500)},this)),this.timeline.play()},NextendSplitTextAnimationEditorController.prototype.killPreview=function(){this.repeatTimeout&&clearTimeout(this.repeatTimeout),this.timeline.pause(),this.mySplitText&&this.mySplitText.revert()},NextendSplitTextAnimationEditorController.prototype.show=function(){this.loadTransformOrigin(nextend.splittextanimationManager.transformOriginElement.val()),NextendVisualEditorControllerWithEditor.prototype.show.call(this),this.refreshTimeline()},NextendSplitTextAnimationEditorController.prototype.close=function(){this.killPreview(),NextendVisualEditorControllerWithEditor.prototype.close.call(this)},NextendSplitTextAnimationEditorController.prototype.loadTransformOrigin=function(t){this.editor.fields.transformOrigin.element.data("field").insideChange(t),this.refreshTransformOrigin(t,!1)},NextendSplitTextAnimationEditorController.prototype.refreshTransformOrigin=function(t,e){this.transformOrigin=t,NextendTween.set(this.preview.parent().get(0),{perspective:"1000px"}),e&&this.refreshTimeline()},scope.NextendSplitTextAnimationEditorController=NextendSplitTextAnimationEditorController,NextendSplitTextAnimationEditor.prototype=Object.create(NextendVisualEditor.prototype),NextendSplitTextAnimationEditor.prototype.constructor=NextendSplitTextAnimationEditor,NextendSplitTextAnimationEditor.prototype.load=function(t){this._off(),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(nextend.splittextanimationManager.controller.transformOrigin),this._on()},NextendSplitTextAnimationEditor.prototype.changeMode=function(){this.trigger("mode",this.fields.mode.element.val())},NextendSplitTextAnimationEditor.prototype.changeSort=function(){this.trigger("sort",this.fields.sort.element.val())},NextendSplitTextAnimationEditor.prototype.changeDuration=function(){this.trigger("duration",this.fields.duration.element.val()/1e3)},NextendSplitTextAnimationEditor.prototype.changeStagger=function(){this.trigger("stagger",this.fields.stagger.element.val()/1e3)},NextendSplitTextAnimationEditor.prototype.changeEasing=function(){this.trigger("ease",this.fields.easing.element.val())},NextendSplitTextAnimationEditor.prototype.changeOpacity=function(){this.trigger("opacity",this.fields.opacity.element.val()/100)},NextendSplitTextAnimationEditor.prototype.changeOffset=function(){var t=this.fields.offset.element.val().split("|*|");this.trigger("x",t[0]),this.trigger("y",t[1])},NextendSplitTextAnimationEditor.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])},NextendSplitTextAnimationEditor.prototype.changeScale=function(){this.trigger("scale",this.fields.scale.element.val()/100)},NextendSplitTextAnimationEditor.prototype.changeTransformOrigin=function(){nextend.splittextanimationManager.controller.refreshTransformOrigin(this.fields.transformOrigin.element.val(),!0)},scope.NextendSplitTextAnimationEditor=NextendSplitTextAnimationEditor}(n2,window),N2Require("Zoom",[],[],function(t,e,i){function n(e){this.key="n2-ss-editor-device-lock-mode",this.devices={unknownUnknown:t("<div />")},this.responsives=[e],e.setOrientation("portrait"),e.parameters.onResizeEnabled=0,e.parameters.forceFull=0,e._getDevice=e._getDeviceZoom,this.lock=t("#n2-ss-lock").on("click",t.proxy(this.switchLock,this));var i=e.parameters.sliderWidthToDevice.desktopPortrait;this.container=e.containerElement.closest(".n2-ss-container-device").addBack(),this.container.width(i),this.containerWidth=i,this.initZoom();var n=t("#n2-ss-devices .n2-tr"),r=e.parameters.deviceModes;this.devices.desktopPortrait=t('<div class="n2-td n2-panel-option" data-device="desktop" data-orientation="portrait"><i class="n2-i n2-it n2-i-v-desktop"></i></div>').prependTo(n),r.desktopLandscape?this.devices.desktopLandscape=t('<div class="n2-td n2-panel-option" data-device="desktop" data-orientation="landscape"><i class="n2-i n2-it n2-i-v-desktop-landscape"></i></div>').prependTo(n):this.devices.desktopLandscape=this.devices.desktopPortrait,r.tabletPortrait?this.devices.tabletPortrait=t('<div class="n2-td n2-panel-option" data-device="tablet" data-orientation="portrait"><i class="n2-i n2-it n2-i-v-tablet"></i></div>').prependTo(n):this.devices.tabletPortrait=this.devices.desktopPortrait,r.tabletLandscape?this.devices.tabletLandscape=t('<div class="n2-td n2-panel-option" data-device="tablet" data-orientation="landscape"><i class="n2-i n2-it n2-i-v-tablet-landscape"></i></div>').prependTo(n):this.devices.tabletLandscape=this.devices.desktopLandscape,r.mobilePortrait?this.devices.mobilePortrait=t('<div class="n2-td n2-panel-option" data-device="mobile" data-orientation="portrait"><i class="n2-i n2-it n2-i-v-mobile"></i></div>').prependTo(n):this.devices.mobilePortrait=this.devices.tabletPortrait,r.mobileLandscape?this.devices.mobileLandscape=t('<div class="n2-td n2-panel-option" data-device="mobile" data-orientation="landscape"><i class="n2-i n2-it n2-i-v-mobile-landscape"></i></div>').prependTo(n):this.devices.mobileLandscape=this.devices.tabletLandscape,this.deviceOptions=t("#n2-ss-devices .n2-panel-option"),this.deviceOptions.each(t.proxy(function(e,i){t(i).on({mousedown:t.proxy(nextend.context.setMouseDownArea,nextend.context,"zoomDeviceClicked"),click:t.proxy(this.setDeviceMode,this)})},this)),e.sliderElement.on("SliderDeviceOrientation",t.proxy(this.onDeviceOrientationChange,this))}var r=null;return nextend.ssBeforeResponsive=function(){r=new n(this),nextend.ssBeforeResponsive=function(){r.add(this)}},n.prototype.add=function(t){this.responsives.push(t),t.setOrientation("portrait"),t.parameters.onResizeEnabled=0,t.parameters.forceFull=0,t._getDevice=t._getDeviceZoom},n.prototype.onDeviceOrientationChange=function(e,i){t("#n2-admin").removeClass("n2-ss-mode-"+i.lastDevice+i.lastOrientation).addClass("n2-ss-mode-"+i.device+i.orientation),this.devices[i.lastDevice+i.lastOrientation].removeClass("n2-active"),this.devices[i.device+i.orientation].addClass("n2-active")},n.prototype.setDeviceMode=function(e){var i=t(e.currentTarget);if((e.ctrlKey||e.metaKey)&&nextend.smartSlider.canvasManager){var n=i.data("orientation");nextend.smartSlider.canvasManager.copyOrResetMode(i.data("device")+n[0].toUpperCase()+n.substr(1))}else for(var r=0;r<this.responsives.length;r++)this.responsives[r].setOrientation(i.data("orientation")),this.responsives[r].setMode(i.data("device"),this.responsives[r])},n.prototype.switchLock=function(e){e.preventDefault(),this.lock.toggleClass("n2-active"),this.lock.hasClass("n2-active")?(this.setZoomSyncMode(),this.zoomChange(e,this.zoom.slider("value"),"sync",!1),t.jStorage.set(this.key,"sync")):(this.setZoomFixMode(),t.jStorage.set(this.key,"fix"))},n.prototype.initZoom=function(){var e=t("#n2-ss-slider-zoom");e.length>0&&("undefined"!=typeof e[0].slide&&(e[0].slide=null),this.zoom=e.removeAttr("slide").prop("slide",!1).slider({range:"min",step:1,value:1,min:0,max:102}),this.responsives[0].sliderElement.on("SliderResize",t.proxy(this.sliderResize,this)),"fix"==t.jStorage.get(this.key,"sync")?this.setZoomFixMode():(this.setZoomSyncMode(),this.lock.addClass("n2-active")))},n.prototype.sliderResize=function(t,e){this.setZoom()},n.prototype.setZoomFixMode=function(){this.zoom.off(".n2-ss-zoom").on({"slide.n2-ss-zoom":t.proxy(this.zoomChangeFixMode,this),"slidechange.n2-ss-zoom":t.proxy(this.zoomChangeFixMode,this)})},n.prototype.setZoomSyncMode=function(){this.zoom.off(".n2-ss-zoom").on({"slide.n2-ss-zoom":t.proxy(this.zoomChangeSyncMode,this),"slidechange.n2-ss-zoom":t.proxy(this.zoomChangeSyncMode,this)})},n.prototype.zoomChangeFixMode=function(t,e){this.zoomChange(t,e.value,"fix",e)},n.prototype.zoomChangeSyncMode=function(t,e){this.zoomChange(t,e.value,"sync",e)},n.prototype.zoomChange=function(t,e,n,r){var s;if(t.originalEvent!==i){var o=1;50>e?o=nextend.smallestZoom/this.containerWidth+Math.max(e/50,0)*(1-nextend.smallestZoom/this.containerWidth):e>52&&(o=1+(e-52)/50),s=parseInt(o*this.containerWidth),this.container.width(s);for(var a=1;a<this.responsives.length;a++)this.responsives[a].containerElement.width(s);for(var a=0;a<this.responsives.length;a++)switch(n){case"sync":this.responsives[a].doResize(t);break;default:this.responsives[a].doResize(t,!0)}}else s=this.container.last().width(),this.container.width(s);r&&(r.handle.innerHTML=s+"px")},n.prototype.setZoom=function(){var t=this.responsives[0].containerElement.width()/this.containerWidth,e=50;1>t?e=(t-nextend.smallestZoom/this.containerWidth)/(1-nextend.smallestZoom/this.containerWidth)*50:t>1&&(e=50*(t-1)+52);this.zoom.slider("value");this.zoom.slider("value",e)},n}),N2Require("CreateSlider",[],[],function(t,e,i){function n(e,i,n){this.addToGroupModal=null,this.groupID=e,this.ajaxUrl=i,this.shouldSkipLicenseModal=n,t(".n2-ss-create-slider").click(t.proxy(function(e){e.preventDefault(),e.stopImmediatePropagation(),n?this.showModal():nextend.smartSlider.license.isActiveAsync(!0).done(t.proxy(this.showModal,this))},this)),this.notificationStack=new NextendNotificationCenterStackModal(t("body")),t(".n2-ss-add-sample-slider").click(t.proxy(function(e){e.preventDefault(),e.stopImmediatePropagation(),nextend.smartSlider.license.isActiveAsync().done(t.proxy(this.showDemoSliders,this))},this)),"createslider"==window.location.hash.substring(1)&&this.showModal()}return n.prototype.showModal=function(){if(!this.createSliderModal){var e=this,i=this.ajaxUrl,n=[];n.push({key:"default",name:n2_("Default"),image:"$ss$/admin/images/sliderpresets/default.png"}),n.push({key:"fullwidth",name:n2_("Full width"),image:"$ss$/admin/images/sliderpresets/fullwidth.png"}),n.push({key:"fullpage",name:n2_("Full page"),image:"$ss$/admin/images/sliderpresets/fullpage.png"}),n.push({key:"block",name:n2_("Block"),image:"$ss$/admin/images/sliderpresets/block.png"}),n.push({key:"carousel",name:n2_("Carousel"),image:"$ss$/admin/images/sliderpresets/carousel.png"}),n.push({key:"showcase",name:n2_("Showcase"),image:"$ss$/admin/images/sliderpresets/showcase.png"}),n.push({key:"thumbnailhorizontal",name:n2_("Thumbnail - horizontal"),image:"$ss$/admin/images/sliderpresets/thumbnailhorizontal.png"}),n.push({key:"thumbnailvertical",name:n2_("Thumbnail - vertical"),image:"$ss$/admin/images/sliderpresets/thumbnailvertical.png"}),n.push({key:"caption",name:n2_("Bar"),image:"$ss$/admin/images/sliderpresets/caption.png"}),n.push({key:"horizontalaccordion",name:n2_("Horizontal accordion"),image:"$ss$/admin/images/sliderpresets/horizontalaccordion.png"}),n.push({key:"verticalaccordion",name:n2_("Vertical accordion"),image:"$ss$/admin/images/sliderpresets/verticalaccordion.png"});var r=[750,630];this.createSliderModal=new NextendModal({zero:{size:r,title:n2_("Create Slider"),back:!1,close:!0,content:'<form class="n2-form"></form>',controls:['<a href="#" class="n2-button n2-button-normal n2-button-l n2-radius-s n2-button-green n2-uc n2-h4">'+n2_("Create")+"</a>"],fn:{show:function(){var r=this.controls.find(".n2-button-green"),s=this.content.find(".n2-form").on("submit",function(t){t.preventDefault(),r.trigger("click")});s.append(this.createInput(n2_("Slider name"),"createslidertitle","width: 240px;")),s.append(this.createInputUnit(n2_("Width"),"createsliderwidth","px","width: 30px;")),s.append(this.createInputUnit(n2_("Height"),"createsliderheight","px","width: 30px;")),new N2Classes.FormElementAutocompleteSimple("createsliderwidth",["1920","1200","1000","800","600","400"]),new N2Classes.FormElementAutocompleteSimple("createsliderheight",["800","600","500","400","300","200"]);var o=t("#createslidertitle").val(n2_("Slider")).focus(),a=t("#createsliderwidth").val(1200),l=t("#createsliderheight").val(500);a.parent().addClass("n2-form-element-autocomplete ui-front"),l.parent().addClass("n2-form-element-autocomplete ui-front"),this.createHeading(n2_("Preset")).appendTo(this.content);var h=360,d=this.createImageRadio(n).css("height",h).appendTo(this.content),p=d.find("input");r.on("click",t.proxy(function(){NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(i,{nextendaction:"create"}),data:{groupID:e.groupID,sliderTitle:o.val(),sliderSizeWidth:a.val(),sliderSizeHeight:l.val(),preset:p.val()},dataType:"json"}).done(t.proxy(function(t){NextendAjaxHelper.startLoading()},this))},this))}}}})}this.createSliderModal.show()},n.prototype.showDemoSliders=function(){var e=this;t("body").css("overflow","hidden");var i=0;i=1;var n=t('<iframe src="//smartslider3.com/demo-import/?pro='+i+"&version="+N2SS3VERSION+"&utm_campaign="+N2SS3C+"&utm_source=import-slider-frame&utm_medium=smartslider-"+N2PLATFORM+"-"+(i?"pro":"free")+'" frameborder="0"></iframe>').css({position:"fixed",zIndex:1e5,left:0,top:0,width:"100%",height:"100%"}).appendTo("body"),r=function(){t("body").css("overflow",""),n.remove(),window.removeEventListener("message",o,!1),e.notificationStack.popStack()},s=function(t){NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(e.ajaxUrl,{nextendaction:"importDemo"}),data:{groupID:e.groupID,key:Base64.encode(t.replace(/^(http(s)?:)?\/\//,"//"))},dataType:"json"}).fail(function(){})},o=function(t){if("http://smartslider3.com"===t.origin||"https://smartslider3.com"===t.origin){var e=t.data;switch(e.key){case"importSlider":return void s(e.data.href);case"closeWindow":r()}}};this.notificationStack.enableStack(),NextendEsc.add(t.proxy(function(){return r(),!0},this)),window.addEventListener("message",o,!1)},n}),N2Require("SliderGroup",[],[],function(t,e,i){function n(e,i){this.addToGroupModal=null,this.manager=e,this.ajaxUrl=i,t("#n2-ss-create-group").click(t.proxy(function(t){t.preventDefault(),t.stopImmediatePropagation(),this.showModal()},this)),this.notificationStack=new NextendNotificationCenterStackModal(t("body"))}return n.prototype.showModal=function(){var i=!1;if(!this.addToGroupModal){var n=this,r=this.ajaxUrl;this.addToGroupModal=new NextendModal({zero:{size:[300,220],title:n2_("Create Group"),back:!1,close:!0,content:'<form class="n2-form"></form>',controls:['<a href="#" class="n2-button n2-button-normal n2-button-l n2-radius-s n2-button-green n2-uc n2-h4">'+n2_("Create group")+"</a>"],fn:{show:function(){var s=this.controls.find(".n2-button-green"),o=this.content.find(".n2-form").on("submit",function(t){t.preventDefault(),s.trigger("click")});o.append(this.createInput(n2_("Group name"),"grouptitle","width: 240px;"));var a=t("#grouptitle").val(n2_("Group")).focus();s.on("click",t.proxy(function(s){s.preventDefault(),NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(r,{nextendaction:"createGroup"}),data:{title:a.val()},dataType:"json"}).done(t.proxy(function(r){if(0==n.manager.groupID){var o=t(r.data).appendTo(n.manager.slidersContainer);new e.Slider(n.manager,o);n.manager.initSliders()}i=!0,this.hide(s)},this))},this))},hide:function(){i?t("body").triggerHandler("groupAdded"):t("body").triggerHandler("groupCanceled")}}}})}this.addToGroupModal.show()},n}),N2Require("ManageSliders",[],[],function(t,e,i){function n(i,n,r){this.preventSort=!1,this.groupID=i,this.ajaxUrl=n,this.sliders=[],this.sliderPanel=t("#n2-ss-slider-container"),this.orderBy="ordering"==this.sliderPanel.data("orderby"),this.slidersContainer=this.sliderPanel.find(".n2-ss-sliders-container");for(var s=this.slidersContainer.find(".n2-ss-box-slider"),o=0;o<s.length;o++)this.sliders.push(new e.Slider(this,s.eq(o)));this.changed(),this.initMenu(),this.initOrderable(),this.create=new e.CreateSlider(i,n,r),this.createGroup=new e.SliderGroup(this,n),this.initBulk()}return n.prototype.changed=function(){t("html").attr("data-sliders",this.sliders.length)},n.prototype.initSliders=function(){for(var e=(this.sliders.length,this.slidersContainer.find(".n2-ss-box-slider")),i=[],n=0;n<e.length;n++){var r=e.eq(n).data("slider");i.push(r)}this.sliders=i,this.changed(),t(window).triggerHandler("SmartSliderSidebarSlidersChanged")},n.prototype.initOrderable=function(){this.orderBy&&this.slidersContainer.sortable({helper:"clone",forcePlaceholderSize:!1,tolerance:"pointer",connectWith:".n2-ss-box-slider-group",items:".n2-ss-box-slider",start:function(t,e){e.item.show()},stop:t.proxy(this.saveOrder,this),placeholder:"n2-box-sortable-placeholder",distance:10})},n.prototype.saveOrder=function(e){if(this.preventSort)return this.slidersContainer.sortable("cancel"),void(this.preventSort=!1);for(var i=this.slidersContainer.find(".n2-ss-box-slider"),n=[],r=[],s=[],o=0;o<i.length;o++){var a=i.eq(o).data("slider");n.push(a),r.push(a.getId())}for(var o=0;o<this.sliders.length;o++)s.push(this.sliders[o].getId());if(JSON.stringify(s)!=JSON.stringify(r)){t(window).triggerHandler("SmartSliderSidebarSlidersOrderChanged");var l={nextendcontroller:"sliders",nextendaction:"order"};NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(this.ajaxUrl,l),data:{groupID:this.groupID,sliderorder:r,isReversed:"DESC"==this.sliderPanel.data("orderbydirection")?1:0}}),this.sliders=n}},n.prototype.initMenu=function(){this.slider=null,this.menu=t("#n2-ss-slider-menu").detach().addClass("n2-inited"),this.menuActions={duplicate:this.menu.find(".n2-ss-duplicate").on("click",t.proxy(function(t){this.slider.duplicate(t)},this)),"delete":this.menu.find(".n2-ss-delete").on("click",t.proxy(function(t){this.slider["delete"](t)},this)),preview:this.menu.find(".n2-ss-preview").on("click",t.proxy(function(t){this.slider.preview(t)},this))},this.menuActions.addToGroup=this.menu.find(".n2-ss-add-to-group").on("click",t.proxy(function(t){t.stopPropagation(),t.preventDefault(),this.addToGroup([this.slider.getId()])},this)),this.menuActions.removeFromGroup=this.menu.find(".n2-ss-remove-from-group").on("click",t.proxy(function(t){t.stopPropagation(),t.preventDefault(),this.removeFromGroup([this.slider.getId()])},this)),this.menu.find(".n2-button").on("click",t.proxy(function(e){e.preventDefault(),e.stopPropagation(),this.menu.hasClass("n2-active")?this.menu.removeClass("n2-active").off("mouseleave"):this.menu.addClass("n2-active").on("mouseleave",function(){t(this).removeClass("n2-active")})},this))},n.prototype.showMenu=function(t){this.slider=t,this.menu.appendTo(t.box)},n.prototype.hideMenu=function(){this.menu.hasClass("n2-active")&&this.menu.removeClass("n2-active").off("mouseleave"),this.menu.detach()},n.prototype.deleteSliders=function(e,i){this.hideMenu();var n=i[0].box.find(".n2-box-placeholder-title a").text();i.length>1&&(n+=" and "+(i.length-1)+" more"),NextendDeleteModal("slider-delete",n,t.proxy(function(){NextendAjaxHelper.ajax({url:NextendAjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendcontroller:"sliders",nextendaction:"delete"}),type:"POST",data:{sliders:e}}).done(t.proxy(function(){for(var t=0;t<i.length;t++)i[t].deleted();this.initSliders(),this.leaveBulk()},this))},this))},n.prototype.duplicateSliders=function(e,i){for(var n=0;n<this.sliders.length;n++)this.sliders[n].selected&&this.sliders[n].duplicate(t.Event("click",{currentTarget:null}));
},n.prototype.exportSliders=function(e,i){window.location.href=NextendAjaxHelper.makeFallbackUrl(this.ajaxUrl,{nextendcontroller:"sliders",nextendaction:"exportAll"})+"&"+t.param({sliders:e,currentGroupID:this.groupID})},n.prototype.initBulk=function(){this.selection=[],this.isBulkSelection=!1;var e=t(".n2-bulk-select").find("a");e.eq(0).on("click",t.proxy(function(t){t.preventDefault(),this.bulkSelect(function(t){t.select()})},this)),e.eq(1).on("click",t.proxy(function(t){t.preventDefault(),this.bulkSelect(function(t){t.deSelect()})},this));t(".n2-bulk-actions").find("a").on("click",t.proxy(function(e){switch(e.preventDefault(),t(e.currentTarget).data("action")){case"duplicate":this.bulkAction("duplicateSliders",!1);break;case"delete":this.bulkAction("deleteSliders",!1);break;case"export":this.bulkAction("exportSliders",!1);break;case"addToGroup":this.bulkAction("addToGroup",!0)}},this))},n.prototype.addSelection=function(t){0==this.selection.length&&this.enterBulk(),this.selection.push(t)},n.prototype.removeSelection=function(e){this.selection.splice(t.inArray(e,this.selection),1),0==this.selection.length&&this.leaveBulk()},n.prototype.bulkSelect=function(t){for(var e=0;e<this.sliders.length;e++)t(this.sliders[e])},n.prototype.bulkAction=function(t,e){var i=[],n=[];this.bulkSelect(function(t){!t.selected||e&&t.isGroup||(i.push(t),n.push(t.getId()))}),n.length?(this[t](n,i),this.leaveBulk()):e?nextend.notificationCenter.notice("Please select one or more sliders for the action!"):nextend.notificationCenter.notice("Please select one or more sliders or groups for the action!")},n.prototype.enterBulk=function(){this.isBulkSelection||(this.isBulkSelection=!0,this.orderBy&&this.slidersContainer.sortable("option","disabled",!0),t("#n2-admin").addClass("n2-ss-has-box-selection"))},n.prototype.leaveBulk=function(){if(this.isBulkSelection){this.orderBy&&this.slidersContainer.sortable("option","disabled",!1),t("#n2-admin").removeClass("n2-ss-has-box-selection");for(var e=0;e<this.sliders.length;e++)this.sliders[e].deSelect();this.selection=[],this.isBulkSelection=!1}},n.prototype.removeFromGroup=function(e){return NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"removeFromGroup"}),data:{currentGroupID:this.groupID,sliders:e},dataType:"json"}).done(t.proxy(function(i){for(var n=0;n<e.length;n++)t('[data-sliderid="'+e[n]+'"]').data("slider").deleted();this.initSliders()},this))},n.prototype._addToGroup=function(e,i,n){return NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"addToGroup"}),data:{currentGroupID:this.groupID,groupID:i,action:e,sliders:n},dataType:"json"}).done(t.proxy(function(r){if("move"==e){for(var s=0;s<n.length;s++)t('[data-sliderid="'+n[s]+'"]').data("slider").deleted();this.initSliders()}var o=t('[data-sliderid="'+i+'"] .n2-box-placeholder-buttons .n2-button-grey');o.html(parseInt(o.html())+n.length)},this))},n.prototype.addToGroup=function(e){var i=null,n=this,r=(this.ajaxUrl,new NextendModal({zero:{size:[350,220],title:n2_("Add to group"),back:!1,close:!0,content:'<form class="n2-form"></form>',controls:['<div class="n2-button n2-button-with-actions n2-button-l n2-button-green n2-radius-s n2-h4"><a class="n2-button-inner" href="#" data-action="move">'+n2_("Move")+'</a><div class="n2-button-menu-open"><i class="n2-i n2-i-buttonarrow"></i><div class="n2-button-menu"><div class="n2-button-menu-inner n2-border-radius"><a class="n2-h4" href="#" data-action="copy">'+n2_("Copy")+'</a><a class="n2-h4" href="#" data-action="link">'+n2_("Link")+"</a></div></div></div></div>"],fn:{show:function(){this.controls.find(".n2-button-menu-open").n2opener();var r=this.controls.find("a"),s=this.content.find(".n2-form").on("submit",function(t){t.preventDefault(),r.eq(0).trigger("click")});s.append(this.createSelect(n2_("Group"),"choosegroup",i,"width:300px;"));var o=t("#choosegroup");r.on("click",t.proxy(function(i){i.preventDefault(),n._addToGroup(t(i.currentTarget).data("action"),o.val(),e).done(t.proxy(function(){this.hide(i)},this))},this))}}}}));NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendcontroller:"sliders",nextendaction:"listGroups"}),dataType:"json"}).done(t.proxy(function(e){i=e.data,"undefined"!=typeof i[this.groupID]&&delete i[this.groupID],t.isEmptyObject(i)?(t("body").on({"groupAdded.addToGroup":t.proxy(function(){t("body").off(".addToGroup"),NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendcontroller:"sliders",nextendaction:"listGroups"}),dataType:"json"}).done(t.proxy(function(t){i=t.data,"undefined"!=typeof i[this.groupID]&&delete i[this.groupID],r.show()},this))},this),"groupAddCanceled.addToGroup":t.proxy(function(){t("body").off(".addToGroup")},this)}),this.createGroup.showModal()):r.show()},this))},n}),N2Require("ParticleAdminManager",[],[],function(t,e,i){function n(e,i){this.slider=window["n2-ss-"+e],this.types=i,this.fields={},this.values=t.extend({},r),this.slider.ready(t.proxy(this.onVisible,this)),this.updateParticle=NextendThrottle(this.updateParticle,33),window.parent!=window&&t(window).on("keydown keyup keypress",t.proxy(function(t){27==t.keyCode&&this.postMessage("cancel")},this)),t("#n2-ss-form-cancel").on("click",t.proxy(function(t){t.preventDefault(),this.postMessage("cancel")},this)),t("#n2-ss-form-save").on("click",t.proxy(function(t){t.preventDefault(),this.postMessage("save",this.getValues())},this)),window.addEventListener("message",t.proxy(this.onMessage,this),!1),this.slider.ready(t.proxy(function(){this.postMessage("ready")},this)),t('<div style="margin:10px;">'+n2_printf("You can generate at %s Then <i>Download current config (json)</i> and paste content into the field.",'<a target="_blank" href="http://vincentgarreau.com/particles.js/">http://vincentgarreau.com/particles.js/</a>')+"</div>").insertAfter(t("#slidercustom").parent())}var r={preset:0,custom:"",color:"FFFFFF80","line-color":"FFFFFF66",speed:2,number:28,hover:"off",click:"off",mobile:0};return n.prototype.getValues=function(){if("0"==this.values.preset)return JSON.stringify(!1);var e=t.extend({},this.values);return""!=e.custom&&(e.custom=JSON.parse(e.custom.replace(/\/\*.*?\*\//,""))),JSON.stringify(e)},n.prototype.postMessage=function(t){var e=!1;arguments.length>1&&(e=arguments[1]),parent.postMessage(JSON.stringify({action:t,data:e}),"*")},n.prototype.onMessage=function(t){if(t.source==parent)try{var e=JSON.parse(t.data);switch(e.action){case"load":try{var i=JSON.parse(e.data);0==i?this.loadValues(r):this.loadValues(i)}catch(n){this.loadValues(r)}}}catch(n){console.error(n)}},n.prototype.onVisible=function(){this.registerField("preset"),this.$rowSettings=t(".n2-ss-particle-settings"),this.$rowCustom=t(".n2-ss-particle-custom"),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"),this.updateParticle()},n.prototype.updateParticle=function(){var e=this.getValue("preset");if(0==e)return this.$rowSettings.css("display","none"),this.$rowCustom.css("display","none"),void(this.slider.pJS&&(this.slider.pJS.pJS.fn.vendors.destroypJS(),this.slider.pJS=!1));var i={};if("custom"==e){this.$rowSettings.css("display","none"),this.$rowCustom.css("display","");var n=this.getValue("custom").replace(/\/\*.*?\*\//,"");if(""==n)return void(this.slider.pJS&&(this.slider.pJS.pJS.fn.vendors.destroypJS(),this.slider.pJS=!1));try{i=JSON.parse(n)}catch(r){alert("Invalid JSON data in custom field.")}}else{this.$rowSettings.css("display",""),this.$rowCustom.css("display","none"),i=JSON.parse(this.types[e]);var s=N2Color.colorToSVG(this.getValue("color"));i.particles.color.value=s[0],i.particles.opacity.value=s[1];var o=N2Color.colorToSVG(this.getValue("line-color"));i.particles.line_linked.color=o[0],i.particles.line_linked.opacity=o[1],i.particles.number.value=this.getValue("number"),i.particles.move.speed=parseInt(this.getValue("speed"));var a=this.getValue("hover");"0"==a?i.interactivity.events.onhover.enable=0:(i.interactivity.events.onhover.enable=1,i.interactivity.events.onhover.mode=a);var l=this.getValue("click");"0"==l?i.interactivity.events.onclick.enable=0:(i.interactivity.events.onclick.enable=1,i.interactivity.events.onclick.mode=l)}if(i.interactivity.detect_on=this.slider.sliderElement[0],this.slider.pJS){t.extend(!0,this.slider.pJS.pJS,i);var h=this.slider.pJS.pJS;h.tmp.obj={size_value:h.particles.size.value,size_anim_speed:h.particles.size.anim.speed,move_speed:h.particles.move.speed,line_linked_distance:h.particles.line_linked.distance,line_linked_width:h.particles.line_linked.width,mode_grab_distance:h.interactivity.modes.grab.distance,mode_bubble_distance:h.interactivity.modes.bubble.distance,mode_bubble_size:h.interactivity.modes.bubble.size,mode_repulse_distance:h.interactivity.modes.repulse.distance},this.slider.pJS.pJS.fn.particlesRefresh()}else this.slider.startParticleJS(i)},n.prototype.registerField=function(e){this.fields[e]=t("#slider"+e).on("nextendChange",t.proxy(function(){this.values[e]=this.fields[e].val(),this.updateParticle()},this))},n.prototype.loadValues=function(e){"object"==typeof e.custom&&(e.custom=JSON.stringify(e.custom,null,2)),this.values=t.extend({},r,e),this.updateParticle();for(var i in this.fields)this.fields[i].data("field").insideChange(this.getValue(i))},n.prototype.getValue=function(t){return this.values[t]},n}),N2Require("ShapeDividerAdminManager",[],[],function(t,e,i){function n(e,i){this.slider=window["n2-ss-"+e],this.top=new r(this.slider,this,i,"top"),this.bottom=new r(this.slider,this,i,"bottom"),window.parent!=window&&t(window).on("keydown keyup keypress",t.proxy(function(t){27==t.keyCode&&this.postMessage("cancel")},this)),t("#n2-ss-form-cancel").on("click",t.proxy(function(t){t.preventDefault(),this.postMessage("cancel")},this)),t("#n2-ss-form-save").on("click",t.proxy(function(t){t.preventDefault(),this.postMessage("save",this.getValues())},this)),window.addEventListener("message",t.proxy(this.onMessage,this),!1),this.slider.ready(t.proxy(function(){this.postMessage("ready")},this))}function r(e,i,n,r){this.slider=e,this.manager=i,this.types=n,this.side=r,this.devicePrefix="desktopportrait",this.isDeviceBased={},this.fields={},this.values=t.extend({},s),this.tweens=[],this.renderDivider=NextendThrottle(this.renderDivider,33),this.slider.ready(t.proxy(this.onVisible,this))}var s={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,scroll:0};return n.prototype.getValues=function(){return JSON.stringify({top:this.top.getValues(),bottom:this.bottom.getValues()})},n.prototype.postMessage=function(t){var e=!1;arguments.length>1&&(e=arguments[1]),parent.postMessage(JSON.stringify({action:t,data:e}),"*")},n.prototype.onMessage=function(t){if(t.source==parent)try{var e=JSON.parse(t.data);switch(e.action){case"load":try{var i=JSON.parse(e.data);this.top.loadValues(i.top),this.bottom.loadValues(i.bottom)}catch(n){this.top.loadValues(s),this.bottom.loadValues(s)}}}catch(n){console.error(n)}},r.prototype.loadValues=function(e){this.values=t.extend({},s,e),this.renderDivider();for(var i in this.fields)this.fields[i].data("field").insideChange(this.getValue(i))},r.prototype.getValues=function(){return 0==this.values.type?!1:this.values},r.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-mixed-group").css("display","none"),this.registerField("flip",!1),this.registerField("animate",!1),this.registerField("width",!0),this.registerField("height",!0),this.registerField("scroll",!1),this.slider.sliderElement.on("SliderDeviceOrientation",t.proxy(this.onDeviceChange,this))},r.prototype.onDeviceChange=function(t,e){this.devicePrefix=e.device.toLowerCase()+e.orientation.toLowerCase();for(var i in this.isDeviceBased)this.isDeviceBased[i]&&this.fields[i].data("field").insideChange(this.getValue(i));this.renderDivider()},r.prototype.renderDivider=function(){if(this.tweens.length){for(var e=0;e<this.tweens.length;e++)this.tweens[e].kill();this.tweens=[]}this.slider.sliderElement.find(".n2-ss-shape-divider-"+this.side).remove();var n=this.getValue("type");if(0==n?this.$fieldGroups.css("display","none"):this.$fieldGroups.css("display",""),n.match(/bi\-/)?this.$color2Container.css("display",""):this.$color2Container.css("display","none"),"0"!=n&&this.types[n]!==i){var r=this.types[n].replace(/#000000/g,N2Color.hex2rgbaCSS(this.getValue("color"))).replace(/#000010/g,N2Color.hex2rgbaCSS(this.getValue("color2"))),s=t("<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'>"+r+"</div></div>").appendTo(this.$shapeContainer);if(parseInt(this.getValue("flip"))&&s.addClass("n2-ss-flip-horizontal"),parseInt(this.getValue("animate"))){s.addClass("n2-ss-divider-animate");var o=s.find(".n2-ss-divider-start > *"),a=s.find(".n2-ss-divider-end > *");if(o.parent().attr("yoyo"))for(var l={onComplete:function(){this.reverse()},onReverseComplete:function(){this.restart()}},h=0;h<o.length;h++)this.tweens.push(NextendTween.to(o[h],parseFloat(o.eq(h).attr("duration")),t.extend({morphSVG:a[h],delay:0,ease:"easeInOut"},l,{delay:o.eq(h).attr("delay"),ease:o.eq(h).attr("ease")})));else{for(var d=new NextendTimeline({onComplete:function(){this.restart()}}),h=0;h<o.length;h++)d.to(o[h],parseFloat(o.eq(h).attr("duration")),t.extend({morphSVG:a[h],delay:0,ease:"easeOutCubic"},{delay:o.eq(h).attr("delay"),ease:o.eq(h).attr("ease")}),0);d.to({x:0},2,{x:10}),this.tweens.push(d)}}}},r.prototype.registerField=function(e,i){this.isDeviceBased[e]=i,this.fields[e]=t("#slidershapedivider-"+this.side+"-"+e).on("nextendChange",t.proxy(function(){i?this.values[this.devicePrefix+e]=this.fields[e].val():this.values[e]=this.fields[e].val(),this.renderDivider()},this))},r.prototype.getValue=function(t){return this.isDeviceBased[t]?this.values[this.devicePrefix+t]==i||""==this.values[this.devicePrefix+t]?this.values["desktopportrait"+t]:this.values[this.devicePrefix+t]:this.values[t]},n}),N2Require("Slider",[],[],function(t,e,i){function n(e,i){this.selected=!1,this.manager=e,this.box=i.data("slider",this).addClass("n2-clickable"),this.isGroup=this.box.hasClass("n2-ss-box-slider-group"),this.box.on("mouseenter",t.proxy(function(){this.manager.showMenu(this)},this)).on("mouseleave",t.proxy(function(){this.manager.hideMenu()},this)).on("click.n2-slider",t.proxy(this.goToEdit,this)),this.box.find(".n2-ss-box-select").on("click",t.proxy(function(t){t.stopPropagation(),t.preventDefault(),this.invertSelection()},this)),this.isGroup&&this.manager.orderBy&&this.box.droppable({accept:".n2-ss-box-slider-slider",greedy:!0,over:t.proxy(function(e,i){this.box.addClass("n2-active"),this.manager.slidersContainer.addClass("n2-ss-slider-over-group"),t(i.helper).addClass("n2-ss-helper-add-to-group")},this),out:t.proxy(function(e,i){t(i.helper).removeClass("n2-ss-helper-add-to-group"),this.manager.slidersContainer.removeClass("n2-ss-slider-over-group"),this.box.removeClass("n2-active")},this),drop:t.proxy(function(e,i){t(i.helper).removeClass("n2-ss-helper-add-to-group"),this.manager.slidersContainer.removeClass("n2-ss-slider-over-group"),this.box.removeClass("n2-active"),this.manager._addToGroup("move",this.getId(),[i.helper.data("sliderid")]),this.manager.preventSort=!0},this)})}return n.prototype.getId=function(){return this.box.data("sliderid")},n.prototype.goToEdit=function(t,e){var i=this.box.data("editurl");"undefined"!=typeof e&&e?window.open(i,"_blank"):window.location=i},n.prototype.preview=function(t){t.stopPropagation(),t.preventDefault(),window.open(NextendAjaxHelper.makeFallbackUrl(this.box.data("editurl"),{nextendcontroller:"preview",nextendaction:"index"}),"_blank")},n.prototype.duplicate=function(e){e.stopPropagation(),e.preventDefault();var i=t.Deferred();return NextendAjaxHelper.ajax({url:NextendAjaxHelper.makeAjaxUrl(this.box.data("editurl"),{nextendcontroller:"slider",nextendaction:"duplicate"})}).done(t.proxy(function(e){var r=t(e.data).insertAfter(this.box),s=new n(this.manager,r);this.manager.initSliders(),i.resolve(s)},this)),i},n.prototype["delete"]=function(t){t.stopPropagation(),t.preventDefault(),this.manager.deleteSliders([this.getId()],[this])},n.prototype.deleted=function(){this.box.remove()},n.prototype.invertSelection=function(t){t&&t.preventDefault(),this.selected?this.deSelect():this.select()},n.prototype.select=function(){this.selected||(this.selected=!0,this.box.addClass("n2-selected"),this.manager.addSelection(this))},n.prototype.deSelect=function(){this.selected&&(this.selected=!1,this.box.removeClass("n2-selected"),this.manager.removeSelection(this))},n}),N2Require("FormElementAnimationManager",["FormElement"],[],function(t,e,i){function n(i,n){this.element=t("#"+i),this.managerIdentifier=n,this.element.parent().on("click",t.proxy(this.show,this)),this.element.siblings(".n2-form-element-clear").on("click",t.proxy(this.clear,this)),this.name=this.element.siblings("input"),this.updateName(this.element.val()),e.FormElement.prototype.constructor.apply(this,arguments)}return n.prototype=Object.create(e.FormElement.prototype),n.prototype.constructor=n,n.prototype.show=function(e){e.preventDefault(),nextend[this.managerIdentifier].show(this.element.val(),t.proxy(this.save,this))},n.prototype.clear=function(t){t.preventDefault(),t.stopPropagation(),this.val("")},n.prototype.save=function(t,e){this.val(e)},n.prototype.val=function(t){this.element.val(t),this.updateName(t),this.triggerOutsideChange()},n.prototype.insideChange=function(t){this.element.val(t),this.updateName(t),this.triggerInsideChange()},n.prototype.updateName=function(t){t=""==t?n2_("Disabled"):t.split("||").length>1?n2_("Multiple animations"):n2_("Single animation"),this.name.val(t)},n}),N2Require("FormElementBackground",["FormElement"],[],function(t,e,i){function n(i,n){this.value="",this.element=t("#"+i),this.$container=this.element.closest(".n2-form-tab"),this.panel=t("#"+i+"-panel"),this.setValue(n),this.options=this.panel.find(".n2-subform-image-option").on("click",t.proxy(this.selectOption,this)),this.active=this.getIndex(this.options.filter(".n2-active").get(0)),this.element.on("change",t.proxy(function(){this.insideChange(this.element.val())},this)),e.FormElement.prototype.constructor.apply(this,arguments)}return n.prototype=Object.create(e.FormElement.prototype),n.prototype.constructor=n,n.prototype.selectOption=function(e){var i=this.getIndex(e.currentTarget);if(i!=this.active){this.options.eq(i).addClass("n2-active"),this.options.eq(this.active).removeClass("n2-active"),this.active=i;var n=t(e.currentTarget).data("value");this.insideChange(n)}},n.prototype.setValue=function(t){this.$container.removeClass("n2-ss-background-type-"+this.value),this.value=t,this.$container.addClass("n2-ss-background-type-"+this.value)},n.prototype.insideChange=function(t){this.setValue(t),this.element.val(t),this.options.removeClass("n2-active"),this.options.filter('[data-value="'+t+'"]').addClass("n2-active"),this.triggerInsideChange()},n.prototype.getIndex=function(e){return t.inArray(e,this.options)},n}),N2Require("FormElementColumns",["FormElement"],[],function(t,e,i){function n(i){this.denominators={1:100,2:100,3:144,4:100,5:100,6:144},this.element=t("#"+i),e.FormElement.prototype.constructor.apply(this,arguments),this.$c=t("#"+i).parent(),this.$container=this.$c.find(".n2-ss-columns-element-container"),this.containerWidth=284,this.maxWidth=0,this.$container.sortable({axis:"x",tolerance:"pointer",items:".n2-ss-columns-element-column",helper:"clone",start:t.proxy(function(t,e){this.$container.addClass("n2-sortable-currently-sorted"),e.placeholder.css("width",e.item.width());var i=this.$container.find(".n2-ss-columns-element-column");e.item.data("index",i.index(e.item))},this),stop:t.proxy(function(t,e){var i=this.$container.find(".n2-ss-columns-element-column"),n=e.item.data("index"),r=i.index(e.item);n!=r&&(this.currentRow.moveCol(n,r),e.item.data("index",null)),this.makeResizable(),this.$container.removeClass("n2-sortable-currently-sorted")},this)}),this.$c.find(".n2-ss-columns-element-add-col").on({click:t.proxy(function(){this.currentRow.createCol()},this)})}return n.prototype=Object.create(e.FormElement.prototype),n.prototype.constructor=n,n.prototype.getDenominator=function(t){return this.denominators[t]===i&&(this.denominators[t]=15*t),this.denominators[t]},n.prototype.setRow=function(t){this.currentRow=t,this.insideChange(t.getColumnsOrdered())},n.prototype.setValue=function(t){},n.prototype.insideChange=function(t){this.start(t)},n.prototype.activateColumn=function(t){var e=this.$container.find(".n2-ss-columns-element-column").index(t.currentTarget);this.currentRow.activateColumn(e,t)},n.prototype.start=function(e){this.percentages=[];for(var i=e.split("+"),n=0;n<i.length;n++)this.percentages.push(new Fraction(i[n]));this.refreshMaxWidth(),this.$container.empty();for(var n=0;n<this.percentages.length;n++)this.updateColumn(t('<div class="n2-ss-columns-element-column">').on("click",t.proxy(this.activateColumn,this)).appendTo(this.$container),this.percentages[n]);this.makeResizable()},n.prototype.refreshMaxWidth=function(){this.maxWidth=this.containerWidth-15*(this.percentages.length-1)},n.prototype.updateColumn=function(t,e){t.css("width",this.maxWidth*e.valueOf()+"px").html(Math.round(100*e.valueOf()*10)/10+"%")},n.prototype.makeResizable=function(){this.handles&&this.handles.remove(),this.$columns=this.$container.find(".n2-ss-columns-element-column"),t('<div class="n2-ss-columns-element-handle"><div class="n2-i n2-i-more"></div></div>').insertAfter(this.$columns.not(this.$columns.last())),this.handles=this.$container.find(".n2-ss-columns-element-handle").on("mousedown",t.proxy(this._resizeStart,this))},n.prototype._resizeStart=function(e){var i=this.handles.index(e.currentTarget),n=this.$container.offset().left+8;this.resizeContext={index:i,cLeft:n,$currentCol:this.$columns.eq(i),$nextCol:this.$columns.eq(i+1),startX:Math.max(0,Math.min(e.clientX-n,this.containerWidth))},this._resizeMove(e),t("html").off(".resizecol").on({"mousemove.resizecol":t.proxy(this._resizeMove,this),"mouseup.resizecol mouseleave.resizecol":t.proxy(this._resizeStop,this)})},n.prototype._resizeMove=function(e){e.preventDefault();var i=Math.max(0,Math.min(e.clientX-this.resizeContext.cLeft,this.containerWidth)),n=this.getDenominator(this.percentages.length),r=new Fraction(Math.round((i-this.resizeContext.startX)/(this.maxWidth/n)),n);r.compare(this.percentages[this.resizeContext.index].clone().mul(-1))<0&&(r=this.percentages[this.resizeContext.index].clone().mul(-1)),r.compare(this.percentages[this.resizeContext.index+1])>0&&(r=this.percentages[this.resizeContext.index+1].clone());var s=this.percentages[this.resizeContext.index].add(r),o=this.percentages[this.resizeContext.index+1].sub(r);this.updateColumn(this.resizeContext.$currentCol,s),this.updateColumn(this.resizeContext.$nextCol,o);var a=t.extend([],this.percentages);return a[this.resizeContext.index]=s,a[this.resizeContext.index+1]=o,this.onColumnWidthChange(a),[s,o]},n.prototype._resizeStop=function(e){var i=this._resizeMove(e);this.percentages[this.resizeContext.index]=i[0],this.percentages[this.resizeContext.index+1]=i[1],t("html").off(".resizecol"),delete this.resizeContext,this.currentRow.setRealColsWidth(this.percentages)},n.prototype.onColumnWidthChange=function(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i].valueOf());this.currentRow.updateColumnWidth(e)},n}),function(t){"use strict";function e(t,e){return isNaN(t=parseInt(t,10))&&i(),t*e}function i(){throw"Invalid Param"}function n(t,e){return this instanceof n?(o(t,e),t=n.REDUCE?d(s.d,s.n):1,this.s=s.s,this.n=s.n/t,void(this.d=s.d/t)):new n(t,e)}var r=2e3,s={s:1,n:0,d:1},o=function(t,n){var r,o=0,a=1,l=1,h=0,d=0,p=0,c=1,u=1,y=0,f=1,g=1,m=1,v=1e7;if(void 0===t||null===t);else if(void 0!==n)o=t,a=n,l=o*a;else switch(typeof t){case"object":"d"in t&&"n"in t?(o=t.n,a=t.d,"s"in t&&(o*=t.s)):0 in t?(o=t[0],1 in t&&(a=t[1])):i(),l=o*a;break;case"number":if(0>t&&(l=t,t=-t),t%1===0)o=t;else if(t>0){for(t>=1&&(u=Math.pow(10,Math.floor(1+Math.log(t)/Math.LN10)),t/=u);v>=f&&v>=m;){if(r=(y+g)/(f+m),t===r){v>=f+m?(o=y+g,a=f+m):m>f?(o=g,a=m):(o=y,a=f);break}t>r?(y+=g,f+=m):(g+=y,m+=f),f>v?(o=g,a=m):(o=y,a=f)}o*=u}else(isNaN(t)||isNaN(n))&&(a=o=NaN);break;case"string":if(f=t.match(/\d+|./g),"-"===f[y]?(l=-1,y++):"+"===f[y]&&y++,f.length===y+1?d=e(f[y++],l):"."===f[y+1]||"."===f[y]?("."!==f[y]&&(h=e(f[y++],l)),y++,(y+1===f.length||"("===f[y+1]&&")"===f[y+3]||"'"===f[y+1]&&"'"===f[y+3])&&(d=e(f[y],l),c=Math.pow(10,f[y].length),y++),("("===f[y]&&")"===f[y+2]||"'"===f[y]&&"'"===f[y+2])&&(p=e(f[y+1],l),u=Math.pow(10,f[y+1].length)-1,y+=3)):"/"===f[y+1]||":"===f[y+1]?(d=e(f[y],l),c=e(f[y+2],1),y+=3):"/"===f[y+3]&&" "===f[y+1]&&(h=e(f[y],l),d=e(f[y+2],l),c=e(f[y+4],1),y+=5),f.length<=y){a=c*u,l=o=p+a*h+u*d;break}default:i()}if(0===a)throw"DIV/0";s.s=0>l?-1:1,s.n=Math.abs(o),s.d=Math.abs(a)},a=function(t,e,i){for(var n=1;e>0;t=t*t%i,e>>=1)1&e&&(n=n*t%i);return n},l=function(t,e){for(;e%2===0;e/=2);for(;e%5===0;e/=5);if(1===e)return 0;for(var i=10%e,n=1;1!==i;n++)if(i=10*i%e,n>r)return 0;return n},h=function(t,e,i){for(var n=1,r=a(10,i,e),s=0;300>s;s++){if(n===r)return s;n=10*n%e,r=10*r%e}return 0},d=function(t,e){if(!t)return e;if(!e)return t;for(;;){if(t%=e,!t)return e;if(e%=t,!e)return t}};n.REDUCE=1,n.prototype={s:1,n:0,d:1,abs:function(){return new n(this.n,this.d)},neg:function(){return new n(-this.s*this.n,this.d)},add:function(t,e){return o(t,e),new n(this.s*this.n*s.d+s.s*this.d*s.n,this.d*s.d)},sub:function(t,e){return o(t,e),new n(this.s*this.n*s.d-s.s*this.d*s.n,this.d*s.d)},mul:function(t,e){return o(t,e),new n(this.s*s.s*this.n*s.n,this.d*s.d)},div:function(t,e){return o(t,e),new n(this.s*s.s*this.n*s.d,this.d*s.n)},clone:function(){return new n(this)},mod:function(t,e){return isNaN(this.n)||isNaN(this.d)?new n(NaN):void 0===t?new n(this.s*this.n%this.d,1):(o(t,e),0===s.n&&0===this.d&&n(0,0),new n(this.s*s.d*this.n%(s.n*this.d),s.d*this.d))},gcd:function(t,e){return o(t,e),new n(d(s.n,this.n),s.d*this.d/d(s.d,this.d))},lcm:function(t,e){return o(t,e),0===s.n&&0===this.n?new n:new n(s.n*this.n/d(s.n,this.n),d(s.d,this.d))},ceil:function(t){return t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d)?new n(NaN):new n(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 n(NaN):new n(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 n(NaN):new n(Math.round(t*this.s*this.n/this.d),t)},inverse:function(){return new n(this.s*this.d,this.n)},pow:function(t){return 0>t?new n(Math.pow(this.s*this.d,-t),Math.pow(this.n,-t)):new n(Math.pow(this.s*this.n,t),Math.pow(this.d,t))},equals:function(t,e){return o(t,e),this.s*this.n*s.d===s.s*s.n*this.d},compare:function(t,e){o(t,e);var i=this.s*this.n*s.d-s.s*s.n*this.d;return(i>0)-(0>i)},divisible:function(t,e){return o(t,e),!(!(s.n*this.d)||this.n*s.d%(s.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(t){var e,i="",n=this.n,r=this.d;return this.s<0&&(i+="-"),1===r?i+=n:(t&&(e=Math.floor(n/r))>0&&(i+=e,i+=" ",n%=r),i+=n,i+="/",i+=r),i},toLatex:function(t){var e,i="",n=this.n,r=this.d;return this.s<0&&(i+="-"),1===r?i+=n:(t&&(e=Math.floor(n/r))>0&&(i+=e,n%=r),i+="\\frac{",i+=n,i+="}{",i+=r,i+="}"),i},toContinued:function(){var t,e=this.n,i=this.d,n=[];do n.push(Math.floor(e/i)),t=e%i,e=i,i=t;while(1!==e);return n},toString:function(){var t,e=this.n,i=this.d;if(isNaN(e)||isNaN(i))return"NaN";n.REDUCE||(t=d(e,i),e/=t,i/=t);for(var r=String(e).split(""),s=0,o=[~this.s?"":"-","",""],a="",p=l(e,i),c=h(e,i,p),u=-1,y=1,f=15+p+c+r.length,g=0;f>g;g++,s*=10){if(g<r.length?s+=Number(r[g]):(y=2,u++),p>0)if(u===c)o[y]+=a+"(",a="";else if(u===p+c){o[y]+=a+")";break}s>=i?(o[y]+=a+(s/i|0),a="",s%=i):y>1?a+="0":o[y]&&(o[y]+="0")}return o[0]+=o[1]||"0",o[2]?o[0]+"."+o[2]:o[0]}},t.Fraction=n}(this),N2Require("FormElementLayerPicker",["FormElement"],[],function(t,e,i){function n(i){this.status=0,this.element=t("#"+i),this.$container=t(".n2-ss-parent-picker"),this.overlays=null,this.aligns=this.element.parent().parent().siblings(),this.picker=this.element.siblings(".n2-ss-layer-picker").on({click:t.proxy(function(){this.change("")},this)}),e.FormElement.prototype.constructor.apply(this,arguments)}var r={INITIALIZED:0,PICK_PARENT:1,PICK_CHILD:2,PICK_PARENT_ALIGN:3,PICK_CHILD_ALIGN:4},s='<div class="n2-ss-picker-overlay-tile" data-align="left" data-valign="top" /><div class="n2-ss-picker-overlay-tile" data-align="center" data-valign="top" style="left:33%;top:0;" /><div class="n2-ss-picker-overlay-tile" data-align="right" data-valign="top" style="left:66%;top:0;width:34%;" /><div class="n2-ss-picker-overlay-tile" data-align="left" data-valign="middle" style="left:0;top:33%;" /><div class="n2-ss-picker-overlay-tile" data-align="center" data-valign="middle" style="left:33%;top:33%; " /><div class="n2-ss-picker-overlay-tile" data-align="right" data-valign="middle" style="left:66%;top:33%;width:34%;" /><div class="n2-ss-picker-overlay-tile" data-align="left" data-valign="bottom" style="left:0;top:66%;height:34%;" /><div class="n2-ss-picker-overlay-tile" data-align="center" data-valign="bottom" style="left:33%;top:66%;height:34%;" /><div class="n2-ss-picker-overlay-tile" data-align="right" data-valign="bottom" style="left:66%;top:66%;width:34%;height:34%;" />';return n.prototype=Object.create(e.FormElement.prototype),n.prototype.constructor=n,n.prototype.click=function(e){return t("#n2-admin").hasClass("n2-ss-mode-desktopPortrait")?void(this.status==r.INITIALIZED?(this.data={parent:null,parentVAlign:null,parentHAlign:null,child:null,childVAlign:null,childHAlign:null},t("body").on("mousedown.n2-ss-parent-linker",t.proxy(function(e){var i=t(e.target);i.hasClass("n2-ss-picker-overlay")||i.hasClass("n2-ss-picker-overlay-tile")||this.destroy()},this)),NextendEsc.add(t.proxy(function(){return this.destroy(),!1},this)),this.pickParent(e)):(this.data=null,this.change(""),this.destroy())):void nextend.notificationCenter.notice(n2_("To chain layers together, please switch to desktop portrait mode!"))},n.prototype.getAbsoluteLayers=function(t){for(var e=[],i=t.getSortedLayers(),n=0;n<i.length;n++)switch(i[n].placement.getType()){case"absolute":e.push(i[n].layer[0]);break;case"group":e.push.apply(e,this.getAbsoluteLayers(i[n].container))}return e},n.prototype.pickParent=function(e){var i=nextend.smartSlider.canvasManager,n=t(this.getAbsoluteLayers(i.mainContainer.container));if(this.tempLayers=n,0==n.length)this.destroy();else{this.status=r.PICK_PARENT,nextend.tooltipMouse.show(n2_("Pick the parent layer!"),e);t('<div class="n2-ss-picker-overlay"></div>').appendTo(n).on("click",t.proxy(function(e){e.preventDefault(),e.stopPropagation();var i=t(e.currentTarget).parent();i.data("layerObject");this.data.parent=i,this._destroy(),this.pickParentAlign(e)},this))}},n.prototype.pickParentAlign=function(e){this.status=r.PICK_PARENT_ALIGN,nextend.tooltipMouse.show(n2_("Pick the align point of the parent layer!"),e);
var i=t(s).appendTo(this.data.parent).on("click",t.proxy(function(e){e.preventDefault(),e.stopPropagation(),nextend.context.preventDblClick();var n=t(e.currentTarget);this.data.parentHAlign=n.data("align"),this.data.parentVAlign=n.data("valign"),n.off("click").addClass("n2-active"),i.not(n).remove(),this.pickChild(e)},this))},n.prototype.pickChild=function(e){this.status=r.PICK_CHILD,nextend.tooltipMouse.show(n2_("Pick the child layer!"),e);var i=this.tempLayers.not(this.data.parent);delete this.tempLayers;var n=function(e){var r=e.data("layerObject").getProperty("parentid");r&&""!=r&&n(t("#"+r)),i=i.not(e)};if(n(this.data.parent),!i.length)return nextend.notificationCenter.error(n2_("There is not any layer available to be child of the selected layer!")),void this.destroy();var s=t('<div class="n2-ss-picker-overlay"></div>').appendTo(i).on("click",t.proxy(function(e){e.preventDefault(),e.stopPropagation();var i=t(e.currentTarget).parent();i.data("layerObject");this.data.child=i,s.remove(),this.pickChildAlign(e)},this))},n.prototype.pickChildAlign=function(e){this.status=r.PICK_CHILD_ALIGN,nextend.tooltipMouse.show(n2_("Pick the align point of the child layer!"),e);t(s).appendTo(this.data.child).on("click",t.proxy(function(e){e.preventDefault(),e.stopPropagation(),nextend.context.preventDblClick();var i=t(e.currentTarget);this.data.childHAlign=i.data("align"),this.data.childVAlign=i.data("valign"),this.done()},this))},n.prototype._destroy=function(){t(".n2-ss-picker-overlay").remove(),t(".n2-ss-picker-overlay-tile").remove()},n.prototype.destroy=function(){nextend.tooltipMouse.hide(),this._destroy(),t("body").off(".n2-ss-parent-linker"),NextendEsc.pop(),this.status=r.INITIALIZED},n.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()},n.prototype.change=function(t){this.element.val(t).trigger("change"),this._setValue(t),this.triggerOutsideChange()},n.prototype.insideChange=function(t){this.element.val(t),this._setValue(t),this.triggerInsideChange()},n.prototype._setValue=function(t){t&&""!=t?this.$container.css("display",""):this.$container.css("display","none")},n}),N2Require("FormElementParticleManager",["FormElement"],[],function(t,e,i){function n(i){this.element=t("#"+i),this.element.parent().on("click",t.proxy(this.show,this)),this.element.siblings(".n2-form-element-clear").on("click",t.proxy(this.clear,this)),this.name=this.element.siblings("input"),this.updateName(this.element.val()),e.FormElement.prototype.constructor.apply(this,arguments),this.form=t("#smartslider-form"),this.formAction=this.form.attr("action"),this.onMessage=t.proxy(function(t){if(t.source==this.iframeWindow)try{var e=JSON.parse(t.data);switch(e.action){case"ready":this.iframeReadyDeferred.resolve();break;case"save":this.val(e.data),this.removeLightbox();break;default:this.removeLightbox()}}catch(i){console.error(i),this.removeLightbox()}},this)}return n.prototype=Object.create(e.FormElement.prototype),n.prototype.constructor=n,n.prototype.show=function(e){e.preventDefault(),NextendAjaxHelper.startLoading(),this.iframeReadyDeferred=t.Deferred(),this.$lightbox=t('<div class="n2 n2-lightbox-container"></div>').css({display:"block"}).appendTo("body");var i=t('<div class="n2-lightbox n2-border-radius"></div>').appendTo(this.$lightbox),n=t('<iframe name="n2-ss-particleframe" style="width:100%;height:100%;"/>').appendTo(i);this.form.attr({action:NextendAjaxHelper.makeFallbackUrl(window.location.href,{nextendaction:"particle"}),target:"n2-ss-particleframe"}).submit().attr({action:this.formAction,target:null}),this.iframeWindow=n[0].contentWindow||n[0].contentDocument,window.addEventListener("message",this.onMessage,!1),this.iframeReadyDeferred.done(t.proxy(function(){this.iframeWindow.postMessage(JSON.stringify({action:"load",data:this.element.val()}),"*"),NextendAjaxHelper.stopLoading()},this))},n.prototype.removeLightbox=function(){this.$lightbox.remove(),this.$lightbox=null,window.removeEventListener("message",this.onMessage,!1)},n.prototype.clear=function(t){t.preventDefault(),t.stopPropagation();var e=this.element.val().split("|*|");e[2]="",this.val(e.join("|*|"))},n.prototype.save=function(t,e){this.val(e)},n.prototype.val=function(t){this.element.val(t),this.updateName(t),this.triggerOutsideChange()},n.prototype.insideChange=function(t){this.element.val(t),this.updateName(t),this.triggerInsideChange()},n.prototype.updateName=function(t){var e="";try{var i=JSON.parse(t);e=0==i?n2_("Disabled"):n2_("Enabled")}catch(n){e=n2_("Disabled")}this.name.val(e)},n}),N2Require("FormElementPostAnimationManager",["FormElementAnimationManager"],[],function(t,e,i){function n(){e.FormElementAnimationManager.prototype.constructor.apply(this,arguments)}return n.prototype=Object.create(e.FormElementAnimationManager.prototype),n.prototype.constructor=n,n.prototype.clear=function(t){t.preventDefault(),t.stopPropagation();var e=this.element.val().split("|*|");e[2]="",this.val(e.join("|*|"))},n.prototype.updateName=function(t){var e=t.split("|*|");t=e[2],t=""==t?n2_("Disabled"):t.split("||").length>1?n2_("Multiple animations"):n2_("Single animation"),this.name.val(t)},n}),N2Require("FormElementShapeDividerManager",["FormElement"],[],function(t,e,i){function n(i){this.element=t("#"+i),this.element.parent().on("click",t.proxy(this.show,this)),this.element.siblings(".n2-form-element-clear").on("click",t.proxy(this.clear,this)),this.name=this.element.siblings("input"),this.updateName(this.element.val()),e.FormElement.prototype.constructor.apply(this,arguments),this.form=t("#smartslider-form"),this.formAction=this.form.attr("action"),this.onMessage=t.proxy(function(t){if(t.source==this.iframeWindow)try{var e=JSON.parse(t.data);switch(e.action){case"ready":this.iframeReadyDeferred.resolve();break;case"save":this.val(e.data),this.removeLightbox();break;default:this.removeLightbox()}}catch(i){console.error(i),this.removeLightbox()}},this)}return n.prototype=Object.create(e.FormElement.prototype),n.prototype.constructor=n,n.prototype.show=function(e){e.preventDefault(),NextendAjaxHelper.startLoading(),this.iframeReadyDeferred=t.Deferred(),this.$lightbox=t('<div class="n2 n2-lightbox-container"></div>').css({display:"block"}).appendTo("body");var i=t('<div class="n2-lightbox n2-border-radius"></div>').appendTo(this.$lightbox),n=t('<iframe name="n2-ss-shapedividerframe" style="width:100%;height:100%;"/>').appendTo(i);this.form.attr({action:NextendAjaxHelper.makeFallbackUrl(window.location.href,{nextendaction:"shapedivider"}),target:"n2-ss-shapedividerframe"}).submit().attr({action:this.formAction,target:null}),this.iframeWindow=n[0].contentWindow||n[0].contentDocument,window.addEventListener("message",this.onMessage,!1),this.iframeReadyDeferred.done(t.proxy(function(){this.iframeWindow.postMessage(JSON.stringify({action:"load",data:this.element.val()}),"*"),NextendAjaxHelper.stopLoading()},this))},n.prototype.removeLightbox=function(){this.$lightbox.remove(),this.$lightbox=null,window.removeEventListener("message",this.onMessage,!1)},n.prototype.clear=function(t){t.preventDefault(),t.stopPropagation();var e=this.element.val().split("|*|");e[2]="",this.val(e.join("|*|"))},n.prototype.save=function(t,e){this.val(e)},n.prototype.val=function(t){this.element.val(t),this.updateName(t),this.triggerOutsideChange()},n.prototype.insideChange=function(t){this.element.val(t),this.updateName(t),this.triggerInsideChange()},n.prototype.updateName=function(t){var e="";try{var i=JSON.parse(t);i.top&&i.bottom?e=n2_("Top and bottom"):i.top?e=n2_("Top"):i.bottom&&(e=n2_("Bottom"))}catch(n){e=n2_("Disabled")}this.name.val(e)},n}),N2Require("FormElementSliderType",[],[],function(t,e,i){function n(e){this.element=t("#"+e),this.setAttribute(),this.element.on("nextendChange",t.proxy(this.setAttribute,this))}return n.prototype.setAttribute=function(){t("#n2-admin").attr("data-slider-type",this.element.val()),"block"==this.element.val()&&t(".n2-fm-shadow").trigger("click")},n}),N2Require("FormElementSliderWidgetArea",["FormElement"],[],function(t,e,i){function n(i){this.element=t("#"+i),this.area=t("#"+i+"_area"),this.areas=this.area.find(".n2-area"),this.areas.on("click",t.proxy(this.chooseArea,this)),e.FormElement.prototype.constructor.apply(this,arguments)}return n.prototype=Object.create(e.FormElement.prototype),n.prototype.constructor=n,n.prototype.chooseArea=function(e){var i=parseInt(t(e.target).data("area"));this.element.val(i),this.setSelected(i),this.triggerOutsideChange()},n.prototype.insideChange=function(t){t=parseInt(t),this.element.val(t),this.setSelected(t),this.triggerInsideChange()},n.prototype.setSelected=function(t){this.areas.removeClass("n2-active"),this.areas.eq(t-1).addClass("n2-active")},n}),N2Require("FormElementSplitTextAnimationManager",["FormElement"],[],function(t,e,i){function n(i,n){this.element=t("#"+i),this.parameters=n,this.element.parent().on("click",t.proxy(this.show,this)),this.element.siblings(".n2-form-element-clear").on("click",t.proxy(this.clear,this)),this.name=this.element.siblings("input"),this.updateName(this.element.val()),e.FormElement.prototype.constructor.apply(this,arguments)}return n.prototype=Object.create(e.FormElement.prototype),n.prototype.constructor=n,n.prototype.show=function(e){e.preventDefault(),this.parameters.font&&nextend.splittextanimationManager.setConnectedFont(this.parameters.font),this.parameters.style&&nextend.splittextanimationManager.setConnectedStyle(this.parameters.style),nextend.splittextanimationManager.show(this.element.val(),t.proxy(this.save,this),{previewMode:"0",previewHTML:this.parameters.preview,group:this.parameters.group,transformOrigin:t("#"+this.parameters.transformOrigin)})},n.prototype.clear=function(t){t.preventDefault(),t.stopPropagation(),this.val("")},n.prototype.save=function(t,e){this.val(e)},n.prototype.val=function(t){this.element.val(t),this.updateName(t),this.triggerOutsideChange()},n.prototype.insideChange=function(t){this.element.val(t),this.updateName(t),this.triggerInsideChange()},n.prototype.updateName=function(e){t.when(nextend.splittextanimationManager.getVisual(e)).done(t.proxy(function(t){this.name.val(t.name)},this))},n}),N2Require("FormElementWidgetPosition",[],[],function(t,e,i){function n(e){this.element=t("#"+e+"-mode"),this.container=this.element.closest(".n2-form-element-mixed"),this.tabs=this.container.find("> .n2-mixed-group"),this.element.on("nextendChange",t.proxy(this.onChange,this)),this.onChange()}return n.prototype.onChange=function(){var t=this.element.val();"advanced"==t?(this.tabs.eq(2).css("display",""),this.tabs.eq(1).css("display","none")):(this.tabs.eq(1).css("display",""),this.tabs.eq(2).css("display","none"))},n}),N2Require("SmartSliderGeneratorRecords",[],[],function(t,e,i){function n(e){this.ajaxUrl=e,t("#generatorrecord-viewer").on("click",t.proxy(this.showRecords,this))}return n.prototype.showRecords=function(e){e.preventDefault(),NextendAjaxHelper.ajax({type:"POST",url:this.ajaxUrl,data:t("#smartslider-form").serialize(),dataType:"json"}).done(function(t){var e=new NextendModal({zero:{size:[1300,700],title:"Records",content:t.data.html}},!0);e.content.css("overflow","auto")}).error(function(t){if(200==t.status){var e=new NextendModal({zero:{size:[1300,700],title:"Response",content:t.responseText}},!0);e.content.css("overflow","auto")}})},n}),N2Require("FormElement500pxToken",[],[],function(t,e,i){function n(e,i,n){this.element=t("#"+e),this.button=t("#"+e+"_button").on("click",t.proxy(this.requestToken,this)),this.url=i,t("#generatorcallback").html(n)}return n.prototype.requestToken=function(e){e.preventDefault(),NextendAjaxHelper.ajax({url:this.url,data:t("#smartslider-form").serialize()}).done(function(t){var e=1e3,i=600,n=(screen.width-e)/2,r=(screen.height-i)/2;window.open(t.data.authUrl,"500px authentication","width=1000,height=600,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left="+n+",top="+r)})},n}),N2Require("FormElementDribbbleProjects",[],[],function(t,e,i){function n(e,i){this.element=t("#"+e),this.select=this.element.parent().find("select"),this.relatedField=t("#generatordribbble-user-id").on("nextendChange",t.proxy(this.refreshList,this)),this.url=i}return n.prototype.refreshList=function(e){NextendAjaxHelper.ajax({url:this.url,data:{method:"getProjects",userID:this.relatedField.val()}}).done(t.proxy(function(t){if(0!=t.data.length){this.select.find("option").remove();for(var e in t.data)this.select.append('<option value="'+e+'">'+t.data[e]+"</option>");this.select.val(this.select.find("option:first").val()).trigger("change")}},this))},n}),N2Require("FormElementDribbbleToken",[],[],function(t,e,i){function n(e,i,n){this.element=t("#"+e),this.button=t("#"+e+"_button").on("click",t.proxy(this.requestToken,this)),this.url=i,t("#generatorcallback").html(n)}return n.prototype.requestToken=function(e){e.preventDefault(),NextendAjaxHelper.ajax({url:this.url,data:t("#smartslider-form").serialize()}).done(function(t){var e=1e3,i=600,n=(screen.width-e)/2,r=(screen.height-i)/2;window.open(t.data.authUrl,"YouTube authentication","width=1000,height=600,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left="+n+",top="+r)})},n}),N2Require("FormElementFacebookAlbums",[],[],function(t,e,i){function n(e,i){this.element=t("#"+e),this.select=this.element.parent().find("select"),this.relatedField=t("#generatorfacebook-id").on("nextendChange",t.proxy(this.refreshList,this)),this.url=i}return n.prototype.refreshList=function(e){NextendAjaxHelper.ajax({url:this.url,data:{method:"getAlbums",facebookID:this.relatedField.val()}}).done(t.proxy(function(t){this.select.find("option").remove();for(var e in t.data)this.select.append('<option value="'+e+'">'+t.data[e]+"</option>");this.select.val(this.select.find("option:first").val()).trigger("change")},this))},n}),N2Require("FormElementFacebookToken",[],[],function(t,e,i){function n(e,i){this.element=t("#"+e),this.button=t("#"+e+"_button").on("click",t.proxy(this.requestToken,this)),this.url=i,t("#generatorcallback").html(location.protocol+"//"+location.hostname+(location.port?":"+location.port:""))}return n.prototype.requestToken=function(e){e.preventDefault(),NextendAjaxHelper.ajax({url:this.url,data:t("#smartslider-form").serialize()}).done(function(t){var e=580,i=400,n=(screen.width-e)/2,r=(screen.height-i)/2;window.open(t.data.authUrl,"Facebook authentication","width=580,height=400,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left="+n+",top="+r)})},n}),N2Require("FormElementFlickrToken",[],[],function(t,e,i){function n(e,i,n){this.element=t("#"+e),this.button=t("#"+e+"_button").on("click",t.proxy(this.requestToken,this)),this.url=i,t("#generatorcallback").html(n)}return n.prototype.requestToken=function(e){e.preventDefault(),NextendAjaxHelper.ajax({url:this.url,data:t("#smartslider-form").serialize()}).done(function(t){var e=1200,i=1e3,n=(screen.width-e)/2,r=(screen.height-i)/2;window.open(t.data.authUrl,"Flickr authentication","width="+e+",height="+i+",toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left="+n+",top="+r)})},n}),N2Require("FormElementInstagramToken",[],[],function(t,e,i){function n(e,i,n){this.element=t("#"+e),this.button=t("#"+e+"_button").on("click",t.proxy(this.requestToken,this)),this.url=i,t("#generatorcallback").html(n)}return n.prototype.requestToken=function(e){e.preventDefault(),NextendAjaxHelper.ajax({url:this.url,data:t("#smartslider-form").serialize()}).done(function(t){var e=580,i=400,n=(screen.width-e)/2,r=(screen.height-i)/2;window.open(t.data.authUrl,"Instagram authentication","width=580,height=400,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left="+n+",top="+r)})},n}),N2Require("FormElementPicasaToken",[],[],function(t,e,i){function n(e,i,n){this.element=t("#"+e),this.button=t("#"+e+"_button").on("click",t.proxy(this.requestToken,this)),this.url=i,t("#generatorcallback").html(n)}return n.prototype.requestToken=function(e){e.preventDefault(),NextendAjaxHelper.ajax({url:this.url,data:t("#smartslider-form").serialize()}).done(function(t){var e=1e3,i=600,n=(screen.width-e)/2,r=(screen.height-i)/2;window.open(t.data.authUrl,"Picasa authentication","width=1000,height=600,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left="+n+",top="+r)})},n}),N2Require("FormElementTwitterToken",[],[],function(t,e,i){function n(e,i,n){this.element=t("#"+e),this.button=t("#"+e+"_button").on("click",t.proxy(this.requestToken,this)),this.url=i,t("#generatorcallback").html(n)}return n.prototype.requestToken=function(e){e.preventDefault(),NextendAjaxHelper.ajax({url:this.url,data:t("#smartslider-form").serialize()}).done(function(t){var e=1e3,i=600,n=(screen.width-e)/2,r=(screen.height-i)/2;window.open(t.data.authUrl,"Twitter authentication","width=1000,height=600,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left="+n+",top="+r)})},n}),N2Require("FormElementVimeoToken",[],[],function(t,e,i){function n(e,i,n){this.element=t("#"+e),this.button=t("#"+e+"_button").on("click",t.proxy(this.requestToken,this)),this.url=i,t("#generatorcallback").html(n)}return n.prototype.requestToken=function(e){e.preventDefault(),NextendAjaxHelper.ajax({url:this.url,data:t("#smartslider-form").serialize()}).done(function(t){var e=1e3,i=600,n=(screen.width-e)/2,r=(screen.height-i)/2;window.open(t.data.authUrl,"Vimeo authentication","width=1000,height=600,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left="+n+",top="+r)})},n}),N2Require("FormElementYouTubePlaylists",[],[],function(t,e,i){function n(e,i){this.element=t("#"+e),this.select=this.element.parent().find("select"),this.relatedField=t("#generatorchannel-id").on("nextendChange",t.proxy(this.refreshList,this)),this.url=i}return n.prototype.refreshList=function(e){NextendAjaxHelper.ajax({url:this.url,data:{method:"getPlayListsAjax",channelID:this.relatedField.val()}}).done(t.proxy(function(t){this.select.find("option").remove();for(var e in t.data)this.select.append('<option value="'+e+'">'+t.data[e]+"</option>");this.select.val(this.select.find("option:first").val()).trigger("change")},this))},n}),N2Require("FormElementYoutubeToken",[],[],function(t,e,i){function n(e,i,n){this.element=t("#"+e),this.button=t("#"+e+"_button").on("click",t.proxy(this.requestToken,this)),this.url=i,t("#generatorcallback").html(n)}return n.prototype.requestToken=function(e){e.preventDefault(),NextendAjaxHelper.ajax({url:this.url,data:t("#smartslider-form").serialize()}).done(function(t){var e=1e3,i=600,n=(screen.width-e)/2,r=(screen.height-i)/2;window.open(t.data.authUrl,"YouTube authentication","width=1000,height=600,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left="+n+",top="+r)})},n}),N2Require("QuickSlides",[],[],function(t,e,i){function n(e){var i=t("#n2-quick-slides-edit");i.length<1||(this.ajaxUrl=e,i.on("click",t.proxy(this.openEdit,this)))}return n.prototype.openEdit=function(e){e.preventDefault();var i=t("#n2-ss-slides .n2-box-slide"),n=this;this.modal=new NextendModal({zero:{fit:!0,fitX:!1,overflow:"auto",size:[1200,700],title:n2_("Quick Edit - Slides"),back:!1,close:!0,content:'<form class="n2-form"><table></table></form>',controls:['<a href="#" class="n2-button n2-button-normal n2-button-l n2-radius-s n2-button-green n2-uc n2-h4">'+n2_("Save")+"</a>"],fn:{show:function(){var e=this.controls.find(".n2-button-green"),r=this.content.find(".n2-form").on("submit",function(t){t.preventDefault(),e.trigger("click")}),s=r.find("table");i.each(t.proxy(function(e,i){var r=t(i),o=t("<tr />").appendTo(s),a=r.data("slideid");o.append(t("<td />").append('<img src="'+r.data("image")+'" style="width:100px;"/>')),o.append(t("<td />").append(n.createInput("Name","title-"+a,r.data("title"),"width: 240px;"))),o.append(t("<td />").append(n.createTextarea("Description","description-"+a,r.data("description"),"width: 330px;height:24px;")));var l=r.data("link").split("|*|");o.append(t("<td />").append(n.createLink("Link","link-"+a,l[0],"width: 180px;"))),o.append(t("<td />").append(n.createTarget("Target","target-"+a,l.length>1?l[1]:"_self",""))),new N2Classes.FormElementUrl("link-"+a,nextend.NextendElementUrlParams)},this)),e.on("click",t.proxy(function(e){var r={};i.each(t.proxy(function(e,i){var n=t(i),s=n.data("slideid"),o=t("#title-"+s).val(),a=t("#description-"+s).val(),l=t("#link-"+s).val()+"|*|"+t("#target-"+s).val();o==n.data("title")&&a==n.data("description")&&l==n.data("link")||(r[s]={name:o,description:a,link:l})},this)),jQuery.isEmptyObject(r)?this.hide(e):(this.hide(e),NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(n.ajaxUrl),data:{changed:Base64.encode(JSON.stringify(r))},dataType:"json"}).done(t.proxy(function(e){var i=e.data;for(var n in i){var r=t('.n2-box-slide[data-slideid="'+n+'"]');r.find(".n2-box-placeholder a.n2-h4").html(i[n].title),r.attr("data-title",i[n].rawTitle),r.data("title",i[n].rawTitle),r.attr("data-description",i[n].rawDescription),r.data("description",i[n].rawDescription),r.attr("data-link",i[n].rawLink),r.data("link",i[n].rawLink)}},this)))},this))}}}}),this.modal.setCustomClass("n2-ss-quick-slides-edit-modal"),this.modal.show()},n.prototype.createInput=function(e,i,n){var r="";4==arguments.length&&(r=arguments[3]);var s=t('<div class="n2-form-element-mixed"><div class="n2-mixed-group"><div class="n2-mixed-label"><label for="'+i+'">'+e+'</label></div><div class="n2-mixed-element"><div class="n2-form-element-text n2-border-radius"><input type="text" id="'+i+'" class="n2-h5" autocomplete="off" style="'+r+'"></div></div></div></div>');return s.find("input").val(n),s},n.prototype.createTextarea=function(e,i,n){var r="";4==arguments.length&&(r=arguments[3]);var s=t('<div class="n2-form-element-mixed"><div class="n2-mixed-group"><div class="n2-mixed-label"><label for="'+i+'">'+e+'</label></div><div class="n2-mixed-element"><div class="n2-form-element-textarea n2-border-radius"><textarea id="'+i+'" class="n2-h5" autocomplete="off" style="resize:y;'+r+'"></textarea></div></div></div></div>');return s.find("textarea").val(n),s},n.prototype.createLink=function(e,i,n){var r="";4==arguments.length&&(r=arguments[3]);var s=t('<div class="n2-form-element-mixed"><div class="n2-mixed-group"><div class="n2-mixed-label"><label for="'+i+'">'+e+'</label></div><div class="n2-mixed-element"><div class="n2-form-element-text n2-border-radius"><input type="text" id="'+i+'" class="n2-h5" autocomplete="off" style="'+r+'"><a href="#" class="n2-form-element-clear"><i class="n2-i n2-it n2-i-empty n2-i-grey-opacity"></i></a><a id="'+i+'_button" class="n2-form-element-button n2-h5 n2-uc" href="#">Link</a></div></div></div></div>');return s.find("input").val(n),s},n.prototype.createTarget=function(e,i,n){var r="";4==arguments.length&&(r=arguments[3]);var s=t('<div class="n2-form-element-mixed"><div class="n2-mixed-group"><div class="n2-mixed-label"><label for="'+i+'">'+e+'</label></div><div class="n2-mixed-element"><div class="n2-form-element-list"><select id="'+i+'" autocomplete="off" style="'+r+'"><option value="_self">Self</option><option value="_blank">Blank</option></select</div></div></div></div>');return s.find("select").val(n),s},n}),N2Require("Slide",[],[],function(t,e,i){function n(e,i){this.selected=!1,this.manager=e,this.box=i.data("slide",this).addClass("n2-clickable"),this.box.on("mouseenter",t.proxy(function(){this.manager.showMenu(this)},this)).on("mouseleave",t.proxy(function(){this.manager.hideMenu()},this)).on("click.n2-slide",t.proxy(this.goToEdit,this)),this.publishElement=this.box.find(".n2-slide-published").on("click",t.proxy(this.switchPublished,this)),this.box.find(".n2-ss-box-select").on("click",t.proxy(function(t){t.stopPropagation(),t.preventDefault(),this.invertSelection()},this))}return n.prototype.getId=function(){return this.box.data("slideid")},n.prototype.setFirst=function(e){e.stopPropagation(),e.preventDefault(),NextendAjaxHelper.ajax({url:NextendAjaxHelper.makeAjaxUrl(this.manager.ajaxUrl,{nextendaction:"first"}),type:"POST",data:{id:this.getId()}}).done(t.proxy(function(){this.manager.unsetFirst(),this.box.addClass("n2-slide-state-first")},this))},n.prototype.unsetFirst=function(){this.box.removeClass("n2-slide-state-first")},n.prototype.switchPublished=function(t){t.stopPropagation(),t.preventDefault(),this.isPublished()?this.manager.unPublishSlides([this.getId()],[this]):this.manager.publishSlides([this.getId()],[this])},n.prototype.isPublished=function(){return this.box.hasClass("n2-slide-state-published")},n.prototype.published=function(){this.box.addClass("n2-slide-state-published")},n.prototype.unPublished=function(){this.box.removeClass("n2-slide-state-published")},n.prototype.goToEdit=function(t,e){if(this.manager.isBulkSelection)this.invertSelection(),t.preventDefault();else{var i=this.box.data("editurl");"undefined"!=typeof e&&e?window.open(i,"_blank"):i==location.href?n2("#n2-admin").toggleClass("n2-ss-slides-outer-container-visible"):window.location=i}},n.prototype.duplicate=function(e){e.stopPropagation(),e.preventDefault();var i=t.Deferred();return NextendAjaxHelper.ajax({url:NextendAjaxHelper.makeAjaxUrl(this.box.data("editurl"),{nextendaction:"duplicate"})}).done(t.proxy(function(e){var r=t(e.data).insertAfter(this.box),s=new n(this.manager,r);this.manager.initSlides(),i.resolve(s)},this)),i},n.prototype["delete"]=function(t){t.stopPropagation(),t.preventDefault(),this.manager.deleteSlides([this.getId()],[this])},n.prototype.deleted=function(){this.box.remove()},n.prototype.invertSelection=function(t){t&&t.preventDefault(),this.selected?this.deSelect():this.select()},n.prototype.select=function(){this.selected||(this.selected=!0,this.box.addClass("n2-selected"),this.manager.addSelection(this))},n.prototype.deSelect=function(){this.selected&&(this.selected=!1,this.box.removeClass("n2-selected"),this.manager.removeSelection(this))},n.prototype.publish=function(t){this.switchPublished(t)},n.prototype.unpublish=function(t){this.switchPublished(t)},n.prototype.generator=function(t){window.location=this.box.data("generator")},n.prototype.copy=function(e){this.manager.showSliderSelector(n2_("Copy slide to ..."),t.proxy(function(t){NextendAjaxHelper.ajax({url:NextendAjaxHelper.makeAjaxUrl(this.box.data("editurl"),{nextendaction:"copy",targetSliderID:t})})},this))},n}),N2Require("SlidesManager",[],[],function(t,e,i){function n(i,n,r,s,o,a){this.quickPostModal=null,this.quickVideoModal=null,this.parameters=r,this.slides=[],this.ajaxUrl=i,this.contentAjaxUrl=n,this.slidesPanel=t("#n2-ss-slides-container"),this.slidesContainer=this.slidesPanel.find(".n2-ss-slides-container"),this.initMenu(),this.initSlidesOrderable();for(var l=this.slidesContainer.find(".n2-box-slide"),h=0;h<l.length;h++)this.slides.push(new e.Slide(this,l.eq(h)));if(t("html").attr("data-slides",this.slides.length),t(".n2-add-quick-image, .n2-box-slide-dummy").on("click",t.proxy(this.addQuickImage,this)),t(".n2-add-quick-video").on("click",t.proxy(this.addQuickVideo,this)),t(".n2-add-quick-post").on("click",t.proxy(this.addQuickPost,this)),t(".n2-box-add-sample-slide a").on("click",t.proxy(function(e){e.preventDefault(),nextend.smartSlider.license.isActiveAsync().done(t.proxy(function(){window.location.href=t(e.target).attr("href")},this))},this)),this.initBulk(),!s){var d=[];this.slidesContainer.fileupload({url:o,pasteZone:!1,dataType:"json",paramName:"image",dropZone:t("undefined"==typeof nextend.smartSlider?document:".n2-ss-slides-outer-container"),add:t.proxy(function(t,e){e.formData={path:"/"+a},e.submit()},this),done:t.proxy(function(t,e){var i=e.result;i.data&&i.data.name?d.push({title:i.data.name,description:"",image:i.data.url}):NextendAjaxHelper.notification(i)},this),fail:t.proxy(function(t,e){NextendAjaxHelper.notification(e.jqXHR.responseJSON)},this),start:function(){NextendAjaxHelper.startLoading()},stop:t.proxy(function(){d.length?this._addQuickImages(d):setTimeout(function(){NextendAjaxHelper.stopLoading()},100),d=[]},this)});var p=null;this.slidesContainer.on("dragover",t.proxy(function(e){null!==p?(clearTimeout(p),p=null):this.slidesContainer.addClass("n2-drag-over"),p=setTimeout(t.proxy(function(){this.slidesContainer.removeClass("n2-drag-over"),p=null},this),400)},this))}}return n.prototype.changed=function(){},n.prototype.initSlidesOrderable=function(){this.slidesContainer.sortable({helper:"clone",forcePlaceholderSize:!1,tolerance:"pointer",items:".n2-box-slide",start:function(t,e){e.item.show()},stop:t.proxy(this.saveSlideOrder,this),placeholder:"n2-box-sortable-placeholder n2-box-sortable-placeholder-small",distance:10})},n.prototype.saveSlideOrder=function(e){for(var i=this.slidesContainer.find(".n2-box-slide"),n=[],r=[],s=[],o=0;o<i.length;o++){var a=i.eq(o).data("slide");n.push(a),r.push(a.getId())}for(var o=0;o<this.slides.length;o++)s.push(this.slides[o].getId());if(JSON.stringify(s)!=JSON.stringify(r)){t(window).triggerHandler("SmartSliderSidebarSlidesOrderChanged");var l={nextendcontroller:"slides",nextendaction:"order"};NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(this.ajaxUrl,l),data:{slideorder:r}}),this.slides=n,this.changed()}},n.prototype.initSlides=function(){for(var e=(this.slides.length,this.slidesContainer.find(".n2-box-slide")),i=[],n=0;n<e.length;n++){var r=e.eq(n).data("slide");i.push(r)}this.slides=i,this.changed(),t(window).triggerHandler("SmartSliderSidebarSlidesChanged"),t("html").attr("data-slides",this.slides.length)},n.prototype.unsetFirst=function(){for(var t=0;t<this.slides.length;t++)this.slides[t].unsetFirst();this.changed()},n.prototype.addQuickImage=function(e){e.preventDefault(),nextend.imageHelper.openMultipleLightbox(t.proxy(this._addQuickImages,this))},n.prototype.addBoxes=function(i){i.insertBefore(this.slidesContainer.find(".n2-clear")),i.addClass("n2-ss-box-just-added").each(t.proxy(function(i,n){new e.Slide(this,t(n))},this)),this.initSlides(),setTimeout(function(){i.removeClass("n2-ss-box-just-added")},200)},n.prototype._addQuickImages=function(e){NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"quickImages"}),data:{images:Base64.encode(JSON.stringify(e))}}).done(t.proxy(function(e){this.addBoxes(t(e.data))},this))},n.prototype.addQuickVideo=function(e){e.preventDefault();var i=this;this.quickVideoModal||(this.quickVideoModal=new NextendModal({zero:{size:[500,350],title:n2_("Add video"),back:!1,close:!0,content:'<form class="n2-form"></form>',controls:['<a href="#" class="n2-button n2-button-normal n2-button-l n2-radius-s n2-button-green n2-uc n2-h4">'+n2_("Add video")+"</a>"],fn:{show:function(){var e=this.controls.find(".n2-button"),n=(this.content.find(".n2-form").on("submit",function(t){t.preventDefault(),e.trigger("click")}).append(this.createInput(n2_("Video url"),"n2-slide-video-url","width: 446px;")),this.content.find("#n2-slide-video-url").focus());this.content.append(this.createHeading(n2_("Examples"))),this.content.append(this.createTable([["YouTube","https://www.youtube.com/watch?v=lsq09izc1H4"],["Vimeo","https://vimeo.com/144598279"]],["",""])),e.on("click",t.proxy(t.proxy(function(e){e.preventDefault();var r=n.val(),s=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/,o=r.match(s),a=/https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/,l=r.match(a),h=r.match(/\.(mp4)/i);o?NextendAjaxHelper.getJSON("https://www.googleapis.com/youtube/v3/videos?id="+encodeURI(o[2])+"&part=snippet&key=AIzaSyC3AolfvPAPlJs-2FgyPJdEEKS6nbPHdSM").done(t.proxy(function(t){if(t.items.length){var e=t.items[0].snippet,n=t.items[0].snippet.thumbnails,s=n.maxres||n.standard||n.high||n.medium||n["default"];i._addQuickVideo(this,{type:"youtube",title:e.title,description:e.description,image:s.url,
video:r})}},this)).fail(function(t){nextend.notificationCenter.error(t.error.errors[0].message)}):l?NextendAjaxHelper.getJSON("https://vimeo.com/api/v2/video/"+l[3]+".json").done(t.proxy(function(t){i._addQuickVideo(this,{type:"vimeo",title:t[0].title,description:t[0].description,video:l[3],image:t[0].thumbnail_large})},this)).fail(function(t){nextend.notificationCenter.error(t.responseText)}):h?i._addQuickVideo(this,{type:"video",title:r,description:"",format:h[1],video:r,image:""}):nextend.notificationCenter.error("This video url is not supported!")},this)))}}}})),this.quickVideoModal.show()},n.prototype._addQuickVideo=function(e,i){NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"quickVideo"}),data:{video:Base64.encode(encodeURIComponent(JSON.stringify(i)))}}).done(t.proxy(function(e){this.addBoxes(t(e.data)),this.initSlides()},this)),e.hide()},n.prototype.addQuickPost=function(e){if(e.preventDefault(),!this.quickPostModal){var i=this,n={},r=t.proxy(function(t){return"undefined"==typeof n[t]&&(n[t]=NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(this.contentAjaxUrl),data:{keyword:t},dataType:"json"})),n[t]},this);this.quickPostModal=new NextendModal({zero:{size:[600,430],title:n2_("Add post"),back:!1,close:!0,content:'<div class="n2-form"></div>',fn:{show:function(){this.content.find(".n2-form").append(this.createInput(n2_("Keyword"),"n2-ss-keyword","width:546px;"));var e=t("#n2-ss-keyword"),n=this.createHeading("").appendTo(this.content),s=this.createResult().appendTo(this.content),o="";e.on("keyup",t.proxy(function(){o=e.val(),r(o).done(t.proxy(function(r){if(e.val()==o){""==o?n.html(n2_("No search term specified. Showing recent items.")):n.html(n2_printf(n2_('Showing items match for "%s"'),o));for(var a=r.data,l=[],h=this,d=0;d<a.length;d++)l.push([a[d].title,a[d].info,t('<div class="n2-button n2-button-normal n2-button-xs n2-button-green n2-radius-s n2-uc n2-h5">'+n2_("Select")+"</div>").on("click",{post:a[d]},function(t){i._addQuickPost(h,t.data.post)})]);s.html(""),this.createTable(l,["width:100%;","",""]).appendTo(this.createTableWrap().appendTo(s))}},this))},this)).trigger("keyup").focus()}}}})}this.quickPostModal.show()},n.prototype._addQuickPost=function(e,i){i.image||(i.image=""),NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"quickPost"}),data:{post:i}}).done(t.proxy(function(e){this.addBoxes(t(e.data)),this.initSlides()},this)),e.hide()},n.prototype.initBulk=function(){this.selection=[],this.isBulkSelection=!1;var e=t(".n2-bulk-select").find("a");e.eq(0).on("click",t.proxy(function(t){t.preventDefault(),this.bulkSelect(function(t){t.select()})},this)),e.eq(1).on("click",t.proxy(function(t){t.preventDefault(),this.bulkSelect(function(t){t.deSelect()})},this)),e.eq(2).on("click",t.proxy(function(t){t.preventDefault(),this.bulkSelect(function(t){t.box.hasClass("n2-slide-state-published")?t.select():t.deSelect()})},this)),e.eq(3).on("click",t.proxy(function(t){t.preventDefault(),this.bulkSelect(function(t){t.box.hasClass("n2-slide-state-published")?t.deSelect():t.select()})},this)),t(".n2-bulk-actions a").on("click",t.proxy(function(e){var i=t(e.currentTarget).data("action");i&&(e.preventDefault(),this.bulkAction(i))},this))},n.prototype.addSelection=function(t){0==this.selection.length&&this.enterBulk(),this.selection.push(t)},n.prototype.removeSelection=function(e){this.selection.splice(t.inArray(e,this.selection),1),0==this.selection.length&&this.leaveBulk()},n.prototype.bulkSelect=function(t){for(var e=0;e<this.slides.length;e++)t(this.slides[e])},n.prototype.bulkAction=function(t){var e=[],i=[];this.bulkSelect(function(t){t.selected&&(e.push(t),i.push(t.getId()))}),i.length?this[t](i,e):nextend.notificationCenter.notice("Please select one or more slides for the action!")},n.prototype.enterBulk=function(){this.isBulkSelection||(this.isBulkSelection=!0,this.slidesContainer.sortable("option","disabled",!0),t("#n2-admin").addClass("n2-ss-has-box-selection"))},n.prototype.leaveBulk=function(){if(this.isBulkSelection){this.slidesContainer.sortable("option","disabled",!1),t("#n2-admin").removeClass("n2-ss-has-box-selection");for(var e=0;e<this.slides.length;e++)this.slides[e].deSelect();this.selection=[],this.isBulkSelection=!1}},n.prototype.deleteSlides=function(e,i){this.hideMenu();var n=i[0].box.find(".n2-box-placeholder-title a").text();i.length>1&&(n+=" and "+(i.length-1)+" more"),NextendDeleteModal("slide-delete",n,t.proxy(function(){NextendAjaxHelper.ajax({url:NextendAjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"delete"}),type:"POST",data:{slides:e}}).done(t.proxy(function(){for(var t=0;t<i.length;t++)i[t].deleted();this.initSlides(),this.leaveBulk()},this))},this))},n.prototype.duplicateSlides=function(e,i){for(var n=0;n<this.slides.length;n++)this.slides[n].selected&&this.slides[n].duplicate(t.Event("click",{currentTarget:null}))},n.prototype.copySlides=function(e,i){this.showSliderSelector(n2_("Copy slide to ..."),t.proxy(function(t){NextendAjaxHelper.ajax({url:NextendAjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"copySlides",targetSliderID:t}),type:"POST",data:{slides:e}})},this))},n.prototype.publishSlides=function(e,i){NextendAjaxHelper.ajax({url:NextendAjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"publish"}),type:"POST",data:{slides:e}}).done(t.proxy(function(){for(var t=0;t<i.length;t++)i[t].published();this.changed()},this))},n.prototype.unPublishSlides=function(e,i){NextendAjaxHelper.ajax({url:NextendAjaxHelper.makeAjaxUrl(this.ajaxUrl,{nextendaction:"unpublish"}),type:"POST",data:{slides:e}}).done(t.proxy(function(){for(var t=0;t<i.length;t++)i[t].unPublished();this.changed()},this))},n.prototype.initMenu=function(){this.slide=null,this.menu=t("#n2-ss-slide-menu").detach().addClass("n2-inited"),this.menu.find("li").on("click",t.proxy(function(e){e.stopPropagation();var i=t(e.currentTarget).data("action");i&&"function"==typeof this.slide[i]&&this.slide[i](e)},this)),this.menu.find(".n2-button").on("click",t.proxy(function(e){e.preventDefault(),e.stopPropagation(),this.menu.hasClass("n2-active")?this.menu.removeClass("n2-active").off("mouseleave"):this.menu.addClass("n2-active").on("mouseleave",function(){t(this).removeClass("n2-active")})},this))},n.prototype.showMenu=function(t){this.slide=t,this.menu.appendTo(t.box)},n.prototype.hideMenu=function(){this.menu.detach()},n.prototype.showSliderSelector=function(e,i){var n=NextendAjaxHelper.makeFallbackUrl(this.ajaxUrl,{nextendcontroller:"sliders",nextendaction:"choose"});this.sliderSelectorModal=new NextendModal({zero:{size:[970,600],title:e,back:!1,close:!0,content:"",fn:{show:function(){var e=t('<iframe src="'+n+'" width="970" height="540" style="margin: 0 -20px 0 -20px;"></iframe>').appendTo(this.content),r=window.addEventListener?"addEventListener":"attachEvent";window[r]("attachEvent"==r?"onmessage":"message",t.proxy(function(t){if(t.source==(e[0].contentWindow||e[0].contentDocument)){var n=t[t.message?"message":"data"];i(n),this.hide()}},this),!1)},destroy:function(){this.destroy()}}}},!0)},n}),N2Require("SlideAdmin",[],[],function(t,e,i){function n(){this.layerAnimationManager=null,this.slideEditManager=null,this.frontend=null,this.generator=null,this.canvasManager=null,this.history=null,this.$currentSlideElement=null}return n.prototype.startEditor=function(t,i,n){return null===this.slideEditManager&&(this.slideEditManager=new e.SlideEditManager(t,i,n)),this.slideEditManager},window.nextend.pre="div#n2-ss-0 ",window.nextend.smartSlider=new n,n}),N2Require("SmartSliderBackgroundImageAdmin",["SmartSliderBackgroundImage"],[],function(t,e,i){function n(t,i,n){this.allowVisualLoad=!0,this.hash=i.data("hash"),e.SmartSliderBackgroundImage.prototype.constructor.call(this,t,i,n),this.loadAllowed=!0,this.listenImageManager()}return n.prototype=Object.create(e.SmartSliderBackgroundImage.prototype),n.prototype.constructor=n,n.prototype.startColorMode=function(){this.$background=t('<div class="n2-ss-background-image"/>').appendTo(this.$mask),this.loadDeferred.resolve()},n.prototype.setVisualLoad=function(t){this.allowVisualLoad=t},n.prototype.listenImageManager=function(){""!=this.hash&&t(window).on(this.hash,t.proxy(this.onImageManagerChanged,this))},n.prototype.notListenImageManager=function(){""!=this.hash&&t(window).off(this.hash,null,t.proxy(this.onImageManagerChanged,this))},n.prototype.onImageManagerChanged=function(t,e){this.tabletSrc=e.tablet.image,this.mobileSrc=e.mobile.image,this.updateBackgroundToDevice(this.manager.device)},n.prototype.setDesktopSrc=function(e){if(this.notListenImageManager(),this.desktopSrc=e,this.hash=md5(e),""!=e&&this.allowVisualLoad){var i=new Image;i.addEventListener("load",t.proxy(function(){t.when(nextend.imageManager.getVisual(e)).done(t.proxy(function(t){this.onImageManagerChanged(null,t.value),this.listenImageManager()},this))},this),!1),i.src=nextend.imageHelper.fixed(e)}else this.tabletSrc="",this.mobileSrc="",this.setSrc(nextend.imageHelper.fixed(e))},n.prototype.setSrc=function(t){e.SmartSliderBackgroundImage.prototype.setSrc.call(this,nextend.imageHelper.fixed(t))},n.prototype.startFixed=function(){},n.prototype.setMode=function(t){"default"==t&&(t=nextend.smartSlider.slideBackgroundMode),this.element.attr("data-mode",t),this.mode=t},n.prototype.setFocus=function(t,e){this.$background.css("background-position",t+"% "+e+"%")},n.prototype.setOpacity=function(t){this.opacity=t,this.$background.css("opacity",t)},n.prototype.setBlur=function(t){window.n2FilterProperty&&(t>0?this.$background.css({margin:"-"+2*t+"px",padding:2*t+"px"}).css(window.n2FilterProperty,"blur("+t+"px)"):this.$background.css({margin:"",padding:""}).css(window.n2FilterProperty,"")),this.blur=t},n}),N2Require("SlideEditManager",["SlideAdmin"],["smartSlider"],function(t,e,i,n){"use strict";function r(e,i,n){this.readyDeferred=t.Deferred(),this.options=t.extend({slideAsFile:0,isUploadDisabled:!0,uploadUrl:"",uploadDir:"",isAddSample:!1},n),this.warnInternetExplorerUsers(),this.$slideContentElement=t("#"+i),this.slideStartValue=this.$slideContentElement.val(),window[e].visible(t.proxy(this.sliderStarted,this))}return r.prototype.startSampleSlides=function(){var e="https://smartslider3.com/slides/"+window.N2SS3VERSION+"/pro2e4G2dR/",i=this,r=window.addEventListener?"addEventListener":"attachEvent",s=t('<iframe src="'+e+'"></iframe>').prependTo(".n2-ss-sample-slides-container"),o=s[0];t("html, body").scrollTop(s.offset().top-t("#wpadminbar").height());var a=t(".n2-ss-sample-slide-settings"),l=t("#slidebackgroundImage"),h=t("#n2-ss-sample-slide-setting-background-image").on("click",function(){l.parent().find(".n2-form-element-button").trigger("click")}),d=function(){var e=l.val();""===e?(a.removeClass("n2-ss-has-image"),h.css("background-image","url(//nextenddev.no-ip.org/roland/wordpress1/wp-content/plugins/nextend-smart-slider3-pro/nextend/media/images/placeholder/image.png)"),t("#slidebackground-type").val("color").trigger("change")):(a.addClass("n2-ss-has-image"),t("#slidebackground-type").val("image").trigger("change"),h.css("background-image","url("+nextend.imageHelper.fixed(e)+")"))};h.find(".n2-i-close").on("click",function(t){t.stopPropagation(),l.parent().find(".n2-form-element-clear").trigger("click")}),l.on("nextendChange",d),d();var p=t("#slidebackgroundImageOpacity"),c=t("#n2-ss-sample-slide-setting-opacity-slider").removeAttr("slide").prop("slide",!1).slider({min:0,max:100,step:1,slide:function(t,e){p.data("field").insideChange(e.value)}}),u=function(t){c.slider("value",p.val())};p.on("nextendChange",u),u();var y=t("#slidebackgroundImageBlur"),f=t("#n2-ss-sample-slide-setting-blur-slider").removeAttr("slide").prop("slide",!1).slider({min:0,max:40,step:1,slide:function(t,e){y.data("field").insideChange(e.value)}}),g=function(t){f.slider("value",y.val())};y.on("nextendChange",g),g();var m=t("#slidebackgroundColor"),v=t("#n2-ss-sample-slide-setting-color").n2spectrum({showAlpha:1,preferredFormat:"hex8",showInput:!1,showButtons:!1,move:function(){var t=v.n2spectrum("get").toHexString8();v.val(t),m.data("field").insideChange(t)},showSelectionPalette:!0,showPalette:!0,maxSelectionSize:6,localStorageKey:"color",palette:[["000000","55aa39","357cbd","bb4a28","8757b2","000000CC"],["81898d","5cba3c","4594e1","d85935","9e74c2","00000080"],["ced3d5","27ae60","01add3","e79d19","e264af","FFFFFFCC"],["ffffff","2ecc71","00c1c4","ecc31f","ec87c0","FFFFFF80"]]}),x=function(t){var e=m.val();e!=v.val()&&v.n2spectrum("set",e)};m.on("nextendChange",x),x();var b=t("#slidebackgroundGradient"),C=function(){"off"==b.val()?a.removeClass("n2-ss-has-gradient"):a.addClass("n2-ss-has-gradient")};b.on("nextendChange",C),C();var w=t("#slidebackgroundColorEnd"),S=t("#n2-ss-sample-slide-setting-gradient").n2spectrum({showAlpha:1,preferredFormat:"hex8",showInput:!1,showButtons:!1,move:function(){var t=S.n2spectrum("get").toHexString8();w.data("field").insideChange(t)},showSelectionPalette:!0,showPalette:!0,maxSelectionSize:6,localStorageKey:"color",palette:[["000000","55aa39","357cbd","bb4a28","8757b2","000000CC"],["81898d","5cba3c","4594e1","d85935","9e74c2","00000080"],["ced3d5","27ae60","01add3","e79d19","e264af","FFFFFFCC"],["ffffff","2ecc71","00c1c4","ecc31f","ec87c0","FFFFFF80"]]}),k=function(t){S.n2spectrum("set",w.val())};w.on("outsideChange",k),k(),window[r]("attachEvent"==r?"onmessage":"message",function(t){if(t.source==(o.contentWindow||o.contentDocument)){var e=t[t.message?"message":"data"];if(e.key)switch(e.key){case"sampleSlide":var r=JSON.parse(e.data);i.settings.setData(r.data,!0),i.canvasManager.mainContainer.replaceLayers(r.layers),"content"!=i.canvasManager.currentEditorMode&&i.canvasManager.mainContent!=n&&i.canvasManager.updateEditorMode("content");break;case"ready":(o.contentWindow||o.contentDocument).postMessage({key:"ackReady"},"*"),i.options.isAddSample&&((o.contentWindow||o.contentDocument).postMessage({key:"create"},"*"),i.options.isAddSample=!1)}}},!1)},r.prototype.sliderStarted=function(){i.history=new e.History,i.frontend=window["n2-ss-0"],i.frontend.visible(function(){t("body").addClass("n2-ss-slider-visible");var e=t("#n2-ss-slide-canvas-container"),i=e.tinyscrollbar({axis:"x",wheel:!1,wheelLock:!1}).data("plugin_tinyscrollbar");"function"==typeof e.get(0).move&&(e.get(0).move=null),this.sliderElement.on("SliderResize",function(){i.update("relative")})}),i.$currentSlideElement=i.frontend.sliderElement.find(".n2-ss-currently-edited-slide");var n=i.$currentSlideElement.hasClass("n2-ss-static-slide");new e.Generator,this.settings=new e.SlideSettings(n),this.canvasManager=new e.CanvasManager(this,n,this.options),this.readyDeferred.resolve(),t("#smartslider-form").on({checkChanged:t.proxy(this.prepareFormForCheck,this),submit:t.proxy(this.onSlideSubmit,this)}),this.options.isAddSample&&this.startSampleSlides()},r.prototype.ready=function(t){this.readyDeferred.done(t)},r.prototype.prepareFormForCheck=function(){var t=JSON.stringify(this.canvasManager.getData()),e=JSON.stringify(JSON.parse(Base64.decode(this.slideStartValue)));this.$slideContentElement.val(e==t?this.slideStartValue:Base64.encode(t))},r.prototype.onSlideSubmit=function(e){if(!nextend.isPreview)if(i.layerAnimationManager.timelineControl.exitPreviewMode(),this.prepareForm(),e.preventDefault(),nextend.askToSave=!1,this.options.slideAsFile&&typeof window.FormData!==n&&"undefined"!=typeof window.File){var r=new FormData,s=t("#smartslider-form").serializeArray();t.each(s,function(t,e){if("slide[slide]"==e.name)try{r.append("slide",new Blob([e.value]),"slide.txt")}catch(i){try{r.append("slide",new Blob([e.value]))}catch(i){try{r.append("slide",new File([e.value],"slide.txt"))}catch(i){nextend.notificationCenter.notice('Your browser does not support File api, please disable "Send slide as file" option in the global settings.')}}}else r.append(e.name,e.value)}),NextendAjaxHelper.ajax({url:NextendAjaxHelper.makeAjaxUrl(window.location.href),type:"POST",data:r,contentType:!1,processData:!1}).done(t.proxy(this.afterSave,this))}else NextendAjaxHelper.ajax({type:"POST",url:NextendAjaxHelper.makeAjaxUrl(window.location.href),data:t("#smartslider-form").serialize(),dataType:"json"}).done(t.proxy(this.afterSave,this))},r.prototype.afterSave=function(){nextend.askToSave=!0,t("#smartslider-form").trigger("saved"),t(".n2-ss-edit-slide-top-details .n2-h1").html(t("#slidetitle").val())},r.prototype.prepareForm=function(){i.ruler&&t("#slideguides").val(Base64.encode(JSON.stringify(i.ruler.toArray()))),this.$slideContentElement.val(Base64.encode(nextend.UnicodeToHTMLEntity(JSON.stringify(this.canvasManager.getData()))))},r.prototype.warnInternetExplorerUsers=function(){var t=this.isInternetExplorer();t&&10>t&&alert(window.ss2lang.The_editor_was_tested_under_Internet_Explorer_10_Firefox_and_Chrome_Please_use_one_of_the_tested_browser)},r.prototype.isInternetExplorer=function(){var t=navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):!1},r.prototype.getLayout=function(){for(var e=t("#smartslider-form").serializeArray(),i={},n=0;n<e.length;n++){var r=e[n].name.match(/slide\[(.*?)\]/);r&&(i[r[1]]=e[n].value)}return delete i.generator,delete i.published,delete i.publishdates,delete i["record-start"],delete i["record-slides"],delete i.slide,i.slide=this.canvasManager.getData(),i},r.prototype.loadLayout=function(e,i,n){var r=e.slide;if(delete e.slide,n?this.canvasManager.importLayers(r,!0):this.canvasManager.importLayers(r,!1),i)for(var s in e)t("#slide"+s).val(e[s]).trigger("change");e.slide=r},r.prototype.getSelf=function(){return this},r.prototype.copySlide=function(){var e={data:this.settings.getBackgroundData(),layers:this.canvasManager.getData()};t.jStorage.set("copiedSlide",JSON.stringify(e))},r.prototype.pasteSlide=function(){var e=t.jStorage.get("copiedSlide");e&&(e=JSON.parse(e),this.settings.setData(e.data),this.canvasManager.mainContainer.replaceLayers(e.layers))},r.prototype.hasCopiedSlide=function(){var e=t.jStorage.get("copiedSlide");return!!e},r}),N2Require("Generator",["SlideAdmin"],["smartSlider"],function(t,e,i,n){"use strict";function r(){this._refreshTimeout=null,this.modal=!1,this.group=0,i.generator=this;var e=i.$currentSlideElement.data("variables");if(e){this.variables=e;for(var n in this.variables)!isNaN(parseFloat(n))&&isFinite(n)&&(this.group=Math.max(this.group,parseInt(n)+1));this.fill=this.generatorFill,this.group>0&&(this.registerField=this.generatorRegisterField,this.button=t('<a href="#" class="n2-button n2-button-normal n2-button-xs n2-radius-s n2-button-blue n2-h5 n2-uc" style="position:absolute;right: -2px;top: -18px;">Variable</a>').on("click",t.proxy(function(t){t.preventDefault(),this.showModal()},this)),this.registerField(t("#slidetitle")),this.registerField(t("#slidedescription")),this.registerField(t("#slidethumbnail")),this.registerField(t("#slidebackgroundImage")),this.registerField(t("#slidebackgroundAlt")),this.registerField(t("#slidebackgroundTitle")),this.registerField(t("#slidebackgroundVideoMp4")),this.registerField(t("#slidebackgroundColor")),this.registerField(t("#slidebackgroundColorEnd")),this.registerField(t("#linkslidelink_0")),this.registerField(t("#layergenerator-visible")),this.registerField(t("#layergroup-generator-visible")),t("body").addClass("n2-ss-dynamic-slide")),this.initSlideDataRefresh()}else this.variables=null}return r.prototype.isDynamicSlide=function(){return this.group>0},r.prototype.splitTokens=function(t){for(var e=[],i="",n=0,r=0;r<t.length;r++){var s=t[r];","===s&&0===n?(e.push(i),i=""):(i+=s,"("===s?n++:")"===s&&n--)}return i.length&&e.push(i),e},r.prototype.fill=function(t){return t},r.prototype.generatorFill=function(e){return e.replace(/{((([a-z]+)\(([^}]+)\))|([a-zA-Z0-9][a-zA-Z0-9_\/]*))}/g,t.proxy(this.parseFunction,this))},r.prototype.parseFunction=function(t,e,i,n,r,s){if("undefined"==typeof s){for(var o=this.splitTokens(r),a=0;a<o.length;a++)o[a]=this.parseVariable(o[a]);return"function"==typeof this[n]?this[n].apply(this,o):t}return this.parseVariable(s)},r.prototype.parseVariable=function(t){var e=t.match(/^("|')(.*)("|')$/);if(e)return e[2];var i=t.match(/((([a-z]+)\(([^}]+)\)))/);if(i)return this.parseFunction.apply(this,i);var n=t.match(/([a-zA-Z][0-9a-zA-Z_]*)(\/([0-9a-z]+))?/);if(n){var r=n[3];if("undefined"==typeof r)r=0;else{var s=parseInt(r);isNaN(s)||(r=Math.max(r,1)-1)}return"undefined"!=typeof this.variables[r]&&"undefined"!=typeof this.variables[r][n[1]]?this.variables[r][n[1]]:""}return t},r.prototype.fallback=function(t,e){return""==t?e:t},r.prototype.cleanhtml=function(t){return this.stripTags(t,"<p><a><b><br /><br/><i>")},r.prototype.stripTags=function(t,e){e=(((e||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");var i=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,n=/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;return t.replace(n,"").replace(i,function(t,i){return e.indexOf("<"+i.toLowerCase()+">")>-1?t:""})},r.prototype.removehtml=function(e){return t("<div>"+e+"</div>").text()},r.prototype.splitbychars=function(t,e,i){return t.substr(e,i)},r.prototype.splitbywords=function(t,e,i){var n=t,r=n.length,s=Math.max(0,0==e?0:n.indexOf(" ",e)),o=Math.max(0,i>r?r:n.indexOf(" ",i));return 0==o&&r>=i&&(o=r),n.substr(s,o)},r.prototype.findimage=function(t,e){var i=t,n=/(<img.*?src=[\'"](.*?)[\'"][^>]*>)|(background(-image)??\s*?:.*?url\((["|\']?)?(.+?)(["|\']?)?\))/gi,r=[],s=null;for(e="undefined"!=typeof e?parseInt(e)-1:0;s=n.exec(i);)"undefined"!=typeof s[2]?r.push(s[2]):"undefined"!=typeof s[6]&&r.push(s[6]);return r.length?r.length>e?r[e]:r[r.length-1]:""},r.prototype.findlink=function(t,e){var i=t,n=/href=["\']?([^"\'>]+)["\']?/gi,r=[],s=null;for(e="undefined"!=typeof e?parseInt(e)-1:0;s=n.exec(i);)"undefined"!=typeof s[1]&&r.push(s[1]);return r.length?r.length>e?r[e]:r[r.length-1]:""},r.prototype.removevarlink=function(t){var e=String(t),i=/<a href=\"(.*?)\">(.*?)<\/a>/g;return e.replace(i,"")},r.prototype.removelinebreaks=function(t){var e=String(t),i=/\r?\n|\r/g;return e.replace(i,"")},r.prototype.registerField=function(t){},r.prototype.generatorRegisterField=function(e){var i=e.parent();i.on({mouseenter:t.proxy(function(){this.activeField=e,this.button.prependTo(i)},this)})},r.prototype.getModal=function(){var e=this;if(!this.modal){var i={key:"",group:1,filter:"no",split:"no",splitStart:0,splitLength:300,findImage:0,findImageIndex:1,findLink:0,findLinkIndex:1,removeVarLink:0,removelinebreaks:0},n=function(){var t=i.key+"/"+i.group;return i.findImage&&(t="findimage("+t+","+Math.max(1,i.findImageIndex)+")"),i.findLink&&(t="findlink("+t+","+Math.max(1,i.findLinkIndex)+")"),i.removeVarLink&&(t="removevarlink("+t+")"),i.removelinebreaks&&(t="removelinebreaks("+t+")"),"no"!=i.filter&&(t=i.filter+"("+t+")"),"no"!=i.split&&i.splitStart>=0&&i.splitLength>0&&(t=i.split+"("+t+","+i.splitStart+","+i.splitLength+")"),"{"+t+"}"},r=t('<div class="n2-generator-result-container" />'),s=function(){r.html(t("<div/>").text(e.fill(n())).html())},o=e.group,a=null,l=null,h=t('<div class="n2-generator-insert-variable"/>'),d=NextendModal.prototype.createHeading(n2_("Choose the group")).appendTo(h),p=t('<div class="n2-group-container" />').appendTo(h);h.append(NextendModal.prototype.createHeading(n2_("Choose the variable")));var c=t('<div class="n2-variable-container webkit-scroll-fix" />').appendTo(h),u=t('<div class="n2-generator-functions-container n2-form-element-mixed" />').appendTo(t('<div class="n2-form" />').appendTo(h));h.append(NextendModal.prototype.createHeading(n2_("Result"))),r.appendTo(h),t('<div class="n2-mixed-group"><div class="n2-mixed-label"><label>'+n2_("Filter")+'</label></div><div class="n2-mixed-element"><div class="n2-form-element-list"><select autocomplete="off" name="filter" id="n2-generator-function-filter"><option selected="selected" value="no">'+n2_("No")+'</option><option value="cleanhtml">'+n2_("Clean HTML")+'</option><option value="removehtml">'+n2_("Remove HTML")+"</option></select></div></div></div>").appendTo(u);var y=u.find("#n2-generator-function-filter");y.on("change",t.proxy(function(){i.filter=y.val(),s()},this)),t('<div class="n2-mixed-group"><div class="n2-mixed-label"><label>'+n2_("Split by chars")+'</label></div><div class="n2-mixed-element"><div class="n2-form-element-list"><select autocomplete="off" name="split" id="n2-generator-function-split"><option selected="selected" value="no">'+n2_("No")+'</option><option value="splitbychars">'+n2_("Strict")+'</option><option value="splitbywords">'+n2_("Respect words")+'</option></select></div><div class="n2-form-element-text n2-text-has-unit n2-border-radius"><div class="n2-text-sub-label n2-h5 n2-uc">'+n2_("Start")+'</div><input type="text" autocomplete="off" style="width: 22px;" class="n2-h5" value="0" id="n2-generator-function-split-start"></div><div class="n2-form-element-text n2-text-has-unit n2-border-radius"><div class="n2-text-sub-label n2-h5 n2-uc">'+n2_("Length")+'</div><input type="text" autocomplete="off" style="width: 22px;" class="n2-h5" value="300" id="n2-generator-function-split-length"></div></div></div>').appendTo(u);var f=u.find("#n2-generator-function-split");f.on("change",t.proxy(function(){i.split=f.val(),s()},this));var g=u.find("#n2-generator-function-split-start");g.on("change",t.proxy(function(){i.splitStart=parseInt(g.val()),s()},this));var m=u.find("#n2-generator-function-split-length");m.on("change",t.proxy(function(){i.splitLength=parseInt(m.val()),s()},this)),t('<div class="n2-mixed-group"><div class="n2-mixed-label"><label>'+n2_("Find image")+'</label></div><div class="n2-mixed-element"><div class="n2-form-element-onoff"><div class="n2-onoff-slider"><div class="n2-onoff-no"><i class="n2-i n2-i-close"></i></div><div class="n2-onoff-round"></div><div class="n2-onoff-yes"><i class="n2-i n2-i-tick"></i></div></div><input type="hidden" autocomplete="off" value="0" id="n2-generator-function-findimage"></div><div class="n2-form-element-text n2-text-has-unit n2-border-radius"><div class="n2-text-sub-label n2-h5 n2-uc">'+n2_("Index")+'</div><input type="text" autocomplete="off" style="width: 22px;" class="n2-h5" value="1" id="n2-generator-function-findimage-index"></div></div></div>').appendTo(u);var v=u.find("#n2-generator-function-findimage");v.on("nextendChange",t.proxy(function(){i.findImage=parseInt(v.val()),s()},this));var x=u.find("#n2-generator-function-findimage-index");x.on("change",t.proxy(function(){i.findImageIndex=parseInt(x.val()),s()},this)),t('<div class="n2-mixed-group"><div class="n2-mixed-label"><label>'+n2_("Find link")+'</label></div><div class="n2-mixed-element"><div class="n2-form-element-onoff"><div class="n2-onoff-slider"><div class="n2-onoff-no"><i class="n2-i n2-i-close"></i></div><div class="n2-onoff-round"></div><div class="n2-onoff-yes"><i class="n2-i n2-i-tick"></i></div></div><input type="hidden" autocomplete="off" value="0" id="n2-generator-function-findlink"></div><div class="n2-form-element-text n2-text-has-unit n2-border-radius"><div class="n2-text-sub-label n2-h5 n2-uc">'+n2_("Index")+'</div><input type="text" autocomplete="off" style="width: 22px;" class="n2-h5" value="1" id="n2-generator-function-findlink-index"></div></div></div>').appendTo(u);var b=u.find("#n2-generator-function-findlink");b.on("nextendChange",t.proxy(function(){i.findLink=parseInt(b.val()),s()},this));var C=u.find("#n2-generator-function-findlink-index");C.on("change",t.proxy(function(){i.findLinkIndex=parseInt(C.val()),s()},this)),t('<div class="n2-mixed-group"><div class="n2-mixed-label"><label>'+n2_("Remove links")+'</label></div><div class="n2-mixed-element"><div class="n2-form-element-onoff"><div class="n2-onoff-slider"><div class="n2-onoff-no"><i class="n2-i n2-i-close"></i></div><div class="n2-onoff-round"></div><div class="n2-onoff-yes"><i class="n2-i n2-i-tick"></i></div></div><input type="hidden" autocomplete="off" value="0" id="n2-generator-function-removevarlink"></div></div></div>').appendTo(u);var w=u.find("#n2-generator-function-removevarlink");w.on("nextendChange",t.proxy(function(){i.removeVarLink=parseInt(w.val()),s()},this));var S=u.find("#n2-generator-function-removevarlink-index");S.on("change",t.proxy(function(){i.removeVarLinkIndex=parseInt(S.val()),s()},this)),t('<div class="n2-mixed-group"><div class="n2-mixed-label"><label>'+n2_("Remove line breaks")+'</label></div><div class="n2-mixed-element"><div class="n2-form-element-onoff"><div class="n2-onoff-slider"><div class="n2-onoff-no"><i class="n2-i n2-i-close"></i></div><div class="n2-onoff-round"></div><div class="n2-onoff-yes"><i class="n2-i n2-i-tick"></i></div></div><input type="hidden" autocomplete="off" value="0" id="n2-generator-function-removelinebreaks"></div></div></div>').appendTo(u);var k=u.find("#n2-generator-function-removelinebreaks");k.on("nextendChange",t.proxy(function(){i.removelinebreaks=parseInt(k.val()),s()},this));var P=u.find("#n2-generator-function-removelinebreaks-index");P.on("change",t.proxy(function(){i.removelinebreaksIndex=parseInt(P.val()),s()},this));for(var A in this.variables[0])t('<a href="#" class="n2-button n2-button-normal n2-button-s n2-button-grey n2-radius-s">'+A+"</a>").on("click",t.proxy(function(e,n){n.preventDefault(),a.removeClass("n2-active"),t(n.currentTarget).addClass("n2-active"),i.key=e,s()},this,A)).appendTo(c);a=c.find("a"),a.eq(0).trigger("click"),1==o&&(d.css("display","none"),p.css("display","none"));for(var M=0;o>M;M++)t('<a href="#" class="n2-button n2-button-normal n2-button-s n2-button-grey n2-radius-s">'+(M+1)+"</a>").on("click",t.proxy(function(e,n){n.preventDefault(),l.removeClass("n2-active"),t(n.currentTarget).addClass("n2-active"),i.group=e+1,s()},this,M)).appendTo(p);l=p.find("a"),l.eq(0).trigger("click");var D=!1;this.modal=new NextendModal({zero:{size:[1e3,o>1?670:600],title:n2_("Insert variable"),back:!1,close:!0,content:h,controls:['<a href="#" class="n2-button n2-button-normal n2-button-l n2-radius-s n2-button-green">'+n2_("Insert")+"</a>"],fn:{show:function(){D||(new N2Classes.FormElementOnoff("n2-generator-function-findimage"),new N2Classes.FormElementOnoff("n2-generator-function-findlink"),new N2Classes.FormElementOnoff("n2-generator-function-removevarlink"),new N2Classes.FormElementOnoff("n2-generator-function-removelinebreaks"),D=!0),this.controls.find(".n2-button").on("click",t.proxy(function(t){t.preventDefault(),e.insert(n()),this.hide(t)},this))}}}},!1),this.modal.setCustomClass("n2-ss-generator-modal")}return this.modal},r.prototype.showModal=function(){this.getModal().show()},r.prototype.insert=function(t){this.activeField.val(t).trigger("change")},r.prototype.initSlideDataRefresh=function(){var e=t("#slidetitle").on("nextendChange",t.proxy(function(){this.variables.slide.name=e.val(),this.refresh()},this)),i=t("#slidedescription").on("nextendChange",t.proxy(function(){this.variables.slide.description=i.val(),this.refresh()},this))},r.prototype.refresh=function(){this._refreshTimeout&&(clearTimeout(this._refreshTimeout),this._refreshTimeout=null),this._refreshTimeout=setTimeout(t.proxy(this._refresh,this),100)},r.prototype._refresh=function(){for(var t=i.canvasManager.mainContainer.container.getAllLayers(),e=0;e<t.length;e++)"layer"==t[e].type&&t[e].item.reRender()},r}),N2Require("History",[],[],function(t,e,i){"use strict";function n(){this.historyStates=50,this.enabled=0!=this.historyStates,this.historyAddAllowed=!0,this.isBatched=!1,this.currentBatch=this,this.index=-1,this.stackedOff=[],this.tasks=[],this.preventUndoRedo=!1,this.undoBTN=t("#n2-ss-undo").on({click:t.proxy(this.undo,this),mousedown:function(t){nextend.context.setMouseDownArea("undo",t)}}),this.redoBTN=t("#n2-ss-redo").on({click:t.proxy(this.redo,this),mousedown:function(t){nextend.context.setMouseDownArea("redo",t)}}),this.updateUI()}function r(t){this.parent=t,this.tasks=[]}function s(t){switch(t){case"skipForwardUndos":this.undo=function(){return!1}}}function o(t,e,i,n){
this.that=t,this.undoAction=e,this.redoAction=i,this.context=n||[]}function a(){o.prototype.constructor.apply(this,arguments)}return n.prototype.updateUI=function(){0==this.index||0==this.tasks.length?this.undoBTN.removeClass("n2-active"):this.undoBTN.addClass("n2-active"),-1==this.index||this.index>=this.tasks.length?this.redoBTN.removeClass("n2-active"):this.redoBTN.addClass("n2-active")},n.prototype.throttleUndoRedo=function(){return this.preventUndoRedo?!0:(this.preventUndoRedo=!0,setTimeout(t.proxy(function(){this.preventUndoRedo=!1},this),100),!1)},n.prototype.isEnabled=function(){return this.enabled&&this.historyAddAllowed},n.prototype.startBatch=function(){if(this.isEnabled()){var t=new r(this.currentBatch);return this.currentBatch._add(t),this.currentBatch=t,t}return!1},n.prototype.endBatch=function(){this.isEnabled()&&(this.currentBatch.parent==i,this.currentBatch=this.currentBatch.parent)},n.prototype.addControl=function(t){return this.currentBatch._add(new s(t))},n.prototype.addSimple=function(t,e,i,n){return this.isEnabled()?this.currentBatch._add(new o(t,e,i,n)):!1},n.prototype.addValue=function(t,e,i){if(this.isEnabled()){if(this.isBatched||this.currentBatch!=this)for(var n=this.getCurrentBatchStack(),r=0;r<n.length;r++)if(n[r].isEqual(t,e,i))return n.push(n.splice(r,1)[0]),n[n.length-1];return this.currentBatch._add(new a(t,e,e,i))}return!1},n.prototype.getCurrentBatchStack=function(){return this.currentBatch!=this?this.currentBatch.tasks:this.tasks[this.tasks.length-1]},n.prototype._add=function(e){return-1!=this.index&&this.tasks.splice(this.index,this.tasks.length),this.index=-1,this.isBatched?this.tasks[this.tasks.length-1].push(e):(this.tasks.push([e]),this.isBatched=!0,setTimeout(t.proxy(function(){this.isBatched=!1},this),100)),this.tasks.length>this.historyStates&&this.tasks.unshift(),this.updateUI(),e},n.prototype.off=function(){this.historyAddAllowed=!1,this.stackedOff.push(1)},n.prototype.on=function(){this.stackedOff.pop(),0==this.stackedOff.length&&(this.historyAddAllowed=!0)},n.prototype.undo=function(t){if(t&&t.preventDefault(),this.throttleUndoRedo())return!1;if(this.off(),-1==this.index?this.index=this.tasks.length-1:this.index--,this.index>=0)for(var e=this.tasks[this.index],i=e.length-1;i>=0&&e[i].undo();i--);else this.index=0;return this.on(),this.updateUI(),!0},n.prototype.redo=function(t){if(t&&t.preventDefault(),this.throttleUndoRedo())return!1;if(this.off(),-1!=this.index&&this.index<this.tasks.length){var e=this.tasks[this.index];this.index++;for(var i=0;i<e.length&&e[i].redo();i++);}return this.on(),this.updateUI(),!0},r.prototype._add=function(t){return this.tasks.push(t),t},r.prototype.invertUndo=function(){return this.undo=function(){for(var t=this.tasks.length-1;t>=0&&this.tasks[t].undo();t--);return!0},this},r.prototype.undo=function(){for(var t=0;t<this.tasks.length&&this.tasks[t].undo();t++);return!0},r.prototype.redo=function(){for(var t=0;t<this.tasks.length&&this.tasks[t].redo();t++);return!0},r.prototype.isEqual=function(){return!1},s.prototype.undo=function(){return!0},s.prototype.redo=function(){return!0},s.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,e){this.undoValue=t,this.redoValue=e},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,e,i){if(t==this.that&&e==this.undoAction){for(var n=0;n<i.length;n++)if(i[n]!=this.context[n])return!1;return this.setValues=function(t,e){this.redoValue=e},!0}return!1},n}),N2Require("InlineField",[],[],function(t,e,i){function n(){this.$input=t('<input type="text" name="name" />').on({mouseup:function(t){t.stopPropagation()},keyup:t.proxy(function(t){27==t.keyCode&&this.cancel()},this),blur:t.proxy(this.save,this)}),this.$form=t('<form class="n2-inline-form"></form>').append(this.$input).on("submit",t.proxy(this.save,this))}return n.prototype.injectNode=function(t,e){this.$input.val(e),t.append(this.$form),this.$input.focus()},n.prototype.save=function(t){t.preventDefault(),this.$input.trigger("valueChanged",[this.$input.val()]),this.$input.off("blur"),this.destroy()},n.prototype.cancel=function(){this.$input.trigger("cancel"),this.destroy()},n.prototype.destroy=function(){this.$input.off("blur"),this.$form.remove()},n}),N2Require("SlideSettings",["SlideEditManager"],["smartSlider"],function(t,e,i,n){"use strict";function r(e){this.isStatic=e;var n=t("#smartslider-form").find('input[id][name^="slide"], textarea[id][name^="slide"]'),r={};if(n.each(t.proxy(function(e,i){var n=t(i),s=n.attr("name").match(/slide\[(.*)\]/)[1];r[s]=n.on("nextendChange",t.proxy(this.onChange,this,s))},this)),this.fields=r,this.slideBackground=i.$currentSlideElement.data("slideBackground"),!e){this.$slideMask=this.slideBackground.$mask;var s=t("#slidethumbnail");if(""==s.val()){var o=t("#item_imageimage"),a=t.proxy(function(t){""!=t&&"$system$/images/placeholder/image.png"!=t&&(s.val(t).trigger("change"),this.fields.backgroundImage.off(".slidethumbnail"),o.off(".slidethumbnail"))},this);this.fields.backgroundImage.on("nextendChange.slidethumbnail",t.proxy(function(){a(this.fields.backgroundImage.val())},this)),o.on("nextendChange.slidethumbnail",t.proxy(function(){a(o.val())},this))}}this.createHistory()}r.prototype.createHistory=function(){this.values={},t("#smartslider-form").find('input[id][name^="slide"], textarea[id][name^="slide"]').not("#slideslide").each(t.proxy(function(e,n){var r=t(n),s=r.data("field"),o=r.attr("id");this.values[o]=r.val(),r.on("nextendChange",t.proxy(function(){var t=r.val(),e=i.history.addValue(this,this.historyUpdateSlideValue,[s]);e&&e.setValues(this.values[o],t),this.values[o]=t},this))},this))},r.prototype.getSelf=function(){return this},r.prototype.historyUpdateSlideValue=function(t,e){e.insideChange(t)},r.prototype.getAllData=function(){var t={};for(var e in this.fields)t[e]=this.fields[e].val();return t};var s=["thumbnail","background-type","backgroundColor","backgroundGradient","backgroundColorEnd","backgroundImage","backgroundImageOpacity","backgroundImageBlur","backgroundFocusX","backgroundFocusY","backgroundMode"];return r.prototype.getBackgroundData=function(){for(var t={},e=0;e<s.length;e++)t[s[e]]=this.fields[s[e]].val();return t},r.prototype.setData=function(t,e){e&&this.slideBackground.setVisualLoad(!1);for(var i in t)this.fields[i].val(t[i]).trigger("change");e&&this.slideBackground.setVisualLoad(!1)},r.prototype.onChange=function(t,e){"function"==typeof this["sync_"+t]&&this["sync_"+t].call(this)},r.prototype.sync_backgroundColor=r.prototype.sync_backgroundGradient=r.prototype.sync_backgroundColorEnd=function(){this.updateBackgroundColor()},r.prototype.updateBackgroundColor=function(){var t=i.generator.fill(this.fields.backgroundColor.val()),e=this.fields.backgroundGradient.val();if(t.length&&"#"==t.charAt(0)&&(t=t.substring(1),6==t.length&&(t+="ff")),"off"!=e){var n=i.generator.fill(this.fields.backgroundColorEnd.val()),r=this.$slideMask.css({background:"",filter:""});switch(n.length&&"#"==n.charAt(0)&&(n=n.substring(1),6==n.length&&(n+="ff")),e){case"horizontal":r.css("background","#"+t.substr(0,6)).css("background","-moz-linear-gradient(left, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(n)+" 100%)").css("background"," -webkit-linear-gradient(left, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(n)+" 100%)").css("background","linear-gradient(to right, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(n)+" 100%)").css("background","filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#"+t.substr(0,6)+"', endColorstr='#"+n.substr(0,6)+"',GradientType=1)");break;case"vertical":r.css("background","#"+t.substr(0,6)).css("background","-moz-linear-gradient(top, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(n)+" 100%)").css("background"," -webkit-linear-gradient(top, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(n)+" 100%)").css("background","linear-gradient(to bottom, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(n)+" 100%)").css("background","filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#"+t.substr(0,6)+"', endColorstr='#"+n.substr(0,6)+"',GradientType=0)");break;case"diagonal1":r.css("background","#"+t.substr(0,6)).css("background","-moz-linear-gradient(45deg, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(n)+" 100%)").css("background"," -webkit-linear-gradient(45deg, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(n)+" 100%)").css("background","linear-gradient(45deg, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(n)+" 100%)").css("background","filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#"+t.substr(0,6)+"', endColorstr='#"+n.substr(0,6)+"',GradientType=1)");break;case"diagonal2":r.css("background","#"+t.substr(0,6)).css("background","-moz-linear-gradient(-45deg, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(n)+" 100%)").css("background"," -webkit-linear-gradient(-45deg, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(n)+" 100%)").css("background","linear-gradient(-45deg, "+N2Color.hex2rgbaCSS(t)+" 0%,"+N2Color.hex2rgbaCSS(n)+" 100%)").css("background","filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#"+t.substr(0,6)+"', endColorstr='#"+n.substr(0,6)+"',GradientType=1)")}}else"00"==t.substr(6,8)?this.$slideMask.css("background",""):this.$slideMask.css("background","#"+t.substr(0,6)).css("background",N2Color.hex2rgbaCSS(t));this.slideBackground.element.find(".n2-ss-slide-bg-video-color-overlay").css("background",this.$slideMask.css("background"))},r.prototype.sync_backgroundVideoMp4=function(){this["sync_background-type"]()},r.prototype.sync_backgroundVideoMode=function(){this["sync_background-type"]()},r.prototype.sync_backgroundImage=function(){this["sync_background-type"]()},r.prototype["sync_background-type"]=function(){var n=this.fields["background-type"].val();if("color"==n)this.slideBackground.setDesktopSrc("");else if(this.slideBackground.setDesktopSrc(i.generator.fill(this.fields.backgroundImage.val())),this.slideBackground.element.find(".n2-ss-slide-background-video").remove(),"video"==n){var r=this.fields.backgroundVideoMp4.val();if(""!=r){var s=t('<video muted="muted" loop="loop" preload="auto" class="n2-ss-slide-background-video n2-ow n2-active" data-mode="'+this.fields.backgroundVideoMode.val()+'" data-background="opacity:1;" playsinline="playsinline" webkit-playsinline="webkit-playsinline" style="width: 100%; height: auto; margin-top: -87px; margin-left: 0px;"><source src="'+nextend.imageHelper.fixed(r)+'" type="video/mp4"></video>').appendTo(this.slideBackground.element);new e.SmartSliderBackgroundVideo(i.$currentSlideElement.data("slide"),s)}}},r.prototype.sync_backgroundMode=function(){this.slideBackground.setMode(this.fields.backgroundMode.val())},r.prototype.sync_backgroundFocusY=function(){this.slideBackground.setFocus(this.fields.backgroundFocusX.val(),this.fields.backgroundFocusY.val())},r.prototype.sync_backgroundFocusX=function(){this.slideBackground.setFocus(this.fields.backgroundFocusX.val(),this.fields.backgroundFocusY.val())},r.prototype.sync_backgroundImageOpacity=function(){this.slideBackground.setOpacity(this.fields.backgroundImageOpacity.val()/100)},r.prototype.sync_backgroundImageBlur=function(){this.slideBackground.setBlur(this.fields.backgroundImageBlur.val())},r}),N2Require("LayerContainer",[],["smartSlider"],function(t,e,i,n){"use strict";function r(t,e,i,n,r){this.component=t,this.$ul=e.data("container",this),this.allowedPlacementMode=i,this.childrenSelector=n,this.allowedChildren=r,this.layerContainerElement=t.layer}return r.prototype.setLayerContainerElement=function(t){this.layerContainerElement=t},r.prototype.startWithExistingNodes=function(){for(var t=this.layerContainerElement.find(this.childrenSelector),e=0;e<t.length;e++)this._loadNode(t.eq(e),!1);this.component.onChildCountChange()},r.prototype.isChildAllowed=function(e){return-1!==t.inArray(e,this.allowedChildren)},r.prototype._loadNode=function(t,i){var r=t.data("type");if(this.isChildAllowed(r)){var s=t.data("lastplacement"),o={};if(s!==n&&s!=this.allowedPlacementMode)switch(s){case"absolute":o=e.PlacementAbsolute.cleanLayer(t);break;case"normal":o=e.PlacementNormal.cleanLayer(t)}var a;switch(r){case"layer":a=new e.Layer(this.component.canvasManager,this.component);var l=a.itemEditor.getItemClass(t.find(".n2-ss-item").data("item"));l&&e[l].needSize&&o.desktopportraitheight!==n&&t.data("desktopportraitheight",o.desktopportraitheight);break;case"content":a=new e.Content(this.component.canvasManager,this.component);break;case"row":a=new e.Row(this.component.canvasManager,this.component);break;case"col":a=new e.Col(this.component.canvasManager,this.component);break;case"group":a=new e.Group(this.component.canvasManager,this.component)}if(a)return a.load(t),i&&a.sync(),a}else console.error(r+" is not allowed in "+this.component.label);return!1},r.prototype.getLayerCount=function(){return this.layerContainerElement.find(this.childrenSelector).length},r.prototype.getLayerIndex=function(t){return this.layerContainerElement.find(this.childrenSelector).index(t)},r.prototype.getSortedLayers=function(){var e=[];return this.layerContainerElement.find(this.childrenSelector).each(function(i,r){var s=t(r).data("layerObject");s!==n&&e.push(s)}),e},r.prototype.append=function(t){t.appendTo(this.layerContainerElement);var e=this._loadNode(t,!0);return this.component.onChildCountChange(),e},r.prototype.insertAt=function(t,e){var i=this.getSortedLayers();e>=i.length?t.appendTo(this.layerContainerElement):t.insertBefore(i[e].layer);var n=this._loadNode(t,!0);return this.component.onChildCountChange(),n},r.prototype.insert=function(t){t.getRootElement().appendTo(this.layerContainerElement)},r.prototype.insertLayerAt=function(e,i){var n=this.getSortedLayers(),r=t.inArray(e,n);"-1"!=r&&i>r&&i++,i>=n.length?e.getRootElement().appendTo(this.layerContainerElement):e.getRootElement().insertBefore(n[i].getRootElement()),this.syncLayerRow(e)},r.prototype.syncLayerRow=function(t){var e,i="absolute"==this.allowedPlacementMode;e=i?t.getRootElement().prevAll(".n2-ss-layer, .n2-ss-layer-group, .n2-ss-section-outer").first().data("layerObject"):t.getRootElement().nextAll(".n2-ss-layer, .n2-ss-layer-group, .n2-ss-section-outer").first().data("layerObject"),e!==n?t.layerRow.insertBefore(e.layerRow):this.$ul.append(t.layerRow),t.animations&&t.animations.syncRow(e,i)},r.prototype.getChildLayersRecursive=function(t){for(var e=this.getSortedLayers(),i=[],n=0;n<e.length;n++)t?i.push(e[n].layer[0]):i.push(e[n]),e[n].container&&i.push.apply(i,e[n].container.getChildLayersRecursive(t));return i},r.prototype.moveLayerToGroup=function(t,e){this.moveLayersToGroup([t],[e])},r.prototype.moveLayersToGroup=function(e,i){i=i||[];for(var n=[],r=0;r<e.length;r++){var s=e[r],o=s.group,a=s.getIndex();"undefined"!=typeof i[r]?this.insertLayerAt(s,i[r]):this.insert(s),s.changeGroup(a,this.component),this!=o&&-1==t.inArray(o,n)&&n.push(o)}for(var r=0;r<n.length;r++)n[r].update()},r.prototype.activateFirst=function(){var t=this.getSortedLayers();t.length>0&&t[t.length-1].activate()},r.prototype.resetModes=function(t){for(var e=this.getSortedLayers(),i=0;i<e.length;i++)e[i].resetMode(t),e[i].container!=n&&e[i].container.resetModes(t)},r.prototype.copyModes=function(t,e){for(var i=this.getSortedLayers(),r=0;r<i.length;r++)i[r].copyMode(t,e),i[r].container!=n&&i[r].container.copyModes(t,e)},r.prototype.changeEditorModes=function(t){for(var e=this.getSortedLayers(),i=0;i<e.length;i++)e[i].changeEditorMode(t),e[i].container!=n&&e[i].container.changeEditorModes(t)},r.prototype.renderModeProperties=function(){for(var t=this.getSortedLayers(),e=0;e<t.length;e++)t[e].renderModeProperties(),t[e].container!=n&&t[e].container.renderModeProperties()},r.prototype.getAllLayers=function(t){t=t||[];for(var e=this.getSortedLayers(),i=0;i<e.length;i++)t.push(e[i]),e[i].container!=n&&e[i].container.getAllLayers(t);return t},r.prototype.getData=function(e){e=t.extend({layersIncluded:!0,itemsIncluded:!0},e);var i=[],n=this.getSortedLayers();if("absolute"==this.allowedPlacementMode)for(var r=n.length-1;r>=0;r--)i.push(n[r].getData(e));else for(var r=0;r<n.length;r++)i.push(n[r].getData(e));return i},r.prototype.getHTML=function(t){for(var e=this.getSortedLayers(),i=[],n=0;n<e.length;n++)i.push(e[n].getHTML(t));return i},r.prototype.getDroppables=function(t){for(var e=[],i=this.getSortedLayers(),n=0;n<i.length;n++)if(i[n]!=t){var r=i[n].getDroppable();"object"==typeof r&&e.push(r),"hidden"!=r&&i[n].container&&e.push.apply(e,i[n].container.getDroppables(t))}return e},r.prototype.getLLDroppables=function(t){var e=[],i=this.component.getLLDroppable(t);i&&e.push(i);for(var n=this.getSortedLayers(),r=0;r<n.length;r++)n[r].container&&n[r]!=t&&e.push.apply(e,n[r].container.getLLDroppables(t));return e},r}),N2Require("LayerDataStorage",[],["smartSlider"],function(t,e,i,n){"use strict";function r(){this.isDeviceProp={},this.propertyScope={},this.property={},this.deviceProperty={desktopPortrait:{},desktopLandscape:{},tabletPortrait:{},tabletLandscape:{},mobilePortrait:{},mobileLandscape:{}}}return r.prototype.getMode=function(){return this.canvasManager.getMode()},r.prototype.getRawProperty=function(t){if(this.isDeviceProp[t]){var e=this.getMode(),i=this.deviceProperty[e];return i[t]!==n?i[t]:n}return this.property[t]},r.prototype.getProperty=function(t){if(this.isDeviceProp[t]){var e=this.getMode(),i=this.deviceProperty[e],n=this.deviceProperty.desktopPortrait;if("undefined"!=typeof i[t])return i[t];if("undefined"!=typeof n[t])return n[t]}return this.property[t]},r.prototype.historyStore=function(t,e,i){if(!this.isDeleteStarted){var n=this.getMode();this.isDeviceProp[e]&&i!=n?(this.deviceProperty[i][e]=t,this.render(e)):(this.store(e,t,!0,"history"),this.$.trigger("propertyChanged",[e,this.getProperty(e)]))}},r.prototype.store=function(t,e,n,r){var s,o,a=this.getMode();this.isDeviceProp[t]?(s=this.deviceProperty[a][t],o=this.getProperty(t)):o=s=this.property[t];var l=i.history.addValue(this,this.historyStore,[t,a]);l&&l.setValues(s,e),this.property[t]=e,this.isDeviceProp[t]&&(this.deviceProperty[a][t]=e),n&&this.render(t,o,r)},r.prototype.render=function(t,e,i){this.propertyScope[t]["_sync"+t](e,i)},r.prototype.isDimensionPropertyAccepted=function(t){return!(!(t+"").match(/[0-9]+%/)&&"auto"!=t)},r.prototype.changeEditorMode=function(t){var e=parseInt(this.property[t]);e?this._show():this._hide(),this.layer.triggerHandler("LayerShowChange",[t,e]),this.renderModeProperties(!1)},r.prototype.renderModeProperties=function(){for(var t in this.property)this.property[t]=this.getProperty(t),this.$.trigger("propertyChanged",[t,this.property[t]])},r.prototype.historyResetMode=function(e,i){this.deviceProperty[i]=t.extend({},e),i==this.canvasManager.getMode()&&this.renderModeProperties(!0)},r.prototype.resetMode=function(e){if("desktopPortrait"!=e){var n,r=i.history.addValue(this,this.historyResetMode,[e]);r&&r.setValues(t.extend({},this.deviceProperty[e]),{});for(var s in this.deviceProperty[e])this.deviceProperty[e][s]=n;e==this.canvasManager.getMode()&&this.renderModeProperties(!0)}},r.prototype.copyMode=function(e,n){if(e!=n){var r=this.deviceProperty[n];this.deviceProperty[n]=t.extend({},this.deviceProperty[n],this.deviceProperty[e]);var s=i.history.addValue(this,this.historyResetMode,[n]);s&&s.setValues(r,this.deviceProperty[n])}},r.prototype._getDefault=function(t,e){return this.originalProperties[t]!==n?this.originalProperties[t]:e},r.prototype.createProperty=function(t,e,i,r){this.isDeviceProp[t]=!1,this.propertyScope[t]=r||this,i?(this.property[t]=i.data(t.toLowerCase()),this.property[t]===n&&(this.property[t]=this._getDefault(t,e))):this.property[t]=this._getDefault(t,e)},r.prototype.createDeviceProperty=function(t,e,i,r){if(this.isDeviceProp[t]=!0,this.propertyScope[t]=r||this,i){for(var s in this.deviceProperty)this.deviceProperty[s][t]=i.data(s.toLowerCase()+t.toLowerCase()),""===this.deviceProperty[s][t]&&(this.deviceProperty[s][t]=n);for(var s in this.deviceProperty)if(this.deviceProperty[s][t]===n||""===this.deviceProperty[s][t]){var o=this._getDefault(s.toLowerCase()+t.toLowerCase());o!==n&&(this.deviceProperty[s][t]=o)}for(var s in e)this.deviceProperty[s][t]!==n&&""!==this.deviceProperty[s][t]||(this.deviceProperty[s][t]=e[s])}else{for(var s in e)this.deviceProperty[s][t]=e[s];for(var s in this.deviceProperty){var o=this._getDefault(s.toLowerCase()+t.toLowerCase());o!==n&&(this.deviceProperty[s][t]=o)}}this.property[t]=this.deviceProperty.desktopPortrait[t]},r.prototype.removeProperty=function(t){if(delete this.property[t],this.layer.removeData(t.toLowerCase()).removeAttr("data-"+t.toLowerCase()),this.isDeviceProp[t])for(var e in this.deviceProperty)delete this.deviceProperty[e][t],this.layer.removeData(e.toLowerCase()+t.toLowerCase()).removeAttr("data-"+e.toLowerCase()+t.toLowerCase());delete this.isDeviceProp[t],delete this.propertyScope[t]},r.prototype.removeProperties=function(t){for(var e=0;e<t.length;e++)this.removeProperty(t[e])},r.prototype.getPropertiesData=function(t){for(var e={},i=0;i<t.length;i++){var r=t[i];if(this.property[r]!==n&&(e[r]=this.property[r]),this.isDeviceProp[r])for(var s in this.deviceProperty)this.deviceProperty[s][r]!==n&&(e[s.toLowerCase()+r]=this.deviceProperty[s][r])}return e},r.prototype.setProperty=function(t,e,i){this.propertyScope[t]!==n&&("function"==typeof this.propertyScope[t]["setProperty"+t]?this.propertyScope[t]["setProperty"+t](t,e,i):this._setProperty(t,e,i))},r.prototype._setProperty=function(t,e,i){this.store(t,e,!0,i),"manager"!=i&&this.$.trigger("propertyChanged",[t,this.getProperty(t)])},r}),N2Require("CanvasManager",[],["smartSlider"],function(t,e,i,n){"use strict";function r(n,r,s){this.mode="desktopPortrait",this.slideEditManager=n,this.isStatic=r,this.ready=t.Deferred(),this.shouldPreventActivationBubble=!1,this.$=t(this),i.canvasManager=this,this.$highlight=t('<div class="n2-ss-layer-highlight n2-ss-layer-highlight-n" /><div class="n2-ss-layer-highlight n2-ss-layer-highlight-e" /><div class="n2-ss-layer-highlight n2-ss-layer-highlight-s" /><div class="n2-ss-layer-highlight n2-ss-layer-highlight-w" />'),this.initSelectMode(),this.layerWindow=new e.LayerWindow(this),i.$currentSlideElement.data("slide").setZero(),this.layerOptions=new e.ComponentSettings(this),new e.LayerAnimationManager(this),this.ui=new e.CanvasUserInterface(this),this.mainContainer=new e.MainContainer(this),this.itemEditor=new e.ItemManager(this,s),this.mainContainer.lateInit(),this._initDeviceModeChange(),this.canvasSettings=new e.CanvasSettings(this),this.layerOptions.startFeatures(),this.hotkeys(),this.addContextMenu(),this.mainContainer.refreshHasLayers();var o=t("#n2-ss-editor-mode .n2-radio-option"),a=t.proxy(function(t){switch(this.updateEditorMode(t),t){case"content":o.eq(0).addClass("n2-active"),o.eq(1).removeClass("n2-active");break;case"canvas":o.eq(0).removeClass("n2-active"),o.eq(1).addClass("n2-active")}},this);if(this.mainContent&&this.mainContent.container.getLayerCount())a("content");else{var l=this.mainContainer.container.getSortedLayers();if(this.mainContent&&l.length>1||!this.mainContent&&l.length>0)a("canvas");else{var h=t.jStorage.get("editormode");h||(h="content",t.jStorage.set("editormode",h)),a(h)}}o.on("click",t.proxy(function(e){o.removeClass("n2-active");var i=t(e.currentTarget),n=i.data("mode");i.addClass("n2-active"),n!=this.currentEditorMode&&(this.updateEditorMode(n),t.jStorage.set("editormode",n))},this)),this.isMultiDrag=!1}var s={16:0,38:0,40:0,37:0,39:0},o={97:"left",98:"center",99:"right",100:"left",101:"center",102:"right",103:"left",104:"center",105:"right"},a={97:"bottom",98:"bottom",99:"bottom",100:"middle",101:"middle",102:"middle",103:"top",104:"top",105:"top"},l={OFF:0,ON:1,GROUP:2};return r.prototype.updateEditorMode=function(e){this.currentEditorMode=e,t("body").attr("data-editormode",this.currentEditorMode)},r.prototype.getMode=function(){return this.mode},r.prototype.getResponsiveRatio=function(t){return"h"==t?i.frontend.responsive.lastRatios.slideW:"v"==t?i.frontend.responsive.lastRatios.slideH:0},r.prototype.setMainContent=function(t){this.mainContent=t},r.prototype.isGroup=function(t){return t instanceof e.Group},r.prototype.isRow=function(t){return t instanceof e.Row},r.prototype.isCol=function(t){return t instanceof e.Col},r.prototype.isLayer=function(t){return t instanceof e.Layer},r.prototype.isContent=function(t){return t instanceof e.Content},r.prototype._initDeviceModeChange=function(){var e=t("#layerresettodesktop").on("click",t.proxy(this.__onResetToDesktopClick,this));this.resetToDesktopTRElement=e.closest("tr"),this.resetToDesktopGlobalElement=t("#n2-ss-layer-reset-to-desktop").on("click",t.proxy(function(){"block"==this.resetToDesktopTRElement.css("display")&&e.trigger("click")},this));var n=t("#n2-ss-layer-show-on"),r={},s=i.frontend.responsive.parameters.deviceModes;for(var o in s)s[o]&&(r[o]=t('<div class="n2-radio-option"><i class="n2-i n2-it n2-i-'+o+'"></i></div>').on("click",t.proxy(function(t){this.layerOptions.currentForm[t].data("field").onoff.trigger("click")},this,o)).appendTo(n));n.children().first().addClass("n2-first"),n.children().last().addClass("n2-last"),this.globalShowOnDeviceCB=function(t){"undefined"!=typeof r[t]&&r[t].toggleClass("n2-active",1==this.layerOptions.currentForm[t].val())},this.layerOptions.forms.global.desktopPortrait.on("nextendChange",t.proxy(this.globalShowOnDeviceCB,this,"desktopPortrait")),this.layerOptions.forms.global.desktopLandscape.on("nextendChange",t.proxy(this.globalShowOnDeviceCB,this,"desktopLandscape")),this.layerOptions.forms.global.tabletPortrait.on("nextendChange",t.proxy(this.globalShowOnDeviceCB,this,"tabletPortrait")),this.layerOptions.forms.global.tabletLandscape.on("nextendChange",t.proxy(this.globalShowOnDeviceCB,this,"tabletLandscape")),this.layerOptions.forms.global.mobilePortrait.on("nextendChange",t.proxy(this.globalShowOnDeviceCB,this,"mobilePortrait")),this.layerOptions.forms.global.mobileLandscape.on("nextendChange",t.proxy(this.globalShowOnDeviceCB,this,"mobileLandscape")),this.layerOptions.forms.component.group.desktopPortrait.on("nextendChange",t.proxy(this.globalShowOnDeviceCB,this,"desktopPortrait")),this.layerOptions.forms.component.group.desktopLandscape.on("nextendChange",t.proxy(this.globalShowOnDeviceCB,this,"desktopLandscape")),this.layerOptions.forms.component.group.tabletPortrait.on("nextendChange",t.proxy(this.globalShowOnDeviceCB,this,"tabletPortrait")),this.layerOptions.forms.component.group.tabletLandscape.on("nextendChange",t.proxy(this.globalShowOnDeviceCB,this,"tabletLandscape")),this.layerOptions.forms.component.group.mobilePortrait.on("nextendChange",t.proxy(this.globalShowOnDeviceCB,this,"mobilePortrait")),this.layerOptions.forms.component.group.mobileLandscape.on("nextendChange",t.proxy(this.globalShowOnDeviceCB,this,"mobileLandscape")),t("#layershow").data("field").setAvailableDevices(s),t("#layergroup-show").data("field").setAvailableDevices(s),this.__onChangeDeviceOrientation(),i.frontend.sliderElement.on("SliderDeviceOrientation",t.proxy(function(){this.__onChangeDeviceOrientation()},this)),this.ready.resolve()},r.prototype.refreshMode=function(){this.__onChangeDeviceOrientation(),i.frontend.responsive.reTriggerSliderDeviceOrientation()},r.prototype.__onChangeDeviceOrientation=function(){this.mode=i.frontend.responsive.getNormalizedModeString(),this.resetToDesktopTRElement.css("display","desktopPortrait"==this.mode?"none":""),this.resetToDesktopGlobalElement.css("display","desktopPortrait"==this.mode?"none":""),this.mainContainer.container.changeEditorModes(this.mode)},r.prototype.__onResetToDesktopClick=function(){if(this.mainContainer.getSelectedLayer()){var t=this.getMode();this.mainContainer.getSelectedLayer().resetMode(t)}},r.prototype.copyOrResetMode=function(t){var e=this.getMode();"desktopPortrait"==e?"desktopPortrait"!=t&&this.mainContainer.container.resetModes(t):t==e?this.mainContainer.container.resetModes(t):this.mainContainer.container.copyModes(e,t)},r.prototype.getSnap=function(){return this.canvasSettings.get("n2-ss-snap-to-enabled")?t(this.isStatic?".n2-ss-static-slide .n2-ss-layer.ui-resizable:not(.n2-ss-layer-locked):not(.n2-ss-layer-parent):not(.n2-ss-layer-selected):visible, .n2-ruler-user-guide":".n2-ss-slide.n2-ss-slide-active .n2-ss-layer.ui-resizable:not(.n2-ss-layer-locked):not(.n2-ss-layer-parent):not(.n2-ss-layer-selected):visible, .n2-ruler-user-guide"):!1},r.prototype.getHTML=function(){for(var e=t("<div></div>"),i=this.mainContainer.container.getAllLayers(),n=0;n<i.length;n++)e.append(i[n].getHTML(!0));return e.html()},r.prototype.getData=function(){return this.mainContainer.container.getData()},r.prototype.importLayers=function(e,i){var n=(this.mainContainer,t.extend(!0,[],e));i&&this.mainContainer.deleteLayers(),this._idTranslation={};for(var r=this.dataToLayers(n),s=0;s<r.length;s++)this.mainContainer.container.append(r[s]);if(this.refreshMode(),!this.mainContainer.getSelectedLayer()){var n=this.mainContainer.container.getSortedLayers();n.length>0&&n[0].activate()}},r.prototype.loadComponentWithNode=function(t,e,i,n){var r=t.container.append(e);return n&&this.refreshMode(),r},r.prototype.insertComponentWithNode=function(t,e,i,n,r){var s=t.container.insertAt(e,i);return r&&this.refreshMode(),s},r.prototype.fixActiveLayer=function(){var t=this.mainContainer.getSelectedLayer();(0==t||t.isDeleted)&&this.resetActiveLayer()},r.prototype.resetActiveLayer=function(){var t=this.mainContainer.container.getSortedLayers();t.length?t[t.length-1].activate():this.changeActiveLayer(null)},r.prototype.changeActiveLayer=function(e,i){var n=this.mainContainer.getSelectedLayer();n&&!n.isDeleted&&(n.$.off("propertyChanged.editor").off(".active"),n.deActivate()),this.mainContainer.activeLayer=e,i||this.exitSelectMode(),e&&(this.layerOptions.changeActiveComponent(e,e.type,e.placement.getType(),e.property),e.$.on({"propertyChanged.editor":t.proxy(this.layerOptions.onUpdateField,this.layerOptions),"placementChanged.active":t.proxy(function(t,i,n){this.layerOptions.changeActiveComponentPlacement(i,e.property)},this)}),e.animations.activate()),this.$.trigger("activeLayerChanged")},r.prototype.highlight=function(t){this.$highlight.appendTo(t.layer)},r.prototype.deHighlight=function(t){this.$highlight.detach()},r.prototype["delete"]=function(){this.mainContainer.getSelectedLayer()&&this.doActionOnActiveLayer("delete")},r.prototype.duplicate=function(){this.mainContainer.getSelectedLayer()&&this.doActionOnActiveLayer("duplicate",[this.selectMode!=l.ON,!1])},r.prototype.copy=function(e){var i;if(e==n)if(1==this.selectMode)i=this.selectedLayers;else{var r=this.mainContainer.getSelectedLayer();r&&(i=this.isCol(r)||this.isContent(r)?r.container.getSortedLayers():[r])}else i=this.isCol(e)||this.isContent(e)?e.container.getSortedLayers():[e];var s=this.mainContainer.getLayerData(i);s.length&&t.jStorage.set("ss3layersclipboard",JSON.stringify(s))},r.prototype.paste=function(e){var i=t.jStorage.get("ss3layersclipboard");if(i){var r=JSON.parse(i);if(r.length){var s;s=e!==n&&e?this.isCol(e)||this.isContent(e)?e:e.group:this.mainContainer.getActiveGroup(),this.mainContainer.addLayers(r,s)}}},r.prototype.hasLayersOnClipboard=function(){return!!t.jStorage.get("ss3layersclipboard")},r.prototype.addContextMenu=function(){t("#n2-ss-0 .n2-ss-currently-edited-slide").nextendContextMenu({
onShow:t.proxy(function(e,i){var n=t(e.target),r=n.closest(".n2-ss-layer"),s=r.data("layerObject");s||(s=this.mainContainer.getSelectedLayer()),s&&(this.isCol(s)||this.isContent(s)?i.addItem("Copy child layers","n2-i-copy",t.proxy(function(){this.copy(s)},this)):i.addItem("Copy layer","n2-i-copy",t.proxy(function(){this.selectMode==l.ON?this.copy():this.copy(s)},this))),this.hasLayersOnClipboard()&&i.addItem("Paste layer(s)","n2-i-paste",t.proxy(function(){this.paste(s)},this)),i.addItem("Copy slide","n2-i-copy",t.proxy(function(){this.slideEditManager.copySlide()},this)),this.slideEditManager.hasCopiedSlide()&&i.addItem("Paste slide","n2-i-paste",t.proxy(function(){this.slideEditManager.pasteSlide()},this))},this)})},r.prototype.initSelectMode=function(){this.selectMode=l.OFF,this.selectedLayers=[],t(".n2-ss-layer-list-top-bar .n2-button").on("mousedown",t.proxy(function(e){switch(e.preventDefault(),t(e.currentTarget).data("action")){case"delete":this["delete"]();break;case"duplicate":this.duplicate();break;case"group":this.createGroupFromSelected();break;case"cancel":this.exitSelectMode()}},this))},r.prototype.startSelection=function(t){t?(this.selectMode==l.ON&&this.exitSelectMode(),this.changeSelectMode(l.GROUP)):this.changeSelectMode(l.ON)},r.prototype.changeSelectMode=function(e){var i=this.selectMode;i!=e&&(i==l.ON?t("#n2-admin").removeClass("n2-ss-select-layer-mode-on"):i==l.GROUP&&t("#n2-admin").removeClass("n2-ss-select-layer-mode-group"),this.selectMode=e,i==l.GROUP&&e==l.ON&&this.selectedLayers[0].activate(null,null,!0),e==l.OFF?t("#n2-admin").removeClass("n2-ss-select-layer-mode"):(t("#n2-admin").addClass("n2-ss-select-layer-mode"),e==l.ON?t("#n2-admin").addClass("n2-ss-select-layer-mode-on"):e==l.GROUP&&t("#n2-admin").addClass("n2-ss-select-layer-mode-group")),this.selectMode==l.OFF?t("body").off(".n2-ss-selection"):t("body").on("mousedown.n2-ss-selection",t.proxy(function(t){3!=event.which&&"main"==nextend.context.getCurrentWindow()&&nextend.context.mouseDownArea===!1&&this.exitSelectMode()},this)))},r.prototype.endSelection=function(t){t&&this.selectMode==l.GROUP&&this.exitSelectMode()},r.prototype.selectLayer=function(t,e){if("layer"!=t.type)return!0;if(this.selectMode!=l.ON){var i=this.mainContainer.getSelectedLayer();if("layer"!=i.type)return t.activate(null),!0;this.startSelection(!1),e&&this.selectedLayers.push(i)}return this._selectLayer(t),!0},r.prototype._selectLayer=function(e){var i=t.inArray(e,this.selectedLayers);if(-1!=i){if(this.selectMode==l.ON&&this.selectedLayers.length<=1)return this.exitSelectMode(),!1;var n=this.selectedLayers[i];if(this.selectedLayers.splice(i,1),e.layerRow.removeClass("n2-selected"),e.layer.removeClass("n2-ss-layer-selected"),this.selectMode==l.ON&&this.selectedLayers.length<=1)return this.selectedLayers[0].activate(),this.exitSelectMode(),!1;n===this.mainContainer.getSelectedLayer()&&this.selectedLayers[0].activate(!1,null,!0)}else{for(var r=this.selectedLayers.length,s=0;s<this.selectedLayers.length;s++)if(e.layer.add(this.selectedLayers[s].layer).index(this.selectedLayers[s].layer)>0){r=s;break}this.selectedLayers.splice(r,0,e)}for(var s=0;s<this.selectedLayers.length;s++)this.selectedLayers[s].layerRow.addClass("n2-selected"),this.selectedLayers[s].layer.addClass("n2-ss-layer-selected")},r.prototype.addSelection=function(t,e){e||this.changeSelectMode(l.ON);for(var i=0;i<t.length;i++)this._selectLayer(t[i],!1)},r.prototype.exitSelectMode=function(){if(this.selectMode){for(var e=0;e<this.selectedLayers.length;e++)this.selectedLayers[e]!=this.mainContainer.getSelectedLayer()&&this.selectedLayers[e].layerRow.removeClass("n2-active"),this.selectedLayers[e].layerRow.removeClass("n2-selected"),this.selectedLayers[e].layer.removeClass("n2-ss-layer-selected");t("#n2-admin").removeClass("n2-ss-select-layer-mode"),this.selectedLayers=[],this.changeSelectMode(l.OFF)}},r.prototype.doActionOnActiveLayer=function(e,i){if(this.selectMode==l.ON)for(var n=t.extend([],this.selectedLayers),r=0;r<n.length;r++)n[r][e].apply(n[r],i);else{var s=this.mainContainer.getSelectedLayer();s&&s[e].apply(s,i)}},r.prototype.canvasDragStart=function(t,e){if(this.selectMode&&"canvas"==this.currentEditorMode&&"absolute"==e.mode){for(var i=!1,n=0;n<this.selectedLayers.length;n++){var r=this.selectedLayers[n],s=r.layer;if(s[0]!=e.layer.layer[0]){var o=s.css("display");"none"==o&&s.css("display",""),r._originalPosition=s.position(),"none"==o&&s.css("display","none")}else i=!0}i||this.exitSelectMode(),this.isMultiDrag=!0}},r.prototype.canvasDragMove=function(t,e){if(this.isMultiDrag===!0)for(var i={left:e.position.left+e.canvasOffset.left-e.originalOffset.left,top:e.position.top+e.canvasOffset.top-e.originalOffset.top},n=0;n<this.selectedLayers.length;n++){var r=this.selectedLayers[n];if(!this.isGroup(r)){var s=r.layer;s[0]!=e.layer.layer[0]&&(s.css({left:r._originalPosition.left+i.left,top:r._originalPosition.top+i.top,bottom:"auto",right:"auto"}),r.placement.doAction("triggerLayerResized"))}}},r.prototype.canvasDragStop=function(t,e){if(this.isMultiDrag===!0){for(var i=0;i<this.selectedLayers.length;i++){var n=this.selectedLayers[i];if(!this.isGroup(n)){var r=n.layer;if(r[0]!=e.layer.layer[0]){var s=r.css("display");"none"==s&&r.css("display","block");var o=parseInt(n.layer.css("left")),a=parseInt(n.layer.css("top"));n.placement.current.setPosition(o,a),n.placement.doAction("triggerLayerResized"),"none"==s&&r.css("display","none")}}}return this.isMultiDrag=!1,!0}return!1},r.prototype.historyDeleteGroup=function(t){t.getSelf()["delete"]()},r.prototype.historyCreateGroup=function(t){var i=new e.Group(this,this.mainContainer,{},null);i.create(),t.setSelf(i)},r.prototype.createGroupFromSelected=function(){var t;switch(this.selectMode){case l.ON:t=new e.Group(this,this.mainContainer,{},null),t.create(),i.history.addSimple(this,this.historyDeleteGroup,this.historyCreateGroup,[t]),t.addLayers(this.selectedLayers),this.exitSelectMode(),t.activate();break;case l.OFF:var n=this.mainContainer.getSelectedLayer();n.group instanceof e.Group?n.group.activate():(t=new e.Group(this,this.mainContainer,{},null),t.create(),i.history.addSimple(this,this.historyDeleteGroup,this.historyCreateGroup,[t]),t.addLayers([n]),t.activate());break;case l.GROUP:}},r.prototype.createRow=function(t){var i=new e.Row(this,t,{});return i.create(),i.hightlightStructure(),{layer:i}},r.prototype.createCol=function(t){var e=t,i=null;if(this.isCol(e))i=e.group.createCol();else if(this.isRow(e))i=e.createCol();else{if(!this.isCol(e.group))return this.createRow(t);i=e.group.group.createCol()}return i.activate(null),{layer:i}},r.prototype.preventActivationBubbling=function(){return this.shouldPreventActivationBubble?!1:(this.shouldPreventActivationBubble=!0,!0)},r.prototype.allowActivation=function(){this.shouldPreventActivationBubble=!1},r.prototype.hotkeys=function(){t(window).on({keydown:t.proxy(function(e){if(!("TEXTAREA"==e.target.tagName||"INPUT"==e.target.tagName||i.layerAnimationManager&&i.layerAnimationManager.timelineControl&&i.layerAnimationManager.timelineControl.isActivated())){var n=this.mainContainer.getSelectedLayer(),r=e.keyCode;if(r>=49&&57>=r){var l=e.originalEvent.location||e.originalEvent.keyLocation||0;3==l&&(r+=48)}if(n)if(46==r||8==r)this["delete"](),e.preventDefault();else if(35==r)this.duplicate(),e.preventDefault();else if(16==r)s[r]=1;else if(38==r){if(!s[r]){var h=t.proxy(function(){this.doActionOnActiveLayer("moveY",[-1*(s[16]?10:1)])},this);h(),s[r]=setInterval(h,100)}e.preventDefault()}else if(40==r){if(!s[r]){var h=t.proxy(function(){this.doActionOnActiveLayer("moveY",[s[16]?10:1])},this);h(),s[r]=setInterval(h,100)}e.preventDefault()}else if(37==r){if(!s[r]){var h=t.proxy(function(){this.doActionOnActiveLayer("moveX",[-1*(s[16]?10:1)])},this);h(),s[r]=setInterval(h,100)}e.preventDefault()}else if(39==r){if(!s[r]){var h=t.proxy(function(){this.doActionOnActiveLayer("moveX",[s[16]?10:1])},this);h(),s[r]=setInterval(h,100)}e.preventDefault()}else if(r>=97&&105>=r){var d=o[r],p=a[r],c=!1;this.layerOptions.forms.placement.absolute.align.val()==d&&this.layerOptions.forms.placement.absolute.valign.val()==p&&(c=!0),this.layerOptions.layerFeatures.horizontalAlign(d,c),this.layerOptions.layerFeatures.verticalAlign(p,c)}else if(65==r){e.preventDefault();var u=this.mainContainer.getSelectedLayer();u&&"absolute"==u.placement.getType()&&u.placement.current.fit()}(e.ctrlKey||e.metaKey)&&(90==r?e.shiftKey?i.history.redo()&&e.preventDefault():i.history.undo()&&e.preventDefault():71==r?(this.createGroupFromSelected(),e.preventDefault()):68==r?(e.preventDefault(),this.slideEditManager.copySlide()):70==r?(e.preventDefault(),this.slideEditManager.pasteSlide()):67==r?this.copy():86==r&&this.paste())}},this),keyup:t.proxy(function(t){"undefined"!=typeof s[t.keyCode]&&s[t.keyCode]&&(clearInterval(s[t.keyCode]),s[t.keyCode]=0)},this)})},r.prototype.getSelf=function(){return this},r}),N2Require("CanvasUserInterface",[],["smartSlider"],function(t,e,i,n){"use strict";function r(e){this.canvasManager=e,this.isShown=!t.jStorage.get("ssLayersShown",!1),this.tlHeight=t.jStorage.get("ssLayersHeight")||200,this.$container=t("#n2-ss-layers"),this.fixScroll(),this.switchLayerList(),this.topBar=t(".n2-ss-layer-list-top-bar").on("mousedown",t.proxy(this.resizeStart,this)),this.topBar.find(".n2-ss-layer-list-opener").on("click",t.proxy(function(t){t.preventDefault(),this.switchLayerList()},this)),t(".n2-ss-slide-show-layers").on("click",t.proxy(function(t){t.preventDefault(),this.switchLayerList()},this)),this.onResize(),t(window).on("resize",t.proxy(this.onResize,this))}return r.prototype.onResize=function(){this.$container.width(this.$container.parent().width()+2);var t=this.$container.height();this.paneLeft.height(t-48),this.paneRight.height(t-48)},r.prototype.onActivateLayer=function(t){var e=this.paneLeft.scrollTop(),i=0,n=t;do i+=n.layerRow.get(0).offsetTop,n=n.group;while(n!==this.canvasManager.mainContainer);(e>i||i>e+this.paneLeft.height()-40)&&(this.paneLeft.scrollTop(i),this.paneRight.scrollTop(i))},r.prototype.fixScroll=function(){this.paneLeft=t(".n2-ss-layers-sidebar-rows"),this.paneRight=t(".n2-ss-timeline-content-layers-container");var e=t.proxy(function(t){var e=this.paneLeft.scrollTop();t.originalEvent.deltaY>0?e+=40:e-=40,e=40*Math.round(e/40),this.paneLeft.scrollTop(e),this.paneRight.scrollTop(e),t.preventDefault()},this);this.paneLeft.on("mousewheel",e),this.paneLeft.on("scroll",t.proxy(function(t){var e=this.paneLeft.scrollTop();this.paneRight.scrollTop(e),t.preventDefault()},this)),this.paneRight.on("mousewheel",e)},r.prototype.resizeStart=function(e){this.isShown&&(e.target==this.topBar[0]||t(e.target).hasClass("n2-h2"))&&(e.preventDefault(),this.startY=e.clientY,this.height=this.$container.height(),t("body").on({"mousemove.n2-ss-tl-resize":t.proxy(this.resizeMove,this),"mouseup.n2-ss-tl-resize":t.proxy(this.resizeStop,this),"mouseleave.n2-ss-tl-resize":t.proxy(this.resizeStop,this)}))},r.prototype.resizeMove=function(t){t.preventDefault(),this.setTLHeight(this._calculateDesiredHeight(t))},r.prototype.resizeStop=function(e){e.preventDefault(),t("body").off(".n2-ss-tl-resize");var i=this._calculateDesiredHeight(e);this.setTLHeight(i),this.tlHeight=i,t.jStorage.set("ssLayersHeight",i),t("#n2-admin").triggerHandler("resize")},r.prototype._calculateDesiredHeight=function(t){var e=this.startY-t.clientY+this.height-48;return this.__calculateDesiredHeight(e)},r.prototype.__calculateDesiredHeight=function(t){return 40*Math.round(Math.min(Math.max(40,t),(window.innerHeight||document.documentElement.clientHeight)/2)/40)+48},r.prototype.switchLayerList=function(){this.isShown=!this.isShown,this.$container.toggleClass("n2-active",this.isShown),this.isShown?this.setTLHeight(this.tlHeight):this.setTLHeight(48),t.jStorage.set("ssLayersShown",this.isShown)},r.prototype.setTLHeight=function(t){t=Math.max(48,t),this.$container.height(t),t=this.$container.height(),this.paneLeft.height(t-48),this.paneRight.height(t-48),nextend.triggerResize()},r.prototype.activateAdd=function(t,e){this.$add.css({left:t,top:e}).appendTo(this.$container)},r}),N2Require("LayerFeatures",[],["smartSlider"],function(t,e,i,n){"use strict";function r(t,e){this.fields=t,this.canvasManager=e,this.initParentLinker(),this.initAlign(),this.initEvents()}var s={left:0,center:1,right:2,top:0,middle:1,bottom:2};return r.prototype.initParentLinker=function(){var e=this.fields.parentid.data("field");t("#n2-ss-layer-parent-linker").on({click:function(t){e.click(t)}})},r.prototype.initAlign=function(){this.layerDefault={align:null,valign:null};var e=t("#n2-ss-layer-horizontal-align .n2-radio-option"),i=t("#n2-ss-layer-vertical-align .n2-radio-option");e.add(i).on("click",t.proxy(function(n){if(n.ctrlKey||n.metaKey){var r=t(n.currentTarget),s=r.hasClass("n2-sub-active"),o=r.data("align");switch(o){case"left":case"center":case"right":e.removeClass("n2-sub-active"),s?(t.jStorage.set("ss-item-horizontal-align",null),this.layerDefault.align=null):(t.jStorage.set("ss-item-horizontal-align",o),this.layerDefault.align=o,r.addClass("n2-sub-active"));break;case"top":case"middle":case"bottom":i.removeClass("n2-sub-active"),s?(t.jStorage.set("ss-item-vertical-align",null),this.layerDefault.valign=null):(t.jStorage.set("ss-item-vertical-align",o),this.layerDefault.valign=o,r.addClass("n2-sub-active"))}}else if(this.canvasManager.mainContainer.getSelectedLayer()){var o=t(n.currentTarget).data("align");switch(o){case"left":case"center":case"right":this.horizontalAlign(o,!0);break;case"top":case"middle":case"bottom":this.verticalAlign(o,!0)}}},this)),this.fields.align.on("nextendChange",t.proxy(function(){switch(e.removeClass("n2-active"),this.fields.align.val()){case"left":e.eq(0).addClass("n2-active");break;case"center":e.eq(1).addClass("n2-active");break;case"right":e.eq(2).addClass("n2-active")}},this)),this.fields.valign.on("nextendChange",t.proxy(function(){switch(i.removeClass("n2-active"),this.fields.valign.val()){case"top":i.eq(0).addClass("n2-active");break;case"middle":i.eq(1).addClass("n2-active");break;case"bottom":i.eq(2).addClass("n2-active")}},this));var n=t.jStorage.get("ss-item-horizontal-align",null),r=t.jStorage.get("ss-item-vertical-align",null);null!=n&&(e.eq(s[n]).addClass("n2-sub-active"),this.layerDefault.align=n),null!=r&&(i.eq(s[r]).addClass("n2-sub-active"),this.layerDefault.valign=r)},r.prototype.horizontalAlign=function(t,e){this.fields.align.val()!=t?this.fields.align.data("field").options.eq(s[t]).trigger("click"):e&&this.fields.left.val(0).trigger("change")},r.prototype.verticalAlign=function(t,e){this.fields.valign.val()!=t?this.fields.valign.data("field").options.eq(s[t]).trigger("click"):e&&this.fields.top.val(0).trigger("change")},r.prototype.initEvents=function(){var e=t("#n2-tab-events"),i=e.find(".n2-h3"),n=i.html(),r=t('<div class="n2-editor-header n2-h2 n2-uc"><span>'+n+"</span></div>");i.replaceWith(r)},r}),N2Require("LayerWindow",[],["smartSlider"],function(t,e,i,n){"use strict";function r(e){this.isMinimized=!1,this.detachedPosition={left:t.jStorage.get("ssPanelLeft")||200,top:t.jStorage.get("ssPanelTop")||100,height:t.jStorage.get("ssPanelHeight")||400},this.hasBreadcrumb=!1,this.lastHeight=this.detachedPosition.height,this.admin=t("#n2-admin"),this.sidebar=t("#n2-ss-layer-window").on("mousedown",t.proxy(nextend.context.setMouseDownArea,nextend.context,"sidebarClicked")),this.title=this.sidebar.find(".n2-ss-layer-window-title-inner"),this.sidebarTD=this.sidebar.parent(),this.canvasManager=e,i.layerWindow=this,this.viewPanes={layerEdit:t("#n2-tabbed-slide-editor-settings > .n2-tabs").addClass("n2-scrollable")};for(var n in this.viewPanes)this.viewPanes[n].on("DOMMouseScroll mousewheel",function(e){var i=!1;e.originalEvent&&(e.originalEvent.wheelDelta&&(i=e.originalEvent.wheelDelta/-1<0),e.originalEvent.deltaY&&(i=e.originalEvent.deltaY<0),e.originalEvent.detail&&(i=e.originalEvent.detail<0));var n=function(){return e.stopPropagation(),e.preventDefault(),e.returnValue=!1,!1};return!i&&this.scrollHeight<=t(this).innerHeight()+this.scrollTop+1?n():i&&0>=this.scrollTop-1?n():void 0});this.panelHeading=t("#n2-tabbed-slide-editor-settings").find(".n2-sidebar-tab-switcher .n2-td");var r=this.sidebar.find(".n2-ss-layer-window-title-nav-left");t('<a href="#"><i class="n2-i n2-i-minimize n2-i-grey-opacity"></i></a>').on("click",t.proxy(function(t){t.preventDefault(),this.toggleMinimize()},this)).appendTo(r);var s=this.sidebar.find(".n2-ss-layer-window-title-nav-right");t('<a href="#"><i class="n2-i n2-i-closewindow n2-i-grey-opacity"></i></a>').on("click",t.proxy(function(t){t.preventDefault(),this.hide()},this)).appendTo(s),nextend.tooltip.add(s),this.$breadcrumb=t('<div class="n2-ss-layer-window-breadcrumb"></div>').insertAfter("#n2-tabbed-slide-editor-settings > .n2-sidebar-tab-switcher");var o=t("#n2-ss-add-sidebar");t(".n2-ss-add-layer-button").on("click",function(e){e.preventDefault(),t("#n2-ss-layers-switcher > .n2-labels .n2-td").eq(0).trigger("click"),o.toggleClass("n2-active")}),t(".n2-ss-core-item").on("click",function(t){o.removeClass("n2-active")});var a=t("#wpadminbar, .navbar-fixed-top").height()+t(".n2-top-bar").height();this.$verticalBarInner=t(".n2-ss-add-sidebar-inner").each(function(){var e=t(this);e.fixTo(e.parent(),{top:a})}),this.$resizeInnerContainer=t("#n2-ss-layers-switcher_0, #n2-ss-layers-switcher_1"),this.extraHeightToRemove=60,this.$resizeInnerContainer.length||(this.extraHeightToRemove=0,this.$resizeInnerContainer=this.$verticalBarInner),this.$resizeInnerContainer.css("overflow","auto"),this.detach(),t("#n2-admin").on("resize",t.proxy(this.resizeVerticalBar,this)),t(window).on("resize",t.proxy(this.onResize,this)),t(".n2-ss-slide-duplicate-layer").on("click",t.proxy(function(t){t.preventDefault(),this.duplicate()},this.canvasManager)),t(".n2-ss-slide-delete-layer").on("click",t.proxy(function(t){t.preventDefault(),this["delete"]()},this.canvasManager)),t("body").on("mousedown",t.proxy(function(t){"main"==nextend.context.getCurrentWindow()&&nextend.context.mouseDownArea===!1&&this.hide()},this));var l=t('<div id="n2-ss-devicespecific-settings"></div>'),h=nextend.smartSlider.frontend.responsive.parameters.deviceModes;for(var n in h)if(h[n]){var d=n.replace(/([A-Z])/g," $1").split(" "),p=d[0],c=d[1].toLowerCase();l.append('<i class="n2-i n2-it n2-i-mini-'+p+"-"+c+'" data-device="'+p+'" data-orientation="'+c+'"></i>')}var u={mouseenter:t.proxy(function(t){l.appendTo(t.currentTarget)},this),mouseleave:t.proxy(function(t){l.detach()},this)};this.sidebar.find("[data-devicespecific] label").prepend('<span class="n2-i n2-i-mini-desktop-portrait"></span>'),this.sidebar.find("[data-devicespecific] label").on(u),l.find(".n2-i").on({click:t.proxy(function(e){e.preventDefault();var i=t(e.currentTarget);t("#n2-ss-devices").find('[data-device="'+i.data("device")+'"][data-orientation="'+i.data("orientation")+'"]').trigger("click")},this)})}return r.prototype.toggleMinimize=function(){this.isMinimized=!this.isMinimized,this.sidebar.toggleClass("n2-ss-layer-window-minized",this.isMinimized),this.isMinimized||this.onResize()},r.prototype.show=function(e,i){this.setTitle(e),t("body").addClass("n2-ss-layer-edit-visible")},r.prototype._show=function(){t("body").addClass("n2-ss-layer-edit-visible")},r.prototype.hide=function(){t("body").removeClass("n2-ss-layer-edit-visible")},r.prototype.isVisible=function(){return t("body").hasClass("n2-ss-layer-edit-visible")},r.prototype.hideWithDeferred=function(e){t("body").hasClass("n2-ss-layer-edit-visible")&&(this.hide(),e.done(t.proxy(this._show,this)))},r.prototype.setTitle=function(t){this.title.html(t.getName()),this.updateGroupTitle(t)},r.prototype.updateGroupTitle=function(e){var i;for(this.$breadcrumb.html(""),i=0;5>i&&(t('<span class="n2-window-title-structure-nav"><span>'+e.label+'</span><span class="n2-i n2-it n2-i-mini-arrow-thin"></span></span>').on({mouseenter:t.proxy(function(){this.canvasManager.highlight(this)},e),mouseleave:t.proxy(function(){this.canvasManager.deHighlight(this)},e),click:t.proxy(function(t){this.canvasManager.deHighlight(this),this.activate(t)},e)}).prependTo(this.$breadcrumb),e.group&&e.group!==this.canvasManager.mainContainer);i++)e=e.group;this.hasBreadcrumb=i>0,this.$breadcrumb.toggleClass("n2-has-breadcrumb",this.hasBreadcrumb),this.onResize()},r.prototype.getLayerEditExcludedHeight=function(){return 85+(this.hasBreadcrumb?23:0)},r.prototype.resizeVerticalBar=function(){this.$resizeInnerContainer.height((window.innerHeight||document.documentElement.clientHeight)-(t("#n2-ss-layers").is(":visible")&&t("#n2-ss-layers").hasClass("n2-active")?t("#n2-ss-layers").height():0)-t("#wpadminbar, .navbar-fixed-top").height()-t(".n2-top-bar").height()-this.extraHeightToRemove)},r.prototype.onResize=function(){this.sidebar.css("display","block"),this.resizeVerticalBar();var t=window.innerHeight||document.documentElement.clientHeight,e=this.sidebar.height()-this.getLayerEditExcludedHeight();this.viewPanes.layerEdit.height(e);var i={},n=window.innerWidth||document.documentElement.clientWidth,r=this.sidebar[0].getBoundingClientRect();r.left<0?i.left=0:r.left+r.width>n&&(i.left=Math.max(0,n-r.width)),r.height>t-r.top&&(i.top=t-r.top-r.height+r.top,i.top<0&&(this.lastHeight=i.height=r.height+i.top,i.top=0)),this.sidebar.css(i),this.sidebar.css("display","")},r.prototype.detach=function(){this.sidebar.css(this.detachedPosition),this.sidebar.appendTo(this.admin),this.admin.addClass("n2-sidebar-hidden"),t(window).off(".n2-ss-panel"),this.sidebar.removeClass("n2-sidebar-fixed"),this.sidebar.draggable({distance:5,handle:".n2-ss-layer-window-title",containment:"window",stop:t.proxy(function(e,i){this.sidebar.css("height",this.lastHeight);var n=this.sidebar[0].getBoundingClientRect();this.detachedPosition.left=n.left,this.detachedPosition.top=n.top,t.jStorage.set("ssPanelLeft",n.left),t.jStorage.set("ssPanelTop",n.top)},this),scroll:!1}).resizable({distance:5,handles:"s",stop:t.proxy(function(e,i){this.lastHeight=this.detachedPosition.height=this.sidebar.height(),t.jStorage.set("ssPanelHeight",this.detachedPosition.height)},this),create:t.proxy(function(e,i){t(e.target).find(".ui-resizable-handle").addClass("n2-ss-layer-window-resizer")},this)}),this.onResize(),nextend.triggerResize()},r.prototype.switchTab=function(t){this.panelHeading.filter('[data-tab="'+t+'"]').trigger("click")},r}),N2Require("PositionDisplay",[],["smartSlider"],function(t,e,i,n){"use strict";function r(){this.currentSource="",t(window).ready(t.proxy(this.ready,this))}return r.prototype.ready=function(){this.$body=t("body"),this.$el=t('<div class="n2 n2-ss-position-display"/>').appendTo("body")},r.prototype.show=function(t){""==this.currentSource&&(this.currentSource=t,this.$el.addClass("n2-active"),this.$body.addClass("n2-position-display-active"))},r.prototype.update=function(t,e,i){this.currentSource==e&&this.$el.html(i).css({left:t.pageX+10,top:t.pageY+10})},r.prototype.hide=function(t){this.currentSource!=t&&t!==n||(this.$body.removeClass("n2-position-display-active"),this.$el.removeClass("n2-active"),this.currentSource="")},i.positionDisplay=new r,r}),N2Require("Ruler",[],["smartSlider"],function(t,e,i,n){"use strict";function r(e){this.showGuides=1,this.guides=[],this.container=t('<div class="n2-ruler-container" />').appendTo("#n2-ss-slide-canvas-container-inner .n2-ss-slider-outer-container"),this.scale=10,this.vertical=t('<div class="n2-ruler n2-ruler-vertical unselectable"></div>').appendTo(".n2-ss-slider-real-container"),this.horizontal=t('<div class="n2-ruler n2-ruler-horizontal unselectable"></div>').appendTo(this.container),this.verticalSpans=t(),this.horizontalSpans=t(),this.onResize(),nextend.smartSlider.frontend.sliderElement.on("SliderResize",t.proxy(this.onSliderResize,this)),t(window).on("resize",t.proxy(this.onResize,this)),this.horizontal.on("mousedown",t.proxy(function(t){this.showGuides&&new o(this,this.horizontal,t)},this)),this.vertical.on("mousedown",t.proxy(function(t){this.showGuides&&new a(this,this.vertical,t)},this));try{e=t.extend({vertical:[],horizontal:[]},JSON.parse(Base64.decode(e)));for(var i=0;i<e.horizontal.length;i++){var n=new o(this,this.horizontal);n.setPosition(e.horizontal[i])}for(var i=0;i<e.vertical.length;i++){var n=new a(this,this.vertical);n.setPosition(e.vertical[i])}}catch(r){}nextend.ruler=this,this.measureToolVertical(),this.measureToolHorizontal()}function s(e,i,n){this.ruler=e,this.container=i,this.position=0,this.guide=t('<div class="n2-ruler-guide n2-ruler-user-guide"><div class="n2-ruler-guide-border"></div><div class="n2-ruler-guide-handle"></div></div>').appendTo(i).on("mousedown",t.proxy(function(t){t.preventDefault(),t.stopPropagation(),nextend.smartSlider.canvasManager.canvasSettings.settings["n2-ss-lock-guides"]||this["delete"]()},this)),this.ruler.addGuide(this),n&&this.create(n)}function o(){s.prototype.constructor.apply(this,arguments)}function a(){s.prototype.constructor.apply(this,arguments)}return r.prototype.addGuide=function(t){this.guides.push(t)},r.prototype.removeGuide=function(e){this.guides.splice(t.inArray(e,this.guides),1)},r.prototype.clearGuides=function(){for(var t=this.guides.length-1;t>=0;t--)this.guides[t]["delete"]()},r.prototype.onSliderResize=function(t,e){this.onResize()},r.prototype.onResize=function(){var e=nextend.smartSlider.frontend.responsive.responsiveDimensions,i=Math.max(e.slider.width,t("#n2-ss-slide-canvas-container").outerWidth(!0)-40),n=Math.max(e.slider.height,t("#n2-ss-slide-canvas-container").outerHeight(!0));this.container.css({width:i+40,height:n+40});for(var r=this.horizontalSpans.length-3;r<i/this.scale;r++){var s=t("<span />").appendTo(this.horizontal);r%10==0?s.addClass("n2-ss-ruler-mark-large").append("<span>"+r/10*100+"</span>"):r%2==0&&s.addClass("n2-ss-ruler-mark-medium"),this.horizontalSpans=this.horizontalSpans.add(s)}for(var r=this.verticalSpans.length-3;r<n/this.scale;r++){var s=t("<span />").appendTo(this.vertical);r%10==0?s.addClass("n2-ss-ruler-mark-large").append("<span>"+r/10*100+"</span>"):r%2==0&&s.addClass("n2-ss-ruler-mark-medium"),this.verticalSpans=this.verticalSpans.add(s)}},r.prototype.toArray=function(){for(var t={horizontal:[],vertical:[]},e=0;e<this.guides.length;e++)this.guides[e]instanceof o?t.horizontal.push(this.guides[e].position):this.guides[e]instanceof a&&t.vertical.push(this.guides[e].position);return t},r.prototype.measureToolVertical=function(){var e=t('<div class="n2-ruler-guide" style="z-index:1;"><div class="n2-ruler-guide-border" style="border-color: #f00;"></div></div>').css("display","none").appendTo(this.vertical),n=!1,r=t.proxy(function(){n||(n=!0,e.css("display",""),i.positionDisplay.show("Guide"))},this),s=t.proxy(function(){n&&(n=!1,e.css("display","none"),i.positionDisplay.hide("Guide"))},this);this.vertical.on({mouseenter:t.proxy(function(n){if(this.showGuides){var o=0,a=Math.round(this.vertical.offset().top);r(),this.vertical.on("mousemove.n2-ruler-measure-tool",t.proxy(function(n){if(t(n.target).hasClass("n2-ruler-guide-border")&&t(n.target).parent()[0]!=e[0])s();else if(r(),o!=n.pageY){var l=n.pageY-a;e.css("top",l),i.positionDisplay.update(n,"Guide",l-40+"px"),o=n.pageY}},this))}},this),mouseleave:t.proxy(function(){this.vertical.off(".n2-ruler-measure-tool"),s()},this)})},r.prototype.measureToolHorizontal=function(){var e=t('<div class="n2-ruler-guide" style="z-index:1;"><div class="n2-ruler-guide-border" style="border-color: #f00;"></div></div>').css("display","none").appendTo(this.horizontal),n=!1,r=t.proxy(function(){n||(n=!0,e.css("display",""),i.positionDisplay.show("Guide"))},this),s=t.proxy(function(){n&&(n=!1,e.css("display","none"),i.positionDisplay.hide("Guide"))},this);this.horizontal.on({mouseenter:t.proxy(function(n){if(this.showGuides){var o=0,a=Math.round(this.horizontal.offset().left);r(),this.horizontal.on("mousemove.n2-ruler-measure-tool",t.proxy(function(n){if(t(n.target).hasClass("n2-ruler-guide-border")&&t(n.target).parent()[0]!=e[0])s();else if(r(),o!=n.pageX){var l=Math.max(n.pageX-a,40);e.css("left",l),i.positionDisplay.update(n,"Guide",l-40+"px"),o=n.pageX}},this))}},this),mouseleave:t.proxy(function(){this.horizontal.off(".n2-ruler-measure-tool"),s()},this)})},s.prototype._position=function(t,e){return Math.max(0,t)},s.prototype.setPosition=function(t){this.position=t,this.refresh()},s.prototype.refresh=function(){this.positionRender(this.position)},s.prototype["delete"]=function(){this.ruler.removeGuide(this),this.guide.remove()},o.prototype=Object.create(s.prototype),o.prototype.constructor=o,o.prototype.create=function(t){var e=Math.round(this.container.offset().left)+40;this.position=this._position(t.pageX-e,t),this.positionRender(this.position)},o.prototype.rawPositionRender=function(t){this.guide.css("left",Math.max(0,t)+40)},o.prototype.positionRender=function(t){this.guide.css("left",Math.max(0,t)+40)},a.prototype=Object.create(s.prototype),a.prototype.constructor=a,a.prototype.create=function(t){var e=Math.round(this.container.offset().top)+40;this.position=this._position(t.pageY-e,t),this.positionRender(this.position)},a.prototype.rawPositionRender=function(t){this.guide.css("top",Math.max(0,t)+40)},a.prototype.positionRender=function(t){this.guide.css("top",Math.max(0,t)+40)},r}),N2Require("CanvasSettings",[],["smartSlider"],function(t,e,i,n){"use strict";function r(e){this.canvasManager=e,this.settings={};var i=t("#n2-ss-slide-canvas-settings").on("mouseleave",t.proxy(function(){i.removeClass("n2-active")},this));i.find("> a").on("click",function(t){t.preventDefault(),i.toggleClass("n2-active")}),this.$settingsPanel=i.find(".n2-ss-settings-panel-inner"),this.snapTo(),this.roundTo(),this.colorScheme(),this.canvasManager.slideEditManager.options.isAddSample||this.ruler()}return r.prototype._addSettings=function(e,i,n,r){this.settings[e]=parseInt(t.jStorage.get(e,n));var s=t('<a href="">'+i+'<span class="n2-setting-tick"><i class="n2-i n2-it n2-i-tick2"></i></span></a>').on("click",t.proxy(function(i){i.preventDefault(),this.settings[e]=1==this.settings[e]?0:1,t.jStorage.set(e,this.settings[e]),s.toggleClass("n2-setting-enabled",1==this.settings[e]),r(this.settings[e],!1)},this)).appendTo(this.$settingsPanel);s.toggleClass("n2-setting-enabled",1==this.settings[e]),r(this.settings[e],!0)},r.prototype._addAction=function(e,i){t('<a href="" class="n2-panel-action">'+e+"</a>").on("click",t.proxy(function(t){t.preventDefault(),i()},this)).appendTo(this.$settingsPanel)},r.prototype.get=function(t){return this.settings[t]},r.prototype.snapTo=function(){this._addSettings("n2-ss-snap-to-enabled",n2_("Smart Snap"),1,t.proxy(function(t){for(var e=this.mainContainer.container.getSortedLayers(),i=0;i<e.length;i++)e[i].placement.doAction("snap")},this.canvasManager))},r.prototype.roundTo=function(){this._addSettings("n2-ss-round-to-enabled",n2_("Round to 5px"),1,function(t){1==t?nextend.roundTo=5:nextend.roundTo=1})},r.prototype.colorScheme=function(){var e=t("#n2-ss-slide-canvas-container");this._addSettings("n2-ss-theme-dark",n2_("Dark Mode"),0,function(t){e.toggleClass("n2-ss-theme-dark",1==t)})},r.prototype.ruler=function(){i.ruler=new e.Ruler(t("#slideguides").val());var n=t("#n2-ss-slide-canvas-container");this._addSettings("n2-ss-ruler-enabled",n2_("Ruler"),1,t.proxy(function(t){n.toggleClass("n2-ss-has-ruler",1==t),nextend.triggerResize()},this)),this._addSettings("n2-ss-show-guides",n2_("Show Guides"),1,t.proxy(function(t){nextend.ruler.showGuides=t,n.toggleClass("n2-ss-show-guides",1==t)},this)),this._addSettings("n2-ss-lock-guides",n2_("Lock Guides"),0,t.proxy(function(t){n.toggleClass("n2-ss-lock-guides",1==t)},this)),this._addAction("Clear Guides",t.proxy(function(){nextend.ruler.clearGuides()},this))},r}),N2Require("PlacementAbsolute",["PlacementAbstract"],["smartSlider"],function(t,e,i,n){"use strict";function r(t,i,n){this.type="absolute",this.transferredProperties={},e.PlacementAbstract.prototype.constructor.apply(this,arguments),
this.doThrottledTheResize=this.doTheResize,this._triggerLayerResizedThrottled=NextendThrottle(this._triggerLayerResized,30),this.parentIsVisible=!0,this.children=[]}var s=function(){var t=0;return window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){var i,n=(new Date).getTime();return i=Math.max(0,16-(n-t)),t=n+i,setTimeout(function(){e(n+i)},i)}}(),o={raf:!1,ratios:null,isThrottled:!1,layers:[]},a=function(){o.raf===!1&&(o.raf=!0,s(function(){for(var t=0;t<o.layers.length;t++)o.layers[t].isDeleted||o.layers[t].doTheResize(o.ratios,!0,o.isThrottled);o={raf:!1,ratios:null,isThrottled:!1,layers:[]}}))};return r.prototype=Object.create(e.PlacementAbstract.prototype),r.prototype.constructor=r,r.prototype.start=function(){this.$layer=this.layer.layer,this.$layerRow=this.layer.layerRow},r.prototype.preActivation=function(t){if("normal"==t.type){var e=this.layer.getProperty("height");e>0&&(this.transferredProperties.height=e)}},r.prototype.activated=function(e){var i=this.$layer.data("parentid");if(i){var n=t("#"+i);n.length>0?this.activatedAfterParentReady(e):setTimeout(t.proxy(function(){this.activatedAfterParentReady(e)},this),300)}else this._activated(e)},r.prototype.activatedAfterParentReady=function(e){var i=this.$layer.data("parentid");if(i){var n=t("#"+i);if(n.length>0){var r=n.data("layerObject");r?r.readyDeferred.done(t.proxy(this._activated,this,e)):n.on("layerStarted",t.proxy(function(i,n){n.readyDeferred.done(t.proxy(this._activated,this,e))},this))}else this.$layer.data("parentid",""),this._activated(e)}else this._activated(e)},r.prototype._activated=function(e){this.loadProperties(t.extend(e,this.transferredProperties)),this.transferredProperties={},this.$layer.css("zIndex",""),this.___makeLayerAlign(),this.___makeLayerResizeable()},r.cleanLayer=function(t){var e=["desktopPortrait","desktopLandscape","tabletPortrait","tabletLandscape","mobilePortrait","mobileLandscape"];t.removeAttr("data-align").removeAttr("data-valign").css({left:"",top:"",right:"",bottom:"",width:"",height:"","text-align":""});for(var i=["parentid","responsiveposition","responsivesize","parentalign","parentvalign","align","valign","left","top","width","height"],n={},r=0;r<i.length;r++){var s=i[r].toLowerCase();n[s]=t.data(s),t.removeAttr(s),t.removeData(s);for(var o=0;o<e.length;o++){var a=e[o].toLowerCase();n[a+s]=t.data(a+s),t.removeAttr(a+s),t.removeData(a+s)}}return n},r.prototype.deActivated=function(t){var e=this.layer.getProperty("parentid");e&&""!=e&&(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.alignMarker.remove(),this.$layer.nextendResizable("destroy"),this.$layer.off(".n2-ss-absolute"),this.$layer.triggerHandler("LayerUnavailable");var i=["parentid","responsiveposition","responsivesize","parentalign","parentvalign","align","valign","left","top","width","height"],n=this.layer.getPropertiesData(i);return this.layer.removeProperties(i),this.chainParent.remove(),n},r.prototype.loadProperties=function(e){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:e.align||"center"},this.layer.layer,this),this.layer.createDeviceProperty("valign",{desktopPortrait:e.valign||"middle"},this.layer.layer,this),this.layer.createDeviceProperty("left",{desktopPortrait:e.left||0},this.layer.layer,this),this.layer.createDeviceProperty("top",{desktopPortrait:e.top||0},this.layer.layer,this),this.layer.createDeviceProperty("width",{desktopPortrait:e.width||"auto"},this.layer.layer,this),this.layer.createDeviceProperty("height",{desktopPortrait:e.height||"auto"},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")});var n=null;this.chainParent=t('<div class="n2-ss-layer-chain-parent n2-button n2-button-icon n2-button-xs n2-radius-s n2-button-blue"><i class="n2-i n2-i-layerunlink"></i></div>').on({click:t.proxy(this.unlink,this),mouseenter:t.proxy(function(){n=t("#"+this.layer.getProperty("parentid")).addClass("n2-highlight")},this),mouseleave:t.proxy(function(){n&&(n.removeClass("n2-highlight"),n=null)},this)}).appendTo(this.$layer)},r.prototype.triggerLayerResized=function(t,e){t?this._triggerLayerResized(t,e):this._triggerLayerResizedThrottled(!0,e)},r.prototype._triggerLayerResized=function(t,e){this.layer.isDeleted||this.$layer.triggerHandler("LayerResized",[e||{slideW:this.canvasManager.getResponsiveRatio("h"),slideH:this.canvasManager.getResponsiveRatio("v")},t||!1])},r.prototype.___makeLayerAlign=function(){this.alignMarker=t('<div class="n2-ss-layer-cc" />').appendTo(this.$layer)},r.prototype.___makeLayerResizeable=function(){this._resizableJustClick=!1,this.$layer.nextendResizable({handles:"n, e, s, w, ne, se, sw, nw",_containment:this.canvasManager.mainContainer.layer,start:t.proxy(this.____makeLayerResizeableStart,this),resize:t.proxy(this.____makeLayerResizeableResize,this),stop:t.proxy(this.____makeLayerResizeableStop,this),create:t.proxy(function(){this.$layer.find(".ui-resizable-handle, .n2-ss-layer-cc").on({mousedown:t.proxy(function(t){this._resizableJustClick=[t.clientX,t.clientY]},this),mouseup:t.proxy(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 i=t(e.currentTarget),n=this.canvasManager.layerOptions.layerFeatures;i.hasClass("ui-resizable-nw")?(n.horizontalAlign("left",!1),n.verticalAlign("top",!1)):i.hasClass("ui-resizable-w")?(n.horizontalAlign("left",!1),n.verticalAlign("middle",!1)):i.hasClass("ui-resizable-sw")?(n.horizontalAlign("left",!1),n.verticalAlign("bottom",!1)):i.hasClass("ui-resizable-n")?(n.horizontalAlign("center",!1),n.verticalAlign("top",!1)):i.hasClass("n2-ss-layer-cc")?(n.horizontalAlign("center",!1),n.verticalAlign("middle",!1)):i.hasClass("ui-resizable-s")?(n.horizontalAlign("center",!1),n.verticalAlign("bottom",!1)):i.hasClass("ui-resizable-ne")?(n.horizontalAlign("right",!1),n.verticalAlign("top",!1)):i.hasClass("ui-resizable-e")?(n.horizontalAlign("right",!1),n.verticalAlign("middle",!1)):i.hasClass("ui-resizable-se")&&(n.horizontalAlign("right",!1),n.verticalAlign("bottom",!1))}this._resizableJustClick=!1},this)})},this),smartguides:t.proxy(function(){return this.$layer.triggerHandler("LayerParent"),this.canvasManager.getSnap()},this),tolerance:5}).on({"mousedown.n2-ss-absolute":t.proxy(function(t){!this.layer.status!=e.ComponentAbstract.STATUS.LOCKED&&(i.positionDisplay.show("Canvas"),i.positionDisplay.update(t,"Canvas","W: "+parseInt(this.$layer.width())+"px<br />H: "+parseInt(this.$layer.height())+"px")),document.activeElement&&document.activeElement.blur()},this),"mouseup.n2-ss-absolute":t.proxy(function(t){i.positionDisplay.hide("Canvas")},this)})},r.prototype.____makeLayerResizeableStart=function(e,n){this.preventActivation=!0,this.resizableDeferred=t.Deferred(),this.canvasManager.layerWindow.hideWithDeferred(this.resizableDeferred),t("body").addClass("n2-ss-resize-layer"),this._resizableJustClick&&(this._resizableJustClick=!1),this.____makeLayerResizeableResize(e,n),i.positionDisplay.show("Canvas")},r.prototype.____makeLayerResizeableResize=function(t,e){i.positionDisplay.update(t,"Canvas","W: "+e.size.width+"px<br />H: "+e.size.height+"px"),this.triggerLayerResized()},r.prototype.____makeLayerResizeableStop=function(e,n){t("body").removeClass("n2-ss-resize-layer"),this.resizableDeferred.resolve();var r=!1;if("n"==n.axis||"s"==n.axis||n.originalSize.width==n.size.width){var s=this.layer.getProperty("width");this.layer.isDimensionPropertyAccepted(s)&&(r=!0,this._syncwidth())}var o=!1;if("e"==n.axis||"w"==n.axis||n.originalSize.height==n.size.height){var s=this.layer.getProperty("height");this.layer.isDimensionPropertyAccepted(s)&&(o=!0,this._syncheight())}var a=this.canvasManager.getResponsiveRatio("h"),l=this.canvasManager.getResponsiveRatio("v");parseInt(this.layer.getProperty("responsivesize"))||(a=l=1);var h=null;r||(h=Math.round(n.size.width*(1/a)));var d=null;o||(d=Math.round(n.size.height*(1/l))),this._setPosition(null,null,n.position.left,n.position.top,h,d,!0),this.triggerLayerResized(),this.$layer.triggerHandler("LayerUnParent"),i.positionDisplay.hide("Canvas"),setTimeout(t.proxy(function(){this.preventActivation=!1},this),80)},r.prototype._setPosition=function(t,e,n,r,s,o,a){var l=this.layer.getMode();null===t&&(t=this.layer.getProperty("align")),null===e&&(e=this.layer.getProperty("valign")),null===n?n=this.layer.getProperty("left"):a&&(n=this.calculatePositionLeft(t,n)),null===r?r=this.layer.getProperty("top"):a&&(r=this.calculatePositionTop(e,r)),null===s&&(s=this.layer.getProperty("width")),null===o&&(o=this.layer.getProperty("height"));var h=i.history.addValue(this.layer,this.layer.historyStoreOnPlacement,["historyStorePosition",l]);h&&h.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:e,left:n,top:r,width:s,height:o}),i.history.off(),this.layer.store("width",s,!0,"layer"),this.layer.$.trigger("propertyChanged",["width",s]),this.layer.store("height",o,!0,"layer"),this.layer.$.trigger("propertyChanged",["height",o]),this.layer.store("align",t,!0,"layer"),this.layer.$.trigger("propertyChanged",["align",t]),this.layer.store("valign",e,!0,"layer"),this.layer.$.trigger("propertyChanged",["valign",e]),this.layer.store("left",n,!0,"layer"),this.layer.$.trigger("propertyChanged",["left",n]),this.layer.store("top",r,!0,"layer"),this.layer.$.trigger("propertyChanged",["top",r]),i.history.on()},r.prototype.historyStorePosition=function(t,e){this.layer.historyStore(t.align,"align",e),this.layer.historyStore(t.valign,"valign",e),this.layer.historyStore(t.width,"width",e),this.layer.historyStore(t.height,"height",e),this.layer.historyStore(t.left,"left",e),this.layer.historyStore(t.top,"top",e),this.triggerLayerResized()},r.prototype.calculatePositionLeft=function(t,e){var i=this.canvasManager.getResponsiveRatio("h");parseInt(this.layer.getProperty("responsiveposition"))||(i=1);var n=this.parent,r={left:0,leftMultiplier:1};if(n&&n.is(":visible")){var s=n.position();switch(this.layer.getProperty("parentalign")){case"right":r.left=s.left+n.width();break;case"center":r.left=s.left+n.width()/2;break;default:r.left=s.left}}else switch(n=this.$layer.parent(),t){case"center":r.left+=n.width()/2;break;case"right":r.left+=n.width()}var e;switch(t){case"left":e=-Math.round((r.left-e)*(1/i));break;case"center":e=-Math.round((r.left-e-this.$layer.width()/2)*(1/i));break;case"right":e=-Math.round((r.left-e-this.$layer.width())*(1/i))}return e},r.prototype.calculatePositionTop=function(t,e){var i=this.canvasManager.getResponsiveRatio("v");parseInt(this.layer.getProperty("responsiveposition"))||(i=1);var n=this.parent,r={top:0,topMultiplier:1};if(n&&n.is(":visible")){var s=n.position();switch(this.layer.getProperty("parentvalign")){case"bottom":r.top=s.top+n.height();break;case"middle":r.top=s.top+n.height()/2;break;default:r.top=s.top}}else switch(n=this.$layer.parent(),t){case"middle":r.top+=n.height()/2;break;case"bottom":r.top+=n.height()}var e;switch(t){case"top":e=-Math.round((r.top-e)*(1/i));break;case"middle":e=-Math.round((r.top-e-this.$layer.height()/2)*(1/i));break;case"bottom":e=-Math.round((r.top-e-this.$layer.height())*(1/i))}return e},r.prototype.moveX=function(t){this._setPosition(null,null,this.layer.getProperty("left")+t,null,null,null,!1)},r.prototype.moveY=function(t){this._setPosition(null,null,null,this.layer.getProperty("top")+t,null,null,!1)},r.prototype.setPositionLeft=function(t){t=this.calculatePositionLeft(this.layer.getProperty("align"),t),this.layer.store("left",t,!0),this.layer.$.trigger("propertyChanged",["left",t])},r.prototype.setPositionTop=function(t){t=this.calculatePositionTop(this.layer.getProperty("valign"),t),this.layer.store("top",t,!0),this.layer.$.trigger("propertyChanged",["top",t])},r.prototype.setPosition=function(t,e){this.setPositionLeft(t),this.setPositionTop(e)},r.prototype.setDeviceBasedAlign=function(){var t=this.layer.getMode();"undefined"==typeof this.layer.deviceProperty[t].align&&this.layer.setProperty("align",this.layer.getProperty("align"),"layer"),"undefined"==typeof this.layer.deviceProperty[t].valign&&this.layer.setProperty("valign",this.layer.getProperty("valign"),"layer")},r.prototype.setPropertyresponsiveposition=r.prototype.setPropertyresponsivesize=function(t,e,i){this.layer._setProperty(t,parseInt(e),i)},r.prototype.setPropertywidth=r.prototype.setPropertyheight=function(e,i,n){var r=i;this.layer.isDimensionPropertyAccepted(i)||(r=~~i,r!=i&&this.layer.$.trigger("propertyChanged",[e,r])),setTimeout(t.proxy(function(){this.onResize(!1)},this),50),this.layer._setProperty(e,r,n)},r.prototype.setPropertyleft=r.prototype.setPropertytop=function(t,e,i){var n=~~e;n!=e&&this.layer.$.trigger("propertyChanged",[t,n]),this.layer._setProperty(t,n,i)},r.prototype.render=function(t){this["_sync"+t]()},r.prototype.renderWithModifier=function(t,e,i){try{"width"!=t&&"height"!=t||!this.layer.isDimensionPropertyAccepted(e)?this["_sync"+t](Math.round(e*i)):this["_sync"+t](e)}catch(n){console.error("_sync"+t)}},r.prototype.onResize=function(t){this.resize({slideW:this.canvasManager.getResponsiveRatio("h"),slideH:this.canvasManager.getResponsiveRatio("v")},t)},r.prototype.resize=function(t,e){this.parent&&!e||this.addToResizeCollection(this,t,!1)},r.prototype.addToResizeCollection=function(t,e,i){o.ratios=e,o.isThrottled=i;for(var n=0;n<o.layers.length;n++)if(o.layers[n]==this){o.layers.splice(n,1);break}o.layers.push(t),a(),this.triggerLayerResized(i,e)},r.prototype._syncresponsiveposition=function(){this.onResize(!1)},r.prototype._syncwidth=function(){var t=this.layer.getProperty("width");if(!this.layer.isDimensionPropertyAccepted(t)){if(parseInt(this.layer.getProperty("responsivesize"))){var e=this.canvasManager.getResponsiveRatio("h");t*=e}t+="px"}this.$layer.css("width",t)},r.prototype._syncheight=function(){var t=this.layer.getProperty("height");if(!this.layer.isDimensionPropertyAccepted(t)){if(parseInt(this.layer.getProperty("responsivesize"))){var e=this.canvasManager.getResponsiveRatio("v");t*=e}t+="px"}this.$layer.css("height",t)},r.prototype._syncparentalign=function(){var t=this.layer.getProperty("parentalign");this.$layer.data("parentalign",t);var e=this.getParent();e&&e.placement.current.onResize(!1)},r.prototype._syncparentvalign=function(){var t=this.layer.getProperty("parentvalign");this.$layer.data("parentvalign",t);var e=this.getParent();e&&e.placement.current.onResize(!1)},r.prototype._syncleft=function(){var t=this.layer.getProperty("left");if(parseInt(this.layer.getProperty("responsiveposition"))){var e=this.canvasManager.getResponsiveRatio("h");t*=e}if(this.parent&&this.parentIsVisible){var i=this.parent.position(),n=this.layer.getProperty("align"),r=this.layer.getProperty("parentalign"),s=0;switch(r){case"right":s=i.left+this.parent.width();break;case"center":s=i.left+this.parent.width()/2;break;default:s=i.left}switch(n){case"right":this.$layer.css({left:"auto",right:this.$layer.parent().width()-s-t+"px"});break;case"center":this.$layer.css({left:s+t-this.$layer.width()/2+"px",right:"auto"});break;default:this.$layer.css({left:s+t+"px",right:"auto"})}}else switch(this.layer.getProperty("align")){case"right":this.$layer.css({left:"auto",right:-t+"px"});break;case"center":this.$layer.css({left:this.$layer.parent().width()/2+t-this.$layer.width()/2+"px",right:"auto"});break;default:this.$layer.css({left:t+"px",right:"auto"})}this.triggerLayerResized()},r.prototype._synctop=function(){var t=this.layer.getProperty("top");if(parseInt(this.layer.getProperty("responsiveposition"))){var e=this.canvasManager.getResponsiveRatio("v");t*=e}if(this.parent&&this.parentIsVisible){var i=this.parent.position(),n=this.layer.getProperty("valign"),r=this.layer.getProperty("parentvalign"),s=0;switch(r){case"bottom":s=i.top+this.parent.height();break;case"middle":s=i.top+this.parent.height()/2;break;default:s=i.top}switch(n){case"bottom":this.$layer.css({top:"auto",bottom:this.$layer.parent().height()-s-t+"px"});break;case"middle":this.$layer.css({top:s+t-this.$layer.height()/2+"px",bottom:"auto"});break;default:this.$layer.css({top:s+t+"px",bottom:"auto"})}}else switch(this.layer.getProperty("valign")){case"bottom":this.$layer.css({top:"auto",bottom:-t+"px"});break;case"middle":this.$layer.css({top:this.$layer.parent().height()/2+t-this.$layer.height()/2+"px",bottom:"auto"});break;default:this.$layer.css({top:t+"px",bottom:"auto"})}this.triggerLayerResized()},r.prototype._syncresponsivesize=function(){this.onResize(!1)},r.prototype.historyStoreDoubleProp=function(t,e,i,n){var r=this.layer.getMode();e==r?(this.layer._setProperty(i,t.value,"history"),this.layer._setProperty(n,t.value2,"history")):(this.layer.deviceProperty[e][i]=t.value,this.layer.deviceProperty[e][n]=t.value2,this.layer.$.trigger("propertyChanged",[i,this.layer.getProperty(i)]),this.layer.$.trigger("propertyChanged",[n,this.layer.getProperty(n)]),this.layer.render(i,null,"history"),this.layer.render(n,null,"history"))},r.prototype.setPropertyalign=function(t,e,n){var r=this.layer.getProperty(t),s=this.layer.getRawProperty("left");i.history.off(),this.layer._setProperty(t,e,n),i.history.on();var o=i.history.addValue(this.layer,this.layer.historyStoreOnPlacement,["historyStoreDoubleProp",this.layer.getMode(),"align","left"]);o&&o.setValues({value:r,value2:s},{value:e,value2:this.layer.getRawProperty("left")})},r.prototype.setPropertyvalign=function(t,e,n){var r=this.layer.getProperty(t),s=this.layer.getRawProperty("top");i.history.off(),this.layer._setProperty(t,e,n),i.history.on();var o=i.history.addValue(this.layer,this.layer.historyStoreOnPlacement,["historyStoreDoubleProp",this.layer.getMode(),"valign","top"]);o&&o.setValues({value:r,value2:s},{value:e,value2:this.layer.getRawProperty("top")})},r.prototype._syncalign=function(t,e){var i=this.layer.getProperty("align");this.$layer.attr("data-align",i),"history"!=e&&i!=t&&this.setPositionLeft(this.$layer.position().left)},r.prototype._syncvalign=function(t,e){var i=this.layer.getProperty("valign");this.$layer.attr("data-valign",i),"history"!=e&&i!=t&&this.setPositionTop(this.$layer.position().top)},r.prototype.fit=function(){var t=this.$layer.get(0);this.$layer.position();if(t.scrollWidth>0&&t.scrollHeight>0){var e=!1;if(this.layer.item&&(e=this.layer.item.fitLayer()),!e){this.layer.setProperty("width","auto","layer"),this.layer.setProperty("height","auto","layer");var i=this.$layer.width();Math.abs(this.canvasManager.mainContainer.layer.width()-this.$layer.position().left-i)<2&&this.layer.setProperty("width",i,"layer")}}},r.prototype.hide=function(t){this.layer.store(t?t:this.layer.getMode(),0,!0)},r.prototype.show=function(t){this.layer.store(t?t:this.layer.getMode(),1,!0)},r.prototype.changeStatus=function(t,i){t==e.ComponentAbstract.STATUS.LOCKED&&this.layer.nextendResizable("enable"),i==e.ComponentAbstract.STATUS.LOCKED&&this.$layer.nextendResizable("disable")},r.prototype.getParent=function(){return t("#"+this.layer.getProperty("parentid")).data("layerObject")},r.prototype.subscribeParent=function(){var e=this,i=t("#"+this.layer.property.parentid);this.parent&&!i.is(this.parent)&&(this.parent.off(this.subscribeParentCallbacks),this.parent=!1),this.parent||(this.subscribeParentCallbacks={LayerResized:function(){e.resizeParent.apply(e,arguments)},LayerParent:function(){e.$layer.addClass("n2-ss-layer-parent"),e.$layer.triggerHandler("LayerParent")},LayerUnParent:function(){e.$layer.removeClass("n2-ss-layer-parent"),e.$layer.triggerHandler("LayerUnParent")},LayerDeleted:function(t){e.layer.setProperty("parentid","","layer")},LayerUnavailable:function(t){e.layer.setProperty("parentid","","layer"),e.layer.setProperty("left",0,"layer"),e.layer.setProperty("top",0,"layer")},LayerShowChange:function(t,i,n){e.layer.getMode()==i&&(e.parentIsVisible=n)},"n2-ss-activate":function(){e.$layerRow.addClass("n2-parent-active")},"n2-ss-deactivate":function(){e.$layerRow.removeClass("n2-parent-active")},LayerGetDataWithChildren:function(t,i,n){e.layer.getDataWithChildren(i,n)}},this.parent=i.on(this.subscribeParentCallbacks),this.parent.data("layerObject").placement.current.addChild(this),this.$layer.addClass("n2-ss-layer-has-parent"))},r.prototype.unSubscribeParent=function(t){if(this.$layerRow.removeClass("n2-parent-active"),this.$layer.removeClass("n2-ss-layer-has-parent"),this.parent&&(this.parent.off(this.subscribeParentCallbacks),this.parent=!1,this.subscribeParentCallbacks={},"delete"!=t)){var e=this.$layer.position();this._setPosition(null,null,e.left,e.top,null,null,!0)}},r.prototype.addChild=function(t){this.children.push(t)},r.prototype.removeChild=function(e){this.children.splice(t.inArray(e,this.children),1)},r.prototype.unlink=function(t){t&&t.preventDefault(),this.layer.setProperty("parentid","","layer")},r.prototype.parentPicked=function(t,e,i,n,r){this.layer.setProperty("parentid","","layer"),this.layer.setProperty("align",n,"layer"),this.layer.setProperty("valign",r,"layer"),this.layer.setProperty("parentalign",e,"layer"),this.layer.setProperty("parentvalign",i,"layer"),this.layer.setProperty("parentid",t.requestID(),"layer");var s;for(var o in this.layer.deviceProperty)"desktopPortrait"!=o&&(this.layer.deviceProperty[o].left=s,this.layer.deviceProperty[o].top=s,this.layer.deviceProperty[o].valign=s,this.layer.deviceProperty[o].align=s)},r.prototype._syncparentid=function(){var e=this.layer.getProperty("parentid");if(e&&""!=e)if(0==t("#"+e).length)this.layer.setProperty("parentid","","layer");else{this.$layer.attr("data-parentid",e).addClass("n2-ss-layer-has-parent"),this.subscribeParent();var i=this.$layer.position();this._setPosition(null,null,i.left,i.top,null,null,!0)}else this.$layer.removeAttr("data-parentid"),this.unSubscribeParent()},r.prototype.snap=function(){this.$layer.nextendResizable("option","smartguides",t.proxy(function(){return this.$layer.triggerHandler("LayerParent"),this.canvasManager.getSnap()},this))},r.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)},r.prototype.doLinearResize=function(t){this.doThrottledTheResize(t,!0)},r.prototype.doTheResize=function(t,e,i){this.render("width"),this.render("height"),this.render("left"),this.render("top"),e||this.triggerLayerResized(i,t)},r.prototype.resizeParent=function(t,e,i){this.addToResizeCollection(this,e,i)},r.prototype.updatePosition=function(){var t=this.parent;if("center"==this.layer.getProperty("align")){var e=0;e=t?t.position().left+t.width()/2:this.$layer.parent().width()/2;var i=this.canvasManager.getResponsiveRatio("h");parseInt(this.layer.getProperty("responsiveposition"))||(i=1),this.$layer.css("left",e-this.$layer.width()/2+this.layer.getProperty("left")*i)}if("middle"==this.layer.getProperty("valign")){var n=0;n=t?t.position().top+t.height()/2:this.$layer.parent().height()/2;var i=this.canvasManager.getResponsiveRatio("v");parseInt(this.layer.getProperty("responsiveposition"))||(i=1),this.$layer.css("top",n-this.$layer.height()/2+this.layer.getProperty("top")*i)}this.triggerLayerResized()},r.prototype.getIndex=function(){var t=parseInt(this.$layer.css("zIndex"));return isNaN(t)&&(t=0),t},r.prototype.renderIndex=function(t){},r.prototype.sync=function(){this._syncalign(null,"history"),this._syncvalign(null,"history"),this._syncwidth(),this._syncheight(),this._synctop(),this._syncleft(),this._syncparentid()},r.prototype["delete"]=function(){var t=this.layer.getProperty("parentid");t&&this.unSubscribeParent("delete")},r.prototype.isParentOrChild=function(){return this.parent||this.children.length>0},r}),N2Require("PlacementContent",["PlacementAbstract"],[],function(t,e,i){"use strict";function n(t,i,n){this.type="content",e.PlacementAbstract.prototype.constructor.apply(this,arguments)}return n.prototype=Object.create(e.PlacementAbstract.prototype),n.prototype.constructor=n,n}),N2Require("PlacementDefault",["PlacementAbstract"],["smartSlider"],function(t,e,i,n){"use strict";function r(t,i,n){this.type="default",e.PlacementAbstract.prototype.constructor.apply(this,arguments)}return r.prototype=Object.create(e.PlacementAbstract.prototype),r.prototype.constructor=r,r.prototype.start=function(){this.$layer=this.layer.layer},r.prototype.activated=function(t){this.startUISizing()},r.prototype.deActivated=function(t){this.$layer.nextendNormalSizing("destroy")},r.prototype.startUISizing=function(){var e=!1;this.layer.item&&this.layer.item.needSize&&(e=!0),this.$layer.nextendNormalSizing({start:t.proxy(function(t,e){i.positionDisplay.show("NormalSizing"),"maxwidth"==e&&this.layer.layer.addClass("n2-ss-has-maxwidth")},this),resizeMaxWidth:t.proxy(function(t,e){i.positionDisplay.update(t,"NormalSizing","Max-width: "+(0==e.value?"none":e.value+"px"))},this),stopMaxWidth:t.proxy(function(t,e){i.positionDisplay.hide("NormalSizing"),this.layer.setProperty("maxwidth",e.value)},this)})},r}),N2Require("PlacementGroup",["PlacementAbstract"],[],function(t,e,i){"use strict";function n(t,i,n){this.type="group",e.PlacementAbstract.prototype.constructor.apply(this,arguments)}return n.prototype=Object.create(e.PlacementAbstract.prototype),n.prototype.constructor=n,n}),N2Require("PlacementNormal",["PlacementAbstract"],["smartSlider"],function(t,e,i,n){"use strict";function r(t,i,n){this.type="normal",this.transferredProperties={},e.PlacementAbstract.prototype.constructor.apply(this,arguments)}return r.prototype=Object.create(e.PlacementAbstract.prototype),r.prototype.constructor=r,r.prototype.start=function(){this.$layer=this.layer.layer},r.prototype.preActivation=function(t){if("absolute"==t.type&&this.layer.item&&this.layer.item.needSize){var e=this.layer.getProperty("height");e.match&&e.match(/[0-9]+%$/)?this.transferredProperties.height=Math.max(100,parseInt(this.$layer.parent().height()*parseInt(e)/100)):e>0&&(this.transferredProperties.height=e)}},r.prototype.activated=function(e){this.loadProperties(t.extend(e,this.transferredProperties)),this.transferredProperties={},this.layer.$.on("baseSizeUpdated.placementnormal",t.proxy(this._syncmargin,this)),this.layer.$.on("baseSizeUpdated.placementnormal",t.proxy(this._syncheight,this)),this.startUISpacing(),this.startUISizing(),this.$layer.on({mousedown:t.proxy(function(t){t.stopPropagation()})})},r.prototype.loadProperties=function(t){this.layer.createDeviceProperty("margin",{desktopPortrait:"0|*|0|*|0|*|0|*|px+"},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)},r.cleanLayer=function(t){var e=["desktopPortrait","desktopLandscape","tabletPortrait","tabletLandscape","mobilePortrait","mobileLandscape"];t.removeClass("n2-ss-has-maxwidth").removeAttr("data-cssselfalign").css({position:"",margin:"",height:"",maxWidth:""});for(var i=["margin","height","maxwidth","selfalign"],n={},r=0;r<i.length;r++){var s=i[r].toLowerCase();n[s]=t.data(s),t.removeAttr(s),t.removeData(s);for(var o=0;o<e.length;o++){var a=e[o].toLowerCase();n[s]=t.data(a+s),t.removeAttr(a+s),t.removeData(a+s)}}return n},r.prototype.deActivated=function(t){this.layer.$.off(".placementnormal"),this.$layer.nextendSpacing("destroy"),this.$layer.nextendNormalSizing("destroy"),this.layer.layer.removeClass("n2-ss-has-maxwidth"),this.layer.layer.removeAttr("data-cssselfalign");var e=["margin","height","maxwidth","selfalign"],i=this.layer.getPropertiesData(e);return this.layer.removeProperties(e),this.layer.layer.css({position:"",margin:"",height:"",maxWidth:""}),i},r.prototype._renderModeProperties=function(t){this._syncmargin(),this._syncheight(),this._syncmaxwidth(),this._syncselfalign()},r.prototype._syncmargin=function(){var t=this.layer.getProperty("margin").split("|*|"),e=t.pop(),i=this.layer.baseSize;if("px+"==e&&i>0){e="em";for(var n=0;n<t.length;n++)t[n]=parseInt(t[n])/i}var t=t.join(e+" ")+e;this.layer.layer.css("margin",t),this.layer.update(),this.$layer.nextendSpacing("option","current",t)},r.prototype.startUISpacing=function(){this.$layer.nextendSpacing({mode:"margin",sync:{n:"margin-top",e:"margin-right",s:"margin-bottom",w:"margin-left"},handles:"n, s, e, w",start:t.proxy(function(t,e){i.positionDisplay.show("Spacing")},this),spacing:t.proxy(function(t,e){var n="";for(var r in e.changed)n+="Margin "+r+": "+e.changed[r]+"px<br>";i.positionDisplay.update(t,"Spacing",n)},this),stop:t.proxy(this.onSpacingStop,this)})},r.prototype.onSpacingStop=function(e,n){i.positionDisplay.hide("Spacing");var r=this.layer.getProperty("margin").split("|*|"),s=1,o=1;"px+"==r[r.length-1]&&Math.abs(parseFloat(this.$layer.css("fontSize"))-this.layer.baseSize)>1&&(s=this.canvasManager.getResponsiveRatio("h"),o=this.canvasManager.getResponsiveRatio("v"));for(var a in n.changed){var l=n.changed[a];switch(a){case"top":r[0]=Math.round(l/o);break;case"right":r[1]=Math.round(l/s);break;case"bottom":r[2]=Math.round(l/o);break;case"left":r[3]=Math.round(l/s)}}this.layer.setProperty("margin",r.join("|*|")),t("#layernormal-margin").data("field").insideChange(r.join("|*|"))},r.prototype.startUISizing=function(){var e=!1;this.layer.item&&this.layer.item.needSize&&(e=!0),this.$layer.nextendNormalSizing({height:e,syncWidth:!0,start:t.proxy(function(t,e){i.positionDisplay.show("NormalSizing"),"maxwidth"==e&&this.layer.layer.addClass("n2-ss-has-maxwidth")},this),resizeMaxWidth:t.proxy(function(t,e){i.positionDisplay.update(t,"NormalSizing","Max-width: "+(0==e.value?"none":e.value+"px"))},this),stopMaxWidth:t.proxy(function(t,e){i.positionDisplay.hide("NormalSizing"),this.layer.setProperty("maxwidth",e.value)},this),resizeHeight:t.proxy(function(t,e){i.positionDisplay.update(t,"NormalSizing","Height: "+e.value+"px")},this),stopHeight:t.proxy(function(t,e){i.positionDisplay.hide("NormalSizing");var n=1;parseInt(this.$layer.css("fontSize"))!=this.layer.baseSize&&(n=this.canvasManager.getResponsiveRatio("h"));var r=Math.round(r/n);this.layer.setProperty("height",e.value)},this)})},r.prototype._syncheight=function(){var t=parseInt(this.layer.getProperty("height"));if(t>0){var e="px",i=this.layer.baseSize;i>0&&(e="em",t=parseInt(t)/i),this.layer.layer.css("height",t+e)}else this.layer.layer.css("height","");this.layer.update()},r.prototype._syncmaxwidth=function(){var t=parseInt(this.layer.getProperty("maxwidth"));0>=t||isNaN(t)?this.layer.layer.css("maxWidth","").removeClass("n2-ss-has-maxwidth"):this.layer.layer.css("maxWidth",t+"px").addClass("n2-ss-has-maxwidth"),this.layer.update()},r.prototype._syncselfalign=function(){this.layer.layer.attr("data-cssselfalign",this.layer.getProperty("selfalign"))},r.prototype.sync=function(){this._syncmargin(),this._syncheight(),this._syncmaxwidth()},r}),N2Require("Placement",[],[],function(t,e,i){"use strict";function n(t){this.layer=t,this.canvasManager=t.canvasManager,this.modes={},this.current=null,this.isTransferHandled=!1,this.updatePositionThrottled=NextendDeBounce(this.updatePosition,200);
}return n.prototype.allow=function(t){switch(t){case"absolute":this.modes.absolute=new e.PlacementAbsolute(this,this.layer,this.canvasManager);break;case"normal":this.modes.normal=new e.PlacementNormal(this,this.layer,this.canvasManager);break;case"group":this.modes.absolute=new e.PlacementGroup(this,this.layer,this.canvasManager);break;case"content":this.modes.absolute=new e.PlacementContent(this,this.layer,this.canvasManager);break;case"default":this.modes["default"]=new e.PlacementDefault(this,this.layer,this.canvasManager)}},n.prototype.start=function(){for(var t in this.modes)this.modes[t].start()},n.prototype.setMode=function(t,e){var i=!1;if(e=e||{},"undefined"==typeof this.modes[t])throw new Exception("Layer placement("+t+") not allowed for the container",this.layer);if(this.current!=this.modes[t]){var n;this.current&&(this.modes[t].preActivation(this.current),n=this.current.type,i=this.current.deActivated(this.modes[t])),this.current=this.modes[t],this.layer.layer.attr("data-pm",this.current.type),this.current.activated(e),this.layer.$.triggerHandler("placementChanged",[this.current.type,n])}return i},n.prototype.doAction=function(t){try{return this.current[t].apply(this.current,Array.prototype.slice.call(arguments,1))}catch(e){}},n.prototype.getType=function(){return this.current.type},n.prototype.onResize=function(t){"function"==typeof this.current.onResize&&this.current.onResize(t)},n.prototype.updatePosition=function(){this.current.updatePosition()},n.prototype.getIndex=function(){return this.current.getIndex()},n.prototype.renderIndex=function(t){return this.current.renderIndex(t)},n.prototype.doLinearResize=function(t){this.current.doLinearResize(t)},n.prototype.sync=function(){this.current.sync()},n.prototype.renderModeProperties=function(t){var e=this.layer.getProperty("fontsize");this.layer.adjustFontSize(this.layer.getProperty("adaptivefont"),e,!1),this.current._renderModeProperties(t)},n.prototype["delete"]=function(){this.current["delete"]()},n}),N2Require("PlacementAbstract",["Placement"],[],function(t,e,i){"use strict";function n(t,e,i){this.placement=t,this.layer=e,this.canvasManager=i}return n.prototype.start=function(){},n.prototype.preActivation=function(t){},n.prototype.activated=function(){},n.prototype.deActivated=function(t){return!1},n.prototype.updatePosition=function(){this.layer.group.update()},n.prototype._renderModeProperties=function(t){},n.prototype._hide=function(){},n.prototype._show=function(){},n.prototype.snap=function(){return!1},n.prototype.getIndex=function(){return this.layer.layer.index()},n.prototype.renderIndex=function(t){},n.prototype.doLinearResize=function(t){},n.prototype.sync=function(){},n.prototype["delete"]=function(){},n.prototype.triggerLayerResized=function(t,e){},n.prototype.changeStatus=function(t,e){},n}),N2Require("Item",[],["smartSlider"],function(t,e,i,n){"use strict";function r(e,i,r){this.type===n&&(this.type=e.data("item")),this.needSize=this.constructor.needSize,this.self=this,this.$item=e,this.layer=i,this.itemEditor=r,this.fonts=[],this.styles=[],this.needFill=[],this.values=this.$item.data("itemvalues"),"object"!=typeof this.values&&(this.values=t.parseJSON(this.values)),this.pre="div#"+nextend.smartSlider.frontend.sliderElement.attr("id")+" ",this.defaultValues=r.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.layer.readyDeferred.done(t.proxy(this.reRender,this)),t("<div/>").addClass("ui-helper ui-item-overlay").css("zIndex",89).appendTo(this.$item),this.$item.find("a").on("click",function(t){t.preventDefault()}),t(window).trigger("ItemCreated")}return r.needSize=!1,r.prototype.setSelf=function(t){this.self!=this&&this.self.setSelf(t),this.self=t},r.prototype.getSelf=function(){return this.self!=this&&(this.self=this.self.getSelf()),this.self},r.prototype.changeValue=function(e,i){this==this.itemEditor.activeItem?t("#item_"+this.type+e).data("field").insideChange(i):this.values[e]=i},r.prototype.activate=function(t,e,i){this.itemEditor.setActiveItem(this,e,i)&&(nextend.basicCSS.activate("ss3item"+this.type,this.values,{font:this.fonts,style:this.styles}),this.itemEditor.lastValues[this.type]=this.values)},r.prototype.deActivate=function(){nextend.basicCSS.deActivate()},r.prototype.render=function(e,i){this.layer.layer.triggerHandler("itemRender"),this.$item.html(""),this.parseAll(e),this._render(e),this.itemEditor.lastValues[this.type]=this.values=i,t("<div/>").addClass("ui-helper ui-item-overlay").css("zIndex",89).appendTo(this.$item);var n=this.getName(e);n=n===!1||""==n||"Layer"==n?this.type:n.replace(/[<>]/gi,""),this.layer.rename(n,!1),this.layer.update(),this.$item.find("a").on("click",function(t){t.preventDefault()})},r.prototype._render=function(t){},r.prototype.reRender=function(e){this.values=t.extend({},this.getDefault(),this.values,e),this.render(t.extend({},this.values),this.values)},r.prototype["delete"]=function(){this.$item.trigger("mouseleave"),this.$item.remove(),this.itemEditor.activeItem==this&&(this.itemEditor.activeItem=null)},r.prototype.getHTML=function(e){var i="";return i=e?"["+this.type+' values="'+Base64.encode(JSON.stringify(this.values))+'"]':t('<div class="n2-ss-item n2-ss-item-'+this.type+'"></div>').attr("data-item",this.type).attr("data-itemvalues",JSON.stringify(this.values))},r.prototype.getData=function(){return{type:this.type,values:this.values}},r.prototype.getDefault=function(){return{}},r.prototype.added=function(){},r.prototype.addedFont=function(e,i){var n=t("#item_"+this.type+i);n.length&&(this.fonts.push({mode:e,name:i,field:n.data("field"),def:this.defaultValues[i]}),t.when(nextend.fontManager.addVisualUsage(e,this.values[i],this.pre)).done(t.proxy(function(t){t||this.changeValue(i,"")},this)))},r.prototype.addedStyle=function(e,i){var n=t("#item_"+this.type+i);n.length&&(this.styles.push({mode:e,name:i,field:n.data("field"),def:this.defaultValues[i]}),t.when(nextend.styleManager.addVisualUsage(e,this.values[i],this.pre)).done(t.proxy(function(t){t||this.changeValue(i,"")},this)))},r.prototype.parseAll=function(t){for(var e=0;e<this.fonts.length;e++)t[this.fonts[e].name+"class"]=nextend.fontManager.getClass(t[this.fonts[e].name],this.fonts[e].mode)+" ";for(var e=0;e<this.styles.length;e++)t[this.styles[e].name+"class"]=nextend.styleManager.getClass(t[this.styles[e].name],this.styles[e].mode)+" ";for(var e=0;e<this.needFill.length;e++)"undefined"!=typeof t[this.needFill[e]]&&(t[this.needFill[e]]=nextend.smartSlider.generator.fill(t[this.needFill[e]]+""))},r.prototype.getName=function(t){return"Layer"},r.prototype.resizeLayerToImage=function(e){var n=this.layer;t("<img/>").attr("src",e).on("load",function(){var t=i.frontend.dimensions.slide,e=this.width,r=this.height,s=t.width,o=t.height;e>0&&r>0&&(e>s&&(r=r*s/e,e=s),r>o&&(e=e*o/r),nextend.smartSlider.history.off(),n.setProperty("width",e),n.setProperty("height","auto"),nextend.smartSlider.history.on())})},r.prototype.fitLayer=function(t){return!1},r}),N2Require("ItemManager",[],["smartSlider"],function(t,e,i,n){"use strict";function r(e,n){this.suppressChange=!1,this.activeItemOriginalData=null,this.canvasManager=e,this.lastValues={},this.startItems(),this.forms={},this.activeForm=!1,n.isUploadDisabled||i.frontend.sliderElement.fileupload({url:n.uploadUrl,pasteZone:!1,dropZone:i.frontend.sliderElement,dataType:"json",paramName:"image",add:function(t,e){e.formData={path:"/"+n.uploadDir},e.submit()},done:t.proxy(function(t,e){var i=e.result;if(i.data&&i.data.name){var n=this.createLayerItem(!1,{item:"image"});n.reRender({image:i.data.url}),n.activate(null,null,!0)}else NextendAjaxHelper.notification(i)},this),fail:function(t,e){NextendAjaxHelper.notification(e.jqXHR.responseJSON)},start:function(){NextendAjaxHelper.startLoading()},stop:function(){setTimeout(function(){NextendAjaxHelper.stopLoading()},100)}})}return r.prototype.setActiveItem=function(e,i,n){if(e!=this.activeItem||n){this.activeItemOriginalData=null;var r=e.type;this.activeForm&&this.activeForm.form.css("display","none"),this.activeItem&&this.activeItem.deActivate(),this.activeForm=this.getItemForm(r);var s=t.extend({},this.activeForm.values,e.values);this.activeItem=e,this.suppressChange=!0;for(var o in s){var a=t("#item_"+r+o).data("field");a&&a.insideChange(s[o])}return this.suppressChange=!1,this.activeForm.form.css("display","block"),this.focusFirst(i),!0}return!1},r.prototype.focusFirst=function(t){var e=this.activeForm.fields.eq(0).data("field");nextend.smartSlider.generator.isDynamicSlide()&&e.connectedField&&e.connectedField instanceof N2Classes.FormElementImage||this.activeForm.fields.eq(0).data("field").focus("undefined"!=typeof t&&t)},r.prototype.startItems=function(){t(".n2-ss-core-item").nextendCanvasItem({canvasUIManager:this.canvasManager.mainContainer.canvasUIManager,distance:5,$layer:function(){return this.element.clone()},onCreate:t.proxy(function(t,e,n,r){switch(n.layer.type){case"content":case"col":i.history.startBatch();var s=this.createLayerItem(n.layer,e.$layer.data(),"click");i.history.addControl("skipForwardUndos"),n.layer.container.insertLayerAt(s.layer,r),s.layer.changeGroup(!1,n.layer),i.history.endBatch();break;case"row":var o=n.layer.createCol();n.layer.moveCol(o.getIndex(),r),i.history.startBatch();var s=this.createLayerItem(o,e.$layer.data(),"click");i.history.addControl("skipForwardUndos"),o.container.insertLayerAt(s.layer,0),s.layer.changeGroup(!1,o),i.history.endBatch();break;default:var a=nextend.smartSlider.$currentSlideElement.offset(),s=this.createLayerItem(this.canvasManager.mainContainer,e.$layer.data(),"click");s.layer.placement.current.setPosition(t.pageX-a.left-20,t.pageY-a.top-20)}},this),start:function(){t("#n2-ss-add-sidebar").removeClass("n2-active")}}).on("click",t.proxy(function(e){this.createLayerItem(this.canvasManager.mainContainer.getActiveGroup(),t(e.currentTarget).data(),"click")},this)),t("[data-itemshortcut]").on({click:t.proxy(function(e){e.preventDefault(),t('.n2-ss-core-item[data-item="'+t(e.currentTarget).data("itemshortcut")+'"]').trigger("click")},this),mousedown:t.proxy(function(e){t('.n2-ss-core-item[data-item="'+t(e.currentTarget).data("itemshortcut")+'"]').trigger(e)},this)}),t("[data-structureshortcut]").on({click:t.proxy(function(e){e.preventDefault(),t(".n2-ss-add-layer-button").trigger("click"),t("#n2-ss-layers-switcher > .n2-labels .n2-td").eq(1).trigger("click")},this),mousedown:t.proxy(function(e){t('.n2-ss-core-item[data-type="'+t(e.currentTarget).data("structureshortcut")+'"]').trigger(e)},this)})},r.prototype.createLayerItem=function(n,r,s,o){n=n||this.canvasManager.mainContainer.getActiveGroup();var a=r.item;if("structure"==a){var l=new e.Row(this.canvasManager,n,{});return l.create(r.type),l.hightlightStructure(),{layer:l}}var h=this.getItemForm(a),d=t("<div></div>").attr("data-item",a).data("itemvalues",t.extend(!0,{},h.values,this.getLastValues(a))).addClass("n2-ss-item n2-ss-item-"+a),l=this._createLayer(d,n,t.extend(t(".n2-ss-core-item-"+a).data("layerproperties"),o));return s&&"click"==s?setTimeout(function(){l.layer.trigger("mousedown",["create"]).trigger("mouseup",["create"]).trigger("click",["create"])},500):l.activate(),i.layerWindow.switchTab("item"),i.history.addSimple(this,this.historyDelete,this.historyCreate,[n,l,r]),l.item},r.prototype.getLastValues=function(t){return this.lastValues[t]!==n?this.lastValues[t]:{}},r.prototype.getItemClass=function(t){var i="Item"+t.capitalize();return"undefined"==typeof e[i]?"Item":i},r.prototype._createLayer=function(t,i,n){var r=this.canvasManager.layerOptions.layerFeatures.layerDefault;for(var s in r)null!==r[s]&&(n[s]=r[s]);var o=new e.Layer(this.canvasManager,i,n);return o.create(function(e){return e._createLayer().append(t)}),o},r.prototype.getItemForm=function(e){if(this.forms[e]===n){var i=t("#smartslider-slide-toolbox-item-type-"+e),r={form:i,values:i.data("itemvalues"),fields:i.find('[name^="item_'+e+'"]'),fieldNameRegexp:new RegExp("item_"+e+"\\[(.*?)\\]","")};r.fields.on({nextendChange:t.proxy(this.updateCurrentItem,this),keydown:t.proxy(this.updateCurrentItemDeBounced,this)}),this.forms[e]=r}return this.forms[e]},r.prototype.updateCurrentItem=function(e){if(!this.suppressChange){null===this.activeItemOriginalData&&(this.activeItemOriginalData=t.extend({},this.activeItem.values));var n={},r={};if(this.activeForm.fields.each(t.proxy(function(e,i){var i=t(i),s=i.attr("name").match(this.activeForm.fieldNameRegexp)[1];r[s]=n[s]=i.val()},this)),e&&"nextendChange"==e.type){var s=i.history.addValue(this,this.historyUpdateCurrentItem,[this.activeItem]);s&&s.setValues(this.activeItemOriginalData,t.extend({},r)),this.activeItemOriginalData=null}this.activeItem.render(t.extend({},this.activeItem.getDefault(),n),r)}},r.prototype.historyUpdateCurrentItem=function(e,i){var n=i.getSelf();n.reRender(t.extend(!0,{},e)),n.values=e,this.activeItem==n&&n.activate(null,null,!0)},r.prototype.updateCurrentItemDeBounced=NextendDeBounce(function(t){this.updateCurrentItem(t)},100),r.prototype.historyDelete=function(t,e){e.getSelf()["delete"]()},r.prototype.historyCreate=function(t,e,i){var n=this.createLayerItem(t.getSelf(),i);e.setSelf(n.layer)},r.prototype.historyCreateStructure=function(t,e,i){var n=this.createLayerItem(t.getSelf(),i);e.setSelf(n.layer)},r.prototype.getSelf=function(){return this},r}),N2Require("HeadingItemSplitTextAdmin",["FrontendItemHeadingSplitText"],[],function(t,e,i){"use strict";function n(i,n,r,s,o,a,l,h){if(""!=o)try{o=JSON.parse(Base64.decode(o))}catch(d){o=!1}else o=!1;if(""!=l)try{l=JSON.parse(Base64.decode(l))}catch(d){l=!1}else l=!1;o||t("#"+n).closest(".n2-ss-layer").triggerHandler("layerExtraAnimationRemoved"),(o||l)&&e.FrontendItemHeadingSplitText.prototype.constructor.call(this,i,n,r,s,o,a,l,h)}return n.prototype=Object.create(e.FrontendItemHeadingSplitText.prototype),n.prototype.constructor=n,n.prototype.started=function(i,n,r,s,o,a){e.FrontendItemHeadingSplitText.prototype.started.apply(this,arguments),this.layer.on("AnimationSetZero."+this.id,t.proxy(this.setZero,this)),this.layer.on("itemRender."+this.id,t.proxy(function(){this.layer.off("."+this.id)},this)),r&&(this.layer.on("timelineLoadedForLayer."+this.id,t.proxy(function(){this.layer.triggerHandler("layerExtraAnimationAdded",[s,"ST",t.proxy(this.changeIn,this),t.proxy(this.editIn,this)])},this)),this.layer.triggerHandler("layerExtraAnimationAdded",[s,"ST",t.proxy(this.changeIn,this),t.proxy(this.editIn,this)]))},n.prototype.changeIn=function(e){t("#item_headingsplit-text-delay-in").val(1e3*e).trigger("change")},n.prototype.editIn=function(e){t("#item_headingsplit-text-animation-in").parent().find(".n2-form-element-button").trigger("click")},n.prototype.off=function(){this.node.closest(".n2-ss-static-slide, .n2-ss-slide").off("."+this.id)},n.prototype.setZero=function(t,e){for(var i=this.splitText.vars.type.split(","),n=0;n<i.length;n++)NextendTween.set(this.splitText[i[n]],{opacity:1,scale:1,x:0,y:0,rotationX:0,rotationY:0,rotationZ:0})},n.prototype.extendTimelines=function(t,i){n2.contains(document,this.node[0])?e.FrontendItemHeadingSplitText.prototype.extendTimelines.call(this,t,i):this.off()},n}),N2Require("PluginActivatable",[],[],function(t,e,i){"use strict";function n(){this.isActive=!1,this.preventActivation=!1}return n.prototype.activate=function(t,e,i){return this.preventActivation?!1:(document.activeElement&&document.activeElement.blur(),t&&(t.ctrlKey||t.metaKey)&&this.canvasManager.mainContainer.getSelectedLayer()?!this.select():t&&3==t.which&&this.canvasManager.selectMode?!1:(i||this.canvasManager.exitSelectMode(),t&&this.positionSidebar(),this.canvasManager.mainContainer.getSelectedLayer()!==this&&(this.layerRow.addClass("n2-active"),this.layer.addClass("n2-active"),this.layer.triggerHandler("n2-ss-activate"),this.canvasManager.changeActiveLayer(this,i),nextend.activeLayer=this.layer,this.canvasManager.ui.onActivateLayer(this)),this.isActive=!0,!0))},n.prototype.deActivate=function(){this.isActive=!1,this.layer===i&&console.error(),this.layer.removeClass("n2-active"),this.layerRow.removeClass("n2-active"),this.layer.triggerHandler("n2-ss-deactivate")},n}),N2Require("PluginAnimatable",[],["smartSlider"],function(t,e,i,n){"use strict";function r(){this.animations=null}return r.prototype.addProperties=function(t){this.createProperty("mouseenter","",t),this.createProperty("click","",t),this.createProperty("mouseleave","",t),this.createProperty("play","",t),this.createProperty("pause","",t),this.createProperty("stop","",t)},r.prototype.updateAnimations=function(){i.layerAnimationManager.layerWindowEditor.update(this),this.layerRow.toggleClass("n2-ss-layer-has-animations",this.animations.hasAnimation())},r.prototype.createLayerAnimations=function(t,i){var n=[];if(this.animations){var r=this.layer,s=r.data("animatableselector");s&&(r=r.find(s));var o=new e.FrontendLayerAnimations(this.layer,r);o.setLinear(this,t,i)&&n.push(o)}if(this.container)for(var a=this.container.getSortedLayers(),l=0;l<a.length;l++)n.push.apply(n,a[l].createLayerAnimations(t,i));return n},r}),N2Require("PluginEditableName",[],[],function(t,e,i){"use strict";function n(){}var r=300,s=null;return n.prototype.addProperties=function(t){this.createProperty("name",this.label,t),this.createProperty("nameSynced",1,t)},n.prototype.makeNameEditable=function(){this.layerTitleSpan.on({mouseup:t.proxy(function(e){s?(clearTimeout(s),s=null,this.editName()):(this.activate(e),s=setTimeout(t.proxy(function(){s=null},this),r))},this)})},n.prototype.editName=function(){var i=new e.InlineField;i.$input.on({valueChanged:t.proxy(function(t,e){this.rename(e,!0),this.layerTitleSpan.css("display","inline")},this),cancel:t.proxy(function(){this.layerTitleSpan.css("display","inline")},this)}),this.layerTitleSpan.css("display","none"),i.injectNode(this.layerTitle,this.property.name)},n.prototype.rename=function(t,e){if(this.property.nameSynced||e){if(e&&(this.property.nameSynced=0),""==t){if(e)return this.property.nameSynced=1,this.item.reRender(),!1;t="Layer #"+(this.group.getLayerCount()+1)}t=t.substr(0,35),this.property.name!=t&&(this.property.name=t,this.layerTitleSpan.html(t),this.$.trigger("layerRenamed",t))}},n}),N2Require("PluginShowOn",[],["smartSlider"],function(t,e,i,n){"use strict";function r(){}return r.prototype.addProperties=function(t){this.showsOnCurrent=!0,this.createProperty("generatorvisible","",t),this.createProperty("desktopPortrait",1,t),this.createProperty("desktopLandscape",1,t),this.createProperty("tabletPortrait",1,t),this.createProperty("tabletLandscape",1,t),this.createProperty("mobilePortrait",1,t),this.createProperty("mobileLandscape",1,t)},r.prototype._hide=function(){this.layer.css("display","none"),this.showsOnCurrent=!1,this.update()},r.prototype._show=function(){parseInt(this.property[this.canvasManager.getMode()])&&(this.layer.css("display",""),this.showsOnCurrent=!0),this.update()},r.prototype._syncdesktopPortrait=function(){var t=this.getProperty("desktopPortrait");this.__syncShowOnDevice("desktopPortrait",t)},r.prototype._syncdesktopLandscape=function(){var t=this.getProperty("desktopLandscape");this.__syncShowOnDevice("desktopLandscape",t)},r.prototype._synctabletPortrait=function(){var t=this.getProperty("tabletPortrait");this.__syncShowOnDevice("tabletPortrait",t)},r.prototype._synctabletLandscape=function(){var t=this.getProperty("tabletLandscape");this.__syncShowOnDevice("tabletLandscape",t)},r.prototype._syncmobilePortrait=function(){var t=this.getProperty("mobilePortrait");this.__syncShowOnDevice("mobilePortrait",t)},r.prototype._syncmobileLandscape=function(){var t=this.getProperty("mobileLandscape");this.__syncShowOnDevice("mobileLandscape",t)},r.prototype.__syncShowOnDevice=function(t,e){if(this.getMode()==t){var e=parseInt(e);e?this._show():this._hide(),this.layer.triggerHandler("LayerShowChange",[t,e]),this.placement.doAction("triggerLayerResized")}},r}),N2Require("Col",["ContentAbstract"],["smartSlider"],function(t,e,i,n){"use strict";function r(t,i,n){this.label="Col",this.type="col",this.innerContainer="> .n2-ss-layer-col",e.ContentAbstract.prototype.constructor.call(this,t,i,n),this.placement.allow("default")}return r.prototype=Object.create(e.ContentAbstract.prototype),r.prototype.constructor=r,r.prototype._createLayer=function(){return t('<div class="n2-ss-layer"><div class="n2-ss-layer-content n2-ss-layer-col"></div></div>').attr("data-type",this.type)},r.prototype.addProperties=function(t){e.ContentAbstract.prototype.addProperties.call(this,t),this.createProperty("colwidth","1",t),this.createProperty("link","#|*|_self",t),this.createProperty("borderradius",0,t),this.createProperty("boxshadow","0|*|0|*|0|*|0|*|00000080",t),this.createProperty("borderwidth","1|*|1|*|1|*|1",t),this.createProperty("borderstyle","none",t),this.createProperty("bordercolor","ffffffff",t),this.createDeviceProperty("order",{desktopPortrait:0},t)},r.prototype.create=function(){e.ContentAbstract.prototype.create.call(this),this._syncorder(),this._syncborder(),this._syncborderradius(),this._syncboxshadow(),this._onReady()},r.prototype.load=function(t){e.ContentAbstract.prototype.load.call(this,t),this._syncorder(),this._syncborder(),this._syncborderradius(),this._syncboxshadow(),this._onReady();var i=t.data("rowcolumns")+"";if(i!=n&&"resolved"==this.group.readyDeferred.state()){for(var r=i.split("+"),s=0;s<r.length;s++)r[s]=new Fraction(r[s]);this.group.setColsWidth(r)}},r.prototype.createRow=function(){this.$content=this.layer.find(".n2-ss-layer-content:first"),this.container=new e.LayerContainer(this,t('<ul class="n2-list n2-h4 n2-list-orderable" />'),"normal","> .n2-ss-layer",["row","layer"]),this.container.setLayerContainerElement(this.$content);var i=t('<div class="n2-button n2-button-icon n2-button-m n2-button-m-narrow" data-n2tip="'+n2_("Delete layer")+'"><i class="n2-i n2-i-delete n2-i-grey-opacity"></i></div>').on("click",t.proxy(this["delete"],this)),n=t('<div class="n2-button n2-button-icon n2-button-m n2-button-m-narrow" data-n2tip="'+n2_("Duplicate layer")+'"><i class="n2-i n2-i-duplicate n2-i-grey-opacity"></i></div>').on("click",t.proxy(function(){this.duplicate(!0,!1)},this));this._createLayerListRow([t('<div class="n2-actions"></div>').append(n).append(i)]).addClass("n2-ss-layer-content-row"),this.openerElement=t('<a href="#" class="n2-ss-layer-icon n2-button n2-button-icon n2-button-m"><i class="n2-i n2-i-col"></i></a>').insertBefore(this.layerTitleSpan).on("click",t.proxy(this.switchOpened,this)),this.container.$ul.appendTo(this.layerRow),this.readyDeferred.done(t.proxy(this._syncopened,this))},r.prototype._start=function(t){e.ContentAbstract.prototype._start.call(this,t),t&&this.highlight(2e3)},r.prototype.getRealOrder=function(){var t=this.getProperty("order");return 0==t?10:t},r.prototype._syncorder=function(){var t=this.getProperty("order");0==t?this.layer.css("order",""):this.layer.css("order",t),this.group.refreshUI()},r.prototype._synccolwidth=function(){this.layer.css("width",100*new Fraction(this.getProperty("colwidth")).valueOf()+"%"),this.group.refreshUI()},r.prototype._synclink=function(){},r.prototype._syncborderradius=function(){this.$content.css("border-radius",this.getProperty("borderradius")+"px")},r.prototype._syncborderwidth=r.prototype._syncbordercolor=r.prototype._syncborderstyle=function(){this._syncborder()},r.prototype._syncborder=function(){var t=this.getProperty("borderstyle");if("none"!=t){this.$content.css("border-color",N2Color.hex2rgbaCSS(this.getProperty("bordercolor"))),this.$content.css("border-style",this.getProperty("borderstyle"));var e=this.getProperty("borderwidth").split("|*|"),i="px";this.$content.css("border-width",e.join(i+" ")+i)}else this.$content.css("border","");this.update()},r.prototype._syncboxshadow=function(){var t=this.getProperty("boxshadow").split("|*|");0==t[0]&&0==t[1]&&0==t[2]&&0==t[3]||0==N2Color.hex2alpha(t[4])?this.$content.css("box-shadow",""):this.$content.css("box-shadow",t[0]+"px "+t[1]+"px "+t[2]+"px "+t[3]+"px "+N2Color.hex2rgbaCSS(t[4]))},r.prototype["delete"]=function(){this.group.container.getLayerCount()>1?this._delete():this.group["delete"]()},r.prototype.getHTML=function(t){var i=e.ComponentAbstract.prototype.getHTML.call(this,t);return i.attr("data-rowcolumns",this.group.getColumns()),i},r.prototype.renderModeProperties=function(t){this._syncorder(),e.ContentAbstract.prototype.renderModeProperties.call(this,t)},r.prototype.update=function(){this.group._syncwrapafter(),e.ComponentAbstract.prototype.update.call(this)},r});var dependencies=["LayerDataStorage","PluginEditableName"];dependencies.push("PluginAnimatable"),N2Require("ComponentAbstract",dependencies,["smartSlider"],function(t,e,i,n){"use strict";function r(i,n,o){this.wraps={},this.counter=s++,window.layers[this.counter]=this,this.self=this,this.originalProperties=o||{},e.LayerDataStorage.prototype.constructor.call(this),this.readyDeferred=t.Deferred(),this.readyDeferred.done(t.proxy(this.onReady,this)),this.isDeleteStarted=!1,this.isDeleted=!1,this._lastClasses=!1,this.$=t(this),this.proxyRefreshBaseSize=t.proxy(this.refreshBaseSize,this),this.status=r.STATUS.UNDEFINED,this.canvasManager=i,this.group=n,e.PluginActivatable.prototype.constructor.call(this),e.PluginAnimatable.prototype.constructor.call(this),this.placement=new e.Placement(this),this.readyDeferred.done(t.proxy(this.addUILabels,this))}var s=0;window.layers=[],r.STATUS={UNDEFINED:0,NORMAL:1,LOCKED:2,HIDDEN:3},r.STATUS_INV={0:"UNDEFINED",1:"NORMAL",2:"LOCKED",3:"HIDDEN"};for(var o in e.PluginActivatable.prototype)r.prototype[o]=e.PluginActivatable.prototype[o];for(var o in e.LayerDataStorage.prototype)r.prototype[o]=e.LayerDataStorage.prototype[o];for(var o in e.PluginEditableName.prototype)r.prototype[o]=e.PluginEditableName.prototype[o];for(var o in e.PluginAnimatable.prototype)r.prototype[o]=e.PluginAnimatable.prototype[o];for(var o in e.PluginShowOn.prototype)r.prototype[o]=e.PluginShowOn.prototype[o];return r.prototype.addUILabels=function(){this.markTimer=null,this.uiLabel=t('<div class="n2-ss-layer-ui-label-container"><div class="n2-ss-layer-ui-label n2-ss-layer-ui-label-self">'+this.getUILabel()+"</div></div>").appendTo(this.layer),nextend.tooltip.addElement(t('<div class="n2-ss-layer-ui-label n2-ss-layer-ui-label-up n2-ss-layer-ui-label-action"><i class="n2-i n2-i-uplevel"/></div>').on({mousedown:function(t){t.stopPropagation()},click:t.proxy(function(t){this.up(t)},this)}).appendTo(this.uiLabel),"Select parent"),t('<div class="n2-ss-layer-ui-label n2-ss-layer-ui-label-action"><i class="n2-i n2-i-mini-duplicate"/></div>').on({mousedown:function(t){t.stopPropagation()},click:t.proxy(function(){this.duplicate()},this)}).appendTo(this.uiLabel),t('<div class="n2-ss-layer-ui-label n2-ss-layer-ui-label-action"><i class="n2-i n2-i-mini-trash"/></div>').on({mousedown:function(t){t.stopPropagation()},click:t.proxy(function(){this["delete"]()},this)}).appendTo(this.uiLabel)},r.prototype.getUILabel=function(){return this.label},r.prototype.up=function(t){t.stopImmediatePropagation(),this.group.activate(t)},r.prototype.addProperties=function(t){this.createProperty("id",null,t,this),this.createProperty("class","",t),this.createProperty("crop","visible",t),this.createProperty("rotation",0,t),this.createProperty("parallax",0,t),this.createProperty("adaptivefont",0,t),this.createDeviceProperty("fontsize",{desktopPortrait:100},t),e.PluginAnimatable.prototype.addProperties.call(this,t),e.PluginShowOn.prototype.addProperties.call(this,t),e.PluginEditableName.prototype.addProperties.call(this,t)},r.prototype.getRootElement=function(){return this.layer},r.prototype.create=function(t,e){e=e||!1,e||this.addProperties(!1),"function"==typeof t?this.layer=t.call(null,this):this.layer=this._createLayer(),this.layer.addClass("n2-ss-layer-under-creation"),e&&this.addProperties(this.layer),this.layer.data("layerObject",this),this.layer.triggerHandler("layerStarted",[this]),this.group.container.insert(this),this.group.onChildCountChange(),this.$.triggerHandler("create"),this._start(!0)},r.prototype.load=function(t){this.addProperties(t),this.layer=t.data("layerObject",this),this.layer.triggerHandler("layerStarted",[this]),this.$.triggerHandler("load"),this._start(!1);var e=t.data("status");null!==e&&"undefined"!=typeof e?this.changeStatus(e):this.changeStatus(r.STATUS.NORMAL)},r.prototype._start=function(i){this.createRow();var n=this.layer.find("> .n2-ss-layer-mask");n.length&&(this.wraps.mask=n),this._synccrop(),this._syncrotation(),this.placement.start(),this.placement.setMode(this.group.container.allowedPlacementMode,this.originalProperties),this.animations=new e.LayerAnimations(this),this.setGroup(this.group),this.canvasManager.$.triggerHandler("layerCreated",this),this.animations.load(),i&&(this.refreshBaseSize(),this.$.triggerHandler("created")),setTimeout(t.proxy(function(){this.isDeleted||(this.placement.onResize(!0),this.layer.css("visibility",""),this.layer.removeClass("n2-ss-layer-under-creation"))},this),300)},r.prototype._onReady=function(){this.originalProperties={},this.readyDeferred.resolve(),this.layer.on({mouseover:t.proxy(this.markOver,this),mouseout:t.proxy(this.markOut,this)})},r.prototype.isReady=function(){return"resolved"==this.readyDeferred.state()},r.prototype.getName=function(){return this.property.name},r.prototype.setGroup=function(t){this.group.$.off("baseSizeUpdated",this.proxyRefreshBaseSize),this.group=t,this.placement.setMode(t.container.allowedPlacementMode),t.container.syncLayerRow(this),this.isReady()&&this.refreshBaseSize(),this.group.$.on("baseSizeUpdated",this.proxyRefreshBaseSize)},r.prototype.changeGroup=function(t,e){var i=this.group;i.$.off("baseSizeUpdated",this.proxyRefreshBaseSize),this.group=e;var n=this.placement.setMode(e.container.allowedPlacementMode);e.container.syncLayerRow(this),this.refreshBaseSize(),e.$.on("baseSizeUpdated",this.proxyRefreshBaseSize),this.userGroupChange(i,t,n,e,this.getIndex()),i.update()},r.prototype.userGroupChange=function(t,e,n,r,s){if(t==r)this.userIndexChange(e,s);else{var o=i.history.addValue(this,this.historyUserGroupChange,[]);o&&o.setValues({historyGroup:t,index:e,placementData:n},{historyGroup:r,index:s})}},r.prototype.historyUserGroupChange=function(t){var e=this.group,i=t.historyGroup.getSelf(),n=t.index;i.container.insertLayerAt(this,n),this.group.$.off("baseSizeUpdated",this.proxyRefreshBaseSize),this.group=i,t.placementData&&this.layer.data(t.placementData),this.placement.setMode(i.container.allowedPlacementMode),i.container.syncLayerRow(this),this.refreshBaseSize(),this.group.$.on("baseSizeUpdated",this.proxyRefreshBaseSize),i.onChildCountChange(),t.placementData&&this.placement.sync(),e.update()},r.prototype.userIndexChange=function(t,e){var n=i.history.addValue(this,this.historyUserIndexChange);n&&n.setValues(t,e),this.group.container.insertLayerAt(this,e)},r.prototype.historyUserIndexChange=function(t){this.group.container.insertLayerAt(this,t)},r.prototype._createLayerListRow=function(e){return this.layerRow=t('<li class="n2-ss-layerlist-row"></li>').data("layer",this).on({mousedown:t.proxy(nextend.context.setMouseDownArea,nextend.context,"layerRowClicked")}).appendTo(this.group.container.$ul),this.layerTitleSpan=t('<span class="n2-ucf">'+this.property.name+"</span>"),this.makeNameEditable(),this.layerTitle=t('<div class="n2-ss-layer-title"></div>').on({mouseenter:t.proxy(function(){this.canvasManager.highlight(this)},this),mouseleave:t.proxy(function(){this.canvasManager.deHighlight(this)},this)}).append(this.layerTitleSpan).append(e).appendTo(this.layerRow).on({mouseup:t.proxy(function(t){nextend.shouldPreventMouseUp||"DIV"!==t.target.tagName||this.activate(t)},this)}),nextend.tooltip.add(this.layerRow),this.layerRow.nextendLayerListItem({UIManager:this.canvasManager.mainContainer.layerListUIManager,layer:this,$item:this.layerRow}),this.layerRow;
},r.prototype.select=function(t){return this.canvasManager.selectLayer(this,!0)},r.prototype.update=function(){this.readyDeferred.done(t.proxy(this.placement.updatePositionThrottled,this.placement))},r.prototype.updateThrottled=function(){this.placement.updatePositionThrottled()},r.prototype.positionSidebar=function(){this.canvasManager.layerWindow.show(this,this.layer)},r.prototype.showEditor=function(){this.canvasManager.layerWindow._show()},r.prototype.highlight=function(e){e=e||2e3,this.isHighlighted&&(clearTimeout(this.isHighlighted),this.isHighlighted=!1),this.layer.addClass("n2-highlight"),this.isHighlighted=setTimeout(t.proxy(function(){this.layer.removeClass("n2-highlight")},this),e)},r.prototype.setPropertydesktopPortrait=r.prototype.setPropertydesktopLandscape=r.prototype.setPropertytabletPortrait=r.prototype.setPropertytabletLandscape=r.prototype.setPropertymobilePortrait=r.prototype.setPropertymobileLandscape=function(t,e,i){this._setProperty(t,parseInt(e),i)},r.prototype.getHTML=function(t){var i=this._createLayer();for(var r in this.property)"width"!=r&&"height"!=r&&"left"!=r&&"top"!=r&&i.attr("data-"+r.toLowerCase(),this.property[r]);for(var r in this.deviceProperty)for(var s in this.deviceProperty[r])i.attr("data-"+r.toLowerCase()+s,this.deviceProperty[r][s]);for(var r in this.deviceProperty.desktop)i.css(r,this.deviceProperty.desktop[r]+"px");if(this.container!=n){var o=i;this.innerContainer!=n&&(o=i.find(this.innerContainer)),o.append(this.container.getHTML(t))}var a=this.getProperty("id");return a&&""!=a&&i.attr("id",a),this.status>e.ComponentAbstract.STATUS.NORMAL&&i.attr("data-status",this.status),i.attr("data-animations",this.animations.getAnimationsCode()),i},r.prototype.duplicate=function(e){var n=this.getHTML(!1);if("absolute"==this.placement.getType()){var r=n.attr("id");r&&(r=t.fn.uid(),n.attr("id",r),n.attr("data-id",r)),n.attr("data-parentid")?(n.data("desktopportraittop",0),n.data("desktopportraitleft",0)):(n.data("desktopportraittop",n.data("desktopportraittop")+40),n.data("desktopportraitleft",n.data("desktopportraitleft")+40)),n.attr("data-parentid","")}var s=this.canvasManager.insertComponentWithNode(this.group,n,this.getIndex()+1,!1,!0);return this.layerRow.trigger("mouseleave"),e&&s.activate(),i.history.addSimple(this,this.historyDeleteDuplicated,this.historyDuplicate,[s,s.container?s.container.getAllLayers():!1]),s},r.prototype.historyDeleteDuplicated=function(t){t.getSelf()["delete"]()},r.prototype.historyDuplicate=function(t,e){var i=this.duplicate(!1,!1);if(t.setSelf(i),e)for(var n=i.container.getAllLayers(),r=0;r<n.length;r++)e[r].setSelf(n[r])},r.prototype.historyDelete=function(){this["delete"]()},r.prototype.historyRestore=function(t,e,i,n){var r=this.canvasManager.insertComponentWithNode(this.group.getSelf(),t.clone(),i,!1,!0);if(this.setSelf(r),n)for(var s=r.container.getAllLayers(),o=0;o<s.length;o++)n[o].setSelf(s[o])},r.prototype["delete"]=function(){i.positionDisplay.hide(),nextend.tooltip.onLeave(),this._delete()},r.prototype._delete=function(){if(this.isDeleteStarted=!0,this.canvasManager.mainContainer.getSelectedLayer()==this&&this.canvasManager.layerWindow.hide(),this.isHighlighted&&(clearTimeout(this.isHighlighted),this.isHighlighted=!1),i.history.startBatch(),i.history.addSimple(this,this.historyRestore,this.historyDelete,[this.getHTML(!1),this.group,this.getIndex(),this.container?this.container.getAllLayers():!1]),this.deActivate(),this.container!=n){i.history.off();for(var t=this.container.getSortedLayers(),e=0;e<t.length;e++)t[e]._delete();i.history.on()}i.history.endBatch(),this.item!=n&&this.item["delete"](),this.placement["delete"](),this.layer.trigger("mouseup"),this.isDeleted=!0,this.canvasManager.mainContainer.layerDeleted(this),this.layer.triggerHandler("LayerDeleted"),this.getRootElement().remove(),this.layerRow.remove(),this.group.update(),this.group.$.off("baseSizeUpdated",this.proxyRefreshBaseSize),this.$.trigger("layerDeleted"),this.markTimer&&clearTimeout(this.markTimer),delete this.layer,delete this.itemEditor,delete this.animation,this.group.onChildCountChange()},r.prototype.getData=function(i){var n={type:this.type,lastplacement:this.placement.getType()};n.animations=this.animations.getData(),this.status>e.ComponentAbstract.STATUS.NORMAL&&(n.status=this.status);var r=t.extend({},this.property);for(var s in this.deviceProperty)for(var o in this.deviceProperty[s]){delete r[o];var a=this.deviceProperty[s][o];if("undefined"!=typeof a){switch(o){case"width":case"height":this.isDimensionPropertyAccepted(a)||(a=parseFloat(a));break;case"fontsize":case"left":case"top":case"gutter":case"wrap":a=parseFloat(a)}n[s.toLowerCase()+o]=a}}for(var l in r)n[l.toLowerCase()]=r[l];return n},r.prototype.onChildCountChange=function(){},r.prototype.getDataWithChildren=function(e,i){return-1==t.inArray(this,i)&&(i.push(this),e.push(this.getData({layersIncluded:!0,itemsIncluded:!0})),this.layer.triggerHandler("LayerGetDataWithChildren",[e,i])),e},r.prototype.markOver=function(t){this.layer.addClass("n2-ss-mouse-over"),t.stopPropagation(),this.group.markEnter(),this.markTimer&&clearTimeout(this.markTimer),this.layer.addClass("n2-ss-mouse-over-delayed"),this.uiLabel.removeClass("invisible")},r.prototype.markOut=function(e){this.layer.removeClass("n2-ss-mouse-over"),e&&e.stopPropagation(),this.group.markLeave(),this.markTimer&&clearTimeout(this.markTimer),this.isActive||this.uiLabel.addClass("invisible"),this.markTimer=setTimeout(t.proxy(function(){this.layer.removeClass("n2-ss-mouse-over-delayed"),this.uiLabel.removeClass("invisible"),this.markTimer=null},this),10)},r.prototype.markEnter=function(t){this.layer.addClass("n2-ss-mouse-hover"),this.group.markEnter()},r.prototype.markLeave=function(t){this.layer.removeClass("n2-ss-mouse-hover"),this.group.markLeave()},r.prototype.formSetname=function(t,e){},r.prototype.formSetnameSynced=function(t,e){},r.prototype.formSetdesktopPortrait=function(t,e){t.currentForm.desktopPortrait.data("field").insideChange(e)},r.prototype.formSetdesktopLandscape=function(t,e){t.currentForm.desktopLandscape.data("field").insideChange(e)},r.prototype.formSettabletPortrait=function(t,e){t.currentForm.tabletPortrait.data("field").insideChange(e)},r.prototype.formSettabletLandscape=function(t,e){t.currentForm.tabletLandscape.data("field").insideChange(e)},r.prototype.formSetmobilePortrait=function(t,e){t.currentForm.mobilePortrait.data("field").insideChange(e)},r.prototype.formSetmobileLandscape=function(t,e){t.currentForm.mobileLandscape.data("field").insideChange(e)},r.prototype.sync=function(){if(this._syncid(),this.container)for(var t=this.container.getSortedLayers(),e=0;e<t.length;e++)t[e].sync();this.placement.sync()},r.prototype._syncid=function(){var t=this.getProperty("id");t&&""!=t?this.layer.attr("id",t):this.layer.removeAttr("id")},r.prototype.requestID=function(){var e=this.getProperty("id");return e||(e=t.fn.uid(),this.setProperty("id",e,"layer")),e},r.prototype._syncfontsize=function(){this.adjustFontSize(this.getProperty("adaptivefont"),this.getProperty("fontsize"),!0)},r.prototype._syncadaptivefont=function(){this.adjustFontSize(this.getProperty("adaptivefont"),this.getProperty("fontsize"),!0)},r.prototype.adjustFontSize=function(t,e,i){e=parseInt(e),parseInt(t)?this.layer.css("font-size",16*e/100+"px"):100!=e?this.layer.css("font-size",e+"%"):this.layer.css("font-size",""),this.refreshBaseSize(),i&&this.update()},r.prototype.refreshBaseSize=function(){var t=this.getFontSize();this.isAdaptiveFont()?this.baseSize=16*t/100:this.baseSize=this.group.baseSize*t/100,this.$.triggerHandler("baseSizeUpdated")},r.prototype.getFontSize=function(){return parseInt(this.getProperty("fontsize"))},r.prototype.isAdaptiveFont=function(){return parseInt(this.getProperty("adaptivefont"))},r.prototype._synccrop=function(){var t=this.getProperty("crop");"auto"==t&&(t="hidden"),"mask"==t?(t="hidden",this.addWrap("mask","<div class='n2-ss-layer-mask'></div>")):(this.removeWrap("mask"),this.layer.data("animatableselector",null)),this.layer.css("overflow",t)},r.prototype._syncrotation=function(){var t=parseFloat(this.getProperty("rotation"));if(t/360!=0){var e=this.addWrap("rotation","<div class='n2-ss-layer-rotation'></div>");NextendTween.set(e[0],{rotationZ:t})}else this.removeWrap("rotation")},r.prototype.addWrap=function(e,i){if(this.wraps[e]===n){var r=t(i);switch(this.wraps[e]=r,e){case"mask":r.appendTo(this.layer),this.wraps.rotation!==n?r.append(this.wraps.rotation):r.append(this.getContents()),this.layer.data("animatableselector",".n2-ss-layer-mask:first");break;case"rotation":this.wraps.mask!==n?r.appendTo(this.wraps.mask):r.appendTo(this.layer),r.append(this.getContents())}}return this.wraps[e]},r.prototype.removeWrap=function(t){if(this.wraps[t]!==n){switch(t){case"mask":this.wraps.rotation!==n?this.layer.append(this.wraps.rotation):this.layer.append(this.getContents());break;case"rotation":this.wraps.mask!==n?this.wraps.mask.append(this.getContents()):this.layer.append(this.getContents())}this.wraps[t].remove(),delete this.wraps[t]}},r.prototype.getContents=function(){return!1},r.prototype._syncclass=function(){this._lastClasses!==!1&&this.layer.removeClass(this._lastClasses);var t=this.getProperty("class");t&&""!=t?(this.layer.addClass(t),this._lastClasses=t):this._lastClasses=!1},r.prototype._syncparallax=function(){},r.prototype._syncgeneratorvisible=function(){},r.prototype._syncmouseenter=r.prototype._syncclick=r.prototype._syncmouseleave=r.prototype._syncplay=r.prototype._syncpause=r.prototype._syncstop=function(){},r.prototype.renderModeProperties=function(t){e.LayerDataStorage.prototype.renderModeProperties.call(this),this.placement.renderModeProperties(t)},r.prototype.getIndex=function(){return this.group.container.getLayerIndex(this.layer)},r.prototype.toString=function(){return this.type+" #"+this.counter},r.prototype.setSelf=function(t){t===n&&console.error(t),this.self!=this&&this.self.setSelf(t),this.self=t},r.prototype.getSelf=function(){return this.self!==this&&(this.self=this.self.getSelf()),this.self},r.prototype.historyStoreOnPlacement=function(){var t=Array.prototype.slice.call(arguments);t.splice(1,1),this.placement.current[arguments[1]].apply(this.placement.current,t)},r.prototype.getDroppable=function(){return!1},r.prototype.onCanvasUpdate=function(t,e,i){if(this.group==e)t!=i&&this.userIndexChange(t,i);else{var n;if(this.canvasManager.isCol(this.group))for(n=this;n&&(!n.placement||"absolute"!==n.placement.getType());)n=n.group;this.changeGroup(t,e),e.onChildCountChange();for(var r=this;r&&(!r.placement||"absolute"!==r.placement.getType());)r=r.group;n&&n!=r&&n.placement.updatePosition(),r&&r.placement.updatePosition()}},r.prototype.setStatusNormal=function(){this.changeStatus(r.STATUS.NORMAL)},r.prototype.changeStatus=function(t){var e=this.status;switch(t==this.status&&(t=r.STATUS.NORMAL),this.status){case r.STATUS.HIDDEN:this.getRootElement().removeAttr("data-visibility"),this.layerRow.removeClass("n2-ss-layer-status-hidden");break;case r.STATUS.LOCKED:this.layer.removeClass("n2-ss-layer-locked"),this.layerRow.removeClass("n2-ss-layer-status-locked")}switch(this.status=t,this.status){case r.STATUS.HIDDEN:this.getRootElement().attr("data-visibility","hidden"),this.layerRow.addClass("n2-ss-layer-status-hidden");break;case r.STATUS.LOCKED:this.layer.addClass("n2-ss-layer-locked"),this.layerRow.addClass("n2-ss-layer-status-locked")}this.placement.current.changeStatus(e,this.status)},r.prototype.moveX=function(t){"absolute"==this.placement.getType()&&this.placement.current.moveX(t)},r.prototype.moveY=function(t){"absolute"==this.placement.getType()&&this.placement.current.moveY(t)},r}),N2Require("Content",["ContentAbstract"],["smartSlider"],function(t,e,i,n){"use strict";function r(i,n,r){this.label=n2_("Content"),this.type="content",this.innerContainer="> .n2-ss-layer-content",this._defaults=t.extend({verticalalign:"center"},this._defaults),e.ContentAbstract.prototype.constructor.call(this,i,n,r),this.placement.allow("content"),i.setMainContent(this)}return r.prototype=Object.create(e.ContentAbstract.prototype),r.prototype.constructor=r,r.prototype.addUILabels=function(){this.markTimer=null,this.uiLabel=t('<div class="n2-ss-layer-ui-label-container"><div class="n2-ss-layer-ui-label n2-ss-layer-ui-label-self">'+this.getUILabel()+"</div></div>").appendTo(this.layer)},r.prototype.addProperties=function(t){e.ContentAbstract.prototype.addProperties.call(this,t),this.createDeviceProperty("selfalign",{desktopPortrait:"inherit"},t)},r.prototype.getRootElement=function(){return this.$outerSection},r.prototype.getBackgroundElement=function(){return this.$outerSection},r.prototype._createLayer=function(){return t('<div class="n2-ss-layer n2-ss-content-empty"><div class="n2-ss-section-main-content n2-ss-layer-content"></div></div>').attr("data-type",this.type)},r.prototype.createRow=function(){this.$outerSection=this.layer.parent(),this.$outerSection.hasClass("n2-ss-section-outer")||(this.$outerSection=t('<div class="n2-ss-section-outer"></div>').insertAfter(this.layer).append(this.layer)),this.$outerSection.data("layerObject",this),this.$content=this.layer.find(".n2-ss-layer-content:first");var i=t('<div class="n2-ss-layer-status"></div>'),n=t('<div class="n2-button n2-button-icon n2-button-m n2-button-m-narrow" data-n2tip="'+n2_("Delete layer")+'"><i class="n2-i n2-i-delete n2-i-grey-opacity"></i></div>').on("click",t.proxy(this["delete"],this));this.container=new e.LayerContainer(this,t('<ul class="n2-list n2-h4 n2-list-orderable" />'),"normal","> .n2-ss-layer",["row","layer"]),this.container.setLayerContainerElement(this.$content),t('<a href="#" class="n2-ss-sc-hide n2-button n2-button-icon n2-button-m"><i class="n2-i n2-i-eye"></i></a>').appendTo(i).on("click",t.proxy(function(t){t.preventDefault(),this.status==e.ComponentAbstract.STATUS.HIDDEN?this.setStatusNormal():this.changeStatus(e.ComponentAbstract.STATUS.HIDDEN)},this)),this._createLayerListRow([t('<div class="n2-actions-left"></div>').append(i),t('<div class="n2-actions"></div>').append(n)]).addClass("n2-ss-layer-content-row"),this.openerElement=t('<a href="#" class="n2-ss-layer-icon n2-button n2-button-icon n2-button-m"><i class="n2-i n2-i-col"></i></a>').insertBefore(this.layerTitleSpan).on("click",t.proxy(this.switchOpened,this)),this.container.$ul.appendTo(this.layerRow),this.readyDeferred.done(t.proxy(this._syncopened,this))},r.prototype.create=function(){this.originalProperties.adaptivefont=1,e.ContentAbstract.prototype.create.call(this),this._syncselfalign(),this._onReady()},r.prototype.load=function(t){e.ContentAbstract.prototype.load.call(this,t),this._syncselfalign(),this._onReady()},r.prototype._onReady=function(){e.ContentAbstract.prototype._onReady.call(this),this.startUISizing()},r.prototype.startUISizing=function(){this.layer.nextendNormalSizing({start:t.proxy(function(t,e){i.positionDisplay.show("NormalSizing"),"maxwidth"==e&&this.layer.addClass("n2-ss-has-maxwidth")},this),resizeMaxWidth:t.proxy(function(t,e){i.positionDisplay.update(t,"NormalSizing","Max-width: "+(0==e.value?"none":e.value+"px"))},this),stopMaxWidth:t.proxy(function(t,e){i.positionDisplay.hide("NormalSizing"),this.setProperty("maxwidth",e.value)},this)})},r.prototype["delete"]=function(){for(var t=this.container.getSortedLayers(),e=0;e<t.length;e++)t[e]["delete"]()},r.prototype.remove=function(){this._delete()},r.prototype.update=function(){nextend.smartSlider.frontend.responsive.doVerticalResize()},r.prototype.onChildCountChange=function(){var t=this.container.getSortedLayers();this.layer.toggleClass("n2-ss-content-empty",0==t.length)},r.prototype.renderModeProperties=function(t){e.ContentAbstract.prototype.renderModeProperties.call(this,t),this._syncselfalign()},r.prototype._syncselfalign=function(){this.layer.attr("data-cssselfalign",this.getProperty("selfalign"))},r.prototype.duplicate=function(t){console.error("Content can not be duplicated!")},r}),N2Require("ContentAbstract",["LayerContainer","ComponentAbstract"],["smartSlider"],function(t,e,i,n){"use strict";function r(i,n,r){this._defaults=t.extend({verticalalign:"flex-start"},this._defaults),this._syncbgThrottled=NextendThrottle(this._syncbgThrottled,50),e.ComponentAbstract.prototype.constructor.call(this,i,n,r)}return r.prototype=Object.create(e.ComponentAbstract.prototype),r.prototype.constructor=r,r.prototype.addProperties=function(t){this.createProperty("opened",1,t,this),e.ComponentAbstract.prototype.addProperties.call(this,t),this.createProperty("bgimage","",t),this.createProperty("bgimagex",50,t),this.createProperty("bgimagey",50,t),this.createProperty("bgimageparallax",0,t),this.createProperty("bgcolor","00000000",t),this.createProperty("bgcolorgradient","off",t),this.createProperty("bgcolorgradientend","00000000",t),this.createProperty("verticalalign",this._defaults.verticalalign,t),this.createDeviceProperty("maxwidth",{desktopPortrait:0},t),this.createDeviceProperty("inneralign",{desktopPortrait:"inherit"},t),this.createDeviceProperty("padding",{desktopPortrait:"10|*|10|*|10|*|10|*|px+"},t)},r.prototype.getBackgroundElement=function(){return this.$content},r.prototype.getPaddingElement=function(){return this.$content},r.prototype.create=function(){e.ComponentAbstract.prototype.create.call(this),this.initUI(),this._syncverticalalign(),this._syncmaxwidth(),this._syncpadding(),this._syncinneralign(),this._syncbgThrottled()},r.prototype.load=function(t){e.ComponentAbstract.prototype.load.call(this,t),this.initUI(),this._syncverticalalign(),this._syncmaxwidth(),this._syncpadding(),this._syncinneralign(),this._syncbgThrottled(),this.container.startWithExistingNodes()},r.prototype.initUI=function(){this.layer.on({mousedown:t.proxy(nextend.context.setMouseDownArea,nextend.context,"layerClicked"),click:t.proxy(function(t){!nextend.shouldPreventMouseUp&&this.canvasManager.preventActivationBubbling()&&this.activate(t)},this),dblclick:t.proxy(function(e){e.stopPropagation(),t('[data-tab="layer"]').trigger("click")},this)}),this.getPaddingElement().nextendSpacing({handles:"n, s, e, w",start:t.proxy(function(t,e){i.positionDisplay.show("Spacing")},this),spacing:t.proxy(function(t,e){var n="";for(var r in e.changed)n+="Padding "+r+": "+e.changed[r]+"px<br>";i.positionDisplay.update(t,"Spacing",n)},this),stop:t.proxy(this.onSpacingStop,this)})},r.prototype.onSpacingStop=function(e,n){i.positionDisplay.hide("Spacing");var r=this.getPadding().split("|*|"),s=1,o=1;"px+"==r[r.length-1]&&Math.abs(parseFloat(this.layer.css("fontSize"))-this.baseSize)>1&&(s=this.canvasManager.getResponsiveRatio("h"),o=this.canvasManager.getResponsiveRatio("v"));for(var a in n.changed){var l=n.changed[a];switch(a){case"top":r[0]=Math.round(l/o);break;case"right":r[1]=Math.round(l/s);break;case"bottom":r[2]=Math.round(l/o);break;case"left":r[3]=Math.round(l/s)}}this.setProperty("padding",r.join("|*|")),t("#layercol-padding").data("field").insideChange(r.join("|*|"))},r.prototype.switchOpened=function(t){t.preventDefault(),this.getProperty("opened")?this.setProperty("opened",0):this.setProperty("opened",1)},r.prototype._syncopened=function(){this.getProperty("opened")?(this.openerElement.removeClass("n2-closed"),this.container.$ul.css("display",""),this.layer.triggerHandler("opened")):(this.openerElement.addClass("n2-closed"),this.container.$ul.css("display","none"),this.layer.triggerHandler("closed"))},r.prototype.getPadding=function(){return this.getProperty("padding")},r.prototype._syncpadding=function(){var t=this.getPadding().split("|*|"),e=t.pop(),i=this.baseSize;if("px+"==e&&i>0){e="em";for(var n=0;n<t.length;n++)t[n]=parseInt(t[n])/i}var r=t.join(e+" ")+e;this.getPaddingElement().css("padding",r),this.update(),this.getPaddingElement().nextendSpacing("option","current",r)},r.prototype._syncmaxwidth=function(){var t=parseInt(this.getProperty("maxwidth"));0>=t||isNaN(t)?this.layer.css("maxWidth","").removeClass("n2-ss-has-maxwidth"):this.layer.css("maxWidth",t+"px").addClass("n2-ss-has-maxwidth"),this.update()},r.prototype.getInnerAlign=function(){return this.getProperty("inneralign")},r.prototype._syncinneralign=function(){this.layer.attr("data-csstextalign",this.getInnerAlign())},r.prototype.getVerticalAlign=function(){return this.getProperty("verticalalign")},r.prototype._syncverticalalign=function(){this.$content.attr("data-verticalalign",this.getVerticalAlign())},r.prototype._syncbgimage=r.prototype._syncbgimagex=r.prototype._syncbgimagey=r.prototype._syncbgimageparallax=r.prototype._syncbgcolor=r.prototype._syncbgcolorgradient=r.prototype._syncbgcolorgradientend=function(){this._syncbgThrottled()},r.prototype._syncbgThrottled=function(){var t="",e=nextend.smartSlider.generator.fill(this.getProperty("bgimage"));if(""!=e){var i=parseInt(this.getProperty("bgimagex"));isFinite(i)||(i=50);var n=parseInt(this.getProperty("bgimagey"));isFinite(n)||(n=50),t+='url("'+nextend.imageHelper.fixed(e)+'") '+i+"% "+n+"% / cover no-repeat"+(1==this.getProperty("bgimageparallax")?" fixed":"")}var r=this.getProperty("bgcolor"),s=this.getProperty("bgcolorgradient"),o=this.getProperty("bgcolorgradientend");if(0!=N2Color.hex2alpha(r)||"off"!=s&&0!=N2Color.hex2alpha(o)){var a="";switch(""!=t&&(a=","+t),s){case"horizontal":this.getBackgroundElement().css("background","-moz-linear-gradient(left, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background"," -webkit-linear-gradient(left, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background","linear-gradient(to right, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a);break;case"vertical":this.getBackgroundElement().css("background","-moz-linear-gradient(top, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background"," -webkit-linear-gradient(top, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background","linear-gradient(to bottom, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a);break;case"diagonal1":this.getBackgroundElement().css("background","-moz-linear-gradient(45deg, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background"," -webkit-linear-gradient(45deg, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background","linear-gradient(45deg, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a);break;case"diagonal2":this.getBackgroundElement().css("background","-moz-linear-gradient(-45deg, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background"," -webkit-linear-gradient(-45deg, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background","linear-gradient(-45deg, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a);break;case"off":default:""!=t?t="linear-gradient("+N2Color.hex2rgbaCSS(r)+", "+N2Color.hex2rgbaCSS(r)+"),"+t:t+=N2Color.hex2rgbaCSS(r),this.getBackgroundElement().css("background",t)}}else this.getBackgroundElement().css("background",t)},r.prototype.getData=function(t){var i=e.ComponentAbstract.prototype.getData.call(this,t);return t.layersIncluded&&(i.layers=this.container.getData(t)),i},r.prototype.onChildCountChange=function(){this.layer.toggleClass("n2-ss-content-empty",0==this.container.getLayerCount()),this.update()},r.prototype.renderModeProperties=function(t){e.ComponentAbstract.prototype.renderModeProperties.call(this,t),this._syncmaxwidth(),this._syncpadding(),this._syncinneralign()},r.prototype.getDroppable=function(){return this.layer.is(":visible")&&this.status!=N2Classes.ComponentAbstract.STATUS.HIDDEN&&this.status!=N2Classes.ComponentAbstract.STATUS.LOCKED?{$container:this.$content,layer:this,placement:"normal",axis:"y"}:"hidden"},r.prototype.getLLDroppable=function(t){switch(t.type){case"layer":case"row":return{$container:this.container.$ul,layer:this}}return!1},r.prototype.getContents=function(){return this.$content},r}),N2Require("Group",["LayerContainer","ComponentAbstract","PluginShowOn"],["smartSlider"],function(t,e,i,n){"use strict";function r(t,i,n){this.label=n2_("Group"),this.type="group",e.ComponentAbstract.prototype.constructor.call(this,t,i,n),this.placement.allow("group")}return r.prototype=Object.create(e.ComponentAbstract.prototype),r.prototype.constructor=r,r.prototype._createLayer=function(){return t('<div class="n2-ss-layer-group"></div>').attr("data-type",this.type)},r.prototype.addProperties=function(t){this.createProperty("opened",1,t,this),e.ComponentAbstract.prototype.addProperties.call(this,t)},r.prototype.create=function(){e.ComponentAbstract.prototype.create.call(this),this._onReady()},r.prototype.load=function(t){e.ComponentAbstract.prototype.load.call(this,t),this.container.startWithExistingNodes(),this._onReady()},r.prototype.createRow=function(){this.container=new e.LayerContainer(this,t('<ul class="n2-list n2-h4 n2-list-orderable" />'),"absolute","> .n2-ss-layer",["row","layer"]);var i=t('<div class="n2-button n2-button-icon n2-button-m n2-button-m-narrow" data-n2tip="'+n2_("Delete layer")+'"><i class="n2-i n2-i-delete n2-i-grey-opacity"></i></div>').on("click",t.proxy(this["delete"],this)),n=t('<div class="n2-button n2-button-icon n2-button-m n2-button-m-narrow" data-n2tip="'+n2_("Duplicate layer")+'"><i class="n2-i n2-i-duplicate n2-i-grey-opacity"></i></div>').on("click",t.proxy(function(){this.duplicate(!0,!1)},this));this.openerElement=t('<a href="#" class="n2-button n2-button-icon n2-button-m n2-ss-layer-list-group-opener" onclick="return false;"><i class="n2-i n2-i-folderopened"></i></a>').on("click",t.proxy(this.switchOpened,this)),this._createLayerListRow([t('<div class="n2-actions-left"></div>').append(t('<div class="n2-ss-layer-status"></div>').append(this.openerElement)),t('<div class="n2-actions"></div>').append(n).append(i)]).addClass("n2-ss-layer-group-row"),this.container.$ul.appendTo(this.layerRow),this.readyDeferred.done(t.proxy(this._syncopened,this))},r.prototype.addLayers=function(t){this.container.moveLayersToGroup(t)},r.prototype.getData=function(t){var i=e.ComponentAbstract.prototype.getData.call(this,t);return t.itemsIncluded&&(i.layers=this.container.getData(t)),i},r.prototype.switchOpened=function(t){t.preventDefault(),this.getProperty("opened")?this.setProperty("opened",0):this.setProperty("opened",1)},r.prototype._syncopened=function(){this.getProperty("opened")?(this.openerElement.removeClass("n2-closed"),this.container.$ul.css("display",""),this.layer.triggerHandler("opened")):(this.openerElement.addClass("n2-closed"),this.container.$ul.css("display","none"),this.layer.triggerHandler("closed"))},r.prototype.positionSidebar=function(){this.canvasManager.layerWindow.show(this,t("#n2-ss-layer-list"))},r.prototype.activate=function(){e.PluginActivatable.prototype.activate.call(this,arguments)&&(this.canvasManager.startSelection(!0),this.canvasManager.addSelection(this.container.getSortedLayers(),!0))},r.prototype.deActivate=function(){this.canvasManager.endSelection(!0),e.PluginActivatable.prototype.deActivate.call(this)},r.prototype.select=function(){this.canvasManager.selectLayer(this,!1),this.canvasManager.addSelection(this.container.getSortedLayers(),!1)},r.prototype.doAction=function(e,i){for(var n=t.extend([],this.container.layersSorted),r=0;r<n.length;r++)n[r][e].apply(n[r],i)},r.prototype.getLLDroppable=function(t){switch(t.type){case"layer":case"row":return{$container:this.container.$ul,layer:this}}return!1},r}),N2Require("Layer",["ComponentAbstract"],["smartSlider"],function(t,e,i,n){"use strict";function r(i,n,r){this.label=n2_("Layer"),this.type="layer",this.parent=!1,this.itemEditor=i.itemEditor,e.ComponentAbstract.prototype.constructor.call(this,i,n,r),this.placement.allow("absolute"),this.placement.allow("normal"),this.$.on("load create",t.proxy(this.startItem,this))}return r.prototype=Object.create(e.ComponentAbstract.prototype),r.prototype.constructor=r,r.prototype.create=function(){e.ComponentAbstract.prototype.create.apply(this,arguments),this.initUI(),this._onReady()},r.prototype.load=function(t){e.ComponentAbstract.prototype.load.call(this,t),this.initUI(),this._onReady()},r.prototype.startItem=function(){var t=this.layer.find(".n2-ss-item");new(e[this.itemEditor.getItemClass(t.data("item"))])(t,this,this.itemEditor),this.layer.nextendCanvasItem({canvasUIManager:this.canvasManager.mainContainer.canvasUIManager,layer:this,$layer:this.layer}),this.item.needSize&&this.layer.addClass("n2-ss-layer-needsize")},r.prototype.initUI=function(){this.layer.on({mousedown:t.proxy(nextend.context.setMouseDownArea,nextend.context,"layerClicked"),click:t.proxy(function(t){this.canvasManager.preventActivationBubbling()&&this.activate(t)},this),dblclick:t.proxy(function(e){nextend.context.isPreventDblClick||(e.stopPropagation(),t('[data-tab="item"]').trigger("click"),this.item.itemEditor.focusFirst("dblclick"))},this)})},r.prototype.getContent=function(){var t=this.layer,e=t.data("animatableselector");return e&&(t=t.find(e)),t},r.prototype._createLayer=function(){return t('<div class="n2-ss-layer"></div>').attr("data-type",this.type)},r.prototype.createRow=function(){var i=t('<div class="n2-ss-layer-status"></div>'),n=t('<div class="n2-button n2-button-icon n2-button-m n2-button-m-narrow" data-n2tip="'+n2_("Delete layer")+'"><i class="n2-i n2-i-delete n2-i-grey-opacity"></i></div>').on("click",t.proxy(this["delete"],this)),r=t('<div class="n2-button n2-button-icon n2-button-m n2-button-m-narrow" data-n2tip="'+n2_("Duplicate layer")+'"><i class="n2-i n2-i-duplicate n2-i-grey-opacity"></i></div>').on("click",t.proxy(function(){this.duplicate(!0,!1)},this));t('<a href="#" class="n2-ss-sc-hide n2-button n2-button-icon n2-button-m"><i class="n2-i n2-i-eye"></i></a>').appendTo(i).on("click",t.proxy(function(t){t.preventDefault(),this.status==e.ComponentAbstract.STATUS.HIDDEN?this.setStatusNormal():this.changeStatus(e.ComponentAbstract.STATUS.HIDDEN)},this)),this._createLayerListRow([t('<div class="n2-actions-left"></div>').append(i),t('<div class="n2-actions"></div>').append(r).append(n)]).addClass("n2-ss-layer-layer-row")},r.prototype.activate=function(t,i,n){e.PluginActivatable.prototype.activate.call(this,t,i,n),this.item?this.item.activate(null,i):console.error("The layer do not have item on it!")},r.prototype.getHTML=function(t){var i=e.ComponentAbstract.prototype.getHTML.call(this,t),n=this.item.getHTML(t);return i.attr("style",i.attr("style")+this.getStyleText()).append(n),i},r.prototype.getData=function(t){var i=e.ComponentAbstract.prototype.getData.call(this,t);return t.itemsIncluded&&(i.item=this.item.getData()),i},r.prototype.getStyleText=function(){var t="",e=this.property.crop;return"auto"!=e&&"mask"!=e||(e="hidden"),t+="overflow:"+e+";"},r.prototype.getContents=function(){return this.item.$item},r.prototype.setSelf=function(t){this.self!=this&&this.self.setSelf(t),this.self=t,this.item.setSelf(t.item)},r.prototype.getSelf=function(){return this.self!==this&&(this.self=this.self.getSelf()),this.self},r}),N2Require("MainContainer",["LayerContainer"],["smartSlider"],function(t,e,i,n){"use strict";function r(n){this.baseSize=16,this.activeLayer=null,this.$=n.$,this.isActiveGroupBlurred=!0,this.isMainGroup=!0,this.canvasManager=n,this.layer=i.$currentSlideElement.find(".n2-ss-layers-container").addBack().last(),this.layer.nextendCanvas({mainContainer:this,tolerance:5,smartguides:t.proxy(function(t){return t.$layer.triggerHandler("LayerParent"),this.canvasManager.getSnap()},this),display:{hidden:!0,show:t.proxy(function(){i.positionDisplay.show("Canvas")},this),update:t.proxy(function(t,e){i.positionDisplay.update(t,"Canvas","L: "+parseInt(0|e.left)+"px<br />T: "+parseInt(0|e.top)+"px")},this),hide:t.proxy(function(){i.positionDisplay.hide("Canvas")},this)},start:t.proxy(function(t,e){this.canvasManager.canvasDragStart(t,e)},this),drag:t.proxy(function(t,e){this.canvasManager.canvasDragMove(t,e),e.layer&&e.layer.placement.current.triggerLayerResized();
},this),stop:t.proxy(function(t,e){this.canvasManager.canvasDragStop(t,e),e.layer&&e.layer.placement.current.triggerLayerResized()},this)}),this.canvasUIManager=this.layer.data("uiNextendCanvas"),this.layer.nextendLayerList({mainContainer:this,$fixed:t("#n2-ss-layers"),$scrolled:t("#n2-ss-layer-list")}),this.layerListUIManager=this.layer.data("uiNextendLayerList"),this.layer.parent().prepend('<div class="n2-ss-slide-border n2-ss-slide-border-left" /><div class="n2-ss-slide-border n2-ss-slide-border-top" /><div class="n2-ss-slide-border n2-ss-slide-border-right" /><div class="n2-ss-slide-border n2-ss-slide-border-bottom" />'),this.container=new e.LayerContainer(this,t("#n2-ss-layer-list").find("ul"),"absolute","> .n2-ss-section-outer > .n2-ss-layer, > .n2-ss-layer, > .n2-ss-layer-group",["content","row","layer","group"]),this.layerRow=this.container.$ul,this.$.on("layerCreated",t.proxy(function(){this.refreshHasLayers()},this))}return r.prototype.lateInit=function(){this.container.startWithExistingNodes(),this.layer.parent().on("click",t.proxy(function(){this.canvasManager.shouldPreventActivationBubble?this.blurActiveGroup():this.unBlurActiveGroup(),this.canvasManager.allowActivation()},this)),i.frontend.sliderElement.on("SliderResize",t.proxy(this.onResize,this))},r.prototype.onResize=function(t,e){for(var i=this.getEverySortedLayers(),n=0;n<i.length;n++)i[n].placement.doLinearResize(e)},r.prototype.getEverySortedLayers=function(){for(var t=this.container.getChildLayersRecursive(!1),e={},i=t.length-1;i>=0;i--)"undefined"!=typeof t[i].property.parentid&&t[i].property.parentid&&("undefined"==typeof e[t[i].property.parentid]&&(e[t[i].property.parentid]=[]),e[t[i].property.parentid].push(t[i]),t.splice(i,1));for(var i=0;i<t.length;i++)"undefined"!=typeof t[i].property.id&&t[i].property.id&&"undefined"!=typeof e[t[i].property.id]&&(e[t[i].property.id].unshift(0),e[t[i].property.id].unshift(i+1),t.splice.apply(t,e[t[i].property.id]),delete e[t[i].property.id]);return t},r.prototype.deleteLayers=function(){for(var t=this.container.getSortedLayers(),e=0;e<t.length;e++)t[e]["delete"]()},r.prototype.blurActiveGroup=function(){this.isActiveGroupBlurred=!0},r.prototype.unBlurActiveGroup=function(){this.isActiveGroupBlurred=!1},r.prototype.getActiveGroup=function(){if(this.isActiveGroupBlurred){var t=this,e=this.activeLayer;switch(this.canvasManager.isGroup(e)||this.canvasManager.isCol(e)||this.canvasManager.isContent(e)?t=e:this.canvasManager.isRow(e)?t=e.container.getSortedLayers()[0]:e&&(t=e.group),this.canvasManager.currentEditorMode){case"content":t==this&&(t=this.canvasManager.mainContent);break;case"canvas":t==this.canvasManager.mainContent&&(t=this)}return t}switch(this.canvasManager.currentEditorMode){case"content":return this.canvasManager.mainContent}return this},r.prototype.getSelectedLayer=function(){return null==this.activeLayer?!1:this.activeLayer},r.prototype.getLayerData=function(t){if(t===n)return[];for(var e=[],i=[],r=0;r<t.length;r++)t[r].getDataWithChildren(e,i);return e},r.prototype.layerDeleted=function(t){for(var e=this.canvasManager.selectedLayers.length;e--;)t==this.canvasManager.selectedLayers[e]&&this.canvasManager.selectedLayers.splice(e,1);this._afterLayerDeletedDeBounced(t),this.refreshHasLayers()},r.prototype._afterLayerDeletedDeBounced=NextendDeBounce(function(t){this.activeLayer&&!this.activeLayer.isDeleted||this.canvasManager.resetActiveLayer()},50),r.prototype.refreshHasLayers=function(){t("body").toggleClass("n2-ss-has-layers",this.container.getLayerCount()>0),nextend.triggerResize()},r.prototype.getName=function(){return"Slide"},r.prototype.update=function(){},r.prototype.onChildCountChange=function(){},r.prototype.markEnter=function(t){},r.prototype.markLeave=function(t){},r.prototype.getSelf=function(){return this},r.prototype.createLayerAnimations=function(t,e){for(var i=[],n=this.container.getSortedLayers(),r=0;r<n.length;r++)i.push.apply(i,n[r].createLayerAnimations(t,e));return i},r.prototype.getDroppables=function(e){var i,n=this.canvasManager.currentEditorMode,r=[];if("canvas"==n){r.push(this.getDroppable()),i=this.container.getSortedLayers();var s=t.inArray(this.canvasManager.mainContent,i);s>-1&&i.splice(s,1)}else"content"==n&&(i=[this.canvasManager.mainContent]);for(var o=0;o<i.length;o++)if(i[o]!=e){var a=i[o].getDroppable();"object"==typeof a&&r.push(a),"hidden"!=a&&i[o].container&&r.push.apply(r,i[o].container.getDroppables(e))}return r},r.prototype.getLLDroppables=function(t){return this.container.getLLDroppables(t)},r.prototype.getDroppable=function(){return{$container:this.layer,layer:this,placement:"absolute"}},r.prototype.getLLDroppable=function(t){switch(t.type){case"layer":case"row":case"group":case"content":return{$container:this.container.$ul,layer:this}}return!1},r.prototype.replaceLayers=function(e){this._idTranslation={};var n=this.dataToLayers(t.extend(!0,[],e).reverse()),r=[];this.deleteLayers(),this.canvasManager.mainContent.remove();for(var s=0;s<n.length;s++)r.push(this.container.append(n[s]));return this.canvasManager.refreshMode(),this.container.layerContainerElement.n2imagesLoaded().always(t.proxy(this.canvasManager.refreshMode,this.canvasManager)),this.getSelectedLayer()||r.length>0&&r[0].activate(),i.history.isEnabled()&&i.history.addSimple(this,this.historyDeleteAll,this.historyReplaceLayers,[e,r,this.container.getAllLayers()]),r},r.prototype.historyDeleteAll=function(t,e){for(var i=0;i<e.length;i++)e[i].getSelf()["delete"]();this.canvasManager.mainContent.getSelf().remove()},r.prototype.historyReplaceLayers=function(t,e,i){this.replaceLayers(t);for(var n=this.container.getAllLayers(),r=0;r<i.length;r++)i[r].setSelf(n[r])},r.prototype.addLayers=function(e,n){this._idTranslation={};for(var r=this.dataToLayers(t.extend(!0,[],e)),s=[],o=0;o<r.length;o++)s.push(n.container.append(r[o]));return this.canvasManager.refreshMode(),i.history.addSimple(this,this.historyDeleteLayers,this.historyAddLayers,[e,s,n]),s},r.prototype.historyDeleteLayers=function(t,e,i){for(var n=0;n<e.length;n++)e[n].getSelf()["delete"]()},r.prototype.historyAddLayers=function(t,e,i){for(var n=this.addLayers(t,i.getSelf()),r=0;r<e.length;r++)e[r].setSelf(n[r])},r.prototype.dataToLayers=function(t,e){for(var i=[],n=0;n<t.length;n++)switch(t[n].type){case"group":console.error("Group data to layer not implemented!");break;case"row":i.push(this.buildRowNode(t[n],e));break;case"col":i.push(this.buildColNode(t[n],e));break;case"content":i.push(this.buildContentNode(t[n],e));break;case"layer":default:i.push(this.buildLayerNode(t[n],e))}return i},r.prototype._buildNodePrepareID=function(e,i){if(i.id){var n=t.fn.uid(),r=!1;"object"==typeof this._idTranslation[i.id]&&(r=this._idTranslation[i.id]),this._idTranslation[i.id]=n,i.id=n,e.attr("id",n),r&&r.resolve(i.id,n)}if(i.parentid)switch(typeof this._idTranslation[i.parentid]){case"string":i.parentid=this._idTranslation[i.parentid];break;case"undefined":this._idTranslation[i.parentid]=t.Deferred();case"object":this._idTranslation[i.parentid].done(t.proxy(function(t,e,i){t.data("parentid",i)},this,e));break;default:i.parentid=""}},r.prototype._buildNodeAnimations=function(t){"object"==typeof t.animations&&(t.animations=Base64.encode(JSON.stringify(t.animations)))},r.prototype.buildContentNode=function(e,i){var r=t("<div class='n2-ss-layer' data-type='content'/>"),s=t("<div class='n2-ss-section-main-content n2-ss-layer-content' />").appendTo(r);this._buildNodeAnimations(e);for(var o in e)r.data(o,e[o]);return i!==n&&r.appendTo(i),this.dataToLayers(e.layers,s),r},r.prototype.buildRowNode=function(e,i){var r=t("<div class='n2-ss-layer' data-type='row'/>"),s=t("<div class='n2-ss-layer-row' />").appendTo(r);this._buildNodePrepareID(r,e),this._buildNodeAnimations(e);for(var o in e)r.data(o,e[o]);return i!==n&&r.appendTo(i),this.dataToLayers(e.cols,s),r},r.prototype.buildColNode=function(e,i){var r=t("<div class='n2-ss-layer' data-type='col'/>"),s=t("<div class='n2-ss-layer-col n2-ss-layer-content' />").appendTo(r);this._buildNodeAnimations(e);for(var o in e)r.data(o,e[o]);return i!==n&&r.appendTo(i),this.dataToLayers(e.layers,s),r},r.prototype.buildLayerNode=function(e,i){var r=t("<div class='n2-ss-layer' data-type='layer'></div>").attr("style",e.style),s=1;e.zIndex&&(s=e.zIndex),this._buildNodePrepareID(r,e),e.items!==n&&(e.item=e.items[0],delete e.items),t('<div class="n2-ss-item n2-ss-item-'+e.item.type+'"></div>').data("item",e.item.type).data("itemvalues",e.item.values).appendTo(r),delete e.style,delete e.item,this._buildNodeAnimations(e);for(var o in e)r.data(o,e[o]);return i!==n&&r.appendTo(i),r},r}),N2Require("Row",["LayerContainer","ComponentAbstract"],["smartSlider"],function(t,e,i,n){"use strict";function r(i,n,r){this.label=n2_("Row"),this.type="row",this._syncbgThrottled=NextendThrottle(this._syncbgThrottled,50),this.innerContainer="> .n2-ss-layer-row",this.columnsField=t("#layerrow-columns").data("field"),this.refreshUI=NextendDeBounce(this.refreshUI,100),e.ComponentAbstract.prototype.constructor.call(this,i,n,r),this.placement.allow("absolute"),this.placement.allow("normal")}return r.prototype=Object.create(e.ComponentAbstract.prototype),r.prototype.constructor=r,r.prototype.addProperties=function(t){this.createProperty("opened",1,t,this),e.ComponentAbstract.prototype.addProperties.call(this,t),this.createProperty("bgimage","",t),this.createProperty("bgimagex",50,t),this.createProperty("bgimagey",50,t),this.createProperty("bgimageparallax",0,t),this.createProperty("bgcolor","00000000",t),this.createProperty("bgcolorgradient","off",t),this.createProperty("bgcolorgradientend","00000000",t),this.createProperty("borderradius",0,t),this.createProperty("boxshadow","0|*|0|*|0|*|0|*|00000080",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|*|px+"},t),this.createDeviceProperty("gutter",{desktopPortrait:20},t),this.createDeviceProperty("wrapafter",{desktopPortrait:0,mobilePortrait:1,mobileLandscape:1},t)},r.prototype.historyDeleteSelf=function(){this["delete"]()},r.prototype.historyCreateSelf=function(t,i,n){var r=new e.Row(this.canvasManager,t.getSelf(),{});r.create(i),this.setSelf(r);for(var s=r.container.getSortedLayers(),o=0;o<s.length;o++)n[o].setSelf(s[o])},r.prototype.create=function(n){var r,s=function(e){return t("<div class='n2-ss-layer' />").append(t("<div class='n2-ss-layer-row' />").append(e)).attr("data-type","row")},o=function(e){return t("<div class='n2-ss-layer' data-type='col'/>").append(t("<div class='n2-ss-layer-col n2-ss-layer-content' />").append(e))};switch(n){case"2col":r=function(t){return s([o(),o()])};break;case"2col-60-40":r=function(t){return s([o().data("colwidth","6/10"),o().data("colwidth","4/10")])};break;case"2col-40-60":r=function(t){return s([o().data("colwidth","4/10"),o().data("colwidth","6/10")])};break;case"2col-80-20":r=function(t){return s([o().data("colwidth","8/10"),o().data("colwidth","2/10")])};break;case"2col-20-80":r=function(t){return s([o().data("colwidth","2/10"),o().data("colwidth","8/10")])};break;case"3col":r=function(t){return s([o(),o(),o()])};break;case"3col-20-60-20":r=function(t){return s([o().data("colwidth","2/10"),o().data("colwidth","6/10"),o().data("colwidth","2/10")])};break;case"4col":r=function(t){return s([o(),o(),o(),o()])};break;case"special":r=function(t){var e=s([o(),o()]);return s([o().data("colwidth","1/5"),o(e).data("colwidth","4/5")])};break;default:r=function(t){return s([o()])}}"absolute"==this.group.container.allowedPlacementMode&&(this.originalProperties=t.extend({width:"100%",align:"center",valign:"top",top:20},this.originalProperties)),e.ComponentAbstract.prototype.create.call(this,r,!0),this.initUI(),this.container.startWithExistingNodes(),this._syncpadding(),this._syncinneralign(),this._syncfullwidth(),this._syncstretch(),this._syncbgThrottled(),this._syncborderradius(),this._syncboxshadow(),this.renderModeProperties(),this.container.renderModeProperties(),i.history.addSimple(this,this.historyDeleteSelf,this.historyCreateSelf,[this.group,n,this.container.getSortedLayers()]),this._onReady()},r.prototype.load=function(t){e.ComponentAbstract.prototype.load.call(this,t),this.initUI(),this.container.startWithExistingNodes(),this._syncpadding(),this._syncinneralign(),this._syncfullwidth(),this._syncstretch(),this._syncbgThrottled(),this._syncborderradius(),this._syncboxshadow(),this._onReady()},r.prototype.initUI=function(){this.layer.nextendCanvasItem({canvasUIManager:this.canvasManager.mainContainer.canvasUIManager,layer:this,$layer:this.layer}),this.layer.on({mousedown:t.proxy(nextend.context.setMouseDownArea,nextend.context,"layerClicked"),click:t.proxy(function(t){!nextend.shouldPreventMouseUp&&this.canvasManager.preventActivationBubbling()&&this.activate(t)},this),dblclick:t.proxy(function(e){e.stopPropagation(),t('[data-tab="row"]').trigger("click")},this)}),this.$row.nextendSpacing({handles:"n, s, e, w",start:t.proxy(function(t,e){i.positionDisplay.show("Spacing")},this),spacing:t.proxy(function(t,e){var n="";for(var r in e.changed)n+="Padding "+r+": "+e.changed[r]+"px<br>";i.positionDisplay.update(t,"Spacing",n)},this),stop:t.proxy(this.____makeLayerResizeableStop,this)}),this.$row.nextendColumns({columns:"1",gutter:this.getGutter(),start:t.proxy(function(t,e){i.positionDisplay.show("Columns")},this),colwidth:t.proxy(function(t,e){this.updateColumnWidth(e.currentPercent),i.positionDisplay.update(t,"Columns",Math.round(100*e.currentPercent[e.index])+"% &mdash; "+Math.round(100*e.currentPercent[e.index+1])+"%")},this),stop:t.proxy(function(t,e){i.positionDisplay.hide("Columns"),this.setRealColsWidth(e.currentFractions)},this)}),this.$row.sortable({distance:10,tolerance:"pointer",forceHelperSize:!0,forcePlaceholderSize:!0,items:"> .n2-ss-layer",handle:" > .n2-ss-layer-ui-label-container > .n2-ss-layer-ui-label-self",start:t.proxy(function(t,e){var i=this.getColumns().split("+");e.placeholder.css({width:100*new Fraction(i[e.item.data("layerObject").getIndex()]).valueOf()+"%",height:e.helper.height(),visibility:"visible",marginRight:this.getGutter()+"px",marginTop:this.getGutter()+"px"}),e.helper.hasClass("n2-ss-last-in-row")&&e.placeholder.addClass("n2-ss-last-in-row"),e.placeholder.css("order",e.helper.css("order")),e.placeholder.attr("data-r",e.helper.attr("data-r"))},this),stop:t.proxy(function(t,e){var i=e.item.data("layerObject"),n=e.item.prevAll(".n2-ss-layer, .n2-ss-layer-group").first().data("layerObject");this.$row.sortable("cancel");var r=i.getIndex(),s=0;n&&(s=n.getIndex(),r>s&&s++),r!=s&&this.moveCol(r,s)},this)})},r.prototype.____makeLayerResizeableStop=function(e,n){i.positionDisplay.hide("Spacing");var r=this.getPadding().split("|*|"),s=1,o=1;"px+"==r[r.length-1]&&Math.abs(parseFloat(this.layer.css("fontSize"))-this.baseSize)>1&&(s=this.canvasManager.getResponsiveRatio("h"),o=this.canvasManager.getResponsiveRatio("v"));for(var a in n.changed){var l=n.changed[a];switch(a){case"top":r[0]=Math.round(l/o);break;case"right":r[1]=Math.round(l/s);break;case"bottom":r[2]=Math.round(l/o);break;case"left":r[3]=Math.round(l/s)}}this.setProperty("padding",r.join("|*|")),t("#layerrow-padding").data("field").insideChange(r.join("|*|"))},r.prototype._createLayer=function(){return t('<div class="n2-ss-layer"><div class="n2-ss-layer-row"></div></div>').attr("data-type",this.type)},r.prototype.historyDeleteCol=function(t,e){e.getSelf()["delete"]()},r.prototype.historyCreateCol=function(t,e){var i=t.getSelf().createCol();e.setSelf(i)},r.prototype.createCol=function(){var t=new e.Col(this.canvasManager,this,{});return i.history.addSimple(this,this.historyDeleteCol,this.historyCreateCol,[this,t]),t.create(),this.isReady()&&this.placement.updatePosition(),t},r.prototype.createRow=function(){this.$row=this.layer.find(".n2-ss-layer-row:first"),this.container=new e.LayerContainer(this,t('<ul class="n2-list n2-h4 n2-list-orderable" />'),"default","> .n2-ss-layer",["col"]),this.container.setLayerContainerElement(this.$row);var i=t('<div class="n2-ss-layer-status"></div>'),n=t('<div class="n2-button n2-button-icon n2-button-m n2-button-m-narrow" data-n2tip="'+n2_("Delete layer")+'"><i class="n2-i n2-i-delete n2-i-grey-opacity"></i></div>').on("click",t.proxy(this["delete"],this)),r=t('<div class="n2-button n2-button-icon n2-button-m n2-button-m-narrow" data-n2tip="'+n2_("Duplicate layer")+'"><i class="n2-i n2-i-duplicate n2-i-grey-opacity"></i></div>').on("click",t.proxy(function(){this.duplicate(!0,!1)},this));t('<a href="#" class="n2-ss-sc-hide n2-button n2-button-icon n2-button-m"><i class="n2-i n2-i-eye"></i></a>').appendTo(i).on("click",t.proxy(function(t){t.preventDefault(),this.status==e.ComponentAbstract.STATUS.HIDDEN?this.setStatusNormal():this.changeStatus(e.ComponentAbstract.STATUS.HIDDEN)},this)),this._createLayerListRow([t('<div class="n2-actions-left"></div>').append(i),t('<div class="n2-actions"></div>').append(r).append(n)]).addClass("n2-ss-layer-row-row"),this.openerElement=t('<a href="#" class="n2-ss-layer-icon n2-button n2-button-icon n2-button-m"><i class="n2-i n2-i-row"></i></a>').insertBefore(this.layerTitleSpan).on("click",t.proxy(this.switchOpened,this)),this.container.$ul.appendTo(this.layerRow),this.readyDeferred.done(t.proxy(this._syncopened,this))},r.prototype.activate=function(){e.PluginActivatable.prototype.activate.apply(this,arguments),this.columnsField.setRow(this)},r.prototype.switchOpened=function(t){t.preventDefault(),this.getProperty("opened")?this.setProperty("opened",0):this.setProperty("opened",1)},r.prototype._syncopened=function(){this.getProperty("opened")?(this.openerElement.removeClass("n2-closed"),this.container.$ul.css("display",""),this.layer.triggerHandler("opened")):(this.openerElement.addClass("n2-closed"),this.container.$ul.css("display","none"),this.layer.triggerHandler("closed"))},r.prototype.getColumns=function(){for(var t=this.container.getSortedLayers(),e=[],i=0;i<t.length;i++)e.push(t[i].getProperty("colwidth"));return e.join("+")},r.prototype.getColumnsOrdered=function(){for(var t=this.getOrderedColumns(),e=[],i=0;i<t.length;i++)e.push(t[i].getProperty("colwidth"));return e.join("+")},r.prototype._synccolumns=function(){for(var t=this.container.getSortedLayers(),e=0;e<t.length;e++)t[e]._synccolwidth();this.update()},r.prototype.getPadding=function(){return this.getProperty("padding")},r.prototype._syncpadding=function(){var t=this.getPadding().split("|*|"),e=t.pop(),i=this.baseSize;if("px+"==e&&i>0){e="em";for(var n=0;n<t.length;n++)t[n]=parseInt(t[n])/i}var r=t.join(e+" ")+e;this.$row.css("padding",r),this.$row.nextendSpacing("option","current",r),this.update()},r.prototype.getGutter=function(){return this.getProperty("gutter")},r.prototype._syncgutter=function(){var t=this.getGutter()+"px",e=this.container.getSortedLayers();if(e.length>0)for(var i=e.length-1;i>=0;i--)e[i].layer.css("marginRight",t).css("marginTop",t);this.$row.nextendColumns("option","gutter",this.getGutter()),this.update()},r.prototype._syncwrapafter=function(){if(!this.isDeleted&&!this.isDeleteStarted){for(var e=parseInt(this.getProperty("wrapafter")),i=this.getOrderedColumns(),n=!1,r=i.length-1;r>=0;r--)i[r].showsOnCurrent||i.splice(r,1);var s=i.length;if(e>0&&s>e&&(n=!0),this.$row.find("> .n2-ss-row-break").remove(),this.$row.toggleClass("n2-ss-row-wrapped",n),n)for(var r=0;s>r;r++){var o=parseInt(r/e);if(i[r].layer.attr("data-r",o),(r+1)%e==0||r==s-1){var a=i[r].getProperty("order");0==a&&(a=10),t('<div class="n2-ss-row-break"/>').css("order",a).insertAfter(i[r].layer.addClass("n2-ss-last-in-row"))}else i[r].layer.removeClass("n2-ss-last-in-row")}else{for(var r=0;s>r;r++)i[r].layer.removeClass("n2-ss-last-in-row").attr("data-r",0);i.length>0?i[s-1].layer.addClass("n2-ss-last-in-row"):console.error("The row does not have col.")}this.update()}},r.prototype.getOrderedColumns=function(){return this.container.getSortedLayers().sort(function(t,e){return t.getRealOrder()-e.getRealOrder()})},r.prototype.getInnerAlign=function(){return this.getProperty("inneralign")},r.prototype._syncinneralign=function(){this.layer.attr("data-csstextalign",this.getInnerAlign())},r.prototype._syncfullwidth=function(){this.layer.toggleClass("n2-ss-autowidth",0==this.getProperty("fullwidth"))},r.prototype._syncstretch=function(){this.layer.toggleClass("n2-ss-stretch-layer",1==this.getProperty("stretch"))},r.prototype._syncborderradius=function(){this.$row.css("border-radius",this.getProperty("borderradius")+"px")},r.prototype._syncboxshadow=function(){var t=this.getProperty("boxshadow").split("|*|");0==t[0]&&0==t[1]&&0==t[2]&&0==t[3]||0==N2Color.hex2alpha(t[4])?this.$row.css("box-shadow",""):this.$row.css("box-shadow",t[0]+"px "+t[1]+"px "+t[2]+"px "+t[3]+"px "+N2Color.hex2rgbaCSS(t[4]))},r.prototype._syncbgimage=r.prototype._syncbgimagex=r.prototype._syncbgimagey=r.prototype._syncbgimageparallax=r.prototype._syncbgcolor=r.prototype._syncbgcolorgradient=r.prototype._syncbgcolorgradientend=function(){this._syncbgThrottled()},r.prototype._syncbgThrottled=function(){var t="",e=nextend.smartSlider.generator.fill(this.getProperty("bgimage"));if(""!=e){var i=parseInt(this.getProperty("bgimagex"));isFinite(i)||(i=50);var n=parseInt(this.getProperty("bgimagey"));isFinite(n)||(n=50),t+='url("'+nextend.imageHelper.fixed(e)+'") '+i+"% "+n+"% / cover no-repeat"+(1==this.getProperty("bgimageparallax")?" fixed":"")}var r=this.getProperty("bgcolor"),s=this.getProperty("bgcolorgradient"),o=this.getProperty("bgcolorgradientend");if(0!=N2Color.hex2alpha(r)||"off"!=s&&0!=N2Color.hex2alpha(o)){var a="";switch(""!=t&&(a=","+t),s){case"horizontal":this.$row.css("background","-moz-linear-gradient(left, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background"," -webkit-linear-gradient(left, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background","linear-gradient(to right, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a);break;case"vertical":this.$row.css("background","-moz-linear-gradient(top, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background"," -webkit-linear-gradient(top, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background","linear-gradient(to bottom, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a);break;case"diagonal1":this.$row.css("background","-moz-linear-gradient(45deg, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background"," -webkit-linear-gradient(45deg, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background","linear-gradient(45deg, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a);break;case"diagonal2":this.$row.css("background","-moz-linear-gradient(-45deg, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background"," -webkit-linear-gradient(-45deg, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a).css("background","linear-gradient(-45deg, "+N2Color.hex2rgbaCSS(r)+" 0%,"+N2Color.hex2rgbaCSS(o)+" 100%)"+a);break;case"off":default:""!=t?t="linear-gradient("+N2Color.hex2rgbaCSS(r)+", "+N2Color.hex2rgbaCSS(r)+"),"+t:t+=N2Color.hex2rgbaCSS(r),this.$row.css("background",t)}}else this.$row.css("background",t)},r.prototype.getData=function(t){var i=e.ComponentAbstract.prototype.getData.call(this,t);return t.itemsIncluded&&(i.cols=this.container.getData(t)),i},r.prototype.moveCol=function(t,e){if("desktopPortrait"==this.getMode()){this._moveCol(t,e);var n=i.history.addValue(this,this.historyMoveCol,[]);n&&n.setValues({oldIndex:e,newIndex:t},{oldIndex:t,newIndex:e})}else{var r=this.getOrderedColumns(),s=r[t];r.splice(t,1),r.splice(e,0,s);for(var o=0;o<r.length;o++)r[o].setProperty("order",o+1);this.refreshUI()}},r.prototype._moveCol=function(t,e){var i=this.container.getSortedLayers();e>t&&e++,this.container.insertLayerAt(i[t],e),this.refreshUI()},r.prototype.historyMoveCol=function(t){this._moveCol(t.oldIndex,t.newIndex)},r.prototype.setColsWidth=function(t){for(var e=this.container.getSortedLayers(),i=0;i<t.length;i++)e[i].setProperty("colwidth",t[i].toFraction());this.update(),this.refreshUI()},r.prototype.setRealColsWidth=function(t){for(var e=this.getOrderedColumns(),i=0;i<t.length;i++)e[i].setProperty("colwidth",t[i].toFraction());this.update(),this.refreshUI()},r.prototype.updateColumnWidth=function(t){for(var e=this.getOrderedColumns(),i=0;i<e.length;i++)e[i].layer.css("width",100*t[i]+"%");this.update()},r.prototype.activateColumn=function(t,e){this.container.getSortedLayers()[t].activate(e)},r.prototype.onChildCountChange=function(){if(!this.isDeleted&&!this.isDeleteStarted){var t=this.container.getSortedLayers(),e=t.length;if(e){for(var i=this.getColumns().split("+"),n=0,r=0;r<i.length;r++)n=new Fraction(i[r]).add(n);if(1!=n.valueOf())for(var r=0;e>r;r++)t[r].setProperty("colwidth","1/"+e);else for(var r=0;e>r;r++)t[r]._synccolwidth();this.refreshUI()}this._syncgutter(),this._syncwrapafter()}},r.prototype.renderModeProperties=function(t){e.ComponentAbstract.prototype.renderModeProperties.call(this,t),this._syncpadding(),this._syncinneralign(),this._syncwrapafter(),this._syncgutter(),this.isActive&&this.columnsField.setRow(this)},r.prototype.hightlightStructure=function(e){e=e||4e3,this.isStructureHighlighted&&(clearTimeout(this.isStructureHighlighted),this.isStructureHighlighted=!1),this.layer.addClass("n2-highlight-structure"),this.isStructureHighlighted=setTimeout(t.proxy(function(){this.isDeleted||this.layer.removeClass("n2-highlight-structure")},this),e)},r.prototype.refreshUI=function(){this.isDeleteStarted||(this.isActive&&this.columnsField.setRow(this),this._syncwrapafter(),this.$row.nextendColumns("option","columns",this.getColumnsOrdered()))},r.prototype.getDroppable=function(){return this.layer.is(":visible")&&this.status!=N2Classes.ComponentAbstract.STATUS.HIDDEN&&this.status!=N2Classes.ComponentAbstract.STATUS.LOCKED?{$container:this.$row,layer:this,placement:"normal",axis:"x"}:"hidden"},r.prototype.getLLDroppable=function(t){switch(t.type){case"col":if(t.group==this)return{$container:this.container.$ul,layer:this}}return!1},r.prototype.getContents=function(){return this.$row},r}),N2Require("ComponentSettings",[],["smartSlider"],function(t,e,i,n){"use strict";function r(e){this.componentType="undefined",this.placementType="undefined",t("html").attr("data-component",""),t("html").attr("data-placement",""),this.currentForm={},this.forms={undefined:null,placement:{absolute:{},normal:{},"default":{}},component:{content:{},layer:{},row:{},col:{},group:{}},global:{id:t("#layerid"),desktopPortrait:t("#layershow-desktop-portrait"),desktopLandscape:t("#layershow-desktop-landscape"),tabletPortrait:t("#layershow-tablet-portrait"),tabletLandscape:t("#layershow-tablet-landscape"),mobilePortrait:t("#layershow-mobile-portrait"),mobileLandscape:t("#layershow-mobile-landscape"),"class":t("#layerclass"),generatorvisible:t("#layergenerator-visible"),crop:t("#layercrop"),rotation:t("#layerrotation"),parallax:t("#layerparallax"),fontsize:t("#layerfont-size"),adaptivefont:t("#layeradaptive-font"),mouseenter:t("#layeronmouseenter"),click:t("#layeronclick"),mouseleave:t("#layeronmouseleave"),play:t("#layeronplay"),pause:t("#layeronpause"),stop:t("#layeronstop")}},this.canvasManager=e;var n=i.frontend.responsive;n.enabled("desktop","Landscape")||this.forms.global.desktopLandscape.closest(".n2-mixed-group").css("display","none"),n.enabled("tablet","Portrait")||this.forms.global.tabletPortrait.closest(".n2-mixed-group").css("display","none"),n.enabled("tablet","Landscape")||this.forms.global.tabletLandscape.closest(".n2-mixed-group").css("display","none"),n.enabled("mobile","Portrait")||this.forms.global.mobilePortrait.closest(".n2-mixed-group").css("display","none"),n.enabled("mobile","Landscape")||this.forms.global.mobileLandscape.closest(".n2-mixed-group").css("display","none"),this.forms.placement.absolute={parentid:t("#layerparentid"),parentalign:t("#layerparentalign"),parentvalign:t("#layerparentvalign"),left:t("#layerleft"),top:t("#layertop"),responsiveposition:t("#layerresponsive-position"),width:t("#layerwidth"),height:t("#layerheight"),responsivesize:t("#layerresponsive-size"),align:t("#layeralign"),valign:t("#layervalign")},this.forms.placement.normal={margin:t("#layernormal-margin"),height:t("#layernormal-height"),maxwidth:t("#layernormal-maxwidth"),selfalign:t("#layernormal-selfalign")},this.forms.component.content={maxwidth:t("#layercontent-maxwidth"),selfalign:t("#layercontent-selfalign"),padding:t("#layercontent-padding"),inneralign:t("#layercontent-inneralign"),verticalalign:t("#layercontent-verticalalign"),bgcolor:t("#layercontent-background-color"),bgimage:t("#layercontent-background-image"),bgimagex:t("#layercontent-background-focus-x"),bgimagey:t("#layercontent-background-focus-y"),bgimageparallax:t("#layercontent-background-parallax"),bgcolorgradient:t("#layercontent-background-gradient"),bgcolorgradientend:t("#layercontent-background-color-end"),opened:t("#layercontent-opened")},i.generator.registerField(this.forms.component.content.bgimage),this.forms.component.row={padding:t("#layerrow-padding"),gutter:t("#layerrow-gutter"),fullwidth:t("#layerrow-fullwidth"),stretch:t("#layerrow-stretch"),wrapafter:t("#layerrow-wrap-after"),inneralign:t("#layerrow-inneralign"),bgimage:t("#layerrow-background-image"),bgimagex:t("#layerrow-background-focus-x"),bgimagey:t("#layerrow-background-focus-y"),bgimageparallax:t("#layerrow-background-parallax"),bgcolor:t("#layerrow-background-color"),bgcolorgradient:t("#layerrow-background-gradient"),bgcolorgradientend:t("#layerrow-background-color-end"),borderradius:t("#layerrow-border-radius"),boxshadow:t("#layerrow-boxshadow"),opened:t("#layerrow-opened")},i.generator.registerField(this.forms.component.row.bgimage),this.forms.component.col={maxwidth:t("#layercol-maxwidth"),padding:t("#layercol-padding"),inneralign:t("#layercol-inneralign"),verticalalign:t("#layercol-verticalalign"),bgcolor:t("#layercol-background-color"),link:t("#layercol-link"),bgimage:t("#layercol-background-image"),bgimagex:t("#layercol-background-focus-x"),bgimagey:t("#layercol-background-focus-y"),bgimageparallax:t("#layercol-background-parallax"),bgcolorgradient:t("#layercol-background-gradient"),bgcolorgradientend:t("#layercol-background-color-end"),borderradius:t("#layercol-border-radius"),boxshadow:t("#layercol-boxshadow"),borderwidth:t("#layercol-border-width"),borderstyle:t("#layercol-border-style"),bordercolor:t("#layercol-border-color"),opened:t("#layercol-opened"),colwidth:t("#layercol-colwidth"),order:t("#layercol-order")},i.generator.registerField(t("#col-linklayercol-link_0")),i.generator.registerField(this.forms.component.col.bgimage),this.forms.component.group={parallax:t("#layergroup-parallax"),desktopPortrait:t("#layergroup-show-desktop-portrait"),desktopLandscape:t("#layergroup-show-desktop-landscape"),tabletPortrait:t("#layergroup-show-tablet-portrait"),tabletLandscape:t("#layergroup-show-tablet-landscape"),mobilePortrait:t("#layergroup-show-mobile-portrait"),mobileLandscape:t("#layergroup-show-mobile-landscape"),fontsize:t("#layergroup-font-size"),adaptivefont:t("#layergroup-adaptive-font"),generatorvisible:t("#layergroup-generator-visible")}}return r.prototype.changeActiveComponent=function(e,i,n,r){if(this.currentLayer=e,this.componentType!=i){switch(t("html").attr("data-component",i),i){case"content":t("#n2-tabbed-slide-editor-settings").data("pane").showTabs(["content","animations","position"]);break;case"layer":t("#n2-tabbed-slide-editor-settings").data("pane").showTabs(["item","style","animations","position"]);break;case"group":t("#n2-tabbed-slide-editor-settings").data("pane").showTabs(["group","animations"]);break;case"row":t("#n2-tabbed-slide-editor-settings").data("pane").showTabs(["row","animations","position"]);
break;case"col":t("#n2-tabbed-slide-editor-settings").data("pane").showTabs(["column","animations","position"])}this.componentType=i}this.changeActiveComponentPlacement(n),this.syncFields(r)},r.prototype.changeActiveComponentPlacement=function(e,i){this.placementType!=e&&(t("html").attr("data-placement",e),this.placementType=e),this.syncFields(i)},r.prototype.syncFields=function(e){if("object"==typeof e){this.currentForm=t.extend({},this.forms.global,this.forms.component[this.componentType],this.forms.placement[this.placementType]);for(var i in e)typeof e[i]!==n?this.updateField(i,e[i]):console.error("Value is undefined for: "+i);for(var r in this.currentForm)this.currentForm[r].off(".layeroptions").on("outsideChange.layeroptions",t.proxy(this.activeComponentPropertyChanged,this,r))}},r.prototype.onUpdateField=function(t,e,i){t.target==this.currentLayer&&this.updateField(e,i)},r.prototype.updateField=function(t,e){if("function"==typeof this.currentLayer["formSet"+t])this.currentLayer["formSet"+t](this,e);else if(this.currentForm[t]!==n){var i=this.currentForm[t].data("field");i!==n&&i.insideChange(e)}else console.error("field not available: "+t+":"+e,this.currentForm)},r.prototype.activeComponentPropertyChanged=function(t,e){if(this.currentLayer&&!this.currentLayer.isDeleted){var i=this.currentForm[t].val();this.currentLayer.setProperty(t,i,"manager")}else{var n=this.currentForm[t].data("field");"undefined"!=typeof n&&null!==n&&n.insideChange("")}},r.prototype.startFeatures=function(){this.layerFeatures=new e.LayerFeatures(this.forms.placement.absolute,this.canvasManager);var i=t("#n2-ss-layer-adaptive-font").on("click",t.proxy(function(){this.currentForm.adaptivefont.data("field").onoff.trigger("click")},this));this.forms.global.adaptivefont.on("nextendChange",t.proxy(function(){1==this.currentForm.adaptivefont.val()?i.addClass("n2-active"):i.removeClass("n2-active")},this)),this.forms.component.group.adaptivefont.on("nextendChange",t.proxy(function(){1==this.currentForm.adaptivefont.val()?i.addClass("n2-active"):i.removeClass("n2-active")},this)),new N2Classes.FormElementNumber("n2-ss-layer-font-size",-Number.MAX_VALUE,Number.MAX_VALUE),new N2Classes.FormElementAutocompleteSlider("n2-ss-layer-font-size",{min:50,max:300,step:5});var n=t("#n2-ss-layer-font-size").on("outsideChange",t.proxy(function(){var t=parseInt(n.val());this.currentForm.fontsize.val(t).trigger("change")},this));this.forms.global.fontsize.on("nextendChange",t.proxy(function(){n.data("field").insideChange(this.forms.global.fontsize.val())},this)),this.forms.component.group.fontsize.on("nextendChange",t.proxy(function(){n.data("field").insideChange(this.currentForm.fontsize.val())},this))},r}),N2Require("BgAnimationManager",[],[],function(t,e,i){function n(){this.type="backgroundanimation",NextendVisualManagerMultipleSelection.prototype.constructor.apply(this,arguments)}return n.prototype=Object.create(NextendVisualManagerMultipleSelection.prototype),n.prototype.constructor=n,n.prototype.loadDefaults=function(){NextendVisualManagerMultipleSelection.prototype.loadDefaults.apply(this,arguments),this.type="backgroundanimation",this.labels={visual:"Background animation",visuals:"Background animations"}},n.prototype.initController=function(){return new e.BgAnimationEditor},n.prototype.createVisual=function(t,e){return new NextendVisualWithSetRowMultipleSelection(t,e,this)},n}),N2Require("BgAnimationEditor",[],[],function(t,e,i){function n(){this.parameters={shiftedBackgroundAnimation:0},NextendVisualEditorController.prototype.constructor.call(this,!1),this.bgAnimationElement=t(".n2-bg-animation"),this.slides=t(".n2-bg-animation-slide"),this.bgImages=t(".n2-bg-animation-slide-bg"),NextendTween.set(this.bgImages,{rotationZ:1e-4}),this.directionTab=new N2Classes.FormElementRadio("n2-background-animation-preview-tabs",["0","1"]),this.directionTab.element.on("nextendChange.n2-editor",t.proxy(this.directionTabChanged,this)),nModernizr.csstransforms3d&&nModernizr.csstransformspreserve3d||nextend.notificationCenter.error("Background animations are not available in your browser. It works if the <i>transform-style: preserve-3d</i> feature available. ")}return n.prototype=Object.create(NextendVisualEditorController.prototype),n.prototype.constructor=n,n.prototype.loadDefaults=function(){NextendVisualEditorController.prototype.loadDefaults.call(this),this.type="backgroundanimation",this.current=0,this.animationProperties=!1,this.direction=0},n.prototype.get=function(){return null},n.prototype.load=function(t,e,i,n){this.lightbox.addClass("n2-editor-loaded")},n.prototype.setTabs=function(t){},n.prototype.directionTabChanged=function(){this.direction=parseInt(this.directionTab.element.val())},n.prototype.start=function(){this.animationProperties&&(this.timeline?this.timeline.play():this.next())},n.prototype.pause=function(){this.timeline&&this.timeline.pause()},n.prototype.next=function(){this.timeline=new NextendTimeline({paused:!0,onComplete:t.proxy(this.ended,this)});var e=this.bgImages.eq(this.current),i=this.bgImages.eq(1-this.current);nModernizr.csstransforms3d&&nModernizr.csstransformspreserve3d?(this.currentAnimation=new N2Classes["SmartSliderBackgroundAnimation"+this.animationProperties.type](this,e,i,this.animationProperties,1,this.direction),this.slides.eq(this.current).css("zIndex",2),this.slides.eq(1-this.current).css("zIndex",3),this.timeline.to(this.slides.eq(this.current),.5,{opacity:0},this.currentAnimation.getExtraDelay()),this.timeline.to(this.slides.eq(1-this.current),.5,{opacity:1},this.currentAnimation.getExtraDelay()),this.currentAnimation.postSetup()):(this.timeline.to(this.slides.eq(this.current),1.5,{opacity:0},0),this.timeline.to(this.slides.eq(1-this.current),1.5,{opacity:1},0)),this.current=1-this.current,this.timeline.play()},n.prototype.ended=function(){this.currentAnimation&&this.currentAnimation.ended(),this.next()},n.prototype.setAnimationProperties=function(t){var e=this.animationProperties;this.animationProperties=t,e||this.next()},n}),N2Require("PostBgAnimationManager",[],[],function(t,e,i){function n(){this.type="postbackgroundanimation",NextendVisualManagerMultipleSelection.prototype.constructor.apply(this,arguments)}return n.prototype=Object.create(NextendVisualManagerMultipleSelection.prototype),n.prototype.constructor=n,n.prototype.loadDefaults=function(){NextendVisualManagerMultipleSelection.prototype.loadDefaults.apply(this,arguments),this.type="postbackgroundanimation",this.labels={visual:"Ken Burns effect",visuals:"Ken Burns effects"}},n.prototype.initController=function(){return new e.PostBgAnimationEditor},n.prototype.createVisual=function(t,e){return new NextendVisualWithSetRowMultipleSelection(t,e,this)},n.prototype.show=function(t,e){var i=[];""!=t&&(t=t.split("|*|"),i[0]=t[0],i[1]=t[1],t=t[2]),NextendVisualManagerMultipleSelection.prototype.show.call(this,t,e,i)},n.prototype.getAsString=function(){return this.controller.transformOrigin+"|*|"+NextendVisualManagerMultipleSelection.prototype.getAsString.call(this)},n}),N2Require("PostBgAnimationEditor",[],[],function(t,e,i){function n(){NextendVisualEditorController.prototype.constructor.call(this,!1),this.bgAnimationElement=t(".n2-postbg-animation-slider").on("click",t.proxy(this.clickFocusPoint,this)),this.bgImage=this.bgAnimationElement.find(".n2-postbg-animation-slide"),nModernizr.csstransforms3d||nextend.notificationCenter.error("Background animations are not available in your browser. It works if the <i>3D transform</i> feature available. "),this.transformOriginField=t("#n2-post-backgroundtransformorigin").on("nextendChange",t.proxy(this.changeFocus,this))}return n.prototype=Object.create(NextendVisualEditorController.prototype),n.prototype.constructor=n,n.prototype.loadDefaults=function(){NextendVisualEditorController.prototype.loadDefaults.call(this),this.type="postbackgroundanimation",this.tween=null,this.animationProperties=!1,this.transformOrigin="50||50"},n.prototype.clickFocusPoint=function(t){var e=this.bgAnimationElement.offset(),i=Math.round((t.pageX-e.left)/this.bgAnimationElement.width()*100),n=Math.round((t.pageY-e.top)/this.bgAnimationElement.height()*100);this.transformOriginField.data("field").insideChange(i+"|*|"+n)},n.prototype.changeFocus=function(){this.transformOrigin=this.transformOriginField.val(),this.animationProperties&&this.setAnimationProperties(this.animationProperties)},n.prototype.setImage=function(){if(nextend&&nextend.smartSlider&&nextend.smartSlider.frontend){var t=nextend.smartSlider.frontend;if("undefined"!=typeof t){this.bgImage.html(""),t.currentSlide.backgroundImage.$background.clone().appendTo(this.bgImage);var e=this.bgAnimationElement.parent().width()-40,i=t.dimensions.width,n=t.dimensions.height;i>e&&(n=n*e/i,i=e),this.bgAnimationElement.css({width:i,height:n})}}},n.prototype.get=function(){return null},n.prototype.load=function(t,e,i,n){this.lightbox.addClass("n2-editor-loaded")},n.prototype.setTabs=function(t){},n.prototype.start=function(t){this.setImage(),this.transformOriginField.data("field").insideChange(t[0]+"|*|"+t[1])},n.prototype.pause=function(){this.tween&&this.tween.pause()},n.prototype.next=function(){var e=t.extend(!0,{},this.animationProperties);"undefined"==typeof e.from.transformOrigin&&NextendTween.set(this.bgImage,{transformOrigin:this.transformOrigin.split("|*|").join("% ")+"%"}),e.to.delay=.5,e.to.onComplete=t.proxy(this.next,this),this.tween=NextendTween.fromTo(this.bgImage,e.duration,e.from,e.to)},n.prototype.setAnimationProperties=function(t){this.animationProperties=t,this.pause(),NextendTween.set(this.bgImage,{scale:1,x:0,y:0,rotationZ:1e-4,transformOrigin:"50% 50%"}),this.next()},n}),function(t){"use strict";t.widget("ui.nextendCanvasItem",t.ui.mouse,{widgetEventPrefix:"canvasItem",options:{canvasUIManager:null,layer:!1,$layer:null,distance:2,onCreate:function(){}},_create:function(){"function"==typeof this.options.$layer&&(this.options.$layer=this.options.$layer.call(this,this)),this._mouseInit()},_mouseCapture:function(t,e){return this.options.canvasUIManager._mouseCapture(this.options,t,e)},_mouseStart:function(t,e,i){return this._trigger("start"),this.options.canvasUIManager._mouseStart(this.options,t,e,i)},_mouseDrag:function(t){return this.options.canvasUIManager._mouseDrag(this.options,t)},_mouseStop:function(t,e){return this.options.canvasUIManager._mouseStop(this.options,t,e)},_destroy:function(){return this._mouseDestroy(),this}})}(n2),function(t){"use strict";t.widget("ui.nextendCanvas",{widgetEventPrefix:"canvas",ready:!1,options:{mainContainer:null},display:!1,_create:function(){},_mouseCapture:function(e,i,n){return!(t(i.target).closest(".ui-resizable-handle, .ui-customresizable-handle, .ui-spacing-handle").length>0)},_mouseStart:function(e,i,n,r){t("body").addClass("n2-ss-move-layer"),this.dragDeferred=t.Deferred(),this.options.mainContainer.canvasManager.layerWindow.hideWithDeferred(this.dragDeferred),this.context={placeholder:t('<div class="n2-ss-layer-placeholder" />'),mouse:{offset:{left:i.pageX,top:i.pageY}},canvas:{offset:this.options.mainContainer.layer.offset(),size:{width:this.options.mainContainer.layer.outerWidth(),height:this.options.mainContainer.layer.outerHeight()}},$layer:e.$layer};var s={position:"absolute",right:"auto",bottom:"auto"};e.layer?(this.startMode=e.layer.placement.getType(),this.context.layer={offset:e.$layer.offset()},this.context.originalIndex=e.layer.getIndex(),"normal"==this.startMode&&(s.width=e.$layer.width(),e.$layer.appendTo(this.options.mainContainer.layer))):(this.startMode="create",this.context.layer={offset:{left:0,top:0}},e.$layer.appendTo("body")),e.$layer.addClass("n2-canvas-item-drag").css(s),this._cacheMargins(e.$layer),this.context.size={width:e.$layer.outerWidth(),height:e.$layer.outerHeight()},this.context.droppables=this.options.mainContainer.getDroppables(e.layer),this._cacheContainers(),this._trigger("start",i,{layer:e.layer,mode:this.startMode}),this._mouseDrag(e,i)},_mouseDrag:function(t,e){var i;i="create"==this.startMode?{top:e.pageY-this.context.canvas.offset.top-20,left:e.pageX-this.context.canvas.offset.left-20}:{top:this.context.layer.offset.top-this.context.canvas.offset.top+e.pageY-this.context.mouse.offset.top,left:this.context.layer.offset.left-this.context.canvas.offset.left+e.pageX-this.context.mouse.offset.left};var n=this._findInnerContainer(e);if(n===!1&&"create"!=this.startMode&&(n=this.context.droppables[0]),n)if("normal"==n.placement){"undefined"==typeof n.layers&&(n.layers=this._cacheContainerLayers(n));var r=this._findNormalIndex(e,n);r>0?(this.context.placeholder.css("order",n.layers[r-1].layer.layer.css("order")),this.context.placeholder.insertAfter(n.layers[r-1].layer.layer)):(this.context.placeholder.css("order",0),this.context.placeholder.prependTo(n.$container)),this.context.targetIndex=r}else this.context.placeholder.detach();else this.context.placeholder.detach();this.context.targetContainer=n,this._trigger("drag",e,{layer:t.layer,originalOffset:this.context.layer.offset,position:i,canvasOffset:this.context.canvas.offset,offset:{left:i.left+this.context.canvas.offset.left,top:i.top+this.context.canvas.offset.top}}),"create"==this.startMode&&(i.left+=this.context.canvas.offset.left,i.top+=this.context.canvas.offset.top),t.$layer.css(i),this._displayPosition(e,i)},_mouseStop:function(e,i,n){this.context.placeholder.remove();var r=this.context.targetIndex,s=this.context.targetContainer;if(e.$layer.removeClass("n2-canvas-item-drag"),"create"==this.startMode)s&&e.onCreate.call(this,i,e,s,r),e.$layer.detach();else if("absolute"==this.startMode&&"absolute"==this.context.targetContainer.placement){var o=parseInt(e.$layer.css("left")),a=parseInt(e.$layer.css("top"));e.$layer.css({position:"",right:"",bottom:""}),e.layer.placement.current.setPosition(o,a)}else if("absolute"==this.context.targetContainer.placement){var o=parseInt(e.$layer.css("left")),a=parseInt(e.$layer.css("top"));e.$layer.css({position:"",right:"",bottom:""});var l=e.$layer.width(),h=e.$layer.height();e.layer.group.onChildCountChange();for(var d=e.layer;d&&(!d.placement||"absolute"!==d.placement.getType());)d=d.group;nextend.smartSlider.history.startBatch(),e.layer.changeGroup(this.context.originalIndex,this.options.mainContainer),nextend.smartSlider.history.addControl("skipForwardUndos"),"layer"==e.layer.type&&e.layer.item&&(e.layer.item.needSize||(h="auto",l++));var p=d?d.getProperty("align"):"center",c=d?d.getProperty("valign"):"middle";e.layer.placement.current._setPosition(p,c,o,a,l,h,!0),nextend.smartSlider.history.endBatch()}else if("normal"==this.context.targetContainer.placement)switch(e.$layer.css({position:"relative",width:"",left:"",top:""}),s.layer.type){case"content":case"col":r>0?e.$layer.insertAfter(s.layers[r-1].layer.layer):e.$layer.prependTo(s.$container),e.layer.onCanvasUpdate(this.context.originalIndex,s.layer,r);break;case"row":var u=s.layer.createCol();s.layer.moveCol(u.getIndex(),r),e.$layer.prependTo(u.$content),e.layer.onCanvasUpdate(this.context.originalIndex,u,0)}delete this.context,this.options.display&&this.options.display.hide(),this._trigger("stop",i,{layer:e.layer}),this.dragDeferred.resolve(),t("body").removeClass("n2-ss-move-layer")},cancel:function(t){},_cacheContainers:function(){for(var t=0;t<this.context.droppables.length;t++){var e=this.context.droppables[t];e.offset=e.$container.offset(),e.size={width:e.$container.outerWidth(),height:e.$container.outerHeight()},e.offset.right=e.offset.left+e.size.width,e.offset.bottom=e.offset.top+e.size.height}},_findInnerContainer:function(t){for(var e=this.context.droppables.length-1;e>=0;e--){var i=this.context.droppables[e];if(i.offset.left<=t.pageX&&i.offset.right>=t.pageX&&i.offset.top<=t.pageY&&i.offset.bottom>=t.pageY)return i}return!1},_cacheContainerLayers:function(t){for(var e=[],i=t.layer.container.getSortedLayers(),n=0;n<i.length;n++){var r={layer:i[n]};r.offset=r.layer.layer.offset(),r.size={width:r.layer.layer.outerWidth(),height:r.layer.layer.outerHeight()},r.offset.right=r.offset.left+r.size.width/2,r.offset.bottom=r.offset.top+r.size.height/2,e.push(r)}return e},_findNormalIndex:function(t,e){var i=-1;switch(e.axis){case"y":for(var n=0;n<e.layers.length;n++){var r=e.layers[n];if(t.pageY<=r.offset.bottom){i=n;break}}break;case"x":for(var n=0;n<e.layers.length;n++){var r=e.layers[n];if(t.pageX<=r.offset.right){i=n;break}}}return-1===i&&(i=e.layers.length),i},_displayPosition:function(t,e){this.options.display&&(this.context.targetContainer&&"absolute"==this.context.targetContainer.placement?(this.options.display.hidden&&this.options.display.show(),"create"==this.startMode&&(e.left-=this.context.canvas.offset.left,e.top-=this.context.canvas.offset.top),this.options.display.update(t,e)):this.options.display.hidden&&this.options.display.hide())},_trigger:function(e,i,n){return n=n||{},t.ui.plugin.call(this,e,[i,n,this],!0),t.Widget.prototype._trigger.call(this,e,i,n)},plugins:{},_cacheMargins:function(t){this.margins={left:parseInt(t.css("marginLeft"),10)||0,top:parseInt(t.css("marginTop"),10)||0,right:parseInt(t.css("marginRight"),10)||0,bottom:parseInt(t.css("marginBottom"),10)||0}}}),t.ui.plugin.add("nextendCanvas","smartguides",{start:function(e,i){var n=t(this).data("uiNextendCanvas"),r=n.options;if("create"!=n.startMode&&(n.gridH=t('<div class="n2-grid n2-grid-h"></div>').appendTo(r.mainContainer.layer),n.gridV=t('<div class="n2-grid n2-grid-v"></div>').appendTo(r.mainContainer.layer),n.elements=[],"function"==typeof r.smartguides)){var s=t(r.smartguides(n.context)).not(n.context.$layer);s&&s.length&&s.each(function(){var e=t(this),i=e.offset();this!=n.element[0]&&n.elements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:Math.round(i.top),left:Math.round(i.left),backgroundColor:""})});var o=r.mainContainer.layer.offset();n.elements.push({width:r.mainContainer.layer.width(),height:r.mainContainer.layer.height(),top:Math.round(o.top),left:Math.round(o.left),backgroundColor:"#ff4aff"})}},stop:function(e,i){var n=t(this).data("uiNextendCanvas");"create"!=n.startMode&&(n.gridH.remove(),n.gridV.remove())},drag:function(e,i){var n=!1,r=!1,s=t(this).data("uiNextendCanvas"),o=s.options,a=o.tolerance,l=o.tolerance;if("create"!=s.startMode&&(s.gridH.css({display:"none"}),s.gridV.css({display:"none"}),s.context.targetContainer&&"absolute"==s.context.targetContainer.placement)){var h=s.elements[s.elements.length-1],d=function(t){s.gridV.css({left:Math.min(t,h.width-1),display:"block"})},p=function(t){s.gridH.css({top:Math.min(t,h.height-1),display:"block"})},c=e.ctrlKey||e.metaKey,u=e.altKey;if(c&&u)return;c?n=!0:u&&(r=!0);var y=i.offset.left,f=y+s.context.size.width,g=i.offset.top,m=g+s.context.size.height,v=(y+f)/2,x=(g+m)/2;if(!n)for(var b=s.elements.length-1;b>=0&&0!=a;b--){var C,w=s.elements[b].left,S=w+s.elements[b].width,k=(w+S)/2,P=!0;(C=Math.abs(w-f))<a?(i.position.left=w-s.context.size.width-s.context.canvas.offset.left-s.margins.left,d(i.position.left+s.context.size.width)):(C=Math.abs(w-y))<a?(i.position.left=w-s.context.canvas.offset.left-s.margins.left,d(i.position.left)):(C=Math.abs(S-y))<a?(i.position.left=S-s.context.canvas.offset.left-s.margins.left,d(i.position.left)):(C=Math.abs(S-f))<a?(i.position.left=S-s.context.size.width-s.context.canvas.offset.left-s.margins.left,d(i.position.left+s.context.size.width)):(C=Math.abs(k-f))<a?(i.position.left=k-s.context.size.width-s.context.canvas.offset.left-s.margins.left,d(i.position.left+s.context.size.width)):(C=Math.abs(k-y))<a?(i.position.left=k-s.context.canvas.offset.left-s.margins.left,d(i.position.left)):(C=Math.abs(k-v))<a?(i.position.left=k-s.context.size.width/2-s.context.canvas.offset.left-s.margins.left,d(i.position.left+s.context.size.width/2)):P=!1,P&&(n=s.elements[b],a=Math.min(C,a))}if(!r)for(var b=s.elements.length-1;b>=0&&0!=l;b--){var C,A=s.elements[b].top,M=A+s.elements[b].height,D=(A+M)/2,T=!0;(C=Math.abs(A-m))<l?(i.position.top=A-s.context.size.height-s.context.canvas.offset.top-s.margins.top,p(i.position.top+s.context.size.height)):(C=Math.abs(A-g))<l?(i.position.top=A-s.context.canvas.offset.top-s.margins.top,p(i.position.top)):(C=Math.abs(M-g))<l?(i.position.top=M-s.context.canvas.offset.top-s.margins.top,p(i.position.top)):(C=Math.abs(M-m))<l?(i.position.top=M-s.context.size.height-s.context.canvas.offset.top-s.margins.top,p(i.position.top+s.context.size.height)):(C=Math.abs(D-m))<l?(i.position.top=D-s.context.size.height-s.context.canvas.offset.top-s.margins.top,p(i.position.top+s.context.size.height)):(C=Math.abs(D-g))<l?(i.position.top=D-s.context.canvas.offset.top-s.margins.top,p(i.position.top)):(C=Math.abs(D-x))<l?(i.position.top=D-s.context.size.height/2-s.context.canvas.offset.top-s.margins.top,p(i.position.top+s.context.size.height/2)):T=!1,T&&(r=s.elements[b],l=Math.min(C,l))}n&&n!==!0&&s.gridV.css("backgroundColor",n.backgroundColor),r&&r!==!0&&s.gridH.css("backgroundColor",r.backgroundColor)}}})}(n2),function(t){"use strict";t.widget("ui.nextendColumns",t.ui.mouse,{version:"1.0.0",widgetEventPrefix:"columns",options:{columns:"1",gutter:0,denominators:{1:100,2:100,3:144,4:100,5:100,6:144},drag:null,start:null,stop:null},getDenominator:function(t){return void 0===this.options.denominators[t]&&(this.options.denominators[t]=15*t),this.options.denominators[t]},_create:function(){this._setupHandles(),t(window).on("resize",t.proxy(this._resize,this)),this._mouseInit()},_destroy:function(){return this._mouseDestroy(),this.element.removeData("uiNextendColumns").off(".columns").find("> .ui-column-width-handle").remove(),this},_setupHandles:function(){var e,i,n=this.options;this.fractions=[];for(var r=n.columns.split("+"),e=0;e<r.length;e++)this.fractions.push(new Fraction(r[e]));this.currentDenominator=this.getDenominator(this.fractions.length);var s=0;for(e=0;e<this.fractions.length-1;e++){i=t("<div class='ui-column-width-handle'>");var o=100*this.fractions[e].valueOf();s+=o,i.data("i",e).data("percent",s).appendTo(this.element),this._on(i,{mousedown:this._mouseDown})}this.handles=this.element.find("> .ui-column-width-handle"),this.handles.disableSelection(),this._resize()},_resize:function(){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 e=0;e<this.handles.length;e++){var i=this.handles.eq(e).data("percent");this._updateResizer(e,i)}},_updateResizer:function(t,e){this.handles.eq(t).css({left:e+"%",marginLeft:-2+this.paddingLeft+(t+.5)*this.options.gutter+(this.innerWidth-this.outerWidth)*e/100})},_removeHandles:function(){this.handles.remove()},_setOption:function(t,e){switch(this._super(t,e),t){case"columns":this._removeHandles(),this._setupHandles();break;case"gutter":this._resize()}},_mouseCapture:function(t){var e,i,n=!1;for(e=0;e<this.handles.length;e++)i=this.handles[e],i===t.target&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i=t(e.target).data("i"),n=this.element.offset().left+10,r=this.element.width()-20;this.resizeContext={index:i,cLeft:n,containerWidth:r,startX:Math.max(0,Math.min(e.clientX-n,r))},this.currentFractions=[],this.currentPercent=[];for(var s=0;s<this.fractions.length;s++)this.currentFractions.push(this.fractions[s].clone()),this.currentPercent.push(this.fractions[s].valueOf());return this.resizing=!0,t("body").css("cursor","ew-resize"),this.element.addClass("ui-column-width-resizing"),this._trigger("start",e,this.ui()),!0},_mouseDrag:function(t){var e=Math.max(0,Math.min(t.clientX-this.resizeContext.cLeft,this.resizeContext.containerWidth)),i=new Fraction(Math.round((e-this.resizeContext.startX)/(this.resizeContext.containerWidth/this.currentDenominator)),this.currentDenominator);i.compare(this.fractions[this.resizeContext.index].clone().mul(-1))<0&&(i=this.fractions[this.resizeContext.index].clone().mul(-1)),i.compare(this.fractions[this.resizeContext.index+1])>0&&(i=this.fractions[this.resizeContext.index+1].clone());var n=this.fractions[this.resizeContext.index].add(i),r=this.fractions[this.resizeContext.index+1].sub(i);this.currentFractions[this.resizeContext.index]=n,this.currentFractions[this.resizeContext.index+1]=r;var s=0;this.currentPercent=[];for(var o=0;o<this.currentFractions.length;o++){var a=this.currentFractions[o].valueOf();this.currentPercent.push(a),s+=100*a,this._updateResizer(o,s)}this._trigger("colwidth",t,this.ui())},_mouseStop:function(e){return this.resizing=!1,t("body").css("cursor","auto"),this._trigger("stop",e,this.ui()),this.fractions=this.currentFractions,nextend.preventMouseUp(),!1},ui:function(){return{element:this.element,originalFractions:this.fractions,currentFractions:this.currentFractions,currentPercent:this.currentPercent,index:this.resizeContext.index}}})}(n2),function(t){"use strict";t.widget("ui.nextendLayerListItem",t.ui.mouse,{widgetEventPrefix:"layerListItem",options:{UIManager:null,layer:!1,$layer:null,distance:2},_create:function(){this._mouseInit()},_mouseCapture:function(t,e){return this.options.UIManager._mouseCapture(this.options,t,e)},_mouseStart:function(t,e,i){return this._trigger("start"),this.options.UIManager._mouseStart(this.options,t,e,i)},_mouseDrag:function(t){return this.options.UIManager._mouseDrag(this.options,t)},_mouseStop:function(t,e){return this.options.UIManager._mouseStop(this.options,t,e)},_destroy:function(){return this._mouseDestroy(),this}})}(n2),function(t){"use strict";t.widget("ui.nextendLayerList",{widgetEventPrefix:"layerList",ready:!1,scrollTimeout:null,options:{$fixed:null,$scrolled:null},_create:function(){},_mouseCapture:function(t,e,i){return!0},_mouseStart:function(e,i,n,r){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,t("body").addClass("n2-ss-layer-list-move-layer"),this.context={placeholder:t('<div class="nextend-sortable-placeholder"><div></div></div>'),mouse:{y:i.pageY,topModifier:e.$item.offset().top-i.pageY},$item:e.$item,$clone:e.$item.clone()},this.context.$clone.addClass("n2-ss-ll-dragging").appendTo(this.options.$scrolled.find("> ul")),this.context.droppables=this.options.mainContainer.getLLDroppables(e.layer),this._cacheContainers(),this._trigger("start",i),this._mouseDrag(e,i)},_scrollUp:function(){this.scrolledTop>0&&null===this.scrollTimeout&&(this.scrollTimeout=setInterval(t.proxy(function(){this.scrolledScroll-=30,this.options.$scrolled.scrollTop(this.scrolledScroll)},this),100),this.scrolledScroll-=30,this.options.$scrolled.scrollTop(this.scrolledScroll))},_scrollDown:function(){null===this.scrollTimeout&&(this.scrollTimeout=setInterval(t.proxy(function(){this.scrolledScroll+=30,this.options.$scrolled.scrollTop(Math.min(this.scrolledScroll,this.scrolledMaxHeight))},this),100),this.scrolledScroll+=30,this.options.$scrolled.scrollTop(Math.min(this.scrolledScroll,this.scrolledMaxHeight)))},_mouseDrag:function(t,e){this.scrolledTop=this.options.$scrolled.offset().top,this.scrolledHeight>60&&(e.pageY<this.scrolledTop+30?this._scrollUp():e.pageY>this.scrolledTop+this.scrolledHeight-30?this._scrollDown():(clearInterval(this.scrollTimeout),this.scrollTimeout=null)),this.scrolledScroll=this.options.$scrolled.scrollTop();var i=e.pageY-this.scrolledTop+this.scrolledScroll,n=this._findInnerContainer(i);n===!1&&(n=this.context.droppables[0]),"undefined"==typeof n.layers&&(n.layers=this._cacheContainerLayers(n));var r=this._findNormalIndex(i,n);r>0?this.context.placeholder.insertAfter(n.layers[r-1].layer.layerRow):this.context.placeholder.prependTo(n.$container),this.context.targetIndex=r,this.context.targetContainer&&this.context.targetContainer!=n&&this.context.targetContainer.layer.layerRow.removeClass("n2-ss-ll-dragging-parent"),this.context.targetContainer=n,this.context.targetContainer.layer.layerRow.addClass("n2-ss-ll-dragging-parent"),this.context.$clone.css({top:i+this.context.mouse.topModifier})},_mouseStop:function(e,i,n){null!==this.scrollTimeout&&(clearInterval(this.scrollTimeout),this.scrollTimeout=null),this.context.placeholder.remove(),this.context.$clone.remove(),this.context.targetContainer.layer.layerRow.removeClass("n2-ss-ll-dragging-parent");var r=this.context.targetIndex,s=this.context.targetContainer,o=e.layer.getIndex(),a=-1;if(0==this.context.targetContainer.layers.length)a=0;else{var l=!1,h=!1;this.context.targetContainer.layers[r]&&(l=this.context.targetContainer.layers[r].layer),this.context.targetContainer.layers[r-1]&&(h=this.context.targetContainer.layers[r-1].layer),l==e.layer||h==e.layer?a=-1:"absolute"==s.layer.container.allowedPlacementMode?l?a=l.getIndex()+1:h&&(a=h.getIndex()):h?a=h.getIndex()+1:l&&(a=l.getIndex())}a>=0&&("col"==e.layer.type?(a>o&&a--,s.layer.moveCol(o,a)):(s.layer.container.insertLayerAt(e.layer,a),e.layer.onCanvasUpdate(o,s.layer,a))),delete this.context,this._trigger("stop",i),t("body").removeClass("n2-ss-layer-list-move-layer")},cancel:function(t){},_cacheContainers:function(){for(var t=0;t<this.context.droppables.length;t++){var e=this.context.droppables[t];e.top=e.$container.offset().top-this.scrolledTop+this.scrolledScroll-15,e.height=e.$container.outerHeight(),e.bottom=e.top+e.height+15}},_findInnerContainer:function(t){for(var e=this.context.droppables.length-1;e>=0;e--){var i=this.context.droppables[e];if(i.top<=t&&i.bottom>=t)return i}return!1},_cacheContainerLayers:function(t){for(var e=[],i=t.layer.container.getSortedLayers(),n=0;n<i.length;n++){var r={layer:i[n]};r.top=r.layer.layerRow.offset().top-this.scrolledTop+this.scrolledScroll,r.height=r.layer.layerRow.outerHeight(),r.bottom=r.top+r.height/2,r.index=n,e.push(r)}return"absolute"==t.layer.container.allowedPlacementMode&&e.reverse(),e},_findNormalIndex:function(t,e){for(var i=0;i<e.layers.length;i++){var n=e.layers[i];if(t<=n.bottom)return i}return e.layers.length}})}(n2),N2Require("TimelineAnimation",["TimelineAnimationAbstract"],["smartSlider"],function(t,e,i,n){"use strict";function r(i,n,r){this.resizable=!0,this.$=t(this),this.group=r,this.data=t.extend({},e.TimelineAnimationAbstract.defaults,n),e.TimelineAnimationAbstract.prototype.constructor.call(this,i,n,r)}return r.prototype=Object.create(e.TimelineAnimationAbstract.prototype),r.prototype.constructor=r,r.prototype.save=function(t){t!==!1&&(this.data=t,this.$.trigger("animationChanged"))},r.prototype["delete"]=function(t){t&&t.stopPropagation(),this.animations.removeAnimation(this),this.$.trigger("animationDeleted")},r.prototype.getOptimizedData=function(){return nextend.deepDiff.map(t.extend({},this.data),e.TimelineAnimationAbstract.defaults)},e.NextendSmartSliderTimelineAnimation=r,r}),N2Require("TimelineAnimationAbstract",[],["smartSlider"],function(t,e,i,n){"use strict";function r(e,n,r){this.animations=e,this.group=r,this.delay=t('<span class="n2-ss-animation-delay n2-h5"></span>'),this.renderDelay(this.data.delay),this.duration=t('<span class="n2-ss-animation-duration n2-h5"></span>'),this.renderDuration(this.data.duration),this.bar=t('<div class="n2-ss-layer-animation n2-ss-layer-animation-'+this.group+'"></div>').css(nextend.rtl.marginLeft,i.layerAnimationManager.durationToOffsetX(this.data.delay)).css({width:i.layerAnimationManager.durationToOffsetX(this.data.duration)}).data("animation",this).append(this.delay).append(this.duration).draggable({scroll:!0,axis:"x",start:t.proxy(function(e,i){if(1==this.animations.layer.canvasManager.selectMode){var n=this.animations.layer;s=t.grep(this.animations.layer.canvasManager.selectedLayers,function(t){return t!=n});for(var r=0;r<s.length;r++)s[r].animations.shiftStartMultiSelect()}i.originalPosition[nextend.rtl.marginLeft]=parseInt(i.helper.css(nextend.rtl.marginLeft)),i.originalPosition.delay=this.getDelay()},this),drag:t.proxy(function(t,e){
if(nextend.rtl.isRtl)var n=Math.max(0,-1*(e.position.left-e.originalPosition[nextend.rtl.marginLeft]));else var n=Math.max(0,e.position.left+e.originalPosition[nextend.rtl.marginLeft]);var r=i.layerAnimationManager.normalizeOffsetX(n);e.position.left=0,e.helper.css(nextend.rtl.marginLeft,r),e.position[nextend.rtl.marginLeft]=r;var o=i.layerAnimationManager.offsetXToDuration(r);if(this.renderDelay(o),s)for(var a=o-e.originalPosition.delay,l=0;l<s.length;l++)s[l].animations.shiftDragMultiSelect(a)},this),stop:t.proxy(this.onBarDragStop,this)}),this.resizable&&this.bar.resizable({handles:"e, w",start:function(t,e){e.originalPosition[nextend.rtl.marginLeft]=parseInt(e.helper.css(nextend.rtl.marginLeft))},resize:t.proxy(function(t,e){if(nextend.rtl.isRtl){e.size.width=e.originalSize.width-(e.size.width-e.originalSize.width);var n=Math.max(0,-1*(e.position.left-e.originalPosition[nextend.rtl.marginLeft]))}else var n=Math.max(0,e.position.left+e.originalPosition[nextend.rtl.marginLeft]);var r=i.layerAnimationManager.normalizeOffsetX(n),s=n-r;e.size.width=i.layerAnimationManager.normalizeOffsetX(e.size.width+s),this.renderDuration(i.layerAnimationManager.offsetXToDuration(e.size.width)),e.position.left=0,e.helper.css(nextend.rtl.marginLeft,r),e.position[nextend.rtl.marginLeft]=r,this.renderDelay(i.layerAnimationManager.offsetXToDuration(r))},this),stop:t.proxy(this.onBarResizeStop,this)}),this.bar.on("click",t.proxy(this.click,this)),this.$.on("animationChanged",t.proxy(this.animationChanged,this)).on("animationMoved",t.proxy(this.animationMoved,this)).on("animationDeleted",t.proxy(this.animationDeleted,this))}var s=null;return r.defaults={name:"Animation",duration:.8,delay:0,ease:"easeOutCubic",opacity:1,x:0,y:0,z:0,rotationX:0,rotationY:0,rotationZ:0,scaleX:1,scaleY:1,scaleZ:1,skewX:0,n2blur:0},r.prototype.getBar=function(){return this.bar},r.prototype.click=function(t){t.stopPropagation(),this.animations.showEdit(t,this.group)},r.prototype.onBarResizeStop=function(t,e){this.animations._startHistory();var n=i.layerAnimationManager.offsetXToDuration(e.position[nextend.rtl.marginLeft]),r=i.layerAnimationManager.offsetXToDuration(e.size.width);this.renderDelay(n),this.renderDuration(r),this.setDelay(n),this.setDuration(r),this.fixTimelineTotalDuration(),this.animations._endHistory()},r.prototype.onBarDragStop=function(t,e){this.animations._startHistory();var n=i.layerAnimationManager.offsetXToDuration(e.position[nextend.rtl.marginLeft]);if(this.renderDelay(n),this.setDelay(n),s)for(var r=n-e.originalPosition.delay,o=0;o<s.length;o++)s[o].animations.shiftEndMultiSelect(r);this.fixTimelineTotalDuration(),this.animations._endHistory()},r.prototype.animationChanged=function(){this.bar.css(nextend.rtl.marginLeft,i.layerAnimationManager.durationToOffsetX(this.data.delay)).css({width:i.layerAnimationManager.durationToOffsetX(this.data.duration)}),this.renderDelay(this.data.delay),this.renderDuration(this.data.duration),this.fixTimelineTotalDuration()},r.prototype.updateDelayUI=function(t){t=Math.max(t,0),this.bar.css(nextend.rtl.marginLeft,i.layerAnimationManager.durationToOffsetX(t)),this.renderDelay(t)},r.prototype.setDelay=function(t){this.data.delay=t,this.animations.layer.updateAnimations()},r.prototype.renderDelay=function(t){.15>t?this.delay.css("display","none"):this.delay.css("display","inline").html(Math.round(t*i.layerAnimationManager.oneSecMs))},r.prototype.getDelay=function(){return this.data.delay},r.prototype.setDuration=function(t){this.data.duration=t,this.animations.layer.updateAnimations()},r.prototype.renderDuration=function(t){this.duration.html(Math.round(t*i.layerAnimationManager.oneSecMs))},r.prototype.animationMoved=function(t,e,i,n,r){this.group!=n&&console.error("Unable to change the animation group");var s=this.animations[this.group];this.bar.detach().removeClass("n2-ss-layer-animation-"+e).addClass("n2-ss-layer-animation-"+n),"out"==n&&"in"==this.group&&(r+=s.find(".n2-ss-layer-animation-in").length),0==r?this.bar.prependTo(s):this.bar.insertAfter(s.children().eq(r-1)),"in"==this.group&&this.animations.specialZeroInChanged(),this.fixTimelineTotalDuration()},r.prototype.animationDeleted=function(){this.bar.remove(),this.$.off("animationChanged animationMoved animationDeleted")},r.prototype.fixTimelineTotalDuration=function(){this.animations.fixTimelineTotalDuration(this.group)},r}),N2Require("TimelineAnimationLoop",[],[],function(t,e,i){"use strict";function n(i,n,r){this.group="loop",this.$=t(this),this.animations=i,this.loopDummy=r,this.data=t.extend({},e.TimelineAnimationAbstract.defaults,n),this.$.on({animationChanged:t.proxy(this.loopDummy.refresh,this.loopDummy),animationMoved:t.proxy(this.animationMoved,this),animationDeleted:t.proxy(this.loopDummy.remove,this.loopDummy,this)})}return n.prototype.animationMoved=function(t,e,i,n,r){this.loopDummy.animationMoved(i,r)},n.prototype.getOptimizedData=function(){return nextend.deepDiff.map(t.extend({},this.data),e.TimelineAnimationAbstract.defaults)},n.prototype["delete"]=function(){this.animations.removeAnimation(this),this.loopDummy.remove(),this.$.trigger("animationDeleted")},n.prototype.save=function(t){t!==!1&&(this.data=t,this.$.trigger("animationChanged"))},n}),N2Require("TimelineAnimationLoopDummy",["TimelineAnimationAbstract"],["smartSlider"],function(t,e,i,n){"use strict";function r(i){this.resizable=!1,this.group="loop",this.data={duration:0,delay:0},this.loops=[],this.$=t(""),e.TimelineAnimationAbstract.prototype.constructor.call(this,i,null,"loop")}return r.prototype=Object.create(e.TimelineAnimationAbstract.prototype),r.prototype.constructor=r,r.prototype.setDelay=function(t){this.animations.data.repeatStartDelay=t},r.prototype.getDelay=function(){return this.animations.data.repeatStartDelay},r.prototype.setDuration=function(t){},r.prototype.add=function(t){this.loops.push(t),this.bar.appendTo(this.animations[this.group]),this.refresh()},r.prototype.remove=function(e){var i=t.inArray(e,this.loops);this.loops.splice(i,1),this.refresh()},r.prototype.refresh=function(){if(0==this.loops.length)return void this.bar.detach();var t=0,e=0,i=this.loops.length;if(1==i){var n=this.loops[0].data;e=360!=n.rotationX&&360!=n.rotationY&&360!=n.rotationZ||1!=n.opacity||0!=n.x||0!=n.y||0!=n.z||1!=n.scaleX||1!=n.scaleY||1!=n.scaleZ||0!=n.skewX||0!=n.n2blur?2*(n.duration+n.delay):n.duration+n.delay}else{t=this.loops[this.loops.length-1].data.duration;for(var r=0;i>r;r++){var s=this.loops[r].data;e+=s.duration+s.delay}}var o=this.animations.data;0!=o.repeatCount&&(e*=o.repeatCount),this.data.duration=e+t,this.data.delay=o.repeatStartDelay,this.animationChanged()},r.prototype.animationMoved=function(t,e){var i=this.loops[t];this.loops.splice(t,1),this.loops.splice(e,0,i),this.refresh()},r.prototype.renderDuration=function(t){var e;e=0==this.animations.data.repeatCount?n2_("LOOP"):Math.round(t*i.layerAnimationManager.oneSecMs),this.duration.html(e)},r}),N2Require("LayerAnimationManager",[],["smartSlider"],function(t,e,i,n){"use strict";function r(n){this.canvasManager=n,this.oneSecWidth=200,this.oneSecMs=1e3,this.fps=20,this.pxToFrame=this.oneSecWidth/this.fps,i.layerAnimationManager=this,this.element=t("#n2-ss-layers-table"),this.element.on({enterPreviewMode:t.proxy(this.onEnterPreview,this),exitPreviewMode:t.proxy(this.onExitPreview,this)}),this.scrollable=this.element.find(".n2-ss-timeline-content-scrollable"),this.contentContainer=t('<div class="n2-ss-timeline-content-layers-container"></div>').appendTo(this.scrollable),this.initTimeFrame(),this.initCurrentTimeIndicator(),this.timelineControl=new e.TimelineControl(this),this.makeScrollable(),this.addContextMenu(),this.layerWindowEditor=new e.LayerWindowAnimationEditor(this)}return r.prototype.durationToOffsetX=function(t){return t*this.oneSecWidth},r.prototype.offsetXToDuration=function(t){return t/this.oneSecWidth},r.prototype.normalizeOffsetX=function(t){return Math.round(t/this.pxToFrame)*this.pxToFrame},r.prototype.getActiveLayer=function(){return this.canvasManager.mainContainer.getSelectedLayer()},r.prototype.clear=function(t,e){e&&e.preventDefault(),this.getActiveLayer().animations.clear(t)},r.prototype.storeNewAnimation=function(e,i,n){if(n.animations.length>0){var r=this.getActiveLayer().animation;r.setTransformOrigin(e,n.transformOrigin),r.setRepeatable(n.repeatable),"in"==e?(r.setSpecialZero(e,n.specialZero),r.setEvent(e,"PlayEvent",n.playEvent)):"loop"==e?(r.setRepeatCount(e,n.repeatCount),r.setRepeatStartDelay(e,n.repeatStartDelay),r.setEvent(e,"PlayEvent",n.playEvent),r.setEvent(e,"PauseEvent",n.pauseEvent),r.setEvent(e,"StopEvent",n.stopEvent),r.setRepeatSelfOnly(e,n.repeatSelfOnly)):"out"==e&&(r.setEvent(e,"PlayEvent",n.playEvent),r.setInstantOut(n.instantOut));for(var s=0;s<n.animations.length;s++)r.addAnimation(e,n.animations[s]);t(window).triggerHandler("AnimationAdded")}},r.prototype.initTimeFrame=function(){this.timeMarker=this.element.find(".n2-ss-timeline-content-timeframe").on("mousedown",t.proxy(function(e){var i=this.offsetXToDuration(e.pageX-t(e.currentTarget).offset().left-21);this.disablePreviewModeWidthCTI(i)||this.setCTI(i),this.slideCTI.trigger(e),t(document).one("mouseup",t.proxy(function(t){this.timelineControl.unHold(),this.slideCTI.trigger(t)},this))},this)),this._extendTimeFrame(0)},r.prototype.refreshDuration=NextendDeBounce(function(){this._extendTimeFrame(this.getMinimumSlideDuration())},200),r.prototype._extendTimeFrame=function(e){e=Math.floor(e)+1;var i=this.timeMarker.find(".n2-time-marker"),n=i.length;for(10>e&&(e=10),n>e&&(i.slice(e).remove(),n=e);e>=n;n++)t('<div class="n2-time-marker n2-h5">'+n+"s</div>").appendTo(this.timeMarker);this.scrollable.css("width",n*this.oneSecWidth+21),nextend.triggerResize()},r.prototype.getMinimumSlideDuration=function(){for(var t=this.canvasManager.mainContainer.container.getAllLayers(),e=0,i=0;i<t.length;i++)this.canvasManager.isLayer(t[i])&&(e=Math.max(e,t[i].animations.getTotalDuration()));return e},r.prototype.initCurrentTimeIndicator=function(){this.slideCTI=t('<div class="n2-ss-timeline-cti"></div>').append('<div class="n2-ss-timeline-cti-dot"></div>').appendTo(this.scrollable).draggable({axis:"x",cursor:"ew-resize",start:t.proxy(function(t,e){this.timelineControl.enterPreviewMode(),this.timelineControl.pause(),this.slideDurationPx=this.timelineControl.timeline.totalDuration()*this.oneSecWidth},this),drag:t.proxy(function(t,e){e.position.left=Math.max(e.position.left,-.05*this.oneSecWidth),e.position.left=Math.min(e.position.left,this.slideDurationPx),this.setCTI(this.offsetXToDuration(e.position.left))},this),stop:t.proxy(function(t,e){this.timelineControl.unHold(),this.disablePreviewModeWidthCTI(this.offsetXToDuration(e.position.left)),delete this.slideDurationPx},this)})},r.prototype.disablePreviewModeWidthCTI=function(t){return null==t||0>t?this.timelineControl.exitPreviewMode():!1},r.prototype.setCTI=function(t){this.timelineControl.setPosition(Math.max(0,t)),this.timelineControl.hold()},r.prototype.onEnterPreview=function(){},r.prototype.onExitPreview=function(){this.slideCTI.css(nextend.rtl.left,-10)},r.prototype.makeScrollable=function(){var e=t(".n2-ss-timeline-content");this.tinyscrollbar=e.tinyscrollbar({axis:"x",wheel:!1,wheelLock:!1}).data("plugin_tinyscrollbar"),"function"==typeof e.get(0).move&&(e.get(0).move=null)},r.prototype.appendRow=function(t,e){t.group.isMainGroup?this.contentContainer.append(e):t.group.animations.contentArea.append(e)},r.prototype.addContextMenu=function(){t("#n2-ss-layer-list").nextendContextMenu({selector:".n2-ss-layerlist-row",onShow:t.proxy(function(e,i){e.stopPropagation();var n=t(e.currentTarget).data("layer");n.animations.hasAnimation()&&i.addItem("Copy animation","n2-i-copy",t.proxy(function(){t.jStorage.set("layerAnimationCopied",JSON.stringify(n.animations.getData()))},this));var r=t.jStorage.get("layerAnimationCopied");null!==r&&i.addItem("Paste animation","n2-i-paste",t.proxy(function(){n.animations.loadData(JSON.parse(r))},this))},this)})},r}),N2Require("LayerAnimations",[],["smartSlider"],function(t,e,i,n){"use strict";function r(e){this._loaded=!1,this.active=!1,this.layer=e,this.data=null,this.ins=[],this.loops=[],this.outs=[],e.animations=this,this.sidebar=e.layerRow,this.contentArea=this.content=t('<div class="n2-ss-timeline-content-layers"></div>').on({mouseenter:t.proxy(function(){this.layer.canvasManager.highlight(this.layer)},this),mouseleave:t.proxy(function(){this.layer.canvasManager.deHighlight(this.layer)},this),click:t.proxy(function(t){this.layer.activate()},this)}),e.container!=n&&(this.contentArea=t('<div class="n2-ss-timeline-content-layers-area"></div>').append(this.contentArea),this.containerArea=t('<div class="n2-ss-timeline-content-layers-container2"></div>').appendTo(this.contentArea)),this.layer.layer.on({"n2-ss-activate":t.proxy(function(){this.content.addClass("n2-active")},this),"n2-ss-deactivate":t.proxy(function(){this.content.removeClass("n2-active")},this),opened:t.proxy(function(){this.contentArea.removeClass("n2-ss-group-closed")},this),closed:t.proxy(function(){this.contentArea.addClass("n2-ss-group-closed")},this)}),this["in"]=t("<div></div>").appendTo(this.content),this.loop=t("<div></div>").appendTo(this.content),this.out=t("<div></div>").appendTo(this.content),t('<div data-n2tip="'+n2_("Add animation")+'" class="n2-ss-animation-action n2-button n2-button-icon n2-button-m n2-button-m-narrow n2-radius-s"><i class="n2-i n2-i-animation"></i></div>').on("click",t.proxy(function(i){e!=this.layer.canvasManager.mainContainer.getSelectedLayer()?e.activate(i):e.showEditor(i),t('[data-tab="animations"]').trigger("click")},this)).appendTo(this.layer.layerRow.find(".n2-actions")),t('<div data-n2tip="'+n2_("Remove animations")+'" class="n2-ss-animation-clear-action n2-button n2-button-icon n2-button-m n2-button-m-narrow n2-radius-s"><i class="n2-i n2-i-clearanimation"></i></div>').on("click",t.proxy(function(t){this.layer.animations.clearAll()},this)).appendTo(this.layer.layerRow.find(".n2-actions")),nextend.tooltip.add(this.layer.layerRow),e.$.on({"layerDeleted.animations":t.proxy(this.deleted,this)}),this.initExtraAnimation(),e.layer.triggerHandler("timelineLoadedForLayer"),this.getTargetTimelineContainer().append(this.contentArea)}var s={repeatable:0,"in":[],specialZeroIn:0,transformOriginIn:"50|*|50|*|0",inPlayEvent:"",loop:[],repeatCount:0,repeatStartDelay:0,transformOriginLoop:"50|*|50|*|0",loopPlayEvent:"",loopPauseEvent:"",loopStopEvent:"",out:[],transformOriginOut:"50|*|50|*|0",outPlayEvent:"",instantOut:1};return r.prototype.deleted=function(){this.contentArea.remove(),this.layer.$.off(".animations")},r.prototype.syncRow=function(t,e){t!==n?this.contentArea.insertBefore(t.animations.contentArea):this.getTargetTimelineContainer().append(this.contentArea)},r.prototype.getTargetTimelineContainer=function(){return this.layer.group.isMainGroup?i.layerAnimationManager.contentContainer:this.layer.group.animations.containerArea},r.prototype.activate=function(){},r.prototype.initExtraAnimation=function(){var e=this.layer;this.extraAnimationBar=null,e.layer.on({layerExtraAnimationAdded:t.proxy(function(n,r,s,o,a){this.extraAnimationBar?this.extraAnimationBar.css("left",i.layerAnimationManager.durationToOffsetX(r)):this.extraAnimationBar=t('<div class="n2-ss-layer-extra-animation n2-ss-layer-extra-animation-'+s+'"><span class="n2-ss-animation-duration n2-h5">'+s+"</span></div>").css("left",i.layerAnimationManager.durationToOffsetX(r)).appendTo(this.content).draggable({scroll:!0,axis:"x",drag:function(t,e){e.position.left=Math.max(0,i.layerAnimationManager.normalizeOffsetX(e.position.left))},stop:function(t,n){e.activate(),o(i.layerAnimationManager.offsetXToDuration(n.position.left))}}).on("click",function(){e.activate(),a()})},this),layerExtraAnimationRemoved:t.proxy(function(){this.extraAnimationBar&&(this.extraAnimationBar.remove(),this.extraAnimationBar=null)},this)})},r.prototype.addAnimation=function(t,i){var n,r;"loop"==t?(this.loopDummy||(this.loopDummy=new e.TimelineAnimationLoopDummy(this)),r=this.loopDummy.getBar(),n=new e.TimelineAnimationLoop(this,i,this.loopDummy),this.loopDummy.add(n)):(n=new e.TimelineAnimation(this,i,t),r=n.getBar()),this[t].append(r),this[t+"s"].push(n),"in"==t&&this.specialZeroInChanged(),this.fixTimelineTotalDuration()},r.prototype.removeAnimation=function(e){var i=e.group,n=t.inArray(e,this[i+"s"]);-1!=n&&this[i+"s"].splice(n,1)},r.prototype.clearAll=function(){this._startHistory(),this._clear("in"),this._clear("loop"),this._clear("out"),this._endHistory(),this.layer.updateAnimations()},r.prototype.clear=function(t){this._startHistory(),this._clear(t),this._endHistory(),this.layer.updateAnimations()},r.prototype._clear=function(t){for(var e=this[t+"s"];e.length;)e[0]["delete"]()},r.prototype.getCurrentData=function(t){for(var e=[],i=0;i<this[t+"s"].length;i++)e.push(this[t+"s"][i].data);var n={animations:e,transformOrigin:this.data["transformOrigin"+this.ucfirst(t)],repeatable:this.data.repeatable};return"in"==t?(n.specialZero=this.data.specialZeroIn,n.playEvent=this.data.inPlayEvent):"loop"==t?(n.repeatCount=this.data.repeatCount,n.repeatStartDelay=this.data.repeatStartDelay,n.playEvent=this.data.loopPlayEvent,n.pauseEvent=this.data.loopPauseEvent,n.stopEvent=this.data.loopStopEvent):"out"==t&&(n.playEvent=this.data.outPlayEvent,n.instantOut=this.data.instantOut),n},r.prototype.getGroupAnimationData=function(t){for(var e=[],i=0;i<this[t+"s"].length;i++)e.push(this[t+"s"][i].data);var n={animations:e,transformOrigin:this.data["transformOrigin"+this.ucfirst(t)],repeatable:this.data.repeatable};return"in"==t&&(n.specialZero=this.data.specialZeroIn),n},r.prototype.showEdit=function(e,i){var n=this.layer;n!=n.canvasManager.mainContainer.getSelectedLayer()?n.activate(e):n.showEditor(e),t('[data-tab="animations"]').trigger("click"),t('[data-tab="animations-'+i+'"]').trigger("click")},r.prototype.edit=function(e,i){var n=nextend.animationManager;n.controller.setPreviewSize(this.layer.layer.width(),this.layer.layer.height()).setGroup(e);var r={repeatable:1},s=this.getGroupAnimationData(e);"in"==e?(r.specialZero=1,r.playEvent=1,s.playEvent=this.data.inPlayEvent,n.changeSetById(1e3),n.setTitle(n2_("In animation"))):"loop"==e?(r.repeat=1,s.repeatCount=this.data.repeatCount,s.repeatStartDelay=this.data.repeatStartDelay,r.playEvent=1,s.playEvent=this.data.loopPlayEvent,r.pauseEvent=1,s.pauseEvent=this.data.loopPauseEvent,r.stopEvent=1,s.stopEvent=this.data.loopStopEvent,r.repeatSelfOnly=1,s.repeatSelfOnly=this.data.loopRepeatSelfOnly,n.changeSetById(1200),n.setTitle(n2_("Loop animation"))):"out"==e&&(r.playEvent=1,r.instantOut=1,s.playEvent=this.data.outPlayEvent,s.instantOut=this.data.instantOut,n.changeSetById(1e3),n.setTitle(n2_("Out animation"))),n.show(r,s,t.proxy(this.storeAnimations,this,e,s),{previewMode:!1,previewHTML:!1}),i>0&&n.controller.tabField.options.eq(i).trigger("click")},r.prototype.storeAnimations=function(e,n,r,s){var o=i.history.addValue(this,this.historyStoreAnimations,[this.layer,e]);o&&o.setValues(t.extend(!0,{},n),t.extend(!0,{},s));var a=0,l=this[e+"s"];for(this.setTransformOrigin(e,s.transformOrigin),this.setRepeatable(s.repeatable),"in"==e?(this.setSpecialZero(e,s.specialZero),this.setEvent(e,"PlayEvent",s.playEvent)):"loop"==e?(this.setRepeatCount(e,s.repeatCount),this.setRepeatStartDelay(e,s.repeatStartDelay),this.setEvent(e,"PlayEvent",s.playEvent),this.setEvent(e,"PauseEvent",s.pauseEvent),this.setEvent(e,"StopEvent",s.stopEvent),this.setRepeatSelfOnly(e,s.repeatSelfOnly)):"out"==e&&(this.setEvent(e,"PlayEvent",s.playEvent),this.setInstantOut(s.instantOut));a<s.animations.length&&a<l.length;a++)l[a].save(s.animations[a]);for(;a<s.animations.length;a++)this.addAnimation(e,s.animations[a]);for(;a<l.length;a++)l[a]["delete"]();this.layer.updateAnimations()},r.prototype.load=function(){if(this._loaded===!1){var e=this.layer.layer.data("animations");this.data={},t.extend(this.data,s);try{"undefined"!=typeof e&&t.extend(this.data,t.parseJSON(Base64.decode(e)))}catch(i){}this._load("in"),this._load("loop"),this._load("out"),this._loaded=!0,this.layer.updateAnimations()}},r.prototype._load=function(t){if("undefined"!=typeof this.data[t]){for(var e=0;e<this.data[t].length;e++)this.addAnimation(t,this.data[t][e]);delete this.data[t]}},r.prototype.setAnimations=function(t,e){this._startHistory(),this._clear(t);for(var i=0;i<e.animations.length;i++)this.addAnimation(t,e.animations[i]);for(var n in e)"animations"!=n&&(this.data[n]=e[n]);this._endHistory(),this.layer.updateAnimations()},r.prototype.setData=function(t){for(var e in t)"animations"!=e&&(this.data[e]=t[e]);this.layer.updateAnimations()},r.prototype.getAnimationsCode=function(){if(this._loaded===!1)return this.layer.layer.data("animations");for(var e=t.extend({},this.data,{"in":[],loop:[],out:[]}),i=0;i<this.ins.length;i++){var n=this.ins[i];e["in"].push(n.getOptimizedData())}for(var i=0;i<this.loops.length;i++){var n=this.loops[i];e.loop.push(n.getOptimizedData())}for(var i=0;i<this.outs.length;i++){var n=this.outs[i];e.out.push(n.getOptimizedData())}var r=nextend.deepDiff.map(e,s);return t.isEmptyObject(r)?"":Base64.encode(JSON.stringify(r))},r.prototype.loadData=function(e){this._startHistory(),this._clear("in"),this._clear("loop"),this._clear("out"),this.data={},t.extend(this.data,s),t.extend(this.data,e),this._load("in"),this._load("loop"),this._load("out"),this._endHistory(),this.layer.updateAnimations()},r.prototype.getData=function(){for(var e=t.extend({},this.data,{"in":[],loop:[],out:[]}),i=0;i<this.ins.length;i++){var n=this.ins[i];e["in"].push(n.getOptimizedData())}for(var i=0;i<this.loops.length;i++){var n=this.loops[i];e.loop.push(n.getOptimizedData())}for(var i=0;i<this.outs.length;i++){var n=this.outs[i];e.out.push(n.getOptimizedData())}var r=nextend.deepDiff.map(e,s);return t.isEmptyObject(r)?"":r},r.prototype.setSpecialZero=function(t,e){e=parseInt(e)?1:0,e!=this.data["transformOrigin"+this.ucfirst(t)]&&(this.data.specialZeroIn=e,this.specialZeroInChanged())},r.prototype.setRepeatCount=function(t,e){this.data.repeatCount=e},r.prototype.setRepeatStartDelay=function(t,e){this.data.repeatStartDelay=e},r.prototype.setEvent=function(t,e,i){this.data[t+e]=i},r.prototype.setTransformOrigin=function(t,e){this.data["transformOrigin"+this.ucfirst(t)]=e},r.prototype.setRepeatable=function(t){this.data.repeatable=parseInt(t)?1:0},r.prototype.setRepeatSelfOnly=function(t,e){this.data[t+"RepeatSelfOnly"]=parseInt(e)},r.prototype.setInstantOut=function(t){this.data.instantOut=parseInt(t)?1:0},r.prototype.ucfirst=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},r.prototype.hasAnimation=function(){return!!(this.ins.length||this.loops.length||this.outs.length)},r.prototype.fixTimelineTotalDuration=function(){i.layerAnimationManager.refreshDuration()},r.prototype.getTotalDuration=function(){var t=this.content.find(".n2-ss-layer-animation:visible:last");if(0==t.length)return 0;var e=parseInt(t.position().left)+parseInt(t.css("marginLeft"))-20;return i.layerAnimationManager.offsetXToDuration(e+t.outerWidth())},r.prototype.specialZeroInChanged=function(){this.isLayerSpecialZeroIn()?this["in"].find(".n2-ss-layer-animation-in").css("display","").last().css("display","none"):(this["in"].find(".n2-ss-layer-animation-in").css("display",""),this.fixTimelineTotalDuration())},r.prototype.isLayerSpecialZeroIn=function(){return this.data.specialZeroIn},r.prototype.shiftStartMultiSelect=function(){this._currentlyShiftedAnimation=this.content.find(".n2-ss-layer-animation").data("animation"),this._currentlyShiftedAnimation?(this._currentlyShiftedAnimationDelay=this._currentlyShiftedAnimation.data.delay,this._startHistory()):this._currentlyShiftedAnimation=!1},r.prototype.shiftDragMultiSelect=function(t){this._currentlyShiftedAnimation&&this._currentlyShiftedAnimation.updateDelayUI(this._currentlyShiftedAnimationDelay+t)},r.prototype.shiftEndMultiSelect=function(t){this._currentlyShiftedAnimation&&(this._currentlyShiftedAnimation.updateDelayUI(this._currentlyShiftedAnimationDelay+t),this._currentlyShiftedAnimation.setDelay(this._currentlyShiftedAnimationDelay+t),this._endHistory(),delete this._currentlyShiftedAnimationDelay),delete this._currentlyShiftedAnimation},r.prototype._startHistory=function(){this._oldData={"in":t.extend(!0,{},this.getCurrentData("in")),loop:t.extend(!0,{},this.getCurrentData("loop")),out:t.extend(!0,{},this.getCurrentData("out"))}},r.prototype.getSelf=function(){return this},r.prototype._endHistory=function(){var e={"in":this.getCurrentData("in"),loop:this.getCurrentData("loop"),out:this.getCurrentData("out")};for(var n in e){var r=i.history.addValue(this,this.historyStoreAnimations,[this.layer,n]);r&&r.setValues(t.extend(!0,{},this._oldData[n]),t.extend(!0,{},e[n]))}this._oldData=null},r.prototype.historyStoreAnimations=function(e,i,n){i.getSelf().animations.storeAnimations(n,null,null,t.extend(!0,{},e))},r}),N2Require("LayerWindowAnimationEditor",[],["smartSlider"],function(t,e,i,n){"use strict";function r(e){this.insideUpdate=!1,this.timeline=null,this.animationManager=e,this.mainTab=n2("#n2-tabbed-slide-editor-settings").on("changetab",t.proxy(this.changeMainTab,this)).data("pane"),this.tab=t("#n2-tabbed-animations-tabbed").on("changetab",t.proxy(this.changeTab,this)).data("pane"),this.activeLayer=null,this.activeTimeline=-1,this.animationManager.canvasManager.$.on("activeLayerChanged",t.proxy(this.loadDataForLayer,this)),this.$heading=t('<div class="n2-editor-header n2-h2 n2-uc"><span></span><div class="n2-ss-button-container"></div></div>'),this.$headingName=this.$heading.find("span"),this.$headingButtonsLeft=t('<div class="n2-ss-button-container-left"></div>').appendTo(this.$heading),this.playButton=t('<a class="n2-button-single-animation-play n2-button n2-button-icon n2-button-s n2-radius-s n2-h5 n2-uc n2-button-grey n2-button-blue-active" href="#"><i class="n2-i n2-i-play"></i></a>').on("click",t.proxy(function(t){t.preventDefault(),this.toggleTimeline()},this)).appendTo(this.$headingButtonsLeft),this.$headingButtonsRight=this.$heading.find(".n2-ss-button-container"),t('<a class="n2-button n2-button-icon n2-button-s n2-radius-s n2-button-darker n2-h5 n2-uc" href="#"><i class="n2-i n2-i-delete"></i></a>').on("click",t.proxy(function(t){t.preventDefault(),this.activeLayer.animations.clear(s[this.tab._active])},this)).appendTo(this.$headingButtonsRight),this.$form=t("#n2-tab-animations-form").detach(),this.form={duration:{input:this.$form.find("#layer-anim-duration"),set:function(t){this.input.val(parseInt(1e3*t))},get:function(){return this.input.val()/1e3}},delay:{input:this.$form.find("#layer-anim-delay"),set:function(t){this.input.val(parseInt(1e3*t))},get:function(){return this.input.val()/1e3}},ease:{input:this.$form.find("#layer-anim-ease"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}},opacity:{input:this.$form.find("#layer-anim-opacity"),set:function(t){this.input.val(parseInt(100*t))},get:function(){return this.input.val()/100}},x:{input:this.$form.find("#layer-anim-x"),set:function(t){this.input.val(t)},get:function(){return this.input.val()}},y:{input:this.$form.find("#layer-anim-y"),set:function(t){this.input.val(t)},get:function(){return this.input.val()}},rotationX:{input:this.$form.find("#layer-anim-rotationX"),set:function(t){this.input.val(t)},get:function(){return this.input.val()}},rotationY:{input:this.$form.find("#layer-anim-rotationY"),set:function(t){this.input.val(t)},get:function(){return this.input.val()}},rotationZ:{input:this.$form.find("#layer-anim-rotationZ"),set:function(t){this.input.val(t)},get:function(){return this.input.val()}},scaleX:{input:this.$form.find("#layer-anim-scaleX"),set:function(t){this.input.val(parseInt(100*t))},get:function(){return this.input.val()/100}},scaleY:{input:this.$form.find("#layer-anim-scaleY"),set:function(t){this.input.val(parseInt(100*t))},get:function(){return this.input.val()/100}},n2blur:{input:this.$form.find("#layer-anim-n2blur"),set:function(t){this.input.val(t)},get:function(){return this.input.val()}}};for(var i in this.form)this.form[i].input.on("outsideChange.n2-editor",t.proxy(this.changeInlineField,this,i));this.globalForm={inPlayEvent:{input:t("#layerin-play-event"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}},outPlayEvent:{input:t("#layerout-play-event"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}},loopPlayEvent:{input:t("#layerloop-play-event"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}},loopPauseEvent:{input:t("#layerloop-pause-event"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}},loopStopEvent:{input:t("#layerloop-stop-event"),set:function(t){this.input.data("field").insideChange(t)},get:function(){return this.input.val()}}};var n=function(t,e){this.insideUpdate=!0;var i={};i[t]=this.globalForm[t].get(),this.activeLayer.animations.setData(i),this.insideUpdate=!1};for(var i in this.globalForm)this.globalForm[i].input.on("outsideChange.n2-editor",t.proxy(n,this,i))}var s={0:"in",1:"loop",2:"out"};return r.prototype.changeMainTab=function(){this.loadDataForLayer()},r.prototype.changeTab=function(){this.loadDataForLayer()},r.prototype.loadDataForLayer=function(){var t=!1;if("animations"==this.mainTab.headings.eq(this.mainTab._active).data("tab")){var e=this.animationManager.getActiveLayer();this.activeLayer!=e&&(this.activeLayer=e,t=!0),this.tab._active<3?(t||this.activeTimeline!=this.tab._active)&&this.updateCurrentTab():(t||this.activeTimeline!=this.tab._active)&&this.updateEventsTab()}},r.prototype.updateEventsTab=function(){var t=this.activeLayer.animations;for(var e in t.data)"undefined"!=typeof this.globalForm[e]&&this.globalForm[e].get()!=t.data[e]&&this.globalForm[e].set(t.data[e])},r.prototype.updateCurrentTab=function(){if(this.activeLayer&&!this.insideUpdate){var i=this.tab.contents[this.tab._active],n=s[this.tab._active],r=this.activeLayer.animations,o=r[s[this.tab._active]+"s"];if(this.updateEventsTab(),3!=this.tab._active){this.$heading.detach(),this.$form.detach(),i.empty();var a=t("<div />").appendTo(i);if(o.length>0){if(1==o.length){this.$headingName.html(o[0].data.name),a.append(this.$heading);var l=o[0].data;for(var h in this.form)this.form[h].get()!=l[h]&&this.form[h].set(l[h]);a.append(this.$form),t('<div class="n2-ss-small-more n2-button n2-button-normal n2-button-s n2-button-grey n2-radius-s n2-h5 n2-uc">'+n2_("More")+"</div>").on("click",t.proxy(function(){r.edit(n,0)},this)).appendTo(a)}else this.$headingName.html(n2_("Animation chain")),a.append(this.$heading),t('<div class="n2-button n2-button-normal n2-button-wide n2-button-l n2-button-green n2-radius-s n2-h4 n2-uc">'+n2_("Edit")+"</div>").on("click",t.proxy(function(){r.edit(n,0)},this)).appendTo(a);this._play=t.proxy(function(i,s){this.destroyTimeline(),this.playButton.addClass("n2-active"),t("body").addClass("n2-ss-animation-play-single");var o=this.activeLayer.layer,a=o.data("animatableselector");a&&(o=o.find(a)),this.timeline=new e.EditorAnimationsTimeline(this,o,n,r.getGroupAnimationData(n))},this),this.$heading.off("singlepreview").on({"mouseleave.singlepreview":t.proxy(this.destroyTimeline,this)})}else{var d=t('<ul class="n2-list"></ul>'),p=1e3;"loop"==n&&(p=1200),t.when(nextend.animationManager.sets[p]._loadVisuals()).done(t.proxy(function(){var i=nextend.animationManager.sets[p].visuals;for(var s in i)var o=t("<li></li>").on({mouseenter:t.proxy(function(i,r){this.destroyTimeline(),t("body").addClass("n2-ss-animation-play-single");var s=this.activeLayer.layer,o=s.data("animatableselector");o&&(s=s.find(o)),this.timeline=new e.EditorAnimationsTimeline(this,s,n,i.value)},this,i[s]),mouseleave:t.proxy(this.destroyTimeline,this)}).append(t('<a href="">'+i[s].name+"</a>").on({
click:t.proxy(function(e,i){i.preventDefault(),this.destroyTimeline(),r.setAnimations(n,t.extend(!0,{},e.value))},this,i[s])})).appendTo(d);d.appendTo(a)},this))}}}},r.prototype.toggleTimeline=function(){this.timeline?this.destroyTimeline():this._play()},r.prototype._play=function(){},r.prototype.destroyTimeline=function(){this.timeline&&(t("body").removeClass("n2-ss-animation-play-single"),this.timeline.destroy()),this.timeline=null,this.playButton.removeClass("n2-active")},r.prototype.update=function(t){t==this.activeLayer&&this.updateCurrentTab()},r.prototype.changeInlineField=function(i,n){this.insideUpdate=!0;var r=s[this.tab._active],o=this.activeLayer.animations,a=t.extend(!0,{},o.getGroupAnimationData(r));a.animations[0][i]=this.form[i].get(),o.setAnimations(r,t.extend(!0,{},a)),this.insideUpdate=!1,this.destroyTimeline(),t("body").addClass("n2-ss-animation-play-single");var l=this.activeLayer.layer,h=l.data("animatableselector");h&&(l=l.find(h)),this.timeline=new e.EditorAnimationsTimeline(this,l,r,a,!0)},r}),N2Require("EditorAnimationsTimeline",[],["smartSlider"],function(t,e,i,n){"use strict";function r(t,e,n,r,s){this.parent=t,this.playOnce=s||!1,this.timeline=null,this.preview=e,this.group=n,this.currentVisual=r.animations,this.transformOrigin=r.transformOrigin||"0|*|0|*|0",this.specialZero=r.specialZero||0,this.horizontalRatio=i.frontend.responsive.lastRatios.slideW,this.verticalRatio=i.frontend.responsive.lastRatios.slideH,this.createTimeline()}var s={opacity:1,x:0,y:0,z:0,rotationX:0,rotationY:0,rotationZ:0,scaleX:1,scaleY:1,scaleZ:1,skewX:0,n2blur:0};return r.prototype.createTimeline=function(){this.timeline&&this.timeline.pause(0),this.timeline=new NextendTimeline({paused:1}),this.timeline.eventCallback("onComplete",t.proxy(function(){this.playOnce?this.parent.destroyTimeline():this.timeline.play(0,!1)},this)),this.timeline.set(this.preview.get(0),{transformOrigin:this.transformOrigin.split("|*|").join("% ")+"px"},0);var e=[];t.extend(!0,e,this.currentVisual);for(var i=0;i<e.length;i++)e[i]=t.extend({name:"Animation",duration:.8,delay:0,ease:"easeOutCubic",opacity:1,x:0,y:0,z:0,rotationX:0,rotationY:0,rotationZ:0,scaleX:1,scaleY:1,scaleZ:1,skewX:0,n2blur:0},e[i]),e[i].delay>.5&&(e[i].delay=.5);switch(this.group){case"in":this.buildTimelineIn(this.timeline,this.preview.get(0),e,this.horizontalRatio,this.verticalRatio);break;case"loop":this.buildTimelineLoop(this.timeline,this.preview.get(0),e,this.horizontalRatio,this.verticalRatio);break;case"out":this.buildTimelineOut(this.timeline,this.preview.get(0),e,this.horizontalRatio,this.verticalRatio);break;default:console.log(this.group+" animation is not supported!")}this.timeline.totalDuration()>0&&this.timeline.play()},r.prototype.destroy=function(){this.timeline&&(this.timeline.pause(),this.repeatTimeout&&clearTimeout(this.repeatTimeout),this.timeline.progress(1,!0),NextendTween.set(this.preview.get(0),{opacity:1,x:0,y:0,z:0,rotationX:0,rotationY:0,rotationZ:0,scaleX:1,scaleY:1,scaleZ:1,skewX:0,n2blur:0})),this.timeline=null},r.prototype.setCurrentZero=function(e){NextendTween.set(e,t.extend({},this.currentZero))},r.prototype.buildTimelineIn=function(t,e,i,n,r){this.currentZero=s,"in"==this.group&&("solo"!=this.currentPreviewMode||this.currentTabIndex==this.currentVisual.length-1)&&this.specialZero&&i.length>0&&(this.currentZero=i.pop(),delete this.currentZero.name,this.currentZero.x=this.currentZero.x*n,this.currentZero.y=this.currentZero.y*r,this.currentZero.rotationX=-this.currentZero.rotationX,this.currentZero.rotationY=-this.currentZero.rotationY,this.currentZero.rotationZ=-this.currentZero.rotationZ,this.setCurrentZero(e));var o=0,a=this._buildAnimationChainIn(i,n,r,this.currentZero),l=0;if(a.length>0)for(t.fromTo(e,a[l].duration,a[l].from,a[l].to,o),o+=a[l].duration+a[l].to.delay,l++;l<a.length;l++)t.to(e,a[l].duration,a[l].to,o),o+=a[l].duration+a[l].to.delay},r.prototype._buildAnimationChainIn=function(e,i,n,r){for(var s=[{from:r}],o=e.length-1;o>=0;o--){var a=e[o],l=a.delay,h=a.duration,d=a.ease;delete a.delay,delete a.duration,delete a.ease,delete a.name;var p=s[0].from;a.x=-a.x*i,a.y=-a.y*n,a.rotationX=-a.rotationX,a.rotationY=-a.rotationY,a.rotationZ=-a.rotationZ,s.unshift({duration:h,from:a,to:t.extend({},p,{ease:d,delay:l})})}return s.pop(),s},r.prototype.buildTimelineLoop=function(t,e,i,n,r){var s=this._buildAnimationChainLoop(i,n,r),o=0;if(s.length>0)for(t.fromTo(e,s[o].duration,s[o].from,s[o].to),o++;o<s.length;o++)t.to(e,s[o].duration,s[o].to)},r.prototype._buildAnimationChainLoop=function(e,i,n){if(delete e[0].name,1==e.length){var r=e[0],o=t.extend({},s);if(o.duration=r.duration,o.ease=r.ease,(360==r.rotationX||360==r.rotationY||360==r.rotationZ)&&1==r.opacity&&0==r.x&&0==r.y&&0==r.z&&1==r.scaleX&&1==r.scaleY&&1==r.scaleZ&&0==r.skewX&&0==r.n2blur)return[{duration:e[0].duration,from:t.extend({},s),to:e[0]}];e.unshift(o)}var a=0,l=[{duration:e[a].duration,to:e[a]}];for(a++;a<e.length;a++){var o=e[a],h=o.duration;delete o.duration,delete o.name;var d=t.extend({},l[l.length-1].to);delete d.delay,delete d.ease,o.x=o.x*i,o.y=o.y*n,l.push({duration:h,from:d,to:o})}return l.push({duration:l[0].duration,from:t.extend({},l[l.length-1].to),to:t.extend({},l[0].to)}),l.shift(),l},r.prototype.buildTimelineOut=function(t,e,i,n,r){var s=0,o=this._buildAnimationChainOut(i,n,r),a=0;if(o.length>0)for(t.fromTo(e,o[a].duration,o[a].from,o[a].to,s),s+=o[a].duration+o[a].to.delay,a++;a<o.length;a++)t.to(e,o[a].duration,o[a].to,s),s+=o[a].duration+o[a].to.delay},r.prototype._buildAnimationChainOut=function(e,i,n){for(var r=[{to:s}],o=0;o<e.length;o++){var a=e[o],l=a.duration;delete a.duration,delete a.name;var h=t.extend({},r[r.length-1].to);delete h.delay,delete h.ease,a.x=a.x*i,a.y=a.y*n,r.push({duration:l,from:h,to:a})}return r.shift(),r},r}),N2Require("TimelineControl",[],["smartSlider"],function(t,e,i,n){"use strict";function r(e){this.timelineVisible=!0,this.status=0,this.layerAnimationManager=e,this.canvasManager=e.canvasManager;t(".n2-ss-layer-list-topbar-control");this.$overlay=t('<div style="position: fixed; width:100%; height:100%;left:0;top:0;z-index:9999;display:none;"></div>').on("click",t.proxy(function(t){this.exitPreviewMode()},this)).appendTo("body"),this.$playButton=t(".n2-play").on({mousedown:t.proxy(this.onPlayButton,this),click:function(t){t.preventDefault()}}),t(window).on("keydown",t.proxy(function(t){"INPUT"!=t.target.tagName&&"TEXTAREA"!=t.target.tagName&&(0==t.keyCode||32==t.keyCode?this.onPlayButton(t):27==t.keyCode&&this.onStopButton(t))},this)),t(".n2-ss-timeline-content-layers-container, .n2-ss-timeline-duration-marker, .n2-ss-layer-list-opener").on("mousedown",t.proxy(this.exitPreviewMode,this,!1))}var s={DISABLED:0,PAUSED:1,HOLD_PAUSED:2,PLAYING:3,HOLD_PLAYING:4};return r.prototype.isActivated=function(){return this.status!=s.DISABLED},r.prototype.onStopButton=function(t){t.preventDefault(),t.stopPropagation(),this.status!=s.DISABLED&&this.exitPreviewMode()},r.prototype.onPlayButton=function(t){switch(t.preventDefault(),this.status){case s.DISABLED:this.enterPreviewMode();case s.PAUSED:this.play();break;case s.PLAYING:this.exitPreviewMode()}},r.prototype.enterPreviewMode=function(){if(this.status==s.DISABLED){this.$overlay.css("display","block"),t("body").addClass("n2-ss-preview-mode"),this.animations=this.canvasManager.mainContainer.createLayerAnimations(nextend.smartSlider.frontend.responsive.lastRatios.slideW,nextend.smartSlider.frontend.responsive.lastRatios.slideH),this.timeline=new NextendTimeline({paused:1});for(var e=0;e<this.animations.length;e++){var n=this.animations[e];this.timeline.add(n.linearTimeline,0),n.linearTimeline.paused(!1)}this.timeline.eventCallback("onComplete",t.proxy(function(){this.timeline.totalDuration()>0&&this.timeline.restart()},this));var r=this.timeline.totalDuration(),o={};o[nextend.rtl.left]=0;var a={ease:"linear"};a[nextend.rtl.left]=i.layerAnimationManager.durationToOffsetX(r),this.timeline.fromTo(this.layerAnimationManager.slideCTI,r,o,a,0),this.timeline.pause(0),this.$playButton.addClass("n2-button-blue"),this.layerAnimationManager.element.triggerHandler("enterPreviewMode"),this.status=s.PAUSED}},r.prototype.exitPreviewMode=function(e){if(this.status!=s.DISABLED){e&&(e.preventDefault(),e.stopPropagation()),this.$overlay.css("display","none"),this.status==s.PLAYING&&this.pause();for(var i=0;i<this.animations.length;i++)this.animations[i].setZero();return this.timeline.kill(),t("body").removeClass("n2-ss-preview-mode"),this.$playButton.removeClass("n2-button-blue"),this.layerAnimationManager.element.triggerHandler("exitPreviewMode"),this.status=s.DISABLED,!0}return!1},r.prototype.play=function(){return this.status==s.PAUSED?(this.status=s.PLAYING,this.$playButton.addClass("n2-active"),this.timeline.play(),!0):!1},r.prototype.pause=function(){return this.status==s.PLAYING?(this.status=s.PAUSED,this.$playButton.removeClass("n2-active"),this.timeline.pause(),!0):!1},r.prototype.hold=function(){this.status==s.PAUSED?this.status=s.HOLD_PAUSED:this.status==s.PLAYING&&(this.status=s.HOLD_PLAYING,this.timeline.pause())},r.prototype.unHold=function(){this.status==s.HOLD_PAUSED?this.status=s.PAUSED:this.status==s.HOLD_PLAYING&&(this.status=s.PLAYING,this.timeline.play())},r.prototype.setPosition=function(t){this.enterPreviewMode(),this.timeline.seek(t)},r});