@mozert-studio/mozert-slider 0.0.0-stage → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ /*! Mozert 1.1.0 | core styles (required) | MIT */
2
+ .mozert-slider{position:relative;display:block;box-sizing:border-box;min-width:0;max-width:100%;-webkit-tap-highlight-color:transparent}.mozert-slider *,.mozert-slider *::before,.mozert-slider *::after{box-sizing:border-box}.mozert-list{position:relative;display:block;margin:0;padding:0;overflow:hidden}.mozert-list:focus{outline:none}.mozert-list:focus-visible{outline:2px solid currentColor;outline-offset:-2px}.mozert-draggable .mozert-list{cursor:grab}.mozert-dragging .mozert-list{cursor:grabbing}.mozert-dragging{user-select:none;-webkit-user-select:none}.mozert-dragging .mozert-track a,.mozert-dragging .mozert-track img{pointer-events:none}.mozert-track{position:relative;top:0;left:0;display:flex;flex-wrap:nowrap;will-change:transform}.mozert-vertical .mozert-track{flex-direction:column}.mozert-rtl .mozert-track{direction:rtl}.mozert-adaptive .mozert-track{align-items:flex-start}.mozert-slide{flex:0 0 auto;min-height:1px}.mozert-slide img{max-width:100%}.mozert-fade .mozert-slide{opacity:0;pointer-events:none}.mozert-fade .mozert-slide.mozert-active{opacity:1;pointer-events:auto}.mozert-page{display:flex;flex-direction:column}.mozert-row{display:flex;flex:0 0 auto}.mozert-cell{flex:0 0 auto;min-width:0}.mozert-static .mozert-track{transform:none !important}.mozert-arrow[hidden],.mozert-hidden{display:none !important}.mozert-disabled{cursor:default}img.mozert-loading{opacity:0.3}img.mozert-loaded{opacity:1;transition:opacity 0.25s ease}@media (prefers-reduced-motion:reduce){.mozert-track,.mozert-slide,.mozert-list{transition-duration:0.01ms !important}}.mozert-fx .mozert-slide{will-change:transform,opacity;transform-style:preserve-3d}.mozert-fx-flip .mozert-slide,.mozert-fx-cube .mozert-slide{backface-visibility:hidden}.mozert-pagination{display:flex;justify-content:center;align-items:center;gap:6px;padding:10px 0;font-variant-numeric:tabular-nums}.mozert-bullet{width:8px;height:8px;padding:0;border:0;border-radius:50%;background:currentColor;opacity:.3;cursor:pointer;transition:transform .2s,opacity .2s,width .2s}.mozert-bullet-active{opacity:1;background:var(--mozert-accent,currentColor)}.mozert-pagination-dynamic .mozert-bullet{transform:scale(.4)}.mozert-pagination-dynamic .mozert-bullet-near{transform:scale(.66)}.mozert-pagination-dynamic .mozert-bullet-active-main{transform:scale(1)}.mozert-pagination-dynamic .mozert-bullet-hidden{width:0;margin:0 -3px;opacity:0}.mozert-pagination-progressbar{display:block;position:relative;height:4px;padding:0;background:rgba(128,128,128,.25);border-radius:4px;overflow:hidden}.mozert-pg-fill{position:absolute;inset:0;background:var(--mozert-accent,currentColor);transform-origin:0 50%;transform:scaleX(0);transition:transform .3s}.mozert-pg-opposite .mozert-pg-fill{transform-origin:100% 50%}.mozert-scrollbar{position:relative;height:4px;margin:10px 16px;background:rgba(128,128,128,.25);border-radius:4px;touch-action:none}.mozert-scrollbar-drag{position:absolute;top:0;height:100%;background:var(--mozert-accent,currentColor);border-radius:4px;transition:left .3s}.mozert-scrollbar-hide{opacity:0;transition:opacity .3s}.mozert-scrollbar-hide.mozert-scrollbar-show{opacity:1}.mozert-free .mozert-track{transition-timing-function:cubic-bezier(.17,.67,.35,1)}.mozert-fullscreen-btn{position:absolute;top:10px;right:10px;z-index:5;width:34px;height:34px;border:0;border-radius:8px;background:rgba(0,0,0,.5);color:#fff;cursor:pointer;display:grid;place-items:center}.mozert-fullscreen{position:fixed !important;inset:0;z-index:9999;background:#000}.mozert-zoomed{cursor:grab}.mozert-bleed{overflow:visible}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Mozert 1.1.0
3
+ * A dependency-free, responsive, touch-friendly carousel / slider.
4
+ * MIT License
5
+ */
6
+ (function(root,factory){if(typeof define==='function'&&define.amd)define([],factory);else if(typeof module==='object'&&module.exports){module.exports=factory();module.exports.default=module.exports;}else root.Mozert=factory();}(typeof self!=='undefined'?self:this,function(){'use strict';const VERSION='1.1.0';const DEFAULTS={accessibility:true,adaptiveHeight:false,appendArrows:null,appendDots:null,arrows:true,asNavFor:null,autoplay:false,disableOnInteraction:false,autoplayReverse:false,autoplaySpeed:3000,centerMode:false,centerPadding:'50px',cssEase:'ease',customPaging:null,dots:false,dotsClass:'mozert-dots',dragThreshold:6,draggable:true,easing:'linear',edgeFriction:0.15,edgePadding:0,effect:'slide',fade:false,focusOnSelect:false,freeMode:false,infinite:true,initialSlide:0,labels:null,lazyLoad:'ondemand',mobileFirst:false,nextArrow:null,pauseOnDotsHover:false,pauseOnFocus:true,pauseOnHover:true,prevArrow:null,respectReducedMotion:true,respondTo:'window',responsive:null,rows:1,rtl:false,slide:'',slideWidth:0,slidesPerRow:1,slidesToScroll:1,slidesToShow:1,spaceBetween:0,speed:300,stopOnLastSlide:false,swipe:true,swipeToSlide:false,touchMove:true,touchRatio:1,touchThreshold:5,useCSS:true,useTransform:true,variableWidth:false,vertical:false,verticalSwiping:false,waitForAnimate:true,zIndex:1000,on:null,};const LABELS={slide:'Slide {n} of {total}',prev:'Previous slide',next:'Next slide',goTo:'Go to slide {n}'};const DEFAULT_PREV='<button type="button" class="mozert-prev" aria-label="Previous slide">Previous</button>';const DEFAULT_NEXT='<button type="button" class="mozert-next" aria-label="Next slide">Next</button>';const FOCUSABLE='a[href],button,input,select,textarea,[tabindex],[contenteditable="true"]';const STASH_ATTRS=['class','style','role','aria-hidden','aria-label','aria-roledescription','data-mozert-index'];const STACKED=['fade','flip','cube','cards','creative'];const EASINGS={linear:(t)=>t,swing:(t)=>0.5-Math.cos(t*Math.PI)/2,easeInQuad:(t)=>t*t,easeOutQuad:(t)=>t*(2-t),easeInOutQuad:(t)=>(t<0.5?2*t*t:-1+(4-2*t)*t),easeInCubic:(t)=>t*t*t,easeOutCubic:(t)=>--t*t*t+1,easeInOutCubic:(t)=>(t<0.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),easeInOutQuart:(t)=>(t<0.5?8*t*t*t*t:1-8*--t*t*t*t),};const registry={get:(e)=>e._mozert||undefined,set:(e,v)=>{e._mozert=v;},delete:(e)=>{delete e._mozert;},};const isEl=(v)=>typeof Element!=='undefined'&&v instanceof Element;const clamp=(v,a,b)=>Math.min(b,Math.max(a,v));function htmlToEl(html){const t=document.createElement('template');t.innerHTML=String(html).trim();return t.content.firstElementChild;}function resolveNode(v){if(!v)return null;if(isEl(v))return v;if(typeof v==='string'){const t=v.trim();return t.charAt(0)==='<'?htmlToEl(t):document.querySelector(t);}if(v[0]&&isEl(v[0]))return v[0];return null;}function parseData(el){const raw=el.getAttribute('data-mozert');if(!raw)return{};try{return JSON.parse(raw);}catch(e){console.warn('Mozert: could not parse data-mozert JSON',e);return{};}}class Mozert{constructor(el,options={}){if(typeof el==='string')el=document.querySelector(el);if(!isEl(el))throw new TypeError('Mozert: a valid element or selector is required');const existing=registry.get(el);if(existing)return existing;this.el=el;const _o=Object.assign({},options,parseData(el));Mozert._boot.forEach((f)=>f(el,_o));this._base=Object.assign({},DEFAULTS,options,parseData(el));this.options=this._base;this._dormant=false;this.active=false;this.canNav=false;this.current=0;this.animating=false;this.n=0;this._handlers={};this._sources=[];this._filter=null;this._stash=new WeakMap();this._logical=0;this._t=0;this._cur=0;this._bp=null;this._off=[];this._life=[];this._pause=new Set();this._fxHooks=[];this._mi=[];this._release=null;this._lockDrag=false;this._autoOn=false;this._dir=1;this._built=false;this._initDone=false;this._origDir=el.getAttribute('dir');this._lastW=el.clientWidth;registry.set(el,this);this._collect();this._bindLife();this._apply(true);}getState(){return{active:this.active,current:this.current,count:this.n,total:this.trackLen||0,inner:this.Lc||0,clones:this.cloneCount||0,offset:this._cur||0,animating:this.animating,canNavigate:this.canNav,playing:this.isPlaying(),breakpoint:this._bp,};}slideCount(){return this.n;}currentSlide(){return this.current;}isPlaying(){return!!(this.active&&this._autoOn&&!this._pause.has('user'));}get _c(){return this.cloneCount;}next(){if(!this.active||!this.canNav)return this;this._slideTo(this.current+this.s.slidesToScroll);return this;}prev(){if(!this.active||!this.canNav)return this;this._slideTo(this.current-this.s.slidesToScroll);return this;}goTo(index,dontAnimate=false){if(!this.active||!this.canNav)return this;index=parseInt(index,10);if(isNaN(index))return this;this._slideTo(this.s.infinite?this._norm(index):clamp(index,0,Math.max(0,this.n-1)),{animate:!dontAnimate});return this;}play(){const was=this.isPlaying();this._autoOn=true;this._pause.delete('user');this._schedule();this._live();if(!was)this.emit('autoplayStart');return this;}pause(){const was=this.isPlaying();this._autoOn=false;this._pause.add('user');clearTimeout(this._apTimer);cancelAnimationFrame(this._apRaf);this._live();if(was)this.emit('autoplayStop');return this;}getSlides(){return this._units?this._units.slice():this._activeItems();}getOption(name){return this.options[name];}setOption(name,value,refresh){if(name&&typeof name==='object'){refresh=value;Object.assign(this._base,name);}else{this._base[name]=value;}if(refresh===false){this._applyLive();}else{this._apply(false);}return this;}_applyLive(){const r=this._resolve();this.options=r.s;if(this.active){this.s=this._prepare(r.s);this._autoOn=!!this.s.autoplay&&this.canNav;if(this._autoOn)this._pause.delete('user');this._live();this._schedule();}}add(markup,index,addBefore){const node=resolveNode(typeof markup==='string'&&markup.trim().charAt(0)!=='<'?`<div>${markup}</div>`:markup);if(!node)return false;if(typeof index==='boolean'){addBefore=index;index=null;}const items=this._activeItems();if(index!=null&&(index<0||index>=items.length))return false;if(index==null||!items.length){if(addBefore)this._sources.unshift(node);else this._sources.push(node);}else{const at=this._sources.indexOf(items[index]);this._sources.splice(at+(addBefore?0:1),0,node);}this._refreshKeep();return this;}remove(index,removeBefore){const items=this._activeItems();if(typeof index==='boolean'){removeBefore=index;index=removeBefore?0:items.length-1;}else{index=removeBefore?index-1:index;}if(index==null||index<0||index>=items.length)return false;const node=items[index];this._sources.splice(this._sources.indexOf(node),1);this._restoreItem(node);if(node.parentNode)node.parentNode.removeChild(node);if(index<this.current)this.current-=1;this._refreshKeep();return this;}removeAll(){this._activeItems().forEach((node)=>{this._sources.splice(this._sources.indexOf(node),1);this._restoreItem(node);if(node.parentNode)node.parentNode.removeChild(node);});this.current=0;this._refreshKeep();return this;}filter(selectorOrFn){this._filter=selectorOrFn||null;this.current=0;this._refreshKeep();return this;}unfilter(){return this.filter(null);}refresh(){this._refreshKeep();this.emit('reInit');return this;}setPosition(){if(!this.active)return this;this._layout();this._paintCurrent(false);this.emit('setPosition');return this;}destroy(){this.emit('destroy');if(this.active)this._teardown();this._sources.forEach((n)=>this.el.appendChild(n));this.active=false;this._life.forEach((fn)=>fn());this._life=[];if(this._ro)this._ro.disconnect();registry.delete(this.el);this._dormant=false;this._handlers={};return this;}on(name,fn){(this._handlers[name]=this._handlers[name]||[]).push(fn);return this;}once(name,fn){const wrap=(...a)=>{this.off(name,wrap);fn.apply(this,a);};return this.on(name,wrap);}one(name,fn){return this.once(name,fn);}off(name,fn){if(!name)this._handlers={};else if(!fn)delete this._handlers[name];else this._handlers[name]=(this._handlers[name]||[]).filter((f)=>f!==fn);return this;}emit(name,...args){(this._handlers[name]||[]).slice().forEach((fn)=>fn.call(this,this,...args));const cb=this._base.on&&this._base.on[name];if(typeof cb==='function')cb.call(this,this,...args);this.el.dispatchEvent(new CustomEvent('mozert:'+name,{bubbles:true,detail:{slider:this,args}}));if(Mozert._bridge)Mozert._bridge(this,name,args);}static get(el){if(typeof el==='string')el=document.querySelector(el);return(isEl(el)&&registry.get(el))||null;}static initAll(root,options){const scope=root&&root.querySelectorAll?root:document;const found=Array.from(scope.querySelectorAll('[data-mozert]'));if(scope!==document&&scope.matches&&scope.matches('[data-mozert]'))found.unshift(scope);return found.map((n)=>Mozert.get(n)||new Mozert(n,options));}_respondWidth(){const mode=this._base.respondTo;const w=window.innerWidth;if(mode==='slider')return this.el.clientWidth;if(mode==='min')return Math.min(w,this.el.clientWidth);return w;}_resolve(){const base=this._base;const list=Array.isArray(base.responsive)?base.responsive.filter((r)=>r&&typeof r.breakpoint==='number'):[];const w=this._respondWidth();let hit=null;if(base.mobileFirst){list.sort((a,b)=>a.breakpoint-b.breakpoint).forEach((r)=>{if(w>=r.breakpoint)hit=r;});}else{list.sort((a,b)=>b.breakpoint-a.breakpoint).forEach((r)=>{if(w<=r.breakpoint)hit=r;});}if(hit&&hit.settings==='destroy')return{bp:hit.breakpoint,dormant:true,s:Object.assign({},base)};return{bp:hit?hit.breakpoint:null,dormant:false,s:Object.assign({},base,hit?hit.settings:{})};}_prepare(raw){const s=Object.assign({},raw);s.slidesToShow=Math.max(1,parseFloat(s.slidesToShow)||1);s.slidesToScroll=Math.max(1,parseInt(s.slidesToScroll,10)||1);s.rows=Math.max(1,parseInt(s.rows,10)||1);s.slidesPerRow=Math.max(1,parseInt(s.slidesPerRow,10)||1);s.effect=s.fade?'fade':s.effect||'slide';s.fade=s.effect==='fade';s.stacked=STACKED.indexOf(s.effect)>-1;if(s.stacked){s.slidesToShow=1;s.slidesToScroll=1;}if(s.effect==='coverflow')s.centerMode=true;if(s.freeMode||s.virtual||s.bleed)s.infinite=false;if(s.marquee){s.infinite=true;s.arrows=false;s.dots=false;s.autoplay=false;}s.spaceBetween=parseFloat(s.spaceBetween)||0;if(s.respectReducedMotion&&window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)').matches){s.speed=0;s.autoplay=false;}return s;}_apply(first){const r=this._resolve();const changed=r.bp!==this._bp;this._bp=r.bp;this._raw=r.s;this.options=r.s;this._dormant=!!r.dormant;if(r.dormant){if(this.active){this._teardown();this.active=false;this.emit('destroy');}if(changed&&!first)this.emit('breakpoint',r.bp);return;}this.s=this._prepare(r.s);if(this.active)this._teardown();this._build(!first);if(changed&&!first)this.emit('breakpoint',r.bp);}_refreshKeep(){if(!this.active){this._apply(false);return;}this._teardown();this._build(true);}_bindLife(){let timer;const onResize=()=>{clearTimeout(timer);timer=setTimeout(()=>this._onResize(),40);};window.addEventListener('resize',onResize);window.addEventListener('orientationchange',onResize);const onVis=()=>{if(document.hidden)this._holdOn('hidden');else this._holdOff('hidden');};document.addEventListener('visibilitychange',onVis);this._life.push(()=>{clearTimeout(timer);window.removeEventListener('resize',onResize);window.removeEventListener('orientationchange',onResize);document.removeEventListener('visibilitychange',onVis);});if(typeof ResizeObserver!=='undefined'){this._ro=new ResizeObserver(()=>{const w=this.el.clientWidth;if(w!==this._lastW){this._lastW=w;onResize();}});this._ro.observe(this.el);}}_onResize(){const r=this._resolve();const must=r.bp!==this._bp||(r.dormant&&this.active)||(!r.dormant&&!this.active);if(must){this._apply(false);return;}if(!this.active)return;this._layout();if(this._computeCan()!==this.canNav){this._refreshKeep();return;}this._paintCurrent(false);this.emit('setPosition');}_collect(){const kids=Array.from(this.el.children);const sel=this._base.slide;this._sources=sel?kids.filter((k)=>k.matches(sel)):kids;}_activeItems(){const f=this._filter;if(!f)return this._sources.slice();return this._sources.filter((el,i)=>(typeof f==='function'?f.call(el,el,i):el.matches(f)));}_remember(el){if(this._stash.has(el))return;const o={};STASH_ATTRS.forEach((a)=>(o[a]=el.getAttribute(a)));this._stash.set(el,o);}_restoreItem(el){const o=this._stash.get(el);if(!o)return;STASH_ATTRS.forEach((a)=>(o[a]===null?el.removeAttribute(a):el.setAttribute(a,o[a])));el.querySelectorAll('[data-mozert-tabindex]').forEach((f)=>{const v=f.getAttribute('data-mozert-tabindex');if(v==='')f.removeAttribute('tabindex');else f.setAttribute('tabindex',v);f.removeAttribute('data-mozert-tabindex');});el.querySelectorAll('[data-mozert-bg]').forEach((b)=>b.removeAttribute('data-mozert-bg'));this._stash.delete(el);}_label(key,vars){const l=Object.assign({},LABELS,this.s&&this.s.labels);return String(l[key]).replace(/\{(\w+)\}/g,(m,k)=>(vars&&vars[k]!==undefined?vars[k]:m));}_px(v){const p=String(v||'0');if(p.indexOf('%')>-1)return(parseFloat(p)/100)*this.el.clientWidth;return parseFloat(p)||0;}_padPx(){return this._px(this.s.centerPadding);}_edgePad(){const s=this.s;return s.centerMode?this._padPx():this._px(s.edgePadding);}_calcShow(){const s=this.s;let show=s.slidesToShow;if(s.slideWidth&&!s.vertical&&!s.variableWidth){const inner=Math.max(1,(this.list?this.list.clientWidth:this.el.clientWidth)-2*this._edgePad());show=Math.max(1,(inner+s.spaceBetween)/(parseFloat(s.slideWidth)+s.spaceBetween));}this._show=show;this._showC=Math.ceil(show-1e-6);}_build(keep){const s=this.s;const el=this.el;const items=this._activeItems();this._sources.forEach((n)=>{if(items.indexOf(n)===-1&&n.parentNode===el)el.removeChild(n);});el.classList.add('mozert-slider','mozert-initialized');el.classList.toggle('mozert-vertical',!!s.vertical);el.classList.toggle('mozert-rtl',!!s.rtl);el.classList.toggle('mozert-fade',!!s.fade);el.classList.toggle('mozert-fx',s.effect!=='slide'&&!s.fade);if(s.effect!=='slide')el.classList.add('mozert-effect-'+s.effect);el.classList.toggle('mozert-center',!!s.centerMode);el.classList.toggle('mozert-adaptive',!!s.adaptiveHeight);el.classList.toggle('mozert-draggable',!!(s.draggable||s.swipe));if(s.rtl)el.setAttribute('dir','rtl');el.setAttribute('role','region');el.setAttribute('aria-roledescription','carousel');this.list=document.createElement('div');this.list.className='mozert-list';this.track=document.createElement('div');this.track.className='mozert-track';this.list.appendChild(this.track);el.appendChild(this.list);let units=items;if(s.rows>1||s.slidesPerRow>1){units=[];const per=s.rows*s.slidesPerRow;for(let i=0;i<items.length;i+=per){const page=document.createElement('div');page.className='mozert-page';for(let r=0;r<s.rows;r++){const row=document.createElement('div');row.className='mozert-row';for(let c=0;c<s.slidesPerRow;c++){const it=items[i+r*s.slidesPerRow+c];if(!it)break;this._remember(it);it.classList.add('mozert-cell');it.style.width=100/s.slidesPerRow+'%';row.appendChild(it);}if(row.children.length)page.appendChild(row);}units.push(page);}}this._items=items;this._units=units;this.n=units.length;this._calcShow();units.forEach((u,i)=>{this._remember(u);u.classList.add('mozert-slide');u.setAttribute('data-mozert-index',i);u.setAttribute('role','group');u.setAttribute('aria-roledescription','slide');u.setAttribute('aria-label',this._label('slide',{n:i+1,total:units.length}));u.querySelectorAll('[data-lazy-bg]').forEach((b,k)=>b.setAttribute('data-mozert-bg',String(k)));this.track.appendChild(u);});this.dom=units.slice();this.cloneCount=0;if(s.variableWidth)this._layout();this.canNav=this._computeCan();if(s.infinite&&this.canNav&&!s.stacked)this._addClones();this._layout();this.maxIndex=this._maxIndex();this.current=clamp(keep?this.current:parseInt(s.initialSlide,10)||0,0,s.infinite?Math.max(0,this.n-1):this.maxIndex);if(!this.canNav)this.current=0;this._logical=this.current;if(!this.canNav)el.classList.add('mozert-static');else el.classList.remove('mozert-static');this._buildArrows();this._buildDots();this._bindEvents();this.active=true;this._built=true;this._paintCurrent(false);if(s.fade){this.dom.forEach((e)=>(e.style.transition='none'));void this.track.offsetWidth;this.dom.forEach((e)=>(e.style.transition=s.speed>0?'opacity '+s.speed+'ms '+s.cssEase:'none'));}this._updateNav();this._lazy();this._mi=Mozert._mods.map((m)=>(m.create?m.create(this):null)).filter(Boolean);this._autoOn=!!s.autoplay&&this.canNav;if(!this._initDone){this._initDone=true;this._autoOn=!!s.autoplay&&this.canNav;this.emit('init');}else if(keep){this.emit('reInit');}this._live();this._schedule();this.emit('setPosition');}_addClones(){const s=this.s;const n=this.n;const count=s.variableWidth?n*2:this._showC+s.slidesToScroll+(s.centerMode?1:0);this.cloneCount=count;const mk=(idx)=>{const base=this._units[((idx%n)+n)%n];const c=base.cloneNode(true);c.removeAttribute('id');c.querySelectorAll('[id]').forEach((x)=>x.removeAttribute('id'));c.classList.remove('mozert-active','mozert-center');c.classList.add('mozert-cloned');c.setAttribute('aria-hidden','true');c.removeAttribute('role');c.removeAttribute('aria-label');c.removeAttribute('aria-roledescription');c.querySelectorAll(FOCUSABLE).forEach((f)=>{f.setAttribute('data-mozert-tabindex',f.getAttribute('tabindex')||'');f.setAttribute('tabindex','-1');});return c;};const before=[];const after=[];for(let i=-count;i<0;i++)before.push(mk(i));for(let i=0;i<count;i++)after.push(mk(n+i));const first=this._units[0];before.forEach((c)=>this.track.insertBefore(c,first));after.forEach((c)=>this.track.appendChild(c));this.dom=before.concat(this._units,after);}_teardown(){this._mi.forEach((m)=>m.destroy&&m.destroy());this._mi=[];this._fxHooks=[];this._release=null;this._lockDrag=false;this._off.forEach((fn)=>fn());this._off=[];clearTimeout(this._animTimer);clearTimeout(this._apTimer);if(this._raf)cancelAnimationFrame(this._raf);this._raf=0;this.animating=false;const el=this.el;(this._items||[]).forEach((it)=>{this._restoreItem(it);if(this._sources.indexOf(it)>-1)el.appendChild(it);});(this._units||[]).forEach((u)=>{if(this._items.indexOf(u)===-1)this._stash.delete(u);});if(this.list&&this.list.parentNode)this.list.parentNode.removeChild(this.list);(this._navNodes||[]).forEach((fn)=>fn());this._navNodes=[];Array.from(el.classList).filter((c)=>c.indexOf('mozert')===0).forEach((c)=>el.classList.remove(c));el.removeAttribute('role');el.removeAttribute('aria-roledescription');if(this._origDir===null)el.removeAttribute('dir');else el.setAttribute('dir',this._origDir);this.dom=[];this.active=false;}_layout(){const s=this.s;const v=!!s.vertical;const list=this.list;const track=this.track;const dom=this.dom;this._calcShow();const show=this._show;const gap=s.spaceBetween;const pad=this._edgePad();const mProp=v?'marginBottom':s.rtl?'marginLeft':'marginRight';list.style.padding=v?pad+'px 0':'0 '+pad+'px';if(v){dom.forEach((e)=>(e.style.height=''));track.style.height='';let h=0;this._units.forEach((u)=>(h=Math.max(h,u.offsetHeight)));this.slideSize=h;dom.forEach((e)=>{e.style.height=h+'px';e.style[mProp]=gap?gap+'px':'';});this.Lc=h*show+gap*(show-1);list.style.height=this.Lc+2*pad+'px';this.trackLen=(h+gap)*dom.length-gap;track.style.height=this.trackLen+gap+'px';}else{this.Lc=Math.max(0,list.clientWidth-2*pad);if(!s.variableWidth){const w=s.slideWidth?parseFloat(s.slideWidth):(this.Lc-gap*(show-1))/show;this.slideSize=w;dom.forEach((e)=>{e.style.width=w+'px';e.style[mProp]=gap?gap+'px':'';});this.trackLen=(w+gap)*dom.length-gap;track.style.width=this.trackLen+gap+'px';}else{dom.forEach((e)=>(e.style[mProp]=gap?gap+'px':''));track.style.width='100000px';}}const tr=track.getBoundingClientRect();this._mags=[];this._sizes=[];dom.forEach((e)=>{const r=e.getBoundingClientRect();if(v){this._mags.push(r.top-tr.top);this._sizes.push(r.height);}else if(s.rtl){this._mags.push(tr.right-r.right);this._sizes.push(r.width);}else{this._mags.push(r.left-tr.left);this._sizes.push(r.width);}});if(!v&&s.variableWidth){let end=0;this._mags.forEach((m,i)=>(end=Math.max(end,m+this._sizes[i])));this.trackLen=Math.ceil(end);track.style.width=this.trackLen+'px';}const cc=this.cloneCount;const last=cc+this.n-1;this._realLen=this.n?this._mags[last]+this._sizes[last]-this._mags[cc]:0;if(s.stacked){const sz=this.slideSize;dom.forEach((e,i)=>{e.style.position='relative';if(v)e.style.top=-i*sz+'px';else e.style.left=(s.rtl?i*sz:-i*sz)+'px';});}this._adaptHeight();this._arrowY();this.maxIndex=this._maxIndex();}_computeCan(){const s=this.s;if(s.variableWidth)return this.n>1&&this._realLen>this.Lc+1;return this.n>this._show+1e-6;}_maxIndex(){const s=this.s;if(s.infinite||s.stacked)return Math.max(0,this.n-1);if(s.centerMode)return Math.max(0,this.n-1);if(s.variableWidth){const need=this._realLen-this.Lc-0.5;if(need<=0)return 0;for(let i=0;i<this.n;i++)if(this._mags[this.cloneCount+i]-this._mags[this.cloneCount]>=need)return i;return this.n-1;}return Math.max(0,Math.ceil(this.n-this._show-1e-6));}_adaptHeight(){const s=this.s;if(!s.adaptiveHeight||s.vertical||this._show!==1)return;const e=this.dom[this.cloneCount+this._logical]||this.dom[0];if(!e)return;this.list.style.transition=s.speed>0?'height '+s.speed+'ms '+s.cssEase:'none';this.list.style.height=e.offsetHeight+'px';this._arrowY(e.offsetHeight);}_arrowY(h){const l=this.list;if(!l||this.s.vertical)return;const hh=h===undefined?l.offsetHeight:h;this.el.style.setProperty('--mozert-arrow-y',l.offsetTop+hh/2+'px');}_norm(i){const n=this.n;if(this.s.infinite||this.s.stacked)return((i%n)+n)%n;return clamp(i,0,this.maxIndex);}_pos(L){const s=this.s;const k=this.cloneCount+L;if(this._mags[k]===undefined)return this._t;let mag=this._mags[k];let c=0;if(s.centerMode)c=(this.Lc-this._sizes[k])/2;else if(!s.infinite)mag=Math.min(mag,Math.max(0,this.trackLen-this.Lc));const dir=s.rtl&&!s.vertical?-1:1;return dir*(c-mag);}_paint(val,animate){const s=this.s;const track=this.track;this._cur=val;if(s.useTransform)track.style.transform=s.vertical?'translate3d(0,'+val+'px,0)':'translate3d('+val+'px,0,0)';else track.style[s.vertical?'top':'left']=val+'px';if(this._fxHooks.length)this._fx(this._pvFromT(val),!!animate);}_pvFromT(t){const s=this.s;if(s.variableWidth||!this._mags||!this._mags.length)return this._logical;const dir=s.rtl&&!s.vertical?-1:1;const c=s.centerMode?(this.Lc-this.slideSize)/2:0;const pitch=this.slideSize+s.spaceBetween;return(c-dir*t-this._mags[this.cloneCount])/(pitch||1);}_fx(pv,animate){for(let i=0;i<this._fxHooks.length;i++)this._fxHooks[i](pv,animate,this.s.speed);}_onFx(fn){this._fxHooks.push(fn);}_sub(name,fn){this.on(name,fn);this._off.push(()=>this.off(name,fn));}_user(){if(this.s.disableOnInteraction&&this._autoOn)this.pause();}_setPos(t,animate,opts){const s=this.s;const track=this.track;if(this._raf)cancelAnimationFrame(this._raf);this._raf=0;if(animate&&s.speed>0){const dur=opts&&opts.duration?opts.duration:s.speed;if(s.useCSS){track.style.transition=(s.useTransform?'transform':s.vertical?'top':'left')+' '+dur+'ms '+(opts&&opts.ease?opts.ease:s.cssEase);this._paint(t,true);}else{track.style.transition='none';const from=this._cur;const ease=typeof s.easing==='function'?s.easing:EASINGS[s.easing]||EASINGS.linear;const t0=performance.now();const step=(now)=>{const p=Math.min(1,(now-t0)/s.speed);this._paint(from+(t-from)*ease(p));this._raf=p<1?requestAnimationFrame(step):0;};this._raf=requestAnimationFrame(step);}}else{track.style.transition='none';this._paint(t);void track.offsetWidth;}this._t=t;}_paintCurrent(animate){if(this.s.stacked)this._fx(this._logical,false);else this._setPos(this._pos(this._logical),animate);this._updateSlideClasses(this._logical);this._adaptHeight();}_snapBack(){if(this.s.stacked)this._fx(this._logical,true);else this._setPos(this._pos(this._logical),true);}_slideTo(target,opts={}){const s=this.s;if(!this.active||!this.canNav)return false;if(this.animating&&!opts.fromSync&&s.waitForAnimate)return false;let next=target;if(!s.infinite||s.stacked)next=s.stacked?this._norm(next):clamp(next,0,this.maxIndex);const real=this._norm(next);const want=s.infinite||s.stacked?real:clamp(target,0,this.n-1);if(next===this.current&&!this.animating&&!opts.force){if(!opts.fromSync&&want!==next){this._sel=want;this._updateSlideClasses(this._logical);this._syncNav(want);}return false;}const old=this.current;this.emit('beforeChange',old,real);this._sel=opts.fromSync?(opts.sel!==undefined&&opts.sel!==next?opts.sel:null):want!==next?want:null;if(!opts.fromSync)this._syncNav(want);clearTimeout(this._animTimer);this.current=real;this._logical=next;this._updateNav();this._updateSlideClasses(next);this._lazy();const animate=opts.animate!==false;if(s.stacked)this._fx(next,animate&&s.speed>0);else this._setPos(this._pos(next),animate);if(!animate||s.speed<=0){this._finish();}else{this.animating=true;this._animTimer=setTimeout(()=>this._finish(),s.speed);}return true;}_finish(){this.animating=false;if(this._logical!==this.current){this._logical=this.current;if(!this.s.stacked)this._setPos(this._pos(this.current),false);this._updateSlideClasses(this._logical);}this._adaptHeight();this.emit('afterChange',this.current);this._schedule();}_updateSlideClasses(L){const s=this.s;const show=this._show;const showC=this._showC;const half=Math.floor(showC/2);const t=s.stacked?0:this._pos(L);this.dom.forEach((e,k)=>{const l=k-this.cloneCount;let active;let centered=false;if(s.stacked){active=l===L;}else if(s.variableWidth){const d=s.rtl?this._mags[k]-t:this._mags[k]+t;active=d+this._sizes[k]>0.5&&d<this.Lc-0.5;centered=s.centerMode&&l===L;}else if(s.centerMode){active=l>=L-half&&l<=L+half-(showC%2===0?1:0);centered=l===L;}else{active=l>=L&&l<=L+showC-1;}e.classList.toggle('mozert-active',active);e.classList.toggle('mozert-center',centered);e.classList.toggle('mozert-current',l===(this._sel!=null?this._sel:L));e.setAttribute('aria-hidden',active?'false':'true');if(s.stacked)e.style.zIndex=l===L?s.zIndex:s.zIndex-2;if(!e.classList.contains('mozert-cloned')){e.querySelectorAll(FOCUSABLE).forEach((f)=>{if(active){if(f.hasAttribute('data-mozert-tabindex')){const v=f.getAttribute('data-mozert-tabindex');if(v==='')f.removeAttribute('tabindex');else f.setAttribute('tabindex',v);f.removeAttribute('data-mozert-tabindex');}}else if(!f.hasAttribute('data-mozert-tabindex')){f.setAttribute('data-mozert-tabindex',f.getAttribute('tabindex')||'');f.setAttribute('tabindex','-1');}});}});}_buildArrows(){this._navNodes=this._navNodes||[];this._arrows={prev:null,next:null};this._prev=this._next=null;const s=this.s;if(!s.arrows||!this.canNav)return;const mount=resolveNode(s.appendArrows)||this.el;const make=(val,html,cls,handler)=>{const node=resolveNode(val)||htmlToEl(html);const created=!(val&&!(typeof val==='string'&&val.trim().charAt(0)==='<'));node.classList.add('mozert-arrow',cls);if(!node.parentNode||created)mount.appendChild(node);const lab=this._label(cls==='mozert-prev'?'prev':'next');if(!val||(!node.getAttribute('aria-label')&&!node.textContent.trim()))node.setAttribute('aria-label',lab);node.addEventListener('click',handler);this._navNodes.push(()=>{node.removeEventListener('click',handler);node.classList.remove('mozert-arrow',cls,'mozert-disabled');node.removeAttribute('aria-disabled');if(created&&node.parentNode)node.parentNode.removeChild(node);});return node;};this._arrows.prev=make(s.prevArrow,DEFAULT_PREV,'mozert-prev',(e)=>{e.preventDefault();this._user();this.prev();});this._arrows.next=make(s.nextArrow,DEFAULT_NEXT,'mozert-next',(e)=>{e.preventDefault();this._user();this.next();});this._prev=this._arrows.prev;this._next=this._arrows.next;}_dotCount(){const s=this.s;if(!this.canNav)return 0;if(s.infinite)return Math.ceil(this.n/s.slidesToScroll);return Math.ceil(this.maxIndex/s.slidesToScroll)+1;}_buildDots(){this._dots=null;const s=this.s;if(!s.dots||!this.canNav)return;const count=this._dotCount();const ul=document.createElement('ul');ul.className=s.dotsClass;ul.setAttribute('role','tablist');for(let i=0;i<count;i++){const li=document.createElement('li');li.setAttribute('role','presentation');let inner=typeof s.customPaging==='function'?s.customPaging(this,i):null;if(typeof inner==='string')inner=htmlToEl(inner.trim().charAt(0)==='<'?inner:'<button type="button">'+inner+'</button>');if(!isEl(inner)){inner=document.createElement('button');inner.type='button';inner.setAttribute('aria-label',this._label('goTo',{n:i+1}));}inner.setAttribute('role','tab');li.appendChild(inner);li.addEventListener('click',(e)=>{e.preventDefault();this._user();this._slideTo(this._dotTarget(i));});ul.appendChild(li);}(resolveNode(s.appendDots)||this.el).appendChild(ul);this._dots=ul;this._navNodes.push(()=>ul.parentNode&&ul.parentNode.removeChild(ul));if(s.pauseOnDotsHover){const a=()=>this._holdOn('dots');const b=()=>this._holdOff('dots');ul.addEventListener('mouseenter',a);ul.addEventListener('mouseleave',b);}}_dotTarget(i){const s=this.s;const t=i*s.slidesToScroll;return s.infinite?t:Math.min(t,this.maxIndex);}_updateNav(){const s=this.s;if(this._dots){const total=this._dots.children.length;const idx=s.infinite?Math.floor(this.current/s.slidesToScroll):Math.ceil(this.current/s.slidesToScroll);Array.from(this._dots.children).forEach((li,i)=>{const on=i===Math.min(total-1,idx);li.classList.toggle('mozert-active',on);if(li.firstElementChild)li.firstElementChild.setAttribute('aria-selected',on?'true':'false');});}const{prev,next}=this._arrows||{};if(!s.infinite&&prev&&next){const setD=(node,d)=>{node.classList.toggle('mozert-disabled',d);node.setAttribute('aria-disabled',d?'true':'false');if('disabled'in node)node.disabled=d;};setD(prev,this.current<=0);setD(next,this.current>=this.maxIndex);}}_axis(){const s=this.s;if(s.vertical)return s.verticalSwiping?'y':null;return'x';}_on(target,type,fn,opts){target.addEventListener(type,fn,opts);this._off.push(()=>target.removeEventListener(type,fn,opts));}_bindEvents(){const s=this.s;const el=this.el;const list=this.list;const axis=this._axis();list.style.touchAction=axis==='x'?'pan-y':axis==='y'?'pan-x':'';if(s.accessibility)list.setAttribute('tabindex','0');this._on(el,'keydown',(e)=>{if(!s.accessibility||!this.canNav)return;const t=e.target;if(t&&(/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName)||t.isContentEditable))return;const rtl=s.rtl&&!s.vertical;let handled=true;if(e.key==='ArrowLeft'||(s.vertical&&e.key==='ArrowUp'))rtl?this.next():this.prev();else if(e.key==='ArrowRight'||(s.vertical&&e.key==='ArrowDown'))rtl?this.prev():this.next();else if(e.key==='Home')this.goTo(0);else if(e.key==='End')this.goTo(this.n-1);else handled=false;if(handled)e.preventDefault();});if(s.pauseOnHover){this._on(el,'mouseenter',()=>this._holdOn('hover'));this._on(el,'mouseleave',()=>this._holdOff('hover'));}if(s.pauseOnFocus){this._on(el,'focusin',()=>this._holdOn('focus'));this._on(el,'focusout',(e)=>{if(!el.contains(e.relatedTarget))this._holdOff('focus');});}this._on(list,'click',(e)=>{if(this._dragged){e.preventDefault();e.stopPropagation();this._dragged=false;return;}if(s.focusOnSelect&&this.canNav){const slide=e.target.closest?e.target.closest('.mozert-slide'):null;if(slide&&this.track.contains(slide)){const i=parseInt(slide.getAttribute('data-mozert-index'),10);if(!isNaN(i))this.goTo(i);}}},true);this._on(list,'dragstart',(e)=>e.preventDefault());this._on(list,'selectstart',(e)=>{if(this._pointerDown)e.preventDefault();});this._on(this.track,'load',()=>{if(!this.active)return;clearTimeout(this._imgTimer);this._imgTimer=setTimeout(()=>this.setPosition(),30);},true);if(axis&&this.canNav)this._bindDrag(axis);}_bindDrag(axis){const s=this.s;const list=this.list;let d=null;const onDown=(e)=>{if(this._lockDrag)return;if(this.animating&&s.waitForAnimate)return;if(e.pointerType==='mouse'){if(e.button!==0||!s.draggable)return;}else if(!s.swipe){return;}this._dragged=false;this._pointerDown=true;d={id:e.pointerId,x:e.clientX,y:e.clientY,started:false,base:this._t,delta:0,samples:[]};window.addEventListener('pointermove',onMove);window.addEventListener('pointerup',onUp);window.addEventListener('pointercancel',onCancel);};const limits=()=>{const a=this._pos(0);const b=this._pos(this.maxIndex);return[Math.min(a,b),Math.max(a,b)];};const onMove=(e)=>{if(!d||e.pointerId!==d.id)return;if(this._lockDrag&&!d.started)return;const dx=e.clientX-d.x;const dy=e.clientY-d.y;const main=(axis==='x'?dx:dy)*s.touchRatio;const cross=axis==='x'?dy:dx;if(!d.started){if(Math.abs(main)<s.dragThreshold||Math.abs(main)<Math.abs(cross))return;d.started=true;this.el.classList.add('mozert-dragging');this._holdOn('drag');try{list.setPointerCapture(e.pointerId);}catch(err){}this.track.style.transition='none';}d.delta=main;d.samples.push({t:performance.now(),v:main});if(d.samples.length>6)d.samples.shift();if(!s.touchMove)return;if(s.stacked){const sgn=s.rtl&&!s.vertical?1:-1;let pv=this._logical+(sgn*main)/(axis==='x'?this.list.clientWidth:this.list.clientHeight);if(!s.infinite){if(pv<0)pv*=s.edgeFriction;else if(pv>this.maxIndex)pv=this.maxIndex+(pv-this.maxIndex)*s.edgeFriction;}this._fx(pv,false);return;}let raw=d.base+main;if(!s.infinite){const[lo,hi]=limits();if(raw>hi)raw=hi+(raw-hi)*s.edgeFriction;else if(raw<lo)raw=lo-(lo-raw)*s.edgeFriction;}this._paint(raw);};const end=()=>{window.removeEventListener('pointermove',onMove);window.removeEventListener('pointerup',onUp);window.removeEventListener('pointercancel',onCancel);this._pointerDown=false;this.el.classList.remove('mozert-dragging');this._holdOff('drag');};const onCancel=()=>{if(!d)return;const started=d.started;d=null;end();if(started)this._snapBack();};const onUp=(e)=>{if(!d||e.pointerId!==d.id)return;const st=d;d=null;end();if(!st.started)return;this._dragged=true;const delta=st.delta;const size=axis==='x'?this.list.clientWidth:this.list.clientHeight;this._user();if(this._release&&this._release(st,size,axis))return;const fingerDir=axis==='x'?(delta<0?'left':'right'):delta<0?'up':'down';const rtl=s.rtl&&!s.vertical;const forward=rtl?delta>0:delta<0;if(Math.abs(delta)<size/s.touchThreshold){this._snapBack();return;}this.emit('swipe',fingerDir);let target;if(s.swipeToSlide){const raw=st.base+delta;let best=this.current;let bestD=Infinity;const lo=s.infinite?-this.cloneCount:0;const hi=s.infinite?this.n+this.cloneCount-1:this.maxIndex;for(let i=lo;i<=hi;i++){const dist=Math.abs(this._pos(i)-raw);if(dist<bestD){bestD=dist;best=i;}}target=best;}else{target=this.current+(forward?1:-1)*s.slidesToScroll;}if(!s.infinite){const clamped=clamp(target,0,this.maxIndex);if(clamped===this.current){this.emit('edge',fingerDir);this._snapBack();return;}target=clamped;}if(target===this.current){this._snapBack();return;}this._slideTo(target);};this._on(list,'pointerdown',onDown);this._off.push(()=>{window.removeEventListener('pointermove',onMove);window.removeEventListener('pointerup',onUp);window.removeEventListener('pointercancel',onCancel);});}_holdOn(reason){this._pause.add(reason);clearTimeout(this._apTimer);}_holdOff(reason){this._pause.delete(reason);this._schedule();}_live(){if(this.track)this.track.setAttribute('aria-live',this._autoOn&&!this._pause.has('user')?'off':'polite');}_schedule(){clearTimeout(this._apTimer);cancelAnimationFrame(this._apRaf);if(!this.active||!this.canNav||!this._autoOn)return;if(this._pause.size)return;const delay=this.s.autoplaySpeed;this._apTimer=setTimeout(()=>this._tick(),delay);const cb=this.options.on&&this.options.on.autoplayTimeLeft;if((this._handlers.autoplayTimeLeft&&this._handlers.autoplayTimeLeft.length)||cb){const t0=performance.now();const loop=()=>{const left=Math.max(0,delay-(performance.now()-t0));this.emit('autoplayTimeLeft',left,left/delay);if(left>0)this._apRaf=requestAnimationFrame(loop);};loop();}}_tick(){const s=this.s;if(this._pause.size||!this.active)return;if(this.animating){this._schedule();return;}const rev=s.autoplayReverse;if(s.infinite){if(rev)this.prev();else this.next();return;}if(s.stopOnLastSlide&&(rev?this.current<=0:this.current>=this.maxIndex)){this.pause();return;}if(this.current>=this.maxIndex)this._dir=-1;else if(this.current<=0)this._dir=1;if((this._dir===1)!==!!rev)this.next();else this.prev();}_navTargets(){const v=this.s.asNavFor;if(!v)return[];let els=[];if(v instanceof Mozert)return[v];if(typeof v==='string')els=Array.from(document.querySelectorAll(v));else if(isEl(v))els=[v];else if(v.length)els=Array.from(v);return els.map((e)=>registry.get(e)).filter((i)=>i&&i!==this&&i.active&&i.canNav);}_syncNav(index){this._navTargets().forEach((t)=>t._slideTo(t.s.infinite?index:clamp(index,0,t.maxIndex),{fromSync:true,sel:index}));}_lazy(){const s=this.s;if(!this.track||!this.n)return;const mode=s.lazyLoad;if(mode!=='ondemand'&&mode!=='progressive')return;const from=this.current-(s.centerMode?Math.floor(this._show/2):0);const to=this.current+this._show-1+(s.centerMode?Math.floor(this._show/2):1);const seen=new Set();for(let i=from;i<=to;i++){const r=((i%this.n)+this.n)%this.n;if(!seen.has(r)){seen.add(r);this._loadSlide(r);}}if(mode==='progressive'&&!this._progressing)this._progressive();}_progressive(){this._progressing=true;const step=()=>{if(!this.active){this._progressing=false;return;}const next=this._units.findIndex((u)=>u.querySelector('img[data-lazy]:not([data-mozert-loading]), [data-lazy-bg]:not([data-mozert-loading])'));if(next===-1){this._progressing=false;return;}this._loadSlide(next,step);};step();}_loadSlide(index,done){const unit=this._units[index];if(!unit)return;const imgs=unit.querySelectorAll('img[data-lazy]');const bgs=unit.querySelectorAll('[data-lazy-bg]');if(!imgs.length&&!bgs.length){if(done)done();return;}let left=imgs.length+bgs.length;const fin=()=>{if(--left===0&&done)done();};bgs.forEach((el)=>{if(el.hasAttribute('data-mozert-loading')){fin();return;}el.setAttribute('data-mozert-loading','');const src=el.getAttribute('data-lazy-bg');const k=el.getAttribute('data-mozert-bg');const apply=(n)=>{n.style.backgroundImage='url("'+src.replace(/"/g,'%22')+'")';n.removeAttribute('data-lazy-bg');n.removeAttribute('data-mozert-loading');};const probe=new Image();probe.onload=()=>{apply(el);this.dom.forEach((e)=>{if(!e.classList.contains('mozert-cloned')||parseInt(e.getAttribute('data-mozert-index'),10)!==index)return;const c=e.querySelector('[data-mozert-bg="'+k+'"]');if(c)apply(c);});this.emit('lazyLoaded',el,src);fin();};probe.onerror=()=>{el.removeAttribute('data-lazy-bg');el.removeAttribute('data-mozert-loading');el.classList.add('mozert-lazy-error');this.emit('lazyLoadError',el,src);fin();};probe.src=src;});imgs.forEach((img)=>{if(img.hasAttribute('data-mozert-loading')){fin();return;}img.setAttribute('data-mozert-loading','');img.classList.add('mozert-loading');const src=img.getAttribute('data-lazy');const srcset=img.getAttribute('data-lazy-srcset');const sizes=img.getAttribute('data-lazy-sizes');const probe=new Image();probe.onload=()=>{if(srcset)img.srcset=srcset;if(sizes)img.sizes=sizes;img.src=src;img.removeAttribute('data-lazy');img.removeAttribute('data-mozert-loading');img.classList.remove('mozert-loading');img.classList.add('mozert-loaded');this._lazyClones(index,src,srcset,sizes,img);this.emit('lazyLoaded',img,src);fin();};probe.onerror=()=>{img.removeAttribute('data-lazy');img.removeAttribute('data-mozert-loading');img.classList.remove('mozert-loading');img.classList.add('mozert-lazy-error');this.emit('lazyLoadError',img,src);fin();};if(srcset)probe.srcset=srcset;probe.src=src;});}_lazyClones(index,src,srcset,sizes,realImg){const imgsInUnit=Array.from(this._units[index].querySelectorAll('img'));const pos=imgsInUnit.indexOf(realImg);this.dom.forEach((e)=>{if(!e.classList.contains('mozert-cloned')||parseInt(e.getAttribute('data-mozert-index'),10)!==index)return;const c=e.querySelectorAll('img')[pos];if(!c)return;if(srcset)c.srcset=srcset;if(sizes)c.sizes=sizes;c.src=src;c.removeAttribute('data-lazy');c.classList.add('mozert-loaded');});}}Mozert._mods=[];Mozert._boot=[];Mozert.use=function(mod){if(mod&&Mozert._mods.indexOf(mod)<0){Mozert._mods.push(mod);Object.keys(mod.defaults||{}).forEach((k)=>{if(!(k in DEFAULTS))DEFAULTS[k]=mod.defaults[k];});}return Mozert;};Mozert.version=VERSION;Mozert.defaults=DEFAULTS;Mozert._bridge=null;(function(){const clampN=(v,a,b)=>Math.min(b,Math.max(a,v));const num=(v,d)=>(v===undefined||v===null||isNaN(parseFloat(v))?d:parseFloat(v));const objOpt=(v,d)=>Object.assign({},d,v&&typeof v==='object'?v:{});const mk=(tag,cls,html)=>{const e=document.createElement(tag);if(cls)e.className=cls;if(html!=null)e.innerHTML=html;return e;};const relOf=(i,pv,n,loop)=>{let r=i-pv;if(loop)r=((((r+n/2)%n)+n)%n)-n/2;return r;};const pct=(v,size)=>(typeof v==='string'&&v.indexOf('%')>-1?(parseFloat(v)/100)*size:parseFloat(v)||0);const FX=['coverflow','cube','flip','cards','creative'];Mozert.use({name:'effects',defaults:{coverflowEffect:{rotate:45,depth:120,scale:1,stretch:0,modifier:1,shadow:true},cubeEffect:{shadow:true,slideShadows:true,perspective:1200},flipEffect:{perspective:1400,limitRotation:true},cardsEffect:{perSlideOffset:10,perSlideRotate:2,rotate:true,visible:4},creativeEffect:{limitProgress:1,prev:{translate:['-120%',0,-300],rotate:[0,0,0],opacity:0,scale:1},next:{translate:['120%',0,0],rotate:[0,0,0],opacity:0,scale:1},},},create(sl){const s=sl.s;const fx=s.effect;if(FX.indexOf(fx)<0)return null;const o=objOpt(s[fx+'Effect'],Mozert.defaults[fx+'Effect']);const stacked=s.stacked;const n=sl.n;const list=sl.list;const prevR=[];const persp=fx==='coverflow'?1200:o.perspective||1200;list.style.perspective=persp+'px';sl.track.style.transformStyle='preserve-3d';const slides=()=>(stacked?sl._units:sl.dom);const place=(e,tr,op,z,animate,speed,jump)=>{e.style.transition=animate&&!jump?'transform '+speed+'ms '+s.cssEase+', opacity '+speed+'ms '+s.cssEase:'none';e.style.transform=tr;e.style.opacity=op;e.style.zIndex=z;e.style.pointerEvents=op>0.5&&z>=0?'':'none';e.style.backfaceVisibility=fx==='flip'||fx==='cube'?'hidden':'';};const apply=(pv,animate,speed)=>{const W=sl.slideSize||sl.list.clientWidth;const items=slides();const loop=stacked?true:false;for(let k=0;k<items.length;k++){const i=stacked?k:k-sl.cloneCount;const r=relOf(i,pv,n,loop);const jump=prevR[k]!==undefined&&Math.abs(r-prevR[k])>1.5;prevR[k]=r;const e=items[k];const a=Math.abs(r);let tr='';let op=1;let z=Math.round(1000-a*10);if(fx==='coverflow'){const rot=clampN(-r,-3,3)*o.rotate*o.modifier;const tz=-a*o.depth;const sc=1-Math.min(a,3)*(1-o.scale)*0.5;tr='translate3d('+-r*o.stretch+'px,0,'+tz+'px) rotateY('+rot+'deg) scale('+sc+')';op=a>4?0:1;}else if(fx==='cube'){tr='translate3d(0,0,'+-W/2+'px) rotateY('+r*90+'deg) translate3d(0,0,'+W/2+'px)';op=a<=1.01?1:0;}else if(fx==='flip'){const rr=o.limitRotation?clampN(r,-1,1):r;tr='rotateY('+rr*-180+'deg)';op=a<1?1:0;z=Math.round(1000-a*100);}else if(fx==='cards'){const vis=o.visible;if(r<0){const t=Math.max(r,-1);tr='translate3d('+t*105+'%,0,0)'+(o.rotate?' rotate('+t*12+'deg)':'');op=1+t*0.3;z=2000;}else{tr='translate3d(0,'+r*-o.perSlideOffset+'px,'+-r*40+'px) scale('+(1-r*0.05)+')'+(o.rotate?' rotate('+r*o.perSlideRotate*(i%2?1:-1)+'deg)':'');op=r>vis?0:1;z=Math.round(1000-r*10);}}else{const lim=o.limitProgress;const p=clampN(r,-lim,lim);const d=p<0?o.prev:o.next;const m=Math.abs(p);const t=d.translate||[0,0,0];const rt=d.rotate||[0,0,0];tr='translate3d('+pct(t[0],W)*m+'px,'+pct(t[1],sl.list.clientHeight)*m+'px,'+(parseFloat(t[2])||0)*m+'px) rotateX('+(rt[0]||0)*m+'deg) rotateY('+(rt[1]||0)*m+'deg) rotateZ('+(rt[2]||0)*m+'deg) scale('+(1+((d.scale===undefined?1:d.scale)-1)*m)+')';op=1+((d.opacity===undefined?1:d.opacity)-1)*m;if(a>lim+0.01)op=d.opacity===undefined?1:d.opacity;z=d.zIndex!==undefined&&p!==0?d.zIndex:Math.round(1000-a*10);}place(e,tr,op,z,animate,speed,jump);}};sl._onFx(apply);sl.el.classList.add('mozert-fx-'+fx);sl._paintCurrent(false);return{destroy(){list.style.perspective='';sl.track.style.transformStyle='';list.style.overflow='';sl.el.classList.remove('mozert-fx-'+fx);slides().forEach((e)=>{e.style.transform=e.style.opacity=e.style.zIndex=e.style.transition=e.style.pointerEvents=e.style.backfaceVisibility='';});},};},});Mozert.use({name:'parallax',defaults:{parallax:false},create(sl){if(!sl.s.parallax)return null;const items=[];const stacked=sl.s.stacked;const slides=stacked?sl._units:sl.dom;slides.forEach((slide,k)=>{const els=[];if(slide.hasAttribute('data-parallax-x')||slide.hasAttribute('data-parallax-y'))els.push(slide);slide.querySelectorAll('[data-parallax-x],[data-parallax-y],[data-parallax-scale],[data-parallax-opacity]').forEach((e)=>els.push(e));items.push(els);});const bg=sl.el.querySelector('[data-parallax-bg]');const apply=(pv,animate,speed)=>{const W=sl.slideSize||sl.list.clientWidth;slides.forEach((slide,k)=>{const i=stacked?k:k-sl.cloneCount;const r=clampN(relOf(i,pv,sl.n,stacked),-2,2);items[k].forEach((e)=>{const x=e.getAttribute('data-parallax-x');const y=e.getAttribute('data-parallax-y');const sc=e.getAttribute('data-parallax-scale');const op=e.getAttribute('data-parallax-opacity');const tx=x?pct(x,e===slide?W:e.offsetWidth||W)*r:0;const ty=y?pct(y,e.offsetHeight||100)*r:0;e.style.transition=animate?'transform '+speed+'ms '+sl.s.cssEase+', opacity '+speed+'ms '+sl.s.cssEase:'none';e.style.transform='translate3d('+tx+'px,'+ty+'px,0)'+(sc?' scale('+(1+(parseFloat(sc)-1)*Math.abs(r))+')':'');if(op!==null)e.style.opacity=1+(parseFloat(op)-1)*Math.abs(r);});});if(bg){const amt=parseFloat(bg.getAttribute('data-parallax-bg'))||0.5;bg.style.transition=animate?'transform '+speed+'ms '+sl.s.cssEase:'none';bg.style.transform='translate3d('+-pv*W*amt+'px,0,0)';}};sl._onFx(apply);sl._paintCurrent(false);return{destroy(){items.forEach((l)=>l.forEach((e)=>(e.style.transform=e.style.opacity=e.style.transition='')));if(bg)bg.style.transform='';},};},});Mozert.use({name:'zoom',defaults:{zoom:false},create(sl){if(!sl.s.zoom)return null;const o=objOpt(sl.s.zoom,{max:3,min:1,toggle:true,step:0.5});let scale=1;let tx=0;let ty=0;let target=null;const ptrs=new Map();let startDist=0;let startScale=1;let pan=null;const cur=()=>sl._units[sl.current];const tgt=()=>{const u=cur();return u?u.querySelector('.mozert-zoom-target')||u.querySelector('img,picture,canvas,video'):null;};const paint=(animate)=>{if(!target)return;target.style.transition=animate?'transform .25s ease':'none';target.style.transform=scale===1&&!tx&&!ty?'':'translate3d('+tx+'px,'+ty+'px,0) scale('+scale+')';target.style.transformOrigin='50% 50%';target.style.cursor=scale>1?'grab':'';sl._lockDrag=scale>1;sl.el.classList.toggle('mozert-zoomed',scale>1);};const bound=()=>{if(!target)return;const mx=(target.offsetWidth*(scale-1))/2;const my=(target.offsetHeight*(scale-1))/2;tx=clampN(tx,-mx,mx);ty=clampN(ty,-my,my);};const reset=(animate)=>{if(scale===1&&!tx&&!ty){target=tgt();return;}scale=1;tx=ty=0;paint(animate);target=tgt();};const setScale=(v,animate)=>{target=tgt();if(!target)return;scale=clampN(v,o.min,o.max);if(scale===1)tx=ty=0;bound();paint(animate);sl.emit('zoomChange',scale);};sl.zoom={in:()=>setScale(scale+o.step,true),out:()=>setScale(scale-o.step,true),toggle:()=>setScale(scale>1?1:o.max,true),reset:()=>reset(true),get scale(){return scale;},};const onDbl=(e)=>{if(!o.toggle||!e.target.closest||!cur()||!cur().contains(e.target))return;e.preventDefault();sl.zoom.toggle();};const onDown=(e)=>{if(!cur()||!cur().contains(e.target))return;ptrs.set(e.pointerId,{x:e.clientX,y:e.clientY});if(ptrs.size===2){const[a,b]=Array.from(ptrs.values());startDist=Math.hypot(a.x-b.x,a.y-b.y);startScale=scale;sl._lockDrag=true;}else if(scale>1)pan={x:e.clientX,y:e.clientY,tx,ty};};const onMove=(e)=>{if(!ptrs.has(e.pointerId))return;ptrs.set(e.pointerId,{x:e.clientX,y:e.clientY});if(ptrs.size===2&&startDist){const[a,b]=Array.from(ptrs.values());setScale((startScale*Math.hypot(a.x-b.x,a.y-b.y))/startDist,false);}else if(pan&&scale>1){tx=pan.tx+(e.clientX-pan.x);ty=pan.ty+(e.clientY-pan.y);bound();paint(false);}};const onUp=(e)=>{ptrs.delete(e.pointerId);if(ptrs.size<2)startDist=0;if(!ptrs.size)pan=null;if(scale<=1.001){scale=1;tx=ty=0;paint(true);}};const onWheel=(e)=>{if(!e.ctrlKey||!cur()||!cur().contains(e.target))return;e.preventDefault();setScale(scale-e.deltaY*0.01,false);};sl._on(sl.list,'dblclick',onDbl);sl._on(sl.list,'pointerdown',onDown);sl._on(window,'pointermove',onMove);sl._on(window,'pointerup',onUp);sl._on(window,'pointercancel',onUp);sl._on(sl.list,'wheel',onWheel,{passive:false});sl._sub('beforeChange',()=>reset(false));target=tgt();return{destroy(){reset(false);sl._lockDrag=false;delete sl.zoom;},};},});Mozert._boot.push((el,o)=>{const v=o.virtual;if(!v||!v.slides||el.children.length)return;v.slides.forEach((d,i)=>{const sh=mk('div','mozert-v');sh.setAttribute('data-vi',i);el.appendChild(sh);});});Mozert.use({name:'virtual',defaults:{virtual:false},create(sl){const v=sl.s.virtual;if(!v||!v.slides)return null;const before=num(v.addSlidesBefore,2);const after=num(v.addSlidesAfter,2);const store=v.slides;const hostOf=(u)=>(u.classList.contains('mozert-v')?u:u.querySelector('.mozert-v')||u);const make=(i)=>{const d=store[i];const html=typeof v.renderSlide==='function'?v.renderSlide(d,i):d;return html;};const render=()=>{const a=Math.max(0,sl.current-before);const b=Math.min(sl.n-1,sl.current+sl._showC-1+after);const added=[];sl._units.forEach((u,i)=>{const h=hostOf(u);const inWin=i>=a&&i<=b;if(inWin&&!h.hasAttribute('data-vr')){const c=make(i);if(typeof c==='string')h.innerHTML=c;else if(c&&c.nodeType){h.innerHTML='';h.appendChild(c);}h.setAttribute('data-vr','1');added.push(i);}else if(!inWin&&h.hasAttribute('data-vr')&&v.cache===false){h.innerHTML='';h.removeAttribute('data-vr');}});if(added.length){sl._arrowY();sl._lazy();sl.emit('virtualRender',added);}};sl._sub('beforeChange',(_s,old,real)=>{sl.current=real;render();});render();sl.virtual={slides:store,appendSlide(d){store.push(d);sl.add(mk('div','mozert-v'));return sl;},prependSlide(d){store.unshift(d);sl.add(mk('div','mozert-v'),true);return sl;},removeSlide(i){store.splice(i,1);sl.remove(i);return sl;},update(){sl._units.forEach((u)=>{const h=hostOf(u);h.innerHTML='';h.removeAttribute('data-vr');});render();},};return{destroy(){delete sl.virtual;},};},});Mozert.use({name:'hash',defaults:{hashNavigation:false},create(sl){const h=sl.s.hashNavigation;if(!h||typeof window==='undefined')return null;const o=objOpt(h,{watchState:true,replaceState:true,prefix:''});const hashes=sl._units.map((u,i)=>(u.getAttribute('data-hash')||(u.firstElementChild&&u.firstElementChild.getAttribute('data-hash'))||String(i+1)));const read=()=>decodeURIComponent((window.location.hash||'').replace(/^#/,'').replace(o.prefix,''));const go=(anim)=>{const i=hashes.indexOf(read());if(i>-1&&i!==sl.current)sl.goTo(i,!anim);};go(false);sl._sub('afterChange',()=>{const val=o.prefix+hashes[sl.current];try{if(o.replaceState&&window.history&&window.history.replaceState)window.history.replaceState(null,'','#'+val);else window.location.hash=val;}catch(e){}});if(o.watchState)sl._on(window,'hashchange',()=>go(true));return null;},});Mozert.use({name:'scrollbar',defaults:{scrollbar:false},create(sl){const c=sl.s.scrollbar;if(!c||!sl.canNav)return null;const o=objOpt(c,{draggable:true,hide:false,el:null});const host=o.el?(typeof o.el==='string'?document.querySelector(o.el):o.el):null;const bar=host||mk('div','mozert-scrollbar');const thumb=mk('div','mozert-scrollbar-drag');bar.classList.add('mozert-scrollbar');bar.appendChild(thumb);if(!host)sl.el.appendChild(bar);const show=()=>Math.min(sl.n,sl._show);const apply=(pv)=>{const max=Math.max(0.0001,sl.n-show());const frac=sl.s.stacked?(pv-0)/Math.max(1,sl.n-1):clampN(pv/max,0,1);const tw=sl.s.stacked?100/sl.n:(show()/sl.n)*100;thumb.style.width=tw+'%';thumb.style.left=clampN(frac,0,1)*(100-tw)+'%';};sl._onFx(apply);sl._paintCurrent(false);let hideT;if(o.hide){bar.classList.add('mozert-scrollbar-hide');sl._sub('beforeChange',()=>{bar.classList.add('mozert-scrollbar-show');clearTimeout(hideT);hideT=setTimeout(()=>bar.classList.remove('mozert-scrollbar-show'),1200);});}if(o.draggable){let drag=false;const move=(e)=>{const r=bar.getBoundingClientRect();const f=clampN((e.clientX-r.left)/(r.width||1),0,1);const idx=Math.round(f*(sl.s.stacked?sl.n-1:sl.maxIndex));sl.goTo(idx);};const down=(e)=>{drag=true;move(e);e.preventDefault();};sl._on(bar,'pointerdown',down);sl._on(window,'pointermove',(e)=>drag&&move(e));sl._on(window,'pointerup',()=>(drag=false));}return{destroy(){clearTimeout(hideT);if(host){if(thumb.parentNode)thumb.parentNode.removeChild(thumb);}else if(bar.parentNode)bar.parentNode.removeChild(bar);},};},});Mozert.use({name:'pagination',defaults:{pagination:false},create(sl){const c=sl.s.pagination;if(!c||!sl.canNav)return null;const o=objOpt(c,{type:'bullets',el:null,clickable:true,dynamicMainBullets:1,progressbarOpposite:false,hideOnClick:false});const host=o.el?(typeof o.el==='string'?document.querySelector(o.el):o.el):null;const root=host||mk('div');root.classList.add('mozert-pagination','mozert-pagination-'+o.type);if(!host)sl.el.appendChild(root);const total=sl.n;const cur=()=>sl.current;let bullets=[];let fill=null;const buildBullets=()=>{root.innerHTML='';bullets=[];for(let i=0;i<total;i++){let b;if(typeof o.renderBullet==='function'){const html=o.renderBullet(i,'mozert-bullet');const t=mk('div',null,String(html).trim());b=t.firstElementChild||mk('span','mozert-bullet');}else b=mk('button','mozert-bullet');if(b.tagName==='BUTTON'){b.type='button';b.setAttribute('aria-label',sl._label('goTo',{n:i+1}));}if(o.clickable){b.addEventListener('click',(e)=>{e.preventDefault();sl._user();sl.goTo(i);});}root.appendChild(b);bullets.push(b);}};const update=()=>{const i=cur();if(o.type==='bullets'||o.type==='dynamic'){const m=o.dynamicMainBullets;bullets.forEach((b,k)=>{b.classList.toggle('mozert-bullet-active',k===i);if(o.type==='dynamic'){const d=Math.abs(k-i);b.classList.toggle('mozert-bullet-active-main',d<=(m-1)/2||k===i);b.classList.toggle('mozert-bullet-near',d===1||d===2);b.classList.toggle('mozert-bullet-far',d===3||d===4);b.classList.toggle('mozert-bullet-hidden',d>4+(m-1));}});}else if(o.type==='fraction'){const cs='<span class="mozert-pg-current">'+(i+1)+'</span>';const ts='<span class="mozert-pg-total">'+total+'</span>';root.innerHTML=typeof o.renderFraction==='function'?o.renderFraction('mozert-pg-current','mozert-pg-total',i+1,total):cs+' / '+ts;}else if(o.type==='custom'&&typeof o.renderCustom==='function'){root.innerHTML=o.renderCustom(sl,i+1,total);}};if(o.type==='bullets'||o.type==='dynamic')buildBullets();else if(o.type==='progressbar'){fill=mk('span','mozert-pg-fill');root.appendChild(fill);if(o.progressbarOpposite)root.classList.add('mozert-pg-opposite');sl._onFx((pv)=>{const p=sl.s.stacked?(relOf(0,-pv,total,false)+1)/total:clampN((pv+Math.min(sl._show,total))/total,0,1);fill.style.transform='scaleX('+clampN(sl.s.stacked?(pv+1)/total:p,0,1)+')';});sl._paintCurrent(false);}update();sl._sub('beforeChange',(_s,old,real)=>{sl.current=real;update();});sl._sub('afterChange',update);return{destroy(){if(host)root.innerHTML='';else if(root.parentNode)root.parentNode.removeChild(root);root.classList.remove('mozert-pagination','mozert-pagination-'+o.type);},};},});const bounds=(sl)=>[sl._pos(sl.maxIndex),sl._pos(0)];const syncCurrent=(sl)=>{const s=sl.s;if(s.stacked)return;const pv=sl._pvFromT(sl._cur);const idx=clampN(Math.round(pv),0,sl.maxIndex);if(idx!==sl.current){const old=sl.current;sl.emit('beforeChange',old,idx);sl.current=idx;sl._logical=idx;sl._updateNav();sl._updateSlideClasses(idx);sl._lazy();sl.emit('afterChange',idx);}};Mozert.use({name:'freeMode',defaults:{freeMode:false},create(sl){const s=sl.s;if(!s.freeMode||s.stacked)return null;const o=objOpt(s.freeMode,{momentum:true,momentumRatio:1,momentumBounce:true,sticky:false,minimumVelocity:0.02});let timer;sl.el.classList.add('mozert-free');sl._release=(st,size,axis)=>{const sm=st.samples;let v=0;if(sm.length>1){const a=sm[0];const b=sm[sm.length-1];v=(b.v-a.v)/Math.max(1,b.t-a.t);}if(performance.now()-(sm.length?sm[sm.length-1].t:0)>120)v=0;const[mn,mx]=bounds(sl);const cur=sl._cur;let dist=o.momentum&&Math.abs(v)>o.minimumVelocity?v*350*o.momentumRatio:0;let target=clampN(cur+dist,mn,mx);const dur=clampN(Math.abs(target-cur)*2.2+250,250,1400);sl._setPos(target,true,{duration:dur,ease:'cubic-bezier(.17,.67,.35,1)'});clearTimeout(timer);timer=setTimeout(()=>{if(o.sticky){const idx=clampN(Math.round(sl._pvFromT(sl._cur)),0,sl.maxIndex);sl._setPos(sl._pos(idx),true);}syncCurrent(sl);},dur+20);sl.emit('freeModeEnd',target);return true;};return{destroy(){clearTimeout(timer);sl.el.classList.remove('mozert-free');},};},});Mozert.use({name:'mousewheel',defaults:{mousewheel:false},create(sl){const c=sl.s.mousewheel;if(!c)return null;const o=objOpt(c,{sensitivity:1,forceToAxis:false,releaseOnEdges:true,thresholdDelta:4,thresholdTime:450});let last=0;let timer;const free=!!sl.s.freeMode&&!sl.s.stacked;const on=(e)=>{if(!sl.canNav||!sl.active)return;let d=sl.s.vertical?e.deltaY:o.forceToAxis?e.deltaX:Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;if(e.shiftKey&&!sl.s.vertical)d=e.deltaY||e.deltaX;if(!d)return;if(d>0===(sl.s.rtl&&!sl.s.vertical))d=d;const edgeFwd=d>0&&sl.current>=(sl.s.infinite||sl.s.stacked?Infinity:sl.maxIndex)&&(!free||sl._cur<=bounds(sl)[0]+1);const edgeBack=d<0&&sl.current<=(sl.s.infinite||sl.s.stacked?-Infinity:0)&&(!free||sl._cur>=bounds(sl)[1]-1);if(o.releaseOnEdges&&(edgeFwd||edgeBack))return;e.preventDefault();sl._user();if(free){const[mn,mx]=bounds(sl);const dir=sl.s.rtl&&!sl.s.vertical?1:-1;sl._setPos(clampN(sl._cur+dir*d*o.sensitivity,mn,mx),false);clearTimeout(timer);timer=setTimeout(()=>syncCurrent(sl),120);return;}const now=performance.now();if(Math.abs(d)<o.thresholdDelta&&now-last<o.thresholdTime)return;if(now-last<o.thresholdTime)return;last=now;if(d>0)sl.next();else sl.prev();};sl._on(sl.el,'wheel',on,{passive:false});return{destroy(){clearTimeout(timer);},};},});Mozert.use({name:'globalKeyboard',defaults:{globalKeyboard:false},create(sl){const c=sl.s.globalKeyboard;if(!c)return null;const o=objOpt(c,{onlyInViewport:true});sl._on(document,'keydown',(e)=>{if(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)return;const t=e.target;if(t&&(/^(input|textarea|select)$/i.test(t.tagName)||t.isContentEditable))return;if(o.onlyInViewport){const r=sl.el.getBoundingClientRect();const vh=window.innerHeight||document.documentElement.clientHeight;if(r.bottom<0||r.top>vh)return;}const v=sl.s.vertical;const k=e.key;const rtl=sl.s.rtl&&!v;if((!v&&(k==='ArrowLeft'||k==='ArrowRight'))||(v&&(k==='ArrowUp'||k==='ArrowDown'))){const fwd=k==='ArrowRight'||k==='ArrowDown';sl._user();if(fwd!==rtl)sl.next();else sl.prev();e.preventDefault();}});return null;},});Mozert.use({name:'marquee',defaults:{marquee:false},create(sl){const c=sl.s.marquee;if(!c||!sl.canNav)return null;const o=objOpt(c,{speed:60,pauseOnHover:true,direction:'left'});if(typeof window.matchMedia==='function'&&window.matchMedia('(prefers-reduced-motion: reduce)').matches&&sl.s.respectReducedMotion)return null;const pitch=sl.slideSize+sl.s.spaceBetween;const setLen=pitch*sl.n;const base=sl._pos(0);let off=0;let last=0;let raf=0;let hold=false;sl._lockDrag=true;sl.track.style.transition='none';const dir=(o.direction==='right'?-1:1)*(sl.s.rtl?-1:1);const loop=(t)=>{if(!last)last=t;const dt=Math.min(64,t-last);last=t;if(!hold){off+=(o.speed*dt)/1000;const m=((off%setLen)+setLen)%setLen;const v=o.direction==='right'?base-setLen+m:base-m;sl._paint(sl.s.rtl?-v:v);sl._t=sl._cur;}raf=requestAnimationFrame(loop);};raf=requestAnimationFrame(loop);if(o.pauseOnHover){sl._on(sl.el,'mouseenter',()=>(hold=true));sl._on(sl.el,'mouseleave',()=>{hold=false;last=0;});}sl.marquee={pause:()=>(hold=true),resume:()=>{hold=false;last=0;},};return{destroy(){cancelAnimationFrame(raf);sl._lockDrag=false;delete sl.marquee;},};},});Mozert.use({name:'video',defaults:{videoAutoplay:false},create(sl){const c=sl.s.videoAutoplay;if(!c)return null;const o=objOpt(c,{wait:false,pauseOthers:true,rewind:true});const vids=(u)=>Array.from(u.querySelectorAll('video'));const ended=()=>sl._holdOff('video');const sync=()=>{sl._units.forEach((u,i)=>{vids(u).forEach((v)=>{if(i===sl.current){try{const p=v.play();if(p&&p.catch)p.catch(()=>{});}catch(e){}if(o.wait){sl._holdOn('video');v.addEventListener('ended',ended,{once:true});}}else if(o.pauseOthers){try{v.pause();if(o.rewind)v.currentTime=0;}catch(e){}}});});if(o.wait&&!vids(sl._units[sl.current]||document.createElement('i')).length)sl._holdOff('video');};sl._sub('afterChange',sync);sync();return{destroy(){sl._holdOff('video');},};},});Mozert.use({name:'fullscreen',defaults:{fullscreen:false},create(sl){if(!sl.s.fullscreen)return null;const btn=mk('button','mozert-fullscreen-btn');btn.type='button';btn.setAttribute('aria-label',sl._label('fullscreen')||'Toggle fullscreen');btn.innerHTML='<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5"/></svg>';sl.el.appendChild(btn);const toggle=()=>{const on=!sl.el.classList.contains('mozert-fullscreen');if(on&&sl.el.requestFullscreen)sl.el.requestFullscreen().catch(()=>sl.el.classList.add('mozert-fullscreen'));else if(!on&&document.fullscreenElement&&document.exitFullscreen)document.exitFullscreen();else sl.el.classList.toggle('mozert-fullscreen',on);setTimeout(()=>window.dispatchEvent(new Event('resize')),60);};btn.addEventListener('click',toggle);sl._on(document,'fullscreenchange',()=>{sl.el.classList.toggle('mozert-fullscreen',document.fullscreenElement===sl.el);window.dispatchEvent(new Event('resize'));});sl.fullscreen={toggle};return{destroy(){if(btn.parentNode)btn.parentNode.removeChild(btn);delete sl.fullscreen;},};},});Mozert.use({name:'bleed',defaults:{bleed:false},create(sl){const c=sl.s.bleed;if(!c||sl.s.vertical)return null;const side=c==='left'||c==='right'?c:'both';const list=sl.list;list.style.overflow='visible';sl.el.classList.add('mozert-bleed');const body=document.body;const prevClip=body.style.overflowX;let clipped=false;if(getComputedStyle(body).overflowX==='visible'){body.style.overflowX='clip';clipped=true;}const update=()=>{const r=sl.el.getBoundingClientRect();const vw=document.documentElement.clientWidth||window.innerWidth;const L=side==='right'?0:Math.max(0,r.left);const R=side==='left'?0:Math.max(0,vw-r.right);list.style.clipPath='inset(-48px '+-R+'px -48px '+-L+'px)';};update();sl._on(window,'resize',update);sl._sub('setPosition',update);const t=setTimeout(update,120);return{destroy(){clearTimeout(t);list.style.overflow='';list.style.clipPath='';if(clipped)body.style.overflowX=prevClip;sl.el.classList.remove('mozert-bleed');},};},});})();if(typeof window!=='undefined'&&typeof document!=='undefined'){var auto=function(){if(window.MozertAutoInit===false)return;Mozert.initAll(document);};if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',auto);else auto();}return Mozert;}));
@@ -0,0 +1,119 @@
1
+ /*!
2
+ * Mozert jQuery adapter v1.0.0 | MIT
3
+ * Usage: $('.slider').mozert({ dots: true });
4
+ * $('.slider').mozert('next');
5
+ * $('.slider').on('afterChange', function (event, slider, current) {});
6
+ */
7
+ (function (factory) {
8
+ if (typeof define === 'function' && define.amd) { define(['jquery', 'mozert'], factory); }
9
+ else if (typeof module === 'object' && module.exports) { module.exports = function (jq, D) { return factory(jq, D); }; }
10
+ else { factory(window.jQuery, window.Mozert); }
11
+ }(function ($, Mozert) {
12
+ 'use strict';
13
+ if (!$ || !Mozert) return;
14
+
15
+ // Fire jQuery events too, with the signature (event, slider, ...args)
16
+ Mozert._bridge = function (inst, name, args) {
17
+ $(inst.el).trigger(name, [inst].concat(args));
18
+ };
19
+
20
+ var GETTERS = { currentSlide: 1, getOption: 1, getInstance: 1, isPlaying: 1, slideCount: 1 };
21
+
22
+ $.fn.mozert = function (opt) {
23
+ var rest = Array.prototype.slice.call(arguments, 1), ret = this;
24
+ for (var i = 0; i < this.length; i++) {
25
+ var el = this[i], inst = Mozert.get(el);
26
+ if (typeof opt === 'object' || opt === undefined) {
27
+ if (!inst) { new Mozert(el, opt); }
28
+ else if (opt) { inst.setOption(opt); }
29
+ } else if (typeof opt === 'string') {
30
+ // accept Slick-style names too: slickNext -> next, slickGoTo -> goTo
31
+ var name = opt.replace(/^slick/, '');
32
+ name = name.charAt(0).toLowerCase() + name.slice(1);
33
+ if (name === 'unslick') name = 'destroy';
34
+ if (!inst) continue;
35
+ if (name === 'getInstance') { return inst; }
36
+ if (typeof inst[name] !== 'function') { $.error('mozert: unknown method "' + opt + '"'); }
37
+ var res = inst[name].apply(inst, rest);
38
+ if (GETTERS[name]) { return res; }
39
+ ret = this;
40
+ }
41
+ }
42
+ return ret;
43
+ };
44
+ return $;
45
+ }));
46
+
47
+ /*!
48
+ * Mozert Slick compatibility layer v1.0.0 | MIT
49
+ * Load AFTER jQuery, mozert.min.js and mozert.jquery.min.js (or use dist/mozert.slick.min.js, which bundles the adapter).
50
+ * Gives you: $.fn.slick(), slick* method names, slick-* class names, data-slick="{}", slick-style event args and slick.slideCount / currentSlide.
51
+ */
52
+ ;(function () {
53
+ 'use strict';
54
+ var $ = window.jQuery, M = window.Mozert;
55
+ if (!$ || !M || !$.fn.mozert) { if (window.console) console.warn('Mozert Slick layer: needs jQuery, Mozert and the jQuery adapter loaded first.'); return; }
56
+
57
+ // 1) slick* method names on the instance (slick.slickNext() inside callbacks)
58
+ var map = { slickNext: 'next', slickPrev: 'prev', slickGoTo: 'goTo', slickPlay: 'play', slickPause: 'pause', slickAdd: 'add', slickRemove: 'remove', slickFilter: 'filter', slickUnfilter: 'unfilter', slickGetOption: 'getOption', slickSetOption: 'setOption', slickCurrentSlide: 'currentSlide', unslick: 'destroy', getSlick: 'getInstance' };
59
+ Object.keys(map).forEach(function (k) { M.prototype[k] = function () { return this[map[k]].apply(this, arguments); }; });
60
+
61
+ // 2) Slick-shaped object handed to events (numbers instead of methods for slideCount / currentSlide)
62
+ function facade(inst) {
63
+ return new Proxy(inst, {
64
+ get: function (t, k) {
65
+ switch (k) {
66
+ case 'slideCount': return t.n;
67
+ case 'currentSlide': return t.current;
68
+ case '$slider': return $(t.el);
69
+ case '$list': return $(t.list);
70
+ case '$slideTrack': return $(t.track);
71
+ case '$slides': return $(t._units);
72
+ case 'options': return t.s;
73
+ case 'unslicked': return !t.active;
74
+ }
75
+ var v = t[k];
76
+ return typeof v === 'function' ? v.bind(t) : v;
77
+ }
78
+ });
79
+ }
80
+ M._bridge = function (inst, name, args) { $(inst.el).trigger(name, [facade(inst)].concat(args)); };
81
+
82
+ // 3) $.fn.slick
83
+ var base = $.fn.mozert;
84
+ $.fn.slick = function (opt) {
85
+ if (opt === 'getSlick') { var i = this[0] && M.get(this[0]); return i ? facade(i) : undefined; }
86
+ return base.apply(this, arguments);
87
+ };
88
+ $.fn.slick.Constructor = M;
89
+
90
+ // 4) data-slick="{...}" as an options source
91
+ M._boot.push(function (el) {
92
+ if (el.hasAttribute && el.hasAttribute('data-slick') && !el.hasAttribute('data-mozert')) el.setAttribute('data-mozert', el.getAttribute('data-slick'));
93
+ });
94
+
95
+ // 5) slick-* classes (and data-slick-index) mirrored next to mozert-* ones, so existing Slick CSS/JS keeps working
96
+ function mirror(node) {
97
+ var list = node.classList, i, c;
98
+ if (!list) return;
99
+ for (i = 0; i < list.length; i++) { c = list[i]; if (c.indexOf('mozert-') === 0 && c !== 'mozert-slider') { var m = 'slick-' + c.slice(7); if (!list.contains(m)) list.add(m); } }
100
+ if (list.contains('mozert-slider') && !list.contains('slick-slider')) list.add('slick-slider');
101
+ if (node.hasAttribute('data-mozert-index') && node.getAttribute('data-slick-index') !== node.getAttribute('data-mozert-index')) node.setAttribute('data-slick-index', node.getAttribute('data-mozert-index'));
102
+ }
103
+ function mirrorTree(root) { mirror(root); var all = root.querySelectorAll('[class*="mozert-"],[data-mozert-index]'); for (var i = 0; i < all.length; i++) mirror(all[i]); }
104
+ var obs = typeof MutationObserver === 'function' ? new MutationObserver(function (recs) {
105
+ recs.forEach(function (r) {
106
+ if (r.type === 'attributes') mirror(r.target);
107
+ else Array.prototype.forEach.call(r.addedNodes, function (n) { if (n.nodeType === 1) mirrorTree(n); });
108
+ });
109
+ }) : null;
110
+ M.prototype._slickWatch = function () {
111
+ mirrorTree(this.el);
112
+ if (obs) obs.observe(this.el, { subtree: true, childList: true, attributes: true, attributeFilter: ['class', 'data-mozert-index'] });
113
+ };
114
+ var origEmit = M.prototype.emit;
115
+ M.prototype.emit = function (name) {
116
+ if ((name === 'init' || name === 'reInit') && !this._slickWatched) { this._slickWatched = true; this._slickWatch(); }
117
+ return origEmit.apply(this, arguments);
118
+ };
119
+ })();
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * Mozert jQuery adapter v1.0.0 | MIT
3
+ * Usage: $('.slider').mozert({ dots: true });
4
+ * $('.slider').mozert('next');
5
+ * $('.slider').on('afterChange', function (event, slider, current) {});
6
+ */
7
+ (function(factory){if(typeof define==='function'&&define.amd){define(['jquery','mozert'],factory);}else if(typeof module==='object'&&module.exports){module.exports=function(jq,D){return factory(jq,D);};}else{factory(window.jQuery,window.Mozert);}}(function($,Mozert){'use strict';if(!$||!Mozert)return;Mozert._bridge=function(inst,name,args){$(inst.el).trigger(name,[inst].concat(args));};var GETTERS={currentSlide:1,getOption:1,getInstance:1,isPlaying:1,slideCount:1};$.fn.mozert=function(opt){var rest=Array.prototype.slice.call(arguments,1),ret=this;for(var i=0;i<this.length;i++){var el=this[i],inst=Mozert.get(el);if(typeof opt==='object'||opt===undefined){if(!inst){new Mozert(el,opt);}else if(opt){inst.setOption(opt);}}else if(typeof opt==='string'){var name=opt.replace(/^slick/,'');name=name.charAt(0).toLowerCase()+name.slice(1);if(name==='unslick')name='destroy';if(!inst)continue;if(name==='getInstance'){return inst;}if(typeof inst[name]!=='function'){$.error('mozert: unknown method "'+opt+'"');}var res=inst[name].apply(inst,rest);if(GETTERS[name]){return res;}ret=this;}}return ret;};return $;}));
8
+ /*!
9
+ * Mozert Slick compatibility layer v1.0.0 | MIT
10
+ * Load AFTER jQuery, mozert.min.js and mozert.jquery.min.js (or use dist/mozert.slick.min.js, which bundles the adapter).
11
+ * Gives you: $.fn.slick(), slick* method names, slick-* class names, data-slick="{}", slick-style event args and slick.slideCount / currentSlide.
12
+ */
13
+ ;(function(){'use strict';var $=window.jQuery,M=window.Mozert;if(!$||!M||!$.fn.mozert){if(window.console)console.warn('Mozert Slick layer: needs jQuery, Mozert and the jQuery adapter loaded first.');return;}var map={slickNext:'next',slickPrev:'prev',slickGoTo:'goTo',slickPlay:'play',slickPause:'pause',slickAdd:'add',slickRemove:'remove',slickFilter:'filter',slickUnfilter:'unfilter',slickGetOption:'getOption',slickSetOption:'setOption',slickCurrentSlide:'currentSlide',unslick:'destroy',getSlick:'getInstance'};Object.keys(map).forEach(function(k){M.prototype[k]=function(){return this[map[k]].apply(this,arguments);};});function facade(inst){return new Proxy(inst,{get:function(t,k){switch(k){case'slideCount':return t.n;case'currentSlide':return t.current;case'$slider':return $(t.el);case'$list':return $(t.list);case'$slideTrack':return $(t.track);case'$slides':return $(t._units);case'options':return t.s;case'unslicked':return!t.active;}var v=t[k];return typeof v==='function'?v.bind(t):v;}});}M._bridge=function(inst,name,args){$(inst.el).trigger(name,[facade(inst)].concat(args));};var base=$.fn.mozert;$.fn.slick=function(opt){if(opt==='getSlick'){var i=this[0]&&M.get(this[0]);return i?facade(i):undefined;}return base.apply(this,arguments);};$.fn.slick.Constructor=M;M._boot.push(function(el){if(el.hasAttribute&&el.hasAttribute('data-slick')&&!el.hasAttribute('data-mozert'))el.setAttribute('data-mozert',el.getAttribute('data-slick'));});function mirror(node){var list=node.classList,i,c;if(!list)return;for(i=0;i<list.length;i++){c=list[i];if(c.indexOf('mozert-')===0&&c!=='mozert-slider'){var m='slick-'+c.slice(7);if(!list.contains(m))list.add(m);}}if(list.contains('mozert-slider')&&!list.contains('slick-slider'))list.add('slick-slider');if(node.hasAttribute('data-mozert-index')&&node.getAttribute('data-slick-index')!==node.getAttribute('data-mozert-index'))node.setAttribute('data-slick-index',node.getAttribute('data-mozert-index'));}function mirrorTree(root){mirror(root);var all=root.querySelectorAll('[class*="mozert-"],[data-mozert-index]');for(var i=0;i<all.length;i++)mirror(all[i]);}var obs=typeof MutationObserver==='function'?new MutationObserver(function(recs){recs.forEach(function(r){if(r.type==='attributes')mirror(r.target);else Array.prototype.forEach.call(r.addedNodes,function(n){if(n.nodeType===1)mirrorTree(n);});});}):null;M.prototype._slickWatch=function(){mirrorTree(this.el);if(obs)obs.observe(this.el,{subtree:true,childList:true,attributes:true,attributeFilter:['class','data-mozert-index']});};var origEmit=M.prototype.emit;M.prototype.emit=function(name){if((name==='init'||name==='reInit')&&!this._slickWatched){this._slickWatched=true;this._slickWatch();}return origEmit.apply(this,arguments);};})();
@@ -0,0 +1,236 @@
1
+ /*!
2
+ * Mozert Swiper-style API v1.0.0 | MIT
3
+ * new Mozert.Swiper('.swiper', { slidesPerView: 3, loop: true, pagination: { el: '.swiper-pagination' } })
4
+ * Load after mozert.min.js. If `window.Swiper` is not defined, it is set to Mozert.Swiper so existing code keeps working.
5
+ */
6
+ ;(function (root, factory) {
7
+ if (typeof define === 'function' && define.amd) define(['mozert'], factory);
8
+ else if (typeof module === 'object' && module.exports) module.exports = factory(require('./mozert.js'));
9
+ else factory(root.Mozert);
10
+ }(typeof self !== 'undefined' ? self : this, function (Mozert) {
11
+ 'use strict';
12
+ if (!Mozert) throw new Error('Mozert.Swiper needs Mozert loaded first');
13
+ var isObj = function (v) { return v && typeof v === 'object' && !Array.isArray(v) && !v.nodeType; };
14
+ var node = function (v, scope) { return !v ? null : typeof v === 'string' ? (scope && scope.querySelector(v)) || document.querySelector(v) : v; };
15
+ var obj = function (v, d) { return isObj(v) ? v : (v ? d || {} : null); };
16
+
17
+ /** Swiper options -> Mozert options (one level; used for the base and for every breakpoint). */
18
+ function mapOptions(p, ctx) {
19
+ var o = {};
20
+ if (p.slidesPerView !== undefined) { if (p.slidesPerView === 'auto') o.variableWidth = true; else { o.slidesToShow = p.slidesPerView; o.variableWidth = false; } }
21
+ if (p.slidesPerGroup !== undefined) o.slidesToScroll = p.slidesPerGroup;
22
+ if (p.spaceBetween !== undefined) o.spaceBetween = parseFloat(p.spaceBetween) || 0;
23
+ if (p.loop !== undefined) o.infinite = !!p.loop;
24
+ if (p.speed !== undefined) o.speed = p.speed;
25
+ if (p.initialSlide !== undefined) o.initialSlide = p.initialSlide;
26
+ if (p.direction) o.vertical = p.direction === 'vertical';
27
+ if (p.centeredSlides !== undefined) { o.centerMode = !!p.centeredSlides; o.centerPadding = '0px'; }
28
+ if (p.autoHeight !== undefined) o.adaptiveHeight = !!p.autoHeight;
29
+ if (p.allowTouchMove !== undefined) { o.draggable = !!p.allowTouchMove; o.touchMove = !!p.allowTouchMove; }
30
+ if (p.touchRatio !== undefined) o.touchRatio = p.touchRatio;
31
+ if (p.threshold !== undefined) o.dragThreshold = Math.max(p.threshold, 1);
32
+ if (p.slidesOffsetBefore !== undefined) o.edgePadding = p.slidesOffsetBefore;
33
+ if (p.a11y !== undefined) o.accessibility = p.a11y !== false;
34
+ if (p.effect) {
35
+ o.effect = p.effect;
36
+ ['coverflow', 'cube', 'flip', 'cards', 'creative'].forEach(function (k) { if (p[k + 'Effect']) o[k + 'Effect'] = p[k + 'Effect']; });
37
+ }
38
+ if (p.autoplay) {
39
+ var a = obj(p.autoplay, {});
40
+ o.autoplay = true;
41
+ o.autoplaySpeed = a.delay !== undefined ? a.delay : 3000;
42
+ o.pauseOnHover = !!a.pauseOnMouseEnter;
43
+ o.disableOnInteraction = a.disableOnInteraction !== false;
44
+ o.autoplayReverse = !!a.reverseDirection;
45
+ o.stopOnLastSlide = !!a.stopOnLastSlide;
46
+ } else if (p.autoplay === false) o.autoplay = false;
47
+ if (p.freeMode) o.freeMode = p.freeMode;
48
+ if (p.mousewheel) o.mousewheel = p.mousewheel;
49
+ if (p.keyboard) o.globalKeyboard = obj(p.keyboard, {}).enabled === false ? false : p.keyboard;
50
+ if (p.zoom) { var z = obj(p.zoom, {}); o.zoom = { max: z.maxRatio || 3, min: z.minRatio || 1, toggle: z.toggle !== false }; }
51
+ if (p.parallax) o.parallax = true;
52
+ if (p.virtual) o.virtual = p.virtual;
53
+ if (p.hashNavigation) o.hashNavigation = p.hashNavigation;
54
+ if (p.grid && p.grid.rows > 1) { o.rows = p.grid.rows; o.slidesPerRow = 1; }
55
+ if (p.scrollbar) { var sb = obj(p.scrollbar, {}); o.scrollbar = { el: node(sb.el, ctx.el), draggable: !!sb.draggable, hide: !!sb.hide }; }
56
+ if (p.pagination) {
57
+ var pg = obj(p.pagination, {});
58
+ o.pagination = { el: node(pg.el, ctx.el), type: pg.dynamicBullets && (!pg.type || pg.type === 'bullets') ? 'dynamic' : pg.type || 'bullets', clickable: pg.clickable !== false, renderBullet: pg.renderBullet, renderFraction: pg.renderFraction, renderCustom: pg.renderCustom, progressbarOpposite: !!pg.progressbarOpposite, dynamicMainBullets: pg.dynamicMainBullets || 1 };
59
+ }
60
+ return o;
61
+ }
62
+
63
+ var EV = { slideChange: 'beforeChange', slideChangeTransitionStart: 'beforeChange', slideChangeTransitionEnd: 'afterChange', transitionEnd: 'afterChange', transitionStart: 'beforeChange', resize: 'setPosition', lazyImageReady: 'lazyLoaded', touchEnd: 'swipe', sliderMove: 'swipe' };
64
+ var CLS = { 'mozert-slide': 'swiper-slide', 'mozert-current': 'swiper-slide-active', 'mozert-active': 'swiper-slide-visible', 'mozert-cloned': 'swiper-slide-duplicate', 'mozert-track': 'swiper-wrapper', 'mozert-vertical': 'swiper-vertical', 'mozert-bullet': 'swiper-pagination-bullet', 'mozert-bullet-active': 'swiper-pagination-bullet-active', 'mozert-pagination': 'swiper-pagination', 'mozert-pagination-bullets': 'swiper-pagination-bullets', 'mozert-pagination-fraction': 'swiper-pagination-fraction', 'mozert-pagination-progressbar': 'swiper-pagination-progressbar', 'mozert-pg-fill': 'swiper-pagination-progressbar-fill', 'mozert-pg-current': 'swiper-pagination-current', 'mozert-pg-total': 'swiper-pagination-total', 'mozert-scrollbar': 'swiper-scrollbar', 'mozert-scrollbar-drag': 'swiper-scrollbar-drag', 'mozert-initialized': 'swiper-initialized' };
65
+ function mirror(n) {
66
+ var l = n.classList; if (!l) return;
67
+ Array.prototype.slice.call(l).forEach(function (c) { var m = CLS[c]; if (m && !l.contains(m)) l.add(m); });
68
+ }
69
+ function mirrorTree(r) { mirror(r); var a = r.querySelectorAll('[class*="mozert-"]'); for (var i = 0; i < a.length; i++) mirror(a[i]); }
70
+
71
+ function Swiper(target, params) {
72
+ if (!(this instanceof Swiper)) return new Swiper(target, params);
73
+ var el = typeof target === 'string' ? document.querySelector(target) : target;
74
+ if (!el) throw new Error('Swiper: container not found');
75
+ if (el.swiper) return el.swiper;
76
+ var p = this.params = Object.assign({ slidesPerView: 1, spaceBetween: 0, speed: 300, init: true }, params || {});
77
+ this.el = el; el.swiper = this; this.destroyed = false; this._h = {}; this.allowSlideNext = true; this.allowSlidePrev = true;
78
+ this.previousIndex = 0;
79
+ if (p.init !== false) this.init();
80
+ }
81
+ var P = Swiper.prototype;
82
+
83
+ P.init = function () {
84
+ var self = this, p = this.params, el = this.el, i;
85
+ this._fire('beforeInit');
86
+ this._nextEl = node(p.navigation && p.navigation.nextEl, el); this._prevEl = node(p.navigation && p.navigation.prevEl, el);
87
+ var o = mapOptions(p, this);
88
+ o.arrows = !!p.navigation && !(this._nextEl || this._prevEl) ? true : false;
89
+ o.dots = false;
90
+ if (p.dir === 'rtl' || el.getAttribute('dir') === 'rtl' || p.rtl) o.rtl = true;
91
+ if (p.breakpoints) {
92
+ o.mobileFirst = true;
93
+ o.responsive = Object.keys(p.breakpoints).map(Number).sort(function (a, b) { return a - b; }).map(function (bp) { return { breakpoint: bp, settings: mapOptions(p.breakpoints[bp], self) }; });
94
+ // Swiper's breakpoint objects only override what they list; below the first breakpoint the top-level params apply.
95
+ }
96
+ if (p.thumbs && p.thumbs.swiper) o._thumbs = p.thumbs.swiper;
97
+ if (p.controller && p.controller.control) o._control = p.controller.control;
98
+ // Unwrap .swiper-wrapper > .swiper-slide into plain children; park helper elements (pagination, arrows...) until Mozert has built.
99
+ var wrap = el.querySelector(':scope > .swiper-wrapper');
100
+ this._parked = [];
101
+ if (wrap) {
102
+ Array.prototype.slice.call(el.children).forEach(function (c) { if (c !== wrap) { self._parked.push([c, c.nextSibling]); el.removeChild(c); } });
103
+ var kids = Array.prototype.slice.call(wrap.children);
104
+ el.removeChild(wrap);
105
+ kids.forEach(function (k) { el.appendChild(k); });
106
+ }
107
+ this._cleanOpts = o;
108
+ var m = this.mozert = new Mozert(el, Object.assign({}, o));
109
+ // re-attach parked helpers (pagination, navigation, scrollbar elements)
110
+ this._parked.forEach(function (pair) { el.appendChild(pair[0]); });
111
+ // pagination/scrollbar modules ran inside Mozert's build; if the host was parked they must be (re)built now
112
+ this._wireNav();
113
+ this._wireEvents();
114
+ // class mirroring
115
+ if (typeof MutationObserver === 'function') {
116
+ this._mo = new MutationObserver(function (recs) { recs.forEach(function (r) { if (r.type === 'attributes') mirror(r.target); else Array.prototype.forEach.call(r.addedNodes, function (n) { if (n.nodeType === 1) mirrorTree(n); }); }); });
117
+ var obsRoots = [el]; if (o.pagination && o.pagination.el) obsRoots.push(o.pagination.el); if (o.scrollbar && o.scrollbar.el) obsRoots.push(o.scrollbar.el);
118
+ obsRoots.forEach(function (r) { mirrorTree(r); self._mo.observe(r, { subtree: true, childList: true, attributes: true, attributeFilter: ['class'] }); });
119
+ }
120
+ ['beforeChange', 'afterChange', 'reInit'].forEach(function (e) { m.on(e, function () { self._neighbours(); }); });
121
+ this._neighbours();
122
+ // thumbs / controller via asNavFor-style syncing
123
+ var other = (p.thumbs && p.thumbs.swiper) || (p.controller && p.controller.control);
124
+ if (other) [].concat(other).forEach(function (t) { self._link(t); });
125
+ if (p.thumbs && p.thumbs.swiper) this._thumbsSetup(p.thumbs.swiper, p.thumbs.slideThumbActiveClass || 'swiper-slide-thumb-active');
126
+ this.mozert.on('beforeChange', function (s, old, real) { self.previousIndex = old; });
127
+ this._fire('init'); this._fire('afterInit');
128
+ return this;
129
+ };
130
+
131
+ P._wireNav = function () {
132
+ var self = this, m = this.mozert, n = this._nextEl, pv = this._prevEl;
133
+ this._navOff = [];
134
+ var on = function (e, f) { if (e) { e.addEventListener('click', f); self._navOff.push(function () { e.removeEventListener('click', f); }); } };
135
+ on(n, function (e) { e.preventDefault(); if (self.allowSlideNext) { m._user(); m.next(); } });
136
+ on(pv, function (e) { e.preventDefault(); if (self.allowSlidePrev) { m._user(); m.prev(); } });
137
+ var upd = function () {
138
+ if (n) { n.classList.toggle('swiper-button-disabled', !m.s.infinite && self.isEnd); n.classList.add('swiper-button-next'); }
139
+ if (pv) { pv.classList.toggle('swiper-button-disabled', !m.s.infinite && self.isBeginning); pv.classList.add('swiper-button-prev'); }
140
+ };
141
+ m.on('beforeChange', upd); m.on('afterChange', upd); m.on('reInit', upd); upd();
142
+ };
143
+
144
+ P._neighbours = function () {
145
+ var m = this.mozert; if (!m || !m._units) return;
146
+ var c = m.current, n = m._units.length;
147
+ m._units.forEach(function (u, i) {
148
+ u.classList.toggle('swiper-slide-next', n > 1 && i === (c + 1) % n);
149
+ u.classList.toggle('swiper-slide-prev', n > 1 && i === (c - 1 + n) % n);
150
+ });
151
+ };
152
+
153
+ P._wireEvents = function () {
154
+ var self = this, on = this.params.on;
155
+ if (on) Object.keys(on).forEach(function (k) { self.on(k, on[k]); });
156
+ var m = this.mozert;
157
+ m.on('afterChange', function () {
158
+ if (self.isEnd) self._fire('reachEnd'); if (self.isBeginning) self._fire('reachBeginning'); self._fire('slideChangeTransitionEnd'); self._fire('transitionEnd');
159
+ });
160
+ m.on('beforeChange', function () { self._fire('slideChange'); self._fire('slideChangeTransitionStart'); self._fire('transitionStart'); });
161
+ ['autoplayStart', 'autoplayStop', 'autoplayTimeLeft', 'zoomChange', 'breakpoint', 'setPosition', 'lazyLoaded', 'swipe'].forEach(function (k) {
162
+ m.on(k, function () { var a = Array.prototype.slice.call(arguments, 1); var sw = k === 'setPosition' ? 'resize' : k === 'lazyLoaded' ? 'lazyImageReady' : k === 'swipe' ? 'sliderMove' : k; self._fire.apply(self, [sw].concat(a)); });
163
+ });
164
+ m.on('destroy', function () { self._fire('destroy'); });
165
+ };
166
+
167
+ P._link = function (other) {
168
+ var self = this;
169
+ other = other && other.mozert ? other : null; if (!other) return;
170
+ var lock = false;
171
+ var sync = function (a, b) { a.mozert.on('beforeChange', function (s, o, real) { if (lock) return; lock = true; b.slideTo(real); lock = false; }); };
172
+ sync(self, other); sync(other, self);
173
+ };
174
+ P._thumbsSetup = function (t, cls) {
175
+ var self = this;
176
+ var mark = function () { (t.slides || []).forEach(function (s, i) { s.classList.toggle(cls, i === self.realIndex); }); };
177
+ this.mozert.on('beforeChange', mark); mark();
178
+ (t.slides || []).forEach(function (s, i) { s.addEventListener('click', function () { self.slideTo(i); }); });
179
+ };
180
+
181
+ /* ---- events (Swiper semantics: handler(swiper, ...args), `this` = swiper) ---- */
182
+ P.on = function (n, f, prepend) { var a = this._h[n] = this._h[n] || []; if (prepend) a.unshift(f); else a.push(f); return this; };
183
+ P.once = function (n, f) { var s = this; var w = function () { s.off(n, w); f.apply(s, arguments); }; w._o = f; return this.on(n, w); };
184
+ P.off = function (n, f) { if (!n) this._h = {}; else if (!f) delete this._h[n]; else this._h[n] = (this._h[n] || []).filter(function (x) { return x !== f && x._o !== f; }); return this; };
185
+ P.emit = function (n) { return this._fire.apply(this, arguments); };
186
+ P._fire = function (n) { var a = Array.prototype.slice.call(arguments, 1), s = this; (this._h[n] || []).slice().forEach(function (f) { f.apply(s, [s].concat(a)); }); (this._h['*'] || []).slice().forEach(function (f) { f.apply(s, [n, s].concat(a)); }); return this; };
187
+
188
+ /* ---- methods ---- */
189
+ P.slideTo = function (i, speed, run) { var m = this.mozert; if (speed === 0) m.goTo(i, true); else m.goTo(i); return this; };
190
+ P.slideToLoop = P.slideTo;
191
+ P.slideNext = function (speed) { this.mozert.next(); return this; };
192
+ P.slidePrev = function (speed) { this.mozert.prev(); return this; };
193
+ P.slideReset = function () { this.mozert._snapBack(); return this; };
194
+ P.update = P.updateSlides = P.updateSize = P.updateSlidesClasses = P.updateProgress = function () { this.mozert.refresh(); return this; };
195
+ P.enable = function () { this.mozert.setOption('draggable', true); return this; };
196
+ P.disable = function () { this.mozert.setOption('draggable', false); return this; };
197
+ P.changeDirection = function (d) { this.mozert.setOption('vertical', d === 'vertical'); return this; };
198
+ P.destroy = function (deleteInstance, clean) {
199
+ if (this.destroyed) return;
200
+ (this._navOff || []).forEach(function (f) { f(); });
201
+ if (this._mo) this._mo.disconnect();
202
+ this.mozert.destroy();
203
+ this.destroyed = true; this._fire('destroy');
204
+ if (deleteInstance !== false) delete this.el.swiper;
205
+ };
206
+ var toNode = function (h) { if (typeof h === 'string') { var d = document.createElement('div'); d.innerHTML = h.trim(); return d.firstElementChild || d; } return h; };
207
+ P.appendSlide = function (s) { var m = this.mozert; [].concat(s).forEach(function (x) { m.add(toNode(x)); }); return this; };
208
+ P.prependSlide = function (s) { var m = this.mozert; [].concat(s).reverse().forEach(function (x) { m.add(toNode(x), true); }); return this; };
209
+ P.addSlide = function (i, s) { var m = this.mozert; if (i <= 0) return this.prependSlide(s); [].concat(s).forEach(function (x, k) { m.add(toNode(x), i - 1 + k); }); return this; };
210
+ P.removeSlide = function (i) { var m = this.mozert; (Array.isArray(i) ? i.slice().sort(function (a, b) { return b - a; }) : [i]).forEach(function (k) { m.remove(k); }); return this; };
211
+ P.removeAllSlides = function () { this.mozert.removeAll(); return this; };
212
+
213
+ /* ---- properties ---- */
214
+ var def = function (k, g) { Object.defineProperty(P, k, { get: g, configurable: true }); };
215
+ def('activeIndex', function () { return this.mozert.currentSlide(); });
216
+ def('realIndex', function () { return this.mozert.currentSlide(); });
217
+ def('slides', function () { return this.mozert._units.slice(); });
218
+ def('wrapperEl', function () { return this.mozert.track; });
219
+ def('isBeginning', function () { var m = this.mozert; return !m.s.infinite && m.current <= 0; });
220
+ def('isEnd', function () { var m = this.mozert; return !m.s.infinite && m.current >= m.maxIndex; });
221
+ def('width', function () { return this.mozert.list.clientWidth; });
222
+ def('height', function () { return this.mozert.list.clientHeight; });
223
+ def('translate', function () { return this.mozert._cur; });
224
+ def('progress', function () { var m = this.mozert; return m.maxIndex ? Math.max(0, Math.min(1, m._pvFromT(m._cur) / m.maxIndex)) : 0; });
225
+ def('autoplay', function () { var m = this.mozert; return { running: m.isPlaying(), start: function () { m.play(); return true; }, stop: function () { m.pause(); return true; }, pause: function () { m.pause(); }, resume: function () { m.play(); } }; });
226
+ def('zoom', function () { var z = this.mozert.zoom; return z ? { in: z.in, out: z.out, toggle: z.toggle, scale: z.scale } : undefined; });
227
+ def('virtual', function () { return this.mozert.virtual; });
228
+
229
+ Swiper.use = function () { return Swiper; }; // modules are built in, kept so `Swiper.use([Navigation, Pagination])` code runs
230
+ Swiper.defaults = {};
231
+ Swiper.version = Mozert.version;
232
+ Swiper.default = Swiper;
233
+ Mozert.Swiper = Swiper;
234
+ if (typeof window !== 'undefined' && !window.Swiper) window.Swiper = Swiper;
235
+ return Swiper;
236
+ }));
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Mozert Swiper-style API v1.0.0 | MIT
3
+ * new Mozert.Swiper('.swiper', { slidesPerView: 3, loop: true, pagination: { el: '.swiper-pagination' } })
4
+ * Load after mozert.min.js. If `window.Swiper` is not defined, it is set to Mozert.Swiper so existing code keeps working.
5
+ */
6
+ ;(function(root,factory){if(typeof define==='function'&&define.amd)define(['mozert'],factory);else if(typeof module==='object'&&module.exports)module.exports=factory(require('./mozert.js'));else factory(root.Mozert);}(typeof self!=='undefined'?self:this,function(Mozert){'use strict';if(!Mozert)throw new Error('Mozert.Swiper needs Mozert loaded first');var isObj=function(v){return v&&typeof v==='object'&&!Array.isArray(v)&&!v.nodeType;};var node=function(v,scope){return!v?null:typeof v==='string'?(scope&&scope.querySelector(v))||document.querySelector(v):v;};var obj=function(v,d){return isObj(v)?v:(v?d||{}:null);};function mapOptions(p,ctx){var o={};if(p.slidesPerView!==undefined){if(p.slidesPerView==='auto')o.variableWidth=true;else{o.slidesToShow=p.slidesPerView;o.variableWidth=false;}}if(p.slidesPerGroup!==undefined)o.slidesToScroll=p.slidesPerGroup;if(p.spaceBetween!==undefined)o.spaceBetween=parseFloat(p.spaceBetween)||0;if(p.loop!==undefined)o.infinite=!!p.loop;if(p.speed!==undefined)o.speed=p.speed;if(p.initialSlide!==undefined)o.initialSlide=p.initialSlide;if(p.direction)o.vertical=p.direction==='vertical';if(p.centeredSlides!==undefined){o.centerMode=!!p.centeredSlides;o.centerPadding='0px';}if(p.autoHeight!==undefined)o.adaptiveHeight=!!p.autoHeight;if(p.allowTouchMove!==undefined){o.draggable=!!p.allowTouchMove;o.touchMove=!!p.allowTouchMove;}if(p.touchRatio!==undefined)o.touchRatio=p.touchRatio;if(p.threshold!==undefined)o.dragThreshold=Math.max(p.threshold,1);if(p.slidesOffsetBefore!==undefined)o.edgePadding=p.slidesOffsetBefore;if(p.a11y!==undefined)o.accessibility=p.a11y!==false;if(p.effect){o.effect=p.effect;['coverflow','cube','flip','cards','creative'].forEach(function(k){if(p[k+'Effect'])o[k+'Effect']=p[k+'Effect'];});}if(p.autoplay){var a=obj(p.autoplay,{});o.autoplay=true;o.autoplaySpeed=a.delay!==undefined?a.delay:3000;o.pauseOnHover=!!a.pauseOnMouseEnter;o.disableOnInteraction=a.disableOnInteraction!==false;o.autoplayReverse=!!a.reverseDirection;o.stopOnLastSlide=!!a.stopOnLastSlide;}else if(p.autoplay===false)o.autoplay=false;if(p.freeMode)o.freeMode=p.freeMode;if(p.mousewheel)o.mousewheel=p.mousewheel;if(p.keyboard)o.globalKeyboard=obj(p.keyboard,{}).enabled===false?false:p.keyboard;if(p.zoom){var z=obj(p.zoom,{});o.zoom={max:z.maxRatio||3,min:z.minRatio||1,toggle:z.toggle!==false};}if(p.parallax)o.parallax=true;if(p.virtual)o.virtual=p.virtual;if(p.hashNavigation)o.hashNavigation=p.hashNavigation;if(p.grid&&p.grid.rows>1){o.rows=p.grid.rows;o.slidesPerRow=1;}if(p.scrollbar){var sb=obj(p.scrollbar,{});o.scrollbar={el:node(sb.el,ctx.el),draggable:!!sb.draggable,hide:!!sb.hide};}if(p.pagination){var pg=obj(p.pagination,{});o.pagination={el:node(pg.el,ctx.el),type:pg.dynamicBullets&&(!pg.type||pg.type==='bullets')?'dynamic':pg.type||'bullets',clickable:pg.clickable!==false,renderBullet:pg.renderBullet,renderFraction:pg.renderFraction,renderCustom:pg.renderCustom,progressbarOpposite:!!pg.progressbarOpposite,dynamicMainBullets:pg.dynamicMainBullets||1};}return o;}var EV={slideChange:'beforeChange',slideChangeTransitionStart:'beforeChange',slideChangeTransitionEnd:'afterChange',transitionEnd:'afterChange',transitionStart:'beforeChange',resize:'setPosition',lazyImageReady:'lazyLoaded',touchEnd:'swipe',sliderMove:'swipe'};var CLS={'mozert-slide':'swiper-slide','mozert-current':'swiper-slide-active','mozert-active':'swiper-slide-visible','mozert-cloned':'swiper-slide-duplicate','mozert-track':'swiper-wrapper','mozert-vertical':'swiper-vertical','mozert-bullet':'swiper-pagination-bullet','mozert-bullet-active':'swiper-pagination-bullet-active','mozert-pagination':'swiper-pagination','mozert-pagination-bullets':'swiper-pagination-bullets','mozert-pagination-fraction':'swiper-pagination-fraction','mozert-pagination-progressbar':'swiper-pagination-progressbar','mozert-pg-fill':'swiper-pagination-progressbar-fill','mozert-pg-current':'swiper-pagination-current','mozert-pg-total':'swiper-pagination-total','mozert-scrollbar':'swiper-scrollbar','mozert-scrollbar-drag':'swiper-scrollbar-drag','mozert-initialized':'swiper-initialized'};function mirror(n){var l=n.classList;if(!l)return;Array.prototype.slice.call(l).forEach(function(c){var m=CLS[c];if(m&&!l.contains(m))l.add(m);});}function mirrorTree(r){mirror(r);var a=r.querySelectorAll('[class*="mozert-"]');for(var i=0;i<a.length;i++)mirror(a[i]);}function Swiper(target,params){if(!(this instanceof Swiper))return new Swiper(target,params);var el=typeof target==='string'?document.querySelector(target):target;if(!el)throw new Error('Swiper: container not found');if(el.swiper)return el.swiper;var p=this.params=Object.assign({slidesPerView:1,spaceBetween:0,speed:300,init:true},params||{});this.el=el;el.swiper=this;this.destroyed=false;this._h={};this.allowSlideNext=true;this.allowSlidePrev=true;this.previousIndex=0;if(p.init!==false)this.init();}var P=Swiper.prototype;P.init=function(){var self=this,p=this.params,el=this.el,i;this._fire('beforeInit');this._nextEl=node(p.navigation&&p.navigation.nextEl,el);this._prevEl=node(p.navigation&&p.navigation.prevEl,el);var o=mapOptions(p,this);o.arrows=!!p.navigation&&!(this._nextEl||this._prevEl)?true:false;o.dots=false;if(p.dir==='rtl'||el.getAttribute('dir')==='rtl'||p.rtl)o.rtl=true;if(p.breakpoints){o.mobileFirst=true;o.responsive=Object.keys(p.breakpoints).map(Number).sort(function(a,b){return a-b;}).map(function(bp){return{breakpoint:bp,settings:mapOptions(p.breakpoints[bp],self)};});}if(p.thumbs&&p.thumbs.swiper)o._thumbs=p.thumbs.swiper;if(p.controller&&p.controller.control)o._control=p.controller.control;var wrap=el.querySelector(':scope > .swiper-wrapper');this._parked=[];if(wrap){Array.prototype.slice.call(el.children).forEach(function(c){if(c!==wrap){self._parked.push([c,c.nextSibling]);el.removeChild(c);}});var kids=Array.prototype.slice.call(wrap.children);el.removeChild(wrap);kids.forEach(function(k){el.appendChild(k);});}this._cleanOpts=o;var m=this.mozert=new Mozert(el,Object.assign({},o));this._parked.forEach(function(pair){el.appendChild(pair[0]);});this._wireNav();this._wireEvents();if(typeof MutationObserver==='function'){this._mo=new MutationObserver(function(recs){recs.forEach(function(r){if(r.type==='attributes')mirror(r.target);else Array.prototype.forEach.call(r.addedNodes,function(n){if(n.nodeType===1)mirrorTree(n);});});});var obsRoots=[el];if(o.pagination&&o.pagination.el)obsRoots.push(o.pagination.el);if(o.scrollbar&&o.scrollbar.el)obsRoots.push(o.scrollbar.el);obsRoots.forEach(function(r){mirrorTree(r);self._mo.observe(r,{subtree:true,childList:true,attributes:true,attributeFilter:['class']});});}['beforeChange','afterChange','reInit'].forEach(function(e){m.on(e,function(){self._neighbours();});});this._neighbours();var other=(p.thumbs&&p.thumbs.swiper)||(p.controller&&p.controller.control);if(other)[].concat(other).forEach(function(t){self._link(t);});if(p.thumbs&&p.thumbs.swiper)this._thumbsSetup(p.thumbs.swiper,p.thumbs.slideThumbActiveClass||'swiper-slide-thumb-active');this.mozert.on('beforeChange',function(s,old,real){self.previousIndex=old;});this._fire('init');this._fire('afterInit');return this;};P._wireNav=function(){var self=this,m=this.mozert,n=this._nextEl,pv=this._prevEl;this._navOff=[];var on=function(e,f){if(e){e.addEventListener('click',f);self._navOff.push(function(){e.removeEventListener('click',f);});}};on(n,function(e){e.preventDefault();if(self.allowSlideNext){m._user();m.next();}});on(pv,function(e){e.preventDefault();if(self.allowSlidePrev){m._user();m.prev();}});var upd=function(){if(n){n.classList.toggle('swiper-button-disabled',!m.s.infinite&&self.isEnd);n.classList.add('swiper-button-next');}if(pv){pv.classList.toggle('swiper-button-disabled',!m.s.infinite&&self.isBeginning);pv.classList.add('swiper-button-prev');}};m.on('beforeChange',upd);m.on('afterChange',upd);m.on('reInit',upd);upd();};P._neighbours=function(){var m=this.mozert;if(!m||!m._units)return;var c=m.current,n=m._units.length;m._units.forEach(function(u,i){u.classList.toggle('swiper-slide-next',n>1&&i===(c+1)%n);u.classList.toggle('swiper-slide-prev',n>1&&i===(c-1+n)%n);});};P._wireEvents=function(){var self=this,on=this.params.on;if(on)Object.keys(on).forEach(function(k){self.on(k,on[k]);});var m=this.mozert;m.on('afterChange',function(){if(self.isEnd)self._fire('reachEnd');if(self.isBeginning)self._fire('reachBeginning');self._fire('slideChangeTransitionEnd');self._fire('transitionEnd');});m.on('beforeChange',function(){self._fire('slideChange');self._fire('slideChangeTransitionStart');self._fire('transitionStart');});['autoplayStart','autoplayStop','autoplayTimeLeft','zoomChange','breakpoint','setPosition','lazyLoaded','swipe'].forEach(function(k){m.on(k,function(){var a=Array.prototype.slice.call(arguments,1);var sw=k==='setPosition'?'resize':k==='lazyLoaded'?'lazyImageReady':k==='swipe'?'sliderMove':k;self._fire.apply(self,[sw].concat(a));});});m.on('destroy',function(){self._fire('destroy');});};P._link=function(other){var self=this;other=other&&other.mozert?other:null;if(!other)return;var lock=false;var sync=function(a,b){a.mozert.on('beforeChange',function(s,o,real){if(lock)return;lock=true;b.slideTo(real);lock=false;});};sync(self,other);sync(other,self);};P._thumbsSetup=function(t,cls){var self=this;var mark=function(){(t.slides||[]).forEach(function(s,i){s.classList.toggle(cls,i===self.realIndex);});};this.mozert.on('beforeChange',mark);mark();(t.slides||[]).forEach(function(s,i){s.addEventListener('click',function(){self.slideTo(i);});});};P.on=function(n,f,prepend){var a=this._h[n]=this._h[n]||[];if(prepend)a.unshift(f);else a.push(f);return this;};P.once=function(n,f){var s=this;var w=function(){s.off(n,w);f.apply(s,arguments);};w._o=f;return this.on(n,w);};P.off=function(n,f){if(!n)this._h={};else if(!f)delete this._h[n];else this._h[n]=(this._h[n]||[]).filter(function(x){return x!==f&&x._o!==f;});return this;};P.emit=function(n){return this._fire.apply(this,arguments);};P._fire=function(n){var a=Array.prototype.slice.call(arguments,1),s=this;(this._h[n]||[]).slice().forEach(function(f){f.apply(s,[s].concat(a));});(this._h['*']||[]).slice().forEach(function(f){f.apply(s,[n,s].concat(a));});return this;};P.slideTo=function(i,speed,run){var m=this.mozert;if(speed===0)m.goTo(i,true);else m.goTo(i);return this;};P.slideToLoop=P.slideTo;P.slideNext=function(speed){this.mozert.next();return this;};P.slidePrev=function(speed){this.mozert.prev();return this;};P.slideReset=function(){this.mozert._snapBack();return this;};P.update=P.updateSlides=P.updateSize=P.updateSlidesClasses=P.updateProgress=function(){this.mozert.refresh();return this;};P.enable=function(){this.mozert.setOption('draggable',true);return this;};P.disable=function(){this.mozert.setOption('draggable',false);return this;};P.changeDirection=function(d){this.mozert.setOption('vertical',d==='vertical');return this;};P.destroy=function(deleteInstance,clean){if(this.destroyed)return;(this._navOff||[]).forEach(function(f){f();});if(this._mo)this._mo.disconnect();this.mozert.destroy();this.destroyed=true;this._fire('destroy');if(deleteInstance!==false)delete this.el.swiper;};var toNode=function(h){if(typeof h==='string'){var d=document.createElement('div');d.innerHTML=h.trim();return d.firstElementChild||d;}return h;};P.appendSlide=function(s){var m=this.mozert;[].concat(s).forEach(function(x){m.add(toNode(x));});return this;};P.prependSlide=function(s){var m=this.mozert;[].concat(s).reverse().forEach(function(x){m.add(toNode(x),true);});return this;};P.addSlide=function(i,s){var m=this.mozert;if(i<=0)return this.prependSlide(s);[].concat(s).forEach(function(x,k){m.add(toNode(x),i-1+k);});return this;};P.removeSlide=function(i){var m=this.mozert;(Array.isArray(i)?i.slice().sort(function(a,b){return b-a;}):[i]).forEach(function(k){m.remove(k);});return this;};P.removeAllSlides=function(){this.mozert.removeAll();return this;};var def=function(k,g){Object.defineProperty(P,k,{get:g,configurable:true});};def('activeIndex',function(){return this.mozert.currentSlide();});def('realIndex',function(){return this.mozert.currentSlide();});def('slides',function(){return this.mozert._units.slice();});def('wrapperEl',function(){return this.mozert.track;});def('isBeginning',function(){var m=this.mozert;return!m.s.infinite&&m.current<=0;});def('isEnd',function(){var m=this.mozert;return!m.s.infinite&&m.current>=m.maxIndex;});def('width',function(){return this.mozert.list.clientWidth;});def('height',function(){return this.mozert.list.clientHeight;});def('translate',function(){return this.mozert._cur;});def('progress',function(){var m=this.mozert;return m.maxIndex?Math.max(0,Math.min(1,m._pvFromT(m._cur)/m.maxIndex)):0;});def('autoplay',function(){var m=this.mozert;return{running:m.isPlaying(),start:function(){m.play();return true;},stop:function(){m.pause();return true;},pause:function(){m.pause();},resume:function(){m.play();}};});def('zoom',function(){var z=this.mozert.zoom;return z?{in:z.in,out:z.out,toggle:z.toggle,scale:z.scale}:undefined;});def('virtual',function(){return this.mozert.virtual;});Swiper.use=function(){return Swiper;};Swiper.defaults={};Swiper.version=Mozert.version;Swiper.default=Swiper;Mozert.Swiper=Swiper;if(typeof window!=='undefined'&&!window.Swiper)window.Swiper=Swiper;return Swiper;}));