{"version":3,"sources":["webpack:///./src/js/modules/relatedNews.js"],"names":["Module","this","dom","el","slider","querySelector","breakpoint","window","matchMedia","checkBreakpoint","addListener","matches","initSlider","swiper","destroy","Swiper","slidesPerView","spaceBetween","init","Component"],"mappings":"uYAAA,QACA,S,ySAEMA,E,ieAEFC,KAAKC,IAAM,CACTC,GAAIF,KAAKE,GACTC,OAAQH,KAAKE,GAAGE,cAAc,sBAGhCJ,KAAKK,WAAaC,OAAOC,WAAW,sBACpCP,KAAKQ,oB,qCAILR,KAAKK,WAAWI,YAAcT,KAAKQ,gBAAnC,KAA8BR,S,wCAK9B,IAAgC,IAA5BA,KAAKK,WAAWK,QAMb,OAAgC,IAA5BV,KAAKK,WAAWK,QAElBV,KAAKW,kBAFP,EAJDX,KAAKY,QAAQZ,KAAKY,OAAOC,SAAQ,GAAM,K,mCAW7Cb,KAAKY,OAAS,IAAIE,UAAOd,KAAKC,IAAIE,OAAQ,CACxCY,cAAe,OACfC,aAAc,GACdC,MAAM,Q,GAjCSC,a,UAsCNnB","file":"69.ba160cba265b44293927.js","sourcesContent":["import { Component } from '@verndale/core';\nimport Swiper from 'swiper/js/swiper';\n\nclass Module extends Component {\n setupDefaults() {\n this.dom = {\n el: this.el,\n slider: this.el.querySelector('.swiper-container')\n };\n\n this.breakpoint = window.matchMedia('(min-width: 980px)');\n this.checkBreakpoint();\n }\n\n addListeners() {\n this.breakpoint.addListener(::this.checkBreakpoint);\n }\n\n checkBreakpoint() {\n // if larger viewport and multi-row layout needed\n if (this.breakpoint.matches === true) {\n // clean up old instances and inline styles when available\n if (this.swiper) this.swiper.destroy(true, true);\n // or/and do nothing\n return;\n // else if a small viewport and single column layout needed\n } else if (this.breakpoint.matches === false) {\n // fire small viewport version of swiper\n return this.initSlider();\n }\n }\n\n initSlider() {\n this.swiper = new Swiper(this.dom.slider, {\n slidesPerView: 'auto',\n spaceBetween: 35,\n init: true\n });\n }\n}\n\nexport default Module;\n"],"sourceRoot":""}