1/*! For license information please see bundle.js.LICENSE.txt */ 2(()=>{var __webpack_modules__={
vendor: 43,985 bytes, line 2
2"./node_modules/animejs/lib/anime.es.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n * anime.js v3.2.2\n * (c) 2023 Julian Garnier\n * Released under the MIT license\n * animejs.com\n */\n\n// Defaults\n\nvar defaultInstanceSettings = {\n update: null,\n begin: null,\n loopBegin: null,\n changeBegin: null,\n change: null,\n changeComplete: null,\n loopComplete: null,\n complete: null,\n loop: 1,\n direction: 'normal',\n autoplay: true,\n timelineOffset: 0\n};\n\nvar defaultTweenSettings = {\n duration: 1000,\n delay: 0,\n endDelay: 0,\n easing: 'easeOutElastic(1, .5)',\n round: 0\n};\n\nvar validTransforms = ['translateX', 'translateY', 'translateZ', 'rotate', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'perspective', 'matrix', 'matrix3d'];\n\n// Caching\n\nvar cache = {\n CSS: {},\n springs: {}\n};\n\n// Utils\n\nfunction minMax(val, min, max) {\n return Math.min(Math.max(val, min), max);\n}\n\nfunction stringContains(str, text) {\n return str.indexOf(text) > -1;\n}\n\nfunction applyArguments(func, args) {\n return func.apply(null, args);\n}\n\nvar is = {\n arr: function (a) { return Array.isArray(a); },\n obj: function (a) { return stringContains(Object.prototype.toString.call(a), 'Object'); },\n pth: function (a) { return is.obj(a) && a.hasOwnProperty('totalLength'); },\n svg: function (a) { return a instanceof SVGElement; },\n inp: function (a) { return a instanceof HTMLInputElement; },\n dom: function (a) { return a.nodeType || is.svg(a); },\n str: function (a) { return typeof a === 'string'; },\n fnc: function (a) { return typeof a === 'function'; },\n und: function (a) { return typeof a === 'undefined'; },\n nil: function (a) { return is.und(a) || a === null; },\n hex: function (a) { return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a); },\n rgb: function (a) { return /^rgb/.test(a); },\n hsl: function (a) { return /^hsl/.test(a); },\n col: function (a) { return (is.hex(a) || is.rgb(a) || is.hsl(a)); },\n key: function (a) { return !defaultInstanceSettings.hasOwnProperty(a) && !defaultTweenSettings.hasOwnProperty(a) && a !== 'targets' && a !== 'keyframes'; },\n};\n\n// Easings\n\nfunction parseEasingParameters(string) {\n var match = /\\(([^)]+)\\)/.exec(string);\n return match ? match[1].split(',').map(function (p) { return parseFloat(p); }) : [];\n}\n\n// Spring solver inspired by Webkit Copyright © 2016 Apple Inc. All rights reserved. https://webkit.org/demos/spring/spring.js\n\nfunction spring(string, duration) {\n\n var params = parseEasingParameters(string);\n var mass = minMax(is.und(params[0]) ? 1 : params[0], .1, 100);\n var stiffness = minMax(is.und(params[1]) ? 100 : params[1], .1, 100);\n var damping = minMax(is.und(params[2]) ? 10 : params[2], .1, 100);\n var velocity = minMax(is.und(params[3]) ? 0 : params[3], .1, 100);\n var w0 = Math.sqrt(stiffness / mass);\n var zeta = damping / (2 * Math.sqrt(stiffness * mass));\n var wd = zeta < 1 ? w0 * Math.sqrt(1 - zeta * zeta) : 0;\n var a = 1;\n var b = zeta < 1 ? (zeta * w0 + -velocity) / wd : -velocity + w0;\n\n function solver(t) {\n var progress = duration ? (duration * t) / 1000 : t;\n if (zeta < 1) {\n progress = Math.exp(-progress * zeta * w0) * (a * Math.cos(wd * progress) + b * Math.sin(wd * progress));\n } else {\n progress = (a + b * progress) * Math.exp(-progress * w0);\n }\n if (t === 0 || t === 1) { return t; }\n return 1 - progress;\n }\n\n function getDuration() {\n var cached = cache.springs[string];\n if (cached) { return cached; }\n var frame = 1/6;\n var elapsed = 0;\n var rest = 0;\n while(true) {\n elapsed += frame;\n if (solver(elapsed) === 1) {\n rest++;\n if (rest >= 16) { break; }\n } else {\n rest = 0;\n }\n }\n var duration = elapsed * frame * 1000;\n cache.springs[string] = duration;\n return duration;\n }\n\n return duration ? solver : getDuration;\n\n}\n\n// Basic steps easing implementation https://developer.mozilla.org/fr/docs/Web/CSS/transition-timing-function\n\nfunction steps(steps) {\n if ( steps === void 0 ) steps = 10;\n\n return function (t) { return Math.ceil((minMax(t, 0.000001, 1)) * steps) * (1 / steps); };\n}\n\n// BezierEasing https://github.com/gre/bezier-easing\n\nvar bezier = (function () {\n\n var kSplineTableSize = 11;\n var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\n function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1 }\n function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1 }\n function C(aA1) { return 3.0 * aA1 }\n\n function calcBezier(aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT }\n function getSlope(aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1) }\n\n function binarySubdivide(aX, aA, aB, mX1, mX2) {\n var currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) { aB = currentT; } else { aA = currentT; }\n } while (Math.abs(currentX) > 0.0000001 && ++i < 10);\n return currentT;\n }\n\n function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {\n for (var i = 0; i < 4; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) { return aGuessT; }\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n }\n\n function bezier(mX1, mY1, mX2, mY2) {\n\n if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { return; }\n var sampleValues = new Float32Array(kSplineTableSize);\n\n if (mX1 !== mY1 || mX2 !== mY2) {\n for (var i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n }\n\n function getTForX(aX) {\n\n var intervalStart = 0;\n var currentSample = 1;\n var lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n\n var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n var guessForT = intervalStart + dist * kSampleStepSize;\n var initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= 0.001) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n\n }\n\n return function (x) {\n if (mX1 === mY1 && mX2 === mY2) { return x; }\n if (x === 0 || x === 1) { return x; }\n return calcBezier(getTForX(x), mY1, mY2);\n }\n\n }\n\n return bezier;\n\n})();\n\nvar penner = (function () {\n\n // Based on jQuery UI's implemenation of easing equations from Robert Penner (http://www.robertpenner.com/easing)\n\n var eases = { linear: function () { return function (t) { return t; }; } };\n\n var functionEasings = {\n Sine: function () { return function (t) { return 1 - Math.cos(t * Math.PI / 2); }; },\n Expo: function () { return function (t) { return t ? Math.pow(2, 10 * t - 10) : 0; }; },\n Circ: function () { return function (t) { return 1 - Math.sqrt(1 - t * t); }; },\n Back: function () { return function (t) { return t * t * (3 * t - 2); }; },\n Bounce: function () { return function (t) {\n var pow2, b = 4;\n while (t < (( pow2 = Math.pow(2, --b)) - 1) / 11) {}\n return 1 / Math.pow(4, 3 - b) - 7.5625 * Math.pow(( pow2 * 3 - 2 ) / 22 - t, 2)\n }; },\n Elastic: function (amplitude, period) {\n if ( amplitude === void 0 ) amplitude = 1;\n if ( period === void 0 ) period = .5;\n\n var a = minMax(amplitude, 1, 10);\n var p = minMax(period, .1, 2);\n return function (t) {\n return (t === 0 || t === 1) ? t : \n -a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p);\n }\n }\n };\n\n var baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint'];\n\n baseEasings.forEach(function (name, i) {\n functionEasings[name] = function () { return function (t) { return Math.pow(t, i + 2); }; };\n });\n\n Object.keys(functionEasings).forEach(function (name) {\n var easeIn = functionEasings[name];\n eases['easeIn' + name] = easeIn;\n eases['easeOut' + name] = function (a, b) { return function (t) { return 1 - easeIn(a, b)(1 - t); }; };\n eases['easeInOut' + name] = function (a, b) { return function (t) { return t < 0.5 ? easeIn(a, b)(t * 2) / 2 : \n 1 - easeIn(a, b)(t * -2 + 2) / 2; }; };\n eases['easeOutIn' + name] = function (a, b) { return function (t) { return t < 0.5 ? (1 - easeIn(a, b)(1 - t * 2)) / 2 : \n (easeIn(a, b)(t * 2 - 1) + 1) / 2; }; };\n });\n\n return eases;\n\n})();\n\nfunction parseEasings(easing, duration) {\n if (is.fnc(easing)) { return easing; }\n var name = easing.split('(')[0];\n var ease = penner[name];\n var args = parseEasingParameters(easing);\n switch (name) {\n case 'spring' : return spring(easing, duration);\n case 'cubicBezier' : return applyArguments(bezier, args);\n case 'steps' : return applyArguments(steps, args);\n default : return applyArguments(ease, args);\n }\n}\n\n// Strings\n\nfunction selectString(str) {\n try {\n var nodes = document.querySelectorAll(str);\n return nodes;\n } catch(e) {\n return;\n }\n}\n\n// Arrays\n\nfunction filterArray(arr, callback) {\n var len = arr.length;\n var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\n var result = [];\n for (var i = 0; i < len; i++) {\n if (i in arr) {\n var val = arr[i];\n if (callback.call(thisArg, val, i, arr)) {\n result.push(val);\n }\n }\n }\n return result;\n}\n\nfunction flattenArray(arr) {\n return arr.reduce(function (a, b) { return a.concat(is.arr(b) ? flattenArray(b) : b); }, []);\n}\n\nfunction toArray(o) {\n if (is.arr(o)) { return o; }\n if (is.str(o)) { o = selectString(o) || o; }\n if (o instanceof NodeList || o instanceof HTMLCollection) { return [].slice.call(o); }\n return [o];\n}\n\nfunction arrayContains(arr, val) {\n return arr.some(function (a) { return a === val; });\n}\n\n// Objects\n\nfunction cloneObject(o) {\n var clone = {};\n for (var p in o) { clone[p] = o[p]; }\n return clone;\n}\n\nfunction replaceObjectProps(o1, o2) {\n var o = cloneObject(o1);\n for (var p in o1) { o[p] = o2.hasOwnProperty(p) ? o2[p] : o1[p]; }\n return o;\n}\n\nfunction mergeObjects(o1, o2) {\n var o = cloneObject(o1);\n for (var p in o2) { o[p] = is.und(o1[p]) ? o2[p] : o1[p]; }\n return o;\n}\n\n// Colors\n\nfunction rgbToRgba(rgbValue) {\n var rgb = /rgb\\((\\d+,\\s*[\\d]+,\\s*[\\d]+)\\)/g.exec(rgbValue);\n return rgb ? (\"rgba(\" + (rgb[1]) + \",1)\") : rgbValue;\n}\n\nfunction hexToRgba(hexValue) {\n var rgx = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n var hex = hexValue.replace(rgx, function (m, r, g, b) { return r + r + g + g + b + b; } );\n var rgb = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n var r = parseInt(rgb[1], 16);\n var g = parseInt(rgb[2], 16);\n var b = parseInt(rgb[3], 16);\n return (\"rgba(\" + r + \",\" + g + \",\" + b + \",1)\");\n}\n\nfunction hslToRgba(hslValue) {\n var hsl = /hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g.exec(hslValue) || /hsla\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%,\\s*([\\d.]+)\\)/g.exec(hslValue);\n var h = parseInt(hsl[1], 10) / 360;\n var s = parseInt(hsl[2], 10) / 100;\n var l = parseInt(hsl[3], 10) / 100;\n var a = hsl[4] || 1;\n function hue2rgb(p, q, t) {\n if (t < 0) { t += 1; }\n if (t > 1) { t -= 1; }\n if (t < 1/6) { return p + (q - p) * 6 * t; }\n if (t < 1/2) { return q; }\n if (t < 2/3) { return p + (q - p) * (2/3 - t) * 6; }\n return p;\n }\n var r, g, b;\n if (s == 0) {\n r = g = b = l;\n } else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n return (\"rgba(\" + (r * 255) + \",\" + (g * 255) + \",\" + (b * 255) + \",\" + a + \")\");\n}\n\nfunction colorToRgb(val) {\n if (is.rgb(val)) { return rgbToRgba(val); }\n if (is.hex(val)) { return hexToRgba(val); }\n if (is.hsl(val)) { return hslToRgba(val); }\n}\n\n// Units\n\nfunction getUnit(val) {\n var split = /[+-]?\\d*\\.?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(val);\n if (split) { return split[1]; }\n}\n\nfunction getTransformUnit(propName) {\n if (stringContains(propName, 'translate') || propName === 'perspective') { return 'px'; }\n if (stringContains(propName, 'rotate') || stringContains(propName, 'skew')) { return 'deg'; }\n}\n\n// Values\n\nfunction getFunctionValue(val, animatable) {\n if (!is.fnc(val)) { return val; }\n return val(animatable.target, animatable.id, animatable.total);\n}\n\nfunction getAttribute(el, prop) {\n return el.getAttribute(prop);\n}\n\nfunction convertPxToUnit(el, value, unit) {\n var valueUnit = getUnit(value);\n if (arrayContains([unit, 'deg', 'rad', 'turn'], valueUnit)) { return value; }\n var cached = cache.CSS[value + unit];\n if (!is.und(cached)) { return cached; }\n var baseline = 100;\n var tempEl = document.createElement(el.tagName);\n var parentEl = (el.parentNode && (el.parentNode !== document)) ? el.parentNode : document.body;\n parentEl.appendChild(tempEl);\n tempEl.style.position = 'absolute';\n tempEl.style.width = baseline + unit;\n var factor = baseline / tempEl.offsetWidth;\n parentEl.removeChild(tempEl);\n var convertedUnit = factor * parseFloat(value);\n cache.CSS[value + unit] = convertedUnit;\n return convertedUnit;\n}\n\nfunction getCSSValue(el, prop, unit) {\n if (prop in el.style) {\n var uppercasePropName = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n var value = el.style[prop] || getComputedStyle(el).getPropertyValue(uppercasePropName) || '0';\n return unit ? convertPxToUnit(el, value, unit) : value;\n }\n}\n\nfunction getAnimationType(el, prop) {\n if (is.dom(el) && !is.inp(el) && (!is.nil(getAttribute(el, prop)) || (is.svg(el) && el[prop]))) { return 'attribute'; }\n if (is.dom(el) && arrayContains(validTransforms, prop)) { return 'transform'; }\n if (is.dom(el) && (prop !== 'transform' && getCSSValue(el, prop))) { return 'css'; }\n if (el[prop] != null) { return 'object'; }\n}\n\nfunction getElementTransforms(el) {\n if (!is.dom(el)) { return; }\n var str = el.style.transform || '';\n var reg = /(\\w+)\\(([^)]*)\\)/g;\n var transforms = new Map();\n var m; while (m = reg.exec(str)) { transforms.set(m[1], m[2]); }\n return transforms;\n}\n\nfunction getTransformValue(el, propName, animatable, unit) {\n var defaultVal = stringContains(propName, 'scale') ? 1 : 0 + getTransformUnit(propName);\n var value = getElementTransforms(el).get(propName) || defaultVal;\n if (animatable) {\n animatable.transforms.list.set(propName, value);\n animatable.transforms['last'] = propName;\n }\n return unit ? convertPxToUnit(el, value, unit) : value;\n}\n\nfunction getOriginalTargetValue(target, propName, unit, animatable) {\n switch (getAnimationType(target, propName)) {\n case 'transform': return getTransformValue(target, propName, animatable, unit);\n case 'css': return getCSSValue(target, propName, unit);\n case 'attribute': return getAttribute(target, propName);\n default: return target[propName] || 0;\n }\n}\n\nfunction getRelativeValue(to, from) {\n var operator = /^(\\*=|\\+=|-=)/.exec(to);\n if (!operator) { return to; }\n var u = getUnit(to) || 0;\n var x = parseFloat(from);\n var y = parseFloat(to.replace(operator[0], ''));\n switch (operator[0][0]) {\n case '+': return x + y + u;\n case '-': return x - y + u;\n case '*': return x * y + u;\n }\n}\n\nfunction validateValue(val, unit) {\n if (is.col(val)) { return colorToRgb(val); }\n if (/\\s/g.test(val)) { return val; }\n var originalUnit = getUnit(val);\n var unitLess = originalUnit ? val.substr(0, val.length - originalUnit.length) : val;\n if (unit) { return unitLess + unit; }\n return unitLess;\n}\n\n// getTotalLength() equivalent for circle, rect, polyline, polygon and line shapes\n// adapted from https://gist.github.com/SebLambla/3e0550c496c236709744\n\nfunction getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}\n\nfunction getCircleLength(el) {\n return Math.PI * 2 * getAttribute(el, 'r');\n}\n\nfunction getRectLength(el) {\n return (getAttribute(el, 'width') * 2) + (getAttribute(el, 'height') * 2);\n}\n\nfunction getLineLength(el) {\n return getDistance(\n {x: getAttribute(el, 'x1'), y: getAttribute(el, 'y1')}, \n {x: getAttribute(el, 'x2'), y: getAttribute(el, 'y2')}\n );\n}\n\nfunction getPolylineLength(el) {\n var points = el.points;\n var totalLength = 0;\n var previousPos;\n for (var i = 0 ; i < points.numberOfItems; i++) {\n var currentPos = points.getItem(i);\n if (i > 0) { totalLength += getDistance(previousPos, currentPos); }\n previousPos = currentPos;\n }\n return totalLength;\n}\n\nfunction getPolygonLength(el) {\n var points = el.points;\n return getPolylineLength(el) + getDistance(points.getItem(points.numberOfItems - 1), points.getItem(0));\n}\n\n// Path animation\n\nfunction getTotalLength(el) {\n if (el.getTotalLength) { return el.getTotalLength(); }\n switch(el.tagName.toLowerCase()) {\n case 'circle': return getCircleLength(el);\n case 'rect': return getRectLength(el);\n case 'line': return getLineLength(el);\n case 'polyline': return getPolylineLength(el);\n case 'polygon': return getPolygonLength(el);\n }\n}\n\nfunction setDashoffset(el) {\n var pathLength = getTotalLength(el);\n el.setAttribute('stroke-dasharray', pathLength);\n return pathLength;\n}\n\n// Motion path\n\nfunction getParentSvgEl(el) {\n var parentEl = el.parentNode;\n while (is.svg(parentEl)) {\n if (!is.svg(parentEl.parentNode)) { break; }\n parentEl = parentEl.parentNode;\n }\n return parentEl;\n}\n\nfunction getParentSvg(pathEl, svgData) {\n var svg = svgData || {};\n var parentSvgEl = svg.el || getParentSvgEl(pathEl);\n var rect = parentSvgEl.getBoundingClientRect();\n var viewBoxAttr = getAttribute(parentSvgEl, 'viewBox');\n var width = rect.width;\n var height = rect.height;\n var viewBox = svg.viewBox || (viewBoxAttr ? viewBoxAttr.split(' ') : [0, 0, width, height]);\n return {\n el: parentSvgEl,\n viewBox: viewBox,\n x: viewBox[0] / 1,\n y: viewBox[1] / 1,\n w: width,\n h: height,\n vW: viewBox[2],\n vH: viewBox[3]\n }\n}\n\nfunction getPath(path, percent) {\n var pathEl = is.str(path) ? selectString(path)[0] : path;\n var p = percent || 100;\n return function(property) {\n return {\n property: property,\n el: pathEl,\n svg: getParentSvg(pathEl),\n totalLength: getTotalLength(pathEl) * (p / 100)\n }\n }\n}\n\nfunction getPathProgress(path, progress, isPathTargetInsideSVG) {\n function point(offset) {\n if ( offset === void 0 ) offset = 0;\n\n var l = progress + offset >= 1 ? progress + offset : 0;\n return path.el.getPointAtLength(l);\n }\n var svg = getParentSvg(path.el, path.svg);\n var p = point();\n var p0 = point(-1);\n var p1 = point(+1);\n var scaleX = isPathTargetInsideSVG ? 1 : svg.w / svg.vW;\n var scaleY = isPathTargetInsideSVG ? 1 : svg.h / svg.vH;\n switch (path.property) {\n case 'x': return (p.x - svg.x) * scaleX;\n case 'y': return (p.y - svg.y) * scaleY;\n case 'angle': return Math.atan2(p1.y - p0.y, p1.x - p0.x) * 180 / Math.PI;\n }\n}\n\n// Decompose value\n\nfunction decomposeValue(val, unit) {\n // const rgx = /-?\\d*\\.?\\d+/g; // handles basic numbers\n // const rgx = /[+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?/g; // handles exponents notation\n var rgx = /[+-]?\\d*\\.?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?/g; // handles exponents notation\n var value = validateValue((is.pth(val) ? val.totalLength : val), unit) + '';\n return {\n original: value,\n numbers: value.match(rgx) ? value.match(rgx).map(Number) : [0],\n strings: (is.str(val) || unit) ? value.split(rgx) : []\n }\n}\n\n// Animatables\n\nfunction parseTargets(targets) {\n var targetsArray = targets ? (flattenArray(is.arr(targets) ? targets.map(toArray) : toArray(targets))) : [];\n return filterArray(targetsArray, function (item, pos, self) { return self.indexOf(item) === pos; });\n}\n\nfunction getAnimatables(targets) {\n var parsed = parseTargets(targets);\n return parsed.map(function (t, i) {\n return {target: t, id: i, total: parsed.length, transforms: { list: getElementTransforms(t) } };\n });\n}\n\n// Properties\n\nfunction normalizePropertyTweens(prop, tweenSettings) {\n var settings = cloneObject(tweenSettings);\n // Override duration if easing is a spring\n if (/^spring/.test(settings.easing)) { settings.duration = spring(settings.easing); }\n if (is.arr(prop)) {\n var l = prop.length;\n var isFromTo = (l === 2 && !is.obj(prop[0]));\n if (!isFromTo) {\n // Duration divided by the number of tweens\n if (!is.fnc(tweenSettings.duration)) { settings.duration = tweenSettings.duration / l; }\n } else {\n // Transform [from, to] values shorthand to a valid tween value\n prop = {value: prop};\n }\n }\n var propArray = is.arr(prop) ? prop : [prop];\n return propArray.map(function (v, i) {\n var obj = (is.obj(v) && !is.pth(v)) ? v : {value: v};\n // Default delay value should only be applied to the first tween\n if (is.und(obj.delay)) { obj.delay = !i ? tweenSettings.delay : 0; }\n // Default endDelay value should only be applied to the last tween\n if (is.und(obj.endDelay)) { obj.endDelay = i === propArray.length - 1 ? tweenSettings.endDelay : 0; }\n return obj;\n }).map(function (k) { return mergeObjects(k, settings); });\n}\n\n\nfunction flattenKeyframes(keyframes) {\n var propertyNames = filterArray(flattenArray(keyframes.map(function (key) { return Object.keys(key); })), function (p) { return is.key(p); })\n .reduce(function (a,b) { if (a.indexOf(b) < 0) { a.push(b); } return a; }, []);\n var properties = {};\n var loop = function ( i ) {\n var propName = propertyNames[i];\n properties[propName] = keyframes.map(function (key) {\n var newKey = {};\n for (var p in key) {\n if (is.key(p)) {\n if (p == propName) { newKey.value = key[p]; }\n } else {\n newKey[p] = key[p];\n }\n }\n return newKey;\n });\n };\n\n for (var i = 0; i < propertyNames.length; i++) loop( i );\n return properties;\n}\n\nfunction getProperties(tweenSettings, params) {\n var properties = [];\n var keyframes = params.keyframes;\n if (keyframes) { params = mergeObjects(flattenKeyframes(keyframes), params); }\n for (var p in params) {\n if (is.key(p)) {\n properties.push({\n name: p,\n tweens: normalizePropertyTweens(params[p], tweenSettings)\n });\n }\n }\n return properties;\n}\n\n// Tweens\n\nfunction normalizeTweenValues(tween, animatable) {\n var t = {};\n for (var p in tween) {\n var value = getFunctionValue(tween[p], animatable);\n if (is.arr(value)) {\n value = value.map(function (v) { return getFunctionValue(v, animatable); });\n if (value.length === 1) { value = value[0]; }\n }\n t[p] = value;\n }\n t.duration = parseFloat(t.duration);\n t.delay = parseFloat(t.delay);\n return t;\n}\n\nfunction normalizeTweens(prop, animatable) {\n var previousTween;\n return prop.tweens.map(function (t) {\n var tween = normalizeTweenValues(t, animatable);\n var tweenValue = tween.value;\n var to = is.arr(tweenValue) ? tweenValue[1] : tweenValue;\n var toUnit = getUnit(to);\n var originalValue = getOriginalTargetValue(animatable.target, prop.name, toUnit, animatable);\n var previousValue = previousTween ? previousTween.to.original : originalValue;\n var from = is.arr(tweenValue) ? tweenValue[0] : previousValue;\n var fromUnit = getUnit(from) || getUnit(originalValue);\n var unit = toUnit || fromUnit;\n if (is.und(to)) { to = previousValue; }\n tween.from = decomposeValue(from, unit);\n tween.to = decomposeValue(getRelativeValue(to, from), unit);\n tween.start = previousTween ? previousTween.end : 0;\n tween.end = tween.start + tween.delay + tween.duration + tween.endDelay;\n tween.easing = parseEasings(tween.easing, tween.duration);\n tween.isPath = is.pth(tweenValue);\n tween.isPathTargetInsideSVG = tween.isPath && is.svg(animatable.target);\n tween.isColor = is.col(tween.from.original);\n if (tween.isColor) { tween.round = 1; }\n previousTween = tween;\n return tween;\n });\n}\n\n// Tween progress\n\nvar setProgressValue = {\n css: function (t, p, v) { return t.style[p] = v; },\n attribute: function (t, p, v) { return t.setAttribute(p, v); },\n object: function (t, p, v) { return t[p] = v; },\n transform: function (t, p, v, transforms, manual) {\n transforms.list.set(p, v);\n if (p === transforms.last || manual) {\n var str = '';\n transforms.list.forEach(function (value, prop) { str += prop + \"(\" + value + \") \"; });\n t.style.transform = str;\n }\n }\n};\n\n// Set Value helper\n\nfunction setTargetsValue(targets, properties) {\n var animatables = getAnimatables(targets);\n animatables.forEach(function (animatable) {\n for (var property in properties) {\n var value = getFunctionValue(properties[property], animatable);\n var target = animatable.target;\n var valueUnit = getUnit(value);\n var originalValue = getOriginalTargetValue(target, property, valueUnit, animatable);\n var unit = valueUnit || getUnit(originalValue);\n var to = getRelativeValue(validateValue(value, unit), originalValue);\n var animType = getAnimationType(target, property);\n setProgressValue[animType](target, property, to, animatable.transforms, true);\n }\n });\n}\n\n// Animations\n\nfunction createAnimation(animatable, prop) {\n var animType = getAnimationType(animatable.target, prop.name);\n if (animType) {\n var tweens = normalizeTweens(prop, animatable);\n var lastTween = tweens[tweens.length - 1];\n return {\n type: animType,\n property: prop.name,\n animatable: animatable,\n tweens: tweens,\n duration: lastTween.end,\n delay: tweens[0].delay,\n endDelay: lastTween.endDelay\n }\n }\n}\n\nfunction getAnimations(animatables, properties) {\n return filterArray(flattenArray(animatables.map(function (animatable) {\n return properties.map(function (prop) {\n return createAnimation(animatable, prop);\n });\n })), function (a) { return !is.und(a); });\n}\n\n// Create Instance\n\nfunction getInstanceTimings(animations, tweenSettings) {\n var animLength = animations.length;\n var getTlOffset = function (anim) { return anim.timelineOffset ? anim.timelineOffset : 0; };\n var timings = {};\n timings.duration = animLength ? Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration; })) : tweenSettings.duration;\n timings.delay = animLength ? Math.min.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.delay; })) : tweenSettings.delay;\n timings.endDelay = animLength ? timings.duration - Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration - anim.endDelay; })) : tweenSettings.endDelay;\n return timings;\n}\n\nvar instanceID = 0;\n\nfunction createNewInstance(params) {\n var instanceSettings = replaceObjectProps(defaultInstanceSettings, params);\n var tweenSettings = replaceObjectProps(defaultTweenSettings, params);\n var properties = getProperties(tweenSettings, params);\n var animatables = getAnimatables(params.targets);\n var animations = getAnimations(animatables, properties);\n var timings = getInstanceTimings(animations, tweenSettings);\n var id = instanceID;\n instanceID++;\n return mergeObjects(instanceSettings, {\n id: id,\n children: [],\n animatables: animatables,\n animations: animations,\n duration: timings.duration,\n delay: timings.delay,\n endDelay: timings.endDelay\n });\n}\n\n// Core\n\nvar activeInstances = [];\n\nvar engine = (function () {\n var raf;\n\n function play() {\n if (!raf && (!isDocumentHidden() || !anime.suspendWhenDocumentHidden) && activeInstances.length > 0) {\n raf = requestAnimationFrame(step);\n }\n }\n function step(t) {\n // memo on algorithm issue:\n // dangerous iteration over mutable `activeInstances`\n // (that collection may be updated from within callbacks of `tick`-ed animation instances)\n var activeInstancesLength = activeInstances.length;\n var i = 0;\n while (i < activeInstancesLength) {\n var activeInstance = activeInstances[i];\n if (!activeInstance.paused) {\n activeInstance.tick(t);\n i++;\n } else {\n activeInstances.splice(i, 1);\n activeInstancesLength--;\n }\n }\n raf = i > 0 ? requestAnimationFrame(step) : undefined;\n }\n\n function handleVisibilityChange() {\n if (!anime.suspendWhenDocumentHidden) { return; }\n\n if (isDocumentHidden()) {\n // suspend ticks\n raf = cancelAnimationFrame(raf);\n } else { // is back to active tab\n // first adjust animations to consider the time that ticks were suspended\n activeInstances.forEach(\n function (instance) { return instance ._onDocumentVisibility(); }\n );\n engine();\n }\n }\n if (typeof document !== 'undefined') {\n document.addEventListener('visibilitychange', handleVisibilityChange);\n }\n\n return play;\n})();\n\nfunction isDocumentHidden() {\n return !!document && document.hidden;\n}\n\n// Public Instance\n\nfunction anime(params) {\n if ( params === void 0 ) params = {};\n\n\n var startTime = 0, lastTime = 0, now = 0;\n var children, childrenLength = 0;\n var resolve = null;\n\n function makePromise(instance) {\n var promise = window.Promise && new Promise(function (_resolve) { return resolve = _resolve; });\n instance.finished = promise;\n return promise;\n }\n\n var instance = createNewInstance(params);\n var promise = makePromise(instance);\n\n function toggleInstanceDirection() {\n var direction = instance.direction;\n if (direction !== 'alternate') {\n instance.direction = direction !== 'normal' ? 'normal' : 'reverse';\n }\n instance.reversed = !instance.reversed;\n children.forEach(function (child) { return child.reversed = instance.reversed; });\n }\n\n function adjustTime(time) {\n return instance.reversed ? instance.duration - time : time;\n }\n\n function resetTime() {\n startTime = 0;\n lastTime = adjustTime(instance.currentTime) * (1 / anime.speed);\n }\n\n function seekChild(time, child) {\n if (child) { child.seek(time - child.timelineOffset); }\n }\n\n function syncInstanceChildren(time) {\n if (!instance.reversePlayback) {\n for (var i = 0; i < childrenLength; i++) { seekChild(time, children[i]); }\n } else {\n for (var i$1 = childrenLength; i$1--;) { seekChild(time, children[i$1]); }\n }\n }\n\n function setAnimationsProgress(insTime) {\n var i = 0;\n var animations = instance.animations;\n var animationsLength = animations.length;\n while (i < animationsLength) {\n var anim = animations[i];\n var animatable = anim.animatable;\n var tweens = anim.tweens;\n var tweenLength = tweens.length - 1;\n var tween = tweens[tweenLength];\n // Only check for keyframes if there is more than one tween\n if (tweenLength) { tween = filterArray(tweens, function (t) { return (insTime < t.end); })[0] || tween; }\n var elapsed = minMax(insTime - tween.start - tween.delay, 0, tween.duration) / tween.duration;\n var eased = isNaN(elapsed) ? 1 : tween.easing(elapsed);\n var strings = tween.to.strings;\n var round = tween.round;\n var numbers = [];\n var toNumbersLength = tween.to.numbers.length;\n var progress = (void 0);\n for (var n = 0; n < toNumbersLength; n++) {\n var value = (void 0);\n var toNumber = tween.to.numbers[n];\n var fromNumber = tween.from.numbers[n] || 0;\n if (!tween.isPath) {\n value = fromNumber + (eased * (toNumber - fromNumber));\n } else {\n value = getPathProgress(tween.value, eased * toNumber, tween.isPathTargetInsideSVG);\n }\n if (round) {\n if (!(tween.isColor && n > 2)) {\n value = Math.round(value * round) / round;\n }\n }\n numbers.push(value);\n }\n // Manual Array.reduce for better performances\n var stringsLength = strings.length;\n if (!stringsLength) {\n progress = numbers[0];\n } else {\n progress = strings[0];\n for (var s = 0; s < stringsLength; s++) {\n var a = strings[s];\n var b = strings[s + 1];\n var n$1 = numbers[s];\n if (!isNaN(n$1)) {\n if (!b) {\n progress += n$1 + ' ';\n } else {\n progress += n$1 + b;\n }\n }\n }\n }\n setProgressValue[anim.type](animatable.target, anim.property, progress, animatable.transforms);\n anim.currentValue = progress;\n i++;\n }\n }\n\n function setCallback(cb) {\n if (instance[cb] && !instance.passThrough) { instance[cb](instance); }\n }\n\n function countIteration() {\n if (instance.remaining && instance.remaining !== true) {\n instance.remaining--;\n }\n }\n\n function setInstanceProgress(engineTime) {\n var insDuration = instance.duration;\n var insDelay = instance.delay;\n var insEndDelay = insDuration - instance.endDelay;\n var insTime = adjustTime(engineTime);\n instance.progress = minMax((insTime / insDuration) * 100, 0, 100);\n instance.reversePlayback = insTime < instance.currentTime;\n if (children) { syncInstanceChildren(insTime); }\n if (!instance.began && instance.currentTime > 0) {\n instance.began = true;\n setCallback('begin');\n }\n if (!instance.loopBegan && instance.currentTime > 0) {\n instance.loopBegan = true;\n setCallback('loopBegin');\n }\n if (insTime <= insDelay && instance.currentTime !== 0) {\n setAnimationsProgress(0);\n }\n if ((insTime >= insEndDelay && instance.currentTime !== insDuration) || !insDuration) {\n setAnimationsProgress(insDuration);\n }\n if (insTime > insDelay && insTime < insEndDelay) {\n if (!instance.changeBegan) {\n instance.changeBegan = true;\n instance.changeCompleted = false;\n setCallback('changeBegin');\n }\n setCallback('change');\n setAnimationsProgress(insTime);\n } else {\n if (instance.changeBegan) {\n instance.changeCompleted = true;\n instance.changeBegan = false;\n setCallback('changeComplete');\n }\n }\n instance.currentTime = minMax(insTime, 0, insDuration);\n if (instance.began) { setCallback('update'); }\n if (engineTime >= insDuration) {\n lastTime = 0;\n countIteration();\n if (!instance.remaining) {\n instance.paused = true;\n if (!instance.completed) {\n instance.completed = true;\n setCallback('loopComplete');\n setCallback('complete');\n if (!instance.passThrough && 'Promise' in window) {\n resolve();\n promise = makePromise(instance);\n }\n }\n } else {\n startTime = now;\n setCallback('loopComplete');\n instance.loopBegan = false;\n if (instance.direction === 'alternate') {\n toggleInstanceDirection();\n }\n }\n }\n }\n\n instance.reset = function() {\n var direction = instance.direction;\n instance.passThrough = false;\n instance.currentTime = 0;\n instance.progress = 0;\n instance.paused = true;\n instance.began = false;\n instance.loopBegan = false;\n instance.changeBegan = false;\n instance.completed = false;\n instance.changeCompleted = false;\n instance.reversePlayback = false;\n instance.reversed = direction === 'reverse';\n instance.remaining = instance.loop;\n children = instance.children;\n childrenLength = children.length;\n for (var i = childrenLength; i--;) { instance.children[i].reset(); }\n if (instance.reversed && instance.loop !== true || (direction === 'alternate' && instance.loop === 1)) { instance.remaining++; }\n setAnimationsProgress(instance.reversed ? instance.duration : 0);\n };\n\n // internal method (for engine) to adjust animation timings before restoring engine ticks (rAF)\n instance._onDocumentVisibility = resetTime;\n\n // Set Value helper\n\n instance.set = function(targets, properties) {\n setTargetsValue(targets, properties);\n return instance;\n };\n\n instance.tick = function(t) {\n now = t;\n if (!startTime) { startTime = now; }\n setInstanceProgress((now + (lastTime - startTime)) * anime.speed);\n };\n\n instance.seek = function(time) {\n setInstanceProgress(adjustTime(time));\n };\n\n instance.pause = function() {\n instance.paused = true;\n resetTime();\n };\n\n instance.play = function() {\n if (!instance.paused) { return; }\n if (instance.completed) { instance.reset(); }\n instance.paused = false;\n activeInstances.push(instance);\n resetTime();\n engine();\n };\n\n instance.reverse = function() {\n toggleInstanceDirection();\n instance.completed = instance.reversed ? false : true;\n resetTime();\n };\n\n instance.restart = function() {\n instance.reset();\n instance.play();\n };\n\n instance.remove = function(targets) {\n var targetsArray = parseTargets(targets);\n removeTargetsFromInstance(targetsArray, instance);\n };\n\n instance.reset();\n\n if (instance.autoplay) { instance.play(); }\n\n return instance;\n\n}\n\n// Remove targets from animation\n\nfunction removeTargetsFromAnimations(targetsArray, animations) {\n for (var a = animations.length; a--;) {\n if (arrayContains(targetsArray, animations[a].animatable.target)) {\n animations.splice(a, 1);\n }\n }\n}\n\nfunction removeTargetsFromInstance(targetsArray, instance) {\n var animations = instance.animations;\n var children = instance.children;\n removeTargetsFromAnimations(targetsArray, animations);\n for (var c = children.length; c--;) {\n var child = children[c];\n var childAnimations = child.animations;\n removeTargetsFromAnimations(targetsArray, childAnimations);\n if (!childAnimations.length && !child.children.length) { children.splice(c, 1); }\n }\n if (!animations.length && !children.length) { instance.pause(); }\n}\n\nfunction removeTargetsFromActiveInstances(targets) {\n var targetsArray = parseTargets(targets);\n for (var i = activeInstances.length; i--;) {\n var instance = activeInstances[i];\n removeTargetsFromInstance(targetsArray, instance);\n }\n}\n\n// Stagger helpers\n\nfunction stagger(val, params) {\n if ( params === void 0 ) params = {};\n\n var direction = params.direction || 'normal';\n var easing = params.easing ? parseEasings(params.easing) : null;\n var grid = params.grid;\n var axis = params.axis;\n var fromIndex = params.from || 0;\n var fromFirst = fromIndex === 'first';\n var fromCenter = fromIndex === 'center';\n var fromLast = fromIndex === 'last';\n var isRange = is.arr(val);\n var val1 = isRange ? parseFloat(val[0]) : parseFloat(val);\n var val2 = isRange ? parseFloat(val[1]) : 0;\n var unit = getUnit(isRange ? val[1] : val) || 0;\n var start = params.start || 0 + (isRange ? val1 : 0);\n var values = [];\n var maxValue = 0;\n return function (el, i, t) {\n if (fromFirst) { fromIndex = 0; }\n if (fromCenter) { fromIndex = (t - 1) / 2; }\n if (fromLast) { fromIndex = t - 1; }\n if (!values.length) {\n for (var index = 0; index < t; index++) {\n if (!grid) {\n values.push(Math.abs(fromIndex - index));\n } else {\n var fromX = !fromCenter ? fromIndex%grid[0] : (grid[0]-1)/2;\n var fromY = !fromCenter ? Math.floor(fromIndex/grid[0]) : (grid[1]-1)/2;\n var toX = index%grid[0];\n var toY = Math.floor(index/grid[0]);\n var distanceX = fromX - toX;\n var distanceY = fromY - toY;\n var value = Math.sqrt(distanceX * distanceX + distanceY * distanceY);\n if (axis === 'x') { value = -distanceX; }\n if (axis === 'y') { value = -distanceY; }\n values.push(value);\n }\n maxValue = Math.max.apply(Math, values);\n }\n if (easing) { values = values.map(function (val) { return easing(val / maxValue) * maxValue; }); }\n if (direction === 'reverse') { values = values.map(function (val) { return axis ? (val < 0) ? val * -1 : -val : Math.abs(maxValue - val); }); }\n }\n var spacing = isRange ? (val2 - val1) / maxValue : val1;\n return start + (spacing * (Math.round(values[i] * 100) / 100)) + unit;\n }\n}\n\n// Timeline\n\nfunction timeline(params) {\n if ( params === void 0 ) params = {};\n\n var tl = anime(params);\n tl.duration = 0;\n tl.add = function(instanceParams, timelineOffset) {\n var tlIndex = activeInstances.indexOf(tl);\n var children = tl.children;\n if (tlIndex > -1) { activeInstances.splice(tlIndex, 1); }\n function passThrough(ins) { ins.passThrough = true; }\n for (var i = 0; i < children.length; i++) { passThrough(children[i]); }\n var insParams = mergeObjects(instanceParams, replaceObjectProps(defaultTweenSettings, params));\n insParams.targets = insParams.targets || params.targets;\n var tlDuration = tl.duration;\n insParams.autoplay = false;\n insParams.direction = tl.direction;\n insParams.timelineOffset = is.und(timelineOffset) ? tlDuration : getRelativeValue(timelineOffset, tlDuration);\n passThrough(tl);\n tl.seek(insParams.timelineOffset);\n var ins = anime(insParams);\n passThrough(ins);\n children.push(ins);\n var timings = getInstanceTimings(children, params);\n tl.delay = timings.delay;\n tl.endDelay = timings.endDelay;\n tl.duration = timings.duration;\n tl.seek(0);\n tl.reset();\n if (tl.autoplay) { tl.play(); }\n return tl;\n };\n return tl;\n}\n\nanime.version = '3.2.1';\nanime.speed = 1;\n// TODO:#review: naming, documentation\nanime.suspendWhenDocumentHidden = true;\nanime.running = activeInstances;\nanime.remove = removeTargetsFromActiveInstances;\nanime.get = getOriginalTargetValue;\nanime.set = setTargetsValue;\nanime.convertPx = convertPxToUnit;\nanime.path = getPath;\nanime.setDashoffset = setDashoffset;\nanime.stagger = stagger;\nanime.timeline = timeline;\nanime.easing = parseEasings;\nanime.penner = penner;\nanime.random = function (min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; };\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (anime);\n\n\n//# sourceURL=webpack://builder/./node_modules/animejs/lib/anime.es.js?")},
vendor: 14,810 bytes, line 2
2"./node_modules/keen-slider/keen-slider.es.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "default": () => (/* binding */ y)\n/* harmony export */ });\nvar n=function(){return n=Object.assign||function(n){for(var t,i=1,e=arguments.length;i<e;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},n.apply(this,arguments)};function t(n,t,i){if(i||2===arguments.length)for(var e,r=0,a=t.length;r<a;r++)!e&&r in t||(e||(e=Array.prototype.slice.call(t,0,r)),e[r]=t[r]);return n.concat(e||Array.prototype.slice.call(t))}function i(n){return Array.prototype.slice.call(n)}function e(n,t){var i=Math.floor(n);return i===t||i+1===t?n:t}function r(){return Date.now()}function a(n,t,i){if(t="data-keen-slider-"+t,null===i)return n.removeAttribute(t);n.setAttribute(t,i||"")}function o(n,t){return t=t||document,"function"==typeof n&&(n=n(t)),Array.isArray(n)?n:"string"==typeof n?i(t.querySelectorAll(n)):n instanceof HTMLElement?[n]:n instanceof NodeList?i(n):[]}function u(n){n.raw&&(n=n.raw),n.cancelable&&!n.defaultPrevented&&n.preventDefault()}function s(n){n.raw&&(n=n.raw),n.stopPropagation&&n.stopPropagation()}function c(){var n=[];return{add:function(t,i,e,r){t.addListener?t.addListener(e):t.addEventListener(i,e,r),n.push([t,i,e,r])},input:function(n,t,i,e){this.add(n,t,function(n){return function(t){t.nativeEvent&&(t=t.nativeEvent);var i=t.changedTouches||[],e=t.targetTouches||[],r=t.detail&&t.detail.x?t.detail:null;return n({id:r?r.identifier?r.identifier:"i":e[0]?e[0]?e[0].identifier:"e":"d",idChanged:r?r.identifier?r.identifier:"i":i[0]?i[0]?i[0].identifier:"e":"d",raw:t,x:r&&r.x?r.x:e[0]?e[0].screenX:r?r.x:t.pageX,y:r&&r.y?r.y:e[0]?e[0].screenY:r?r.y:t.pageY})}}(i),e)},purge:function(){n.forEach((function(n){n[0].removeListener?n[0].removeListener(n[2]):n[0].removeEventListener(n[1],n[2],n[3])})),n=[]}}}function d(n,t,i){return Math.min(Math.max(n,t),i)}function l(n){return(n>0?1:0)-(n<0?1:0)||+n}function f(n){var t=n.getBoundingClientRect();return{height:e(t.height,n.offsetHeight),width:e(t.width,n.offsetWidth)}}function p(n,t,i,e){var r=n&&n[t];return null==r?i:e&&"function"==typeof r?r():r}function v(n){return Math.round(1e6*n)/1e6}function h(n){var t,i,e,r,a,o;function u(t){o||(o=t),s(!0);var a=t-o;a>e&&(a=e);var l=r[i];if(l[3]<a)return i++,u(t);var f=l[2],p=l[4],v=l[0],h=l[1]*(0,l[5])(0===p?1:(a-f)/p);if(h&&n.track.to(v+h),a<e)return d();o=null,s(!1),c(null),n.emit("animationEnded")}function s(n){t.active=n}function c(n){t.targetIdx=n}function d(){var n;n=u,a=window.requestAnimationFrame(n)}function l(){var t;t=a,window.cancelAnimationFrame(t),s(!1),c(null),o&&n.emit("animationStopped"),o=null}return t={active:!1,start:function(t){if(l(),n.track.details){var a=0,o=n.track.details.position;i=0,e=0,r=t.map((function(n){var t,i=Number(o),r=null!==(t=n.earlyExit)&&void 0!==t?t:n.duration,u=n.easing,s=n.distance*u(r/n.duration)||0;o+=s;var c=e;return e+=r,a+=s,[i,n.distance,c,e,n.duration,u]})),c(n.track.distToIdx(a)),d(),n.emit("animationStarted")}},stop:l,targetIdx:null}}function m(n){var i,e,a,o,u,s,c,f,h,m,g,b,x,k,y=1/0,w=[],M=null,T=0;function C(n){_(T+n)}function E(n){var t=z(T+n).abs;return D(t)?t:null}function z(n){var i=Math.floor(Math.abs(v(n/e))),r=v((n%e+e)%e);r===e&&(r=0);var a=l(n),o=c.indexOf(t([],c,!0).reduce((function(n,t){return Math.abs(t-r)<Math.abs(n-r)?t:n}))),u=o;return a<0&&i++,o===s&&(u=0,i+=a>0?1:-1),{abs:u+i*s*a,origin:o,rel:u}}function I(n,t,i){var e;if(t||!S())return A(n,i);if(!D(n))return null;var r=z(null!=i?i:T),a=r.abs,o=n-r.rel,u=a+o;e=A(u);var c=A(u-s*l(o));return(null!==c&&Math.abs(c)<Math.abs(e)||null===e)&&(e=c),v(e)}function A(n,t){if(null==t&&(t=v(T)),!D(n)||null===n)return null;n=Math.round(n);var i=z(t),r=i.abs,a=i.rel,o=i.origin,u=O(n),d=(t%e+e)%e,l=c[o],f=Math.floor((n-(r-a))/s)*e;return v(l-d-l+c[u]+f+(o===s?e:0))}function D(n){return L(n)===n}function L(n){return d(n,h,m)}function S(){return o.loop}function O(n){return(n%s+s)%s}function _(t){var i;i=t-T,w.push({distance:i,timestamp:r()}),w.length>6&&(w=w.slice(-6)),T=v(t);var e=H().abs;if(e!==M){var a=null!==M;M=e,a&&n.emit("slideChanged")}}function H(t){var r=t?null:function(){if(s){var n=S(),t=n?(T%e+e)%e:T,i=(n?T%e:T)-u[0][2],r=0-(i<0&&n?e-Math.abs(i):i),c=0,d=z(T),f=d.abs,p=d.rel,v=u[p][2],y=u.map((function(t,i){var a=r+c;(a<0-t[0]||a>1)&&(a+=(Math.abs(a)>e-1&&n?e:0)*l(-a));var u=i-p,d=l(u),h=u+f;n&&(-1===d&&a>v&&(h+=s),1===d&&a<v&&(h-=s),null!==g&&h<g&&(a+=e),null!==b&&h>b&&(a-=e));var m=a+t[0]+t[1],x=Math.max(a>=0&&m<=1?1:m<0||a>1?0:a<0?Math.min(1,(t[0]+a)/t[0]):(1-a)/t[0],0);return c+=t[0]+t[1],{abs:h,distance:o.rtl?-1*a+1-t[0]:a,portion:x,size:t[0]}}));return f=L(f),p=O(f),{abs:L(f),length:a,max:k,maxIdx:m,min:x,minIdx:h,position:T,progress:n?t/e:T/a,rel:p,slides:y,slidesLength:e}}}();return i.details=r,n.emit("detailsChanged"),r}return i={absToRel:O,add:C,details:null,distToIdx:E,idxToDist:I,init:function(t){if(function(){if(o=n.options,u=(o.trackConfig||[]).map((function(n){return[p(n,"size",1),p(n,"spacing",0),p(n,"origin",0)]})),s=u.length){e=v(u.reduce((function(n,t){return n+t[0]+t[1]}),0));var t,i=s-1;a=v(e+u[0][2]-u[i][0]-u[i][2]-u[i][1]),c=u.reduce((function(n,i){if(!n)return[0];var e=u[n.length-1],r=n[n.length-1]+(e[0]+e[2])+e[1];return r-=i[2],n[n.length-1]>r&&(r=n[n.length-1]),r=v(r),n.push(r),(!t||t<r)&&(f=n.length-1),t=r,n}),null),0===a&&(f=0),c.push(v(e))}}(),!s)return H(!0);var i;!function(){var t=n.options.range,i=n.options.loop;g=h=i?p(i,"min",-1/0):0,b=m=i?p(i,"max",y):f;var e=p(t,"min",null),r=p(t,"max",null);null!==e&&(h=e),null!==r&&(m=r),x=h===-1/0?h:n.track.idxToDist(h||0,!0,0),k=m===y?m:I(m,!0,0),null===r&&(b=m),p(t,"align",!1)&&m!==y&&0===u[O(m)][2]&&(k-=1-u[O(m)][0],m=E(k-T)),x=v(x),k=v(k)}(),i=t,Number(i)===i?C(A(L(t))):H()},to:_,velocity:function(){var n=r(),t=w.reduce((function(t,i){var e=i.distance,r=i.timestamp;return n-r>200||(l(e)!==l(t.distance)&&t.distance&&(t={distance:0,lastTimestamp:0,time:0}),t.time&&(t.distance+=e),t.lastTimestamp&&(t.time+=r-t.lastTimestamp),t.lastTimestamp=r),t}),{distance:0,lastTimestamp:0,time:0});return t.distance/t.time||0}}}function g(n){var t,i,e,r,a,o,u,s;function c(n){return 2*n}function f(n){return d(n,u,s)}function p(n){return 1-Math.pow(1-n,3)}function v(){return e?n.track.velocity():0}function h(){b();var t="free-snap"===n.options.mode,i=n.track,e=v();r=l(e);var u=n.track.details,s=[];if(e||!t){var d=m(e),h=d.dist,g=d.dur;if(g=c(g),h*=r,t){var x=i.idxToDist(i.distToIdx(h),!0);x&&(h=x)}s.push({distance:h,duration:g,easing:p});var k=u.position,y=k+h;if(y<a||y>o){var w=y<a?a-k:o-k,M=0,T=e;if(l(w)===r){var C=Math.min(Math.abs(w)/Math.abs(h),1),E=function(n){return 1-Math.pow(1-n,1/3)}(C)*g;s[0].earlyExit=E,T=e*(1-C)}else s[0].earlyExit=0,M+=w;var z=m(T,100),I=z.dist*r;n.options.rubberband&&(s.push({distance:I,duration:c(z.dur),easing:p}),s.push({distance:-I+M,duration:500,easing:p}))}n.animator.start(s)}else n.moveToIdx(f(u.abs),!0,{duration:500,easing:function(n){return 1+--n*n*n*n*n}})}function m(n,t){void 0===t&&(t=1e3);var i=147e-9+(n=Math.abs(n))/t;return{dist:Math.pow(n,2)/i,dur:n/i}}function g(){var t=n.track.details;t&&(a=t.min,o=t.max,u=t.minIdx,s=t.maxIdx)}function b(){n.animator.stop()}n.on("updated",g),n.on("optionsChanged",g),n.on("created",g),n.on("dragStarted",(function(){e=!1,b(),t=i=n.track.details.abs})),n.on("dragChecked",(function(){e=!0})),n.on("dragEnded",(function(){var e=n.options.mode;"snap"===e&&function(){var e=n.track,r=n.track.details,u=r.position,s=l(v());(u>o||u<a)&&(s=0);var c=t+s;0===r.slides[e.absToRel(c)].portion&&(c-=s),t!==i&&(c=i),l(e.idxToDist(c,!0))!==s&&(c+=s),c=f(c);var d=e.idxToDist(c,!0);n.animator.start([{distance:d,duration:500,easing:function(n){return 1+--n*n*n*n*n}}])}(),"free"!==e&&"free-snap"!==e||h()})),n.on("dragged",(function(){i=n.track.details.abs}))}function b(n){var t,i,e,r,a,f,p,v,h,m,g,b,x,k,y,w,M,T,C=c();function E(t){if(f&&v===t.id){var o=D(t);if(h){if(!A(t))return I(t);m=o,h=!1,n.emit("dragChecked")}if(w)return m=o;u(t);var c=function(t){if(M===-1/0&&T===1/0)return t;var e=n.track.details,o=e.length,u=e.position,s=d(t,M-u,T-u);if(0===o)return 0;if(!n.options.rubberband)return s;if(u<=T&&u>=M)return t;if(u<M&&i>0||u>T&&i<0)return t;var c=(u<M?u-M:u-T)/o,l=r*o,f=Math.abs(c*l),p=Math.max(0,1-f/a*2);return p*p*t}(p(m-o)/r*e);i=l(c);var x=n.track.details.position;(x>M&&x<T||x===M&&i>0||x===T&&i<0)&&s(t),g+=c,!b&&Math.abs(g*r)>5&&(b=!0),n.track.add(c),m=o,n.emit("dragged")}}function z(t){!f&&n.track.details&&n.track.details.length&&(g=0,f=!0,b=!1,h=!0,v=t.id,A(t),m=D(t),n.emit("dragStarted"))}function I(t){f&&v===t.idChanged&&(f=!1,n.emit("dragEnded"))}function A(n){var t=L(),i=t?n.y:n.x,e=t?n.x:n.y,r=void 0!==x&&void 0!==k&&Math.abs(k-e)<=Math.abs(x-i);return x=i,k=e,r}function D(n){return L()?n.y:n.x}function L(){return n.options.vertical}function S(){r=n.size,a=L()?window.innerHeight:window.innerWidth;var t=n.track.details;t&&(M=t.min,T=t.max)}function O(n){b&&(s(n),u(n))}function _(){if(C.purge(),n.options.drag&&!n.options.disabled){var i;i=n.options.dragSpeed||1,p="function"==typeof i?i:function(n){return n*i},e=n.options.rtl?-1:1,S(),t=n.container,function(){var n="data-keen-slider-clickable";o("[".concat(n,"]:not([").concat(n,"=false])"),t).map((function(n){C.add(n,"dragstart",s),C.add(n,"mousedown",s),C.add(n,"touchstart",s)}))}(),C.add(t,"dragstart",(function(n){u(n)})),C.add(t,"click",O,{capture:!0}),C.input(t,"ksDragStart",z),C.input(t,"ksDrag",E),C.input(t,"ksDragEnd",I),C.input(t,"mousedown",z),C.input(t,"mousemove",E),C.input(t,"mouseleave",I),C.input(t,"mouseup",I),C.input(t,"touchstart",z,{passive:!0}),C.input(t,"touchmove",E,{passive:!1}),C.input(t,"touchend",I),C.input(t,"touchcancel",I),C.add(window,"wheel",(function(n){f&&u(n)}));var r="data-keen-slider-scrollable";o("[".concat(r,"]:not([").concat(r,"=false])"),n.container).map((function(n){return function(n){var t;C.input(n,"touchstart",(function(n){t=D(n),w=!0,y=!0}),{passive:!0}),C.input(n,"touchmove",(function(i){var e=L(),r=e?n.scrollHeight-n.clientHeight:n.scrollWidth-n.clientWidth,a=t-D(i),o=e?n.scrollTop:n.scrollLeft,s=e&&"scroll"===n.style.overflowY||!e&&"scroll"===n.style.overflowX;if(t=D(i),(a<0&&o>0||a>0&&o<r)&&y&&s)return w=!0;y=!1,u(i),w=!1})),C.input(n,"touchend",(function(){w=!1}))}(n)}))}}n.on("updated",S),n.on("optionsChanged",_),n.on("created",_),n.on("destroyed",C.purge)}function x(n){var t,i,e=null;function r(t,i,e){n.animator.active?o(t,i,e):requestAnimationFrame((function(){return o(t,i,e)}))}function a(){r(!1,!1,i)}function o(i,r,a){var o=0,u=n.size,d=n.track.details;if(d&&t){var l=d.slides;t.forEach((function(n,t){if(i)!e&&r&&s(n,null,a),c(n,null,a);else{if(!l[t])return;var d=l[t].size*u;!e&&r&&s(n,d,a),c(n,l[t].distance*u-o,a),o+=d}}))}}function u(t){return"performance"===n.options.renderMode?Math.round(t):t}function s(n,t,i){var e=i?"height":"width";null!==t&&(t=u(t)+"px"),n.style["min-"+e]=t,n.style["max-"+e]=t}function c(n,t,i){if(null!==t){t=u(t);var e=i?t:0;t="translate3d(".concat(i?0:t,"px, ").concat(e,"px, 0)")}n.style.transform=t,n.style["-webkit-transform"]=t}function d(){t&&(o(!0,!0,i),t=null),n.on("detailsChanged",a,!0)}function l(){r(!1,!0,i)}function f(){d(),i=n.options.vertical,n.options.disabled||"custom"===n.options.renderMode||(e="auto"===p(n.options.slides,"perView",null),n.on("detailsChanged",a),(t=n.slides).length&&l())}n.on("created",f),n.on("optionsChanged",f),n.on("beforeOptionsChanged",(function(){d()})),n.on("updated",l),n.on("destroyed",d)}function k(t,i){return function(e){var r,u,s,d,l,v,h=c();function m(n){var t;a(e.container,"reverse","rtl"!==(t=e.container,window.getComputedStyle(t,null).getPropertyValue("direction"))||n?null:""),a(e.container,"v",e.options.vertical&&!n?"":null),a(e.container,"disabled",e.options.disabled&&!n?"":null)}function g(){b()&&M()}function b(){var t=null;if(d.forEach((function(n){n.matches&&(t=n.__media)})),t===r)return!1;r||e.emit("beforeOptionsChanged"),r=t;var i=t?s.breakpoints[t]:s;return e.options=n(n({},s),i),m(),I(),A(),C(),!0}function x(n){var t=f(n);return(e.options.vertical?t.height:t.width)/e.size||1}function k(){return e.options.trackConfig.length}function y(t){for(var a in r=!1,s=n(n({},i),t),h.purge(),u=e.size,d=[],s.breakpoints||[]){var o=window.matchMedia(a);o.__media=a,d.push(o),h.add(o,"change",g)}h.add(window,"orientationchange",z),h.add(window,"resize",E),b()}function w(n){e.animator.stop();var t=e.track.details;e.track.init(null!=n?n:t?t.abs:0)}function M(n){w(n),e.emit("optionsChanged")}function T(n,t){if(n)return y(n),void M(t);I(),A();var i=k();C(),k()!==i?M(t):w(t),e.emit("updated")}function C(){var n=e.options.slides;if("function"==typeof n)return e.options.trackConfig=n(e.size,e.slides);for(var t=e.slides,i=t.length,r="number"==typeof n?n:p(n,"number",i,!0),a=[],o=p(n,"perView",1,!0),u=p(n,"spacing",0,!0)/e.size||0,s="auto"===o?u:u/o,c=p(n,"origin","auto"),d=0,l=0;l<r;l++){var f="auto"===o?x(t[l]):1/o-u+s,v="center"===c?.5-f/2:"auto"===c?0:c;a.push({origin:v,size:f,spacing:u}),d+=f}if(d+=u*(r-1),"auto"===c&&!e.options.loop&&1!==o){var h=0;a.map((function(n){var t=d-h;return h+=n.size+u,t>=1||(n.origin=1-t-(d>1?0:1-d)),n}))}e.options.trackConfig=a}function E(){I();var n=e.size;e.options.disabled||n===u||(u=n,T())}function z(){E(),setTimeout(E,500),setTimeout(E,2e3)}function I(){var n=f(e.container);e.size=(e.options.vertical?n.height:n.width)||1}function A(){e.slides=o(e.options.selector,e.container)}e.container=(v=o(t,l||document)).length?v[0]:null,e.destroy=function(){h.purge(),e.emit("destroyed"),m(!0)},e.prev=function(){e.moveToIdx(e.track.details.abs-1,!0)},e.next=function(){e.moveToIdx(e.track.details.abs+1,!0)},e.update=T,y(e.options)}}var y=function(n,i,e){try{return function(n,t){var i,e={};return i={emit:function(n){e[n]&&e[n].forEach((function(n){n(i)}));var t=i.options&&i.options[n];t&&t(i)},moveToIdx:function(n,t,e){var r=i.track.idxToDist(n,t);if(r){var a=i.options.defaultAnimation;i.animator.start([{distance:r,duration:p(e||a,"duration",500),easing:p(e||a,"easing",(function(n){return 1+--n*n*n*n*n}))}])}},on:function(n,t,i){void 0===i&&(i=!1),e[n]||(e[n]=[]);var r=e[n].indexOf(t);r>-1?i&&delete e[n][r]:i||e[n].push(t)},options:n},function(){if(i.track=m(i),i.animator=h(i),t)for(var n=0,e=t;n<e.length;n++)(0,e[n])(i);i.track.init(i.options.initial||0),i.emit("created")}(),i}(i,t([k(n,{drag:!0,mode:"snap",renderMode:"precision",rubberband:!0,selector:".keen-slider__slide"}),x,b,g],e||[],!0))}catch(n){console.error(n)}};\n\n\n//# sourceURL=webpack://builder/./node_modules/keen-slider/keen-slider.es.js?')},
vendor: 123,460 bytes, line 2
2"./node_modules/scrollmagic/scrollmagic/uncompressed/ScrollMagic.js":function(module,exports,__webpack_require__){eval('var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\r\n * ScrollMagic v2.0.8 (2020-08-14)\r\n * The javascript library for magical scroll interactions.\r\n * (c) 2020 Jan Paepke (@janpaepke)\r\n * Project Website: http://scrollmagic.io\r\n * \r\n * @version 2.0.8\r\n * @license Dual licensed under MIT license and GPL.\r\n * @author Jan Paepke - [email protected]\r\n *\r\n * @file ScrollMagic main library.\r\n */\r\n/**\r\n * @namespace ScrollMagic\r\n */\r\n(function (root, factory) {\r\n\tif (true) {\r\n\t\t// AMD. Register as an anonymous module.\r\n\t\t!(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === \'function\' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n\t} else {}\r\n}(this, function () {\r\n\t"use strict";\r\n\r\n\tvar ScrollMagic = function () {\r\n\t\t_util.log(2, \'(COMPATIBILITY NOTICE) -> As of ScrollMagic 2.0.0 you need to use \\\'new ScrollMagic.Controller()\\\' to create a new controller instance. Use \\\'new ScrollMagic.Scene()\\\' to instance a scene.\');\r\n\t};\r\n\r\n\tScrollMagic.version = "2.0.8";\r\n\r\n\t// TODO: temporary workaround for chrome\'s scroll jitter bug\r\n\tif (typeof (window) !== \'undefined\') {\r\n\t\twindow.addEventListener("mousewheel", void(0));\r\n\t}\r\n\r\n\t// global const\r\n\tvar PIN_SPACER_ATTRIBUTE = "data-scrollmagic-pin-spacer";\r\n\r\n\t/**\r\n\t * The main class that is needed once per scroll container.\r\n\t *\r\n\t * @class\r\n\t *\r\n\t * @example\r\n\t * // basic initialization\r\n\t * var controller = new ScrollMagic.Controller();\r\n\t *\r\n\t * // passing options\r\n\t * var controller = new ScrollMagic.Controller({container: "#myContainer", loglevel: 3});\r\n\t *\r\n\t * @param {object} [options] - An object containing one or more options for the controller.\r\n\t * @param {(string|object)} [options.container=window] - A selector, DOM object that references the main container for scrolling.\r\n\t * @param {boolean} [options.vertical=true] - Sets the scroll mode to vertical (`true`) or horizontal (`false`) scrolling.\r\n\t * @param {object} [options.globalSceneOptions={}] - These options will be passed to every Scene that is added to the controller using the addScene method. For more information on Scene options see {@link ScrollMagic.Scene}.\r\n\t * @param {number} [options.loglevel=2] Loglevel for debugging. Note that logging is disabled in the minified version of ScrollMagic.\r\n\t\t\t\t\t\t\t\t\t\t\t ** `0` => silent\r\n\t\t\t\t\t\t\t\t\t\t\t ** `1` => errors\r\n\t\t\t\t\t\t\t\t\t\t\t ** `2` => errors, warnings\r\n\t\t\t\t\t\t\t\t\t\t\t ** `3` => errors, warnings, debuginfo\r\n\t * @param {boolean} [options.refreshInterval=100] - Some changes don\'t call events by default, like changing the container size or moving a scene trigger element. \r\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t This interval polls these parameters to fire the necessary events. \r\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t If you don\'t use custom containers, trigger elements or have static layouts, where the positions of the trigger elements don\'t change, you can set this to 0 disable interval checking and improve performance.\r\n\t *\r\n\t */\r\n\tScrollMagic.Controller = function (options) {\r\n\t\t/*\r\n\t\t * ----------------------------------------------------------------\r\n\t\t * settings\r\n\t\t * ----------------------------------------------------------------\r\n\t\t */\r\n\t\tvar\r\n\t\t\tNAMESPACE = \'ScrollMagic.Controller\',\r\n\t\t\tSCROLL_DIRECTION_FORWARD = \'FORWARD\',\r\n\t\t\tSCROLL_DIRECTION_REVERSE = \'REVERSE\',\r\n\t\t\tSCROLL_DIRECTION_PAUSED = \'PAUSED\',\r\n\t\t\tDEFAULT_OPTIONS = CONTROLLER_OPTIONS.defaults;\r\n\r\n\t\t/*\r\n\t\t * ----------------------------------------------------------------\r\n\t\t * private vars\r\n\t\t * ----------------------------------------------------------------\r\n\t\t */\r\n\t\tvar\r\n\t\t\tController = this,\r\n\t\t\t_options = _util.extend({}, DEFAULT_OPTIONS, options),\r\n\t\t\t_sceneObjects = [],\r\n\t\t\t_updateScenesOnNextCycle = false, // can be boolean (true => all scenes) or an array of scenes to be updated\r\n\t\t\t_scrollPos = 0,\r\n\t\t\t_scrollDirection = SCROLL_DIRECTION_PAUSED,\r\n\t\t\t_isDocument = true,\r\n\t\t\t_viewPortSize = 0,\r\n\t\t\t_enabled = true,\r\n\t\t\t_updateTimeout,\r\n\t\t\t_refreshTimeout;\r\n\r\n\t\t/*\r\n\t\t * ----------------------------------------------------------------\r\n\t\t * private functions\r\n\t\t * ----------------------------------------------------------------\r\n\t\t */\r\n\r\n\t\t/**\r\n\t\t * Internal constructor function of the ScrollMagic Controller\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar construct = function () {\r\n\t\t\tfor (var key in _options) {\r\n\t\t\t\tif (!DEFAULT_OPTIONS.hasOwnProperty(key)) {\r\n\t\t\t\t\tlog(2, "WARNING: Unknown option \\"" + key + "\\"");\r\n\t\t\t\t\tdelete _options[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t_options.container = _util.get.elements(_options.container)[0];\r\n\t\t\t// check ScrollContainer\r\n\t\t\tif (!_options.container) {\r\n\t\t\t\tlog(1, "ERROR creating object " + NAMESPACE + ": No valid scroll container supplied");\r\n\t\t\t\tthrow NAMESPACE + " init failed."; // cancel\r\n\t\t\t}\r\n\t\t\t_isDocument = _options.container === window || _options.container === document.body || !document.body.contains(_options.container);\r\n\t\t\t// normalize to window\r\n\t\t\tif (_isDocument) {\r\n\t\t\t\t_options.container = window;\r\n\t\t\t}\r\n\t\t\t// update container size immediately\r\n\t\t\t_viewPortSize = getViewportSize();\r\n\t\t\t// set event handlers\r\n\t\t\t_options.container.addEventListener("resize", onChange);\r\n\t\t\t_options.container.addEventListener("scroll", onChange);\r\n\r\n\t\t\tvar ri = parseInt(_options.refreshInterval, 10);\r\n\t\t\t_options.refreshInterval = _util.type.Number(ri) ? ri : DEFAULT_OPTIONS.refreshInterval;\r\n\t\t\tscheduleRefresh();\r\n\r\n\t\t\tlog(3, "added new " + NAMESPACE + " controller (v" + ScrollMagic.version + ")");\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Schedule the next execution of the refresh function\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar scheduleRefresh = function () {\r\n\t\t\tif (_options.refreshInterval > 0) {\r\n\t\t\t\t_refreshTimeout = window.setTimeout(refresh, _options.refreshInterval);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Default function to get scroll pos - overwriteable using `Controller.scrollPos(newFunction)`\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar getScrollPos = function () {\r\n\t\t\treturn _options.vertical ? _util.get.scrollTop(_options.container) : _util.get.scrollLeft(_options.container);\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Returns the current viewport Size (width vor horizontal, height for vertical)\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar getViewportSize = function () {\r\n\t\t\treturn _options.vertical ? _util.get.height(_options.container) : _util.get.width(_options.container);\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Default function to set scroll pos - overwriteable using `Controller.scrollTo(newFunction)`\r\n\t\t * Make available publicly for pinned mousewheel workaround.\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar setScrollPos = this._setScrollPos = function (pos) {\r\n\t\t\tif (_options.vertical) {\r\n\t\t\t\tif (_isDocument) {\r\n\t\t\t\t\twindow.scrollTo(_util.get.scrollLeft(), pos);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t_options.container.scrollTop = pos;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (_isDocument) {\r\n\t\t\t\t\twindow.scrollTo(pos, _util.get.scrollTop());\r\n\t\t\t\t} else {\r\n\t\t\t\t\t_options.container.scrollLeft = pos;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Handle updates in cycles instead of on scroll (performance)\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar updateScenes = function () {\r\n\t\t\tif (_enabled && _updateScenesOnNextCycle) {\r\n\t\t\t\t// determine scenes to update\r\n\t\t\t\tvar scenesToUpdate = _util.type.Array(_updateScenesOnNextCycle) ? _updateScenesOnNextCycle : _sceneObjects.slice(0);\r\n\t\t\t\t// reset scenes\r\n\t\t\t\t_updateScenesOnNextCycle = false;\r\n\t\t\t\tvar oldScrollPos = _scrollPos;\r\n\t\t\t\t// update scroll pos now instead of onChange, as it might have changed since scheduling (i.e. in-browser smooth scroll)\r\n\t\t\t\t_scrollPos = Controller.scrollPos();\r\n\t\t\t\tvar deltaScroll = _scrollPos - oldScrollPos;\r\n\t\t\t\tif (deltaScroll !== 0) { // scroll position changed?\r\n\t\t\t\t\t_scrollDirection = (deltaScroll > 0) ? SCROLL_DIRECTION_FORWARD : SCROLL_DIRECTION_REVERSE;\r\n\t\t\t\t}\r\n\t\t\t\t// reverse order of scenes if scrolling reverse\r\n\t\t\t\tif (_scrollDirection === SCROLL_DIRECTION_REVERSE) {\r\n\t\t\t\t\tscenesToUpdate.reverse();\r\n\t\t\t\t}\r\n\t\t\t\t// update scenes\r\n\t\t\t\tscenesToUpdate.forEach(function (scene, index) {\r\n\t\t\t\t\tlog(3, "updating Scene " + (index + 1) + "/" + scenesToUpdate.length + " (" + _sceneObjects.length + " total)");\r\n\t\t\t\t\tscene.update(true);\r\n\t\t\t\t});\r\n\t\t\t\tif (scenesToUpdate.length === 0 && _options.loglevel >= 3) {\r\n\t\t\t\t\tlog(3, "updating 0 Scenes (nothing added to controller)");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Initializes rAF callback\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar debounceUpdate = function () {\r\n\t\t\t_updateTimeout = _util.rAF(updateScenes);\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Handles Container changes\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar onChange = function (e) {\r\n\t\t\tlog(3, "event fired causing an update:", e.type);\r\n\t\t\tif (e.type == "resize") {\r\n\t\t\t\t// resize\r\n\t\t\t\t_viewPortSize = getViewportSize();\r\n\t\t\t\t_scrollDirection = SCROLL_DIRECTION_PAUSED;\r\n\t\t\t}\r\n\t\t\t// schedule update\r\n\t\t\tif (_updateScenesOnNextCycle !== true) {\r\n\t\t\t\t_updateScenesOnNextCycle = true;\r\n\t\t\t\tdebounceUpdate();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar refresh = function () {\r\n\t\t\tif (!_isDocument) {\r\n\t\t\t\t// simulate resize event. Only works for viewport relevant param (performance)\r\n\t\t\t\tif (_viewPortSize != getViewportSize()) {\r\n\t\t\t\t\tvar resizeEvent;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tresizeEvent = new Event(\'resize\', {\r\n\t\t\t\t\t\t\tbubbles: false,\r\n\t\t\t\t\t\t\tcancelable: false\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} catch (e) { // stupid IE\r\n\t\t\t\t\t\tresizeEvent = document.createEvent("Event");\r\n\t\t\t\t\t\tresizeEvent.initEvent("resize", false, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t_options.container.dispatchEvent(resizeEvent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t_sceneObjects.forEach(function (scene, index) { // refresh all scenes\r\n\t\t\t\tscene.refresh();\r\n\t\t\t});\r\n\t\t\tscheduleRefresh();\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Send a debug message to the console.\r\n\t\t * provided publicly with _log for plugins\r\n\t\t * @private\r\n\t\t *\r\n\t\t * @param {number} loglevel - The loglevel required to initiate output for the message.\r\n\t\t * @param {...mixed} output - One or more variables that should be passed to the console.\r\n\t\t */\r\n\t\tvar log = this._log = function (loglevel, output) {\r\n\t\t\tif (_options.loglevel >= loglevel) {\r\n\t\t\t\tArray.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ") ->");\r\n\t\t\t\t_util.log.apply(window, arguments);\r\n\t\t\t}\r\n\t\t};\r\n\t\t// for scenes we have getters for each option, but for the controller we don\'t, so we need to make it available externally for plugins\r\n\t\tthis._options = _options;\r\n\r\n\t\t/**\r\n\t\t * Sort scenes in ascending order of their start offset.\r\n\t\t * @private\r\n\t\t *\r\n\t\t * @param {array} ScenesArray - an array of ScrollMagic Scenes that should be sorted\r\n\t\t * @return {array} The sorted array of Scenes.\r\n\t\t */\r\n\t\tvar sortScenes = function (ScenesArray) {\r\n\t\t\tif (ScenesArray.length <= 1) {\r\n\t\t\t\treturn ScenesArray;\r\n\t\t\t} else {\r\n\t\t\t\tvar scenes = ScenesArray.slice(0);\r\n\t\t\t\tscenes.sort(function (a, b) {\r\n\t\t\t\t\treturn a.scrollOffset() > b.scrollOffset() ? 1 : -1;\r\n\t\t\t\t});\r\n\t\t\t\treturn scenes;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * ----------------------------------------------------------------\r\n\t\t * public functions\r\n\t\t * ----------------------------------------------------------------\r\n\t\t */\r\n\r\n\t\t/**\r\n\t\t * Add one ore more scene(s) to the controller. \r\n\t\t * This is the equivalent to `Scene.addTo(controller)`.\r\n\t\t * @public\r\n\t\t * @example\r\n\t\t * // with a previously defined scene\r\n\t\t * controller.addScene(scene);\r\n\t\t *\r\n\t\t * // with a newly created scene.\r\n\t\t * controller.addScene(new ScrollMagic.Scene({duration : 0}));\r\n\t\t *\r\n\t\t * // adding multiple scenes\r\n\t\t * controller.addScene([scene, scene2, new ScrollMagic.Scene({duration : 0})]);\r\n\t\t *\r\n\t\t * @param {(ScrollMagic.Scene|array)} newScene - ScrollMagic Scene or Array of Scenes to be added to the controller.\r\n\t\t * @return {Controller} Parent object for chaining.\r\n\t\t */\r\n\t\tthis.addScene = function (newScene) {\r\n\t\t\tif (_util.type.Array(newScene)) {\r\n\t\t\t\tnewScene.forEach(function (scene, index) {\r\n\t\t\t\t\tController.addScene(scene);\r\n\t\t\t\t});\r\n\t\t\t} else if (newScene instanceof ScrollMagic.Scene) {\r\n\t\t\t\tif (newScene.controller() !== Controller) {\r\n\t\t\t\t\tnewScene.addTo(Controller);\r\n\t\t\t\t} else if (_sceneObjects.indexOf(newScene) < 0) {\r\n\t\t\t\t\t// new scene\r\n\t\t\t\t\t_sceneObjects.push(newScene); // add to array\r\n\t\t\t\t\t_sceneObjects = sortScenes(_sceneObjects); // sort\r\n\t\t\t\t\tnewScene.on("shift.controller_sort", function () { // resort whenever scene moves\r\n\t\t\t\t\t\t_sceneObjects = sortScenes(_sceneObjects);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t// insert Global defaults.\r\n\t\t\t\t\tfor (var key in _options.globalSceneOptions) {\r\n\t\t\t\t\t\tif (newScene[key]) {\r\n\t\t\t\t\t\t\tnewScene[key].call(newScene, _options.globalSceneOptions[key]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlog(3, "adding Scene (now " + _sceneObjects.length + " total)");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tlog(1, "ERROR: invalid argument supplied for \'.addScene()\'");\r\n\t\t\t}\r\n\t\t\treturn Controller;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Remove one ore more scene(s) from the controller. \r\n\t\t * This is the equivalent to `Scene.remove()`.\r\n\t\t * @public\r\n\t\t * @example\r\n\t\t * // remove a scene from the controller\r\n\t\t * controller.removeScene(scene);\r\n\t\t *\r\n\t\t * // remove multiple scenes from the controller\r\n\t\t * controller.removeScene([scene, scene2, scene3]);\r\n\t\t *\r\n\t\t * @param {(ScrollMagic.Scene|array)} Scene - ScrollMagic Scene or Array of Scenes to be removed from the controller.\r\n\t\t * @returns {Controller} Parent object for chaining.\r\n\t\t */\r\n\t\tthis.removeScene = function (Scene) {\r\n\t\t\tif (_util.type.Array(Scene)) {\r\n\t\t\t\tScene.forEach(function (scene, index) {\r\n\t\t\t\t\tController.removeScene(scene);\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tvar index = _sceneObjects.indexOf(Scene);\r\n\t\t\t\tif (index > -1) {\r\n\t\t\t\t\tScene.off("shift.controller_sort");\r\n\t\t\t\t\t_sceneObjects.splice(index, 1);\r\n\t\t\t\t\tlog(3, "removing Scene (now " + _sceneObjects.length + " left)");\r\n\t\t\t\t\tScene.remove();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn Controller;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t * Update one ore more scene(s) according to the scroll position of the container. \r\n\t * This is the equivalent to `Scene.update()`. \r\n\t * The update method calculates the scene\'s start and end position (based on the trigger element, trigger hook, duration and offset) and checks it against the current scroll position of the container. \r\n\t * It then updates the current scene state accordingly (or does nothing, if the state is already correct) â Pins will be set to their correct position and tweens will be updated to their correct progress. \r\n\t * _**Note:** This method gets called constantly whenever Controller detects a change. The only application for you is if you change something outside of the realm of ScrollMagic, like moving the trigger or changing tween parameters._\r\n\t * @public\r\n\t * @example\r\n\t * // update a specific scene on next cycle\r\n \t * controller.updateScene(scene);\r\n \t *\r\n\t * // update a specific scene immediately\r\n\t * controller.updateScene(scene, true);\r\n \t *\r\n\t * // update multiple scenes scene on next cycle\r\n\t * controller.updateScene([scene1, scene2, scene3]);\r\n\t *\r\n\t * @param {ScrollMagic.Scene} Scene - ScrollMagic Scene or Array of Scenes that is/are supposed to be updated.\r\n\t * @param {boolean} [immediately=false] - If `true` the update will be instant, if `false` it will wait until next update cycle. \r\n\t \t\t\t\t\t\t\t\t\t\t This is useful when changing multiple properties of the scene - this way it will only be updated once all new properties are set (updateScenes).\r\n\t * @return {Controller} Parent object for chaining.\r\n\t */\r\n\t\tthis.updateScene = function (Scene, immediately) {\r\n\t\t\tif (_util.type.Array(Scene)) {\r\n\t\t\t\tScene.forEach(function (scene, index) {\r\n\t\t\t\t\tController.updateScene(scene, immediately);\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tif (immediately) {\r\n\t\t\t\t\tScene.update(true);\r\n\t\t\t\t} else if (_updateScenesOnNextCycle !== true && Scene instanceof ScrollMagic.Scene) { // if _updateScenesOnNextCycle is true, all connected scenes are already scheduled for update\r\n\t\t\t\t\t// prep array for next update cycle\r\n\t\t\t\t\t_updateScenesOnNextCycle = _updateScenesOnNextCycle || [];\r\n\t\t\t\t\tif (_updateScenesOnNextCycle.indexOf(Scene) == -1) {\r\n\t\t\t\t\t\t_updateScenesOnNextCycle.push(Scene);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t_updateScenesOnNextCycle = sortScenes(_updateScenesOnNextCycle); // sort\r\n\t\t\t\t\tdebounceUpdate();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn Controller;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Updates the controller params and calls updateScene on every scene, that is attached to the controller. \r\n\t\t * See `Controller.updateScene()` for more information about what this means. \r\n\t\t * In most cases you will not need this function, as it is called constantly, whenever ScrollMagic detects a state change event, like resize or scroll. \r\n\t\t * The only application for this method is when ScrollMagic fails to detect these events. \r\n\t\t * One application is with some external scroll libraries (like iScroll) that move an internal container to a negative offset instead of actually scrolling. In this case the update on the controller needs to be called whenever the child container\'s position changes.\r\n\t\t * For this case there will also be the need to provide a custom function to calculate the correct scroll position. See `Controller.scrollPos()` for details.\r\n\t\t * @public\r\n\t\t * @example\r\n\t\t * // update the controller on next cycle (saves performance due to elimination of redundant updates)\r\n\t\t * controller.update();\r\n\t\t *\r\n\t\t * // update the controller immediately\r\n\t\t * controller.update(true);\r\n\t\t *\r\n\t\t * @param {boolean} [immediately=false] - If `true` the update will be instant, if `false` it will wait until next update cycle (better performance)\r\n\t\t * @return {Controller} Parent object for chaining.\r\n\t\t */\r\n\t\tthis.update = function (immediately) {\r\n\t\t\tonChange({\r\n\t\t\t\ttype: "resize"\r\n\t\t\t}); // will update size and set _updateScenesOnNextCycle to true\r\n\t\t\tif (immediately) {\r\n\t\t\t\tupdateScenes();\r\n\t\t\t}\r\n\t\t\treturn Controller;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Scroll to a numeric scroll offset, a DOM element, the start of a scene or provide an alternate method for scrolling. \r\n\t\t * For vertical controllers it will change the top scroll offset and for horizontal applications it will change the left offset.\r\n\t\t * @public\r\n\t\t *\r\n\t\t * @since 1.1.0\r\n\t\t * @example\r\n\t\t * // scroll to an offset of 100\r\n\t\t * controller.scrollTo(100);\r\n\t\t *\r\n\t\t * // scroll to a DOM element\r\n\t\t * controller.scrollTo("#anchor");\r\n\t\t *\r\n\t\t * // scroll to the beginning of a scene\r\n\t\t * var scene = new ScrollMagic.Scene({offset: 200});\r\n\t\t * controller.scrollTo(scene);\r\n\t\t *\r\n\t\t * // define a new scroll position modification function (jQuery animate instead of jump)\r\n\t\t * controller.scrollTo(function (newScrollPos) {\r\n\t\t *\t$("html, body").animate({scrollTop: newScrollPos});\r\n\t\t * });\r\n\t\t * controller.scrollTo(100); // call as usual, but the new function will be used instead\r\n\t\t *\r\n\t\t * // define a new scroll function with an additional parameter\r\n\t\t * controller.scrollTo(function (newScrollPos, message) {\r\n\t\t * console.log(message);\r\n\t\t *\t$(this).animate({scrollTop: newScrollPos});\r\n\t\t * });\r\n\t\t * // call as usual, but supply an extra parameter to the defined custom function\r\n\t\t * controller.scrollTo(100, "my message");\r\n\t\t *\r\n\t\t * // define a new scroll function with an additional parameter containing multiple variables\r\n\t\t * controller.scrollTo(function (newScrollPos, options) {\r\n\t\t * someGlobalVar = options.a + options.b;\r\n\t\t *\t$(this).animate({scrollTop: newScrollPos});\r\n\t\t * });\r\n\t\t * // call as usual, but supply an extra parameter containing multiple options\r\n\t\t * controller.scrollTo(100, {a: 1, b: 2});\r\n\t\t *\r\n\t\t * // define a new scroll function with a callback supplied as an additional parameter\r\n\t\t * controller.scrollTo(function (newScrollPos, callback) {\r\n\t\t *\t$(this).animate({scrollTop: newScrollPos}, 400, "swing", callback);\r\n\t\t * });\r\n\t\t * // call as usual, but supply an extra parameter, which is used as a callback in the previously defined custom scroll function\r\n\t\t * controller.scrollTo(100, function() {\r\n\t\t *\tconsole.log("scroll has finished.");\r\n\t\t * });\r\n\t\t *\r\n\t\t * @param {mixed} scrollTarget - The supplied argument can be one of these types:\r\n\t\t * 1. `number` -> The container will scroll to this new scroll offset.\r\n\t\t * 2. `string` or `object` -> Can be a selector or a DOM object. \r\n\t\t * The container will scroll to the position of this element.\r\n\t\t * 3. `ScrollMagic Scene` -> The container will scroll to the start of this scene.\r\n\t\t * 4. `function` -> This function will be used for future scroll position modifications. \r\n\t\t * This provides a way for you to change the behaviour of scrolling and adding new behaviour like animation. The function receives the new scroll position as a parameter and a reference to the container element using `this`. \r\n\t\t * It may also optionally receive an optional additional parameter (see below) \r\n\t\t * _**NOTE:** \r\n\t\t * All other options will still work as expected, using the new function to scroll._\r\n\t\t * @param {mixed} [additionalParameter] - If a custom scroll function was defined (see above 4.), you may want to supply additional parameters to it, when calling it. You can do this using this parameter â see examples for details. Please note, that this parameter will have no effect, if you use the default scrolling function.\r\n\t\t * @returns {Controller} Parent object for chaining.\r\n\t\t */\r\n\t\tthis.scrollTo = function (scrollTarget, additionalParameter) {\r\n\t\t\tif (_util.type.Number(scrollTarget)) { // excecute\r\n\t\t\t\tsetScrollPos.call(_options.container, scrollTarget, additionalParameter);\r\n\t\t\t} else if (scrollTarget instanceof ScrollMagic.Scene) { // scroll to scene\r\n\t\t\t\tif (scrollTarget.controller() === Controller) { // check if the controller is associated with this scene\r\n\t\t\t\t\tController.scrollTo(scrollTarget.scrollOffset(), additionalParameter);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlog(2, "scrollTo(): The supplied scene does not belong to this controller. Scroll cancelled.", scrollTarget);\r\n\t\t\t\t}\r\n\t\t\t} else if (_util.type.Function(scrollTarget)) { // assign new scroll function\r\n\t\t\t\tsetScrollPos = scrollTarget;\r\n\t\t\t} else { // scroll to element\r\n\t\t\t\tvar elem = _util.get.elements(scrollTarget)[0];\r\n\t\t\t\tif (elem) {\r\n\t\t\t\t\t// if parent is pin spacer, use spacer position instead so correct start position is returned for pinned elements.\r\n\t\t\t\t\twhile (elem.parentNode.hasAttribute(PIN_SPACER_ATTRIBUTE)) {\r\n\t\t\t\t\t\telem = elem.parentNode;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar\r\n\t\t\t\t\t\tparam = _options.vertical ? "top" : "left", // which param is of interest ?\r\n\t\t\t\t\t\tcontainerOffset = _util.get.offset(_options.container), // container position is needed because element offset is returned in relation to document, not in relation to container.\r\n\t\t\t\t\t\telementOffset = _util.get.offset(elem);\r\n\r\n\t\t\t\t\tif (!_isDocument) { // container is not the document root, so substract scroll Position to get correct trigger element position relative to scrollcontent\r\n\t\t\t\t\t\tcontainerOffset[param] -= Controller.scrollPos();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tController.scrollTo(elementOffset[param] - containerOffset[param], additionalParameter);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlog(2, "scrollTo(): The supplied argument is invalid. Scroll cancelled.", scrollTarget);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn Controller;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * **Get** the current scrollPosition or **Set** a new method to calculate it. \r\n\t\t * -> **GET**:\r\n\t\t * When used as a getter this function will return the current scroll position. \r\n\t\t * To get a cached value use Controller.info("scrollPos"), which will be updated in the update cycle. \r\n\t\t * For vertical controllers it will return the top scroll offset and for horizontal applications it will return the left offset.\r\n\t\t *\r\n\t\t * -> **SET**:\r\n\t\t * When used as a setter this method prodes a way to permanently overwrite the controller\'s scroll position calculation. \r\n\t\t * A typical usecase is when the scroll position is not reflected by the containers scrollTop or scrollLeft values, but for example by the inner offset of a child container. \r\n\t\t * Moving a child container inside a parent is a commonly used method for several scrolling frameworks, including iScroll. \r\n\t\t * By providing an alternate calculation function you can make sure ScrollMagic receives the correct scroll position. \r\n\t\t * Please also bear in mind that your function should return y values for vertical scrolls an x for horizontals.\r\n\t\t *\r\n\t\t * To change the current scroll position please use `Controller.scrollTo()`.\r\n\t\t * @public\r\n\t\t *\r\n\t\t * @example\r\n\t\t * // get the current scroll Position\r\n\t\t * var scrollPos = controller.scrollPos();\r\n\t\t *\r\n\t\t * // set a new scroll position calculation method\r\n\t\t * controller.scrollPos(function () {\r\n\t\t *\treturn this.info("vertical") ? -mychildcontainer.y : -mychildcontainer.x\r\n\t\t * });\r\n\t\t *\r\n\t\t * @param {function} [scrollPosMethod] - The function to be used for the scroll position calculation of the container.\r\n\t\t * @returns {(number|Controller)} Current scroll position or parent object for chaining.\r\n\t\t */\r\n\t\tthis.scrollPos = function (scrollPosMethod) {\r\n\t\t\tif (!arguments.length) { // get\r\n\t\t\t\treturn getScrollPos.call(Controller);\r\n\t\t\t} else { // set\r\n\t\t\t\tif (_util.type.Function(scrollPosMethod)) {\r\n\t\t\t\t\tgetScrollPos = scrollPosMethod;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlog(2, "Provided value for method \'scrollPos\' is not a function. To change the current scroll position use \'scrollTo()\'.");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn Controller;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * **Get** all infos or one in particular about the controller.\r\n\t\t * @public\r\n\t\t * @example\r\n\t\t * // returns the current scroll position (number)\r\n\t\t * var scrollPos = controller.info("scrollPos");\r\n\t\t *\r\n\t\t * // returns all infos as an object\r\n\t\t * var infos = controller.info();\r\n\t\t *\r\n\t\t * @param {string} [about] - If passed only this info will be returned instead of an object containing all. \r\n\t\t \t\t\t\t\t\t\t Valid options are:\r\n\t\t \t\t\t\t\t\t\t ** `"size"` => the current viewport size of the container\r\n\t\t \t\t\t\t\t\t\t ** `"vertical"` => true if vertical scrolling, otherwise false\r\n\t\t \t\t\t\t\t\t\t ** `"scrollPos"` => the current scroll position\r\n\t\t \t\t\t\t\t\t\t ** `"scrollDirection"` => the last known direction of the scroll\r\n\t\t \t\t\t\t\t\t\t ** `"container"` => the container element\r\n\t\t \t\t\t\t\t\t\t ** `"isDocument"` => true if container element is the document.\r\n\t\t * @returns {(mixed|object)} The requested info(s).\r\n\t\t */\r\n\t\tthis.info = function (about) {\r\n\t\t\tvar values = {\r\n\t\t\t\tsize: _viewPortSize, // contains height or width (in regard to orientation);\r\n\t\t\t\tvertical: _options.vertical,\r\n\t\t\t\tscrollPos: _scrollPos,\r\n\t\t\t\tscrollDirection: _scrollDirection,\r\n\t\t\t\tcontainer: _options.container,\r\n\t\t\t\tisDocument: _isDocument\r\n\t\t\t};\r\n\t\t\tif (!arguments.length) { // get all as an object\r\n\t\t\t\treturn values;\r\n\t\t\t} else if (values[about] !== undefined) {\r\n\t\t\t\treturn values[about];\r\n\t\t\t} else {\r\n\t\t\t\tlog(1, "ERROR: option \\"" + about + "\\" is not available");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * **Get** or **Set** the current loglevel option value.\r\n\t\t * @public\r\n\t\t *\r\n\t\t * @example\r\n\t\t * // get the current value\r\n\t\t * var loglevel = controller.loglevel();\r\n\t\t *\r\n\t\t * // set a new value\r\n\t\t * controller.loglevel(3);\r\n\t\t *\r\n\t\t * @param {number} [newLoglevel] - The new loglevel setting of the Controller. `[0-3]`\r\n\t\t * @returns {(number|Controller)} Current loglevel or parent object for chaining.\r\n\t\t */\r\n\t\tthis.loglevel = function (newLoglevel) {\r\n\t\t\tif (!arguments.length) { // get\r\n\t\t\t\treturn _options.loglevel;\r\n\t\t\t} else if (_options.loglevel != newLoglevel) { // set\r\n\t\t\t\t_options.loglevel = newLoglevel;\r\n\t\t\t}\r\n\t\t\treturn Controller;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * **Get** or **Set** the current enabled state of the controller. \r\n\t\t * This can be used to disable all Scenes connected to the controller without destroying or removing them.\r\n\t\t * @public\r\n\t\t *\r\n\t\t * @example\r\n\t\t * // get the current value\r\n\t\t * var enabled = controller.enabled();\r\n\t\t *\r\n\t\t * // disable the controller\r\n\t\t * controller.enabled(false);\r\n\t\t *\r\n\t\t * @param {boolean} [newState] - The new enabled state of the controller `true` or `false`.\r\n\t\t * @returns {(boolean|Controller)} Current enabled state or parent object for chaining.\r\n\t\t */\r\n\t\tthis.enabled = function (newState) {\r\n\t\t\tif (!arguments.length) { // get\r\n\t\t\t\treturn _enabled;\r\n\t\t\t} else if (_enabled != newState) { // set\r\n\t\t\t\t_enabled = !!newState;\r\n\t\t\t\tController.updateScene(_sceneObjects, true);\r\n\t\t\t}\r\n\t\t\treturn Controller;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Destroy the Controller, all Scenes and everything.\r\n\t\t * @public\r\n\t\t *\r\n\t\t * @example\r\n\t\t * // without resetting the scenes\r\n\t\t * controller = controller.destroy();\r\n\t\t *\r\n\t\t * // with scene reset\r\n\t\t * controller = controller.destroy(true);\r\n\t\t *\r\n\t\t * @param {boolean} [resetScenes=false] - If `true` the pins and tweens (if existent) of all scenes will be reset.\r\n\t\t * @returns {null} Null to unset handler variables.\r\n\t\t */\r\n\t\tthis.destroy = function (resetScenes) {\r\n\t\t\twindow.clearTimeout(_refreshTimeout);\r\n\t\t\tvar i = _sceneObjects.length;\r\n\t\t\twhile (i--) {\r\n\t\t\t\t_sceneObjects[i].destroy(resetScenes);\r\n\t\t\t}\r\n\t\t\t_options.container.removeEventListener("resize", onChange);\r\n\t\t\t_options.container.removeEventListener("scroll", onChange);\r\n\t\t\t_util.cAF(_updateTimeout);\r\n\t\t\tlog(3, "destroyed " + NAMESPACE + " (reset: " + (resetScenes ? "true" : "false") + ")");\r\n\t\t\treturn null;\r\n\t\t};\r\n\r\n\t\t// INIT\r\n\t\tconstruct();\r\n\t\treturn Controller;\r\n\t};\r\n\r\n\t// store pagewide controller options\r\n\tvar CONTROLLER_OPTIONS = {\r\n\t\tdefaults: {\r\n\t\t\tcontainer: window,\r\n\t\t\tvertical: true,\r\n\t\t\tglobalSceneOptions: {},\r\n\t\t\tloglevel: 2,\r\n\t\t\trefreshInterval: 100\r\n\t\t}\r\n\t};\r\n\t/*\r\n\t * method used to add an option to ScrollMagic Scenes.\r\n\t */\r\n\tScrollMagic.Controller.addOption = function (name, defaultValue) {\r\n\t\tCONTROLLER_OPTIONS.defaults[name] = defaultValue;\r\n\t};\r\n\t// instance extension function for plugins\r\n\tScrollMagic.Controller.extend = function (extension) {\r\n\t\tvar oldClass = this;\r\n\t\tScrollMagic.Controller = function () {\r\n\t\t\toldClass.apply(this, arguments);\r\n\t\t\tthis.$super = _util.extend({}, this); // copy parent state\r\n\t\t\treturn extension.apply(this, arguments) || this;\r\n\t\t};\r\n\t\t_util.extend(ScrollMagic.Controller, oldClass); // copy properties\r\n\t\tScrollMagic.Controller.prototype = oldClass.prototype; // copy prototype\r\n\t\tScrollMagic.Controller.prototype.constructor = ScrollMagic.Controller; // restore constructor\r\n\t};\r\n\r\n\r\n\t/**\r\n\t * A Scene defines where the controller should react and how.\r\n\t *\r\n\t * @class\r\n\t *\r\n\t * @example\r\n\t * // create a standard scene and add it to a controller\r\n\t * new ScrollMagic.Scene()\r\n\t *\t\t.addTo(controller);\r\n\t *\r\n\t * // create a scene with custom options and assign a handler to it.\r\n\t * var scene = new ScrollMagic.Scene({\r\n\t * \t\tduration: 100,\r\n\t *\t\toffset: 200,\r\n\t *\t\ttriggerHook: "onEnter",\r\n\t *\t\treverse: false\r\n\t * });\r\n\t *\r\n\t * @param {object} [options] - Options for the Scene. The options can be updated at any time. \r\n\t \t\t\t\t\t\t\t Instead of setting the options for each scene individually you can also set them globally in the controller as the controllers `globalSceneOptions` option. The object accepts the same properties as the ones below. \r\n\t \t\t\t\t\t\t\t When a scene is added to the controller the options defined using the Scene constructor will be overwritten by those set in `globalSceneOptions`.\r\n\t * @param {(number|string|function)} [options.duration=0] - The duration of the scene. \r\n\t \t\t\t\t\tPlease see `Scene.duration()` for details.\r\n\t * @param {number} [options.offset=0] - Offset Value for the Trigger Position. If no triggerElement is defined this will be the scroll distance from the start of the page, after which the scene will start.\r\n\t * @param {(string|object)} [options.triggerElement=null] - Selector or DOM object that defines the start of the scene. If undefined the scene will start right at the start of the page (unless an offset is set).\r\n\t * @param {(number|string)} [options.triggerHook="onCenter"] - Can be a number between 0 and 1 defining the position of the trigger Hook in relation to the viewport. \r\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Can also be defined using a string:\r\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ** `"onEnter"` => `1`\r\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ** `"onCenter"` => `0.5`\r\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ** `"onLeave"` => `0`\r\n\t * @param {boolean} [options.reverse=true] - Should the scene reverse, when scrolling up?\r\n\t * @param {number} [options.loglevel=2] - Loglevel for debugging. Note that logging is disabled in the minified version of ScrollMagic.\r\n\t \t\t\t\t\t\t\t\t\t\t ** `0` => silent\r\n\t \t\t\t\t\t\t\t\t\t\t ** `1` => errors\r\n\t \t\t\t\t\t\t\t\t\t\t ** `2` => errors, warnings\r\n\t \t\t\t\t\t\t\t\t\t\t ** `3` => errors, warnings, debuginfo\r\n\t * \r\n\t */\r\n\tScrollMagic.Scene = function (options) {\r\n\r\n\t\t/*\r\n\t\t * ----------------------------------------------------------------\r\n\t\t * settings\r\n\t\t * ----------------------------------------------------------------\r\n\t\t */\r\n\r\n\t\tvar\r\n\t\t\tNAMESPACE = \'ScrollMagic.Scene\',\r\n\t\t\tSCENE_STATE_BEFORE = \'BEFORE\',\r\n\t\t\tSCENE_STATE_DURING = \'DURING\',\r\n\t\t\tSCENE_STATE_AFTER = \'AFTER\',\r\n\t\t\tDEFAULT_OPTIONS = SCENE_OPTIONS.defaults;\r\n\r\n\t\t/*\r\n\t\t * ----------------------------------------------------------------\r\n\t\t * private vars\r\n\t\t * ----------------------------------------------------------------\r\n\t\t */\r\n\r\n\t\tvar\r\n\t\t\tScene = this,\r\n\t\t\t_options = _util.extend({}, DEFAULT_OPTIONS, options),\r\n\t\t\t_state = SCENE_STATE_BEFORE,\r\n\t\t\t_progress = 0,\r\n\t\t\t_scrollOffset = {\r\n\t\t\t\tstart: 0,\r\n\t\t\t\tend: 0\r\n\t\t\t}, // reflects the controllers\'s scroll position for the start and end of the scene respectively\r\n\t\t\t_triggerPos = 0,\r\n\t\t\t_enabled = true,\r\n\t\t\t_durationUpdateMethod,\r\n\t\t\t_controller;\r\n\r\n\t\t/**\r\n\t\t * Internal constructor function of the ScrollMagic Scene\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar construct = function () {\r\n\t\t\tfor (var key in _options) { // check supplied options\r\n\t\t\t\tif (!DEFAULT_OPTIONS.hasOwnProperty(key)) {\r\n\t\t\t\t\tlog(2, "WARNING: Unknown option \\"" + key + "\\"");\r\n\t\t\t\t\tdelete _options[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// add getters/setters for all possible options\r\n\t\t\tfor (var optionName in DEFAULT_OPTIONS) {\r\n\t\t\t\taddSceneOption(optionName);\r\n\t\t\t}\r\n\t\t\t// validate all options\r\n\t\t\tvalidateOption();\r\n\t\t};\r\n\r\n\t\t/*\r\n\t\t * ----------------------------------------------------------------\r\n\t\t * Event Management\r\n\t\t * ----------------------------------------------------------------\r\n\t\t */\r\n\r\n\t\tvar _listeners = {};\r\n\t\t/**\r\n\t\t * Scene start event. \r\n\t\t * Fires whenever the scroll position its the starting point of the scene. \r\n\t\t * It will also fire when scrolling back up going over the start position of the scene. If you want something to happen only when scrolling down/right, use the scrollDirection parameter passed to the callback.\r\n\t\t *\r\n\t\t * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method.\r\n\t\t *\r\n\t\t * @event ScrollMagic.Scene#start\r\n\t\t *\r\n\t\t * @example\r\n\t\t * scene.on("start", function (event) {\r\n\t\t * \tconsole.log("Hit start point of scene.");\r\n\t\t * });\r\n\t\t *\r\n\t\t * @property {object} event - The event Object passed to each callback\r\n\t\t * @property {string} event.type - The name of the event\r\n\t\t * @property {Scene} event.target - The Scene object that triggered this event\r\n\t\t * @property {number} event.progress - Reflects the current progress of the scene\r\n\t\t * @property {string} event.state - The current state of the scene `"BEFORE"` or `"DURING"`\r\n\t\t * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"`\r\n\t\t */\r\n\t\t/**\r\n\t\t * Scene end event. \r\n\t\t * Fires whenever the scroll position its the ending point of the scene. \r\n\t\t * It will also fire when scrolling back up from after the scene and going over its end position. If you want something to happen only when scrolling down/right, use the scrollDirection parameter passed to the callback.\r\n\t\t *\r\n\t\t * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method.\r\n\t\t *\r\n\t\t * @event ScrollMagic.Scene#end\r\n\t\t *\r\n\t\t * @example\r\n\t\t * scene.on("end", function (event) {\r\n\t\t * \tconsole.log("Hit end point of scene.");\r\n\t\t * });\r\n\t\t *\r\n\t\t * @property {object} event - The event Object passed to each callback\r\n\t\t * @property {string} event.type - The name of the event\r\n\t\t * @property {Scene} event.target - The Scene object that triggered this event\r\n\t\t * @property {number} event.progress - Reflects the current progress of the scene\r\n\t\t * @property {string} event.state - The current state of the scene `"DURING"` or `"AFTER"`\r\n\t\t * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"`\r\n\t\t */\r\n\t\t/**\r\n\t\t * Scene enter event. \r\n\t\t * Fires whenever the scene enters the "DURING" state. \r\n\t\t * Keep in mind that it doesn\'t matter if the scene plays forward or backward: This event always fires when the scene enters its active scroll timeframe, regardless of the scroll-direction.\r\n\t\t *\r\n\t\t * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method.\r\n\t\t *\r\n\t\t * @event ScrollMagic.Scene#enter\r\n\t\t *\r\n\t\t * @example\r\n\t\t * scene.on("enter", function (event) {\r\n\t\t * \tconsole.log("Scene entered.");\r\n\t\t * });\r\n\t\t *\r\n\t\t * @property {object} event - The event Object passed to each callback\r\n\t\t * @property {string} event.type - The name of the event\r\n\t\t * @property {Scene} event.target - The Scene object that triggered this event\r\n\t\t * @property {number} event.progress - Reflects the current progress of the scene\r\n\t\t * @property {string} event.state - The current state of the scene - always `"DURING"`\r\n\t\t * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"`\r\n\t\t */\r\n\t\t/**\r\n\t\t * Scene leave event. \r\n\t\t * Fires whenever the scene\'s state goes from "DURING" to either "BEFORE" or "AFTER". \r\n\t\t * Keep in mind that it doesn\'t matter if the scene plays forward or backward: This event always fires when the scene leaves its active scroll timeframe, regardless of the scroll-direction.\r\n\t\t *\r\n\t\t * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method.\r\n\t\t *\r\n\t\t * @event ScrollMagic.Scene#leave\r\n\t\t *\r\n\t\t * @example\r\n\t\t * scene.on("leave", function (event) {\r\n\t\t * \tconsole.log("Scene left.");\r\n\t\t * });\r\n\t\t *\r\n\t\t * @property {object} event - The event Object passed to each callback\r\n\t\t * @property {string} event.type - The name of the event\r\n\t\t * @property {Scene} event.target - The Scene object that triggered this event\r\n\t\t * @property {number} event.progress - Reflects the current progress of the scene\r\n\t\t * @property {string} event.state - The current state of the scene `"BEFORE"` or `"AFTER"`\r\n\t\t * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"`\r\n\t\t */\r\n\t\t/**\r\n\t\t * Scene update event. \r\n\t\t * Fires whenever the scene is updated (but not necessarily changes the progress).\r\n\t\t *\r\n\t\t * @event ScrollMagic.Scene#update\r\n\t\t *\r\n\t\t * @example\r\n\t\t * scene.on("update", function (event) {\r\n\t\t * \tconsole.log("Scene updated.");\r\n\t\t * });\r\n\t\t *\r\n\t\t * @property {object} event - The event Object passed to each callback\r\n\t\t * @property {string} event.type - The name of the event\r\n\t\t * @property {Scene} event.target - The Scene object that triggered this event\r\n\t\t * @property {number} event.startPos - The starting position of the scene (in relation to the conainer)\r\n\t\t * @property {number} event.endPos - The ending position of the scene (in relation to the conainer)\r\n\t\t * @property {number} event.scrollPos - The current scroll position of the container\r\n\t\t */\r\n\t\t/**\r\n\t\t * Scene progress event. \r\n\t\t * Fires whenever the progress of the scene changes.\r\n\t\t *\r\n\t\t * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method.\r\n\t\t *\r\n\t\t * @event ScrollMagic.Scene#progress\r\n\t\t *\r\n\t\t * @example\r\n\t\t * scene.on("progress", function (event) {\r\n\t\t * \tconsole.log("Scene progress changed to " + event.progress);\r\n\t\t * });\r\n\t\t *\r\n\t\t * @property {object} event - The event Object passed to each callback\r\n\t\t * @property {string} event.type - The name of the event\r\n\t\t * @property {Scene} event.target - The Scene object that triggered this event\r\n\t\t * @property {number} event.progress - Reflects the current progress of the scene\r\n\t\t * @property {string} event.state - The current state of the scene `"BEFORE"`, `"DURING"` or `"AFTER"`\r\n\t\t * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"`\r\n\t\t */\r\n\t\t/**\r\n\t\t * Scene change event. \r\n\t\t * Fires whenvever a property of the scene is changed.\r\n\t\t *\r\n\t\t * @event ScrollMagic.Scene#change\r\n\t\t *\r\n\t\t * @example\r\n\t\t * scene.on("change", function (event) {\r\n\t\t * \tconsole.log("Scene Property \\"" + event.what + "\\" changed to " + event.newval);\r\n\t\t * });\r\n\t\t *\r\n\t\t * @property {object} event - The event Object passed to each callback\r\n\t\t * @property {string} event.type - The name of the event\r\n\t\t * @property {Scene} event.target - The Scene object that triggered this event\r\n\t\t * @property {string} event.what - Indicates what value has been changed\r\n\t\t * @property {mixed} event.newval - The new value of the changed property\r\n\t\t */\r\n\t\t/**\r\n\t\t * Scene shift event. \r\n\t\t * Fires whenvever the start or end **scroll offset** of the scene change.\r\n\t\t * This happens explicitely, when one of these values change: `offset`, `duration` or `triggerHook`.\r\n\t\t * It will fire implicitly when the `triggerElement` changes, if the new element has a different position (most cases).\r\n\t\t * It will also fire implicitly when the size of the container changes and the triggerHook is anything other than `onLeave`.\r\n\t\t *\r\n\t\t * @event ScrollMagic.Scene#shift\r\n\t\t * @since 1.1.0\r\n\t\t *\r\n\t\t * @example\r\n\t\t * scene.on("shift", function (event) {\r\n\t\t * \tconsole.log("Scene moved, because the " + event.reason + " has changed.)");\r\n\t\t * });\r\n\t\t *\r\n\t\t * @property {object} event - The event Object passed to each callback\r\n\t\t * @property {string} event.type - The name of the event\r\n\t\t * @property {Scene} event.target - The Scene object that triggered this event\r\n\t\t * @property {string} event.reason - Indicates why the scene has shifted\r\n\t\t */\r\n\t\t/**\r\n\t\t * Scene destroy event. \r\n\t\t * Fires whenvever the scene is destroyed.\r\n\t\t * This can be used to tidy up custom behaviour used in events.\r\n\t\t *\r\n\t\t * @event ScrollMagic.Scene#destroy\r\n\t\t * @since 1.1.0\r\n\t\t *\r\n\t\t * @example\r\n\t\t * scene.on("enter", function (event) {\r\n\t\t * // add custom action\r\n\t\t * $("#my-elem").left("200");\r\n\t\t * })\r\n\t\t * .on("destroy", function (event) {\r\n\t\t * // reset my element to start position\r\n\t\t * if (event.reset) {\r\n\t\t * $("#my-elem").left("0");\r\n\t\t * }\r\n\t\t * });\r\n\t\t *\r\n\t\t * @property {object} event - The event Object passed to each callback\r\n\t\t * @property {string} event.type - The name of the event\r\n\t\t * @property {Scene} event.target - The Scene object that triggered this event\r\n\t\t * @property {boolean} event.reset - Indicates if the destroy method was called with reset `true` or `false`.\r\n\t\t */\r\n\t\t/**\r\n\t\t * Scene add event. \r\n\t\t * Fires when the scene is added to a controller.\r\n\t\t * This is mostly used by plugins to know that change might be due.\r\n\t\t *\r\n\t\t * @event ScrollMagic.Scene#add\r\n\t\t * @since 2.0.0\r\n\t\t *\r\n\t\t * @example\r\n\t\t * scene.on("add", function (event) {\r\n\t\t * \tconsole.log(\'Scene was added to a new controller.\');\r\n\t\t * });\r\n\t\t *\r\n\t\t * @property {object} event - The event Object passed to each callback\r\n\t\t * @property {string} event.type - The name of the event\r\n\t\t * @property {Scene} event.target - The Scene object that triggered this event\r\n\t\t * @property {boolean} event.controller - The controller object the scene was added to.\r\n\t\t */\r\n\t\t/**\r\n\t\t * Scene remove event. \r\n\t\t * Fires when the scene is removed from a controller.\r\n\t\t * This is mostly used by plugins to know that change might be due.\r\n\t\t *\r\n\t\t * @event ScrollMagic.Scene#remove\r\n\t\t * @since 2.0.0\r\n\t\t *\r\n\t\t * @example\r\n\t\t * scene.on("remove", function (event) {\r\n\t\t * \tconsole.log(\'Scene was removed from its controller.\');\r\n\t\t * });\r\n\t\t *\r\n\t\t * @property {object} event - The event Object passed to each callback\r\n\t\t * @property {string} event.type - The name of the event\r\n\t\t * @property {Scene} event.target - The Scene object that triggered this event\r\n\t\t */\r\n\r\n\t\t/**\r\n\t\t * Add one ore more event listener. \r\n\t\t * The callback function will be fired at the respective event, and an object containing relevant data will be passed to the callback.\r\n\t\t * @method ScrollMagic.Scene#on\r\n\t\t *\r\n\t\t * @example\r\n\t\t * function callback (event) {\r\n\t\t * \t\tconsole.log("Event fired! (" + event.type + ")");\r\n\t\t * }\r\n\t\t * // add listeners\r\n\t\t * scene.on("change update progress start end enter leave", callback);\r\n\t\t *\r\n\t\t * @param {string} names - The name or names of the event the callback should be attached to.\r\n\t\t * @param {function} callback - A function that should be executed, when the event is dispatched. An event object will be passed to the callback.\r\n\t\t * @returns {Scene} Parent object for chaining.\r\n\t\t */\r\n\t\tthis.on = function (names, callback) {\r\n\t\t\tif (_util.type.Function(callback)) {\r\n\t\t\t\tnames = names.trim().split(\' \');\r\n\t\t\t\tnames.forEach(function (fullname) {\r\n\t\t\t\t\tvar\r\n\t\t\t\t\t\tnameparts = fullname.split(\'.\'),\r\n\t\t\t\t\t\teventname = nameparts[0],\r\n\t\t\t\t\t\tnamespace = nameparts[1];\r\n\t\t\t\t\tif (eventname != "*") { // disallow wildcards\r\n\t\t\t\t\t\tif (!_listeners[eventname]) {\r\n\t\t\t\t\t\t\t_listeners[eventname] = [];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t_listeners[eventname].push({\r\n\t\t\t\t\t\t\tnamespace: namespace || \'\',\r\n\t\t\t\t\t\t\tcallback: callback\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tlog(1, "ERROR when calling \'.on()\': Supplied callback for \'" + names + "\' is not a valid function!");\r\n\t\t\t}\r\n\t\t\treturn Scene;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Remove one or more event listener.\r\n\t\t * @method ScrollMagic.Scene#off\r\n\t\t *\r\n\t\t * @example\r\n\t\t * function callback (event) {\r\n\t\t * \t\tconsole.log("Event fired! (" + event.type + ")");\r\n\t\t * }\r\n\t\t * // add listeners\r\n\t\t * scene.on("change update", callback);\r\n\t\t * // remove listeners\r\n\t\t * scene.off("change update", callback);\r\n\t\t *\r\n\t\t * @param {string} names - The name or names of the event that should be removed.\r\n\t\t * @param {function} [callback] - A specific callback function that should be removed. If none is passed all callbacks to the event listener will be removed.\r\n\t\t * @returns {Scene} Parent object for chaining.\r\n\t\t */\r\n\t\tthis.off = function (names, callback) {\r\n\t\t\tif (!names) {\r\n\t\t\t\tlog(1, "ERROR: Invalid event name supplied.");\r\n\t\t\t\treturn Scene;\r\n\t\t\t}\r\n\t\t\tnames = names.trim().split(\' \');\r\n\t\t\tnames.forEach(function (fullname, key) {\r\n\t\t\t\tvar\r\n\t\t\t\t\tnameparts = fullname.split(\'.\'),\r\n\t\t\t\t\teventname = nameparts[0],\r\n\t\t\t\t\tnamespace = nameparts[1] || \'\',\r\n\t\t\t\t\tremoveList = eventname === \'*\' ? Object.keys(_listeners) : [eventname];\r\n\t\t\t\tremoveList.forEach(function (remove) {\r\n\t\t\t\t\tvar\r\n\t\t\t\t\t\tlist = _listeners[remove] || [],\r\n\t\t\t\t\t\ti = list.length;\r\n\t\t\t\t\twhile (i--) {\r\n\t\t\t\t\t\tvar listener = list[i];\r\n\t\t\t\t\t\tif (listener && (namespace === listener.namespace || namespace === \'*\') && (!callback || callback == listener.callback)) {\r\n\t\t\t\t\t\t\tlist.splice(i, 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!list.length) {\r\n\t\t\t\t\t\tdelete _listeners[remove];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\treturn Scene;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Trigger an event.\r\n\t\t * @method ScrollMagic.Scene#trigger\r\n\t\t *\r\n\t\t * @example\r\n\t\t * this.trigger("change");\r\n\t\t *\r\n\t\t * @param {string} name - The name of the event that should be triggered.\r\n\t\t * @param {object} [vars] - An object containing info that should be passed to the callback.\r\n\t\t * @returns {Scene} Parent object for chaining.\r\n\t\t */\r\n\t\tthis.trigger = function (name, vars) {\r\n\t\t\tif (name) {\r\n\t\t\t\tvar\r\n\t\t\t\t\tnameparts = name.trim().split(\'.\'),\r\n\t\t\t\t\teventname = nameparts[0],\r\n\t\t\t\t\tnamespace = nameparts[1],\r\n\t\t\t\t\tlisteners = _listeners[eventname];\r\n\t\t\t\tlog(3, \'event fired:\', eventname, vars ? "->" : \'\', vars || \'\');\r\n\t\t\t\tif (listeners) {\r\n\t\t\t\t\tlisteners.forEach(function (listener, key) {\r\n\t\t\t\t\t\tif (!namespace || namespace === listener.namespace) {\r\n\t\t\t\t\t\t\tlistener.callback.call(Scene, new ScrollMagic.Event(eventname, listener.namespace, Scene, vars));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tlog(1, "ERROR: Invalid event name supplied.");\r\n\t\t\t}\r\n\t\t\treturn Scene;\r\n\t\t};\r\n\r\n\t\t// set event listeners\r\n\t\tScene\r\n\t\t\t.on("change.internal", function (e) {\r\n\t\t\t\tif (e.what !== "loglevel" && e.what !== "tweenChanges") { // no need for a scene update scene with these options...\r\n\t\t\t\t\tif (e.what === "triggerElement") {\r\n\t\t\t\t\t\tupdateTriggerElementPosition();\r\n\t\t\t\t\t} else if (e.what === "reverse") { // the only property left that may have an impact on the current scene state. Everything else is handled by the shift event.\r\n\t\t\t\t\t\tScene.update();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.on("shift.internal", function (e) {\r\n\t\t\t\tupdateScrollOffset();\r\n\t\t\t\tScene.update(); // update scene to reflect new position\r\n\t\t\t});\r\n\r\n\t\t/**\r\n\t\t * Send a debug message to the console.\r\n\t\t * @private\r\n\t\t * but provided publicly with _log for plugins\r\n\t\t *\r\n\t\t * @param {number} loglevel - The loglevel required to initiate output for the message.\r\n\t\t * @param {...mixed} output - One or more variables that should be passed to the console.\r\n\t\t */\r\n\t\tvar log = this._log = function (loglevel, output) {\r\n\t\t\tif (_options.loglevel >= loglevel) {\r\n\t\t\t\tArray.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ") ->");\r\n\t\t\t\t_util.log.apply(window, arguments);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Add the scene to a controller. \r\n\t\t * This is the equivalent to `Controller.addScene(scene)`.\r\n\t\t * @method ScrollMagic.Scene#addTo\r\n\t\t *\r\n\t\t * @example\r\n\t\t * // add a scene to a ScrollMagic Controller\r\n\t\t * scene.addTo(controller);\r\n\t\t *\r\n\t\t * @param {ScrollMagic.Controller} controller - The controller to which the scene should be added.\r\n\t\t * @returns {Scene} Parent object for chaining.\r\n\t\t */\r\n\t\tthis.addTo = function (controller) {\r\n\t\t\tif (!(controller instanceof ScrollMagic.Controller)) {\r\n\t\t\t\tlog(1, "ERROR: supplied argument of \'addTo()\' is not a valid ScrollMagic Controller");\r\n\t\t\t} else if (_controller != controller) {\r\n\t\t\t\t// new controller\r\n\t\t\t\tif (_controller) { // was associated to a different controller before, so remove it...\r\n\t\t\t\t\t_controller.removeScene(Scene);\r\n\t\t\t\t}\r\n\t\t\t\t_controller = controller;\r\n\t\t\t\tvalidateOption();\r\n\t\t\t\tupdateDuration(true);\r\n\t\t\t\tupdateTriggerElementPosition(true);\r\n\t\t\t\tupdateScrollOffset();\r\n\t\t\t\t_controller.info("container").addEventListener(\'resize\', onContainerResize);\r\n\t\t\t\tcontroller.addScene(Scene);\r\n\t\t\t\tScene.trigger("add", {\r\n\t\t\t\t\tcontroller: _controller\r\n\t\t\t\t});\r\n\t\t\t\tlog(3, "added " + NAMESPACE + " to controller");\r\n\t\t\t\tScene.update();\r\n\t\t\t}\r\n\t\t\treturn Scene;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * **Get** or **Set** the current enabled state of the scene. \r\n\t\t * This can be used to disable this scene without removing or destroying it.\r\n\t\t * @method ScrollMagic.Scene#enabled\r\n\t\t *\r\n\t\t * @example\r\n\t\t * // get the current value\r\n\t\t * var enabled = scene.enabled();\r\n\t\t *\r\n\t\t * // disable the scene\r\n\t\t * scene.enabled(false);\r\n\t\t *\r\n\t\t * @param {boolean} [newState] - The new enabled state of the scene `true` or `false`.\r\n\t\t * @returns {(boolean|Scene)} Current enabled state or parent object for chaining.\r\n\t\t */\r\n\t\tthis.enabled = function (newState) {\r\n\t\t\tif (!arguments.length) { // get\r\n\t\t\t\treturn _enabled;\r\n\t\t\t} else if (_enabled != newState) { // set\r\n\t\t\t\t_enabled = !!newState;\r\n\t\t\t\tScene.update(true);\r\n\t\t\t}\r\n\t\t\treturn Scene;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Remove the scene from the controller. \r\n\t\t * This is the equivalent to `Controller.removeScene(scene)`.\r\n\t\t * The scene will not be updated anymore until you readd it to a controller.\r\n\t\t * To remove the pin or the tween you need to call removeTween() or removePin() respectively.\r\n\t\t * @method ScrollMagic.Scene#remove\r\n\t\t * @example\r\n\t\t * // remove the scene from its controller\r\n\t\t * scene.remove();\r\n\t\t *\r\n\t\t * @returns {Scene} Parent object for chaining.\r\n\t\t */\r\n\t\tthis.remove = function () {\r\n\t\t\tif (_controller) {\r\n\t\t\t\t_controller.info("container").removeEventListener(\'resize\', onContainerResize);\r\n\t\t\t\tvar tmpParent = _controller;\r\n\t\t\t\t_controller = undefined;\r\n\t\t\t\ttmpParent.removeScene(Scene);\r\n\t\t\t\tScene.trigger("remove");\r\n\t\t\t\tlog(3, "removed " + NAMESPACE + " from controller");\r\n\t\t\t}\r\n\t\t\treturn Scene;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Destroy the scene and everything.\r\n\t\t * @method ScrollMagic.Scene#destroy\r\n\t\t * @example\r\n\t\t * // destroy the scene without resetting the pin and tween to their initial positions\r\n\t\t * scene = scene.destroy();\r\n\t\t *\r\n\t\t * // destroy the scene and reset the pin and tween\r\n\t\t * scene = scene.destroy(true);\r\n\t\t *\r\n\t\t * @param {boolean} [reset=false] - If `true` the pin and tween (if existent) will be reset.\r\n\t\t * @returns {null} Null to unset handler variables.\r\n\t\t */\r\n\t\tthis.destroy = function (reset) {\r\n\t\t\tScene.trigger("destroy", {\r\n\t\t\t\treset: reset\r\n\t\t\t});\r\n\t\t\tScene.remove();\r\n\t\t\tScene.off("*.*");\r\n\t\t\tlog(3, "destroyed " + NAMESPACE + " (reset: " + (reset ? "true" : "false") + ")");\r\n\t\t\treturn null;\r\n\t\t};\r\n\r\n\r\n\t\t/**\r\n\t\t * Updates the Scene to reflect the current state. \r\n\t\t * This is the equivalent to `Controller.updateScene(scene, immediately)`. \r\n\t\t * The update method calculates the scene\'s start and end position (based on the trigger element, trigger hook, duration and offset) and checks it against the current scroll position of the container. \r\n\t\t * It then updates the current scene state accordingly (or does nothing, if the state is already correct) â Pins will be set to their correct position and tweens will be updated to their correct progress.\r\n\t\t * This means an update doesn\'t necessarily result in a progress change. The `progress` event will be fired if the progress has indeed changed between this update and the last. \r\n\t\t * _**NOTE:** This method gets called constantly whenever ScrollMagic detects a change. The only application for you is if you change something outside of the realm of ScrollMagic, like moving the trigger or changing tween parameters._\r\n\t\t * @method ScrollMagic.Scene#update\r\n\t\t * @example\r\n\t\t * // update the scene on next tick\r\n\t\t * scene.update();\r\n\t\t *\r\n\t\t * // update the scene immediately\r\n\t\t * scene.update(true);\r\n\t\t *\r\n\t\t * @fires Scene.update\r\n\t\t *\r\n\t\t * @param {boolean} [immediately=false] - If `true` the update will be instant, if `false` it will wait until next update cycle (better performance).\r\n\t\t * @returns {Scene} Parent object for chaining.\r\n\t\t */\r\n\t\tthis.update = function (immediately) {\r\n\t\t\tif (_controller) {\r\n\t\t\t\tif (immediately) {\r\n\t\t\t\t\tif (_controller.enabled() && _enabled) {\r\n\t\t\t\t\t\tvar\r\n\t\t\t\t\t\t\tscrollPos = _controller.info("scrollPos"),\r\n\t\t\t\t\t\t\tnewProgress;\r\n\r\n\t\t\t\t\t\tif (_options.duration > 0) {\r\n\t\t\t\t\t\t\tnewProgress = (scrollPos - _scrollOffset.start) / (_scrollOffset.end - _scrollOffset.start);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tnewProgress = scrollPos >= _scrollOffset.start ? 1 : 0;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tScene.trigger("update", {\r\n\t\t\t\t\t\t\tstartPos: _scrollOffset.start,\r\n\t\t\t\t\t\t\tendPos: _scrollOffset.end,\r\n\t\t\t\t\t\t\tscrollPos: scrollPos\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tScene.progress(newProgress);\r\n\t\t\t\t\t} else if (_pin && _state === SCENE_STATE_DURING) {\r\n\t\t\t\t\t\tupdatePinState(true); // unpin in position\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t_controller.updateScene(Scene, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn Scene;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Updates dynamic scene variables like the trigger element position or the duration.\r\n\t\t * This method is automatically called in regular intervals from the controller. See {@link ScrollMagic.Controller} option `refreshInterval`.\r\n\t\t * \r\n\t\t * You can call it to minimize lag, for example when you intentionally change the position of the triggerElement.\r\n\t\t * If you don\'t it will simply be updated in the next refresh interval of the container, which is usually sufficient.\r\n\t\t *\r\n\t\t * @method ScrollMagic.Scene#refresh\r\n\t\t * @since 1.1.0\r\n\t\t * @example\r\n\t\t * scene = new ScrollMagic.Scene({triggerElement: "#trigger"});\r\n\t\t * \r\n\t\t * // change the position of the trigger\r\n\t\t * $("#trigger").css("top", 500);\r\n\t\t * // immediately let the scene know of this change\r\n\t\t * scene.refresh();\r\n\t\t *\r\n\t\t * @fires {@link Scene.shift}, if the trigger element position or the duration changed\r\n\t\t * @fires {@link Scene.change}, if the duration changed\r\n\t\t *\r\n\t\t * @returns {Scene} Parent object for chaining.\r\n\t\t */\r\n\t\tthis.refresh = function () {\r\n\t\t\tupdateDuration();\r\n\t\t\tupdateTriggerElementPosition();\r\n\t\t\t// update trigger element position\r\n\t\t\treturn Scene;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * **Get** or **Set** the scene\'s progress. \r\n\t\t * Usually it shouldn\'t be necessary to use this as a setter, as it is set automatically by scene.update(). \r\n\t\t * The order in which the events are fired depends on the duration of the scene:\r\n\t\t * 1. Scenes with `duration == 0`: \r\n\t\t * Scenes that have no duration by definition have no ending. Thus the `end` event will never be fired. \r\n\t\t * When the trigger position of the scene is passed the events are always fired in this order: \r\n\t\t * `enter`, `start`, `progress` when scrolling forward \r\n\t\t * and \r\n\t\t * `progress`, `start`, `leave` when scrolling in reverse\r\n\t\t * 2. Scenes with `duration > 0`: \r\n\t\t * Scenes with a set duration have a defined start and end point. \r\n\t\t * When scrolling past the start position of the scene it will fire these events in this order: \r\n\t\t * `enter`, `start`, `progress` \r\n\t\t * When continuing to scroll and passing the end point it will fire these events: \r\n\t\t * `progress`, `end`, `leave` \r\n\t\t * When reversing through the end point these events are fired: \r\n\t\t * `enter`, `end`, `progress` \r\n\t\t * And when continuing to scroll past the start position in reverse it will fire: \r\n\t\t * `progress`, `start`, `leave` \r\n\t\t * In between start and end the `progress` event will be called constantly, whenever the progress changes.\r\n\t\t * \r\n\t\t * In short: \r\n\t\t * `enter` events will always trigger **before** the progress update and `leave` envents will trigger **after** the progress update. \r\n\t\t * `start` and `end` will always trigger at their respective position.\r\n\t\t * \r\n\t\t * Please review the event descriptions for details on the events and the event object that is passed to the callback.\r\n\t\t * \r\n\t\t * @method ScrollMagic.Scene#progress\r\n\t\t * @example\r\n\t\t * // get the current scene progress\r\n\t\t * var progress = scene.progress();\r\n\t\t *\r\n\t\t * // set new scene progress\r\n\t\t * scene.progress(0.3);\r\n\t\t *\r\n\t\t * @fires {@link Scene.enter}, when used as setter\r\n\t\t * @fires {@link Scene.start}, when used as setter\r\n\t\t * @fires {@link Scene.progress}, when used as setter\r\n\t\t * @fires {@link Scene.end}, when used as setter\r\n\t\t * @fires {@link Scene.leave}, when used as setter\r\n\t\t *\r\n\t\t * @param {number} [progress] - The new progress value of the scene `[0-1]`.\r\n\t\t * @returns {number} `get` - Current scene progress.\r\n\t\t * @returns {Scene} `set` - Parent object for chaining.\r\n\t\t */\r\n\t\tthis.progress = function (progress) {\r\n\t\t\tif (!arguments.length) { // get\r\n\t\t\t\treturn _progress;\r\n\t\t\t} else { // set\r\n\t\t\t\tvar\r\n\t\t\t\t\tdoUpdate = false,\r\n\t\t\t\t\toldState = _state,\r\n\t\t\t\t\tscrollDirection = _controller ? _controller.info("scrollDirection") : \'PAUSED\',\r\n\t\t\t\t\treverseOrForward = _options.reverse || progress >= _progress;\r\n\t\t\t\tif (_options.duration === 0) {\r\n\t\t\t\t\t// zero duration scenes\r\n\t\t\t\t\tdoUpdate = _progress != progress;\r\n\t\t\t\t\t_progress = progress < 1 && reverseOrForward ? 0 : 1;\r\n\t\t\t\t\t_state = _progress === 0 ? SCENE_STATE_BEFORE : SCENE_STATE_DURING;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// scenes with start and end\r\n\t\t\t\t\tif (progress < 0 && _state !== SCENE_STATE_BEFORE && reverseOrForward) {\r\n\t\t\t\t\t\t// go back to initial state\r\n\t\t\t\t\t\t_progress = 0;\r\n\t\t\t\t\t\t_state = SCENE_STATE_BEFORE;\r\n\t\t\t\t\t\tdoUpdate = true;\r\n\t\t\t\t\t} else if (progress >= 0 && progress < 1 && reverseOrForward) {\r\n\t\t\t\t\t\t_progress = progress;\r\n\t\t\t\t\t\t_state = SCENE_STATE_DURING;\r\n\t\t\t\t\t\tdoUpdate = true;\r\n\t\t\t\t\t} else if (progress >= 1 && _state !== SCENE_STATE_AFTER) {\r\n\t\t\t\t\t\t_progress = 1;\r\n\t\t\t\t\t\t_state = SCENE_STATE_AFTER;\r\n\t\t\t\t\t\tdoUpdate = true;\r\n\t\t\t\t\t} else if (_state === SCENE_STATE_DURING && !reverseOrForward) {\r\n\t\t\t\t\t\tupdatePinState(); // in case we scrolled backwards mid-scene and reverse is disabled => update the pin position, so it doesn\'t move back as well.\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (doUpdate) {\r\n\t\t\t\t\t// fire events\r\n\t\t\t\t\tvar\r\n\t\t\t\t\t\teventVars = {\r\n\t\t\t\t\t\t\tprogress: _progress,\r\n\t\t\t\t\t\t\tstate: _state,\r\n\t\t\t\t\t\t\tscrollDirection: scrollDirection\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tstateChanged = _state != oldState;\r\n\r\n\t\t\t\t\tvar trigger = function (eventName) { // tmp helper to simplify code\r\n\t\t\t\t\t\tScene.trigger(eventName, eventVars);\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tif (stateChanged) { // enter events\r\n\t\t\t\t\t\tif (oldState !== SCENE_STATE_DURING) {\r\n\t\t\t\t\t\t\ttrigger("enter");\r\n\t\t\t\t\t\t\ttrigger(oldState === SCENE_STATE_BEFORE ? "start" : "end");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttrigger("progress");\r\n\t\t\t\t\tif (stateChanged) { // leave events\r\n\t\t\t\t\t\tif (_state !== SCENE_STATE_DURING) {\r\n\t\t\t\t\t\t\ttrigger(_state === SCENE_STATE_BEFORE ? "start" : "end");\r\n\t\t\t\t\t\t\ttrigger("leave");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn Scene;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\r\n\t\t/**\r\n\t\t * Update the start and end scrollOffset of the container.\r\n\t\t * The positions reflect what the controller\'s scroll position will be at the start and end respectively.\r\n\t\t * Is called, when:\r\n\t\t * - Scene event "change" is called with: offset, triggerHook, duration \r\n\t\t * - scroll container event "resize" is called\r\n\t\t * - the position of the triggerElement changes\r\n\t\t * - the controller changes -> addTo()\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar updateScrollOffset = function () {\r\n\t\t\t_scrollOffset = {\r\n\t\t\t\tstart: _triggerPos + _options.offset\r\n\t\t\t};\r\n\t\t\tif (_controller && _options.triggerElement) {\r\n\t\t\t\t// take away triggerHook portion to get relative to top\r\n\t\t\t\t_scrollOffset.start -= _controller.info("size") * _options.triggerHook;\r\n\t\t\t}\r\n\t\t\t_scrollOffset.end = _scrollOffset.start + _options.duration;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Updates the duration if set to a dynamic function.\r\n\t\t * This method is called when the scene is added to a controller and in regular intervals from the controller through scene.refresh().\r\n\t\t * \r\n\t\t * @fires {@link Scene.change}, if the duration changed\r\n\t\t * @fires {@link Scene.shift}, if the duration changed\r\n\t\t *\r\n\t\t * @param {boolean} [suppressEvents=false] - If true the shift event will be suppressed.\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar updateDuration = function (suppressEvents) {\r\n\t\t\t// update duration\r\n\t\t\tif (_durationUpdateMethod) {\r\n\t\t\t\tvar varname = "duration";\r\n\t\t\t\tif (changeOption(varname, _durationUpdateMethod.call(Scene)) && !suppressEvents) { // set\r\n\t\t\t\t\tScene.trigger("change", {\r\n\t\t\t\t\t\twhat: varname,\r\n\t\t\t\t\t\tnewval: _options[varname]\r\n\t\t\t\t\t});\r\n\t\t\t\t\tScene.trigger("shift", {\r\n\t\t\t\t\t\treason: varname\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Updates the position of the triggerElement, if present.\r\n\t\t * This method is called ...\r\n\t\t * - ... when the triggerElement is changed\r\n\t\t * - ... when the scene is added to a (new) controller\r\n\t\t * - ... in regular intervals from the controller through scene.refresh().\r\n\t\t * \r\n\t\t * @fires {@link Scene.shift}, if the position changed\r\n\t\t *\r\n\t\t * @param {boolean} [suppressEvents=false] - If true the shift event will be suppressed.\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar updateTriggerElementPosition = function (suppressEvents) {\r\n\t\t\tvar\r\n\t\t\t\telementPos = 0,\r\n\t\t\t\ttelem = _options.triggerElement;\r\n\t\t\tif (_controller && (telem || _triggerPos > 0)) { // either an element exists or was removed and the triggerPos is still > 0\r\n\t\t\t\tif (telem) { // there currently a triggerElement set\r\n\t\t\t\t\tif (telem.parentNode) { // check if element is still attached to DOM\r\n\t\t\t\t\t\tvar\r\n\t\t\t\t\t\t\tcontrollerInfo = _controller.info(),\r\n\t\t\t\t\t\t\tcontainerOffset = _util.get.offset(controllerInfo.container), // container position is needed because element offset is returned in relation to document, not in relation to container.\r\n\t\t\t\t\t\t\tparam = controllerInfo.vertical ? "top" : "left"; // which param is of interest ?\r\n\r\n\t\t\t\t\t\t// if parent is spacer, use spacer position instead so correct start position is returned for pinned elements.\r\n\t\t\t\t\t\twhile (telem.parentNode.hasAttribute(PIN_SPACER_ATTRIBUTE)) {\r\n\t\t\t\t\t\t\ttelem = telem.parentNode;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tvar elementOffset = _util.get.offset(telem);\r\n\r\n\t\t\t\t\t\tif (!controllerInfo.isDocument) { // container is not the document root, so substract scroll Position to get correct trigger element position relative to scrollcontent\r\n\t\t\t\t\t\t\tcontainerOffset[param] -= _controller.scrollPos();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\telementPos = elementOffset[param] - containerOffset[param];\r\n\r\n\t\t\t\t\t} else { // there was an element, but it was removed from DOM\r\n\t\t\t\t\t\tlog(2, "WARNING: triggerElement was removed from DOM and will be reset to", undefined);\r\n\t\t\t\t\t\tScene.triggerElement(undefined); // unset, so a change event is triggered\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar changed = elementPos != _triggerPos;\r\n\t\t\t\t_triggerPos = elementPos;\r\n\t\t\t\tif (changed && !suppressEvents) {\r\n\t\t\t\t\tScene.trigger("shift", {\r\n\t\t\t\t\t\treason: "triggerElementPosition"\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Trigger a shift event, when the container is resized and the triggerHook is > 1.\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar onContainerResize = function (e) {\r\n\t\t\tif (_options.triggerHook > 0) {\r\n\t\t\t\tScene.trigger("shift", {\r\n\t\t\t\t\treason: "containerResize"\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\r\n\t\tvar _validate = _util.extend(SCENE_OPTIONS.validate, {\r\n\t\t\t// validation for duration handled internally for reference to private var _durationMethod\r\n\t\t\tduration: function (val) {\r\n\t\t\t\tif (_util.type.String(val) && val.match(/^(\\.|\\d)*\\d+%$/)) {\r\n\t\t\t\t\t// percentage value\r\n\t\t\t\t\tvar perc = parseFloat(val) / 100;\r\n\t\t\t\t\tval = function () {\r\n\t\t\t\t\t\treturn _controller ? _controller.info("size") * perc : 0;\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t\tif (_util.type.Function(val)) {\r\n\t\t\t\t\t// function\r\n\t\t\t\t\t_durationUpdateMethod = val;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tval = parseFloat(_durationUpdateMethod.call(Scene));\r\n\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\tval = -1; // will cause error below\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// val has to be float\r\n\t\t\t\tval = parseFloat(val);\r\n\t\t\t\tif (!_util.type.Number(val) || val < 0) {\r\n\t\t\t\t\tif (_durationUpdateMethod) {\r\n\t\t\t\t\t\t_durationUpdateMethod = undefined;\r\n\t\t\t\t\t\tthrow ["Invalid return value of supplied function for option \\"duration\\":", val];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthrow ["Invalid value for option \\"duration\\":", val];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn val;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t/**\r\n\t\t * Checks the validity of a specific or all options and reset to default if neccessary.\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar validateOption = function (check) {\r\n\t\t\tcheck = arguments.length ? [check] : Object.keys(_validate);\r\n\t\t\tcheck.forEach(function (optionName, key) {\r\n\t\t\t\tvar value;\r\n\t\t\t\tif (_validate[optionName]) { // there is a validation method for this option\r\n\t\t\t\t\ttry { // validate value\r\n\t\t\t\t\t\tvalue = _validate[optionName](_options[optionName]);\r\n\t\t\t\t\t} catch (e) { // validation failed -> reset to default\r\n\t\t\t\t\t\tvalue = DEFAULT_OPTIONS[optionName];\r\n\t\t\t\t\t\tvar logMSG = _util.type.String(e) ? [e] : e;\r\n\t\t\t\t\t\tif (_util.type.Array(logMSG)) {\r\n\t\t\t\t\t\t\tlogMSG[0] = "ERROR: " + logMSG[0];\r\n\t\t\t\t\t\t\tlogMSG.unshift(1); // loglevel 1 for error msg\r\n\t\t\t\t\t\t\tlog.apply(this, logMSG);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tlog(1, "ERROR: Problem executing validation callback for option \'" + optionName + "\':", e.message);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} finally {\r\n\t\t\t\t\t\t_options[optionName] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Helper used by the setter/getters for scene options\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar changeOption = function (varname, newval) {\r\n\t\t\tvar\r\n\t\t\t\tchanged = false,\r\n\t\t\t\toldval = _options[varname];\r\n\t\t\tif (_options[varname] != newval) {\r\n\t\t\t\t_options[varname] = newval;\r\n\t\t\t\tvalidateOption(varname); // resets to default if necessary\r\n\t\t\t\tchanged = oldval != _options[varname];\r\n\t\t\t}\r\n\t\t\treturn changed;\r\n\t\t};\r\n\r\n\t\t// generate getters/setters for all options\r\n\t\tvar addSceneOption = function (optionName) {\r\n\t\t\tif (!Scene[optionName]) {\r\n\t\t\t\tScene[optionName] = function (newVal) {\r\n\t\t\t\t\tif (!arguments.length) { // get\r\n\t\t\t\t\t\treturn _options[optionName];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (optionName === "duration") { // new duration is set, so any previously set function must be unset\r\n\t\t\t\t\t\t\t_durationUpdateMethod = undefined;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (changeOption(optionName, newVal)) { // set\r\n\t\t\t\t\t\t\tScene.trigger("change", {\r\n\t\t\t\t\t\t\t\twhat: optionName,\r\n\t\t\t\t\t\t\t\tnewval: _options[optionName]\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tif (SCENE_OPTIONS.shifts.indexOf(optionName) > -1) {\r\n\t\t\t\t\t\t\t\tScene.trigger("shift", {\r\n\t\t\t\t\t\t\t\t\treason: optionName\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn Scene;\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * **Get** or **Set** the duration option value.\r\n\t\t *\r\n\t\t * As a **setter** it accepts three types of parameters:\r\n\t\t * 1. `number`: Sets the duration of the scene to exactly this amount of pixels. \r\n\t\t * This means the scene will last for exactly this amount of pixels scrolled. Sub-Pixels are also valid.\r\n\t\t * A value of `0` means that the scene is \'open end\' and no end will be triggered. Pins will never unpin and animations will play independently of scroll progress.\r\n\t\t * 2. `string`: Always updates the duration relative to parent scroll container. \r\n\t\t * For example `"100%"` will keep the duration always exactly at the inner height of the scroll container.\r\n\t\t * When scrolling vertically the width is used for reference respectively.\r\n\t\t * 3. `function`: The supplied function will be called to return the scene duration.\r\n\t\t * This is useful in setups where the duration depends on other elements who might change size. By supplying a function you can return a value instead of updating potentially multiple scene durations. \r\n\t\t * The scene can be referenced inside the callback using `this`.\r\n\t\t * _**WARNING:** This is an easy way to kill performance, as the callback will be executed every time `Scene.refresh()` is called, which happens a lot. The interval is defined by the controller (see ScrollMagic.Controller option `refreshInterval`). \r\n\t\t * It\'s recomended to avoid calculations within the function and use cached variables as return values. \r\n\t\t * This counts double if you use the same function for multiple scenes._\r\n\t\t *\r\n\t\t * @method ScrollMagic.Scene#duration\r\n\t\t * @example\r\n\t\t * // get the current duration value\r\n\t\t * var duration = scene.duration();\r\n\t\t *\r\n\t\t * // set a new duration\r\n\t\t * scene.duration(300);\r\n\t\t *\r\n\t\t * // set duration responsively to container size\r\n\t\t * scene.duration("100%");\r\n\t\t *\r\n\t\t * // use a function to randomize the duration for some reason.\r\n\t\t * var durationValueCache;\r\n\t\t * function durationCallback () {\r\n\t\t * return durationValueCache;\r\n\t\t * }\r\n\t\t * function updateDuration () {\r\n\t\t * durationValueCache = Math.random() * 100;\r\n\t\t * }\r\n\t\t * updateDuration(); // set to initial value\r\n\t\t * scene.duration(durationCallback); // set duration callback\r\n\t\t *\r\n\t\t * @fires {@link Scene.change}, when used as setter\r\n\t\t * @fires {@link Scene.shift}, when used as setter\r\n\t\t * @param {(number|string|function)} [newDuration] - The new duration setting for the scene.\r\n\t\t * @returns {number} `get` - Current scene duration.\r\n\t\t * @returns {Scene} `set` - Parent object for chaining.\r\n\t\t */\r\n\r\n\t\t/**\r\n\t\t * **Get** or **Set** the offset option value.\r\n\t\t * @method ScrollMagic.Scene#offset\r\n\t\t * @example\r\n\t\t * // get the current offset\r\n\t\t * var offset = scene.offset();\r\n\t\t *\r\n\t\t * // set a new offset\r\n\t\t * scene.offset(100);\r\n\t\t *\r\n\t\t * @fires {@link Scene.change}, when used as setter\r\n\t\t * @fires {@link Scene.shift}, when used as setter\r\n\t\t * @param {number} [newOffset] - The new offset of the scene.\r\n\t\t * @returns {number} `get` - Current scene offset.\r\n\t\t * @returns {Scene} `set` - Parent object for chaining.\r\n\t\t */\r\n\r\n\t\t/**\r\n\t\t * **Get** or **Set** the triggerElement option value.\r\n\t\t * Does **not** fire `Scene.shift`, because changing the trigger Element doesn\'t necessarily mean the start position changes. This will be determined in `Scene.refresh()`, which is automatically triggered.\r\n\t\t * @method ScrollMagic.Scene#triggerElement\r\n\t\t * @example\r\n\t\t * // get the current triggerElement\r\n\t\t * var triggerElement = scene.triggerElement();\r\n\t\t *\r\n\t\t * // set a new triggerElement using a selector\r\n\t\t * scene.triggerElement("#trigger");\r\n\t\t * // set a new triggerElement using a DOM object\r\n\t\t * scene.triggerElement(document.getElementById("trigger"));\r\n\t\t *\r\n\t\t * @fires {@link Scene.change}, when used as setter\r\n\t\t * @param {(string|object)} [newTriggerElement] - The new trigger element for the scene.\r\n\t\t * @returns {(string|object)} `get` - Current triggerElement.\r\n\t\t * @returns {Scene} `set` - Parent object for chaining.\r\n\t\t */\r\n\r\n\t\t/**\r\n\t\t * **Get** or **Set** the triggerHook option value.\r\n\t\t * @method ScrollMagic.Scene#triggerHook\r\n\t\t * @example\r\n\t\t * // get the current triggerHook value\r\n\t\t * var triggerHook = scene.triggerHook();\r\n\t\t *\r\n\t\t * // set a new triggerHook using a string\r\n\t\t * scene.triggerHook("onLeave");\r\n\t\t * // set a new triggerHook using a number\r\n\t\t * scene.triggerHook(0.7);\r\n\t\t *\r\n\t\t * @fires {@link Scene.change}, when used as setter\r\n\t\t * @fires {@link Scene.shift}, when used as setter\r\n\t\t * @param {(number|string)} [newTriggerHook] - The new triggerHook of the scene. See {@link Scene} parameter description for value options.\r\n\t\t * @returns {number} `get` - Current triggerHook (ALWAYS numerical).\r\n\t\t * @returns {Scene} `set` - Parent object for chaining.\r\n\t\t */\r\n\r\n\t\t/**\r\n\t\t * **Get** or **Set** the reverse option value.\r\n\t\t * @method ScrollMagic.Scene#reverse\r\n\t\t * @example\r\n\t\t * // get the current reverse option\r\n\t\t * var reverse = scene.reverse();\r\n\t\t *\r\n\t\t * // set new reverse option\r\n\t\t * scene.reverse(false);\r\n\t\t *\r\n\t\t * @fires {@link Scene.change}, when used as setter\r\n\t\t * @param {boolean} [newReverse] - The new reverse setting of the scene.\r\n\t\t * @returns {boolean} `get` - Current reverse option value.\r\n\t\t * @returns {Scene} `set` - Parent object for chaining.\r\n\t\t */\r\n\r\n\t\t/**\r\n\t\t * **Get** or **Set** the loglevel option value.\r\n\t\t * @method ScrollMagic.Scene#loglevel\r\n\t\t * @example\r\n\t\t * // get the current loglevel\r\n\t\t * var loglevel = scene.loglevel();\r\n\t\t *\r\n\t\t * // set new loglevel\r\n\t\t * scene.loglevel(3);\r\n\t\t *\r\n\t\t * @fires {@link Scene.change}, when used as setter\r\n\t\t * @param {number} [newLoglevel] - The new loglevel setting of the scene. `[0-3]`\r\n\t\t * @returns {number} `get` - Current loglevel.\r\n\t\t * @returns {Scene} `set` - Parent object for chaining.\r\n\t\t */\r\n\r\n\t\t/**\r\n\t\t * **Get** the associated controller.\r\n\t\t * @method ScrollMagic.Scene#controller\r\n\t\t * @example\r\n\t\t * // get the controller of a scene\r\n\t\t * var controller = scene.controller();\r\n\t\t *\r\n\t\t * @returns {ScrollMagic.Controller} Parent controller or `undefined`\r\n\t\t */\r\n\t\tthis.controller = function () {\r\n\t\t\treturn _controller;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * **Get** the current state.\r\n\t\t * @method ScrollMagic.Scene#state\r\n\t\t * @example\r\n\t\t * // get the current state\r\n\t\t * var state = scene.state();\r\n\t\t *\r\n\t\t * @returns {string} `"BEFORE"`, `"DURING"` or `"AFTER"`\r\n\t\t */\r\n\t\tthis.state = function () {\r\n\t\t\treturn _state;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * **Get** the current scroll offset for the start of the scene. \r\n\t\t * Mind, that the scrollOffset is related to the size of the container, if `triggerHook` is bigger than `0` (or `"onLeave"`). \r\n\t\t * This means, that resizing the container or changing the `triggerHook` will influence the scene\'s start offset.\r\n\t\t * @method ScrollMagic.Scene#scrollOffset\r\n\t\t * @example\r\n\t\t * // get the current scroll offset for the start and end of the scene.\r\n\t\t * var start = scene.scrollOffset();\r\n\t\t * var end = scene.scrollOffset() + scene.duration();\r\n\t\t * console.log("the scene starts at", start, "and ends at", end);\r\n\t\t *\r\n\t\t * @returns {number} The scroll offset (of the container) at which the scene will trigger. Y value for vertical and X value for horizontal scrolls.\r\n\t\t */\r\n\t\tthis.scrollOffset = function () {\r\n\t\t\treturn _scrollOffset.start;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * **Get** the trigger position of the scene (including the value of the `offset` option). \r\n\t\t * @method ScrollMagic.Scene#triggerPosition\r\n\t\t * @example\r\n\t\t * // get the scene\'s trigger position\r\n\t\t * var triggerPosition = scene.triggerPosition();\r\n\t\t *\r\n\t\t * @returns {number} Start position of the scene. Top position value for vertical and left position value for horizontal scrolls.\r\n\t\t */\r\n\t\tthis.triggerPosition = function () {\r\n\t\t\tvar pos = _options.offset; // the offset is the basis\r\n\t\t\tif (_controller) {\r\n\t\t\t\t// get the trigger position\r\n\t\t\t\tif (_options.triggerElement) {\r\n\t\t\t\t\t// Element as trigger\r\n\t\t\t\t\tpos += _triggerPos;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// return the height of the triggerHook to start at the beginning\r\n\t\t\t\t\tpos += _controller.info("size") * Scene.triggerHook();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn pos;\r\n\t\t};\r\n\r\n\r\n\t\tvar\r\n\t\t\t_pin,\r\n\t\t\t_pinOptions;\r\n\r\n\t\tScene\r\n\t\t\t.on("shift.internal", function (e) {\r\n\t\t\t\tvar durationChanged = e.reason === "duration";\r\n\t\t\t\tif ((_state === SCENE_STATE_AFTER && durationChanged) || (_state === SCENE_STATE_DURING && _options.duration === 0)) {\r\n\t\t\t\t\t// if [duration changed after a scene (inside scene progress updates pin position)] or [duration is 0, we are in pin phase and some other value changed].\r\n\t\t\t\t\tupdatePinState();\r\n\t\t\t\t}\r\n\t\t\t\tif (durationChanged) {\r\n\t\t\t\t\tupdatePinDimensions();\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.on("progress.internal", function (e) {\r\n\t\t\t\tupdatePinState();\r\n\t\t\t})\r\n\t\t\t.on("add.internal", function (e) {\r\n\t\t\t\tupdatePinDimensions();\r\n\t\t\t})\r\n\t\t\t.on("destroy.internal", function (e) {\r\n\t\t\t\tScene.removePin(e.reset);\r\n\t\t\t});\r\n\t\t/**\r\n\t\t * Update the pin state.\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar updatePinState = function (forceUnpin) {\r\n\t\t\tif (_pin && _controller) {\r\n\t\t\t\tvar\r\n\t\t\t\t\tcontainerInfo = _controller.info(),\r\n\t\t\t\t\tpinTarget = _pinOptions.spacer.firstChild; // may be pin element or another spacer, if cascading pins\r\n\r\n\t\t\t\tif (!forceUnpin && _state === SCENE_STATE_DURING) { // during scene or if duration is 0 and we are past the trigger\r\n\t\t\t\t\t// pinned state\r\n\t\t\t\t\tif (_util.css(pinTarget, "position") != "fixed") {\r\n\t\t\t\t\t\t// change state before updating pin spacer (position changes due to fixed collapsing might occur.)\r\n\t\t\t\t\t\t_util.css(pinTarget, {\r\n\t\t\t\t\t\t\t"position": "fixed"\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t// update pin spacer\r\n\t\t\t\t\t\tupdatePinDimensions();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar\r\n\t\t\t\t\t\tfixedPos = _util.get.offset(_pinOptions.spacer, true), // get viewport position of spacer\r\n\t\t\t\t\t\tscrollDistance = _options.reverse || _options.duration === 0 ?\r\n\t\t\t\t\t\tcontainerInfo.scrollPos - _scrollOffset.start // quicker\r\n\t\t\t\t\t\t:\r\n\t\t\t\t\t\tMath.round(_progress * _options.duration * 10) / 10; // if no reverse and during pin the position needs to be recalculated using the progress\r\n\r\n\t\t\t\t\t// add scrollDistance\r\n\t\t\t\t\tfixedPos[containerInfo.vertical ? "top" : "left"] += scrollDistance;\r\n\r\n\t\t\t\t\t// set new values\r\n\t\t\t\t\t_util.css(_pinOptions.spacer.firstChild, {\r\n\t\t\t\t\t\ttop: fixedPos.top,\r\n\t\t\t\t\t\tleft: fixedPos.left\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// unpinned state\r\n\t\t\t\t\tvar\r\n\t\t\t\t\t\tnewCSS = {\r\n\t\t\t\t\t\t\tposition: _pinOptions.inFlow ? "relative" : "absolute",\r\n\t\t\t\t\t\t\ttop: 0,\r\n\t\t\t\t\t\t\tleft: 0\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tchange = _util.css(pinTarget, "position") != newCSS.position;\r\n\r\n\t\t\t\t\tif (!_pinOptions.pushFollowers) {\r\n\t\t\t\t\t\tnewCSS[containerInfo.vertical ? "top" : "left"] = _options.duration * _progress;\r\n\t\t\t\t\t} else if (_options.duration > 0) { // only concerns scenes with duration\r\n\t\t\t\t\t\tif (_state === SCENE_STATE_AFTER && parseFloat(_util.css(_pinOptions.spacer, "padding-top")) === 0) {\r\n\t\t\t\t\t\t\tchange = true; // if in after state but havent updated spacer yet (jumped past pin)\r\n\t\t\t\t\t\t} else if (_state === SCENE_STATE_BEFORE && parseFloat(_util.css(_pinOptions.spacer, "padding-bottom")) === 0) { // before\r\n\t\t\t\t\t\t\tchange = true; // jumped past fixed state upward direction\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// set new values\r\n\t\t\t\t\t_util.css(pinTarget, newCSS);\r\n\t\t\t\t\tif (change) {\r\n\t\t\t\t\t\t// update pin spacer if state changed\r\n\t\t\t\t\t\tupdatePinDimensions();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Update the pin spacer and/or element size.\r\n\t\t * The size of the spacer needs to be updated whenever the duration of the scene changes, if it is to push down following elements.\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar updatePinDimensions = function () {\r\n\t\t\tif (_pin && _controller && _pinOptions.inFlow) { // no spacerresize, if original position is absolute\r\n\t\t\t\tvar\r\n\t\t\t\t\tafter = (_state === SCENE_STATE_AFTER),\r\n\t\t\t\t\tbefore = (_state === SCENE_STATE_BEFORE),\r\n\t\t\t\t\tduring = (_state === SCENE_STATE_DURING),\r\n\t\t\t\t\tvertical = _controller.info("vertical"),\r\n\t\t\t\t\tpinTarget = _pinOptions.spacer.firstChild, // usually the pined element but can also be another spacer (cascaded pins)\r\n\t\t\t\t\tmarginCollapse = _util.isMarginCollapseType(_util.css(_pinOptions.spacer, "display")),\r\n\t\t\t\t\tcss = {};\r\n\r\n\t\t\t\t// set new size\r\n\t\t\t\t// if relsize: spacer -> pin | else: pin -> spacer\r\n\t\t\t\tif (_pinOptions.relSize.width || _pinOptions.relSize.autoFullWidth) {\r\n\t\t\t\t\tif (during) {\r\n\t\t\t\t\t\t_util.css(_pin, {\r\n\t\t\t\t\t\t\t"width": _util.get.width(_pinOptions.spacer)\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t_util.css(_pin, {\r\n\t\t\t\t\t\t\t"width": "100%"\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// minwidth is needed for cascaded pins.\r\n\t\t\t\t\tcss["min-width"] = _util.get.width(vertical ? _pin : pinTarget, true, true);\r\n\t\t\t\t\tcss.width = during ? css["min-width"] : "auto";\r\n\t\t\t\t}\r\n\t\t\t\tif (_pinOptions.relSize.height) {\r\n\t\t\t\t\tif (during) {\r\n\t\t\t\t\t\t// the only padding the spacer should ever include is the duration (if pushFollowers = true), so we need to substract that.\r\n\t\t\t\t\t\t_util.css(_pin, {\r\n\t\t\t\t\t\t\t"height": _util.get.height(_pinOptions.spacer) - (_pinOptions.pushFollowers ? _options.duration : 0)\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t_util.css(_pin, {\r\n\t\t\t\t\t\t\t"height": "100%"\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// margin is only included if it\'s a cascaded pin to resolve an IE9 bug\r\n\t\t\t\t\tcss["min-height"] = _util.get.height(vertical ? pinTarget : _pin, true, !marginCollapse); // needed for cascading pins\r\n\t\t\t\t\tcss.height = during ? css["min-height"] : "auto";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// add space for duration if pushFollowers is true\r\n\t\t\t\tif (_pinOptions.pushFollowers) {\r\n\t\t\t\t\tcss["padding" + (vertical ? "Top" : "Left")] = _options.duration * _progress;\r\n\t\t\t\t\tcss["padding" + (vertical ? "Bottom" : "Right")] = _options.duration * (1 - _progress);\r\n\t\t\t\t}\r\n\t\t\t\t_util.css(_pinOptions.spacer, css);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Updates the Pin state (in certain scenarios)\r\n\t\t * If the controller container is not the document and we are mid-pin-phase scrolling or resizing the main document can result to wrong pin positions.\r\n\t\t * So this function is called on resize and scroll of the document.\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar updatePinInContainer = function () {\r\n\t\t\tif (_controller && _pin && _state === SCENE_STATE_DURING && !_controller.info("isDocument")) {\r\n\t\t\t\tupdatePinState();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Updates the Pin spacer size state (in certain scenarios)\r\n\t\t * If container is resized during pin and relatively sized the size of the pin might need to be updated...\r\n\t\t * So this function is called on resize of the container.\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar updateRelativePinSpacer = function () {\r\n\t\t\tif (_controller && _pin && // well, duh\r\n\t\t\t\t_state === SCENE_STATE_DURING && // element in pinned state?\r\n\t\t\t\t( // is width or height relatively sized, but not in relation to body? then we need to recalc.\r\n\t\t\t\t\t((_pinOptions.relSize.width || _pinOptions.relSize.autoFullWidth) && _util.get.width(window) != _util.get.width(_pinOptions.spacer.parentNode)) ||\r\n\t\t\t\t\t(_pinOptions.relSize.height && _util.get.height(window) != _util.get.height(_pinOptions.spacer.parentNode))\r\n\t\t\t\t)\r\n\t\t\t) {\r\n\t\t\t\tupdatePinDimensions();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Is called, when the mousewhel is used while over a pinned element inside a div container.\r\n\t\t * If the scene is in fixed state scroll events would be counted towards the body. This forwards the event to the scroll container.\r\n\t\t * @private\r\n\t\t */\r\n\t\tvar onMousewheelOverPin = function (e) {\r\n\t\t\tif (_controller && _pin && _state === SCENE_STATE_DURING && !_controller.info("isDocument")) { // in pin state\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\t_controller._setScrollPos(_controller.info("scrollPos") - ((e.wheelDelta || e[_controller.info("vertical") ? "wheelDeltaY" : "wheelDeltaX"]) / 3 || -e.detail * 30));\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Pin an element for the duration of the scene.\r\n\t\t * If the scene duration is 0 the element will only be unpinned, if the user scrolls back past the start position. \r\n\t\t * Make sure only one pin is applied to an element at the same time.\r\n\t\t * An element can be pinned multiple times, but only successively.\r\n\t\t * _**NOTE:** The option `pushFollowers` has no effect, when the scene duration is 0._\r\n\t\t * @method ScrollMagic.Scene#setPin\r\n\t\t * @example\r\n\t\t * // pin element and push all following elements down by the amount of the pin duration.\r\n\t\t * scene.setPin("#pin");\r\n\t\t *\r\n\t\t * // pin element and keeping all following elements in their place. The pinned element will move past them.\r\n\t\t * scene.setPin("#pin", {pushFollowers: false});\r\n\t\t *\r\n\t\t * @param {(string|object)} element - A Selector targeting an element or a DOM object that is supposed to be pinned.\r\n\t\t * @param {object} [settings] - settings for the pin\r\n\t\t * @param {boolean} [settings.pushFollowers=true] - If `true` following elements will be "pushed" down for the duration of the pin, if `false` the pinned element will just scroll past them. \r\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t Ignored, when duration is `0`.\r\n\t\t * @param {string} [settings.spacerClass="scrollmagic-pin-spacer"] - Classname of the pin spacer element, which is used to replace the element.\r\n\t\t *\r\n\t\t * @returns {Scene} Parent object for chaining.\r\n\t\t */\r\n\t\tthis.setPin = function (element, settings) {\r\n\t\t\tvar\r\n\t\t\t\tdefaultSettings = {\r\n\t\t\t\t\tpushFollowers: true,\r\n\t\t\t\t\tspacerClass: "scrollmagic-pin-spacer"\r\n\t\t\t\t};\r\n\t\t\tvar pushFollowersActivelySet = settings && settings.hasOwnProperty(\'pushFollowers\');\r\n\t\t\tsettings = _util.extend({}, defaultSettings, settings);\r\n\r\n\t\t\t// validate Element\r\n\t\t\telement = _util.get.elements(element)[0];\r\n\t\t\tif (!element) {\r\n\t\t\t\tlog(1, "ERROR calling method \'setPin()\': Invalid pin element supplied.");\r\n\t\t\t\treturn Scene; // cancel\r\n\t\t\t} else if (_util.css(element, "position") === "fixed") {\r\n\t\t\t\tlog(1, "ERROR calling method \'setPin()\': Pin does not work with elements that are positioned \'fixed\'.");\r\n\t\t\t\treturn Scene; // cancel\r\n\t\t\t}\r\n\r\n\t\t\tif (_pin) { // preexisting pin?\r\n\t\t\t\tif (_pin === element) {\r\n\t\t\t\t\t// same pin we already have -> do nothing\r\n\t\t\t\t\treturn Scene; // cancel\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// kill old pin\r\n\t\t\t\t\tScene.removePin();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\t_pin = element;\r\n\r\n\t\t\tvar\r\n\t\t\t\tparentDisplay = _pin.parentNode.style.display,\r\n\t\t\t\tboundsParams = ["top", "left", "bottom", "right", "margin", "marginLeft", "marginRight", "marginTop", "marginBottom"];\r\n\r\n\t\t\t_pin.parentNode.style.display = \'none\'; // hack start to force css to return stylesheet values instead of calculated px values.\r\n\t\t\tvar\r\n\t\t\t\tinFlow = _util.css(_pin, "position") != "absolute",\r\n\t\t\t\tpinCSS = _util.css(_pin, boundsParams.concat(["display"])),\r\n\t\t\t\tsizeCSS = _util.css(_pin, ["width", "height"]);\r\n\t\t\t_pin.parentNode.style.display = parentDisplay; // hack end.\r\n\r\n\t\t\tif (!inFlow && settings.pushFollowers) {\r\n\t\t\t\tlog(2, "WARNING: If the pinned element is positioned absolutely pushFollowers will be disabled.");\r\n\t\t\t\tsettings.pushFollowers = false;\r\n\t\t\t}\r\n\t\t\twindow.setTimeout(function () { // wait until all finished, because with responsive duration it will only be set after scene is added to controller\r\n\t\t\t\tif (_pin && _options.duration === 0 && pushFollowersActivelySet && settings.pushFollowers) {\r\n\t\t\t\t\tlog(2, "WARNING: pushFollowers =", true, "has no effect, when scene duration is 0.");\r\n\t\t\t\t}\r\n\t\t\t}, 0);\r\n\r\n\t\t\t// create spacer and insert\r\n\t\t\tvar\r\n\t\t\t\tspacer = _pin.parentNode.insertBefore(document.createElement(\'div\'), _pin),\r\n\t\t\t\tspacerCSS = _util.extend(pinCSS, {\r\n\t\t\t\t\tposition: inFlow ? "relative" : "absolute",\r\n\t\t\t\t\tboxSizing: "content-box",\r\n\t\t\t\t\tmozBoxSizing: "content-box",\r\n\t\t\t\t\twebkitBoxSizing: "content-box"\r\n\t\t\t\t});\r\n\r\n\t\t\tif (!inFlow) { // copy size if positioned absolutely, to work for bottom/right positioned elements.\r\n\t\t\t\t_util.extend(spacerCSS, _util.css(_pin, ["width", "height"]));\r\n\t\t\t}\r\n\r\n\t\t\t_util.css(spacer, spacerCSS);\r\n\t\t\tspacer.setAttribute(PIN_SPACER_ATTRIBUTE, "");\r\n\t\t\t_util.addClass(spacer, settings.spacerClass);\r\n\r\n\t\t\t// set the pin Options\r\n\t\t\t_pinOptions = {\r\n\t\t\t\tspacer: spacer,\r\n\t\t\t\trelSize: { // save if size is defined using % values. if so, handle spacer resize differently...\r\n\t\t\t\t\twidth: sizeCSS.width.slice(-1) === "%",\r\n\t\t\t\t\theight: sizeCSS.height.slice(-1) === "%",\r\n\t\t\t\t\tautoFullWidth: sizeCSS.width === "auto" && inFlow && _util.isMarginCollapseType(pinCSS.display)\r\n\t\t\t\t},\r\n\t\t\t\tpushFollowers: settings.pushFollowers,\r\n\t\t\t\tinFlow: inFlow, // stores if the element takes up space in the document flow\r\n\t\t\t};\r\n\r\n\t\t\tif (!_pin.___origStyle) {\r\n\t\t\t\t_pin.___origStyle = {};\r\n\t\t\t\tvar\r\n\t\t\t\t\tpinInlineCSS = _pin.style,\r\n\t\t\t\t\tcopyStyles = boundsParams.concat(["width", "height", "position", "boxSizing", "mozBoxSizing", "webkitBoxSizing"]);\r\n\t\t\t\tcopyStyles.forEach(function (val) {\r\n\t\t\t\t\t_pin.___origStyle[val] = pinInlineCSS[val] || "";\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// if relative size, transfer it to spacer and make pin calculate it...\r\n\t\t\tif (_pinOptions.relSize.width) {\r\n\t\t\t\t_util.css(spacer, {\r\n\t\t\t\t\twidth: sizeCSS.width\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (_pinOptions.relSize.height) {\r\n\t\t\t\t_util.css(spacer, {\r\n\t\t\t\t\theight: sizeCSS.height\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// now place the pin element inside the spacer\t\r\n\t\t\tspacer.appendChild(_pin);\r\n\t\t\t// and set new css\r\n\t\t\t_util.css(_pin, {\r\n\t\t\t\tposition: inFlow ? "relative" : "absolute",\r\n\t\t\t\tmargin: "auto",\r\n\t\t\t\ttop: "auto",\r\n\t\t\t\tleft: "auto",\r\n\t\t\t\tbottom: "auto",\r\n\t\t\t\tright: "auto"\r\n\t\t\t});\r\n\r\n\t\t\tif (_pinOptions.relSize.width || _pinOptions.relSize.autoFullWidth) {\r\n\t\t\t\t_util.css(_pin, {\r\n\t\t\t\t\tboxSizing: "border-box",\r\n\t\t\t\t\tmozBoxSizing: "border-box",\r\n\t\t\t\t\twebkitBoxSizing: "border-box"\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// add listener to document to update pin position in case controller is not the document.\r\n\t\t\twindow.addEventListener(\'scroll\', updatePinInContainer);\r\n\t\t\twindow.addEventListener(\'resize\', updatePinInContainer);\r\n\t\t\twindow.addEventListener(\'resize\', updateRelativePinSpacer);\r\n\t\t\t// add mousewheel listener to catch scrolls over fixed elements\r\n\t\t\t_pin.addEventListener("mousewheel", onMousewheelOverPin);\r\n\t\t\t_pin.addEventListener("DOMMouseScroll", onMousewheelOverPin);\r\n\r\n\t\t\tlog(3, "added pin");\r\n\r\n\t\t\t// finally update the pin to init\r\n\t\t\tupdatePinState();\r\n\r\n\t\t\treturn Scene;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Remove the pin from the scene.\r\n\t\t * @method ScrollMagic.Scene#removePin\r\n\t\t * @example\r\n\t\t * // remove the pin from the scene without resetting it (the spacer is not removed)\r\n\t\t * scene.removePin();\r\n\t\t *\r\n\t\t * // remove the pin from the scene and reset the pin element to its initial position (spacer is removed)\r\n\t\t * scene.removePin(true);\r\n\t\t *\r\n\t\t * @param {boolean} [reset=false] - If `false` the spacer will not be removed and the element\'s position will not be reset.\r\n\t\t * @returns {Scene} Parent object for chaining.\r\n\t\t */\r\n\t\tthis.removePin = function (reset) {\r\n\t\t\tif (_pin) {\r\n\t\t\t\tif (_state === SCENE_STATE_DURING) {\r\n\t\t\t\t\tupdatePinState(true); // force unpin at position\r\n\t\t\t\t}\r\n\t\t\t\tif (reset || !_controller) { // if there\'s no controller no progress was made anyway...\r\n\t\t\t\t\tvar pinTarget = _pinOptions.spacer.firstChild; // usually the pin element, but may be another spacer (cascaded pins)...\r\n\t\t\t\t\tif (pinTarget.hasAttribute(PIN_SPACER_ATTRIBUTE)) { // copy margins to child spacer\r\n\t\t\t\t\t\tvar\r\n\t\t\t\t\t\t\tstyle = _pinOptions.spacer.style,\r\n\t\t\t\t\t\t\tvalues = ["margin", "marginLeft", "marginRight", "marginTop", "marginBottom"],\r\n\t\t\t\t\t\t\tmargins = {};\r\n\t\t\t\t\t\tvalues.forEach(function (val) {\r\n\t\t\t\t\t\t\tmargins[val] = style[val] || "";\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t_util.css(pinTarget, margins);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t_pinOptions.spacer.parentNode.insertBefore(pinTarget, _pinOptions.spacer);\r\n\t\t\t\t\t_pinOptions.spacer.parentNode.removeChild(_pinOptions.spacer);\r\n\t\t\t\t\tif (!_pin.parentNode.hasAttribute(PIN_SPACER_ATTRIBUTE)) { // if it\'s the last pin for this element -> restore inline styles\r\n\t\t\t\t\t\t// TODO: only correctly set for first pin (when cascading) - how to fix?\r\n\t\t\t\t\t\t_util.css(_pin, _pin.___origStyle);\r\n\t\t\t\t\t\tdelete _pin.___origStyle;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\twindow.removeEventListener(\'scroll\', updatePinInContainer);\r\n\t\t\t\twindow.removeEventListener(\'resize\', updatePinInContainer);\r\n\t\t\t\twindow.removeEventListener(\'resize\', updateRelativePinSpacer);\r\n\t\t\t\t_pin.removeEventListener("mousewheel", onMousewheelOverPin);\r\n\t\t\t\t_pin.removeEventListener("DOMMouseScroll", onMousewheelOverPin);\r\n\t\t\t\t_pin = undefined;\r\n\t\t\t\tlog(3, "removed pin (reset: " + (reset ? "true" : "false") + ")");\r\n\t\t\t}\r\n\t\t\treturn Scene;\r\n\t\t};\r\n\r\n\r\n\t\tvar\r\n\t\t\t_cssClasses,\r\n\t\t\t_cssClassElems = [];\r\n\r\n\t\tScene\r\n\t\t\t.on("destroy.internal", function (e) {\r\n\t\t\t\tScene.removeClassToggle(e.reset);\r\n\t\t\t});\r\n\t\t/**\r\n\t\t * Define a css class modification while the scene is active. \r\n\t\t * When the scene triggers the classes will be added to the supplied element and removed, when the scene is over.\r\n\t\t * If the scene duration is 0 the classes will only be removed if the user scrolls back past the start position.\r\n\t\t * @method ScrollMagic.Scene#setClassToggle\r\n\t\t * @example\r\n\t\t * // add the class \'myclass\' to the element with the id \'my-elem\' for the duration of the scene\r\n\t\t * scene.setClassToggle("#my-elem", "myclass");\r\n\t\t *\r\n\t\t * // add multiple classes to multiple elements defined by the selector \'.classChange\'\r\n\t\t * scene.setClassToggle(".classChange", "class1 class2 class3");\r\n\t\t *\r\n\t\t * @param {(string|object)} element - A Selector targeting one or more elements or a DOM object that is supposed to be modified.\r\n\t\t * @param {string} classes - One or more Classnames (separated by space) that should be added to the element during the scene.\r\n\t\t *\r\n\t\t * @returns {Scene} Parent object for chaining.\r\n\t\t */\r\n\t\tthis.setClassToggle = function (element, classes) {\r\n\t\t\tvar elems = _util.get.elements(element);\r\n\t\t\tif (elems.length === 0 || !_util.type.String(classes)) {\r\n\t\t\t\tlog(1, "ERROR calling method \'setClassToggle()\': Invalid " + (elems.length === 0 ? "element" : "classes") + " supplied.");\r\n\t\t\t\treturn Scene;\r\n\t\t\t}\r\n\t\t\tif (_cssClassElems.length > 0) {\r\n\t\t\t\t// remove old ones\r\n\t\t\t\tScene.removeClassToggle();\r\n\t\t\t}\r\n\t\t\t_cssClasses = classes;\r\n\t\t\t_cssClassElems = elems;\r\n\t\t\tScene.on("enter.internal_class leave.internal_class", function (e) {\r\n\t\t\t\tvar toggle = e.type === "enter" ? _util.addClass : _util.removeClass;\r\n\t\t\t\t_cssClassElems.forEach(function (elem, key) {\r\n\t\t\t\t\ttoggle(elem, _cssClasses);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\treturn Scene;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Remove the class binding from the scene.\r\n\t\t * @method ScrollMagic.Scene#removeClassToggle\r\n\t\t * @example\r\n\t\t * // remove class binding from the scene without reset\r\n\t\t * scene.removeClassToggle();\r\n\t\t *\r\n\t\t * // remove class binding and remove the changes it caused\r\n\t\t * scene.removeClassToggle(true);\r\n\t\t *\r\n\t\t * @param {boolean} [reset=false] - If `false` and the classes are currently active, they will remain on the element. If `true` they will be removed.\r\n\t\t * @returns {Scene} Parent object for chaining.\r\n\t\t */\r\n\t\tthis.removeClassToggle = function (reset) {\r\n\t\t\tif (reset) {\r\n\t\t\t\t_cssClassElems.forEach(function (elem, key) {\r\n\t\t\t\t\t_util.removeClass(elem, _cssClasses);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tScene.off("start.internal_class end.internal_class");\r\n\t\t\t_cssClasses = undefined;\r\n\t\t\t_cssClassElems = [];\r\n\t\t\treturn Scene;\r\n\t\t};\r\n\r\n\t\t// INIT\r\n\t\tconstruct();\r\n\t\treturn Scene;\r\n\t};\r\n\r\n\t// store pagewide scene options\r\n\tvar SCENE_OPTIONS = {\r\n\t\tdefaults: {\r\n\t\t\tduration: 0,\r\n\t\t\toffset: 0,\r\n\t\t\ttriggerElement: undefined,\r\n\t\t\ttriggerHook: 0.5,\r\n\t\t\treverse: true,\r\n\t\t\tloglevel: 2\r\n\t\t},\r\n\t\tvalidate: {\r\n\t\t\toffset: function (val) {\r\n\t\t\t\tval = parseFloat(val);\r\n\t\t\t\tif (!_util.type.Number(val)) {\r\n\t\t\t\t\tthrow ["Invalid value for option \\"offset\\":", val];\r\n\t\t\t\t}\r\n\t\t\t\treturn val;\r\n\t\t\t},\r\n\t\t\ttriggerElement: function (val) {\r\n\t\t\t\tval = val || undefined;\r\n\t\t\t\tif (val) {\r\n\t\t\t\t\tvar elem = _util.get.elements(val)[0];\r\n\t\t\t\t\tif (elem && elem.parentNode) {\r\n\t\t\t\t\t\tval = elem;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthrow ["Element defined in option \\"triggerElement\\" was not found:", val];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn val;\r\n\t\t\t},\r\n\t\t\ttriggerHook: function (val) {\r\n\t\t\t\tvar translate = {\r\n\t\t\t\t\t"onCenter": 0.5,\r\n\t\t\t\t\t"onEnter": 1,\r\n\t\t\t\t\t"onLeave": 0\r\n\t\t\t\t};\r\n\t\t\t\tif (_util.type.Number(val)) {\r\n\t\t\t\t\tval = Math.max(0, Math.min(parseFloat(val), 1)); // make sure its betweeen 0 and 1\r\n\t\t\t\t} else if (val in translate) {\r\n\t\t\t\t\tval = translate[val];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow ["Invalid value for option \\"triggerHook\\": ", val];\r\n\t\t\t\t}\r\n\t\t\t\treturn val;\r\n\t\t\t},\r\n\t\t\treverse: function (val) {\r\n\t\t\t\treturn !!val; // force boolean\r\n\t\t\t},\r\n\t\t\tloglevel: function (val) {\r\n\t\t\t\tval = parseInt(val);\r\n\t\t\t\tif (!_util.type.Number(val) || val < 0 || val > 3) {\r\n\t\t\t\t\tthrow ["Invalid value for option \\"loglevel\\":", val];\r\n\t\t\t\t}\r\n\t\t\t\treturn val;\r\n\t\t\t}\r\n\t\t}, // holder for validation methods. duration validation is handled in \'getters-setters.js\'\r\n\t\tshifts: ["duration", "offset", "triggerHook"], // list of options that trigger a `shift` event\r\n\t};\r\n\t/*\r\n\t * method used to add an option to ScrollMagic Scenes.\r\n\t * TODO: DOC (private for dev)\r\n\t */\r\n\tScrollMagic.Scene.addOption = function (name, defaultValue, validationCallback, shifts) {\r\n\t\tif (!(name in SCENE_OPTIONS.defaults)) {\r\n\t\t\tSCENE_OPTIONS.defaults[name] = defaultValue;\r\n\t\t\tSCENE_OPTIONS.validate[name] = validationCallback;\r\n\t\t\tif (shifts) {\r\n\t\t\t\tSCENE_OPTIONS.shifts.push(name);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tScrollMagic._util.log(1, "[static] ScrollMagic.Scene -> Cannot add Scene option \'" + name + "\', because it already exists.");\r\n\t\t}\r\n\t};\r\n\t// instance extension function for plugins\r\n\t// TODO: DOC (private for dev)\r\n\tScrollMagic.Scene.extend = function (extension) {\r\n\t\tvar oldClass = this;\r\n\t\tScrollMagic.Scene = function () {\r\n\t\t\toldClass.apply(this, arguments);\r\n\t\t\tthis.$super = _util.extend({}, this); // copy parent state\r\n\t\t\treturn extension.apply(this, arguments) || this;\r\n\t\t};\r\n\t\t_util.extend(ScrollMagic.Scene, oldClass); // copy properties\r\n\t\tScrollMagic.Scene.prototype = oldClass.prototype; // copy prototype\r\n\t\tScrollMagic.Scene.prototype.constructor = ScrollMagic.Scene; // restore constructor\r\n\t};\r\n\r\n\r\n\r\n\t/**\r\n\t * TODO: DOCS (private for dev)\r\n\t * @class\r\n\t * @private\r\n\t */\r\n\r\n\tScrollMagic.Event = function (type, namespace, target, vars) {\r\n\t\tvars = vars || {};\r\n\t\tfor (var key in vars) {\r\n\t\t\tthis[key] = vars[key];\r\n\t\t}\r\n\t\tthis.type = type;\r\n\t\tthis.target = this.currentTarget = target;\r\n\t\tthis.namespace = namespace || \'\';\r\n\t\tthis.timeStamp = this.timestamp = Date.now();\r\n\t\treturn this;\r\n\t};\r\n\r\n\t/*\r\n\t * TODO: DOCS (private for dev)\r\n\t */\r\n\r\n\tvar _util = ScrollMagic._util = (function (window) {\r\n\t\tvar U = {},\r\n\t\t\ti;\r\n\r\n\t\t/**\r\n\t\t * ------------------------------\r\n\t\t * internal helpers\r\n\t\t * ------------------------------\r\n\t\t */\r\n\r\n\t\t// parse float and fall back to 0.\r\n\t\tvar floatval = function (number) {\r\n\t\t\treturn parseFloat(number) || 0;\r\n\t\t};\r\n\t\t// get current style IE safe (otherwise IE would return calculated values for \'auto\')\r\n\t\tvar _getComputedStyle = function (elem) {\r\n\t\t\treturn elem.currentStyle ? elem.currentStyle : window.getComputedStyle(elem);\r\n\t\t};\r\n\r\n\t\t// get element dimension (width or height)\r\n\t\tvar _dimension = function (which, elem, outer, includeMargin) {\r\n\t\t\telem = (elem === document) ? window : elem;\r\n\t\t\tif (elem === window) {\r\n\t\t\t\tincludeMargin = false;\r\n\t\t\t} else if (!_type.DomElement(elem)) {\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\twhich = which.charAt(0).toUpperCase() + which.substr(1).toLowerCase();\r\n\t\t\tvar dimension = (outer ? elem[\'offset\' + which] || elem[\'outer\' + which] : elem[\'client\' + which] || elem[\'inner\' + which]) || 0;\r\n\t\t\tif (outer && includeMargin) {\r\n\t\t\t\tvar style = _getComputedStyle(elem);\r\n\t\t\t\tdimension += which === \'Height\' ? floatval(style.marginTop) + floatval(style.marginBottom) : floatval(style.marginLeft) + floatval(style.marginRight);\r\n\t\t\t}\r\n\t\t\treturn dimension;\r\n\t\t};\r\n\t\t// converts \'margin-top\' into \'marginTop\'\r\n\t\tvar _camelCase = function (str) {\r\n\t\t\treturn str.replace(/^[^a-z]+([a-z])/g, \'$1\').replace(/-([a-z])/g, function (g) {\r\n\t\t\t\treturn g[1].toUpperCase();\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * ------------------------------\r\n\t\t * external helpers\r\n\t\t * ------------------------------\r\n\t\t */\r\n\r\n\t\t// extend obj â same as jQuery.extend({}, objA, objB)\r\n\t\tU.extend = function (obj) {\r\n\t\t\tobj = obj || {};\r\n\t\t\tfor (i = 1; i < arguments.length; i++) {\r\n\t\t\t\tif (!arguments[i]) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tfor (var key in arguments[i]) {\r\n\t\t\t\t\tif (arguments[i].hasOwnProperty(key)) {\r\n\t\t\t\t\t\tobj[key] = arguments[i][key];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn obj;\r\n\t\t};\r\n\r\n\t\t// check if a css display type results in margin-collapse or not\r\n\t\tU.isMarginCollapseType = function (str) {\r\n\t\t\treturn ["block", "flex", "list-item", "table", "-webkit-box"].indexOf(str) > -1;\r\n\t\t};\r\n\r\n\t\t// implementation of requestAnimationFrame\r\n\t\t// based on https://gist.github.com/paulirish/1579671\r\n\t\tvar\r\n\t\t\tlastTime = 0,\r\n\t\t\tvendors = [\'ms\', \'moz\', \'webkit\', \'o\'];\r\n\t\tvar _requestAnimationFrame = window.requestAnimationFrame;\r\n\t\tvar _cancelAnimationFrame = window.cancelAnimationFrame;\r\n\t\t// try vendor prefixes if the above doesn\'t work\r\n\t\tfor (i = 0; !_requestAnimationFrame && i < vendors.length; ++i) {\r\n\t\t\t_requestAnimationFrame = window[vendors[i] + \'RequestAnimationFrame\'];\r\n\t\t\t_cancelAnimationFrame = window[vendors[i] + \'CancelAnimationFrame\'] || window[vendors[i] + \'CancelRequestAnimationFrame\'];\r\n\t\t}\r\n\r\n\t\t// fallbacks\r\n\t\tif (!_requestAnimationFrame) {\r\n\t\t\t_requestAnimationFrame = function (callback) {\r\n\t\t\t\tvar\r\n\t\t\t\t\tcurrTime = new Date().getTime(),\r\n\t\t\t\t\ttimeToCall = Math.max(0, 16 - (currTime - lastTime)),\r\n\t\t\t\t\tid = window.setTimeout(function () {\r\n\t\t\t\t\t\tcallback(currTime + timeToCall);\r\n\t\t\t\t\t}, timeToCall);\r\n\t\t\t\tlastTime = currTime + timeToCall;\r\n\t\t\t\treturn id;\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (!_cancelAnimationFrame) {\r\n\t\t\t_cancelAnimationFrame = function (id) {\r\n\t\t\t\twindow.clearTimeout(id);\r\n\t\t\t};\r\n\t\t}\r\n\t\tU.rAF = _requestAnimationFrame.bind(window);\r\n\t\tU.cAF = _cancelAnimationFrame.bind(window);\r\n\r\n\t\tvar\r\n\t\t\tloglevels = ["error", "warn", "log"],\r\n\t\t\tconsole = window.console || {};\r\n\r\n\t\tconsole.log = console.log || function () {}; // no console log, well - do nothing then...\r\n\t\t// make sure methods for all levels exist.\r\n\t\tfor (i = 0; i < loglevels.length; i++) {\r\n\t\t\tvar method = loglevels[i];\r\n\t\t\tif (!console[method]) {\r\n\t\t\t\tconsole[method] = console.log; // prefer .log over nothing\r\n\t\t\t}\r\n\t\t}\r\n\t\tU.log = function (loglevel) {\r\n\t\t\tif (loglevel > loglevels.length || loglevel <= 0) loglevel = loglevels.length;\r\n\t\t\tvar now = new Date(),\r\n\t\t\t\ttime = ("0" + now.getHours()).slice(-2) + ":" + ("0" + now.getMinutes()).slice(-2) + ":" + ("0" + now.getSeconds()).slice(-2) + ":" + ("00" + now.getMilliseconds()).slice(-3),\r\n\t\t\t\tmethod = loglevels[loglevel - 1],\r\n\t\t\t\targs = Array.prototype.splice.call(arguments, 1),\r\n\t\t\t\tfunc = Function.prototype.bind.call(console[method], console);\r\n\t\t\targs.unshift(time);\r\n\t\t\tfunc.apply(console, args);\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * ------------------------------\r\n\t\t * type testing\r\n\t\t * ------------------------------\r\n\t\t */\r\n\r\n\t\tvar _type = U.type = function (v) {\r\n\t\t\treturn Object.prototype.toString.call(v).replace(/^\\[object (.+)\\]$/, "$1").toLowerCase();\r\n\t\t};\r\n\t\t_type.String = function (v) {\r\n\t\t\treturn _type(v) === \'string\';\r\n\t\t};\r\n\t\t_type.Function = function (v) {\r\n\t\t\treturn _type(v) === \'function\';\r\n\t\t};\r\n\t\t_type.Array = function (v) {\r\n\t\t\treturn Array.isArray(v);\r\n\t\t};\r\n\t\t_type.Number = function (v) {\r\n\t\t\treturn !_type.Array(v) && (v - parseFloat(v) + 1) >= 0;\r\n\t\t};\r\n\t\t_type.DomElement = function (o) {\r\n\t\t\treturn (\r\n\t\t\t\ttypeof HTMLElement === "object" || typeof HTMLElement === "function" ? o instanceof HTMLElement || o instanceof SVGElement : //DOM2\r\n\t\t\t\to && typeof o === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string"\r\n\t\t\t);\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * ------------------------------\r\n\t\t * DOM Element info\r\n\t\t * ------------------------------\r\n\t\t */\r\n\t\t// always returns a list of matching DOM elements, from a selector, a DOM element or an list of elements or even an array of selectors\r\n\t\tvar _get = U.get = {};\r\n\t\t_get.elements = function (selector) {\r\n\t\t\tvar arr = [];\r\n\t\t\tif (_type.String(selector)) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tselector = document.querySelectorAll(selector);\r\n\t\t\t\t} catch (e) { // invalid selector\r\n\t\t\t\t\treturn arr;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (_type(selector) === \'nodelist\' || _type.Array(selector) || selector instanceof NodeList) {\r\n\t\t\t\tfor (var i = 0, ref = arr.length = selector.length; i < ref; i++) { // list of elements\r\n\t\t\t\t\tvar elem = selector[i];\r\n\t\t\t\t\tarr[i] = _type.DomElement(elem) ? elem : _get.elements(elem); // if not an element, try to resolve recursively\r\n\t\t\t\t}\r\n\t\t\t} else if (_type.DomElement(selector) || selector === document || selector === window) {\r\n\t\t\t\tarr = [selector]; // only the element\r\n\t\t\t}\r\n\t\t\treturn arr;\r\n\t\t};\r\n\t\t// get scroll top value\r\n\t\t_get.scrollTop = function (elem) {\r\n\t\t\treturn (elem && typeof elem.scrollTop === \'number\') ? elem.scrollTop : window.pageYOffset || 0;\r\n\t\t};\r\n\t\t// get scroll left value\r\n\t\t_get.scrollLeft = function (elem) {\r\n\t\t\treturn (elem && typeof elem.scrollLeft === \'number\') ? elem.scrollLeft : window.pageXOffset || 0;\r\n\t\t};\r\n\t\t// get element height\r\n\t\t_get.width = function (elem, outer, includeMargin) {\r\n\t\t\treturn _dimension(\'width\', elem, outer, includeMargin);\r\n\t\t};\r\n\t\t// get element width\r\n\t\t_get.height = function (elem, outer, includeMargin) {\r\n\t\t\treturn _dimension(\'height\', elem, outer, includeMargin);\r\n\t\t};\r\n\r\n\t\t// get element position (optionally relative to viewport)\r\n\t\t_get.offset = function (elem, relativeToViewport) {\r\n\t\t\tvar offset = {\r\n\t\t\t\ttop: 0,\r\n\t\t\t\tleft: 0\r\n\t\t\t};\r\n\t\t\tif (elem && elem.getBoundingClientRect) { // check if available\r\n\t\t\t\tvar rect = elem.getBoundingClientRect();\r\n\t\t\t\toffset.top = rect.top;\r\n\t\t\t\toffset.left = rect.left;\r\n\t\t\t\tif (!relativeToViewport) { // clientRect is by default relative to viewport...\r\n\t\t\t\t\toffset.top += _get.scrollTop();\r\n\t\t\t\t\toffset.left += _get.scrollLeft();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn offset;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * ------------------------------\r\n\t\t * DOM Element manipulation\r\n\t\t * ------------------------------\r\n\t\t */\r\n\r\n\t\tU.addClass = function (elem, classname) {\r\n\t\t\tif (classname) {\r\n\t\t\t\tif (elem.classList)\r\n\t\t\t\t\telem.classList.add(classname);\r\n\t\t\t\telse\r\n\t\t\t\t\telem.className += \' \' + classname;\r\n\t\t\t}\r\n\t\t};\r\n\t\tU.removeClass = function (elem, classname) {\r\n\t\t\tif (classname) {\r\n\t\t\t\tif (elem.classList)\r\n\t\t\t\t\telem.classList.remove(classname);\r\n\t\t\t\telse\r\n\t\t\t\t\telem.className = elem.className.replace(new RegExp(\'(^|\\\\b)\' + classname.split(\' \').join(\'|\') + \'(\\\\b|$)\', \'gi\'), \' \');\r\n\t\t\t}\r\n\t\t};\r\n\t\t// if options is string -> returns css value\r\n\t\t// if options is array -> returns object with css value pairs\r\n\t\t// if options is object -> set new css values\r\n\t\tU.css = function (elem, options) {\r\n\t\t\tif (_type.String(options)) {\r\n\t\t\t\treturn _getComputedStyle(elem)[_camelCase(options)];\r\n\t\t\t} else if (_type.Array(options)) {\r\n\t\t\t\tvar\r\n\t\t\t\t\tobj = {},\r\n\t\t\t\t\tstyle = _getComputedStyle(elem);\r\n\t\t\t\toptions.forEach(function (option, key) {\r\n\t\t\t\t\tobj[option] = style[_camelCase(option)];\r\n\t\t\t\t});\r\n\t\t\t\treturn obj;\r\n\t\t\t} else {\r\n\t\t\t\tfor (var option in options) {\r\n\t\t\t\t\tvar val = options[option];\r\n\t\t\t\t\tif (val == parseFloat(val)) { // assume pixel for seemingly numerical values\r\n\t\t\t\t\t\tval += \'px\';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telem.style[_camelCase(option)] = val;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\treturn U;\r\n\t}(window || {}));\r\n\r\n\r\n\tScrollMagic.Scene.prototype.addIndicators = function () {\r\n\t\tScrollMagic._util.log(1, \'(ScrollMagic.Scene) -> ERROR calling addIndicators() due to missing Plugin \\\'debug.addIndicators\\\'. Please make sure to include plugins/debug.addIndicators.js\');\r\n\t\treturn this;\r\n\t}\r\n\tScrollMagic.Scene.prototype.removeIndicators = function () {\r\n\t\tScrollMagic._util.log(1, \'(ScrollMagic.Scene) -> ERROR calling removeIndicators() due to missing Plugin \\\'debug.addIndicators\\\'. Please make sure to include plugins/debug.addIndicators.js\');\r\n\t\treturn this;\r\n\t}\r\n\tScrollMagic.Scene.prototype.setTween = function () {\r\n\t\tScrollMagic._util.log(1, \'(ScrollMagic.Scene) -> ERROR calling setTween() due to missing Plugin \\\'animation.gsap\\\'. Please make sure to include plugins/animation.gsap.js\');\r\n\t\treturn this;\r\n\t}\r\n\tScrollMagic.Scene.prototype.removeTween = function () {\r\n\t\tScrollMagic._util.log(1, \'(ScrollMagic.Scene) -> ERROR calling removeTween() due to missing Plugin \\\'animation.gsap\\\'. Please make sure to include plugins/animation.gsap.js\');\r\n\t\treturn this;\r\n\t}\r\n\tScrollMagic.Scene.prototype.setVelocity = function () {\r\n\t\tScrollMagic._util.log(1, \'(ScrollMagic.Scene) -> ERROR calling setVelocity() due to missing Plugin \\\'animation.velocity\\\'. Please make sure to include plugins/animation.velocity.js\');\r\n\t\treturn this;\r\n\t}\r\n\tScrollMagic.Scene.prototype.removeVelocity = function () {\r\n\t\tScrollMagic._util.log(1, \'(ScrollMagic.Scene) -> ERROR calling removeVelocity() due to missing Plugin \\\'animation.velocity\\\'. Please make sure to include plugins/animation.velocity.js\');\r\n\t\treturn this;\r\n\t}\r\n\r\n\treturn ScrollMagic;\r\n}));\n\n//# sourceURL=webpack://builder/./node_modules/scrollmagic/scrollmagic/uncompressed/ScrollMagic.js?')},
2"./src/js/components/activity-item.js":()=>{eval('jQuery(document).ready(function($) {\n\t$(\'.post-item__button\').each(function() {\n\t\tconst $button = $(this);\n\t\tconst $previousP = $button.prev(\'p\');\n\t\t\n\t\tif ($previousP.length) {\n\t\t\t$previousP.append($button);\n\t\t}\n\t});\n\n\tfunction toMarkup($this) {\n \tvar text = $this.html();\n \ttext = text.replace(/\\*\\*(.*?)\\*\\*/g, "<b>$1</b>");\n \ttext = text.replace(/__(.*?)__/g, "<u>$1</u>");\n \ttext = text.replace(/~~(.*?)~~/g, "<i>$1</i>");\n \ttext = text.replace(/--(.*?)--/g, "<del>$1</del>");\n \ttext = text.replace(/<<(.*?)>>/g, "<a href=\'$1\'>Link</a>");\n \t$this.html(text);\n\t}\n\n\t$(\'.content-default__editor\').each(function() {\n\t\tconst $this = $(this);\n\t\t$(this).html(toMarkup($this));\n\t})\n});\n\n//# sourceURL=webpack://builder/./src/js/components/activity-item.js?')},
2"./src/js/components/filters.js":()=>{eval("$(function() {\n\t$('.js-filter').on('click', function(event) {\n event.preventDefault(); // Prevents the button's default action\n var $filter = $(this); // Gets the clicked button\n var $filterInput = $('.js-filter-input'); // Gets the hidden input\n \n if ($filter.hasClass('is-active')) {\n $filterInput.val(''); // Clears the input value\n } else {\n var filterValue = $filter.val(); // Gets the value of the clicked button\n $filterInput.val(filterValue); // Sets the hidden input's value\n }\n\n $('.activity-filters__form').submit(); // Submits the form\n });\n})\n\n//# sourceURL=webpack://builder/./src/js/components/filters.js?")},
2"./src/js/components/header.js":()=>{eval("$(function() {\n\tconst divElement = document.querySelector(\"div.content-header\");\n\t\n\t$(\"a[href='#intro']\").click(function(e) {\n\t\te.preventDefault();\n\t\t$(\"html, body\").animate({ scrollTop: divElement.offsetHeight }, \"smooth\");\n\t});\n});\n\n$(document).ready(function() {\n\t$(window).scroll(function() {\n\t\tif ($(this).scrollTop() > 50) {\n\t\t\t$('header').addClass('scrolled');\n\t\t} else {\n\t\t\t$('header').removeClass('scrolled');\n\t\t}\n\t});\n});\n\n//# sourceURL=webpack://builder/./src/js/components/header.js?")},
2"./src/js/components/navigation.js":()=>{eval("$(function() {\n\t$('.js-main-menu-button').on('click', function() {\n\t\tif ($(this).hasClass('is-active')) {\n\t\t\t$('.js-navigation').removeClass('is-active');\n\t\t\t$('body').removeClass('is-active');\n\t\t\t$('.header').removeClass('is-active');\n\t\t\t$('.navigation__head').removeClass('is-active');\n\t\t} else {\n\t\t\t$('.js-navigation').addClass('is-active'); \n\t\t\t$('.js-main-menu-mobile').addClass('is-active');\n\t\t\t$('.header').addClass('is-active');\n\t\t\t$('body').addClass('is-active');\n\t\t\t$('.navigation__head').addClass('is-active');\n\t\t}\n\t});\n\n\t$('.js-navigation').on('click', function(e) {\n\t\tif ($(e.target).is(this) && $(this).hasClass('is-active')) {\n\t\t\t$('.js-navigation').removeClass('is-active');\n\t\t\t$('body').removeClass('is-active');\n\t\t\t$('.header').removeClass('is-active');\n\t\t\t$('.navigation__head').removeClass('is-active');\n\t\t}\n\t});\n\t\n\tif ($(window).width() < 900) {\n\t\t$('.submenu-container').hide();\n\t}\n\t\n\t$('.js-main-menu > .menu-item > a').append('<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"9\" height=\"7\" viewBox=\"0 0 9 7\" fill=\"none\">
2<path d=\"M0.652488 2.10317L3.47779 5.699C3.99828 6.36144 5.00172 6.36144 5.52221 5.699L8.34751 2.10317C9.0177 1.2502 8.41006 0 7.3253 0H1.6747C0.589942 0 -0.0177007 1.2502 0.652488 2.10317Z\" fill=\"#191919\"/></svg>');\n\n\t$('.js-main-menu > .menu-item > a').on('click', function(event) {\n\t\tif ($(window).width() < 900) {\n\n\t\t\tevent.preventDefault();\n\t\t\tvar $submenu = $(this).siblings('.submenu-container');\n\t\t\t$('.submenu-container').not($submenu).slideUp();\n\t\t\t$submenu.slideToggle();\n\t\t}\n\t});\n\n\t$(document).on('keydown', function(e) {\n\t\tif (e.key === 'Escape') {\n\t\t\t$('.js-navigation').removeClass('is-active');\n\t\t\t$('body').removeClass('is-active');\n\t\t\t$('.header').removeClass('is-active');\n\t\t\t$('.navigation__head').removeClass('is-active');\n\t\t}\n\t});\n})\n\n//# sourceURL=webpack://builder/./src/js/components/navigation.js?")},
2"./src/js/components/popup.js":()=>{eval("$(function() {\n\tconst $popup = $('.popup');\n\n\tif ( ! $popup.length ) return;\n\n\tconst $close = $('.popup__close');\n\n\t// Al getoond deze sessie? Dan niet tonen\n\tif ( sessionStorage.getItem('popupSeen') ) {\n\t\treturn;\n\t}\n\n\t// Popup zichtbaar maken\n\t$popup.addClass('is-visible');\n\n\t// Handmatig sluiten via kruisje\n\t$close.on('click', function() {\n\t\t$popup.removeClass('is-visible').addClass('is-hidden');\n\t\tsessionStorage.setItem('popupSeen', '1');\n\t});\n})\n\n//# sourceURL=webpack://builder/./src/js/components/popup.js?")},
2"./src/js/components/team.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var keen_slider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! keen-slider */ \"./node_modules/keen-slider/keen-slider.es.js\");\n\n\n$(document).ready(function() {\n\tconst teamWrapper = document.querySelector(\".team__members\");\n\tlet teamSlider = null;\n\n\tfunction initSlider() {\n\t\tif (window.innerWidth < 600) {\n\t\t\tif (teamSlider === null) {\n\t\t\t\tteamWrapper.classList.add('keen-slider');\n\t\t\t\tconst teamItems = teamWrapper.children;\n\t\t\t\tArray.from(teamItems).forEach(item => {\n\t\t\t\t\tif (!item.classList.contains('team__nav')) {\n\t\t\t\t\t\titem.classList.add('keen-slider__slide');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tteamSlider = new keen_slider__WEBPACK_IMPORTED_MODULE_0__[\"default\"](teamWrapper, {\n\t\t\t\t\tslides: {\n\t\t\t\t\t\torigin: \"center\",\n\t\t\t\t\t\tperView: 1,\n\t\t\t\t\t\tspacing: 24\n\t\t\t\t\t},\n\t\t\t\t\tloop: true,\n\t\t\t\t\tcreated: function(slider) {\n\t\t\t\t\t\tupdateTeamNavButtons(slider);\n\t\t\t\t\t},\n\t\t\t\t\tslideChanged: function(slider) {\n\t\t\t\t\t\tupdateTeamNavButtons(slider);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t$('.js-prev-team').on('click', function() {\n\t\t\t\t\tteamSlider.prev();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t$('.js-next-team').on('click', function() {\n\t\t\t\t\tteamSlider.next();\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tif (teamSlider !== null) {\n\t\t\t\tteamWrapper.classList.remove('keen-slider');\n\t\t\t\tconst teamItems = teamWrapper.children;\n\t\t\t\tArray.from(teamItems).forEach(item => {\n\t\t\t\t\titem.classList.remove('keen-slider__slide');\n\t\t\t\t});\n\t\t\t\tteamSlider.destroy();\n\t\t\t\tteamSlider = null;\n\t\t\t\t$('.js-prev-team, .js-next-team').removeClass('disabled');\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction updateTeamNavButtons(slider) {\n\t\tif (slider.track.details.rel === 0) {\n\t\t\t$('.js-prev-team').addClass('disabled');\n\t\t} else {\n\t\t\t$('.js-prev-team').removeClass('disabled');\n\t\t}\n\t\n\t\tif (slider.track.details.rel === slider.track.details.slides.length - 1) {\n\t\t\t$('.js-next-team').addClass('disabled');\n\t\t} else {\n\t\t\t$('.js-next-team').removeClass('disabled');\n\t\t}\n\t}\n\n\tinitSlider();\n\t\n\twindow.addEventListener('resize', function() {\n\t\tinitSlider();\n\t});\n});\n\n//# sourceURL=webpack://builder/./src/js/components/team.js?")},
2"./src/js/index.js":(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval('// Objects.\n__webpack_require__(/*! ./objects/cms-output.js */ "./src/js/objects/cms-output.js");\n__webpack_require__(/*! ./objects/form.js */ "./src/js/objects/form.js");\n__webpack_require__(/*! ./objects/lazy-load.js */ "./src/js/objects/lazy-load.js");\n__webpack_require__(/*! ./objects/lightboxes.js */ "./src/js/objects/lightboxes.js");\n__webpack_require__(/*! ./objects/scroll.js */ "./src/js/objects/scroll.js");\n__webpack_require__(/*! ./objects/toggle.js */ "./src/js/objects/toggle.js");\n__webpack_require__(/*! ./objects/sliders.js */ "./src/js/objects/sliders.js");\n__webpack_require__(/*! ./objects/animations.js */ "./src/js/objects/animations.js");\n\n// Components.\n__webpack_require__(/*! ./components/navigation.js */ "./src/js/components/navigation.js");\n__webpack_require__(/*! ./components/filters.js */ "./src/js/components/filters.js");\n__webpack_require__(/*! ./components/header.js */ "./src/js/components/header.js");\n__webpack_require__(/*! ./components/team.js */ "./src/js/components/team.js");\n__webpack_require__(/*! ./components/activity-item.js */ "./src/js/components/activity-item.js");\n__webpack_require__(/*! ./components/popup.js */ "./src/js/components/popup.js");\n\n\n//# sourceURL=webpack://builder/./src/js/index.js?')},
2"./src/js/objects/animations.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var scrollmagic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! scrollmagic */ \"./node_modules/scrollmagic/scrollmagic/uncompressed/ScrollMagic.js\");\n/* harmony import */ var scrollmagic__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(scrollmagic__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var animejs_lib_anime_es_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! animejs/lib/anime.es.js */ \"./node_modules/animejs/lib/anime.es.js\");\n\n\n\n$(function() {\n\t// Create a ScrollMagic Controller\n\tconst controller = new (scrollmagic__WEBPACK_IMPORTED_MODULE_0___default().Controller)();\n\n\t// Define the animation function for multiple items\n\tfunction animateOnScroll(targets, animationOptions) {\n\t\tconst targetElements = typeof targets === 'string' ? document.querySelectorAll(targets) : targets;\n\n\t\tnew (scrollmagic__WEBPACK_IMPORTED_MODULE_0___default().Scene)({\n\t\t\ttriggerElement: targetElements[0],\n\t\t\ttriggerHook: 0.8,\n\t\t\treverse: false\n\t\t})\n\t\t.on('enter', () => {\n\n\t\t(0,animejs_lib_anime_es_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({\n\t\t\ttargets: targetElements,\n\t\t\t...animationOptions,\n\t\t});\n\t\t})\n\t\t.addTo(controller);\n\t}\n\n\tfunction singleAnimateOnScroll(targets, animationOptions) {\n\t\tconst targetElements = typeof targets === 'string' ? document.querySelectorAll(targets) : [targets];\n\n\t\ttargetElements.forEach(target => {\n\t\t\tnew (scrollmagic__WEBPACK_IMPORTED_MODULE_0___default().Scene)({\n\t\t\t\ttriggerElement: target,\n\t\t\t\ttriggerHook: 0.8,\n\t\t\t\treverse: false\n\t\t\t})\n\t\t\t.on('enter', () => {\n\t\t\t\t(0,animejs_lib_anime_es_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({\n\t\t\t\t\ttargets: target,\n\t\t\t\t\t...animationOptions\n\t\t\t\t});\n\t\t\t})\n\t\t\t.addTo(controller);\n\t\t});\n\t}\n\n\tfunction syncAnimateOnScroll(target, trigger, animationOptions) {\n\t\tconst animation = (0,animejs_lib_anime_es_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({\n\t\t\ttargets: target,\n\t\t\t...animationOptions,\n\t\t\tautoplay: false,\n\t\t});\n\n\t\tnew (scrollmagic__WEBPACK_IMPORTED_MODULE_0___default().Scene)({\n\t\t\ttriggerElement: target,\n\t\t\ttriggerHook: trigger,\n\t\t\tduration: '30%'\n\t\t})\n\t\t.on('progress', (event) => {\n\t\t\tanimation.seek(animation.duration * event.progress);\n\t\t})\n\t\t.addTo(controller);\n\t}\n\n\t/*\n\t* Header animations\n\t*/\n\tif ($('.header')) {\n\t\tanimateOnScroll('.header', {\n\t\t\ttargets: '.header',\n\t\t\tdeplay: 0,\n\t\t\tduration: 500,\n\t\t\topacity: [0, 1],\n\t\t\teasing: 'easeOutQuad',\n\t\t});\n\t}\n\n\t/*\n\t* Content header animations\n\t*/\n\tif ($('.js-content-header-title-animation')) {\n\t\tanimateOnScroll('.content-header', {\n\t\t\ttargets: '.js-content-header-title-animation',\n\t\t\ttranslateY: [50, 0],\n\t\t\tduration: 400,\n\t\t\tdelay: animejs_lib_anime_es_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].stagger(100), // delay each element by 500ms\n\t\t\topacity: [0, 1],\n\t\t\teasing: 'linear',\n\t\t});\n\t}\n\n\tif ($('.content-header .links .link')) {\n\t\tanimateOnScroll('.content-header', {\n\t\t\ttargets: '.content-header .links .link',\n\t\t\ttranslateY: [25, 0],\n\t\t\ttranslateX: [0, 0],\n\t\t\tduration: 300,\n\t\t\tdelay: animejs_lib_anime_es_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].stagger(150), // delay each element by 500ms\n\t\t\topacity: [0, 1],\n\t\t\teasing: 'linear',\n\t\t});\n\t}\n});\n\n//# sourceURL=webpack://builder/./src/js/objects/animations.js?")},
2"./src/js/objects/cms-output.js":()=>{eval("$(function() {\n\n\t/**\n\t * Wrap images.\n\t */\n\t$('.js-cms-output img').each(function() {\n\t\t$(this).wrap('<div class=\"img-wrap\"></div>');\n\t});\n});\n\n\n//# sourceURL=webpack://builder/./src/js/objects/cms-output.js?")},
2"./src/js/objects/form.js":()=>{eval('$(function() {\n\n\t/**\n\t * Remove error message.\n\t */\n\t$(\'.validation_error .close-button\').on(\'click\', function() {\n\t\t$(this).parent().fadeOut(350).removeClass(\'is-active\');\n\t});\n\n\n\t/**\n\t * Set icons.\n\t */\n\tif ($(\'.ginput_container_select\').length) {\n\t\t$(\'.ginput_container_select\').each(function() {\n\t\t\t$(this).append(\'<svg xmlns="http://www.w3.org/2000/svg" width="13" height="8" viewBox="0 0 13 8" fill="none"><path d="M7.04158 7.04243C6.55974 7.52426 5.77725 7.52426 5.29542 7.04243L0.36148 2.10849C0.00685272 1.75386 -0.0972226 1.22578 0.0955095 0.76322C0.288242 0.300663 0.73538 0 1.23648 0H11.1044C11.6016 0 12.0526 0.300663 12.2453 0.76322C12.4381 1.22578 12.3301 1.75386 11.9794 2.10849L7.04543 7.04243H7.04158Z" fill="black"/></svg>\');\n\t\t});\n\t}\n});\n\n\n//# sourceURL=webpack://builder/./src/js/objects/form.js?')},
2"./src/js/objects/lazy-load.js":()=>{eval("$(function() {\n\n\t/**\n\t * Initiate Lazy Load.\n\t */\n\t$(document).on( \"scroll\", function() {\n\t\tlazyload();\n\t } );\n\tlazyload();\n});\n\nfunction lazyload() {\n\t$('.js-lazy-load').each(function() {\n\t\tif ($(this).isInViewport()) {\n\t\t\t$(this).attr('loaded', true);;\n\t\t}\n\t})\n}\n\n//# sourceURL=webpack://builder/./src/js/objects/lazy-load.js?")},
2"./src/js/objects/lightboxes.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var bigger_picture__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bigger-picture */ \"./node_modules/bigger-picture/dist/bigger-picture.mjs\");\n\n\n$(function() {\n\tlet bp = (0,bigger_picture__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n\t\ttarget: document.body,\n\t\tonOpen: function() {\n\t\t\t$('.gallery__wrapper, .gallery-alignment__wrapper').addClass('lightbox-active');\n\t\t},\n\t\tonClose: function() {\n\t\t\t$('.gallery__wrapper, .gallery-alignment__wrapper').removeClass('lightbox-active');\n\t\t},\n\t\timageText: function(slide) {\n\t\t\tif (slide && slide.el && slide.el.dataset && slide.el.dataset.caption) {\n\t\t\t\treturn slide.el.dataset.caption;\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\t})\n\t\n\t$('.js-lightbox').on('click', function(event) {\n\t\tif ($(event.target).hasClass('gallery__image--caption') || $(event.target).hasClass('gallery-alignment__image--caption')) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconst galleryImages = $(this).parent().find('.js-lightbox');\n\t\tconst galleryItems = [];\n\t\t\n\t\tgalleryImages.each(function(i) {\n\t\t\tconst imgEl = $(this).find('img')[0];\n\t\t\tconst caption = $(this).find('.gallery__image--caption, .gallery-alignment__image--caption').text();\n\t\t\t\n\t\t\timgEl.dataset.caption = caption;\n\t\t\tgalleryItems.push(imgEl);\n\t\t});\n\t\t\n\t\tconst clickedImageIndex = Array.from(galleryImages).indexOf(this);\n\t\t\n\t\ttry {\n\t\t\tbp.open({\n\t\t\t\titems: galleryItems,\n\t\t\t\tintro: 'fade',\n\t\t\t\tposition: clickedImageIndex\n\t\t\t});\n\t\t} catch (error) {\n\t\t}\n\t\t\n\t\tsetTimeout(function() {\n\t\t\t$('.bp-wrap').on('click', function(e) {\n\t\t\t\tif (e.target === this) {\n\t\t\t\t\tbp.close();\n\t\t\t\t}\n\t\t\t});\n\t\t}, 100);\n\t});\n});\n\n//# sourceURL=webpack://builder/./src/js/objects/lightboxes.js?")},
2"./src/js/objects/scroll.js":()=>{eval("$(function() {\n\t/**\n\t * Smooth scroll on anchor click with responsive behavior.\n\t * Different scroll offset and animation duration based on screen width.\n\t */\n\t$(document).on('click', 'a[href^=\"#\"]', function(event) {\n\t\tevent.preventDefault();\n\t\t\n\t\tvar targetHref = $(this).attr('href');\n\t\tvar targetOffset = $(targetHref).offset().top;\n\t\t\n\t\tif (window.innerWidth < 768) {\n\t\t\t$('html, body').animate({\n\t\t\t\tscrollTop: targetOffset - 100\n\t\t\t}, 500);\n\t\t} else {\n\t\t\t$('html, body').animate({\n\t\t\t\tscrollTop: targetOffset\n\t\t\t}, 1000);\n\t\t}\n\t});\n});\n\n\n//# sourceURL=webpack://builder/./src/js/objects/scroll.js?")},
2"./src/js/objects/sliders.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var keen_slider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! keen-slider */ \"./node_modules/keen-slider/keen-slider.es.js\");\n\n\n$(function() {\n\tif ($('.js-post-latest-slider').length) {\n\t\tvar postLatestSlider = new keen_slider__WEBPACK_IMPORTED_MODULE_0__[\"default\"](\".js-post-latest-slider\", {\n\t\t\tmode: \"snap\",\n\t\t\trtl: false,\n\t\t\tslides: {\n\t\t\t\tspacing: 32,\n\t\t\t\tperView: 1,\n\t\t\t},\n\t\t\tbreakpoints: {\n\t\t\t\t\"(min-width: 600px)\": {\n\t\t\t\t\tslides: {\n\t\t\t\t\t\tperView: 2,\n\t\t\t\t\t\tspacing: 32,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\"(min-width: 900px)\": {\n\t\t\t\t\tslides: {\n\t\t\t\t\t\tperView: 3,\n\t\t\t\t\t\tspacing: 32,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t\tcreated: function(slider) {\n\t\t\t\tupdateNavPostLatestButtons(slider);\n\t\t\t},\n\t\t\tslideChanged: function(slider) {\n\t\t\t\tupdateNavPostLatestButtons(slider);\n\t\t\t}\n\t\t});\n\t\t\n\t\t$('.js-prev-post-latest').on('click', function() {\n\t\t\tpostLatestSlider.prev();\n\t\t});\n\t\t\n\t\t$('.js-next-post-latest').on('click', function() {\n\t\t\tpostLatestSlider.next();\n\t\t});\n\t}\n\n\tif ($('.js-teasers-slider').length) {\n\t\tvar teasersSlider = new keen_slider__WEBPACK_IMPORTED_MODULE_0__[\"default\"](\".js-teasers-slider\", {\n\t\t\tmode: \"snap\",\n\t\t\trtl: false,\n\t\t\tslides: {\n\t\t\t\tspacing: 32,\n\t\t\t\tperView: 1,\n\t\t\t},\n\t\t\tbreakpoints: {\n\t\t\t\t\"(min-width: 600px)\": {\n\t\t\t\t\tslides: {\n\t\t\t\t\t\tperView: 2,\n\t\t\t\t\t\tspacing: 32,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\"(min-width: 900px)\": {\n\t\t\t\t\tslides: {\n\t\t\t\t\t\tperView: 3,\n\t\t\t\t\t\tspacing: 32,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t\tcreated: function(slider) {\n\t\t\t\tupdateNavButtons(slider);\n\t\t\t},\n\t\t\tslideChanged: function(slider) {\n\t\t\t\tupdateNavButtons(slider);\n\t\t\t}\n\t\t});\n\t\t\n\t\t$('.js-prev-teasers').on('click', function() {\n\t\t\tteasersSlider.prev();\n\t\t});\n\t\t\n\t\t$('.js-next-teasers').on('click', function() {\n\t\t\tteasersSlider.next();\n\t\t});\n\t}\n\n\t$('.js-lightbox-gallery').each(function(index) {\n\t\tvar $sliderContainer = $(this).closest('.gallery__wrapper, .gallery-alignment__wrapper');\n\t\tvar gallerySlider = new keen_slider__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this, {\n\t\t\tmode: \"snap\",\n\t\t\trtl: false,\n\t\t\tslides: {\n\t\t\t\tspacing: 16,\n\t\t\t\tperView: \"auto\",\n\t\t\t},\n\t\t\tbreakpoints: {\n\t\t\t\t\"(min-width: 0px)\": {\n\t\t\t\t\tslides: {\n\t\t\t\t\t\tperView: 2,\n\t\t\t\t\t\tspacing: 16,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"(min-width: 600px)\": {\n\t\t\t\t\tslides: {\n\t\t\t\t\t\tperView: 3,\n\t\t\t\t\t\tspacing: 16,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\"(min-width: 900px)\": {\n\t\t\t\t\tslides: {\n\t\t\t\t\t\tperView: 3,\n\t\t\t\t\t\tspacing: 32,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t\tcreated: function(slider) {\n\t\t\t\tupdateGalleryNavButtons(slider, $sliderContainer);\n\t\t\t},\n\t\t\tslideChanged: function(slider) {\n\t\t\t\tupdateGalleryNavButtons(slider, $sliderContainer);\n\t\t\t}\n\t\t});\n\n\t\t$sliderContainer.find('.js-prev-gallery').on('click', function() {\n\t\t\tgallerySlider.prev();\n\t\t});\n\t\t\n\t\t$sliderContainer.find('.js-next-gallery').on('click', function() {\n\t\t\tgallerySlider.next();\n\t\t});\n\t});\n\n\tfunction updateNavPostLatestButtons(slider) {\n\t\tif (slider.track.details.rel === 0) {\n\t\t\t$('.js-prev-post-latest').addClass('disabled');\n\t\t} else {\n\t\t\t$('.js-prev-post-latest').removeClass('disabled');\n\t\t}\n\t\n\t\tif (slider.track.details.rel === slider.track.details.slides.length - 1) {\n\t\t\t$('.js-next-post-latest').addClass('disabled');\n\t\t} else {\n\t\t\t$('.js-next-post-latest').removeClass('disabled');\n\t\t}\n\t}\n\n\tfunction updateGalleryNavButtons(slider, $container) {\n\t\tif (slider.track.details.rel === 0) {\n\t\t\t$container.find('.js-prev-gallery').addClass('disabled');\n\t\t} else {\n\t\t\t$container.find('.js-prev-gallery').removeClass('disabled');\n\t\t}\n\t\n\t\tif (slider.track.details.rel === slider.track.details.slides.length - 1) {\n\t\t\t$container.find('.js-next-gallery').addClass('disabled');\n\t\t} else {\n\t\t\t$container.find('.js-next-gallery').removeClass('disabled');\n\t\t}\n\t}\n\n\tfunction updateNavButtons(slider) {\n\t\tif (slider.track.details.rel === 0) {\n\t\t\t$('.js-prev-teasers').addClass('disabled');\n\t\t} else {\n\t\t\t$('.js-prev-teasers').removeClass('disabled');\n\t\t}\n\t\n\t\tif (slider.track.details.rel === slider.track.details.slides.length - 1) {\n\t\t\t$('.js-next-teasers').addClass('disabled');\n\t\t} else {\n\t\t\t$('.js-next-teasers').removeClass('disabled');\n\t\t}\n\t}\n});\n\n//# sourceURL=webpack://builder/./src/js/objects/sliders.js?")},
2"./src/js/objects/toggle.js":()=>{eval("$(function() {\n\n\t/**\n\t * Toggle.\n\t */\n\t$('.js-toggle').each(function() {\n\t\t$(this).on('click', function(event) {\n\n\t\t\t// Check window size.\n\t\t\tvar ignore = false;\n\t\t\tif ($(this).hasClass('js-portrait-down') && $(window).width() > 899) {\n\t\t\t\tvar ignore = true;\n\t\t\t};\n\n\t\t\t// Open & Close current.\n\t\t\tif (ignore == false) {\n\n\t\t\t\t// Prevent.\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\t// Toggle.\n\t\t\t\tif ($(this).hasClass('is-active')) {\n\t\t\t\t\t$(this).removeClass('is-active');\n\t\t\t\t\t$(this).find('.js-toggle-body').stop().slideUp();\n\t\t\t\t\t$(this).find('.js-toggle-icon .plus').addClass('is-active');\t\n\t\t\t\t\t$(this).find('.js-toggle-icon .minus').removeClass('is-active');\n\t\t\t\t} else {\n\n\t\t\t\t\t// Close all open.\n\t\t\t\t\t$(this).parent().find('.js-toggle-body').slideUp();\n\t\t\t\t\t$(this).parent().find('.is-active').removeClass('is-active');\n\n\t\t\t\t\t// Open current.\n\t\t\t\t\t$(this).addClass('is-active');\n\t\t\t\t\t$(this).find('.js-toggle-body').stop().slideDown();\n\t\t\t\t\t$(this).find('.js-toggle-icon .minus').addClass('is-active');\t\n\t\t\t\t\t$(this).find('.js-toggle-icon .plus').removeClass('is-active');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n\n\t/**\n\t * Reset on window resize.\n\t */\n\t$(window).resize(function() {\n\t\t$('.js-toggle-head, .js-toggle-product-head').each(function() {\n\t\t\tif( !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t\t\t$(this).parent().removeClass('is-active');\n\t\t\t\t$(this).parent().find('.js-toggle-body').removeAttr('style');\n\t\t\t}\n\t\t});\n\t});\n});\n\n\n//# sourceURL=webpack://builder/./src/js/objects/toggle.js?")},
vendor: 78,507 bytes, line 2
2"./node_modules/bigger-picture/dist/bigger-picture.mjs":(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "default": () => (/* binding */ biggerPicture)\n/* harmony export */ });\nfunction noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\nfunction run(fn) {\n return fn();\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === \'function\';\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction is_empty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction subscribe(store, ...callbacks) {\n if (store == null) {\n return noop;\n }\n const unsub = store.subscribe(...callbacks);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction action_destroyer(action_result) {\n return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\nlet now = () => globalThis.performance.now()\n ;\nlet raf = cb => requestAnimationFrame(cb) ;\n\nconst tasks = new Set();\nfunction run_tasks(now) {\n tasks.forEach(task => {\n if (!task.c(now)) {\n tasks.delete(task);\n task.f();\n }\n });\n if (tasks.size !== 0)\n raf(run_tasks);\n}\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n */\nfunction loop(callback) {\n let task;\n if (tasks.size === 0)\n raf(run_tasks);\n return {\n promise: new Promise(fulfill => {\n tasks.add(task = { c: callback, f: fulfill });\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction detach(node) {\n node.parentNode.removeChild(node);\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction empty() {\n return text(\'\');\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else if (node.getAttribute(attribute) !== value)\n node.setAttribute(attribute, value);\n}\nfunction set_style(node, key, value, important) {\n if (value === null) {\n node.style.removeProperty(key);\n }\n else {\n node.style.setProperty(key, value);\n }\n}\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? \'add\' : \'remove\'](name);\n}\nfunction custom_event(type, detail, bubbles = false) {\n const e = document.createEvent(\'CustomEvent\');\n e.initCustomEvent(type, bubbles, false, detail);\n return e;\n}\nlet stylesheet;\nlet active = 0;\nlet current_rules = {};\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\n// function hash(str) {\n// let hash = 5381;\n// let i = str.length;\n// while (i--)\n// hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n// return hash >>> 0;\n// }\nfunction create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n const step = 16.666 / duration;\n let keyframes = \'{\\n\';\n for (let p = 0; p <= 1; p += step) {\n const t = a + (b - a) * ease(p);\n keyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n }\n const rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n const name = `_bp_${Math.round(Math.random() * 1e9)}_${uid}`;\n if (!current_rules[name]) {\n if (!stylesheet) {\n const style = element(\'style\');\n document.head.appendChild(style);\n stylesheet = style.sheet;\n }\n current_rules[name] = true;\n stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n }\n const animation = node.style.animation || \'\';\n node.style.animation = `${animation ? `${animation}, ` : ``}${name} ${duration}ms linear ${delay}ms 1 both`;\n active += 1;\n return name;\n}\nfunction delete_rule(node, name) {\n node.style.animation = (node.style.animation || \'\')\n .split(\', \')\n .filter(name\n ? anim => anim.indexOf(name) < 0 // remove specific animation\n : anim => anim.indexOf(\'_bp\') === -1 // remove all Svelte animations\n )\n .join(\', \');\n if (name && !--active)\n clear_rules();\n}\nfunction clear_rules() {\n raf(() => {\n if (active)\n return;\n let i = stylesheet.cssRules.length;\n while (i--)\n stylesheet.deleteRule(i);\n current_rules = {};\n });\n}\n\nlet current_component;\nfunction set_current_component(component) {\n current_component = component;\n}\n\nconst dirty_components = [];\nconst binding_callbacks = [];\nconst render_callbacks = [];\nconst flush_callbacks = [];\nconst resolved_promise = Promise.resolve();\nlet update_scheduled = false;\nfunction schedule_update() {\n if (!update_scheduled) {\n update_scheduled = true;\n resolved_promise.then(flush);\n }\n}\nfunction add_render_callback(fn) {\n render_callbacks.push(fn);\n}\n// flush() calls callbacks in this order:\n// 1. All beforeUpdate callbacks, in order: parents before children\n// 2. All bind:this callbacks, in reverse order: children before parents.\n// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT\n// for afterUpdates called during the initial onMount, which are called in\n// reverse order: children before parents.\n// Since callbacks might update component values, which could trigger another\n// call to flush(), the following steps guard against this:\n// 1. During beforeUpdate, any updated components will be added to the\n// dirty_components array and will cause a reentrant call to flush(). Because\n// the flush index is kept outside the function, the reentrant call will pick\n// up where the earlier call left off and go through all dirty components. The\n// current_component value is saved and restored so that the reentrant call will\n// not interfere with the "parent" flush() call.\n// 2. bind:this callbacks cannot trigger new flush() calls.\n// 3. During afterUpdate, any updated components will NOT have their afterUpdate\n// callback called a second time; the seen_callbacks set, outside the flush()\n// function, guarantees this behavior.\nconst seen_callbacks = new Set();\nlet flushidx = 0; // Do *not* move this inside the flush() function\nfunction flush() {\n const saved_component = current_component;\n do {\n // first, call beforeUpdate functions\n // and update components\n while (flushidx < dirty_components.length) {\n const component = dirty_components[flushidx];\n flushidx++;\n set_current_component(component);\n update(component.$$);\n }\n set_current_component(null);\n dirty_components.length = 0;\n flushidx = 0;\n while (binding_callbacks.length)\n binding_callbacks.pop()();\n // then, once components are updated, call\n // afterUpdate functions. This may cause\n // subsequent updates...\n for (let i = 0; i < render_callbacks.length; i += 1) {\n const callback = render_callbacks[i];\n if (!seen_callbacks.has(callback)) {\n // ...so guard against infinite loops\n seen_callbacks.add(callback);\n callback();\n }\n }\n render_callbacks.length = 0;\n } while (dirty_components.length);\n while (flush_callbacks.length) {\n flush_callbacks.pop()();\n }\n update_scheduled = false;\n seen_callbacks.clear();\n set_current_component(saved_component);\n}\nfunction update($$) {\n if ($$.fragment !== null) {\n $$.update();\n run_all($$.before_update);\n const dirty = $$.dirty;\n $$.dirty = [-1];\n $$.fragment && $$.fragment.p($$.ctx, dirty);\n $$.after_update.forEach(add_render_callback);\n }\n}\n\nlet promise;\nfunction wait() {\n if (!promise) {\n promise = Promise.resolve();\n promise.then(() => {\n promise = null;\n });\n }\n return promise;\n}\nfunction dispatch(node, direction, kind) {\n node.dispatchEvent(custom_event(`${direction ? \'intro\' : \'outro\'}${kind}`));\n}\nconst outroing = new Set();\nlet outros;\nfunction group_outros() {\n outros = {\n r: 0,\n c: [],\n p: outros // parent group\n };\n}\nfunction check_outros() {\n if (!outros.r) {\n run_all(outros.c);\n }\n outros = outros.p;\n}\nfunction transition_in(block, local) {\n if (block && block.i) {\n outroing.delete(block);\n block.i(local);\n }\n}\nfunction transition_out(block, local, detach, callback) {\n if (block && block.o) {\n if (outroing.has(block))\n return;\n outroing.add(block);\n outros.c.push(() => {\n outroing.delete(block);\n if (callback) {\n if (detach)\n block.d(1);\n callback();\n }\n });\n block.o(local);\n }\n}\nconst null_transition = { duration: 0 };\nfunction create_in_transition(node, fn, params) {\n let config = fn(node, params);\n let running = false;\n let animation_name;\n let task;\n let uid = 0;\n function cleanup() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n tick(0, 1);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n if (task)\n task.abort();\n running = true;\n add_render_callback(() => dispatch(node, true, \'start\'));\n task = loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(1, 0);\n dispatch(node, true, \'end\');\n cleanup();\n return running = false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(t, 1 - t);\n }\n }\n return running;\n });\n }\n let started = false;\n return {\n start() {\n if (started)\n return;\n started = true;\n delete_rule(node);\n if (is_function(config)) {\n config = config();\n wait().then(go);\n }\n else {\n go();\n }\n },\n invalidate() {\n started = false;\n },\n end() {\n if (running) {\n cleanup();\n running = false;\n }\n }\n };\n}\nfunction create_out_transition(node, fn, params) {\n let config = fn(node, params);\n let running = true;\n let animation_name;\n const group = outros;\n group.r += 1;\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n add_render_callback(() => dispatch(node, false, \'start\'));\n loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(0, 1);\n dispatch(node, false, \'end\');\n if (!--group.r) {\n // this will result in `end()` being called,\n // so we don\'t need to clean up here\n run_all(group.c);\n }\n return false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(1 - t, t);\n }\n }\n return running;\n });\n }\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config();\n go();\n });\n }\n else {\n go();\n }\n return {\n end(reset) {\n if (reset && config.tick) {\n config.tick(1, 0);\n }\n if (running) {\n if (animation_name)\n delete_rule(node, animation_name);\n running = false;\n }\n }\n };\n}\nfunction create_component(block) {\n block && block.c();\n}\nfunction mount_component(component, target, anchor, customElement) {\n const { fragment, on_mount, on_destroy, after_update } = component.$$;\n fragment && fragment.m(target, anchor);\n if (!customElement) {\n // onMount happens before the initial afterUpdate\n add_render_callback(() => {\n const new_on_destroy = on_mount.map(run).filter(is_function);\n if (on_destroy) {\n on_destroy.push(...new_on_destroy);\n }\n else {\n // Edge case - component was destroyed immediately,\n // most likely as a result of a binding initialising\n run_all(new_on_destroy);\n }\n component.$$.on_mount = [];\n });\n }\n after_update.forEach(add_render_callback);\n}\nfunction destroy_component(component, detaching) {\n const $$ = component.$$;\n if ($$.fragment !== null) {\n run_all($$.on_destroy);\n $$.fragment && $$.fragment.d(detaching);\n // TODO null out other refs, including component.$$ (but need to\n // preserve final state?)\n $$.on_destroy = $$.fragment = null;\n $$.ctx = [];\n }\n}\nfunction make_dirty(component, i) {\n if (component.$$.dirty[0] === -1) {\n dirty_components.push(component);\n schedule_update();\n component.$$.dirty.fill(0);\n }\n component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));\n}\nfunction init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {\n const parent_component = current_component;\n set_current_component(component);\n const $$ = component.$$ = {\n fragment: null,\n ctx: null,\n // state\n props,\n update: noop,\n not_equal,\n bound: {},\n // lifecycle\n on_mount: [],\n on_destroy: [],\n on_disconnect: [],\n before_update: [],\n after_update: [],\n context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),\n // everything else\n callbacks: {},\n dirty,\n skip_bound: false,\n root: options.target || parent_component.$$.root\n };\n append_styles && append_styles($$.root);\n let ready = false;\n $$.ctx = instance\n ? instance(component, options.props || {}, (i, ret, ...rest) => {\n const value = rest.length ? rest[0] : ret;\n if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {\n if (!$$.skip_bound && $$.bound[i])\n $$.bound[i](value);\n if (ready)\n make_dirty(component, i);\n }\n return ret;\n })\n : [];\n $$.update();\n ready = true;\n run_all($$.before_update);\n // `false` as a special case of no DOM component\n $$.fragment = create_fragment ? create_fragment($$.ctx) : false;\n if (options.target) {\n {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.c();\n }\n mount_component(component, options.target, options.anchor, options.customElement);\n flush();\n }\n set_current_component(parent_component);\n}\n/**\n * Base class for Svelte components. Used when dev=false.\n */\nclass SvelteComponent {\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n}\n\nfunction cubicOut(t) {\n const f = t - 1.0;\n return f * f * f + 1.0;\n}\n\nfunction fly(node, { delay = 0, duration = 400, easing = cubicOut, x = 0, y = 0, opacity = 0 } = {}) {\n const style = getComputedStyle(node);\n const target_opacity = +style.opacity;\n const transform = style.transform === \'none\' ? \'\' : style.transform;\n const od = target_opacity * (1 - opacity);\n return {\n delay,\n duration,\n easing,\n css: (t, u) => `\n\t\t\ttransform: ${transform} translate(${(1 - t) * x}px, ${(1 - t) * y}px);\n\t\t\topacity: ${target_opacity - (od * u)}`\n };\n}\n\nconst subscriber_queue = [];\n/**\n * Create a `Writable` store that allows both updating and reading by subscription.\n * @param {*=}value initial value\n * @param {StartStopNotifier=}start start and stop notifications for subscriptions\n */\nfunction writable(value, start = noop) {\n let stop;\n const subscribers = new Set();\n function set(new_value) {\n if (not_equal(value, new_value)) {\n value = new_value;\n if (stop) { // store is ready\n const run_queue = !subscriber_queue.length;\n for (const subscriber of subscribers) {\n subscriber[1]();\n subscriber_queue.push(subscriber, value);\n }\n if (run_queue) {\n for (let i = 0; i < subscriber_queue.length; i += 2) {\n subscriber_queue[i][0](subscriber_queue[i + 1]);\n }\n subscriber_queue.length = 0;\n }\n }\n }\n }\n function update(fn) {\n set(fn(value));\n }\n function subscribe(run, invalidate = noop) {\n const subscriber = [run, invalidate];\n subscribers.add(subscriber);\n if (subscribers.size === 1) {\n stop = start(set) || noop;\n }\n run(value);\n return () => {\n subscribers.delete(subscriber);\n if (subscribers.size === 0) {\n stop();\n stop = null;\n }\n };\n }\n return { set, update, subscribe };\n}\n\nfunction get_interpolator(a, b) {\n if (a === b || a !== a)\n return () => a;\n const type = typeof a;\n if (Array.isArray(a)) {\n const arr = b.map((bi, i) => {\n return get_interpolator(a[i], bi);\n });\n return t => arr.map(fn => fn(t));\n }\n if (type === \'number\') {\n const delta = b - a;\n return t => a + t * delta;\n }\n \n}\nfunction tweened(value, defaults = {}) {\n const store = writable(value);\n let task;\n let target_value = value;\n function set(new_value, opts) {\n if (value == null) {\n store.set(value = new_value);\n return Promise.resolve();\n }\n target_value = new_value;\n let previous_task = task;\n let started = false;\n let { delay = 0, duration = 400, easing = identity, interpolate = get_interpolator } = assign(assign({}, defaults), opts);\n if (duration === 0) {\n if (previous_task) {\n previous_task.abort();\n previous_task = null;\n }\n store.set(value = target_value);\n return Promise.resolve();\n }\n const start = now() + delay;\n let fn;\n task = loop(now => {\n if (now < start)\n return true;\n if (!started) {\n fn = interpolate(value, new_value);\n if (typeof duration === \'function\')\n duration = duration(value, new_value);\n started = true;\n }\n if (previous_task) {\n previous_task.abort();\n previous_task = null;\n }\n const elapsed = now - start;\n if (elapsed > duration) {\n store.set(value = new_value);\n return false;\n }\n // @ts-ignore\n store.set(value = fn(easing(elapsed / duration)));\n return true;\n });\n return task.promise;\n }\n return {\n set,\n update: (fn, opts) => set(fn(target_value, value), opts),\n subscribe: store.subscribe\n };\n}\n\n/** true if gallery is in the process of closing */\nconst closing = writable(0);\n\n/** store if user prefers reduced motion */\nconst prefersReducedMotion = globalThis.matchMedia?.(\n\t\'(prefers-reduced-motion: reduce)\'\n).matches;\n\n/** default options for tweens / transitions */\nconst defaultTweenOptions = (duration) => ({\n\teasing: cubicOut,\n\tduration: prefersReducedMotion ? 0 : duration,\n});\n\nconst getThumbBackground = (activeItem) =>\n\t!activeItem.thumb || `url(${activeItem.thumb})`;\n\n/**\n * Adds attributes to the given node based on the provided object.\n *\n * @param {HTMLElement} node - The node to which attributes will be added\n * @param {Record<string, string | boolean> | string} obj - The object containing key-value pairs of attributes to be added\n */\nconst addAttributes = (node, obj) => {\n\tif (!obj) {\n\t\treturn\n\t}\n\tif (typeof obj === \'string\') {\n\t\tobj = JSON.parse(obj);\n\t}\n\tfor (const key in obj) {\n\t\tnode.setAttribute(key, obj[key]);\n\t}\n};\n\n/* src/components/loading.svelte generated by Svelte v3.55.1 */\n\nfunction create_if_block_1$2(ctx) {\n\tlet div;\n\tlet div_outro;\n\tlet current;\n\n\treturn {\n\t\tc() {\n\t\t\tdiv = element("div");\n\t\t\tdiv.innerHTML = `<span class="bp-bar"></span><span class="bp-o"></span>`;\n\t\t\tattr(div, "class", "bp-load");\n\t\t\tset_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, div, anchor);\n\t\t\tcurrent = true;\n\t\t},\n\t\tp(ctx, dirty) {\n\t\t\tif (dirty & /*activeItem*/ 1) {\n\t\t\t\tset_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));\n\t\t\t}\n\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\tif (div_outro) div_outro.end(1);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\tif (local) {\n\t\t\t\tdiv_outro = create_out_transition(div, fly, { duration: 480 });\n\t\t\t}\n\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tif (detaching) detach(div);\n\t\t\tif (detaching && div_outro) div_outro.end();\n\t\t}\n\t};\n}\n\n// (11:57) {#if $closing}\nfunction create_if_block$2(ctx) {\n\tlet div;\n\tlet div_intro;\n\n\treturn {\n\t\tc() {\n\t\t\tdiv = element("div");\n\t\t\tattr(div, "class", "bp-load");\n\t\t\tset_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, div, anchor);\n\t\t},\n\t\tp(ctx, dirty) {\n\t\t\tif (dirty & /*activeItem*/ 1) {\n\t\t\t\tset_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));\n\t\t\t}\n\t\t},\n\t\ti(local) {\n\t\t\tif (!div_intro) {\n\t\t\t\tadd_render_callback(() => {\n\t\t\t\t\tdiv_intro = create_in_transition(div, fly, { duration: 480 });\n\t\t\t\t\tdiv_intro.start();\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\to: noop,\n\t\td(detaching) {\n\t\t\tif (detaching) detach(div);\n\t\t}\n\t};\n}\n\nfunction create_fragment$4(ctx) {\n\tlet if_block0_anchor;\n\tlet if_block1_anchor;\n\tlet if_block0 = !/*loaded*/ ctx[1] && create_if_block_1$2(ctx);\n\tlet if_block1 = /*$closing*/ ctx[2] && create_if_block$2(ctx);\n\n\treturn {\n\t\tc() {\n\t\t\tif (if_block0) if_block0.c();\n\t\t\tif_block0_anchor = empty();\n\t\t\tif (if_block1) if_block1.c();\n\t\t\tif_block1_anchor = empty();\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tif (if_block0) if_block0.m(target, anchor);\n\t\t\tinsert(target, if_block0_anchor, anchor);\n\t\t\tif (if_block1) if_block1.m(target, anchor);\n\t\t\tinsert(target, if_block1_anchor, anchor);\n\t\t},\n\t\tp(ctx, [dirty]) {\n\t\t\tif (!/*loaded*/ ctx[1]) {\n\t\t\t\tif (if_block0) {\n\t\t\t\t\tif_block0.p(ctx, dirty);\n\n\t\t\t\t\tif (dirty & /*loaded*/ 2) {\n\t\t\t\t\t\ttransition_in(if_block0, 1);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif_block0 = create_if_block_1$2(ctx);\n\t\t\t\t\tif_block0.c();\n\t\t\t\t\ttransition_in(if_block0, 1);\n\t\t\t\t\tif_block0.m(if_block0_anchor.parentNode, if_block0_anchor);\n\t\t\t\t}\n\t\t\t} else if (if_block0) {\n\t\t\t\tgroup_outros();\n\n\t\t\t\ttransition_out(if_block0, 1, 1, () => {\n\t\t\t\t\tif_block0 = null;\n\t\t\t\t});\n\n\t\t\t\tcheck_outros();\n\t\t\t}\n\n\t\t\tif (/*$closing*/ ctx[2]) {\n\t\t\t\tif (if_block1) {\n\t\t\t\t\tif_block1.p(ctx, dirty);\n\n\t\t\t\t\tif (dirty & /*$closing*/ 4) {\n\t\t\t\t\t\ttransition_in(if_block1, 1);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif_block1 = create_if_block$2(ctx);\n\t\t\t\t\tif_block1.c();\n\t\t\t\t\ttransition_in(if_block1, 1);\n\t\t\t\t\tif_block1.m(if_block1_anchor.parentNode, if_block1_anchor);\n\t\t\t\t}\n\t\t\t} else if (if_block1) {\n\t\t\t\tif_block1.d(1);\n\t\t\t\tif_block1 = null;\n\t\t\t}\n\t\t},\n\t\ti(local) {\n\t\t\ttransition_in(if_block0);\n\t\t\ttransition_in(if_block1);\n\t\t},\n\t\to(local) {\n\t\t\ttransition_out(if_block0);\n\t\t},\n\t\td(detaching) {\n\t\t\tif (if_block0) if_block0.d(detaching);\n\t\t\tif (detaching) detach(if_block0_anchor);\n\t\t\tif (if_block1) if_block1.d(detaching);\n\t\t\tif (detaching) detach(if_block1_anchor);\n\t\t}\n\t};\n}\n\nfunction instance$4($$self, $$props, $$invalidate) {\n\tlet $closing;\n\tcomponent_subscribe($$self, closing, $$value => $$invalidate(2, $closing = $$value));\n\tlet { activeItem } = $$props;\n\tlet { loaded } = $$props;\n\n\t$$self.$$set = $$props => {\n\t\tif (\'activeItem\' in $$props) $$invalidate(0, activeItem = $$props.activeItem);\n\t\tif (\'loaded\' in $$props) $$invalidate(1, loaded = $$props.loaded);\n\t};\n\n\treturn [activeItem, loaded, $closing];\n}\n\nclass Loading extends SvelteComponent {\n\tconstructor(options) {\n\t\tsuper();\n\t\tinit(this, options, instance$4, create_fragment$4, not_equal, { activeItem: 0, loaded: 1 });\n\t}\n}\n\n/* src/components/image.svelte generated by Svelte v3.55.1 */\n\nfunction create_if_block_1$1(ctx) {\n\tlet img;\n\tlet img_sizes_value;\n\tlet img_outro;\n\tlet current;\n\tlet mounted;\n\tlet dispose;\n\n\treturn {\n\t\tc() {\n\t\t\timg = element("img");\n\t\t\tattr(img, "sizes", img_sizes_value = /*opts*/ ctx[8].sizes || `${/*sizes*/ ctx[1]}px`);\n\t\t\tattr(img, "alt", /*activeItem*/ ctx[7].alt);\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, img, anchor);\n\t\t\tcurrent = true;\n\n\t\t\tif (!mounted) {\n\t\t\t\tdispose = [\n\t\t\t\t\taction_destroyer(/*addSrc*/ ctx[21].call(null, img)),\n\t\t\t\t\tlisten(img, "error", /*error_handler*/ ctx[27])\n\t\t\t\t];\n\n\t\t\t\tmounted = true;\n\t\t\t}\n\t\t},\n\t\tp(ctx, dirty) {\n\t\t\tif (!current || dirty[0] & /*sizes*/ 2 && img_sizes_value !== (img_sizes_value = /*opts*/ ctx[8].sizes || `${/*sizes*/ ctx[1]}px`)) {\n\t\t\t\tattr(img, "sizes", img_sizes_value);\n\t\t\t}\n\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\tif (img_outro) img_outro.end(1);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\timg_outro = create_out_transition(img, fly, {});\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tif (detaching) detach(img);\n\t\t\tif (detaching && img_outro) img_outro.end();\n\t\t\tmounted = false;\n\t\t\trun_all(dispose);\n\t\t}\n\t};\n}\n\n// (384:10) {#if showLoader}\nfunction create_if_block$1(ctx) {\n\tlet loading;\n\tlet current;\n\n\tloading = new Loading({\n\t\t\tprops: {\n\t\t\t\tactiveItem: /*activeItem*/ ctx[7],\n\t\t\t\tloaded: /*loaded*/ ctx[2]\n\t\t\t}\n\t\t});\n\n\treturn {\n\t\tc() {\n\t\t\tcreate_component(loading.$$.fragment);\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tmount_component(loading, target, anchor);\n\t\t\tcurrent = true;\n\t\t},\n\t\tp(ctx, dirty) {\n\t\t\tconst loading_changes = {};\n\t\t\tif (dirty[0] & /*loaded*/ 4) loading_changes.loaded = /*loaded*/ ctx[2];\n\t\t\tloading.$set(loading_changes);\n\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\ttransition_in(loading.$$.fragment, local);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\ttransition_out(loading.$$.fragment, local);\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tdestroy_component(loading, detaching);\n\t\t}\n\t};\n}\n\nfunction create_fragment$3(ctx) {\n\tlet div1;\n\tlet div0;\n\tlet if_block0_anchor;\n\tlet style_transform = `translate3d(${/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]}px, ${/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]}px, 0)`;\n\tlet current;\n\tlet mounted;\n\tlet dispose;\n\tlet if_block0 = /*loaded*/ ctx[2] && create_if_block_1$1(ctx);\n\tlet if_block1 = /*showLoader*/ ctx[3] && create_if_block$1(ctx);\n\n\treturn {\n\t\tc() {\n\t\t\tdiv1 = element("div");\n\t\t\tdiv0 = element("div");\n\t\t\tif (if_block0) if_block0.c();\n\t\t\tif_block0_anchor = empty();\n\t\t\tif (if_block1) if_block1.c();\n\t\t\tattr(div0, "class", "bp-img");\n\t\t\tset_style(div0, "width", /*$imageDimensions*/ ctx[0][0] + "px");\n\t\t\tset_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px");\n\t\t\ttoggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]);\n\t\t\ttoggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]);\n\t\t\tset_style(div0, "background-image", getThumbBackground(/*activeItem*/ ctx[7]));\n\t\t\tset_style(div0, "transform", style_transform);\n\t\t\tattr(div1, "class", "bp-img-wrap");\n\t\t\ttoggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]);\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, div1, anchor);\n\t\t\tappend(div1, div0);\n\t\t\tif (if_block0) if_block0.m(div0, null);\n\t\t\tappend(div0, if_block0_anchor);\n\t\t\tif (if_block1) if_block1.m(div0, null);\n\t\t\tcurrent = true;\n\n\t\t\tif (!mounted) {\n\t\t\t\tdispose = [\n\t\t\t\t\taction_destroyer(/*onMount*/ ctx[20].call(null, div0)),\n\t\t\t\t\tlisten(div1, "wheel", /*onWheel*/ ctx[15]),\n\t\t\t\t\tlisten(div1, "pointerdown", /*onPointerDown*/ ctx[16]),\n\t\t\t\t\tlisten(div1, "pointermove", /*onPointerMove*/ ctx[17]),\n\t\t\t\t\tlisten(div1, "pointerup", /*onPointerUp*/ ctx[19]),\n\t\t\t\t\tlisten(div1, "pointercancel", /*removeEventFromCache*/ ctx[18])\n\t\t\t\t];\n\n\t\t\t\tmounted = true;\n\t\t\t}\n\t\t},\n\t\tp(ctx, dirty) {\n\t\t\tif (/*loaded*/ ctx[2]) {\n\t\t\t\tif (if_block0) {\n\t\t\t\t\tif_block0.p(ctx, dirty);\n\n\t\t\t\t\tif (dirty[0] & /*loaded*/ 4) {\n\t\t\t\t\t\ttransition_in(if_block0, 1);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif_block0 = create_if_block_1$1(ctx);\n\t\t\t\t\tif_block0.c();\n\t\t\t\t\ttransition_in(if_block0, 1);\n\t\t\t\t\tif_block0.m(div0, if_block0_anchor);\n\t\t\t\t}\n\t\t\t} else if (if_block0) {\n\t\t\t\tgroup_outros();\n\n\t\t\t\ttransition_out(if_block0, 1, 1, () => {\n\t\t\t\t\tif_block0 = null;\n\t\t\t\t});\n\n\t\t\t\tcheck_outros();\n\t\t\t}\n\n\t\t\tif (/*showLoader*/ ctx[3]) {\n\t\t\t\tif (if_block1) {\n\t\t\t\t\tif_block1.p(ctx, dirty);\n\n\t\t\t\t\tif (dirty[0] & /*showLoader*/ 8) {\n\t\t\t\t\t\ttransition_in(if_block1, 1);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif_block1 = create_if_block$1(ctx);\n\t\t\t\t\tif_block1.c();\n\t\t\t\t\ttransition_in(if_block1, 1);\n\t\t\t\t\tif_block1.m(div0, null);\n\t\t\t\t}\n\t\t\t} else if (if_block1) {\n\t\t\t\tgroup_outros();\n\n\t\t\t\ttransition_out(if_block1, 1, 1, () => {\n\t\t\t\t\tif_block1 = null;\n\t\t\t\t});\n\n\t\t\t\tcheck_outros();\n\t\t\t}\n\n\t\t\tif (!current || dirty[0] & /*$imageDimensions*/ 1) {\n\t\t\t\tset_style(div0, "width", /*$imageDimensions*/ ctx[0][0] + "px");\n\t\t\t}\n\n\t\t\tif (!current || dirty[0] & /*$imageDimensions*/ 1) {\n\t\t\t\tset_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px");\n\t\t\t}\n\n\t\t\tif (!current || dirty[0] & /*pointerDown*/ 16) {\n\t\t\t\ttoggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]);\n\t\t\t}\n\n\t\t\tif (!current || dirty[0] & /*maxZoom, $imageDimensions, naturalWidth*/ 6145) {\n\t\t\t\ttoggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]);\n\t\t\t}\n\n\t\t\tif (dirty[0] & /*$imageDimensions, $zoomDragTranslate*/ 65 && style_transform !== (style_transform = `translate3d(${/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]}px, ${/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]}px, 0)`)) {\n\t\t\t\tset_style(div0, "transform", style_transform);\n\t\t\t}\n\n\t\t\tif (!current || dirty[0] & /*closingWhileZoomed*/ 32) {\n\t\t\t\ttoggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]);\n\t\t\t}\n\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\ttransition_in(if_block0);\n\t\t\ttransition_in(if_block1);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\ttransition_out(if_block0);\n\t\t\ttransition_out(if_block1);\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tif (detaching) detach(div1);\n\t\t\tif (if_block0) if_block0.d();\n\t\t\tif (if_block1) if_block1.d();\n\t\t\tmounted = false;\n\t\t\trun_all(dispose);\n\t\t}\n\t};\n}\n\nfunction instance$3($$self, $$props, $$invalidate) {\n\tlet $zoomed;\n\tlet $zoomDragTranslate;\n\tlet $closing;\n\tlet $imageDimensions;\n\tcomponent_subscribe($$self, closing, $$value => $$invalidate(26, $closing = $$value));\n\tlet { props } = $$props;\n\tlet { smallScreen } = $$props;\n\tlet { activeItem, opts, prev, next, zoomed, container } = props;\n\tcomponent_subscribe($$self, zoomed, value => $$invalidate(25, $zoomed = value));\n\tlet maxZoom = activeItem.maxZoom || opts.maxZoom || 10;\n\tlet calculatedDimensions = props.calculateDimensions(activeItem);\n\n\t/** value of sizes attribute */\n\tlet sizes = calculatedDimensions[0];\n\n\t/** tracks load state of image */\n\tlet loaded, showLoader;\n\n\t/** stores pinch info if multiple touch events active */\n\tlet pinchDetails;\n\n\t/** image html element (.bp-img) */\n\tlet bpImg;\n\n\t/** track distance for pinch events */\n\tlet prevDiff = 0;\n\n\tlet pointerDown, hasDragged;\n\tlet dragStartX, dragStartY;\n\n\t/** zoomDragTranslate values on start of drag */\n\tlet dragStartTranslateX, dragStartTranslateY;\n\n\t/** if true, adds class to .bp-wrap to avoid image cropping */\n\tlet closingWhileZoomed;\n\n\tconst naturalWidth = +activeItem.width;\n\n\t/** store positions for drag inertia */\n\tconst dragPositions = [];\n\n\t/** cache pointer events to handle pinch */\n\tconst pointerCache = new Map();\n\n\t/** tween to control image size */\n\tconst imageDimensions = tweened(calculatedDimensions, defaultTweenOptions(400));\n\n\tcomponent_subscribe($$self, imageDimensions, value => $$invalidate(0, $imageDimensions = value));\n\n\t/** translate transform for pointerDown */\n\tconst zoomDragTranslate = tweened([0, 0], defaultTweenOptions(400));\n\n\tcomponent_subscribe($$self, zoomDragTranslate, value => $$invalidate(6, $zoomDragTranslate = value));\n\n\t/** calculate translate position with bounds */\n\tconst boundTranslateValues = ([x, y], newDimensions = $imageDimensions) => {\n\t\t// image drag translate bounds\n\t\tconst maxTranslateX = (newDimensions[0] - container.w) / 2;\n\n\t\tconst maxTranslateY = (newDimensions[1] - container.h) / 2;\n\n\t\t// x max drag\n\t\tif (maxTranslateX < 0) {\n\t\t\tx = 0;\n\t\t} else if (x > maxTranslateX) {\n\t\t\tif (smallScreen) {\n\t\t\t\t// bound to left side (allow slight over drag)\n\t\t\t\tx = pointerDown\n\t\t\t\t? maxTranslateX + (x - maxTranslateX) / 10\n\t\t\t\t: maxTranslateX;\n\n\t\t\t\t// previous item if dragged past threshold\n\t\t\t\tif (x > maxTranslateX + 20) {\n\t\t\t\t\t// pointerdown = undefined to stop pointermove from running again\n\t\t\t\t\t$$invalidate(4, pointerDown = prev());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tx = maxTranslateX;\n\t\t\t}\n\t\t} else if (x < -maxTranslateX) {\n\t\t\t// bound to right side (allow slight over drag)\n\t\t\tif (smallScreen) {\n\t\t\t\tx = pointerDown\n\t\t\t\t? -maxTranslateX - (-maxTranslateX - x) / 10\n\t\t\t\t: -maxTranslateX;\n\n\t\t\t\t// next item if dragged past threshold\n\t\t\t\tif (x < -maxTranslateX - 20) {\n\t\t\t\t\t// pointerdown = undefined to stop pointermove from running again\n\t\t\t\t\t$$invalidate(4, pointerDown = next());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tx = -maxTranslateX;\n\t\t\t}\n\t\t}\n\n\t\t// y max drag\n\t\tif (maxTranslateY < 0) {\n\t\t\ty = 0;\n\t\t} else if (y > maxTranslateY) {\n\t\t\ty = maxTranslateY;\n\t\t} else if (y < -maxTranslateY) {\n\t\t\ty = -maxTranslateY;\n\t\t}\n\n\t\treturn [x, y];\n\t};\n\n\t/** updates zoom level in or out based on amt value */\n\tfunction changeZoom(amt = maxZoom, e) {\n\t\tif ($closing) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst maxWidth = calculatedDimensions[0] * maxZoom;\n\t\tlet newWidth = $imageDimensions[0] + $imageDimensions[0] * amt;\n\t\tlet newHeight = $imageDimensions[1] + $imageDimensions[1] * amt;\n\n\t\tif (amt > 0) {\n\t\t\tif (newWidth > maxWidth) {\n\t\t\t\t// requesting size large than max zoom\n\t\t\t\tnewWidth = maxWidth;\n\n\t\t\t\tnewHeight = calculatedDimensions[1] * maxZoom;\n\t\t\t}\n\n\t\t\tif (newWidth > naturalWidth) {\n\t\t\t\t// if requesting zoom larger than natural size\n\t\t\t\tnewWidth = naturalWidth;\n\n\t\t\t\tnewHeight = +activeItem.height;\n\t\t\t}\n\t\t} else if (newWidth < calculatedDimensions[0]) {\n\t\t\t// if requesting image smaller than starting size\n\t\t\timageDimensions.set(calculatedDimensions);\n\n\t\t\treturn zoomDragTranslate.set([0, 0]);\n\t\t}\n\n\t\tlet { x, y, width, height } = bpImg.getBoundingClientRect();\n\n\t\t// distance clicked from center of image\n\t\tconst offsetX = e ? e.clientX - x - width / 2 : 0;\n\n\t\tconst offsetY = e ? e.clientY - y - height / 2 : 0;\n\t\tx = -offsetX * (newWidth / width) + offsetX;\n\t\ty = -offsetY * (newHeight / height) + offsetY;\n\t\tconst newDimensions = [newWidth, newHeight];\n\n\t\t// set new dimensions and update sizes property\n\t\timageDimensions.set(newDimensions).then(() => {\n\t\t\t$$invalidate(1, sizes = Math.round(Math.max(sizes, newWidth)));\n\t\t});\n\n\t\t// update translate value\n\t\tzoomDragTranslate.set(boundTranslateValues([$zoomDragTranslate[0] + x, $zoomDragTranslate[1] + y], newDimensions));\n\t}\n\n\t// allow zoom to be read / set externally\n\tObject.defineProperty(activeItem, \'zoom\', {\n\t\tconfigurable: true,\n\t\tget: () => $zoomed,\n\t\tset: bool => changeZoom(bool ? maxZoom : -maxZoom)\n\t});\n\n\tconst onWheel = e => {\n\t\t// return if scrolling past inline gallery w/ wheel\n\t\tif (opts.inline && !$zoomed) {\n\t\t\treturn;\n\t\t}\n\n\t\t// preventDefault to stop scrolling on zoomed inline image\n\t\te.preventDefault();\n\n\t\t// change zoom on wheel\n\t\tchangeZoom(e.deltaY / -300, e);\n\t};\n\n\t/** on drag start, store initial position and image translate values */\n\tconst onPointerDown = e => {\n\t\t// don\'t run if right click\n\t\tif (e.button !== 2) {\n\t\t\te.preventDefault();\n\t\t\t$$invalidate(4, pointerDown = true);\n\t\t\tpointerCache.set(e.pointerId, e);\n\t\t\tdragStartX = e.clientX;\n\t\t\tdragStartY = e.clientY;\n\t\t\tdragStartTranslateX = $zoomDragTranslate[0];\n\t\t\tdragStartTranslateY = $zoomDragTranslate[1];\n\t\t}\n\t};\n\n\t/** on drag, update image translate val */\n\tconst onPointerMove = e => {\n\t\tif (pointerCache.size > 1) {\n\t\t\t// if multiple pointer events, pass to handlePinch function\n\t\t\t$$invalidate(4, pointerDown = false);\n\n\t\t\treturn opts.noPinch?.(container.el) || handlePinch(e);\n\t\t}\n\n\t\tif (!pointerDown) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet x = e.clientX;\n\t\tlet y = e.clientY;\n\n\t\t// store positions in dragPositions for inertia\n\t\t// set hasDragged if > 2 pointer move events\n\t\thasDragged = dragPositions.push({ x, y }) > 2;\n\n\t\t// overall drag diff from start location\n\t\tx = x - dragStartX;\n\n\t\ty = y - dragStartY;\n\n\t\t// handle unzoomed left / right / up swipes\n\t\tif (!$zoomed) {\n\t\t\t// close if swipe up\n\t\t\tif (y < -90) {\n\t\t\t\t$$invalidate(4, pointerDown = !opts.noClose && props.close());\n\t\t\t}\n\n\t\t\t// only handle left / right if not swiping vertically\n\t\t\tif (Math.abs(y) < 30) {\n\t\t\t\t// previous if swipe left\n\t\t\t\tif (x > 40) {\n\t\t\t\t\t// pointerdown = undefined to stop pointermove from running again\n\t\t\t\t\t$$invalidate(4, pointerDown = prev());\n\t\t\t\t}\n\n\t\t\t\t// next if swipe right\n\t\t\t\tif (x < -40) {\n\t\t\t\t\t// pointerdown = undefined to stop pointermove from running again\n\t\t\t\t\t$$invalidate(4, pointerDown = next());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// image drag when zoomed\n\t\tif ($zoomed && hasDragged && !$closing) {\n\t\t\tzoomDragTranslate.set(boundTranslateValues([dragStartTranslateX + x, dragStartTranslateY + y]), { duration: 0 });\n\t\t}\n\t};\n\n\tconst handlePinch = e => {\n\t\t// update event in cache and get values\n\t\tconst [p1, p2] = pointerCache.set(e.pointerId, e).values();\n\n\t\t// Calculate the distance between the two pointers\n\t\tconst dx = p1.clientX - p2.clientX;\n\n\t\tconst dy = p1.clientY - p2.clientY;\n\t\tconst curDiff = Math.hypot(dx, dy);\n\n\t\t// cache the original pinch center\n\t\tpinchDetails = pinchDetails || {\n\t\t\tclientX: (p1.clientX + p2.clientX) / 2,\n\t\t\tclientY: (p1.clientY + p2.clientY) / 2\n\t\t};\n\n\t\t// scale image\n\t\tchangeZoom(((prevDiff || curDiff) - curDiff) / -35, pinchDetails);\n\n\t\t// Cache the distance for the next move event\n\t\tprevDiff = curDiff;\n\t};\n\n\t/** remove event from pointer event cache */\n\tconst removeEventFromCache = e => pointerCache.delete(e.pointerId);\n\n\tfunction onPointerUp(e) {\n\t\tremoveEventFromCache(e);\n\n\t\tif (pinchDetails) {\n\t\t\t// reset prevDiff and clear pointerDown to trigger return below\n\t\t\t$$invalidate(4, pointerDown = prevDiff = 0);\n\n\t\t\t// set pinchDetails to null after last finger lifts\n\t\t\tpinchDetails = pointerCache.size ? pinchDetails : null;\n\t\t}\n\n\t\t// make sure pointer events don\'t carry over to next image\n\t\tif (!pointerDown) {\n\t\t\treturn;\n\t\t}\n\n\t\t$$invalidate(4, pointerDown = false);\n\n\t\t// close if overlay is clicked\n\t\tif (e.target === this && !opts.noClose) {\n\t\t\treturn props.close();\n\t\t}\n\n\t\t// add drag inertia / snap back to bounds\n\t\tif (hasDragged) {\n\t\t\tconst [posOne, posTwo, posThree] = dragPositions.slice(-3);\n\t\t\tconst xDiff = posTwo.x - posThree.x;\n\t\t\tconst yDiff = posTwo.y - posThree.y;\n\n\t\t\tif (Math.hypot(xDiff, yDiff) > 5) {\n\t\t\t\tzoomDragTranslate.set(boundTranslateValues([\n\t\t\t\t\t$zoomDragTranslate[0] - (posOne.x - posThree.x) * 5,\n\t\t\t\t\t$zoomDragTranslate[1] - (posOne.y - posThree.y) * 5\n\t\t\t\t]));\n\t\t\t}\n\t\t} else if (!opts.onImageClick?.(container.el, activeItem)) {\n\t\t\tchangeZoom($zoomed ? -maxZoom : maxZoom, e);\n\t\t}\n\n\t\t// reset pointer states\n\t\thasDragged = false;\n\n\t\t// reset dragPositions\n\t\tdragPositions.length = 0;\n\t}\n\n\tconst onMount = node => {\n\t\tbpImg = node;\n\n\t\t// handle globalThis resize\n\t\tprops.setResizeFunc(() => {\n\t\t\t$$invalidate(24, calculatedDimensions = props.calculateDimensions(activeItem));\n\n\t\t\t// adjust image size / zoom on resize, but not on mobile because\n\t\t\t// some browsers (ios safari 15) constantly resize screen on drag\n\t\t\tif (opts.inline || !smallScreen) {\n\t\t\t\timageDimensions.set(calculatedDimensions);\n\t\t\t\tzoomDragTranslate.set([0, 0]);\n\t\t\t}\n\t\t});\n\n\t\t// decode initial image before rendering\n\t\tprops.loadImage(activeItem).then(() => {\n\t\t\t$$invalidate(2, loaded = true);\n\t\t\tprops.preloadNext();\n\t\t});\n\n\t\t// show loading indicator if needed\n\t\tsetTimeout(\n\t\t\t() => {\n\t\t\t\t$$invalidate(3, showLoader = !loaded);\n\t\t\t},\n\t\t\t250\n\t\t);\n\t};\n\n\tconst addSrc = node => {\n\t\taddAttributes(node, activeItem.attr);\n\t\tnode.srcset = activeItem.img;\n\t};\n\n\tconst error_handler = error => opts.onError?.(container, activeItem, error);\n\n\t$$self.$$set = $$props => {\n\t\t\n\t\tif (\'smallScreen\' in $$props) $$invalidate(23, smallScreen = $$props.smallScreen);\n\t};\n\n\t$$self.$$.update = () => {\n\t\tif ($$self.$$.dirty[0] & /*$imageDimensions, calculatedDimensions*/ 16777217) {\n\t\t\tzoomed.set($imageDimensions[0] - 10 > calculatedDimensions[0]);\n\t\t}\n\n\t\tif ($$self.$$.dirty[0] & /*$closing, $zoomed, calculatedDimensions*/ 117440512) {\n\t\t\t// if zoomed while closing, zoom out image and add class\n\t\t\t// to change contain value on .bp-wrap to avoid cropping\n\t\t\tif ($closing && $zoomed && !opts.intro) {\n\t\t\t\tconst closeTweenOpts = defaultTweenOptions(480);\n\t\t\t\tzoomDragTranslate.set([0, 0], closeTweenOpts);\n\t\t\t\timageDimensions.set(calculatedDimensions, closeTweenOpts);\n\t\t\t\t$$invalidate(5, closingWhileZoomed = true);\n\t\t\t}\n\t\t}\n\t};\n\n\treturn [\n\t\t$imageDimensions,\n\t\tsizes,\n\t\tloaded,\n\t\tshowLoader,\n\t\tpointerDown,\n\t\tclosingWhileZoomed,\n\t\t$zoomDragTranslate,\n\t\tactiveItem,\n\t\topts,\n\t\tzoomed,\n\t\tcontainer,\n\t\tmaxZoom,\n\t\tnaturalWidth,\n\t\timageDimensions,\n\t\tzoomDragTranslate,\n\t\tonWheel,\n\t\tonPointerDown,\n\t\tonPointerMove,\n\t\tremoveEventFromCache,\n\t\tonPointerUp,\n\t\tonMount,\n\t\taddSrc,\n\t\tprops,\n\t\tsmallScreen,\n\t\tcalculatedDimensions,\n\t\t$zoomed,\n\t\t$closing,\n\t\terror_handler\n\t];\n}\n\nclass Image extends SvelteComponent {\n\tconstructor(options) {\n\t\tsuper();\n\t\tinit(this, options, instance$3, create_fragment$3, not_equal, { props: 22, smallScreen: 23 }, null, [-1, -1]);\n\t}\n}\n\n/* src/components/iframe.svelte generated by Svelte v3.55.1 */\n\nfunction create_fragment$2(ctx) {\n\tlet div;\n\tlet iframe;\n\tlet loading;\n\tlet current;\n\tlet mounted;\n\tlet dispose;\n\n\tloading = new Loading({\n\t\t\tprops: {\n\t\t\t\tactiveItem: /*activeItem*/ ctx[2],\n\t\t\t\tloaded: /*loaded*/ ctx[0]\n\t\t\t}\n\t\t});\n\n\treturn {\n\t\tc() {\n\t\t\tdiv = element("div");\n\t\t\tiframe = element("iframe");\n\t\t\tcreate_component(loading.$$.fragment);\n\t\t\tattr(iframe, "allow", "autoplay; fullscreen");\n\t\t\tattr(iframe, "title", /*activeItem*/ ctx[2].title);\n\t\t\tattr(div, "class", "bp-if");\n\t\t\tset_style(div, "width", /*dimensions*/ ctx[1][0] + "px");\n\t\t\tset_style(div, "height", /*dimensions*/ ctx[1][1] + "px");\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, div, anchor);\n\t\t\tappend(div, iframe);\n\t\t\tmount_component(loading, div, null);\n\t\t\tcurrent = true;\n\n\t\t\tif (!mounted) {\n\t\t\t\tdispose = [\n\t\t\t\t\taction_destroyer(/*addSrc*/ ctx[3].call(null, iframe)),\n\t\t\t\t\tlisten(iframe, "load", /*load_handler*/ ctx[5])\n\t\t\t\t];\n\n\t\t\t\tmounted = true;\n\t\t\t}\n\t\t},\n\t\tp(ctx, [dirty]) {\n\t\t\tconst loading_changes = {};\n\t\t\tif (dirty & /*loaded*/ 1) loading_changes.loaded = /*loaded*/ ctx[0];\n\t\t\tloading.$set(loading_changes);\n\n\t\t\tif (!current || dirty & /*dimensions*/ 2) {\n\t\t\t\tset_style(div, "width", /*dimensions*/ ctx[1][0] + "px");\n\t\t\t}\n\n\t\t\tif (!current || dirty & /*dimensions*/ 2) {\n\t\t\t\tset_style(div, "height", /*dimensions*/ ctx[1][1] + "px");\n\t\t\t}\n\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\ttransition_in(loading.$$.fragment, local);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\ttransition_out(loading.$$.fragment, local);\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tif (detaching) detach(div);\n\t\t\tdestroy_component(loading);\n\t\t\tmounted = false;\n\t\t\trun_all(dispose);\n\t\t}\n\t};\n}\n\nfunction instance$2($$self, $$props, $$invalidate) {\n\tlet { props } = $$props;\n\tlet loaded, dimensions;\n\tconst { activeItem } = props;\n\tconst setDimensions = () => $$invalidate(1, dimensions = props.calculateDimensions(activeItem));\n\tsetDimensions();\n\tprops.setResizeFunc(setDimensions);\n\n\tconst addSrc = node => {\n\t\taddAttributes(node, activeItem.attr);\n\t\tnode.src = activeItem.iframe;\n\t};\n\n\tconst load_handler = () => $$invalidate(0, loaded = true);\n\n\t\n\n\treturn [loaded, dimensions, activeItem, addSrc, props, load_handler];\n}\n\nclass Iframe extends SvelteComponent {\n\tconstructor(options) {\n\t\tsuper();\n\t\tinit(this, options, instance$2, create_fragment$2, not_equal, { props: 4 });\n\t}\n}\n\n/* src/components/video.svelte generated by Svelte v3.55.1 */\n\nfunction create_fragment$1(ctx) {\n\tlet div;\n\tlet loading;\n\tlet current;\n\tlet mounted;\n\tlet dispose;\n\n\tloading = new Loading({\n\t\t\tprops: {\n\t\t\t\tactiveItem: /*activeItem*/ ctx[2],\n\t\t\t\tloaded: /*loaded*/ ctx[0]\n\t\t\t}\n\t\t});\n\n\treturn {\n\t\tc() {\n\t\t\tdiv = element("div");\n\t\t\tcreate_component(loading.$$.fragment);\n\t\t\tattr(div, "class", "bp-vid");\n\t\t\tset_style(div, "width", /*dimensions*/ ctx[1][0] + "px");\n\t\t\tset_style(div, "height", /*dimensions*/ ctx[1][1] + "px");\n\t\t\tset_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[2]));\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, div, anchor);\n\t\t\tmount_component(loading, div, null);\n\t\t\tcurrent = true;\n\n\t\t\tif (!mounted) {\n\t\t\t\tdispose = action_destroyer(/*onMount*/ ctx[3].call(null, div));\n\t\t\t\tmounted = true;\n\t\t\t}\n\t\t},\n\t\tp(ctx, [dirty]) {\n\t\t\tconst loading_changes = {};\n\t\t\tif (dirty & /*loaded*/ 1) loading_changes.loaded = /*loaded*/ ctx[0];\n\t\t\tloading.$set(loading_changes);\n\n\t\t\tif (!current || dirty & /*dimensions*/ 2) {\n\t\t\t\tset_style(div, "width", /*dimensions*/ ctx[1][0] + "px");\n\t\t\t}\n\n\t\t\tif (!current || dirty & /*dimensions*/ 2) {\n\t\t\t\tset_style(div, "height", /*dimensions*/ ctx[1][1] + "px");\n\t\t\t}\n\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\ttransition_in(loading.$$.fragment, local);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\ttransition_out(loading.$$.fragment, local);\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tif (detaching) detach(div);\n\t\t\tdestroy_component(loading);\n\t\t\tmounted = false;\n\t\t\tdispose();\n\t\t}\n\t};\n}\n\nfunction instance$1($$self, $$props, $$invalidate) {\n\tlet { props } = $$props;\n\tlet loaded, dimensions;\n\tconst { activeItem, opts, container } = props;\n\tconst setDimensions = () => $$invalidate(1, dimensions = props.calculateDimensions(activeItem));\n\tsetDimensions();\n\tprops.setResizeFunc(setDimensions);\n\n\t/** create audo / video element */\n\tconst onMount = node => {\n\t\tlet mediaElement;\n\n\t\t/** takes supplied object and creates elements in video */\n\t\tconst appendToVideo = (tag, arr) => {\n\t\t\tif (!Array.isArray(arr)) {\n\t\t\t\tarr = JSON.parse(arr);\n\t\t\t}\n\n\t\t\tfor (const obj of arr) {\n\t\t\t\t// create media element if it doesn\'t exist\n\t\t\t\tif (!mediaElement) {\n\t\t\t\t\tmediaElement = document.createElement((obj.type?.includes(\'audio\')) ? \'audio\' : \'video\');\n\n\t\t\t\t\taddAttributes(mediaElement, {\n\t\t\t\t\t\tcontrols: true,\n\t\t\t\t\t\tautoplay: true,\n\t\t\t\t\t\tplaysinline: true,\n\t\t\t\t\t\ttabindex: \'0\'\n\t\t\t\t\t});\n\n\t\t\t\t\taddAttributes(mediaElement, activeItem.attr);\n\t\t\t\t}\n\n\t\t\t\t// add sources / tracks to media element\n\t\t\t\tconst el = document.createElement(tag);\n\n\t\t\t\taddAttributes(el, obj);\n\n\t\t\t\tif (tag == \'source\') {\n\t\t\t\t\tel.onError = error => opts.onError?.(container, activeItem, error);\n\t\t\t\t}\n\n\t\t\t\tmediaElement.append(el);\n\t\t\t}\n\t\t};\n\n\t\tappendToVideo(\'source\', activeItem.sources);\n\t\tappendToVideo(\'track\', activeItem.tracks || []);\n\t\tmediaElement.oncanplay = () => $$invalidate(0, loaded = true);\n\t\tnode.append(mediaElement);\n\t};\n\n\t\n\n\treturn [loaded, dimensions, activeItem, onMount, props];\n}\n\nclass Video extends SvelteComponent {\n\tconstructor(options) {\n\t\tsuper();\n\t\tinit(this, options, instance$1, create_fragment$1, not_equal, { props: 4 });\n\t}\n}\n\n/* src/bigger-picture.svelte generated by Svelte v3.55.1 */\n\nfunction create_if_block(ctx) {\n\tlet div2;\n\tlet div0;\n\tlet div0_outro;\n\tlet previous_key = /*activeItem*/ ctx[6].i;\n\tlet div1;\n\tlet button;\n\tlet div1_outro;\n\tlet current;\n\tlet mounted;\n\tlet dispose;\n\tlet key_block = create_key_block(ctx);\n\tlet if_block = /*items*/ ctx[0].length > 1 && create_if_block_1(ctx);\n\n\treturn {\n\t\tc() {\n\t\t\tdiv2 = element("div");\n\t\t\tdiv0 = element("div");\n\t\t\tkey_block.c();\n\t\t\tdiv1 = element("div");\n\t\t\tbutton = element("button");\n\t\t\tif (if_block) if_block.c();\n\t\t\tattr(button, "class", "bp-x");\n\t\t\tattr(button, "title", "Close");\n\t\t\tattr(button, "aria-label", "Close");\n\t\t\tattr(div1, "class", "bp-controls");\n\t\t\tattr(div2, "class", "bp-wrap");\n\t\t\ttoggle_class(div2, "bp-zoomed", /*$zoomed*/ ctx[10]);\n\t\t\ttoggle_class(div2, "bp-inline", /*inline*/ ctx[8]);\n\t\t\ttoggle_class(div2, "bp-small", /*smallScreen*/ ctx[7]);\n\t\t\ttoggle_class(div2, "bp-noclose", /*opts*/ ctx[5].noClose);\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, div2, anchor);\n\t\t\tappend(div2, div0);\n\t\t\tkey_block.m(div2, null);\n\t\t\tappend(div2, div1);\n\t\t\tappend(div1, button);\n\t\t\tif (if_block) if_block.m(div1, null);\n\t\t\tcurrent = true;\n\n\t\t\tif (!mounted) {\n\t\t\t\tdispose = [\n\t\t\t\t\tlisten(button, "click", /*close*/ ctx[1]),\n\t\t\t\t\taction_destroyer(/*containerActions*/ ctx[14].call(null, div2))\n\t\t\t\t];\n\n\t\t\t\tmounted = true;\n\t\t\t}\n\t\t},\n\t\tp(ctx, dirty) {\n\t\t\tif (dirty[0] & /*activeItem*/ 64 && not_equal(previous_key, previous_key = /*activeItem*/ ctx[6].i)) {\n\t\t\t\tgroup_outros();\n\t\t\t\ttransition_out(key_block, 1, 1, noop);\n\t\t\t\tcheck_outros();\n\t\t\t\tkey_block = create_key_block(ctx);\n\t\t\t\tkey_block.c();\n\t\t\t\ttransition_in(key_block, 1);\n\t\t\t\tkey_block.m(div2, div1);\n\t\t\t} else {\n\t\t\t\tkey_block.p(ctx, dirty);\n\t\t\t}\n\n\t\t\tif (/*items*/ ctx[0].length > 1) {\n\t\t\t\tif (if_block) {\n\t\t\t\t\tif_block.p(ctx, dirty);\n\t\t\t\t} else {\n\t\t\t\t\tif_block = create_if_block_1(ctx);\n\t\t\t\t\tif_block.c();\n\t\t\t\t\tif_block.m(div1, null);\n\t\t\t\t}\n\t\t\t} else if (if_block) {\n\t\t\t\tif_block.d(1);\n\t\t\t\tif_block = null;\n\t\t\t}\n\n\t\t\tif (!current || dirty[0] & /*$zoomed*/ 1024) {\n\t\t\t\ttoggle_class(div2, "bp-zoomed", /*$zoomed*/ ctx[10]);\n\t\t\t}\n\n\t\t\tif (!current || dirty[0] & /*inline*/ 256) {\n\t\t\t\ttoggle_class(div2, "bp-inline", /*inline*/ ctx[8]);\n\t\t\t}\n\n\t\t\tif (!current || dirty[0] & /*smallScreen*/ 128) {\n\t\t\t\ttoggle_class(div2, "bp-small", /*smallScreen*/ ctx[7]);\n\t\t\t}\n\n\t\t\tif (!current || dirty[0] & /*opts*/ 32) {\n\t\t\t\ttoggle_class(div2, "bp-noclose", /*opts*/ ctx[5].noClose);\n\t\t\t}\n\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\tif (div0_outro) div0_outro.end(1);\n\t\t\ttransition_in(key_block);\n\t\t\tif (div1_outro) div1_outro.end(1);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\tif (local) {\n\t\t\t\tdiv0_outro = create_out_transition(div0, fly, { duration: 480 });\n\t\t\t}\n\n\t\t\ttransition_out(key_block);\n\n\t\t\tif (local) {\n\t\t\t\tdiv1_outro = create_out_transition(div1, fly, {});\n\t\t\t}\n\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tif (detaching) detach(div2);\n\t\t\tif (detaching && div0_outro) div0_outro.end();\n\t\t\tkey_block.d(detaching);\n\t\t\tif (if_block) if_block.d();\n\t\t\tif (detaching && div1_outro) div1_outro.end();\n\t\t\tmounted = false;\n\t\t\trun_all(dispose);\n\t\t}\n\t};\n}\n\n// (311:199) {:else}\nfunction create_else_block(ctx) {\n\tlet div;\n\tlet raw_value = (/*activeItem*/ ctx[6].html ?? /*activeItem*/ ctx[6].element.outerHTML) + "";\n\n\treturn {\n\t\tc() {\n\t\t\tdiv = element("div");\n\t\t\tattr(div, "class", "bp-html");\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, div, anchor);\n\t\t\tdiv.innerHTML = raw_value;\n\t\t},\n\t\tp(ctx, dirty) {\n\t\t\tif (dirty[0] & /*activeItem*/ 64 && raw_value !== (raw_value = (/*activeItem*/ ctx[6].html ?? /*activeItem*/ ctx[6].element.outerHTML) + "")) div.innerHTML = raw_value;\t\t},\n\t\ti: noop,\n\t\to: noop,\n\t\td(detaching) {\n\t\t\tif (detaching) detach(div);\n\t\t}\n\t};\n}\n\n// (311:165) \nfunction create_if_block_5(ctx) {\n\tlet iframe;\n\tlet current;\n\n\tiframe = new Iframe({\n\t\t\tprops: { props: /*getChildProps*/ ctx[13]() }\n\t\t});\n\n\treturn {\n\t\tc() {\n\t\t\tcreate_component(iframe.$$.fragment);\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tmount_component(iframe, target, anchor);\n\t\t\tcurrent = true;\n\t\t},\n\t\tp: noop,\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\ttransition_in(iframe.$$.fragment, local);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\ttransition_out(iframe.$$.fragment, local);\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tdestroy_component(iframe, detaching);\n\t\t}\n\t};\n}\n\n// (311:104) \nfunction create_if_block_4(ctx) {\n\tlet video;\n\tlet current;\n\n\tvideo = new Video({\n\t\t\tprops: { props: /*getChildProps*/ ctx[13]() }\n\t\t});\n\n\treturn {\n\t\tc() {\n\t\t\tcreate_component(video.$$.fragment);\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tmount_component(video, target, anchor);\n\t\t\tcurrent = true;\n\t\t},\n\t\tp: noop,\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\ttransition_in(video.$$.fragment, local);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\ttransition_out(video.$$.fragment, local);\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tdestroy_component(video, detaching);\n\t\t}\n\t};\n}\n\n// (311:4) {#if activeItem.img}\nfunction create_if_block_3(ctx) {\n\tlet imageitem;\n\tlet current;\n\n\timageitem = new Image({\n\t\t\tprops: {\n\t\t\t\tprops: /*getChildProps*/ ctx[13](),\n\t\t\t\tsmallScreen: /*smallScreen*/ ctx[7]\n\t\t\t}\n\t\t});\n\n\treturn {\n\t\tc() {\n\t\t\tcreate_component(imageitem.$$.fragment);\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tmount_component(imageitem, target, anchor);\n\t\t\tcurrent = true;\n\t\t},\n\t\tp(ctx, dirty) {\n\t\t\tconst imageitem_changes = {};\n\t\t\tif (dirty[0] & /*smallScreen*/ 128) imageitem_changes.smallScreen = /*smallScreen*/ ctx[7];\n\t\t\timageitem.$set(imageitem_changes);\n\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\ttransition_in(imageitem.$$.fragment, local);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\ttransition_out(imageitem.$$.fragment, local);\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tdestroy_component(imageitem, detaching);\n\t\t}\n\t};\n}\n\n// (311:299) {#if activeItem.caption}\nfunction create_if_block_2(ctx) {\n\tlet div;\n\tlet raw_value = /*activeItem*/ ctx[6].caption + "";\n\tlet div_outro;\n\tlet current;\n\n\treturn {\n\t\tc() {\n\t\t\tdiv = element("div");\n\t\t\tattr(div, "class", "bp-cap");\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, div, anchor);\n\t\t\tdiv.innerHTML = raw_value;\n\t\t\tcurrent = true;\n\t\t},\n\t\tp(ctx, dirty) {\n\t\t\tif ((!current || dirty[0] & /*activeItem*/ 64) && raw_value !== (raw_value = /*activeItem*/ ctx[6].caption + "")) div.innerHTML = raw_value;\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\tif (div_outro) div_outro.end(1);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\tdiv_outro = create_out_transition(div, fly, { duration: 200 });\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tif (detaching) detach(div);\n\t\t\tif (detaching && div_outro) div_outro.end();\n\t\t}\n\t};\n}\n\n// (300:43) {#key activeItem.i}\nfunction create_key_block(ctx) {\n\tlet div;\n\tlet current_block_type_index;\n\tlet if_block0;\n\tlet div_intro;\n\tlet div_outro;\n\tlet if_block1_anchor;\n\tlet current;\n\tlet mounted;\n\tlet dispose;\n\tconst if_block_creators = [create_if_block_3, create_if_block_4, create_if_block_5, create_else_block];\n\tconst if_blocks = [];\n\n\tfunction select_block_type(ctx, dirty) {\n\t\tif (/*activeItem*/ ctx[6].img) return 0;\n\t\tif (/*activeItem*/ ctx[6].sources) return 1;\n\t\tif (/*activeItem*/ ctx[6].iframe) return 2;\n\t\treturn 3;\n\t}\n\n\tcurrent_block_type_index = select_block_type(ctx);\n\tif_block0 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);\n\tlet if_block1 = /*activeItem*/ ctx[6].caption && create_if_block_2(ctx);\n\n\treturn {\n\t\tc() {\n\t\t\tdiv = element("div");\n\t\t\tif_block0.c();\n\t\t\tif (if_block1) if_block1.c();\n\t\t\tif_block1_anchor = empty();\n\t\t\tattr(div, "class", "bp-inner");\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, div, anchor);\n\t\t\tif_blocks[current_block_type_index].m(div, null);\n\t\t\tif (if_block1) if_block1.m(target, anchor);\n\t\t\tinsert(target, if_block1_anchor, anchor);\n\t\t\tcurrent = true;\n\n\t\t\tif (!mounted) {\n\t\t\t\tdispose = [\n\t\t\t\t\tlisten(div, "pointerdown", /*pointerdown_handler*/ ctx[20]),\n\t\t\t\t\tlisten(div, "pointerup", /*pointerup_handler*/ ctx[21])\n\t\t\t\t];\n\n\t\t\t\tmounted = true;\n\t\t\t}\n\t\t},\n\t\tp(ctx, dirty) {\n\t\t\tlet previous_block_index = current_block_type_index;\n\t\t\tcurrent_block_type_index = select_block_type(ctx);\n\n\t\t\tif (current_block_type_index === previous_block_index) {\n\t\t\t\tif_blocks[current_block_type_index].p(ctx, dirty);\n\t\t\t} else {\n\t\t\t\tgroup_outros();\n\n\t\t\t\ttransition_out(if_blocks[previous_block_index], 1, 1, () => {\n\t\t\t\t\tif_blocks[previous_block_index] = null;\n\t\t\t\t});\n\n\t\t\t\tcheck_outros();\n\t\t\t\tif_block0 = if_blocks[current_block_type_index];\n\n\t\t\t\tif (!if_block0) {\n\t\t\t\t\tif_block0 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);\n\t\t\t\t\tif_block0.c();\n\t\t\t\t} else {\n\t\t\t\t\tif_block0.p(ctx, dirty);\n\t\t\t\t}\n\n\t\t\t\ttransition_in(if_block0, 1);\n\t\t\t\tif_block0.m(div, null);\n\t\t\t}\n\n\t\t\tif (/*activeItem*/ ctx[6].caption) {\n\t\t\t\tif (if_block1) {\n\t\t\t\t\tif_block1.p(ctx, dirty);\n\n\t\t\t\t\tif (dirty[0] & /*activeItem*/ 64) {\n\t\t\t\t\t\ttransition_in(if_block1, 1);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif_block1 = create_if_block_2(ctx);\n\t\t\t\t\tif_block1.c();\n\t\t\t\t\ttransition_in(if_block1, 1);\n\t\t\t\t\tif_block1.m(if_block1_anchor.parentNode, if_block1_anchor);\n\t\t\t\t}\n\t\t\t} else if (if_block1) {\n\t\t\t\tgroup_outros();\n\n\t\t\t\ttransition_out(if_block1, 1, 1, () => {\n\t\t\t\t\tif_block1 = null;\n\t\t\t\t});\n\n\t\t\t\tcheck_outros();\n\t\t\t}\n\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\ttransition_in(if_block0);\n\n\t\t\tadd_render_callback(() => {\n\t\t\t\tif (div_outro) div_outro.end(1);\n\t\t\t\tdiv_intro = create_in_transition(div, /*mediaTransition*/ ctx[12], true);\n\t\t\t\tdiv_intro.start();\n\t\t\t});\n\n\t\t\ttransition_in(if_block1);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\ttransition_out(if_block0);\n\t\t\tif (div_intro) div_intro.invalidate();\n\t\t\tdiv_outro = create_out_transition(div, /*mediaTransition*/ ctx[12], false);\n\t\t\ttransition_out(if_block1);\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tif (detaching) detach(div);\n\t\t\tif_blocks[current_block_type_index].d();\n\t\t\tif (detaching && div_outro) div_outro.end();\n\t\t\tif (if_block1) if_block1.d(detaching);\n\t\t\tif (detaching) detach(if_block1_anchor);\n\t\t\tmounted = false;\n\t\t\trun_all(dispose);\n\t\t}\n\t};\n}\n\n// (311:554) {#if items.length > 1}\nfunction create_if_block_1(ctx) {\n\tlet div;\n\tlet raw_value = `${/*position*/ ctx[4] + 1} / ${/*items*/ ctx[0].length}` + "";\n\tlet button0;\n\tlet button1;\n\tlet mounted;\n\tlet dispose;\n\n\treturn {\n\t\tc() {\n\t\t\tdiv = element("div");\n\t\t\tbutton0 = element("button");\n\t\t\tbutton1 = element("button");\n\t\t\tattr(div, "class", "bp-count");\n\t\t\tattr(button0, "class", "bp-prev");\n\t\t\tattr(button0, "title", "Previous");\n\t\t\tattr(button0, "aria-label", "Previous");\n\t\t\tattr(button1, "class", "bp-next");\n\t\t\tattr(button1, "title", "Next");\n\t\t\tattr(button1, "aria-label", "Next");\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, div, anchor);\n\t\t\tdiv.innerHTML = raw_value;\n\t\t\tinsert(target, button0, anchor);\n\t\t\tinsert(target, button1, anchor);\n\n\t\t\tif (!mounted) {\n\t\t\t\tdispose = [\n\t\t\t\t\tlisten(button0, "click", /*prev*/ ctx[2]),\n\t\t\t\t\tlisten(button1, "click", /*next*/ ctx[3])\n\t\t\t\t];\n\n\t\t\t\tmounted = true;\n\t\t\t}\n\t\t},\n\t\tp(ctx, dirty) {\n\t\t\tif (dirty[0] & /*position, items*/ 17 && raw_value !== (raw_value = `${/*position*/ ctx[4] + 1} / ${/*items*/ ctx[0].length}` + "")) div.innerHTML = raw_value;\t\t},\n\t\td(detaching) {\n\t\t\tif (detaching) detach(div);\n\t\t\tif (detaching) detach(button0);\n\t\t\tif (detaching) detach(button1);\n\t\t\tmounted = false;\n\t\t\trun_all(dispose);\n\t\t}\n\t};\n}\n\nfunction create_fragment(ctx) {\n\tlet if_block_anchor;\n\tlet current;\n\tlet if_block = /*items*/ ctx[0] && create_if_block(ctx);\n\n\treturn {\n\t\tc() {\n\t\t\tif (if_block) if_block.c();\n\t\t\tif_block_anchor = empty();\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tif (if_block) if_block.m(target, anchor);\n\t\t\tinsert(target, if_block_anchor, anchor);\n\t\t\tcurrent = true;\n\t\t},\n\t\tp(ctx, dirty) {\n\t\t\tif (/*items*/ ctx[0]) {\n\t\t\t\tif (if_block) {\n\t\t\t\t\tif_block.p(ctx, dirty);\n\n\t\t\t\t\tif (dirty[0] & /*items*/ 1) {\n\t\t\t\t\t\ttransition_in(if_block, 1);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif_block = create_if_block(ctx);\n\t\t\t\t\tif_block.c();\n\t\t\t\t\ttransition_in(if_block, 1);\n\t\t\t\t\tif_block.m(if_block_anchor.parentNode, if_block_anchor);\n\t\t\t\t}\n\t\t\t} else if (if_block) {\n\t\t\t\tgroup_outros();\n\n\t\t\t\ttransition_out(if_block, 1, 1, () => {\n\t\t\t\t\tif_block = null;\n\t\t\t\t});\n\n\t\t\t\tcheck_outros();\n\t\t\t}\n\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\ttransition_in(if_block);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\ttransition_out(if_block);\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tif (if_block) if_block.d(detaching);\n\t\t\tif (detaching) detach(if_block_anchor);\n\t\t}\n\t};\n}\n\nfunction instance($$self, $$props, $$invalidate) {\n\tlet $zoomed;\n\tlet { items = undefined } = $$props;\n\tlet { target = undefined } = $$props;\n\tconst html = document.documentElement;\n\n\t/** index of current active item */\n\tlet position;\n\n\t/** options passed via open method */\n\tlet opts;\n\n\t/** bool tracks open state */\n\tlet isOpen;\n\n\t/** dom element to restore focus to on close */\n\tlet focusTrigger;\n\n\t/** bool true if container width < 769 */\n\tlet smallScreen;\n\n\t/** bool value of inline option passed in open method */\n\tlet inline;\n\n\t/** when position is set */\n\tlet movement;\n\n\t/** stores target on pointerdown (ref for overlay close) */\n\tlet clickedEl;\n\n\t/** active item object */\n\tlet activeItem;\n\n\t/** returns true if `activeItem` is html */\n\tconst activeItemIsHtml = () => !activeItem.img && !activeItem.sources && !activeItem.iframe;\n\n\t/** function set by child component to run when container resized */\n\tlet resizeFunc;\n\n\t/** used by child components to set resize function */\n\tconst setResizeFunc = fn => resizeFunc = fn;\n\n\t/** container element (el) / width (w) / height (h) */\n\tconst container = {};\n\n\t// /** true if image is currently zoomed past starting size */\n\tconst zoomed = writable(0);\n\n\tcomponent_subscribe($$self, zoomed, value => $$invalidate(10, $zoomed = value));\n\n\tconst open = options => {\n\t\t$$invalidate(5, opts = options);\n\t\t$$invalidate(8, inline = opts.inline);\n\n\t\t// add class to hide scroll if not inline gallery\n\t\tif (!inline && html.scrollHeight > html.clientHeight) {\n\t\t\thtml.classList.add(\'bp-lock\');\n\t\t}\n\n\t\t// update trigger element to restore focus\n\t\tfocusTrigger = document.activeElement;\n\n\t\t$$invalidate(19, container.w = target.offsetWidth, container);\n\n\t\t$$invalidate(\n\t\t\t19,\n\t\t\tcontainer.h = target === document.body\n\t\t\t? globalThis.innerHeight\n\t\t\t: target.clientHeight,\n\t\t\tcontainer\n\t\t);\n\n\t\t$$invalidate(7, smallScreen = container.w < 769);\n\t\t$$invalidate(4, position = opts.position || 0);\n\n\t\t// set items\n\t\t$$invalidate(0, items = []);\n\n\t\tfor (let i = 0; i < (opts.items.length || 1); i++) {\n\t\t\tlet item = opts.items[i] || opts.items;\n\n\t\t\tif (\'dataset\' in item) {\n\t\t\t\titems.push({ element: item, i, ...item.dataset });\n\t\t\t} else {\n\t\t\t\titem.i = i;\n\t\t\t\titems.push(item);\n\n\t\t\t\t// set item to element for position check below\n\t\t\t\titem = item.element;\n\t\t\t}\n\n\t\t\t// override gallery position if needed\n\t\t\tif (opts.el && opts.el === item) {\n\t\t\t\t$$invalidate(4, position = i);\n\t\t\t}\n\t\t}\n\t};\n\n\tconst close = () => {\n\t\topts.onClose?.(container.el, activeItem);\n\t\tclosing.set(true);\n\t\t$$invalidate(0, items = null);\n\n\t\t// restore focus to trigger element\n\t\tfocusTrigger?.focus({ preventScroll: true });\n\t};\n\n\tconst prev = () => setPosition(position - 1);\n\tconst next = () => setPosition(position + 1);\n\n\tconst setPosition = index => {\n\t\tmovement = index - position;\n\t\t$$invalidate(4, position = getNextPosition(index));\n\t};\n\n\t/**\n * returns next gallery position (looped if neccessary)\n * @param {number} index\n */\n\tconst getNextPosition = index => (index + items.length) % items.length;\n\n\tconst onKeydown = e => {\n\t\tconst { key, shiftKey } = e;\n\n\t\tif (key === \'Escape\') {\n\t\t\t!opts.noClose && close();\n\t\t} else if (key === \'ArrowRight\') {\n\t\t\tnext();\n\t\t} else if (key === \'ArrowLeft\') {\n\t\t\tprev();\n\t\t} else if (key === \'Tab\') {\n\t\t\t// trap focus on tab press\n\t\t\tconst { activeElement } = document;\n\n\t\t\t// allow browser to handle tab into video controls only\n\t\t\tif (shiftKey || !activeElement.controls) {\n\t\t\t\te.preventDefault();\n\t\t\t\tconst { focusWrap = container.el } = opts;\n\t\t\t\tconst tabbable = [...focusWrap.querySelectorAll(\'*\')].filter(node => node.tabIndex >= 0);\n\t\t\t\tlet index = tabbable.indexOf(activeElement);\n\t\t\t\tindex += tabbable.length + (shiftKey ? -1 : 1);\n\t\t\t\ttabbable[index % tabbable.length].focus();\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n * calculate dimensions of height / width resized to fit within container\n * @param {object} item object with height / width properties\n * @returns {Array} [width: number, height: number]\n */\n\tconst calculateDimensions = ({ width = 1920, height = 1080 }) => {\n\t\tconst { scale = 0.99 } = opts;\n\t\tconst ratio = Math.min(1, container.w / width * scale, container.h / height * scale);\n\n\t\t// round number so we don\'t use a float as the sizes attribute\n\t\treturn [Math.round(width * ratio), Math.round(height * ratio)];\n\t};\n\n\t/** preloads images for previous and next items in gallery */\n\tconst preloadNext = () => {\n\t\tif (items) {\n\t\t\tconst nextItem = items[getNextPosition(position + 1)];\n\t\t\tconst prevItem = items[getNextPosition(position - 1)];\n\t\t\t!nextItem.preload && loadImage(nextItem);\n\t\t\t!prevItem.preload && loadImage(prevItem);\n\t\t}\n\t};\n\n\t/** loads / decodes image for item */\n\tconst loadImage = item => {\n\t\tif (item.img) {\n\t\t\tconst image = document.createElement(\'img\');\n\t\t\timage.sizes = opts.sizes || `${calculateDimensions(item)[0]}px`;\n\t\t\timage.srcset = item.img;\n\t\t\titem.preload = true;\n\n\t\t\treturn image.decode().catch(error => {\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t};\n\n\t/** svelte transition to control opening / changing */\n\tconst mediaTransition = (node, isEntering) => {\n\t\tif (!isOpen || !items) {\n\t\t\t// entrance / exit transition\n\t\t\t$$invalidate(18, isOpen = isEntering);\n\n\t\t\treturn opts.intro\n\t\t\t? fly(node, { y: isEntering ? 10 : -10 })\n\t\t\t: scaleIn(node);\n\t\t}\n\n\t\t// forward / backward transition\n\t\treturn fly(node, {\n\t\t\tx: (movement > 0 ? 20 : -20) * (isEntering ? 1 : -1),\n\t\t\tduration: 250\n\t\t});\n\t};\n\n\t/** custom svelte transition for entrance zoom */\n\tconst scaleIn = node => {\n\t\tlet dimensions;\n\n\t\tif (activeItemIsHtml()) {\n\t\t\tconst bpItem = node.firstChild.firstChild;\n\t\t\tdimensions = [bpItem.clientWidth, bpItem.clientHeight];\n\t\t} else {\n\t\t\tdimensions = calculateDimensions(activeItem);\n\t\t}\n\n\t\t// rect is bounding rect of trigger element\n\t\tconst rect = (activeItem.element || focusTrigger).getBoundingClientRect();\n\n\t\tconst leftOffset = rect.left - (container.w - rect.width) / 2;\n\t\tconst centerTop = rect.top - (container.h - rect.height) / 2;\n\t\tconst scaleWidth = rect.width / dimensions[0];\n\t\tconst scaleHeight = rect.height / dimensions[1];\n\n\t\treturn {\n\t\t\tduration: 480,\n\t\t\teasing: cubicOut,\n\t\t\tcss: (t, u) => {\n\t\t\t\treturn `transform:translate3d(${leftOffset * u}px, ${centerTop * u}px, 0) scale3d(${scaleWidth + t * (1 - scaleWidth)}, ${scaleHeight + t * (1 - scaleHeight)}, 1)`;\n\t\t\t}\n\t\t};\n\t};\n\n\t/** provides object w/ needed funcs / data to child components */\n\tconst getChildProps = () => ({\n\t\tactiveItem,\n\t\tcalculateDimensions,\n\t\tloadImage,\n\t\tpreloadNext,\n\t\topts,\n\t\tprev,\n\t\tnext,\n\t\tclose,\n\t\tsetResizeFunc,\n\t\tzoomed,\n\t\tcontainer\n\t});\n\n\t/** code to run on mount / destroy */\n\tconst containerActions = node => {\n\t\t$$invalidate(19, container.el = node, container);\n\t\tlet roActive;\n\t\topts.onOpen?.(container.el, activeItem);\n\n\t\t// don\'t use keyboard events for inline galleries\n\t\tif (!inline) {\n\t\t\tglobalThis.addEventListener(\'keydown\', onKeydown);\n\t\t}\n\n\t\t// set up resize observer\n\t\tconst ro = new ResizeObserver(entries => {\n\t\t\t\t// use roActive to avoid running on initial open\n\t\t\t\tif (roActive) {\n\t\t\t\t\t$$invalidate(19, container.w = entries[0].contentRect.width, container);\n\t\t\t\t\t$$invalidate(19, container.h = entries[0].contentRect.height, container);\n\t\t\t\t\t$$invalidate(7, smallScreen = container.w < 769);\n\n\t\t\t\t\t// run child component resize function\n\t\t\t\t\tif (!activeItemIsHtml()) {\n\t\t\t\t\t\tresizeFunc?.();\n\t\t\t\t\t}\n\n\t\t\t\t\t// run user defined onResize function\n\t\t\t\t\topts.onResize?.(container.el, activeItem);\n\t\t\t\t}\n\n\t\t\t\troActive = true;\n\t\t\t});\n\n\t\tro.observe(node);\n\n\t\treturn {\n\t\t\tdestroy() {\n\t\t\t\tro.disconnect();\n\t\t\t\tglobalThis.removeEventListener(\'keydown\', onKeydown);\n\t\t\t\tclosing.set(false);\n\n\t\t\t\t// remove class hiding scroll\n\t\t\t\thtml.classList.remove(\'bp-lock\');\n\n\t\t\t\topts.onClosed?.();\n\t\t\t}\n\t\t};\n\t};\n\n\tconst pointerdown_handler = e => $$invalidate(9, clickedEl = e.target);\n\n\tconst pointerup_handler = function (e) {\n\t\t// only close if left click on self and not dragged\n\t\tif (e.button !== 2 && e.target === this && clickedEl === this) {\n\t\t\t!opts.noClose && close();\n\t\t}\n\t};\n\n\t$$self.$$set = $$props => {\n\t\tif (\'items\' in $$props) $$invalidate(0, items = $$props.items);\n\t\tif (\'target\' in $$props) $$invalidate(15, target = $$props.target);\n\t};\n\n\t$$self.$$.update = () => {\n\t\tif ($$self.$$.dirty[0] & /*items, position, isOpen, opts, container, activeItem*/ 786545) {\n\t\t\tif (items) {\n\t\t\t\t// update active item when position changes\n\t\t\t\t$$invalidate(6, activeItem = items[position]);\n\n\t\t\t\tif (isOpen) {\n\t\t\t\t\t// run onUpdate when items updated\n\t\t\t\t\topts.onUpdate?.(container.el, activeItem);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\treturn [\n\t\titems,\n\t\tclose,\n\t\tprev,\n\t\tnext,\n\t\tposition,\n\t\topts,\n\t\tactiveItem,\n\t\tsmallScreen,\n\t\tinline,\n\t\tclickedEl,\n\t\t$zoomed,\n\t\tzoomed,\n\t\tmediaTransition,\n\t\tgetChildProps,\n\t\tcontainerActions,\n\t\ttarget,\n\t\topen,\n\t\tsetPosition,\n\t\tisOpen,\n\t\tcontainer,\n\t\tpointerdown_handler,\n\t\tpointerup_handler\n\t];\n}\n\nclass Bigger_picture extends SvelteComponent {\n\tconstructor(options) {\n\t\tsuper();\n\n\t\tinit(\n\t\t\tthis,\n\t\t\toptions,\n\t\t\tinstance,\n\t\t\tcreate_fragment,\n\t\t\tnot_equal,\n\t\t\t{\n\t\t\t\titems: 0,\n\t\t\t\ttarget: 15,\n\t\t\t\topen: 16,\n\t\t\t\tclose: 1,\n\t\t\t\tprev: 2,\n\t\t\t\tnext: 3,\n\t\t\t\tsetPosition: 17\n\t\t\t},\n\t\t\tnull,\n\t\t\t[-1, -1]\n\t\t);\n\t}\n\n\tget items() {\n\t\treturn this.$$.ctx[0];\n\t}\n\n\n\n\tget target() {\n\t\treturn this.$$.ctx[15];\n\t}\n\n\n\n\tget open() {\n\t\treturn this.$$.ctx[16];\n\t}\n\n\tget close() {\n\t\treturn this.$$.ctx[1];\n\t}\n\n\tget prev() {\n\t\treturn this.$$.ctx[2];\n\t}\n\n\tget next() {\n\t\treturn this.$$.ctx[3];\n\t}\n\n\tget setPosition() {\n\t\treturn this.$$.ctx[17];\n\t}\n}\n\n/**\n * Initializes BiggerPicture\n * @param {{target: HTMLElement}} options\n * @returns BiggerPicture instance\n */\nfunction biggerPicture (options) {\n\treturn new Bigger_picture({\n\t\t...options,\n\t\tprops: options,\n\t})\n}\n\n\n\n\n//# sourceURL=webpack://builder/./node_modules/bigger-picture/dist/bigger-picture.mjs?')}
2},__webpack_module_cache__={};function __webpack_require__(t){var n=__webpack_module_cache__[t];if(void 0!==n)return n.exports;var e=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(e.exports,e,e.exports,__webpack_require__),e.exports}__webpack_require__.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(n,{a:n}),n},__webpack_require__.d=(t,n)=>{for(var e in n)__webpack_require__.o(n,e)&&!__webpack_require__.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},__webpack_require__.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__("./src/js/index.js")})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.