{"version":3,"sources":["../node_modules/react-medium-image-zoom/lib/index.js","../node_modules/react-medium-image-zoom/lib/defaults.js","../node_modules/react-medium-image-zoom/lib/helpers.js","../node_modules/react-medium-image-zoom/lib/keyboardEvents.js","../node_modules/react-medium-image-zoom/lib/ImageZoom.js","../node_modules/react-medium-image-zoom/lib/EventsWrapper.js","../node_modules/react-medium-image-zoom/lib/Zoom.js","../node_modules/react-medium-image-zoom/lib/Overlay.js"],"names":["Object","defineProperty","exports","value","obj","_ImageZoom","require","_ImageZoom2","__esModule","default","defaults","errors","controlled","uncontrolled","styles","image","cursor","zoomImage","position","transition","transform","transformOrigin","willChange","zoomContainer","top","right","bottom","left","zIndex","overlay","backgroundColor","opacity","transitionDuration","createPortalContainer","tag","portal","document","createElement","body","appendChild","removePortalContainer","removeChild","fetchImage","cb","src","srcSet","sizes","img","Image","addEventListener","onLoad","removeEventListener","srcset","getScale","_ref","width","height","zoomMargin","scaleX","window","innerWidth","scaleY","innerHeight","Math","min","getMaxDimensionScale","_ref2","naturalWidth","naturalHeight","scale","ratio","isMaxDimension","clientWidth","clientHeight","enterKey","keys","keyCode","isKey","e","indexOf","key","isSpaceBarKey","isEnterOrSpaceBarKey","isTabKey","isEscapeKey","_extends","assign","target","i","arguments","length","source","prototype","hasOwnProperty","call","_createClass","defineProperties","props","descriptor","enumerable","configurable","writable","Constructor","protoProps","staticProps","_react","_react2","_interopRequireDefault","_propTypes","_defaults2","_helpers","_keyboardEvents","_EventsWrapper2","_Zoom2","isControlled","isZoomed","undefined","ImageZoom","_Component","instance","TypeError","_classCallCheck","this","_this","self","ReferenceError","_possibleConstructorReturn","__proto__","getPrototypeOf","state","isDisabled","wasZoomed","prevSrc","isClosing","_handleKeyDown","bind","_handleLoad","_handleLoadError","_handleUnzoom","_handleZoom","subClass","superClass","create","constructor","setPrototypeOf","_inherits","prevProps","prevState","Error","prevIsZoomed","portalInstance","unzoom","force","_this2","_props","defaultStyles","propsIsZoomed","shouldRespectMaxDimension","_state","stateIsZoomed","attrs","tabIndex","style","_getImageStyle","onMouseDown","_preventFocus","onClick","onKeyDown","Fragment","ref","x","onError","node","controlledEventFn","_getControlledEventFn","allowAccessibilityClose","_allowTabNavigation","Number","onUnzoom","_props2","setState","_props3","isZoomedP","_state2","isZoomedSt","isHidden","visibility","_checkShouldDisableComponent","Function","preventDefault","shouldHandleZoom","onZoom","allowRefocus","_this3","changes","shouldReplaceImage","focus","get","Component","propTypes","shape","string","isRequired","alt","className","object","bool","func","_reactDom","EventsWrapper","_handleScroll","_handleResize","_handleTouchStart","_handleTouchMove","_handleTouchEnd","pageYOffset","loadTimeout","setTimeout","clearTimeout","createPortal","_cloneChild","child","cloneElement","Children","only","children","unzoomForEnterOrSpace","unzoomForEscape","forceUpdate","abs","yTouchPosition","touches","clientY","element","getControlledEventFn","_Overlay2","Zoom","hasLoaded","currentSrc","tmpSrc","_handleImageLoad","_props$zoomImage","_getZoomImageStyle","_getZoomContainerStyle","isVisible","TmpImg","imageOffset","getBoundingClientRect","viewportX","viewportY","zoomStyle","number","_objectWithoutProperties","getTmpStyle","tmpStyle","Overlay","_PureComponent","isMounted","_getStyle","PureComponent"],"mappings":"sGAEAA,OAAOC,eAAeC,EAAS,aAAc,CAC3CC,OAAO,IAGT,IAIgCC,EAJ5BC,EAAaC,EAAQ,KAErBC,GAE4BH,EAFSC,IAEYD,EAAII,WAAaJ,EAAM,CAAEK,QAASL,GAEvFF,EAAQO,QAAUF,EAAYE,S,iCCV9BT,OAAOC,eAAeC,EAAS,aAAc,CAC3CC,OAAO,IAET,IAEIO,EAAW,CACbC,OAAQ,CACNC,WAAY,gTACZC,aAAc,iTAEhBC,OAAQ,CACNC,MAAO,CACLC,OAAQ,WAEVC,UAAW,CACTD,OAAQ,WACRE,SAAU,WACVC,WAAY,kBACZC,UAAW,gCACXC,gBAAiB,gBACjBC,WAAY,wBAEdC,cAAe,CACbL,SAAU,QACVM,IAAK,EACLC,MAAO,EACPC,OAAQ,EACRC,KAAM,EACNC,O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4B,KAAMzB,IAK9G,OAHA0B,EAAMM,MAAQ,CACZgI,WAAW,GAENtI,EAsBT,OAnCF,SAAmBiB,EAAUC,GAAc,GAA0B,oBAAfA,GAA4C,OAAfA,EAAuB,MAAM,IAAIrB,UAAU,kEAAoEqB,GAAeD,EAAShD,UAAY5F,OAAO8I,OAAOD,GAAcA,EAAWjD,UAAW,CAAEmD,YAAa,CAAE5I,MAAOyI,EAAUzC,YAAY,EAAOE,UAAU,EAAMD,cAAc,KAAeyC,IAAY7I,OAAOgJ,eAAiBhJ,OAAOgJ,eAAeJ,EAAUC,GAAcD,EAASb,UAAYc,GAG/dI,CAAU8G,EAASC,GAanBjK,EAAagK,EAAS,CAAC,CACrB/K,IAAK,oBACL7E,MAAO,WACLuH,KAAK0D,SAAS,CAAE6E,WAAW,MAE5B,CACDjL,IAAK,SACL7E,MAAO,WACL,OAAOuG,EAAQjG,QAAQ4B,cAAc,MAAO,CAAE6H,MAAOxC,KAAKwI,gBAE3D,CACDlL,IAAK,YACL7E,MAAO,WACL,IACI4B,EAAsB,GADV2F,KAAKO,MAAMgI,WAAavI,KAAKzB,MAAMmJ,WAEnD,OAAO/J,EAAS,GAAIwB,EAAWpG,QAAQK,OAAOe,QAAS,CAAEE,QAASA,GAAW2F,KAAKzB,MAAM0D,cAAc9H,aAInGkO,EAjCK,CAkCZtJ,EAAO0J,eAETjQ,EAAQO,QAAUsP,EAGlBA,EAAQxD,UAAY,CAClB6C,UAAWxI,EAAWkG,KAAKJ,WAC3B/C,cAAe/C,EAAWiG,OAAOH","file":"static/js/0.204d2a92.chunk.js","sourcesContent":["'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _ImageZoom = require('./ImageZoom');\n\nvar _ImageZoom2 = _interopRequireDefault(_ImageZoom);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _ImageZoom2.default;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar transitionDuration = 300;\n\nvar defaults = {\n errors: {\n controlled: 'A component is changing a react-medium-image-zoom component from a controlled component to an uncontrolled one. ImageZoom elements should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled image zoom element for the lifetime of the component.',\n uncontrolled: 'A component is changing a react-medium-image-zoom component from an uncontrolled component to a controlled one. ImageZoom elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled image zoom element for the lifetime of the component.'\n },\n styles: {\n image: {\n cursor: 'zoom-in'\n },\n zoomImage: {\n cursor: 'zoom-out',\n position: 'absolute',\n transition: 'transform ' + transitionDuration + 'ms',\n transform: 'translate3d(0, 0, 0) scale(1)',\n transformOrigin: 'center center',\n willChange: 'transform, top, left'\n },\n zoomContainer: {\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n zIndex: 99999\n },\n overlay: {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n backgroundColor: '#fff',\n opacity: 0,\n transition: 'opacity ' + transitionDuration + 'ms'\n }\n },\n transitionDuration: transitionDuration\n};\n\nexports.default = defaults;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar createPortalContainer = exports.createPortalContainer = function createPortalContainer(tag) {\n var portal = document.createElement(tag);\n document.body.appendChild(portal);\n return portal;\n};\n\nvar removePortalContainer = exports.removePortalContainer = function removePortalContainer(portal) {\n document.body.removeChild(portal);\n};\n\nvar fetchImage = exports.fetchImage = function fetchImage(image, cb) {\n var src = image.src,\n srcSet = image.srcSet,\n sizes = image.sizes;\n\n var img = new Image();\n var onLoad = function onLoad() {\n cb(img);\n\n /**\n * If using srcset, future resize events can trigger\n * additional onload events to fire.\n * Remove listener after first load\n */\n img.removeEventListener('load', onLoad);\n };\n img.addEventListener('load', onLoad);\n img.src = src;\n if (srcSet) img.srcset = srcSet;\n if (sizes) img.sizes = sizes;\n};\n\n/**\n * Figure out how much to scale based\n * solely on no maxing out the browser\n */\nvar getScale = exports.getScale = function getScale(_ref) {\n var width = _ref.width,\n height = _ref.height,\n zoomMargin = _ref.zoomMargin;\n\n var scaleX = window.innerWidth / (width + zoomMargin);\n var scaleY = window.innerHeight / (height + zoomMargin);\n return Math.min(scaleX, scaleY);\n};\n\n/**\n * Figure out how much to scale so you're\n * not larger than the original image\n */\nvar getMaxDimensionScale = exports.getMaxDimensionScale = function getMaxDimensionScale(_ref2) {\n var width = _ref2.width,\n height = _ref2.height,\n naturalWidth = _ref2.naturalWidth,\n naturalHeight = _ref2.naturalHeight,\n zoomMargin = _ref2.zoomMargin;\n\n var scale = getScale({\n width: naturalWidth,\n height: naturalHeight,\n zoomMargin: zoomMargin\n });\n var ratio = naturalWidth > naturalHeight ? naturalWidth / width : naturalHeight / height;\n return scale > 1 ? ratio : scale * ratio;\n};\n\nvar isMaxDimension = exports.isMaxDimension = function isMaxDimension(img) {\n return img.clientWidth >= img.naturalWidth || img.clientHeight >= img.naturalHeight;\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar enterKey = {\n keys: ['Enter'],\n keyCode: 13\n};\n\nvar tabKey = {\n keys: ['Tab'],\n keyCode: 9\n};\n\nvar spaceBarKey = {\n keys: [' '],\n keyCode: 32\n};\n\nvar escapeKey = {\n keys: ['Escape', 'Esc'],\n keyCode: 27\n\n /**\n * Per the MDN, KeyboardEvent.keyCode and KeyboardEvent.which\n * are deprecated. KeyboardEvent.code is not to be used to\n * determine what character corresponds with a key event\n * and is also not supported on Edge. KeyboardEvent.key is the\n * preferred method, but seems less reliable than keyCode given\n * it returns different strings for different browsers; ex: \"Escape\"\n * in Chrome, but \"Esc\" in Edge. This function future proofs\n * against deprecation, while still giving preference to the more\n * reliable keyCode.\n * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode\n * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code\n * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key\n * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/which\n *\n * KeyMap : { keyCode: Number, keys: [ String ] }\n * isKey : KeyMap -> KeyboardEvent -> Boolean\n */\n};var isKey = function isKey(_ref) {\n var keyCode = _ref.keyCode,\n keys = _ref.keys;\n return function (e) {\n return e.keyCode ? e.keyCode === keyCode : keys.indexOf(e.key) !== -1;\n };\n};\n\n// is<X>Key : KeyboardEvent -> Boolean\nvar isEnterOrSpaceBarKey = exports.isEnterOrSpaceBarKey = function isEnterOrSpaceBarKey(e) {\n return isKey(enterKey)(e) || isSpaceBarKey(e);\n};\nvar isTabKey = exports.isTabKey = isKey(tabKey);\nvar isSpaceBarKey = exports.isSpaceBarKey = isKey(spaceBarKey);\nvar isEscapeKey = exports.isEscapeKey = isKey(escapeKey);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _defaults = require('./defaults');\n\nvar _defaults2 = _interopRequireDefault(_defaults);\n\nvar _helpers = require('./helpers');\n\nvar _keyboardEvents = require('./keyboardEvents');\n\nvar _EventsWrapper = require('./EventsWrapper');\n\nvar _EventsWrapper2 = _interopRequireDefault(_EventsWrapper);\n\nvar _Zoom = require('./Zoom');\n\nvar _Zoom2 = _interopRequireDefault(_Zoom);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar isControlled = function isControlled(isZoomed) {\n return isZoomed !== null && isZoomed !== undefined;\n};\nvar focusableTabIndex = 0;\nvar unfocusableTabIndex = -1;\n\nvar ImageZoom = function (_Component) {\n _inherits(ImageZoom, _Component);\n\n function ImageZoom(props) {\n _classCallCheck(this, ImageZoom);\n\n var _this = _possibleConstructorReturn(this, (ImageZoom.__proto__ || Object.getPrototypeOf(ImageZoom)).call(this, props));\n\n _this.state = {\n isDisabled: false,\n isZoomed: false,\n wasZoomed: false,\n src: props.image.src,\n prevSrc: props.image.src,\n isClosing: false\n };\n\n _this._handleKeyDown = _this._handleKeyDown.bind(_this);\n _this._handleLoad = _this._handleLoad.bind(_this);\n _this._handleLoadError = _this._handleLoadError.bind(_this);\n _this._handleUnzoom = _this._handleUnzoom.bind(_this);\n _this._handleZoom = _this._handleZoom.bind(_this);\n return _this;\n }\n\n _createClass(ImageZoom, [{\n key: 'componentDidUpdate',\n\n\n /**\n * When the component's state updates, check for changes\n * and either zoom or start the unzoom procedure.\n * NOTE: We need to differentiate whether this is a\n * controlled or uncontrolled component and do the check\n * based off of that.\n */\n value: function componentDidUpdate(prevProps, prevState) {\n if (!isControlled(prevProps.isZoomed) && isControlled(this.props.isZoomed)) {\n throw new Error(_defaults2.default.errors.uncontrolled);\n } else if (isControlled(prevProps.isZoomed) && !isControlled(this.props.isZoomed)) {\n throw new Error(_defaults2.default.errors.controlled);\n }\n\n var prevIsZoomed = isControlled(prevProps.isZoomed) ? prevProps.isZoomed : prevState.isZoomed;\n var isZoomed = isControlled(this.props.isZoomed) ? this.props.isZoomed : this.state.isZoomed;\n if (prevIsZoomed !== isZoomed && !isZoomed && this.portalInstance) {\n this.portalInstance.unzoom({ force: true });\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props = this.props,\n defaultStyles = _props.defaultStyles,\n image = _props.image,\n propsIsZoomed = _props.isZoomed,\n shouldRespectMaxDimension = _props.shouldRespectMaxDimension,\n zoomImage = _props.zoomImage,\n zoomMargin = _props.zoomMargin,\n _state = this.state,\n isDisabled = _state.isDisabled,\n stateIsZoomed = _state.isZoomed,\n src = _state.src,\n isClosing = _state.isClosing;\n\n /**\n * Take whatever attributes you want to pass the image\n * and then override with the properties we need,\n * including using state as source of truth for hi/low-res\n * version img src.\n * Also, disable any clicking if the component is\n * already at its maximum dimensions.\n */\n\n var attrs = _extends({}, !isDisabled && { tabIndex: focusableTabIndex }, image, { src: src, style: this._getImageStyle() }, !isDisabled && {\n onMouseDown: this._preventFocus,\n onClick: this._handleZoom,\n onKeyDown: this._handleKeyDown\n });\n var isZoomed = isControlled(propsIsZoomed) ? propsIsZoomed : stateIsZoomed;\n\n return _react2.default.createElement(\n _react.Fragment,\n null,\n _react2.default.createElement('img', _extends({}, attrs, {\n key: 'image',\n ref: function ref(x) {\n _this2.image = x;\n },\n onLoad: this._handleLoad,\n onError: this._handleLoadError\n })),\n this.image && (isZoomed || isClosing) ? _react2.default.createElement(\n _EventsWrapper2.default,\n {\n key: 'portal',\n ref: function ref(node) {\n _this2.portalInstance = node;\n },\n controlledEventFn: this._getControlledEventFn(),\n allowAccessibilityClose: this._allowTabNavigation()\n },\n _react2.default.createElement(_Zoom2.default, {\n defaultStyles: defaultStyles,\n image: this.image,\n shouldRespectMaxDimension: shouldRespectMaxDimension,\n zoomImage: zoomImage,\n zoomMargin: Number(zoomMargin),\n onUnzoom: this._handleUnzoom\n })\n ) : null\n );\n }\n\n /**\n * If the image should not exceed its original\n * dimensions AND there is no zoomImage AND the\n * image is already rendered at its maximum dimensions,\n * then we shouldn't try to zoom it at all. We currently\n * only do this on componentDidMount, though on window\n * resize could be something to consider if necessary.\n */\n\n }, {\n key: '_checkShouldDisableComponent',\n value: function _checkShouldDisableComponent() {\n var _props2 = this.props,\n shouldRespectMaxDimension = _props2.shouldRespectMaxDimension,\n zoomImage = _props2.zoomImage;\n\n var isDisabled = shouldRespectMaxDimension && !zoomImage && (0, _helpers.isMaxDimension)(this.image);\n\n this.setState({ isDisabled: isDisabled });\n }\n }, {\n key: '_getImageStyle',\n value: function _getImageStyle() {\n var _props3 = this.props,\n defaultStyles = _props3.defaultStyles,\n image = _props3.image,\n isZoomedP = _props3.isZoomed,\n _state2 = this.state,\n isDisabled = _state2.isDisabled,\n isZoomedSt = _state2.isZoomed,\n isClosing = _state2.isClosing;\n\n\n var isHidden = isZoomedSt || isZoomedP || isClosing;\n\n return _extends({}, _defaults2.default.styles.image, isHidden && { visibility: 'hidden' }, defaultStyles.image, image.style, isDisabled && { cursor: 'inherit' });\n }\n\n /**\n * We need to wait for the main image\n * to load before we can do any width/height\n * checks on it.\n */\n\n }, {\n key: '_handleLoad',\n value: function _handleLoad(e) {\n this._checkShouldDisableComponent();\n\n var cb = this.props.image.onLoad || Function.prototype;\n cb(e);\n }\n }, {\n key: '_handleLoadError',\n value: function _handleLoadError(e) {\n this.setState({ isDisabled: true });\n\n var cb = this.props.image.onError || Function.prototype;\n cb(e);\n }\n }, {\n key: '_handleKeyDown',\n value: function _handleKeyDown(e) {\n if ((0, _keyboardEvents.isEnterOrSpaceBarKey)(e)) {\n e.preventDefault();\n this._handleZoom(e);\n }\n }\n }, {\n key: '_preventFocus',\n value: function _preventFocus(e) {\n e.preventDefault();\n }\n }, {\n key: '_handleZoom',\n value: function _handleZoom(e) {\n if (!isControlled(this.props.isZoomed) && this.props.shouldHandleZoom(e)) {\n this.setState({ isZoomed: true }, this.props.onZoom);\n } else {\n this.props.onZoom();\n }\n }\n\n /**\n * This gets passed to the zoomed component as a callback\n * to trigger when the time is right to shut down the zoom.\n * If `shouldReplaceImage`, update the normal image we're showing\n * with the zoomed image -- useful when wanting to replace a low-res\n * image with a high-res one once it's already been downloaded.\n * It also cleans up the zoom references and then updates state.\n */\n\n }, {\n key: '_handleUnzoom',\n value: function _handleUnzoom(src, allowRefocus) {\n var _this3 = this;\n\n return function () {\n var changes = _extends({ isZoomed: false, isClosing: false }, _this3.props.shouldReplaceImage && { src: src });\n\n _this3.setState(changes, _this3.props.onUnzoom);\n\n if (allowRefocus && _this3._allowTabNavigation()) {\n _this3.image.focus();\n }\n };\n }\n }, {\n key: '_getControlledEventFn',\n value: function _getControlledEventFn() {\n return isControlled(this.props.isZoomed) ? this.props.onUnzoom : null;\n }\n }, {\n key: '_allowTabNavigation',\n value: function _allowTabNavigation() {\n return this.image && this.image.tabIndex !== unfocusableTabIndex;\n }\n }], [{\n key: 'getDerivedStateFromProps',\n value: function getDerivedStateFromProps(props, state) {\n /**\n * When component is controlled, we need a flag\n * set when it's about to close in order to keep\n * hiding the original image on the page until the\n * unzooming is complete\n */\n var isClosing = state.wasZoomed && !props.isZoomed || state.isClosing;\n // If the consumer wants to change the image's src, then so be it.\n var src = props.image.src !== state.prevSrc ? props.image.src : state.src;\n\n return {\n src: src,\n isClosing: isClosing,\n // Keep track of previous props\n wasZoomed: props.isZoomed,\n prevSrc: props.image.src\n };\n }\n }, {\n key: 'defaultProps',\n get: function get() {\n return {\n shouldReplaceImage: true,\n shouldRespectMaxDimension: false,\n zoomMargin: 40,\n defaultStyles: {\n zoomContainer: {},\n overlay: {},\n image: {},\n zoomImage: {}\n },\n shouldHandleZoom: function shouldHandleZoom() {\n return true;\n },\n onZoom: function onZoom() {},\n onUnzoom: function onUnzoom() {}\n };\n }\n }]);\n\n return ImageZoom;\n}(_react.Component);\n\nexports.default = ImageZoom;\n\n\nImageZoom.propTypes = {\n image: (0, _propTypes.shape)({\n src: _propTypes.string.isRequired,\n alt: _propTypes.string,\n className: _propTypes.string,\n style: _propTypes.object\n }).isRequired,\n zoomImage: (0, _propTypes.shape)({\n src: _propTypes.string,\n alt: _propTypes.string,\n className: _propTypes.string,\n style: _propTypes.object\n }),\n defaultStyles: _propTypes.object,\n isZoomed: _propTypes.bool,\n shouldHandleZoom: _propTypes.func,\n shouldReplaceImage: _propTypes.bool,\n shouldRespectMaxDimension: _propTypes.bool,\n onZoom: _propTypes.func,\n onUnzoom: _propTypes.func\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require('react-dom');\n\nvar _propTypes = require('prop-types');\n\nvar _defaults = require('./defaults');\n\nvar _defaults2 = _interopRequireDefault(_defaults);\n\nvar _helpers = require('./helpers');\n\nvar _keyboardEvents = require('./keyboardEvents');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar EventsWrapper = function (_Component) {\n _inherits(EventsWrapper, _Component);\n\n function EventsWrapper() {\n _classCallCheck(this, EventsWrapper);\n\n var _this = _possibleConstructorReturn(this, (EventsWrapper.__proto__ || Object.getPrototypeOf(EventsWrapper)).call(this));\n\n _this.portal = (0, _helpers.createPortalContainer)('div');\n _this.unzoom = _this.unzoom.bind(_this);\n _this._handleScroll = _this._handleScroll.bind(_this);\n _this._handleKeyDown = _this._handleKeyDown.bind(_this);\n _this._handleResize = _this._handleResize.bind(_this);\n _this._handleTouchStart = _this._handleTouchStart.bind(_this);\n _this._handleTouchMove = _this._handleTouchMove.bind(_this);\n _this._handleTouchEnd = _this._handleTouchEnd.bind(_this);\n return _this;\n }\n\n _createClass(EventsWrapper, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n this.pageYOffset = window.pageYOffset;\n this.loadTimeout = setTimeout(function () {\n window.addEventListener('scroll', _this2._handleScroll);\n window.addEventListener('keydown', _this2._handleKeyDown);\n window.addEventListener('ontouchstart', _this2._handleTouchStart);\n window.addEventListener('ontouchmove', _this2._handleTouchMove);\n window.addEventListener('ontouchend', _this2._handleTouchEnd);\n window.addEventListener('ontouchcancel', _this2._handleTouchEnd);\n window.addEventListener('resize', _this2._handleResize);\n }, _defaults2.default.transitionDuration);\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n clearTimeout(this.loadTimeout);\n window.removeEventListener('scroll', this._handleScroll);\n window.removeEventListener('keydown', this._handleKeyDown);\n window.removeEventListener('ontouchstart', this._handleTouchStart);\n window.removeEventListener('ontouchmove', this._handleTouchMove);\n window.removeEventListener('ontouchend', this._handleTouchEnd);\n window.removeEventListener('ontouchcancel', this._handleTouchEnd);\n window.removeEventListener('resize', this._handleResize);\n (0, _helpers.removePortalContainer)(this.portal);\n }\n }, {\n key: 'render',\n value: function render() {\n return this.portal ? (0, _reactDom.createPortal)(_react2.default.createElement(\n 'div',\n { onClick: this.unzoom },\n this._cloneChild()\n ), this.portal) : null;\n }\n }, {\n key: 'unzoom',\n value: function unzoom() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n force = _ref.force,\n allowRefocus = _ref.allowRefocus;\n\n if (this.props.controlledEventFn && !force) {\n return this.props.controlledEventFn();\n }\n\n return this.child.unzoom(allowRefocus);\n }\n }, {\n key: '_cloneChild',\n value: function _cloneChild() {\n var _this3 = this;\n\n return _react2.default.cloneElement(_react2.default.Children.only(this.props.children), {\n ref: function ref(child) {\n _this3.child = child;\n }\n });\n }\n }, {\n key: '_handleKeyDown',\n value: function _handleKeyDown(e) {\n if ((0, _keyboardEvents.isTabKey)(e)) {\n e.preventDefault(); // prevent in-behind controls from grabbing focus\n return;\n }\n\n var allowAccessibilityClose = this.props.allowAccessibilityClose;\n\n var unzoomForEnterOrSpace = allowAccessibilityClose && (0, _keyboardEvents.isEnterOrSpaceBarKey)(e);\n var unzoomForEscape = (0, _keyboardEvents.isEscapeKey)(e);\n\n if (unzoomForEnterOrSpace) {\n e.preventDefault(); // prevent space bar from scrolling\n }\n\n if (unzoomForEnterOrSpace || unzoomForEscape) {\n this.unzoom({ allowRefocus: true });\n }\n }\n }, {\n key: '_handleResize',\n value: function _handleResize() {\n this.forceUpdate();\n }\n }, {\n key: '_handleScroll',\n value: function _handleScroll() {\n this.forceUpdate();\n var scrollChange = Math.abs(window.pageYOffset - this.pageYOffset);\n if (scrollChange > 10) {\n this.unzoom();\n }\n }\n }, {\n key: '_handleTouchStart',\n value: function _handleTouchStart(e) {\n this.yTouchPosition = e.touches[0].clientY;\n }\n }, {\n key: '_handleTouchMove',\n value: function _handleTouchMove(e) {\n this.forceUpdate();\n var touchChange = Math.abs(e.touches[0].clientY - this.yTouchPosition);\n if (touchChange > 10) {\n this.unzoom();\n }\n }\n }, {\n key: '_handleTouchEnd',\n value: function _handleTouchEnd() {\n delete this.yTouchPosition;\n }\n }]);\n\n return EventsWrapper;\n}(_react.Component);\n\nexports.default = EventsWrapper;\n\n\nEventsWrapper.propTypes = {\n children: _propTypes.element.isRequired,\n getControlledEventFn: _propTypes.func\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _defaults = require('./defaults');\n\nvar _defaults2 = _interopRequireDefault(_defaults);\n\nvar _helpers = require('./helpers');\n\nvar _Overlay = require('./Overlay');\n\nvar _Overlay2 = _interopRequireDefault(_Overlay);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The `tmpSrc` and `TmpImg` code here is a workaround\n * for a longstanding Firefox issue where replacing the\n * `src` of an `<img>` tag requires calculations and\n * results in a \"flicker\" of sorts.\n *\n * See https://github.com/rpearce/react-medium-image-zoom/issues/96\n * for further details.\n */\n\nvar Zoom = function (_Component) {\n _inherits(Zoom, _Component);\n\n function Zoom(props) {\n _classCallCheck(this, Zoom);\n\n var _this = _possibleConstructorReturn(this, (Zoom.__proto__ || Object.getPrototypeOf(Zoom)).call(this, props));\n\n _this.state = {\n hasLoaded: false,\n isZoomed: true,\n src: props.image.currentSrc || props.image.src,\n tmpSrc: null\n };\n\n _this.unzoom = _this.unzoom.bind(_this);\n _this._handleImageLoad = _this._handleImageLoad.bind(_this);\n return _this;\n }\n\n _createClass(Zoom, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _props$zoomImage = this.props.zoomImage,\n src = _props$zoomImage.src,\n srcSet = _props$zoomImage.srcSet;\n\n\n this.setState({ hasLoaded: true });\n\n if (src || srcSet) {\n (0, _helpers.fetchImage)(this.props.zoomImage, this._handleImageLoad);\n }\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps, prevState) {\n var _this2 = this;\n\n // If we have a `tmpSrc`, wait and then give it to `src`\n if (!prevState.tmpSrc && this.state.tmpSrc) {\n setTimeout(function () {\n _this2.setState({ src: _this2.state.tmpSrc, tmpSrc: null });\n }, 100);\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n defaultStyles = _props.defaultStyles,\n zoomImage = _props.zoomImage,\n _state = this.state,\n tmpSrc = _state.tmpSrc,\n isZoomed = _state.isZoomed,\n src = _state.src;\n\n\n var style = this._getZoomImageStyle();\n\n return _react2.default.createElement(\n 'div',\n { style: this._getZoomContainerStyle() },\n _react2.default.createElement(_Overlay2.default, { isVisible: isZoomed, defaultStyles: defaultStyles }),\n _react2.default.createElement('img', _extends({}, zoomImage, { src: src, style: style })),\n _react2.default.createElement(TmpImg, _extends({}, zoomImage, { src: tmpSrc, style: style }))\n );\n }\n }, {\n key: 'unzoom',\n value: function unzoom(allowRefocus) {\n var onUnzoom = this.props.onUnzoom(this.state.src, allowRefocus);\n this.setState({ isZoomed: false }, function () {\n return setTimeout(onUnzoom, _defaults2.default.transitionDuration);\n });\n }\n }, {\n key: '_handleImageLoad',\n value: function _handleImageLoad(img) {\n // Only set state if component is still mounted\n if (this.state.isZoomed) {\n this.setState({ tmpSrc: img.currentSrc || img.src });\n }\n }\n }, {\n key: '_getZoomContainerStyle',\n value: function _getZoomContainerStyle() {\n return _extends({}, _defaults2.default.styles.zoomContainer, this.props.defaultStyles.zoomContainer);\n }\n }, {\n key: '_getZoomImageStyle',\n value: function _getZoomImageStyle() {\n var _props2 = this.props,\n image = _props2.image,\n shouldRespectMaxDimension = _props2.shouldRespectMaxDimension,\n src = _props2.src,\n zoomMargin = _props2.zoomMargin;\n\n var imageOffset = image.getBoundingClientRect();\n\n var top = imageOffset.top,\n left = imageOffset.left;\n var width = image.width,\n height = image.height,\n naturalWidth = image.naturalWidth,\n naturalHeight = image.naturalHeight;\n\n\n var style = { top: top, left: left, width: width, height: height };\n\n if (!this.state.hasLoaded || !this.state.isZoomed) {\n return _extends({}, _defaults2.default.styles.zoomImage, this.props.defaultStyles.zoomImage, this.props.style, style);\n }\n\n // Get the the coords for center of the viewport\n var viewportX = document.body.clientWidth / 2;\n var viewportY = window.innerHeight / 2;\n\n // Get the coords for center of the original image\n var imageCenterX = imageOffset.left + width / 2;\n var imageCenterY = imageOffset.top + height / 2;\n\n // Get offset amounts for image coords to be centered on screen\n var translateX = viewportX - imageCenterX;\n var translateY = viewportY - imageCenterY;\n\n // Figure out how much to scale the image\n var scale = shouldRespectMaxDimension && !src ? (0, _helpers.getMaxDimensionScale)({\n width: width,\n height: height,\n naturalWidth: naturalWidth,\n naturalHeight: naturalHeight,\n zoomMargin: zoomMargin\n }) : (0, _helpers.getScale)({ width: width, height: height, zoomMargin: zoomMargin });\n\n var zoomStyle = {\n transform: 'translate3d(' + translateX + 'px, ' + translateY + 'px, 0) scale(' + scale + ')'\n };\n\n return _extends({}, _defaults2.default.styles.zoomImage, this.props.defaultStyles.zoomImage, this.props.style, style, zoomStyle);\n }\n }], [{\n key: 'defaultProps',\n get: function get() {\n return {\n zoomImage: {}\n };\n }\n }]);\n\n return Zoom;\n}(_react.Component);\n\nexports.default = Zoom;\n\n\nZoom.propTypes = {\n defaultStyles: _propTypes.object.isRequired,\n image: _propTypes.object.isRequired,\n shouldRespectMaxDimension: _propTypes.bool,\n zoomImage: (0, _propTypes.shape)({\n src: _propTypes.string,\n alt: _propTypes.string,\n className: _propTypes.string,\n style: _propTypes.object\n }).isRequired,\n zoomMargin: _propTypes.number.isRequired,\n onUnzoom: _propTypes.func.isRequired\n};\n\nvar TmpImg = function TmpImg(_ref) {\n var src = _ref.src,\n style = _ref.style,\n props = _objectWithoutProperties(_ref, ['src', 'style']);\n\n return src ? _react2.default.createElement('img', _extends({}, props, { src: src, style: getTmpStyle(style) })) : null;\n};\n\nvar tmpStyle = {\n position: 'fixed',\n visibility: 'hidden'\n};\n\nvar getTmpStyle = function getTmpStyle(style) {\n return _extends({}, style, tmpStyle);\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _defaults = require('./defaults');\n\nvar _defaults2 = _interopRequireDefault(_defaults);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Overlay = function (_PureComponent) {\n _inherits(Overlay, _PureComponent);\n\n function Overlay(props) {\n _classCallCheck(this, Overlay);\n\n var _this = _possibleConstructorReturn(this, (Overlay.__proto__ || Object.getPrototypeOf(Overlay)).call(this, props));\n\n _this.state = {\n isMounted: false\n };\n return _this;\n }\n\n _createClass(Overlay, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.setState({ isMounted: true });\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement('div', { style: this._getStyle() });\n }\n }, {\n key: '_getStyle',\n value: function _getStyle() {\n var isVisible = this.state.isMounted && this.props.isVisible;\n var opacity = isVisible & 1; // bitwise and; converts bool to 0 or 1\n return _extends({}, _defaults2.default.styles.overlay, { opacity: opacity }, this.props.defaultStyles.overlay);\n }\n }]);\n\n return Overlay;\n}(_react.PureComponent);\n\nexports.default = Overlay;\n\n\nOverlay.propTypes = {\n isVisible: _propTypes.bool.isRequired,\n defaultStyles: _propTypes.object.isRequired\n};"],"sourceRoot":""}