-
Notifications
You must be signed in to change notification settings - Fork 189
/
bundle.js
377 lines (337 loc) · 234 KB
/
bundle.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => {
// webpackBootstrap
/******/ var __webpack_modules__ = {
/***/ "./src/js/index.js":
/*!*************************!*\
!*** ./src/js/index.js ***!
\*************************/
/***/ (
__unused_webpack_module,
__webpack_exports__,
__webpack_require__,
) => {
"use strict";
eval(
"__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_tiny_slider_dist_tiny_slider_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/tiny-slider/dist/tiny-slider.css */ \"./node_modules/tiny-slider/dist/tiny-slider.css\");\n/* harmony import */ var _css_animate_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../css/animate.css */ \"./src/css/animate.css\");\n/* harmony import */ var _css_style_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../css/style.css */ \"./src/css/style.css\");\n/* harmony import */ var _js_typewriter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../js/typewriter */ \"./src/js/typewriter.js\");\n/* harmony import */ var _js_typewriter__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_js_typewriter__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var tiny_slider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! tiny-slider */ \"./node_modules/tiny-slider/dist/tiny-slider.js\");\n/* harmony import */ var isotope_layout__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! isotope-layout */ \"./node_modules/isotope-layout/js/isotope.js\");\n/* harmony import */ var isotope_layout__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(isotope_layout__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var wowjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! wowjs */ \"./node_modules/wowjs/dist/wow.js\");\n/* harmony import */ var wowjs__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(wowjs__WEBPACK_IMPORTED_MODULE_6__);\n\n\n\n\n\n\n\nwindow.wow = new (wowjs__WEBPACK_IMPORTED_MODULE_6___default().WOW)({\n live: false\n});\nwindow.wow.init({\n offset: 50\n});\n\n//========= testimonial\nvar testimonial = document.querySelectorAll('.testimonial-active');\nif (testimonial.length) {\n (0,tiny_slider__WEBPACK_IMPORTED_MODULE_4__.tns)({\n container: '.testimonial-active',\n items: 1,\n slideBy: 'page',\n autoplay: false,\n mouseDrag: true,\n gutter: 0,\n nav: false,\n controlsText: [\"<svg\\n width=\\\"20\\\"\\n height=\\\"20\\\"\\n viewBox=\\\"0 0 20 20\\\"\\n class=\\\"fill-current\\\"\\n >\\n <path\\n d=\\\"M6.52329 10.8331L10.9933 15.3031L9.81496 16.4814L3.3333 9.99978L9.81496 3.51811L10.9933 4.69645L6.52329 9.16645L16.6666 9.16645L16.6666 10.8331L6.52329 10.8331Z\\\"\\n \\n />\\n </svg>\", \"<svg\\n width=\\\"20\\\"\\n height=\\\"20\\\"\\n viewBox=\\\"0 0 20 20\\\"\\n class=\\\"fill-current\\\"\\n >\\n <path\\n d=\\\"M13.4767 9.16689L9.00671 4.69689L10.185 3.51855L16.6667 10.0002L10.185 16.4819L9.00671 15.3036L13.4767 10.8336H3.33337V9.16689H13.4767Z\\\"\\n \\n />\\n </svg>\"]\n });\n}\n\n//============== isotope masonry js\n\nvar elem = document.querySelector('.portfolio-grid');\nvar iso = new (isotope_layout__WEBPACK_IMPORTED_MODULE_5___default())(elem, {\n // options\n itemSelector: '.grid-item',\n masonry: {\n // use outer width of grid-sizer for columnWidth\n columnWidth: '.grid-sizer'\n }\n});\nvar filterButtons = document.querySelectorAll('.portfolio-btn-wrapper button');\nfilterButtons.forEach(function (e) {\n return e.addEventListener('click', function () {\n var filterValue = event.target.getAttribute('data-filter');\n iso.arrange({\n filter: filterValue\n });\n });\n});\n\n//======= portfolio-btn active\nvar elements = document.querySelectorAll('.portfolio-btn-wrapper button');\nfor (var i = 0; i < elements.length; i++) {\n elements[i].onclick = function () {\n // remove class from sibling\n\n var el = elements[0];\n while (el) {\n if (el.tagName === 'BUTTON') {\n //remove class\n el.classList.remove('active');\n }\n // pass to the new sibling\n el = el.nextSibling;\n }\n this.classList.add('active');\n };\n}\n(function () {\n 'use strict';\n\n // ======= Sticky\n window.onscroll = function () {\n var ud_header = document.querySelector('.header');\n var sticky = ud_header.offsetTop;\n if (window.pageYOffset > sticky) {\n ud_header.classList.add('sticky');\n } else {\n ud_header.classList.remove('sticky');\n }\n\n // show or hide the back-top-top button\n var backToTop = document.querySelector('.back-to-top');\n if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {\n backToTop.style.display = 'flex';\n } else {\n backToTop.style.display = 'none';\n }\n };\n\n // Mobile Menu\n var menuToggler = document.querySelector('.menu-toggler');\n var menuWrapper = document.querySelector('.menu-wrapper');\n menuToggler.addEventListener('click', function () {\n menuWrapper.classList.toggle('show');\n document.body.classList.toggle('overflow-y-hidden');\n menuToggler.querySelector('.cross').classList.toggle('hidden');\n menuToggler.querySelector('.menu').classList.toggle('hidden');\n });\n\n //===== close navbar-collapse when a clicked\n document.querySelectorAll('.navbar li:not(.submenu-item) a').forEach(function (e) {\n return e.addEventListener('click', function () {\n menuWrapper.classList.toggle('show');\n document.body.classList.toggle('overflow-y-hidden');\n menuToggler.querySelector('.cross').classList.toggle('hidden');\n menuToggler.querySelector('.menu').classList.toggle('hidden');\n });\n });\n\n // ===== Sub-menu\n var submenuItems = document.querySelectorAll('.submenu-item');\n submenuItems.forEach(function (el) {\n el.querySelector('a').addEventListener('click', function () {\n el.querySelector('a').classList.toggle('active');\n el.querySelector('.submenu').classList.toggle('hidden');\n });\n });\n\n // ====== scroll top js\n function scrollTo(element) {\n var to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 500;\n var start = element.scrollTop;\n var change = to - start;\n var increment = 20;\n var currentTime = 0;\n var animateScroll = function animateScroll() {\n currentTime += increment;\n var val = Math.easeInOutQuad(currentTime, start, change, duration);\n element.scrollTop = val;\n if (currentTime < duration) {\n setTimeout(animateScroll, increment);\n }\n };\n animateScroll();\n }\n Math.easeInOutQuad = function (t, b, c, d) {\n t /= d / 2;\n if (t < 1) return c / 2 * t * t + b;\n t--;\n return -c / 2 * (t * (t - 2) - 1) + b;\n };\n document.querySelector('.back-to-top').onclick = function () {\n scrollTo(document.documentElement);\n };\n})();\n\n// Document Loaded\ndocument.addEventListener('DOMContentLoaded', function () {\n // ==== darkToggler\n var darkTogglerCheckbox = document.querySelector('#darkToggler');\n var html = document.querySelector('html');\n var darkModeToggler = function darkModeToggler() {\n darkTogglerCheckbox.checked ? html.classList.remove('dark') : html.classList.add('dark');\n };\n darkModeToggler();\n darkTogglerCheckbox.addEventListener('click', darkModeToggler);\n});\n\n//# sourceURL=webpack://gotw/./src/js/index.js?",
);
/***/
},
/***/ "./src/js/typewriter.js":
/*!******************************!*\
!*** ./src/js/typewriter.js ***!
\******************************/
/***/ () => {
eval(
'function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }\n// ES6 Class\nvar TypeWriter = /*#__PURE__*/function () {\n function TypeWriter(txtElement, words) {\n var wait = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3000;\n _classCallCheck(this, TypeWriter);\n this.txtElement = txtElement;\n this.words = words;\n this.txt = "";\n this.wordIndex = 0;\n this.wait = parseInt(wait, 10);\n this.type();\n this.isDeleting = false;\n }\n _createClass(TypeWriter, [{\n key: "type",\n value: function type() {\n var _this = this;\n // Current index of word\n var current = this.wordIndex % this.words.length;\n // Get full text of current word\n var fullTxt = this.words[current];\n\n // Check if deleting\n if (this.isDeleting) {\n // Remove char\n this.txt = fullTxt.substring(0, this.txt.length - 1);\n } else {\n // Add char\n this.txt = fullTxt.substring(0, this.txt.length + 1);\n }\n\n // Insert txt into element\n this.txtElement.innerHTML = "<span class=\\"txt\\">".concat(this.txt, "</span>");\n\n // Initial Type Speed\n var typeSpeed = 300;\n if (this.isDeleting) {\n typeSpeed /= 2;\n }\n\n // If word is complete\n if (!this.isDeleting && this.txt === fullTxt) {\n // Make pause at end\n typeSpeed = this.wait;\n // Set delete to true\n this.isDeleting = true;\n } else if (this.isDeleting && this.txt === "") {\n this.isDeleting = false;\n // Move to next word\n this.wordIndex++;\n // Pause before start typing\n typeSpeed = 500;\n }\n setTimeout(function () {\n return _this.type();\n }, typeSpeed);\n }\n }]);\n return TypeWriter;\n}(); // Init On DOM Load\ndocument.addEventListener("DOMContentLoaded", init);\n\n// Init App\nfunction init() {\n var txtElement = document.querySelectorAll(".txt-type");\n if (txtElement.length) {\n var _txtElement = document.querySelector(\'.txt-type\');\n var words = JSON.parse(_txtElement.getAttribute("data-words"));\n var wait = _txtElement.getAttribute("data-wait");\n // Init TypeWriter\n new TypeWriter(_txtElement, words, wait);\n }\n}\n\n//# sourceURL=webpack://gotw/./src/js/typewriter.js?',
);
/***/
},
/***/ "./node_modules/desandro-matches-selector/matches-selector.js":
/*!********************************************************************!*\
!*** ./node_modules/desandro-matches-selector/matches-selector.js ***!
\********************************************************************/
/***/ (module, exports, __webpack_require__) => {
eval(
"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**\n * matchesSelector v2.0.2\n * matchesSelector( element, '.selector' )\n * MIT license\n */\n\n/*jshint browser: true, strict: true, undef: true, unused: true */\n\n( function( window, factory ) {\n /*global define: false, module: false */\n 'use strict';\n // universal module definition\n if ( true ) {\n // AMD\n !(__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__));\n } else {}\n\n}( window, function factory() {\n 'use strict';\n\n var matchesMethod = ( function() {\n var ElemProto = window.Element.prototype;\n // check for the standard method name first\n if ( ElemProto.matches ) {\n return 'matches';\n }\n // check un-prefixed\n if ( ElemProto.matchesSelector ) {\n return 'matchesSelector';\n }\n // check vendor prefixes\n var prefixes = [ 'webkit', 'moz', 'ms', 'o' ];\n\n for ( var i=0; i < prefixes.length; i++ ) {\n var prefix = prefixes[i];\n var method = prefix + 'MatchesSelector';\n if ( ElemProto[ method ] ) {\n return method;\n }\n }\n })();\n\n return function matchesSelector( elem, selector ) {\n return elem[ matchesMethod ]( selector );\n };\n\n}));\n\n\n//# sourceURL=webpack://gotw/./node_modules/desandro-matches-selector/matches-selector.js?",
);
/***/
},
/***/ "./node_modules/ev-emitter/ev-emitter.js":
/*!***********************************************!*\
!*** ./node_modules/ev-emitter/ev-emitter.js ***!
\***********************************************/
/***/ function (module, exports, __webpack_require__) {
eval(
"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**\n * EvEmitter v1.1.0\n * Lil' event emitter\n * MIT License\n */\n\n/* jshint unused: true, undef: true, strict: true */\n\n( function( global, factory ) {\n // universal module definition\n /* jshint strict: false */ /* globals define, module, window */\n if ( true ) {\n // AMD - RequireJS\n !(__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__));\n } else {}\n\n}( typeof window != 'undefined' ? window : this, function() {\n\n\"use strict\";\n\nfunction EvEmitter() {}\n\nvar proto = EvEmitter.prototype;\n\nproto.on = function( eventName, listener ) {\n if ( !eventName || !listener ) {\n return;\n }\n // set events hash\n var events = this._events = this._events || {};\n // set listeners array\n var listeners = events[ eventName ] = events[ eventName ] || [];\n // only add once\n if ( listeners.indexOf( listener ) == -1 ) {\n listeners.push( listener );\n }\n\n return this;\n};\n\nproto.once = function( eventName, listener ) {\n if ( !eventName || !listener ) {\n return;\n }\n // add event\n this.on( eventName, listener );\n // set once flag\n // set onceEvents hash\n var onceEvents = this._onceEvents = this._onceEvents || {};\n // set onceListeners object\n var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};\n // set flag\n onceListeners[ listener ] = true;\n\n return this;\n};\n\nproto.off = function( eventName, listener ) {\n var listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) {\n return;\n }\n var index = listeners.indexOf( listener );\n if ( index != -1 ) {\n listeners.splice( index, 1 );\n }\n\n return this;\n};\n\nproto.emitEvent = function( eventName, args ) {\n var listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) {\n return;\n }\n // copy over to avoid interference if .off() in listener\n listeners = listeners.slice(0);\n args = args || [];\n // once stuff\n var onceListeners = this._onceEvents && this._onceEvents[ eventName ];\n\n for ( var i=0; i < listeners.length; i++ ) {\n var listener = listeners[i]\n var isOnce = onceListeners && onceListeners[ listener ];\n if ( isOnce ) {\n // remove listener\n // remove before trigger to prevent recursion\n this.off( eventName, listener );\n // unset once flag\n delete onceListeners[ listener ];\n }\n // trigger listener\n listener.apply( this, args );\n }\n\n return this;\n};\n\nproto.allOff = function() {\n delete this._events;\n delete this._onceEvents;\n};\n\nreturn EvEmitter;\n\n}));\n\n\n//# sourceURL=webpack://gotw/./node_modules/ev-emitter/ev-emitter.js?",
);
/***/
},
/***/ "./node_modules/fizzy-ui-utils/utils.js":
/*!**********************************************!*\
!*** ./node_modules/fizzy-ui-utils/utils.js ***!
\**********************************************/
/***/ (module, exports, __webpack_require__) => {
eval(
"var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/**\n * Fizzy UI utils v2.0.7\n * MIT license\n */\n\n/*jshint browser: true, undef: true, unused: true, strict: true */\n\n( function( window, factory ) {\n // universal module definition\n /*jshint strict: false */ /*globals define, module, require */\n\n if ( true ) {\n // AMD\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n __webpack_require__(/*! desandro-matches-selector/matches-selector */ \"./node_modules/desandro-matches-selector/matches-selector.js\")\n ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( matchesSelector ) {\n return factory( window, matchesSelector );\n }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n\n}( window, function factory( window, matchesSelector ) {\n\n'use strict';\n\nvar utils = {};\n\n// ----- extend ----- //\n\n// extends objects\nutils.extend = function( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n};\n\n// ----- modulo ----- //\n\nutils.modulo = function( num, div ) {\n return ( ( num % div ) + div ) % div;\n};\n\n// ----- makeArray ----- //\n\nvar arraySlice = Array.prototype.slice;\n\n// turn element or nodeList into an array\nutils.makeArray = function( obj ) {\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n return obj;\n }\n // return empty array if undefined or null. #6\n if ( obj === null || obj === undefined ) {\n return [];\n }\n\n var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n if ( isArrayLike ) {\n // convert nodeList to array\n return arraySlice.call( obj );\n }\n\n // array of single index\n return [ obj ];\n};\n\n// ----- removeFrom ----- //\n\nutils.removeFrom = function( ary, obj ) {\n var index = ary.indexOf( obj );\n if ( index != -1 ) {\n ary.splice( index, 1 );\n }\n};\n\n// ----- getParent ----- //\n\nutils.getParent = function( elem, selector ) {\n while ( elem.parentNode && elem != document.body ) {\n elem = elem.parentNode;\n if ( matchesSelector( elem, selector ) ) {\n return elem;\n }\n }\n};\n\n// ----- getQueryElement ----- //\n\n// use element as selector string\nutils.getQueryElement = function( elem ) {\n if ( typeof elem == 'string' ) {\n return document.querySelector( elem );\n }\n return elem;\n};\n\n// ----- handleEvent ----- //\n\n// enable .ontype to trigger from .addEventListener( elem, 'type' )\nutils.handleEvent = function( event ) {\n var method = 'on' + event.type;\n if ( this[ method ] ) {\n this[ method ]( event );\n }\n};\n\n// ----- filterFindElements ----- //\n\nutils.filterFindElements = function( elems, selector ) {\n // make array of elems\n elems = utils.makeArray( elems );\n var ffElems = [];\n\n elems.forEach( function( elem ) {\n // check that elem is an actual element\n if ( !( elem instanceof HTMLElement ) ) {\n return;\n }\n // add elem if no selector\n if ( !selector ) {\n ffElems.push( elem );\n return;\n }\n // filter & find items if we have a selector\n // filter\n if ( matchesSelector( elem, selector ) ) {\n ffElems.push( elem );\n }\n // find children\n var childElems = elem.querySelectorAll( selector );\n // concat childElems to filterFound array\n for ( var i=0; i < childElems.length; i++ ) {\n ffElems.push( childElems[i] );\n }\n });\n\n return ffElems;\n};\n\n// ----- debounceMethod ----- //\n\nutils.debounceMethod = function( _class, methodName, threshold ) {\n threshold = threshold || 100;\n // original method\n var method = _class.prototype[ methodName ];\n var timeoutName = methodName + 'Timeout';\n\n _class.prototype[ methodName ] = function() {\n var timeout = this[ timeoutName ];\n clearTimeout( timeout );\n\n var args = arguments;\n var _this = this;\n this[ timeoutName ] = setTimeout( function() {\n method.apply( _this, args );\n delete _this[ timeoutName ];\n }, threshold );\n };\n};\n\n// ----- docReady ----- //\n\nutils.docReady = function( callback ) {\n var readyState = document.readyState;\n if ( readyState == 'complete' || readyState == 'interactive' ) {\n // do async to allow for other scripts to run. metafizzy/flickity#441\n setTimeout( callback );\n } else {\n document.addEventListener( 'DOMContentLoaded', callback );\n }\n};\n\n// ----- htmlInit ----- //\n\n// http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/\nutils.toDashed = function( str ) {\n return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) {\n return $1 + '-' + $2;\n }).toLowerCase();\n};\n\nvar console = window.console;\n/**\n * allow user to initialize classes via [data-namespace] or .js-namespace class\n * htmlInit( Widget, 'widgetName' )\n * options are parsed from data-namespace-options\n */\nutils.htmlInit = function( WidgetClass, namespace ) {\n utils.docReady( function() {\n var dashedNamespace = utils.toDashed( namespace );\n var dataAttr = 'data-' + dashedNamespace;\n var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' );\n var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace );\n var elems = utils.makeArray( dataAttrElems )\n .concat( utils.makeArray( jsDashElems ) );\n var dataOptionsAttr = dataAttr + '-options';\n var jQuery = window.jQuery;\n\n elems.forEach( function( elem ) {\n var attr = elem.getAttribute( dataAttr ) ||\n elem.getAttribute( dataOptionsAttr );\n var options;\n try {\n options = attr && JSON.parse( attr );\n } catch ( error ) {\n // log error, do not initialize\n if ( console ) {\n console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className +\n ': ' + error );\n }\n return;\n }\n // initialize\n var instance = new WidgetClass( elem, options );\n // make available via $().data('namespace')\n if ( jQuery ) {\n jQuery.data( elem, namespace, instance );\n }\n });\n\n });\n};\n\n// ----- ----- //\n\nreturn utils;\n\n}));\n\n\n//# sourceURL=webpack://gotw/./node_modules/fizzy-ui-utils/utils.js?",
);
/***/
},
/***/ "./node_modules/get-size/get-size.js":
/*!*******************************************!*\
!*** ./node_modules/get-size/get-size.js ***!
\*******************************************/
/***/ (module, exports, __webpack_require__) => {
eval(
"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * getSize v2.0.3\n * measure size of elements\n * MIT license\n */\n\n/* jshint browser: true, strict: true, undef: true, unused: true */\n/* globals console: false */\n\n( function( window, factory ) {\n /* jshint strict: false */ /* globals define, module */\n if ( true ) {\n // AMD\n !(__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__));\n } else {}\n\n})( window, function factory() {\n'use strict';\n\n// -------------------------- helpers -------------------------- //\n\n// get a number from a string, not a percentage\nfunction getStyleSize( value ) {\n var num = parseFloat( value );\n // not a percent like '100%', and a number\n var isValid = value.indexOf('%') == -1 && !isNaN( num );\n return isValid && num;\n}\n\nfunction noop() {}\n\nvar logError = typeof console == 'undefined' ? noop :\n function( message ) {\n console.error( message );\n };\n\n// -------------------------- measurements -------------------------- //\n\nvar measurements = [\n 'paddingLeft',\n 'paddingRight',\n 'paddingTop',\n 'paddingBottom',\n 'marginLeft',\n 'marginRight',\n 'marginTop',\n 'marginBottom',\n 'borderLeftWidth',\n 'borderRightWidth',\n 'borderTopWidth',\n 'borderBottomWidth'\n];\n\nvar measurementsLength = measurements.length;\n\nfunction getZeroSize() {\n var size = {\n width: 0,\n height: 0,\n innerWidth: 0,\n innerHeight: 0,\n outerWidth: 0,\n outerHeight: 0\n };\n for ( var i=0; i < measurementsLength; i++ ) {\n var measurement = measurements[i];\n size[ measurement ] = 0;\n }\n return size;\n}\n\n// -------------------------- getStyle -------------------------- //\n\n/**\n * getStyle, get style of element, check for Firefox bug\n * https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n */\nfunction getStyle( elem ) {\n var style = getComputedStyle( elem );\n if ( !style ) {\n logError( 'Style returned ' + style +\n '. Are you running this code in a hidden iframe on Firefox? ' +\n 'See https://bit.ly/getsizebug1' );\n }\n return style;\n}\n\n// -------------------------- setup -------------------------- //\n\nvar isSetup = false;\n\nvar isBoxSizeOuter;\n\n/**\n * setup\n * check isBoxSizerOuter\n * do on first getSize() rather than on page load for Firefox bug\n */\nfunction setup() {\n // setup once\n if ( isSetup ) {\n return;\n }\n isSetup = true;\n\n // -------------------------- box sizing -------------------------- //\n\n /**\n * Chrome & Safari measure the outer-width on style.width on border-box elems\n * IE11 & Firefox<29 measures the inner-width\n */\n var div = document.createElement('div');\n div.style.width = '200px';\n div.style.padding = '1px 2px 3px 4px';\n div.style.borderStyle = 'solid';\n div.style.borderWidth = '1px 2px 3px 4px';\n div.style.boxSizing = 'border-box';\n\n var body = document.body || document.documentElement;\n body.appendChild( div );\n var style = getStyle( div );\n // round value for browser zoom. desandro/masonry#928\n isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;\n getSize.isBoxSizeOuter = isBoxSizeOuter;\n\n body.removeChild( div );\n}\n\n// -------------------------- getSize -------------------------- //\n\nfunction getSize( elem ) {\n setup();\n\n // use querySeletor if elem is string\n if ( typeof elem == 'string' ) {\n elem = document.querySelector( elem );\n }\n\n // do not proceed on non-objects\n if ( !elem || typeof elem != 'object' || !elem.nodeType ) {\n return;\n }\n\n var style = getStyle( elem );\n\n // if hidden, everything is 0\n if ( style.display == 'none' ) {\n return getZeroSize();\n }\n\n var size = {};\n size.width = elem.offsetWidth;\n size.height = elem.offsetHeight;\n\n var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box';\n\n // get all measurements\n for ( var i=0; i < measurementsLength; i++ ) {\n var measurement = measurements[i];\n var value = style[ measurement ];\n var num = parseFloat( value );\n // any 'auto', 'medium' value will be 0\n size[ measurement ] = !isNaN( num ) ? num : 0;\n }\n\n var paddingWidth = size.paddingLeft + size.paddingRight;\n var paddingHeight = size.paddingTop + size.paddingBottom;\n var marginWidth = size.marginLeft + size.marginRight;\n var marginHeight = size.marginTop + size.marginBottom;\n var borderWidth = size.borderLeftWidth + size.borderRightWidth;\n var borderHeight = size.borderTopWidth + size.borderBottomWidth;\n\n var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter;\n\n // overwrite width and height if we can get it from style\n var styleWidth = getStyleSize( style.width );\n if ( styleWidth !== false ) {\n size.width = styleWidth +\n // add padding and border unless it's already including it\n ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth );\n }\n\n var styleHeight = getStyleSize( style.height );\n if ( styleHeight !== false ) {\n size.height = styleHeight +\n // add padding and border unless it's already including it\n ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight );\n }\n\n size.innerWidth = size.width - ( paddingWidth + borderWidth );\n size.innerHeight = size.height - ( paddingHeight + borderHeight );\n\n size.outerWidth = size.width + marginWidth;\n size.outerHeight = size.height + marginHeight;\n\n return size;\n}\n\nreturn getSize;\n\n});\n\n\n//# sourceURL=webpack://gotw/./node_modules/get-size/get-size.js?",
);
/***/
},
/***/ "./node_modules/isotope-layout/js/isotope.js":
/*!***************************************************!*\
!*** ./node_modules/isotope-layout/js/isotope.js ***!
\***************************************************/
/***/ (module, exports, __webpack_require__) => {
eval(
"var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * Isotope v3.0.6\n *\n * Licensed GPLv3 for open source use\n * or Isotope Commercial License for commercial use\n *\n * https://isotope.metafizzy.co\n * Copyright 2010-2018 Metafizzy\n */\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /*globals define, module, require */\n if ( true ) {\n // AMD\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n __webpack_require__(/*! outlayer/outlayer */ \"./node_modules/outlayer/outlayer.js\"),\n __webpack_require__(/*! get-size/get-size */ \"./node_modules/get-size/get-size.js\"),\n __webpack_require__(/*! desandro-matches-selector/matches-selector */ \"./node_modules/desandro-matches-selector/matches-selector.js\"),\n __webpack_require__(/*! fizzy-ui-utils/utils */ \"./node_modules/fizzy-ui-utils/utils.js\"),\n __webpack_require__(/*! ./item */ \"./node_modules/isotope-layout/js/item.js\"),\n __webpack_require__(/*! ./layout-mode */ \"./node_modules/isotope-layout/js/layout-mode.js\"),\n // include default layout modes\n __webpack_require__(/*! ./layout-modes/masonry */ \"./node_modules/isotope-layout/js/layout-modes/masonry.js\"),\n __webpack_require__(/*! ./layout-modes/fit-rows */ \"./node_modules/isotope-layout/js/layout-modes/fit-rows.js\"),\n __webpack_require__(/*! ./layout-modes/vertical */ \"./node_modules/isotope-layout/js/layout-modes/vertical.js\")\n ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( Outlayer, getSize, matchesSelector, utils, Item, LayoutMode ) {\n return factory( window, Outlayer, getSize, matchesSelector, utils, Item, LayoutMode );\n }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n\n}( window, function factory( window, Outlayer, getSize, matchesSelector, utils,\n Item, LayoutMode ) {\n\n'use strict';\n\n// -------------------------- vars -------------------------- //\n\nvar jQuery = window.jQuery;\n\n// -------------------------- helpers -------------------------- //\n\nvar trim = String.prototype.trim ?\n function( str ) {\n return str.trim();\n } :\n function( str ) {\n return str.replace( /^\\s+|\\s+$/g, '' );\n };\n\n// -------------------------- isotopeDefinition -------------------------- //\n\n // create an Outlayer layout class\n var Isotope = Outlayer.create( 'isotope', {\n layoutMode: 'masonry',\n isJQueryFiltering: true,\n sortAscending: true\n });\n\n Isotope.Item = Item;\n Isotope.LayoutMode = LayoutMode;\n\n var proto = Isotope.prototype;\n\n proto._create = function() {\n this.itemGUID = 0;\n // functions that sort items\n this._sorters = {};\n this._getSorters();\n // call super\n Outlayer.prototype._create.call( this );\n\n // create layout modes\n this.modes = {};\n // start filteredItems with all items\n this.filteredItems = this.items;\n // keep of track of sortBys\n this.sortHistory = [ 'original-order' ];\n // create from registered layout modes\n for ( var name in LayoutMode.modes ) {\n this._initLayoutMode( name );\n }\n };\n\n proto.reloadItems = function() {\n // reset item ID counter\n this.itemGUID = 0;\n // call super\n Outlayer.prototype.reloadItems.call( this );\n };\n\n proto._itemize = function() {\n var items = Outlayer.prototype._itemize.apply( this, arguments );\n // assign ID for original-order\n for ( var i=0; i < items.length; i++ ) {\n var item = items[i];\n item.id = this.itemGUID++;\n }\n this._updateItemsSortData( items );\n return items;\n };\n\n\n // -------------------------- layout -------------------------- //\n\n proto._initLayoutMode = function( name ) {\n var Mode = LayoutMode.modes[ name ];\n // set mode options\n // HACK extend initial options, back-fill in default options\n var initialOpts = this.options[ name ] || {};\n this.options[ name ] = Mode.options ?\n utils.extend( Mode.options, initialOpts ) : initialOpts;\n // init layout mode instance\n this.modes[ name ] = new Mode( this );\n };\n\n\n proto.layout = function() {\n // if first time doing layout, do all magic\n if ( !this._isLayoutInited && this._getOption('initLayout') ) {\n this.arrange();\n return;\n }\n this._layout();\n };\n\n // private method to be used in layout() & magic()\n proto._layout = function() {\n // don't animate first layout\n var isInstant = this._getIsInstant();\n // layout flow\n this._resetLayout();\n this._manageStamps();\n this.layoutItems( this.filteredItems, isInstant );\n\n // flag for initalized\n this._isLayoutInited = true;\n };\n\n // filter + sort + layout\n proto.arrange = function( opts ) {\n // set any options pass\n this.option( opts );\n this._getIsInstant();\n // filter, sort, and layout\n\n // filter\n var filtered = this._filter( this.items );\n this.filteredItems = filtered.matches;\n\n this._bindArrangeComplete();\n\n if ( this._isInstant ) {\n this._noTransition( this._hideReveal, [ filtered ] );\n } else {\n this._hideReveal( filtered );\n }\n\n this._sort();\n this._layout();\n };\n // alias to _init for main plugin method\n proto._init = proto.arrange;\n\n proto._hideReveal = function( filtered ) {\n this.reveal( filtered.needReveal );\n this.hide( filtered.needHide );\n };\n\n // HACK\n // Don't animate/transition first layout\n // Or don't animate/transition other layouts\n proto._getIsInstant = function() {\n var isLayoutInstant = this._getOption('layoutInstant');\n var isInstant = isLayoutInstant !== undefined ? isLayoutInstant :\n !this._isLayoutInited;\n this._isInstant = isInstant;\n return isInstant;\n };\n\n // listen for layoutComplete, hideComplete and revealComplete\n // to trigger arrangeComplete\n proto._bindArrangeComplete = function() {\n // listen for 3 events to trigger arrangeComplete\n var isLayoutComplete, isHideComplete, isRevealComplete;\n var _this = this;\n function arrangeParallelCallback() {\n if ( isLayoutComplete && isHideComplete && isRevealComplete ) {\n _this.dispatchEvent( 'arrangeComplete', null, [ _this.filteredItems ] );\n }\n }\n this.once( 'layoutComplete', function() {\n isLayoutComplete = true;\n arrangeParallelCallback();\n });\n this.once( 'hideComplete', function() {\n isHideComplete = true;\n arrangeParallelCallback();\n });\n this.once( 'revealComplete', function() {\n isRevealComplete = true;\n arrangeParallelCallback();\n });\n };\n\n // -------------------------- filter -------------------------- //\n\n proto._filter = function( items ) {\n var filter = this.options.filter;\n filter = filter || '*';\n var matches = [];\n var hiddenMatched = [];\n var visibleUnmatched = [];\n\n var test = this._getFilterTest( filter );\n\n // test each item\n for ( var i=0; i < items.length; i++ ) {\n var item = items[i];\n if ( item.isIgnored ) {\n continue;\n }\n // add item to either matched or unmatched group\n var isMatched = test( item );\n // item.isFilterMatched = isMatched;\n // add to matches if its a match\n if ( isMatched ) {\n matches.push( item );\n }\n // add to additional group if item needs to be hidden or revealed\n if ( isMatched && item.isHidden ) {\n hiddenMatched.push( item );\n } else if ( !isMatched && !item.isHidden ) {\n visibleUnmatched.push( item );\n }\n }\n\n // return collections of items to be manipulated\n return {\n matches: matches,\n needReveal: hiddenMatched,\n needHide: visibleUnmatched\n };\n };\n\n // get a jQuery, function, or a matchesSelector test given the filter\n proto._getFilterTest = function( filter ) {\n if ( jQuery && this.options.isJQueryFiltering ) {\n // use jQuery\n return function( item ) {\n return jQuery( item.element ).is( filter );\n };\n }\n if ( typeof filter == 'function' ) {\n // use filter as function\n return function( item ) {\n return filter( item.element );\n };\n }\n // default, use filter as selector string\n return function( item ) {\n return matchesSelector( item.element, filter );\n };\n };\n\n // -------------------------- sorting -------------------------- //\n\n /**\n * @params {Array} elems\n * @public\n */\n proto.updateSortData = function( elems ) {\n // get items\n var items;\n if ( elems ) {\n elems = utils.makeArray( elems );\n items = this.getItems( elems );\n } else {\n // update all items if no elems provided\n items = this.items;\n }\n\n this._getSorters();\n this._updateItemsSortData( items );\n };\n\n proto._getSorters = function() {\n var getSortData = this.options.getSortData;\n for ( var key in getSortData ) {\n var sorter = getSortData[ key ];\n this._sorters[ key ] = mungeSorter( sorter );\n }\n };\n\n /**\n * @params {Array} items - of Isotope.Items\n * @private\n */\n proto._updateItemsSortData = function( items ) {\n // do not update if no items\n var len = items && items.length;\n\n for ( var i=0; len && i < len; i++ ) {\n var item = items[i];\n item.updateSortData();\n }\n };\n\n // ----- munge sorter ----- //\n\n // encapsulate this, as we just need mungeSorter\n // other functions in here are just for munging\n var mungeSorter = ( function() {\n // add a magic layer to sorters for convienent shorthands\n // `.foo-bar` will use the text of .foo-bar querySelector\n // `[foo-bar]` will use attribute\n // you can also add parser\n // `.foo-bar parseInt` will parse that as a number\n function mungeSorter( sorter ) {\n // if not a string, return function or whatever it is\n if ( typeof sorter != 'string' ) {\n return sorter;\n }\n // parse the sorter string\n var args = trim( sorter ).split(' ');\n var query = args[0];\n // check if query looks like [an-attribute]\n var attrMatch = query.match( /^\\[(.+)\\]$/ );\n var attr = attrMatch && attrMatch[1];\n var getValue = getValueGetter( attr, query );\n // use second argument as a parser\n var parser = Isotope.sortDataParsers[ args[1] ];\n // parse the value, if there was a parser\n sorter = parser ? function( elem ) {\n return elem && parser( getValue( elem ) );\n } :\n // otherwise just return value\n function( elem ) {\n return elem && getValue( elem );\n };\n\n return sorter;\n }\n\n // get an attribute getter, or get text of the querySelector\n function getValueGetter( attr, query ) {\n // if query looks like [foo-bar], get attribute\n if ( attr ) {\n return function getAttribute( elem ) {\n return elem.getAttribute( attr );\n };\n }\n\n // otherwise, assume its a querySelector, and get its text\n return function getChildText( elem ) {\n var child = elem.querySelector( query );\n return child && child.textContent;\n };\n }\n\n return mungeSorter;\n })();\n\n // parsers used in getSortData shortcut strings\n Isotope.sortDataParsers = {\n 'parseInt': function( val ) {\n return parseInt( val, 10 );\n },\n 'parseFloat': function( val ) {\n return parseFloat( val );\n }\n };\n\n // ----- sort method ----- //\n\n // sort filteredItem order\n proto._sort = function() {\n if ( !this.options.sortBy ) {\n return;\n }\n // keep track of sortBy History\n var sortBys = utils.makeArray( this.options.sortBy );\n if ( !this._getIsSameSortBy( sortBys ) ) {\n // concat all sortBy and sortHistory, add to front, oldest goes in last\n this.sortHistory = sortBys.concat( this.sortHistory );\n }\n // sort magic\n var itemSorter = getItemSorter( this.sortHistory, this.options.sortAscending );\n this.filteredItems.sort( itemSorter );\n };\n\n // check if sortBys is same as start of sortHistory\n proto._getIsSameSortBy = function( sortBys ) {\n for ( var i=0; i < sortBys.length; i++ ) {\n if ( sortBys[i] != this.sortHistory[i] ) {\n return false;\n }\n }\n return true;\n };\n\n // returns a function used for sorting\n function getItemSorter( sortBys, sortAsc ) {\n return function sorter( itemA, itemB ) {\n // cycle through all sortKeys\n for ( var i = 0; i < sortBys.length; i++ ) {\n var sortBy = sortBys[i];\n var a = itemA.sortData[ sortBy ];\n var b = itemB.sortData[ sortBy ];\n if ( a > b || a < b ) {\n // if sortAsc is an object, use the value given the sortBy key\n var isAscending = sortAsc[ sortBy ] !== undefined ? sortAsc[ sortBy ] : sortAsc;\n var direction = isAscending ? 1 : -1;\n return ( a > b ? 1 : -1 ) * direction;\n }\n }\n return 0;\n };\n }\n\n // -------------------------- methods -------------------------- //\n\n // get layout mode\n proto._mode = function() {\n var layoutMode = this.options.layoutMode;\n var mode = this.modes[ layoutMode ];\n if ( !mode ) {\n // TODO console.error\n throw new Error( 'No layout mode: ' + layoutMode );\n }\n // HACK sync mode's options\n // any options set after init for layout mode need to be synced\n mode.options = this.options[ layoutMode ];\n return mode;\n };\n\n proto._resetLayout = function() {\n // trigger original reset layout\n Outlayer.prototype._resetLayout.call( this );\n this._mode()._resetLayout();\n };\n\n proto._getItemLayoutPosition = function( item ) {\n return this._mode()._getItemLayoutPosition( item );\n };\n\n proto._manageStamp = function( stamp ) {\n this._mode()._manageStamp( stamp );\n };\n\n proto._getContainerSize = function() {\n return this._mode()._getContainerSize();\n };\n\n proto.needsResizeLayout = function() {\n return this._mode().needsResizeLayout();\n };\n\n // -------------------------- adding & removing -------------------------- //\n\n // HEADS UP overwrites default Outlayer appended\n proto.appended = function( elems ) {\n var items = this.addItems( elems );\n if ( !items.length ) {\n return;\n }\n // filter, layout, reveal new items\n var filteredItems = this._filterRevealAdded( items );\n // add to filteredItems\n this.filteredItems = this.filteredItems.concat( filteredItems );\n };\n\n // HEADS UP overwrites default Outlayer prepended\n proto.prepended = function( elems ) {\n var items = this._itemize( elems );\n if ( !items.length ) {\n return;\n }\n // start new layout\n this._resetLayout();\n this._manageStamps();\n // filter, layout, reveal new items\n var filteredItems = this._filterRevealAdded( items );\n // layout previous items\n this.layoutItems( this.filteredItems );\n // add to items and filteredItems\n this.filteredItems = filteredItems.concat( this.filteredItems );\n this.items = items.concat( this.items );\n };\n\n proto._filterRevealAdded = function( items ) {\n var filtered = this._filter( items );\n this.hide( filtered.needHide );\n // reveal all new items\n this.reveal( filtered.matches );\n // layout new items, no transition\n this.layoutItems( filtered.matches, true );\n return filtered.matches;\n };\n\n /**\n * Filter, sort, and layout newly-appended item elements\n * @param {Array or NodeList or Element} elems\n */\n proto.insert = function( elems ) {\n var items = this.addItems( elems );\n if ( !items.length ) {\n return;\n }\n // append item elements\n var i, item;\n var len = items.length;\n for ( i=0; i < len; i++ ) {\n item = items[i];\n this.element.appendChild( item.element );\n }\n // filter new stuff\n var filteredInsertItems = this._filter( items ).matches;\n // set flag\n for ( i=0; i < len; i++ ) {\n items[i].isLayoutInstant = true;\n }\n this.arrange();\n // reset flag\n for ( i=0; i < len; i++ ) {\n delete items[i].isLayoutInstant;\n }\n this.reveal( filteredInsertItems );\n };\n\n var _remove = proto.remove;\n proto.remove = function( elems ) {\n elems = utils.makeArray( elems );\n var removeItems = this.getItems( elems );\n // do regular thing\n _remove.call( this, elems );\n // bail if no items to remove\n var len = removeItems && removeItems.length;\n // remove elems from filteredItems\n for ( var i=0; len && i < len; i++ ) {\n var item = removeItems[i];\n // remove item from collection\n utils.removeFrom( this.filteredItems, item );\n }\n };\n\n proto.shuffle = function() {\n // update random sortData\n for ( var i=0; i < this.items.length; i++ ) {\n var item = this.items[i];\n item.sortData.random = Math.random();\n }\n this.options.sortBy = 'random';\n this._sort();\n this._layout();\n };\n\n /**\n * trigger fn without transition\n * kind of hacky to have this in the first place\n * @param {Function} fn\n * @param {Array} args\n * @returns ret\n * @private\n */\n proto._noTransition = function( fn, args ) {\n // save transitionDuration before disabling\n var transitionDuration = this.options.transitionDuration;\n // disable transition\n this.options.transitionDuration = 0;\n // do it\n var returnValue = fn.apply( this, args );\n // re-enable transition for reveal\n this.options.transitionDuration = transitionDuration;\n return returnValue;\n };\n\n // ----- helper methods ----- //\n\n /**\n * getter method for getting filtered item elements\n * @returns {Array} elems - collection of item elements\n */\n proto.getFilteredItemElements = function() {\n return this.filteredItems.map( function( item ) {\n return item.element;\n });\n };\n\n // ----- ----- //\n\n return Isotope;\n\n}));\n\n\n//# sourceURL=webpack://gotw/./node_modules/isotope-layout/js/isotope.js?",
);
/***/
},
/***/ "./node_modules/isotope-layout/js/item.js":
/*!************************************************!*\
!*** ./node_modules/isotope-layout/js/item.js ***!
\************************************************/
/***/ (module, exports, __webpack_require__) => {
eval(
"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/**\n * Isotope Item\n**/\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /*globals define, module, require */\n if ( true ) {\n // AMD\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n __webpack_require__(/*! outlayer/outlayer */ \"./node_modules/outlayer/outlayer.js\")\n ], __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__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n\n}( window, function factory( Outlayer ) {\n'use strict';\n\n// -------------------------- Item -------------------------- //\n\n// sub-class Outlayer Item\nfunction Item() {\n Outlayer.Item.apply( this, arguments );\n}\n\nvar proto = Item.prototype = Object.create( Outlayer.Item.prototype );\n\nvar _create = proto._create;\nproto._create = function() {\n // assign id, used for original-order sorting\n this.id = this.layout.itemGUID++;\n _create.call( this );\n this.sortData = {};\n};\n\nproto.updateSortData = function() {\n if ( this.isIgnored ) {\n return;\n }\n // default sorters\n this.sortData.id = this.id;\n // for backward compatibility\n this.sortData['original-order'] = this.id;\n this.sortData.random = Math.random();\n // go thru getSortData obj and apply the sorters\n var getSortData = this.layout.options.getSortData;\n var sorters = this.layout._sorters;\n for ( var key in getSortData ) {\n var sorter = sorters[ key ];\n this.sortData[ key ] = sorter( this.element, this );\n }\n};\n\nvar _destroy = proto.destroy;\nproto.destroy = function() {\n // call super\n _destroy.apply( this, arguments );\n // reset display, #741\n this.css({\n display: ''\n });\n};\n\nreturn Item;\n\n}));\n\n\n//# sourceURL=webpack://gotw/./node_modules/isotope-layout/js/item.js?",
);
/***/
},
/***/ "./node_modules/isotope-layout/js/layout-mode.js":
/*!*******************************************************!*\
!*** ./node_modules/isotope-layout/js/layout-mode.js ***!
\*******************************************************/
/***/ (module, exports, __webpack_require__) => {
eval(
"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/**\n * Isotope LayoutMode\n */\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /*globals define, module, require */\n if ( true ) {\n // AMD\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n __webpack_require__(/*! get-size/get-size */ \"./node_modules/get-size/get-size.js\"),\n __webpack_require__(/*! outlayer/outlayer */ \"./node_modules/outlayer/outlayer.js\")\n ], __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__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n\n}( window, function factory( getSize, Outlayer ) {\n 'use strict';\n\n // layout mode class\n function LayoutMode( isotope ) {\n this.isotope = isotope;\n // link properties\n if ( isotope ) {\n this.options = isotope.options[ this.namespace ];\n this.element = isotope.element;\n this.items = isotope.filteredItems;\n this.size = isotope.size;\n }\n }\n\n var proto = LayoutMode.prototype;\n\n /**\n * some methods should just defer to default Outlayer method\n * and reference the Isotope instance as `this`\n **/\n var facadeMethods = [\n '_resetLayout',\n '_getItemLayoutPosition',\n '_manageStamp',\n '_getContainerSize',\n '_getElementOffset',\n 'needsResizeLayout',\n '_getOption'\n ];\n\n facadeMethods.forEach( function( methodName ) {\n proto[ methodName ] = function() {\n return Outlayer.prototype[ methodName ].apply( this.isotope, arguments );\n };\n });\n\n // ----- ----- //\n\n // for horizontal layout modes, check vertical size\n proto.needsVerticalResizeLayout = function() {\n // don't trigger if size did not change\n var size = getSize( this.isotope.element );\n // check that this.size and size are there\n // IE8 triggers resize on body size change, so they might not be\n var hasSizes = this.isotope.size && size;\n return hasSizes && size.innerHeight != this.isotope.size.innerHeight;\n };\n\n // ----- measurements ----- //\n\n proto._getMeasurement = function() {\n this.isotope._getMeasurement.apply( this, arguments );\n };\n\n proto.getColumnWidth = function() {\n this.getSegmentSize( 'column', 'Width' );\n };\n\n proto.getRowHeight = function() {\n this.getSegmentSize( 'row', 'Height' );\n };\n\n /**\n * get columnWidth or rowHeight\n * segment: 'column' or 'row'\n * size 'Width' or 'Height'\n **/\n proto.getSegmentSize = function( segment, size ) {\n var segmentName = segment + size;\n var outerSize = 'outer' + size;\n // columnWidth / outerWidth // rowHeight / outerHeight\n this._getMeasurement( segmentName, outerSize );\n // got rowHeight or columnWidth, we can chill\n if ( this[ segmentName ] ) {\n return;\n }\n // fall back to item of first element\n var firstItemSize = this.getFirstItemSize();\n this[ segmentName ] = firstItemSize && firstItemSize[ outerSize ] ||\n // or size of container\n this.isotope.size[ 'inner' + size ];\n };\n\n proto.getFirstItemSize = function() {\n var firstItem = this.isotope.filteredItems[0];\n return firstItem && firstItem.element && getSize( firstItem.element );\n };\n\n // ----- methods that should reference isotope ----- //\n\n proto.layout = function() {\n this.isotope.layout.apply( this.isotope, arguments );\n };\n\n proto.getSize = function() {\n this.isotope.getSize();\n this.size = this.isotope.size;\n };\n\n // -------------------------- create -------------------------- //\n\n LayoutMode.modes = {};\n\n LayoutMode.create = function( namespace, options ) {\n\n function Mode() {\n LayoutMode.apply( this, arguments );\n }\n\n Mode.prototype = Object.create( proto );\n Mode.prototype.constructor = Mode;\n\n // default options\n if ( options ) {\n Mode.options = options;\n }\n\n Mode.prototype.namespace = namespace;\n // register in Isotope\n LayoutMode.modes[ namespace ] = Mode;\n\n return Mode;\n };\n\n return LayoutMode;\n\n}));\n\n\n//# sourceURL=webpack://gotw/./node_modules/isotope-layout/js/layout-mode.js?",
);
/***/
},
/***/ "./node_modules/isotope-layout/js/layout-modes/fit-rows.js":
/*!*****************************************************************!*\
!*** ./node_modules/isotope-layout/js/layout-modes/fit-rows.js ***!
\*****************************************************************/
/***/ (module, exports, __webpack_require__) => {
eval(
"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/**\n * fitRows layout mode\n */\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /*globals define, module, require */\n if ( true ) {\n // AMD\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n __webpack_require__(/*! ../layout-mode */ \"./node_modules/isotope-layout/js/layout-mode.js\")\n ], __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__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n\n}( window, function factory( LayoutMode ) {\n'use strict';\n\nvar FitRows = LayoutMode.create('fitRows');\n\nvar proto = FitRows.prototype;\n\nproto._resetLayout = function() {\n this.x = 0;\n this.y = 0;\n this.maxY = 0;\n this._getMeasurement( 'gutter', 'outerWidth' );\n};\n\nproto._getItemLayoutPosition = function( item ) {\n item.getSize();\n\n var itemWidth = item.size.outerWidth + this.gutter;\n // if this element cannot fit in the current row\n var containerWidth = this.isotope.size.innerWidth + this.gutter;\n if ( this.x !== 0 && itemWidth + this.x > containerWidth ) {\n this.x = 0;\n this.y = this.maxY;\n }\n\n var position = {\n x: this.x,\n y: this.y\n };\n\n this.maxY = Math.max( this.maxY, this.y + item.size.outerHeight );\n this.x += itemWidth;\n\n return position;\n};\n\nproto._getContainerSize = function() {\n return { height: this.maxY };\n};\n\nreturn FitRows;\n\n}));\n\n\n//# sourceURL=webpack://gotw/./node_modules/isotope-layout/js/layout-modes/fit-rows.js?",
);
/***/
},
/***/ "./node_modules/isotope-layout/js/layout-modes/masonry.js":
/*!****************************************************************!*\
!*** ./node_modules/isotope-layout/js/layout-modes/masonry.js ***!
\****************************************************************/
/***/ (module, exports, __webpack_require__) => {
eval(
"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * Masonry layout mode\n * sub-classes Masonry\n * https://masonry.desandro.com\n */\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /*globals define, module, require */\n if ( true ) {\n // AMD\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n __webpack_require__(/*! ../layout-mode */ \"./node_modules/isotope-layout/js/layout-mode.js\"),\n __webpack_require__(/*! masonry-layout/masonry */ \"./node_modules/masonry-layout/masonry.js\")\n ], __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__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n\n}( window, function factory( LayoutMode, Masonry ) {\n'use strict';\n\n// -------------------------- masonryDefinition -------------------------- //\n\n // create an Outlayer layout class\n var MasonryMode = LayoutMode.create('masonry');\n\n var proto = MasonryMode.prototype;\n\n var keepModeMethods = {\n _getElementOffset: true,\n layout: true,\n _getMeasurement: true\n };\n\n // inherit Masonry prototype\n for ( var method in Masonry.prototype ) {\n // do not inherit mode methods\n if ( !keepModeMethods[ method ] ) {\n proto[ method ] = Masonry.prototype[ method ];\n }\n }\n\n var measureColumns = proto.measureColumns;\n proto.measureColumns = function() {\n // set items, used if measuring first item\n this.items = this.isotope.filteredItems;\n measureColumns.call( this );\n };\n\n // point to mode options for fitWidth\n var _getOption = proto._getOption;\n proto._getOption = function( option ) {\n if ( option == 'fitWidth' ) {\n return this.options.isFitWidth !== undefined ?\n this.options.isFitWidth : this.options.fitWidth;\n }\n return _getOption.apply( this.isotope, arguments );\n };\n\n return MasonryMode;\n\n}));\n\n\n//# sourceURL=webpack://gotw/./node_modules/isotope-layout/js/layout-modes/masonry.js?",
);
/***/
},
/***/ "./node_modules/isotope-layout/js/layout-modes/vertical.js":
/*!*****************************************************************!*\
!*** ./node_modules/isotope-layout/js/layout-modes/vertical.js ***!
\*****************************************************************/
/***/ (module, exports, __webpack_require__) => {
eval(
"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/**\n * vertical layout mode\n */\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /*globals define, module, require */\n if ( true ) {\n // AMD\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n __webpack_require__(/*! ../layout-mode */ \"./node_modules/isotope-layout/js/layout-mode.js\")\n ], __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__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n\n}( window, function factory( LayoutMode ) {\n'use strict';\n\nvar Vertical = LayoutMode.create( 'vertical', {\n horizontalAlignment: 0\n});\n\nvar proto = Vertical.prototype;\n\nproto._resetLayout = function() {\n this.y = 0;\n};\n\nproto._getItemLayoutPosition = function( item ) {\n item.getSize();\n var x = ( this.isotope.size.innerWidth - item.size.outerWidth ) *\n this.options.horizontalAlignment;\n var y = this.y;\n this.y += item.size.outerHeight;\n return { x: x, y: y };\n};\n\nproto._getContainerSize = function() {\n return { height: this.y };\n};\n\nreturn Vertical;\n\n}));\n\n\n//# sourceURL=webpack://gotw/./node_modules/isotope-layout/js/layout-modes/vertical.js?",
);
/***/
},
/***/ "./node_modules/masonry-layout/masonry.js":
/*!************************************************!*\
!*** ./node_modules/masonry-layout/masonry.js ***!
\************************************************/
/***/ (module, exports, __webpack_require__) => {
eval(
"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * Masonry v4.2.2\n * Cascading grid layout library\n * https://masonry.desandro.com\n * MIT License\n * by David DeSandro\n */\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /*globals define, module, require */\n if ( true ) {\n // AMD\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n __webpack_require__(/*! outlayer/outlayer */ \"./node_modules/outlayer/outlayer.js\"),\n __webpack_require__(/*! get-size/get-size */ \"./node_modules/get-size/get-size.js\")\n ], __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__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n\n}( window, function factory( Outlayer, getSize ) {\n\n'use strict';\n\n// -------------------------- masonryDefinition -------------------------- //\n\n // create an Outlayer layout class\n var Masonry = Outlayer.create('masonry');\n // isFitWidth -> fitWidth\n Masonry.compatOptions.fitWidth = 'isFitWidth';\n\n var proto = Masonry.prototype;\n\n proto._resetLayout = function() {\n this.getSize();\n this._getMeasurement( 'columnWidth', 'outerWidth' );\n this._getMeasurement( 'gutter', 'outerWidth' );\n this.measureColumns();\n\n // reset column Y\n this.colYs = [];\n for ( var i=0; i < this.cols; i++ ) {\n this.colYs.push( 0 );\n }\n\n this.maxY = 0;\n this.horizontalColIndex = 0;\n };\n\n proto.measureColumns = function() {\n this.getContainerWidth();\n // if columnWidth is 0, default to outerWidth of first item\n if ( !this.columnWidth ) {\n var firstItem = this.items[0];\n var firstItemElem = firstItem && firstItem.element;\n // columnWidth fall back to item of first element\n this.columnWidth = firstItemElem && getSize( firstItemElem ).outerWidth ||\n // if first elem has no width, default to size of container\n this.containerWidth;\n }\n\n var columnWidth = this.columnWidth += this.gutter;\n\n // calculate columns\n var containerWidth = this.containerWidth + this.gutter;\n var cols = containerWidth / columnWidth;\n // fix rounding errors, typically with gutters\n var excess = columnWidth - containerWidth % columnWidth;\n // if overshoot is less than a pixel, round up, otherwise floor it\n var mathMethod = excess && excess < 1 ? 'round' : 'floor';\n cols = Math[ mathMethod ]( cols );\n this.cols = Math.max( cols, 1 );\n };\n\n proto.getContainerWidth = function() {\n // container is parent if fit width\n var isFitWidth = this._getOption('fitWidth');\n var container = isFitWidth ? this.element.parentNode : this.element;\n // check that this.size and size are there\n // IE8 triggers resize on body size change, so they might not be\n var size = getSize( container );\n this.containerWidth = size && size.innerWidth;\n };\n\n proto._getItemLayoutPosition = function( item ) {\n item.getSize();\n // how many columns does this brick span\n var remainder = item.size.outerWidth % this.columnWidth;\n var mathMethod = remainder && remainder < 1 ? 'round' : 'ceil';\n // round if off by 1 pixel, otherwise use ceil\n var colSpan = Math[ mathMethod ]( item.size.outerWidth / this.columnWidth );\n colSpan = Math.min( colSpan, this.cols );\n // use horizontal or top column position\n var colPosMethod = this.options.horizontalOrder ?\n '_getHorizontalColPosition' : '_getTopColPosition';\n var colPosition = this[ colPosMethod ]( colSpan, item );\n // position the brick\n var position = {\n x: this.columnWidth * colPosition.col,\n y: colPosition.y\n };\n // apply setHeight to necessary columns\n var setHeight = colPosition.y + item.size.outerHeight;\n var setMax = colSpan + colPosition.col;\n for ( var i = colPosition.col; i < setMax; i++ ) {\n this.colYs[i] = setHeight;\n }\n\n return position;\n };\n\n proto._getTopColPosition = function( colSpan ) {\n var colGroup = this._getTopColGroup( colSpan );\n // get the minimum Y value from the columns\n var minimumY = Math.min.apply( Math, colGroup );\n\n return {\n col: colGroup.indexOf( minimumY ),\n y: minimumY,\n };\n };\n\n /**\n * @param {Number} colSpan - number of columns the element spans\n * @returns {Array} colGroup\n */\n proto._getTopColGroup = function( colSpan ) {\n if ( colSpan < 2 ) {\n // if brick spans only one column, use all the column Ys\n return this.colYs;\n }\n\n var colGroup = [];\n // how many different places could this brick fit horizontally\n var groupCount = this.cols + 1 - colSpan;\n // for each group potential horizontal position\n for ( var i = 0; i < groupCount; i++ ) {\n colGroup[i] = this._getColGroupY( i, colSpan );\n }\n return colGroup;\n };\n\n proto._getColGroupY = function( col, colSpan ) {\n if ( colSpan < 2 ) {\n return this.colYs[ col ];\n }\n // make an array of colY values for that one group\n var groupColYs = this.colYs.slice( col, col + colSpan );\n // and get the max value of the array\n return Math.max.apply( Math, groupColYs );\n };\n\n // get column position based on horizontal index. #873\n proto._getHorizontalColPosition = function( colSpan, item ) {\n var col = this.horizontalColIndex % this.cols;\n var isOver = colSpan > 1 && col + colSpan > this.cols;\n // shift to next row if item can't fit on current row\n col = isOver ? 0 : col;\n // don't let zero-size items take up space\n var hasSize = item.size.outerWidth && item.size.outerHeight;\n this.horizontalColIndex = hasSize ? col + colSpan : this.horizontalColIndex;\n\n return {\n col: col,\n y: this._getColGroupY( col, colSpan ),\n };\n };\n\n proto._manageStamp = function( stamp ) {\n var stampSize = getSize( stamp );\n var offset = this._getElementOffset( stamp );\n // get the columns that this stamp affects\n var isOriginLeft = this._getOption('originLeft');\n var firstX = isOriginLeft ? offset.left : offset.right;\n var lastX = firstX + stampSize.outerWidth;\n var firstCol = Math.floor( firstX / this.columnWidth );\n firstCol = Math.max( 0, firstCol );\n var lastCol = Math.floor( lastX / this.columnWidth );\n // lastCol should not go over if multiple of columnWidth #425\n lastCol -= lastX % this.columnWidth ? 0 : 1;\n lastCol = Math.min( this.cols - 1, lastCol );\n // set colYs to bottom of the stamp\n\n var isOriginTop = this._getOption('originTop');\n var stampMaxY = ( isOriginTop ? offset.top : offset.bottom ) +\n stampSize.outerHeight;\n for ( var i = firstCol; i <= lastCol; i++ ) {\n this.colYs[i] = Math.max( stampMaxY, this.colYs[i] );\n }\n };\n\n proto._getContainerSize = function() {\n this.maxY = Math.max.apply( Math, this.colYs );\n var size = {\n height: this.maxY\n };\n\n if ( this._getOption('fitWidth') ) {\n size.width = this._getContainerFitWidth();\n }\n\n return size;\n };\n\n proto._getContainerFitWidth = function() {\n var unusedCols = 0;\n // count unused columns\n var i = this.cols;\n while ( --i ) {\n if ( this.colYs[i] !== 0 ) {\n break;\n }\n unusedCols++;\n }\n // fit container to columns that have been used\n return ( this.cols - unusedCols ) * this.columnWidth - this.gutter;\n };\n\n proto.needsResizeLayout = function() {\n var previousWidth = this.containerWidth;\n this.getContainerWidth();\n return previousWidth != this.containerWidth;\n };\n\n return Masonry;\n\n}));\n\n\n//# sourceURL=webpack://gotw/./node_modules/masonry-layout/masonry.js?",
);
/***/
},
/***/ "./node_modules/tiny-slider/dist/tiny-slider.css":
/*!*******************************************************!*\
!*** ./node_modules/tiny-slider/dist/tiny-slider.css ***!
\*******************************************************/
/***/ (
__unused_webpack_module,
__webpack_exports__,
__webpack_require__,
) => {
"use strict";
eval(
"__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://gotw/./node_modules/tiny-slider/dist/tiny-slider.css?",
);
/***/
},
/***/ "./src/css/animate.css":
/*!*****************************!*\
!*** ./src/css/animate.css ***!
\*****************************/
/***/ (
__unused_webpack_module,
__webpack_exports__,
__webpack_require__,
) => {
"use strict";
eval(
"__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://gotw/./src/css/animate.css?",
);
/***/
},
/***/ "./src/css/style.css":
/*!***************************!*\
!*** ./src/css/style.css ***!
\***************************/
/***/ (
__unused_webpack_module,
__webpack_exports__,
__webpack_require__,
) => {
"use strict";
eval(
"__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://gotw/./src/css/style.css?",
);
/***/
},
/***/ "./node_modules/outlayer/item.js":
/*!***************************************!*\
!*** ./node_modules/outlayer/item.js ***!
\***************************************/
/***/ (module, exports, __webpack_require__) => {
eval(
"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/**\n * Outlayer Item\n */\n\n( function( window, factory ) {\n // universal module definition\n /* jshint strict: false */ /* globals define, module, require */\n if ( true ) {\n // AMD - RequireJS\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n __webpack_require__(/*! ev-emitter/ev-emitter */ \"./node_modules/ev-emitter/ev-emitter.js\"),\n __webpack_require__(/*! get-size/get-size */ \"./node_modules/get-size/get-size.js\")\n ], __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__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n\n}( window, function factory( EvEmitter, getSize ) {\n'use strict';\n\n// ----- helpers ----- //\n\nfunction isEmptyObj( obj ) {\n for ( var prop in obj ) {\n return false;\n }\n prop = null;\n return true;\n}\n\n// -------------------------- CSS3 support -------------------------- //\n\n\nvar docElemStyle = document.documentElement.style;\n\nvar transitionProperty = typeof docElemStyle.transition == 'string' ?\n 'transition' : 'WebkitTransition';\nvar transformProperty = typeof docElemStyle.transform == 'string' ?\n 'transform' : 'WebkitTransform';\n\nvar transitionEndEvent = {\n WebkitTransition: 'webkitTransitionEnd',\n transition: 'transitionend'\n}[ transitionProperty ];\n\n// cache all vendor properties that could have vendor prefix\nvar vendorProperties = {\n transform: transformProperty,\n transition: transitionProperty,\n transitionDuration: transitionProperty + 'Duration',\n transitionProperty: transitionProperty + 'Property',\n transitionDelay: transitionProperty + 'Delay'\n};\n\n// -------------------------- Item -------------------------- //\n\nfunction Item( element, layout ) {\n if ( !element ) {\n return;\n }\n\n this.element = element;\n // parent layout class, i.e. Masonry, Isotope, or Packery\n this.layout = layout;\n this.position = {\n x: 0,\n y: 0\n };\n\n this._create();\n}\n\n// inherit EvEmitter\nvar proto = Item.prototype = Object.create( EvEmitter.prototype );\nproto.constructor = Item;\n\nproto._create = function() {\n // transition objects\n this._transn = {\n ingProperties: {},\n clean: {},\n onEnd: {}\n };\n\n this.css({\n position: 'absolute'\n });\n};\n\n// trigger specified handler for event type\nproto.handleEvent = function( event ) {\n var method = 'on' + event.type;\n if ( this[ method ] ) {\n this[ method ]( event );\n }\n};\n\nproto.getSize = function() {\n this.size = getSize( this.element );\n};\n\n/**\n * apply CSS styles to element\n * @param {Object} style\n */\nproto.css = function( style ) {\n var elemStyle = this.element.style;\n\n for ( var prop in style ) {\n // use vendor property if available\n var supportedProp = vendorProperties[ prop ] || prop;\n elemStyle[ supportedProp ] = style[ prop ];\n }\n};\n\n // measure position, and sets it\nproto.getPosition = function() {\n var style = getComputedStyle( this.element );\n var isOriginLeft = this.layout._getOption('originLeft');\n var isOriginTop = this.layout._getOption('originTop');\n var xValue = style[ isOriginLeft ? 'left' : 'right' ];\n var yValue = style[ isOriginTop ? 'top' : 'bottom' ];\n var x = parseFloat( xValue );\n var y = parseFloat( yValue );\n // convert percent to pixels\n var layoutSize = this.layout.size;\n if ( xValue.indexOf('%') != -1 ) {\n x = ( x / 100 ) * layoutSize.width;\n }\n if ( yValue.indexOf('%') != -1 ) {\n y = ( y / 100 ) * layoutSize.height;\n }\n // clean up 'auto' or other non-integer values\n x = isNaN( x ) ? 0 : x;\n y = isNaN( y ) ? 0 : y;\n // remove padding from measurement\n x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight;\n y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom;\n\n this.position.x = x;\n this.position.y = y;\n};\n\n// set settled position, apply padding\nproto.layoutPosition = function() {\n var layoutSize = this.layout.size;\n var style = {};\n var isOriginLeft = this.layout._getOption('originLeft');\n var isOriginTop = this.layout._getOption('originTop');\n\n // x\n var xPadding = isOriginLeft ? 'paddingLeft' : 'paddingRight';\n var xProperty = isOriginLeft ? 'left' : 'right';\n var xResetProperty = isOriginLeft ? 'right' : 'left';\n\n var x = this.position.x + layoutSize[ xPadding ];\n // set in percentage or pixels\n style[ xProperty ] = this.getXValue( x );\n // reset other property\n style[ xResetProperty ] = '';\n\n // y\n var yPadding = isOriginTop ? 'paddingTop' : 'paddingBottom';\n var yProperty = isOriginTop ? 'top' : 'bottom';\n var yResetProperty = isOriginTop ? 'bottom' : 'top';\n\n var y = this.position.y + layoutSize[ yPadding ];\n // set in percentage or pixels\n style[ yProperty ] = this.getYValue( y );\n // reset other property\n style[ yResetProperty ] = '';\n\n this.css( style );\n this.emitEvent( 'layout', [ this ] );\n};\n\nproto.getXValue = function( x ) {\n var isHorizontal = this.layout._getOption('horizontal');\n return this.layout.options.percentPosition && !isHorizontal ?\n ( ( x / this.layout.size.width ) * 100 ) + '%' : x + 'px';\n};\n\nproto.getYValue = function( y ) {\n var isHorizontal = this.layout._getOption('horizontal');\n return this.layout.options.percentPosition && isHorizontal ?\n ( ( y / this.layout.size.height ) * 100 ) + '%' : y + 'px';\n};\n\nproto._transitionTo = function( x, y ) {\n this.getPosition();\n // get current x & y from top/left\n var curX = this.position.x;\n var curY = this.position.y;\n\n var didNotMove = x == this.position.x && y == this.position.y;\n\n // save end position\n this.setPosition( x, y );\n\n // if did not move and not transitioning, just go to layout\n if ( didNotMove && !this.isTransitioning ) {\n this.layoutPosition();\n return;\n }\n\n var transX = x - curX;\n var transY = y - curY;\n var transitionStyle = {};\n transitionStyle.transform = this.getTranslate( transX, transY );\n\n this.transition({\n to: transitionStyle,\n onTransitionEnd: {\n transform: this.layoutPosition\n },\n isCleaning: true\n });\n};\n\nproto.getTranslate = function( x, y ) {\n // flip cooridinates if origin on right or bottom\n var isOriginLeft = this.layout._getOption('originLeft');\n var isOriginTop = this.layout._getOption('originTop');\n x = isOriginLeft ? x : -x;\n y = isOriginTop ? y : -y;\n return 'translate3d(' + x + 'px, ' + y + 'px, 0)';\n};\n\n// non transition + transform support\nproto.goTo = function( x, y ) {\n this.setPosition( x, y );\n this.layoutPosition();\n};\n\nproto.moveTo = proto._transitionTo;\n\nproto.setPosition = function( x, y ) {\n this.position.x = parseFloat( x );\n this.position.y = parseFloat( y );\n};\n\n// ----- transition ----- //\n\n/**\n * @param {Object} style - CSS\n * @param {Function} onTransitionEnd\n */\n\n// non transition, just trigger callback\nproto._nonTransition = function( args ) {\n this.css( args.to );\n if ( args.isCleaning ) {\n this._removeStyles( args.to );\n }\n for ( var prop in args.onTransitionEnd ) {\n args.onTransitionEnd[ prop ].call( this );\n }\n};\n\n/**\n * proper transition\n * @param {Object} args - arguments\n * @param {Object} to - style to transition to\n * @param {Object} from - style to start transition from\n * @param {Boolean} isCleaning - removes transition styles after transition\n * @param {Function} onTransitionEnd - callback\n */\nproto.transition = function( args ) {\n // redirect to nonTransition if no transition duration\n if ( !parseFloat( this.layout.options.transitionDuration ) ) {\n this._nonTransition( args );\n return;\n }\n\n var _transition = this._transn;\n // keep track of onTransitionEnd callback by css property\n for ( var prop in args.onTransitionEnd ) {\n _transition.onEnd[ prop ] = args.onTransitionEnd[ prop ];\n }\n // keep track of properties that are transitioning\n for ( prop in args.to ) {\n _transition.ingProperties[ prop ] = true;\n // keep track of properties to clean up when transition is done\n if ( args.isCleaning ) {\n _transition.clean[ prop ] = true;\n }\n }\n\n // set from styles\n if ( args.from ) {\n this.css( args.from );\n // force redraw. http://blog.alexmaccaw.com/css-transitions\n var h = this.element.offsetHeight;\n // hack for JSHint to hush about unused var\n h = null;\n }\n // enable transition\n this.enableTransition( args.to );\n // set styles that are transitioning\n this.css( args.to );\n\n this.isTransitioning = true;\n\n};\n\n// dash before all cap letters, including first for\n// WebkitTransform => -webkit-transform\nfunction toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}\n\nvar transitionProps = 'opacity,' + toDashedAll( transformProperty );\n\nproto.enableTransition = function(/* style */) {\n // HACK changing transitionProperty during a transition\n // will cause transition to jump\n if ( this.isTransitioning ) {\n return;\n }\n\n // make `transition: foo, bar, baz` from style object\n // HACK un-comment this when enableTransition can work\n // while a transition is happening\n // var transitionValues = [];\n // for ( var prop in style ) {\n // // dash-ify camelCased properties like WebkitTransition\n // prop = vendorProperties[ prop ] || prop;\n // transitionValues.push( toDashedAll( prop ) );\n // }\n // munge number to millisecond, to match stagger\n var duration = this.layout.options.transitionDuration;\n duration = typeof duration == 'number' ? duration + 'ms' : duration;\n // enable transition styles\n this.css({\n transitionProperty: transitionProps,\n transitionDuration: duration,\n transitionDelay: this.staggerDelay || 0\n });\n // listen for transition end event\n this.element.addEventListener( transitionEndEvent, this, false );\n};\n\n// ----- events ----- //\n\nproto.onwebkitTransitionEnd = function( event ) {\n this.ontransitionend( event );\n};\n\nproto.onotransitionend = function( event ) {\n this.ontransitionend( event );\n};\n\n// properties that I munge to make my life easier\nvar dashedVendorProperties = {\n '-webkit-transform': 'transform'\n};\n\nproto.ontransitionend = function( event ) {\n // disregard bubbled events from children\n if ( event.target !== this.element ) {\n return;\n }\n var _transition = this._transn;\n // get property name of transitioned property, convert to prefix-free\n var propertyName = dashedVendorProperties[ event.propertyName ] || event.propertyName;\n\n // remove property that has completed transitioning\n delete _transition.ingProperties[ propertyName ];\n // check if any properties are still transitioning\n if ( isEmptyObj( _transition.ingProperties ) ) {\n // all properties have completed transitioning\n this.disableTransition();\n }\n // clean style\n if ( propertyName in _transition.clean ) {\n // clean up style\n this.element.style[ event.propertyName ] = '';\n delete _transition.clean[ propertyName ];\n }\n // trigger onTransitionEnd callback\n if ( propertyName in _transition.onEnd ) {\n var onTransitionEnd = _transition.onEnd[ propertyName ];\n onTransitionEnd.call( this );\n delete _transition.onEnd[ propertyName ];\n }\n\n this.emitEvent( 'transitionEnd', [ this ] );\n};\n\nproto.disableTransition = function() {\n this.removeTransitionStyles();\n this.element.removeEventListener( transitionEndEvent, this, false );\n this.isTransitioning = false;\n};\n\n/**\n * removes style property from element\n * @param {Object} style\n**/\nproto._removeStyles = function( style ) {\n // clean up transition styles\n var cleanStyle = {};\n for ( var prop in style ) {\n cleanStyle[ prop ] = '';\n }\n this.css( cleanStyle );\n};\n\nvar cleanTransitionStyle = {\n transitionProperty: '',\n transitionDuration: '',\n transitionDelay: ''\n};\n\nproto.removeTransitionStyles = function() {\n // remove transition\n this.css( cleanTransitionStyle );\n};\n\n// ----- stagger ----- //\n\nproto.stagger = function( delay ) {\n delay = isNaN( delay ) ? 0 : delay;\n this.staggerDelay = delay + 'ms';\n};\n\n// ----- show/hide/remove ----- //\n\n// remove element from DOM\nproto.removeElem = function() {\n this.element.parentNode.removeChild( this.element );\n // remove display: none\n this.css({ display: '' });\n this.emitEvent( 'remove', [ this ] );\n};\n\nproto.remove = function() {\n // just remove element if no transition support or no transition\n if ( !transitionProperty || !parseFloat( this.layout.options.transitionDuration ) ) {\n this.removeElem();\n return;\n }\n\n // start transition\n this.once( 'transitionEnd', function() {\n this.removeElem();\n });\n this.hide();\n};\n\nproto.reveal = function() {\n delete this.isHidden;\n // remove display: none\n this.css({ display: '' });\n\n var options = this.layout.options;\n\n var onTransitionEnd = {};\n var transitionEndProperty = this.getHideRevealTransitionEndProperty('visibleStyle');\n onTransitionEnd[ transitionEndProperty ] = this.onRevealTransitionEnd;\n\n this.transition({\n from: options.hiddenStyle,\n to: options.visibleStyle,\n isCleaning: true,\n onTransitionEnd: onTransitionEnd\n });\n};\n\nproto.onRevealTransitionEnd = function() {\n // check if still visible\n // during transition, item may have been hidden\n if ( !this.isHidden ) {\n this.emitEvent('reveal');\n }\n};\n\n/**\n * get style property use for hide/reveal transition end\n * @param {String} styleProperty - hiddenStyle/visibleStyle\n * @returns {String}\n */\nproto.getHideRevealTransitionEndProperty = function( styleProperty ) {\n var optionStyle = this.layout.options[ styleProperty ];\n // use opacity\n if ( optionStyle.opacity ) {\n return 'opacity';\n }\n // get first property\n for ( var prop in optionStyle ) {\n return prop;\n }\n};\n\nproto.hide = function() {\n // set flag\n this.isHidden = true;\n // remove display: none\n this.css({ display: '' });\n\n var options = this.layout.options;\n\n var onTransitionEnd = {};\n var transitionEndProperty = this.getHideRevealTransitionEndProperty('hiddenStyle');\n onTransitionEnd[ transitionEndProperty ] = this.onHideTransitionEnd;\n\n this.transition({\n from: options.visibleStyle,\n to: options.hiddenStyle,\n // keep hidden stuff hidden\n isCleaning: true,\n onTransitionEnd: onTransitionEnd\n });\n};\n\nproto.onHideTransitionEnd = function() {\n // check if still hidden\n // during transition, item may have been un-hidden\n if ( this.isHidden ) {\n this.css({ display: 'none' });\n this.emitEvent('hide');\n }\n};\n\nproto.destroy = function() {\n this.css({\n position: '',\n left: '',\n right: '',\n top: '',\n bottom: '',\n transition: '',\n transform: ''\n });\n};\n\nreturn Item;\n\n}));\n\n\n//# sourceURL=webpack://gotw/./node_modules/outlayer/item.js?",
);
/***/
},
/***/ "./node_modules/outlayer/outlayer.js":
/*!*******************************************!*\
!*** ./node_modules/outlayer/outlayer.js ***!
\*******************************************/
/***/ (module, exports, __webpack_require__) => {
eval(
"var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * Outlayer v2.1.1\n * the brains and guts of a layout library\n * MIT license\n */\n\n( function( window, factory ) {\n 'use strict';\n // universal module definition\n /* jshint strict: false */ /* globals define, module, require */\n if ( true ) {\n // AMD - RequireJS\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n __webpack_require__(/*! ev-emitter/ev-emitter */ \"./node_modules/ev-emitter/ev-emitter.js\"),\n __webpack_require__(/*! get-size/get-size */ \"./node_modules/get-size/get-size.js\"),\n __webpack_require__(/*! fizzy-ui-utils/utils */ \"./node_modules/fizzy-ui-utils/utils.js\"),\n __webpack_require__(/*! ./item */ \"./node_modules/outlayer/item.js\")\n ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( EvEmitter, getSize, utils, Item ) {\n return factory( window, EvEmitter, getSize, utils, Item);\n }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n\n}( window, function factory( window, EvEmitter, getSize, utils, Item ) {\n'use strict';\n\n// ----- vars ----- //\n\nvar console = window.console;\nvar jQuery = window.jQuery;\nvar noop = function() {};\n\n// -------------------------- Outlayer -------------------------- //\n\n// globally unique identifiers\nvar GUID = 0;\n// internal store of all Outlayer intances\nvar instances = {};\n\n\n/**\n * @param {Element, String} element\n * @param {Object} options\n * @constructor\n */\nfunction Outlayer( element, options ) {\n var queryElement = utils.getQueryElement( element );\n if ( !queryElement ) {\n if ( console ) {\n console.error( 'Bad element for ' + this.constructor.namespace +\n ': ' + ( queryElement || element ) );\n }\n return;\n }\n this.element = queryElement;\n // add jQuery\n if ( jQuery ) {\n this.$element = jQuery( this.element );\n }\n\n // options\n this.options = utils.extend( {}, this.constructor.defaults );\n this.option( options );\n\n // add id for Outlayer.getFromElement\n var id = ++GUID;\n this.element.outlayerGUID = id; // expando\n instances[ id ] = this; // associate via id\n\n // kick it off\n this._create();\n\n var isInitLayout = this._getOption('initLayout');\n if ( isInitLayout ) {\n this.layout();\n }\n}\n\n// settings are for internal use only\nOutlayer.namespace = 'outlayer';\nOutlayer.Item = Item;\n\n// default options\nOutlayer.defaults = {\n containerStyle: {\n position: 'relative'\n },\n initLayout: true,\n originLeft: true,\n originTop: true,\n resize: true,\n resizeContainer: true,\n // item options\n transitionDuration: '0.4s',\n hiddenStyle: {\n opacity: 0,\n transform: 'scale(0.001)'\n },\n visibleStyle: {\n opacity: 1,\n transform: 'scale(1)'\n }\n};\n\nvar proto = Outlayer.prototype;\n// inherit EvEmitter\nutils.extend( proto, EvEmitter.prototype );\n\n/**\n * set options\n * @param {Object} opts\n */\nproto.option = function( opts ) {\n utils.extend( this.options, opts );\n};\n\n/**\n * get backwards compatible option value, check old name\n */\nproto._getOption = function( option ) {\n var oldOption = this.constructor.compatOptions[ option ];\n return oldOption && this.options[ oldOption ] !== undefined ?\n this.options[ oldOption ] : this.options[ option ];\n};\n\nOutlayer.compatOptions = {\n // currentName: oldName\n initLayout: 'isInitLayout',\n horizontal: 'isHorizontal',\n layoutInstant: 'isLayoutInstant',\n originLeft: 'isOriginLeft',\n originTop: 'isOriginTop',\n resize: 'isResizeBound',\n resizeContainer: 'isResizingContainer'\n};\n\nproto._create = function() {\n // get items from children\n this.reloadItems();\n // elements that affect layout, but are not laid out\n this.stamps = [];\n this.stamp( this.options.stamp );\n // set container style\n utils.extend( this.element.style, this.options.containerStyle );\n\n // bind resize method\n var canBindResize = this._getOption('resize');\n if ( canBindResize ) {\n this.bindResize();\n }\n};\n\n// goes through all children again and gets bricks in proper order\nproto.reloadItems = function() {\n // collection of item elements\n this.items = this._itemize( this.element.children );\n};\n\n\n/**\n * turn elements into Outlayer.Items to be used in layout\n * @param {Array or NodeList or HTMLElement} elems\n * @returns {Array} items - collection of new Outlayer Items\n */\nproto._itemize = function( elems ) {\n\n var itemElems = this._filterFindItemElements( elems );\n var Item = this.constructor.Item;\n\n // create new Outlayer Items for collection\n var items = [];\n for ( var i=0; i < itemElems.length; i++ ) {\n var elem = itemElems[i];\n var item = new Item( elem, this );\n items.push( item );\n }\n\n return items;\n};\n\n/**\n * get item elements to be used in layout\n * @param {Array or NodeList or HTMLElement} elems\n * @returns {Array} items - item elements\n */\nproto._filterFindItemElements = function( elems ) {\n return utils.filterFindElements( elems, this.options.itemSelector );\n};\n\n/**\n * getter method for getting item elements\n * @returns {Array} elems - collection of item elements\n */\nproto.getItemElements = function() {\n return this.items.map( function( item ) {\n return item.element;\n });\n};\n\n// ----- init & layout ----- //\n\n/**\n * lays out all items\n */\nproto.layout = function() {\n this._resetLayout();\n this._manageStamps();\n\n // don't animate first layout\n var layoutInstant = this._getOption('layoutInstant');\n var isInstant = layoutInstant !== undefined ?\n layoutInstant : !this._isLayoutInited;\n this.layoutItems( this.items, isInstant );\n\n // flag for initalized\n this._isLayoutInited = true;\n};\n\n// _init is alias for layout\nproto._init = proto.layout;\n\n/**\n * logic before any new layout\n */\nproto._resetLayout = function() {\n this.getSize();\n};\n\n\nproto.getSize = function() {\n this.size = getSize( this.element );\n};\n\n/**\n * get measurement from option, for columnWidth, rowHeight, gutter\n * if option is String -> get element from selector string, & get size of element\n * if option is Element -> get size of element\n * else use option as a number\n *\n * @param {String} measurement\n * @param {String} size - width or height\n * @private\n */\nproto._getMeasurement = function( measurement, size ) {\n var option = this.options[ measurement ];\n var elem;\n if ( !option ) {\n // default to 0\n this[ measurement ] = 0;\n } else {\n // use option as an element\n if ( typeof option == 'string' ) {\n elem = this.element.querySelector( option );\n } else if ( option instanceof HTMLElement ) {\n elem = option;\n }\n // use size of element, if element\n this[ measurement ] = elem ? getSize( elem )[ size ] : option;\n }\n};\n\n/**\n * layout a collection of item elements\n * @api public\n */\nproto.layoutItems = function( items, isInstant ) {\n items = this._getItemsForLayout( items );\n\n this._layoutItems( items, isInstant );\n\n this._postLayout();\n};\n\n/**\n * get the items to be laid out\n * you may want to skip over some items\n * @param {Array} items\n * @returns {Array} items\n */\nproto._getItemsForLayout = function( items ) {\n return items.filter( function( item ) {\n return !item.isIgnored;\n });\n};\n\n/**\n * layout items\n * @param {Array} items\n * @param {Boolean} isInstant\n */\nproto._layoutItems = function( items, isInstant ) {\n this._emitCompleteOnItems( 'layout', items );\n\n if ( !items || !items.length ) {\n // no items, emit event with empty array\n return;\n }\n\n var queue = [];\n\n items.forEach( function( item ) {\n // get x/y object from method\n var position = this._getItemLayoutPosition( item );\n // enqueue\n position.item = item;\n position.isInstant = isInstant || item.isLayoutInstant;\n queue.push( position );\n }, this );\n\n this._processLayoutQueue( queue );\n};\n\n/**\n * get item layout position\n * @param {Outlayer.Item} item\n * @returns {Object} x and y position\n */\nproto._getItemLayoutPosition = function( /* item */ ) {\n return {\n x: 0,\n y: 0\n };\n};\n\n/**\n * iterate over array and position each item\n * Reason being - separating this logic prevents 'layout invalidation'\n * thx @paul_irish\n * @param {Array} queue\n */\nproto._processLayoutQueue = function( queue ) {\n this.updateStagger();\n queue.forEach( function( obj, i ) {\n this._positionItem( obj.item, obj.x, obj.y, obj.isInstant, i );\n }, this );\n};\n\n// set stagger from option in milliseconds number\nproto.updateStagger = function() {\n var stagger = this.options.stagger;\n if ( stagger === null || stagger === undefined ) {\n this.stagger = 0;\n return;\n }\n this.stagger = getMilliseconds( stagger );\n return this.stagger;\n};\n\n/**\n * Sets position of item in DOM\n * @param {Outlayer.Item} item\n * @param {Number} x - horizontal position\n * @param {Number} y - vertical position\n * @param {Boolean} isInstant - disables transitions\n */\nproto._positionItem = function( item, x, y, isInstant, i ) {\n if ( isInstant ) {\n // if not transition, just set CSS\n item.goTo( x, y );\n } else {\n item.stagger( i * this.stagger );\n item.moveTo( x, y );\n }\n};\n\n/**\n * Any logic you want to do after each layout,\n * i.e. size the container\n */\nproto._postLayout = function() {\n this.resizeContainer();\n};\n\nproto.resizeContainer = function() {\n var isResizingContainer = this._getOption('resizeContainer');\n if ( !isResizingContainer ) {\n return;\n }\n var size = this._getContainerSize();\n if ( size ) {\n this._setContainerMeasure( size.width, true );\n this._setContainerMeasure( size.height, false );\n }\n};\n\n/**\n * Sets width or height of container if returned\n * @returns {Object} size\n * @param {Number} width\n * @param {Number} height\n */\nproto._getContainerSize = noop;\n\n/**\n * @param {Number} measure - size of width or height\n * @param {Boolean} isWidth\n */\nproto._setContainerMeasure = function( measure, isWidth ) {\n if ( measure === undefined ) {\n return;\n }\n\n var elemSize = this.size;\n // add padding and border width if border box\n if ( elemSize.isBorderBox ) {\n measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight +\n elemSize.borderLeftWidth + elemSize.borderRightWidth :\n elemSize.paddingBottom + elemSize.paddingTop +\n elemSize.borderTopWidth + elemSize.borderBottomWidth;\n }\n\n measure = Math.max( measure, 0 );\n this.element.style[ isWidth ? 'width' : 'height' ] = measure + 'px';\n};\n\n/**\n * emit eventComplete on a collection of items events\n * @param {String} eventName\n * @param {Array} items - Outlayer.Items\n */\nproto._emitCompleteOnItems = function( eventName, items ) {\n var _this = this;\n function onComplete() {\n _this.dispatchEvent( eventName + 'Complete', null, [ items ] );\n }\n\n var count = items.length;\n if ( !items || !count ) {\n onComplete();\n return;\n }\n\n var doneCount = 0;\n function tick() {\n doneCount++;\n if ( doneCount == count ) {\n onComplete();\n }\n }\n\n // bind callback\n items.forEach( function( item ) {\n item.once( eventName, tick );\n });\n};\n\n/**\n * emits events via EvEmitter and jQuery events\n * @param {String} type - name of event\n * @param {Event} event - original event\n * @param {Array} args - extra arguments\n */\nproto.dispatchEvent = function( type, event, args ) {\n // add original event to arguments\n var emitArgs = event ? [ event ].concat( args ) : args;\n this.emitEvent( type, emitArgs );\n\n if ( jQuery ) {\n // set this.$element\n this.$element = this.$element || jQuery( this.element );\n if ( event ) {\n // create jQuery event\n var $event = jQuery.Event( event );\n $event.type = type;\n this.$element.trigger( $event, args );\n } else {\n // just trigger with type if no event available\n this.$element.trigger( type, args );\n }\n }\n};\n\n// -------------------------- ignore & stamps -------------------------- //\n\n\n/**\n * keep item in collection, but do not lay it out\n * ignored items do not get skipped in layout\n * @param {Element} elem\n */\nproto.ignore = function( elem ) {\n var item = this.getItem( elem );\n if ( item ) {\n item.isIgnored = true;\n }\n};\n\n/**\n * return item to layout collection\n * @param {Element} elem\n */\nproto.unignore = function( elem ) {\n var item = this.getItem( elem );\n if ( item ) {\n delete item.isIgnored;\n }\n};\n\n/**\n * adds elements to stamps\n * @param {NodeList, Array, Element, or String} elems\n */\nproto.stamp = function( elems ) {\n elems = this._find( elems );\n if ( !elems ) {\n return;\n }\n\n this.stamps = this.stamps.concat( elems );\n // ignore\n elems.forEach( this.ignore, this );\n};\n\n/**\n * removes elements to stamps\n * @param {NodeList, Array, or Element} elems\n */\nproto.unstamp = function( elems ) {\n elems = this._find( elems );\n if ( !elems ){\n return;\n }\n\n elems.forEach( function( elem ) {\n // filter out removed stamp elements\n utils.removeFrom( this.stamps, elem );\n this.unignore( elem );\n }, this );\n};\n\n/**\n * finds child elements\n * @param {NodeList, Array, Element, or String} elems\n * @returns {Array} elems\n */\nproto._find = function( elems ) {\n if ( !elems ) {\n return;\n }\n // if string, use argument as selector string\n if ( typeof elems == 'string' ) {\n elems = this.element.querySelectorAll( elems );\n }\n elems = utils.makeArray( elems );\n return elems;\n};\n\nproto._manageStamps = function() {\n if ( !this.stamps || !this.stamps.length ) {\n return;\n }\n\n this._getBoundingRect();\n\n this.stamps.forEach( this._manageStamp, this );\n};\n\n// update boundingLeft / Top\nproto._getBoundingRect = function() {\n // get bounding rect for container element\n var boundingRect = this.element.getBoundingClientRect();\n var size = this.size;\n this._boundingRect = {\n left: boundingRect.left + size.paddingLeft + size.borderLeftWidth,\n top: boundingRect.top + size.paddingTop + size.borderTopWidth,\n right: boundingRect.right - ( size.paddingRight + size.borderRightWidth ),\n bottom: boundingRect.bottom - ( size.paddingBottom + size.borderBottomWidth )\n };\n};\n\n/**\n * @param {Element} stamp\n**/\nproto._manageStamp = noop;\n\n/**\n * get x/y position of element relative to container element\n * @param {Element} elem\n * @returns {Object} offset - has left, top, right, bottom\n */\nproto._getElementOffset = function( elem ) {\n var boundingRect = elem.getBoundingClientRect();\n var thisRect = this._boundingRect;\n var size = getSize( elem );\n var offset = {\n left: boundingRect.left - thisRect.left - size.marginLeft,\n top: boundingRect.top - thisRect.top - size.marginTop,\n right: thisRect.right - boundingRect.right - size.marginRight,\n bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom\n };\n return offset;\n};\n\n// -------------------------- resize -------------------------- //\n\n// enable event handlers for listeners\n// i.e. resize -> onresize\nproto.handleEvent = utils.handleEvent;\n\n/**\n * Bind layout to window resizing\n */\nproto.bindResize = function() {\n window.addEventListener( 'resize', this );\n this.isResizeBound = true;\n};\n\n/**\n * Unbind layout to window resizing\n */\nproto.unbindResize = function() {\n window.removeEventListener( 'resize', this );\n this.isResizeBound = false;\n};\n\nproto.onresize = function() {\n this.resize();\n};\n\nutils.debounceMethod( Outlayer, 'onresize', 100 );\n\nproto.resize = function() {\n // don't trigger if size did not change\n // or if resize was unbound. See #9\n if ( !this.isResizeBound || !this.needsResizeLayout() ) {\n return;\n }\n\n this.layout();\n};\n\n/**\n * check if layout is needed post layout\n * @returns Boolean\n */\nproto.needsResizeLayout = function() {\n var size = getSize( this.element );\n // check that this.size and size are there\n // IE8 triggers resize on body size change, so they might not be\n var hasSizes = this.size && size;\n return hasSizes && size.innerWidth !== this.size.innerWidth;\n};\n\n// -------------------------- methods -------------------------- //\n\n/**\n * add items to Outlayer instance\n * @param {Array or NodeList or Element} elems\n * @returns {Array} items - Outlayer.Items\n**/\nproto.addItems = function( elems ) {\n var items = this._itemize( elems );\n // add items to collection\n if ( items.length ) {\n this.items = this.items.concat( items );\n }\n return items;\n};\n\n/**\n * Layout newly-appended item elements\n * @param {Array or NodeList or Element} elems\n */\nproto.appended = function( elems ) {\n var items = this.addItems( elems );\n if ( !items.length ) {\n return;\n }\n // layout and reveal just the new items\n this.layoutItems( items, true );\n this.reveal( items );\n};\n\n/**\n * Layout prepended elements\n * @param {Array or NodeList or Element} elems\n */\nproto.prepended = function( elems ) {\n var items = this._itemize( elems );\n if ( !items.length ) {\n return;\n }\n // add items to beginning of collection\n var previousItems = this.items.slice(0);\n this.items = items.concat( previousItems );\n // start new layout\n this._resetLayout();\n this._manageStamps();\n // layout new stuff without transition\n this.layoutItems( items, true );\n this.reveal( items );\n // layout previous items\n this.layoutItems( previousItems );\n};\n\n/**\n * reveal a collection of items\n * @param {Array of Outlayer.Items} items\n */\nproto.reveal = function( items ) {\n this._emitCompleteOnItems( 'reveal', items );\n if ( !items || !items.length ) {\n return;\n }\n var stagger = this.updateStagger();\n items.forEach( function( item, i ) {\n item.stagger( i * stagger );\n item.reveal();\n });\n};\n\n/**\n * hide a collection of items\n * @param {Array of Outlayer.Items} items\n */\nproto.hide = function( items ) {\n this._emitCompleteOnItems( 'hide', items );\n if ( !items || !items.length ) {\n return;\n }\n var stagger = this.updateStagger();\n items.forEach( function( item, i ) {\n item.stagger( i * stagger );\n item.hide();\n });\n};\n\n/**\n * reveal item elements\n * @param {Array}, {Element}, {NodeList} items\n */\nproto.revealItemElements = function( elems ) {\n var items = this.getItems( elems );\n this.reveal( items );\n};\n\n/**\n * hide item elements\n * @param {Array}, {Element}, {NodeList} items\n */\nproto.hideItemElements = function( elems ) {\n var items = this.getItems( elems );\n this.hide( items );\n};\n\n/**\n * get Outlayer.Item, given an Element\n * @param {Element} elem\n * @param {Function} callback\n * @returns {Outlayer.Item} item\n */\nproto.getItem = function( elem ) {\n // loop through items to get the one that matches\n for ( var i=0; i < this.items.length; i++ ) {\n var item = this.items[i];\n if ( item.element == elem ) {\n // return item\n return item;\n }\n }\n};\n\n/**\n * get collection of Outlayer.Items, given Elements\n * @param {Array} elems\n * @returns {Array} items - Outlayer.Items\n */\nproto.getItems = function( elems ) {\n elems = utils.makeArray( elems );\n var items = [];\n elems.forEach( function( elem ) {\n var item = this.getItem( elem );\n if ( item ) {\n items.push( item );\n }\n }, this );\n\n return items;\n};\n\n/**\n * remove element(s) from instance and DOM\n * @param {Array or NodeList or Element} elems\n */\nproto.remove = function( elems ) {\n var removeItems = this.getItems( elems );\n\n this._emitCompleteOnItems( 'remove', removeItems );\n\n // bail if no items to remove\n if ( !removeItems || !removeItems.length ) {\n return;\n }\n\n removeItems.forEach( function( item ) {\n item.remove();\n // remove item from collection\n utils.removeFrom( this.items, item );\n }, this );\n};\n\n// ----- destroy ----- //\n\n// remove and disable Outlayer instance\nproto.destroy = function() {\n // clean up dynamic styles\n var style = this.element.style;\n style.height = '';\n style.position = '';\n style.width = '';\n // destroy items\n this.items.forEach( function( item ) {\n item.destroy();\n });\n\n this.unbindResize();\n\n var id = this.element.outlayerGUID;\n delete instances[ id ]; // remove reference to instance by id\n delete this.element.outlayerGUID;\n // remove data for jQuery\n if ( jQuery ) {\n jQuery.removeData( this.element, this.constructor.namespace );\n }\n\n};\n\n// -------------------------- data -------------------------- //\n\n/**\n * get Outlayer instance from element\n * @param {Element} elem\n * @returns {Outlayer}\n */\nOutlayer.data = function( elem ) {\n elem = utils.getQueryElement( elem );\n var id = elem && elem.outlayerGUID;\n return id && instances[ id ];\n};\n\n\n// -------------------------- create Outlayer class -------------------------- //\n\n/**\n * create a layout class\n * @param {String} namespace\n */\nOutlayer.create = function( namespace, options ) {\n // sub-class Outlayer\n var Layout = subclass( Outlayer );\n // apply new options and compatOptions\n Layout.defaults = utils.extend( {}, Outlayer.defaults );\n utils.extend( Layout.defaults, options );\n Layout.compatOptions = utils.extend( {}, Outlayer.compatOptions );\n\n Layout.namespace = namespace;\n\n Layout.data = Outlayer.data;\n\n // sub-class Item\n Layout.Item = subclass( Item );\n\n // -------------------------- declarative -------------------------- //\n\n utils.htmlInit( Layout, namespace );\n\n // -------------------------- jQuery bridge -------------------------- //\n\n // make into jQuery plugin\n if ( jQuery && jQuery.bridget ) {\n jQuery.bridget( namespace, Layout );\n }\n\n return Layout;\n};\n\nfunction subclass( Parent ) {\n function SubClass() {\n Parent.apply( this, arguments );\n }\n\n SubClass.prototype = Object.create( Parent.prototype );\n SubClass.prototype.constructor = SubClass;\n\n return SubClass;\n}\n\n// ----- helpers ----- //\n\n// how many milliseconds are in each unit\nvar msUnits = {\n ms: 1,\n s: 1000\n};\n\n// munge time-like parameter into millisecond number\n// '0.4s' -> 40\nfunction getMilliseconds( time ) {\n if ( typeof time == 'number' ) {\n return time;\n }\n var matches = time.match( /(^\\d*\\.?\\d*)(\\w*)/ );\n var num = matches && matches[1];\n var unit = matches && matches[2];\n if ( !num.length ) {\n return 0;\n }\n num = parseFloat( num );\n var mult = msUnits[ unit ] || 1;\n return num * mult;\n}\n\n// ----- fin ----- //\n\n// back in global\nOutlayer.Item = Item;\n\nreturn Outlayer;\n\n}));\n\n\n//# sourceURL=webpack://gotw/./node_modules/outlayer/outlayer.js?",
);
/***/
},
/***/ "./node_modules/tiny-slider/dist/tiny-slider.js":
/*!******************************************************!*\
!*** ./node_modules/tiny-slider/dist/tiny-slider.js ***!
\******************************************************/
/***/ (__unused_webpack_module, exports) => {
"use strict";
eval(
"\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n\nvar win$1 = window;\nvar raf = win$1.requestAnimationFrame || win$1.webkitRequestAnimationFrame || win$1.mozRequestAnimationFrame || win$1.msRequestAnimationFrame || function (cb) {\n return setTimeout(cb, 16);\n};\n\nvar win = window;\nvar caf = win.cancelAnimationFrame || win.mozCancelAnimationFrame || function (id) {\n clearTimeout(id);\n};\n\nfunction extend() {\n var obj,\n name,\n copy,\n target = arguments[0] || {},\n i = 1,\n length = arguments.length;\n\n for (; i < length; i++) {\n if ((obj = arguments[i]) !== null) {\n for (name in obj) {\n copy = obj[name];\n\n if (target === copy) {\n continue;\n } else if (copy !== undefined) {\n target[name] = copy;\n }\n }\n }\n }\n\n return target;\n}\n\nfunction checkStorageValue(value) {\n return ['true', 'false'].indexOf(value) >= 0 ? JSON.parse(value) : value;\n}\n\nfunction setLocalStorage(storage, key, value, access) {\n if (access) {\n try {\n storage.setItem(key, value);\n } catch (e) {}\n }\n\n return value;\n}\n\nfunction getSlideId() {\n var id = window.tnsId;\n window.tnsId = !id ? 1 : id + 1;\n return 'tns' + window.tnsId;\n}\n\nfunction getBody() {\n var doc = document,\n body = doc.body;\n\n if (!body) {\n body = doc.createElement('body');\n body.fake = true;\n }\n\n return body;\n}\n\nvar docElement = document.documentElement;\n\nfunction setFakeBody(body) {\n var docOverflow = '';\n\n if (body.fake) {\n docOverflow = docElement.style.overflow; //avoid crashing IE8, if background image is used\n\n body.style.background = ''; //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible\n\n body.style.overflow = docElement.style.overflow = 'hidden';\n docElement.appendChild(body);\n }\n\n return docOverflow;\n}\n\nfunction resetFakeBody(body, docOverflow) {\n if (body.fake) {\n body.remove();\n docElement.style.overflow = docOverflow; // Trigger layout so kinetic scrolling isn't disabled in iOS6+\n // eslint-disable-next-line\n\n docElement.offsetHeight;\n }\n}\n\n// get css-calc \nfunction calc() {\n var doc = document,\n body = getBody(),\n docOverflow = setFakeBody(body),\n div = doc.createElement('div'),\n result = false;\n body.appendChild(div);\n\n try {\n var str = '(10px * 10)',\n vals = ['calc' + str, '-moz-calc' + str, '-webkit-calc' + str],\n val;\n\n for (var i = 0; i < 3; i++) {\n val = vals[i];\n div.style.width = val;\n\n if (div.offsetWidth === 100) {\n result = val.replace(str, '');\n break;\n }\n }\n } catch (e) {}\n\n body.fake ? resetFakeBody(body, docOverflow) : div.remove();\n return result;\n}\n\n// get subpixel support value\nfunction percentageLayout() {\n // check subpixel layout supporting\n var doc = document,\n body = getBody(),\n docOverflow = setFakeBody(body),\n wrapper = doc.createElement('div'),\n outer = doc.createElement('div'),\n str = '',\n count = 70,\n perPage = 3,\n supported = false;\n wrapper.className = \"tns-t-subp2\";\n outer.className = \"tns-t-ct\";\n\n for (var i = 0; i < count; i++) {\n str += '<div></div>';\n }\n\n outer.innerHTML = str;\n wrapper.appendChild(outer);\n body.appendChild(wrapper);\n supported = Math.abs(wrapper.getBoundingClientRect().left - outer.children[count - perPage].getBoundingClientRect().left) < 2;\n body.fake ? resetFakeBody(body, docOverflow) : wrapper.remove();\n return supported;\n}\n\nfunction mediaquerySupport() {\n if (window.matchMedia || window.msMatchMedia) {\n return true;\n }\n\n var doc = document,\n body = getBody(),\n docOverflow = setFakeBody(body),\n div = doc.createElement('div'),\n style = doc.createElement('style'),\n rule = '@media all and (min-width:1px){.tns-mq-test{position:absolute}}',\n position;\n style.type = 'text/css';\n div.className = 'tns-mq-test';\n body.appendChild(style);\n body.appendChild(div);\n\n if (style.styleSheet) {\n style.styleSheet.cssText = rule;\n } else {\n style.appendChild(doc.createTextNode(rule));\n }\n\n position = window.getComputedStyle ? window.getComputedStyle(div).position : div.currentStyle['position'];\n body.fake ? resetFakeBody(body, docOverflow) : div.remove();\n return position === \"absolute\";\n}\n\n// create and append style sheet\nfunction createStyleSheet(media, nonce) {\n // Create the <style> tag\n var style = document.createElement(\"style\"); // style.setAttribute(\"type\", \"text/css\");\n // Add a media (and/or media query) here if you'd like!\n // style.setAttribute(\"media\", \"screen\")\n // style.setAttribute(\"media\", \"only screen and (max-width : 1024px)\")\n\n if (media) {\n style.setAttribute(\"media\", media);\n } // Add nonce attribute for Content Security Policy\n\n\n if (nonce) {\n style.setAttribute(\"nonce\", nonce);\n } // WebKit hack :(\n // style.appendChild(document.createTextNode(\"\"));\n // Add the <style> element to the page\n\n\n document.querySelector('head').appendChild(style);\n return style.sheet ? style.sheet : style.styleSheet;\n}\n\n// cross browsers addRule method\nfunction addCSSRule(sheet, selector, rules, index) {\n // return raf(function() {\n 'insertRule' in sheet ? sheet.insertRule(selector + '{' + rules + '}', index) : sheet.addRule(selector, rules, index); // });\n}\n\n// cross browsers addRule method\nfunction removeCSSRule(sheet, index) {\n // return raf(function() {\n 'deleteRule' in sheet ? sheet.deleteRule(index) : sheet.removeRule(index); // });\n}\n\nfunction getCssRulesLength(sheet) {\n var rule = 'insertRule' in sheet ? sheet.cssRules : sheet.rules;\n return rule.length;\n}\n\nfunction toDegree(y, x) {\n return Math.atan2(y, x) * (180 / Math.PI);\n}\n\nfunction getTouchDirection(angle, range) {\n var direction = false,\n gap = Math.abs(90 - Math.abs(angle));\n\n if (gap >= 90 - range) {\n direction = 'horizontal';\n } else if (gap <= range) {\n direction = 'vertical';\n }\n\n return direction;\n}\n\n// https://toddmotto.com/ditch-the-array-foreach-call-nodelist-hack/\nfunction forEach(arr, callback, scope) {\n for (var i = 0, l = arr.length; i < l; i++) {\n callback.call(scope, arr[i], i);\n }\n}\n\nvar classListSupport = ('classList' in document.createElement('_'));\n\nvar hasClass = classListSupport ? function (el, str) {\n return el.classList.contains(str);\n} : function (el, str) {\n return el.className.indexOf(str) >= 0;\n};\n\nvar addClass = classListSupport ? function (el, str) {\n if (!hasClass(el, str)) {\n el.classList.add(str);\n }\n} : function (el, str) {\n if (!hasClass(el, str)) {\n el.className += ' ' + str;\n }\n};\n\nvar removeClass = classListSupport ? function (el, str) {\n if (hasClass(el, str)) {\n el.classList.remove(str);\n }\n} : function (el, str) {\n if (hasClass(el, str)) {\n el.className = el.className.replace(str, '');\n }\n};\n\nfunction hasAttr(el, attr) {\n return el.hasAttribute(attr);\n}\n\nfunction getAttr(el, attr) {\n return el.getAttribute(attr);\n}\n\nfunction isNodeList(el) {\n // Only NodeList has the \"item()\" function\n return typeof el.item !== \"undefined\";\n}\n\nfunction setAttrs(els, attrs) {\n els = isNodeList(els) || els instanceof Array ? els : [els];\n\n if (Object.prototype.toString.call(attrs) !== '[object Object]') {\n return;\n }\n\n for (var i = els.length; i--;) {\n for (var key in attrs) {\n els[i].setAttribute(key, attrs[key]);\n }\n }\n}\n\nfunction removeAttrs(els, attrs) {\n els = isNodeList(els) || els instanceof Array ? els : [els];\n attrs = attrs instanceof Array ? attrs : [attrs];\n var attrLength = attrs.length;\n\n for (var i = els.length; i--;) {\n for (var j = attrLength; j--;) {\n els[i].removeAttribute(attrs[j]);\n }\n }\n}\n\nfunction arrayFromNodeList(nl) {\n var arr = [];\n\n for (var i = 0, l = nl.length; i < l; i++) {\n arr.push(nl[i]);\n }\n\n return arr;\n}\n\nfunction hideElement(el, forceHide) {\n if (el.style.display !== 'none') {\n el.style.display = 'none';\n }\n}\n\nfunction showElement(el, forceHide) {\n if (el.style.display === 'none') {\n el.style.display = '';\n }\n}\n\nfunction isVisible(el) {\n return window.getComputedStyle(el).display !== 'none';\n}\n\nfunction whichProperty(props) {\n if (typeof props === 'string') {\n var arr = [props],\n Props = props.charAt(0).toUpperCase() + props.substr(1),\n prefixes = ['Webkit', 'Moz', 'ms', 'O'];\n prefixes.forEach(function (prefix) {\n if (prefix !== 'ms' || props === 'transform') {\n arr.push(prefix + Props);\n }\n });\n props = arr;\n }\n\n var el = document.createElement('fakeelement');\n props.length;\n\n for (var i = 0; i < props.length; i++) {\n var prop = props[i];\n\n if (el.style[prop] !== undefined) {\n return prop;\n }\n }\n\n return false; // explicit for ie9-\n}\n\nfunction has3DTransforms(tf) {\n if (!tf) {\n return false;\n }\n\n if (!window.getComputedStyle) {\n return false;\n }\n\n var doc = document,\n body = getBody(),\n docOverflow = setFakeBody(body),\n el = doc.createElement('p'),\n has3d,\n cssTF = tf.length > 9 ? '-' + tf.slice(0, -9).toLowerCase() + '-' : '';\n cssTF += 'transform'; // Add it to the body to get the computed style\n\n body.insertBefore(el, null);\n el.style[tf] = 'translate3d(1px,1px,1px)';\n has3d = window.getComputedStyle(el).getPropertyValue(cssTF);\n body.fake ? resetFakeBody(body, docOverflow) : el.remove();\n return has3d !== undefined && has3d.length > 0 && has3d !== \"none\";\n}\n\n// get transitionend, animationend based on transitionDuration\n// @propin: string\n// @propOut: string, first-letter uppercase\n// Usage: getEndProperty('WebkitTransitionDuration', 'Transition') => webkitTransitionEnd\nfunction getEndProperty(propIn, propOut) {\n var endProp = false;\n\n if (/^Webkit/.test(propIn)) {\n endProp = 'webkit' + propOut + 'End';\n } else if (/^O/.test(propIn)) {\n endProp = 'o' + propOut + 'End';\n } else if (propIn) {\n endProp = propOut.toLowerCase() + 'end';\n }\n\n return endProp;\n}\n\n// Test via a getter in the options object to see if the passive property is accessed\nvar supportsPassive = false;\n\ntry {\n var opts = Object.defineProperty({}, 'passive', {\n get: function () {\n supportsPassive = true;\n }\n });\n window.addEventListener(\"test\", null, opts);\n} catch (e) {}\n\nvar passiveOption = supportsPassive ? {\n passive: true\n} : false;\n\nfunction addEvents(el, obj, preventScrolling) {\n for (var prop in obj) {\n var option = ['touchstart', 'touchmove'].indexOf(prop) >= 0 && !preventScrolling ? passiveOption : false;\n el.addEventListener(prop, obj[prop], option);\n }\n}\n\nfunction removeEvents(el, obj) {\n for (var prop in obj) {\n var option = ['touchstart', 'touchmove'].indexOf(prop) >= 0 ? passiveOption : false;\n el.removeEventListener(prop, obj[prop], option);\n }\n}\n\nfunction Events() {\n return {\n topics: {},\n on: function (eventName, fn) {\n this.topics[eventName] = this.topics[eventName] || [];\n this.topics[eventName].push(fn);\n },\n off: function (eventName, fn) {\n if (this.topics[eventName]) {\n for (var i = 0; i < this.topics[eventName].length; i++) {\n if (this.topics[eventName][i] === fn) {\n this.topics[eventName].splice(i, 1);\n break;\n }\n }\n }\n },\n emit: function (eventName, data) {\n data.type = eventName;\n\n if (this.topics[eventName]) {\n this.topics[eventName].forEach(function (fn) {\n fn(data, eventName);\n });\n }\n }\n };\n}\n\nfunction jsTransform(element, attr, prefix, postfix, to, duration, callback) {\n var tick = Math.min(duration, 10),\n unit = to.indexOf('%') >= 0 ? '%' : 'px',\n to = to.replace(unit, ''),\n from = Number(element.style[attr].replace(prefix, '').replace(postfix, '').replace(unit, '')),\n positionTick = (to - from) / duration * tick;\n setTimeout(moveElement, tick);\n\n function moveElement() {\n duration -= tick;\n from += positionTick;\n element.style[attr] = prefix + from + unit + postfix;\n\n if (duration > 0) {\n setTimeout(moveElement, tick);\n } else {\n callback();\n }\n }\n}\n\n// Object.keys\nif (!Object.keys) {\n Object.keys = function (object) {\n var keys = [];\n\n for (var name in object) {\n if (Object.prototype.hasOwnProperty.call(object, name)) {\n keys.push(name);\n }\n }\n\n return keys;\n };\n} // ChildNode.remove\n\n\nif (!(\"remove\" in Element.prototype)) {\n Element.prototype.remove = function () {\n if (this.parentNode) {\n this.parentNode.removeChild(this);\n }\n };\n}\nvar tns = function (options) {\n options = extend({\n container: '.slider',\n mode: 'carousel',\n axis: 'horizontal',\n items: 1,\n gutter: 0,\n edgePadding: 0,\n fixedWidth: false,\n autoWidth: false,\n viewportMax: false,\n slideBy: 1,\n center: false,\n controls: true,\n controlsPosition: 'top',\n controlsText: ['prev', 'next'],\n controlsContainer: false,\n prevButton: false,\n nextButton: false,\n nav: true,\n navPosition: 'top',\n navContainer: false,\n navAsThumbnails: false,\n arrowKeys: false,\n speed: 300,\n autoplay: false,\n autoplayPosition: 'top',\n autoplayTimeout: 5000,\n autoplayDirection: 'forward',\n autoplayText: ['start', 'stop'],\n autoplayHoverPause: false,\n autoplayButton: false,\n autoplayButtonOutput: true,\n autoplayResetOnVisibility: true,\n animateIn: 'tns-fadeIn',\n animateOut: 'tns-fadeOut',\n animateNormal: 'tns-normal',\n animateDelay: false,\n loop: true,\n rewind: false,\n autoHeight: false,\n responsive: false,\n lazyload: false,\n lazyloadSelector: '.tns-lazy-img',\n touch: true,\n mouseDrag: false,\n swipeAngle: 15,\n nested: false,\n preventActionWhenRunning: false,\n preventScrollOnTouch: false,\n freezable: true,\n onInit: false,\n useLocalStorage: true,\n nonce: false\n }, options || {});\n var doc = document,\n win = window,\n KEYS = {\n ENTER: 13,\n SPACE: 32,\n LEFT: 37,\n RIGHT: 39\n },\n tnsStorage = {},\n localStorageAccess = options.useLocalStorage;\n\n if (localStorageAccess) {\n // check browser version and local storage access\n var browserInfo = navigator.userAgent;\n var uid = new Date();\n\n try {\n tnsStorage = win.localStorage;\n\n if (tnsStorage) {\n tnsStorage.setItem(uid, uid);\n localStorageAccess = tnsStorage.getItem(uid) == uid;\n tnsStorage.removeItem(uid);\n } else {\n localStorageAccess = false;\n }\n\n if (!localStorageAccess) {\n tnsStorage = {};\n }\n } catch (e) {\n localStorageAccess = false;\n }\n\n if (localStorageAccess) {\n // remove storage when browser version changes\n if (tnsStorage['tnsApp'] && tnsStorage['tnsApp'] !== browserInfo) {\n ['tC', 'tPL', 'tMQ', 'tTf', 't3D', 'tTDu', 'tTDe', 'tADu', 'tADe', 'tTE', 'tAE'].forEach(function (item) {\n tnsStorage.removeItem(item);\n });\n } // update browserInfo\n\n\n localStorage['tnsApp'] = browserInfo;\n }\n }\n\n var CALC = tnsStorage['tC'] ? checkStorageValue(tnsStorage['tC']) : setLocalStorage(tnsStorage, 'tC', calc(), localStorageAccess),\n PERCENTAGELAYOUT = tnsStorage['tPL'] ? checkStorageValue(tnsStorage['tPL']) : setLocalStorage(tnsStorage, 'tPL', percentageLayout(), localStorageAccess),\n CSSMQ = tnsStorage['tMQ'] ? checkStorageValue(tnsStorage['tMQ']) : setLocalStorage(tnsStorage, 'tMQ', mediaquerySupport(), localStorageAccess),\n TRANSFORM = tnsStorage['tTf'] ? checkStorageValue(tnsStorage['tTf']) : setLocalStorage(tnsStorage, 'tTf', whichProperty('transform'), localStorageAccess),\n HAS3DTRANSFORMS = tnsStorage['t3D'] ? checkStorageValue(tnsStorage['t3D']) : setLocalStorage(tnsStorage, 't3D', has3DTransforms(TRANSFORM), localStorageAccess),\n TRANSITIONDURATION = tnsStorage['tTDu'] ? checkStorageValue(tnsStorage['tTDu']) : setLocalStorage(tnsStorage, 'tTDu', whichProperty('transitionDuration'), localStorageAccess),\n TRANSITIONDELAY = tnsStorage['tTDe'] ? checkStorageValue(tnsStorage['tTDe']) : setLocalStorage(tnsStorage, 'tTDe', whichProperty('transitionDelay'), localStorageAccess),\n ANIMATIONDURATION = tnsStorage['tADu'] ? checkStorageValue(tnsStorage['tADu']) : setLocalStorage(tnsStorage, 'tADu', whichProperty('animationDuration'), localStorageAccess),\n ANIMATIONDELAY = tnsStorage['tADe'] ? checkStorageValue(tnsStorage['tADe']) : setLocalStorage(tnsStorage, 'tADe', whichProperty('animationDelay'), localStorageAccess),\n TRANSITIONEND = tnsStorage['tTE'] ? checkStorageValue(tnsStorage['tTE']) : setLocalStorage(tnsStorage, 'tTE', getEndProperty(TRANSITIONDURATION, 'Transition'), localStorageAccess),\n ANIMATIONEND = tnsStorage['tAE'] ? checkStorageValue(tnsStorage['tAE']) : setLocalStorage(tnsStorage, 'tAE', getEndProperty(ANIMATIONDURATION, 'Animation'), localStorageAccess); // get element nodes from selectors\n\n var supportConsoleWarn = win.console && typeof win.console.warn === \"function\",\n tnsList = ['container', 'controlsContainer', 'prevButton', 'nextButton', 'navContainer', 'autoplayButton'],\n optionsElements = {};\n tnsList.forEach(function (item) {\n if (typeof options[item] === 'string') {\n var str = options[item],\n el = doc.querySelector(str);\n optionsElements[item] = str;\n\n if (el && el.nodeName) {\n options[item] = el;\n } else {\n if (supportConsoleWarn) {\n console.warn('Can\\'t find', options[item]);\n }\n\n return;\n }\n }\n }); // make sure at least 1 slide\n\n if (options.container.children.length < 1) {\n if (supportConsoleWarn) {\n console.warn('No slides found in', options.container);\n }\n\n return;\n } // update options\n\n\n var responsive = options.responsive,\n nested = options.nested,\n carousel = options.mode === 'carousel' ? true : false;\n\n if (responsive) {\n // apply responsive[0] to options and remove it\n if (0 in responsive) {\n options = extend(options, responsive[0]);\n delete responsive[0];\n }\n\n var responsiveTem = {};\n\n for (var key in responsive) {\n var val = responsive[key]; // update responsive\n // from: 300: 2\n // to:\n // 300: {\n // items: 2\n // }\n\n val = typeof val === 'number' ? {\n items: val\n } : val;\n responsiveTem[key] = val;\n }\n\n responsive = responsiveTem;\n responsiveTem = null;\n } // update options\n\n\n function updateOptions(obj) {\n for (var key in obj) {\n if (!carousel) {\n if (key === 'slideBy') {\n obj[key] = 'page';\n }\n\n if (key === 'edgePadding') {\n obj[key] = false;\n }\n\n if (key === 'autoHeight') {\n obj[key] = false;\n }\n } // update responsive options\n\n\n if (key === 'responsive') {\n updateOptions(obj[key]);\n }\n }\n }\n\n if (!carousel) {\n updateOptions(options);\n } // === define and set variables ===\n\n\n if (!carousel) {\n options.axis = 'horizontal';\n options.slideBy = 'page';\n options.edgePadding = false;\n var animateIn = options.animateIn,\n animateOut = options.animateOut,\n animateDelay = options.animateDelay,\n animateNormal = options.animateNormal;\n }\n\n var horizontal = options.axis === 'horizontal' ? true : false,\n outerWrapper = doc.createElement('div'),\n innerWrapper = doc.createElement('div'),\n middleWrapper,\n container = options.container,\n containerParent = container.parentNode,\n containerHTML = container.outerHTML,\n slideItems = container.children,\n slideCount = slideItems.length,\n breakpointZone,\n windowWidth = getWindowWidth(),\n isOn = false;\n\n if (responsive) {\n setBreakpointZone();\n }\n\n if (carousel) {\n container.className += ' tns-vpfix';\n } // fixedWidth: viewport > rightBoundary > indexMax\n\n\n var autoWidth = options.autoWidth,\n fixedWidth = getOption('fixedWidth'),\n edgePadding = getOption('edgePadding'),\n gutter = getOption('gutter'),\n viewport = getViewportWidth(),\n center = getOption('center'),\n items = !autoWidth ? Math.floor(getOption('items')) : 1,\n slideBy = getOption('slideBy'),\n viewportMax = options.viewportMax || options.fixedWidthViewportWidth,\n arrowKeys = getOption('arrowKeys'),\n speed = getOption('speed'),\n rewind = options.rewind,\n loop = rewind ? false : options.loop,\n autoHeight = getOption('autoHeight'),\n controls = getOption('controls'),\n controlsText = getOption('controlsText'),\n nav = getOption('nav'),\n touch = getOption('touch'),\n mouseDrag = getOption('mouseDrag'),\n autoplay = getOption('autoplay'),\n autoplayTimeout = getOption('autoplayTimeout'),\n autoplayText = getOption('autoplayText'),\n autoplayHoverPause = getOption('autoplayHoverPause'),\n autoplayResetOnVisibility = getOption('autoplayResetOnVisibility'),\n sheet = createStyleSheet(null, getOption('nonce')),\n lazyload = options.lazyload,\n lazyloadSelector = options.lazyloadSelector,\n slidePositions,\n // collection of slide positions\n slideItemsOut = [],\n cloneCount = loop ? getCloneCountForLoop() : 0,\n slideCountNew = !carousel ? slideCount + cloneCount : slideCount + cloneCount * 2,\n hasRightDeadZone = (fixedWidth || autoWidth) && !loop ? true : false,\n rightBoundary = fixedWidth ? getRightBoundary() : null,\n updateIndexBeforeTransform = !carousel || !loop ? true : false,\n // transform\n transformAttr = horizontal ? 'left' : 'top',\n transformPrefix = '',\n transformPostfix = '',\n // index\n getIndexMax = function () {\n if (fixedWidth) {\n return function () {\n return center && !loop ? slideCount - 1 : Math.ceil(-rightBoundary / (fixedWidth + gutter));\n };\n } else if (autoWidth) {\n return function () {\n for (var i = 0; i < slideCountNew; i++) {\n if (slidePositions[i] >= -rightBoundary) {\n return i;\n }\n }\n };\n } else {\n return function () {\n if (center && carousel && !loop) {\n return slideCount - 1;\n } else {\n return loop || carousel ? Math.max(0, slideCountNew - Math.ceil(items)) : slideCountNew - 1;\n }\n };\n }\n }(),\n index = getStartIndex(getOption('startIndex')),\n indexCached = index;\n getCurrentSlide();\n var indexMin = 0,\n indexMax = !autoWidth ? getIndexMax() : null,\n preventActionWhenRunning = options.preventActionWhenRunning,\n swipeAngle = options.swipeAngle,\n moveDirectionExpected = swipeAngle ? '?' : true,\n running = false,\n onInit = options.onInit,\n events = new Events(),\n // id, class\n newContainerClasses = ' tns-slider tns-' + options.mode,\n slideId = container.id || getSlideId(),\n disable = getOption('disable'),\n disabled = false,\n freezable = options.freezable,\n freeze = freezable && !autoWidth ? getFreeze() : false,\n frozen = false,\n controlsEvents = {\n 'click': onControlsClick,\n 'keydown': onControlsKeydown\n },\n navEvents = {\n 'click': onNavClick,\n 'keydown': onNavKeydown\n },\n hoverEvents = {\n 'mouseover': mouseoverPause,\n 'mouseout': mouseoutRestart\n },\n visibilityEvent = {\n 'visibilitychange': onVisibilityChange\n },\n docmentKeydownEvent = {\n 'keydown': onDocumentKeydown\n },\n touchEvents = {\n 'touchstart': onPanStart,\n 'touchmove': onPanMove,\n 'touchend': onPanEnd,\n 'touchcancel': onPanEnd\n },\n dragEvents = {\n 'mousedown': onPanStart,\n 'mousemove': onPanMove,\n 'mouseup': onPanEnd,\n 'mouseleave': onPanEnd\n },\n hasControls = hasOption('controls'),\n hasNav = hasOption('nav'),\n navAsThumbnails = autoWidth ? true : options.navAsThumbnails,\n hasAutoplay = hasOption('autoplay'),\n hasTouch = hasOption('touch'),\n hasMouseDrag = hasOption('mouseDrag'),\n slideActiveClass = 'tns-slide-active',\n slideClonedClass = 'tns-slide-cloned',\n imgCompleteClass = 'tns-complete',\n imgEvents = {\n 'load': onImgLoaded,\n 'error': onImgFailed\n },\n imgsComplete,\n liveregionCurrent,\n preventScroll = options.preventScrollOnTouch === 'force' ? true : false; // controls\n\n\n if (hasControls) {\n var controlsContainer = options.controlsContainer,\n controlsContainerHTML = options.controlsContainer ? options.controlsContainer.outerHTML : '',\n prevButton = options.prevButton,\n nextButton = options.nextButton,\n prevButtonHTML = options.prevButton ? options.prevButton.outerHTML : '',\n nextButtonHTML = options.nextButton ? options.nextButton.outerHTML : '',\n prevIsButton,\n nextIsButton;\n } // nav\n\n\n if (hasNav) {\n var navContainer = options.navContainer,\n navContainerHTML = options.navContainer ? options.navContainer.outerHTML : '',\n navItems,\n pages = autoWidth ? slideCount : getPages(),\n pagesCached = 0,\n navClicked = -1,\n navCurrentIndex = getCurrentNavIndex(),\n navCurrentIndexCached = navCurrentIndex,\n navActiveClass = 'tns-nav-active',\n navStr = 'Carousel Page ',\n navStrCurrent = ' (Current Slide)';\n } // autoplay\n\n\n if (hasAutoplay) {\n var autoplayDirection = options.autoplayDirection === 'forward' ? 1 : -1,\n autoplayButton = options.autoplayButton,\n autoplayButtonHTML = options.autoplayButton ? options.autoplayButton.outerHTML : '',\n autoplayHtmlStrings = ['<span class=\\'tns-visually-hidden\\'>', ' animation</span>'],\n autoplayTimer,\n animating,\n autoplayHoverPaused,\n autoplayUserPaused,\n autoplayVisibilityPaused;\n }\n\n if (hasTouch || hasMouseDrag) {\n var initPosition = {},\n lastPosition = {},\n translateInit,\n panStart = false,\n rafIndex,\n getDist = horizontal ? function (a, b) {\n return a.x - b.x;\n } : function (a, b) {\n return a.y - b.y;\n };\n } // disable slider when slidecount <= items\n\n\n if (!autoWidth) {\n resetVariblesWhenDisable(disable || freeze);\n }\n\n if (TRANSFORM) {\n transformAttr = TRANSFORM;\n transformPrefix = 'translate';\n\n if (HAS3DTRANSFORMS) {\n transformPrefix += horizontal ? '3d(' : '3d(0px, ';\n transformPostfix = horizontal ? ', 0px, 0px)' : ', 0px)';\n } else {\n transformPrefix += horizontal ? 'X(' : 'Y(';\n transformPostfix = ')';\n }\n }\n\n if (carousel) {\n container.className = container.className.replace('tns-vpfix', '');\n }\n\n initStructure();\n initSheet();\n initSliderTransform(); // === COMMON FUNCTIONS === //\n\n function resetVariblesWhenDisable(condition) {\n if (condition) {\n controls = nav = touch = mouseDrag = arrowKeys = autoplay = autoplayHoverPause = autoplayResetOnVisibility = false;\n }\n }\n\n function getCurrentSlide() {\n var tem = carousel ? index - cloneCount : index;\n\n while (tem < 0) {\n tem += slideCount;\n }\n\n return tem % slideCount + 1;\n }\n\n function getStartIndex(ind) {\n ind = ind ? Math.max(0, Math.min(loop ? slideCount - 1 : slideCount - items, ind)) : 0;\n return carousel ? ind + cloneCount : ind;\n }\n\n function getAbsIndex(i) {\n if (i == null) {\n i = index;\n }\n\n if (carousel) {\n i -= cloneCount;\n }\n\n while (i < 0) {\n i += slideCount;\n }\n\n return Math.floor(i % slideCount);\n }\n\n function getCurrentNavIndex() {\n var absIndex = getAbsIndex(),\n result;\n result = navAsThumbnails ? absIndex : fixedWidth || autoWidth ? Math.ceil((absIndex + 1) * pages / slideCount - 1) : Math.floor(absIndex / items); // set active nav to the last one when reaches the right edge\n\n if (!loop && carousel && index === indexMax) {\n result = pages - 1;\n }\n\n return result;\n }\n\n function getItemsMax() {\n // fixedWidth or autoWidth while viewportMax is not available\n if (autoWidth || fixedWidth && !viewportMax) {\n return slideCount - 1; // most cases\n } else {\n var str = fixedWidth ? 'fixedWidth' : 'items',\n arr = [];\n\n if (fixedWidth || options[str] < slideCount) {\n arr.push(options[str]);\n }\n\n if (responsive) {\n for (var bp in responsive) {\n var tem = responsive[bp][str];\n\n if (tem && (fixedWidth || tem < slideCount)) {\n arr.push(tem);\n }\n }\n }\n\n if (!arr.length) {\n arr.push(0);\n }\n\n return Math.ceil(fixedWidth ? viewportMax / Math.min.apply(null, arr) : Math.max.apply(null, arr));\n }\n }\n\n function getCloneCountForLoop() {\n var itemsMax = getItemsMax(),\n result = carousel ? Math.ceil((itemsMax * 5 - slideCount) / 2) : itemsMax * 4 - slideCount;\n result = Math.max(itemsMax, result);\n return hasOption('edgePadding') ? result + 1 : result;\n }\n\n function getWindowWidth() {\n return win.innerWidth || doc.documentElement.clientWidth || doc.body.clientWidth;\n }\n\n function getInsertPosition(pos) {\n return pos === 'top' ? 'afterbegin' : 'beforeend';\n }\n\n function getClientWidth(el) {\n if (el == null) {\n return;\n }\n\n var div = doc.createElement('div'),\n rect,\n width;\n el.appendChild(div);\n rect = div.getBoundingClientRect();\n width = rect.right - rect.left;\n div.remove();\n return width || getClientWidth(el.parentNode);\n }\n\n function getViewportWidth() {\n var gap = edgePadding ? edgePadding * 2 - gutter : 0;\n return getClientWidth(containerParent) - gap;\n }\n\n function hasOption(item) {\n if (options[item]) {\n return true;\n } else {\n if (responsive) {\n for (var bp in responsive) {\n if (responsive[bp][item]) {\n return true;\n }\n }\n }\n\n return false;\n }\n } // get option:\n // fixed width: viewport, fixedWidth, gutter => items\n // others: window width => all variables\n // all: items => slideBy\n\n\n function getOption(item, ww) {\n if (ww == null) {\n ww = windowWidth;\n }\n\n if (item === 'items' && fixedWidth) {\n return Math.floor((viewport + gutter) / (fixedWidth + gutter)) || 1;\n } else {\n var result = options[item];\n\n if (responsive) {\n for (var bp in responsive) {\n // bp: convert string to number\n if (ww >= parseInt(bp)) {\n if (item in responsive[bp]) {\n result = responsive[bp][item];\n }\n }\n }\n }\n\n if (item === 'slideBy' && result === 'page') {\n result = getOption('items');\n }\n\n if (!carousel && (item === 'slideBy' || item === 'items')) {\n result = Math.floor(result);\n }\n\n return result;\n }\n }\n\n function getSlideMarginLeft(i) {\n return CALC ? CALC + '(' + i * 100 + '% / ' + slideCountNew + ')' : i * 100 / slideCountNew + '%';\n }\n\n function getInnerWrapperStyles(edgePaddingTem, gutterTem, fixedWidthTem, speedTem, autoHeightBP) {\n var str = '';\n\n if (edgePaddingTem !== undefined) {\n var gap = edgePaddingTem;\n\n if (gutterTem) {\n gap -= gutterTem;\n }\n\n str = horizontal ? 'margin: 0 ' + gap + 'px 0 ' + edgePaddingTem + 'px;' : 'margin: ' + edgePaddingTem + 'px 0 ' + gap + 'px 0;';\n } else if (gutterTem && !fixedWidthTem) {\n var gutterTemUnit = '-' + gutterTem + 'px',\n dir = horizontal ? gutterTemUnit + ' 0 0' : '0 ' + gutterTemUnit + ' 0';\n str = 'margin: 0 ' + dir + ';';\n }\n\n if (!carousel && autoHeightBP && TRANSITIONDURATION && speedTem) {\n str += getTransitionDurationStyle(speedTem);\n }\n\n return str;\n }\n\n function getContainerWidth(fixedWidthTem, gutterTem, itemsTem) {\n if (fixedWidthTem) {\n return (fixedWidthTem + gutterTem) * slideCountNew + 'px';\n } else {\n return CALC ? CALC + '(' + slideCountNew * 100 + '% / ' + itemsTem + ')' : slideCountNew * 100 / itemsTem + '%';\n }\n }\n\n function getSlideWidthStyle(fixedWidthTem, gutterTem, itemsTem) {\n var width;\n\n if (fixedWidthTem) {\n width = fixedWidthTem + gutterTem + 'px';\n } else {\n if (!carousel) {\n itemsTem = Math.floor(itemsTem);\n }\n\n var dividend = carousel ? slideCountNew : itemsTem;\n width = CALC ? CALC + '(100% / ' + dividend + ')' : 100 / dividend + '%';\n }\n\n width = 'width:' + width; // inner slider: overwrite outer slider styles\n\n return nested !== 'inner' ? width + ';' : width + ' !important;';\n }\n\n function getSlideGutterStyle(gutterTem) {\n var str = ''; // gutter maybe interger || 0\n // so can't use 'if (gutter)'\n\n if (gutterTem !== false) {\n var prop = horizontal ? 'padding-' : 'margin-',\n dir = horizontal ? 'right' : 'bottom';\n str = prop + dir + ': ' + gutterTem + 'px;';\n }\n\n return str;\n }\n\n function getCSSPrefix(name, num) {\n var prefix = name.substring(0, name.length - num).toLowerCase();\n\n if (prefix) {\n prefix = '-' + prefix + '-';\n }\n\n return prefix;\n }\n\n function getTransitionDurationStyle(speed) {\n return getCSSPrefix(TRANSITIONDURATION, 18) + 'transition-duration:' + speed / 1000 + 's;';\n }\n\n function getAnimationDurationStyle(speed) {\n return getCSSPrefix(ANIMATIONDURATION, 17) + 'animation-duration:' + speed / 1000 + 's;';\n }\n\n function initStructure() {\n var classOuter = 'tns-outer',\n classInner = 'tns-inner';\n hasOption('gutter');\n outerWrapper.className = classOuter;\n innerWrapper.className = classInner;\n outerWrapper.id = slideId + '-ow';\n innerWrapper.id = slideId + '-iw'; // set container properties\n\n if (container.id === '') {\n container.id = slideId;\n }\n\n newContainerClasses += PERCENTAGELAYOUT || autoWidth ? ' tns-subpixel' : ' tns-no-subpixel';\n newContainerClasses += CALC ? ' tns-calc' : ' tns-no-calc';\n\n if (autoWidth) {\n newContainerClasses += ' tns-autowidth';\n }\n\n newContainerClasses += ' tns-' + options.axis;\n container.className += newContainerClasses; // add constrain layer for carousel\n\n if (carousel) {\n middleWrapper = doc.createElement('div');\n middleWrapper.id = slideId + '-mw';\n middleWrapper.className = 'tns-ovh';\n outerWrapper.appendChild(middleWrapper);\n middleWrapper.appendChild(innerWrapper);\n } else {\n outerWrapper.appendChild(innerWrapper);\n }\n\n if (autoHeight) {\n var wp = middleWrapper ? middleWrapper : innerWrapper;\n wp.className += ' tns-ah';\n }\n\n containerParent.insertBefore(outerWrapper, container);\n innerWrapper.appendChild(container); // add id, class, aria attributes\n // before clone slides\n\n forEach(slideItems, function (item, i) {\n addClass(item, 'tns-item');\n\n if (!item.id) {\n item.id = slideId + '-item' + i;\n }\n\n if (!carousel && animateNormal) {\n addClass(item, animateNormal);\n }\n\n setAttrs(item, {\n 'aria-hidden': 'true',\n 'tabindex': '-1'\n });\n }); // ## clone slides\n // carousel: n + slides + n\n // gallery: slides + n\n\n if (cloneCount) {\n var fragmentBefore = doc.createDocumentFragment(),\n fragmentAfter = doc.createDocumentFragment();\n\n for (var j = cloneCount; j--;) {\n var num = j % slideCount,\n cloneFirst = slideItems[num].cloneNode(true);\n addClass(cloneFirst, slideClonedClass);\n removeAttrs(cloneFirst, 'id');\n fragmentAfter.insertBefore(cloneFirst, fragmentAfter.firstChild);\n\n if (carousel) {\n var cloneLast = slideItems[slideCount - 1 - num].cloneNode(true);\n addClass(cloneLast, slideClonedClass);\n removeAttrs(cloneLast, 'id');\n fragmentBefore.appendChild(cloneLast);\n }\n }\n\n container.insertBefore(fragmentBefore, container.firstChild);\n container.appendChild(fragmentAfter);\n slideItems = container.children;\n }\n }\n\n function initSliderTransform() {\n // ## images loaded/failed\n if (hasOption('autoHeight') || autoWidth || !horizontal) {\n var imgs = container.querySelectorAll('img'); // add img load event listener\n\n forEach(imgs, function (img) {\n var src = img.src;\n\n if (!lazyload) {\n // not data img\n if (src && src.indexOf('data:image') < 0) {\n img.src = '';\n addEvents(img, imgEvents);\n addClass(img, 'loading');\n img.src = src; // data img\n } else {\n imgLoaded(img);\n }\n }\n }); // set imgsComplete\n\n raf(function () {\n imgsLoadedCheck(arrayFromNodeList(imgs), function () {\n imgsComplete = true;\n });\n }); // reset imgs for auto height: check visible imgs only\n\n if (hasOption('autoHeight')) {\n imgs = getImageArray(index, Math.min(index + items - 1, slideCountNew - 1));\n }\n\n lazyload ? initSliderTransformStyleCheck() : raf(function () {\n imgsLoadedCheck(arrayFromNodeList(imgs), initSliderTransformStyleCheck);\n });\n } else {\n // set container transform property\n if (carousel) {\n doContainerTransformSilent();\n } // update slider tools and events\n\n\n initTools();\n initEvents();\n }\n }\n\n function initSliderTransformStyleCheck() {\n if (autoWidth && slideCount > 1) {\n // check styles application\n var num = loop ? index : slideCount - 1;\n\n (function stylesApplicationCheck() {\n var left = slideItems[num].getBoundingClientRect().left;\n var right = slideItems[num - 1].getBoundingClientRect().right;\n Math.abs(left - right) <= 1 ? initSliderTransformCore() : setTimeout(function () {\n stylesApplicationCheck();\n }, 16);\n })();\n } else {\n initSliderTransformCore();\n }\n }\n\n function initSliderTransformCore() {\n // run Fn()s which are rely on image loading\n if (!horizontal || autoWidth) {\n setSlidePositions();\n\n if (autoWidth) {\n rightBoundary = getRightBoundary();\n\n if (freezable) {\n freeze = getFreeze();\n }\n\n indexMax = getIndexMax(); // <= slidePositions, rightBoundary <=\n\n resetVariblesWhenDisable(disable || freeze);\n } else {\n updateContentWrapperHeight();\n }\n } // set container transform property\n\n\n if (carousel) {\n doContainerTransformSilent();\n } // update slider tools and events\n\n\n initTools();\n initEvents();\n }\n\n function initSheet() {\n // gallery:\n // set animation classes and left value for gallery slider\n if (!carousel) {\n for (var i = index, l = index + Math.min(slideCount, items); i < l; i++) {\n var item = slideItems[i];\n item.style.left = (i - index) * 100 / items + '%';\n addClass(item, animateIn);\n removeClass(item, animateNormal);\n }\n } // #### LAYOUT\n // ## INLINE-BLOCK VS FLOAT\n // ## PercentageLayout:\n // slides: inline-block\n // remove blank space between slides by set font-size: 0\n // ## Non PercentageLayout:\n // slides: float\n // margin-right: -100%\n // margin-left: ~\n // Resource: https://docs.google.com/spreadsheets/d/147up245wwTXeQYve3BRSAD4oVcvQmuGsFteJOeA5xNQ/edit?usp=sharing\n\n\n if (horizontal) {\n if (PERCENTAGELAYOUT || autoWidth) {\n addCSSRule(sheet, '#' + slideId + ' > .tns-item', 'font-size:' + win.getComputedStyle(slideItems[0]).fontSize + ';', getCssRulesLength(sheet));\n addCSSRule(sheet, '#' + slideId, 'font-size:0;', getCssRulesLength(sheet));\n } else if (carousel) {\n forEach(slideItems, function (slide, i) {\n slide.style.marginLeft = getSlideMarginLeft(i);\n });\n }\n } // ## BASIC STYLES\n\n\n if (CSSMQ) {\n // middle wrapper style\n if (TRANSITIONDURATION) {\n var str = middleWrapper && options.autoHeight ? getTransitionDurationStyle(options.speed) : '';\n addCSSRule(sheet, '#' + slideId + '-mw', str, getCssRulesLength(sheet));\n } // inner wrapper styles\n\n\n str = getInnerWrapperStyles(options.edgePadding, options.gutter, options.fixedWidth, options.speed, options.autoHeight);\n addCSSRule(sheet, '#' + slideId + '-iw', str, getCssRulesLength(sheet)); // container styles\n\n if (carousel) {\n str = horizontal && !autoWidth ? 'width:' + getContainerWidth(options.fixedWidth, options.gutter, options.items) + ';' : '';\n\n if (TRANSITIONDURATION) {\n str += getTransitionDurationStyle(speed);\n }\n\n addCSSRule(sheet, '#' + slideId, str, getCssRulesLength(sheet));\n } // slide styles\n\n\n str = horizontal && !autoWidth ? getSlideWidthStyle(options.fixedWidth, options.gutter, options.items) : '';\n\n if (options.gutter) {\n str += getSlideGutterStyle(options.gutter);\n } // set gallery items transition-duration\n\n\n if (!carousel) {\n if (TRANSITIONDURATION) {\n str += getTransitionDurationStyle(speed);\n }\n\n if (ANIMATIONDURATION) {\n str += getAnimationDurationStyle(speed);\n }\n }\n\n if (str) {\n addCSSRule(sheet, '#' + slideId + ' > .tns-item', str, getCssRulesLength(sheet));\n } // non CSS mediaqueries: IE8\n // ## update inner wrapper, container, slides if needed\n // set inline styles for inner wrapper & container\n // insert stylesheet (one line) for slides only (since slides are many)\n\n } else {\n // middle wrapper styles\n update_carousel_transition_duration(); // inner wrapper styles\n\n innerWrapper.style.cssText = getInnerWrapperStyles(edgePadding, gutter, fixedWidth, autoHeight); // container styles\n\n if (carousel && horizontal && !autoWidth) {\n container.style.width = getContainerWidth(fixedWidth, gutter, items);\n } // slide styles\n\n\n var str = horizontal && !autoWidth ? getSlideWidthStyle(fixedWidth, gutter, items) : '';\n\n if (gutter) {\n str += getSlideGutterStyle(gutter);\n } // append to the last line\n\n\n if (str) {\n addCSSRule(sheet, '#' + slideId + ' > .tns-item', str, getCssRulesLength(sheet));\n }\n } // ## MEDIAQUERIES\n\n\n if (responsive && CSSMQ) {\n for (var bp in responsive) {\n // bp: convert string to number\n bp = parseInt(bp);\n var opts = responsive[bp],\n str = '',\n middleWrapperStr = '',\n innerWrapperStr = '',\n containerStr = '',\n slideStr = '',\n itemsBP = !autoWidth ? getOption('items', bp) : null,\n fixedWidthBP = getOption('fixedWidth', bp),\n speedBP = getOption('speed', bp),\n edgePaddingBP = getOption('edgePadding', bp),\n autoHeightBP = getOption('autoHeight', bp),\n gutterBP = getOption('gutter', bp); // middle wrapper string\n\n if (TRANSITIONDURATION && middleWrapper && getOption('autoHeight', bp) && 'speed' in opts) {\n middleWrapperStr = '#' + slideId + '-mw{' + getTransitionDurationStyle(speedBP) + '}';\n } // inner wrapper string\n\n\n if ('edgePadding' in opts || 'gutter' in opts) {\n innerWrapperStr = '#' + slideId + '-iw{' + getInnerWrapperStyles(edgePaddingBP, gutterBP, fixedWidthBP, speedBP, autoHeightBP) + '}';\n } // container string\n\n\n if (carousel && horizontal && !autoWidth && ('fixedWidth' in opts || 'items' in opts || fixedWidth && 'gutter' in opts)) {\n containerStr = 'width:' + getContainerWidth(fixedWidthBP, gutterBP, itemsBP) + ';';\n }\n\n if (TRANSITIONDURATION && 'speed' in opts) {\n containerStr += getTransitionDurationStyle(speedBP);\n }\n\n if (containerStr) {\n containerStr = '#' + slideId + '{' + containerStr + '}';\n } // slide string\n\n\n if ('fixedWidth' in opts || fixedWidth && 'gutter' in opts || !carousel && 'items' in opts) {\n slideStr += getSlideWidthStyle(fixedWidthBP, gutterBP, itemsBP);\n }\n\n if ('gutter' in opts) {\n slideStr += getSlideGutterStyle(gutterBP);\n } // set gallery items transition-duration\n\n\n if (!carousel && 'speed' in opts) {\n if (TRANSITIONDURATION) {\n slideStr += getTransitionDurationStyle(speedBP);\n }\n\n if (ANIMATIONDURATION) {\n slideStr += getAnimationDurationStyle(speedBP);\n }\n }\n\n if (slideStr) {\n slideStr = '#' + slideId + ' > .tns-item{' + slideStr + '}';\n } // add up\n\n\n str = middleWrapperStr + innerWrapperStr + containerStr + slideStr;\n\n if (str) {\n sheet.insertRule('@media (min-width: ' + bp / 16 + 'em) {' + str + '}', sheet.cssRules.length);\n }\n }\n }\n }\n\n function initTools() {\n // == slides ==\n updateSlideStatus(); // == live region ==\n\n outerWrapper.insertAdjacentHTML('afterbegin', '<div class=\"tns-liveregion tns-visually-hidden\" aria-live=\"polite\" aria-atomic=\"true\">slide <span class=\"current\">' + getLiveRegionStr() + '</span> of ' + slideCount + '</div>');\n liveregionCurrent = outerWrapper.querySelector('.tns-liveregion .current'); // == autoplayInit ==\n\n if (hasAutoplay) {\n var txt = autoplay ? 'stop' : 'start';\n\n if (autoplayButton) {\n setAttrs(autoplayButton, {\n 'data-action': txt\n });\n } else if (options.autoplayButtonOutput) {\n outerWrapper.insertAdjacentHTML(getInsertPosition(options.autoplayPosition), '<button type=\"button\" data-action=\"' + txt + '\">' + autoplayHtmlStrings[0] + txt + autoplayHtmlStrings[1] + autoplayText[0] + '</button>');\n autoplayButton = outerWrapper.querySelector('[data-action]');\n } // add event\n\n\n if (autoplayButton) {\n addEvents(autoplayButton, {\n 'click': toggleAutoplay\n });\n }\n\n if (autoplay) {\n startAutoplay();\n\n if (autoplayHoverPause) {\n addEvents(container, hoverEvents);\n }\n\n if (autoplayResetOnVisibility) {\n addEvents(container, visibilityEvent);\n }\n }\n } // == navInit ==\n\n\n if (hasNav) {\n // will not hide the navs in case they're thumbnails\n\n if (navContainer) {\n setAttrs(navContainer, {\n 'aria-label': 'Carousel Pagination'\n });\n navItems = navContainer.children;\n forEach(navItems, function (item, i) {\n setAttrs(item, {\n 'data-nav': i,\n 'tabindex': '-1',\n 'aria-label': navStr + (i + 1),\n 'aria-controls': slideId\n });\n }); // generated nav\n } else {\n var navHtml = '',\n hiddenStr = navAsThumbnails ? '' : 'style=\"display:none\"';\n\n for (var i = 0; i < slideCount; i++) {\n // hide nav items by default\n navHtml += '<button type=\"button\" data-nav=\"' + i + '\" tabindex=\"-1\" aria-controls=\"' + slideId + '\" ' + hiddenStr + ' aria-label=\"' + navStr + (i + 1) + '\"></button>';\n }\n\n navHtml = '<div class=\"tns-nav\" aria-label=\"Carousel Pagination\">' + navHtml + '</div>';\n outerWrapper.insertAdjacentHTML(getInsertPosition(options.navPosition), navHtml);\n navContainer = outerWrapper.querySelector('.tns-nav');\n navItems = navContainer.children;\n }\n\n updateNavVisibility(); // add transition\n\n if (TRANSITIONDURATION) {\n var prefix = TRANSITIONDURATION.substring(0, TRANSITIONDURATION.length - 18).toLowerCase(),\n str = 'transition: all ' + speed / 1000 + 's';\n\n if (prefix) {\n str = '-' + prefix + '-' + str;\n }\n\n addCSSRule(sheet, '[aria-controls^=' + slideId + '-item]', str, getCssRulesLength(sheet));\n }\n\n setAttrs(navItems[navCurrentIndex], {\n 'aria-label': navStr + (navCurrentIndex + 1) + navStrCurrent\n });\n removeAttrs(navItems[navCurrentIndex], 'tabindex');\n addClass(navItems[navCurrentIndex], navActiveClass); // add events\n\n addEvents(navContainer, navEvents);\n } // == controlsInit ==\n\n\n if (hasControls) {\n if (!controlsContainer && (!prevButton || !nextButton)) {\n outerWrapper.insertAdjacentHTML(getInsertPosition(options.controlsPosition), '<div class=\"tns-controls\" aria-label=\"Carousel Navigation\" tabindex=\"0\"><button type=\"button\" data-controls=\"prev\" tabindex=\"-1\" aria-controls=\"' + slideId + '\">' + controlsText[0] + '</button><button type=\"button\" data-controls=\"next\" tabindex=\"-1\" aria-controls=\"' + slideId + '\">' + controlsText[1] + '</button></div>');\n controlsContainer = outerWrapper.querySelector('.tns-controls');\n }\n\n if (!prevButton || !nextButton) {\n prevButton = controlsContainer.children[0];\n nextButton = controlsContainer.children[1];\n }\n\n if (options.controlsContainer) {\n setAttrs(controlsContainer, {\n 'aria-label': 'Carousel Navigation',\n 'tabindex': '0'\n });\n }\n\n if (options.controlsContainer || options.prevButton && options.nextButton) {\n setAttrs([prevButton, nextButton], {\n 'aria-controls': slideId,\n 'tabindex': '-1'\n });\n }\n\n if (options.controlsContainer || options.prevButton && options.nextButton) {\n setAttrs(prevButton, {\n 'data-controls': 'prev'\n });\n setAttrs(nextButton, {\n 'data-controls': 'next'\n });\n }\n\n prevIsButton = isButton(prevButton);\n nextIsButton = isButton(nextButton);\n updateControlsStatus(); // add events\n\n if (controlsContainer) {\n addEvents(controlsContainer, controlsEvents);\n } else {\n addEvents(prevButton, controlsEvents);\n addEvents(nextButton, controlsEvents);\n }\n } // hide tools if needed\n\n\n disableUI();\n }\n\n function initEvents() {\n // add events\n if (carousel && TRANSITIONEND) {\n var eve = {};\n eve[TRANSITIONEND] = onTransitionEnd;\n addEvents(container, eve);\n }\n\n if (touch) {\n addEvents(container, touchEvents, options.preventScrollOnTouch);\n }\n\n if (mouseDrag) {\n addEvents(container, dragEvents);\n }\n\n if (arrowKeys) {\n addEvents(doc, docmentKeydownEvent);\n }\n\n if (nested === 'inner') {\n events.on('outerResized', function () {\n resizeTasks();\n events.emit('innerLoaded', info());\n });\n } else if (responsive || fixedWidth || autoWidth || autoHeight || !horizontal) {\n addEvents(win, {\n 'resize': onResize\n });\n }\n\n if (autoHeight) {\n if (nested === 'outer') {\n events.on('innerLoaded', doAutoHeight);\n } else if (!disable) {\n doAutoHeight();\n }\n }\n\n doLazyLoad();\n\n if (disable) {\n disableSlider();\n } else if (freeze) {\n freezeSlider();\n }\n\n events.on('indexChanged', additionalUpdates);\n\n if (nested === 'inner') {\n events.emit('innerLoaded', info());\n }\n\n if (typeof onInit === 'function') {\n onInit(info());\n }\n\n isOn = true;\n }\n\n function destroy() {\n // sheet\n sheet.disabled = true;\n\n if (sheet.ownerNode) {\n sheet.ownerNode.remove();\n } // remove win event listeners\n\n\n removeEvents(win, {\n 'resize': onResize\n }); // arrowKeys, controls, nav\n\n if (arrowKeys) {\n removeEvents(doc, docmentKeydownEvent);\n }\n\n if (controlsContainer) {\n removeEvents(controlsContainer, controlsEvents);\n }\n\n if (navContainer) {\n removeEvents(navContainer, navEvents);\n } // autoplay\n\n\n removeEvents(container, hoverEvents);\n removeEvents(container, visibilityEvent);\n\n if (autoplayButton) {\n removeEvents(autoplayButton, {\n 'click': toggleAutoplay\n });\n }\n\n if (autoplay) {\n clearInterval(autoplayTimer);\n } // container\n\n\n if (carousel && TRANSITIONEND) {\n var eve = {};\n eve[TRANSITIONEND] = onTransitionEnd;\n removeEvents(container, eve);\n }\n\n if (touch) {\n removeEvents(container, touchEvents);\n }\n\n if (mouseDrag) {\n removeEvents(container, dragEvents);\n } // cache Object values in options && reset HTML\n\n\n var htmlList = [containerHTML, controlsContainerHTML, prevButtonHTML, nextButtonHTML, navContainerHTML, autoplayButtonHTML];\n tnsList.forEach(function (item, i) {\n var el = item === 'container' ? outerWrapper : options[item];\n\n if (typeof el === 'object' && el) {\n var prevEl = el.previousElementSibling ? el.previousElementSibling : false,\n parentEl = el.parentNode;\n el.outerHTML = htmlList[i];\n options[item] = prevEl ? prevEl.nextElementSibling : parentEl.firstElementChild;\n }\n }); // reset variables\n\n tnsList = animateIn = animateOut = animateDelay = animateNormal = horizontal = outerWrapper = innerWrapper = container = containerParent = containerHTML = slideItems = slideCount = breakpointZone = windowWidth = autoWidth = fixedWidth = edgePadding = gutter = viewport = items = slideBy = viewportMax = arrowKeys = speed = rewind = loop = autoHeight = sheet = lazyload = slidePositions = slideItemsOut = cloneCount = slideCountNew = hasRightDeadZone = rightBoundary = updateIndexBeforeTransform = transformAttr = transformPrefix = transformPostfix = getIndexMax = index = indexCached = indexMin = indexMax = swipeAngle = moveDirectionExpected = running = onInit = events = newContainerClasses = slideId = disable = disabled = freezable = freeze = frozen = controlsEvents = navEvents = hoverEvents = visibilityEvent = docmentKeydownEvent = touchEvents = dragEvents = hasControls = hasNav = navAsThumbnails = hasAutoplay = hasTouch = hasMouseDrag = slideActiveClass = imgCompleteClass = imgEvents = imgsComplete = controls = controlsText = controlsContainer = controlsContainerHTML = prevButton = nextButton = prevIsButton = nextIsButton = nav = navContainer = navContainerHTML = navItems = pages = pagesCached = navClicked = navCurrentIndex = navCurrentIndexCached = navActiveClass = navStr = navStrCurrent = autoplay = autoplayTimeout = autoplayDirection = autoplayText = autoplayHoverPause = autoplayButton = autoplayButtonHTML = autoplayResetOnVisibility = autoplayHtmlStrings = autoplayTimer = animating = autoplayHoverPaused = autoplayUserPaused = autoplayVisibilityPaused = initPosition = lastPosition = translateInit = panStart = rafIndex = getDist = touch = mouseDrag = null; // check variables\n // [animateIn, animateOut, animateDelay, animateNormal, horizontal, outerWrapper, innerWrapper, container, containerParent, containerHTML, slideItems, slideCount, breakpointZone, windowWidth, autoWidth, fixedWidth, edgePadding, gutter, viewport, items, slideBy, viewportMax, arrowKeys, speed, rewind, loop, autoHeight, sheet, lazyload, slidePositions, slideItemsOut, cloneCount, slideCountNew, hasRightDeadZone, rightBoundary, updateIndexBeforeTransform, transformAttr, transformPrefix, transformPostfix, getIndexMax, index, indexCached, indexMin, indexMax, resizeTimer, swipeAngle, moveDirectionExpected, running, onInit, events, newContainerClasses, slideId, disable, disabled, freezable, freeze, frozen, controlsEvents, navEvents, hoverEvents, visibilityEvent, docmentKeydownEvent, touchEvents, dragEvents, hasControls, hasNav, navAsThumbnails, hasAutoplay, hasTouch, hasMouseDrag, slideActiveClass, imgCompleteClass, imgEvents, imgsComplete, controls, controlsText, controlsContainer, controlsContainerHTML, prevButton, nextButton, prevIsButton, nextIsButton, nav, navContainer, navContainerHTML, navItems, pages, pagesCached, navClicked, navCurrentIndex, navCurrentIndexCached, navActiveClass, navStr, navStrCurrent, autoplay, autoplayTimeout, autoplayDirection, autoplayText, autoplayHoverPause, autoplayButton, autoplayButtonHTML, autoplayResetOnVisibility, autoplayHtmlStrings, autoplayTimer, animating, autoplayHoverPaused, autoplayUserPaused, autoplayVisibilityPaused, initPosition, lastPosition, translateInit, disX, disY, panStart, rafIndex, getDist, touch, mouseDrag ].forEach(function(item) { if (item !== null) { console.log(item); } });\n\n for (var a in this) {\n if (a !== 'rebuild') {\n this[a] = null;\n }\n }\n\n isOn = false;\n } // === ON RESIZE ===\n // responsive || fixedWidth || autoWidth || !horizontal\n\n\n function onResize(e) {\n raf(function () {\n resizeTasks(getEvent(e));\n });\n }\n\n function resizeTasks(e) {\n if (!isOn) {\n return;\n }\n\n if (nested === 'outer') {\n events.emit('outerResized', info(e));\n }\n\n windowWidth = getWindowWidth();\n var bpChanged,\n breakpointZoneTem = breakpointZone,\n needContainerTransform = false;\n\n if (responsive) {\n setBreakpointZone();\n bpChanged = breakpointZoneTem !== breakpointZone; // if (hasRightDeadZone) { needContainerTransform = true; } // *?\n\n if (bpChanged) {\n events.emit('newBreakpointStart', info(e));\n }\n }\n\n var indChanged,\n itemsChanged,\n itemsTem = items,\n disableTem = disable,\n freezeTem = freeze,\n arrowKeysTem = arrowKeys,\n controlsTem = controls,\n navTem = nav,\n touchTem = touch,\n mouseDragTem = mouseDrag,\n autoplayTem = autoplay,\n autoplayHoverPauseTem = autoplayHoverPause,\n autoplayResetOnVisibilityTem = autoplayResetOnVisibility,\n indexTem = index;\n\n if (bpChanged) {\n var fixedWidthTem = fixedWidth,\n autoHeightTem = autoHeight,\n controlsTextTem = controlsText,\n centerTem = center,\n autoplayTextTem = autoplayText;\n\n if (!CSSMQ) {\n var gutterTem = gutter,\n edgePaddingTem = edgePadding;\n }\n } // get option:\n // fixed width: viewport, fixedWidth, gutter => items\n // others: window width => all variables\n // all: items => slideBy\n\n\n arrowKeys = getOption('arrowKeys');\n controls = getOption('controls');\n nav = getOption('nav');\n touch = getOption('touch');\n center = getOption('center');\n mouseDrag = getOption('mouseDrag');\n autoplay = getOption('autoplay');\n autoplayHoverPause = getOption('autoplayHoverPause');\n autoplayResetOnVisibility = getOption('autoplayResetOnVisibility');\n\n if (bpChanged) {\n disable = getOption('disable');\n fixedWidth = getOption('fixedWidth');\n speed = getOption('speed');\n autoHeight = getOption('autoHeight');\n controlsText = getOption('controlsText');\n autoplayText = getOption('autoplayText');\n autoplayTimeout = getOption('autoplayTimeout');\n\n if (!CSSMQ) {\n edgePadding = getOption('edgePadding');\n gutter = getOption('gutter');\n }\n } // update options\n\n\n resetVariblesWhenDisable(disable);\n viewport = getViewportWidth(); // <= edgePadding, gutter\n\n if ((!horizontal || autoWidth) && !disable) {\n setSlidePositions();\n\n if (!horizontal) {\n updateContentWrapperHeight(); // <= setSlidePositions\n\n needContainerTransform = true;\n }\n }\n\n if (fixedWidth || autoWidth) {\n rightBoundary = getRightBoundary(); // autoWidth: <= viewport, slidePositions, gutter\n // fixedWidth: <= viewport, fixedWidth, gutter\n\n indexMax = getIndexMax(); // autoWidth: <= rightBoundary, slidePositions\n // fixedWidth: <= rightBoundary, fixedWidth, gutter\n }\n\n if (bpChanged || fixedWidth) {\n items = getOption('items');\n slideBy = getOption('slideBy');\n itemsChanged = items !== itemsTem;\n\n if (itemsChanged) {\n if (!fixedWidth && !autoWidth) {\n indexMax = getIndexMax();\n } // <= items\n // check index before transform in case\n // slider reach the right edge then items become bigger\n\n\n updateIndex();\n }\n }\n\n if (bpChanged) {\n if (disable !== disableTem) {\n if (disable) {\n disableSlider();\n } else {\n enableSlider(); // <= slidePositions, rightBoundary, indexMax\n }\n }\n }\n\n if (freezable && (bpChanged || fixedWidth || autoWidth)) {\n freeze = getFreeze(); // <= autoWidth: slidePositions, gutter, viewport, rightBoundary\n // <= fixedWidth: fixedWidth, gutter, rightBoundary\n // <= others: items\n\n if (freeze !== freezeTem) {\n if (freeze) {\n doContainerTransform(getContainerTransformValue(getStartIndex(0)));\n freezeSlider();\n } else {\n unfreezeSlider();\n needContainerTransform = true;\n }\n }\n }\n\n resetVariblesWhenDisable(disable || freeze); // controls, nav, touch, mouseDrag, arrowKeys, autoplay, autoplayHoverPause, autoplayResetOnVisibility\n\n if (!autoplay) {\n autoplayHoverPause = autoplayResetOnVisibility = false;\n }\n\n if (arrowKeys !== arrowKeysTem) {\n arrowKeys ? addEvents(doc, docmentKeydownEvent) : removeEvents(doc, docmentKeydownEvent);\n }\n\n if (controls !== controlsTem) {\n if (controls) {\n if (controlsContainer) {\n showElement(controlsContainer);\n } else {\n if (prevButton) {\n showElement(prevButton);\n }\n\n if (nextButton) {\n showElement(nextButton);\n }\n }\n } else {\n if (controlsContainer) {\n hideElement(controlsContainer);\n } else {\n if (prevButton) {\n hideElement(prevButton);\n }\n\n if (nextButton) {\n hideElement(nextButton);\n }\n }\n }\n }\n\n if (nav !== navTem) {\n if (nav) {\n showElement(navContainer);\n updateNavVisibility();\n } else {\n hideElement(navContainer);\n }\n }\n\n if (touch !== touchTem) {\n touch ? addEvents(container, touchEvents, options.preventScrollOnTouch) : removeEvents(container, touchEvents);\n }\n\n if (mouseDrag !== mouseDragTem) {\n mouseDrag ? addEvents(container, dragEvents) : removeEvents(container, dragEvents);\n }\n\n if (autoplay !== autoplayTem) {\n if (autoplay) {\n if (autoplayButton) {\n showElement(autoplayButton);\n }\n\n if (!animating && !autoplayUserPaused) {\n startAutoplay();\n }\n } else {\n if (autoplayButton) {\n hideElement(autoplayButton);\n }\n\n if (animating) {\n stopAutoplay();\n }\n }\n }\n\n if (autoplayHoverPause !== autoplayHoverPauseTem) {\n autoplayHoverPause ? addEvents(container, hoverEvents) : removeEvents(container, hoverEvents);\n }\n\n if (autoplayResetOnVisibility !== autoplayResetOnVisibilityTem) {\n autoplayResetOnVisibility ? addEvents(doc, visibilityEvent) : removeEvents(doc, visibilityEvent);\n }\n\n if (bpChanged) {\n if (fixedWidth !== fixedWidthTem || center !== centerTem) {\n needContainerTransform = true;\n }\n\n if (autoHeight !== autoHeightTem) {\n if (!autoHeight) {\n innerWrapper.style.height = '';\n }\n }\n\n if (controls && controlsText !== controlsTextTem) {\n prevButton.innerHTML = controlsText[0];\n nextButton.innerHTML = controlsText[1];\n }\n\n if (autoplayButton && autoplayText !== autoplayTextTem) {\n var i = autoplay ? 1 : 0,\n html = autoplayButton.innerHTML,\n len = html.length - autoplayTextTem[i].length;\n\n if (html.substring(len) === autoplayTextTem[i]) {\n autoplayButton.innerHTML = html.substring(0, len) + autoplayText[i];\n }\n }\n } else {\n if (center && (fixedWidth || autoWidth)) {\n needContainerTransform = true;\n }\n }\n\n if (itemsChanged || fixedWidth && !autoWidth) {\n pages = getPages();\n updateNavVisibility();\n }\n\n indChanged = index !== indexTem;\n\n if (indChanged) {\n events.emit('indexChanged', info());\n needContainerTransform = true;\n } else if (itemsChanged) {\n if (!indChanged) {\n additionalUpdates();\n }\n } else if (fixedWidth || autoWidth) {\n doLazyLoad();\n updateSlideStatus();\n updateLiveRegion();\n }\n\n if (itemsChanged && !carousel) {\n updateGallerySlidePositions();\n }\n\n if (!disable && !freeze) {\n // non-mediaqueries: IE8\n if (bpChanged && !CSSMQ) {\n // middle wrapper styles\n // inner wrapper styles\n if (edgePadding !== edgePaddingTem || gutter !== gutterTem) {\n innerWrapper.style.cssText = getInnerWrapperStyles(edgePadding, gutter, fixedWidth, speed, autoHeight);\n }\n\n if (horizontal) {\n // container styles\n if (carousel) {\n container.style.width = getContainerWidth(fixedWidth, gutter, items);\n } // slide styles\n\n\n var str = getSlideWidthStyle(fixedWidth, gutter, items) + getSlideGutterStyle(gutter); // remove the last line and\n // add new styles\n\n removeCSSRule(sheet, getCssRulesLength(sheet) - 1);\n addCSSRule(sheet, '#' + slideId + ' > .tns-item', str, getCssRulesLength(sheet));\n }\n } // auto height\n\n\n if (autoHeight) {\n doAutoHeight();\n }\n\n if (needContainerTransform) {\n doContainerTransformSilent();\n indexCached = index;\n }\n }\n\n if (bpChanged) {\n events.emit('newBreakpointEnd', info(e));\n }\n } // === INITIALIZATION FUNCTIONS === //\n\n\n function getFreeze() {\n if (!fixedWidth && !autoWidth) {\n var a = center ? items - (items - 1) / 2 : items;\n return slideCount <= a;\n }\n\n var width = fixedWidth ? (fixedWidth + gutter) * slideCount : slidePositions[slideCount],\n vp = edgePadding ? viewport + edgePadding * 2 : viewport + gutter;\n\n if (center) {\n vp -= fixedWidth ? (viewport - fixedWidth) / 2 : (viewport - (slidePositions[index + 1] - slidePositions[index] - gutter)) / 2;\n }\n\n return width <= vp;\n }\n\n function setBreakpointZone() {\n breakpointZone = 0;\n\n for (var bp in responsive) {\n bp = parseInt(bp); // convert string to number\n\n if (windowWidth >= bp) {\n breakpointZone = bp;\n }\n }\n } // (slideBy, indexMin, indexMax) => index\n\n\n var updateIndex = function () {\n return loop ? carousel ? // loop + carousel\n function () {\n var leftEdge = indexMin,\n rightEdge = indexMax;\n leftEdge += slideBy;\n rightEdge -= slideBy; // adjust edges when has edge paddings\n // or fixed-width slider with extra space on the right side\n\n if (edgePadding) {\n leftEdge += 1;\n rightEdge -= 1;\n } else if (fixedWidth) {\n if ((viewport + gutter) % (fixedWidth + gutter)) {\n rightEdge -= 1;\n }\n }\n\n if (cloneCount) {\n if (index > rightEdge) {\n index -= slideCount;\n } else if (index < leftEdge) {\n index += slideCount;\n }\n }\n } : // loop + gallery\n function () {\n if (index > indexMax) {\n while (index >= indexMin + slideCount) {\n index -= slideCount;\n }\n } else if (index < indexMin) {\n while (index <= indexMax - slideCount) {\n index += slideCount;\n }\n }\n } : // non-loop\n function () {\n index = Math.max(indexMin, Math.min(indexMax, index));\n };\n }();\n\n function disableUI() {\n if (!autoplay && autoplayButton) {\n hideElement(autoplayButton);\n }\n\n if (!nav && navContainer) {\n hideElement(navContainer);\n }\n\n if (!controls) {\n if (controlsContainer) {\n hideElement(controlsContainer);\n } else {\n if (prevButton) {\n hideElement(prevButton);\n }\n\n if (nextButton) {\n hideElement(nextButton);\n }\n }\n }\n }\n\n function enableUI() {\n if (autoplay && autoplayButton) {\n showElement(autoplayButton);\n }\n\n if (nav && navContainer) {\n showElement(navContainer);\n }\n\n if (controls) {\n if (controlsContainer) {\n showElement(controlsContainer);\n } else {\n if (prevButton) {\n showElement(prevButton);\n }\n\n if (nextButton) {\n showElement(nextButton);\n }\n }\n }\n }\n\n function freezeSlider() {\n if (frozen) {\n return;\n } // remove edge padding from inner wrapper\n\n\n if (edgePadding) {\n innerWrapper.style.margin = '0px';\n } // add class tns-transparent to cloned slides\n\n\n if (cloneCount) {\n var str = 'tns-transparent';\n\n for (var i = cloneCount; i--;) {\n if (carousel) {\n addClass(slideItems[i], str);\n }\n\n addClass(slideItems[slideCountNew - i - 1], str);\n }\n } // update tools\n\n\n disableUI();\n frozen = true;\n }\n\n function unfreezeSlider() {\n if (!frozen) {\n return;\n } // restore edge padding for inner wrapper\n // for mordern browsers\n\n\n if (edgePadding && CSSMQ) {\n innerWrapper.style.margin = '';\n } // remove class tns-transparent to cloned slides\n\n\n if (cloneCount) {\n var str = 'tns-transparent';\n\n for (var i = cloneCount; i--;) {\n if (carousel) {\n removeClass(slideItems[i], str);\n }\n\n removeClass(slideItems[slideCountNew - i - 1], str);\n }\n } // update tools\n\n\n enableUI();\n frozen = false;\n }\n\n function disableSlider() {\n if (disabled) {\n return;\n }\n\n sheet.disabled = true;\n container.className = container.className.replace(newContainerClasses.substring(1), '');\n removeAttrs(container, ['style']);\n\n if (loop) {\n for (var j = cloneCount; j--;) {\n if (carousel) {\n hideElement(slideItems[j]);\n }\n\n hideElement(slideItems[slideCountNew - j - 1]);\n }\n } // vertical slider\n\n\n if (!horizontal || !carousel) {\n removeAttrs(innerWrapper, ['style']);\n } // gallery\n\n\n if (!carousel) {\n for (var i = index, l = index + slideCount; i < l; i++) {\n var item = slideItems[i];\n removeAttrs(item, ['style']);\n removeClass(item, animateIn);\n removeClass(item, animateNormal);\n }\n } // update tools\n\n\n disableUI();\n disabled = true;\n }\n\n function enableSlider() {\n if (!disabled) {\n return;\n }\n\n sheet.disabled = false;\n container.className += newContainerClasses;\n doContainerTransformSilent();\n\n if (loop) {\n for (var j = cloneCount; j--;) {\n if (carousel) {\n showElement(slideItems[j]);\n }\n\n showElement(slideItems[slideCountNew - j - 1]);\n }\n } // gallery\n\n\n if (!carousel) {\n for (var i = index, l = index + slideCount; i < l; i++) {\n var item = slideItems[i],\n classN = i < index + items ? animateIn : animateNormal;\n item.style.left = (i - index) * 100 / items + '%';\n addClass(item, classN);\n }\n } // update tools\n\n\n enableUI();\n disabled = false;\n }\n\n function updateLiveRegion() {\n var str = getLiveRegionStr();\n\n if (liveregionCurrent.innerHTML !== str) {\n liveregionCurrent.innerHTML = str;\n }\n }\n\n function getLiveRegionStr() {\n var arr = getVisibleSlideRange(),\n start = arr[0] + 1,\n end = arr[1] + 1;\n return start === end ? start + '' : start + ' to ' + end;\n }\n\n function getVisibleSlideRange(val) {\n if (val == null) {\n val = getContainerTransformValue();\n }\n\n var start = index,\n end,\n rangestart,\n rangeend; // get range start, range end for autoWidth and fixedWidth\n\n if (center || edgePadding) {\n if (autoWidth || fixedWidth) {\n rangestart = -(parseFloat(val) + edgePadding);\n rangeend = rangestart + viewport + edgePadding * 2;\n }\n } else {\n if (autoWidth) {\n rangestart = slidePositions[index];\n rangeend = rangestart + viewport;\n }\n } // get start, end\n // - check auto width\n\n\n if (autoWidth) {\n slidePositions.forEach(function (point, i) {\n if (i < slideCountNew) {\n if ((center || edgePadding) && point <= rangestart + 0.5) {\n start = i;\n }\n\n if (rangeend - point >= 0.5) {\n end = i;\n }\n }\n }); // - check percentage width, fixed width\n } else {\n if (fixedWidth) {\n var cell = fixedWidth + gutter;\n\n if (center || edgePadding) {\n start = Math.floor(rangestart / cell);\n end = Math.ceil(rangeend / cell - 1);\n } else {\n end = start + Math.ceil(viewport / cell) - 1;\n }\n } else {\n if (center || edgePadding) {\n var a = items - 1;\n\n if (center) {\n start -= a / 2;\n end = index + a / 2;\n } else {\n end = index + a;\n }\n\n if (edgePadding) {\n var b = edgePadding * items / viewport;\n start -= b;\n end += b;\n }\n\n start = Math.floor(start);\n end = Math.ceil(end);\n } else {\n end = start + items - 1;\n }\n }\n\n start = Math.max(start, 0);\n end = Math.min(end, slideCountNew - 1);\n }\n\n return [start, end];\n }\n\n function doLazyLoad() {\n if (lazyload && !disable) {\n var arg = getVisibleSlideRange();\n arg.push(lazyloadSelector);\n getImageArray.apply(null, arg).forEach(function (img) {\n if (!hasClass(img, imgCompleteClass)) {\n // stop propagation transitionend event to container\n var eve = {};\n\n eve[TRANSITIONEND] = function (e) {\n e.stopPropagation();\n };\n\n addEvents(img, eve);\n addEvents(img, imgEvents); // update src\n\n img.src = getAttr(img, 'data-src'); // update srcset\n\n var srcset = getAttr(img, 'data-srcset');\n\n if (srcset) {\n img.srcset = srcset;\n }\n\n addClass(img, 'loading');\n }\n });\n }\n }\n\n function onImgLoaded(e) {\n imgLoaded(getTarget(e));\n }\n\n function onImgFailed(e) {\n imgFailed(getTarget(e));\n }\n\n function imgLoaded(img) {\n addClass(img, 'loaded');\n imgCompleted(img);\n }\n\n function imgFailed(img) {\n addClass(img, 'failed');\n imgCompleted(img);\n }\n\n function imgCompleted(img) {\n addClass(img, imgCompleteClass);\n removeClass(img, 'loading');\n removeEvents(img, imgEvents);\n }\n\n function getImageArray(start, end, imgSelector) {\n var imgs = [];\n\n if (!imgSelector) {\n imgSelector = 'img';\n }\n\n while (start <= end) {\n forEach(slideItems[start].querySelectorAll(imgSelector), function (img) {\n imgs.push(img);\n });\n start++;\n }\n\n return imgs;\n } // check if all visible images are loaded\n // and update container height if it's done\n\n\n function doAutoHeight() {\n var imgs = getImageArray.apply(null, getVisibleSlideRange());\n raf(function () {\n imgsLoadedCheck(imgs, updateInnerWrapperHeight);\n });\n }\n\n function imgsLoadedCheck(imgs, cb) {\n // execute callback function if all images are complete\n if (imgsComplete) {\n return cb();\n } // check image classes\n\n\n imgs.forEach(function (img, index) {\n if (!lazyload && img.complete) {\n imgCompleted(img);\n } // Check image.complete\n\n\n if (hasClass(img, imgCompleteClass)) {\n imgs.splice(index, 1);\n }\n }); // execute callback function if selected images are all complete\n\n if (!imgs.length) {\n return cb();\n } // otherwise execute this functiona again\n\n\n raf(function () {\n imgsLoadedCheck(imgs, cb);\n });\n }\n\n function additionalUpdates() {\n doLazyLoad();\n updateSlideStatus();\n updateLiveRegion();\n updateControlsStatus();\n updateNavStatus();\n }\n\n function update_carousel_transition_duration() {\n if (carousel && autoHeight) {\n middleWrapper.style[TRANSITIONDURATION] = speed / 1000 + 's';\n }\n }\n\n function getMaxSlideHeight(slideStart, slideRange) {\n var heights = [];\n\n for (var i = slideStart, l = Math.min(slideStart + slideRange, slideCountNew); i < l; i++) {\n heights.push(slideItems[i].offsetHeight);\n }\n\n return Math.max.apply(null, heights);\n } // update inner wrapper height\n // 1. get the max-height of the visible slides\n // 2. set transitionDuration to speed\n // 3. update inner wrapper height to max-height\n // 4. set transitionDuration to 0s after transition done\n\n\n function updateInnerWrapperHeight() {\n var maxHeight = autoHeight ? getMaxSlideHeight(index, items) : getMaxSlideHeight(cloneCount, slideCount),\n wp = middleWrapper ? middleWrapper : innerWrapper;\n\n if (wp.style.height !== maxHeight) {\n wp.style.height = maxHeight + 'px';\n }\n } // get the distance from the top edge of the first slide to each slide\n // (init) => slidePositions\n\n\n function setSlidePositions() {\n slidePositions = [0];\n var attr = horizontal ? 'left' : 'top',\n attr2 = horizontal ? 'right' : 'bottom',\n base = slideItems[0].getBoundingClientRect()[attr];\n forEach(slideItems, function (item, i) {\n // skip the first slide\n if (i) {\n slidePositions.push(item.getBoundingClientRect()[attr] - base);\n } // add the end edge\n\n\n if (i === slideCountNew - 1) {\n slidePositions.push(item.getBoundingClientRect()[attr2] - base);\n }\n });\n } // update slide\n\n\n function updateSlideStatus() {\n var range = getVisibleSlideRange(),\n start = range[0],\n end = range[1];\n forEach(slideItems, function (item, i) {\n // show slides\n if (i >= start && i <= end) {\n if (hasAttr(item, 'aria-hidden')) {\n removeAttrs(item, ['aria-hidden', 'tabindex']);\n addClass(item, slideActiveClass);\n } // hide slides\n\n } else {\n if (!hasAttr(item, 'aria-hidden')) {\n setAttrs(item, {\n 'aria-hidden': 'true',\n 'tabindex': '-1'\n });\n removeClass(item, slideActiveClass);\n }\n }\n });\n } // gallery: update slide position\n\n\n function updateGallerySlidePositions() {\n var l = index + Math.min(slideCount, items);\n\n for (var i = slideCountNew; i--;) {\n var item = slideItems[i];\n\n if (i >= index && i < l) {\n // add transitions to visible slides when adjusting their positions\n addClass(item, 'tns-moving');\n item.style.left = (i - index) * 100 / items + '%';\n addClass(item, animateIn);\n removeClass(item, animateNormal);\n } else if (item.style.left) {\n item.style.left = '';\n addClass(item, animateNormal);\n removeClass(item, animateIn);\n } // remove outlet animation\n\n\n removeClass(item, animateOut);\n } // removing '.tns-moving'\n\n\n setTimeout(function () {\n forEach(slideItems, function (el) {\n removeClass(el, 'tns-moving');\n });\n }, 300);\n } // set tabindex on Nav\n\n\n function updateNavStatus() {\n // get current nav\n if (nav) {\n navCurrentIndex = navClicked >= 0 ? navClicked : getCurrentNavIndex();\n navClicked = -1;\n\n if (navCurrentIndex !== navCurrentIndexCached) {\n var navPrev = navItems[navCurrentIndexCached],\n navCurrent = navItems[navCurrentIndex];\n setAttrs(navPrev, {\n 'tabindex': '-1',\n 'aria-label': navStr + (navCurrentIndexCached + 1)\n });\n removeClass(navPrev, navActiveClass);\n setAttrs(navCurrent, {\n 'aria-label': navStr + (navCurrentIndex + 1) + navStrCurrent\n });\n removeAttrs(navCurrent, 'tabindex');\n addClass(navCurrent, navActiveClass);\n navCurrentIndexCached = navCurrentIndex;\n }\n }\n }\n\n function getLowerCaseNodeName(el) {\n return el.nodeName.toLowerCase();\n }\n\n function isButton(el) {\n return getLowerCaseNodeName(el) === 'button';\n }\n\n function isAriaDisabled(el) {\n return el.getAttribute('aria-disabled') === 'true';\n }\n\n function disEnableElement(isButton, el, val) {\n if (isButton) {\n el.disabled = val;\n } else {\n el.setAttribute('aria-disabled', val.toString());\n }\n } // set 'disabled' to true on controls when reach the edges\n\n\n function updateControlsStatus() {\n if (!controls || rewind || loop) {\n return;\n }\n\n var prevDisabled = prevIsButton ? prevButton.disabled : isAriaDisabled(prevButton),\n nextDisabled = nextIsButton ? nextButton.disabled : isAriaDisabled(nextButton),\n disablePrev = index <= indexMin ? true : false,\n disableNext = !rewind && index >= indexMax ? true : false;\n\n if (disablePrev && !prevDisabled) {\n disEnableElement(prevIsButton, prevButton, true);\n }\n\n if (!disablePrev && prevDisabled) {\n disEnableElement(prevIsButton, prevButton, false);\n }\n\n if (disableNext && !nextDisabled) {\n disEnableElement(nextIsButton, nextButton, true);\n }\n\n if (!disableNext && nextDisabled) {\n disEnableElement(nextIsButton, nextButton, false);\n }\n } // set duration\n\n\n function resetDuration(el, str) {\n if (TRANSITIONDURATION) {\n el.style[TRANSITIONDURATION] = str;\n }\n }\n\n function getSliderWidth() {\n return fixedWidth ? (fixedWidth + gutter) * slideCountNew : slidePositions[slideCountNew];\n }\n\n function getCenterGap(num) {\n if (num == null) {\n num = index;\n }\n\n var gap = edgePadding ? gutter : 0;\n return autoWidth ? (viewport - gap - (slidePositions[num + 1] - slidePositions[num] - gutter)) / 2 : fixedWidth ? (viewport - fixedWidth) / 2 : (items - 1) / 2;\n }\n\n function getRightBoundary() {\n var gap = edgePadding ? gutter : 0,\n result = viewport + gap - getSliderWidth();\n\n if (center && !loop) {\n result = fixedWidth ? -(fixedWidth + gutter) * (slideCountNew - 1) - getCenterGap() : getCenterGap(slideCountNew - 1) - slidePositions[slideCountNew - 1];\n }\n\n if (result > 0) {\n result = 0;\n }\n\n return result;\n }\n\n function getContainerTransformValue(num) {\n if (num == null) {\n num = index;\n }\n\n var val;\n\n if (horizontal && !autoWidth) {\n if (fixedWidth) {\n val = -(fixedWidth + gutter) * num;\n\n if (center) {\n val += getCenterGap();\n }\n } else {\n var denominator = TRANSFORM ? slideCountNew : items;\n\n if (center) {\n num -= getCenterGap();\n }\n\n val = -num * 100 / denominator;\n }\n } else {\n val = -slidePositions[num];\n\n if (center && autoWidth) {\n val += getCenterGap();\n }\n }\n\n if (hasRightDeadZone) {\n val = Math.max(val, rightBoundary);\n }\n\n val += horizontal && !autoWidth && !fixedWidth ? '%' : 'px';\n return val;\n }\n\n function doContainerTransformSilent(val) {\n resetDuration(container, '0s');\n doContainerTransform(val);\n }\n\n function doContainerTransform(val) {\n if (val == null) {\n val = getContainerTransformValue();\n }\n\n container.style[transformAttr] = transformPrefix + val + transformPostfix;\n }\n\n function animateSlide(number, classOut, classIn, isOut) {\n var l = number + items;\n\n if (!loop) {\n l = Math.min(l, slideCountNew);\n }\n\n for (var i = number; i < l; i++) {\n var item = slideItems[i]; // set item positions\n\n if (!isOut) {\n item.style.left = (i - index) * 100 / items + '%';\n }\n\n if (animateDelay && TRANSITIONDELAY) {\n item.style[TRANSITIONDELAY] = item.style[ANIMATIONDELAY] = animateDelay * (i - number) / 1000 + 's';\n }\n\n removeClass(item, classOut);\n addClass(item, classIn);\n\n if (isOut) {\n slideItemsOut.push(item);\n }\n }\n } // make transfer after click/drag:\n // 1. change 'transform' property for mordern browsers\n // 2. change 'left' property for legacy browsers\n\n\n var transformCore = function () {\n return carousel ? function () {\n resetDuration(container, '');\n\n if (TRANSITIONDURATION || !speed) {\n // for morden browsers with non-zero duration or\n // zero duration for all browsers\n doContainerTransform(); // run fallback function manually\n // when duration is 0 / container is hidden\n\n if (!speed || !isVisible(container)) {\n onTransitionEnd();\n }\n } else {\n // for old browser with non-zero duration\n jsTransform(container, transformAttr, transformPrefix, transformPostfix, getContainerTransformValue(), speed, onTransitionEnd);\n }\n\n if (!horizontal) {\n updateContentWrapperHeight();\n }\n } : function () {\n slideItemsOut = [];\n var eve = {};\n eve[TRANSITIONEND] = eve[ANIMATIONEND] = onTransitionEnd;\n removeEvents(slideItems[indexCached], eve);\n addEvents(slideItems[index], eve);\n animateSlide(indexCached, animateIn, animateOut, true);\n animateSlide(index, animateNormal, animateIn); // run fallback function manually\n // when transition or animation not supported / duration is 0\n\n if (!TRANSITIONEND || !ANIMATIONEND || !speed || !isVisible(container)) {\n onTransitionEnd();\n }\n };\n }();\n\n function render(e, sliderMoved) {\n if (updateIndexBeforeTransform) {\n updateIndex();\n } // render when slider was moved (touch or drag) even though index may not change\n\n\n if (index !== indexCached || sliderMoved) {\n // events\n events.emit('indexChanged', info());\n events.emit('transitionStart', info());\n\n if (autoHeight) {\n doAutoHeight();\n } // pause autoplay when click or keydown from user\n\n\n if (animating && e && ['click', 'keydown'].indexOf(e.type) >= 0) {\n stopAutoplay();\n }\n\n running = true;\n transformCore();\n }\n }\n /*\n * Transfer prefixed properties to the same format\n * CSS: -Webkit-Transform => webkittransform\n * JS: WebkitTransform => webkittransform\n * @param {string} str - property\n *\n */\n\n\n function strTrans(str) {\n return str.toLowerCase().replace(/-/g, '');\n } // AFTER TRANSFORM\n // Things need to be done after a transfer:\n // 1. check index\n // 2. add classes to visible slide\n // 3. disable controls buttons when reach the first/last slide in non-loop slider\n // 4. update nav status\n // 5. lazyload images\n // 6. update container height\n\n\n function onTransitionEnd(event) {\n // check running on gallery mode\n // make sure trantionend/animationend events run only once\n if (carousel || running) {\n events.emit('transitionEnd', info(event));\n\n if (!carousel && slideItemsOut.length > 0) {\n for (var i = 0; i < slideItemsOut.length; i++) {\n var item = slideItemsOut[i]; // set item positions\n\n item.style.left = '';\n\n if (ANIMATIONDELAY && TRANSITIONDELAY) {\n item.style[ANIMATIONDELAY] = '';\n item.style[TRANSITIONDELAY] = '';\n }\n\n removeClass(item, animateOut);\n addClass(item, animateNormal);\n }\n }\n /* update slides, nav, controls after checking ...\n * => legacy browsers who don't support 'event'\n * have to check event first, otherwise event.target will cause an error\n * => or 'gallery' mode:\n * + event target is slide item\n * => or 'carousel' mode:\n * + event target is container,\n * + event.property is the same with transform attribute\n */\n\n\n if (!event || !carousel && event.target.parentNode === container || event.target === container && strTrans(event.propertyName) === strTrans(transformAttr)) {\n if (!updateIndexBeforeTransform) {\n var indexTem = index;\n updateIndex();\n\n if (index !== indexTem) {\n events.emit('indexChanged', info());\n doContainerTransformSilent();\n }\n }\n\n if (nested === 'inner') {\n events.emit('innerLoaded', info());\n }\n\n running = false;\n indexCached = index;\n }\n }\n } // # ACTIONS\n\n\n function goTo(targetIndex, e) {\n if (freeze) {\n return;\n } // prev slideBy\n\n\n if (targetIndex === 'prev') {\n onControlsClick(e, -1); // next slideBy\n } else if (targetIndex === 'next') {\n onControlsClick(e, 1); // go to exact slide\n } else {\n if (running) {\n if (preventActionWhenRunning) {\n return;\n } else {\n onTransitionEnd();\n }\n }\n\n var absIndex = getAbsIndex(),\n indexGap = 0;\n\n if (targetIndex === 'first') {\n indexGap = -absIndex;\n } else if (targetIndex === 'last') {\n indexGap = carousel ? slideCount - items - absIndex : slideCount - 1 - absIndex;\n } else {\n if (typeof targetIndex !== 'number') {\n targetIndex = parseInt(targetIndex);\n }\n\n if (!isNaN(targetIndex)) {\n // from directly called goTo function\n if (!e) {\n targetIndex = Math.max(0, Math.min(slideCount - 1, targetIndex));\n }\n\n indexGap = targetIndex - absIndex;\n }\n } // gallery: make sure new page won't overlap with current page\n\n\n if (!carousel && indexGap && Math.abs(indexGap) < items) {\n var factor = indexGap > 0 ? 1 : -1;\n indexGap += index + indexGap - slideCount >= indexMin ? slideCount * factor : slideCount * 2 * factor * -1;\n }\n\n index += indexGap; // make sure index is in range\n\n if (carousel && loop) {\n if (index < indexMin) {\n index += slideCount;\n }\n\n if (index > indexMax) {\n index -= slideCount;\n }\n } // if index is changed, start rendering\n\n\n if (getAbsIndex(index) !== getAbsIndex(indexCached)) {\n render(e);\n }\n }\n } // on controls click\n\n\n function onControlsClick(e, dir) {\n if (running) {\n if (preventActionWhenRunning) {\n return;\n } else {\n onTransitionEnd();\n }\n }\n\n var passEventObject;\n\n if (!dir) {\n e = getEvent(e);\n var target = getTarget(e);\n\n while (target !== controlsContainer && [prevButton, nextButton].indexOf(target) < 0) {\n target = target.parentNode;\n }\n\n var targetIn = [prevButton, nextButton].indexOf(target);\n\n if (targetIn >= 0) {\n passEventObject = true;\n dir = targetIn === 0 ? -1 : 1;\n }\n }\n\n if (rewind) {\n if (index === indexMin && dir === -1) {\n goTo('last', e);\n return;\n } else if (index === indexMax && dir === 1) {\n goTo('first', e);\n return;\n }\n }\n\n if (dir) {\n index += slideBy * dir;\n\n if (autoWidth) {\n index = Math.floor(index);\n } // pass e when click control buttons or keydown\n\n\n render(passEventObject || e && e.type === 'keydown' ? e : null);\n }\n } // on nav click\n\n\n function onNavClick(e) {\n if (running) {\n if (preventActionWhenRunning) {\n return;\n } else {\n onTransitionEnd();\n }\n }\n\n e = getEvent(e);\n var target = getTarget(e),\n navIndex; // find the clicked nav item\n\n while (target !== navContainer && !hasAttr(target, 'data-nav')) {\n target = target.parentNode;\n }\n\n if (hasAttr(target, 'data-nav')) {\n var navIndex = navClicked = Number(getAttr(target, 'data-nav')),\n targetIndexBase = fixedWidth || autoWidth ? navIndex * slideCount / pages : navIndex * items,\n targetIndex = navAsThumbnails ? navIndex : Math.min(Math.ceil(targetIndexBase), slideCount - 1);\n goTo(targetIndex, e);\n\n if (navCurrentIndex === navIndex) {\n if (animating) {\n stopAutoplay();\n }\n\n navClicked = -1; // reset navClicked\n }\n }\n } // autoplay functions\n\n\n function setAutoplayTimer() {\n autoplayTimer = setInterval(function () {\n onControlsClick(null, autoplayDirection);\n }, autoplayTimeout);\n animating = true;\n }\n\n function stopAutoplayTimer() {\n clearInterval(autoplayTimer);\n animating = false;\n }\n\n function updateAutoplayButton(action, txt) {\n setAttrs(autoplayButton, {\n 'data-action': action\n });\n autoplayButton.innerHTML = autoplayHtmlStrings[0] + action + autoplayHtmlStrings[1] + txt;\n }\n\n function startAutoplay() {\n setAutoplayTimer();\n\n if (autoplayButton) {\n updateAutoplayButton('stop', autoplayText[1]);\n }\n }\n\n function stopAutoplay() {\n stopAutoplayTimer();\n\n if (autoplayButton) {\n updateAutoplayButton('start', autoplayText[0]);\n }\n } // programaitcally play/pause the slider\n\n\n function play() {\n if (autoplay && !animating) {\n startAutoplay();\n autoplayUserPaused = false;\n }\n }\n\n function pause() {\n if (animating) {\n stopAutoplay();\n autoplayUserPaused = true;\n }\n }\n\n function toggleAutoplay() {\n if (animating) {\n stopAutoplay();\n autoplayUserPaused = true;\n } else {\n startAutoplay();\n autoplayUserPaused = false;\n }\n }\n\n function onVisibilityChange() {\n if (doc.hidden) {\n if (animating) {\n stopAutoplayTimer();\n autoplayVisibilityPaused = true;\n }\n } else if (autoplayVisibilityPaused) {\n setAutoplayTimer();\n autoplayVisibilityPaused = false;\n }\n }\n\n function mouseoverPause() {\n if (animating) {\n stopAutoplayTimer();\n autoplayHoverPaused = true;\n }\n }\n\n function mouseoutRestart() {\n if (autoplayHoverPaused) {\n setAutoplayTimer();\n autoplayHoverPaused = false;\n }\n } // keydown events on document\n\n\n function onDocumentKeydown(e) {\n e = getEvent(e);\n var keyIndex = [KEYS.LEFT, KEYS.RIGHT].indexOf(e.keyCode);\n\n if (keyIndex >= 0) {\n onControlsClick(e, keyIndex === 0 ? -1 : 1);\n }\n } // on key control\n\n\n function onControlsKeydown(e) {\n e = getEvent(e);\n var keyIndex = [KEYS.LEFT, KEYS.RIGHT].indexOf(e.keyCode);\n\n if (keyIndex >= 0) {\n if (keyIndex === 0) {\n if (!prevButton.disabled) {\n onControlsClick(e, -1);\n }\n } else if (!nextButton.disabled) {\n onControlsClick(e, 1);\n }\n }\n } // set focus\n\n\n function setFocus(el) {\n el.focus();\n } // on key nav\n\n\n function onNavKeydown(e) {\n e = getEvent(e);\n var curElement = doc.activeElement;\n\n if (!hasAttr(curElement, 'data-nav')) {\n return;\n } // var code = e.keyCode,\n\n\n var keyIndex = [KEYS.LEFT, KEYS.RIGHT, KEYS.ENTER, KEYS.SPACE].indexOf(e.keyCode),\n navIndex = Number(getAttr(curElement, 'data-nav'));\n\n if (keyIndex >= 0) {\n if (keyIndex === 0) {\n if (navIndex > 0) {\n setFocus(navItems[navIndex - 1]);\n }\n } else if (keyIndex === 1) {\n if (navIndex < pages - 1) {\n setFocus(navItems[navIndex + 1]);\n }\n } else {\n navClicked = navIndex;\n goTo(navIndex, e);\n }\n }\n }\n\n function getEvent(e) {\n e = e || win.event;\n return isTouchEvent(e) ? e.changedTouches[0] : e;\n }\n\n function getTarget(e) {\n return e.target || win.event.srcElement;\n }\n\n function isTouchEvent(e) {\n return e.type.indexOf('touch') >= 0;\n }\n\n function preventDefaultBehavior(e) {\n e.preventDefault ? e.preventDefault() : e.returnValue = false;\n }\n\n function getMoveDirectionExpected() {\n return getTouchDirection(toDegree(lastPosition.y - initPosition.y, lastPosition.x - initPosition.x), swipeAngle) === options.axis;\n }\n\n function onPanStart(e) {\n if (running) {\n if (preventActionWhenRunning) {\n return;\n } else {\n onTransitionEnd();\n }\n }\n\n if (autoplay && animating) {\n stopAutoplayTimer();\n }\n\n panStart = true;\n\n if (rafIndex) {\n caf(rafIndex);\n rafIndex = null;\n }\n\n var $ = getEvent(e);\n events.emit(isTouchEvent(e) ? 'touchStart' : 'dragStart', info(e));\n\n if (!isTouchEvent(e) && ['img', 'a'].indexOf(getLowerCaseNodeName(getTarget(e))) >= 0) {\n preventDefaultBehavior(e);\n }\n\n lastPosition.x = initPosition.x = $.clientX;\n lastPosition.y = initPosition.y = $.clientY;\n\n if (carousel) {\n translateInit = parseFloat(container.style[transformAttr].replace(transformPrefix, ''));\n resetDuration(container, '0s');\n }\n }\n\n function onPanMove(e) {\n if (panStart) {\n var $ = getEvent(e);\n lastPosition.x = $.clientX;\n lastPosition.y = $.clientY;\n\n if (carousel) {\n if (!rafIndex) {\n rafIndex = raf(function () {\n panUpdate(e);\n });\n }\n } else {\n if (moveDirectionExpected === '?') {\n moveDirectionExpected = getMoveDirectionExpected();\n }\n\n if (moveDirectionExpected) {\n preventScroll = true;\n }\n }\n\n if ((typeof e.cancelable !== 'boolean' || e.cancelable) && preventScroll) {\n e.preventDefault();\n }\n }\n }\n\n function panUpdate(e) {\n if (!moveDirectionExpected) {\n panStart = false;\n return;\n }\n\n caf(rafIndex);\n\n if (panStart) {\n rafIndex = raf(function () {\n panUpdate(e);\n });\n }\n\n if (moveDirectionExpected === '?') {\n moveDirectionExpected = getMoveDirectionExpected();\n }\n\n if (moveDirectionExpected) {\n if (!preventScroll && isTouchEvent(e)) {\n preventScroll = true;\n }\n\n try {\n if (e.type) {\n events.emit(isTouchEvent(e) ? 'touchMove' : 'dragMove', info(e));\n }\n } catch (err) {}\n\n var x = translateInit,\n dist = getDist(lastPosition, initPosition);\n\n if (!horizontal || fixedWidth || autoWidth) {\n x += dist;\n x += 'px';\n } else {\n var percentageX = TRANSFORM ? dist * items * 100 / ((viewport + gutter) * slideCountNew) : dist * 100 / (viewport + gutter);\n x += percentageX;\n x += '%';\n }\n\n container.style[transformAttr] = transformPrefix + x + transformPostfix;\n }\n }\n\n function onPanEnd(e) {\n if (panStart) {\n if (rafIndex) {\n caf(rafIndex);\n rafIndex = null;\n }\n\n if (carousel) {\n resetDuration(container, '');\n }\n\n panStart = false;\n var $ = getEvent(e);\n lastPosition.x = $.clientX;\n lastPosition.y = $.clientY;\n var dist = getDist(lastPosition, initPosition);\n\n if (Math.abs(dist)) {\n // drag vs click\n if (!isTouchEvent(e)) {\n // prevent \"click\"\n var target = getTarget(e);\n addEvents(target, {\n 'click': function preventClick(e) {\n preventDefaultBehavior(e);\n removeEvents(target, {\n 'click': preventClick\n });\n }\n });\n }\n\n if (carousel) {\n rafIndex = raf(function () {\n if (horizontal && !autoWidth) {\n var indexMoved = -dist * items / (viewport + gutter);\n indexMoved = dist > 0 ? Math.floor(indexMoved) : Math.ceil(indexMoved);\n index += indexMoved;\n } else {\n var moved = -(translateInit + dist);\n\n if (moved <= 0) {\n index = indexMin;\n } else if (moved >= slidePositions[slideCountNew - 1]) {\n index = indexMax;\n } else {\n var i = 0;\n\n while (i < slideCountNew && moved >= slidePositions[i]) {\n index = i;\n\n if (moved > slidePositions[i] && dist < 0) {\n index += 1;\n }\n\n i++;\n }\n }\n }\n\n render(e, dist);\n events.emit(isTouchEvent(e) ? 'touchEnd' : 'dragEnd', info(e));\n });\n } else {\n if (moveDirectionExpected) {\n onControlsClick(e, dist > 0 ? -1 : 1);\n }\n }\n }\n } // reset\n\n\n if (options.preventScrollOnTouch === 'auto') {\n preventScroll = false;\n }\n\n if (swipeAngle) {\n moveDirectionExpected = '?';\n }\n\n if (autoplay && !animating) {\n setAutoplayTimer();\n }\n } // === RESIZE FUNCTIONS === //\n // (slidePositions, index, items) => vertical_conentWrapper.height\n\n\n function updateContentWrapperHeight() {\n var wp = middleWrapper ? middleWrapper : innerWrapper;\n wp.style.height = slidePositions[index + items] - slidePositions[index] + 'px';\n }\n\n function getPages() {\n var rough = fixedWidth ? (fixedWidth + gutter) * slideCount / viewport : slideCount / items;\n return Math.min(Math.ceil(rough), slideCount);\n }\n /*\n * 1. update visible nav items list\n * 2. add \"hidden\" attributes to previous visible nav items\n * 3. remove \"hidden\" attrubutes to new visible nav items\n */\n\n\n function updateNavVisibility() {\n if (!nav || navAsThumbnails) {\n return;\n }\n\n if (pages !== pagesCached) {\n var min = pagesCached,\n max = pages,\n fn = showElement;\n\n if (pagesCached > pages) {\n min = pages;\n max = pagesCached;\n fn = hideElement;\n }\n\n while (min < max) {\n fn(navItems[min]);\n min++;\n } // cache pages\n\n\n pagesCached = pages;\n }\n }\n\n function info(e) {\n return {\n container: container,\n slideItems: slideItems,\n navContainer: navContainer,\n navItems: navItems,\n controlsContainer: controlsContainer,\n hasControls: hasControls,\n prevButton: prevButton,\n nextButton: nextButton,\n items: items,\n slideBy: slideBy,\n cloneCount: cloneCount,\n slideCount: slideCount,\n slideCountNew: slideCountNew,\n index: index,\n indexCached: indexCached,\n displayIndex: getCurrentSlide(),\n navCurrentIndex: navCurrentIndex,\n navCurrentIndexCached: navCurrentIndexCached,\n pages: pages,\n pagesCached: pagesCached,\n sheet: sheet,\n isOn: isOn,\n event: e || {}\n };\n }\n\n return {\n version: '2.9.4',\n getInfo: info,\n events: events,\n goTo: goTo,\n play: play,\n pause: pause,\n isOn: isOn,\n updateSliderHeight: updateInnerWrapperHeight,\n refresh: initSliderTransform,\n destroy: destroy,\n rebuild: function () {\n return tns(extend(options, optionsElements));\n }\n };\n};\n\nexports.tns = tns;\n\n\n//# sourceURL=webpack://gotw/./node_modules/tiny-slider/dist/tiny-slider.js?",
);
/***/
},
/***/ "./node_modules/wowjs/dist/wow.js":
/*!****************************************!*\
!*** ./node_modules/wowjs/dist/wow.js ***!
\****************************************/
/***/ function () {
eval(
"(function() {\n var MutationObserver, Util, WeakMap, getComputedStyle, getComputedStyleRX,\n bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };\n\n Util = (function() {\n function Util() {}\n\n Util.prototype.extend = function(custom, defaults) {\n var key, value;\n for (key in defaults) {\n value = defaults[key];\n if (custom[key] == null) {\n custom[key] = value;\n }\n }\n return custom;\n };\n\n Util.prototype.isMobile = function(agent) {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(agent);\n };\n\n Util.prototype.createEvent = function(event, bubble, cancel, detail) {\n var customEvent;\n if (bubble == null) {\n bubble = false;\n }\n if (cancel == null) {\n cancel = false;\n }\n if (detail == null) {\n detail = null;\n }\n if (document.createEvent != null) {\n customEvent = document.createEvent('CustomEvent');\n customEvent.initCustomEvent(event, bubble, cancel, detail);\n } else if (document.createEventObject != null) {\n customEvent = document.createEventObject();\n customEvent.eventType = event;\n } else {\n customEvent.eventName = event;\n }\n return customEvent;\n };\n\n Util.prototype.emitEvent = function(elem, event) {\n if (elem.dispatchEvent != null) {\n return elem.dispatchEvent(event);\n } else if (event in (elem != null)) {\n return elem[event]();\n } else if ((\"on\" + event) in (elem != null)) {\n return elem[\"on\" + event]();\n }\n };\n\n Util.prototype.addEvent = function(elem, event, fn) {\n if (elem.addEventListener != null) {\n return elem.addEventListener(event, fn, false);\n } else if (elem.attachEvent != null) {\n return elem.attachEvent(\"on\" + event, fn);\n } else {\n return elem[event] = fn;\n }\n };\n\n Util.prototype.removeEvent = function(elem, event, fn) {\n if (elem.removeEventListener != null) {\n return elem.removeEventListener(event, fn, false);\n } else if (elem.detachEvent != null) {\n return elem.detachEvent(\"on\" + event, fn);\n } else {\n return delete elem[event];\n }\n };\n\n Util.prototype.innerHeight = function() {\n if ('innerHeight' in window) {\n return window.innerHeight;\n } else {\n return document.documentElement.clientHeight;\n }\n };\n\n return Util;\n\n })();\n\n WeakMap = this.WeakMap || this.MozWeakMap || (WeakMap = (function() {\n function WeakMap() {\n this.keys = [];\n this.values = [];\n }\n\n WeakMap.prototype.get = function(key) {\n var i, item, j, len, ref;\n ref = this.keys;\n for (i = j = 0, len = ref.length; j < len; i = ++j) {\n item = ref[i];\n if (item === key) {\n return this.values[i];\n }\n }\n };\n\n WeakMap.prototype.set = function(key, value) {\n var i, item, j, len, ref;\n ref = this.keys;\n for (i = j = 0, len = ref.length; j < len; i = ++j) {\n item = ref[i];\n if (item === key) {\n this.values[i] = value;\n return;\n }\n }\n this.keys.push(key);\n return this.values.push(value);\n };\n\n return WeakMap;\n\n })());\n\n MutationObserver = this.MutationObserver || this.WebkitMutationObserver || this.MozMutationObserver || (MutationObserver = (function() {\n function MutationObserver() {\n if (typeof console !== \"undefined\" && console !== null) {\n console.warn('MutationObserver is not supported by your browser.');\n }\n if (typeof console !== \"undefined\" && console !== null) {\n console.warn('WOW.js cannot detect dom mutations, please call .sync() after loading new content.');\n }\n }\n\n MutationObserver.notSupported = true;\n\n MutationObserver.prototype.observe = function() {};\n\n return MutationObserver;\n\n })());\n\n getComputedStyle = this.getComputedStyle || function(el, pseudo) {\n this.getPropertyValue = function(prop) {\n var ref;\n if (prop === 'float') {\n prop = 'styleFloat';\n }\n if (getComputedStyleRX.test(prop)) {\n prop.replace(getComputedStyleRX, function(_, _char) {\n return _char.toUpperCase();\n });\n }\n return ((ref = el.currentStyle) != null ? ref[prop] : void 0) || null;\n };\n return this;\n };\n\n getComputedStyleRX = /(\\-([a-z]){1})/g;\n\n this.WOW = (function() {\n WOW.prototype.defaults = {\n boxClass: 'wow',\n animateClass: 'animated',\n offset: 0,\n mobile: true,\n live: true,\n callback: null,\n scrollContainer: null\n };\n\n function WOW(options) {\n if (options == null) {\n options = {};\n }\n this.scrollCallback = bind(this.scrollCallback, this);\n this.scrollHandler = bind(this.scrollHandler, this);\n this.resetAnimation = bind(this.resetAnimation, this);\n this.start = bind(this.start, this);\n this.scrolled = true;\n this.config = this.util().extend(options, this.defaults);\n if (options.scrollContainer != null) {\n this.config.scrollContainer = document.querySelector(options.scrollContainer);\n }\n this.animationNameCache = new WeakMap();\n this.wowEvent = this.util().createEvent(this.config.boxClass);\n }\n\n WOW.prototype.init = function() {\n var ref;\n this.element = window.document.documentElement;\n if ((ref = document.readyState) === \"interactive\" || ref === \"complete\") {\n this.start();\n } else {\n this.util().addEvent(document, 'DOMContentLoaded', this.start);\n }\n return this.finished = [];\n };\n\n WOW.prototype.start = function() {\n var box, j, len, ref;\n this.stopped = false;\n this.boxes = (function() {\n var j, len, ref, results;\n ref = this.element.querySelectorAll(\".\" + this.config.boxClass);\n results = [];\n for (j = 0, len = ref.length; j < len; j++) {\n box = ref[j];\n results.push(box);\n }\n return results;\n }).call(this);\n this.all = (function() {\n var j, len, ref, results;\n ref = this.boxes;\n results = [];\n for (j = 0, len = ref.length; j < len; j++) {\n box = ref[j];\n results.push(box);\n }\n return results;\n }).call(this);\n if (this.boxes.length) {\n if (this.disabled()) {\n this.resetStyle();\n } else {\n ref = this.boxes;\n for (j = 0, len = ref.length; j < len; j++) {\n box = ref[j];\n this.applyStyle(box, true);\n }\n }\n }\n if (!this.disabled()) {\n this.util().addEvent(this.config.scrollContainer || window, 'scroll', this.scrollHandler);\n this.util().addEvent(window, 'resize', this.scrollHandler);\n this.interval = setInterval(this.scrollCallback, 50);\n }\n if (this.config.live) {\n return new MutationObserver((function(_this) {\n return function(records) {\n var k, len1, node, record, results;\n results = [];\n for (k = 0, len1 = records.length; k < len1; k++) {\n record = records[k];\n results.push((function() {\n var l, len2, ref1, results1;\n ref1 = record.addedNodes || [];\n results1 = [];\n for (l = 0, len2 = ref1.length; l < len2; l++) {\n node = ref1[l];\n results1.push(this.doSync(node));\n }\n return results1;\n }).call(_this));\n }\n return results;\n };\n })(this)).observe(document.body, {\n childList: true,\n subtree: true\n });\n }\n };\n\n WOW.prototype.stop = function() {\n this.stopped = true;\n this.util().removeEvent(this.config.scrollContainer || window, 'scroll', this.scrollHandler);\n this.util().removeEvent(window, 'resize', this.scrollHandler);\n if (this.interval != null) {\n return clearInterval(this.interval);\n }\n };\n\n WOW.prototype.sync = function(element) {\n if (MutationObserver.notSupported) {\n return this.doSync(this.element);\n }\n };\n\n WOW.prototype.doSync = function(element) {\n var box, j, len, ref, results;\n if (element == null) {\n element = this.element;\n }\n if (element.nodeType !== 1) {\n return;\n }\n element = element.parentNode || element;\n ref = element.querySelectorAll(\".\" + this.config.boxClass);\n results = [];\n for (j = 0, len = ref.length; j < len; j++) {\n box = ref[j];\n if (indexOf.call(this.all, box) < 0) {\n this.boxes.push(box);\n this.all.push(box);\n if (this.stopped || this.disabled()) {\n this.resetStyle();\n } else {\n this.applyStyle(box, true);\n }\n results.push(this.scrolled = true);\n } else {\n results.push(void 0);\n }\n }\n return results;\n };\n\n WOW.prototype.show = function(box) {\n this.applyStyle(box);\n box.className = box.className + \" \" + this.config.animateClass;\n if (this.config.callback != null) {\n this.config.callback(box);\n }\n this.util().emitEvent(box, this.wowEvent);\n this.util().addEvent(box, 'animationend', this.resetAnimation);\n this.util().addEvent(box, 'oanimationend', this.resetAnimation);\n this.util().addEvent(box, 'webkitAnimationEnd', this.resetAnimation);\n this.util().addEvent(box, 'MSAnimationEnd', this.resetAnimation);\n return box;\n };\n\n WOW.prototype.applyStyle = function(box, hidden) {\n var delay, duration, iteration;\n duration = box.getAttribute('data-wow-duration');\n delay = box.getAttribute('data-wow-delay');\n iteration = box.getAttribute('data-wow-iteration');\n return this.animate((function(_this) {\n return function() {\n return _this.customStyle(box, hidden, duration, delay, iteration);\n };\n })(this));\n };\n\n WOW.prototype.animate = (function() {\n if ('requestAnimationFrame' in window) {\n return function(callback) {\n return window.requestAnimationFrame(callback);\n };\n } else {\n return function(callback) {\n return callback();\n };\n }\n })();\n\n WOW.prototype.resetStyle = function() {\n var box, j, len, ref, results;\n ref = this.boxes;\n results = [];\n for (j = 0, len = ref.length; j < len; j++) {\n box = ref[j];\n results.push(box.style.visibility = 'visible');\n }\n return results;\n };\n\n WOW.prototype.resetAnimation = function(event) {\n var target;\n if (event.type.toLowerCase().indexOf('animationend') >= 0) {\n target = event.target || event.srcElement;\n return target.className = target.className.replace(this.config.animateClass, '').trim();\n }\n };\n\n WOW.prototype.customStyle = function(box, hidden, duration, delay, iteration) {\n if (hidden) {\n this.cacheAnimationName(box);\n }\n box.style.visibility = hidden ? 'hidden' : 'visible';\n if (duration) {\n this.vendorSet(box.style, {\n animationDuration: duration\n });\n }\n if (delay) {\n this.vendorSet(box.style, {\n animationDelay: delay\n });\n }\n if (iteration) {\n this.vendorSet(box.style, {\n animationIterationCount: iteration\n });\n }\n this.vendorSet(box.style, {\n animationName: hidden ? 'none' : this.cachedAnimationName(box)\n });\n return box;\n };\n\n WOW.prototype.vendors = [\"moz\", \"webkit\"];\n\n WOW.prototype.vendorSet = function(elem, properties) {\n var name, results, value, vendor;\n results = [];\n for (name in properties) {\n value = properties[name];\n elem[\"\" + name] = value;\n results.push((function() {\n var j, len, ref, results1;\n ref = this.vendors;\n results1 = [];\n for (j = 0, len = ref.length; j < len; j++) {\n vendor = ref[j];\n results1.push(elem[\"\" + vendor + (name.charAt(0).toUpperCase()) + (name.substr(1))] = value);\n }\n return results1;\n }).call(this));\n }\n return results;\n };\n\n WOW.prototype.vendorCSS = function(elem, property) {\n var j, len, ref, result, style, vendor;\n style = getComputedStyle(elem);\n result = style.getPropertyCSSValue(property);\n ref = this.vendors;\n for (j = 0, len = ref.length; j < len; j++) {\n vendor = ref[j];\n result = result || style.getPropertyCSSValue(\"-\" + vendor + \"-\" + property);\n }\n return result;\n };\n\n WOW.prototype.animationName = function(box) {\n var animationName, error;\n try {\n animationName = this.vendorCSS(box, 'animation-name').cssText;\n } catch (error) {\n animationName = getComputedStyle(box).getPropertyValue('animation-name');\n }\n if (animationName === 'none') {\n return '';\n } else {\n return animationName;\n }\n };\n\n WOW.prototype.cacheAnimationName = function(box) {\n return this.animationNameCache.set(box, this.animationName(box));\n };\n\n WOW.prototype.cachedAnimationName = function(box) {\n return this.animationNameCache.get(box);\n };\n\n WOW.prototype.scrollHandler = function() {\n return this.scrolled = true;\n };\n\n WOW.prototype.scrollCallback = function() {\n var box;\n if (this.scrolled) {\n this.scrolled = false;\n this.boxes = (function() {\n var j, len, ref, results;\n ref = this.boxes;\n results = [];\n for (j = 0, len = ref.length; j < len; j++) {\n box = ref[j];\n if (!(box)) {\n continue;\n }\n if (this.isVisible(box)) {\n this.show(box);\n continue;\n }\n results.push(box);\n }\n return results;\n }).call(this);\n if (!(this.boxes.length || this.config.live)) {\n return this.stop();\n }\n }\n };\n\n WOW.prototype.offsetTop = function(element) {\n var top;\n while (element.offsetTop === void 0) {\n element = element.parentNode;\n }\n top = element.offsetTop;\n while (element = element.offsetParent) {\n top += element.offsetTop;\n }\n return top;\n };\n\n WOW.prototype.isVisible = function(box) {\n var bottom, offset, top, viewBottom, viewTop;\n offset = box.getAttribute('data-wow-offset') || this.config.offset;\n viewTop = (this.config.scrollContainer && this.config.scrollContainer.scrollTop) || window.pageYOffset;\n viewBottom = viewTop + Math.min(this.element.clientHeight, this.util().innerHeight()) - offset;\n top = this.offsetTop(box);\n bottom = top + box.clientHeight;\n return top <= viewBottom && bottom >= viewTop;\n };\n\n WOW.prototype.util = function() {\n return this._util != null ? this._util : this._util = new Util();\n };\n\n WOW.prototype.disabled = function() {\n return !this.config.mobile && this.util().isMobile(navigator.userAgent);\n };\n\n return WOW;\n\n })();\n\n}).call(this);\n\n\n//# sourceURL=webpack://gotw/./node_modules/wowjs/dist/wow.js?",
);
/***/
},
/******/
};
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/
}
/******/ // Create a new module (and put it into the cache)
/******/ var module = (__webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {},
/******/
});
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId].call(
module.exports,
module,
module.exports,
__webpack_require__,
);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/
}
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter =
module && module.__esModule
? /******/ () => module["default"]
: /******/ () => module;
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/
};
/******/
})();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for (var key in definition) {
/******/ if (
__webpack_require__.o(definition, key) &&
!__webpack_require__.o(exports, key)
) {
/******/ Object.defineProperty(exports, key, {
enumerable: true,
get: definition[key],
});
/******/
}
/******/
}
/******/
};
/******/
})();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) =>
Object.prototype.hasOwnProperty.call(obj, prop);
/******/
})();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, {
value: "Module",
});
/******/
}
/******/ Object.defineProperty(exports, "__esModule", { value: true });
/******/
};
/******/
})();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./src/js/index.js");
/******/
/******/
})();