/* skel-layers.js v2.0.0 | (c) n33 | getskel.com | MIT licensed */
(function(e){typeof define=="function"&&define.amd?define(["jquery","skel"],e):e(jQuery,skel)})(function(e,t){var n="config",r="cache",i="_skel_layers_translateOrigin",s="setTimeout",o="_skel_layers_resetForms",u="trigger",f="_skel_layers_translate",l="visibleWrapper",c="_skel_layers_promote",h="position",p="_skel_layers_demote",d="$element",v="moveToVisibleWrapper",m="moveToHiddenWrapper",g="_skel_layers_resume",y="exclusiveLayer",b="exclusive",w="_skel_layers_cssNumericValue",E="center",S="css",x="right",T="bottom",N="prototype",C=null,k="_skel_layers_init",L="width",A="_skel_layers_suspend",O="left",M="_skel_layers_doTranslate",_="overflow-x",D="layers",P="speed",H="wrapper",B="hidestart",j="showstart",F="skel-layers-layer-z-index",I="transform",q="children",R="skel-layers-moved",U="hiddenWrapper",z="scrollTop",W="parent",X="length",V="hideend",$="showend",J="auto",K=!1,Q=".skel-layers-fixed:not(.skel-layers-moved)",G="deviceType",Y="unlockView",Z="height",et="resetForms",tt="top",nt="touchstart.lock click.lock scroll.lock",rt="_height",it="element",st="hidden",ot='
1){for(t=0;t
0&&(t[Pt](),t[S](L,(t.data(gn)+r)/12*100+"%"))},e.fn[Zt]=function(){return e(this).parents()[X]>0},e.fn[Pt]=function(){var t=e(this);t[Gt]("class").match(/(\s+|^)([0-9]+)u(\s+|$)/)&&t.data(gn,parseInt(RegExp.$2))},e.fn[c]=function(t){var r,i,s;if(this[X]>1){for(r=0;r-1*f&&n>l;break;case x:a=s-1*f&&n<-1*l;break;case tt:a=n-1*f&&s>l;break;case T:a=n-1*f&&s<-1*l}if(a)return i[Wt]=C,i[Vt]=C,i[$t](),K}if(r[z]()==0&&s<0||u>o-2&&u0)return K}),this[d]=r},Zn[N][Et]=function(){return this[d]!==C},Zn[N][Cn]=function(){return this[d].is(":visible")},Zn[N][v]=function(){Yn[r][l][Dt](this[d])},Zn[N][m]=function(){if(!this[d][Zt]())return;Yn[r][U][Dt](this[d])},Zn[N].resume=function(t){if(!this[Et]())return;this[d][Bt](Mn).each(function(){Yn.parseResume(e(this))}),this[n][st]||this[cn](t)},Zn[N].suspend=function(){if(!this[Et]())return;this[d][i](),this[d][Bt](Mn).each(function(){Yn.parseSuspend(e(this))}),this[rn]&&this[$t]()},Yn={cache:{visibleWrapper:C,body:C,exclusiveLayer:C,document:C,html:C,htmlbody:C,hiddenWrapper:C,layers:{},parent:C,window:C,wrapper:C},config:{baseZIndex:1e4,layers:{},mode:h,speed:500,easing:"ease",wrap:lt},eventType:"click touchend",layerIndex:1,create:function(t,i,s){var o,u;if(t in Yn[r][D])return;if(h in i){if(!i[jn]&&(o=e(Bn+t))[X]==0)return;return Yn[n].wrap||(Yn[n].wrap=lt,Yn.initWrappers()),u=new Zn(t,i,Yn.layerIndex++),Yn[r][D][t]=u,o&&(o[q]()[vn](u[it]),o.remove()),s||Yn._.updateState(),u}return},destroy:function(i){if(i in Yn[r][D]){var s=Yn[r][D][i];return s.suspend(),s[n][yn]&&s[n][yn]!=Yn._.sd&&(a=Yn._[mn](s[n][yn]),Yn._[ut](a,function(e){Yn._.removeCachedElementFromState(a[e],i)})),s[n][Xt]&&(a=Yn._[mn](s[n][Xt]),Yn._[ut](a,function(e){Yn._.removeCachedElementFromBreakpoint(a[e],i)})),e(s[it]).remove(),delete Yn[r][D][i],t.uncacheElement(i),lt}return},get:function(e){if(e in Yn[r][D])return Yn[r][D][e];return},hide:function(e){Yn[r][D][e][$t]()},show:function(e){Yn[r][D][e][cn]()},toggle:function(e){var t=Yn[r][D][e];t[Cn]()?t[$t]():t[cn]()},getBaseFontSize:function(){return Yn._.vars.IEVersion<9?16.5:parseFloat(getComputedStyle(Yn[r][Pn].get(0)).fontSize)},getHalf:function(e){var t=parseInt(e);return typeof e=="string"&&e.charAt(e[X]-1)=="%"?Math.floor(t/2)+"%":Math.floor(t/2)+xn},lockView:function(e){e==bn&&Yn[r][Hn][S](_,st),Yn[n][En]!=I&&t.vars[G]==pn&&Yn[r][W][S](Z,Yn[r].document[Z]()),Yn[r][H].on(nt,function(e){e[Yt](),e[zt](),Yn[r][y]&&Yn[r][y][$t]()}),Yn[r][en].on(It,function(e){Yn[r][y]&&Yn[r][y][$t]()}),Yn._.vars.isMobile||window[s](function(){Yn[r][en].on(Ft,function(e){Yn[r][y]&&Yn[r][y][$t]()})},Yn[n][P]+50)},parseInit:function(t){var n,i,s=t.get(0),o=t[Gt]("data-action"),u=t[Gt]("data-args"),a,f;o&&u&&(u=u.split(","));switch(o){case"toggleLayer":case"layerToggle":t[S](yt,fn)[S]("cursor","pointer"),n=function(t){t[Yt](),t[zt]();if(Yn[r][y])return Yn[r][y][$t](),K;var n=e(this),i=Yn[r][D][u[0]];i[Cn]()?i[$t]():i[cn]()},t.on(Yn.eventType,n);break;case"navList":a=e(Bn+u[0]),n=a[Bt]("a"),i=[],n.each(function(){var t=e(this),n,r;n=Math.max(0,t.parents("li")[X]-1),r=t[Gt]("href"),i.push(''+t.text()+"")}),i[X]>0&&t[jn]("");break;case"copyText":a=e(Bn+u[0]),t[jn](a.text());break;case"copyHTML":a=e(Bn+u[0]),t[jn](a[jn]());break;case"moveElementContents":a=e(Bn+u[0]),s[g]=function(){a[q]().each(function(){var n=e(this);t[Dt](n),n[tn](R)})},s[A]=function(){t[q]().each(function(){var t=e(this);a[Dt](t),t[ln](R),Yn.refresh(t)})},s[g]();break;case"moveElement":a=e(Bn+u[0]),s[g]=function(){e(ot+a[Gt]("id")+'" />').insertBefore(a),t[Dt](a),a[tn](R)},s[A]=function(){e(Ot+a[Gt]("id")).replaceWith(a),a[ln](R),Yn.refresh(a)},s[g]();break;case"moveCell":a=e(Bn+u[0]),f=e(Bn+u[1]),s[g]=function(){e(ot+a[Gt]("id")+'" />').insertBefore(a),t[Dt](a),a[S](L,J),f&&f[Jt]()},s[A]=function(){e(Ot+a[Gt]("id")).replaceWith(a),a[S](L,""),f&&f[S](L,"")},s[g]();break;default:}},parseResume:function(e){var t=e.get(0);t[g]&&t[g]()},parseSuspend:function(e){var t=e.get(0);t[A]&&t[A]()},recalc:function(e,t){var n=Yn._.parseMeasurement(e),r;switch(n[1]){case"%":r=Math.floor(t*(n[0]/100));break;case"em":r=Yn.getBaseFontSize()*n[0];break;default:case xn:r=n[0]}return r},recalcH:function(t){return Yn.recalc(t,e(window)[Z]())},recalcW:function(t){return Yn.recalc(t,e(window)[L]())},refresh:function(t){var n;t?n=t.filter(Q):n=e(Q),n[k](lt)[vn](Yn[r][l])},unlockView:function(e){e==bn&&Yn[r][Hn][S](_,""),Yn[n][En]!=I&&t.vars[G]==pn&&Yn[r][W][S](Z,""),Yn[r][H].off(nt),Yn[r][en].off(It),Yn._.vars.isMobile||Yn[r][en].off(Ft)},init:function(){n in Yn[n]&&(Yn._.extend(Yn[n],Yn[n][n]),delete Yn[n][n]),Yn._[ut](Yn[n],function(e){Yn[n][e]&&typeof Yn[n][e]==hn&&h in Yn[n][e]&&(Yn[n][D][e]=Yn[n][e],delete Yn[n][e])}),typeof Yn[n][En]=="function"&&(Yn[n][En]=Yn[n][En]()),Yn[n][En]==I&&(!Yn._[Qt](I)||!Yn._[Qt](ft))&&(Yn[n][En]=h),Yn[n][En]==h&&!Yn._[Qt](ft)&&(Yn[n][En]=At),Yn._.vars[G]=="wp"&&(Yn[n][En]=At),Yn[r][en]=e(window),e(function(){Yn.initAnimation(),Yn.initObjects(),Yn[n].wrap&&Yn.initWrappers(),Yn.initLayers(),Yn.initIncludes(),Yn._.updateState()})},initIncludes:function(){e(".skel-layers-include").each(function(){Yn.parseInit(e(this))})},initLayers:function(){Yn._[ut](Yn[n][D],function(e){Yn.create(e,Yn[n][D][e],lt)})},initObjects:function(){Yn[r].document=e(document),Yn[r][jn]=e(jn),Yn[r][Pn]=e(Pn),Yn[r][Hn]=e("html,body")},initAnimation:function(){Yn[n][En]==At?(e.fn[ct]=function(t){e(this).fadeTo(Yn[n][P],1,t)},e.fn[at]=function(t){e(this).fadeTo(Yn[n][P],0,t)}):(e.fn[ct]=function(t){e(this)[S](on,1),t&&window[s](t,Yn[n][P]+50)},e.fn[at]=function(t){e(this)[S](on,0),t&&window[s](t,Yn[n][P]+50)});if(Yn[n][En]==I)e.fn[i]=function(){return e(this)[f](0,0)},e.fn[f]=function(t,n){return e(this)[S](I,"translate("+t+"px, "+n+"px)")},e.fn[k]=function(){return e(this)[S]("backface-visibility",st)[S]("perspective","500")[un](ft,"transform "+Yn[n][P]/1e3+dn+Yn[n][bt]+","+_n+Yn[n][P]/1e3+dn+Yn[n][bt])};else{var o=[];Yn[n][En]==At?(Yn[r][en].resize(function(){if(Yn[n][P]!=0){var e=Yn[n][P];Yn[n][P]=0,window[s](function(){Yn[n][P]=e,o=[]},0)}}),Yn[n][bt].substr(0,4)=="ease"?(Yn[n][bt]="swing",Yn[n][P]=Yn[n][P]*.65):Yn[n][bt]="linear",e.fn[M]=function(t,r){e(this)[At](t,Yn[n][P],Yn[n][bt],r)},e.fn[k]=function(t){return e(this)[S](h,t?Nn:sn)}):(Yn[r][en].resize(function(){window[s](function(){o=[]},0)}),e.fn[M]=function(t,r){var i=e(this);Yn._[ut](t,function(e){i[S](e,t[e])}),window[s](r,Yn[n][P])},e.fn[k]=function(t){return e(this)[S](ft,"top "+Yn[n][P]/1e3+dn+Yn[n][bt]+","+"right "+Yn[n][P]/1e3+dn+Yn[n][bt]+","+"bottom "+Yn[n][P]/1e3+dn+Yn[n][bt]+","+"left "+Yn[n][P]/1e3+dn+Yn[n][bt]+","+_n+Yn[n][P]/1e3+dn+Yn[n][bt])[S](h,t?Nn:sn)}),e[w]=function(e){return e&&e.slice(-1)=="%"?e:parseInt(e)},e.fn[i]=function(){for(var t=0;t'),Yn[r][W]=e("#skel-layers-parent"),Yn[r][W][S](h,sn)[S](O,0)[S](tt,0)[S]("min-height",Nt)[S](L,Nt)):Yn[r][W]=Yn[r][Pn],Yn[r][W].wrapInner(''),Yn[r][H]=e("#skel-layers-wrapper"),Yn[r][H][S](h,Dn)[S](O,0)[S](x,0)[S](tt,0)[k](),Yn[r][U]=e('')[vn](Yn[r][W]),Yn[r][U][S](Z,Nt),Yn[r][l]=e('')[vn](Yn[r][W]),Yn[r][l][S](h,Dn),Yn._[jt](_t,Yn[r][U][0]),Yn._[jt]("skel_layers_visibleWrapper",Yn[r][l][0]),Yn._[jt]("skel_layers_wrapper",Yn[r][H][0]),e("[autofocus]").focus(),Yn.refresh()}},Yn)}(jQuery))});