/**
 * lib.js
 */
;(() => {
  window.jsLib = {
    /** @type {MediaQueryList} */
    mqTablet: window.matchMedia(window.jsUtils.BREAKPOINT_TABLET),

    /** @type {MediaQueryList} */
    mqDesktop: window.matchMedia(window.jsUtils.BREAKPOINT_DESKTOP),

    getGapSwiper(gap, tabletGap, desktopGap) {
      let rate

      switch (true) {
        case this.mqDesktop.matches:
          rate = desktopGap / window.jsUtils.DESKTOP_WIDTH
          break
        case this.mqTablet.matches:
          rate = tabletGap / window.jsUtils.TABLET_WIDTH
          break
        default:
          rate = gap / window.jsUtils.MOBILE_WIDTH
          break
      }

      return document.documentElement.scrollWidth * rate
    }
  }
})()
