{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./app/javascript/packs/zoom.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","$","ZoomService","this","_activeZoom","_initialScrollPosition","_initialTouchPosition","_touchMoveListener","_$document","document","_$window","window","_$body","body","_boundClick","proxy","_clickHandler","Zoom","img","_fullHeight","_fullWidth","_overlay","_targetImageWrap","_targetImage","listen","on","_zoom","e","target","tagName","hasClass","metaKey","ctrlKey","open","getAttribute","src","width","OFFSET","_activeZoomClose","zoomImage","_scrollHandler","_keyHandler","_touchStart","addEventListener","attachEvent","bubbles","stopPropagation","cancelBubble","forceDispose","dispose","close","off","removeEventListener","scrollTop","deltaY","Math","abs","keyCode","preventDefault","event","returnValue","touches","pageY","_touchMove","_MAX_WIDTH","_MAX_HEIGHT","createElement","onload","Number","height","_zoomOriginal","className","parentNode","insertBefore","appendChild","addClass","attr","_calculateZoom","_triggerAnimation","offsetWidth","originalFullImageWidth","originalFullImageHeight","maxScaleFactor","viewportHeight","viewportWidth","imageAspectRatio","viewportAspectRatio","_imgScaleFactor","imageOffset","offset","viewportY","viewportX","imageCenterY","top","imageCenterX","left","_translateY","_translateX","targetTransform","imageWrapTransform","support","transition","css","removeClass","one","end","emulateTransitionEnd","replaceChild","removeChild","jQuery"],"mappings":"aACE,IAAIA,EAAmB,CAAC,EAGxB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,CAAC,GAUX,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,OACf,CAIAF,EAAoBQ,EAAIF,EAGxB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AKkB,UAE1ClB,KAAKS,OAAO2F,YAAY,8BAE5B,EAGAtG,GAAE,YACA,IAAIC,GAAcsB,QACpB,GAEF,CArRC,CAqRCqF,O","file":"js/zoom-c2ab7cb1c185aeacf8a9.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"//d398dps5t75y7j.cloudfront.net/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 13);\n","+function ($) { \"use strict\";\n\n /**\n * The zoom service\n */\n function ZoomService () {\n this._activeZoom =\n this._initialScrollPosition =\n this._initialTouchPosition =\n this._touchMoveListener = null\n\n this._$document = $(document)\n this._$window = $(window)\n this._$body = $(document.body)\n\n this._boundClick = $.proxy(this._clickHandler, this)\n }\n\n ZoomService.prototype.listen = function () {\n this._$body.on('click', '[data-action=\"zoom\"]', $.proxy(this._zoom, this))\n }\n\n ZoomService.prototype._zoom = function (e) {\n var target = e.target\n\n if (!target || target.tagName != 'IMG') return\n\n if (this._$body.hasClass('zoom-overlay-open')) return\n\n if (e.metaKey || e.ctrlKey) {\n return window.open((e.target.getAttribute('data-original') || e.target.src), '_blank')\n }\n\n if (target.width >= ($(window).width() - Zoom.OFFSET)) return\n\n this._activeZoomClose(true)\n\n this._activeZoom = new Zoom(target)\n this._activeZoom.zoomImage()\n\n // todo(fat): probably worth throttling this\n this._$window.on('scroll.zoom', $.proxy(this._scrollHandler, this))\n\n this._$document.on('keyup.zoom', $.proxy(this._keyHandler, this))\n this._$document.on('touchstart.zoom', $.proxy(this._touchStart, this))\n\n // we use a capturing phase here to prevent unintended js events\n // sadly no useCapture in jquery api (http://bugs.jquery.com/ticket/14953)\n if (document.addEventListener) {\n document.addEventListener('click', this._boundClick, true)\n } else {\n document.attachEvent('onclick', this._boundClick, true)\n }\n\n if ('bubbles' in e) {\n if (e.bubbles) e.stopPropagation()\n } else {\n // Internet Explorer before version 9\n e.cancelBubble = true\n }\n }\n\n ZoomService.prototype._activeZoomClose = function (forceDispose) {\n if (!this._activeZoom) return\n\n if (forceDispose) {\n this._activeZoom.dispose()\n } else {\n this._activeZoom.close()\n }\n\n this._$window.off('.zoom')\n this._$document.off('.zoom')\n\n document.removeEventListener('click', this._boundClick, true)\n\n this._activeZoom = null\n }\n\n ZoomService.prototype._scrollHandler = function (e) {\n if (this._initialScrollPosition === null) this._initialScrollPosition = $(window).scrollTop()\n var deltaY = this._initialScrollPosition - $(window).scrollTop()\n if (Math.abs(deltaY) >= 40) this._activeZoomClose()\n }\n\n ZoomService.prototype._keyHandler = function (e) {\n if (e.keyCode == 27) this._activeZoomClose()\n }\n\n ZoomService.prototype._clickHandler = function (e) {\n if (e.preventDefault) e.preventDefault()\n else event.returnValue = false\n\n if ('bubbles' in e) {\n if (e.bubbles) e.stopPropagation()\n } else {\n // Internet Explorer before version 9\n e.cancelBubble = true\n }\n\n this._activeZoomClose()\n }\n\n ZoomService.prototype._touchStart = function (e) {\n this._initialTouchPosition = e.touches[0].pageY\n $(e.target).on('touchmove.zoom', $.proxy(this._touchMove, this))\n }\n\n ZoomService.prototype._touchMove = function (e) {\n if (Math.abs(e.touches[0].pageY - this._initialTouchPosition) > 10) {\n this._activeZoomClose()\n $(e.target).off('touchmove.zoom')\n }\n }\n\n\n /**\n * The zoom object\n */\n function Zoom (img) {\n this._fullHeight =\n this._fullWidth =\n this._overlay =\n this._targetImageWrap = null\n\n this._targetImage = img\n\n this._$body = $(document.body)\n }\n\n Zoom.OFFSET = 80\n Zoom._MAX_WIDTH = 2560\n Zoom._MAX_HEIGHT = 4096\n\n Zoom.prototype.zoomImage = function () {\n var img = document.createElement('img')\n img.onload = $.proxy(function () {\n this._fullHeight = Number(img.height)\n this._fullWidth = Number(img.width)\n this._zoomOriginal()\n }, this)\n img.src = this._targetImage.src\n }\n\n Zoom.prototype._zoomOriginal = function () {\n this._targetImageWrap = document.createElement('div')\n this._targetImageWrap.className = 'zoom-img-wrap'\n\n this._targetImage.parentNode.insertBefore(this._targetImageWrap, this._targetImage)\n this._targetImageWrap.appendChild(this._targetImage)\n\n $(this._targetImage)\n .addClass('zoom-img')\n .attr('data-action', 'zoom-out')\n\n this._overlay = document.createElement('div')\n this._overlay.className = 'zoom-overlay'\n\n document.body.appendChild(this._overlay)\n\n this._calculateZoom()\n this._triggerAnimation()\n }\n\n Zoom.prototype._calculateZoom = function () {\n this._targetImage.offsetWidth // repaint before animating\n\n var originalFullImageWidth = this._fullWidth\n var originalFullImageHeight = this._fullHeight\n\n var scrollTop = $(window).scrollTop()\n\n var maxScaleFactor = originalFullImageWidth / this._targetImage.width\n\n var viewportHeight = ($(window).height() - Zoom.OFFSET)\n var viewportWidth = ($(window).width() - Zoom.OFFSET)\n\n var imageAspectRatio = originalFullImageWidth / originalFullImageHeight\n var viewportAspectRatio = viewportWidth / viewportHeight\n\n if (originalFullImageWidth < viewportWidth && originalFullImageHeight < viewportHeight) {\n this._imgScaleFactor = maxScaleFactor\n\n } else if (imageAspectRatio < viewportAspectRatio) {\n this._imgScaleFactor = (viewportHeight / originalFullImageHeight) * maxScaleFactor\n\n } else {\n this._imgScaleFactor = (viewportWidth / originalFullImageWidth) * maxScaleFactor\n }\n }\n\n Zoom.prototype._triggerAnimation = function () {\n this._targetImage.offsetWidth // repaint before animating\n\n var imageOffset = $(this._targetImage).offset()\n var scrollTop = $(window).scrollTop()\n\n var viewportY = scrollTop + ($(window).height() / 2)\n var viewportX = ($(window).width() / 2)\n\n var imageCenterY = imageOffset.top + (this._targetImage.height / 2)\n var imageCenterX = imageOffset.left + (this._targetImage.width / 2)\n\n this._translateY = viewportY - imageCenterY\n this._translateX = viewportX - imageCenterX\n\n var targetTransform = 'scale(' + this._imgScaleFactor + ')'\n var imageWrapTransform = 'translate(' + this._translateX + 'px, ' + this._translateY + 'px)'\n\n if ($.support.transition) {\n imageWrapTransform += ' translateZ(0)'\n }\n\n $(this._targetImage)\n .css({\n '-webkit-transform': targetTransform,\n '-ms-transform': targetTransform,\n 'transform': targetTransform\n })\n\n $(this._targetImageWrap)\n .css({\n '-webkit-transform': imageWrapTransform,\n '-ms-transform': imageWrapTransform,\n 'transform': imageWrapTransform\n })\n\n this._$body.addClass('zoom-overlay-open')\n }\n\n Zoom.prototype.close = function () {\n this._$body\n .removeClass('zoom-overlay-open')\n .addClass('zoom-overlay-transitioning')\n\n // we use setStyle here so that the correct vender prefix for transform is used\n $(this._targetImage)\n .css({\n '-webkit-transform': '',\n '-ms-transform': '',\n 'transform': ''\n })\n\n $(this._targetImageWrap)\n .css({\n '-webkit-transform': '',\n '-ms-transform': '',\n 'transform': ''\n })\n\n if (!$.support.transition) {\n return this.dispose()\n }\n\n $(this._targetImage)\n .one($.support.transition.end, $.proxy(this.dispose, this))\n .emulateTransitionEnd(300)\n }\n\n Zoom.prototype.dispose = function () {\n if (this._targetImageWrap && this._targetImageWrap.parentNode) {\n $(this._targetImage)\n .removeClass('zoom-img')\n .attr('data-action', 'zoom')\n\n this._targetImageWrap.parentNode.replaceChild(this._targetImage, this._targetImageWrap)\n this._overlay.parentNode.removeChild(this._overlay)\n\n this._$body.removeClass('zoom-overlay-transitioning')\n }\n }\n\n // wait for dom ready (incase script included before body)\n $(function () {\n new ZoomService().listen()\n })\n\n}(jQuery)\n"],"sourceRoot":""}