{"version":3,"file":"photoswipe-lightbox.esm.js","sources":["../../../src/js/util/util.js","../../../src/js/util/viewport-size.js","../../../src/js/slide/zoom-level.js","../../../src/js/slide/lazy-load.js","../../../src/js/lightbox/dynamic-import.js","../../../src/js/core/eventable.js","../../../src/js/core/base.js","../../../src/js/lightbox/lightbox.js"],"sourcesContent":["/**\r\n * Creates element and optionally appends it to another.\r\n *\r\n * @param {String} className\r\n * @param {String|NULL} tagName\r\n * @param {Element|NULL} appendToEl\r\n */\r\nexport function createElement(className, tagName, appendToEl) {\r\n const el = document.createElement(tagName || 'div');\r\n if (className) {\r\n el.className = className;\r\n }\r\n if (appendToEl) {\r\n appendToEl.appendChild(el);\r\n }\r\n return el;\r\n}\r\n\r\nexport function equalizePoints(p1, p2) {\r\n p1.x = p2.x;\r\n p1.y = p2.y;\r\n if (p2.id !== undefined) {\r\n p1.id = p2.id;\r\n }\r\n return p1;\r\n}\r\n\r\n\r\nexport function roundPoint(p) {\r\n p.x = Math.round(p.x);\r\n p.y = Math.round(p.y);\r\n}\r\n\r\n/**\r\n * Returns distance between two points.\r\n *\r\n * @param {Object} p1 Point\r\n * @param {Object} p2 Point\r\n */\r\nexport function getDistanceBetween(p1, p2) {\r\n const x = Math.abs(p1.x - p2.x);\r\n const y = Math.abs(p1.y - p2.y);\r\n return Math.sqrt((x * x) + (y * y));\r\n}\r\n\r\n/**\r\n * Whether X and Y positions of points are qual\r\n *\r\n * @param {Object} p1\r\n * @param {Object} p2\r\n */\r\nexport function pointsEqual(p1, p2) {\r\n return p1.x === p2.x && p1.y === p2.y;\r\n}\r\n\r\n/**\r\n * The float result between the min and max values.\r\n *\r\n * @param {Number} val\r\n * @param {Number} min\r\n * @param {Number} max\r\n */\r\nexport function clamp(val, min, max) {\r\n return Math.min(Math.max(val, min), max);\r\n}\r\n\r\n/**\r\n * Get transform string\r\n *\r\n * @param {Number} x\r\n * @param {Number|null} y\r\n * @param {Number|null} scale\r\n */\r\nexport function toTransformString(x, y, scale) {\r\n let propValue = 'translate3d('\r\n + x + 'px,' + (y || 0) + 'px'\r\n + ',0)';\r\n\r\n if (scale !== undefined) {\r\n propValue += ' scale3d('\r\n + scale + ',' + scale\r\n + ',1)';\r\n }\r\n\r\n return propValue;\r\n}\r\n\r\n/**\r\n * Apply transform:translate(x, y) scale(scale) to element\r\n *\r\n * @param {DOMElement} el\r\n * @param {Number} x\r\n * @param {Number|null} y\r\n * @param {Number|null} scale\r\n */\r\nexport function setTransform(el, x, y, scale) {\r\n el.style.transform = toTransformString(x, y, scale);\r\n}\r\n\r\nconst defaultCSSEasing = 'cubic-bezier(.4,0,.22,1)';\r\n\r\n/**\r\n * Apply CSS transition to element\r\n *\r\n * @param {Element} el\r\n * @param {String} prop CSS property to animate\r\n * @param {Number} duration in ms\r\n * @param {String|NULL} ease CSS easing function\r\n */\r\nexport function setTransitionStyle(el, prop, duration, ease) {\r\n // inOut: 'cubic-bezier(.4, 0, .22, 1)', // for \"toggle state\" transitions\r\n // out: 'cubic-bezier(0, 0, .22, 1)', // for \"show\" transitions\r\n // in: 'cubic-bezier(.4, 0, 1, 1)'// for \"hide\" transitions\r\n el.style.transition = prop\r\n ? (prop + ' ' + duration + 'ms ' + (ease || defaultCSSEasing))\r\n : 'none';\r\n}\r\n\r\nexport function removeTransitionStyle(el) {\r\n setTransitionStyle(el);\r\n}\r\n\r\nexport function decodeImage(img) {\r\n if ('decode' in img) {\r\n return img.decode();\r\n }\r\n\r\n if (img.complete) {\r\n return Promise.resolve(img);\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n img.onload = () => resolve(img);\r\n img.onerror = reject;\r\n });\r\n}\r\n\r\n/**\r\n * Check if click or keydown event was dispatched\r\n * with a special key or via mouse wheel.\r\n *\r\n * @param {Event} e\r\n */\r\nexport function specialKeyUsed(e) {\r\n if (e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey) {\r\n return true;\r\n }\r\n}\r\n","export function getViewportSize(options, pswp) {\r\n if (options.getViewportSizeFn) {\r\n const newViewportSize = options.getViewportSizeFn(options, pswp);\r\n if (newViewportSize) {\r\n return newViewportSize;\r\n }\r\n }\r\n\r\n return {\r\n x: document.documentElement.clientWidth,\r\n\r\n // TODO: height on mobile is very incosistent due to toolbar\r\n // find a way to improve this\r\n //\r\n // document.documentElement.clientHeight - doesn't seem to work well\r\n y: window.innerHeight\r\n };\r\n}\r\n\r\nexport function getPanAreaSize(options, viewportSize/*, pswp*/) {\r\n return {\r\n x: viewportSize.x - (options.paddingLeft || 0) - (options.paddingRight || 0),\r\n y: viewportSize.y - (options.paddingTop || 0) - (options.paddingBottom || 0)\r\n };\r\n}\r\n","/**\r\n * Calculates zoom levels for specific slide.\r\n * Depends on viewport size and image size.\r\n */\r\n\r\nconst MAX_IMAGE_WIDTH = 3000;\r\n\r\nclass ZoomLevel {\r\n constructor(options, itemData, index) {\r\n // pswp options\r\n this.options = options;\r\n this.itemData = itemData;\r\n this.index = index;\r\n }\r\n\r\n /**\r\n * Calculate initial, secondary and maximum zoom level for the specified slide.\r\n *\r\n * It should be called when either image or viewport size changes.\r\n *\r\n * @param {Slide} slide\r\n */\r\n update(maxWidth, maxHeight, panAreaSize) {\r\n this.elementSize = {\r\n x: maxWidth,\r\n y: maxHeight\r\n };\r\n\r\n this.panAreaSize = panAreaSize;\r\n\r\n const hRatio = this.panAreaSize.x / this.elementSize.x;\r\n const vRatio = this.panAreaSize.y / this.elementSize.y;\r\n\r\n this.fit = Math.min(1, hRatio < vRatio ? hRatio : vRatio);\r\n this.fill = Math.min(1, hRatio > vRatio ? hRatio : vRatio);\r\n\r\n // zoom.vFill defines zoom level of the image\r\n // when it has 100% of viewport vertical space (height)\r\n this.vFill = Math.min(1, vRatio);\r\n\r\n this.initial = this._getInitial();\r\n this.secondary = this._getSecondary();\r\n this.max = Math.max(\r\n this.initial,\r\n this.secondary,\r\n this._getMax()\r\n );\r\n\r\n this.min = Math.min(\r\n this.fit,\r\n this.initial,\r\n this.secondary\r\n );\r\n }\r\n\r\n /**\r\n * Parses user-defined zoom option.\r\n *\r\n * @param {Mixed} optionPrefix Zoom level option prefix (initial, secondary, max)\r\n */\r\n _parseZoomLevelOption(optionPrefix) {\r\n // zoom.initial\r\n // zoom.secondary\r\n // zoom.max\r\n const optionValue = this.options[optionPrefix + 'ZoomLevel'];\r\n\r\n if (!optionValue) {\r\n return;\r\n }\r\n\r\n if (typeof optionValue === 'function') {\r\n return optionValue(this);\r\n }\r\n\r\n if (optionValue === 'fill') {\r\n return this.fill;\r\n }\r\n\r\n if (optionValue === 'fit') {\r\n return this.fit;\r\n }\r\n\r\n return Number(optionValue);\r\n }\r\n\r\n /**\r\n * Get zoom level to which image will be zoomed after double-tap gesture,\r\n * or when user clicks on zoom icon,\r\n * or mouse-click on image itself.\r\n * If you return 1 image will be zoomed to its original size.\r\n *\r\n * @return {Number}\r\n */\r\n _getSecondary() {\r\n let currZoomLevel = this._parseZoomLevelOption('secondary');\r\n\r\n if (currZoomLevel) {\r\n return currZoomLevel;\r\n }\r\n\r\n // 2.5x of \"fit\" state, but not larger than original\r\n currZoomLevel = Math.min(1, this.fit * 2.5);\r\n\r\n if (currZoomLevel * this.elementSize.x > MAX_IMAGE_WIDTH) {\r\n currZoomLevel = MAX_IMAGE_WIDTH / this.elementSize.x;\r\n }\r\n\r\n return currZoomLevel;\r\n }\r\n\r\n /**\r\n * Get initial image zoom level.\r\n *\r\n * @return {Number}\r\n */\r\n _getInitial() {\r\n return this._parseZoomLevelOption('initial') || this.fit;\r\n }\r\n\r\n /**\r\n * Maximum zoom level when user zooms\r\n * via zoom/pinch gesture,\r\n * via cmd/ctrl-wheel or via trackpad.\r\n *\r\n * @return {Number}\r\n */\r\n _getMax() {\r\n const currZoomLevel = this._parseZoomLevelOption('max');\r\n\r\n if (currZoomLevel) {\r\n return currZoomLevel;\r\n }\r\n\r\n // max zoom level is x4 from \"fit state\",\r\n // used for zoom gesture and ctrl/trackpad zoom\r\n return Math.max(1, this.fit * 4);\r\n }\r\n}\r\n\r\nexport default ZoomLevel;\r\n","import { getViewportSize, getPanAreaSize } from '../util/viewport-size.js';\r\nimport ZoomLevel from './zoom-level.js';\r\n\r\n// This much recently lazy-loaded images will not be lazy-loaded again\r\nconst MAX_SLIDES_TO_LAZY_LOAD = 15;\r\n\r\n/**\r\n * Lazy-load an image\r\n * This function is used both by Lightbox and PhotoSwipe core,\r\n * thus it can be called before dialog is opened.\r\n *\r\n * @param {Object} itemData Data about the slide\r\n * @param {Object} instance PhotoSwipe or PhotoSwipeLightbox eventable instance\r\n * @param {Boolean} decode Wether decode() should be used.\r\n * @returns {Object|Boolean} Image that is being decoded or false.\r\n */\r\nexport function lazyLoadData(itemData, instance, decode) {\r\n if (itemData.src && itemData.w && itemData.h) {\r\n const { options } = instance;\r\n\r\n // We need to know dimensions of the image to preload it,\r\n // as it might use srcset and we need to define sizes\r\n const viewportSize = instance.viewportSize || getViewportSize(options);\r\n const panAreaSize = getPanAreaSize(options, viewportSize);\r\n\r\n const zoomLevel = new ZoomLevel(options, itemData, -1);\r\n zoomLevel.update(itemData.w, itemData.h, panAreaSize);\r\n\r\n const image = document.createElement('img');\r\n image.decoding = 'async';\r\n image.sizes = Math.ceil(itemData.w * zoomLevel.initial) + 'px';\r\n if (itemData.srcset) {\r\n image.srcset = itemData.srcset;\r\n }\r\n image.src = itemData.src;\r\n if (decode && ('decode' in image)) {\r\n image.decode();\r\n }\r\n\r\n return image;\r\n }\r\n}\r\n\r\n/**\r\n * Lazy-loads specific slide.\r\n * This function is used both by Lightbox and PhotoSwipe core,\r\n * thus it can be called before dialog is opened.\r\n *\r\n * By default it loads image based on viewport size and initial zoom level.\r\n *\r\n * @param {Integer} index Slide index\r\n * @param {Object} instance PhotoSwipe or PhotoSwipeLightbox eventable instance\r\n */\r\nexport function lazyLoadSlide(index, instance) {\r\n const itemData = instance.getItemData(index);\r\n\r\n if (instance.dispatch('lazyLoadSlide', { index, itemData }).defaultPrevented) {\r\n return;\r\n }\r\n\r\n lazyLoadData(itemData, instance);\r\n}\r\n\r\nclass LazyLoader {\r\n constructor(pswp) {\r\n this.pswp = pswp;\r\n this.clearRecent();\r\n }\r\n\r\n /**\r\n * Lazy load nearby slides based on `preload` option.\r\n *\r\n * @param {Integer} diff Difference between slide indexes that was changed recently, or 0.\r\n */\r\n update(diff) {\r\n const { pswp } = this;\r\n\r\n if (pswp.dispatch('lazyLoad').defaultPrevented) {\r\n return;\r\n }\r\n\r\n const { preload } = pswp.options;\r\n const isForward = diff === undefined ? true : (diff >= 0);\r\n let i;\r\n\r\n // preload[1] - num items to preload in forward direction\r\n for (i = 0; i <= preload[1]; i++) {\r\n this.loadSlideByIndex(pswp.currIndex + (isForward ? i : (-i)));\r\n }\r\n\r\n // preload[0] - num items to preload in backward direction\r\n for (i = 1; i <= preload[0]; i++) {\r\n this.loadSlideByIndex(pswp.currIndex + (isForward ? (-i) : i));\r\n }\r\n }\r\n\r\n clearRecent() {\r\n this._recentlyLazyLoadedIndexes = [];\r\n }\r\n\r\n /**\r\n * Add index to recently lazy-loaded slides.\r\n *\r\n * To prevent duplciate downloads,\r\n * we keep track of recently preloaded slides.\r\n *\r\n * @param {Integer} index\r\n */\r\n addRecent(index) {\r\n if (this._recentlyLazyLoadedIndexes.indexOf(index) > -1) {\r\n // already exists\r\n return;\r\n }\r\n\r\n if (this._recentlyLazyLoadedIndexes.length > MAX_SLIDES_TO_LAZY_LOAD - 1) {\r\n this._recentlyLazyLoadedIndexes.pop();\r\n }\r\n\r\n // the most recent lazy loaded index is the first\r\n // (thus push to the beginning)\r\n this._recentlyLazyLoadedIndexes.unshift(index);\r\n\r\n return true;\r\n }\r\n\r\n loadSlideByIndex(index) {\r\n index = this.pswp.getLoopedIndex(index);\r\n\r\n if (this.addRecent(index)) {\r\n lazyLoadSlide(index, this.pswp);\r\n }\r\n }\r\n\r\n // @see lazyLoadData\r\n loadSlideByData(data, decode) {\r\n lazyLoadData(data, this.pswp, decode);\r\n }\r\n}\r\n\r\nexport default LazyLoader;\r\n","export function dynamicImportModule(module) {\r\n return typeof module === 'string' ? import(/* webpackIgnore: true */ module) : module;\r\n}\r\n","/**\r\n * Base PhotoSwipe event object\r\n */\r\nclass PhotoSwipeEvent {\r\n constructor(type, details) {\r\n this.type = type;\r\n if (details) {\r\n Object.assign(this, details);\r\n }\r\n }\r\n\r\n preventDefault() {\r\n this.defaultPrevented = true;\r\n }\r\n}\r\n\r\n/**\r\n * PhotoSwipe base class that can listen and dispatch for events.\r\n * Shared by PhotoSwipe Core and PhotoSwipe Lightbox, extended by base.js\r\n */\r\nclass Eventable {\r\n constructor() {\r\n this._listeners = {};\r\n }\r\n\r\n on(name, fn) {\r\n if (!this._listeners[name]) {\r\n this._listeners[name] = [];\r\n }\r\n this._listeners[name].push(fn);\r\n\r\n // When binding events to lightbox,\r\n // also bind events to PhotoSwipe Core,\r\n // if it's open.\r\n if (this.pswp) {\r\n this.pswp.on(name, fn);\r\n }\r\n }\r\n\r\n off(name, fn) {\r\n if (this._listeners[name]) {\r\n this._listeners[name] = this._listeners[name].filter(listener => (fn !== listener));\r\n }\r\n\r\n if (this.pswp) {\r\n this.pswp.off(name, fn);\r\n }\r\n }\r\n\r\n dispatch(name, details) {\r\n if (this.pswp) {\r\n return this.pswp.dispatch(name, details);\r\n }\r\n\r\n const event = new PhotoSwipeEvent(name, details);\r\n\r\n if (!this._listeners) {\r\n return event;\r\n }\r\n\r\n if (this._listeners[name]) {\r\n this._listeners[name].forEach((listener) => {\r\n listener.call(this, event);\r\n });\r\n }\r\n\r\n return event;\r\n }\r\n}\r\n\r\nexport default Eventable;\r\n","/**\r\n * PhotoSwipe base class that can retrieve data about every slide.\r\n * Shared by PhotoSwipe Core and PhotoSwipe Lightbox\r\n */\r\nimport Eventable from './eventable';\r\n\r\nclass PhotoSwipeBase extends Eventable {\r\n /**\r\n * Get total number of slides\r\n */\r\n getNumItems() {\r\n let numItems;\r\n const { dataSource } = this.options;\r\n if (!dataSource) {\r\n numItems = 0;\r\n } else if (dataSource.length) {\r\n // may be an array or just object with length property\r\n numItems = dataSource.length;\r\n } else if (dataSource.gallery) {\r\n // query DOM elements\r\n if (!dataSource.items) {\r\n dataSource.items = this._getGalleryDOMElements(dataSource.gallery);\r\n }\r\n\r\n if (dataSource.items) {\r\n numItems = dataSource.items.length;\r\n }\r\n }\r\n\r\n // allow to filter number of items\r\n const event = this.dispatch('numItems', {\r\n dataSource,\r\n numItems\r\n });\r\n\r\n return event.numItems;\r\n }\r\n\r\n /**\r\n * Get item data by index.\r\n *\r\n * \"item data\" should contain normalized information that PhotoSwipe needs to generate a slide.\r\n * For example, it may contain properties like\r\n * `src`, `srcset`, `w`, `h`, which will be used to generate a slide with image.\r\n *\r\n * @param {Integer} index\r\n */\r\n getItemData(index) {\r\n const { dataSource } = this.options;\r\n let dataSourceItem;\r\n if (Array.isArray(dataSource)) {\r\n // Datasource is an array of elements\r\n dataSourceItem = dataSource[index];\r\n } else if (dataSource && dataSource.gallery) {\r\n // dataSource has gallery property,\r\n // thus it was created by Lightbox, based on\r\n // gallerySelecor and childSelector options\r\n\r\n // query DOM elements\r\n if (!dataSource.items) {\r\n dataSource.items = this._getGalleryDOMElements(dataSource.gallery);\r\n }\r\n\r\n dataSourceItem = dataSource.items[index];\r\n }\r\n\r\n let itemData = dataSourceItem;\r\n\r\n if (itemData instanceof Element) {\r\n itemData = this._domElementToItemData(itemData);\r\n }\r\n\r\n // allow to filter itemData\r\n const event = this.dispatch('itemData', {\r\n itemData: itemData || {},\r\n index\r\n });\r\n\r\n return event.itemData;\r\n }\r\n\r\n /**\r\n * Get array of gallery DOM elements,\r\n * based on childSelector and gallery element.\r\n *\r\n * @param {Element} galleryElement\r\n */\r\n _getGalleryDOMElements(galleryElement) {\r\n if (this.options.childSelector) {\r\n return galleryElement.querySelectorAll(this.options.childSelector) || [];\r\n }\r\n\r\n return [galleryElement];\r\n }\r\n\r\n /**\r\n * Converts DOM element to item data object.\r\n *\r\n * @param {Element} element DOM element\r\n */\r\n // eslint-disable-next-line class-methods-use-this\r\n _domElementToItemData(element) {\r\n const itemData = {\r\n element\r\n };\r\n\r\n const linkEl = element.tagName === 'A' ? element : element.querySelector('a');\r\n\r\n if (!linkEl) {\r\n return itemData;\r\n }\r\n\r\n // src comes from data-pswp-src attribute,\r\n // if it's empty link href is used\r\n itemData.src = linkEl.dataset.pswpSrc || linkEl.href;\r\n\r\n itemData.srcset = linkEl.dataset.pswpSrcset;\r\n\r\n itemData.w = parseInt(linkEl.dataset.pswpWidth, 10);\r\n itemData.h = parseInt(linkEl.dataset.pswpHeight, 10);\r\n\r\n const thumbnailEl = element.querySelector('img');\r\n\r\n if (thumbnailEl) {\r\n // define msrc only if it's the first slide,\r\n // as rendering (even small stretched thumbnail) is an expensive operation\r\n itemData.msrc = thumbnailEl.currentSrc || thumbnailEl.src;\r\n itemData.alt = thumbnailEl.getAttribute('alt');\r\n }\r\n\r\n if (linkEl.dataset.cropped) {\r\n itemData.thumbCropped = true;\r\n }\r\n\r\n return itemData;\r\n }\r\n}\r\n\r\nexport default PhotoSwipeBase;\r\n","/**\r\n * PhotoSwipe lightbox\r\n *\r\n * - If user has unsupported browser it falls back to default browser action (just opens URL)\r\n * - Binds click event to links that should open PhotoSwipe\r\n * - parses DOM strcture for PhotoSwipe (retrieves large image URLs and sizes)\r\n * - Initializes PhotoSwipe\r\n *\r\n *\r\n * Loader options use the same object as PhotoSwipe, and supports such options:\r\n *\r\n * gallerySelector\r\n * childSelector - child selector relative to the parent (should be inside)\r\n *\r\n */\r\n\r\nimport {\r\n specialKeyUsed,\r\n} from '../util/util.js';\r\n\r\nimport { lazyLoadSlide } from '../slide/lazy-load.js';\r\nimport { dynamicImportModule } from './dynamic-import.js';\r\nimport PhotoSwipeBase from '../core/base.js';\r\n\r\nclass PhotoSwipeLightbox extends PhotoSwipeBase {\r\n constructor(options) {\r\n super();\r\n this.options = options;\r\n this._uid = 0;\r\n }\r\n\r\n init() {\r\n this.onThumbnailsClick = this.onThumbnailsClick.bind(this);\r\n\r\n if (this.options && this.options.gallerySelector) {\r\n // Bind click events to each gallery\r\n const galleryElements = document.querySelectorAll(this.options.gallerySelector);\r\n galleryElements.forEach((galleryElement) => {\r\n galleryElement.addEventListener('click', this.onThumbnailsClick, false);\r\n });\r\n }\r\n }\r\n\r\n onThumbnailsClick(e) {\r\n // Exit and allow default browser action if:\r\n if (specialKeyUsed(e) // ... if clicked with a special key (ctrl/cmd...)\r\n || window.pswp // ... if PhotoSwipe is already open\r\n || window.navigator.onLine === false) { // ... if offline\r\n return;\r\n }\r\n\r\n // If both clientX and clientY are 0 or not defined,\r\n // the event is likely triggered by keyboard,\r\n // so we do not pass the initialPoint\r\n //\r\n // Note that some screen readers emulate the mouse position,\r\n // so it's not ideal way to detect them.\r\n //\r\n let initialPoint = { x: e.clientX, y: e.clientY };\r\n\r\n if (!initialPoint.x && !initialPoint.y) {\r\n initialPoint = null;\r\n }\r\n\r\n const clickedIndex = this.getClickedIndex(e);\r\n const dataSource = {\r\n gallery: e.currentTarget\r\n };\r\n\r\n if (clickedIndex >= 0) {\r\n e.preventDefault();\r\n this.loadAndOpen(clickedIndex, dataSource, initialPoint);\r\n }\r\n }\r\n\r\n /**\r\n * Get index of gallery item that was clicked.\r\n *\r\n * @param {Event} e click event\r\n */\r\n getClickedIndex(e) {\r\n if (this.options.getClickedIndexFn) {\r\n return this.options.getClickedIndexFn.call(this, e);\r\n }\r\n\r\n const clickedTarget = e.target;\r\n const clickedGallery = e.currentTarget;\r\n\r\n if (this.options.childSelector) {\r\n const clickedChild = clickedTarget.closest(this.options.childSelector);\r\n const childElements = clickedGallery.querySelectorAll(this.options.childSelector);\r\n\r\n if (clickedChild) {\r\n for (let i = 0; i < childElements.length; i++) {\r\n if (clickedChild === childElements[i]) {\r\n return i;\r\n }\r\n }\r\n }\r\n } else {\r\n // There is only one item (which is gallerySelector)\r\n return 0;\r\n }\r\n }\r\n\r\n /**\r\n * Load and open PhotoSwipe\r\n *\r\n * @param {Integer} index\r\n * @param {Array|Object|null} dataSource\r\n * @param {Point|null} initialPoint\r\n */\r\n loadAndOpen(index, dataSource, initialPoint) {\r\n // Check if the gallery is already open\r\n if (window.pswp) {\r\n return false;\r\n }\r\n\r\n // set initial index\r\n this.options.index = index;\r\n\r\n // define options for PhotoSwipe constructor\r\n this.options.initialPointerPos = initialPoint;\r\n\r\n this.shouldOpen = true;\r\n this.preload(index, dataSource);\r\n return true;\r\n }\r\n\r\n /**\r\n * Load the main module and the slide content by index\r\n *\r\n * @param {Integer} index\r\n */\r\n preload(index, dataSource) {\r\n const { options } = this;\r\n\r\n if (dataSource) {\r\n options.dataSource = dataSource;\r\n }\r\n\r\n // Add the main module\r\n const promiseArray = [dynamicImportModule(options.pswpModule)];\r\n\r\n // Add custom-defined promise, if any\r\n if (typeof options.openPromise === 'function') {\r\n // allow developers to perform some task before opening\r\n promiseArray.push(options.openPromise());\r\n }\r\n\r\n if (options.preloadFirstSlide !== false && index >= 0) {\r\n lazyLoadSlide(index, this);\r\n }\r\n\r\n // Wait till all promises resolve and open PhotoSwipe\r\n const uid = ++this._uid;\r\n Promise.all(promiseArray).then((iterableModules) => {\r\n if (this.shouldOpen) {\r\n const mainModule = iterableModules[0];\r\n this._openPhotoswipe(mainModule, uid);\r\n }\r\n });\r\n }\r\n\r\n _openPhotoswipe(module, uid) {\r\n // Cancel opening if UID doesn't match the current one\r\n // (if user clicked on another gallery item before current was loaded).\r\n //\r\n // Or if shouldOpen flag is set to false\r\n // (developer may modify it via public API)\r\n if (uid !== this._uid && this.shouldOpen) {\r\n return;\r\n }\r\n\r\n this.shouldOpen = false;\r\n\r\n // PhotoSwipe is already open\r\n if (window.pswp) {\r\n return;\r\n }\r\n\r\n // Pass data to PhotoSwipe and open init\r\n const pswp = typeof module === 'object'\r\n ? new module.default(null, this.options) // eslint-disable-line\r\n : new module(null, this.options); // eslint-disable-line\r\n\r\n this.pswp = pswp;\r\n window.pswp = pswp;\r\n\r\n // map listeners from Lightbox to PhotoSwipe Core\r\n Object.keys(this._listeners).forEach((name) => {\r\n this._listeners[name].forEach((fn) => {\r\n pswp.on(name, fn);\r\n });\r\n });\r\n\r\n pswp.on('destroy', () => {\r\n // clean up public variables\r\n this.pswp = null;\r\n window.pswp = null;\r\n });\r\n\r\n pswp.init();\r\n }\r\n\r\n destroy() {\r\n if (this.pswp) {\r\n this.pswp.close();\r\n }\r\n\r\n this.shouldOpen = false;\r\n this._listeners = null;\r\n\r\n const galleryElements = document.querySelectorAll(this.options.gallerySelector);\r\n galleryElements.forEach((galleryElement) => {\r\n galleryElement.removeEventListener('click', this.onThumbnailsClick, false);\r\n });\r\n }\r\n}\r\n\r\nexport default PhotoSwipeLightbox;\r\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAkIA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,CAAC,EAAE;AAClC,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,QAAQ,EAAE;AACzE,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH;;ACnJO,SAAS,eAAe,CAAC,OAAO,EAAE,IAAI,EAAE;AAC/C,EAAE,IAAI,OAAO,CAAC,iBAAiB,EAAE;AACjC,IAAI,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACrE,IAAI,IAAI,eAAe,EAAE;AACzB,MAAM,OAAO,eAAe,CAAC;AAC7B,KAAK;AACL,GAAG;AACH;AACA,EAAE,OAAO;AACT,IAAI,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,WAAW;AAC3C;AACA;AACA;AACA;AACA;AACA,IAAI,CAAC,EAAE,MAAM,CAAC,WAAW;AACzB,GAAG,CAAC;AACJ,CAAC;AACD;AACO,SAAS,cAAc,CAAC,OAAO,EAAE,YAAY,YAAY;AAChE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