{"version":3,"file":"venobox.min.js","sources":["../src/venobox.esm.js"],"sourcesContent":["/**\n * VenoBox 2.0.4\n * Copyright 2013-2021 Nicola Franchini\n * @license: https://github.com/nicolafranchini/VenoBox/blob/master/LICENSE\n */\nlet backdrop, blocknum, blockshare, blocktitle, core, container, content, current_item, current_index, diffX, diffY, endY, elPreloader, elPreloaderInner;\nlet gallIndex, images, infinigall, items, navigationDisabled, newcontent, numeratio, nextok, prevok, overlay;\nlet set_maxWidth, set_overlayColor, set_ratio, set_autoplay, set_href, set_customclass, startY, thenext, theprev, thisborder, thisgall, title, throttle;\n\nconst svgOpen = '';\nconst svgClose = '';\nconst downloadIcon = svgOpen + '' + svgClose;\nconst shareIcon = svgOpen + '' + svgClose;\nconst linkIcon = svgOpen + '' + svgClose;\nconst imagesHolder = document.createElement('div');\n\nlet startX = 0;\nlet endX = 0;\nlet diff = 0;\nlet threshold = 50;\nlet startouch = false;\nlet imgLoader = new Image();\n\nconst spinners = {\n 'bounce': ['sk-bounce', 'sk-bounce-dot', 2],\n 'chase': ['sk-chase', 'sk-chase-dot', 6],\n 'circle': ['sk-circle', 'sk-circle-dot', 12],\n 'circle-fade': ['sk-circle-fade', 'sk-circle-fade-dot', 12],\n 'flow': ['sk-flow', 'sk-flow-dot', 3],\n 'fold': ['sk-fold', 'sk-fold-cube', 4],\n 'grid': ['sk-grid', 'sk-grid-cube', 9],\n 'plane': ['sk-plane', '', 0],\n 'pulse': ['sk-pulse', '', 5],\n 'swing': ['sk-swing', 'sk-swing-dot', 2],\n 'wander': ['sk-wander', 'sk-wander-cube', 3],\n 'wave': ['sk-wave', 'sk-wave-rec', 5]\n};\n\n// Default settings\nconst defaults = {\n selector: '.venobox',\n autoplay : false,\n bgcolor: '#fff',\n border: '0',\n customClass: false,\n infinigall: false,\n maxWidth: '100%',\n navigation: true,\n navKeyboard: true,\n navTouch: true,\n navSpeed: 300,\n numeration: false,\n overlayClose: true,\n overlayColor: 'rgba(23,23,23,0.95)',\n popup: false,\n ratio: '16x9', // '1x1' | '4x3' | '16x9' | '21x9'\n share: false,\n shareStyle: 'pill', // 'bar' | 'block' | 'pill' | 'transparent'\n spinner: 'bounce', // 'plane' | 'chase' | 'bounce' | 'wave' | 'pulse' | 'flow' | 'swing' | 'circle' | 'circle-fade' | 'grid' | 'fold' | 'wander'\n spinColor : '#d2d2d2',\n titleattr: 'title',\n titlePosition: 'top', // 'top' || 'bottom'\n titleStyle: 'bar', // 'bar' | 'block' | 'pill' | 'transparent'\n toolsBackground: '#1C1C1C', // 'transparent'\n toolsColor: '#d2d2d2',\n onPreOpen: function(){ return true; }, // Return the selected object - set return false to prevent opening\n onPostOpen: function(){}, // Return: current_item, gallIndex, thenext, theprev\n onPreClose: function(){ return true; }, // Return: current_item, gallIndex, thenext, theprev - set return false to prevent closing\n onNavComplete: function(){}, // Return: current_item, gallIndex, thenext, theprev\n onContentLoaded: function(){}, // Return: newcontent\n onInit: function(){}, // Return: plugin obj\n jQuerySelectors: false,\n};\n\n/**\n * Generate spinner html\n * @param {Array} spinarray Selected spinner\n */\nfunction createspinner(spinarray){\n if (!spinarray) {\n return 'Loading...';\n }\n let spinner = '
';\n let i = 0;\n for (i = 0; i < spinarray[2]; i++) {\n spinner += '
';\n }\n spinner += '
';\n return spinner;\n}\n\n/**\n * A simple forEach() implementation for Arrays, Objects and NodeLists\n * @param {Array|Object|NodeList} collection Collection of items to iterate\n * @param {Function} callback Callback function for each iteration\n * @param {Array|Object|NodeList} scope Object/NodeList/Array that forEach is iterating over (aka `this`)\n */\nfunction forEach(collection, callback, scope) {\n if (Object.prototype.toString.call(collection) === '[object Object]') {\n let prop;\n for (prop in collection) {\n if (Object.prototype.hasOwnProperty.call(collection, prop)) {\n callback.call(scope, collection[prop], prop, collection);\n }\n }\n } else {\n let i = 0;\n let len = collection.length;\n for (i = 0; i < len; i++) {\n callback.call(scope, collection[i], i, collection);\n }\n }\n}\n\n/**\n* Merge defaults with user options\n* @param {Object} defaults Default settings\n* @param {Object} options User options\n* @returns {Object} Merged values of defaults and options\n*/\nfunction extend( defaults, options ) {\n let extended = {};\n\n forEach(defaults, function (value, prop) {\n extended[prop] = defaults[prop];\n });\n\n forEach(options, function (value, prop) {\n extended[prop] = options[prop];\n });\n return extended;\n}\n\n/**\n * Linear animation timing\n */\nfunction timingLinear(timeFraction){\n return timeFraction;\n}\n\n/**\n * Animate with callback\n * https://javascript.info/js-animation\n */\nfunction animate({timing, draw, duration}) {\n let start = performance.now();\n requestAnimationFrame(function animate(time) {\n // timeFraction goes from 0 to 1\n let timeFraction = (time - start) / duration;\n if (timeFraction > 1) {\n timeFraction = 1;\n }\n // calculate the current animation state\n let progress = timing(timeFraction);\n draw(progress); // draw it\n if (timeFraction < 1) {\n requestAnimationFrame(animate);\n }\n });\n}\n\n/**\n * Parse Youtube or Vimeo videos and get host & ID\n */\nfunction parseVideo(url) {\n let type, match, vid;\n let regYt = /(https?:\\/\\/)?((www\\.)?(youtube(-nocookie)?|youtube.googleapis)\\.com.*(v\\/|v=|vi=|vi\\/|e\\/|embed\\/|user\\/.*\\/u\\/\\d+\\/)|youtu\\.be\\/)([_0-9a-z-]+)/i;\n match = url.match(regYt);\n if (match && match[7]) {\n type = 'youtube';\n vid = match[7];\n } else {\n let regVim = /^.*(vimeo\\.com\\/)((channels\\/[A-z]+\\/)|(groups\\/[A-z]+\\/videos\\/))?([0-9]+)/;\n match = url.match(regVim);\n if (match && match[5]) {\n type = 'vimeo';\n vid = match[5];\n }\n }\n return {\n type: type,\n id: vid\n };\n}\n\n/**\n * Get additional url parameters\n */\nfunction getUrlParameter(url) {\n let result = '';\n let sPageURL = decodeURIComponent(url);\n let firstsplit = sPageURL.split('?');\n\n if (firstsplit[1] !== undefined) {\n let sURLVariables = firstsplit[1].split('&');\n let sParameterName;\n let i;\n for (i = 0; i < sURLVariables.length; i++) {\n sParameterName = sURLVariables[i].split('=');\n result = result + '&'+ sParameterName[0]+'='+ sParameterName[1];\n }\n }\n return encodeURI(result);\n}\n\n/**\n * Get all images from string\n */\nfunction getImages(string) {\n imagesHolder.innerHTML = string;\n return imagesHolder.querySelectorAll('img');\n}\n\n/**\n * Update item settings.\n */\nfunction updateVars(obj){\n if (!obj) {\n return false;\n }\n navigationDisabled = true;\n current_item = obj;\n nextok = false;\n prevok = false;\n set_maxWidth = obj.getAttribute(\"data-maxwidth\") || obj.settings.maxWidth;\n set_overlayColor = obj.getAttribute(\"data-overlay\") || obj.settings.overlayColor;\n set_ratio = obj.getAttribute(\"data-ratio\") || obj.settings.ratio;\n set_autoplay = obj.getAttribute(\"data-autoplay\") || obj.settings.autoplay;\n set_href = obj.getAttribute(\"data-href\") || obj.getAttribute('href');\n set_customclass = obj.getAttribute(\"data-customclass\") || obj.settings.customClass;\n title = obj.getAttribute(obj.settings.titleattr) || '';\n thisborder = obj.getAttribute(\"data-border\") || obj.settings.border;\n}\n\n/**\n * Close modal.\n */\nfunction close() {\n if (!current_item || !document.body.classList.contains('vbox-open')) {\n return false;\n }\n if (current_item.settings.onPreClose && typeof current_item.settings.onPreClose === 'function') {\n current_item.settings.onPreClose(current_item, gallIndex, thenext, theprev);\n if (current_item.settings.onPreClose === false) {\n return false;\n }\n }\n document.body.removeEventListener('keydown', keyboardHandler);\n document.body.classList.remove('vbox-open');\n\n current_item.focus();\n animate({\n duration: 200,\n timing: timingLinear,\n draw: function(progress) {\n overlay.style.opacity = 1 - progress;\n if (progress === 1){\n overlay.remove();\n }\n }\n });\n}\n\n/**\n * Navigate gallery.\n */\nfunction next() {\n navigateGall(thenext);\n}\nfunction prev() {\n navigateGall(theprev);\n}\n\n/**\n * Keyboard navigation.\n */\nfunction keyboardHandler(e) {\n if (e.keyCode === 27) { // esc\n close();\n }\n if (!throttle) {\n if (e.keyCode == 37 && prevok === true) { // <\n navigateGall(theprev);\n }\n if (e.keyCode == 39 && nextok === true) { // >\n navigateGall(thenext);\n }\n /* prevent keyboard processing until timer completed */\n throttle = setTimeout(() => {\n throttle = null;\n }, 100);\n }\n}\n\n/**\n * Append and fade-in new content\n */\nfunction contentLoaded(){\n\n navigationDisabled = false;\n\n content.style.opacity = 0;\n\n content.innerHTML = newcontent;\n\n let vboxChild = content.querySelector(\":first-child\");\n\n vboxChild.classList.add('vbox-child');\n\n vboxChild.style.backgroundColor = current_item.settings.bgcolor;\n vboxChild.style.maxWidth = set_maxWidth;\n vboxChild.style.transform = 'scale(0.9)';\n vboxChild.style.transition = 'transform 200ms';\n\n // Fix weird drag\n let childImageLock = content.querySelector('.vbox-child img');\n\n if (childImageLock) {\n childImageLock.addEventListener('dragstart', function(e) {\n e.preventDefault();\n });\n }\n\n // reset content scroll\n container.scrollTo(0, 0);\n vboxChild.style.transform = 'scale(1)';\n\n overlay.style.setProperty('--vbox-padding', thisborder);\n\n // Reset custom classes.\n forEach(overlay.classList, function(obj){\n if (obj !== 'vbox-overlay') {\n overlay.classList.remove(obj);\n }\n });\n\n // Set custom class.\n if (set_customclass){\n overlay.classList.add(set_customclass);\n }\n\n animate({\n duration: 200,\n timing: timingLinear,\n draw: function(progress) {\n content.style.opacity = progress;\n if (progress === 1){\n elPreloader.classList.add('vbox-hidden');\n }\n }\n });\n if (current_item.settings.onContentLoaded && typeof current_item.settings.onContentLoaded === 'function') {\n current_item.settings.onContentLoaded(newcontent);\n }\n}\n\n/**\n * Check animation state\n * @param {string} state 'loading' | 'animated'\n */\nfunction checkState(state) {\n if (!content.classList.contains('vbox-' + state)) {\n contentLoaded();\n }\n}\n\n/**\n * Load iFrame\n */\nfunction loadIframe(dest, ratio){\n content.classList.add(\"vbox-loading\");\n newcontent = '
';\n content.classList.remove(\"vbox-loading\");\n checkState('animated');\n}\n\n/**\n * Load videos\n */\nfunction loadVid(dest, ratio, autoplay){\n\n content.classList.add(\"vbox-loading\");\n\n let stringAutoplay; \n // check if it's a video file - thanks to @alexxandar\n if (dest.search(/.+\\.mp4|og[gv]|webm/) !== -1) {\n stringAutoplay = autoplay ? \" autoplay\" : \"\";\n newcontent = '
';\n } else {\n let player;\n let videoObj = parseVideo(dest);\n\n // set rel=0 to hide related videos at the end of YT + optional autoplay\n stringAutoplay = autoplay ? \"?rel=0&autoplay=1\" : \"?rel=0\";\n let queryvars = stringAutoplay + getUrlParameter(dest);\n\n if (videoObj.type == 'vimeo') {\n player = 'https://player.vimeo.com/video/';\n } else if (videoObj.type == 'youtube') {\n player = 'https://www.youtube.com/embed/';\n }\n newcontent = '
';\n }\n\n content.classList.remove(\"vbox-loading\");\n checkState('animated');\n}\n\n/**\n * Load inline content\n */\nfunction loadInline(dest){\n let inlineContent = document.querySelector(dest);\n if (inlineContent) {\n content.classList.add(\"vbox-loading\");\n newcontent = '
' + inlineContent.innerHTML + '
';\n content.classList.remove(\"vbox-loading\");\n checkState('animated');\n }\n}\n\n/**\n * Preload images from ajax call\n */\nfunction loadAjaxImages(){\n images = getImages(newcontent);\n if (images.length) {\n let imgCounter = 0;\n forEach(images, function(getimg){\n let srcimg = getimg.src;\n imgLoader = new Image();\n imgLoader.onload = function(){\n imgCounter++;\n if ( imgCounter == images.length ) {\n content.classList.remove(\"vbox-loading\");\n checkState('animated');\n }\n };\n imgLoader.onerror = function(){\n imgCounter++;\n if ( imgCounter == images.length ) {\n content.classList.remove(\"vbox-loading\");\n checkState('animated');\n }\n };\n imgLoader.src = srcimg;\n });\n } else {\n content.classList.remove(\"vbox-loading\");\n checkState('animated');\n }\n}\n\n/**\n * Load Ajax\n */\nfunction loadAjax(dest){\n content.classList.add(\"vbox-loading\");\n let xhr = new XMLHttpRequest();\n xhr.open(\"GET\", dest, true);\n xhr.onload = function() {\n newcontent = '
'+ xhr.response +'
';\n loadAjaxImages();\n };\n xhr.onerror = function() {\n newcontent = '
';\n content.classList.remove(\"vbox-loading\");\n checkState('animated');\n };\n xhr.send();\n}\n\n/**\n * Preload image\n */\nfunction loadImage(dest){\n \n imgLoader.onload = function(){\n // image has been loaded\n newcontent = '
';\n content.classList.remove('vbox-loading');\n checkState('animated');\n };\n imgLoader.src = dest;\n}\n\n/**\n * Start Drag\n */\nfunction dragStart(e) {\n if (!navigationDisabled) {\n let speed = (current_item.settings.navSpeed * 0.84);\n content.style.transition = 'margin '+ speed + 'ms ease-out, opacity '+ speed + 'ms ease-out';\n startY = endY = e.pageY;\n startX = endX = e.pageX;\n startouch = true;\n }\n}\n\n/**\n * End Drag\n */\nfunction dragEnd(e) {\n if (startouch) {\n startouch = false;\n let subject = current_item;\n let change = false;\n diff = endX - startX;\n\n if (diff < 0 && nextok) {\n subject = thenext;\n change = true;\n }\n if (diff > 0 && prevok) {\n subject = theprev;\n change = true;\n }\n\n if (Math.abs(diff) >= threshold && change) {\n navigateGall(subject);\n } else {\n content.style.marginLeft = 0;\n content.style.opacity = 1;\n }\n }\n}\n\n/**\n * Drag items\n */\nfunction drag(e) {\n if (startouch && !navigationDisabled) {\n endX = e.pageX;\n endY = e.pageY;\n diffX = endX - startX;\n diffY = endY - startY;\n\n let absdiffX = Math.abs(diffX);\n let absdiffY = Math.abs(diffY);\n\n if ((absdiffX > absdiffY) && (absdiffX <= 180)) {\n let diffopac = (1 - absdiffX / 180) * 1.5;\n e.preventDefault();\n content.style.marginLeft = diffX + 'px';\n content.style.opacity = diffopac;\n }\n }\n}\n\n\nfunction setShareButtons(href){\n // Navigator share\n if (navigator.canShare) {\n const shareData = {\n url: href\n };\n blockshare.insertAdjacentHTML('beforeend', '');\n const mobileShareBtn = blockshare.querySelector('.vbox-share-mobile');\n mobileShareBtn.addEventListener('click', function(e){\n e.preventDefault();\n navigator.share(shareData);\n });\n }\n\n // Download\n blockshare.insertAdjacentHTML('beforeend', ''+downloadIcon+'');\n\n // Copy link\n blockshare.insertAdjacentHTML('beforeend', '
');\n const shareCopyBtn = blockshare.querySelector('.vbox-share-copy');\n shareCopyBtn.addEventListener('click', function(e){\n e.preventDefault();\n let tooltip = document.getElementById(\"myTooltip\");\n navigator.clipboard.writeText(href).then(function() {\n tooltip.innerHTML = '
Copied
';\n }, function() {\n console.log('copy failed');\n });\n });\n}\n\n/**\n * Check navigation\n * @param {object} el Current item\n */\nfunction checknav(el){\n\n if (!el) {\n return false;\n }\n\n thisgall = el.dataset.gall;\n numeratio = el.settings.numeration;\n infinigall = el.settings.infinigall;\n blockshare.innerHTML = '';\n\n let vbtype = el.dataset.vbtype;\n\n if (el.settings.share && vbtype !== 'iframe' && vbtype !== 'inline' && vbtype !== 'ajax' ) {\n setShareButtons(el.href);\n }\n\n items = document.querySelectorAll('.vbox-item[data-gall=\"' + thisgall + '\"]');\n\n current_index = Array.prototype.indexOf.call(items, el);\n\n if (items.length < 2) {\n infinigall = false;\n numeratio = false;\n }\n\n thenext = items[current_index + 1];\n theprev = items[current_index - 1];\n\n if (!thenext && infinigall) {\n thenext = items[0];\n }\n\n if (!theprev && infinigall) {\n theprev = items[items.length - 1];\n }\n\n // Update gallery numeration\n if (items.length >= 1) {\n gallIndex = current_index + 1;\n blocknum.innerHTML = gallIndex + ' / ' + items.length;\n } else {\n gallIndex = 1;\n }\n if (numeratio) {\n blocknum.classList.remove('vbox-hidden');\n } else {\n blocknum.classList.add('vbox-hidden');\n }\n\n // Update title\n if (title !== '') {\n blocktitle.classList.remove('vbox-hidden');\n } else {\n blocktitle.classList.add('vbox-hidden');\n }\n blocktitle.innerHTML = title;\n\n // update navigation arrows\n prevok = false;\n nextok = false;\n\n if (thenext || infinigall) {\n nextok = true;\n }\n\n if (current_index > 0 || infinigall) {\n prevok = true;\n }\n\n // activate swipe\n if ((prevok || nextok) && el.settings.navTouch) {\n content.classList.add('vbox-grab');\n content.addEventListener(\"touchstart\", dragStart, false);\n content.addEventListener(\"touchend\", dragEnd, false);\n content.addEventListener(\"touchmove\", drag, false);\n content.addEventListener(\"mousedown\", dragStart, false);\n content.addEventListener(\"mouseup\", dragEnd, false);\n content.addEventListener(\"mouseout\", dragEnd, false);\n content.addEventListener(\"mousemove\", drag, false);\n } else {\n content.classList.remove('vbox-grab');\n content.removeEventListener(\"touchstart\", dragStart, false);\n content.removeEventListener(\"touchend\", dragEnd, false);\n content.removeEventListener(\"touchmove\", drag, false);\n content.removeEventListener(\"mousedown\", dragStart, false);\n content.removeEventListener(\"mouseup\", dragEnd, false);\n content.removeEventListener(\"mouseout\", dragEnd, false);\n content.removeEventListener(\"mousemove\", drag, false);\n }\n\n let vbox_next = overlay.querySelector('.vbox-next');\n let vbox_prev = overlay.querySelector('.vbox-prev');\n\n if (prevok) {\n vbox_prev.classList.remove('vbox-hidden');\n } else {\n vbox_prev.classList.add('vbox-hidden');\n }\n\n if (nextok) {\n vbox_next.classList.remove('vbox-hidden');\n } else {\n vbox_next.classList.add('vbox-hidden');\n }\n\n if (!el.settings.navigation) {\n vbox_next.classList.add('vbox-hidden');\n vbox_prev.classList.add('vbox-hidden');\n }\n} // Checknav\n\n/**\n * Update overlay and tools style.\n */\nfunction updateOverlay(destination){\n\n if (!destination) {\n return false;\n }\n\n backdrop.style.backgroundColor = set_overlayColor;\n\n // Custom preloader color.\n elPreloaderInner.innerHTML = createspinner(spinners[destination.settings.spinner]);\n\n overlay.style.setProperty('--sk-color', destination.settings.spinColor);\n\n elPreloader.classList.remove('vbox-hidden');\n\n blockshare.classList.remove('vbox-top', 'vbox-bottom');\n blocktitle.classList.remove('vbox-top', 'vbox-bottom');\n\n if (destination.settings.titlePosition == 'top') {\n blocktitle.classList.add('vbox-top');\n blockshare.classList.add('vbox-bottom');\n } else {\n blocktitle.classList.add('vbox-bottom');\n blockshare.classList.add('vbox-top');\n }\n\n let titleWidth = destination.settings.titleStyle === 'bar' ? '100%' : 'auto';\n let titleRadius = destination.settings.titleStyle === 'pill' ? '5em' : '0';\n let shareWidth = destination.settings.shareStyle === 'bar' ? '100%' : 'auto';\n let shareRadius = destination.settings.shareStyle === 'pill' ? '5em' : '0';\n let titlebg = destination.settings.titleStyle === 'transparent' ? 'transparent' : destination.settings.toolsBackground;\n let sharebg = destination.settings.shareStyle === 'transparent' ? 'transparent' : destination.settings.toolsBackground;\n\n overlay.style.setProperty('--vbox-title-width', titleWidth);\n overlay.style.setProperty('--vbox-title-radius', titleRadius);\n overlay.style.setProperty('--vbox-share-width', shareWidth);\n overlay.style.setProperty('--vbox-share-radius', shareRadius);\n overlay.style.setProperty('--vbox-tools-color', destination.settings.toolsColor);\n overlay.style.setProperty('--vbox-title-background', titlebg);\n overlay.style.setProperty('--vbox-share-background', sharebg);\n}\n\n/**\n * Load content\n */\nfunction loadContent(){\n if (!current_item) {\n return false;\n }\n let vbtype = current_item.dataset.vbtype;\n\n switch (vbtype) {\n case 'iframe':\n loadIframe(set_href, set_ratio);\n break;\n case 'inline':\n loadInline(set_href);\n break;\n case 'ajax':\n loadAjax(set_href);\n break;\n case 'video':\n loadVid(set_href, set_ratio, set_autoplay);\n break;\n default:\n loadImage(set_href);\n }\n}\n\n/**\n * Gallery navigation.\n */\nfunction navigateGall(destination) {\n\n if (!destination || navigationDisabled || !document.body.classList.contains('vbox-open')) {\n return false;\n }\n\n updateVars(destination);\n updateOverlay(destination);\n\n // swipe out item\n let speed = (current_item.settings.navSpeed * 0.84);\n content.style.transition = 'margin '+ speed + 'ms ease-out, opacity '+ speed + 'ms ease-out';\n\n if (destination === theprev) {\n content.classList.add(\"swipe-right\");\n }\n if (destination === thenext) {\n content.classList.add(\"swipe-left\");\n }\n\n elPreloader.classList.remove('vbox-hidden');\n\n let startopacity = content.style.opacity;\n\n content.classList.add(\"vbox-animated\", \"vbox-loading\");\n\n checknav(destination);\n\n animate({\n duration: current_item.settings.navSpeed,\n timing: timingLinear,\n draw: function(progress) {\n\n content.style.opacity = startopacity - progress/startopacity;\n\n if (progress === 1){\n content.classList.remove(\"swipe-left\", \"swipe-right\", \"vbox-animated\");\n content.style.marginLeft = 0;\n content.style.transition = '';\n\n checkState('loading');\n\n navigationDisabled = false;\n\n if (current_item.settings.onNavComplete && typeof current_item.settings.onNavComplete === 'function') {\n current_item.settings.onNavComplete(current_item, gallIndex, thenext, theprev);\n }\n }\n }\n });\n loadContent();\n}\n\n/**\n * Open item.\n */\n function open(obj) {\n\n if (document.body.classList.contains('vbox-open') || !obj) {\n return false;\n }\n\n if (obj.settings.onPreOpen && typeof obj.settings.onPreOpen === 'function') {\n obj.settings.onPreOpen(obj);\n }\n if (!obj.settings.onPreOpen) {\n return false;\n }\n\n updateVars(obj);\n\n document.body.insertAdjacentHTML('beforeend', core);\n document.body.classList.add('vbox-open');\n\n overlay = document.querySelector(\".vbox-overlay\");\n backdrop = overlay.querySelector(\".vbox-backdrop\");\n container = overlay.querySelector(\".vbox-container\");\n content = container.querySelector(\".vbox-content\");\n blocknum = overlay.querySelector(\".vbox-num\");\n blockshare = overlay.querySelector(\".vbox-share\");\n blocktitle = overlay.querySelector(\".vbox-title\");\n elPreloader = overlay.querySelector(\".vbox-preloader\");\n elPreloaderInner = elPreloader.querySelector(\".vbox-preloader-inner\");\n\n overlay.style.opacity = 0;\n\n updateOverlay(obj);\n checknav(obj);\n\n content.classList.add(\"vbox-animated\", \"vbox-loading\");\n\n // fade in overlay\n animate({\n duration: 200,\n timing: timingLinear,\n draw: function(progress) {\n overlay.style.opacity = progress;\n if (progress === 1){\n content.classList.remove('vbox-animated');\n navigationDisabled = false;\n checkState('loading');\n if (current_item.settings.onPostOpen && typeof current_item.settings.onPostOpen === 'function') {\n current_item.settings.onPostOpen(current_item, gallIndex, thenext, theprev);\n }\n }\n }\n });\n\n loadContent();\n\n // Keyboard actions\n if (obj.settings.navKeyboard) {\n document.body.addEventListener('keydown', keyboardHandler);\n\n // Reset the throttle timer\n document.body.addEventListener('keyup', () => {\n if (throttle) {\n clearTimeout(throttle);\n throttle = null;\n }\n });\n }\n\n // Prev gallery\n document.querySelector('.vbox-prev').addEventListener('click', function(){\n navigateGall(theprev);\n });\n\n // Newxt gallery\n document.querySelector('.vbox-next').addEventListener('click', function(){\n navigateGall(thenext);\n });\n\n // Close modal.\n overlay.addEventListener('click', function(e){\n let closeBtn = document.querySelector('.vbox-close');\n if (closeBtn) {\n if (closeBtn.contains(e.target) || closeBtn === e.target || (current_item.settings.overlayClose &&\n e.target.classList.contains('vbox-overlay') ||\n e.target.classList.contains('vbox-content') ||\n e.target.classList.contains('vbox-backdrop') ||\n e.target.classList.contains('vbox-close') ||\n e.target.classList.contains('vbox-preloader') ||\n e.target.classList.contains('vbox-container')\n )) {\n close();\n }\n }\n });\n}\n\n/**\n * Initialize Plugin\n */\nfunction init(venobox, settings) {\n\n if (settings.onInit && typeof settings.onInit === 'function') {\n settings.onInit(venobox);\n }\n\n let selectors = settings.jQuerySelectors || document.querySelectorAll(settings.selector);\n let navigation = 'NextPrev';\n let vbheader = '
0/0
';\n let vbfooter = '
';\n let preloader = '
';\n core = '
' + preloader + '
' + vbheader + navigation + vbfooter + '
';\n\n /**\n * Loop items.\n */\n forEach(selectors, function(obj){\n if (obj.classList.contains(\"vbox-item\")) {\n return true;\n }\n obj.settings = settings;\n obj.classList.add(\"vbox-item\");\n\n // Open Link\n obj.addEventListener(\"click\", function(e){\n e.preventDefault();\n // Remove focus from link to avoid multiple calls with enter key\n obj.blur();\n open(obj);\n return false;\n }); // Click;\n }); // forEach\n\n if (settings.popup) {\n let popup = document.querySelector(settings.popup);\n popup.settings = settings;\n open(popup);\n }\n} // init\n\n/**\n * VenoBox constructor\n */\nconst VenoBox = function (options) {\n const venobox = {};\n\n // Merge user options with defaults\n let settings = extend( defaults, options || {} );\n\n venobox.close = close;\n venobox.next = next;\n venobox.prev = prev;\n venobox.open = open;\n venobox.settings = settings;\n\n init(venobox, settings);\n\n // Public APIs\n return venobox;\n};\n\n/* jQuery bridge for $().venobox() */\nif (typeof jQuery === 'function') {\n (function($){\n \"use strict\";\n $.fn.extend({\n // plugin name - venobox\n venobox: function(options) {\n const pluginoptions = options || {};\n pluginoptions.jQuerySelectors = this;\n // Init venobx\n new VenoBox({pluginoptions});\n } // venobox\n }); // extend\n })(jQuery);\n}\n\nexport default VenoBox;\n"],"names":["backdrop","blocknum","blockshare","blocktitle","core","container","content","current_item","current_index","diffX","diffY","endY","elPreloader","elPreloaderInner","gallIndex","images","infinigall","items","navigationDisabled","newcontent","numeratio","nextok","prevok","overlay","set_maxWidth","set_overlayColor","set_ratio","set_autoplay","set_href","set_customclass","startY","thenext","theprev","thisborder","thisgall","title","throttle","imagesHolder","document","createElement","startX","endX","diff","startouch","imgLoader","Image","spinners","bounce","chase","circle","flow","fold","grid","plane","pulse","swing","wander","wave","defaults","selector","autoplay","bgcolor","border","customClass","maxWidth","navigation","navKeyboard","navTouch","navSpeed","numeration","overlayClose","overlayColor","popup","ratio","share","shareStyle","spinner","spinColor","titleattr","titlePosition","titleStyle","toolsBackground","toolsColor","onPreOpen","onPostOpen","onPreClose","onNavComplete","onContentLoaded","onInit","jQuerySelectors","forEach","collection","callback","scope","Object","prototype","toString","call","prop","hasOwnProperty","i","len","length","timingLinear","timeFraction","animate","timing","draw","duration","start","performance","now","requestAnimationFrame","time","progress","updateVars","obj","getAttribute","settings","close","body","classList","contains","removeEventListener","keyboardHandler","remove","focus","style","opacity","next","navigateGall","prev","e","keyCode","setTimeout","checkState","state","innerHTML","vboxChild","querySelector","add","backgroundColor","transform","transition","childImageLock","addEventListener","preventDefault","scrollTo","setProperty","contentLoaded","loadVid","dest","stringAutoplay","search","player","videoObj","url","type","match","vid","regVim","id","parseVideo","queryvars","result","firstsplit","decodeURIComponent","split","undefined","sParameterName","sURLVariables","encodeURI","getUrlParameter","loadAjaxImages","string","querySelectorAll","imgCounter","getimg","srcimg","src","onload","onerror","dragStart","speed","pageY","pageX","dragEnd","subject","change","Math","abs","marginLeft","drag","absdiffX","diffopac","checknav","el","dataset","gall","vbtype","href","navigator","canShare","shareData","insertAdjacentHTML","tooltip","getElementById","clipboard","writeText","then","console","log","setShareButtons","Array","indexOf","vbox_next","vbox_prev","updateOverlay","destination","spinarray","createspinner","titleWidth","titleRadius","shareWidth","shareRadius","titlebg","sharebg","loadContent","inlineContent","loadInline","xhr","XMLHttpRequest","open","response","send","loadAjax","loadImage","startopacity","clearTimeout","closeBtn","target","VenoBox","options","venobox","extended","value","extend","selectors","blur","init","jQuery","fn","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