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C,KAAKE,iBACFI,cAAc,aACd0F,UAAUG,IAAI,cAGZkB,CACT,CAEA,MAAAjC,GACEpF,KAAKiB,gBAELjB,KAAKkB,UAAUlB,KAAK6F,iBACtB,E","sources":["webpack://endrun/./app/javascript/app/util/events.js","webpack://endrun/./app/components/photo_slideshow_component.js"],"sourcesContent":["/**\n * A constant to track whether custom events are supported.\n *\n * @private\n * @type {boolean}\n */\nconst supportsCustomEvent = typeof window.CustomEvent === 'function';\n\n/**\n * A wrapper around CustomEvent (for modern browers) and document.createEvent\n * (for older browsers). Can be removed in favor of CustomEvent when we drop\n * support for IE11.\n *\n * @template T\n * @param {string} type The type of event to create.\n * @param {CustomEventInit<T>} init The params to pass to the event.\n * @returns {CustomEvent<T>} The created event.\n */\nexport function createEvent(type, init) {\n  if (supportsCustomEvent) {\n    return new window.CustomEvent(type, init);\n  }\n\n  const event = document.createEvent('Event');\n\n  if (init) {\n    event.initEvent(type, init.bubbles, init.cancelable);\n    event.detail = init.detail;\n  } else {\n    event.initEvent(type, false, false);\n  }\n\n  return event;\n}\n","/*\n * TMP PHOTO SLIDESHOW\n * Original repo: https://github.com/themarshallproject/tmp-photo-slideshow\n */\n\n// packages\nimport defaults from 'underscore/modules/defaults.js';\nimport Hammer from 'hammerjs';\n\n// local\nimport { createEvent } from '$app/util/events.js';\n\nexport default class TMPSlideshow {\n  constructor(config) {\n    // Set default values for undefined options\n    const configWithDefaults = defaults(config, {\n      sizeByWindowHeight: true, // If true, photos will take up full screen height if they fit\n      mobileMaxWidth: 579, // Width at which to trigger mobile full-bleed style, -1 indicates no max width\n      startingSlide: 0, // Index of slide to initiate slideshow on\n      captionType: 'each', // TK\n    });\n\n    /** @type {HTMLElement} */\n    this.el = config.el;\n    this.config = configWithDefaults;\n    this.init();\n  }\n\n  init() {\n    this.containerElement = this.el;\n\n    if (this.config.slideData) {\n      this.buildSlideMarkup();\n    }\n\n    this.slideshowContent =\n      this.containerElement.querySelector('.slideshow-content');\n    this.slideWrapper = this.containerElement.querySelector('.slide-wrapper');\n    this.wrapperOffset = 0;\n    this.slides = this.containerElement.querySelectorAll('.slide');\n    this.captionWrapper = this.containerElement.querySelector(\n      '.slide-caption-wrapper'\n    );\n    this.captions = this.containerElement.querySelectorAll('.slide-caption');\n    this.navBtns = this.containerElement.querySelectorAll('.slideshow-btn');\n    this.slideProgress =\n      this.containerElement.querySelectorAll('.slide-progress');\n\n    this.sliderManager = new Hammer.Manager(this.slideshowContent);\n\n    this.buildProgressIcon();\n    this.sizeSlideshow();\n    this.goToSlide(this.config.startingSlide);\n    this.initEvents();\n  }\n\n  buildSlideMarkup() {\n    const slideMarkup = [];\n    const captionMarkup = [];\n\n    this.config.slideData.forEach((slide, i) => {\n      let thisSrcset = '';\n      let thisByline = '';\n\n      if (slide.srcset) {\n        thisSrcset = `srcset=\"${slide.srcset}\"`;\n      }\n\n      if (slide.byline) {\n        thisByline = `<span class=\"byline\">${slide.byline}</span>`;\n      }\n\n      slideMarkup.push(`\n        <div class=\"slide slide-${i}\">\n          <img src=\"${slide.filepath}\" ${thisSrcset} alt=\"${slide.caption}\">\n        </div>\n      `);\n\n      captionMarkup.push(`\n        <p class=\"slide-caption slide-caption-${k}\">\n          <span class=\"slide-progress\"></span>\n          <span class=\"caption-text\">${slide.caption}</span>\n          ${thisByline}\n        </p>\n      `);\n    });\n\n    const fullHTML = `\n    <div class=\"slideshow-content\">\n      <div class=\"slide-wrapper\">\n        ${slideMarkup.join('')}\n      </div>\n    </div>\n    <div class=\"slide-caption-wrapper\">\n      <a href=\"#\" data-dir=\"prev\" class=\"slideshow-btn slide-caption-btn btn-prev\"></a>\n        ${captionMarkup.join('')}\n      <a href=\"#\" data-dir=\"next\" class=\"slideshow-btn slide-caption-btn btn-next\"></a>\n    </div>`;\n\n    this.containerElement.innerHTML = fullHTML;\n  }\n\n  buildProgressIcon() {\n    const iconHTML = [];\n\n    for (var i = 0; i < this.slides.length; i++) {\n      iconHTML.push('<span class=\"progress-icon\"></span>');\n    }\n\n    this.slideProgress.forEach((element) => {\n      element.innerHTML = iconHTML.join('');\n    });\n  }\n\n  sizeSlideshow() {\n    // Save window size values\n    this.windowWidth = window.innerWidth;\n    this.windowHeight = window.innerHeight;\n\n    // Get overall width of slides\n    const allSlides = this.slides;\n    const allSlideImgs = Array.from(\n      this.containerElement.querySelectorAll('img')\n    );\n    const captionElement = this.containerElement.querySelector(\n      '.slide-caption-wrapper'\n    );\n    const captionBounds = captionElement.getBoundingClientRect();\n    const captionComputedStyle = window.getComputedStyle(captionElement);\n    const captionHeight =\n      captionBounds.height +\n      parseFloat(captionComputedStyle.marginTop) +\n      parseFloat(captionComputedStyle.marginBottom);\n\n    const maxWidth = Math.max(...allSlideImgs.map((img) => img.clientWidth));\n    const maxHeight = Math.max(...allSlideImgs.map((img) => img.clientHeight));\n\n    const sizingInfo = this.getSizingInfo(maxWidth, maxHeight, captionHeight);\n\n    // If we want to size the slideshow to fit full height\n    if (sizingInfo.measureBy === 'height') {\n      allSlides.forEach((slide) => {\n        slide.style.height = `${sizingInfo.slideHeight}px`;\n      });\n      this.slideshowContent.style.height = `${sizingInfo.slideHeight}px`;\n      this.slideWrapper.style.left = `${sizingInfo.slideLeft}px`;\n\n      let totalWidth = 0;\n\n      allSlides.forEach((slide) => {\n        slide.style.width = `${sizingInfo.slideWidth}px`;\n        slide.style.left = `${totalWidth}px`;\n\n        const slideBounds = slide.getBoundingClientRect();\n        const slideComputedStyle = window.getComputedStyle(slide);\n\n        totalWidth +=\n          slideBounds.width +\n          parseFloat(slideComputedStyle.marginLeft) +\n          parseFloat(slideComputedStyle.marginRight);\n      });\n    } else {\n      // Otherwise, use given CSS values for slide size\n      allSlides.forEach((slide) => {\n        slide.style.height = null;\n      });\n\n      this.slideshowContent.style.height = `${sizingInfo.slideHeight}px`;\n      this.slideWrapper.style.left = `${sizingInfo.slideLeft}px`;\n\n      let totalWidth = 0;\n\n      allSlides.forEach((slide) => {\n        slide.style.width = null;\n        slide.style.left = `${totalWidth}px`;\n\n        const slideBounds = slide.getBoundingClientRect();\n        const slideComputedStyle = window.getComputedStyle(slide);\n\n        totalWidth +=\n          slideBounds.width +\n          parseFloat(slideComputedStyle.marginLeft) +\n          parseFloat(slideComputedStyle.marginRight);\n      });\n    }\n\n    // Set caption width and nav button width so everything aligns\n    this.containerElement.querySelector(\n      '.slide-caption-wrapper'\n    ).style.width = `${sizingInfo.slideWidth}px`;\n\n    if (sizingInfo.slideLeft > 0) {\n      this.containerElement.querySelector(\n        '.slide-caption-btn'\n      ).style.width = `${sizingInfo.slideLeft}px`;\n    }\n  }\n\n  getSizingInfo(slideWidth, slideHeight, captionHeight) {\n    const windowHeight = this.windowHeight;\n    const windowWidth = this.windowWidth;\n    const slideshowPadding = 150;\n    const windowRatio =\n      (windowWidth - slideshowPadding) /\n      (windowHeight - slideshowPadding - captionHeight);\n    const slideRatio = slideWidth / slideHeight;\n\n    if (\n      !this.config.sizeByWindowHeight ||\n      windowRatio <= slideRatio ||\n      windowWidth <= this.config.mobileMaxWidth\n    ) {\n      return {\n        measureBy: 'width',\n        slideHeight: slideHeight,\n        slideWidth: slideWidth,\n        slideLeft: (windowWidth - slideWidth) / 2,\n      };\n    } else {\n      const computedHeight = windowHeight - slideshowPadding - captionHeight;\n      const computedWidth = slideRatio * computedHeight;\n\n      return {\n        measureBy: 'height',\n        slideHeight: computedHeight,\n        slideWidth: computedWidth,\n        slideLeft: (windowWidth - computedWidth) / 2,\n      };\n    }\n  }\n\n  initEvents() {\n    window.addEventListener('tmp_resize', () => {\n      this.resize();\n    });\n\n    const sizeSlideshow = this.sizeSlideshow.bind(this);\n\n    this.containerElement.querySelectorAll('img').forEach((img) => {\n      img.addEventListener(\n        'load',\n        () => {\n          sizeSlideshow();\n        },\n        { once: true }\n      );\n    });\n\n    this.navBtns.forEach((btn) => {\n      btn.addEventListener('click', (e) => {\n        e.preventDefault();\n\n        const thisBtn = e.currentTarget;\n        const activeIndex = this.activeSlideIndex;\n        let newIndex;\n\n        if (thisBtn.getAttribute('data-dir') === 'prev') {\n          newIndex = activeIndex - 1;\n        } else if (thisBtn.classList.contains('btn-replay')) {\n          newIndex = 0;\n        } else {\n          newIndex = activeIndex + 1;\n        }\n\n        // Protect against exceeding range\n        if (newIndex < 0 || newIndex > this.slides.length - 1) {\n          return;\n        }\n\n        this.goToSlide(newIndex);\n      });\n    });\n\n    // Track hover position to set cursor\n    this.slideshowContent.addEventListener('mousemove', (e) => {\n      const mouseX = e.clientX;\n\n      if (mouseX < this.windowWidth / 2 && this.activeSlideIndex > 0) {\n        this.slideshowContent.classList.add('slideshow-cursor-prev');\n        this.slideshowContent.classList.remove(\n          'slideshow-cursor-next',\n          'slideshow-cursor-hide',\n          'slideshow-cursor-replay'\n        );\n      } else if (this.activeSlideIndex == this.slides.length - 1) {\n        this.slideshowContent.classList.add('slideshow-cursor-replay');\n        this.slideshowContent.classList.remove(\n          'slideshow-cursor-next',\n          'slideshow-cursor-hide',\n          'slideshow-cursor-prev'\n        );\n      } else {\n        this.slideshowContent.classList.add('slideshow-cursor-next');\n        this.slideshowContent.classList.remove(\n          'slideshow-cursor-prev',\n          'slideshow-cursor-hide',\n          'slideshow-cursor-replay'\n        );\n      }\n    });\n\n    // Use Hammer.js to handle events, tap\n    this.sliderManager.add(new Hammer.Tap());\n\n    this.sliderManager.on('tap', (e) => {\n      const activeIndex = this.activeSlideIndex;\n      let newIndex;\n\n      if (e.center.x < this.windowWidth / 2 && activeIndex > 0) {\n        newIndex = activeIndex - 1;\n      } else if (activeIndex == this.slides.length - 1) {\n        newIndex = 0;\n      } else {\n        newIndex = activeIndex + 1;\n      }\n\n      // Protect against exceeding range\n      if (newIndex < 0 || newIndex > this.slides.length - 1) {\n        return;\n      }\n\n      this.goToSlide(newIndex);\n\n      const simulatedEvent = createEvent('mousemove');\n      simulatedEvent.clientX = e.center.x;\n      simulatedEvent.clientY = e.center.y;\n      this.slideshowContent.dispatchEvent(simulatedEvent);\n    });\n\n    // Add pan events to allow swipe/drag\n    this.sliderManager.add(new Hammer.Pan({ threshold: 0, pointers: 0 }));\n\n    // Drag along with pan movement\n    this.sliderManager.on('panleft panright', (e) => {\n      const currentOffset = this.wrapperOffset;\n      this.slideWrapper.style.transform = `translateX(${\n        currentOffset + e.deltaX\n      }px)`;\n    });\n\n    // Snap to correct slide after pan ends\n    this.sliderManager.on('panend', (e) => {\n      let activeSlideIndex = this.activeSlideIndex;\n      const sliderSensitivity =\n        0.2 * this.containerElement.getBoundingClientRect().width;\n\n      // Checking the velocity helps us handle super-quick motions like flicking\n      if (e.velocityX > 1) {\n        this.goToSlide(activeSlideIndex - 1);\n      } else if (e.velocityX < -1) {\n        this.goToSlide(activeSlideIndex + 1);\n      } else {\n        // We use our own check for sensitivity here instead of Hammer's threshold\n        // because we still want the slide to track the mouse's movement, but we want\n        // to provide a minimum distance it has to travel before advancing slides.\n        if (e.deltaX <= -sliderSensitivity) {\n          this.goToSlide(activeSlideIndex + 1);\n        } else if (e.deltaX > sliderSensitivity) {\n          this.goToSlide(activeSlideIndex - 1);\n        } else {\n          this.goToSlide(activeSlideIndex);\n        }\n      }\n    });\n  }\n\n  goToSlide(inputSlideIndex) {\n    let slideIndex = inputSlideIndex;\n    // Prevent from moving to nonexistent slides\n    if (inputSlideIndex < 0) {\n      slideIndex = 0;\n    } else if (inputSlideIndex > this.slides.length - 1) {\n      slideIndex = this.slides.length - 1;\n    }\n\n    // go to slide\n    const activeSlide = this.setActiveSlide(slideIndex);\n    this.activeSlideIndex = slideIndex;\n\n    // Move slide wrapper to display active slide\n    const slideOffset = activeSlide.style.left;\n    this.slideWrapper.classList.add('is-animating');\n    this.slideWrapper.style.transform = `translateX(-${slideOffset})`;\n    this.wrapperOffset = -1 * +slideOffset.replace('px', '');\n\n    clearTimeout(this.animationTimer);\n\n    this.animationTimer = setTimeout(() => {\n      this.slideWrapper.classList.remove('is-animating');\n    }, 700);\n  }\n\n  setActiveSlide(slideIndex) {\n    // set active slide\n    this.slideWrapper\n      .querySelectorAll('.slide-active, .slide-prev, .slide-next')\n      .forEach((slide) => {\n        slide.classList.remove('slide-active', 'slide-prev', 'slide-next');\n      });\n\n    const activeSlide = this.slides[slideIndex];\n    activeSlide.classList.add('slide-active');\n\n    const progressIconActiveElements = this.captionWrapper.querySelectorAll(\n      '.progress-icon-active'\n    );\n\n    progressIconActiveElements.forEach((element) => {\n      element.classList.remove('progress-icon-active');\n    });\n\n    this.slideProgress.forEach((element) => {\n      const progressIconElements = element.querySelectorAll('.progress-icon');\n      const progressIconElement = progressIconElements[slideIndex];\n      progressIconElement.classList.add('progress-icon-active');\n    });\n\n    if (slideIndex > 0) {\n      this.slides[slideIndex - 1].classList.add('slide-prev');\n    }\n\n    if (slideIndex < this.slides.length - 1) {\n      this.slides[slideIndex + 1].classList.add('slide-next');\n    }\n\n    if (this.config.captionType === 'each') {\n      // Set active caption\n      this.captionWrapper\n        .querySelectorAll('.slide-caption-active')\n        .forEach((caption) => {\n          caption.classList.remove('slide-caption-active');\n        });\n\n      const activeCaption = this.captions[slideIndex];\n      activeCaption.classList.add('slide-caption-active');\n    }\n\n    // Set button states\n    const btnHide = this.containerElement.querySelector('.btn-hide');\n\n    if (btnHide) {\n      btnHide.classList.remove('btn-hide');\n    }\n\n    const btnReplay = this.containerElement.querySelector('.btn-replay');\n\n    if (btnReplay) {\n      btnReplay.classList.remove('btn-replay');\n    }\n    // Hide nav button if it's at start of the slideshow\n    if (slideIndex === 0) {\n      this.containerElement\n        .querySelector('.btn-prev')\n        .classList.add('btn-hide');\n    } else if (slideIndex == this.slides.length - 1) {\n      // Change next button to replay icon\n      this.containerElement\n        .querySelector('.btn-next')\n        .classList.add('btn-replay');\n    }\n\n    return activeSlide;\n  }\n\n  resize() {\n    this.sizeSlideshow();\n    // After resizing, reset slidewrapper viewport in case image position has shifted\n    this.goToSlide(this.activeSlideIndex);\n  }\n}\n"],"names":["supportsCustomEvent","window","CustomEvent","createEvent","type","init","event","document","initEvent","bubbles","cancelable","detail","TMPSlideshow","constructor","config","configWithDefaults","sizeByWindowHeight","mobileMaxWidth","startingSlide","captionType","this","el","containerElement","slideData","buildSlideMarkup","slideshowContent","querySelector","slideWrapper","wrapperOffset","slides","querySelectorAll","captionWrapper","captions","navBtns","slideProgress","sliderManager","buildProgressIcon","sizeSlideshow","goToSlide","initEvents","slideMarkup","captionMarkup","forEach","slide","i","thisSrcset","thisByline","srcset","byline","push","filepath","caption","k","fullHTML","join","innerHTML","iconHTML","length","element","windowWidth","innerWidth","windowHeight","innerHeight","allSlides","allSlideImgs","Array","from","captionElement","captionBounds","getBoundingClientRect","captionComputedStyle","getComputedStyle","captionHeight","height","parseFloat","marginTop","marginBottom","maxWidth","Math","max","map","img","clientWidth","maxHeight","clientHeight","sizingInfo","getSizingInfo","measureBy","style","slideHeight","left","slideLeft","totalWidth","width","slideWidth","slideBounds","slideComputedStyle","marginLeft","marginRight","windowRatio","slideRatio","computedHeight","computedWidth","addEventListener","resize","bind","once","btn","e","preventDefault","thisBtn","currentTarget","activeIndex","activeSlideIndex","newIndex","getAttribute","classList","contains","clientX","add","remove","on","center","x","simulatedEvent","clientY","y","dispatchEvent","threshold","pointers","currentOffset","transform","deltaX","sliderSensitivity","velocityX","inputSlideIndex","slideIndex","activeSlide","setActiveSlide","slideOffset","replace","clearTimeout","animationTimer","setTimeout","btnHide","btnReplay"],"sourceRoot":""}