vendor: 3,596 bytes, lines 1-88
1/******/ (function(modules) { // webpackBootstrap 2/******/ // The module cache 3/******/ var installedModules = {}; 4/******/ 5/******/ // The require function 6/******/ function __webpack_require__(moduleId) { 7/******/ 8/******/ // Check if module is in cache 9/******/ if(installedModules[moduleId]) { 10/******/ return installedModules[moduleId].exports; 11/******/ } 12/******/ // Create a new module (and put it into the cache) 13/******/ var module = installedModules[moduleId] = { 14/******/ i: moduleId, 15/******/ l: false, 16/******/ exports: {} 17/******/ }; 18/******/ 19/******/ // Execute the module function 20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21/******/ 22/******/ // Flag the module as loaded 23/******/ module.l = true; 24/******/ 25/******/ // Return the exports of the module 26/******/ return module.exports; 27/******/ } 28/******/ 29/******/ 30/******/ // expose the modules object (__webpack_modules__) 31/******/ __webpack_require__.m = modules; 32/******/ 33/******/ // expose the module cache 34/******/ __webpack_require__.c = installedModules; 35/******/ 36/******/ // define getter function for harmony exports 37/******/ __webpack_require__.d = function(exports, name, getter) { 38/******/ if(!__webpack_require__.o(exports, name)) { 39/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 40/******/ } 41/******/ }; 42/******/ 43/******/ // define __esModule on exports 44/******/ __webpack_require__.r = function(exports) { 45/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 47/******/ } 48/******/ Object.defineProperty(exports, '__esModule', { value: true }); 49/******/ }; 50/******/ 51/******/ // create a fake namespace object 52/******/ // mode & 1: value is a module id, require it 53/******/ // mode & 2: merge all properties of value into the ns 54/******/ // mode & 4: return value when already ns object 55/******/ // mode & 8|1: behave like require 56/******/ __webpack_require__.t = function(value, mode) { 57/******/ if(mode & 1) value = __webpack_require__(value); 58/******/ if(mode & 8) return value; 59/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 60/******/ var ns = Object.create(null); 61/******/ __webpack_require__.r(ns); 62/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 63/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 64/******/ return ns; 65/******/ }; 66/******/ 67/******/ // getDefaultExport function for compatibility with non-harmony modules 68/******/ __webpack_require__.n = function(module) { 69/******/ var getter = module && module.__esModule ? 70/******/ function getDefault() { return module['default']; } : 71/******/ function getModuleExports() { return module; }; 72/******/ __webpack_require__.d(getter, 'a', getter); 73/******/ return getter; 74/******/ }; 75/******/ 76/******/ // Object.prototype.hasOwnProperty.call 77/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 78/******/ 79/******/ // __webpack_public_path__ 80/******/ __webpack_require__.p = "/"; 81/******/ 82/******/ 83/******/ // Load entry module and return exports 84/******/ return __webpack_require__(__webpack_require__.s = 15); 85/******/ }) 86/************************************************************************/ 87/******/ ({ 88
vendor: 970 bytes, lines 89-111
89/***/ "./node_modules/tiny-slider/src/helpers/addCSSRule.js": 90/*!************************************************************!*\ 91 !*** ./node_modules/tiny-slider/src/helpers/addCSSRule.js ***! 92 \************************************************************/ 93/*! exports provided: addCSSRule */ 94/***/ (function(module, __webpack_exports__, __webpack_require__) { 95 96"use strict"; 97__webpack_require__.r(__webpack_exports__); 98/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addCSSRule", function() { return addCSSRule; }); 99/* harmony import */ var _raf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./raf.js */ "./node_modules/tiny-slider/src/helpers/raf.js"); 100// cross browsers addRule method 101 102function addCSSRule(sheet, selector, rules, index) { 103 // return raf(function() { 104 'insertRule' in sheet ? 105 sheet.insertRule(selector + '{' + rules + '}', index) : 106 sheet.addRule(selector, rules, index); 107 // }); 108} 109 110/***/ }), 111
vendor: 1,082 bytes, lines 112-135
112/***/ "./node_modules/tiny-slider/src/helpers/addClass.js": 113/*!**********************************************************!*\ 114 !*** ./node_modules/tiny-slider/src/helpers/addClass.js ***! 115 \**********************************************************/ 116/*! exports provided: addClass */ 117/***/ (function(module, __webpack_exports__, __webpack_require__) { 118 119"use strict"; 120__webpack_require__.r(__webpack_exports__); 121/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addClass", function() { return addClass; }); 122/* harmony import */ var _hasClass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hasClass.js */ "./node_modules/tiny-slider/src/helpers/hasClass.js"); 123 124var addClass = _hasClass_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"] ? 125 function (el, str) { 126 if (!Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.classList.add(str); } 127 } : 128 function (el, str) { 129 if (!Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.className += ' ' + str; } 130 }; 131 132 133 134/***/ }), 135
vendor: 1,023 bytes, lines 136-157
136/***/ "./node_modules/tiny-slider/src/helpers/addEvents.js": 137/*!***********************************************************!*\ 138 !*** ./node_modules/tiny-slider/src/helpers/addEvents.js ***! 139 \***********************************************************/ 140/*! exports provided: addEvents */ 141/***/ (function(module, __webpack_exports__, __webpack_require__) { 142 143"use strict"; 144__webpack_require__.r(__webpack_exports__); 145/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEvents", function() { return addEvents; }); 146/* harmony import */ var _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./passiveOption.js */ "./node_modules/tiny-slider/src/helpers/passiveOption.js"); 147 148 149function addEvents(el, obj, preventScrolling) { 150 for (var prop in obj) { 151 var option = ['touchstart', 'touchmove'].indexOf(prop) >= 0 && !preventScrolling ? _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__["passiveOption"] : false; 152 el.addEventListener(prop, obj[prop], option); 153 } 154} 155 156/***/ }), 157
vendor: 745 bytes, lines 158-177
158/***/ "./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js": 159/*!*******************************************************************!*\ 160 !*** ./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js ***! 161 \*******************************************************************/ 162/*! exports provided: arrayFromNodeList */ 163/***/ (function(module, __webpack_exports__, __webpack_require__) { 164 165"use strict"; 166__webpack_require__.r(__webpack_exports__); 167/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayFromNodeList", function() { return arrayFromNodeList; }); 168function arrayFromNodeList (nl) { 169 var arr = []; 170 for (var i = 0, l = nl.length; i < l; i++) { 171 arr.push(nl[i]); 172 } 173 return arr; 174} 175 176/***/ }), 177
vendor: 637 bytes, lines 178-196
178/***/ "./node_modules/tiny-slider/src/helpers/caf.js": 179/*!*****************************************************!*\ 180 !*** ./node_modules/tiny-slider/src/helpers/caf.js ***! 181 \*****************************************************/ 182/*! exports provided: caf */ 183/***/ (function(module, __webpack_exports__, __webpack_require__) { 184 185"use strict"; 186__webpack_require__.r(__webpack_exports__); 187/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "caf", function() { return caf; }); 188var win = window; 189 190var caf = win.cancelAnimationFrame 191 || win.mozCancelAnimationFrame 192 || function(id){ clearTimeout(id); }; 193 194 195/***/ }), 196
vendor: 1,914 bytes, lines 197-245
197/***/ "./node_modules/tiny-slider/src/helpers/calc.js": 198/*!******************************************************!*\ 199 !*** ./node_modules/tiny-slider/src/helpers/calc.js ***! 200 \******************************************************/ 201/*! exports provided: calc */ 202/***/ (function(module, __webpack_exports__, __webpack_require__) { 203 204"use strict"; 205__webpack_require__.r(__webpack_exports__); 206/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calc", function() { return calc; }); 207/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 208/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 209/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 210// get css-calc 211// @return - false | calc | -webkit-calc | -moz-calc 212// @usage - var calc = getCalc(); 213 214 215 216 217function calc() { 218 var doc = document, 219 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 220 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 221 div = doc.createElement('div'), 222 result = false; 223 224 body.appendChild(div); 225 try { 226 var str = '(10px * 10)', 227 vals = ['calc' + str, '-moz-calc' + str, '-webkit-calc' + str], 228 val; 229 for (var i = 0; i < 3; i++) { 230 val = vals[i]; 231 div.style.width = val; 232 if (div.offsetWidth === 100) { 233 result = val.replace(str, ''); 234 break; 235 } 236 } 237 } catch (e) {} 238 239 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : div.remove(); 240 241 return result; 242} 243 244/***/ }), 245
vendor: 722 bytes, lines 246-261
246/***/ "./node_modules/tiny-slider/src/helpers/checkStorageValue.js": 247/*!*******************************************************************!*\ 248 !*** ./node_modules/tiny-slider/src/helpers/checkStorageValue.js ***! 249 \*******************************************************************/ 250/*! exports provided: checkStorageValue */ 251/***/ (function(module, __webpack_exports__, __webpack_require__) { 252 253"use strict"; 254__webpack_require__.r(__webpack_exports__); 255/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkStorageValue", function() { return checkStorageValue; }); 256function checkStorageValue (value) { 257 return ['true', 'false'].indexOf(value) >= 0 ? JSON.parse(value) : value; 258} 259 260/***/ }), 261
vendor: 667 bytes, lines 262-275
262/***/ "./node_modules/tiny-slider/src/helpers/classListSupport.js": 263/*!******************************************************************!*\ 264 !*** ./node_modules/tiny-slider/src/helpers/classListSupport.js ***! 265 \******************************************************************/ 266/*! exports provided: classListSupport */ 267/***/ (function(module, __webpack_exports__, __webpack_require__) { 268 269"use strict"; 270__webpack_require__.r(__webpack_exports__); 271/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "classListSupport", function() { return classListSupport; }); 272var classListSupport = 'classList' in document.createElement('_'); 273 274/***/ }), 275
vendor: 1,359 bytes, lines 276-310
276/***/ "./node_modules/tiny-slider/src/helpers/createStyleSheet.js": 277/*!******************************************************************!*\ 278 !*** ./node_modules/tiny-slider/src/helpers/createStyleSheet.js ***! 279 \******************************************************************/ 280/*! exports provided: createStyleSheet */ 281/***/ (function(module, __webpack_exports__, __webpack_require__) { 282 283"use strict"; 284__webpack_require__.r(__webpack_exports__); 285/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStyleSheet", function() { return createStyleSheet; }); 286// create and append style sheet 287function createStyleSheet (media, nonce) { 288 // Create the <style> tag 289 var style = document.createElement("style"); 290 // style.setAttribute("type", "text/css"); 291 292 // Add a media (and/or media query) here if you'd like! 293 // style.setAttribute("media", "screen") 294 // style.setAttribute("media", "only screen and (max-width : 1024px)") 295 if (media) { style.setAttribute("media", media); } 296 297 // Add nonce attribute for Content Security Policy 298 if (nonce) { style.setAttribute("nonce", nonce); } 299 300 // WebKit hack :( 301 // style.appendChild(document.createTextNode("")); 302 303 // Add the <style> element to the page 304 document.querySelector('head').appendChild(style); 305 306 return style.sheet ? style.sheet : style.styleSheet; 307}; 308 309/***/ }), 310
vendor: 601 bytes, lines 311-324
311/***/ "./node_modules/tiny-slider/src/helpers/docElement.js": 312/*!************************************************************!*\ 313 !*** ./node_modules/tiny-slider/src/helpers/docElement.js ***! 314 \************************************************************/ 315/*! exports provided: docElement */ 316/***/ (function(module, __webpack_exports__, __webpack_require__) { 317 318"use strict"; 319__webpack_require__.r(__webpack_exports__); 320/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "docElement", function() { return docElement; }); 321var docElement = document.documentElement; 322 323/***/ }), 324
vendor: 1,234 bytes, lines 325-364
325/***/ "./node_modules/tiny-slider/src/helpers/events.js": 326/*!********************************************************!*\ 327 !*** ./node_modules/tiny-slider/src/helpers/events.js ***! 328 \********************************************************/ 329/*! exports provided: Events */ 330/***/ (function(module, __webpack_exports__, __webpack_require__) { 331 332"use strict"; 333__webpack_require__.r(__webpack_exports__); 334/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Events", function() { return Events; }); 335function Events() { 336 return { 337 topics: {}, 338 on: function (eventName, fn) { 339 this.topics[eventName] = this.topics[eventName] || []; 340 this.topics[eventName].push(fn); 341 }, 342 off: function(eventName, fn) { 343 if (this.topics[eventName]) { 344 for (var i = 0; i < this.topics[eventName].length; i++) { 345 if (this.topics[eventName][i] === fn) { 346 this.topics[eventName].splice(i, 1); 347 break; 348 } 349 } 350 } 351 }, 352 emit: function (eventName, data) { 353 data.type = eventName; 354 if (this.topics[eventName]) { 355 this.topics[eventName].forEach(function(fn) { 356 fn(data, eventName); 357 }); 358 } 359 } 360 }; 361}; 362 363/***/ }), 364
vendor: 947 bytes, lines 365-398
365/***/ "./node_modules/tiny-slider/src/helpers/extend.js": 366/*!********************************************************!*\ 367 !*** ./node_modules/tiny-slider/src/helpers/extend.js ***! 368 \********************************************************/ 369/*! exports provided: extend */ 370/***/ (function(module, __webpack_exports__, __webpack_require__) { 371 372"use strict"; 373__webpack_require__.r(__webpack_exports__); 374/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return extend; }); 375function extend() { 376 var obj, name, copy, 377 target = arguments[0] || {}, 378 i = 1, 379 length = arguments.length; 380 381 for (; i < length; i++) { 382 if ((obj = arguments[i]) !== null) { 383 for (name in obj) { 384 copy = obj[name]; 385 386 if (target === copy) { 387 continue; 388 } else if (copy !== undefined) { 389 target[name] = copy; 390 } 391 } 392 } 393 } 394 return target; 395} 396 397/***/ }), 398
vendor: 739 bytes, lines 399-417
399/***/ "./node_modules/tiny-slider/src/helpers/forEach.js": 400/*!*********************************************************!*\ 401 !*** ./node_modules/tiny-slider/src/helpers/forEach.js ***! 402 \*********************************************************/ 403/*! exports provided: forEach */ 404/***/ (function(module, __webpack_exports__, __webpack_require__) { 405 406"use strict"; 407__webpack_require__.r(__webpack_exports__); 408/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; }); 409// https://toddmotto.com/ditch-the-array-foreach-call-nodelist-hack/ 410function forEach (arr, callback, scope) { 411 for (var i = 0, l = arr.length; i < l; i++) { 412 callback.call(scope, arr[i], i); 413 } 414} 415 416/***/ }), 417
vendor: 600 bytes, lines 418-433
418/***/ "./node_modules/tiny-slider/src/helpers/getAttr.js": 419/*!*********************************************************!*\ 420 !*** ./node_modules/tiny-slider/src/helpers/getAttr.js ***! 421 \*********************************************************/ 422/*! exports provided: getAttr */ 423/***/ (function(module, __webpack_exports__, __webpack_require__) { 424 425"use strict"; 426__webpack_require__.r(__webpack_exports__); 427/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAttr", function() { return getAttr; }); 428function getAttr(el, attr) { 429 return el.getAttribute(attr); 430} 431 432/***/ }), 433
vendor: 702 bytes, lines 434-457
434/***/ "./node_modules/tiny-slider/src/helpers/getBody.js": 435/*!*********************************************************!*\ 436 !*** ./node_modules/tiny-slider/src/helpers/getBody.js ***! 437 \*********************************************************/ 438/*! exports provided: getBody */ 439/***/ (function(module, __webpack_exports__, __webpack_require__) { 440 441"use strict"; 442__webpack_require__.r(__webpack_exports__); 443/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBody", function() { return getBody; }); 444function getBody () { 445 var doc = document, 446 body = doc.body; 447 448 if (!body) { 449 body = doc.createElement('body'); 450 body.fake = true; 451 } 452 453 return body; 454} 455 456/***/ }), 457
vendor: 736 bytes, lines 458-474
458/***/ "./node_modules/tiny-slider/src/helpers/getCssRulesLength.js": 459/*!*******************************************************************!*\ 460 !*** ./node_modules/tiny-slider/src/helpers/getCssRulesLength.js ***! 461 \*******************************************************************/ 462/*! exports provided: getCssRulesLength */ 463/***/ (function(module, __webpack_exports__, __webpack_require__) { 464 465"use strict"; 466__webpack_require__.r(__webpack_exports__); 467/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCssRulesLength", function() { return getCssRulesLength; }); 468function getCssRulesLength(sheet) { 469 var rule = ('insertRule' in sheet) ? sheet.cssRules : sheet.rules; 470 return rule.length; 471} 472 473/***/ }), 474
vendor: 1,105 bytes, lines 475-502
475/***/ "./node_modules/tiny-slider/src/helpers/getEndProperty.js": 476/*!****************************************************************!*\ 477 !*** ./node_modules/tiny-slider/src/helpers/getEndProperty.js ***! 478 \****************************************************************/ 479/*! exports provided: getEndProperty */ 480/***/ (function(module, __webpack_exports__, __webpack_require__) { 481 482"use strict"; 483__webpack_require__.r(__webpack_exports__); 484/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEndProperty", function() { return getEndProperty; }); 485// get transitionend, animationend based on transitionDuration 486// @propin: string 487// @propOut: string, first-letter uppercase 488// Usage: getEndProperty('WebkitTransitionDuration', 'Transition') => webkitTransitionEnd 489function getEndProperty(propIn, propOut) { 490 var endProp = false; 491 if (/^Webkit/.test(propIn)) { 492 endProp = 'webkit' + propOut + 'End'; 493 } else if (/^O/.test(propIn)) { 494 endProp = 'o' + propOut + 'End'; 495 } else if (propIn) { 496 endProp = propOut.toLowerCase() + 'end'; 497 } 498 return endProp; 499} 500 501/***/ }), 502
vendor: 678 bytes, lines 503-521
503/***/ "./node_modules/tiny-slider/src/helpers/getSlideId.js": 504/*!************************************************************!*\ 505 !*** ./node_modules/tiny-slider/src/helpers/getSlideId.js ***! 506 \************************************************************/ 507/*! exports provided: getSlideId */ 508/***/ (function(module, __webpack_exports__, __webpack_require__) { 509 510"use strict"; 511__webpack_require__.r(__webpack_exports__); 512/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSlideId", function() { return getSlideId; }); 513function getSlideId() { 514 var id = window.tnsId; 515 window.tnsId = !id ? 1 : id + 1; 516 517 return 'tns' + window.tnsId; 518} 519 520/***/ }), 521
vendor: 867 bytes, lines 522-546
522/***/ "./node_modules/tiny-slider/src/helpers/getTouchDirection.js": 523/*!*******************************************************************!*\ 524 !*** ./node_modules/tiny-slider/src/helpers/getTouchDirection.js ***! 525 \*******************************************************************/ 526/*! exports provided: getTouchDirection */ 527/***/ (function(module, __webpack_exports__, __webpack_require__) { 528 529"use strict"; 530__webpack_require__.r(__webpack_exports__); 531/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTouchDirection", function() { return getTouchDirection; }); 532function getTouchDirection(angle, range) { 533 var direction = false, 534 gap = Math.abs(90 - Math.abs(angle)); 535 536 if (gap >= 90 - range) { 537 direction = 'horizontal'; 538 } else if (gap <= range) { 539 direction = 'vertical'; 540 } 541 542 return direction; 543} 544 545/***/ }), 546
vendor: 1,957 bytes, lines 547-590
547/***/ "./node_modules/tiny-slider/src/helpers/has3DTransforms.js": 548/*!*****************************************************************!*\ 549 !*** ./node_modules/tiny-slider/src/helpers/has3DTransforms.js ***! 550 \*****************************************************************/ 551/*! exports provided: has3DTransforms */ 552/***/ (function(module, __webpack_exports__, __webpack_require__) { 553 554"use strict"; 555__webpack_require__.r(__webpack_exports__); 556/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "has3DTransforms", function() { return has3DTransforms; }); 557/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 558/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 559/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 560 561 562 563 564function has3DTransforms(tf){ 565 if (!tf) { return false; } 566 if (!window.getComputedStyle) { return false; } 567 568 var doc = document, 569 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 570 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 571 el = doc.createElement('p'), 572 has3d, 573 cssTF = tf.length > 9 ? '-' + tf.slice(0, -9).toLowerCase() + '-' : ''; 574 575 cssTF += 'transform'; 576 577 // Add it to the body to get the computed style 578 body.insertBefore(el, null); 579 580 el.style[tf] = 'translate3d(1px,1px,1px)'; 581 has3d = window.getComputedStyle(el).getPropertyValue(cssTF); 582 583 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : el.remove(); 584 585 return (has3d !== undefined && has3d.length > 0 && has3d !== "none"); 586} 587 588 589/***/ }), 590
vendor: 600 bytes, lines 591-606
591/***/ "./node_modules/tiny-slider/src/helpers/hasAttr.js": 592/*!*********************************************************!*\ 593 !*** ./node_modules/tiny-slider/src/helpers/hasAttr.js ***! 594 \*********************************************************/ 595/*! exports provided: hasAttr */ 596/***/ (function(module, __webpack_exports__, __webpack_require__) { 597 598"use strict"; 599__webpack_require__.r(__webpack_exports__); 600/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasAttr", function() { return hasAttr; }); 601function hasAttr(el, attr) { 602 return el.hasAttribute(attr); 603} 604 605/***/ }), 606
vendor: 1,162 bytes, lines 607-629
607/***/ "./node_modules/tiny-slider/src/helpers/hasClass.js": 608/*!**********************************************************!*\ 609 !*** ./node_modules/tiny-slider/src/helpers/hasClass.js ***! 610 \**********************************************************/ 611/*! exports provided: classListSupport, hasClass */ 612/***/ (function(module, __webpack_exports__, __webpack_require__) { 613 614"use strict"; 615__webpack_require__.r(__webpack_exports__); 616/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasClass", function() { return hasClass; }); 617/* harmony import */ var _classListSupport_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classListSupport.js */ "./node_modules/tiny-slider/src/helpers/classListSupport.js"); 618/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "classListSupport", function() { return _classListSupport_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"]; }); 619 620 621 622var hasClass = _classListSupport_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"] ? 623 function (el, str) { return el.classList.contains(str); } : 624 function (el, str) { return el.className.indexOf(str) >= 0; }; 625 626 627 628/***/ }), 629
vendor: 671 bytes, lines 630-645
630/***/ "./node_modules/tiny-slider/src/helpers/hideElement.js": 631/*!*************************************************************!*\ 632 !*** ./node_modules/tiny-slider/src/helpers/hideElement.js ***! 633 \*************************************************************/ 634/*! exports provided: hideElement */ 635/***/ (function(module, __webpack_exports__, __webpack_require__) { 636 637"use strict"; 638__webpack_require__.r(__webpack_exports__); 639/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hideElement", function() { return hideElement; }); 640function hideElement(el, forceHide) { 641 if (el.style.display !== 'none') { el.style.display = 'none'; } 642} 643 644/***/ }), 645
vendor: 673 bytes, lines 646-662
646/***/ "./node_modules/tiny-slider/src/helpers/isNodeList.js": 647/*!************************************************************!*\ 648 !*** ./node_modules/tiny-slider/src/helpers/isNodeList.js ***! 649 \************************************************************/ 650/*! exports provided: isNodeList */ 651/***/ (function(module, __webpack_exports__, __webpack_require__) { 652 653"use strict"; 654__webpack_require__.r(__webpack_exports__); 655/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNodeList", function() { return isNodeList; }); 656function isNodeList(el) { 657 // Only NodeList has the "item()" function 658 return typeof el.item !== "undefined"; 659} 660 661/***/ }), 662
vendor: 635 bytes, lines 663-678
663/***/ "./node_modules/tiny-slider/src/helpers/isVisible.js": 664/*!***********************************************************!*\ 665 !*** ./node_modules/tiny-slider/src/helpers/isVisible.js ***! 666 \***********************************************************/ 667/*! exports provided: isVisible */ 668/***/ (function(module, __webpack_exports__, __webpack_require__) { 669 670"use strict"; 671__webpack_require__.r(__webpack_exports__); 672/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isVisible", function() { return isVisible; }); 673function isVisible(el) { 674 return window.getComputedStyle(el).display !== 'none'; 675} 676 677/***/ }), 678
vendor: 1,205 bytes, lines 679-711
679/***/ "./node_modules/tiny-slider/src/helpers/jsTransform.js": 680/*!*************************************************************!*\ 681 !*** ./node_modules/tiny-slider/src/helpers/jsTransform.js ***! 682 \*************************************************************/ 683/*! exports provided: jsTransform */ 684/***/ (function(module, __webpack_exports__, __webpack_require__) { 685 686"use strict"; 687__webpack_require__.r(__webpack_exports__); 688/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jsTransform", function() { return jsTransform; }); 689function jsTransform(element, attr, prefix, postfix, to, duration, callback) { 690 var tick = Math.min(duration, 10), 691 unit = (to.indexOf('%') >= 0) ? '%' : 'px', 692 to = to.replace(unit, ''), 693 from = Number(element.style[attr].replace(prefix, '').replace(postfix, '').replace(unit, '')), 694 positionTick = (to - from) / duration * tick, 695 running; 696 697 setTimeout(moveElement, tick); 698 function moveElement() { 699 duration -= tick; 700 from += positionTick; 701 element.style[attr] = prefix + from + unit + postfix; 702 if (duration > 0) { 703 setTimeout(moveElement, tick); 704 } else { 705 callback(); 706 } 707 } 708} 709 710/***/ }), 711
vendor: 2,114 bytes, lines 712-763
712/***/ "./node_modules/tiny-slider/src/helpers/mediaquerySupport.js": 713/*!*******************************************************************!*\ 714 !*** ./node_modules/tiny-slider/src/helpers/mediaquerySupport.js ***! 715 \*******************************************************************/ 716/*! exports provided: mediaquerySupport */ 717/***/ (function(module, __webpack_exports__, __webpack_require__) { 718 719"use strict"; 720__webpack_require__.r(__webpack_exports__); 721/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mediaquerySupport", function() { return mediaquerySupport; }); 722/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 723/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 724/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 725 726 727 728 729function mediaquerySupport () { 730 if (window.matchMedia || window.msMatchMedia) { 731 return true; 732 } 733 734 var doc = document, 735 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 736 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 737 div = doc.createElement('div'), 738 style = doc.createElement('style'), 739 rule = '@media all and (min-width:1px){.tns-mq-test{position:absolute}}', 740 position; 741 742 style.type = 'text/css'; 743 div.className = 'tns-mq-test'; 744 745 body.appendChild(style); 746 body.appendChild(div); 747 748 if (style.styleSheet) { 749 style.styleSheet.cssText = rule; 750 } else { 751 style.appendChild(doc.createTextNode(rule)); 752 } 753 754 position = window.getComputedStyle ? window.getComputedStyle(div).position : div.currentStyle['position']; 755 756 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : div.remove(); 757 758 return position === "absolute"; 759} 760 761 762/***/ }), 763
vendor: 943 bytes, lines 764-787
764/***/ "./node_modules/tiny-slider/src/helpers/passiveOption.js": 765/*!***************************************************************!*\ 766 !*** ./node_modules/tiny-slider/src/helpers/passiveOption.js ***! 767 \***************************************************************/ 768/*! exports provided: passiveOption */ 769/***/ (function(module, __webpack_exports__, __webpack_require__) { 770 771"use strict"; 772__webpack_require__.r(__webpack_exports__); 773/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "passiveOption", function() { return passiveOption; }); 774// Test via a getter in the options object to see if the passive property is accessed 775var supportsPassive = false; 776try { 777 var opts = Object.defineProperty({}, 'passive', { 778 get: function() { 779 supportsPassive = true; 780 } 781 }); 782 window.addEventListener("test", null, opts); 783} catch (e) {} 784var passiveOption = supportsPassive ? { passive: true } : false; 785 786/***/ }), 787
vendor: 2,093 bytes, lines 788-838
788/***/ "./node_modules/tiny-slider/src/helpers/percentageLayout.js": 789/*!******************************************************************!*\ 790 !*** ./node_modules/tiny-slider/src/helpers/percentageLayout.js ***! 791 \******************************************************************/ 792/*! exports provided: percentageLayout */ 793/***/ (function(module, __webpack_exports__, __webpack_require__) { 794 795"use strict"; 796__webpack_require__.r(__webpack_exports__); 797/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "percentageLayout", function() { return percentageLayout; }); 798/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 799/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 800/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 801// get subpixel support value 802// @return - boolean 803 804 805 806 807function percentageLayout() { 808 // check subpixel layout supporting 809 var doc = document, 810 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 811 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 812 wrapper = doc.createElement('div'), 813 outer = doc.createElement('div'), 814 str = '', 815 count = 70, 816 perPage = 3, 817 supported = false; 818 819 wrapper.className = "tns-t-subp2"; 820 outer.className = "tns-t-ct"; 821 822 for (var i = 0; i < count; i++) { 823 str += '<div></div>'; 824 } 825 826 outer.innerHTML = str; 827 wrapper.appendChild(outer); 828 body.appendChild(wrapper); 829 830 supported = Math.abs(wrapper.getBoundingClientRect().left - outer.children[count - perPage].getBoundingClientRect().left) < 2; 831 832 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : wrapper.remove(); 833 834 return supported; 835} 836 837/***/ }), 838
vendor: 719 bytes, lines 839-859
839/***/ "./node_modules/tiny-slider/src/helpers/raf.js": 840/*!*****************************************************!*\ 841 !*** ./node_modules/tiny-slider/src/helpers/raf.js ***! 842 \*****************************************************/ 843/*! exports provided: raf */ 844/***/ (function(module, __webpack_exports__, __webpack_require__) { 845 846"use strict"; 847__webpack_require__.r(__webpack_exports__); 848/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "raf", function() { return raf; }); 849var win = window; 850 851var raf = win.requestAnimationFrame 852 || win.webkitRequestAnimationFrame 853 || win.mozRequestAnimationFrame 854 || win.msRequestAnimationFrame 855 || function(cb) { return setTimeout(cb, 16); }; 856 857 858/***/ }), 859
vendor: 1,105 bytes, lines 860-886
860/***/ "./node_modules/tiny-slider/src/helpers/removeAttrs.js": 861/*!*************************************************************!*\ 862 !*** ./node_modules/tiny-slider/src/helpers/removeAttrs.js ***! 863 \*************************************************************/ 864/*! exports provided: removeAttrs */ 865/***/ (function(module, __webpack_exports__, __webpack_require__) { 866 867"use strict"; 868__webpack_require__.r(__webpack_exports__); 869/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAttrs", function() { return removeAttrs; }); 870/* harmony import */ var _isNodeList_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isNodeList.js */ "./node_modules/tiny-slider/src/helpers/isNodeList.js"); 871 872 873function removeAttrs(els, attrs) { 874 els = (Object(_isNodeList_js__WEBPACK_IMPORTED_MODULE_0__["isNodeList"])(els) || els instanceof Array) ? els : [els]; 875 attrs = (attrs instanceof Array) ? attrs : [attrs]; 876 877 var attrLength = attrs.length; 878 for (var i = els.length; i--;) { 879 for (var j = attrLength; j--;) { 880 els[i].removeAttribute(attrs[j]); 881 } 882 } 883} 884 885/***/ }), 886
vendor: 933 bytes, lines 887-909
887/***/ "./node_modules/tiny-slider/src/helpers/removeCSSRule.js": 888/*!***************************************************************!*\ 889 !*** ./node_modules/tiny-slider/src/helpers/removeCSSRule.js ***! 890 \***************************************************************/ 891/*! exports provided: removeCSSRule */ 892/***/ (function(module, __webpack_exports__, __webpack_require__) { 893 894"use strict"; 895__webpack_require__.r(__webpack_exports__); 896/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCSSRule", function() { return removeCSSRule; }); 897/* harmony import */ var _raf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./raf.js */ "./node_modules/tiny-slider/src/helpers/raf.js"); 898// cross browsers addRule method 899 900function removeCSSRule(sheet, index) { 901 // return raf(function() { 902 'deleteRule' in sheet ? 903 sheet.deleteRule(index) : 904 sheet.removeRule(index); 905 // }); 906} 907 908/***/ }), 909
vendor: 1,125 bytes, lines 910-933
910/***/ "./node_modules/tiny-slider/src/helpers/removeClass.js": 911/*!*************************************************************!*\ 912 !*** ./node_modules/tiny-slider/src/helpers/removeClass.js ***! 913 \*************************************************************/ 914/*! exports provided: removeClass */ 915/***/ (function(module, __webpack_exports__, __webpack_require__) { 916 917"use strict"; 918__webpack_require__.r(__webpack_exports__); 919/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeClass", function() { return removeClass; }); 920/* harmony import */ var _hasClass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hasClass.js */ "./node_modules/tiny-slider/src/helpers/hasClass.js"); 921 922var removeClass = _hasClass_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"] ? 923 function (el, str) { 924 if (Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.classList.remove(str); } 925 } : 926 function (el, str) { 927 if (Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.className = el.className.replace(str, ''); } 928 }; 929 930 931 932/***/ }), 933
vendor: 1,011 bytes, lines 934-955
934/***/ "./node_modules/tiny-slider/src/helpers/removeEvents.js": 935/*!**************************************************************!*\ 936 !*** ./node_modules/tiny-slider/src/helpers/removeEvents.js ***! 937 \**************************************************************/ 938/*! exports provided: removeEvents */ 939/***/ (function(module, __webpack_exports__, __webpack_require__) { 940 941"use strict"; 942__webpack_require__.r(__webpack_exports__); 943/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEvents", function() { return removeEvents; }); 944/* harmony import */ var _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./passiveOption.js */ "./node_modules/tiny-slider/src/helpers/passiveOption.js"); 945 946 947function removeEvents(el, obj) { 948 for (var prop in obj) { 949 var option = ['touchstart', 'touchmove'].indexOf(prop) >= 0 ? _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__["passiveOption"] : false; 950 el.removeEventListener(prop, obj[prop], option); 951 } 952} 953 954/***/ }), 955
vendor: 1,108 bytes, lines 956-980
956/***/ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js": 957/*!***************************************************************!*\ 958 !*** ./node_modules/tiny-slider/src/helpers/resetFakeBody.js ***! 959 \***************************************************************/ 960/*! exports provided: resetFakeBody */ 961/***/ (function(module, __webpack_exports__, __webpack_require__) { 962 963"use strict"; 964__webpack_require__.r(__webpack_exports__); 965/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resetFakeBody", function() { return resetFakeBody; }); 966/* harmony import */ var _docElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./docElement.js */ "./node_modules/tiny-slider/src/helpers/docElement.js"); 967 968 969function resetFakeBody (body, docOverflow) { 970 if (body.fake) { 971 body.remove(); 972 _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].style.overflow = docOverflow; 973 // Trigger layout so kinetic scrolling isn't disabled in iOS6+ 974 // eslint-disable-next-line 975 _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].offsetHeight; 976 } 977} 978 979/***/ }), 980
vendor: 1,068 bytes, lines 981-1006
981/***/ "./node_modules/tiny-slider/src/helpers/setAttrs.js": 982/*!**********************************************************!*\ 983 !*** ./node_modules/tiny-slider/src/helpers/setAttrs.js ***! 984 \**********************************************************/ 985/*! exports provided: setAttrs */ 986/***/ (function(module, __webpack_exports__, __webpack_require__) { 987 988"use strict"; 989__webpack_require__.r(__webpack_exports__); 990/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAttrs", function() { return setAttrs; }); 991/* harmony import */ var _isNodeList_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isNodeList.js */ "./node_modules/tiny-slider/src/helpers/isNodeList.js"); 992 993 994function setAttrs(els, attrs) { 995 els = (Object(_isNodeList_js__WEBPACK_IMPORTED_MODULE_0__["isNodeList"])(els) || els instanceof Array) ? els : [els]; 996 if (Object.prototype.toString.call(attrs) !== '[object Object]') { return; } 997 998 for (var i = els.length; i--;) { 999 for(var key in attrs) { 1000 els[i].setAttribute(key, attrs[key]); 1001 } 1002 } 1003} 1004 1005/***/ }), 1006
vendor: 1,310 bytes, lines 1007-1035
1007/***/ "./node_modules/tiny-slider/src/helpers/setFakeBody.js": 1008/*!*************************************************************!*\ 1009 !*** ./node_modules/tiny-slider/src/helpers/setFakeBody.js ***! 1010 \*************************************************************/ 1011/*! exports provided: setFakeBody */ 1012/***/ (function(module, __webpack_exports__, __webpack_require__) { 1013 1014"use strict"; 1015__webpack_require__.r(__webpack_exports__); 1016/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setFakeBody", function() { return setFakeBody; }); 1017/* harmony import */ var _docElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./docElement.js */ "./node_modules/tiny-slider/src/helpers/docElement.js"); 1018 1019 1020function setFakeBody (body) { 1021 var docOverflow = ''; 1022 if (body.fake) { 1023 docOverflow = _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].style.overflow; 1024 //avoid crashing IE8, if background image is used 1025 body.style.background = ''; 1026 //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible 1027 body.style.overflow = _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].style.overflow = 'hidden'; 1028 _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].appendChild(body); 1029 } 1030 1031 return docOverflow; 1032} 1033 1034/***/ }), 1035
vendor: 741 bytes, lines 1036-1054
1036/***/ "./node_modules/tiny-slider/src/helpers/setLocalStorage.js": 1037/*!*****************************************************************!*\ 1038 !*** ./node_modules/tiny-slider/src/helpers/setLocalStorage.js ***! 1039 \*****************************************************************/ 1040/*! exports provided: setLocalStorage */ 1041/***/ (function(module, __webpack_exports__, __webpack_require__) { 1042 1043"use strict"; 1044__webpack_require__.r(__webpack_exports__); 1045/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLocalStorage", function() { return setLocalStorage; }); 1046function setLocalStorage(storage, key, value, access) { 1047 if (access) { 1048 try { storage.setItem(key, value); } catch (e) {} 1049 } 1050 return value; 1051} 1052 1053/***/ }), 1054
vendor: 667 bytes, lines 1055-1070
1055/***/ "./node_modules/tiny-slider/src/helpers/showElement.js": 1056/*!*************************************************************!*\ 1057 !*** ./node_modules/tiny-slider/src/helpers/showElement.js ***! 1058 \*************************************************************/ 1059/*! exports provided: showElement */ 1060/***/ (function(module, __webpack_exports__, __webpack_require__) { 1061 1062"use strict"; 1063__webpack_require__.r(__webpack_exports__); 1064/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showElement", function() { return showElement; }); 1065function showElement(el, forceHide) { 1066 if (el.style.display === 'none') { el.style.display = ''; } 1067} 1068 1069/***/ }), 1070
vendor: 618 bytes, lines 1071-1086
1071/***/ "./node_modules/tiny-slider/src/helpers/toDegree.js": 1072/*!**********************************************************!*\ 1073 !*** ./node_modules/tiny-slider/src/helpers/toDegree.js ***! 1074 \**********************************************************/ 1075/*! exports provided: toDegree */ 1076/***/ (function(module, __webpack_exports__, __webpack_require__) { 1077 1078"use strict"; 1079__webpack_require__.r(__webpack_exports__); 1080/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDegree", function() { return toDegree; }); 1081function toDegree (y, x) { 1082 return Math.atan2(y, x) * (180 / Math.PI); 1083} 1084 1085/***/ }), 1086
vendor: 1,200 bytes, lines 1087-1124
1087/***/ "./node_modules/tiny-slider/src/helpers/whichProperty.js": 1088/*!***************************************************************!*\ 1089 !*** ./node_modules/tiny-slider/src/helpers/whichProperty.js ***! 1090 \***************************************************************/ 1091/*! exports provided: whichProperty */ 1092/***/ (function(module, __webpack_exports__, __webpack_require__) { 1093 1094"use strict"; 1095__webpack_require__.r(__webpack_exports__); 1096/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "whichProperty", function() { return whichProperty; }); 1097function whichProperty(props){ 1098 if (typeof props === 'string') { 1099 var arr = [props], 1100 Props = props.charAt(0).toUpperCase() + props.substr(1), 1101 prefixes = ['Webkit', 'Moz', 'ms', 'O']; 1102 1103 prefixes.forEach(function(prefix) { 1104 if (prefix !== 'ms' || props === 'transform') { 1105 arr.push(prefix + Props); 1106 } 1107 }); 1108 1109 props = arr; 1110 } 1111 1112 var el = document.createElement('fakeelement'), 1113 len = props.length; 1114 for(var i = 0; i < props.length; i++){ 1115 var prop = props[i]; 1116 if( el.style[prop] !== undefined ){ return prop; } 1117 } 1118 1119 return false; // explicit for ie9- 1120} 1121 1122 1123/***/ }), 1124
vendor: 109,421 bytes, lines 1125-3938
1125/***/ "./node_modules/tiny-slider/src/tiny-slider.js": 1126/*!*****************************************************!*\ 1127 !*** ./node_modules/tiny-slider/src/tiny-slider.js ***! 1128 \*****************************************************/ 1129/*! exports provided: tns */ 1130/***/ (function(module, __webpack_exports__, __webpack_require__) { 1131 1132"use strict"; 1133__webpack_require__.r(__webpack_exports__); 1134/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tns", function() { return tns; }); 1135/* harmony import */ var _helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/raf.js */ "./node_modules/tiny-slider/src/helpers/raf.js"); 1136/* harmony import */ var _helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/caf.js */ "./node_modules/tiny-slider/src/helpers/caf.js"); 1137/* harmony import */ var _helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers/extend.js */ "./node_modules/tiny-slider/src/helpers/extend.js"); 1138/* harmony import */ var _helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers/checkStorageValue.js */ "./node_modules/tiny-slider/src/helpers/checkStorageValue.js"); 1139/* harmony import */ var _helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers/setLocalStorage.js */ "./node_modules/tiny-slider/src/helpers/setLocalStorage.js"); 1140/* harmony import */ var _helpers_getSlideId_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers/getSlideId.js */ "./node_modules/tiny-slider/src/helpers/getSlideId.js"); 1141/* harmony import */ var _helpers_calc_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers/calc.js */ "./node_modules/tiny-slider/src/helpers/calc.js"); 1142/* harmony import */ var _helpers_percentageLayout_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers/percentageLayout.js */ "./node_modules/tiny-slider/src/helpers/percentageLayout.js"); 1143/* harmony import */ var _helpers_mediaquerySupport_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers/mediaquerySupport.js */ "./node_modules/tiny-slider/src/helpers/mediaquerySupport.js"); 1144/* harmony import */ var _helpers_createStyleSheet_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/createStyleSheet.js */ "./node_modules/tiny-slider/src/helpers/createStyleSheet.js"); 1145/* harmony import */ var _helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./helpers/addCSSRule.js */ "./node_modules/tiny-slider/src/helpers/addCSSRule.js"); 1146/* harmony import */ var _helpers_removeCSSRule_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers/removeCSSRule.js */ "./node_modules/tiny-slider/src/helpers/removeCSSRule.js"); 1147/* harmony import */ var _helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./helpers/getCssRulesLength.js */ "./node_modules/tiny-slider/src/helpers/getCssRulesLength.js"); 1148/* harmony import */ var _helpers_toDegree_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./helpers/toDegree.js */ "./node_modules/tiny-slider/src/helpers/toDegree.js"); 1149/* harmony import */ var _helpers_getTouchDirection_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./helpers/getTouchDirection.js */ "./node_modules/tiny-slider/src/helpers/getTouchDirection.js"); 1150/* harmony import */ var _helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./helpers/forEach.js */ "./node_modules/tiny-slider/src/helpers/forEach.js"); 1151/* harmony import */ var _helpers_hasClass_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./helpers/hasClass.js */ "./node_modules/tiny-slider/src/helpers/hasClass.js"); 1152/* harmony import */ var _helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./helpers/addClass.js */ "./node_modules/tiny-slider/src/helpers/addClass.js"); 1153/* harmony import */ var _helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./helpers/removeClass.js */ "./node_modules/tiny-slider/src/helpers/removeClass.js"); 1154/* harmony import */ var _helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./helpers/hasAttr.js */ "./node_modules/tiny-slider/src/helpers/hasAttr.js"); 1155/* harmony import */ var _helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./helpers/getAttr.js */ "./node_modules/tiny-slider/src/helpers/getAttr.js"); 1156/* harmony import */ var _helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./helpers/setAttrs.js */ "./node_modules/tiny-slider/src/helpers/setAttrs.js"); 1157/* harmony import */ var _helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./helpers/removeAttrs.js */ "./node_modules/tiny-slider/src/helpers/removeAttrs.js"); 1158/* harmony import */ var _helpers_arrayFromNodeList_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./helpers/arrayFromNodeList.js */ "./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js"); 1159/* harmony import */ var _helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./helpers/hideElement.js */ "./node_modules/tiny-slider/src/helpers/hideElement.js"); 1160/* harmony import */ var _helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./helpers/showElement.js */ "./node_modules/tiny-slider/src/helpers/showElement.js"); 1161/* harmony import */ var _helpers_isVisible_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./helpers/isVisible.js */ "./node_modules/tiny-slider/src/helpers/isVisible.js"); 1162/* harmony import */ var _helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./helpers/whichProperty.js */ "./node_modules/tiny-slider/src/helpers/whichProperty.js"); 1163/* harmony import */ var _helpers_has3DTransforms_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./helpers/has3DTransforms.js */ "./node_modules/tiny-slider/src/helpers/has3DTransforms.js"); 1164/* harmony import */ var _helpers_getEndProperty_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./helpers/getEndProperty.js */ "./node_modules/tiny-slider/src/helpers/getEndProperty.js"); 1165/* harmony import */ var _helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./helpers/addEvents.js */ "./node_modules/tiny-slider/src/helpers/addEvents.js"); 1166/* harmony import */ var _helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./helpers/removeEvents.js */ "./node_modules/tiny-slider/src/helpers/removeEvents.js"); 1167/* harmony import */ var _helpers_events_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./helpers/events.js */ "./node_modules/tiny-slider/src/helpers/events.js"); 1168/* harmony import */ var _helpers_jsTransform_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./helpers/jsTransform.js */ "./node_modules/tiny-slider/src/helpers/jsTransform.js"); 1169// Object.keys 1170if (!Object.keys) { 1171 Object.keys = function(object) { 1172 var keys = []; 1173 for (var name in object) { 1174 if (Object.prototype.hasOwnProperty.call(object, name)) { 1175 keys.push(name); 1176 } 1177 } 1178 return keys; 1179 }; 1180} 1181 1182// ChildNode.remove 1183if(!("remove" in Element.prototype)){ 1184 Element.prototype.remove = function(){ 1185 if(this.parentNode) { 1186 this.parentNode.removeChild(this); 1187 } 1188 }; 1189} 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226var tns = function(options) { 1227 options = Object(_helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__["extend"])({ 1228 container: '.slider', 1229 mode: 'carousel', 1230 axis: 'horizontal', 1231 items: 1, 1232 gutter: 0, 1233 edgePadding: 0, 1234 fixedWidth: false, 1235 autoWidth: false, 1236 viewportMax: false, 1237 slideBy: 1, 1238 center: false, 1239 controls: true, 1240 controlsPosition: 'top', 1241 controlsText: ['prev', 'next'], 1242 controlsContainer: false, 1243 prevButton: false, 1244 nextButton: false, 1245 nav: true, 1246 navPosition: 'top', 1247 navContainer: false, 1248 navAsThumbnails: false, 1249 arrowKeys: false, 1250 speed: 300, 1251 autoplay: false, 1252 autoplayPosition: 'top', 1253 autoplayTimeout: 5000, 1254 autoplayDirection: 'forward', 1255 autoplayText: ['start', 'stop'], 1256 autoplayHoverPause: false, 1257 autoplayButton: false, 1258 autoplayButtonOutput: true, 1259 autoplayResetOnVisibility: true, 1260 animateIn: 'tns-fadeIn', 1261 animateOut: 'tns-fadeOut', 1262 animateNormal: 'tns-normal', 1263 animateDelay: false, 1264 loop: true, 1265 rewind: false, 1266 autoHeight: false, 1267 responsive: false, 1268 lazyload: false, 1269 lazyloadSelector: '.tns-lazy-img', 1270 touch: true, 1271 mouseDrag: false, 1272 swipeAngle: 15, 1273 nested: false, 1274 preventActionWhenRunning: false, 1275 preventScrollOnTouch: false, 1276 freezable: true, 1277 onInit: false, 1278 useLocalStorage: true, 1279 nonce: false 1280 }, options || {}); 1281 1282 var doc = document, 1283 win = window, 1284 KEYS = { 1285 ENTER: 13, 1286 SPACE: 32, 1287 LEFT: 37, 1288 RIGHT: 39 1289 }, 1290 tnsStorage = {}, 1291 localStorageAccess = options.useLocalStorage; 1292 1293 if (localStorageAccess) { 1294 // check browser version and local storage access 1295 var browserInfo = navigator.userAgent; 1296 var uid = new Date; 1297 1298 try { 1299 tnsStorage = win.localStorage; 1300 if (tnsStorage) { 1301 tnsStorage.setItem(uid, uid); 1302 localStorageAccess = tnsStorage.getItem(uid) == uid; 1303 tnsStorage.removeItem(uid); 1304 } else { 1305 localStorageAccess = false; 1306 } 1307 if (!localStorageAccess) { tnsStorage = {}; } 1308 } catch(e) { 1309 localStorageAccess = false; 1310 } 1311 1312 if (localStorageAccess) { 1313 // remove storage when browser version changes 1314 if (tnsStorage['tnsApp'] && tnsStorage['tnsApp'] !== browserInfo) { 1315 ['tC', 'tPL', 'tMQ', 'tTf', 't3D', 'tTDu', 'tTDe', 'tADu', 'tADe', 'tTE', 'tAE'].forEach(function(item) { tnsStorage.removeItem(item); }); 1316 } 1317 // update browserInfo 1318 localStorage['tnsApp'] = browserInfo; 1319 } 1320 } 1321 1322 var CALC = tnsStorage['tC'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tC']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tC', Object(_helpers_calc_js__WEBPACK_IMPORTED_MODULE_6__["calc"])(), localStorageAccess), 1323 PERCENTAGELAYOUT = tnsStorage['tPL'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tPL']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tPL', Object(_helpers_percentageLayout_js__WEBPACK_IMPORTED_MODULE_7__["percentageLayout"])(), localStorageAccess), 1324 CSSMQ = tnsStorage['tMQ'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tMQ']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tMQ', Object(_helpers_mediaquerySupport_js__WEBPACK_IMPORTED_MODULE_8__["mediaquerySupport"])(), localStorageAccess), 1325 TRANSFORM = tnsStorage['tTf'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTf']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTf', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('transform'), localStorageAccess), 1326 HAS3DTRANSFORMS = tnsStorage['t3D'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['t3D']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 't3D', Object(_helpers_has3DTransforms_js__WEBPACK_IMPORTED_MODULE_28__["has3DTransforms"])(TRANSFORM), localStorageAccess), 1327 TRANSITIONDURATION = tnsStorage['tTDu'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTDu']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTDu', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('transitionDuration'), localStorageAccess), 1328 TRANSITIONDELAY = tnsStorage['tTDe'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTDe']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTDe', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('transitionDelay'), localStorageAccess), 1329 ANIMATIONDURATION = tnsStorage['tADu'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tADu']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tADu', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('animationDuration'), localStorageAccess), 1330 ANIMATIONDELAY = tnsStorage['tADe'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tADe']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tADe', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('animationDelay'), localStorageAccess), 1331 TRANSITIONEND = tnsStorage['tTE'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTE']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTE', Object(_helpers_getEndProperty_js__WEBPACK_IMPORTED_MODULE_29__["getEndProperty"])(TRANSITIONDURATION, 'Transition'), localStorageAccess), 1332 ANIMATIONEND = tnsStorage['tAE'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tAE']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tAE', Object(_helpers_getEndProperty_js__WEBPACK_IMPORTED_MODULE_29__["getEndProperty"])(ANIMATIONDURATION, 'Animation'), localStorageAccess); 1333 1334 // get element nodes from selectors 1335 var supportConsoleWarn = win.console && typeof win.console.warn === "function", 1336 tnsList = ['container', 'controlsContainer', 'prevButton', 'nextButton', 'navContainer', 'autoplayButton'], 1337 optionsElements = {}; 1338 1339 tnsList.forEach(function(item) { 1340 if (typeof options[item] === 'string') { 1341 var str = options[item], 1342 el = doc.querySelector(str); 1343 optionsElements[item] = str; 1344 1345 if (el && el.nodeName) { 1346 options[item] = el; 1347 } else { 1348 if (supportConsoleWarn) { console.warn('Can\'t find', options[item]); } 1349 return; 1350 } 1351 } 1352 }); 1353 1354 // make sure at least 1 slide 1355 if (options.container.children.length < 1) { 1356 if (supportConsoleWarn) { console.warn('No slides found in', options.container); } 1357 return; 1358 } 1359 1360 // update options 1361 var responsive = options.responsive, 1362 nested = options.nested, 1363 carousel = options.mode === 'carousel' ? true : false; 1364 1365 if (responsive) { 1366 // apply responsive[0] to options and remove it 1367 if (0 in responsive) { 1368 options = Object(_helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__["extend"])(options, responsive[0]); 1369 delete responsive[0]; 1370 } 1371 1372 var responsiveTem = {}; 1373 for (var key in responsive) { 1374 var val = responsive[key]; 1375 // update responsive 1376 // from: 300: 2 1377 // to: 1378 // 300: { 1379 // items: 2 1380 // } 1381 val = typeof val === 'number' ? {items: val} : val; 1382 responsiveTem[key] = val; 1383 } 1384 responsive = responsiveTem; 1385 responsiveTem = null; 1386 } 1387 1388 // update options 1389 function updateOptions (obj) { 1390 for (var key in obj) { 1391 if (!carousel) { 1392 if (key === 'slideBy') { obj[key] = 'page'; } 1393 if (key === 'edgePadding') { obj[key] = false; } 1394 if (key === 'autoHeight') { obj[key] = false; } 1395 } 1396 1397 // update responsive options 1398 if (key === 'responsive') { updateOptions(obj[key]); } 1399 } 1400 } 1401 if (!carousel) { updateOptions(options); } 1402 1403 1404 // === define and set variables === 1405 if (!carousel) { 1406 options.axis = 'horizontal'; 1407 options.slideBy = 'page'; 1408 options.edgePadding = false; 1409 1410 var animateIn = options.animateIn, 1411 animateOut = options.animateOut, 1412 animateDelay = options.animateDelay, 1413 animateNormal = options.animateNormal; 1414 } 1415 1416 var horizontal = options.axis === 'horizontal' ? true : false, 1417 outerWrapper = doc.createElement('div'), 1418 innerWrapper = doc.createElement('div'), 1419 middleWrapper, 1420 container = options.container, 1421 containerParent = container.parentNode, 1422 containerHTML = container.outerHTML, 1423 slideItems = container.children, 1424 slideCount = slideItems.length, 1425 breakpointZone, 1426 windowWidth = getWindowWidth(), 1427 isOn = false; 1428 if (responsive) { setBreakpointZone(); } 1429 if (carousel) { container.className += ' tns-vpfix'; } 1430 1431 // fixedWidth: viewport > rightBoundary > indexMax 1432 var autoWidth = options.autoWidth, 1433 fixedWidth = getOption('fixedWidth'), 1434 edgePadding = getOption('edgePadding'), 1435 gutter = getOption('gutter'), 1436 viewport = getViewportWidth(), 1437 center = getOption('center'), 1438 items = !autoWidth ? Math.floor(getOption('items')) : 1, 1439 slideBy = getOption('slideBy'), 1440 viewportMax = options.viewportMax || options.fixedWidthViewportWidth, 1441 arrowKeys = getOption('arrowKeys'), 1442 speed = getOption('speed'), 1443 rewind = options.rewind, 1444 loop = rewind ? false : options.loop, 1445 autoHeight = getOption('autoHeight'), 1446 controls = getOption('controls'), 1447 controlsText = getOption('controlsText'), 1448 nav = getOption('nav'), 1449 touch = getOption('touch'), 1450 mouseDrag = getOption('mouseDrag'), 1451 autoplay = getOption('autoplay'), 1452 autoplayTimeout = getOption('autoplayTimeout'), 1453 autoplayText = getOption('autoplayText'), 1454 autoplayHoverPause = getOption('autoplayHoverPause'), 1455 autoplayResetOnVisibility = getOption('autoplayResetOnVisibility'), 1456 sheet = Object(_helpers_createStyleSheet_js__WEBPACK_IMPORTED_MODULE_9__["createStyleSheet"])(null, getOption('nonce')), 1457 lazyload = options.lazyload, 1458 lazyloadSelector = options.lazyloadSelector, 1459 slidePositions, // collection of slide positions 1460 slideItemsOut = [], 1461 cloneCount = loop ? getCloneCountForLoop() : 0, 1462 slideCountNew = !carousel ? slideCount + cloneCount : slideCount + cloneCount * 2, 1463 hasRightDeadZone = (fixedWidth || autoWidth) && !loop ? true : false, 1464 rightBoundary = fixedWidth ? getRightBoundary() : null, 1465 updateIndexBeforeTransform = (!carousel || !loop) ? true : false, 1466 // transform 1467 transformAttr = horizontal ? 'left' : 'top', 1468 transformPrefix = '', 1469 transformPostfix = '', 1470 // index 1471 getIndexMax = (function () { 1472 if (fixedWidth) { 1473 return function() { return center && !loop ? slideCount - 1 : Math.ceil(- rightBoundary / (fixedWidth + gutter)); }; 1474 } else if (autoWidth) { 1475 return function() { 1476 for (var i = 0; i < slideCountNew; i++) { 1477 if (slidePositions[i] >= - rightBoundary) { return i; } 1478 } 1479 }; 1480 } else { 1481 return function() { 1482 if (center && carousel && !loop) { 1483 return slideCount - 1; 1484 } else { 1485 return loop || carousel ? Math.max(0, slideCountNew - Math.ceil(items)) : slideCountNew - 1; 1486 } 1487 }; 1488 } 1489 })(), 1490 index = getStartIndex(getOption('startIndex')), 1491 indexCached = index, 1492 displayIndex = getCurrentSlide(), 1493 indexMin = 0, 1494 indexMax = !autoWidth ? getIndexMax() : null, 1495 // resize 1496 resizeTimer, 1497 preventActionWhenRunning = options.preventActionWhenRunning, 1498 swipeAngle = options.swipeAngle, 1499 moveDirectionExpected = swipeAngle ? '?' : true, 1500 running = false, 1501 onInit = options.onInit, 1502 events = new _helpers_events_js__WEBPACK_IMPORTED_MODULE_32__["Events"](), 1503 // id, class 1504 newContainerClasses = ' tns-slider tns-' + options.mode, 1505 slideId = container.id || Object(_helpers_getSlideId_js__WEBPACK_IMPORTED_MODULE_5__["getSlideId"])(), 1506 disable = getOption('disable'), 1507 disabled = false, 1508 freezable = options.freezable, 1509 freeze = freezable && !autoWidth ? getFreeze() : false, 1510 frozen = false, 1511 controlsEvents = { 1512 'click': onControlsClick, 1513 'keydown': onControlsKeydown 1514 }, 1515 navEvents = { 1516 'click': onNavClick, 1517 'keydown': onNavKeydown 1518 }, 1519 hoverEvents = { 1520 'mouseover': mouseoverPause, 1521 'mouseout': mouseoutRestart 1522 }, 1523 visibilityEvent = {'visibilitychange': onVisibilityChange}, 1524 docmentKeydownEvent = {'keydown': onDocumentKeydown}, 1525 touchEvents = { 1526 'touchstart': onPanStart, 1527 'touchmove': onPanMove, 1528 'touchend': onPanEnd, 1529 'touchcancel': onPanEnd 1530 }, dragEvents = { 1531 'mousedown': onPanStart, 1532 'mousemove': onPanMove, 1533 'mouseup': onPanEnd, 1534 'mouseleave': onPanEnd 1535 }, 1536 hasControls = hasOption('controls'), 1537 hasNav = hasOption('nav'), 1538 navAsThumbnails = autoWidth ? true : options.navAsThumbnails, 1539 hasAutoplay = hasOption('autoplay'), 1540 hasTouch = hasOption('touch'), 1541 hasMouseDrag = hasOption('mouseDrag'), 1542 slideActiveClass = 'tns-slide-active', 1543 slideClonedClass = 'tns-slide-cloned', 1544 imgCompleteClass = 'tns-complete', 1545 imgEvents = { 1546 'load': onImgLoaded, 1547 'error': onImgFailed 1548 }, 1549 imgsComplete, 1550 liveregionCurrent, 1551 preventScroll = options.preventScrollOnTouch === 'force' ? true : false; 1552 1553 // controls 1554 if (hasControls) { 1555 var controlsContainer = options.controlsContainer, 1556 controlsContainerHTML = options.controlsContainer ? options.controlsContainer.outerHTML : '', 1557 prevButton = options.prevButton, 1558 nextButton = options.nextButton, 1559 prevButtonHTML = options.prevButton ? options.prevButton.outerHTML : '', 1560 nextButtonHTML = options.nextButton ? options.nextButton.outerHTML : '', 1561 prevIsButton, 1562 nextIsButton; 1563 } 1564 1565 // nav 1566 if (hasNav) { 1567 var navContainer = options.navContainer, 1568 navContainerHTML = options.navContainer ? options.navContainer.outerHTML : '', 1569 navItems, 1570 pages = autoWidth ? slideCount : getPages(), 1571 pagesCached = 0, 1572 navClicked = -1, 1573 navCurrentIndex = getCurrentNavIndex(), 1574 navCurrentIndexCached = navCurrentIndex, 1575 navActiveClass = 'tns-nav-active', 1576 navStr = 'Carousel Page ', 1577 navStrCurrent = ' (Current Slide)'; 1578 } 1579 1580 // autoplay 1581 if (hasAutoplay) { 1582 var autoplayDirection = options.autoplayDirection === 'forward' ? 1 : -1, 1583 autoplayButton = options.autoplayButton, 1584 autoplayButtonHTML = options.autoplayButton ? options.autoplayButton.outerHTML : '', 1585 autoplayHtmlStrings = ['<span class=\'tns-visually-hidden\'>', ' animation</span>'], 1586 autoplayTimer, 1587 animating, 1588 autoplayHoverPaused, 1589 autoplayUserPaused, 1590 autoplayVisibilityPaused; 1591 } 1592 1593 if (hasTouch || hasMouseDrag) { 1594 var initPosition = {}, 1595 lastPosition = {}, 1596 translateInit, 1597 disX, 1598 disY, 1599 panStart = false, 1600 rafIndex, 1601 getDist = horizontal ? 1602 function(a, b) { return a.x - b.x; } : 1603 function(a, b) { return a.y - b.y; }; 1604 } 1605 1606 // disable slider when slidecount <= items 1607 if (!autoWidth) { resetVariblesWhenDisable(disable || freeze); } 1608 1609 if (TRANSFORM) { 1610 transformAttr = TRANSFORM; 1611 transformPrefix = 'translate'; 1612 1613 if (HAS3DTRANSFORMS) { 1614 transformPrefix += horizontal ? '3d(' : '3d(0px, '; 1615 transformPostfix = horizontal ? ', 0px, 0px)' : ', 0px)'; 1616 } else { 1617 transformPrefix += horizontal ? 'X(' : 'Y('; 1618 transformPostfix = ')'; 1619 } 1620 1621 } 1622 1623 if (carousel) { container.className = container.className.replace('tns-vpfix', ''); } 1624 initStructure(); 1625 initSheet(); 1626 initSliderTransform(); 1627 1628 // === COMMON FUNCTIONS === // 1629 function resetVariblesWhenDisable (condition) { 1630 if (condition) { 1631 controls = nav = touch = mouseDrag = arrowKeys = autoplay = autoplayHoverPause = autoplayResetOnVisibility = false; 1632 } 1633 } 1634 1635 function getCurrentSlide () { 1636 var tem = carousel ? index - cloneCount : index; 1637 while (tem < 0) { tem += slideCount; } 1638 return tem%slideCount + 1; 1639 } 1640 1641 function getStartIndex (ind) { 1642 ind = ind ? Math.max(0, Math.min(loop ? slideCount - 1 : slideCount - items, ind)) : 0; 1643 return carousel ? ind + cloneCount : ind; 1644 } 1645 1646 function getAbsIndex (i) { 1647 if (i == null) { i = index; } 1648 1649 if (carousel) { i -= cloneCount; } 1650 while (i < 0) { i += slideCount; } 1651 1652 return Math.floor(i%slideCount); 1653 } 1654 1655 function getCurrentNavIndex () { 1656 var absIndex = getAbsIndex(), 1657 result; 1658 1659 result = navAsThumbnails ? absIndex : 1660 fixedWidth || autoWidth ? Math.ceil((absIndex + 1) * pages / slideCount - 1) : 1661 Math.floor(absIndex / items); 1662 1663 // set active nav to the last one when reaches the right edge 1664 if (!loop && carousel && index === indexMax) { result = pages - 1; } 1665 1666 return result; 1667 } 1668 1669 function getItemsMax () { 1670 // fixedWidth or autoWidth while viewportMax is not available 1671 if (autoWidth || (fixedWidth && !viewportMax)) { 1672 return slideCount - 1; 1673 // most cases 1674 } else { 1675 var str = fixedWidth ? 'fixedWidth' : 'items', 1676 arr = []; 1677 1678 if (fixedWidth || options[str] < slideCount) { arr.push(options[str]); } 1679 1680 if (responsive) { 1681 for (var bp in responsive) { 1682 var tem = responsive[bp][str]; 1683 if (tem && (fixedWidth || tem < slideCount)) { arr.push(tem); } 1684 } 1685 } 1686 1687 if (!arr.length) { arr.push(0); } 1688 1689 return Math.ceil(fixedWidth ? viewportMax / Math.min.apply(null, arr) : Math.max.apply(null, arr)); 1690 } 1691 } 1692 1693 function getCloneCountForLoop () { 1694 var itemsMax = getItemsMax(), 1695 result = carousel ? Math.ceil((itemsMax * 5 - slideCount)/2) : (itemsMax * 4 - slideCount); 1696 result = Math.max(itemsMax, result); 1697 1698 return hasOption('edgePadding') ? result + 1 : result; 1699 } 1700 1701 function getWindowWidth () { 1702 return win.innerWidth || doc.documentElement.clientWidth || doc.body.clientWidth; 1703 } 1704 1705 function getInsertPosition (pos) { 1706 return pos === 'top' ? 'afterbegin' : 'beforeend'; 1707 } 1708 1709 function getClientWidth (el) { 1710 if (el == null) { return; } 1711 var div = doc.createElement('div'), rect, width; 1712 el.appendChild(div); 1713 rect = div.getBoundingClientRect(); 1714 width = rect.right - rect.left; 1715 div.remove(); 1716 return width || getClientWidth(el.parentNode); 1717 } 1718 1719 function getViewportWidth () { 1720 var gap = edgePadding ? edgePadding * 2 - gutter : 0; 1721 return getClientWidth(containerParent) - gap; 1722 } 1723 1724 function hasOption (item) { 1725 if (options[item]) { 1726 return true; 1727 } else { 1728 if (responsive) { 1729 for (var bp in responsive) { 1730 if (responsive[bp][item]) { return true; } 1731 } 1732 } 1733 return false; 1734 } 1735 } 1736 1737 // get option: 1738 // fixed width: viewport, fixedWidth, gutter => items 1739 // others: window width => all variables 1740 // all: items => slideBy 1741 function getOption (item, ww) { 1742 if (ww == null) { ww = windowWidth; } 1743 1744 if (item === 'items' && fixedWidth) { 1745 return Math.floor((viewport + gutter) / (fixedWidth + gutter)) || 1; 1746 1747 } else { 1748 var result = options[item]; 1749 1750 if (responsive) { 1751 for (var bp in responsive) { 1752 // bp: convert string to number 1753 if (ww >= parseInt(bp)) { 1754 if (item in responsive[bp]) { result = responsive[bp][item]; } 1755 } 1756 } 1757 } 1758 1759 if (item === 'slideBy' && result === 'page') { result = getOption('items'); } 1760 if (!carousel && (item === 'slideBy' || item === 'items')) { result = Math.floor(result); } 1761 1762 return result; 1763 } 1764 } 1765 1766 function getSlideMarginLeft (i) { 1767 return CALC ? 1768 CALC + '(' + i * 100 + '% / ' + slideCountNew + ')' : 1769 i * 100 / slideCountNew + '%'; 1770 } 1771 1772 function getInnerWrapperStyles (edgePaddingTem, gutterTem, fixedWidthTem, speedTem, autoHeightBP) { 1773 var str = ''; 1774 1775 if (edgePaddingTem !== undefined) { 1776 var gap = edgePaddingTem; 1777 if (gutterTem) { gap -= gutterTem; } 1778 str = horizontal ? 1779 'margin: 0 ' + gap + 'px 0 ' + edgePaddingTem + 'px;' : 1780 'margin: ' + edgePaddingTem + 'px 0 ' + gap + 'px 0;'; 1781 } else if (gutterTem && !fixedWidthTem) { 1782 var gutterTemUnit = '-' + gutterTem + 'px', 1783 dir = horizontal ? gutterTemUnit + ' 0 0' : '0 ' + gutterTemUnit + ' 0'; 1784 str = 'margin: 0 ' + dir + ';' 1785 } 1786 1787 if (!carousel && autoHeightBP && TRANSITIONDURATION && speedTem) { str += getTransitionDurationStyle(speedTem); } 1788 return str; 1789 } 1790 1791 function getContainerWidth (fixedWidthTem, gutterTem, itemsTem) { 1792 if (fixedWidthTem) { 1793 return (fixedWidthTem + gutterTem) * slideCountNew + 'px'; 1794 } else { 1795 return CALC ? 1796 CALC + '(' + slideCountNew * 100 + '% / ' + itemsTem + ')' : 1797 slideCountNew * 100 / itemsTem + '%'; 1798 } 1799 } 1800 1801 function getSlideWidthStyle (fixedWidthTem, gutterTem, itemsTem) { 1802 var width; 1803 1804 if (fixedWidthTem) { 1805 width = (fixedWidthTem + gutterTem) + 'px'; 1806 } else { 1807 if (!carousel) { itemsTem = Math.floor(itemsTem); } 1808 var dividend = carousel ? slideCountNew : itemsTem; 1809 width = CALC ? 1810 CALC + '(100% / ' + dividend + ')' : 1811 100 / dividend + '%'; 1812 } 1813 1814 width = 'width:' + width; 1815 1816 // inner slider: overwrite outer slider styles 1817 return nested !== 'inner' ? width + ';' : width + ' !important;'; 1818 } 1819 1820 function getSlideGutterStyle (gutterTem) { 1821 var str = ''; 1822 1823 // gutter maybe interger || 0 1824 // so can't use 'if (gutter)' 1825 if (gutterTem !== false) { 1826 var prop = horizontal ? 'padding-' : 'margin-', 1827 dir = horizontal ? 'right' : 'bottom'; 1828 str = prop + dir + ': ' + gutterTem + 'px;'; 1829 } 1830 1831 return str; 1832 } 1833 1834 function getCSSPrefix (name, num) { 1835 var prefix = name.substring(0, name.length - num).toLowerCase(); 1836 if (prefix) { prefix = '-' + prefix + '-'; } 1837 1838 return prefix; 1839 } 1840 1841 function getTransitionDurationStyle (speed) { 1842 return getCSSPrefix(TRANSITIONDURATION, 18) + 'transition-duration:' + speed / 1000 + 's;'; 1843 } 1844 1845 function getAnimationDurationStyle (speed) { 1846 return getCSSPrefix(ANIMATIONDURATION, 17) + 'animation-duration:' + speed / 1000 + 's;'; 1847 } 1848 1849 function initStructure () { 1850 var classOuter = 'tns-outer', 1851 classInner = 'tns-inner', 1852 hasGutter = hasOption('gutter'); 1853 1854 outerWrapper.className = classOuter; 1855 innerWrapper.className = classInner; 1856 outerWrapper.id = slideId + '-ow'; 1857 innerWrapper.id = slideId + '-iw'; 1858 1859 // set container properties 1860 if (container.id === '') { container.id = slideId; } 1861 newContainerClasses += PERCENTAGELAYOUT || autoWidth ? ' tns-subpixel' : ' tns-no-subpixel'; 1862 newContainerClasses += CALC ? ' tns-calc' : ' tns-no-calc'; 1863 if (autoWidth) { newContainerClasses += ' tns-autowidth'; } 1864 newContainerClasses += ' tns-' + options.axis; 1865 container.className += newContainerClasses; 1866 1867 // add constrain layer for carousel 1868 if (carousel) { 1869 middleWrapper = doc.createElement('div'); 1870 middleWrapper.id = slideId + '-mw'; 1871 middleWrapper.className = 'tns-ovh'; 1872 1873 outerWrapper.appendChild(middleWrapper); 1874 middleWrapper.appendChild(innerWrapper); 1875 } else { 1876 outerWrapper.appendChild(innerWrapper); 1877 } 1878 1879 if (autoHeight) { 1880 var wp = middleWrapper ? middleWrapper : innerWrapper; 1881 wp.className += ' tns-ah'; 1882 } 1883 1884 containerParent.insertBefore(outerWrapper, container); 1885 innerWrapper.appendChild(container); 1886 1887 // add id, class, aria attributes 1888 // before clone slides 1889 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(item, i) { 1890 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, 'tns-item'); 1891 if (!item.id) { item.id = slideId + '-item' + i; } 1892 if (!carousel && animateNormal) { Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateNormal); } 1893 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(item, { 1894 'aria-hidden': 'true', 1895 'tabindex': '-1' 1896 }); 1897 }); 1898 1899 // ## clone slides 1900 // carousel: n + slides + n 1901 // gallery: slides + n 1902 if (cloneCount) { 1903 var fragmentBefore = doc.createDocumentFragment(), 1904 fragmentAfter = doc.createDocumentFragment(); 1905 1906 for (var j = cloneCount; j--;) { 1907 var num = j%slideCount, 1908 cloneFirst = slideItems[num].cloneNode(true); 1909 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(cloneFirst, slideClonedClass); 1910 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(cloneFirst, 'id'); 1911 fragmentAfter.insertBefore(cloneFirst, fragmentAfter.firstChild); 1912 1913 if (carousel) { 1914 var cloneLast = slideItems[slideCount - 1 - num].cloneNode(true); 1915 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(cloneLast, slideClonedClass); 1916 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(cloneLast, 'id'); 1917 fragmentBefore.appendChild(cloneLast); 1918 } 1919 } 1920 1921 container.insertBefore(fragmentBefore, container.firstChild); 1922 container.appendChild(fragmentAfter); 1923 slideItems = container.children; 1924 } 1925 1926 } 1927 1928 function initSliderTransform () { 1929 // ## images loaded/failed 1930 if (hasOption('autoHeight') || autoWidth || !horizontal) { 1931 var imgs = container.querySelectorAll('img'); 1932 1933 // add img load event listener 1934 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(imgs, function(img) { 1935 var src = img.src; 1936 1937 if (!lazyload) { 1938 // not data img 1939 if (src && src.indexOf('data:image') < 0) { 1940 img.src = ''; 1941 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(img, imgEvents); 1942 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'loading'); 1943 1944 img.src = src; 1945 // data img 1946 } else { 1947 imgLoaded(img); 1948 } 1949 } 1950 }); 1951 1952 // set imgsComplete 1953 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(Object(_helpers_arrayFromNodeList_js__WEBPACK_IMPORTED_MODULE_23__["arrayFromNodeList"])(imgs), function() { imgsComplete = true; }); }); 1954 1955 // reset imgs for auto height: check visible imgs only 1956 if (hasOption('autoHeight')) { imgs = getImageArray(index, Math.min(index + items - 1, slideCountNew - 1)); } 1957 1958 lazyload ? initSliderTransformStyleCheck() : Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(Object(_helpers_arrayFromNodeList_js__WEBPACK_IMPORTED_MODULE_23__["arrayFromNodeList"])(imgs), initSliderTransformStyleCheck); }); 1959 1960 } else { 1961 // set container transform property 1962 if (carousel) { doContainerTransformSilent(); } 1963 1964 // update slider tools and events 1965 initTools(); 1966 initEvents(); 1967 } 1968 } 1969 1970 function initSliderTransformStyleCheck () { 1971 if (autoWidth && slideCount > 1) { 1972 // check styles application 1973 var num = loop ? index : slideCount - 1; 1974 1975 (function stylesApplicationCheck() { 1976 var left = slideItems[num].getBoundingClientRect().left; 1977 var right = slideItems[num - 1].getBoundingClientRect().right; 1978 1979 (Math.abs(left - right) <= 1) ? 1980 initSliderTransformCore() : 1981 setTimeout(function(){ stylesApplicationCheck() }, 16); 1982 })(); 1983 1984 } else { 1985 initSliderTransformCore(); 1986 } 1987 } 1988 1989 1990 function initSliderTransformCore () { 1991 // run Fn()s which are rely on image loading 1992 if (!horizontal || autoWidth) { 1993 setSlidePositions(); 1994 1995 if (autoWidth) { 1996 rightBoundary = getRightBoundary(); 1997 if (freezable) { freeze = getFreeze(); } 1998 indexMax = getIndexMax(); // <= slidePositions, rightBoundary <= 1999 resetVariblesWhenDisable(disable || freeze); 2000 } else { 2001 updateContentWrapperHeight(); 2002 } 2003 } 2004 2005 // set container transform property 2006 if (carousel) { doContainerTransformSilent(); } 2007 2008 // update slider tools and events 2009 initTools(); 2010 initEvents(); 2011 } 2012 2013 function initSheet () { 2014 // gallery: 2015 // set animation classes and left value for gallery slider 2016 if (!carousel) { 2017 for (var i = index, l = index + Math.min(slideCount, items); i < l; i++) { 2018 var item = slideItems[i]; 2019 item.style.left = (i - index) * 100 / items + '%'; 2020 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateIn); 2021 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateNormal); 2022 } 2023 } 2024 2025 // #### LAYOUT 2026 2027 // ## INLINE-BLOCK VS FLOAT 2028 2029 // ## PercentageLayout: 2030 // slides: inline-block 2031 // remove blank space between slides by set font-size: 0 2032 2033 // ## Non PercentageLayout: 2034 // slides: float 2035 // margin-right: -100% 2036 // margin-left: ~ 2037 2038 // Resource: https://docs.google.com/spreadsheets/d/147up245wwTXeQYve3BRSAD4oVcvQmuGsFteJOeA5xNQ/edit?usp=sharing 2039 if (horizontal) { 2040 if (PERCENTAGELAYOUT || autoWidth) { 2041 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', 'font-size:' + win.getComputedStyle(slideItems[0]).fontSize + ';', Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 2042 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId, 'font-size:0;', Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 2043 } else if (carousel) { 2044 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function (slide, i) { 2045 slide.style.marginLeft = getSlideMarginLeft(i); 2046 }); 2047 } 2048 } 2049 2050 2051 // ## BASIC STYLES 2052 if (CSSMQ) { 2053 // middle wrapper style 2054 if (TRANSITIONDURATION) { 2055 var str = middleWrapper && options.autoHeight ? getTransitionDurationStyle(options.speed) : ''; 2056 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + '-mw', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 2057 } 2058 2059 // inner wrapper styles 2060 str = getInnerWrapperStyles(options.edgePadding, options.gutter, options.fixedWidth, options.speed, options.autoHeight); 2061 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + '-iw', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 2062 2063 // container styles 2064 if (carousel) { 2065 str = horizontal && !autoWidth ? 'width:' + getContainerWidth(options.fixedWidth, options.gutter, options.items) + ';' : ''; 2066 if (TRANSITIONDURATION) { str += getTransitionDurationStyle(speed); } 2067 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId, str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 2068 } 2069 2070 // slide styles 2071 str = horizontal && !autoWidth ? getSlideWidthStyle(options.fixedWidth, options.gutter, options.items) : ''; 2072 if (options.gutter) { str += getSlideGutterStyle(options.gutter); } 2073 // set gallery items transition-duration 2074 if (!carousel) { 2075 if (TRANSITIONDURATION) { str += getTransitionDurationStyle(speed); } 2076 if (ANIMATIONDURATION) { str += getAnimationDurationStyle(speed); } 2077 } 2078 if (str) { Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); } 2079 2080 // non CSS mediaqueries: IE8 2081 // ## update inner wrapper, container, slides if needed 2082 // set inline styles for inner wrapper & container 2083 // insert stylesheet (one line) for slides only (since slides are many) 2084 } else { 2085 // middle wrapper styles 2086 update_carousel_transition_duration(); 2087 2088 // inner wrapper styles 2089 innerWrapper.style.cssText = getInnerWrapperStyles(edgePadding, gutter, fixedWidth, autoHeight); 2090 2091 // container styles 2092 if (carousel && horizontal && !autoWidth) { 2093 container.style.width = getContainerWidth(fixedWidth, gutter, items); 2094 } 2095 2096 // slide styles 2097 var str = horizontal && !autoWidth ? getSlideWidthStyle(fixedWidth, gutter, items) : ''; 2098 if (gutter) { str += getSlideGutterStyle(gutter); } 2099 2100 // append to the last line 2101 if (str) { Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); } 2102 } 2103 2104 // ## MEDIAQUERIES 2105 if (responsive && CSSMQ) { 2106 for (var bp in responsive) { 2107 // bp: convert string to number 2108 bp = parseInt(bp); 2109 2110 var opts = responsive[bp], 2111 str = '', 2112 middleWrapperStr = '', 2113 innerWrapperStr = '', 2114 containerStr = '', 2115 slideStr = '', 2116 itemsBP = !autoWidth ? getOption('items', bp) : null, 2117 fixedWidthBP = getOption('fixedWidth', bp), 2118 speedBP = getOption('speed', bp), 2119 edgePaddingBP = getOption('edgePadding', bp), 2120 autoHeightBP = getOption('autoHeight', bp), 2121 gutterBP = getOption('gutter', bp); 2122 2123 // middle wrapper string 2124 if (TRANSITIONDURATION && middleWrapper && getOption('autoHeight', bp) && 'speed' in opts) { 2125 middleWrapperStr = '#' + slideId + '-mw{' + getTransitionDurationStyle(speedBP) + '}'; 2126 } 2127 2128 // inner wrapper string 2129 if ('edgePadding' in opts || 'gutter' in opts) { 2130 innerWrapperStr = '#' + slideId + '-iw{' + getInnerWrapperStyles(edgePaddingBP, gutterBP, fixedWidthBP, speedBP, autoHeightBP) + '}'; 2131 } 2132 2133 // container string 2134 if (carousel && horizontal && !autoWidth && ('fixedWidth' in opts || 'items' in opts || (fixedWidth && 'gutter' in opts))) { 2135 containerStr = 'width:' + getContainerWidth(fixedWidthBP, gutterBP, itemsBP) + ';'; 2136 } 2137 if (TRANSITIONDURATION && 'speed' in opts) { 2138 containerStr += getTransitionDurationStyle(speedBP); 2139 } 2140 if (containerStr) { 2141 containerStr = '#' + slideId + '{' + containerStr + '}'; 2142 } 2143 2144 // slide string 2145 if ('fixedWidth' in opts || (fixedWidth && 'gutter' in opts) || !carousel && 'items' in opts) { 2146 slideStr += getSlideWidthStyle(fixedWidthBP, gutterBP, itemsBP); 2147 } 2148 if ('gutter' in opts) { 2149 slideStr += getSlideGutterStyle(gutterBP); 2150 } 2151 // set gallery items transition-duration 2152 if (!carousel && 'speed' in opts) { 2153 if (TRANSITIONDURATION) { slideStr += getTransitionDurationStyle(speedBP); } 2154 if (ANIMATIONDURATION) { slideStr += getAnimationDurationStyle(speedBP); } 2155 } 2156 if (slideStr) { slideStr = '#' + slideId + ' > .tns-item{' + slideStr + '}'; } 2157 2158 // add up 2159 str = middleWrapperStr + innerWrapperStr + containerStr + slideStr; 2160 2161 if (str) { 2162 sheet.insertRule('@media (min-width: ' + bp / 16 + 'em) {' + str + '}', sheet.cssRules.length); 2163 } 2164 } 2165 } 2166 } 2167 2168 function initTools () { 2169 // == slides == 2170 updateSlideStatus(); 2171 2172 // == live region == 2173 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>'); 2174 liveregionCurrent = outerWrapper.querySelector('.tns-liveregion .current'); 2175 2176 // == autoplayInit == 2177 if (hasAutoplay) { 2178 var txt = autoplay ? 'stop' : 'start'; 2179 if (autoplayButton) { 2180 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(autoplayButton, {'data-action': txt}); 2181 } else if (options.autoplayButtonOutput) { 2182 outerWrapper.insertAdjacentHTML(getInsertPosition(options.autoplayPosition), '<button type="button" data-action="' + txt + '">' + autoplayHtmlStrings[0] + txt + autoplayHtmlStrings[1] + autoplayText[0] + '</button>'); 2183 autoplayButton = outerWrapper.querySelector('[data-action]'); 2184 } 2185 2186 // add event 2187 if (autoplayButton) { 2188 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(autoplayButton, {'click': toggleAutoplay}); 2189 } 2190 2191 if (autoplay) { 2192 startAutoplay(); 2193 if (autoplayHoverPause) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, hoverEvents); } 2194 if (autoplayResetOnVisibility) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, visibilityEvent); } 2195 } 2196 } 2197 2198 // == navInit == 2199 if (hasNav) { 2200 var initIndex = !carousel ? 0 : cloneCount; 2201 // customized nav 2202 // will not hide the navs in case they're thumbnails 2203 if (navContainer) { 2204 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navContainer, {'aria-label': 'Carousel Pagination'}); 2205 navItems = navContainer.children; 2206 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(navItems, function(item, i) { 2207 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(item, { 2208 'data-nav': i, 2209 'tabindex': '-1', 2210 'aria-label': navStr + (i + 1), 2211 'aria-controls': slideId, 2212 }); 2213 }); 2214 2215 // generated nav 2216 } else { 2217 var navHtml = '', 2218 hiddenStr = navAsThumbnails ? '' : 'style="display:none"'; 2219 for (var i = 0; i < slideCount; i++) { 2220 // hide nav items by default 2221 navHtml += '<button type="button" data-nav="' + i +'" tabindex="-1" aria-controls="' + slideId + '" ' + hiddenStr + ' aria-label="' + navStr + (i + 1) +'"></button>'; 2222 } 2223 navHtml = '<div class="tns-nav" aria-label="Carousel Pagination">' + navHtml + '</div>'; 2224 outerWrapper.insertAdjacentHTML(getInsertPosition(options.navPosition), navHtml); 2225 2226 navContainer = outerWrapper.querySelector('.tns-nav'); 2227 navItems = navContainer.children; 2228 } 2229 2230 updateNavVisibility(); 2231 2232 // add transition 2233 if (TRANSITIONDURATION) { 2234 var prefix = TRANSITIONDURATION.substring(0, TRANSITIONDURATION.length - 18).toLowerCase(), 2235 str = 'transition: all ' + speed / 1000 + 's'; 2236 2237 if (prefix) { 2238 str = '-' + prefix + '-' + str; 2239 } 2240 2241 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '[aria-controls^=' + slideId + '-item]', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 2242 } 2243 2244 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navItems[navCurrentIndex], {'aria-label': navStr + (navCurrentIndex + 1) + navStrCurrent}); 2245 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(navItems[navCurrentIndex], 'tabindex'); 2246 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(navItems[navCurrentIndex], navActiveClass); 2247 2248 // add events 2249 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(navContainer, navEvents); 2250 } 2251 2252 2253 2254 // == controlsInit == 2255 if (hasControls) { 2256 if (!controlsContainer && (!prevButton || !nextButton)) { 2257 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>'); 2258 2259 controlsContainer = outerWrapper.querySelector('.tns-controls'); 2260 } 2261 2262 if (!prevButton || !nextButton) { 2263 prevButton = controlsContainer.children[0]; 2264 nextButton = controlsContainer.children[1]; 2265 } 2266 2267 if (options.controlsContainer) { 2268 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(controlsContainer, { 2269 'aria-label': 'Carousel Navigation', 2270 'tabindex': '0' 2271 }); 2272 } 2273 2274 if (options.controlsContainer || (options.prevButton && options.nextButton)) { 2275 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])([prevButton, nextButton], { 2276 'aria-controls': slideId, 2277 'tabindex': '-1', 2278 }); 2279 } 2280 2281 if (options.controlsContainer || (options.prevButton && options.nextButton)) { 2282 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(prevButton, {'data-controls' : 'prev'}); 2283 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(nextButton, {'data-controls' : 'next'}); 2284 } 2285 2286 prevIsButton = isButton(prevButton); 2287 nextIsButton = isButton(nextButton); 2288 2289 updateControlsStatus(); 2290 2291 // add events 2292 if (controlsContainer) { 2293 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(controlsContainer, controlsEvents); 2294 } else { 2295 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(prevButton, controlsEvents); 2296 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(nextButton, controlsEvents); 2297 } 2298 } 2299 2300 // hide tools if needed 2301 disableUI(); 2302 } 2303 2304 function initEvents () { 2305 // add events 2306 if (carousel && TRANSITIONEND) { 2307 var eve = {}; 2308 eve[TRANSITIONEND] = onTransitionEnd; 2309 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, eve); 2310 } 2311 2312 if (touch) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, touchEvents, options.preventScrollOnTouch); } 2313 if (mouseDrag) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, dragEvents); } 2314 if (arrowKeys) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(doc, docmentKeydownEvent); } 2315 2316 if (nested === 'inner') { 2317 events.on('outerResized', function () { 2318 resizeTasks(); 2319 events.emit('innerLoaded', info()); 2320 }); 2321 } else if (responsive || fixedWidth || autoWidth || autoHeight || !horizontal) { 2322 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(win, {'resize': onResize}); 2323 } 2324 2325 if (autoHeight) { 2326 if (nested === 'outer') { 2327 events.on('innerLoaded', doAutoHeight); 2328 } else if (!disable) { doAutoHeight(); } 2329 } 2330 2331 doLazyLoad(); 2332 if (disable) { disableSlider(); } else if (freeze) { freezeSlider(); } 2333 2334 events.on('indexChanged', additionalUpdates); 2335 if (nested === 'inner') { events.emit('innerLoaded', info()); } 2336 if (typeof onInit === 'function') { onInit(info()); } 2337 isOn = true; 2338 } 2339 2340 function destroy () { 2341 // sheet 2342 sheet.disabled = true; 2343 if (sheet.ownerNode) { sheet.ownerNode.remove(); } 2344 2345 // remove win event listeners 2346 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(win, {'resize': onResize}); 2347 2348 // arrowKeys, controls, nav 2349 if (arrowKeys) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(doc, docmentKeydownEvent); } 2350 if (controlsContainer) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(controlsContainer, controlsEvents); } 2351 if (navContainer) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(navContainer, navEvents); } 2352 2353 // autoplay 2354 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, hoverEvents); 2355 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, visibilityEvent); 2356 if (autoplayButton) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(autoplayButton, {'click': toggleAutoplay}); } 2357 if (autoplay) { clearInterval(autoplayTimer); } 2358 2359 // container 2360 if (carousel && TRANSITIONEND) { 2361 var eve = {}; 2362 eve[TRANSITIONEND] = onTransitionEnd; 2363 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, eve); 2364 } 2365 if (touch) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, touchEvents); } 2366 if (mouseDrag) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, dragEvents); } 2367 2368 // cache Object values in options && reset HTML 2369 var htmlList = [containerHTML, controlsContainerHTML, prevButtonHTML, nextButtonHTML, navContainerHTML, autoplayButtonHTML]; 2370 2371 tnsList.forEach(function(item, i) { 2372 var el = item === 'container' ? outerWrapper : options[item]; 2373 2374 if (typeof el === 'object' && el) { 2375 var prevEl = el.previousElementSibling ? el.previousElementSibling : false, 2376 parentEl = el.parentNode; 2377 el.outerHTML = htmlList[i]; 2378 options[item] = prevEl ? prevEl.nextElementSibling : parentEl.firstElementChild; 2379 } 2380 }); 2381 2382 2383 // reset variables 2384 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 = 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 = null; 2385 // check variables 2386 // [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); } }); 2387 2388 for (var a in this) { 2389 if (a !== 'rebuild') { this[a] = null; } 2390 } 2391 isOn = false; 2392 } 2393 2394// === ON RESIZE === 2395 // responsive || fixedWidth || autoWidth || !horizontal 2396 function onResize (e) { 2397 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ resizeTasks(getEvent(e)); }); 2398 } 2399 2400 function resizeTasks (e) { 2401 if (!isOn) { return; } 2402 if (nested === 'outer') { events.emit('outerResized', info(e)); } 2403 windowWidth = getWindowWidth(); 2404 var bpChanged, 2405 breakpointZoneTem = breakpointZone, 2406 needContainerTransform = false; 2407 2408 if (responsive) { 2409 setBreakpointZone(); 2410 bpChanged = breakpointZoneTem !== breakpointZone; 2411 // if (hasRightDeadZone) { needContainerTransform = true; } // *? 2412 if (bpChanged) { events.emit('newBreakpointStart', info(e)); } 2413 } 2414 2415 var indChanged, 2416 itemsChanged, 2417 itemsTem = items, 2418 disableTem = disable, 2419 freezeTem = freeze, 2420 arrowKeysTem = arrowKeys, 2421 controlsTem = controls, 2422 navTem = nav, 2423 touchTem = touch, 2424 mouseDragTem = mouseDrag, 2425 autoplayTem = autoplay, 2426 autoplayHoverPauseTem = autoplayHoverPause, 2427 autoplayResetOnVisibilityTem = autoplayResetOnVisibility, 2428 indexTem = index; 2429 2430 if (bpChanged) { 2431 var fixedWidthTem = fixedWidth, 2432 autoHeightTem = autoHeight, 2433 controlsTextTem = controlsText, 2434 centerTem = center, 2435 autoplayTextTem = autoplayText; 2436 2437 if (!CSSMQ) { 2438 var gutterTem = gutter, 2439 edgePaddingTem = edgePadding; 2440 } 2441 } 2442 2443 // get option: 2444 // fixed width: viewport, fixedWidth, gutter => items 2445 // others: window width => all variables 2446 // all: items => slideBy 2447 arrowKeys = getOption('arrowKeys'); 2448 controls = getOption('controls'); 2449 nav = getOption('nav'); 2450 touch = getOption('touch'); 2451 center = getOption('center'); 2452 mouseDrag = getOption('mouseDrag'); 2453 autoplay = getOption('autoplay'); 2454 autoplayHoverPause = getOption('autoplayHoverPause'); 2455 autoplayResetOnVisibility = getOption('autoplayResetOnVisibility'); 2456 2457 if (bpChanged) { 2458 disable = getOption('disable'); 2459 fixedWidth = getOption('fixedWidth'); 2460 speed = getOption('speed'); 2461 autoHeight = getOption('autoHeight'); 2462 controlsText = getOption('controlsText'); 2463 autoplayText = getOption('autoplayText'); 2464 autoplayTimeout = getOption('autoplayTimeout'); 2465 2466 if (!CSSMQ) { 2467 edgePadding = getOption('edgePadding'); 2468 gutter = getOption('gutter'); 2469 } 2470 } 2471 // update options 2472 resetVariblesWhenDisable(disable); 2473 2474 viewport = getViewportWidth(); // <= edgePadding, gutter 2475 if ((!horizontal || autoWidth) && !disable) { 2476 setSlidePositions(); 2477 if (!horizontal) { 2478 updateContentWrapperHeight(); // <= setSlidePositions 2479 needContainerTransform = true; 2480 } 2481 } 2482 if (fixedWidth || autoWidth) { 2483 rightBoundary = getRightBoundary(); // autoWidth: <= viewport, slidePositions, gutter 2484 // fixedWidth: <= viewport, fixedWidth, gutter 2485 indexMax = getIndexMax(); // autoWidth: <= rightBoundary, slidePositions 2486 // fixedWidth: <= rightBoundary, fixedWidth, gutter 2487 } 2488 2489 if (bpChanged || fixedWidth) { 2490 items = getOption('items'); 2491 slideBy = getOption('slideBy'); 2492 itemsChanged = items !== itemsTem; 2493 2494 if (itemsChanged) { 2495 if (!fixedWidth && !autoWidth) { indexMax = getIndexMax(); } // <= items 2496 // check index before transform in case 2497 // slider reach the right edge then items become bigger 2498 updateIndex(); 2499 } 2500 } 2501 2502 if (bpChanged) { 2503 if (disable !== disableTem) { 2504 if (disable) { 2505 disableSlider(); 2506 } else { 2507 enableSlider(); // <= slidePositions, rightBoundary, indexMax 2508 } 2509 } 2510 } 2511 2512 if (freezable && (bpChanged || fixedWidth || autoWidth)) { 2513 freeze = getFreeze(); // <= autoWidth: slidePositions, gutter, viewport, rightBoundary 2514 // <= fixedWidth: fixedWidth, gutter, rightBoundary 2515 // <= others: items 2516 2517 if (freeze !== freezeTem) { 2518 if (freeze) { 2519 doContainerTransform(getContainerTransformValue(getStartIndex(0))); 2520 freezeSlider(); 2521 } else { 2522 unfreezeSlider(); 2523 needContainerTransform = true; 2524 } 2525 } 2526 } 2527 2528 resetVariblesWhenDisable(disable || freeze); // controls, nav, touch, mouseDrag, arrowKeys, autoplay, autoplayHoverPause, autoplayResetOnVisibility 2529 if (!autoplay) { autoplayHoverPause = autoplayResetOnVisibility = false; } 2530 2531 if (arrowKeys !== arrowKeysTem) { 2532 arrowKeys ? 2533 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(doc, docmentKeydownEvent) : 2534 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(doc, docmentKeydownEvent); 2535 } 2536 if (controls !== controlsTem) { 2537 if (controls) { 2538 if (controlsContainer) { 2539 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(controlsContainer); 2540 } else { 2541 if (prevButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(prevButton); } 2542 if (nextButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(nextButton); } 2543 } 2544 } else { 2545 if (controlsContainer) { 2546 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(controlsContainer); 2547 } else { 2548 if (prevButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(prevButton); } 2549 if (nextButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(nextButton); } 2550 } 2551 } 2552 } 2553 if (nav !== navTem) { 2554 if (nav) { 2555 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(navContainer); 2556 updateNavVisibility(); 2557 } else { 2558 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(navContainer) 2559 } 2560 } 2561 if (touch !== touchTem) { 2562 touch ? 2563 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, touchEvents, options.preventScrollOnTouch) : 2564 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, touchEvents); 2565 } 2566 if (mouseDrag !== mouseDragTem) { 2567 mouseDrag ? 2568 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, dragEvents) : 2569 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, dragEvents); 2570 } 2571 if (autoplay !== autoplayTem) { 2572 if (autoplay) { 2573 if (autoplayButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(autoplayButton); } 2574 if (!animating && !autoplayUserPaused) { startAutoplay(); } 2575 } else { 2576 if (autoplayButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(autoplayButton); } 2577 if (animating) { stopAutoplay(); } 2578 } 2579 } 2580 if (autoplayHoverPause !== autoplayHoverPauseTem) { 2581 autoplayHoverPause ? 2582 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, hoverEvents) : 2583 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, hoverEvents); 2584 } 2585 if (autoplayResetOnVisibility !== autoplayResetOnVisibilityTem) { 2586 autoplayResetOnVisibility ? 2587 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(doc, visibilityEvent) : 2588 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(doc, visibilityEvent); 2589 } 2590 2591 if (bpChanged) { 2592 if (fixedWidth !== fixedWidthTem || center !== centerTem) { needContainerTransform = true; } 2593 2594 if (autoHeight !== autoHeightTem) { 2595 if (!autoHeight) { innerWrapper.style.height = ''; } 2596 } 2597 2598 if (controls && controlsText !== controlsTextTem) { 2599 prevButton.innerHTML = controlsText[0]; 2600 nextButton.innerHTML = controlsText[1]; 2601 } 2602 2603 if (autoplayButton && autoplayText !== autoplayTextTem) { 2604 var i = autoplay ? 1 : 0, 2605 html = autoplayButton.innerHTML, 2606 len = html.length - autoplayTextTem[i].length; 2607 if (html.substring(len) === autoplayTextTem[i]) { 2608 autoplayButton.innerHTML = html.substring(0, len) + autoplayText[i]; 2609 } 2610 } 2611 } else { 2612 if (center && (fixedWidth || autoWidth)) { needContainerTransform = true; } 2613 } 2614 2615 if (itemsChanged || fixedWidth && !autoWidth) { 2616 pages = getPages(); 2617 updateNavVisibility(); 2618 } 2619 2620 indChanged = index !== indexTem; 2621 if (indChanged) { 2622 events.emit('indexChanged', info()); 2623 needContainerTransform = true; 2624 } else if (itemsChanged) { 2625 if (!indChanged) { additionalUpdates(); } 2626 } else if (fixedWidth || autoWidth) { 2627 doLazyLoad(); 2628 updateSlideStatus(); 2629 updateLiveRegion(); 2630 } 2631 2632 if (itemsChanged && !carousel) { updateGallerySlidePositions(); } 2633 2634 if (!disable && !freeze) { 2635 // non-mediaqueries: IE8 2636 if (bpChanged && !CSSMQ) { 2637 // middle wrapper styles 2638 2639 // inner wrapper styles 2640 if (edgePadding !== edgePaddingTem || gutter !== gutterTem) { 2641 innerWrapper.style.cssText = getInnerWrapperStyles(edgePadding, gutter, fixedWidth, speed, autoHeight); 2642 } 2643 2644 if (horizontal) { 2645 // container styles 2646 if (carousel) { 2647 container.style.width = getContainerWidth(fixedWidth, gutter, items); 2648 } 2649 2650 // slide styles 2651 var str = getSlideWidthStyle(fixedWidth, gutter, items) + 2652 getSlideGutterStyle(gutter); 2653 2654 // remove the last line and 2655 // add new styles 2656 Object(_helpers_removeCSSRule_js__WEBPACK_IMPORTED_MODULE_11__["removeCSSRule"])(sheet, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet) - 1); 2657 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 2658 } 2659 } 2660 2661 // auto height 2662 if (autoHeight) { doAutoHeight(); } 2663 2664 if (needContainerTransform) { 2665 doContainerTransformSilent(); 2666 indexCached = index; 2667 } 2668 } 2669 2670 if (bpChanged) { events.emit('newBreakpointEnd', info(e)); } 2671 } 2672 2673 2674 2675 2676 2677 // === INITIALIZATION FUNCTIONS === // 2678 function getFreeze () { 2679 if (!fixedWidth && !autoWidth) { 2680 var a = center ? items - (items - 1) / 2 : items; 2681 return slideCount <= a; 2682 } 2683 2684 var width = fixedWidth ? (fixedWidth + gutter) * slideCount : slidePositions[slideCount], 2685 vp = edgePadding ? viewport + edgePadding * 2 : viewport + gutter; 2686 2687 if (center) { 2688 vp -= fixedWidth ? (viewport - fixedWidth) / 2 : (viewport - (slidePositions[index + 1] - slidePositions[index] - gutter)) / 2; 2689 } 2690 2691 return width <= vp; 2692 } 2693 2694 function setBreakpointZone () { 2695 breakpointZone = 0; 2696 for (var bp in responsive) { 2697 bp = parseInt(bp); // convert string to number 2698 if (windowWidth >= bp) { breakpointZone = bp; } 2699 } 2700 } 2701 2702 // (slideBy, indexMin, indexMax) => index 2703 var updateIndex = (function () { 2704 return loop ? 2705 carousel ? 2706 // loop + carousel 2707 function () { 2708 var leftEdge = indexMin, 2709 rightEdge = indexMax; 2710 2711 leftEdge += slideBy; 2712 rightEdge -= slideBy; 2713 2714 // adjust edges when has edge paddings 2715 // or fixed-width slider with extra space on the right side 2716 if (edgePadding) { 2717 leftEdge += 1; 2718 rightEdge -= 1; 2719 } else if (fixedWidth) { 2720 if ((viewport + gutter)%(fixedWidth + gutter)) { rightEdge -= 1; } 2721 } 2722 2723 if (cloneCount) { 2724 if (index > rightEdge) { 2725 index -= slideCount; 2726 } else if (index < leftEdge) { 2727 index += slideCount; 2728 } 2729 } 2730 } : 2731 // loop + gallery 2732 function() { 2733 if (index > indexMax) { 2734 while (index >= indexMin + slideCount) { index -= slideCount; } 2735 } else if (index < indexMin) { 2736 while (index <= indexMax - slideCount) { index += slideCount; } 2737 } 2738 } : 2739 // non-loop 2740 function() { 2741 index = Math.max(indexMin, Math.min(indexMax, index)); 2742 }; 2743 })(); 2744 2745 function disableUI () { 2746 if (!autoplay && autoplayButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(autoplayButton); } 2747 if (!nav && navContainer) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(navContainer); } 2748 if (!controls) { 2749 if (controlsContainer) { 2750 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(controlsContainer); 2751 } else { 2752 if (prevButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(prevButton); } 2753 if (nextButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(nextButton); } 2754 } 2755 } 2756 } 2757 2758 function enableUI () { 2759 if (autoplay && autoplayButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(autoplayButton); } 2760 if (nav && navContainer) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(navContainer); } 2761 if (controls) { 2762 if (controlsContainer) { 2763 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(controlsContainer); 2764 } else { 2765 if (prevButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(prevButton); } 2766 if (nextButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(nextButton); } 2767 } 2768 } 2769 } 2770 2771 function freezeSlider () { 2772 if (frozen) { return; } 2773 2774 // remove edge padding from inner wrapper 2775 if (edgePadding) { innerWrapper.style.margin = '0px'; } 2776 2777 // add class tns-transparent to cloned slides 2778 if (cloneCount) { 2779 var str = 'tns-transparent'; 2780 for (var i = cloneCount; i--;) { 2781 if (carousel) { Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(slideItems[i], str); } 2782 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(slideItems[slideCountNew - i - 1], str); 2783 } 2784 } 2785 2786 // update tools 2787 disableUI(); 2788 2789 frozen = true; 2790 } 2791 2792 function unfreezeSlider () { 2793 if (!frozen) { return; } 2794 2795 // restore edge padding for inner wrapper 2796 // for mordern browsers 2797 if (edgePadding && CSSMQ) { innerWrapper.style.margin = ''; } 2798 2799 // remove class tns-transparent to cloned slides 2800 if (cloneCount) { 2801 var str = 'tns-transparent'; 2802 for (var i = cloneCount; i--;) { 2803 if (carousel) { Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(slideItems[i], str); } 2804 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(slideItems[slideCountNew - i - 1], str); 2805 } 2806 } 2807 2808 // update tools 2809 enableUI(); 2810 2811 frozen = false; 2812 } 2813 2814 function disableSlider () { 2815 if (disabled) { return; } 2816 2817 sheet.disabled = true; 2818 container.className = container.className.replace(newContainerClasses.substring(1), ''); 2819 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(container, ['style']); 2820 if (loop) { 2821 for (var j = cloneCount; j--;) { 2822 if (carousel) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(slideItems[j]); } 2823 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(slideItems[slideCountNew - j - 1]); 2824 } 2825 } 2826 2827 // vertical slider 2828 if (!horizontal || !carousel) { Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(innerWrapper, ['style']); } 2829 2830 // gallery 2831 if (!carousel) { 2832 for (var i = index, l = index + slideCount; i < l; i++) { 2833 var item = slideItems[i]; 2834 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(item, ['style']); 2835 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateIn); 2836 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateNormal); 2837 } 2838 } 2839 2840 // update tools 2841 disableUI(); 2842 2843 disabled = true; 2844 } 2845 2846 function enableSlider () { 2847 if (!disabled) { return; } 2848 2849 sheet.disabled = false; 2850 container.className += newContainerClasses; 2851 doContainerTransformSilent(); 2852 2853 if (loop) { 2854 for (var j = cloneCount; j--;) { 2855 if (carousel) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(slideItems[j]); } 2856 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(slideItems[slideCountNew - j - 1]); 2857 } 2858 } 2859 2860 // gallery 2861 if (!carousel) { 2862 for (var i = index, l = index + slideCount; i < l; i++) { 2863 var item = slideItems[i], 2864 classN = i < index + items ? animateIn : animateNormal; 2865 item.style.left = (i - index) * 100 / items + '%'; 2866 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, classN); 2867 } 2868 } 2869 2870 // update tools 2871 enableUI(); 2872 2873 disabled = false; 2874 } 2875 2876 function updateLiveRegion () { 2877 var str = getLiveRegionStr(); 2878 if (liveregionCurrent.innerHTML !== str) { liveregionCurrent.innerHTML = str; } 2879 } 2880 2881 function getLiveRegionStr () { 2882 var arr = getVisibleSlideRange(), 2883 start = arr[0] + 1, 2884 end = arr[1] + 1; 2885 return start === end ? start + '' : start + ' to ' + end; 2886 } 2887 2888 function getVisibleSlideRange (val) { 2889 if (val == null) { val = getContainerTransformValue(); } 2890 var start = index, end, rangestart, rangeend; 2891 2892 // get range start, range end for autoWidth and fixedWidth 2893 if (center || edgePadding) { 2894 if (autoWidth || fixedWidth) { 2895 rangestart = - (parseFloat(val) + edgePadding); 2896 rangeend = rangestart + viewport + edgePadding * 2; 2897 } 2898 } else { 2899 if (autoWidth) { 2900 rangestart = slidePositions[index]; 2901 rangeend = rangestart + viewport; 2902 } 2903 } 2904 2905 // get start, end 2906 // - check auto width 2907 if (autoWidth) { 2908 slidePositions.forEach(function(point, i) { 2909 if (i < slideCountNew) { 2910 if ((center || edgePadding) && point <= rangestart + 0.5) { start = i; } 2911 if (rangeend - point >= 0.5) { end = i; } 2912 } 2913 }); 2914 2915 // - check percentage width, fixed width 2916 } else { 2917 2918 if (fixedWidth) { 2919 var cell = fixedWidth + gutter; 2920 if (center || edgePadding) { 2921 start = Math.floor(rangestart/cell); 2922 end = Math.ceil(rangeend/cell - 1); 2923 } else { 2924 end = start + Math.ceil(viewport/cell) - 1; 2925 } 2926 2927 } else { 2928 if (center || edgePadding) { 2929 var a = items - 1; 2930 if (center) { 2931 start -= a / 2; 2932 end = index + a / 2; 2933 } else { 2934 end = index + a; 2935 } 2936 2937 if (edgePadding) { 2938 var b = edgePadding * items / viewport; 2939 start -= b; 2940 end += b; 2941 } 2942 2943 start = Math.floor(start); 2944 end = Math.ceil(end); 2945 } else { 2946 end = start + items - 1; 2947 } 2948 } 2949 2950 start = Math.max(start, 0); 2951 end = Math.min(end, slideCountNew - 1); 2952 } 2953 2954 return [start, end]; 2955 } 2956 2957 function doLazyLoad () { 2958 if (lazyload && !disable) { 2959 var arg = getVisibleSlideRange(); 2960 arg.push(lazyloadSelector); 2961 2962 getImageArray.apply(null, arg).forEach(function (img) { 2963 if (!Object(_helpers_hasClass_js__WEBPACK_IMPORTED_MODULE_16__["hasClass"])(img, imgCompleteClass)) { 2964 // stop propagation transitionend event to container 2965 var eve = {}; 2966 eve[TRANSITIONEND] = function (e) { e.stopPropagation(); }; 2967 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(img, eve); 2968 2969 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(img, imgEvents); 2970 2971 // update src 2972 img.src = Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(img, 'data-src'); 2973 2974 // update srcset 2975 var srcset = Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(img, 'data-srcset'); 2976 if (srcset) { img.srcset = srcset; } 2977 2978 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'loading'); 2979 } 2980 }); 2981 } 2982 } 2983 2984 function onImgLoaded (e) { 2985 imgLoaded(getTarget(e)); 2986 } 2987 2988 function onImgFailed (e) { 2989 imgFailed(getTarget(e)); 2990 } 2991 2992 function imgLoaded (img) { 2993 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'loaded'); 2994 imgCompleted(img); 2995 } 2996 2997 function imgFailed (img) { 2998 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'failed'); 2999 imgCompleted(img); 3000 } 3001 3002 function imgCompleted (img) { 3003 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, imgCompleteClass); 3004 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(img, 'loading'); 3005 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(img, imgEvents); 3006 } 3007 3008 function getImageArray (start, end, imgSelector) { 3009 var imgs = []; 3010 if (!imgSelector) { imgSelector = 'img'; } 3011 3012 while (start <= end) { 3013 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems[start].querySelectorAll(imgSelector), function (img) { imgs.push(img); }); 3014 start++; 3015 } 3016 3017 return imgs; 3018 } 3019 3020 // check if all visible images are loaded 3021 // and update container height if it's done 3022 function doAutoHeight () { 3023 var imgs = getImageArray.apply(null, getVisibleSlideRange()); 3024 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(imgs, updateInnerWrapperHeight); }); 3025 } 3026 3027 function imgsLoadedCheck (imgs, cb) { 3028 // execute callback function if all images are complete 3029 if (imgsComplete) { return cb(); } 3030 3031 // check image classes 3032 imgs.forEach(function (img, index) { 3033 if (!lazyload && img.complete) { imgCompleted(img); } // Check image.complete 3034 if (Object(_helpers_hasClass_js__WEBPACK_IMPORTED_MODULE_16__["hasClass"])(img, imgCompleteClass)) { imgs.splice(index, 1); } 3035 }); 3036 3037 // execute callback function if selected images are all complete 3038 if (!imgs.length) { return cb(); } 3039 3040 // otherwise execute this functiona again 3041 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(imgs, cb); }); 3042 } 3043 3044 function additionalUpdates () { 3045 doLazyLoad(); 3046 updateSlideStatus(); 3047 updateLiveRegion(); 3048 updateControlsStatus(); 3049 updateNavStatus(); 3050 } 3051 3052 3053 function update_carousel_transition_duration () { 3054 if (carousel && autoHeight) { 3055 middleWrapper.style[TRANSITIONDURATION] = speed / 1000 + 's'; 3056 } 3057 } 3058 3059 function getMaxSlideHeight (slideStart, slideRange) { 3060 var heights = []; 3061 for (var i = slideStart, l = Math.min(slideStart + slideRange, slideCountNew); i < l; i++) { 3062 heights.push(slideItems[i].offsetHeight); 3063 } 3064 3065 return Math.max.apply(null, heights); 3066 } 3067 3068 // update inner wrapper height 3069 // 1. get the max-height of the visible slides 3070 // 2. set transitionDuration to speed 3071 // 3. update inner wrapper height to max-height 3072 // 4. set transitionDuration to 0s after transition done 3073 function updateInnerWrapperHeight () { 3074 var maxHeight = autoHeight ? getMaxSlideHeight(index, items) : getMaxSlideHeight(cloneCount, slideCount), 3075 wp = middleWrapper ? middleWrapper : innerWrapper; 3076 3077 if (wp.style.height !== maxHeight) { wp.style.height = maxHeight + 'px'; } 3078 } 3079 3080 // get the distance from the top edge of the first slide to each slide 3081 // (init) => slidePositions 3082 function setSlidePositions () { 3083 slidePositions = [0]; 3084 var attr = horizontal ? 'left' : 'top', 3085 attr2 = horizontal ? 'right' : 'bottom', 3086 base = slideItems[0].getBoundingClientRect()[attr]; 3087 3088 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(item, i) { 3089 // skip the first slide 3090 if (i) { slidePositions.push(item.getBoundingClientRect()[attr] - base); } 3091 // add the end edge 3092 if (i === slideCountNew - 1) { slidePositions.push(item.getBoundingClientRect()[attr2] - base); } 3093 }); 3094 } 3095 3096 // update slide 3097 function updateSlideStatus () { 3098 var range = getVisibleSlideRange(), 3099 start = range[0], 3100 end = range[1]; 3101 3102 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(item, i) { 3103 // show slides 3104 if (i >= start && i <= end) { 3105 if (Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(item, 'aria-hidden')) { 3106 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(item, ['aria-hidden', 'tabindex']); 3107 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, slideActiveClass); 3108 } 3109 // hide slides 3110 } else { 3111 if (!Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(item, 'aria-hidden')) { 3112 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(item, { 3113 'aria-hidden': 'true', 3114 'tabindex': '-1' 3115 }); 3116 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, slideActiveClass); 3117 } 3118 } 3119 }); 3120 } 3121 3122 // gallery: update slide position 3123 function updateGallerySlidePositions () { 3124 var l = index + Math.min(slideCount, items); 3125 for (var i = slideCountNew; i--;) { 3126 var item = slideItems[i]; 3127 3128 if (i >= index && i < l) { 3129 // add transitions to visible slides when adjusting their positions 3130 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, 'tns-moving'); 3131 3132 item.style.left = (i - index) * 100 / items + '%'; 3133 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateIn); 3134 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateNormal); 3135 } else if (item.style.left) { 3136 item.style.left = ''; 3137 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateNormal); 3138 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateIn); 3139 } 3140 3141 // remove outlet animation 3142 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateOut); 3143 } 3144 3145 // removing '.tns-moving' 3146 setTimeout(function() { 3147 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(el) { 3148 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(el, 'tns-moving'); 3149 }); 3150 }, 300); 3151 } 3152 3153 // set tabindex on Nav 3154 function updateNavStatus () { 3155 // get current nav 3156 if (nav) { 3157 navCurrentIndex = navClicked >= 0 ? navClicked : getCurrentNavIndex(); 3158 navClicked = -1; 3159 3160 if (navCurrentIndex !== navCurrentIndexCached) { 3161 var navPrev = navItems[navCurrentIndexCached], 3162 navCurrent = navItems[navCurrentIndex]; 3163 3164 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navPrev, { 3165 'tabindex': '-1', 3166 'aria-label': navStr + (navCurrentIndexCached + 1) 3167 }); 3168 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(navPrev, navActiveClass); 3169 3170 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navCurrent, {'aria-label': navStr + (navCurrentIndex + 1) + navStrCurrent}); 3171 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(navCurrent, 'tabindex'); 3172 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(navCurrent, navActiveClass); 3173 3174 navCurrentIndexCached = navCurrentIndex; 3175 } 3176 } 3177 } 3178 3179 function getLowerCaseNodeName (el) { 3180 return el.nodeName.toLowerCase(); 3181 } 3182 3183 function isButton (el) { 3184 return getLowerCaseNodeName(el) === 'button'; 3185 } 3186 3187 function isAriaDisabled (el) { 3188 return el.getAttribute('aria-disabled') === 'true'; 3189 } 3190 3191 function disEnableElement (isButton, el, val) { 3192 if (isButton) { 3193 el.disabled = val; 3194 } else { 3195 el.setAttribute('aria-disabled', val.toString()); 3196 } 3197 } 3198 3199 // set 'disabled' to true on controls when reach the edges 3200 function updateControlsStatus () { 3201 if (!controls || rewind || loop) { return; } 3202 3203 var prevDisabled = (prevIsButton) ? prevButton.disabled : isAriaDisabled(prevButton), 3204 nextDisabled = (nextIsButton) ? nextButton.disabled : isAriaDisabled(nextButton), 3205 disablePrev = (index <= indexMin) ? true : false, 3206 disableNext = (!rewind && index >= indexMax) ? true : false; 3207 3208 if (disablePrev && !prevDisabled) { 3209 disEnableElement(prevIsButton, prevButton, true); 3210 } 3211 if (!disablePrev && prevDisabled) { 3212 disEnableElement(prevIsButton, prevButton, false); 3213 } 3214 if (disableNext && !nextDisabled) { 3215 disEnableElement(nextIsButton, nextButton, true); 3216 } 3217 if (!disableNext && nextDisabled) { 3218 disEnableElement(nextIsButton, nextButton, false); 3219 } 3220 } 3221 3222 // set duration 3223 function resetDuration (el, str) { 3224 if (TRANSITIONDURATION) { el.style[TRANSITIONDURATION] = str; } 3225 } 3226 3227 function getSliderWidth () { 3228 return fixedWidth ? (fixedWidth + gutter) * slideCountNew : slidePositions[slideCountNew]; 3229 } 3230 3231 function getCenterGap (num) { 3232 if (num == null) { num = index; } 3233 3234 var gap = edgePadding ? gutter : 0; 3235 return autoWidth ? ((viewport - gap) - (slidePositions[num + 1] - slidePositions[num] - gutter))/2 : 3236 fixedWidth ? (viewport - fixedWidth) / 2 : 3237 (items - 1) / 2; 3238 } 3239 3240 function getRightBoundary () { 3241 var gap = edgePadding ? gutter : 0, 3242 result = (viewport + gap) - getSliderWidth(); 3243 3244 if (center && !loop) { 3245 result = fixedWidth ? - (fixedWidth + gutter) * (slideCountNew - 1) - getCenterGap() : 3246 getCenterGap(slideCountNew - 1) - slidePositions[slideCountNew - 1]; 3247 } 3248 if (result > 0) { result = 0; } 3249 3250 return result; 3251 } 3252 3253 function getContainerTransformValue (num) { 3254 if (num == null) { num = index; } 3255 3256 var val; 3257 if (horizontal && !autoWidth) { 3258 if (fixedWidth) { 3259 val = - (fixedWidth + gutter) * num; 3260 if (center) { val += getCenterGap(); } 3261 } else { 3262 var denominator = TRANSFORM ? slideCountNew : items; 3263 if (center) { num -= getCenterGap(); } 3264 val = - num * 100 / denominator; 3265 } 3266 } else { 3267 val = - slidePositions[num]; 3268 if (center && autoWidth) { 3269 val += getCenterGap(); 3270 } 3271 } 3272 3273 if (hasRightDeadZone) { val = Math.max(val, rightBoundary); } 3274 3275 val += (horizontal && !autoWidth && !fixedWidth) ? '%' : 'px'; 3276 3277 return val; 3278 } 3279 3280 function doContainerTransformSilent (val) { 3281 resetDuration(container, '0s'); 3282 doContainerTransform(val); 3283 } 3284 3285 function doContainerTransform (val) { 3286 if (val == null) { val = getContainerTransformValue(); } 3287 container.style[transformAttr] = transformPrefix + val + transformPostfix; 3288 } 3289 3290 function animateSlide (number, classOut, classIn, isOut) { 3291 var l = number + items; 3292 if (!loop) { l = Math.min(l, slideCountNew); } 3293 3294 for (var i = number; i < l; i++) { 3295 var item = slideItems[i]; 3296 3297 // set item positions 3298 if (!isOut) { item.style.left = (i - index) * 100 / items + '%'; } 3299 3300 if (animateDelay && TRANSITIONDELAY) { 3301 item.style[TRANSITIONDELAY] = item.style[ANIMATIONDELAY] = animateDelay * (i - number) / 1000 + 's'; 3302 } 3303 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, classOut); 3304 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, classIn); 3305 3306 if (isOut) { slideItemsOut.push(item); } 3307 } 3308 } 3309 3310 // make transfer after click/drag: 3311 // 1. change 'transform' property for mordern browsers 3312 // 2. change 'left' property for legacy browsers 3313 var transformCore = (function () { 3314 return carousel ? 3315 function () { 3316 resetDuration(container, ''); 3317 if (TRANSITIONDURATION || !speed) { 3318 // for morden browsers with non-zero duration or 3319 // zero duration for all browsers 3320 doContainerTransform(); 3321 // run fallback function manually 3322 // when duration is 0 / container is hidden 3323 if (!speed || !Object(_helpers_isVisible_js__WEBPACK_IMPORTED_MODULE_26__["isVisible"])(container)) { onTransitionEnd(); } 3324 3325 } else { 3326 // for old browser with non-zero duration 3327 Object(_helpers_jsTransform_js__WEBPACK_IMPORTED_MODULE_33__["jsTransform"])(container, transformAttr, transformPrefix, transformPostfix, getContainerTransformValue(), speed, onTransitionEnd); 3328 } 3329 3330 if (!horizontal) { updateContentWrapperHeight(); } 3331 } : 3332 function () { 3333 slideItemsOut = []; 3334 3335 var eve = {}; 3336 eve[TRANSITIONEND] = eve[ANIMATIONEND] = onTransitionEnd; 3337 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(slideItems[indexCached], eve); 3338 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(slideItems[index], eve); 3339 3340 animateSlide(indexCached, animateIn, animateOut, true); 3341 animateSlide(index, animateNormal, animateIn); 3342 3343 // run fallback function manually 3344 // when transition or animation not supported / duration is 0 3345 if (!TRANSITIONEND || !ANIMATIONEND || !speed || !Object(_helpers_isVisible_js__WEBPACK_IMPORTED_MODULE_26__["isVisible"])(container)) { onTransitionEnd(); } 3346 }; 3347 })(); 3348 3349 function render (e, sliderMoved) { 3350 if (updateIndexBeforeTransform) { updateIndex(); } 3351 3352 // render when slider was moved (touch or drag) even though index may not change 3353 if (index !== indexCached || sliderMoved) { 3354 // events 3355 events.emit('indexChanged', info()); 3356 events.emit('transitionStart', info()); 3357 if (autoHeight) { doAutoHeight(); } 3358 3359 // pause autoplay when click or keydown from user 3360 if (animating && e && ['click', 'keydown'].indexOf(e.type) >= 0) { stopAutoplay(); } 3361 3362 running = true; 3363 transformCore(); 3364 } 3365 } 3366 3367 /* 3368 * Transfer prefixed properties to the same format 3369 * CSS: -Webkit-Transform => webkittransform 3370 * JS: WebkitTransform => webkittransform 3371 * @param {string} str - property 3372 * 3373 */ 3374 function strTrans (str) { 3375 return str.toLowerCase().replace(/-/g, ''); 3376 } 3377 3378 // AFTER TRANSFORM 3379 // Things need to be done after a transfer: 3380 // 1. check index 3381 // 2. add classes to visible slide 3382 // 3. disable controls buttons when reach the first/last slide in non-loop slider 3383 // 4. update nav status 3384 // 5. lazyload images 3385 // 6. update container height 3386 function onTransitionEnd (event) { 3387 // check running on gallery mode 3388 // make sure trantionend/animationend events run only once 3389 if (carousel || running) { 3390 events.emit('transitionEnd', info(event)); 3391 3392 if (!carousel && slideItemsOut.length > 0) { 3393 for (var i = 0; i < slideItemsOut.length; i++) { 3394 var item = slideItemsOut[i]; 3395 // set item positions 3396 item.style.left = ''; 3397 3398 if (ANIMATIONDELAY && TRANSITIONDELAY) { 3399 item.style[ANIMATIONDELAY] = ''; 3400 item.style[TRANSITIONDELAY] = ''; 3401 } 3402 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateOut); 3403 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateNormal); 3404 } 3405 } 3406 3407 /* update slides, nav, controls after checking ... 3408 * => legacy browsers who don't support 'event' 3409 * have to check event first, otherwise event.target will cause an error 3410 * => or 'gallery' mode: 3411 * + event target is slide item 3412 * => or 'carousel' mode: 3413 * + event target is container, 3414 * + event.property is the same with transform attribute 3415 */ 3416 if (!event || 3417 !carousel && event.target.parentNode === container || 3418 event.target === container && strTrans(event.propertyName) === strTrans(transformAttr)) { 3419 3420 if (!updateIndexBeforeTransform) { 3421 var indexTem = index; 3422 updateIndex(); 3423 if (index !== indexTem) { 3424 events.emit('indexChanged', info()); 3425 3426 doContainerTransformSilent(); 3427 } 3428 } 3429 3430 if (nested === 'inner') { events.emit('innerLoaded', info()); } 3431 running = false; 3432 indexCached = index; 3433 } 3434 } 3435 3436 } 3437 3438 // # ACTIONS 3439 function goTo (targetIndex, e) { 3440 if (freeze) { return; } 3441 3442 // prev slideBy 3443 if (targetIndex === 'prev') { 3444 onControlsClick(e, -1); 3445 3446 // next slideBy 3447 } else if (targetIndex === 'next') { 3448 onControlsClick(e, 1); 3449 3450 // go to exact slide 3451 } else { 3452 if (running) { 3453 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 3454 } 3455 3456 var absIndex = getAbsIndex(), 3457 indexGap = 0; 3458 3459 if (targetIndex === 'first') { 3460 indexGap = - absIndex; 3461 } else if (targetIndex === 'last') { 3462 indexGap = carousel ? slideCount - items - absIndex : slideCount - 1 - absIndex; 3463 } else { 3464 if (typeof targetIndex !== 'number') { targetIndex = parseInt(targetIndex); } 3465 3466 if (!isNaN(targetIndex)) { 3467 // from directly called goTo function 3468 if (!e) { targetIndex = Math.max(0, Math.min(slideCount - 1, targetIndex)); } 3469 3470 indexGap = targetIndex - absIndex; 3471 } 3472 } 3473 3474 // gallery: make sure new page won't overlap with current page 3475 if (!carousel && indexGap && Math.abs(indexGap) < items) { 3476 var factor = indexGap > 0 ? 1 : -1; 3477 indexGap += (index + indexGap - slideCount) >= indexMin ? slideCount * factor : slideCount * 2 * factor * -1; 3478 } 3479 3480 index += indexGap; 3481 3482 // make sure index is in range 3483 if (carousel && loop) { 3484 if (index < indexMin) { index += slideCount; } 3485 if (index > indexMax) { index -= slideCount; } 3486 } 3487 3488 // if index is changed, start rendering 3489 if (getAbsIndex(index) !== getAbsIndex(indexCached)) { 3490 render(e); 3491 } 3492 3493 } 3494 } 3495 3496 // on controls click 3497 function onControlsClick (e, dir) { 3498 if (running) { 3499 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 3500 } 3501 var passEventObject; 3502 3503 if (!dir) { 3504 e = getEvent(e); 3505 var target = getTarget(e); 3506 3507 while (target !== controlsContainer && [prevButton, nextButton].indexOf(target) < 0) { target = target.parentNode; } 3508 3509 var targetIn = [prevButton, nextButton].indexOf(target); 3510 if (targetIn >= 0) { 3511 passEventObject = true; 3512 dir = targetIn === 0 ? -1 : 1; 3513 } 3514 } 3515 3516 if (rewind) { 3517 if (index === indexMin && dir === -1) { 3518 goTo('last', e); 3519 return; 3520 } else if (index === indexMax && dir === 1) { 3521 goTo('first', e); 3522 return; 3523 } 3524 } 3525 3526 if (dir) { 3527 index += slideBy * dir; 3528 if (autoWidth) { index = Math.floor(index); } 3529 // pass e when click control buttons or keydown 3530 render((passEventObject || (e && e.type === 'keydown')) ? e : null); 3531 } 3532 } 3533 3534 // on nav click 3535 function onNavClick (e) { 3536 if (running) { 3537 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 3538 } 3539 3540 e = getEvent(e); 3541 var target = getTarget(e), navIndex; 3542 3543 // find the clicked nav item 3544 while (target !== navContainer && !Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(target, 'data-nav')) { target = target.parentNode; } 3545 if (Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(target, 'data-nav')) { 3546 var navIndex = navClicked = Number(Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(target, 'data-nav')), 3547 targetIndexBase = fixedWidth || autoWidth ? navIndex * slideCount / pages : navIndex * items, 3548 targetIndex = navAsThumbnails ? navIndex : Math.min(Math.ceil(targetIndexBase), slideCount - 1); 3549 goTo(targetIndex, e); 3550 3551 if (navCurrentIndex === navIndex) { 3552 if (animating) { stopAutoplay(); } 3553 navClicked = -1; // reset navClicked 3554 } 3555 } 3556 } 3557 3558 // autoplay functions 3559 function setAutoplayTimer () { 3560 autoplayTimer = setInterval(function () { 3561 onControlsClick(null, autoplayDirection); 3562 }, autoplayTimeout); 3563 3564 animating = true; 3565 } 3566 3567 function stopAutoplayTimer () { 3568 clearInterval(autoplayTimer); 3569 animating = false; 3570 } 3571 3572 function updateAutoplayButton (action, txt) { 3573 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(autoplayButton, {'data-action': action}); 3574 autoplayButton.innerHTML = autoplayHtmlStrings[0] + action + autoplayHtmlStrings[1] + txt; 3575 } 3576 3577 function startAutoplay () { 3578 setAutoplayTimer(); 3579 if (autoplayButton) { updateAutoplayButton('stop', autoplayText[1]); } 3580 } 3581 3582 function stopAutoplay () { 3583 stopAutoplayTimer(); 3584 if (autoplayButton) { updateAutoplayButton('start', autoplayText[0]); } 3585 } 3586 3587 // programaitcally play/pause the slider 3588 function play () { 3589 if (autoplay && !animating) { 3590 startAutoplay(); 3591 autoplayUserPaused = false; 3592 } 3593 } 3594 function pause () { 3595 if (animating) { 3596 stopAutoplay(); 3597 autoplayUserPaused = true; 3598 } 3599 } 3600 3601 function toggleAutoplay () { 3602 if (animating) { 3603 stopAutoplay(); 3604 autoplayUserPaused = true; 3605 } else { 3606 startAutoplay(); 3607 autoplayUserPaused = false; 3608 } 3609 } 3610 3611 function onVisibilityChange () { 3612 if (doc.hidden) { 3613 if (animating) { 3614 stopAutoplayTimer(); 3615 autoplayVisibilityPaused = true; 3616 } 3617 } else if (autoplayVisibilityPaused) { 3618 setAutoplayTimer(); 3619 autoplayVisibilityPaused = false; 3620 } 3621 } 3622 3623 function mouseoverPause () { 3624 if (animating) { 3625 stopAutoplayTimer(); 3626 autoplayHoverPaused = true; 3627 } 3628 } 3629 3630 function mouseoutRestart () { 3631 if (autoplayHoverPaused) { 3632 setAutoplayTimer(); 3633 autoplayHoverPaused = false; 3634 } 3635 } 3636 3637 // keydown events on document 3638 function onDocumentKeydown (e) { 3639 e = getEvent(e); 3640 var keyIndex = [KEYS.LEFT, KEYS.RIGHT].indexOf(e.keyCode); 3641 3642 if (keyIndex >= 0) { 3643 onControlsClick(e, keyIndex === 0 ? -1 : 1); 3644 } 3645 } 3646 3647 // on key control 3648 function onControlsKeydown (e) { 3649 e = getEvent(e); 3650 var keyIndex = [KEYS.LEFT, KEYS.RIGHT].indexOf(e.keyCode); 3651 3652 if (keyIndex >= 0) { 3653 if (keyIndex === 0) { 3654 if (!prevButton.disabled) { onControlsClick(e, -1); } 3655 } else if (!nextButton.disabled) { 3656 onControlsClick(e, 1); 3657 } 3658 } 3659 } 3660 3661 // set focus 3662 function setFocus (el) { 3663 el.focus(); 3664 } 3665 3666 // on key nav 3667 function onNavKeydown (e) { 3668 e = getEvent(e); 3669 var curElement = doc.activeElement; 3670 if (!Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(curElement, 'data-nav')) { return; } 3671 3672 // var code = e.keyCode, 3673 var keyIndex = [KEYS.LEFT, KEYS.RIGHT, KEYS.ENTER, KEYS.SPACE].indexOf(e.keyCode), 3674 navIndex = Number(Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(curElement, 'data-nav')); 3675 3676 if (keyIndex >= 0) { 3677 if (keyIndex === 0) { 3678 if (navIndex > 0) { setFocus(navItems[navIndex - 1]); } 3679 } else if (keyIndex === 1) { 3680 if (navIndex < pages - 1) { setFocus(navItems[navIndex + 1]); } 3681 } else { 3682 navClicked = navIndex; 3683 goTo(navIndex, e); 3684 } 3685 } 3686 } 3687 3688 function getEvent (e) { 3689 e = e || win.event; 3690 return isTouchEvent(e) ? e.changedTouches[0] : e; 3691 } 3692 function getTarget (e) { 3693 return e.target || win.event.srcElement; 3694 } 3695 3696 function isTouchEvent (e) { 3697 return e.type.indexOf('touch') >= 0; 3698 } 3699 3700 function preventDefaultBehavior (e) { 3701 e.preventDefault ? e.preventDefault() : e.returnValue = false; 3702 } 3703 3704 function getMoveDirectionExpected () { 3705 return Object(_helpers_getTouchDirection_js__WEBPACK_IMPORTED_MODULE_14__["getTouchDirection"])(Object(_helpers_toDegree_js__WEBPACK_IMPORTED_MODULE_13__["toDegree"])(lastPosition.y - initPosition.y, lastPosition.x - initPosition.x), swipeAngle) === options.axis; 3706 } 3707 3708 function onPanStart (e) { 3709 if (running) { 3710 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 3711 } 3712 3713 if (autoplay && animating) { stopAutoplayTimer(); } 3714 3715 panStart = true; 3716 if (rafIndex) { 3717 Object(_helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__["caf"])(rafIndex); 3718 rafIndex = null; 3719 } 3720 3721 var $ = getEvent(e); 3722 events.emit(isTouchEvent(e) ? 'touchStart' : 'dragStart', info(e)); 3723 3724 if (!isTouchEvent(e) && ['img', 'a'].indexOf(getLowerCaseNodeName(getTarget(e))) >= 0) { 3725 preventDefaultBehavior(e); 3726 } 3727 3728 lastPosition.x = initPosition.x = $.clientX; 3729 lastPosition.y = initPosition.y = $.clientY; 3730 if (carousel) { 3731 translateInit = parseFloat(container.style[transformAttr].replace(transformPrefix, '')); 3732 resetDuration(container, '0s'); 3733 } 3734 } 3735 3736 function onPanMove (e) { 3737 if (panStart) { 3738 var $ = getEvent(e); 3739 lastPosition.x = $.clientX; 3740 lastPosition.y = $.clientY; 3741 3742 if (carousel) { 3743 if (!rafIndex) { rafIndex = Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ panUpdate(e); }); } 3744 } else { 3745 if (moveDirectionExpected === '?') { moveDirectionExpected = getMoveDirectionExpected(); } 3746 if (moveDirectionExpected) { preventScroll = true; } 3747 } 3748 3749 if ((typeof e.cancelable !== 'boolean' || e.cancelable) && preventScroll) { 3750 e.preventDefault(); 3751 } 3752 } 3753 } 3754 3755 function panUpdate (e) { 3756 if (!moveDirectionExpected) { 3757 panStart = false; 3758 return; 3759 } 3760 Object(_helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__["caf"])(rafIndex); 3761 if (panStart) { rafIndex = Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ panUpdate(e); }); } 3762 3763 if (moveDirectionExpected === '?') { moveDirectionExpected = getMoveDirectionExpected(); } 3764 if (moveDirectionExpected) { 3765 if (!preventScroll && isTouchEvent(e)) { preventScroll = true; } 3766 3767 try { 3768 if (e.type) { events.emit(isTouchEvent(e) ? 'touchMove' : 'dragMove', info(e)); } 3769 } catch(err) {} 3770 3771 var x = translateInit, 3772 dist = getDist(lastPosition, initPosition); 3773 if (!horizontal || fixedWidth || autoWidth) { 3774 x += dist; 3775 x += 'px'; 3776 } else { 3777 var percentageX = TRANSFORM ? dist * items * 100 / ((viewport + gutter) * slideCountNew): dist * 100 / (viewport + gutter); 3778 x += percentageX; 3779 x += '%'; 3780 } 3781 3782 container.style[transformAttr] = transformPrefix + x + transformPostfix; 3783 } 3784 } 3785 3786 function onPanEnd (e) { 3787 if (panStart) { 3788 if (rafIndex) { 3789 Object(_helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__["caf"])(rafIndex); 3790 rafIndex = null; 3791 } 3792 if (carousel) { resetDuration(container, ''); } 3793 panStart = false; 3794 3795 var $ = getEvent(e); 3796 lastPosition.x = $.clientX; 3797 lastPosition.y = $.clientY; 3798 var dist = getDist(lastPosition, initPosition); 3799 3800 if (Math.abs(dist)) { 3801 // drag vs click 3802 if (!isTouchEvent(e)) { 3803 // prevent "click" 3804 var target = getTarget(e); 3805 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(target, {'click': function preventClick (e) { 3806 preventDefaultBehavior(e); 3807 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(target, {'click': preventClick}); 3808 }}); 3809 } 3810 3811 if (carousel) { 3812 rafIndex = Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function() { 3813 if (horizontal && !autoWidth) { 3814 var indexMoved = - dist * items / (viewport + gutter); 3815 indexMoved = dist > 0 ? Math.floor(indexMoved) : Math.ceil(indexMoved); 3816 index += indexMoved; 3817 } else { 3818 var moved = - (translateInit + dist); 3819 if (moved <= 0) { 3820 index = indexMin; 3821 } else if (moved >= slidePositions[slideCountNew - 1]) { 3822 index = indexMax; 3823 } else { 3824 var i = 0; 3825 while (i < slideCountNew && moved >= slidePositions[i]) { 3826 index = i; 3827 if (moved > slidePositions[i] && dist < 0) { index += 1; } 3828 i++; 3829 } 3830 } 3831 } 3832 3833 render(e, dist); 3834 events.emit(isTouchEvent(e) ? 'touchEnd' : 'dragEnd', info(e)); 3835 }); 3836 } else { 3837 if (moveDirectionExpected) { 3838 onControlsClick(e, dist > 0 ? -1 : 1); 3839 } 3840 } 3841 } 3842 } 3843 3844 // reset 3845 if (options.preventScrollOnTouch === 'auto') { preventScroll = false; } 3846 if (swipeAngle) { moveDirectionExpected = '?'; } 3847 if (autoplay && !animating) { setAutoplayTimer(); } 3848 } 3849 3850 // === RESIZE FUNCTIONS === // 3851 // (slidePositions, index, items) => vertical_conentWrapper.height 3852 function updateContentWrapperHeight () { 3853 var wp = middleWrapper ? middleWrapper : innerWrapper; 3854 wp.style.height = slidePositions[index + items] - slidePositions[index] + 'px'; 3855 } 3856 3857 function getPages () { 3858 var rough = fixedWidth ? (fixedWidth + gutter) * slideCount / viewport : slideCount / items; 3859 return Math.min(Math.ceil(rough), slideCount); 3860 } 3861 3862 /* 3863 * 1. update visible nav items list 3864 * 2. add "hidden" attributes to previous visible nav items 3865 * 3. remove "hidden" attrubutes to new visible nav items 3866 */ 3867 function updateNavVisibility () { 3868 if (!nav || navAsThumbnails) { return; } 3869 3870 if (pages !== pagesCached) { 3871 var min = pagesCached, 3872 max = pages, 3873 fn = _helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"]; 3874 3875 if (pagesCached > pages) { 3876 min = pages; 3877 max = pagesCached; 3878 fn = _helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"]; 3879 } 3880 3881 while (min < max) { 3882 fn(navItems[min]); 3883 min++; 3884 } 3885 3886 // cache pages 3887 pagesCached = pages; 3888 } 3889 } 3890 3891 function info (e) { 3892 return { 3893 container: container, 3894 slideItems: slideItems, 3895 navContainer: navContainer, 3896 navItems: navItems, 3897 controlsContainer: controlsContainer, 3898 hasControls: hasControls, 3899 prevButton: prevButton, 3900 nextButton: nextButton, 3901 items: items, 3902 slideBy: slideBy, 3903 cloneCount: cloneCount, 3904 slideCount: slideCount, 3905 slideCountNew: slideCountNew, 3906 index: index, 3907 indexCached: indexCached, 3908 displayIndex: getCurrentSlide(), 3909 navCurrentIndex: navCurrentIndex, 3910 navCurrentIndexCached: navCurrentIndexCached, 3911 pages: pages, 3912 pagesCached: pagesCached, 3913 sheet: sheet, 3914 isOn: isOn, 3915 event: e || {}, 3916 }; 3917 } 3918 3919 return { 3920 version: '2.9.3', 3921 getInfo: info, 3922 events: events, 3923 goTo: goTo, 3924 play: play, 3925 pause: pause, 3926 isOn: isOn, 3927 updateSliderHeight: updateInnerWrapperHeight, 3928 refresh: initSliderTransform, 3929 destroy: destroy, 3930 rebuild: function() { 3931 return tns(Object(_helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__["extend"])(options, optionsElements)); 3932 } 3933 }; 3934}; 3935 3936 3937/***/ }), 3938
3939/***/ "./src/components/product-category-slider/product-category-slider.js": 3940/*!***************************************************************************!*\ 3941 !*** ./src/components/product-category-slider/product-category-slider.js ***! 3942 \***************************************************************************/ 3943/*! no exports provided */ 3944/***/ (function(module, __webpack_exports__, __webpack_require__) { 3945 3946"use strict"; 3947__webpack_require__.r(__webpack_exports__); 3948/* harmony import */ var _js_main_script__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../js/main.script */ "./src/js/main.script.js"); 3949 3950 3951 3952 3953(function ($, Drupal) { 3954 $(document).ready(function () { 3955 // Carousel 3 Items Max. 3956 var slider = document.tnsAda.init({ 3957 "container": ".product-category-slider__row.carousel", 3958 "items": 1, 3959 "center": false, 3960 "loop": true, 3961 "swipeAngle": false, 3962 "speed": 400, 3963 "nav": false, 3964 "controlsContainer": ".product-category-slider__controls", 3965 "prevButton": ".carousel-prev", 3966 "nextButton": ".carousel-next", 3967 "edgePadding": 20, 3968 "gutter": 20, 3969 "controlsPosition": "top" 3970 }); 3971 var arrowsColor = $("#main-taxonomy-bg-color").html(); 3972 $(".product-category-slider__controls .icon").css("background-color", arrowsColor); 3973 }); 3974})(jQuery, Drupal); 3975 3976/***/ }), 3977
3978/***/ "./src/js/main.script.js": 3979/*!*******************************!*\ 3980 !*** ./src/js/main.script.js ***! 3981 \*******************************/ 3982/*! no exports provided */ 3983/***/ (function(module, __webpack_exports__, __webpack_require__) { 3984 3985"use strict"; 3986__webpack_require__.r(__webpack_exports__); 3987/* harmony import */ var _polyfill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./polyfill */ "./src/js/polyfill.js"); 3988/* harmony import */ var _polyfill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_polyfill__WEBPACK_IMPORTED_MODULE_0__); 3989/* harmony import */ var _tnsAda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tnsAda */ "./src/js/tnsAda.js"); 3990 3991 3992 3993 // import 'bootstrap'; 3994 3995(function ($, Drupal, drupalSettings) { 3996 // Responsive check helper: 3997 // USAGE: if (Drupal.device.isMobile()) {} 3998 Drupal.device = { 3999 isDesktop: function isDesktop() { 4000 return $(window).innerWidth() > 980; 4001 }, 4002 isTablet: function isTablet() { 4003 return $(window).innerWidth() <= 980 && $(window).innerWidth() > 728; 4004 }, 4005 isMobile: function isMobile() { 4006 return $(window).innerWidth() <= 728; 4007 } 4008 }; // Let the document know when the mouse is being used 4009 4010 document.body.addEventListener('mousedown', function () { 4011 document.body.classList.add('using-mouse'); 4012 }); // Re-enable focus styling when Tab is pressed 4013 4014 document.body.addEventListener('keydown', function (event) { 4015 if (event.keyCode === 9) { 4016 document.body.classList.remove('using-mouse'); 4017 } 4018 }); 4019 $('#ajax-wrapper .js-form-item-image-upload small #edit-image-upload--description').append("<small> No file chosen.</small>"); 4020 Drupal.behaviors.Bc_brandTheme = { 4021 attach: function attach(context, settings) { 4022 var host = window.location.host; 4023 $('a[href^="http"]:not([href*="' + host + '"])').each(function (index) { 4024 $(this).attr('rel', 'noopener nofollow'); 4025 }); 4026 $('[data-toggle="popover"]').each(function (index) { 4027 var $this = $(this); 4028 var $container = $this.closest('div'); 4029 $container.addClass('has-popover'); 4030 $this.appendTo($container); 4031 $this.popover({ 4032 template: '<div class="popover" role="tooltip"><div class="popover-body"></div></div>', 4033 container: $container 4034 }); 4035 }); 4036 $(".popover-button").click(function () { 4037 var controls = $(this).attr("aria-describedby"); 4038 $(".popover-button").removeAttr("aria-describedby"); 4039 $(".popover-button").attr("aria-expanded", function (index, attr) { 4040 return attr == "false" ? "true" : "false"; 4041 }); 4042 $(".popover-button").attr("aria-controls", function (index, attr) { 4043 return attr = controls; 4044 }); 4045 }); 4046 $('.webform-submission-newsletter-form-form .form-item-postal-code input').inputmask({ 4047 mask: ['99999', '99999-9999', 'A9A 9A9'], 4048 placeholder: '', 4049 clearIncomplete: true 4050 }); 4051 /** 4052 * SHARE COMPONENT 4053 */ 4054 4055 /** 4056 * Determine the mobile operating system. 4057 * This function returns one of 'iOS', 'Android', 'Windows Phone', or 'unknown'. 4058 * Based on: https://stackoverflow.com/questions/21741841/detecting-ios-android-operating-system 4059 * @returns {String} 4060 */ 4061 4062 function isAndroidIOS() { 4063 var userAgent = navigator.userAgent || navigator.vendor || window.opera; 4064 4065 if (/android/i.test(userAgent)) { 4066 console.log("android detected"); 4067 4068 if ($(".page-node-type-blog").length) { 4069 $(window).bind('orientationchange', function () { 4070 if ($(window).width() >= 728) { 4071 $(".article-detail__section-abstract .info-share .share-button").attr("aria-controls", "sharebox"); 4072 $(".article-detail__section-abstract .info-share .sharebox").attr("id", "sharebox"); 4073 $('.article-detail__back-and-share .info-share .share-button').removeAttr("aria-controls"); 4074 $('.article-detail__back-and-share .info-share .sharebox').removeAttr("id"); // console.log('desktop'); 4075 } else { 4076 // console.log("mobile"); 4077 $('.article-detail__back-and-share .info-share .share-button').attr("aria-controls", "sharebox"); 4078 $('.article-detail__back-and-share .info-share .sharebox').attr("id", "sharebox"); 4079 $(".article-detail__section-abstract .info-share .share-button").removeAttr("aria-controls"); 4080 $(".article-detail__section-abstract .info-share .sharebox").removeAttr("id"); 4081 } 4082 }).bind(); 4083 } 4084 4085 return true; 4086 } // iOS detection from: http://stackoverflow.com/a/9039885/177710 4087 4088 4089 if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { 4090 console.log("ios detected"); 4091 return true; 4092 } //not Android or iOS 4093 4094 4095 return false;
4096 } 4097 4098 function getMeta(metaName) { 4099 var metas = document.getElementsByTagName('meta'); 4100 4101 for (var i = 0; i < metas.length; i++) { 4102 if (metas[i].getAttribute('name') === metaName) { 4103 return metas[i].getAttribute('content'); 4104 } 4105 } 4106 4107 return ''; 4108 } 4109 4110 $('.share-button', context).on('click', function () { 4111 var isMobile = isAndroidIOS(); 4112 console.log(isMobile); 4113 4114 if (navigator.share && isMobile) { 4115 navigator.share({ 4116 title: document.title, 4117 text: getMeta('description'), 4118 url: document.href 4119 }).then(function () { 4120 return console.log('Successful share'); 4121 })["catch"](function (error) { 4122 return console.log('Error sharing', error); 4123 }); 4124 return null; 4125 } // console.log(this); 4126 // $(this).toggleClass('opened'); 4127 // // $(this).find('.icon').toggleClass('icon-share-close icon-share'); 4128 // $('.sharebox').toggleClass('opened'); 4129 // if ($(this).hasClass('opened')) { 4130 // $(this).attr('aria-expanded', 'true'); 4131 // } else { 4132 // $(this).attr('aria-expanded', 'false'); 4133 // } 4134 // $('.sharebox .close').focus(); 4135 4136 }); // $('.share-button').on("click", function (e) { 4137 // e.preventDefault(); 4138 // // $('.search__filters li a').addClass('hidden'); 4139 // console.log('toggle share'); 4140 // }); 4141 // $('.sharebox .close').on('click', function () { 4142 // $(this).parents('.opened').removeClass('opened'); 4143 // }); 4144 4145 var $temp = $("<input>"); 4146 var $url = $(location).attr('href'); 4147 $('.sharebox .copybutton').on('click', function () { 4148 // $('.copyfield input')[0].select(); 4149 // document.execCommand('copy'); 4150 $("body").append($temp); 4151 $temp.val($url).select(); 4152 document.execCommand("copy"); 4153 $temp.remove(); 4154 $('.copyfield .copymessage').addClass('shown'); 4155 setTimeout(function () { 4156 $('.copyfield .copymessage').removeClass('shown'); 4157 }, 10000); 4158 }); //Change Element type 4159 4160 $.fn.changeElementType = function (newType) { 4161 this.each(function () { 4162 var attrs = {}; 4163 $.each(this.attributes, function (idx, attr) { 4164 attrs[attr.nodeName] = attr.nodeValue; 4165 }); 4166 $(this).replaceWith(function () { 4167 return $("<" + newType + "/>", attrs).append($(this).contents()); 4168 }); 4169 }); 4170 }; // Detect Valid Keyboard Clicks 4171 // https://karlgroves.com/2014/11/24/ridiculously-easy-trick-for-keyboard-accessibility 4172 4173 4174 function a11yClick(event) { 4175 if (event.type === 'click') { 4176 return true; 4177 } else if (event.type === 'keypress') { 4178 var code = event.charCode || event.keyCode; 4179 4180 if (code === 32 || code === 13) { 4181 return true; 4182 } 4183 } else { 4184 return false; 4185 } 4186 } // Juicer/Slick accessibility tweaks. 4187 // $("#block-juiceren .juicer-feed").changeElementType("div"); 4188 4189 4190 $("#block-juiceren .juicer-feed").on('init', function (e, slick) { 4191 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active"); 4192 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active").removeAttr("aria-hidden"); 4193 setTimeout(function () { 4194 // Set slick's accessibility option to false as recommended here: 4195 // https://hub.accessible360.com/kb/articles/521#heading-tip-3-disable-accessibility-mode 4196 if ($("#block-juiceren .juicer-feed").hasClass('slick-initialized')) { 4197 $("#block-juiceren .juicer-feed.slick-initialized").slick('slickSetOption', { 4198 accessibility: false 4199 }, true); 4200 } 4201 4202 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active").removeAttr("aria-hidden"); 4203 }, 1000); 4204 $("#block-juiceren .juicer-feed .slick-list .feed-item .j-text a").removeAttr("tabindex").css("color", "white").changeElementType("span"); 4205 $("#block-juiceren .juicer-feed .slick-list").find(".slick-track .feed-item").attr("role", "group"); 4206 $("#block-juiceren .juicer-feed .slick-list .feed-item .j-text .j-meta nav").addClass('j-meta-nav').changeElementType("div"); 4207 $('#block-juiceren .juicer-feed .slick-list .feed-item').on('click', function () { 4208 window.open($(this).find('a').attr('href')); // console.log('test'); 4209 4210 return false;
4211 }); // Play icon. 4212 4213 var $imageVideo = $("#block-juiceren .juicer-feed .slick-list .feed-item.j-video .j-image"); 4214 var playIcon = '<span class="j-video-icon" aria-hidden="true"></span>'; 4215 $imageVideo.append(playIcon); 4216 $("#block-juiceren .juicer-feed .slick-list .feed-item", context).each(function (i, e) { 4217 var alt = $(e).find(".j-image img").attr("alt"), 4218 message = $(e).find(".j-message").text(), 4219 label = Number($(e).attr("data-slick-index")) + 1, 4220 totalSlide = $("#block-juiceren .juicer-feed .slick-list .feed-item").length; 4221 $(e).attr({ 4222 "aria-label": "Slide " + label + " of " + totalSlide 4223 }); // if (alt) { 4224 // $(e).find(".j-image img").attr("alt", alt.replace('Photo from ', '')); 4225 // } 4226 4227 $(e).find(".j-image img").attr("alt", message); // Social icon screen reader text. 4228 4229 var $social = $(this).find('.j-social'); 4230 var socialIcon = '<span class="j-social-icon" aria-hidden="true"></span> <span class="sr-only">' + $social.attr('aria-label') + '</span>'; 4231 $social.append(socialIcon).removeAttr('aria-label'); 4232 }); 4233 $(".slick-next, .slick-prev").on("click keypress", function (event) { 4234 if (a11yClick(event) === true) { 4235 setTimeout(function () { 4236 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active a").first().focus(); 4237 }, 100); 4238 } 4239 }); //update all j-meta a tags to say comments or likes 4240 4241 $(".comments, .repins").each(function () { 4242 var numComments = $(this).text(); 4243 $(this).html(numComments + ' <span class="sr-only">comments</div>'); 4244 }); 4245 $(".likes").each(function () { 4246 var numLikes = $(this).text(); 4247 $(this).html(numLikes + ' <span class="sr-only">likes</div>'); 4248 }); 4249 }); 4250 $("#block-juiceren .juicer-feed").on('beforeChange', function (e, slick, currentSlide, nextSlide) { 4251 $("#block-juiceren .juicer-feed .slick-list .feed-item").removeAttr("aria-hidden"); 4252 }); 4253 $("#block-juiceren .juicer-feed").on('afterChange', function (e, slick, currentSlide) { 4254 setTimeout(function () { 4255 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active").removeAttr("aria-hidden"); 4256 }, 500); 4257 }); 4258 4259 if ($('#prodH1').length > 0) { 4260 var root = document.getElementById('prodH1'); 4261 root.style.setProperty('--h1-height', root.clientHeight + 'px'); 4262 $(".products--full").addClass("loaded"); 4263 console.log('root.clientHeight', root.clientHeight); 4264 } // if($(".error").length) { 4265 4266 4267 $('#user-login-form .form-submit').on('click', function () { 4268 // console.log("ERROR MESSAGE"); 4269 setTimeout(function () { 4270 if ($("label").hasClass("error")) { 4271 console.log("ERROR"); 4272 $("#user-login-form").addClass("login-errors"); 4273 } 4274 }, 600); 4275 }); 4276 $('#user-login-form input.required').on('input', function () { 4277 setTimeout(function () { 4278 if ($("label").hasClass("error")) { 4279 console.log("ERROR2"); 4280 $("#user-login-form").addClass("login-errors"); 4281 } 4282 4283 if ($('#user-login-form label').css('display') == 'none') { 4284 // true 4285 console.log("ERROR FIXED"); 4286 $("#user-login-form").removeClass("login-errors"); 4287 } 4288 }, 600); 4289 }); // } 4290 // var altTxt = $("img").attr('alt'); 4291 4292 if ($('.blog-callout__image img').length > 0) { 4293 $(".blog-callout__image img").attr('alt', ''); 4294 } 4295 4296 if ($('.recipe-featured__col img').length > 0) { 4297 $(".recipe-featured__col img").attr('alt', ''); 4298 } 4299 4300 if ($('.recipes--full__image-frame img').length > 0) { 4301 $(".recipes--full__image-frame img").attr('alt', ''); 4302 } 4303 4304 if ($('.blog-teaser__image img').length > 0) { 4305 $(".blog-teaser__image img").attr('alt', ''); 4306 } // setTimeout 4307 // if ($('.recipe-featured__card img').length > 0) { 4308 // $(".recipe-featured__card img").attr('alt', ''); 4309 // console.log('here') 4310 // } 4311 4312 4313 setTimeout(function () { 4314 if ($('.recipe-featured__card img').length > 0) { 4315 $(".recipe-featured__card img").attr('alt', ''); 4316 } 4317 }, 12000); //identitcal id issue on blog page fix 4318 4319 if ($(".page-node-type-blog").length) { 4320 $(window).resize(function () { 4321 if ($(window).width() >= 728) { 4322 $(".article-detail__section-abstract .info-share .share-button").attr("aria-controls", "sharebox"); 4323 $(".article-detail__section-abstract .info-share .sharebox").attr("id", "sharebox"); 4324 $('.article-detail__back-and-share .info-share .share-button').removeAttr("aria-controls"); 4325 $('.article-detail__back-and-share .info-share .sharebox').removeAttr("id"); // console.log('desktop'); 4326 } else { 4327 // console.log("mobile"); 4328 $('.article-detail__back-and-share .info-share .share-button').attr("aria-controls", "sharebox"); 4329 $('.article-detail__back-and-share .info-share .sharebox').attr("id", "sharebox"); 4330 $(".article-detail__section-abstract .info-share .share-button").removeAttr("aria-controls"); 4331 $(".article-detail__section-abstract .info-share .sharebox").removeAttr("id"); 4332 } 4333 }).resize(); 4334 } 4335 } 4336 }; 4337 $("form input#edit-image-upload-upload-button--2").focusin(function (e) { 4338 $('label[for="edit-image-upload-upload-button--2"]').addClass("focused"); 4339 }); 4340 $("form input#edit-image-upload-upload-button--2").focusout(function (e) { 4341 $('label[for="edit-image-upload-upload-button--2"]').removeClass("focused"); 4342 }); //share button fix 4343 4344 $('.share-button').on('click', function () { 4345 $(this).toggleClass('opened'); 4346 $('.sharebox').toggleClass('opened'); 4347 4348 if ($(this).hasClass('opened')) { 4349 $(this).attr('aria-expanded', 'true'); 4350 } else { 4351 $(this).attr('aria-expanded', 'false'); 4352 } 4353 }); // if($(".share-button").length > 0) { 4354 // $('.share-button').on('click', function () { 4355 // console.log("yup clicked"); 4356 // $(this).addClass('opened'); 4357 // $('.sharebox').toggleClass('opened'); 4358 // }) 4359 // } 4360 // $(document).ready(function () { 4361 // // Function to handle aria-hidden for all child elements 4362 // function updateAriaHiddenState(element) { 4363 // if ($(element).attr('aria-hidden') === 'true') { 4364 // // Add aria-hidden="true" to all children 4365 // $(element).find('*').attr('aria-hidden', 'true'); 4366 // } else { 4367 // // Remove aria-hidden from all children 4368 // $(element).find('*').removeAttr('aria-hidden'); 4369 // } 4370 // } 4371 // // Initial check to apply or remove aria-hidden 4372 // $('.blog-featured-medium__item').each(function () { 4373 // updateAriaHiddenState(this); 4374 // }); 4375 // // MutationObserver to watch for changes to aria-hidden attribute 4376 // var observer = new MutationObserver(function (mutations) { 4377 // mutations.forEach(function (mutation) { 4378 // if (mutation.type === 'attributes' && mutation.attributeName === 'aria-hidden') { 4379 // // Update the aria-hidden state for the mutated element 4380 // updateAriaHiddenState(mutation.target); 4381 // } 4382 // }); 4383 // }); 4384 // // Apply the MutationObserver to each blog-featured-medium__item 4385 // $('.blog-featured-medium__item').each(function () { 4386 // observer.observe(this, { attributes: true }); // Watch for attribute changes 4387 // }); 4388 // }); 4389})(jQuery, Drupal, drupalSettings); 4390 4391/***/ }), 4392
4393/***/ "./src/js/polyfill.js": 4394/*!****************************!*\ 4395 !*** ./src/js/polyfill.js ***! 4396 \****************************/ 4397/*! no static exports found */ 4398/***/ (function(module, exports) { 4399 4400// Add your JS/node package pollyfills here 4401 4402/***/ }), 4403
4404/***/ "./src/js/tnsAda.js": 4405/*!**************************!*\ 4406 !*** ./src/js/tnsAda.js ***! 4407 \**************************/ 4408/*! exports provided: tns */ 4409/***/ (function(module, __webpack_exports__, __webpack_require__) { 4410 4411"use strict"; 4412__webpack_require__.r(__webpack_exports__); 4413/* harmony import */ var _node_modules_tiny_slider_src_tiny_slider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/tiny-slider/src/tiny-slider */ "./node_modules/tiny-slider/src/tiny-slider.js"); 4414/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tns", function() { return _node_modules_tiny_slider_src_tiny_slider__WEBPACK_IMPORTED_MODULE_0__["tns"]; }); 4415 4416// Carousel ADA remediation for TNS slider 2.9.2 4417// https://hub.accessible360.com/kb/articles/476 4418// https://confluence.millenniumweb.com/display/CKB/Accessible+Carousels 4419// 4420// Usage Example: 4421// document.tnsAda.init({ 4422// // ===== Just use standard tns config options 4423// container: '.your-selector-for-wrapping-element', 4424// items: 1, 4425// slideBy: 'page', 4426// autoplay: false, 4427// // ===== Options used for custom ADA code **all optional 4428// nav: true, // BOOLEAN: Create ADA bullet nav? 4429// controls: true, // BOOLEAN: Create ADA prev and next buttons? 4430// reverseNextPrev: false, // BOOLEAN: Reverse prev/next buttons? 4431// adaText: { // OBJECT: Custom text for ADA elements 4432// nav: '<span aria-hidden="true">•</span>', // STRING: Custom bullet nav text 4433// prev: '<span class="sr-only">Previous Slide</span> <i class="icon icon-circle-arrow-left icon-fill-tertiary" aria-hidden="true"></i>', // STRING: Custom prev button text 4434// next: '<span class="sr-only">Next Slide</span> <i class="icon icon-circle-arrow-right icon-fill-tertiary" aria-hidden="true"></i>', // STRING: Custom next button text 4435// instructions: 'This is a carousel. Use Next and Previous buttons to navigate, or jump to a slide with the slide dots.', // STRING: Custom instructions text 4436// goTo: 'Go to slide [x]', // STRING: Custom go to slide text 4437// current: 'Slide [x] of [y]', // STRING: Custom current slide text 4438// } 4439// }); 4440// 4441// TODO: generate/find a unique id for the instance of the initialization. 4442// Use it to namespace all events so they can be unbound and the slider 4443// destroyed. could alternatively just put some logic in to prevent the 4444// same element from being initialized twice. 4445// 4446// TODO: import all currently hardcoded text strings so that the slider can be 4447// translatable. could use data-attributes. could grab them from the 4448// document.tnsAda object. could pass them in with the initialization. 4449// For drupal string translation having them in a template or block is 4450// probably easiest. 4451 4452 4453document.tnsAda = { 4454 init: function init(params) { 4455 //if the container element is not present. do nothing and exit. 4456 if (jQuery(params.container).length < 1) { 4457 return; 4458 } 4459 4460 var orig = this; // Definte options for ADA functions 4461 4462 var opt = { 4463 nav: params.nav, 4464 // Create a custom ADA bullet nav? 4465 controls: params.controls, 4466 // Create custom ADA prev and next buttons? 4467 reverseNextPrev: params.reverseNextPrev // Reverse the action of the next and previous buttons? 4468 4469 }; 4470 4471 if (!params.adaText) { 4472 params.adaText = {}; 4473 } 4474 4475 opt.adaText = { 4476 nav: params.adaText.nav || '<span aria-hidden="true">•</span>', 4477 prev: params.adaText.prev || '<span class="sr-only">Previous Slide</span> <i class="icon icon-circle-arrow-left icon-fill-tertiary" aria-hidden="true"></i>', 4478 next: params.adaText.next || '<span class="sr-only">Next Slide</span> <i class="icon icon-circle-arrow-right icon-fill-tertiary" aria-hidden="true"></i>', 4479 instructions: params.adaText.instructions || "This is a carousel. Use Next and Previous buttons to navigate, or jump to a slide with the slide dots.", 4480 goTo: params.adaText.goTo || "Go to slide [x]", 4481 current: params.adaText.current || "Slide [x] of [y]", 4482 slides: params.adaText.slides || "Slides" 4483 }; // Prepare params object for initialization 4484 4485 params.nav = false;
4486 params.controls = false; 4487 delete params.reverseNextPrev; 4488 delete params.adaText; // Initialize the slider and store it in our opt object. 4489 4490 opt.slider = Object(_node_modules_tiny_slider_src_tiny_slider__WEBPACK_IMPORTED_MODULE_0__["tns"])(params); 4491 4492 if (opt.controls) { 4493 orig.addControls(opt); 4494 } 4495 4496 if (opt.nav) { 4497 orig.addNav(opt); 4498 } 4499 4500 orig.oneTimeFixes(opt); 4501 }, 4502 oneTimeFixes: function oneTimeFixes(opt) { 4503 var orig = this, 4504 slider = opt.slider, 4505 info = slider.getInfo(), 4506 inner = jQuery(info.container).parents(".tns-inner"), 4507 outer = jQuery(info.container).parents(".tns-outer"), 4508 uiEnabled = true; // Add role attribute to the slides 4509 4510 inner.find(".tns-item").attr("role", "group"); // Remove non-compliant live region 4511 4512 outer.find(".tns-liveregion").removeAttr("aria-live").removeAttr("aria-atomic").attr("aria-hidden", "true").hide(); // Add role and label to the carousel incase its a ul 4513 4514 inner.find(".tns-carousel").attr("role", "presentation").attr("aria-label", opt.adaText.slides); // Add carousel instructions 4515 4516 outer.prepend('<p class="sr-only tns-custom-instructions">' + opt.adaText.instructions + "</p>"); // Hide controls if all items are displayed at once 4517 4518 jQuery(window).on("resize", function () { 4519 orig.updateActive("", opt); 4520 4521 if (slider.getInfo().items >= info.slideCount) { 4522 toggleUi("off"); 4523 } else { 4524 toggleUi("on"); 4525 } 4526 }); 4527 jQuery(window).trigger("resize"); 4528 4529 function toggleUi(dir) { 4530 if (dir == "off" && uiEnabled) { 4531 outer.find(".tns-custom-controls, .tns-custom-nav, .tns-custom-instructions").hide().attr("aria-hidden", "true"); 4532 orig.updateActive(0, opt); 4533 uiEnabled = false; 4534 } 4535 4536 if (dir == "on" && !uiEnabled) { 4537 outer.find(".tns-custom-controls, .tns-custom-nav, .tns-custom-instructions").show().removeAttr("aria-hidden"); 4538 uiEnabled = true; 4539 } 4540 } 4541 }, 4542 addControls: function addControls(opt) { 4543 var orig = this, 4544 slider = opt.slider, 4545 info = slider.getInfo(), 4546 inner = jQuery(info.container).parents(".tns-inner"); // Add prev/next buttons and events 4547 // Note: TNS sliders interpretation of "next and previous" is a bit conterintuitive. 4548 // I swapped them by default. The reverseNextPrev flag allows you to switch back. 4549 4550 if (opt.reverseNextPrev) { 4551 inner.prepend('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-prev product-category__carousel-prev">' + opt.adaText.prev + "</button></div>"); 4552 inner.append('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-next product-category__carousel-next">' + opt.adaText.next + "</button></div>"); 4553 } else { 4554 inner.prepend('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-prev tns-custom-reverse product-category__carousel-prev">' + opt.adaText.prev + "</button></div>"); 4555 inner.append('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-next tns-custom-reverse product-category__carousel-next">' + opt.adaText.next + "</button></div>"); 4556 } 4557 4558 inner.find(".tns-custom-next").on("click", function () { 4559 orig.updateActive("next", opt); 4560 }); 4561 inner.find(".tns-custom-prev").on("click", function () { 4562 orig.updateActive("prev", opt); 4563 }); 4564 }, 4565 addNav: function addNav(opt) { 4566 var orig = this, 4567 slider = opt.slider, 4568 info = slider.getInfo(), 4569 inner = jQuery(info.container).parents(".tns-inner"); // Add bullet nav and events 4570 4571 var newNav = '<ul class="tns-custom-nav">'; 4572 4573 for (var i = 0; i < info.slideCount; i++) { 4574 newNav = newNav + '<li><button type="button" class="tns-custom-nav-item" data-tns-custom-nav-id="' + i + '" aria-label="' + opt.adaText.goTo.replace("[x]", i + 1) + '">' + opt.navText + "</button></li>"; 4575 } 4576 4577 inner.append(newNav + "</ul>"); 4578 inner.find("[data-tns-custom-nav-id]").on("click", function () { 4579 var target = jQuery(this).attr("data-tns-custom-nav-id"); 4580 orig.updateActive(target, opt); 4581 }); 4582 }, 4583 updateActive: function updateActive(target, opt) { 4584 var focusable = "[href], button, input, select, textarea", 4585 slider = opt.slider, 4586 info = slider.getInfo(), 4587 inner = jQuery(info.container).parents(".tns-inner"); // Navigate to the target slide 4588 4589 if (target.length > 0) { 4590 slider.goTo(target); 4591 } // Modify slides and bullet nav to reflect the new active slide state 4592 4593 4594 setTimeout(function () { 4595 var newInfo = slider.getInfo(); // Make all focusable elements in hidden slides not focusable and update the aria properties of all slides 4596 4597 inner.find(".tns-item").removeAttr("aria-label").attr("tabindex", "-1").attr("aria-hidden", "true").find(focusable).attr("tabindex", "-1"); 4598 4599 for (var i = newInfo.index; i < newInfo.items + newInfo.index; i++) { 4600 inner.find(".tns-item").eq(i).removeAttr("tabindex").removeAttr("aria-hidden").attr("aria-label", opt.adaText.current.replace("[x]", i - newInfo.index + newInfo.displayIndex).replace("[y]", newInfo.slideCount)).find(focusable).removeAttr("tabindex"); 4601 } // Update the bullet nav to reflect the currently active slide. 4602 4603 4604 if (opt.nav) { 4605 var navBtns = inner.find("[data-tns-custom-nav-id]"), 4606 activeNavBtn = inner.find('[data-tns-custom-nav-id="' + (newInfo.displayIndex - 1) + '"]'); 4607 navBtns.removeAttr("aria-current"); 4608 activeNavBtn.attr("aria-current", "true"); 4609 } 4610 }, 100); 4611 } 4612}; 4613 4614/***/ }), 4615 4616/***/ 15: 4617/*!*********************************************************************************!*\ 4618 !*** multi ./src/components/product-category-slider/product-category-slider.js ***! 4619 \*********************************************************************************/ 4620/*! no static exports found */ 4621/***/ (function(module, exports, __webpack_require__) { 4622 4623module.exports = __webpack_require__(/*! /var/www/html/dev_bc_bonmatin/html/web/themes/custom/bc_brand/src/components/product-category-slider/product-category-slider.js */"./src/components/product-category-slider/product-category-slider.js"); 4624 4625 4626/***/ }) 4627 4628/******/ });; 4629/******/ (function(modules) { // webpackBootstrap 4630/******/ // The module cache 4631/******/ var installedModules = {}; 4632/******/ 4633/******/ // The require function 4634/******/ function __webpack_require__(moduleId) { 4635/******/ 4636/******/ // Check if module is in cache 4637/******/ if(installedModules[moduleId]) { 4638/******/ return installedModules[moduleId].exports; 4639/******/ } 4640/******/ // Create a new module (and put it into the cache) 4641/******/ var module = installedModules[moduleId] = { 4642/******/ i: moduleId, 4643/******/ l: false, 4644/******/ exports: {} 4645/******/ }; 4646/******/ 4647/******/ // Execute the module function 4648/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 4649/******/ 4650/******/ // Flag the module as loaded
vendor: 2,823 bytes, lines 4651-4716
4651/******/ module.l = true; 4652/******/ 4653/******/ // Return the exports of the module 4654/******/ return module.exports; 4655/******/ } 4656/******/ 4657/******/ 4658/******/ // expose the modules object (__webpack_modules__) 4659/******/ __webpack_require__.m = modules; 4660/******/ 4661/******/ // expose the module cache 4662/******/ __webpack_require__.c = installedModules; 4663/******/ 4664/******/ // define getter function for harmony exports 4665/******/ __webpack_require__.d = function(exports, name, getter) { 4666/******/ if(!__webpack_require__.o(exports, name)) { 4667/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 4668/******/ } 4669/******/ }; 4670/******/ 4671/******/ // define __esModule on exports 4672/******/ __webpack_require__.r = function(exports) { 4673/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 4674/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 4675/******/ } 4676/******/ Object.defineProperty(exports, '__esModule', { value: true }); 4677/******/ }; 4678/******/ 4679/******/ // create a fake namespace object 4680/******/ // mode & 1: value is a module id, require it 4681/******/ // mode & 2: merge all properties of value into the ns 4682/******/ // mode & 4: return value when already ns object 4683/******/ // mode & 8|1: behave like require 4684/******/ __webpack_require__.t = function(value, mode) { 4685/******/ if(mode & 1) value = __webpack_require__(value); 4686/******/ if(mode & 8) return value; 4687/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 4688/******/ var ns = Object.create(null); 4689/******/ __webpack_require__.r(ns); 4690/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 4691/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 4692/******/ return ns; 4693/******/ }; 4694/******/ 4695/******/ // getDefaultExport function for compatibility with non-harmony modules 4696/******/ __webpack_require__.n = function(module) { 4697/******/ var getter = module && module.__esModule ? 4698/******/ function getDefault() { return module['default']; } : 4699/******/ function getModuleExports() { return module; }; 4700/******/ __webpack_require__.d(getter, 'a', getter); 4701/******/ return getter; 4702/******/ }; 4703/******/ 4704/******/ // Object.prototype.hasOwnProperty.call 4705/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 4706/******/ 4707/******/ // __webpack_public_path__ 4708/******/ __webpack_require__.p = "/"; 4709/******/ 4710/******/ 4711/******/ // Load entry module and return exports 4712/******/ return __webpack_require__(__webpack_require__.s = 9); 4713/******/ }) 4714/************************************************************************/ 4715/******/ ({ 4716
vendor: 970 bytes, lines 4717-4739
4717/***/ "./node_modules/tiny-slider/src/helpers/addCSSRule.js": 4718/*!************************************************************!*\ 4719 !*** ./node_modules/tiny-slider/src/helpers/addCSSRule.js ***! 4720 \************************************************************/ 4721/*! exports provided: addCSSRule */ 4722/***/ (function(module, __webpack_exports__, __webpack_require__) { 4723 4724"use strict"; 4725__webpack_require__.r(__webpack_exports__); 4726/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addCSSRule", function() { return addCSSRule; }); 4727/* harmony import */ var _raf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./raf.js */ "./node_modules/tiny-slider/src/helpers/raf.js"); 4728// cross browsers addRule method 4729 4730function addCSSRule(sheet, selector, rules, index) { 4731 // return raf(function() { 4732 'insertRule' in sheet ? 4733 sheet.insertRule(selector + '{' + rules + '}', index) : 4734 sheet.addRule(selector, rules, index); 4735 // }); 4736} 4737 4738/***/ }), 4739
vendor: 1,082 bytes, lines 4740-4763
4740/***/ "./node_modules/tiny-slider/src/helpers/addClass.js": 4741/*!**********************************************************!*\ 4742 !*** ./node_modules/tiny-slider/src/helpers/addClass.js ***! 4743 \**********************************************************/ 4744/*! exports provided: addClass */ 4745/***/ (function(module, __webpack_exports__, __webpack_require__) { 4746 4747"use strict"; 4748__webpack_require__.r(__webpack_exports__); 4749/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addClass", function() { return addClass; }); 4750/* harmony import */ var _hasClass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hasClass.js */ "./node_modules/tiny-slider/src/helpers/hasClass.js"); 4751 4752var addClass = _hasClass_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"] ? 4753 function (el, str) { 4754 if (!Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.classList.add(str); } 4755 } : 4756 function (el, str) { 4757 if (!Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.className += ' ' + str; } 4758 }; 4759 4760 4761 4762/***/ }), 4763
vendor: 1,023 bytes, lines 4764-4785
4764/***/ "./node_modules/tiny-slider/src/helpers/addEvents.js": 4765/*!***********************************************************!*\ 4766 !*** ./node_modules/tiny-slider/src/helpers/addEvents.js ***! 4767 \***********************************************************/ 4768/*! exports provided: addEvents */ 4769/***/ (function(module, __webpack_exports__, __webpack_require__) { 4770 4771"use strict"; 4772__webpack_require__.r(__webpack_exports__); 4773/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEvents", function() { return addEvents; }); 4774/* harmony import */ var _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./passiveOption.js */ "./node_modules/tiny-slider/src/helpers/passiveOption.js"); 4775 4776 4777function addEvents(el, obj, preventScrolling) { 4778 for (var prop in obj) { 4779 var option = ['touchstart', 'touchmove'].indexOf(prop) >= 0 && !preventScrolling ? _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__["passiveOption"] : false; 4780 el.addEventListener(prop, obj[prop], option); 4781 } 4782} 4783 4784/***/ }), 4785
vendor: 745 bytes, lines 4786-4805
4786/***/ "./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js": 4787/*!*******************************************************************!*\ 4788 !*** ./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js ***! 4789 \*******************************************************************/ 4790/*! exports provided: arrayFromNodeList */ 4791/***/ (function(module, __webpack_exports__, __webpack_require__) { 4792 4793"use strict"; 4794__webpack_require__.r(__webpack_exports__); 4795/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayFromNodeList", function() { return arrayFromNodeList; }); 4796function arrayFromNodeList (nl) { 4797 var arr = []; 4798 for (var i = 0, l = nl.length; i < l; i++) { 4799 arr.push(nl[i]); 4800 } 4801 return arr; 4802} 4803 4804/***/ }), 4805
vendor: 637 bytes, lines 4806-4824
4806/***/ "./node_modules/tiny-slider/src/helpers/caf.js": 4807/*!*****************************************************!*\ 4808 !*** ./node_modules/tiny-slider/src/helpers/caf.js ***! 4809 \*****************************************************/ 4810/*! exports provided: caf */ 4811/***/ (function(module, __webpack_exports__, __webpack_require__) { 4812 4813"use strict"; 4814__webpack_require__.r(__webpack_exports__); 4815/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "caf", function() { return caf; }); 4816var win = window; 4817 4818var caf = win.cancelAnimationFrame 4819 || win.mozCancelAnimationFrame 4820 || function(id){ clearTimeout(id); }; 4821 4822 4823/***/ }), 4824
vendor: 1,914 bytes, lines 4825-4873
4825/***/ "./node_modules/tiny-slider/src/helpers/calc.js": 4826/*!******************************************************!*\ 4827 !*** ./node_modules/tiny-slider/src/helpers/calc.js ***! 4828 \******************************************************/ 4829/*! exports provided: calc */ 4830/***/ (function(module, __webpack_exports__, __webpack_require__) { 4831 4832"use strict"; 4833__webpack_require__.r(__webpack_exports__); 4834/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calc", function() { return calc; }); 4835/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 4836/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 4837/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 4838// get css-calc 4839// @return - false | calc | -webkit-calc | -moz-calc 4840// @usage - var calc = getCalc(); 4841 4842 4843 4844 4845function calc() { 4846 var doc = document, 4847 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 4848 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 4849 div = doc.createElement('div'), 4850 result = false; 4851 4852 body.appendChild(div); 4853 try { 4854 var str = '(10px * 10)', 4855 vals = ['calc' + str, '-moz-calc' + str, '-webkit-calc' + str], 4856 val; 4857 for (var i = 0; i < 3; i++) { 4858 val = vals[i]; 4859 div.style.width = val; 4860 if (div.offsetWidth === 100) { 4861 result = val.replace(str, ''); 4862 break; 4863 } 4864 } 4865 } catch (e) {} 4866 4867 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : div.remove(); 4868 4869 return result; 4870} 4871 4872/***/ }), 4873
vendor: 722 bytes, lines 4874-4889
4874/***/ "./node_modules/tiny-slider/src/helpers/checkStorageValue.js": 4875/*!*******************************************************************!*\ 4876 !*** ./node_modules/tiny-slider/src/helpers/checkStorageValue.js ***! 4877 \*******************************************************************/ 4878/*! exports provided: checkStorageValue */ 4879/***/ (function(module, __webpack_exports__, __webpack_require__) { 4880 4881"use strict"; 4882__webpack_require__.r(__webpack_exports__); 4883/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkStorageValue", function() { return checkStorageValue; }); 4884function checkStorageValue (value) { 4885 return ['true', 'false'].indexOf(value) >= 0 ? JSON.parse(value) : value; 4886} 4887 4888/***/ }), 4889
vendor: 667 bytes, lines 4890-4903
4890/***/ "./node_modules/tiny-slider/src/helpers/classListSupport.js": 4891/*!******************************************************************!*\ 4892 !*** ./node_modules/tiny-slider/src/helpers/classListSupport.js ***! 4893 \******************************************************************/ 4894/*! exports provided: classListSupport */ 4895/***/ (function(module, __webpack_exports__, __webpack_require__) { 4896 4897"use strict"; 4898__webpack_require__.r(__webpack_exports__); 4899/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "classListSupport", function() { return classListSupport; }); 4900var classListSupport = 'classList' in document.createElement('_'); 4901 4902/***/ }), 4903
vendor: 1,359 bytes, lines 4904-4938
4904/***/ "./node_modules/tiny-slider/src/helpers/createStyleSheet.js": 4905/*!******************************************************************!*\ 4906 !*** ./node_modules/tiny-slider/src/helpers/createStyleSheet.js ***! 4907 \******************************************************************/ 4908/*! exports provided: createStyleSheet */ 4909/***/ (function(module, __webpack_exports__, __webpack_require__) { 4910 4911"use strict"; 4912__webpack_require__.r(__webpack_exports__); 4913/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStyleSheet", function() { return createStyleSheet; }); 4914// create and append style sheet 4915function createStyleSheet (media, nonce) { 4916 // Create the <style> tag 4917 var style = document.createElement("style"); 4918 // style.setAttribute("type", "text/css"); 4919 4920 // Add a media (and/or media query) here if you'd like! 4921 // style.setAttribute("media", "screen") 4922 // style.setAttribute("media", "only screen and (max-width : 1024px)") 4923 if (media) { style.setAttribute("media", media); } 4924 4925 // Add nonce attribute for Content Security Policy 4926 if (nonce) { style.setAttribute("nonce", nonce); } 4927 4928 // WebKit hack :( 4929 // style.appendChild(document.createTextNode("")); 4930 4931 // Add the <style> element to the page 4932 document.querySelector('head').appendChild(style); 4933 4934 return style.sheet ? style.sheet : style.styleSheet; 4935}; 4936 4937/***/ }), 4938
vendor: 601 bytes, lines 4939-4952
4939/***/ "./node_modules/tiny-slider/src/helpers/docElement.js": 4940/*!************************************************************!*\ 4941 !*** ./node_modules/tiny-slider/src/helpers/docElement.js ***! 4942 \************************************************************/ 4943/*! exports provided: docElement */ 4944/***/ (function(module, __webpack_exports__, __webpack_require__) { 4945 4946"use strict"; 4947__webpack_require__.r(__webpack_exports__); 4948/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "docElement", function() { return docElement; }); 4949var docElement = document.documentElement; 4950 4951/***/ }), 4952
vendor: 1,234 bytes, lines 4953-4992
4953/***/ "./node_modules/tiny-slider/src/helpers/events.js": 4954/*!********************************************************!*\ 4955 !*** ./node_modules/tiny-slider/src/helpers/events.js ***! 4956 \********************************************************/ 4957/*! exports provided: Events */ 4958/***/ (function(module, __webpack_exports__, __webpack_require__) { 4959 4960"use strict"; 4961__webpack_require__.r(__webpack_exports__); 4962/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Events", function() { return Events; }); 4963function Events() { 4964 return { 4965 topics: {}, 4966 on: function (eventName, fn) { 4967 this.topics[eventName] = this.topics[eventName] || []; 4968 this.topics[eventName].push(fn); 4969 }, 4970 off: function(eventName, fn) { 4971 if (this.topics[eventName]) { 4972 for (var i = 0; i < this.topics[eventName].length; i++) { 4973 if (this.topics[eventName][i] === fn) { 4974 this.topics[eventName].splice(i, 1); 4975 break; 4976 } 4977 } 4978 } 4979 }, 4980 emit: function (eventName, data) { 4981 data.type = eventName; 4982 if (this.topics[eventName]) { 4983 this.topics[eventName].forEach(function(fn) { 4984 fn(data, eventName); 4985 }); 4986 } 4987 } 4988 }; 4989}; 4990 4991/***/ }), 4992
vendor: 947 bytes, lines 4993-5026
4993/***/ "./node_modules/tiny-slider/src/helpers/extend.js": 4994/*!********************************************************!*\ 4995 !*** ./node_modules/tiny-slider/src/helpers/extend.js ***! 4996 \********************************************************/ 4997/*! exports provided: extend */ 4998/***/ (function(module, __webpack_exports__, __webpack_require__) { 4999 5000"use strict"; 5001__webpack_require__.r(__webpack_exports__); 5002/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return extend; }); 5003function extend() { 5004 var obj, name, copy, 5005 target = arguments[0] || {}, 5006 i = 1, 5007 length = arguments.length; 5008 5009 for (; i < length; i++) { 5010 if ((obj = arguments[i]) !== null) { 5011 for (name in obj) { 5012 copy = obj[name]; 5013 5014 if (target === copy) { 5015 continue; 5016 } else if (copy !== undefined) { 5017 target[name] = copy; 5018 } 5019 } 5020 } 5021 } 5022 return target; 5023} 5024 5025/***/ }), 5026
vendor: 739 bytes, lines 5027-5045
5027/***/ "./node_modules/tiny-slider/src/helpers/forEach.js": 5028/*!*********************************************************!*\ 5029 !*** ./node_modules/tiny-slider/src/helpers/forEach.js ***! 5030 \*********************************************************/ 5031/*! exports provided: forEach */ 5032/***/ (function(module, __webpack_exports__, __webpack_require__) { 5033 5034"use strict"; 5035__webpack_require__.r(__webpack_exports__); 5036/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; }); 5037// https://toddmotto.com/ditch-the-array-foreach-call-nodelist-hack/ 5038function forEach (arr, callback, scope) { 5039 for (var i = 0, l = arr.length; i < l; i++) { 5040 callback.call(scope, arr[i], i); 5041 } 5042} 5043 5044/***/ }), 5045
vendor: 600 bytes, lines 5046-5061
5046/***/ "./node_modules/tiny-slider/src/helpers/getAttr.js": 5047/*!*********************************************************!*\ 5048 !*** ./node_modules/tiny-slider/src/helpers/getAttr.js ***! 5049 \*********************************************************/ 5050/*! exports provided: getAttr */ 5051/***/ (function(module, __webpack_exports__, __webpack_require__) { 5052 5053"use strict"; 5054__webpack_require__.r(__webpack_exports__); 5055/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAttr", function() { return getAttr; }); 5056function getAttr(el, attr) { 5057 return el.getAttribute(attr); 5058} 5059 5060/***/ }), 5061
vendor: 702 bytes, lines 5062-5085
5062/***/ "./node_modules/tiny-slider/src/helpers/getBody.js": 5063/*!*********************************************************!*\ 5064 !*** ./node_modules/tiny-slider/src/helpers/getBody.js ***! 5065 \*********************************************************/ 5066/*! exports provided: getBody */ 5067/***/ (function(module, __webpack_exports__, __webpack_require__) { 5068 5069"use strict"; 5070__webpack_require__.r(__webpack_exports__); 5071/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBody", function() { return getBody; }); 5072function getBody () { 5073 var doc = document, 5074 body = doc.body; 5075 5076 if (!body) { 5077 body = doc.createElement('body'); 5078 body.fake = true; 5079 } 5080 5081 return body; 5082} 5083 5084/***/ }), 5085
vendor: 736 bytes, lines 5086-5102
5086/***/ "./node_modules/tiny-slider/src/helpers/getCssRulesLength.js": 5087/*!*******************************************************************!*\ 5088 !*** ./node_modules/tiny-slider/src/helpers/getCssRulesLength.js ***! 5089 \*******************************************************************/ 5090/*! exports provided: getCssRulesLength */ 5091/***/ (function(module, __webpack_exports__, __webpack_require__) { 5092 5093"use strict"; 5094__webpack_require__.r(__webpack_exports__); 5095/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCssRulesLength", function() { return getCssRulesLength; }); 5096function getCssRulesLength(sheet) { 5097 var rule = ('insertRule' in sheet) ? sheet.cssRules : sheet.rules; 5098 return rule.length; 5099} 5100 5101/***/ }), 5102
vendor: 1,105 bytes, lines 5103-5130
5103/***/ "./node_modules/tiny-slider/src/helpers/getEndProperty.js": 5104/*!****************************************************************!*\ 5105 !*** ./node_modules/tiny-slider/src/helpers/getEndProperty.js ***! 5106 \****************************************************************/ 5107/*! exports provided: getEndProperty */ 5108/***/ (function(module, __webpack_exports__, __webpack_require__) { 5109 5110"use strict"; 5111__webpack_require__.r(__webpack_exports__); 5112/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEndProperty", function() { return getEndProperty; }); 5113// get transitionend, animationend based on transitionDuration 5114// @propin: string 5115// @propOut: string, first-letter uppercase 5116// Usage: getEndProperty('WebkitTransitionDuration', 'Transition') => webkitTransitionEnd 5117function getEndProperty(propIn, propOut) { 5118 var endProp = false; 5119 if (/^Webkit/.test(propIn)) { 5120 endProp = 'webkit' + propOut + 'End'; 5121 } else if (/^O/.test(propIn)) { 5122 endProp = 'o' + propOut + 'End'; 5123 } else if (propIn) { 5124 endProp = propOut.toLowerCase() + 'end'; 5125 } 5126 return endProp; 5127} 5128 5129/***/ }), 5130
vendor: 678 bytes, lines 5131-5149
5131/***/ "./node_modules/tiny-slider/src/helpers/getSlideId.js": 5132/*!************************************************************!*\ 5133 !*** ./node_modules/tiny-slider/src/helpers/getSlideId.js ***! 5134 \************************************************************/ 5135/*! exports provided: getSlideId */ 5136/***/ (function(module, __webpack_exports__, __webpack_require__) { 5137 5138"use strict"; 5139__webpack_require__.r(__webpack_exports__); 5140/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSlideId", function() { return getSlideId; }); 5141function getSlideId() { 5142 var id = window.tnsId; 5143 window.tnsId = !id ? 1 : id + 1; 5144 5145 return 'tns' + window.tnsId; 5146} 5147 5148/***/ }), 5149
vendor: 867 bytes, lines 5150-5174
5150/***/ "./node_modules/tiny-slider/src/helpers/getTouchDirection.js": 5151/*!*******************************************************************!*\ 5152 !*** ./node_modules/tiny-slider/src/helpers/getTouchDirection.js ***! 5153 \*******************************************************************/ 5154/*! exports provided: getTouchDirection */ 5155/***/ (function(module, __webpack_exports__, __webpack_require__) { 5156 5157"use strict"; 5158__webpack_require__.r(__webpack_exports__); 5159/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTouchDirection", function() { return getTouchDirection; }); 5160function getTouchDirection(angle, range) { 5161 var direction = false, 5162 gap = Math.abs(90 - Math.abs(angle)); 5163 5164 if (gap >= 90 - range) { 5165 direction = 'horizontal'; 5166 } else if (gap <= range) { 5167 direction = 'vertical'; 5168 } 5169 5170 return direction; 5171} 5172 5173/***/ }), 5174
vendor: 1,957 bytes, lines 5175-5218
5175/***/ "./node_modules/tiny-slider/src/helpers/has3DTransforms.js": 5176/*!*****************************************************************!*\ 5177 !*** ./node_modules/tiny-slider/src/helpers/has3DTransforms.js ***! 5178 \*****************************************************************/ 5179/*! exports provided: has3DTransforms */ 5180/***/ (function(module, __webpack_exports__, __webpack_require__) { 5181 5182"use strict"; 5183__webpack_require__.r(__webpack_exports__); 5184/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "has3DTransforms", function() { return has3DTransforms; }); 5185/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 5186/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 5187/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 5188 5189 5190 5191 5192function has3DTransforms(tf){ 5193 if (!tf) { return false; } 5194 if (!window.getComputedStyle) { return false; } 5195 5196 var doc = document, 5197 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 5198 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 5199 el = doc.createElement('p'), 5200 has3d, 5201 cssTF = tf.length > 9 ? '-' + tf.slice(0, -9).toLowerCase() + '-' : ''; 5202 5203 cssTF += 'transform'; 5204 5205 // Add it to the body to get the computed style 5206 body.insertBefore(el, null); 5207 5208 el.style[tf] = 'translate3d(1px,1px,1px)'; 5209 has3d = window.getComputedStyle(el).getPropertyValue(cssTF); 5210 5211 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : el.remove(); 5212 5213 return (has3d !== undefined && has3d.length > 0 && has3d !== "none"); 5214} 5215 5216 5217/***/ }), 5218
vendor: 600 bytes, lines 5219-5234
5219/***/ "./node_modules/tiny-slider/src/helpers/hasAttr.js": 5220/*!*********************************************************!*\ 5221 !*** ./node_modules/tiny-slider/src/helpers/hasAttr.js ***! 5222 \*********************************************************/ 5223/*! exports provided: hasAttr */ 5224/***/ (function(module, __webpack_exports__, __webpack_require__) { 5225 5226"use strict"; 5227__webpack_require__.r(__webpack_exports__); 5228/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasAttr", function() { return hasAttr; }); 5229function hasAttr(el, attr) { 5230 return el.hasAttribute(attr); 5231} 5232 5233/***/ }), 5234
vendor: 1,162 bytes, lines 5235-5257
5235/***/ "./node_modules/tiny-slider/src/helpers/hasClass.js": 5236/*!**********************************************************!*\ 5237 !*** ./node_modules/tiny-slider/src/helpers/hasClass.js ***! 5238 \**********************************************************/ 5239/*! exports provided: classListSupport, hasClass */ 5240/***/ (function(module, __webpack_exports__, __webpack_require__) { 5241 5242"use strict"; 5243__webpack_require__.r(__webpack_exports__); 5244/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasClass", function() { return hasClass; }); 5245/* harmony import */ var _classListSupport_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classListSupport.js */ "./node_modules/tiny-slider/src/helpers/classListSupport.js"); 5246/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "classListSupport", function() { return _classListSupport_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"]; }); 5247 5248 5249 5250var hasClass = _classListSupport_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"] ? 5251 function (el, str) { return el.classList.contains(str); } : 5252 function (el, str) { return el.className.indexOf(str) >= 0; }; 5253 5254 5255 5256/***/ }), 5257
vendor: 671 bytes, lines 5258-5273
5258/***/ "./node_modules/tiny-slider/src/helpers/hideElement.js": 5259/*!*************************************************************!*\ 5260 !*** ./node_modules/tiny-slider/src/helpers/hideElement.js ***! 5261 \*************************************************************/ 5262/*! exports provided: hideElement */ 5263/***/ (function(module, __webpack_exports__, __webpack_require__) { 5264 5265"use strict"; 5266__webpack_require__.r(__webpack_exports__); 5267/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hideElement", function() { return hideElement; }); 5268function hideElement(el, forceHide) { 5269 if (el.style.display !== 'none') { el.style.display = 'none'; } 5270} 5271 5272/***/ }), 5273
vendor: 673 bytes, lines 5274-5290
5274/***/ "./node_modules/tiny-slider/src/helpers/isNodeList.js": 5275/*!************************************************************!*\ 5276 !*** ./node_modules/tiny-slider/src/helpers/isNodeList.js ***! 5277 \************************************************************/ 5278/*! exports provided: isNodeList */ 5279/***/ (function(module, __webpack_exports__, __webpack_require__) { 5280 5281"use strict"; 5282__webpack_require__.r(__webpack_exports__); 5283/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNodeList", function() { return isNodeList; }); 5284function isNodeList(el) { 5285 // Only NodeList has the "item()" function 5286 return typeof el.item !== "undefined"; 5287} 5288 5289/***/ }), 5290
vendor: 635 bytes, lines 5291-5306
5291/***/ "./node_modules/tiny-slider/src/helpers/isVisible.js": 5292/*!***********************************************************!*\ 5293 !*** ./node_modules/tiny-slider/src/helpers/isVisible.js ***! 5294 \***********************************************************/ 5295/*! exports provided: isVisible */ 5296/***/ (function(module, __webpack_exports__, __webpack_require__) { 5297 5298"use strict"; 5299__webpack_require__.r(__webpack_exports__); 5300/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isVisible", function() { return isVisible; }); 5301function isVisible(el) { 5302 return window.getComputedStyle(el).display !== 'none'; 5303} 5304 5305/***/ }), 5306
vendor: 1,205 bytes, lines 5307-5339
5307/***/ "./node_modules/tiny-slider/src/helpers/jsTransform.js": 5308/*!*************************************************************!*\ 5309 !*** ./node_modules/tiny-slider/src/helpers/jsTransform.js ***! 5310 \*************************************************************/ 5311/*! exports provided: jsTransform */ 5312/***/ (function(module, __webpack_exports__, __webpack_require__) { 5313 5314"use strict"; 5315__webpack_require__.r(__webpack_exports__); 5316/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jsTransform", function() { return jsTransform; }); 5317function jsTransform(element, attr, prefix, postfix, to, duration, callback) { 5318 var tick = Math.min(duration, 10), 5319 unit = (to.indexOf('%') >= 0) ? '%' : 'px', 5320 to = to.replace(unit, ''), 5321 from = Number(element.style[attr].replace(prefix, '').replace(postfix, '').replace(unit, '')), 5322 positionTick = (to - from) / duration * tick, 5323 running; 5324 5325 setTimeout(moveElement, tick); 5326 function moveElement() { 5327 duration -= tick; 5328 from += positionTick; 5329 element.style[attr] = prefix + from + unit + postfix; 5330 if (duration > 0) { 5331 setTimeout(moveElement, tick); 5332 } else { 5333 callback(); 5334 } 5335 } 5336} 5337 5338/***/ }), 5339
vendor: 2,114 bytes, lines 5340-5391
5340/***/ "./node_modules/tiny-slider/src/helpers/mediaquerySupport.js": 5341/*!*******************************************************************!*\ 5342 !*** ./node_modules/tiny-slider/src/helpers/mediaquerySupport.js ***! 5343 \*******************************************************************/ 5344/*! exports provided: mediaquerySupport */ 5345/***/ (function(module, __webpack_exports__, __webpack_require__) { 5346 5347"use strict"; 5348__webpack_require__.r(__webpack_exports__); 5349/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mediaquerySupport", function() { return mediaquerySupport; }); 5350/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 5351/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 5352/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 5353 5354 5355 5356 5357function mediaquerySupport () { 5358 if (window.matchMedia || window.msMatchMedia) { 5359 return true; 5360 } 5361 5362 var doc = document, 5363 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 5364 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 5365 div = doc.createElement('div'), 5366 style = doc.createElement('style'), 5367 rule = '@media all and (min-width:1px){.tns-mq-test{position:absolute}}', 5368 position; 5369 5370 style.type = 'text/css'; 5371 div.className = 'tns-mq-test'; 5372 5373 body.appendChild(style); 5374 body.appendChild(div); 5375 5376 if (style.styleSheet) { 5377 style.styleSheet.cssText = rule; 5378 } else { 5379 style.appendChild(doc.createTextNode(rule)); 5380 } 5381 5382 position = window.getComputedStyle ? window.getComputedStyle(div).position : div.currentStyle['position']; 5383 5384 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : div.remove(); 5385 5386 return position === "absolute"; 5387} 5388 5389 5390/***/ }), 5391
vendor: 943 bytes, lines 5392-5415
5392/***/ "./node_modules/tiny-slider/src/helpers/passiveOption.js": 5393/*!***************************************************************!*\ 5394 !*** ./node_modules/tiny-slider/src/helpers/passiveOption.js ***! 5395 \***************************************************************/ 5396/*! exports provided: passiveOption */ 5397/***/ (function(module, __webpack_exports__, __webpack_require__) { 5398 5399"use strict"; 5400__webpack_require__.r(__webpack_exports__); 5401/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "passiveOption", function() { return passiveOption; }); 5402// Test via a getter in the options object to see if the passive property is accessed 5403var supportsPassive = false; 5404try { 5405 var opts = Object.defineProperty({}, 'passive', { 5406 get: function() { 5407 supportsPassive = true; 5408 } 5409 }); 5410 window.addEventListener("test", null, opts); 5411} catch (e) {} 5412var passiveOption = supportsPassive ? { passive: true } : false; 5413 5414/***/ }), 5415
vendor: 2,093 bytes, lines 5416-5466
5416/***/ "./node_modules/tiny-slider/src/helpers/percentageLayout.js": 5417/*!******************************************************************!*\ 5418 !*** ./node_modules/tiny-slider/src/helpers/percentageLayout.js ***! 5419 \******************************************************************/ 5420/*! exports provided: percentageLayout */ 5421/***/ (function(module, __webpack_exports__, __webpack_require__) { 5422 5423"use strict"; 5424__webpack_require__.r(__webpack_exports__); 5425/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "percentageLayout", function() { return percentageLayout; }); 5426/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 5427/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 5428/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 5429// get subpixel support value 5430// @return - boolean 5431 5432 5433 5434 5435function percentageLayout() { 5436 // check subpixel layout supporting 5437 var doc = document, 5438 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 5439 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 5440 wrapper = doc.createElement('div'), 5441 outer = doc.createElement('div'), 5442 str = '', 5443 count = 70, 5444 perPage = 3, 5445 supported = false; 5446 5447 wrapper.className = "tns-t-subp2"; 5448 outer.className = "tns-t-ct"; 5449 5450 for (var i = 0; i < count; i++) { 5451 str += '<div></div>'; 5452 } 5453 5454 outer.innerHTML = str; 5455 wrapper.appendChild(outer); 5456 body.appendChild(wrapper); 5457 5458 supported = Math.abs(wrapper.getBoundingClientRect().left - outer.children[count - perPage].getBoundingClientRect().left) < 2; 5459 5460 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : wrapper.remove(); 5461 5462 return supported; 5463} 5464 5465/***/ }), 5466
vendor: 719 bytes, lines 5467-5487
5467/***/ "./node_modules/tiny-slider/src/helpers/raf.js": 5468/*!*****************************************************!*\ 5469 !*** ./node_modules/tiny-slider/src/helpers/raf.js ***! 5470 \*****************************************************/ 5471/*! exports provided: raf */ 5472/***/ (function(module, __webpack_exports__, __webpack_require__) { 5473 5474"use strict"; 5475__webpack_require__.r(__webpack_exports__); 5476/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "raf", function() { return raf; }); 5477var win = window; 5478 5479var raf = win.requestAnimationFrame 5480 || win.webkitRequestAnimationFrame 5481 || win.mozRequestAnimationFrame 5482 || win.msRequestAnimationFrame 5483 || function(cb) { return setTimeout(cb, 16); }; 5484 5485 5486/***/ }), 5487
vendor: 1,105 bytes, lines 5488-5514
5488/***/ "./node_modules/tiny-slider/src/helpers/removeAttrs.js": 5489/*!*************************************************************!*\ 5490 !*** ./node_modules/tiny-slider/src/helpers/removeAttrs.js ***! 5491 \*************************************************************/ 5492/*! exports provided: removeAttrs */ 5493/***/ (function(module, __webpack_exports__, __webpack_require__) { 5494 5495"use strict"; 5496__webpack_require__.r(__webpack_exports__); 5497/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAttrs", function() { return removeAttrs; }); 5498/* harmony import */ var _isNodeList_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isNodeList.js */ "./node_modules/tiny-slider/src/helpers/isNodeList.js"); 5499 5500 5501function removeAttrs(els, attrs) { 5502 els = (Object(_isNodeList_js__WEBPACK_IMPORTED_MODULE_0__["isNodeList"])(els) || els instanceof Array) ? els : [els]; 5503 attrs = (attrs instanceof Array) ? attrs : [attrs]; 5504 5505 var attrLength = attrs.length; 5506 for (var i = els.length; i--;) { 5507 for (var j = attrLength; j--;) { 5508 els[i].removeAttribute(attrs[j]); 5509 } 5510 } 5511} 5512 5513/***/ }), 5514
vendor: 933 bytes, lines 5515-5537
5515/***/ "./node_modules/tiny-slider/src/helpers/removeCSSRule.js": 5516/*!***************************************************************!*\ 5517 !*** ./node_modules/tiny-slider/src/helpers/removeCSSRule.js ***! 5518 \***************************************************************/ 5519/*! exports provided: removeCSSRule */ 5520/***/ (function(module, __webpack_exports__, __webpack_require__) { 5521 5522"use strict"; 5523__webpack_require__.r(__webpack_exports__); 5524/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCSSRule", function() { return removeCSSRule; }); 5525/* harmony import */ var _raf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./raf.js */ "./node_modules/tiny-slider/src/helpers/raf.js"); 5526// cross browsers addRule method 5527 5528function removeCSSRule(sheet, index) { 5529 // return raf(function() { 5530 'deleteRule' in sheet ? 5531 sheet.deleteRule(index) : 5532 sheet.removeRule(index); 5533 // }); 5534} 5535 5536/***/ }), 5537
vendor: 1,125 bytes, lines 5538-5561
5538/***/ "./node_modules/tiny-slider/src/helpers/removeClass.js": 5539/*!*************************************************************!*\ 5540 !*** ./node_modules/tiny-slider/src/helpers/removeClass.js ***! 5541 \*************************************************************/ 5542/*! exports provided: removeClass */ 5543/***/ (function(module, __webpack_exports__, __webpack_require__) { 5544 5545"use strict"; 5546__webpack_require__.r(__webpack_exports__); 5547/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeClass", function() { return removeClass; }); 5548/* harmony import */ var _hasClass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hasClass.js */ "./node_modules/tiny-slider/src/helpers/hasClass.js"); 5549 5550var removeClass = _hasClass_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"] ? 5551 function (el, str) { 5552 if (Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.classList.remove(str); } 5553 } : 5554 function (el, str) { 5555 if (Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.className = el.className.replace(str, ''); } 5556 }; 5557 5558 5559 5560/***/ }), 5561
vendor: 1,011 bytes, lines 5562-5583
5562/***/ "./node_modules/tiny-slider/src/helpers/removeEvents.js": 5563/*!**************************************************************!*\ 5564 !*** ./node_modules/tiny-slider/src/helpers/removeEvents.js ***! 5565 \**************************************************************/ 5566/*! exports provided: removeEvents */ 5567/***/ (function(module, __webpack_exports__, __webpack_require__) { 5568 5569"use strict"; 5570__webpack_require__.r(__webpack_exports__); 5571/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEvents", function() { return removeEvents; }); 5572/* harmony import */ var _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./passiveOption.js */ "./node_modules/tiny-slider/src/helpers/passiveOption.js"); 5573 5574 5575function removeEvents(el, obj) { 5576 for (var prop in obj) { 5577 var option = ['touchstart', 'touchmove'].indexOf(prop) >= 0 ? _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__["passiveOption"] : false; 5578 el.removeEventListener(prop, obj[prop], option); 5579 } 5580} 5581 5582/***/ }), 5583
vendor: 1,108 bytes, lines 5584-5608
5584/***/ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js": 5585/*!***************************************************************!*\ 5586 !*** ./node_modules/tiny-slider/src/helpers/resetFakeBody.js ***! 5587 \***************************************************************/ 5588/*! exports provided: resetFakeBody */ 5589/***/ (function(module, __webpack_exports__, __webpack_require__) { 5590 5591"use strict"; 5592__webpack_require__.r(__webpack_exports__); 5593/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resetFakeBody", function() { return resetFakeBody; }); 5594/* harmony import */ var _docElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./docElement.js */ "./node_modules/tiny-slider/src/helpers/docElement.js"); 5595 5596 5597function resetFakeBody (body, docOverflow) { 5598 if (body.fake) { 5599 body.remove(); 5600 _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].style.overflow = docOverflow; 5601 // Trigger layout so kinetic scrolling isn't disabled in iOS6+ 5602 // eslint-disable-next-line 5603 _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].offsetHeight; 5604 } 5605} 5606 5607/***/ }), 5608
vendor: 1,068 bytes, lines 5609-5634
5609/***/ "./node_modules/tiny-slider/src/helpers/setAttrs.js": 5610/*!**********************************************************!*\ 5611 !*** ./node_modules/tiny-slider/src/helpers/setAttrs.js ***! 5612 \**********************************************************/ 5613/*! exports provided: setAttrs */ 5614/***/ (function(module, __webpack_exports__, __webpack_require__) { 5615 5616"use strict"; 5617__webpack_require__.r(__webpack_exports__); 5618/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAttrs", function() { return setAttrs; }); 5619/* harmony import */ var _isNodeList_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isNodeList.js */ "./node_modules/tiny-slider/src/helpers/isNodeList.js"); 5620 5621 5622function setAttrs(els, attrs) { 5623 els = (Object(_isNodeList_js__WEBPACK_IMPORTED_MODULE_0__["isNodeList"])(els) || els instanceof Array) ? els : [els]; 5624 if (Object.prototype.toString.call(attrs) !== '[object Object]') { return; } 5625 5626 for (var i = els.length; i--;) { 5627 for(var key in attrs) { 5628 els[i].setAttribute(key, attrs[key]); 5629 } 5630 } 5631} 5632 5633/***/ }), 5634
vendor: 1,310 bytes, lines 5635-5663
5635/***/ "./node_modules/tiny-slider/src/helpers/setFakeBody.js": 5636/*!*************************************************************!*\ 5637 !*** ./node_modules/tiny-slider/src/helpers/setFakeBody.js ***! 5638 \*************************************************************/ 5639/*! exports provided: setFakeBody */ 5640/***/ (function(module, __webpack_exports__, __webpack_require__) { 5641 5642"use strict"; 5643__webpack_require__.r(__webpack_exports__); 5644/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setFakeBody", function() { return setFakeBody; }); 5645/* harmony import */ var _docElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./docElement.js */ "./node_modules/tiny-slider/src/helpers/docElement.js"); 5646 5647 5648function setFakeBody (body) { 5649 var docOverflow = ''; 5650 if (body.fake) { 5651 docOverflow = _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].style.overflow; 5652 //avoid crashing IE8, if background image is used 5653 body.style.background = ''; 5654 //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible 5655 body.style.overflow = _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].style.overflow = 'hidden'; 5656 _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].appendChild(body); 5657 } 5658 5659 return docOverflow; 5660} 5661 5662/***/ }), 5663
vendor: 741 bytes, lines 5664-5682
5664/***/ "./node_modules/tiny-slider/src/helpers/setLocalStorage.js": 5665/*!*****************************************************************!*\ 5666 !*** ./node_modules/tiny-slider/src/helpers/setLocalStorage.js ***! 5667 \*****************************************************************/ 5668/*! exports provided: setLocalStorage */ 5669/***/ (function(module, __webpack_exports__, __webpack_require__) { 5670 5671"use strict"; 5672__webpack_require__.r(__webpack_exports__); 5673/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLocalStorage", function() { return setLocalStorage; }); 5674function setLocalStorage(storage, key, value, access) { 5675 if (access) { 5676 try { storage.setItem(key, value); } catch (e) {} 5677 } 5678 return value; 5679} 5680 5681/***/ }), 5682
vendor: 667 bytes, lines 5683-5698
5683/***/ "./node_modules/tiny-slider/src/helpers/showElement.js": 5684/*!*************************************************************!*\ 5685 !*** ./node_modules/tiny-slider/src/helpers/showElement.js ***! 5686 \*************************************************************/ 5687/*! exports provided: showElement */ 5688/***/ (function(module, __webpack_exports__, __webpack_require__) { 5689 5690"use strict"; 5691__webpack_require__.r(__webpack_exports__); 5692/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showElement", function() { return showElement; }); 5693function showElement(el, forceHide) { 5694 if (el.style.display === 'none') { el.style.display = ''; } 5695} 5696 5697/***/ }), 5698
vendor: 618 bytes, lines 5699-5714
5699/***/ "./node_modules/tiny-slider/src/helpers/toDegree.js": 5700/*!**********************************************************!*\ 5701 !*** ./node_modules/tiny-slider/src/helpers/toDegree.js ***! 5702 \**********************************************************/ 5703/*! exports provided: toDegree */ 5704/***/ (function(module, __webpack_exports__, __webpack_require__) { 5705 5706"use strict"; 5707__webpack_require__.r(__webpack_exports__); 5708/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDegree", function() { return toDegree; }); 5709function toDegree (y, x) { 5710 return Math.atan2(y, x) * (180 / Math.PI); 5711} 5712 5713/***/ }), 5714
vendor: 1,200 bytes, lines 5715-5752
5715/***/ "./node_modules/tiny-slider/src/helpers/whichProperty.js": 5716/*!***************************************************************!*\ 5717 !*** ./node_modules/tiny-slider/src/helpers/whichProperty.js ***! 5718 \***************************************************************/ 5719/*! exports provided: whichProperty */ 5720/***/ (function(module, __webpack_exports__, __webpack_require__) { 5721 5722"use strict"; 5723__webpack_require__.r(__webpack_exports__); 5724/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "whichProperty", function() { return whichProperty; }); 5725function whichProperty(props){ 5726 if (typeof props === 'string') { 5727 var arr = [props], 5728 Props = props.charAt(0).toUpperCase() + props.substr(1), 5729 prefixes = ['Webkit', 'Moz', 'ms', 'O']; 5730 5731 prefixes.forEach(function(prefix) { 5732 if (prefix !== 'ms' || props === 'transform') { 5733 arr.push(prefix + Props); 5734 } 5735 }); 5736 5737 props = arr; 5738 } 5739 5740 var el = document.createElement('fakeelement'), 5741 len = props.length; 5742 for(var i = 0; i < props.length; i++){ 5743 var prop = props[i]; 5744 if( el.style[prop] !== undefined ){ return prop; } 5745 } 5746 5747 return false; // explicit for ie9- 5748} 5749 5750 5751/***/ }), 5752
vendor: 109,421 bytes, lines 5753-8566
5753/***/ "./node_modules/tiny-slider/src/tiny-slider.js": 5754/*!*****************************************************!*\ 5755 !*** ./node_modules/tiny-slider/src/tiny-slider.js ***! 5756 \*****************************************************/ 5757/*! exports provided: tns */ 5758/***/ (function(module, __webpack_exports__, __webpack_require__) { 5759 5760"use strict"; 5761__webpack_require__.r(__webpack_exports__); 5762/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tns", function() { return tns; }); 5763/* harmony import */ var _helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/raf.js */ "./node_modules/tiny-slider/src/helpers/raf.js"); 5764/* harmony import */ var _helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/caf.js */ "./node_modules/tiny-slider/src/helpers/caf.js"); 5765/* harmony import */ var _helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers/extend.js */ "./node_modules/tiny-slider/src/helpers/extend.js"); 5766/* harmony import */ var _helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers/checkStorageValue.js */ "./node_modules/tiny-slider/src/helpers/checkStorageValue.js"); 5767/* harmony import */ var _helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers/setLocalStorage.js */ "./node_modules/tiny-slider/src/helpers/setLocalStorage.js"); 5768/* harmony import */ var _helpers_getSlideId_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers/getSlideId.js */ "./node_modules/tiny-slider/src/helpers/getSlideId.js"); 5769/* harmony import */ var _helpers_calc_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers/calc.js */ "./node_modules/tiny-slider/src/helpers/calc.js"); 5770/* harmony import */ var _helpers_percentageLayout_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers/percentageLayout.js */ "./node_modules/tiny-slider/src/helpers/percentageLayout.js"); 5771/* harmony import */ var _helpers_mediaquerySupport_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers/mediaquerySupport.js */ "./node_modules/tiny-slider/src/helpers/mediaquerySupport.js"); 5772/* harmony import */ var _helpers_createStyleSheet_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/createStyleSheet.js */ "./node_modules/tiny-slider/src/helpers/createStyleSheet.js"); 5773/* harmony import */ var _helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./helpers/addCSSRule.js */ "./node_modules/tiny-slider/src/helpers/addCSSRule.js"); 5774/* harmony import */ var _helpers_removeCSSRule_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers/removeCSSRule.js */ "./node_modules/tiny-slider/src/helpers/removeCSSRule.js"); 5775/* harmony import */ var _helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./helpers/getCssRulesLength.js */ "./node_modules/tiny-slider/src/helpers/getCssRulesLength.js"); 5776/* harmony import */ var _helpers_toDegree_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./helpers/toDegree.js */ "./node_modules/tiny-slider/src/helpers/toDegree.js"); 5777/* harmony import */ var _helpers_getTouchDirection_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./helpers/getTouchDirection.js */ "./node_modules/tiny-slider/src/helpers/getTouchDirection.js"); 5778/* harmony import */ var _helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./helpers/forEach.js */ "./node_modules/tiny-slider/src/helpers/forEach.js"); 5779/* harmony import */ var _helpers_hasClass_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./helpers/hasClass.js */ "./node_modules/tiny-slider/src/helpers/hasClass.js"); 5780/* harmony import */ var _helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./helpers/addClass.js */ "./node_modules/tiny-slider/src/helpers/addClass.js"); 5781/* harmony import */ var _helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./helpers/removeClass.js */ "./node_modules/tiny-slider/src/helpers/removeClass.js"); 5782/* harmony import */ var _helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./helpers/hasAttr.js */ "./node_modules/tiny-slider/src/helpers/hasAttr.js"); 5783/* harmony import */ var _helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./helpers/getAttr.js */ "./node_modules/tiny-slider/src/helpers/getAttr.js"); 5784/* harmony import */ var _helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./helpers/setAttrs.js */ "./node_modules/tiny-slider/src/helpers/setAttrs.js"); 5785/* harmony import */ var _helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./helpers/removeAttrs.js */ "./node_modules/tiny-slider/src/helpers/removeAttrs.js"); 5786/* harmony import */ var _helpers_arrayFromNodeList_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./helpers/arrayFromNodeList.js */ "./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js"); 5787/* harmony import */ var _helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./helpers/hideElement.js */ "./node_modules/tiny-slider/src/helpers/hideElement.js"); 5788/* harmony import */ var _helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./helpers/showElement.js */ "./node_modules/tiny-slider/src/helpers/showElement.js"); 5789/* harmony import */ var _helpers_isVisible_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./helpers/isVisible.js */ "./node_modules/tiny-slider/src/helpers/isVisible.js"); 5790/* harmony import */ var _helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./helpers/whichProperty.js */ "./node_modules/tiny-slider/src/helpers/whichProperty.js"); 5791/* harmony import */ var _helpers_has3DTransforms_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./helpers/has3DTransforms.js */ "./node_modules/tiny-slider/src/helpers/has3DTransforms.js"); 5792/* harmony import */ var _helpers_getEndProperty_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./helpers/getEndProperty.js */ "./node_modules/tiny-slider/src/helpers/getEndProperty.js"); 5793/* harmony import */ var _helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./helpers/addEvents.js */ "./node_modules/tiny-slider/src/helpers/addEvents.js"); 5794/* harmony import */ var _helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./helpers/removeEvents.js */ "./node_modules/tiny-slider/src/helpers/removeEvents.js"); 5795/* harmony import */ var _helpers_events_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./helpers/events.js */ "./node_modules/tiny-slider/src/helpers/events.js"); 5796/* harmony import */ var _helpers_jsTransform_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./helpers/jsTransform.js */ "./node_modules/tiny-slider/src/helpers/jsTransform.js"); 5797// Object.keys 5798if (!Object.keys) { 5799 Object.keys = function(object) { 5800 var keys = []; 5801 for (var name in object) { 5802 if (Object.prototype.hasOwnProperty.call(object, name)) { 5803 keys.push(name); 5804 } 5805 } 5806 return keys; 5807 }; 5808} 5809 5810// ChildNode.remove 5811if(!("remove" in Element.prototype)){ 5812 Element.prototype.remove = function(){ 5813 if(this.parentNode) { 5814 this.parentNode.removeChild(this); 5815 } 5816 }; 5817} 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854var tns = function(options) { 5855 options = Object(_helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__["extend"])({ 5856 container: '.slider', 5857 mode: 'carousel', 5858 axis: 'horizontal', 5859 items: 1, 5860 gutter: 0, 5861 edgePadding: 0, 5862 fixedWidth: false, 5863 autoWidth: false, 5864 viewportMax: false, 5865 slideBy: 1, 5866 center: false, 5867 controls: true, 5868 controlsPosition: 'top', 5869 controlsText: ['prev', 'next'], 5870 controlsContainer: false, 5871 prevButton: false, 5872 nextButton: false, 5873 nav: true, 5874 navPosition: 'top', 5875 navContainer: false, 5876 navAsThumbnails: false, 5877 arrowKeys: false, 5878 speed: 300, 5879 autoplay: false, 5880 autoplayPosition: 'top', 5881 autoplayTimeout: 5000, 5882 autoplayDirection: 'forward', 5883 autoplayText: ['start', 'stop'], 5884 autoplayHoverPause: false, 5885 autoplayButton: false, 5886 autoplayButtonOutput: true, 5887 autoplayResetOnVisibility: true, 5888 animateIn: 'tns-fadeIn', 5889 animateOut: 'tns-fadeOut', 5890 animateNormal: 'tns-normal', 5891 animateDelay: false, 5892 loop: true, 5893 rewind: false, 5894 autoHeight: false, 5895 responsive: false, 5896 lazyload: false, 5897 lazyloadSelector: '.tns-lazy-img', 5898 touch: true, 5899 mouseDrag: false, 5900 swipeAngle: 15, 5901 nested: false, 5902 preventActionWhenRunning: false, 5903 preventScrollOnTouch: false, 5904 freezable: true, 5905 onInit: false, 5906 useLocalStorage: true, 5907 nonce: false 5908 }, options || {}); 5909 5910 var doc = document, 5911 win = window, 5912 KEYS = { 5913 ENTER: 13, 5914 SPACE: 32, 5915 LEFT: 37, 5916 RIGHT: 39 5917 }, 5918 tnsStorage = {}, 5919 localStorageAccess = options.useLocalStorage; 5920 5921 if (localStorageAccess) { 5922 // check browser version and local storage access 5923 var browserInfo = navigator.userAgent; 5924 var uid = new Date; 5925 5926 try { 5927 tnsStorage = win.localStorage; 5928 if (tnsStorage) { 5929 tnsStorage.setItem(uid, uid); 5930 localStorageAccess = tnsStorage.getItem(uid) == uid; 5931 tnsStorage.removeItem(uid); 5932 } else { 5933 localStorageAccess = false; 5934 } 5935 if (!localStorageAccess) { tnsStorage = {}; } 5936 } catch(e) { 5937 localStorageAccess = false; 5938 } 5939 5940 if (localStorageAccess) { 5941 // remove storage when browser version changes 5942 if (tnsStorage['tnsApp'] && tnsStorage['tnsApp'] !== browserInfo) { 5943 ['tC', 'tPL', 'tMQ', 'tTf', 't3D', 'tTDu', 'tTDe', 'tADu', 'tADe', 'tTE', 'tAE'].forEach(function(item) { tnsStorage.removeItem(item); }); 5944 } 5945 // update browserInfo 5946 localStorage['tnsApp'] = browserInfo; 5947 } 5948 } 5949 5950 var CALC = tnsStorage['tC'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tC']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tC', Object(_helpers_calc_js__WEBPACK_IMPORTED_MODULE_6__["calc"])(), localStorageAccess), 5951 PERCENTAGELAYOUT = tnsStorage['tPL'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tPL']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tPL', Object(_helpers_percentageLayout_js__WEBPACK_IMPORTED_MODULE_7__["percentageLayout"])(), localStorageAccess), 5952 CSSMQ = tnsStorage['tMQ'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tMQ']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tMQ', Object(_helpers_mediaquerySupport_js__WEBPACK_IMPORTED_MODULE_8__["mediaquerySupport"])(), localStorageAccess), 5953 TRANSFORM = tnsStorage['tTf'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTf']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTf', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('transform'), localStorageAccess), 5954 HAS3DTRANSFORMS = tnsStorage['t3D'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['t3D']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 't3D', Object(_helpers_has3DTransforms_js__WEBPACK_IMPORTED_MODULE_28__["has3DTransforms"])(TRANSFORM), localStorageAccess), 5955 TRANSITIONDURATION = tnsStorage['tTDu'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTDu']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTDu', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('transitionDuration'), localStorageAccess), 5956 TRANSITIONDELAY = tnsStorage['tTDe'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTDe']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTDe', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('transitionDelay'), localStorageAccess), 5957 ANIMATIONDURATION = tnsStorage['tADu'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tADu']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tADu', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('animationDuration'), localStorageAccess), 5958 ANIMATIONDELAY = tnsStorage['tADe'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tADe']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tADe', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_27__["whichProperty"])('animationDelay'), localStorageAccess), 5959 TRANSITIONEND = tnsStorage['tTE'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tTE']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tTE', Object(_helpers_getEndProperty_js__WEBPACK_IMPORTED_MODULE_29__["getEndProperty"])(TRANSITIONDURATION, 'Transition'), localStorageAccess), 5960 ANIMATIONEND = tnsStorage['tAE'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_3__["checkStorageValue"])(tnsStorage['tAE']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_4__["setLocalStorage"])(tnsStorage, 'tAE', Object(_helpers_getEndProperty_js__WEBPACK_IMPORTED_MODULE_29__["getEndProperty"])(ANIMATIONDURATION, 'Animation'), localStorageAccess); 5961 5962 // get element nodes from selectors 5963 var supportConsoleWarn = win.console && typeof win.console.warn === "function", 5964 tnsList = ['container', 'controlsContainer', 'prevButton', 'nextButton', 'navContainer', 'autoplayButton'], 5965 optionsElements = {}; 5966 5967 tnsList.forEach(function(item) { 5968 if (typeof options[item] === 'string') { 5969 var str = options[item], 5970 el = doc.querySelector(str); 5971 optionsElements[item] = str; 5972 5973 if (el && el.nodeName) { 5974 options[item] = el; 5975 } else { 5976 if (supportConsoleWarn) { console.warn('Can\'t find', options[item]); } 5977 return; 5978 } 5979 } 5980 }); 5981 5982 // make sure at least 1 slide 5983 if (options.container.children.length < 1) { 5984 if (supportConsoleWarn) { console.warn('No slides found in', options.container); } 5985 return; 5986 } 5987 5988 // update options 5989 var responsive = options.responsive, 5990 nested = options.nested, 5991 carousel = options.mode === 'carousel' ? true : false; 5992 5993 if (responsive) { 5994 // apply responsive[0] to options and remove it 5995 if (0 in responsive) { 5996 options = Object(_helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__["extend"])(options, responsive[0]); 5997 delete responsive[0]; 5998 } 5999 6000 var responsiveTem = {}; 6001 for (var key in responsive) { 6002 var val = responsive[key]; 6003 // update responsive 6004 // from: 300: 2 6005 // to: 6006 // 300: { 6007 // items: 2 6008 // } 6009 val = typeof val === 'number' ? {items: val} : val; 6010 responsiveTem[key] = val; 6011 } 6012 responsive = responsiveTem; 6013 responsiveTem = null; 6014 } 6015 6016 // update options 6017 function updateOptions (obj) { 6018 for (var key in obj) { 6019 if (!carousel) { 6020 if (key === 'slideBy') { obj[key] = 'page'; } 6021 if (key === 'edgePadding') { obj[key] = false; } 6022 if (key === 'autoHeight') { obj[key] = false; } 6023 } 6024 6025 // update responsive options 6026 if (key === 'responsive') { updateOptions(obj[key]); } 6027 } 6028 } 6029 if (!carousel) { updateOptions(options); } 6030 6031 6032 // === define and set variables === 6033 if (!carousel) { 6034 options.axis = 'horizontal'; 6035 options.slideBy = 'page'; 6036 options.edgePadding = false; 6037 6038 var animateIn = options.animateIn, 6039 animateOut = options.animateOut, 6040 animateDelay = options.animateDelay, 6041 animateNormal = options.animateNormal; 6042 } 6043 6044 var horizontal = options.axis === 'horizontal' ? true : false, 6045 outerWrapper = doc.createElement('div'), 6046 innerWrapper = doc.createElement('div'), 6047 middleWrapper, 6048 container = options.container, 6049 containerParent = container.parentNode, 6050 containerHTML = container.outerHTML, 6051 slideItems = container.children, 6052 slideCount = slideItems.length, 6053 breakpointZone, 6054 windowWidth = getWindowWidth(), 6055 isOn = false; 6056 if (responsive) { setBreakpointZone(); } 6057 if (carousel) { container.className += ' tns-vpfix'; } 6058 6059 // fixedWidth: viewport > rightBoundary > indexMax 6060 var autoWidth = options.autoWidth, 6061 fixedWidth = getOption('fixedWidth'), 6062 edgePadding = getOption('edgePadding'), 6063 gutter = getOption('gutter'), 6064 viewport = getViewportWidth(), 6065 center = getOption('center'), 6066 items = !autoWidth ? Math.floor(getOption('items')) : 1, 6067 slideBy = getOption('slideBy'), 6068 viewportMax = options.viewportMax || options.fixedWidthViewportWidth, 6069 arrowKeys = getOption('arrowKeys'), 6070 speed = getOption('speed'), 6071 rewind = options.rewind, 6072 loop = rewind ? false : options.loop, 6073 autoHeight = getOption('autoHeight'), 6074 controls = getOption('controls'), 6075 controlsText = getOption('controlsText'), 6076 nav = getOption('nav'), 6077 touch = getOption('touch'), 6078 mouseDrag = getOption('mouseDrag'), 6079 autoplay = getOption('autoplay'), 6080 autoplayTimeout = getOption('autoplayTimeout'), 6081 autoplayText = getOption('autoplayText'), 6082 autoplayHoverPause = getOption('autoplayHoverPause'), 6083 autoplayResetOnVisibility = getOption('autoplayResetOnVisibility'), 6084 sheet = Object(_helpers_createStyleSheet_js__WEBPACK_IMPORTED_MODULE_9__["createStyleSheet"])(null, getOption('nonce')), 6085 lazyload = options.lazyload, 6086 lazyloadSelector = options.lazyloadSelector, 6087 slidePositions, // collection of slide positions 6088 slideItemsOut = [], 6089 cloneCount = loop ? getCloneCountForLoop() : 0, 6090 slideCountNew = !carousel ? slideCount + cloneCount : slideCount + cloneCount * 2, 6091 hasRightDeadZone = (fixedWidth || autoWidth) && !loop ? true : false, 6092 rightBoundary = fixedWidth ? getRightBoundary() : null, 6093 updateIndexBeforeTransform = (!carousel || !loop) ? true : false, 6094 // transform 6095 transformAttr = horizontal ? 'left' : 'top', 6096 transformPrefix = '', 6097 transformPostfix = '', 6098 // index 6099 getIndexMax = (function () { 6100 if (fixedWidth) { 6101 return function() { return center && !loop ? slideCount - 1 : Math.ceil(- rightBoundary / (fixedWidth + gutter)); }; 6102 } else if (autoWidth) { 6103 return function() { 6104 for (var i = 0; i < slideCountNew; i++) { 6105 if (slidePositions[i] >= - rightBoundary) { return i; } 6106 } 6107 }; 6108 } else { 6109 return function() { 6110 if (center && carousel && !loop) { 6111 return slideCount - 1; 6112 } else { 6113 return loop || carousel ? Math.max(0, slideCountNew - Math.ceil(items)) : slideCountNew - 1; 6114 } 6115 }; 6116 } 6117 })(), 6118 index = getStartIndex(getOption('startIndex')), 6119 indexCached = index, 6120 displayIndex = getCurrentSlide(), 6121 indexMin = 0, 6122 indexMax = !autoWidth ? getIndexMax() : null, 6123 // resize 6124 resizeTimer, 6125 preventActionWhenRunning = options.preventActionWhenRunning, 6126 swipeAngle = options.swipeAngle, 6127 moveDirectionExpected = swipeAngle ? '?' : true, 6128 running = false, 6129 onInit = options.onInit, 6130 events = new _helpers_events_js__WEBPACK_IMPORTED_MODULE_32__["Events"](), 6131 // id, class 6132 newContainerClasses = ' tns-slider tns-' + options.mode, 6133 slideId = container.id || Object(_helpers_getSlideId_js__WEBPACK_IMPORTED_MODULE_5__["getSlideId"])(), 6134 disable = getOption('disable'), 6135 disabled = false, 6136 freezable = options.freezable, 6137 freeze = freezable && !autoWidth ? getFreeze() : false, 6138 frozen = false, 6139 controlsEvents = { 6140 'click': onControlsClick, 6141 'keydown': onControlsKeydown 6142 }, 6143 navEvents = { 6144 'click': onNavClick, 6145 'keydown': onNavKeydown 6146 }, 6147 hoverEvents = { 6148 'mouseover': mouseoverPause, 6149 'mouseout': mouseoutRestart 6150 }, 6151 visibilityEvent = {'visibilitychange': onVisibilityChange}, 6152 docmentKeydownEvent = {'keydown': onDocumentKeydown}, 6153 touchEvents = { 6154 'touchstart': onPanStart, 6155 'touchmove': onPanMove, 6156 'touchend': onPanEnd, 6157 'touchcancel': onPanEnd 6158 }, dragEvents = { 6159 'mousedown': onPanStart, 6160 'mousemove': onPanMove, 6161 'mouseup': onPanEnd, 6162 'mouseleave': onPanEnd 6163 }, 6164 hasControls = hasOption('controls'), 6165 hasNav = hasOption('nav'), 6166 navAsThumbnails = autoWidth ? true : options.navAsThumbnails, 6167 hasAutoplay = hasOption('autoplay'), 6168 hasTouch = hasOption('touch'), 6169 hasMouseDrag = hasOption('mouseDrag'), 6170 slideActiveClass = 'tns-slide-active', 6171 slideClonedClass = 'tns-slide-cloned', 6172 imgCompleteClass = 'tns-complete', 6173 imgEvents = { 6174 'load': onImgLoaded, 6175 'error': onImgFailed 6176 }, 6177 imgsComplete, 6178 liveregionCurrent, 6179 preventScroll = options.preventScrollOnTouch === 'force' ? true : false; 6180 6181 // controls 6182 if (hasControls) { 6183 var controlsContainer = options.controlsContainer, 6184 controlsContainerHTML = options.controlsContainer ? options.controlsContainer.outerHTML : '', 6185 prevButton = options.prevButton, 6186 nextButton = options.nextButton, 6187 prevButtonHTML = options.prevButton ? options.prevButton.outerHTML : '', 6188 nextButtonHTML = options.nextButton ? options.nextButton.outerHTML : '', 6189 prevIsButton, 6190 nextIsButton; 6191 } 6192 6193 // nav 6194 if (hasNav) { 6195 var navContainer = options.navContainer, 6196 navContainerHTML = options.navContainer ? options.navContainer.outerHTML : '', 6197 navItems, 6198 pages = autoWidth ? slideCount : getPages(), 6199 pagesCached = 0, 6200 navClicked = -1, 6201 navCurrentIndex = getCurrentNavIndex(), 6202 navCurrentIndexCached = navCurrentIndex, 6203 navActiveClass = 'tns-nav-active', 6204 navStr = 'Carousel Page ', 6205 navStrCurrent = ' (Current Slide)'; 6206 } 6207 6208 // autoplay 6209 if (hasAutoplay) { 6210 var autoplayDirection = options.autoplayDirection === 'forward' ? 1 : -1, 6211 autoplayButton = options.autoplayButton, 6212 autoplayButtonHTML = options.autoplayButton ? options.autoplayButton.outerHTML : '', 6213 autoplayHtmlStrings = ['<span class=\'tns-visually-hidden\'>', ' animation</span>'], 6214 autoplayTimer, 6215 animating, 6216 autoplayHoverPaused, 6217 autoplayUserPaused, 6218 autoplayVisibilityPaused; 6219 } 6220 6221 if (hasTouch || hasMouseDrag) { 6222 var initPosition = {}, 6223 lastPosition = {}, 6224 translateInit, 6225 disX, 6226 disY, 6227 panStart = false, 6228 rafIndex, 6229 getDist = horizontal ? 6230 function(a, b) { return a.x - b.x; } : 6231 function(a, b) { return a.y - b.y; }; 6232 } 6233 6234 // disable slider when slidecount <= items 6235 if (!autoWidth) { resetVariblesWhenDisable(disable || freeze); } 6236 6237 if (TRANSFORM) { 6238 transformAttr = TRANSFORM; 6239 transformPrefix = 'translate'; 6240 6241 if (HAS3DTRANSFORMS) { 6242 transformPrefix += horizontal ? '3d(' : '3d(0px, '; 6243 transformPostfix = horizontal ? ', 0px, 0px)' : ', 0px)'; 6244 } else { 6245 transformPrefix += horizontal ? 'X(' : 'Y('; 6246 transformPostfix = ')'; 6247 } 6248 6249 } 6250 6251 if (carousel) { container.className = container.className.replace('tns-vpfix', ''); } 6252 initStructure(); 6253 initSheet(); 6254 initSliderTransform(); 6255 6256 // === COMMON FUNCTIONS === // 6257 function resetVariblesWhenDisable (condition) { 6258 if (condition) { 6259 controls = nav = touch = mouseDrag = arrowKeys = autoplay = autoplayHoverPause = autoplayResetOnVisibility = false; 6260 } 6261 } 6262 6263 function getCurrentSlide () { 6264 var tem = carousel ? index - cloneCount : index; 6265 while (tem < 0) { tem += slideCount; } 6266 return tem%slideCount + 1; 6267 } 6268 6269 function getStartIndex (ind) { 6270 ind = ind ? Math.max(0, Math.min(loop ? slideCount - 1 : slideCount - items, ind)) : 0; 6271 return carousel ? ind + cloneCount : ind; 6272 } 6273 6274 function getAbsIndex (i) { 6275 if (i == null) { i = index; } 6276 6277 if (carousel) { i -= cloneCount; } 6278 while (i < 0) { i += slideCount; } 6279 6280 return Math.floor(i%slideCount); 6281 } 6282 6283 function getCurrentNavIndex () { 6284 var absIndex = getAbsIndex(), 6285 result; 6286 6287 result = navAsThumbnails ? absIndex : 6288 fixedWidth || autoWidth ? Math.ceil((absIndex + 1) * pages / slideCount - 1) : 6289 Math.floor(absIndex / items); 6290 6291 // set active nav to the last one when reaches the right edge 6292 if (!loop && carousel && index === indexMax) { result = pages - 1; } 6293 6294 return result; 6295 } 6296 6297 function getItemsMax () { 6298 // fixedWidth or autoWidth while viewportMax is not available 6299 if (autoWidth || (fixedWidth && !viewportMax)) { 6300 return slideCount - 1; 6301 // most cases 6302 } else { 6303 var str = fixedWidth ? 'fixedWidth' : 'items', 6304 arr = []; 6305 6306 if (fixedWidth || options[str] < slideCount) { arr.push(options[str]); } 6307 6308 if (responsive) { 6309 for (var bp in responsive) { 6310 var tem = responsive[bp][str]; 6311 if (tem && (fixedWidth || tem < slideCount)) { arr.push(tem); } 6312 } 6313 } 6314 6315 if (!arr.length) { arr.push(0); } 6316 6317 return Math.ceil(fixedWidth ? viewportMax / Math.min.apply(null, arr) : Math.max.apply(null, arr)); 6318 } 6319 } 6320 6321 function getCloneCountForLoop () { 6322 var itemsMax = getItemsMax(), 6323 result = carousel ? Math.ceil((itemsMax * 5 - slideCount)/2) : (itemsMax * 4 - slideCount); 6324 result = Math.max(itemsMax, result); 6325 6326 return hasOption('edgePadding') ? result + 1 : result; 6327 } 6328 6329 function getWindowWidth () { 6330 return win.innerWidth || doc.documentElement.clientWidth || doc.body.clientWidth; 6331 } 6332 6333 function getInsertPosition (pos) { 6334 return pos === 'top' ? 'afterbegin' : 'beforeend'; 6335 } 6336 6337 function getClientWidth (el) { 6338 if (el == null) { return; } 6339 var div = doc.createElement('div'), rect, width; 6340 el.appendChild(div); 6341 rect = div.getBoundingClientRect(); 6342 width = rect.right - rect.left; 6343 div.remove(); 6344 return width || getClientWidth(el.parentNode); 6345 } 6346 6347 function getViewportWidth () { 6348 var gap = edgePadding ? edgePadding * 2 - gutter : 0; 6349 return getClientWidth(containerParent) - gap; 6350 } 6351 6352 function hasOption (item) { 6353 if (options[item]) { 6354 return true; 6355 } else { 6356 if (responsive) { 6357 for (var bp in responsive) { 6358 if (responsive[bp][item]) { return true; } 6359 } 6360 } 6361 return false; 6362 } 6363 } 6364 6365 // get option: 6366 // fixed width: viewport, fixedWidth, gutter => items 6367 // others: window width => all variables 6368 // all: items => slideBy 6369 function getOption (item, ww) { 6370 if (ww == null) { ww = windowWidth; } 6371 6372 if (item === 'items' && fixedWidth) { 6373 return Math.floor((viewport + gutter) / (fixedWidth + gutter)) || 1; 6374 6375 } else { 6376 var result = options[item]; 6377 6378 if (responsive) { 6379 for (var bp in responsive) { 6380 // bp: convert string to number 6381 if (ww >= parseInt(bp)) { 6382 if (item in responsive[bp]) { result = responsive[bp][item]; } 6383 } 6384 } 6385 } 6386 6387 if (item === 'slideBy' && result === 'page') { result = getOption('items'); } 6388 if (!carousel && (item === 'slideBy' || item === 'items')) { result = Math.floor(result); } 6389 6390 return result; 6391 } 6392 } 6393 6394 function getSlideMarginLeft (i) { 6395 return CALC ? 6396 CALC + '(' + i * 100 + '% / ' + slideCountNew + ')' : 6397 i * 100 / slideCountNew + '%'; 6398 } 6399 6400 function getInnerWrapperStyles (edgePaddingTem, gutterTem, fixedWidthTem, speedTem, autoHeightBP) { 6401 var str = ''; 6402 6403 if (edgePaddingTem !== undefined) { 6404 var gap = edgePaddingTem; 6405 if (gutterTem) { gap -= gutterTem; } 6406 str = horizontal ? 6407 'margin: 0 ' + gap + 'px 0 ' + edgePaddingTem + 'px;' : 6408 'margin: ' + edgePaddingTem + 'px 0 ' + gap + 'px 0;'; 6409 } else if (gutterTem && !fixedWidthTem) { 6410 var gutterTemUnit = '-' + gutterTem + 'px', 6411 dir = horizontal ? gutterTemUnit + ' 0 0' : '0 ' + gutterTemUnit + ' 0'; 6412 str = 'margin: 0 ' + dir + ';' 6413 } 6414 6415 if (!carousel && autoHeightBP && TRANSITIONDURATION && speedTem) { str += getTransitionDurationStyle(speedTem); } 6416 return str; 6417 } 6418 6419 function getContainerWidth (fixedWidthTem, gutterTem, itemsTem) { 6420 if (fixedWidthTem) { 6421 return (fixedWidthTem + gutterTem) * slideCountNew + 'px'; 6422 } else { 6423 return CALC ? 6424 CALC + '(' + slideCountNew * 100 + '% / ' + itemsTem + ')' : 6425 slideCountNew * 100 / itemsTem + '%'; 6426 } 6427 } 6428 6429 function getSlideWidthStyle (fixedWidthTem, gutterTem, itemsTem) { 6430 var width; 6431 6432 if (fixedWidthTem) { 6433 width = (fixedWidthTem + gutterTem) + 'px'; 6434 } else { 6435 if (!carousel) { itemsTem = Math.floor(itemsTem); } 6436 var dividend = carousel ? slideCountNew : itemsTem; 6437 width = CALC ? 6438 CALC + '(100% / ' + dividend + ')' : 6439 100 / dividend + '%'; 6440 } 6441 6442 width = 'width:' + width; 6443 6444 // inner slider: overwrite outer slider styles 6445 return nested !== 'inner' ? width + ';' : width + ' !important;'; 6446 } 6447 6448 function getSlideGutterStyle (gutterTem) { 6449 var str = ''; 6450 6451 // gutter maybe interger || 0 6452 // so can't use 'if (gutter)' 6453 if (gutterTem !== false) { 6454 var prop = horizontal ? 'padding-' : 'margin-', 6455 dir = horizontal ? 'right' : 'bottom'; 6456 str = prop + dir + ': ' + gutterTem + 'px;'; 6457 } 6458 6459 return str; 6460 } 6461 6462 function getCSSPrefix (name, num) { 6463 var prefix = name.substring(0, name.length - num).toLowerCase(); 6464 if (prefix) { prefix = '-' + prefix + '-'; } 6465 6466 return prefix; 6467 } 6468 6469 function getTransitionDurationStyle (speed) { 6470 return getCSSPrefix(TRANSITIONDURATION, 18) + 'transition-duration:' + speed / 1000 + 's;'; 6471 } 6472 6473 function getAnimationDurationStyle (speed) { 6474 return getCSSPrefix(ANIMATIONDURATION, 17) + 'animation-duration:' + speed / 1000 + 's;'; 6475 } 6476 6477 function initStructure () { 6478 var classOuter = 'tns-outer', 6479 classInner = 'tns-inner', 6480 hasGutter = hasOption('gutter'); 6481 6482 outerWrapper.className = classOuter; 6483 innerWrapper.className = classInner; 6484 outerWrapper.id = slideId + '-ow'; 6485 innerWrapper.id = slideId + '-iw'; 6486 6487 // set container properties 6488 if (container.id === '') { container.id = slideId; } 6489 newContainerClasses += PERCENTAGELAYOUT || autoWidth ? ' tns-subpixel' : ' tns-no-subpixel'; 6490 newContainerClasses += CALC ? ' tns-calc' : ' tns-no-calc'; 6491 if (autoWidth) { newContainerClasses += ' tns-autowidth'; } 6492 newContainerClasses += ' tns-' + options.axis; 6493 container.className += newContainerClasses; 6494 6495 // add constrain layer for carousel 6496 if (carousel) { 6497 middleWrapper = doc.createElement('div'); 6498 middleWrapper.id = slideId + '-mw'; 6499 middleWrapper.className = 'tns-ovh'; 6500 6501 outerWrapper.appendChild(middleWrapper); 6502 middleWrapper.appendChild(innerWrapper); 6503 } else { 6504 outerWrapper.appendChild(innerWrapper); 6505 } 6506 6507 if (autoHeight) { 6508 var wp = middleWrapper ? middleWrapper : innerWrapper; 6509 wp.className += ' tns-ah'; 6510 } 6511 6512 containerParent.insertBefore(outerWrapper, container); 6513 innerWrapper.appendChild(container); 6514 6515 // add id, class, aria attributes 6516 // before clone slides 6517 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(item, i) { 6518 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, 'tns-item'); 6519 if (!item.id) { item.id = slideId + '-item' + i; } 6520 if (!carousel && animateNormal) { Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateNormal); } 6521 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(item, { 6522 'aria-hidden': 'true', 6523 'tabindex': '-1' 6524 }); 6525 }); 6526 6527 // ## clone slides 6528 // carousel: n + slides + n 6529 // gallery: slides + n 6530 if (cloneCount) { 6531 var fragmentBefore = doc.createDocumentFragment(), 6532 fragmentAfter = doc.createDocumentFragment(); 6533 6534 for (var j = cloneCount; j--;) { 6535 var num = j%slideCount, 6536 cloneFirst = slideItems[num].cloneNode(true); 6537 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(cloneFirst, slideClonedClass); 6538 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(cloneFirst, 'id'); 6539 fragmentAfter.insertBefore(cloneFirst, fragmentAfter.firstChild); 6540 6541 if (carousel) { 6542 var cloneLast = slideItems[slideCount - 1 - num].cloneNode(true); 6543 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(cloneLast, slideClonedClass); 6544 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(cloneLast, 'id'); 6545 fragmentBefore.appendChild(cloneLast); 6546 } 6547 } 6548 6549 container.insertBefore(fragmentBefore, container.firstChild); 6550 container.appendChild(fragmentAfter); 6551 slideItems = container.children; 6552 } 6553 6554 } 6555 6556 function initSliderTransform () { 6557 // ## images loaded/failed 6558 if (hasOption('autoHeight') || autoWidth || !horizontal) { 6559 var imgs = container.querySelectorAll('img'); 6560 6561 // add img load event listener 6562 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(imgs, function(img) { 6563 var src = img.src; 6564 6565 if (!lazyload) { 6566 // not data img 6567 if (src && src.indexOf('data:image') < 0) { 6568 img.src = ''; 6569 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(img, imgEvents); 6570 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'loading'); 6571 6572 img.src = src; 6573 // data img 6574 } else { 6575 imgLoaded(img); 6576 } 6577 } 6578 }); 6579 6580 // set imgsComplete 6581 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(Object(_helpers_arrayFromNodeList_js__WEBPACK_IMPORTED_MODULE_23__["arrayFromNodeList"])(imgs), function() { imgsComplete = true; }); }); 6582 6583 // reset imgs for auto height: check visible imgs only 6584 if (hasOption('autoHeight')) { imgs = getImageArray(index, Math.min(index + items - 1, slideCountNew - 1)); } 6585 6586 lazyload ? initSliderTransformStyleCheck() : Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(Object(_helpers_arrayFromNodeList_js__WEBPACK_IMPORTED_MODULE_23__["arrayFromNodeList"])(imgs), initSliderTransformStyleCheck); }); 6587 6588 } else { 6589 // set container transform property 6590 if (carousel) { doContainerTransformSilent(); } 6591 6592 // update slider tools and events 6593 initTools(); 6594 initEvents(); 6595 } 6596 } 6597 6598 function initSliderTransformStyleCheck () { 6599 if (autoWidth && slideCount > 1) { 6600 // check styles application 6601 var num = loop ? index : slideCount - 1; 6602 6603 (function stylesApplicationCheck() { 6604 var left = slideItems[num].getBoundingClientRect().left; 6605 var right = slideItems[num - 1].getBoundingClientRect().right; 6606 6607 (Math.abs(left - right) <= 1) ? 6608 initSliderTransformCore() : 6609 setTimeout(function(){ stylesApplicationCheck() }, 16); 6610 })(); 6611 6612 } else { 6613 initSliderTransformCore(); 6614 } 6615 } 6616 6617 6618 function initSliderTransformCore () { 6619 // run Fn()s which are rely on image loading 6620 if (!horizontal || autoWidth) { 6621 setSlidePositions(); 6622 6623 if (autoWidth) { 6624 rightBoundary = getRightBoundary(); 6625 if (freezable) { freeze = getFreeze(); } 6626 indexMax = getIndexMax(); // <= slidePositions, rightBoundary <= 6627 resetVariblesWhenDisable(disable || freeze); 6628 } else { 6629 updateContentWrapperHeight(); 6630 } 6631 } 6632 6633 // set container transform property 6634 if (carousel) { doContainerTransformSilent(); } 6635 6636 // update slider tools and events 6637 initTools(); 6638 initEvents(); 6639 } 6640 6641 function initSheet () { 6642 // gallery: 6643 // set animation classes and left value for gallery slider 6644 if (!carousel) { 6645 for (var i = index, l = index + Math.min(slideCount, items); i < l; i++) { 6646 var item = slideItems[i]; 6647 item.style.left = (i - index) * 100 / items + '%'; 6648 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateIn); 6649 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateNormal); 6650 } 6651 } 6652 6653 // #### LAYOUT 6654 6655 // ## INLINE-BLOCK VS FLOAT 6656 6657 // ## PercentageLayout: 6658 // slides: inline-block 6659 // remove blank space between slides by set font-size: 0 6660 6661 // ## Non PercentageLayout: 6662 // slides: float 6663 // margin-right: -100% 6664 // margin-left: ~ 6665 6666 // Resource: https://docs.google.com/spreadsheets/d/147up245wwTXeQYve3BRSAD4oVcvQmuGsFteJOeA5xNQ/edit?usp=sharing 6667 if (horizontal) { 6668 if (PERCENTAGELAYOUT || autoWidth) { 6669 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', 'font-size:' + win.getComputedStyle(slideItems[0]).fontSize + ';', Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 6670 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId, 'font-size:0;', Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 6671 } else if (carousel) { 6672 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function (slide, i) { 6673 slide.style.marginLeft = getSlideMarginLeft(i); 6674 }); 6675 } 6676 } 6677 6678 6679 // ## BASIC STYLES 6680 if (CSSMQ) { 6681 // middle wrapper style 6682 if (TRANSITIONDURATION) { 6683 var str = middleWrapper && options.autoHeight ? getTransitionDurationStyle(options.speed) : ''; 6684 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + '-mw', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 6685 } 6686 6687 // inner wrapper styles 6688 str = getInnerWrapperStyles(options.edgePadding, options.gutter, options.fixedWidth, options.speed, options.autoHeight); 6689 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + '-iw', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 6690 6691 // container styles 6692 if (carousel) { 6693 str = horizontal && !autoWidth ? 'width:' + getContainerWidth(options.fixedWidth, options.gutter, options.items) + ';' : ''; 6694 if (TRANSITIONDURATION) { str += getTransitionDurationStyle(speed); } 6695 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId, str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 6696 } 6697 6698 // slide styles 6699 str = horizontal && !autoWidth ? getSlideWidthStyle(options.fixedWidth, options.gutter, options.items) : ''; 6700 if (options.gutter) { str += getSlideGutterStyle(options.gutter); } 6701 // set gallery items transition-duration 6702 if (!carousel) { 6703 if (TRANSITIONDURATION) { str += getTransitionDurationStyle(speed); } 6704 if (ANIMATIONDURATION) { str += getAnimationDurationStyle(speed); } 6705 } 6706 if (str) { Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); } 6707 6708 // non CSS mediaqueries: IE8 6709 // ## update inner wrapper, container, slides if needed 6710 // set inline styles for inner wrapper & container 6711 // insert stylesheet (one line) for slides only (since slides are many) 6712 } else { 6713 // middle wrapper styles 6714 update_carousel_transition_duration(); 6715 6716 // inner wrapper styles 6717 innerWrapper.style.cssText = getInnerWrapperStyles(edgePadding, gutter, fixedWidth, autoHeight); 6718 6719 // container styles 6720 if (carousel && horizontal && !autoWidth) { 6721 container.style.width = getContainerWidth(fixedWidth, gutter, items); 6722 } 6723 6724 // slide styles 6725 var str = horizontal && !autoWidth ? getSlideWidthStyle(fixedWidth, gutter, items) : ''; 6726 if (gutter) { str += getSlideGutterStyle(gutter); } 6727 6728 // append to the last line 6729 if (str) { Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); } 6730 } 6731 6732 // ## MEDIAQUERIES 6733 if (responsive && CSSMQ) { 6734 for (var bp in responsive) { 6735 // bp: convert string to number 6736 bp = parseInt(bp); 6737 6738 var opts = responsive[bp], 6739 str = '', 6740 middleWrapperStr = '', 6741 innerWrapperStr = '', 6742 containerStr = '', 6743 slideStr = '', 6744 itemsBP = !autoWidth ? getOption('items', bp) : null, 6745 fixedWidthBP = getOption('fixedWidth', bp), 6746 speedBP = getOption('speed', bp), 6747 edgePaddingBP = getOption('edgePadding', bp), 6748 autoHeightBP = getOption('autoHeight', bp), 6749 gutterBP = getOption('gutter', bp); 6750 6751 // middle wrapper string 6752 if (TRANSITIONDURATION && middleWrapper && getOption('autoHeight', bp) && 'speed' in opts) { 6753 middleWrapperStr = '#' + slideId + '-mw{' + getTransitionDurationStyle(speedBP) + '}'; 6754 } 6755 6756 // inner wrapper string 6757 if ('edgePadding' in opts || 'gutter' in opts) { 6758 innerWrapperStr = '#' + slideId + '-iw{' + getInnerWrapperStyles(edgePaddingBP, gutterBP, fixedWidthBP, speedBP, autoHeightBP) + '}'; 6759 } 6760 6761 // container string 6762 if (carousel && horizontal && !autoWidth && ('fixedWidth' in opts || 'items' in opts || (fixedWidth && 'gutter' in opts))) { 6763 containerStr = 'width:' + getContainerWidth(fixedWidthBP, gutterBP, itemsBP) + ';'; 6764 } 6765 if (TRANSITIONDURATION && 'speed' in opts) { 6766 containerStr += getTransitionDurationStyle(speedBP); 6767 } 6768 if (containerStr) { 6769 containerStr = '#' + slideId + '{' + containerStr + '}'; 6770 } 6771 6772 // slide string 6773 if ('fixedWidth' in opts || (fixedWidth && 'gutter' in opts) || !carousel && 'items' in opts) { 6774 slideStr += getSlideWidthStyle(fixedWidthBP, gutterBP, itemsBP); 6775 } 6776 if ('gutter' in opts) { 6777 slideStr += getSlideGutterStyle(gutterBP); 6778 } 6779 // set gallery items transition-duration 6780 if (!carousel && 'speed' in opts) { 6781 if (TRANSITIONDURATION) { slideStr += getTransitionDurationStyle(speedBP); } 6782 if (ANIMATIONDURATION) { slideStr += getAnimationDurationStyle(speedBP); } 6783 } 6784 if (slideStr) { slideStr = '#' + slideId + ' > .tns-item{' + slideStr + '}'; } 6785 6786 // add up 6787 str = middleWrapperStr + innerWrapperStr + containerStr + slideStr; 6788 6789 if (str) { 6790 sheet.insertRule('@media (min-width: ' + bp / 16 + 'em) {' + str + '}', sheet.cssRules.length); 6791 } 6792 } 6793 } 6794 } 6795 6796 function initTools () { 6797 // == slides == 6798 updateSlideStatus(); 6799 6800 // == live region == 6801 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>'); 6802 liveregionCurrent = outerWrapper.querySelector('.tns-liveregion .current'); 6803 6804 // == autoplayInit == 6805 if (hasAutoplay) { 6806 var txt = autoplay ? 'stop' : 'start'; 6807 if (autoplayButton) { 6808 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(autoplayButton, {'data-action': txt}); 6809 } else if (options.autoplayButtonOutput) { 6810 outerWrapper.insertAdjacentHTML(getInsertPosition(options.autoplayPosition), '<button type="button" data-action="' + txt + '">' + autoplayHtmlStrings[0] + txt + autoplayHtmlStrings[1] + autoplayText[0] + '</button>'); 6811 autoplayButton = outerWrapper.querySelector('[data-action]'); 6812 } 6813 6814 // add event 6815 if (autoplayButton) { 6816 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(autoplayButton, {'click': toggleAutoplay}); 6817 } 6818 6819 if (autoplay) { 6820 startAutoplay(); 6821 if (autoplayHoverPause) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, hoverEvents); } 6822 if (autoplayResetOnVisibility) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, visibilityEvent); } 6823 } 6824 } 6825 6826 // == navInit == 6827 if (hasNav) { 6828 var initIndex = !carousel ? 0 : cloneCount; 6829 // customized nav 6830 // will not hide the navs in case they're thumbnails 6831 if (navContainer) { 6832 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navContainer, {'aria-label': 'Carousel Pagination'}); 6833 navItems = navContainer.children; 6834 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(navItems, function(item, i) { 6835 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(item, { 6836 'data-nav': i, 6837 'tabindex': '-1', 6838 'aria-label': navStr + (i + 1), 6839 'aria-controls': slideId, 6840 }); 6841 }); 6842 6843 // generated nav 6844 } else { 6845 var navHtml = '', 6846 hiddenStr = navAsThumbnails ? '' : 'style="display:none"'; 6847 for (var i = 0; i < slideCount; i++) { 6848 // hide nav items by default 6849 navHtml += '<button type="button" data-nav="' + i +'" tabindex="-1" aria-controls="' + slideId + '" ' + hiddenStr + ' aria-label="' + navStr + (i + 1) +'"></button>'; 6850 } 6851 navHtml = '<div class="tns-nav" aria-label="Carousel Pagination">' + navHtml + '</div>'; 6852 outerWrapper.insertAdjacentHTML(getInsertPosition(options.navPosition), navHtml); 6853 6854 navContainer = outerWrapper.querySelector('.tns-nav'); 6855 navItems = navContainer.children; 6856 } 6857 6858 updateNavVisibility(); 6859 6860 // add transition 6861 if (TRANSITIONDURATION) { 6862 var prefix = TRANSITIONDURATION.substring(0, TRANSITIONDURATION.length - 18).toLowerCase(), 6863 str = 'transition: all ' + speed / 1000 + 's'; 6864 6865 if (prefix) { 6866 str = '-' + prefix + '-' + str; 6867 } 6868 6869 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '[aria-controls^=' + slideId + '-item]', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 6870 } 6871 6872 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navItems[navCurrentIndex], {'aria-label': navStr + (navCurrentIndex + 1) + navStrCurrent}); 6873 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(navItems[navCurrentIndex], 'tabindex'); 6874 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(navItems[navCurrentIndex], navActiveClass); 6875 6876 // add events 6877 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(navContainer, navEvents); 6878 } 6879 6880 6881 6882 // == controlsInit == 6883 if (hasControls) { 6884 if (!controlsContainer && (!prevButton || !nextButton)) { 6885 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>'); 6886 6887 controlsContainer = outerWrapper.querySelector('.tns-controls'); 6888 } 6889 6890 if (!prevButton || !nextButton) { 6891 prevButton = controlsContainer.children[0]; 6892 nextButton = controlsContainer.children[1]; 6893 } 6894 6895 if (options.controlsContainer) { 6896 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(controlsContainer, { 6897 'aria-label': 'Carousel Navigation', 6898 'tabindex': '0' 6899 }); 6900 } 6901 6902 if (options.controlsContainer || (options.prevButton && options.nextButton)) { 6903 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])([prevButton, nextButton], { 6904 'aria-controls': slideId, 6905 'tabindex': '-1', 6906 }); 6907 } 6908 6909 if (options.controlsContainer || (options.prevButton && options.nextButton)) { 6910 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(prevButton, {'data-controls' : 'prev'}); 6911 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(nextButton, {'data-controls' : 'next'}); 6912 } 6913 6914 prevIsButton = isButton(prevButton); 6915 nextIsButton = isButton(nextButton); 6916 6917 updateControlsStatus(); 6918 6919 // add events 6920 if (controlsContainer) { 6921 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(controlsContainer, controlsEvents); 6922 } else { 6923 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(prevButton, controlsEvents); 6924 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(nextButton, controlsEvents); 6925 } 6926 } 6927 6928 // hide tools if needed 6929 disableUI(); 6930 } 6931 6932 function initEvents () { 6933 // add events 6934 if (carousel && TRANSITIONEND) { 6935 var eve = {}; 6936 eve[TRANSITIONEND] = onTransitionEnd; 6937 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, eve); 6938 } 6939 6940 if (touch) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, touchEvents, options.preventScrollOnTouch); } 6941 if (mouseDrag) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, dragEvents); } 6942 if (arrowKeys) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(doc, docmentKeydownEvent); } 6943 6944 if (nested === 'inner') { 6945 events.on('outerResized', function () { 6946 resizeTasks(); 6947 events.emit('innerLoaded', info()); 6948 }); 6949 } else if (responsive || fixedWidth || autoWidth || autoHeight || !horizontal) { 6950 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(win, {'resize': onResize}); 6951 } 6952 6953 if (autoHeight) { 6954 if (nested === 'outer') { 6955 events.on('innerLoaded', doAutoHeight); 6956 } else if (!disable) { doAutoHeight(); } 6957 } 6958 6959 doLazyLoad(); 6960 if (disable) { disableSlider(); } else if (freeze) { freezeSlider(); } 6961 6962 events.on('indexChanged', additionalUpdates); 6963 if (nested === 'inner') { events.emit('innerLoaded', info()); } 6964 if (typeof onInit === 'function') { onInit(info()); } 6965 isOn = true; 6966 } 6967 6968 function destroy () { 6969 // sheet 6970 sheet.disabled = true; 6971 if (sheet.ownerNode) { sheet.ownerNode.remove(); } 6972 6973 // remove win event listeners 6974 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(win, {'resize': onResize}); 6975 6976 // arrowKeys, controls, nav 6977 if (arrowKeys) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(doc, docmentKeydownEvent); } 6978 if (controlsContainer) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(controlsContainer, controlsEvents); } 6979 if (navContainer) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(navContainer, navEvents); } 6980 6981 // autoplay 6982 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, hoverEvents); 6983 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, visibilityEvent); 6984 if (autoplayButton) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(autoplayButton, {'click': toggleAutoplay}); } 6985 if (autoplay) { clearInterval(autoplayTimer); } 6986 6987 // container 6988 if (carousel && TRANSITIONEND) { 6989 var eve = {}; 6990 eve[TRANSITIONEND] = onTransitionEnd; 6991 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, eve); 6992 } 6993 if (touch) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, touchEvents); } 6994 if (mouseDrag) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, dragEvents); } 6995 6996 // cache Object values in options && reset HTML 6997 var htmlList = [containerHTML, controlsContainerHTML, prevButtonHTML, nextButtonHTML, navContainerHTML, autoplayButtonHTML]; 6998 6999 tnsList.forEach(function(item, i) { 7000 var el = item === 'container' ? outerWrapper : options[item]; 7001 7002 if (typeof el === 'object' && el) { 7003 var prevEl = el.previousElementSibling ? el.previousElementSibling : false, 7004 parentEl = el.parentNode; 7005 el.outerHTML = htmlList[i]; 7006 options[item] = prevEl ? prevEl.nextElementSibling : parentEl.firstElementChild; 7007 } 7008 }); 7009 7010 7011 // reset variables 7012 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 = 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 = null; 7013 // check variables 7014 // [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); } }); 7015 7016 for (var a in this) { 7017 if (a !== 'rebuild') { this[a] = null; } 7018 } 7019 isOn = false; 7020 } 7021 7022// === ON RESIZE === 7023 // responsive || fixedWidth || autoWidth || !horizontal 7024 function onResize (e) { 7025 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ resizeTasks(getEvent(e)); }); 7026 } 7027 7028 function resizeTasks (e) { 7029 if (!isOn) { return; } 7030 if (nested === 'outer') { events.emit('outerResized', info(e)); } 7031 windowWidth = getWindowWidth(); 7032 var bpChanged, 7033 breakpointZoneTem = breakpointZone, 7034 needContainerTransform = false; 7035 7036 if (responsive) { 7037 setBreakpointZone(); 7038 bpChanged = breakpointZoneTem !== breakpointZone; 7039 // if (hasRightDeadZone) { needContainerTransform = true; } // *? 7040 if (bpChanged) { events.emit('newBreakpointStart', info(e)); } 7041 } 7042 7043 var indChanged, 7044 itemsChanged, 7045 itemsTem = items, 7046 disableTem = disable, 7047 freezeTem = freeze, 7048 arrowKeysTem = arrowKeys, 7049 controlsTem = controls, 7050 navTem = nav, 7051 touchTem = touch, 7052 mouseDragTem = mouseDrag, 7053 autoplayTem = autoplay, 7054 autoplayHoverPauseTem = autoplayHoverPause, 7055 autoplayResetOnVisibilityTem = autoplayResetOnVisibility, 7056 indexTem = index; 7057 7058 if (bpChanged) { 7059 var fixedWidthTem = fixedWidth, 7060 autoHeightTem = autoHeight, 7061 controlsTextTem = controlsText, 7062 centerTem = center, 7063 autoplayTextTem = autoplayText; 7064 7065 if (!CSSMQ) { 7066 var gutterTem = gutter, 7067 edgePaddingTem = edgePadding; 7068 } 7069 } 7070 7071 // get option: 7072 // fixed width: viewport, fixedWidth, gutter => items 7073 // others: window width => all variables 7074 // all: items => slideBy 7075 arrowKeys = getOption('arrowKeys'); 7076 controls = getOption('controls'); 7077 nav = getOption('nav'); 7078 touch = getOption('touch'); 7079 center = getOption('center'); 7080 mouseDrag = getOption('mouseDrag'); 7081 autoplay = getOption('autoplay'); 7082 autoplayHoverPause = getOption('autoplayHoverPause'); 7083 autoplayResetOnVisibility = getOption('autoplayResetOnVisibility'); 7084 7085 if (bpChanged) { 7086 disable = getOption('disable'); 7087 fixedWidth = getOption('fixedWidth'); 7088 speed = getOption('speed'); 7089 autoHeight = getOption('autoHeight'); 7090 controlsText = getOption('controlsText'); 7091 autoplayText = getOption('autoplayText'); 7092 autoplayTimeout = getOption('autoplayTimeout'); 7093 7094 if (!CSSMQ) { 7095 edgePadding = getOption('edgePadding'); 7096 gutter = getOption('gutter'); 7097 } 7098 } 7099 // update options 7100 resetVariblesWhenDisable(disable); 7101 7102 viewport = getViewportWidth(); // <= edgePadding, gutter 7103 if ((!horizontal || autoWidth) && !disable) { 7104 setSlidePositions(); 7105 if (!horizontal) { 7106 updateContentWrapperHeight(); // <= setSlidePositions 7107 needContainerTransform = true; 7108 } 7109 } 7110 if (fixedWidth || autoWidth) { 7111 rightBoundary = getRightBoundary(); // autoWidth: <= viewport, slidePositions, gutter 7112 // fixedWidth: <= viewport, fixedWidth, gutter 7113 indexMax = getIndexMax(); // autoWidth: <= rightBoundary, slidePositions 7114 // fixedWidth: <= rightBoundary, fixedWidth, gutter 7115 } 7116 7117 if (bpChanged || fixedWidth) { 7118 items = getOption('items'); 7119 slideBy = getOption('slideBy'); 7120 itemsChanged = items !== itemsTem; 7121 7122 if (itemsChanged) { 7123 if (!fixedWidth && !autoWidth) { indexMax = getIndexMax(); } // <= items 7124 // check index before transform in case 7125 // slider reach the right edge then items become bigger 7126 updateIndex(); 7127 } 7128 } 7129 7130 if (bpChanged) { 7131 if (disable !== disableTem) { 7132 if (disable) { 7133 disableSlider(); 7134 } else { 7135 enableSlider(); // <= slidePositions, rightBoundary, indexMax 7136 } 7137 } 7138 } 7139 7140 if (freezable && (bpChanged || fixedWidth || autoWidth)) { 7141 freeze = getFreeze(); // <= autoWidth: slidePositions, gutter, viewport, rightBoundary 7142 // <= fixedWidth: fixedWidth, gutter, rightBoundary 7143 // <= others: items 7144 7145 if (freeze !== freezeTem) { 7146 if (freeze) { 7147 doContainerTransform(getContainerTransformValue(getStartIndex(0))); 7148 freezeSlider(); 7149 } else { 7150 unfreezeSlider(); 7151 needContainerTransform = true; 7152 } 7153 } 7154 } 7155 7156 resetVariblesWhenDisable(disable || freeze); // controls, nav, touch, mouseDrag, arrowKeys, autoplay, autoplayHoverPause, autoplayResetOnVisibility 7157 if (!autoplay) { autoplayHoverPause = autoplayResetOnVisibility = false; } 7158 7159 if (arrowKeys !== arrowKeysTem) { 7160 arrowKeys ? 7161 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(doc, docmentKeydownEvent) : 7162 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(doc, docmentKeydownEvent); 7163 } 7164 if (controls !== controlsTem) { 7165 if (controls) { 7166 if (controlsContainer) { 7167 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(controlsContainer); 7168 } else { 7169 if (prevButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(prevButton); } 7170 if (nextButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(nextButton); } 7171 } 7172 } else { 7173 if (controlsContainer) { 7174 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(controlsContainer); 7175 } else { 7176 if (prevButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(prevButton); } 7177 if (nextButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(nextButton); } 7178 } 7179 } 7180 } 7181 if (nav !== navTem) { 7182 if (nav) { 7183 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(navContainer); 7184 updateNavVisibility(); 7185 } else { 7186 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(navContainer) 7187 } 7188 } 7189 if (touch !== touchTem) { 7190 touch ? 7191 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, touchEvents, options.preventScrollOnTouch) : 7192 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, touchEvents); 7193 } 7194 if (mouseDrag !== mouseDragTem) { 7195 mouseDrag ? 7196 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, dragEvents) : 7197 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, dragEvents); 7198 } 7199 if (autoplay !== autoplayTem) { 7200 if (autoplay) { 7201 if (autoplayButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(autoplayButton); } 7202 if (!animating && !autoplayUserPaused) { startAutoplay(); } 7203 } else { 7204 if (autoplayButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(autoplayButton); } 7205 if (animating) { stopAutoplay(); } 7206 } 7207 } 7208 if (autoplayHoverPause !== autoplayHoverPauseTem) { 7209 autoplayHoverPause ? 7210 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(container, hoverEvents) : 7211 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(container, hoverEvents); 7212 } 7213 if (autoplayResetOnVisibility !== autoplayResetOnVisibilityTem) { 7214 autoplayResetOnVisibility ? 7215 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(doc, visibilityEvent) : 7216 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(doc, visibilityEvent); 7217 } 7218 7219 if (bpChanged) { 7220 if (fixedWidth !== fixedWidthTem || center !== centerTem) { needContainerTransform = true; } 7221 7222 if (autoHeight !== autoHeightTem) { 7223 if (!autoHeight) { innerWrapper.style.height = ''; } 7224 } 7225 7226 if (controls && controlsText !== controlsTextTem) { 7227 prevButton.innerHTML = controlsText[0]; 7228 nextButton.innerHTML = controlsText[1]; 7229 } 7230 7231 if (autoplayButton && autoplayText !== autoplayTextTem) { 7232 var i = autoplay ? 1 : 0, 7233 html = autoplayButton.innerHTML, 7234 len = html.length - autoplayTextTem[i].length; 7235 if (html.substring(len) === autoplayTextTem[i]) { 7236 autoplayButton.innerHTML = html.substring(0, len) + autoplayText[i]; 7237 } 7238 } 7239 } else { 7240 if (center && (fixedWidth || autoWidth)) { needContainerTransform = true; } 7241 } 7242 7243 if (itemsChanged || fixedWidth && !autoWidth) { 7244 pages = getPages(); 7245 updateNavVisibility(); 7246 } 7247 7248 indChanged = index !== indexTem; 7249 if (indChanged) { 7250 events.emit('indexChanged', info()); 7251 needContainerTransform = true; 7252 } else if (itemsChanged) { 7253 if (!indChanged) { additionalUpdates(); } 7254 } else if (fixedWidth || autoWidth) { 7255 doLazyLoad(); 7256 updateSlideStatus(); 7257 updateLiveRegion(); 7258 } 7259 7260 if (itemsChanged && !carousel) { updateGallerySlidePositions(); } 7261 7262 if (!disable && !freeze) { 7263 // non-mediaqueries: IE8 7264 if (bpChanged && !CSSMQ) { 7265 // middle wrapper styles 7266 7267 // inner wrapper styles 7268 if (edgePadding !== edgePaddingTem || gutter !== gutterTem) { 7269 innerWrapper.style.cssText = getInnerWrapperStyles(edgePadding, gutter, fixedWidth, speed, autoHeight); 7270 } 7271 7272 if (horizontal) { 7273 // container styles 7274 if (carousel) { 7275 container.style.width = getContainerWidth(fixedWidth, gutter, items); 7276 } 7277 7278 // slide styles 7279 var str = getSlideWidthStyle(fixedWidth, gutter, items) + 7280 getSlideGutterStyle(gutter); 7281 7282 // remove the last line and 7283 // add new styles 7284 Object(_helpers_removeCSSRule_js__WEBPACK_IMPORTED_MODULE_11__["removeCSSRule"])(sheet, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet) - 1); 7285 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_10__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_12__["getCssRulesLength"])(sheet)); 7286 } 7287 } 7288 7289 // auto height 7290 if (autoHeight) { doAutoHeight(); } 7291 7292 if (needContainerTransform) { 7293 doContainerTransformSilent(); 7294 indexCached = index; 7295 } 7296 } 7297 7298 if (bpChanged) { events.emit('newBreakpointEnd', info(e)); } 7299 } 7300 7301 7302 7303 7304 7305 // === INITIALIZATION FUNCTIONS === // 7306 function getFreeze () { 7307 if (!fixedWidth && !autoWidth) { 7308 var a = center ? items - (items - 1) / 2 : items; 7309 return slideCount <= a; 7310 } 7311 7312 var width = fixedWidth ? (fixedWidth + gutter) * slideCount : slidePositions[slideCount], 7313 vp = edgePadding ? viewport + edgePadding * 2 : viewport + gutter; 7314 7315 if (center) { 7316 vp -= fixedWidth ? (viewport - fixedWidth) / 2 : (viewport - (slidePositions[index + 1] - slidePositions[index] - gutter)) / 2; 7317 } 7318 7319 return width <= vp; 7320 } 7321 7322 function setBreakpointZone () { 7323 breakpointZone = 0; 7324 for (var bp in responsive) { 7325 bp = parseInt(bp); // convert string to number 7326 if (windowWidth >= bp) { breakpointZone = bp; } 7327 } 7328 } 7329 7330 // (slideBy, indexMin, indexMax) => index 7331 var updateIndex = (function () { 7332 return loop ? 7333 carousel ? 7334 // loop + carousel 7335 function () { 7336 var leftEdge = indexMin, 7337 rightEdge = indexMax; 7338 7339 leftEdge += slideBy; 7340 rightEdge -= slideBy; 7341 7342 // adjust edges when has edge paddings 7343 // or fixed-width slider with extra space on the right side 7344 if (edgePadding) { 7345 leftEdge += 1; 7346 rightEdge -= 1; 7347 } else if (fixedWidth) { 7348 if ((viewport + gutter)%(fixedWidth + gutter)) { rightEdge -= 1; } 7349 } 7350 7351 if (cloneCount) { 7352 if (index > rightEdge) { 7353 index -= slideCount; 7354 } else if (index < leftEdge) { 7355 index += slideCount; 7356 } 7357 } 7358 } : 7359 // loop + gallery 7360 function() { 7361 if (index > indexMax) { 7362 while (index >= indexMin + slideCount) { index -= slideCount; } 7363 } else if (index < indexMin) { 7364 while (index <= indexMax - slideCount) { index += slideCount; } 7365 } 7366 } : 7367 // non-loop 7368 function() { 7369 index = Math.max(indexMin, Math.min(indexMax, index)); 7370 }; 7371 })(); 7372 7373 function disableUI () { 7374 if (!autoplay && autoplayButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(autoplayButton); } 7375 if (!nav && navContainer) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(navContainer); } 7376 if (!controls) { 7377 if (controlsContainer) { 7378 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(controlsContainer); 7379 } else { 7380 if (prevButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(prevButton); } 7381 if (nextButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(nextButton); } 7382 } 7383 } 7384 } 7385 7386 function enableUI () { 7387 if (autoplay && autoplayButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(autoplayButton); } 7388 if (nav && navContainer) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(navContainer); } 7389 if (controls) { 7390 if (controlsContainer) { 7391 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(controlsContainer); 7392 } else { 7393 if (prevButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(prevButton); } 7394 if (nextButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(nextButton); } 7395 } 7396 } 7397 } 7398 7399 function freezeSlider () { 7400 if (frozen) { return; } 7401 7402 // remove edge padding from inner wrapper 7403 if (edgePadding) { innerWrapper.style.margin = '0px'; } 7404 7405 // add class tns-transparent to cloned slides 7406 if (cloneCount) { 7407 var str = 'tns-transparent'; 7408 for (var i = cloneCount; i--;) { 7409 if (carousel) { Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(slideItems[i], str); } 7410 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(slideItems[slideCountNew - i - 1], str); 7411 } 7412 } 7413 7414 // update tools 7415 disableUI(); 7416 7417 frozen = true; 7418 } 7419 7420 function unfreezeSlider () { 7421 if (!frozen) { return; } 7422 7423 // restore edge padding for inner wrapper 7424 // for mordern browsers 7425 if (edgePadding && CSSMQ) { innerWrapper.style.margin = ''; } 7426 7427 // remove class tns-transparent to cloned slides 7428 if (cloneCount) { 7429 var str = 'tns-transparent'; 7430 for (var i = cloneCount; i--;) { 7431 if (carousel) { Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(slideItems[i], str); } 7432 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(slideItems[slideCountNew - i - 1], str); 7433 } 7434 } 7435 7436 // update tools 7437 enableUI(); 7438 7439 frozen = false; 7440 } 7441 7442 function disableSlider () { 7443 if (disabled) { return; } 7444 7445 sheet.disabled = true; 7446 container.className = container.className.replace(newContainerClasses.substring(1), ''); 7447 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(container, ['style']); 7448 if (loop) { 7449 for (var j = cloneCount; j--;) { 7450 if (carousel) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(slideItems[j]); } 7451 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"])(slideItems[slideCountNew - j - 1]); 7452 } 7453 } 7454 7455 // vertical slider 7456 if (!horizontal || !carousel) { Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(innerWrapper, ['style']); } 7457 7458 // gallery 7459 if (!carousel) { 7460 for (var i = index, l = index + slideCount; i < l; i++) { 7461 var item = slideItems[i]; 7462 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(item, ['style']); 7463 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateIn); 7464 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateNormal); 7465 } 7466 } 7467 7468 // update tools 7469 disableUI(); 7470 7471 disabled = true; 7472 } 7473 7474 function enableSlider () { 7475 if (!disabled) { return; } 7476 7477 sheet.disabled = false; 7478 container.className += newContainerClasses; 7479 doContainerTransformSilent(); 7480 7481 if (loop) { 7482 for (var j = cloneCount; j--;) { 7483 if (carousel) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(slideItems[j]); } 7484 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"])(slideItems[slideCountNew - j - 1]); 7485 } 7486 } 7487 7488 // gallery 7489 if (!carousel) { 7490 for (var i = index, l = index + slideCount; i < l; i++) { 7491 var item = slideItems[i], 7492 classN = i < index + items ? animateIn : animateNormal; 7493 item.style.left = (i - index) * 100 / items + '%'; 7494 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, classN); 7495 } 7496 } 7497 7498 // update tools 7499 enableUI(); 7500 7501 disabled = false; 7502 } 7503 7504 function updateLiveRegion () { 7505 var str = getLiveRegionStr(); 7506 if (liveregionCurrent.innerHTML !== str) { liveregionCurrent.innerHTML = str; } 7507 } 7508 7509 function getLiveRegionStr () { 7510 var arr = getVisibleSlideRange(), 7511 start = arr[0] + 1, 7512 end = arr[1] + 1; 7513 return start === end ? start + '' : start + ' to ' + end; 7514 } 7515 7516 function getVisibleSlideRange (val) { 7517 if (val == null) { val = getContainerTransformValue(); } 7518 var start = index, end, rangestart, rangeend; 7519 7520 // get range start, range end for autoWidth and fixedWidth 7521 if (center || edgePadding) { 7522 if (autoWidth || fixedWidth) { 7523 rangestart = - (parseFloat(val) + edgePadding); 7524 rangeend = rangestart + viewport + edgePadding * 2; 7525 } 7526 } else { 7527 if (autoWidth) { 7528 rangestart = slidePositions[index]; 7529 rangeend = rangestart + viewport; 7530 } 7531 } 7532 7533 // get start, end 7534 // - check auto width 7535 if (autoWidth) { 7536 slidePositions.forEach(function(point, i) { 7537 if (i < slideCountNew) { 7538 if ((center || edgePadding) && point <= rangestart + 0.5) { start = i; } 7539 if (rangeend - point >= 0.5) { end = i; } 7540 } 7541 }); 7542 7543 // - check percentage width, fixed width 7544 } else { 7545 7546 if (fixedWidth) { 7547 var cell = fixedWidth + gutter; 7548 if (center || edgePadding) { 7549 start = Math.floor(rangestart/cell); 7550 end = Math.ceil(rangeend/cell - 1); 7551 } else { 7552 end = start + Math.ceil(viewport/cell) - 1; 7553 } 7554 7555 } else { 7556 if (center || edgePadding) { 7557 var a = items - 1; 7558 if (center) { 7559 start -= a / 2; 7560 end = index + a / 2; 7561 } else { 7562 end = index + a; 7563 } 7564 7565 if (edgePadding) { 7566 var b = edgePadding * items / viewport; 7567 start -= b; 7568 end += b; 7569 } 7570 7571 start = Math.floor(start); 7572 end = Math.ceil(end); 7573 } else { 7574 end = start + items - 1; 7575 } 7576 } 7577 7578 start = Math.max(start, 0); 7579 end = Math.min(end, slideCountNew - 1); 7580 } 7581 7582 return [start, end]; 7583 } 7584 7585 function doLazyLoad () { 7586 if (lazyload && !disable) { 7587 var arg = getVisibleSlideRange(); 7588 arg.push(lazyloadSelector); 7589 7590 getImageArray.apply(null, arg).forEach(function (img) { 7591 if (!Object(_helpers_hasClass_js__WEBPACK_IMPORTED_MODULE_16__["hasClass"])(img, imgCompleteClass)) { 7592 // stop propagation transitionend event to container 7593 var eve = {}; 7594 eve[TRANSITIONEND] = function (e) { e.stopPropagation(); }; 7595 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(img, eve); 7596 7597 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(img, imgEvents); 7598 7599 // update src 7600 img.src = Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(img, 'data-src'); 7601 7602 // update srcset 7603 var srcset = Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(img, 'data-srcset'); 7604 if (srcset) { img.srcset = srcset; } 7605 7606 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'loading'); 7607 } 7608 }); 7609 } 7610 } 7611 7612 function onImgLoaded (e) { 7613 imgLoaded(getTarget(e)); 7614 } 7615 7616 function onImgFailed (e) { 7617 imgFailed(getTarget(e)); 7618 } 7619 7620 function imgLoaded (img) { 7621 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'loaded'); 7622 imgCompleted(img); 7623 } 7624 7625 function imgFailed (img) { 7626 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, 'failed'); 7627 imgCompleted(img); 7628 } 7629 7630 function imgCompleted (img) { 7631 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(img, imgCompleteClass); 7632 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(img, 'loading'); 7633 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(img, imgEvents); 7634 } 7635 7636 function getImageArray (start, end, imgSelector) { 7637 var imgs = []; 7638 if (!imgSelector) { imgSelector = 'img'; } 7639 7640 while (start <= end) { 7641 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems[start].querySelectorAll(imgSelector), function (img) { imgs.push(img); }); 7642 start++; 7643 } 7644 7645 return imgs; 7646 } 7647 7648 // check if all visible images are loaded 7649 // and update container height if it's done 7650 function doAutoHeight () { 7651 var imgs = getImageArray.apply(null, getVisibleSlideRange()); 7652 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(imgs, updateInnerWrapperHeight); }); 7653 } 7654 7655 function imgsLoadedCheck (imgs, cb) { 7656 // execute callback function if all images are complete 7657 if (imgsComplete) { return cb(); } 7658 7659 // check image classes 7660 imgs.forEach(function (img, index) { 7661 if (!lazyload && img.complete) { imgCompleted(img); } // Check image.complete 7662 if (Object(_helpers_hasClass_js__WEBPACK_IMPORTED_MODULE_16__["hasClass"])(img, imgCompleteClass)) { imgs.splice(index, 1); } 7663 }); 7664 7665 // execute callback function if selected images are all complete 7666 if (!imgs.length) { return cb(); } 7667 7668 // otherwise execute this functiona again 7669 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ imgsLoadedCheck(imgs, cb); }); 7670 } 7671 7672 function additionalUpdates () { 7673 doLazyLoad(); 7674 updateSlideStatus(); 7675 updateLiveRegion(); 7676 updateControlsStatus(); 7677 updateNavStatus(); 7678 } 7679 7680 7681 function update_carousel_transition_duration () { 7682 if (carousel && autoHeight) { 7683 middleWrapper.style[TRANSITIONDURATION] = speed / 1000 + 's'; 7684 } 7685 } 7686 7687 function getMaxSlideHeight (slideStart, slideRange) { 7688 var heights = []; 7689 for (var i = slideStart, l = Math.min(slideStart + slideRange, slideCountNew); i < l; i++) { 7690 heights.push(slideItems[i].offsetHeight); 7691 } 7692 7693 return Math.max.apply(null, heights); 7694 } 7695 7696 // update inner wrapper height 7697 // 1. get the max-height of the visible slides 7698 // 2. set transitionDuration to speed 7699 // 3. update inner wrapper height to max-height 7700 // 4. set transitionDuration to 0s after transition done 7701 function updateInnerWrapperHeight () { 7702 var maxHeight = autoHeight ? getMaxSlideHeight(index, items) : getMaxSlideHeight(cloneCount, slideCount), 7703 wp = middleWrapper ? middleWrapper : innerWrapper; 7704 7705 if (wp.style.height !== maxHeight) { wp.style.height = maxHeight + 'px'; } 7706 } 7707 7708 // get the distance from the top edge of the first slide to each slide 7709 // (init) => slidePositions 7710 function setSlidePositions () { 7711 slidePositions = [0]; 7712 var attr = horizontal ? 'left' : 'top', 7713 attr2 = horizontal ? 'right' : 'bottom', 7714 base = slideItems[0].getBoundingClientRect()[attr]; 7715 7716 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(item, i) { 7717 // skip the first slide 7718 if (i) { slidePositions.push(item.getBoundingClientRect()[attr] - base); } 7719 // add the end edge 7720 if (i === slideCountNew - 1) { slidePositions.push(item.getBoundingClientRect()[attr2] - base); } 7721 }); 7722 } 7723 7724 // update slide 7725 function updateSlideStatus () { 7726 var range = getVisibleSlideRange(), 7727 start = range[0], 7728 end = range[1]; 7729 7730 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(item, i) { 7731 // show slides 7732 if (i >= start && i <= end) { 7733 if (Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(item, 'aria-hidden')) { 7734 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(item, ['aria-hidden', 'tabindex']); 7735 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, slideActiveClass); 7736 } 7737 // hide slides 7738 } else { 7739 if (!Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(item, 'aria-hidden')) { 7740 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(item, { 7741 'aria-hidden': 'true', 7742 'tabindex': '-1' 7743 }); 7744 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, slideActiveClass); 7745 } 7746 } 7747 }); 7748 } 7749 7750 // gallery: update slide position 7751 function updateGallerySlidePositions () { 7752 var l = index + Math.min(slideCount, items); 7753 for (var i = slideCountNew; i--;) { 7754 var item = slideItems[i]; 7755 7756 if (i >= index && i < l) { 7757 // add transitions to visible slides when adjusting their positions 7758 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, 'tns-moving'); 7759 7760 item.style.left = (i - index) * 100 / items + '%'; 7761 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateIn); 7762 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateNormal); 7763 } else if (item.style.left) { 7764 item.style.left = ''; 7765 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateNormal); 7766 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateIn); 7767 } 7768 7769 // remove outlet animation 7770 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateOut); 7771 } 7772 7773 // removing '.tns-moving' 7774 setTimeout(function() { 7775 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_15__["forEach"])(slideItems, function(el) { 7776 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(el, 'tns-moving'); 7777 }); 7778 }, 300); 7779 } 7780 7781 // set tabindex on Nav 7782 function updateNavStatus () { 7783 // get current nav 7784 if (nav) { 7785 navCurrentIndex = navClicked >= 0 ? navClicked : getCurrentNavIndex(); 7786 navClicked = -1; 7787 7788 if (navCurrentIndex !== navCurrentIndexCached) { 7789 var navPrev = navItems[navCurrentIndexCached], 7790 navCurrent = navItems[navCurrentIndex]; 7791 7792 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navPrev, { 7793 'tabindex': '-1', 7794 'aria-label': navStr + (navCurrentIndexCached + 1) 7795 }); 7796 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(navPrev, navActiveClass); 7797 7798 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(navCurrent, {'aria-label': navStr + (navCurrentIndex + 1) + navStrCurrent}); 7799 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_22__["removeAttrs"])(navCurrent, 'tabindex'); 7800 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(navCurrent, navActiveClass); 7801 7802 navCurrentIndexCached = navCurrentIndex; 7803 } 7804 } 7805 } 7806 7807 function getLowerCaseNodeName (el) { 7808 return el.nodeName.toLowerCase(); 7809 } 7810 7811 function isButton (el) { 7812 return getLowerCaseNodeName(el) === 'button'; 7813 } 7814 7815 function isAriaDisabled (el) { 7816 return el.getAttribute('aria-disabled') === 'true'; 7817 } 7818 7819 function disEnableElement (isButton, el, val) { 7820 if (isButton) { 7821 el.disabled = val; 7822 } else { 7823 el.setAttribute('aria-disabled', val.toString()); 7824 } 7825 } 7826 7827 // set 'disabled' to true on controls when reach the edges 7828 function updateControlsStatus () { 7829 if (!controls || rewind || loop) { return; } 7830 7831 var prevDisabled = (prevIsButton) ? prevButton.disabled : isAriaDisabled(prevButton), 7832 nextDisabled = (nextIsButton) ? nextButton.disabled : isAriaDisabled(nextButton), 7833 disablePrev = (index <= indexMin) ? true : false, 7834 disableNext = (!rewind && index >= indexMax) ? true : false; 7835 7836 if (disablePrev && !prevDisabled) { 7837 disEnableElement(prevIsButton, prevButton, true); 7838 } 7839 if (!disablePrev && prevDisabled) { 7840 disEnableElement(prevIsButton, prevButton, false); 7841 } 7842 if (disableNext && !nextDisabled) { 7843 disEnableElement(nextIsButton, nextButton, true); 7844 } 7845 if (!disableNext && nextDisabled) { 7846 disEnableElement(nextIsButton, nextButton, false); 7847 } 7848 } 7849 7850 // set duration 7851 function resetDuration (el, str) { 7852 if (TRANSITIONDURATION) { el.style[TRANSITIONDURATION] = str; } 7853 } 7854 7855 function getSliderWidth () { 7856 return fixedWidth ? (fixedWidth + gutter) * slideCountNew : slidePositions[slideCountNew]; 7857 } 7858 7859 function getCenterGap (num) { 7860 if (num == null) { num = index; } 7861 7862 var gap = edgePadding ? gutter : 0; 7863 return autoWidth ? ((viewport - gap) - (slidePositions[num + 1] - slidePositions[num] - gutter))/2 : 7864 fixedWidth ? (viewport - fixedWidth) / 2 : 7865 (items - 1) / 2; 7866 } 7867 7868 function getRightBoundary () { 7869 var gap = edgePadding ? gutter : 0, 7870 result = (viewport + gap) - getSliderWidth(); 7871 7872 if (center && !loop) { 7873 result = fixedWidth ? - (fixedWidth + gutter) * (slideCountNew - 1) - getCenterGap() : 7874 getCenterGap(slideCountNew - 1) - slidePositions[slideCountNew - 1]; 7875 } 7876 if (result > 0) { result = 0; } 7877 7878 return result; 7879 } 7880 7881 function getContainerTransformValue (num) { 7882 if (num == null) { num = index; } 7883 7884 var val; 7885 if (horizontal && !autoWidth) { 7886 if (fixedWidth) { 7887 val = - (fixedWidth + gutter) * num; 7888 if (center) { val += getCenterGap(); } 7889 } else { 7890 var denominator = TRANSFORM ? slideCountNew : items; 7891 if (center) { num -= getCenterGap(); } 7892 val = - num * 100 / denominator; 7893 } 7894 } else { 7895 val = - slidePositions[num]; 7896 if (center && autoWidth) { 7897 val += getCenterGap(); 7898 } 7899 } 7900 7901 if (hasRightDeadZone) { val = Math.max(val, rightBoundary); } 7902 7903 val += (horizontal && !autoWidth && !fixedWidth) ? '%' : 'px'; 7904 7905 return val; 7906 } 7907 7908 function doContainerTransformSilent (val) { 7909 resetDuration(container, '0s'); 7910 doContainerTransform(val); 7911 } 7912 7913 function doContainerTransform (val) { 7914 if (val == null) { val = getContainerTransformValue(); } 7915 container.style[transformAttr] = transformPrefix + val + transformPostfix; 7916 } 7917 7918 function animateSlide (number, classOut, classIn, isOut) { 7919 var l = number + items; 7920 if (!loop) { l = Math.min(l, slideCountNew); } 7921 7922 for (var i = number; i < l; i++) { 7923 var item = slideItems[i]; 7924 7925 // set item positions 7926 if (!isOut) { item.style.left = (i - index) * 100 / items + '%'; } 7927 7928 if (animateDelay && TRANSITIONDELAY) { 7929 item.style[TRANSITIONDELAY] = item.style[ANIMATIONDELAY] = animateDelay * (i - number) / 1000 + 's'; 7930 } 7931 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, classOut); 7932 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, classIn); 7933 7934 if (isOut) { slideItemsOut.push(item); } 7935 } 7936 } 7937 7938 // make transfer after click/drag: 7939 // 1. change 'transform' property for mordern browsers 7940 // 2. change 'left' property for legacy browsers 7941 var transformCore = (function () { 7942 return carousel ? 7943 function () { 7944 resetDuration(container, ''); 7945 if (TRANSITIONDURATION || !speed) { 7946 // for morden browsers with non-zero duration or 7947 // zero duration for all browsers 7948 doContainerTransform(); 7949 // run fallback function manually 7950 // when duration is 0 / container is hidden 7951 if (!speed || !Object(_helpers_isVisible_js__WEBPACK_IMPORTED_MODULE_26__["isVisible"])(container)) { onTransitionEnd(); } 7952 7953 } else { 7954 // for old browser with non-zero duration 7955 Object(_helpers_jsTransform_js__WEBPACK_IMPORTED_MODULE_33__["jsTransform"])(container, transformAttr, transformPrefix, transformPostfix, getContainerTransformValue(), speed, onTransitionEnd); 7956 } 7957 7958 if (!horizontal) { updateContentWrapperHeight(); } 7959 } : 7960 function () { 7961 slideItemsOut = []; 7962 7963 var eve = {}; 7964 eve[TRANSITIONEND] = eve[ANIMATIONEND] = onTransitionEnd; 7965 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(slideItems[indexCached], eve); 7966 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(slideItems[index], eve); 7967 7968 animateSlide(indexCached, animateIn, animateOut, true); 7969 animateSlide(index, animateNormal, animateIn); 7970 7971 // run fallback function manually 7972 // when transition or animation not supported / duration is 0 7973 if (!TRANSITIONEND || !ANIMATIONEND || !speed || !Object(_helpers_isVisible_js__WEBPACK_IMPORTED_MODULE_26__["isVisible"])(container)) { onTransitionEnd(); } 7974 }; 7975 })(); 7976 7977 function render (e, sliderMoved) { 7978 if (updateIndexBeforeTransform) { updateIndex(); } 7979 7980 // render when slider was moved (touch or drag) even though index may not change 7981 if (index !== indexCached || sliderMoved) { 7982 // events 7983 events.emit('indexChanged', info()); 7984 events.emit('transitionStart', info()); 7985 if (autoHeight) { doAutoHeight(); } 7986 7987 // pause autoplay when click or keydown from user 7988 if (animating && e && ['click', 'keydown'].indexOf(e.type) >= 0) { stopAutoplay(); } 7989 7990 running = true; 7991 transformCore(); 7992 } 7993 } 7994 7995 /* 7996 * Transfer prefixed properties to the same format 7997 * CSS: -Webkit-Transform => webkittransform 7998 * JS: WebkitTransform => webkittransform 7999 * @param {string} str - property 8000 * 8001 */ 8002 function strTrans (str) { 8003 return str.toLowerCase().replace(/-/g, ''); 8004 } 8005 8006 // AFTER TRANSFORM 8007 // Things need to be done after a transfer: 8008 // 1. check index 8009 // 2. add classes to visible slide 8010 // 3. disable controls buttons when reach the first/last slide in non-loop slider 8011 // 4. update nav status 8012 // 5. lazyload images 8013 // 6. update container height 8014 function onTransitionEnd (event) { 8015 // check running on gallery mode 8016 // make sure trantionend/animationend events run only once 8017 if (carousel || running) { 8018 events.emit('transitionEnd', info(event)); 8019 8020 if (!carousel && slideItemsOut.length > 0) { 8021 for (var i = 0; i < slideItemsOut.length; i++) { 8022 var item = slideItemsOut[i]; 8023 // set item positions 8024 item.style.left = ''; 8025 8026 if (ANIMATIONDELAY && TRANSITIONDELAY) { 8027 item.style[ANIMATIONDELAY] = ''; 8028 item.style[TRANSITIONDELAY] = ''; 8029 } 8030 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(item, animateOut); 8031 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_17__["addClass"])(item, animateNormal); 8032 } 8033 } 8034 8035 /* update slides, nav, controls after checking ... 8036 * => legacy browsers who don't support 'event' 8037 * have to check event first, otherwise event.target will cause an error 8038 * => or 'gallery' mode: 8039 * + event target is slide item 8040 * => or 'carousel' mode: 8041 * + event target is container, 8042 * + event.property is the same with transform attribute 8043 */ 8044 if (!event || 8045 !carousel && event.target.parentNode === container || 8046 event.target === container && strTrans(event.propertyName) === strTrans(transformAttr)) { 8047 8048 if (!updateIndexBeforeTransform) { 8049 var indexTem = index; 8050 updateIndex(); 8051 if (index !== indexTem) { 8052 events.emit('indexChanged', info()); 8053 8054 doContainerTransformSilent(); 8055 } 8056 } 8057 8058 if (nested === 'inner') { events.emit('innerLoaded', info()); } 8059 running = false; 8060 indexCached = index; 8061 } 8062 } 8063 8064 } 8065 8066 // # ACTIONS 8067 function goTo (targetIndex, e) { 8068 if (freeze) { return; } 8069 8070 // prev slideBy 8071 if (targetIndex === 'prev') { 8072 onControlsClick(e, -1); 8073 8074 // next slideBy 8075 } else if (targetIndex === 'next') { 8076 onControlsClick(e, 1); 8077 8078 // go to exact slide 8079 } else { 8080 if (running) { 8081 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 8082 } 8083 8084 var absIndex = getAbsIndex(), 8085 indexGap = 0; 8086 8087 if (targetIndex === 'first') { 8088 indexGap = - absIndex; 8089 } else if (targetIndex === 'last') { 8090 indexGap = carousel ? slideCount - items - absIndex : slideCount - 1 - absIndex; 8091 } else { 8092 if (typeof targetIndex !== 'number') { targetIndex = parseInt(targetIndex); } 8093 8094 if (!isNaN(targetIndex)) { 8095 // from directly called goTo function 8096 if (!e) { targetIndex = Math.max(0, Math.min(slideCount - 1, targetIndex)); } 8097 8098 indexGap = targetIndex - absIndex; 8099 } 8100 } 8101 8102 // gallery: make sure new page won't overlap with current page 8103 if (!carousel && indexGap && Math.abs(indexGap) < items) { 8104 var factor = indexGap > 0 ? 1 : -1; 8105 indexGap += (index + indexGap - slideCount) >= indexMin ? slideCount * factor : slideCount * 2 * factor * -1; 8106 } 8107 8108 index += indexGap; 8109 8110 // make sure index is in range 8111 if (carousel && loop) { 8112 if (index < indexMin) { index += slideCount; } 8113 if (index > indexMax) { index -= slideCount; } 8114 } 8115 8116 // if index is changed, start rendering 8117 if (getAbsIndex(index) !== getAbsIndex(indexCached)) { 8118 render(e); 8119 } 8120 8121 } 8122 } 8123 8124 // on controls click 8125 function onControlsClick (e, dir) { 8126 if (running) { 8127 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 8128 } 8129 var passEventObject; 8130 8131 if (!dir) { 8132 e = getEvent(e); 8133 var target = getTarget(e); 8134 8135 while (target !== controlsContainer && [prevButton, nextButton].indexOf(target) < 0) { target = target.parentNode; } 8136 8137 var targetIn = [prevButton, nextButton].indexOf(target); 8138 if (targetIn >= 0) { 8139 passEventObject = true; 8140 dir = targetIn === 0 ? -1 : 1; 8141 } 8142 } 8143 8144 if (rewind) { 8145 if (index === indexMin && dir === -1) { 8146 goTo('last', e); 8147 return; 8148 } else if (index === indexMax && dir === 1) { 8149 goTo('first', e); 8150 return; 8151 } 8152 } 8153 8154 if (dir) { 8155 index += slideBy * dir; 8156 if (autoWidth) { index = Math.floor(index); } 8157 // pass e when click control buttons or keydown 8158 render((passEventObject || (e && e.type === 'keydown')) ? e : null); 8159 } 8160 } 8161 8162 // on nav click 8163 function onNavClick (e) { 8164 if (running) { 8165 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 8166 } 8167 8168 e = getEvent(e); 8169 var target = getTarget(e), navIndex; 8170 8171 // find the clicked nav item 8172 while (target !== navContainer && !Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(target, 'data-nav')) { target = target.parentNode; } 8173 if (Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(target, 'data-nav')) { 8174 var navIndex = navClicked = Number(Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(target, 'data-nav')), 8175 targetIndexBase = fixedWidth || autoWidth ? navIndex * slideCount / pages : navIndex * items, 8176 targetIndex = navAsThumbnails ? navIndex : Math.min(Math.ceil(targetIndexBase), slideCount - 1); 8177 goTo(targetIndex, e); 8178 8179 if (navCurrentIndex === navIndex) { 8180 if (animating) { stopAutoplay(); } 8181 navClicked = -1; // reset navClicked 8182 } 8183 } 8184 } 8185 8186 // autoplay functions 8187 function setAutoplayTimer () { 8188 autoplayTimer = setInterval(function () { 8189 onControlsClick(null, autoplayDirection); 8190 }, autoplayTimeout); 8191 8192 animating = true; 8193 } 8194 8195 function stopAutoplayTimer () { 8196 clearInterval(autoplayTimer); 8197 animating = false; 8198 } 8199 8200 function updateAutoplayButton (action, txt) { 8201 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_21__["setAttrs"])(autoplayButton, {'data-action': action}); 8202 autoplayButton.innerHTML = autoplayHtmlStrings[0] + action + autoplayHtmlStrings[1] + txt; 8203 } 8204 8205 function startAutoplay () { 8206 setAutoplayTimer(); 8207 if (autoplayButton) { updateAutoplayButton('stop', autoplayText[1]); } 8208 } 8209 8210 function stopAutoplay () { 8211 stopAutoplayTimer(); 8212 if (autoplayButton) { updateAutoplayButton('start', autoplayText[0]); } 8213 } 8214 8215 // programaitcally play/pause the slider 8216 function play () { 8217 if (autoplay && !animating) { 8218 startAutoplay(); 8219 autoplayUserPaused = false; 8220 } 8221 } 8222 function pause () { 8223 if (animating) { 8224 stopAutoplay(); 8225 autoplayUserPaused = true; 8226 } 8227 } 8228 8229 function toggleAutoplay () { 8230 if (animating) { 8231 stopAutoplay(); 8232 autoplayUserPaused = true; 8233 } else { 8234 startAutoplay(); 8235 autoplayUserPaused = false; 8236 } 8237 } 8238 8239 function onVisibilityChange () { 8240 if (doc.hidden) { 8241 if (animating) { 8242 stopAutoplayTimer(); 8243 autoplayVisibilityPaused = true; 8244 } 8245 } else if (autoplayVisibilityPaused) { 8246 setAutoplayTimer(); 8247 autoplayVisibilityPaused = false; 8248 } 8249 } 8250 8251 function mouseoverPause () { 8252 if (animating) { 8253 stopAutoplayTimer(); 8254 autoplayHoverPaused = true; 8255 } 8256 } 8257 8258 function mouseoutRestart () { 8259 if (autoplayHoverPaused) { 8260 setAutoplayTimer(); 8261 autoplayHoverPaused = false; 8262 } 8263 } 8264 8265 // keydown events on document 8266 function onDocumentKeydown (e) { 8267 e = getEvent(e); 8268 var keyIndex = [KEYS.LEFT, KEYS.RIGHT].indexOf(e.keyCode); 8269 8270 if (keyIndex >= 0) { 8271 onControlsClick(e, keyIndex === 0 ? -1 : 1); 8272 } 8273 } 8274 8275 // on key control 8276 function onControlsKeydown (e) { 8277 e = getEvent(e); 8278 var keyIndex = [KEYS.LEFT, KEYS.RIGHT].indexOf(e.keyCode); 8279 8280 if (keyIndex >= 0) { 8281 if (keyIndex === 0) { 8282 if (!prevButton.disabled) { onControlsClick(e, -1); } 8283 } else if (!nextButton.disabled) { 8284 onControlsClick(e, 1); 8285 } 8286 } 8287 } 8288 8289 // set focus 8290 function setFocus (el) { 8291 el.focus(); 8292 } 8293 8294 // on key nav 8295 function onNavKeydown (e) { 8296 e = getEvent(e); 8297 var curElement = doc.activeElement; 8298 if (!Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_19__["hasAttr"])(curElement, 'data-nav')) { return; } 8299 8300 // var code = e.keyCode, 8301 var keyIndex = [KEYS.LEFT, KEYS.RIGHT, KEYS.ENTER, KEYS.SPACE].indexOf(e.keyCode), 8302 navIndex = Number(Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_20__["getAttr"])(curElement, 'data-nav')); 8303 8304 if (keyIndex >= 0) { 8305 if (keyIndex === 0) { 8306 if (navIndex > 0) { setFocus(navItems[navIndex - 1]); } 8307 } else if (keyIndex === 1) { 8308 if (navIndex < pages - 1) { setFocus(navItems[navIndex + 1]); } 8309 } else { 8310 navClicked = navIndex; 8311 goTo(navIndex, e); 8312 } 8313 } 8314 } 8315 8316 function getEvent (e) { 8317 e = e || win.event; 8318 return isTouchEvent(e) ? e.changedTouches[0] : e; 8319 } 8320 function getTarget (e) { 8321 return e.target || win.event.srcElement; 8322 } 8323 8324 function isTouchEvent (e) { 8325 return e.type.indexOf('touch') >= 0; 8326 } 8327 8328 function preventDefaultBehavior (e) { 8329 e.preventDefault ? e.preventDefault() : e.returnValue = false; 8330 } 8331 8332 function getMoveDirectionExpected () { 8333 return Object(_helpers_getTouchDirection_js__WEBPACK_IMPORTED_MODULE_14__["getTouchDirection"])(Object(_helpers_toDegree_js__WEBPACK_IMPORTED_MODULE_13__["toDegree"])(lastPosition.y - initPosition.y, lastPosition.x - initPosition.x), swipeAngle) === options.axis; 8334 } 8335 8336 function onPanStart (e) { 8337 if (running) { 8338 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 8339 } 8340 8341 if (autoplay && animating) { stopAutoplayTimer(); } 8342 8343 panStart = true; 8344 if (rafIndex) { 8345 Object(_helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__["caf"])(rafIndex); 8346 rafIndex = null; 8347 } 8348 8349 var $ = getEvent(e); 8350 events.emit(isTouchEvent(e) ? 'touchStart' : 'dragStart', info(e)); 8351 8352 if (!isTouchEvent(e) && ['img', 'a'].indexOf(getLowerCaseNodeName(getTarget(e))) >= 0) { 8353 preventDefaultBehavior(e); 8354 } 8355 8356 lastPosition.x = initPosition.x = $.clientX; 8357 lastPosition.y = initPosition.y = $.clientY; 8358 if (carousel) { 8359 translateInit = parseFloat(container.style[transformAttr].replace(transformPrefix, '')); 8360 resetDuration(container, '0s'); 8361 } 8362 } 8363 8364 function onPanMove (e) { 8365 if (panStart) { 8366 var $ = getEvent(e); 8367 lastPosition.x = $.clientX; 8368 lastPosition.y = $.clientY; 8369 8370 if (carousel) { 8371 if (!rafIndex) { rafIndex = Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ panUpdate(e); }); } 8372 } else { 8373 if (moveDirectionExpected === '?') { moveDirectionExpected = getMoveDirectionExpected(); } 8374 if (moveDirectionExpected) { preventScroll = true; } 8375 } 8376 8377 if ((typeof e.cancelable !== 'boolean' || e.cancelable) && preventScroll) { 8378 e.preventDefault(); 8379 } 8380 } 8381 } 8382 8383 function panUpdate (e) { 8384 if (!moveDirectionExpected) { 8385 panStart = false; 8386 return; 8387 } 8388 Object(_helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__["caf"])(rafIndex); 8389 if (panStart) { rafIndex = Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function(){ panUpdate(e); }); } 8390 8391 if (moveDirectionExpected === '?') { moveDirectionExpected = getMoveDirectionExpected(); } 8392 if (moveDirectionExpected) { 8393 if (!preventScroll && isTouchEvent(e)) { preventScroll = true; } 8394 8395 try { 8396 if (e.type) { events.emit(isTouchEvent(e) ? 'touchMove' : 'dragMove', info(e)); } 8397 } catch(err) {} 8398 8399 var x = translateInit, 8400 dist = getDist(lastPosition, initPosition); 8401 if (!horizontal || fixedWidth || autoWidth) { 8402 x += dist; 8403 x += 'px'; 8404 } else { 8405 var percentageX = TRANSFORM ? dist * items * 100 / ((viewport + gutter) * slideCountNew): dist * 100 / (viewport + gutter); 8406 x += percentageX; 8407 x += '%'; 8408 } 8409 8410 container.style[transformAttr] = transformPrefix + x + transformPostfix; 8411 } 8412 } 8413 8414 function onPanEnd (e) { 8415 if (panStart) { 8416 if (rafIndex) { 8417 Object(_helpers_caf_js__WEBPACK_IMPORTED_MODULE_1__["caf"])(rafIndex); 8418 rafIndex = null; 8419 } 8420 if (carousel) { resetDuration(container, ''); } 8421 panStart = false; 8422 8423 var $ = getEvent(e); 8424 lastPosition.x = $.clientX; 8425 lastPosition.y = $.clientY; 8426 var dist = getDist(lastPosition, initPosition); 8427 8428 if (Math.abs(dist)) { 8429 // drag vs click 8430 if (!isTouchEvent(e)) { 8431 // prevent "click" 8432 var target = getTarget(e); 8433 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_30__["addEvents"])(target, {'click': function preventClick (e) { 8434 preventDefaultBehavior(e); 8435 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_31__["removeEvents"])(target, {'click': preventClick}); 8436 }}); 8437 } 8438 8439 if (carousel) { 8440 rafIndex = Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_0__["raf"])(function() { 8441 if (horizontal && !autoWidth) { 8442 var indexMoved = - dist * items / (viewport + gutter); 8443 indexMoved = dist > 0 ? Math.floor(indexMoved) : Math.ceil(indexMoved); 8444 index += indexMoved; 8445 } else { 8446 var moved = - (translateInit + dist); 8447 if (moved <= 0) { 8448 index = indexMin; 8449 } else if (moved >= slidePositions[slideCountNew - 1]) { 8450 index = indexMax; 8451 } else { 8452 var i = 0; 8453 while (i < slideCountNew && moved >= slidePositions[i]) { 8454 index = i; 8455 if (moved > slidePositions[i] && dist < 0) { index += 1; } 8456 i++; 8457 } 8458 } 8459 } 8460 8461 render(e, dist); 8462 events.emit(isTouchEvent(e) ? 'touchEnd' : 'dragEnd', info(e)); 8463 }); 8464 } else { 8465 if (moveDirectionExpected) { 8466 onControlsClick(e, dist > 0 ? -1 : 1); 8467 } 8468 } 8469 } 8470 } 8471 8472 // reset 8473 if (options.preventScrollOnTouch === 'auto') { preventScroll = false; } 8474 if (swipeAngle) { moveDirectionExpected = '?'; } 8475 if (autoplay && !animating) { setAutoplayTimer(); } 8476 } 8477 8478 // === RESIZE FUNCTIONS === // 8479 // (slidePositions, index, items) => vertical_conentWrapper.height 8480 function updateContentWrapperHeight () { 8481 var wp = middleWrapper ? middleWrapper : innerWrapper; 8482 wp.style.height = slidePositions[index + items] - slidePositions[index] + 'px'; 8483 } 8484 8485 function getPages () { 8486 var rough = fixedWidth ? (fixedWidth + gutter) * slideCount / viewport : slideCount / items; 8487 return Math.min(Math.ceil(rough), slideCount); 8488 } 8489 8490 /* 8491 * 1. update visible nav items list 8492 * 2. add "hidden" attributes to previous visible nav items 8493 * 3. remove "hidden" attrubutes to new visible nav items 8494 */ 8495 function updateNavVisibility () { 8496 if (!nav || navAsThumbnails) { return; } 8497 8498 if (pages !== pagesCached) { 8499 var min = pagesCached, 8500 max = pages, 8501 fn = _helpers_showElement_js__WEBPACK_IMPORTED_MODULE_25__["showElement"]; 8502 8503 if (pagesCached > pages) { 8504 min = pages; 8505 max = pagesCached; 8506 fn = _helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_24__["hideElement"]; 8507 } 8508 8509 while (min < max) { 8510 fn(navItems[min]); 8511 min++; 8512 } 8513 8514 // cache pages 8515 pagesCached = pages; 8516 } 8517 } 8518 8519 function info (e) { 8520 return { 8521 container: container, 8522 slideItems: slideItems, 8523 navContainer: navContainer, 8524 navItems: navItems, 8525 controlsContainer: controlsContainer, 8526 hasControls: hasControls, 8527 prevButton: prevButton, 8528 nextButton: nextButton, 8529 items: items, 8530 slideBy: slideBy, 8531 cloneCount: cloneCount, 8532 slideCount: slideCount, 8533 slideCountNew: slideCountNew, 8534 index: index, 8535 indexCached: indexCached, 8536 displayIndex: getCurrentSlide(), 8537 navCurrentIndex: navCurrentIndex, 8538 navCurrentIndexCached: navCurrentIndexCached, 8539 pages: pages, 8540 pagesCached: pagesCached, 8541 sheet: sheet, 8542 isOn: isOn, 8543 event: e || {}, 8544 }; 8545 } 8546 8547 return { 8548 version: '2.9.3', 8549 getInfo: info, 8550 events: events, 8551 goTo: goTo, 8552 play: play, 8553 pause: pause, 8554 isOn: isOn, 8555 updateSliderHeight: updateInnerWrapperHeight, 8556 refresh: initSliderTransform, 8557 destroy: destroy, 8558 rebuild: function() { 8559 return tns(Object(_helpers_extend_js__WEBPACK_IMPORTED_MODULE_2__["extend"])(options, optionsElements)); 8560 } 8561 }; 8562}; 8563 8564 8565/***/ }), 8566
8567/***/ "./src/components/heroes/heroes.js": 8568/*!*****************************************!*\ 8569 !*** ./src/components/heroes/heroes.js ***! 8570 \*****************************************/ 8571/*! no exports provided */ 8572/***/ (function(module, __webpack_exports__, __webpack_require__) { 8573 8574"use strict"; 8575__webpack_require__.r(__webpack_exports__); 8576/* harmony import */ var _js_main_script__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../js/main.script */ "./src/js/main.script.js"); 8577 8578 8579 8580 8581(function ($, Drupal) { 8582 $(document).ready(function () {// const tnsCarouselPrimary = document.querySelectorAll('.heroes-primary'); 8583 // tnsCarouselPrimary.forEach(slider => { 8584 // // if( $('.heroes-primary .heroes__item').length > 1) { 8585 // const heroes_primary__slider = document.tnsAda.init({ 8586 // container: slider.querySelector(".heroes__row"), 8587 // controlsContainer: slider.querySelector(".tns__controls"), 8588 // navContainer: slider.querySelector(".tns__dots"), 8589 // prevButton: slider.querySelector(".tns__arrow.prev"), 8590 // nextButton: slider.querySelector(".tns__arrow.next"), 8591 // navPosition: 'top', 8592 // gutter: 1, 8593 // 8594 // onInit(info) { 8595 // $('.path-home .heroes-primary .heroes').css("display","flex"); 8596 // 8597 // if( $(info).find('.heroes__item').length > 1) { 8598 // 8599 // info.controlsContainer.setAttribute('tabindex', -1); 8600 // info.nextButton.setAttribute('tabindex', 3); 8601 // info.prevButton.setAttribute('tabindex', 3); 8602 // 8603 // document.querySelectorAll('.tns-slide-cloned a').forEach(function(btn) { 8604 // btn.setAttribute('tabindex', -1); 8605 // }); 8606 // } 8607 // } 8608 // 8609 // }); 8610 // // } 8611 // }); 8612 // // if( $('.heroes-secondary .heroes__item').length > 1) { 8613 // const tnsCarouselSecondary = document.querySelectorAll('.heroes-secondary');
8614 // tnsCarouselSecondary.forEach(slider => { 8615 // const heroes_secondary__slider = document.tnsAda.init({ 8616 // container: slider.querySelector(".heroes__row"), 8617 // controlsContainer: slider.querySelector(".tns__controls"), 8618 // navContainer: slider.querySelector(".tns__dots"), 8619 // prevButton: slider.querySelector(".tns__arrow.prev"), 8620 // nextButton: slider.querySelector(".tns__arrow.next"), 8621 // navPosition: 'top', 8622 // 8623 // onInit(info) { 8624 // info.controlsContainer.setAttribute('tabindex', -1); 8625 // info.nextButton.setAttribute('tabindex', 3); 8626 // info.prevButton.setAttribute('tabindex', 3); 8627 // 8628 // document.querySelectorAll('.tns-slide-cloned a').forEach(function(btn) { 8629 // btn.setAttribute('tabindex', -1); 8630 // }); 8631 // } 8632 // }); 8633 // // } 8634 // }); 8635 }); 8636})(jQuery, Drupal); 8637 8638/***/ }), 8639
8640/***/ "./src/js/main.script.js": 8641/*!*******************************!*\ 8642 !*** ./src/js/main.script.js ***! 8643 \*******************************/ 8644/*! no exports provided */ 8645/***/ (function(module, __webpack_exports__, __webpack_require__) { 8646 8647"use strict"; 8648__webpack_require__.r(__webpack_exports__); 8649/* harmony import */ var _polyfill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./polyfill */ "./src/js/polyfill.js"); 8650/* harmony import */ var _polyfill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_polyfill__WEBPACK_IMPORTED_MODULE_0__); 8651/* harmony import */ var _tnsAda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tnsAda */ "./src/js/tnsAda.js"); 8652 8653 8654 8655 // import 'bootstrap'; 8656 8657(function ($, Drupal, drupalSettings) { 8658 // Responsive check helper: 8659 // USAGE: if (Drupal.device.isMobile()) {} 8660 Drupal.device = { 8661 isDesktop: function isDesktop() { 8662 return $(window).innerWidth() > 980; 8663 }, 8664 isTablet: function isTablet() { 8665 return $(window).innerWidth() <= 980 && $(window).innerWidth() > 728; 8666 }, 8667 isMobile: function isMobile() { 8668 return $(window).innerWidth() <= 728; 8669 } 8670 }; // Let the document know when the mouse is being used 8671 8672 document.body.addEventListener('mousedown', function () { 8673 document.body.classList.add('using-mouse'); 8674 }); // Re-enable focus styling when Tab is pressed 8675 8676 document.body.addEventListener('keydown', function (event) { 8677 if (event.keyCode === 9) { 8678 document.body.classList.remove('using-mouse'); 8679 } 8680 }); 8681 $('#ajax-wrapper .js-form-item-image-upload small #edit-image-upload--description').append("<small> No file chosen.</small>"); 8682 Drupal.behaviors.Bc_brandTheme = { 8683 attach: function attach(context, settings) { 8684 var host = window.location.host; 8685 $('a[href^="http"]:not([href*="' + host + '"])').each(function (index) { 8686 $(this).attr('rel', 'noopener nofollow'); 8687 }); 8688 $('[data-toggle="popover"]').each(function (index) { 8689 var $this = $(this); 8690 var $container = $this.closest('div'); 8691 $container.addClass('has-popover'); 8692 $this.appendTo($container); 8693 $this.popover({ 8694 template: '<div class="popover" role="tooltip"><div class="popover-body"></div></div>', 8695 container: $container 8696 }); 8697 }); 8698 $(".popover-button").click(function () { 8699 var controls = $(this).attr("aria-describedby"); 8700 $(".popover-button").removeAttr("aria-describedby"); 8701 $(".popover-button").attr("aria-expanded", function (index, attr) { 8702 return attr == "false" ? "true" : "false"; 8703 }); 8704 $(".popover-button").attr("aria-controls", function (index, attr) { 8705 return attr = controls; 8706 }); 8707 }); 8708 $('.webform-submission-newsletter-form-form .form-item-postal-code input').inputmask({ 8709 mask: ['99999', '99999-9999', 'A9A 9A9'], 8710 placeholder: '', 8711 clearIncomplete: true 8712 }); 8713 /** 8714 * SHARE COMPONENT 8715 */ 8716 8717 /** 8718 * Determine the mobile operating system. 8719 * This function returns one of 'iOS', 'Android', 'Windows Phone', or 'unknown'. 8720 * Based on: https://stackoverflow.com/questions/21741841/detecting-ios-android-operating-system 8721 * @returns {String} 8722 */ 8723 8724 function isAndroidIOS() { 8725 var userAgent = navigator.userAgent || navigator.vendor || window.opera; 8726 8727 if (/android/i.test(userAgent)) { 8728 console.log("android detected"); 8729 8730 if ($(".page-node-type-blog").length) { 8731 $(window).bind('orientationchange', function () { 8732 if ($(window).width() >= 728) { 8733 $(".article-detail__section-abstract .info-share .share-button").attr("aria-controls", "sharebox"); 8734 $(".article-detail__section-abstract .info-share .sharebox").attr("id", "sharebox"); 8735 $('.article-detail__back-and-share .info-share .share-button').removeAttr("aria-controls"); 8736 $('.article-detail__back-and-share .info-share .sharebox').removeAttr("id"); // console.log('desktop'); 8737 } else { 8738 // console.log("mobile"); 8739 $('.article-detail__back-and-share .info-share .share-button').attr("aria-controls", "sharebox"); 8740 $('.article-detail__back-and-share .info-share .sharebox').attr("id", "sharebox"); 8741 $(".article-detail__section-abstract .info-share .share-button").removeAttr("aria-controls"); 8742 $(".article-detail__section-abstract .info-share .sharebox").removeAttr("id"); 8743 } 8744 }).bind(); 8745 } 8746 8747 return true; 8748 } // iOS detection from: http://stackoverflow.com/a/9039885/177710 8749 8750 8751 if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { 8752 console.log("ios detected"); 8753 return true; 8754 } //not Android or iOS 8755 8756 8757 return false;
8758 } 8759 8760 function getMeta(metaName) { 8761 var metas = document.getElementsByTagName('meta'); 8762 8763 for (var i = 0; i < metas.length; i++) { 8764 if (metas[i].getAttribute('name') === metaName) { 8765 return metas[i].getAttribute('content'); 8766 } 8767 } 8768 8769 return ''; 8770 } 8771 8772 $('.share-button', context).on('click', function () { 8773 var isMobile = isAndroidIOS(); 8774 console.log(isMobile); 8775 8776 if (navigator.share && isMobile) { 8777 navigator.share({ 8778 title: document.title, 8779 text: getMeta('description'), 8780 url: document.href 8781 }).then(function () { 8782 return console.log('Successful share'); 8783 })["catch"](function (error) { 8784 return console.log('Error sharing', error); 8785 }); 8786 return null; 8787 } // console.log(this); 8788 // $(this).toggleClass('opened'); 8789 // // $(this).find('.icon').toggleClass('icon-share-close icon-share'); 8790 // $('.sharebox').toggleClass('opened'); 8791 // if ($(this).hasClass('opened')) { 8792 // $(this).attr('aria-expanded', 'true'); 8793 // } else { 8794 // $(this).attr('aria-expanded', 'false'); 8795 // } 8796 // $('.sharebox .close').focus(); 8797 8798 }); // $('.share-button').on("click", function (e) { 8799 // e.preventDefault(); 8800 // // $('.search__filters li a').addClass('hidden'); 8801 // console.log('toggle share'); 8802 // }); 8803 // $('.sharebox .close').on('click', function () { 8804 // $(this).parents('.opened').removeClass('opened'); 8805 // }); 8806 8807 var $temp = $("<input>"); 8808 var $url = $(location).attr('href'); 8809 $('.sharebox .copybutton').on('click', function () { 8810 // $('.copyfield input')[0].select(); 8811 // document.execCommand('copy'); 8812 $("body").append($temp); 8813 $temp.val($url).select(); 8814 document.execCommand("copy"); 8815 $temp.remove(); 8816 $('.copyfield .copymessage').addClass('shown'); 8817 setTimeout(function () { 8818 $('.copyfield .copymessage').removeClass('shown'); 8819 }, 10000); 8820 }); //Change Element type 8821 8822 $.fn.changeElementType = function (newType) { 8823 this.each(function () { 8824 var attrs = {}; 8825 $.each(this.attributes, function (idx, attr) { 8826 attrs[attr.nodeName] = attr.nodeValue; 8827 }); 8828 $(this).replaceWith(function () { 8829 return $("<" + newType + "/>", attrs).append($(this).contents()); 8830 }); 8831 }); 8832 }; // Detect Valid Keyboard Clicks 8833 // https://karlgroves.com/2014/11/24/ridiculously-easy-trick-for-keyboard-accessibility 8834 8835 8836 function a11yClick(event) { 8837 if (event.type === 'click') { 8838 return true; 8839 } else if (event.type === 'keypress') { 8840 var code = event.charCode || event.keyCode; 8841 8842 if (code === 32 || code === 13) { 8843 return true; 8844 } 8845 } else { 8846 return false; 8847 } 8848 } // Juicer/Slick accessibility tweaks. 8849 // $("#block-juiceren .juicer-feed").changeElementType("div"); 8850 8851 8852 $("#block-juiceren .juicer-feed").on('init', function (e, slick) { 8853 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active"); 8854 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active").removeAttr("aria-hidden"); 8855 setTimeout(function () { 8856 // Set slick's accessibility option to false as recommended here: 8857 // https://hub.accessible360.com/kb/articles/521#heading-tip-3-disable-accessibility-mode 8858 if ($("#block-juiceren .juicer-feed").hasClass('slick-initialized')) { 8859 $("#block-juiceren .juicer-feed.slick-initialized").slick('slickSetOption', { 8860 accessibility: false 8861 }, true); 8862 } 8863 8864 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active").removeAttr("aria-hidden"); 8865 }, 1000); 8866 $("#block-juiceren .juicer-feed .slick-list .feed-item .j-text a").removeAttr("tabindex").css("color", "white").changeElementType("span"); 8867 $("#block-juiceren .juicer-feed .slick-list").find(".slick-track .feed-item").attr("role", "group"); 8868 $("#block-juiceren .juicer-feed .slick-list .feed-item .j-text .j-meta nav").addClass('j-meta-nav').changeElementType("div"); 8869 $('#block-juiceren .juicer-feed .slick-list .feed-item').on('click', function () { 8870 window.open($(this).find('a').attr('href')); // console.log('test'); 8871 8872 return false;
8873 }); // Play icon. 8874 8875 var $imageVideo = $("#block-juiceren .juicer-feed .slick-list .feed-item.j-video .j-image"); 8876 var playIcon = '<span class="j-video-icon" aria-hidden="true"></span>'; 8877 $imageVideo.append(playIcon); 8878 $("#block-juiceren .juicer-feed .slick-list .feed-item", context).each(function (i, e) { 8879 var alt = $(e).find(".j-image img").attr("alt"), 8880 message = $(e).find(".j-message").text(), 8881 label = Number($(e).attr("data-slick-index")) + 1, 8882 totalSlide = $("#block-juiceren .juicer-feed .slick-list .feed-item").length; 8883 $(e).attr({ 8884 "aria-label": "Slide " + label + " of " + totalSlide 8885 }); // if (alt) { 8886 // $(e).find(".j-image img").attr("alt", alt.replace('Photo from ', '')); 8887 // } 8888 8889 $(e).find(".j-image img").attr("alt", message); // Social icon screen reader text. 8890 8891 var $social = $(this).find('.j-social'); 8892 var socialIcon = '<span class="j-social-icon" aria-hidden="true"></span> <span class="sr-only">' + $social.attr('aria-label') + '</span>'; 8893 $social.append(socialIcon).removeAttr('aria-label'); 8894 }); 8895 $(".slick-next, .slick-prev").on("click keypress", function (event) { 8896 if (a11yClick(event) === true) { 8897 setTimeout(function () { 8898 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active a").first().focus(); 8899 }, 100); 8900 } 8901 }); //update all j-meta a tags to say comments or likes 8902 8903 $(".comments, .repins").each(function () { 8904 var numComments = $(this).text(); 8905 $(this).html(numComments + ' <span class="sr-only">comments</div>'); 8906 }); 8907 $(".likes").each(function () { 8908 var numLikes = $(this).text(); 8909 $(this).html(numLikes + ' <span class="sr-only">likes</div>'); 8910 }); 8911 }); 8912 $("#block-juiceren .juicer-feed").on('beforeChange', function (e, slick, currentSlide, nextSlide) { 8913 $("#block-juiceren .juicer-feed .slick-list .feed-item").removeAttr("aria-hidden"); 8914 }); 8915 $("#block-juiceren .juicer-feed").on('afterChange', function (e, slick, currentSlide) { 8916 setTimeout(function () { 8917 $("#block-juiceren .juicer-feed .slick-list .feed-item.slick-active").removeAttr("aria-hidden"); 8918 }, 500); 8919 }); 8920 8921 if ($('#prodH1').length > 0) { 8922 var root = document.getElementById('prodH1'); 8923 root.style.setProperty('--h1-height', root.clientHeight + 'px'); 8924 $(".products--full").addClass("loaded"); 8925 console.log('root.clientHeight', root.clientHeight); 8926 } // if($(".error").length) { 8927 8928 8929 $('#user-login-form .form-submit').on('click', function () { 8930 // console.log("ERROR MESSAGE"); 8931 setTimeout(function () { 8932 if ($("label").hasClass("error")) { 8933 console.log("ERROR"); 8934 $("#user-login-form").addClass("login-errors"); 8935 } 8936 }, 600); 8937 }); 8938 $('#user-login-form input.required').on('input', function () { 8939 setTimeout(function () { 8940 if ($("label").hasClass("error")) { 8941 console.log("ERROR2"); 8942 $("#user-login-form").addClass("login-errors"); 8943 } 8944 8945 if ($('#user-login-form label').css('display') == 'none') { 8946 // true 8947 console.log("ERROR FIXED"); 8948 $("#user-login-form").removeClass("login-errors"); 8949 } 8950 }, 600); 8951 }); // } 8952 // var altTxt = $("img").attr('alt'); 8953 8954 if ($('.blog-callout__image img').length > 0) { 8955 $(".blog-callout__image img").attr('alt', ''); 8956 } 8957 8958 if ($('.recipe-featured__col img').length > 0) { 8959 $(".recipe-featured__col img").attr('alt', ''); 8960 } 8961 8962 if ($('.recipes--full__image-frame img').length > 0) { 8963 $(".recipes--full__image-frame img").attr('alt', ''); 8964 } 8965 8966 if ($('.blog-teaser__image img').length > 0) { 8967 $(".blog-teaser__image img").attr('alt', ''); 8968 } // setTimeout 8969 // if ($('.recipe-featured__card img').length > 0) { 8970 // $(".recipe-featured__card img").attr('alt', ''); 8971 // console.log('here') 8972 // } 8973 8974 8975 setTimeout(function () { 8976 if ($('.recipe-featured__card img').length > 0) { 8977 $(".recipe-featured__card img").attr('alt', ''); 8978 } 8979 }, 12000); //identitcal id issue on blog page fix 8980 8981 if ($(".page-node-type-blog").length) { 8982 $(window).resize(function () { 8983 if ($(window).width() >= 728) { 8984 $(".article-detail__section-abstract .info-share .share-button").attr("aria-controls", "sharebox"); 8985 $(".article-detail__section-abstract .info-share .sharebox").attr("id", "sharebox"); 8986 $('.article-detail__back-and-share .info-share .share-button').removeAttr("aria-controls"); 8987 $('.article-detail__back-and-share .info-share .sharebox').removeAttr("id"); // console.log('desktop'); 8988 } else { 8989 // console.log("mobile"); 8990 $('.article-detail__back-and-share .info-share .share-button').attr("aria-controls", "sharebox"); 8991 $('.article-detail__back-and-share .info-share .sharebox').attr("id", "sharebox"); 8992 $(".article-detail__section-abstract .info-share .share-button").removeAttr("aria-controls"); 8993 $(".article-detail__section-abstract .info-share .sharebox").removeAttr("id"); 8994 } 8995 }).resize(); 8996 } 8997 } 8998 }; 8999 $("form input#edit-image-upload-upload-button--2").focusin(function (e) { 9000 $('label[for="edit-image-upload-upload-button--2"]').addClass("focused"); 9001 }); 9002 $("form input#edit-image-upload-upload-button--2").focusout(function (e) { 9003 $('label[for="edit-image-upload-upload-button--2"]').removeClass("focused"); 9004 }); //share button fix 9005 9006 $('.share-button').on('click', function () { 9007 $(this).toggleClass('opened'); 9008 $('.sharebox').toggleClass('opened'); 9009 9010 if ($(this).hasClass('opened')) { 9011 $(this).attr('aria-expanded', 'true'); 9012 } else { 9013 $(this).attr('aria-expanded', 'false'); 9014 } 9015 }); // if($(".share-button").length > 0) { 9016 // $('.share-button').on('click', function () { 9017 // console.log("yup clicked"); 9018 // $(this).addClass('opened'); 9019 // $('.sharebox').toggleClass('opened'); 9020 // }) 9021 // } 9022 // $(document).ready(function () { 9023 // // Function to handle aria-hidden for all child elements 9024 // function updateAriaHiddenState(element) { 9025 // if ($(element).attr('aria-hidden') === 'true') { 9026 // // Add aria-hidden="true" to all children 9027 // $(element).find('*').attr('aria-hidden', 'true'); 9028 // } else { 9029 // // Remove aria-hidden from all children 9030 // $(element).find('*').removeAttr('aria-hidden'); 9031 // } 9032 // } 9033 // // Initial check to apply or remove aria-hidden 9034 // $('.blog-featured-medium__item').each(function () { 9035 // updateAriaHiddenState(this); 9036 // }); 9037 // // MutationObserver to watch for changes to aria-hidden attribute 9038 // var observer = new MutationObserver(function (mutations) { 9039 // mutations.forEach(function (mutation) { 9040 // if (mutation.type === 'attributes' && mutation.attributeName === 'aria-hidden') { 9041 // // Update the aria-hidden state for the mutated element 9042 // updateAriaHiddenState(mutation.target); 9043 // } 9044 // }); 9045 // }); 9046 // // Apply the MutationObserver to each blog-featured-medium__item 9047 // $('.blog-featured-medium__item').each(function () { 9048 // observer.observe(this, { attributes: true }); // Watch for attribute changes 9049 // }); 9050 // }); 9051})(jQuery, Drupal, drupalSettings); 9052 9053/***/ }), 9054
9055/***/ "./src/js/polyfill.js": 9056/*!****************************!*\ 9057 !*** ./src/js/polyfill.js ***! 9058 \****************************/ 9059/*! no static exports found */ 9060/***/ (function(module, exports) { 9061 9062// Add your JS/node package pollyfills here 9063 9064/***/ }), 9065
9066/***/ "./src/js/tnsAda.js": 9067/*!**************************!*\ 9068 !*** ./src/js/tnsAda.js ***! 9069 \**************************/ 9070/*! exports provided: tns */ 9071/***/ (function(module, __webpack_exports__, __webpack_require__) { 9072 9073"use strict"; 9074__webpack_require__.r(__webpack_exports__); 9075/* harmony import */ var _node_modules_tiny_slider_src_tiny_slider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/tiny-slider/src/tiny-slider */ "./node_modules/tiny-slider/src/tiny-slider.js"); 9076/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tns", function() { return _node_modules_tiny_slider_src_tiny_slider__WEBPACK_IMPORTED_MODULE_0__["tns"]; }); 9077 9078// Carousel ADA remediation for TNS slider 2.9.2 9079// https://hub.accessible360.com/kb/articles/476 9080// https://confluence.millenniumweb.com/display/CKB/Accessible+Carousels 9081// 9082// Usage Example: 9083// document.tnsAda.init({ 9084// // ===== Just use standard tns config options 9085// container: '.your-selector-for-wrapping-element', 9086// items: 1, 9087// slideBy: 'page', 9088// autoplay: false, 9089// // ===== Options used for custom ADA code **all optional 9090// nav: true, // BOOLEAN: Create ADA bullet nav? 9091// controls: true, // BOOLEAN: Create ADA prev and next buttons? 9092// reverseNextPrev: false, // BOOLEAN: Reverse prev/next buttons? 9093// adaText: { // OBJECT: Custom text for ADA elements 9094// nav: '<span aria-hidden="true">•</span>', // STRING: Custom bullet nav text 9095// prev: '<span class="sr-only">Previous Slide</span> <i class="icon icon-circle-arrow-left icon-fill-tertiary" aria-hidden="true"></i>', // STRING: Custom prev button text 9096// next: '<span class="sr-only">Next Slide</span> <i class="icon icon-circle-arrow-right icon-fill-tertiary" aria-hidden="true"></i>', // STRING: Custom next button text 9097// instructions: 'This is a carousel. Use Next and Previous buttons to navigate, or jump to a slide with the slide dots.', // STRING: Custom instructions text 9098// goTo: 'Go to slide [x]', // STRING: Custom go to slide text 9099// current: 'Slide [x] of [y]', // STRING: Custom current slide text 9100// } 9101// }); 9102// 9103// TODO: generate/find a unique id for the instance of the initialization. 9104// Use it to namespace all events so they can be unbound and the slider 9105// destroyed. could alternatively just put some logic in to prevent the 9106// same element from being initialized twice. 9107// 9108// TODO: import all currently hardcoded text strings so that the slider can be 9109// translatable. could use data-attributes. could grab them from the 9110// document.tnsAda object. could pass them in with the initialization. 9111// For drupal string translation having them in a template or block is 9112// probably easiest. 9113 9114 9115document.tnsAda = { 9116 init: function init(params) { 9117 //if the container element is not present. do nothing and exit. 9118 if (jQuery(params.container).length < 1) { 9119 return; 9120 } 9121 9122 var orig = this; // Definte options for ADA functions 9123 9124 var opt = { 9125 nav: params.nav, 9126 // Create a custom ADA bullet nav? 9127 controls: params.controls, 9128 // Create custom ADA prev and next buttons? 9129 reverseNextPrev: params.reverseNextPrev // Reverse the action of the next and previous buttons? 9130 9131 }; 9132 9133 if (!params.adaText) { 9134 params.adaText = {}; 9135 } 9136 9137 opt.adaText = { 9138 nav: params.adaText.nav || '<span aria-hidden="true">•</span>', 9139 prev: params.adaText.prev || '<span class="sr-only">Previous Slide</span> <i class="icon icon-circle-arrow-left icon-fill-tertiary" aria-hidden="true"></i>', 9140 next: params.adaText.next || '<span class="sr-only">Next Slide</span> <i class="icon icon-circle-arrow-right icon-fill-tertiary" aria-hidden="true"></i>', 9141 instructions: params.adaText.instructions || "This is a carousel. Use Next and Previous buttons to navigate, or jump to a slide with the slide dots.", 9142 goTo: params.adaText.goTo || "Go to slide [x]", 9143 current: params.adaText.current || "Slide [x] of [y]", 9144 slides: params.adaText.slides || "Slides" 9145 }; // Prepare params object for initialization 9146 9147 params.nav = false;
9148 params.controls = false; 9149 delete params.reverseNextPrev; 9150 delete params.adaText; // Initialize the slider and store it in our opt object. 9151 9152 opt.slider = Object(_node_modules_tiny_slider_src_tiny_slider__WEBPACK_IMPORTED_MODULE_0__["tns"])(params); 9153 9154 if (opt.controls) { 9155 orig.addControls(opt); 9156 } 9157 9158 if (opt.nav) { 9159 orig.addNav(opt); 9160 } 9161 9162 orig.oneTimeFixes(opt); 9163 }, 9164 oneTimeFixes: function oneTimeFixes(opt) { 9165 var orig = this, 9166 slider = opt.slider, 9167 info = slider.getInfo(), 9168 inner = jQuery(info.container).parents(".tns-inner"), 9169 outer = jQuery(info.container).parents(".tns-outer"), 9170 uiEnabled = true; // Add role attribute to the slides 9171 9172 inner.find(".tns-item").attr("role", "group"); // Remove non-compliant live region 9173 9174 outer.find(".tns-liveregion").removeAttr("aria-live").removeAttr("aria-atomic").attr("aria-hidden", "true").hide(); // Add role and label to the carousel incase its a ul 9175 9176 inner.find(".tns-carousel").attr("role", "presentation").attr("aria-label", opt.adaText.slides); // Add carousel instructions 9177 9178 outer.prepend('<p class="sr-only tns-custom-instructions">' + opt.adaText.instructions + "</p>"); // Hide controls if all items are displayed at once 9179 9180 jQuery(window).on("resize", function () { 9181 orig.updateActive("", opt); 9182 9183 if (slider.getInfo().items >= info.slideCount) { 9184 toggleUi("off"); 9185 } else { 9186 toggleUi("on"); 9187 } 9188 }); 9189 jQuery(window).trigger("resize"); 9190 9191 function toggleUi(dir) { 9192 if (dir == "off" && uiEnabled) { 9193 outer.find(".tns-custom-controls, .tns-custom-nav, .tns-custom-instructions").hide().attr("aria-hidden", "true"); 9194 orig.updateActive(0, opt); 9195 uiEnabled = false; 9196 } 9197 9198 if (dir == "on" && !uiEnabled) { 9199 outer.find(".tns-custom-controls, .tns-custom-nav, .tns-custom-instructions").show().removeAttr("aria-hidden"); 9200 uiEnabled = true; 9201 } 9202 } 9203 }, 9204 addControls: function addControls(opt) { 9205 var orig = this, 9206 slider = opt.slider, 9207 info = slider.getInfo(), 9208 inner = jQuery(info.container).parents(".tns-inner"); // Add prev/next buttons and events 9209 // Note: TNS sliders interpretation of "next and previous" is a bit conterintuitive. 9210 // I swapped them by default. The reverseNextPrev flag allows you to switch back. 9211 9212 if (opt.reverseNextPrev) { 9213 inner.prepend('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-prev product-category__carousel-prev">' + opt.adaText.prev + "</button></div>"); 9214 inner.append('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-next product-category__carousel-next">' + opt.adaText.next + "</button></div>"); 9215 } else { 9216 inner.prepend('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-prev tns-custom-reverse product-category__carousel-prev">' + opt.adaText.prev + "</button></div>"); 9217 inner.append('<div class="product-category__controls"><button type="button" class="tns-custom-controls tns-custom-next tns-custom-reverse product-category__carousel-next">' + opt.adaText.next + "</button></div>"); 9218 } 9219 9220 inner.find(".tns-custom-next").on("click", function () { 9221 orig.updateActive("next", opt); 9222 }); 9223 inner.find(".tns-custom-prev").on("click", function () { 9224 orig.updateActive("prev", opt); 9225 }); 9226 }, 9227 addNav: function addNav(opt) { 9228 var orig = this, 9229 slider = opt.slider, 9230 info = slider.getInfo(), 9231 inner = jQuery(info.container).parents(".tns-inner"); // Add bullet nav and events 9232 9233 var newNav = '<ul class="tns-custom-nav">'; 9234 9235 for (var i = 0; i < info.slideCount; i++) { 9236 newNav = newNav + '<li><button type="button" class="tns-custom-nav-item" data-tns-custom-nav-id="' + i + '" aria-label="' + opt.adaText.goTo.replace("[x]", i + 1) + '">' + opt.navText + "</button></li>"; 9237 } 9238 9239 inner.append(newNav + "</ul>"); 9240 inner.find("[data-tns-custom-nav-id]").on("click", function () { 9241 var target = jQuery(this).attr("data-tns-custom-nav-id"); 9242 orig.updateActive(target, opt); 9243 }); 9244 }, 9245 updateActive: function updateActive(target, opt) { 9246 var focusable = "[href], button, input, select, textarea", 9247 slider = opt.slider, 9248 info = slider.getInfo(), 9249 inner = jQuery(info.container).parents(".tns-inner"); // Navigate to the target slide 9250 9251 if (target.length > 0) { 9252 slider.goTo(target); 9253 } // Modify slides and bullet nav to reflect the new active slide state 9254 9255 9256 setTimeout(function () { 9257 var newInfo = slider.getInfo(); // Make all focusable elements in hidden slides not focusable and update the aria properties of all slides 9258 9259 inner.find(".tns-item").removeAttr("aria-label").attr("tabindex", "-1").attr("aria-hidden", "true").find(focusable).attr("tabindex", "-1"); 9260 9261 for (var i = newInfo.index; i < newInfo.items + newInfo.index; i++) { 9262 inner.find(".tns-item").eq(i).removeAttr("tabindex").removeAttr("aria-hidden").attr("aria-label", opt.adaText.current.replace("[x]", i - newInfo.index + newInfo.displayIndex).replace("[y]", newInfo.slideCount)).find(focusable).removeAttr("tabindex"); 9263 } // Update the bullet nav to reflect the currently active slide. 9264 9265 9266 if (opt.nav) { 9267 var navBtns = inner.find("[data-tns-custom-nav-id]"), 9268 activeNavBtn = inner.find('[data-tns-custom-nav-id="' + (newInfo.displayIndex - 1) + '"]'); 9269 navBtns.removeAttr("aria-current"); 9270 activeNavBtn.attr("aria-current", "true"); 9271 } 9272 }, 100); 9273 } 9274}; 9275 9276/***/ }), 9277 9278/***/ 9: 9279/*!***********************************************!*\ 9280 !*** multi ./src/components/heroes/heroes.js ***! 9281 \***********************************************/ 9282/*! no static exports found */ 9283/***/ (function(module, exports, __webpack_require__) { 9284 9285module.exports = __webpack_require__(/*! /var/www/html/dev_bc_bonmatin/html/web/themes/custom/bc_brand/src/components/heroes/heroes.js */"./src/components/heroes/heroes.js"); 9286 9287 9288/***/ }) 9289 9290/******/ });; 9291/******/ (function(modules) { // webpackBootstrap 9292/******/ // The module cache 9293/******/ var installedModules = {}; 9294/******/ 9295/******/ // The require function 9296/******/ function __webpack_require__(moduleId) { 9297/******/ 9298/******/ // Check if module is in cache 9299/******/ if(installedModules[moduleId]) { 9300/******/ return installedModules[moduleId].exports; 9301/******/ } 9302/******/ // Create a new module (and put it into the cache) 9303/******/ var module = installedModules[moduleId] = { 9304/******/ i: moduleId, 9305/******/ l: false, 9306/******/ exports: {} 9307/******/ }; 9308/******/ 9309/******/ // Execute the module function 9310/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 9311/******/ 9312/******/ // Flag the module as loaded
vendor: 2,823 bytes, lines 9313-9378
9313/******/ module.l = true; 9314/******/ 9315/******/ // Return the exports of the module 9316/******/ return module.exports; 9317/******/ } 9318/******/ 9319/******/ 9320/******/ // expose the modules object (__webpack_modules__) 9321/******/ __webpack_require__.m = modules; 9322/******/ 9323/******/ // expose the module cache 9324/******/ __webpack_require__.c = installedModules; 9325/******/ 9326/******/ // define getter function for harmony exports 9327/******/ __webpack_require__.d = function(exports, name, getter) { 9328/******/ if(!__webpack_require__.o(exports, name)) { 9329/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 9330/******/ } 9331/******/ }; 9332/******/ 9333/******/ // define __esModule on exports 9334/******/ __webpack_require__.r = function(exports) { 9335/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 9336/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 9337/******/ } 9338/******/ Object.defineProperty(exports, '__esModule', { value: true }); 9339/******/ }; 9340/******/ 9341/******/ // create a fake namespace object 9342/******/ // mode & 1: value is a module id, require it 9343/******/ // mode & 2: merge all properties of value into the ns 9344/******/ // mode & 4: return value when already ns object 9345/******/ // mode & 8|1: behave like require 9346/******/ __webpack_require__.t = function(value, mode) { 9347/******/ if(mode & 1) value = __webpack_require__(value); 9348/******/ if(mode & 8) return value; 9349/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 9350/******/ var ns = Object.create(null); 9351/******/ __webpack_require__.r(ns); 9352/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 9353/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 9354/******/ return ns; 9355/******/ }; 9356/******/ 9357/******/ // getDefaultExport function for compatibility with non-harmony modules 9358/******/ __webpack_require__.n = function(module) { 9359/******/ var getter = module && module.__esModule ? 9360/******/ function getDefault() { return module['default']; } : 9361/******/ function getModuleExports() { return module; }; 9362/******/ __webpack_require__.d(getter, 'a', getter); 9363/******/ return getter; 9364/******/ }; 9365/******/ 9366/******/ // Object.prototype.hasOwnProperty.call 9367/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 9368/******/ 9369/******/ // __webpack_public_path__ 9370/******/ __webpack_require__.p = "/"; 9371/******/ 9372/******/ 9373/******/ // Load entry module and return exports 9374/******/ return __webpack_require__(__webpack_require__.s = 8); 9375/******/ }) 9376/************************************************************************/ 9377/******/ ({ 9378
9379/***/ "./src/components/header/header.js": 9380/*!*****************************************!*\ 9381 !*** ./src/components/header/header.js ***! 9382 \*****************************************/ 9383/*! no static exports found */ 9384/***/ (function(module, exports, __webpack_require__) { 9385 9386"use strict"; 9387 9388 9389(function ($, Drupal) { 9390 var valueTerm = $("#term"); 9391 var searchToggle = false; 9392 var w = window.innerWidth; 9393 var $form = $(".search__header form"); //array of view names included in search 9394 9395 var searchViews = ['search_products', 'search_recipes', 'search_blog', 'search_basic_pages']; 9396 $("#search-container #close-search").removeAttr('aria-expanded'); 9397 $('#search-container .btn.submit').attr('tabindex', '-1'); 9398 $('#search-container input').attr('tabindex', '-1'); // ======================================================================================= 9399 // Hide Background from Screen Readers 9400 // ======================================================================================= 9401 9402 function hideModalBG(e) { 9403 var focusableElements = 'button:not(.hidden), [href]:not(.hidden), input:not(.hidden), select:not(.hidden), textarea:not(.hidden), [tabindex]:not([tabindex="-1"])'; // All focusable elements 9404 9405 var modalElements = $(e).find(focusableElements) + $('.open-search'); //on show 9406 //console.log("hide items", $("body > *").not(e)); 9407 9408 $("body > *").not(e).each(function () { 9409 var ariaHidden = $(this).attr("aria-hidden"); 9410 9411 if (typeof ariaHidden == "undefined") { 9412 ariaHidden = "false"; 9413 } 9414 9415 $(this).attr("data-aria-hidden", ariaHidden); 9416 }); 9417 $("body > *").not(e).attr("aria-hidden", true); 9418 $("body").find(focusableElements).not(e).each(function () { 9419 var eTabIndex = $(this).attr("tabindex"); 9420 9421 if (typeof eTabIndex == "undefined") { 9422 eTabIndex = 0; 9423 } 9424 9425 $(this).attr("data-tabindex", eTabIndex); 9426 }); 9427 $("body").find(focusableElements).not(modalElements).attr("tabindex", "-1"); 9428 } 9429 9430 function showModalBG(e) { 9431 var focusableElements = "button:not(.hidden), [href]:not(.hidden), input:not(.hidden), select:not(.hidden), textarea:not(.hidden)"; // All focusable elements 9432 //on hide 9433 9434 $("body > *").each(function (index, el) { 9435 var ariaHidden = $(el).attr("data-aria-hidden"); 9436 9437 if (ariaHidden == "false") { 9438 $(el).removeAttr("aria-hidden"); 9439 } else { 9440 $(el).attr("aria-hidden", ariaHidden); 9441 } 9442 }); 9443 $("body > *").removeAttr("data-aria-hidden"); 9444 $("body").find(focusableElements).each(function (index, el) { 9445 var eTabIndex = $(el).attr("data-tabindex"); 9446 9447 if (eTabIndex == 0) { 9448 $(el).removeAttr("tabindex"); 9449 } else { 9450 $(el).attr("tabindex", eTabIndex); 9451 } 9452 }); 9453 $("body").find(focusableElements).removeAttr("data-tabindex"); 9454 } //focus trap 9455 9456 9457 function focusTrap(trapSelector) { 9458 console.log('FOCUS TRAP RUNNING'); // Focus Trap: Causes the tab key to loop focus within the given selector. 9459 9460 var focusableElements = 'button:not(.hidden), [href]:not(.hidden), input:not(.hidden), select:not(.hidden), textarea:not(.hidden), [tabindex]:not([tabindex="-1"])'; // All focusable elements 9461 9462 document.addEventListener('keydown', function (e) { 9463 var trap = document.querySelector(trapSelector); // If the key pressed is not 'Tab' or the trap element is not present: do nothing 9464 9465 var isTabPressed = e.key === 'Tab' || e.keyCode === 9; 9466 9467 if (!isTabPressed || !trap) { 9468 return; 9469 } 9470 9471 var focusableContent = trap.querySelectorAll(focusableElements), 9472 firstFocusableElement = focusableContent[0], 9473 // first focusable element 9474 lastFocusableElement = focusableContent[focusableContent.length - 1]; // last focusable element 9475 9476 if (e.shiftKey) { 9477 // if shift + tab on first element, focus the last focusable element 9478 if (document.activeElement === firstFocusableElement) { 9479 lastFocusableElement.focus(); // 9480 9481 e.preventDefault(); // console.log("document.activeElement"); 9482 } 9483 } else { 9484 console.log(document.activeElement); // if tab on last element, focus the first focusable element 9485 9486 if (document.activeElement === lastFocusableElement) { 9487 firstFocusableElement.focus(); 9488 e.preventDefault(); // console.log("document.activeElement"); 9489 } 9490 } // console.log('FOCASABLE last',lastFocusableElement); 9491 // console.log('FOCASABLE first',firstFocusableElement); 9492 // console.log(document.activeElement); 9493 9494 }); 9495 } // focusTrap('#search-container'); 9496 9497 9498 Drupal.behaviors.header = { 9499 attach: function attach(context, settings) { 9500 //only attach once 9501 //https://www.lullabot.com/articles/understanding-javascript-behaviors-in-drupal 9502 //https://drupal.stackexchange.com/questions/244492/jquery-once-onload 9503 // $('.page__header', context).once('search-controls').each(function () { 9504 // $(context).find('.navbar-actions').once('search-controls').each(function(context){ 9505 // console.log("attach search-controls"); 9506 // let clearButton = $(".clear", context);
9507 $(context).find("#search-container #close-search").off("click.searchclose").on("click.searchclose", function (e) { 9508 Drupal.behaviors.header.toggleSearch(context); 9509 showModalBG("#search-container"); 9510 setTimeout(function () { 9511 $("button.open-search[aria-expanded]").focus(); 9512 }, 0); 9513 $('#search-container .btn.submit').attr('tabindex', '-1'); 9514 $('#search-container input').attr('tabindex', '-1'); 9515 }); 9516 $(context).find(".navbar-actions").once("search-controls").each(function (context) { 9517 // console.log("attach search-controls"); 9518 var clearButton = $(".clear", context); //open search 9519 // console.log($('.navbar-actions .icon', context)); 9520 9521 $(this).find('.open-search').on("click", function (e) { 9522 e.preventDefault(); 9523 Drupal.behaviors.header.toggleSearch(context); 9524 hideModalBG("#search-container"); 9525 $("#search-container").focus(); // $('.search__filters li a').addClass('hidden'); 9526 9527 console.log('toggle search'); 9528 }); 9529 $(".we-mega-menu-li", context).on("mousedown", function (e) { 9530 if (searchToggle) Drupal.behaviors.header.toggleSearch(context); 9531 }); 9532 $(window).resize(function () { 9533 var btnCloseMenu = $(".btn-close"); 9534 9535 if (w != window.innerWidth && window.innerWidth <= 991) { 9536 $("body").removeClass("page__header--active"); 9537 $("body").removeClass("toggled"); 9538 $(".navbar-we-mega-menu").removeClass("we-mobile-megamenu-active has-clicked"); 9539 $(".we-mega-menu-submenu").removeAttr("style"); 9540 btnCloseMenu.removeClass("d-none"); 9541 searchToggle = false; 9542 $('.navbar-actions .icon-search').attr('aria-expanded', 'false'); 9543 } 9544 }); // $("#main-menu-button").click(function () { 9545 // $("body").removeClass("page__header--active"); 9546 // // console.log("menu open"); 9547 // }); 9548 9549 valueTerm.on('input', function () { 9550 // console.log($(this).val()); 9551 if ($(this).val() == '') { 9552 clearButton.removeClass("d-inline-flex"); 9553 } else { 9554 clearButton.addClass("d-inline-flex"); 9555 } 9556 }); //search navigation 9557 9558 $(".search-results-filter button").click(function () { 9559 // console.log('test'); 9560 $(".search-results-filter button").attr("aria-pressed", "false"); 9561 $(this).attr("aria-pressed", "true"); 9562 var selected = $(this).attr("data-filter"); 9563 9564 if (selected) { 9565 $(".search-results .views-element-container").addClass("d-none"); 9566 $(".search-results .views-element-container" + selected).removeClass("d-none"); 9567 } else { 9568 //show all 9569 $(".search-results .views-element-container").removeClass("d-none"); 9570 Drupal.behaviors.header.checkEmpty(context); 9571 } 9572 }); 9573 var replaceState = window.history.replaceState; //history state is loaded (run search) 9574 9575 window.history.replaceState = function (e) { 9576 replaceState.apply(window.history, arguments); 9577 var urlParams = new URLSearchParams(window.location.search); 9578 var term = urlParams.get('term'); //update the values of the individual hidden forms 9579 9580 $(".search-wrapper input[data-drupal-selector='edit-term']").val(term); 9581 $(".search-wrapper input[data-drupal-selector='edit-term']").attr("value", term); //if search term found in query string 9582 9583 if (term) { 9584 console.log(term); 9585 $('.search-wrapper').addClass('d-none'); // clearButton.addClass("d-inline-flex"); 9586 // iterate through the various views instance names to find our views 9587 9588 var instances = Drupal.views.instances; 9589 var countViewsLeft = searchViews.length; //number of views specified 9590 9591 $.each(instances, function getInstance(index, element) { 9592 if (searchViews.includes(element.settings.view_name)) { 9593 console.log(element.settings.view_name); 9594 element.element_settings.url = "/views/ajax?term=" + term; 9595 element.settings.view_args = "term/" + term; 9596 element.element_settings.refreshViewAjax = "/views/ajax?term=" + term + "&_wrapper_format=drupal_ajax"; 9597 console.log(element); //callback function for Refresh View 9598 //from: https://www.vhinandrich.com/blog/drupal-8-show-drupal-throbber-button-manually-calls-views-ajax-refreshview 9599 9600 element.refreshViewAjax.success = function (response, status) { 9601 // Call the original callback 9602 Drupal.Ajax.prototype.success.call(this, response, status); //add custom callback functions below \/ 9603 9604 countViewsLeft -= 1; //remove one 9605 9606 Drupal.behaviors.header.updateSearchMsg(context, countViewsLeft); 9607 }; 9608 9609 $('.js-view-dom-id-' + element.settings.view_dom_id, context).trigger('RefreshView'); 9610 setTimeout(function () { 9611 $('.js-view-dom-id-' + element.settings.view_dom_id, context).trigger('RefreshView'); 9612 }, 3000); 9613 } 9614 }); 9615 } 9616 }; // search - submit 9617 9618 9619 $(".search__header .submit", context).on('click', function (e) { 9620 e.preventDefault(); //console.log($form.get(0).reportValidity()); 9621 9622 if ($form.get(0).reportValidity()) { 9623 var url = new URL(window.location); 9624 var userSearchTerm = $('#term', context).val(); // console.log(userSearchTerm); 9625 9626 url.searchParams.set('term', userSearchTerm); 9627 console.log("url", url); 9628 window.history.replaceState({}, '', url); 9629 } 9630 }); 9631 }); 9632 }, 9633 checkEmpty: function checkEmpty(context) { 9634 var $hasProducts = $(".view-search-products .views-row").length; 9635 var $hasRecipes = $(".view-search-recipes .views-row").length; 9636 var $hasArticles = $(".view-search-blog .views-row").length; 9637 var $hasBasicPages = $(".view-search-basic-pages .views-row").length; 9638 9639 if (!$hasProducts && !$hasRecipes && !$hasArticles && !$hasBasicPages) { 9640 // console.log('has no products or recipes or articles or basic pages'); 9641 $(".block-views-blocksearch-recipes-block-1").addClass('d-none'); 9642 $(".block-views-blocksearch-blog-block-1").addClass('d-none'); 9643 $(".block-views-blocksearch-basic-pages-block-1").addClass('d-none'); 9644 } else if (!$hasProducts) { 9645 // console.log('has no products'); 9646 // console.log('removed text') 9647 $(".block-views-blocksearch-products-block-1").addClass('d-none'); 9648 } else if (!$hasRecipes) { 9649 // console.log('has no recipes'); 9650 $(".block-views-blocksearch-recipes-block-1").addClass('d-none'); 9651 } else if (!$hasArticles) { 9652 // console.log('has no articles'); 9653 $(".block-views-blocksearch-blog-block-1").addClass('d-none'); 9654 } else if (!$hasBasicPages) { 9655 // console.log('has no basic pages'); 9656 $(".block-views-blocksearch-basic-pages-block-1").addClass('d-none'); 9657 } 9658 }, 9659 updateSearchMsg: function updateSearchMsg(context, countViewsLeft) { 9660 // console.log(context); 9661 console.log("countViewsLeft:", countViewsLeft); 9662 9663 if (countViewsLeft == 0) { 9664 setTimeout(function () { 9665 Drupal.behaviors.header.checkEmpty(context); //no views left to review, remove the display none class 9666 9667 $('.search-wrapper').removeClass('d-none'); 9668 }, 5500); 9669 } 9670 }, 9671 toggleSearch: function toggleSearch(context) { 9672 // $("main").toggleClass("overlay_filter"); 9673 // setTimeout(function() { 9674 var btnCloseMenu = $(".btn-close"); 9675 searchToggle = !searchToggle; 9676 9677 if (searchToggle) { 9678 if (window.innerWidth >= 991) { 9679 $(".we-mega-menu-li.dropdown-menu").removeClass("modal"); 9680 } 9681 9682 Drupal.behaviors.header.setFocusSearch(context); 9683 btnCloseMenu.addClass("d-none"); 9684 console.log('open'); 9685 $('.navbar-actions .open-search').attr('aria-expanded', 'true'); 9686 $('#search-container').removeClass('d-none'); 9687 $('#search-container').removeAttr('tabindex'); 9688 $('#search-container .btn').removeAttr('tabindex'); 9689 $('#search-container input').removeAttr('tabindex'); 9690 $('.page__content').attr('inert', true); 9691 $('.footer').attr('inert', true); 9692 $('.navbar-top').attr('inert', true); 9693 $('#main-menu .main-menu').attr('inert', true); 9694 $('#block-bc-brand-sitebranding').attr('inert', true); 9695 $('.skip-link').attr('inert', true); // $("button.open-search").attr('tabindex', '1'); 9696 // focusTrap('#block-bc-brand-search'); 9697 } else { 9698 btnCloseMenu.removeClass("d-none"); 9699 console.log('closed'); 9700 $('#search-container').addClass('d-none'); 9701 $('#search-container').attr('tabindex', '-1'); 9702 $('.navbar-actions .open-search').attr('aria-expanded', 'false'); 9703 $('#search-container .btn.submit').attr('tabindex', '-1'); 9704 $('#search-container input').attr('tabindex', '-1'); 9705 $('.page__content').removeAttr('inert'); 9706 $('.footer').removeAttr('inert'); 9707 $('.navbar-top').removeAttr('inert'); 9708 $('#main-menu .main-menu').removeAttr('inert'); 9709 $('#block-bc-brand-sitebranding').removeAttr('inert'); 9710 $('.skip-link').removeAttr('inert'); // $("button.open-search").attr('tabindex', '-1'); 9711 } 9712 9713 $("body").toggleClass("page__header--active"); // }, 3000); 9714 }, 9715 clearSearchTerm: function clearSearchTerm(context) { 9716 valueTerm.val(""); 9717 $('.search-wrapper').addClass('d-none'); 9718 }, 9719 setFocusSearch: function setFocusSearch(context) { 9720 valueTerm.focus(); 9721 } 9722 }; 9723})(jQuery, Drupal); 9724 9725/***/ }), 9726 9727/***/ 8: 9728/*!***********************************************!*\ 9729 !*** multi ./src/components/header/header.js ***! 9730 \***********************************************/ 9731/*! no static exports found */ 9732/***/ (function(module, exports, __webpack_require__) { 9733 9734module.exports = __webpack_require__(/*! /var/www/html/dev_bc_bonmatin/html/web/themes/custom/bc_brand/src/components/header/header.js */"./src/components/header/header.js"); 9735 9736 9737/***/ }) 9738 9739/******/ });; 9740/******/ (function(modules) { // webpackBootstrap 9741/******/ // The module cache 9742/******/ var installedModules = {}; 9743/******/ 9744/******/ // The require function 9745/******/ function __webpack_require__(moduleId) { 9746/******/ 9747/******/ // Check if module is in cache 9748/******/ if(installedModules[moduleId]) { 9749/******/ return installedModules[moduleId].exports; 9750/******/ } 9751/******/ // Create a new module (and put it into the cache) 9752/******/ var module = installedModules[moduleId] = { 9753/******/ i: moduleId, 9754/******/ l: false, 9755/******/ exports: {} 9756/******/ }; 9757/******/ 9758/******/ // Execute the module function 9759/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 9760/******/ 9761/******/ // Flag the module as loaded
vendor: 2,824 bytes, lines 9762-9827
9762/******/ module.l = true; 9763/******/ 9764/******/ // Return the exports of the module 9765/******/ return module.exports; 9766/******/ } 9767/******/ 9768/******/ 9769/******/ // expose the modules object (__webpack_modules__) 9770/******/ __webpack_require__.m = modules; 9771/******/ 9772/******/ // expose the module cache 9773/******/ __webpack_require__.c = installedModules; 9774/******/ 9775/******/ // define getter function for harmony exports 9776/******/ __webpack_require__.d = function(exports, name, getter) { 9777/******/ if(!__webpack_require__.o(exports, name)) { 9778/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 9779/******/ } 9780/******/ }; 9781/******/ 9782/******/ // define __esModule on exports 9783/******/ __webpack_require__.r = function(exports) { 9784/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 9785/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 9786/******/ } 9787/******/ Object.defineProperty(exports, '__esModule', { value: true }); 9788/******/ }; 9789/******/ 9790/******/ // create a fake namespace object 9791/******/ // mode & 1: value is a module id, require it 9792/******/ // mode & 2: merge all properties of value into the ns 9793/******/ // mode & 4: return value when already ns object 9794/******/ // mode & 8|1: behave like require 9795/******/ __webpack_require__.t = function(value, mode) { 9796/******/ if(mode & 1) value = __webpack_require__(value); 9797/******/ if(mode & 8) return value; 9798/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 9799/******/ var ns = Object.create(null); 9800/******/ __webpack_require__.r(ns); 9801/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 9802/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 9803/******/ return ns; 9804/******/ }; 9805/******/ 9806/******/ // getDefaultExport function for compatibility with non-harmony modules 9807/******/ __webpack_require__.n = function(module) { 9808/******/ var getter = module && module.__esModule ? 9809/******/ function getDefault() { return module['default']; } : 9810/******/ function getModuleExports() { return module; }; 9811/******/ __webpack_require__.d(getter, 'a', getter); 9812/******/ return getter; 9813/******/ }; 9814/******/ 9815/******/ // Object.prototype.hasOwnProperty.call 9816/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 9817/******/ 9818/******/ // __webpack_public_path__ 9819/******/ __webpack_require__.p = "/"; 9820/******/ 9821/******/ 9822/******/ // Load entry module and return exports 9823/******/ return __webpack_require__(__webpack_require__.s = 12); 9824/******/ }) 9825/************************************************************************/ 9826/******/ ({ 9827
9828/***/ "./src/components/navbar/navbar.js": 9829/*!*****************************************!*\ 9830 !*** ./src/components/navbar/navbar.js ***! 9831 \*****************************************/ 9832/*! no static exports found */ 9833/***/ (function(module, exports) { 9834 9835(function ($, Drupal) { 9836 Drupal.behaviors.navbar = { 9837 attach: function attach(context) { 9838 var $navbar = $('#navbar'), 9839 prevScroll = 0, 9840 scrollDir = 'up'; 9841 $(document).off('scroll.navdir').on('scroll.navdir', function () { 9842 var st = $(window).scrollTop(); 9843 9844 if (st < prevScroll && scrollDir === 'down') { 9845 //console.log('up',st); 9846 scrollDir = 'up'; 9847 $navbar.addClass('scroll-dir-up'); 9848 prevScroll = st; 9849 return; 9850 } 9851 9852 if (st > prevScroll && scrollDir === 'up' && st > 100) { 9853 //console.log('down',st); 9854 $navbar.removeClass('scroll-dir-up'); 9855 scrollDir = 'down'; 9856 } 9857 9858 prevScroll = st; 9859 return; 9860 }); 9861 } 9862 }; 9863})(jQuery, Drupal); 9864 9865/***/ }), 9866 9867/***/ 12: 9868/*!***********************************************!*\ 9869 !*** multi ./src/components/navbar/navbar.js ***! 9870 \***********************************************/ 9871/*! no static exports found */ 9872/***/ (function(module, exports, __webpack_require__) { 9873 9874module.exports = __webpack_require__(/*! /var/www/html/dev_bc_bonmatin/html/web/themes/custom/bc_brand/src/components/navbar/navbar.js */"./src/components/navbar/navbar.js"); 9875 9876 9877/***/ }) 9878 9879/******/ });; 9880/** 9881* DO NOT EDIT THIS FILE. 9882* See the following change record for more information, 9883* https://www.drupal.org/node/2815083 9884* @preserve 9885**/ 9886function _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); } 9887function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } 9888function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } 9889function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 9890function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } 9891function _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); } 9892(function ($, Drupal, cookies) { 9893 var deprecatedMessageSuffix = "is deprecated in Drupal 9.0.0 and will be removed in Drupal 10.0.0. Use the core/js-cookie library instead. See https://www.drupal.org/node/3104677"; 9894 var isFunction = function isFunction(obj) { 9895 return Object.prototype.toString.call(obj) === '[object Function]'; 9896 }; 9897 var parseCookieValue = function parseCookieValue(value, parseJson) { 9898 if (value.indexOf('"') === 0) { 9899 value = value.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 9900 } 9901 try { 9902 value = decodeURIComponent(value.replace(/\+/g, ' ')); 9903 return parseJson ? JSON.parse(value) : value; 9904 } catch (e) {} 9905 }; 9906 var reader = function reader(cookieValue, cookieName, converter, readUnsanitized, parseJson) { 9907 var value = readUnsanitized ? cookieValue : parseCookieValue(cookieValue, parseJson); 9908 if (converter !== undefined && isFunction(converter)) { 9909 return converter(value, cookieName); 9910 } 9911 return value; 9912 };
9913 $.cookie = function (key) { 9914 var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; 9915 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; 9916 Drupal.deprecationError({ 9917 message: "jQuery.cookie() ".concat(deprecatedMessageSuffix) 9918 }); 9919 if (value !== undefined && !isFunction(value)) { 9920 var attributes = _objectSpread(_objectSpread({}, $.cookie.defaults), options); 9921 if (typeof attributes.expires === 'string' && attributes.expires !== '') { 9922 attributes.expires = new Date(attributes.expires); 9923 } 9924 var cookieSetter = cookies.withConverter({ 9925 write: function write(cookieValue) { 9926 return encodeURIComponent(cookieValue); 9927 } 9928 }); 9929 value = $.cookie.json && !$.cookie.raw ? JSON.stringify(value) : String(value); 9930 return cookieSetter.set(key, value, attributes); 9931 } 9932 var userProvidedConverter = value; 9933 var cookiesShim = cookies.withConverter({ 9934 read: function read(cookieValue, cookieName) { 9935 return reader(cookieValue, cookieName, userProvidedConverter, $.cookie.raw, $.cookie.json); 9936 } 9937 }); 9938 if (key !== undefined) { 9939 return cookiesShim.get(key); 9940 } 9941 var results = cookiesShim.get();
9942 Object.keys(results).forEach(function (resultKey) { 9943 if (results[resultKey] === undefined) { 9944 delete results[resultKey]; 9945 } 9946 }); 9947 return results; 9948 }; 9949 $.cookie.defaults = _objectSpread({ 9950 path: '' 9951 }, cookies.defaults); 9952 $.cookie.json = false; 9953 $.cookie.raw = false; 9954 $.removeCookie = function (key, options) { 9955 Drupal.deprecationError({ 9956 message: "jQuery.removeCookie() ".concat(deprecatedMessageSuffix) 9957 }); 9958 cookies.remove(key, _objectSpread(_objectSpread({}, $.cookie.defaults), options)); 9959 return !cookies.get(key); 9960 }; 9961})(jQuery, Drupal, window.Cookies);; 9962(function ($, Drupal) { 9963 Drupal.behaviors.provinceSelector = { 9964 attach: function (context, settings) { 9965 // When juicer.io block is enabled it breaks jQuery.once, The following 9966 // is a fix for this behavior. 9967 let queryString = window.location.search; 9968 let urlParams = new URLSearchParams(queryString); 9969 let regionFocus = urlParams.get('regionFocus'); 9970 if (regionFocus != null) { 9971 $("#region-select").focus(); 9972 var simpleLiveCurl=location.protocol + '//' + location.host + location.pathname; 9973 window.history.replaceState( {} , 'regionFocus', simpleLiveCurl); 9974 } 9975 let $selector = null; 9976 let $selector_mobile = null; 9977 if (typeof jQuery.fn.once !== "undefined") { 9978 $selector = $("#province-selector select").once("provinceSelector"); 9979 $selector_mobile = $("#province-selector-mobile select").once( 9980 "provinceSelector" 9981 ); 9982 } else { 9983 $selector = $("#province-selector select"); 9984 $selector_mobile = $("#province-selector-mobile select"); 9985 } 9986 provinceSelector.setDefault(); 9987 // Bypass megamenu caching issue 9988 const activeProvince = provinceSelector.getProvince(); 9989 9990 $('option', $selector_mobile).removeAttr('selected') 9991 $selector_mobile.val(activeProvince); 9992 9993 $selector.on("change", () => { 9994 const region = $("option:selected", $selector).data("region"); 9995 provinceSelector.setCookie($selector.val(), region); 9996 }); 9997 9998 $selector_mobile.on("change", () => { 9999 // Fix issue with variable undefined 10000 let $sMobile = $("#province-selector-mobile select"); 10001 const region = $("option:selected", $sMobile).data("region"); 10002 provinceSelector.setCookie($sMobile.val(), region); 10003 }); 10004 }, 10005 }; 10006 10007 // Helper object. 10008 const provinceSelector = { 10009 provinceCookie: "currentProvince", 10010 regionCookie: "currentRegion", 10011 setDefault: () => { 10012 // Get default province from backend integration. 10013 $.cookie( 10014 provinceSelector.provinceCookie, drupalSettings.defaultProvince, 10015 { path: "/" } 10016 ); 10017 $.cookie( 10018 provinceSelector.regionCookie, drupalSettings.defaultRegion, 10019 { path: "/" } 10020 ); 10021 }, 10022 setCookie: (province, region) => { 10023 $.cookie(provinceSelector.provinceCookie, province, { path: "/" }); 10024 $.cookie(provinceSelector.regionCookie, region, { path: "/" }); 10025 // document.location.reload(true); 10026 let queryString = window.location.search; 10027 let urlParams = new URLSearchParams(queryString); 10028 urlParams.delete('regionFocus'); 10029 urlParams.set('regionFocus', ''); 10030 document.location.href += '?' + urlParams; 10031 }, 10032 getProvince: () => { 10033 return $.cookie(provinceSelector.provinceCookie) 10034 } 10035 }; 10036})(jQuery, Drupal); 10037; 10038/*! 10039 * jQuery Form Plugin 10040 * version: 4.3.0 10041 * Requires jQuery v1.7.2 or later 10042 * Project repository: https://github.com/jquery-form/form 10043 10044 * Copyright 2017 Kevin Morris 10045 * Copyright 2006 M. Alsup 10046 10047 * Dual licensed under the LGPL-2.1+ or MIT licenses 10048 * https://github.com/jquery-form/form#license 10049 10050 * This library is free software; you can redistribute it and/or 10051 * modify it under the terms of the GNU Lesser General Public 10052 * License as published by the Free Software Foundation; either 10053 * version 2.1 of the License, or (at your option) any later version. 10054 * This library is distributed in the hope that it will be useful, 10055 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10056 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10057 * Lesser General Public License for more details. 10058 */ 10059!function(r){"function"==typeof define&&define.amd?define(["jquery"],r):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),r(t),t}:r(jQuery)}(function(q){"use strict";var m=/\r?\n/g,S={};S.fileapi=void 0!==q('<input type="file">').get(0).files,S.formdata=void 0!==window.FormData;var _=!!q.fn.prop;function o(e){var t=e.data;e.isDefaultPrevented()||(e.preventDefault(),q(e.target).closest("form").ajaxSubmit(t))}function i(e){var t=e.target,r=q(t);if(!r.is("[type=submit],[type=image]")){var a=r.closest("[type=submit]");if(0===a.length)return;t=a[0]}var n,o=t.form;"image"===(o.clk=t).type&&(void 0!==e.offsetX?(o.clk_x=e.offsetX,o.clk_y=e.offsetY):"function"==typeof q.fn.offset?(n=r.offset(),o.clk_x=e.pageX-n.left,o.clk_y=e.pageY-n.top):(o.clk_x=e.pageX-t.offsetLeft,o.clk_y=e.pageY-t.offsetTop)),setTimeout(function(){o.clk=o.clk_x=o.clk_y=null},100)}function N(){var e;q.fn.ajaxSubmit.debug&&(e="[jquery.form] "+Array.prototype.join.call(arguments,""),window.console&&window.console.log?window.console.log(e):window.opera&&window.opera.postError&&window.opera.postError(e))}q.fn.attr2=function(){if(!_)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},q.fn.ajaxSubmit=function(M,e,t,r){if(!this.length)return N("ajaxSubmit: ski
10059pping submit process - no element selected"),this;var O,a,n,o,X=this;"function"==typeof M?M={success:M}:"string"==typeof M||!1===M&&0<arguments.length?(M={url:M,data:e,dataType:t},"function"==typeof r&&(M.success=r)):void 0===M&&(M={}),O=M.method||M.type||this.attr2("method"),n=(n=(n="string"==typeof(a=M.url||this.attr2("action"))?q.trim(a):"")||window.location.href||"")&&(n.match(/^([^#]+)/)||[])[1],o=/(MSIE|Trident)/.test(navigator.userAgent||"")&&/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",M=q.extend(!0,{url:n,success:q.ajaxSettings.success,type:O||q.ajaxSettings.type,iframeSrc:o},M);var i={};if(this.trigger("form-pre-serialize",[this,M,i]),i.veto)return N("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(M.beforeSerialize&&!1===M.beforeSerialize(this,M))return N("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var s=M.traditional;void 0===s&&(s=q.ajaxSettings.traditional);var u,c,C=[],l=this.formToArray(M.semantic,C,M.filtering);if(M.data&&(c=q.isFunction(M.data)?M.data(l):M.data,M.extraData=c,u=q.param(c,s)),M.beforeSubmit&&!1===M.beforeSubmit(l,this,M))return N("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[l,this,M,i]),i.veto)return N("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var f=q.param(l,s);u&&(f=f?f+"&"+u:u),"GET"===M.type.toUpperCase()?(M.url+=(0<=M.url.indexOf("?")?"&":"?")+f,M.data=null):M.data=f;var d,m,p,h=[];M.resetForm&&h.push(function(){X.resetForm()}),M.clearForm&&h.push(function(){X.clearForm(M.includeHidden)}),!M.dataType&&M.target?(d=M.success||function(){},h.push(function(e,t,r){var a=arguments,n=M.replaceTarget?"replaceWith":"html";q(M.target)[n](e).each(function(){d.apply(this,a)})})):M.success&&(q.isArray(M.success)?q.merge(h,M.success):h.push(M.success)),M.success=function(e,t,r){for(var a=M.context||this,n=0,o=h.length;n<o;n++)h[n].apply(a,[e,t,r||X,X])},M.error&&(m=M.error,M.error=function(e,t,r){var a=M.context||this;m.apply(a,[e,t,r,X])}),M.complete&&(p=M.complete,M.complete=function(e,t){var r=M.context||this;p.apply(r,[e,t,X])});var v=0<q("input[type=file]:enabled",this).filter(function(){return""!==q(this).val()}).length,g="multipart/form-data",x=X.attr("enctype")===g||X.attr("encoding")===g,y=S.fileapi&&S.formdata;N("fileAPI :"+y);var b,T=(v||x)&&!y;!1!==M.iframe&&(M.iframe||T)?M.closeKeepAlive?q.get(M.closeKeepAlive,function(){b=w(l)}):b=w(l):b=(v||x)&&y?function(e){for(var r=new FormData,t=0;t<e.length;t++)r.append(e[t].name,e[t].value);if(M.extraData){var a=function(e){var t,r,a=q.param(e,M.traditional).split("&"),n=a.length,o=[];for(t=0;t<n;t++)a[t]=a[t].replace(/\+/g," "),r=a[t].split("="),o.push([decodeURIComponent(r[0]),decodeURIComponent(r[1])]);return o}(M.extraData);for(t=0;t<a.length;t++)a[t]&&r.append(a[t][0],a[t][1])}M.data=null;var n=q.extend(!0,{},q.ajaxSettings,M,{contentType:!1,processData:!1,cache:!1,type:O||"POST"});M.uploadProgress&&(n.xhr=function(){var e=q.ajaxSettings.xhr();return e.upload&&e.upload.addEventListener("progress",function(e){var t=0,r=e.loaded||e.position,a=e.total;e.lengthComputable&&(t=Math.ceil(r/a*100)),M.uploadProgress(e,r,a,t)},!1),e});n.data=null;var o=n.beforeSend;return n.beforeSend=function(e,t){M.formData?t.data=M.formData:t.data=r,o&&o.call(this,e,t)},q.ajax(n)}(l):q.ajax(M),X.removeData("jqxhr").data("jqxhr",b);for(var j=0;j<C.length;j++)C[j]=null;return this.trigger("form-submit-notify",[this,M]),this;function w(e){var t,r,l,f,o,d,m,p,a,n,h,v,i=X[0],g=q.Deferred();if(g.abort=function(e){p.abort(e)},e)for(r=0;r<C.length;r++)t=q(C[r]),_?t.prop("disabled",!1):t.removeAttr("disabled");(l=q.extend(!0,{},q.ajaxSettings,M)).context=l.context||l,o="jqFormIO"+(new Date).getTime();var s=i.ownerDocument,u=X.closest("body");if(l.iframeTarget?(n=(d=q(l.iframeTarget,s)).attr2("name"))?o=n:d.attr2("name",o):(d=q('<iframe name="'+o+'" src="'+l.iframeSrc+'" />',s)).css({position:"absolute",top:"-1000px",left:"-1000px"}),m=d[0],p={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(e){var t="timeout"===e?"timeout":"aborted";N("aborting upload... "+t),this.aborted=1;try{m.contentWindow.document.execCommand&&m.contentWindow.document.execCommand("Stop")}catch(e){}d.attr("src",l.iframeSrc),p.error=t,l.error&&l.error.call(l.context,p,t,e),f&&q.event.trigger("ajaxError",[p,l,t]),l.complete&&l.complete.call(l.context,p,t)}},(f=l.global)&&0==q.active++&&q.event.trigger("ajaxStart"),f&&q.event.trigger("ajaxSend",[p,l]),l.beforeSend&&!1===l.beforeSend.c
vendor: 9,900 bytes, line 10059
10059all(l.context,p,l))return l.global&&q.active--,g.reject(),g;if(p.aborted)return g.reject(),g;(a=i.clk)&&(n=a.name)&&!a.disabled&&(l.extraData=l.extraData||{},l.extraData[n]=a.value,"image"===a.type&&(l.extraData[n+".x"]=i.clk_x,l.extraData[n+".y"]=i.clk_y));var x=1,y=2;function b(t){var r=null;try{t.contentWindow&&(r=t.contentWindow.document)}catch(e){N("cannot get iframe.contentWindow document: "+e)}if(r)return r;try{r=t.contentDocument?t.contentDocument:t.document}catch(e){N("cannot get iframe.contentDocument: "+e),r=t.document}return r}var c=q("meta[name=csrf-token]").attr("content"),T=q("meta[name=csrf-param]").attr("content");function j(){var e=X.attr2("target"),t=X.attr2("action"),r=X.attr("enctype")||X.attr("encoding")||"multipart/form-data";i.setAttribute("target",o),O&&!/post/i.test(O)||i.setAttribute("method","POST"),t!==l.url&&i.setAttribute("action",l.url),l.skipEncodingOverride||O&&!/post/i.test(O)||X.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),l.timeout&&(v=setTimeout(function(){h=!0,A(x)},l.timeout));var a=[];try{if(l.extraData)for(var n in l.extraData)l.extraData.hasOwnProperty(n)&&(q.isPlainObject(l.extraData[n])&&l.extraData[n].hasOwnProperty("name")&&l.extraData[n].hasOwnProperty("value")?a.push(q('<input type="hidden" name="'+l.extraData[n].name+'">',s).val(l.extraData[n].value).appendTo(i)[0]):a.push(q('<input type="hidden" name="'+n+'">',s).val(l.extraData[n]).appendTo(i)[0]));l.iframeTarget||d.appendTo(u),m.attachEvent?m.attachEvent("onload",A):m.addEventListener("load",A,!1),setTimeout(function e(){try{var t=b(m).readyState;N("state = "+t),t&&"uninitialized"===t.toLowerCase()&&setTimeout(e,50)}catch(e){N("Server abort: ",e," (",e.name,")"),A(y),v&&clearTimeout(v),v=void 0}},15);try{i.submit()}catch(e){document.createElement("form").submit.apply(i)}}finally{i.setAttribute("action",t),i.setAttribute("enctype",r),e?i.setAttribute("target",e):X.removeAttr("target"),q(a).remove()}}T&&c&&(l.extraData=l.extraData||{},l.extraData[T]=c),l.forceSync?j():setTimeout(j,10);var w,S,k,D=50;function A(e){if(!p.aborted&&!k){if((S=b(m))||(N("cannot access response document"),e=y),e===x&&p)return p.abort("timeout"),void g.reject(p,"timeout");if(e===y&&p)return p.abort("server abort"),void g.reject(p,"error","server abort");if(S&&S.location.href!==l.iframeSrc||h){m.detachEvent?m.detachEvent("onload",A):m.removeEventListener("load",A,!1);var t,r="success";try{if(h)throw"timeout";var a="xml"===l.dataType||S.XMLDocument||q.isXMLDoc(S);if(N("isXml="+a),!a&&window.opera&&(null===S.body||!S.body.innerHTML)&&--D)return N("requeing onLoad callback, DOM not available"),void setTimeout(A,250);var n=S.body?S.body:S.documentElement;p.responseText=n?n.innerHTML:null,p.responseXML=S.XMLDocument?S.XMLDocument:S,a&&(l.dataType="xml"),p.getResponseHeader=function(e){return{"content-type":l.dataType}[e.toLowerCase()]},n&&(p.status=Number(n.getAttribute("status"))||p.status,p.statusText=n.getAttribute("statusText")||p.statusText);var o,i,s,u=(l.dataType||"").toLowerCase(),c=/(json|script|text)/.test(u);c||l.textarea?(o=S.getElementsByTagName("textarea")[0])?(p.responseText=o.value,p.status=Number(o.getAttribute("status"))||p.status,p.statusText=o.getAttribute("statusText")||p.statusText):c&&(i=S.getElementsByTagName("pre")[0],s=S.getElementsByTagName("body")[0],i?p.responseText=i.textContent?i.textContent:i.innerText:s&&(p.responseText=s.textContent?s.textContent:s.innerText)):"xml"===u&&!p.responseXML&&p.responseText&&(p.responseXML=F(p.responseText));try{w=E(p,u,l)}catch(e){r="parsererror",p.error=t=e||r}}catch(e){N("error caught: ",e),r="error",p.error=t=e||r}p.aborted&&(N("upload aborted"),r=null),p.status&&(r=200<=p.status&&p.status<300||304===p.status?"success":"error"),"success"===r?(l.success&&l.success.call(l.context,w,"success",p),g.resolve(p.responseText,"success",p),f&&q.event.trigger("ajaxSuccess",[p,l])):r&&(void 0===t&&(t=p.statusText),l.error&&l.error.call(l.context,p,r,t),g.reject(p,"error",t),f&&q.event.trigger("ajaxError",[p,l,t])),f&&q.event.trigger("ajaxComplete",[p,l]),f&&!--q.active&&q.event.trigger("ajaxStop"),l.complete&&l.complete.call(l.context,p,r),k=!0,l.timeout&&clearTimeout(v),setTimeout(function(){l.iframeTarget?d.attr("src",l.iframeSrc):d.remove(),p.responseXML=null},100)}}}var F=q.parseXML||function(e,t){return window.ActiveXObject?((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!==t.documentElement.nodeName?t:null},L=q.parseJSON||function(e){return window.eval("("+e+")")},E=function(e,t,r){var a=e.getResponseHeader("content-type")||"",n=("xml"===t||!t)&&0<=a.indexOf("xml"),o=n?e.responseXML:e.responseText;return n&&"parsererror"===o.documentElement.nodeName&&q.error&&q.error("parsererror"),r&&r.dataFilter&&(o=r.dataFilter(o,t)),"string"==typeof o&&(("json"===t||!t)&&0<=a.indexOf("json")?o=L(o):("script"===t||!t)&&0<=a.indexOf("javascript")&&q.globalEval(o)),o};return g}},q.fn.ajaxForm=function(e,t,r,a){if(("string"==typeof e||!1===e&&0<arguments.length)&&(e={url:e,data:t,dataType:r},"function"==typeof a&&(e.success=a)),(e=e||{}).delegation=e.delegation&&q.isFunction(q.fn.on),e.delegation||0!==this.length)return e.delegation?(q(document).off("submit.form-plugin",this.selector,o).off("click.form-plugin",this.selector,i).on("submit.form-plugin",this.selector,e,o).on("click.form-plugin",this.selector,e,i),this):(e.beforeFormUnbind&&e.beforeFormUnbind(this,e),this.ajaxFormUnbind().on("submit.form-plugin",e,o).on("click.form-plugin",e,i));var n={s:this.selector,c:this.context};return!q.isReady&&n.s?(N("DOM not ready, queuing ajaxForm"),q(function(){q(n.s,n.c).ajaxForm(e)})):N("terminating; zero elements found by selector"+(q.isReady?"":" (DOM not ready)")),this},q.fn.ajaxFormUnbind=function(){return this.off("submit.form-plugin click.form-plugin")},q.fn.formToArray=function(e,t,r){var a=[];if(0===this.length)return a;var n,o,i,s,u,c,l,f,d,m,p=this[0],h=this.attr("id"),v=(v=e||void 0===p.elements?p.getElementsByTagName("*"):p.elements)&&q.makeArray(v);if(h&&(e||/(Edge|Trident)\//.test(navigator.userAgent))&&(n=q(':input[form="'+h+'"]').get()).length&&(v=(v||[]).concat(n)),!v||!v.length)return a;for(q.isFunction(r)&&(v=q.map(v,r)),o=0,c=v.length;o<c;o++)if((m=(u=v[o]).name)&&!u.disabled)if(e&&p.clk&&"image"===u.type)p.clk===u&&(a.push({name:m,value:q(u).val(),type:u.type}),a.push({name:m+".x",value:p.clk_x},{name:m+".y",value:p.clk_y}));else if((s=q.fieldValue(u,!0))&&s.constructor===Array)for(t&&t.push(u),i=0,l=s.length;i<l;i++)a.push({name:m,value:s[i]});else if(S.fileapi&&"file"===u.type){t&&t.push(u);var g=u.files;if(g.length)for(i=0;i<g.length;i++)a.push({name:m,value:g[i],type:u.type});else a.push({name:m,value:"",type:u.type})}else null!=s&&(t&&t.push(u),a.push({name:m,value:s,type:u.type,required:u.required}));return e||!p.clk||(m=(d=(f=q(p.clk))[0]).name)&&!d.disabled&&"image"===d.type&&(a.push({name:m,value:f.val()}),a.push({name:m+".x",value:p.clk_x},{name:m+".y",value:p.clk_y})),a},q.fn.formSerialize=function(e){return q.param(this.formToArray(e))},q.fn.fieldSerialize=function(n){var o=[];return this.each(function(){var e=this.name;if(e){var t=q.fieldValue(this,n);if(t&&t.constructor===Array)for(var r=0,a=t.length;r<a;r++)o.push({name:e,value:t[r]});else null!=t&&o.push({name:this.name,value:t})}}),q.param(o)},q.fn.fieldValue=function(e){for(var t=[],r=0,a=this.length;r<a;r++){var n=this[r],o=q.fieldValue(n,e);null==o||o.constructor===Array&&!o.length||(o.constructor===Array?q.merge(t,o):t.push(o))}return t},q.fieldValue=function(e,t){var r=e.name,a=e.type,n=e.tagName.toLowerCase();if(void 0===t&&(t=!0),t&&(!r||e.disabled||"reset"===a||"button"===a||("checkbox"===a||"radio"===a)&&!e.checked||("submit"===a||"image"===a)&&e.form&&e.form.clk!==e||"select"===n&&-1===e.selectedIndex))return null;if("select"!==n)return q(e).val().replace(m,"\r\n");var o=e.selectedIndex;if(o<0)return null;for(var i=[],s=e.options,u="select-one"===a,c=u?o+1:s.length,l=u?o:0;l<c;l++){var f=s[l];if(f.selected&&!f.disabled){var d=(d=f.value)||(f.attributes&&f.attributes.value&&!f.attributes.value.specified?f.text:f.value);if(u)return d;i.push(d)}}return i},q.fn.clearForm=function(e){return this.each(function(){q("input,select,textarea",this).clearFields(e)})},q.fn.clearFields=q.fn.clearInputs=function(r){var a=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var e=this.type,t=this.tagName.toLowerCase();a.test(e)||"textarea"===t?this.value="":"checkbox"===e||"radio"===e?this.checked=!1:"select"===t?this.selectedIndex=-1:"file"===e?/MSIE/.test(navigator.userAgent)?q(this).replaceWith(q(this).clone(!0)):q(this).val(""):r&&(!0===r&&/hidden/.test(e)||"string"==typeof r&&q(this).is(r))&&(this.value="")})},q.fn.resetForm=function(){return this.each(function(){var t=q(this),e=this.tagName.toLowerCase();switch(e){case"input":this.checked=this.defaultChecked;case"textarea":return this.value=this.defaultValue,!0;case"option":case"optgroup":var r=t.parents("select");return r.length&&r[0].multiple?"option"===e?this.selected=this.defaultSelected:t.find("option").resetForm():r.resetForm(),!0;case"select":return t.find("option").each(function(e){if(this.selected=this.defaultSelected,this.defaultSelected&&!t[0].multiple)return t[0].selectedIndex=e,!1}),!0;case"label":var a=q(t.attr("for")),n=t.find("input,select,textarea");return a[0]&&n.unshift(a[0]),n.resetForm(),!0;case"form":return"function"!=typeof this.reset&&("object"!=typeof this.reset||this.reset.nodeType)||this.reset(),!0;default:return t.find("form,input,label,select,textarea").resetForm(),!0}})},q.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},q.fn.selected=function(r){return void 0===r&&(r=!0),this.each(function(){var e,t=this.t
10059ype;"checkbox"===t||"radio"===t?this.checked=r:"option"===this.tagName.toLowerCase()&&(e=q(this).parent("select"),r&&e[0]&&"select-one"===e[0].type&&e.find("option").selected(!1),this.selected=r)})},q.fn.ajaxSubmit.debug=!1}); 10060 10061; 10062/** 10063* DO NOT EDIT THIS FILE. 10064* See the following change record for more information, 10065* https://www.drupal.org/node/2815083 10066* @preserve 10067**/ 10068(function ($, Drupal, drupalSettings) { 10069 Drupal.Views = {}; 10070 Drupal.Views.parseQueryString = function (query) { 10071 var args = {}; 10072 var pos = query.indexOf('?'); 10073 if (pos !== -1) { 10074 query = query.substring(pos + 1); 10075 } 10076 var pair; 10077 var pairs = query.split('&'); 10078 for (var i = 0; i < pairs.length; i++) { 10079 pair = pairs[i].split('='); 10080 if (pair[0] !== 'q' && pair[1]) { 10081 args[decodeURIComponent(pair[0].replace(/\+/g, ' '))] = decodeURIComponent(pair[1].replace(/\+/g, ' ')); 10082 } 10083 } 10084 return args; 10085 }; 10086 Drupal.Views.parseViewArgs = function (href, viewPath) { 10087 var returnObj = {}; 10088 var path = Drupal.Views.getPath(href); 10089 var viewHref = Drupal.url(viewPath).substring(drupalSettings.path.baseUrl.length); 10090 if (viewHref && path.substring(0, viewHref.length + 1) === "".concat(viewHref, "/")) { 10091 returnObj.view_args = decodeURIComponent(path.substring(viewHref.length + 1, path.length)); 10092 returnObj.view_path = path; 10093 } 10094 return returnObj; 10095 }; 10096 Drupal.Views.pathPortion = function (href) { 10097 var protocol = window.location.protocol; 10098 if (href.substring(0, protocol.length) === protocol) { 10099 href = href.substring(href.indexOf('/', protocol.length + 2)); 10100 } 10101 return href; 10102 }; 10103 Drupal.Views.getPath = function (href) { 10104 href = Drupal.Views.pathPortion(href); 10105 href = href.substring(drupalSettings.path.baseUrl.length, href.length); 10106 if (href.substring(0, 3) === '?q=') { 10107 href = href.substring(3, href.length); 10108 } 10109 var chars = ['#', '?', '&']; 10110 for (var i = 0; i < chars.length; i++) { 10111 if (href.indexOf(chars[i]) > -1) { 10112 href = href.substr(0, href.indexOf(chars[i])); 10113 } 10114 } 10115 return href; 10116 }; 10117})(jQuery, Drupal, drupalSettings);; 10118/** 10119* DO NOT EDIT THIS FILE. 10120* See the following change record for more information, 10121* https://www.drupal.org/node/2815083 10122* @preserve 10123**/ 10124(function ($, Drupal, drupalSettings) { 10125 Drupal.behaviors.ViewsAjaxView = {}; 10126 Drupal.behaviors.ViewsAjaxView.attach = function (context, settings) { 10127 if (settings && settings.views && settings.views.ajaxViews) { 10128 var ajaxViews = settings.views.ajaxViews; 10129 Object.keys(ajaxViews || {}).forEach(function (i) { 10130 Drupal.views.instances[i] = new Drupal.views.ajaxView(ajaxViews[i]); 10131 }); 10132 } 10133 }; 10134 Drupal.behaviors.ViewsAjaxView.detach = function (context, settings, trigger) { 10135 if (trigger === 'unload') { 10136 if (settings && settings.views && settings.views.ajaxViews) { 10137 var ajaxViews = settings.views.ajaxViews; 10138 Object.keys(ajaxViews || {}).forEach(function (i) { 10139 var selector = ".js-view-dom-id-".concat(ajaxViews[i].view_dom_id); 10140 if ($(selector, context).length) { 10141 delete Drupal.views.instances[i]; 10142 delete settings.views.ajaxViews[i]; 10143 } 10144 }); 10145 } 10146 } 10147 }; 10148 Drupal.views = {}; 10149 Drupal.views.instances = {}; 10150 Drupal.views.ajaxView = function (settings) { 10151 var selector = ".js-view-dom-id-".concat(settings.view_dom_id); 10152 this.$view = $(selector); 10153 var ajaxPath = drupalSettings.views.ajax_path; 10154 if (ajaxPath.constructor.toString().indexOf('Array') !== -1) { 10155 ajaxPath = ajaxPath[0]; 10156 } 10157 var queryString = window.location.search || ''; 10158 if (queryString !== '') { 10159 queryString = queryString.slice(1).replace(/q=[^&]+&?|&?render=[^&]+/, ''); 10160 if (queryString !== '') { 10161 queryString = (/\?/.test(ajaxPath) ? '&' : '?') + queryString; 10162 } 10163 } 10164 this.element_settings = { 10165 url: ajaxPath + queryString, 10166 submit: settings, 10167 setClick: true, 10168 event: 'click', 10169 selector: selector, 10170 progress: { 10171 type: 'fullscreen' 10172 } 10173 }; 10174 this.settings = settings; 10175 this.$exposed_form = $("form#views-exposed-form-".concat(settings.view_name.replace(/_/g, '-'), "-").concat(settings.view_display_id.replace(/_/g, '-'))); 10176 once('exposed-form', this.$exposed_form).forEach($.proxy(this.attachExposedFormAjax, this));
10177 once('ajax-pager', this.$view.filter($.proxy(this.filterNestedViews, this))).forEach($.proxy(this.attachPagerAjax, this)); 10178 var selfSettings = $.extend({}, this.element_settings, { 10179 event: 'RefreshView', 10180 base: this.selector, 10181 element: this.$view.get(0) 10182 }); 10183 this.refreshViewAjax = Drupal.ajax(selfSettings); 10184 }; 10185 Drupal.views.ajaxView.prototype.attachExposedFormAjax = function () { 10186 var that = this; 10187 this.exposedFormAjax = []; 10188 $('input[type=submit], button[type=submit], input[type=image]', this.$exposed_form).not('[data-drupal-selector=edit-reset]').each(function (index) { 10189 var selfSettings = $.extend({}, that.element_settings, { 10190 base: $(this).attr('id'), 10191 element: this 10192 }); 10193 that.exposedFormAjax[index] = Drupal.ajax(selfSettings); 10194 }); 10195 }; 10196 Drupal.views.ajaxView.prototype.filterNestedViews = function () { 10197 return !this.$view.parents('.view').length; 10198 }; 10199 Drupal.views.ajaxView.prototype.attachPagerAjax = function () { 10200 this.$view.find('ul.js-pager__items > li > a, th.views-field a, .attachment .views-summary a').each($.proxy(this.attachPagerLinkAjax, this)); 10201 }; 10202 Drupal.views.ajaxView.prototype.attachPagerLinkAjax = function (id, link) { 10203 var $link = $(link); 10204 var viewData = {}; 10205 var href = $link.attr('href'); 10206 $.extend(viewData, this.settings, Drupal.Views.parseQueryString(href), Drupal.Views.parseViewArgs(href, this.settings.view_base_path)); 10207 var selfSettings = $.extend({}, this.element_settings, {
10208 submit: viewData, 10209 base: false, 10210 element: link 10211 }); 10212 this.pagerAjax = Drupal.ajax(selfSettings); 10213 }; 10214 Drupal.AjaxCommands.prototype.viewsScrollTop = function (ajax, response) { 10215 var offset = $(response.selector).offset(); 10216 var scrollTarget = response.selector; 10217 while ($(scrollTarget).scrollTop() === 0 && $(scrollTarget).parent()) { 10218 scrollTarget = $(scrollTarget).parent(); 10219 } 10220 if (offset.top - 10 < $(scrollTarget).scrollTop()) { 10221 $(scrollTarget).animate({ 10222 scrollTop: offset.top - 10 10223 }, 500); 10224 } 10225 }; 10226})(jQuery, Drupal, drupalSettings);; 10227/******/ (function(modules) { // webpackBootstrap 10228/******/ // The module cache 10229/******/ var installedModules = {}; 10230/******/ 10231/******/ // The require function 10232/******/ function __webpack_require__(moduleId) { 10233/******/ 10234/******/ // Check if module is in cache 10235/******/ if(installedModules[moduleId]) { 10236/******/ return installedModules[moduleId].exports; 10237/******/ } 10238/******/ // Create a new module (and put it into the cache) 10239/******/ var module = installedModules[moduleId] = { 10240/******/ i: moduleId, 10241/******/ l: false, 10242/******/ exports: {} 10243/******/ }; 10244/******/ 10245/******/ // Execute the module function 10246/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 10247/******/ 10248/******/ // Flag the module as loaded 10249/******/ module.l = true; 10250/******/ 10251/******/ // Return the exports of the module 10252/******/ return module.exports; 10253/******/ } 10254/******/ 10255/******/ 10256/******/ // expose the modules object (__webpack_modules__) 10257/******/ __webpack_require__.m = modules; 10258/******/ 10259/******/ // expose the module cache 10260/******/ __webpack_require__.c = installedModules; 10261/******/ 10262/******/ // define getter function for harmony exports 10263/******/ __webpack_require__.d = function(exports, name, getter) { 10264/******/ if(!__webpack_require__.o(exports, name)) { 10265/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 10266/******/ } 10267/******/ }; 10268/******/ 10269/******/ // define __esModule on exports 10270/******/ __webpack_require__.r = function(exports) { 10271/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 10272/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 10273/******/ } 10274/******/ Object.defineProperty(exports, '__esModule', { value: true }); 10275/******/ }; 10276/******/ 10277/******/ // create a fake namespace object 10278/******/ // mode & 1: value is a module id, require it 10279/******/ // mode & 2: merge all properties of value into the ns 10280/******/ // mode & 4: return value when already ns object 10281/******/ // mode & 8|1: behave like require 10282/******/ __webpack_require__.t = function(value, mode) { 10283/******/ if(mode & 1) value = __webpack_require__(value); 10284/******/ if(mode & 8) return value; 10285/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 10286/******/ var ns = Object.create(null); 10287/******/ __webpack_require__.r(ns); 10288/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 10289/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 10290/******/ return ns; 10291/******/ }; 10292/******/ 10293/******/ // getDefaultExport function for compatibility with non-harmony modules 10294/******/ __webpack_require__.n = function(module) { 10295/******/ var getter = module && module.__esModule ? 10296/******/ function getDefault() { return module['default']; } : 10297/******/ function getModuleExports() { return module; }; 10298/******/ __webpack_require__.d(getter, 'a', getter); 10299/******/ return getter; 10300/******/ }; 10301/******/ 10302/******/ // Object.prototype.hasOwnProperty.call 10303/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 10304/******/ 10305/******/ // __webpack_public_path__ 10306/******/ __webpack_require__.p = "/"; 10307/******/ 10308/******/ 10309/******/ // Load entry module and return exports 10310/******/ return __webpack_require__(__webpack_require__.s = 22); 10311/******/ }) 10312/************************************************************************/ 10313/******/ ({ 10314
10315/***/ "./src/components/search/search.js": 10316/*!*****************************************!*\ 10317 !*** ./src/components/search/search.js ***! 10318 \*****************************************/ 10319/*! no static exports found */ 10320/***/ (function(module, exports, __webpack_require__) { 10321 10322"use strict"; 10323 10324 10325(function ($, Drupal) { 10326 Drupal.behaviors.search = { 10327 attach: function attach(context) { 10328 var filterItem = $(".path-search-results .page__header .search__filters li a, .path-resultats-de-recherche .page__header .search__filters li a", context); 10329 var clearButton = $(".clear"); 10330 var submitButton = $(".submit"); 10331 filterItem.on("click", function () { 10332 filterItem.removeClass("is-active"); 10333 $(this).addClass("is-active"); 10334 var itemValue = $(this).attr("href"); 10335 10336 if (itemValue === "#all") { 10337 $(".view-search-products", context).show(); 10338 $(".view-search-recipes", context).show(); 10339 } else if (itemValue === "#products") { 10340 $(".view-search-products", context).show(); 10341 $(".view-search-recipes", context).hide(); 10342 } else { 10343 $(".view-search-products", context).hide(); 10344 $(".view-search-recipes", context).show(); 10345 } 10346 }); 10347 clearButton.on("click", function (context) { 10348 $(this).removeClass("d-inline-flex"); 10349 submitButton.removeClass("d-none"); 10350 Drupal.behaviors.header.clearSearchTerm(context); 10351 Drupal.behaviors.header.setFocusSearch(context); 10352 }); // setTimeout(() => { 10353 // //Product Search View 10354 // let $productSearch = $(".block-views-blocksearch-products-block-1"); 10355 // //Receipe Search View 10356 // let $recipeSearch = $(".block-views-blocksearch-recipes-block-1"); 10357 // //wrap in one div 10358 // if(!$('.search-results').length) { 10359 // $productSearch.add($recipeSearch).wrapAll("<div class='search-results'></div>"); 10360 // } 10361 // }, 200); 10362 10363 var params = new URLSearchParams(window.location.search); 10364 10365 if (params.has("term")) { 10366 //console.log('here 1'); 10367 if (context === document) { 10368 //console.log('here 2'); 10369 var $hasProducts = $(".view-search-products .views-row").length; 10370 var $hasRecipes = $(".view-search-recipes .views-row").length; 10371 clearButton.addClass("d-inline-flex"); 10372 submitButton.addClass("d-none"); //show search results wrapper 10373 // setTimeout(() => { 10374 // $('.search-results').removeClass('d-none'); 10375 // }, 300); 10376 // submitButton.click(function(){ 10377 // console.log('Search Clicked') 10378 // if (!$hasProducts && !$hasRecipes) { 10379 // console.log('has no products or recipes'); 10380 // // $(".layout-builder__layout .col-12").append( 10381 // // '<p class="no-results">No results found<p>' 10382 // // ); 10383 // } else if (!$hasProducts) { 10384 // console.log('has no products'); 10385 // console.log('removed text') 10386 // // $(".view-search-products").append( 10387 // // '<p class="no-results">No products found<p>' 10388 // // ); 10389 // $(".view-search-products .view-empty").html(''); 10390 // } else if (!$hasRecipes) { 10391 // console.log('has no recipes'); 10392 // // $(".view-search-recipes").append( 10393 // // '<p class="no-results">No recipes found<p>' 10394 // // ); 10395 // $(".view-search-recipes .view-empty").addClass('d-none'); 10396 // } 10397 // }); 10398 10399 if (window.innerWidth >= 991) { 10400 Drupal.behaviors.header.toggleSearch(context); 10401 } 10402 10403 $("#term").val(params.get("term")); 10404 } 10405 } 10406 } 10407 }; 10408 $('#search-container #block-bc-brand-search #term').attr('aria-label', 'search'); // $('#close-search').on('click', function(){ 10409 // setTimeout(() => { 10410 // $('#icon-search').focus(); 10411 // }, 100); 10412 // }) 10413})(jQuery, Drupal); 10414 10415/***/ }), 10416 10417/***/ 22: 10418/*!***********************************************!*\ 10419 !*** multi ./src/components/search/search.js ***! 10420 \***********************************************/ 10421/*! no static exports found */ 10422/***/ (function(module, exports, __webpack_require__) { 10423 10424module.exports = __webpack_require__(/*! /var/www/html/dev_bc_bonmatin/html/web/themes/custom/bc_brand/src/components/search/search.js */"./src/components/search/search.js"); 10425 10426 10427/***/ }) 10428 10429/******/ });; 10430/** 10431 * @file 10432 * Infinite Scroll JS. 10433 */ 10434 10435(function ($, Drupal, debounce) { 10436 "use strict"; 10437 10438 // Cached reference to $(window). 10439 var $window = $(window); 10440 10441 // The threshold for how far to the bottom you should reach before reloading. 10442 var scrollThreshold = 200; 10443 10444 // The selector for the automatic pager. 10445 var automaticPagerSelector = '[data-drupal-views-infinite-scroll-pager
10445="automatic"]'; 10446 10447 // The selector for both manual load and automatic pager. 10448 var pagerSelector = '[data-drupal-views-infinite-scroll-pager]'; 10449 10450 // The selector for the automatic pager. 10451 var contentWrapperSelector = '[data-drupal-views-infinite-scroll-content-wrapper]'; 10452 10453 // The event and namespace that is bound to window for automatic scrolling. 10454 var scrollEvent = 'scroll.views_infinite_scroll'; 10455 10456 /** 10457 * Insert a views infinite scroll view into the document. 10458 * 10459 * @param {jQuery} $newView 10460 * New content detached from the DOM. 10461 */ 10462 $.fn.infiniteScrollInsertView = function ($newView) { 10463 // Extract the view DOM ID from the view classes. 10464 var matches = /(js-view-dom-id-\w+)/.exec(this.attr('class')); 10465 10466 if (!matches) { 10467 return; 10468 } 10469 10470 var currentViewId = matches[1].replace('js-view-dom-id-', 'views_dom_id:'); 10471 10472 // Get the existing ajaxViews object. 10473 var view = Drupal.views.instances[currentViewId]; 10474 // Remove once so that the exposed form and pager are processed on 10475 // behavior attach. 10476 view.$view.removeOnce('ajax-pager'); 10477 view.$exposed_form.removeOnce('exposed-form'); 10478 // Make sure infinite scroll can be reinitialized. 10479 var $existingPager = view.$view.find(pagerSelector); 10480 $existingPager.removeOnce('infinite-scroll'); 10481 10482 var $newRows = $newView.find(contentWrapperSelector).children(); 10483 var $newPager = $newView.find(pagerSelector); 10484 10485 view.$view.find(contentWrapperSelector) 10486 // Trigger a jQuery event on the wrapper to inform that new content was 10487 // loaded and allow other scripts to respond to the event. 10488 .trigger('views_infinite_scroll.new_content', $newRows.clone()) 10489 // Add the new rows to existing view. 10490 .append($newRows); 10491 10492 // Replace the pager link with the new link and ajaxPageState values. 10493 $existingPager.replaceWith($newPager); 10494 10495 // Run views and VIS behaviors. 10496 Drupal.attachBehaviors(view.$view[0]); 10497 }; 10498 10499 /** 10500 * Handle the automatic paging based on the scroll amount. 10501 * 10502 * @type {Drupal~behavior} 10503 * 10504 * @prop {Drupal~behaviorAttach} attach 10505 * Initialize infinite scroll pagers and bind the scroll event. 10506 * @prop {Drupal~behaviorDetach} detach 10507 * During `unload` remove the scroll event binding. 10508 */ 10509 Drupal.behaviors.views_infinite_scroll_automatic = { 10510 attach : function (context, settings) { 10511 $(context).find(automaticPagerSelector).once('infinite-scroll').each(function () { 10512 var $pager = $(this); 10513 $pager.addClass('visually-hidden'); 10514 var isLoadNeeded = function () { 10515 return window.innerHeight + window.pageYOffset > $pager.offset().top - scrollThreshold; 10516 }; 10517 $window.on(scrollEvent, debounce(function () { 10518 if (isLoadNeeded()) { 10519 $pager.find('[rel=next]').click(); 10520 $window.off(scrollEvent); 10521 } 10522 }, 200)); 10523 if (isLoadNeeded()) { 10524 $window.trigger(scrollEvent); 10525 } 10526 }); 10527 }, 10528 detach: function (context, settings, trigger) { 10529 // In the case where the view is removed from the document, remove it's 10530 // events. This is important in the case a view being refreshed for a reason 10531 // other than a scroll. AJAX filters are a good example of the event needing 10532 // to be destroyed earlier than above. 10533 if (trigger === 'unload') { 10534 if ($(context).find(automaticPagerSelector).removeOnce('infinite-scroll').length) { 10535 $window.off(scrollEvent); 10536 } 10537 } 10538 } 10539 }; 10540 10541 /** 10542 * Views AJAX pagination filter. 10543 * 10544 * In case the Entity View Attachment is rendered in a view context, 10545 * the default filter function prevents the required 'Use AJAX' setting 10546 * to work. 10547 * 10548 * @return {Boolean} 10549 * Whether to apply the Views AJAX paginator. VIS requires this setting 10550 * for pagination. 10551 */ 10552 Drupal.views.ajaxView.prototype.filterNestedViews = function () { 10553 return this.$view.hasClass('view-eva') || !this.$view.parents('.view').length; 10554 }; 10555 10556})(jQuery, Drupal, Drupal.debounce); 10557; 10558/******/ (function(modules) { // webpackBootstrap 10559/******/ // The module cache 10560/******/ var installedModules = {}; 10561/******/ 10562/******/ // The require function 10563/******/ function __webpack_require__(moduleId) { 10564/******/ 10565/******/ // Check if module is in cache 10566/******/ if(installedModules[moduleId]) { 10567/******/ return installedModules[moduleId].exports; 10568/******/ } 10569/******/ // Create a new module (and put it into the cache) 10570/******/ var module = installedModules[moduleId] = { 10571/******/ i: moduleId, 10572/******/ l: false, 10573/******/ exports: {} 10574/******/ }; 10575/******/ 10576/******/ // Execute the module function 10577/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 10578/******/ 10579/******/ // Flag the module as loaded
vendor: 2,823 bytes, lines 10580-10645
10580/******/ module.l = true; 10581/******/ 10582/******/ // Return the exports of the module 10583/******/ return module.exports; 10584/******/ } 10585/******/ 10586/******/ 10587/******/ // expose the modules object (__webpack_modules__) 10588/******/ __webpack_require__.m = modules; 10589/******/ 10590/******/ // expose the module cache 10591/******/ __webpack_require__.c = installedModules; 10592/******/ 10593/******/ // define getter function for harmony exports 10594/******/ __webpack_require__.d = function(exports, name, getter) { 10595/******/ if(!__webpack_require__.o(exports, name)) { 10596/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 10597/******/ } 10598/******/ }; 10599/******/ 10600/******/ // define __esModule on exports 10601/******/ __webpack_require__.r = function(exports) { 10602/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 10603/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 10604/******/ } 10605/******/ Object.defineProperty(exports, '__esModule', { value: true }); 10606/******/ }; 10607/******/ 10608/******/ // create a fake namespace object 10609/******/ // mode & 1: value is a module id, require it 10610/******/ // mode & 2: merge all properties of value into the ns 10611/******/ // mode & 4: return value when already ns object 10612/******/ // mode & 8|1: behave like require 10613/******/ __webpack_require__.t = function(value, mode) { 10614/******/ if(mode & 1) value = __webpack_require__(value); 10615/******/ if(mode & 8) return value; 10616/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 10617/******/ var ns = Object.create(null); 10618/******/ __webpack_require__.r(ns); 10619/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 10620/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 10621/******/ return ns; 10622/******/ }; 10623/******/ 10624/******/ // getDefaultExport function for compatibility with non-harmony modules 10625/******/ __webpack_require__.n = function(module) { 10626/******/ var getter = module && module.__esModule ? 10627/******/ function getDefault() { return module['default']; } : 10628/******/ function getModuleExports() { return module; }; 10629/******/ __webpack_require__.d(getter, 'a', getter); 10630/******/ return getter; 10631/******/ }; 10632/******/ 10633/******/ // Object.prototype.hasOwnProperty.call 10634/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 10635/******/ 10636/******/ // __webpack_public_path__ 10637/******/ __webpack_require__.p = "/"; 10638/******/ 10639/******/ 10640/******/ // Load entry module and return exports 10641/******/ return __webpack_require__(__webpack_require__.s = 7); 10642/******/ }) 10643/************************************************************************/ 10644/******/ ({ 10645
10646/***/ "./src/components/form/form.js": 10647/*!*************************************!*\ 10648 !*** ./src/components/form/form.js ***! 10649 \*************************************/ 10650/*! no static exports found */ 10651/***/ (function(module, exports, __webpack_require__) { 10652 10653"use strict"; 10654 10655 10656(function ($, Drupal) { 10657 Drupal.behaviors.form = { 10658 attach: function attach(context) { 10659 if ($('.path-contact-us').length) { 10660 // var path = $('.webform-confirmation', context).length; 10661 // if(path) { 10662 // $('html, body').animate({ 10663 // scrollTop: ($('.hero-intro').first().offset().top + 300) 10664 // },800); 10665 // } 10666 //focus on fields with errors when form's submitted. 10667 $(".webform-button--submit").on("click", function () { 10668 var errorSubmission = $('.error:visible', context).not('strong.error'); // var countryConfirmation = $('#edit-country.has-value', context).length; 10669 // //Canada fields not filled 10670 // var provinceCANotFilled = $('#edit-province-state-canada', context).not('has-value').length; 10671 // var postaCANotFilled = $('#edit-postal-code-canada', context).not('has-value').length; 10672 // //USA fields not filled 10673 // var provinceUSANotFilled = $('#edit-province-state-usa', context).not('has-value').length; 10674 // var postaUSANotFilled = $('#edit-postal-code-usa', context).not('has-value').length; 10675 10676 if (errorSubmission.first().offset()) { 10677 //For the others fields with .error class 10678 $('html, body').animate({ 10679 scrollTop: errorSubmission.first().offset().top - 250 10680 }, 800, function () { 10681 // Callback after animation 10682 // Must change focus! 10683 errorSubmission.first().focus(); 10684 }); 10685 } // else if (countryConfirmation && provinceCANotFilled) { 10686 // //if country field are filled, but the .error class not appear on province and postal code fields, put a focus on them: 10687 // $('html, body').animate({ 10688 // scrollTop: ($('#edit-province-state-canada', context).not('has-value').first().offset().top - 250) 10689 // },800); 10690 // } else if (countryConfirmation && postaCANotFilled) { 10691 // $('html, body').animate({ 10692 // scrollTop: ($('#edit-postal-code-canada', context).not('has-value').first().offset().top - 250) 10693 // },800); 10694 // } else if (countryConfirmation && provinceUSANotFilled) { 10695 // $('html, body').animate({ 10696 // scrollTop: ($('#edit-province-state-usa', context).not('has-value').first().offset().top - 250) 10697 // },800); 10698 // } else if (countryConfirmation && postaUSANotFilled) { 10699 // $('html, body').animate({ 10700 // scrollTop: ($('#edit-postal-code-usa', context).not('has-value').first().offset().top - 250) 10701 // },800); 10702 // } else if ($('.path-frontpage')) { 10703 // var path = $('.webform-confirmation', context).length; 10704 // if(path) { 10705 // $('html, body').animate({ 10706 // scrollTop: ($('.newsletter-form').first().offset().top - 100) 10707 // },800); 10708 // } 10709 // } 10710 10711 }); // if($('#edit-container-product-information').length) { 10712 // } 10713 } 10714 10715 if (!$('.path-user').length) { 10716 $(".form-control").each(function () { 10717 Drupal.behaviors.form.checkForInput(this, context); 10718 }); 10719 $(".form-control").on("change keyup", function () { 10720 Drupal.behaviors.form.checkForInput(this, context); 10721 }); 10722 } 10723 10724 $('.js-form-type-managed-file .form-check-input', context).change(function () { 10725 $(this).parent().siblings('[name="image_upload_remove_button"]').trigger("mousedown"); 10726 }); // popovers 10727 10728 $('.popover-button').popover({ 10729 html: true, 10730 trigger: 'manual' 10731 }).click(function (e) { 10732 $('.popover-button').not(this).popover('hide').css('z-index', '7999'); 10733 $(this).popover('toggle').css('z-index', '8001'); 10734 }); 10735 $(document).click(function (e) { 10736 if (!$(e.target).is('.popover-button, .popover-title, .popover-content')) { 10737 $('.popover-button').popover('hide'); 10738 } 10739 }); 10740 $('.webform-submission-form select option', context).each(function () { 10741 if ($(this).val() == '') { 10742 $(this).text(''); 10743 } 10744 }); 10745 $('.trigger').on('focus', function () { 10746 $('.trigger').attr('aria-expanded', 'true'); 10747 }).on('focusout', function () { 10748 $('.trigger').attr('aria-expanded', 'false'); 10749 }); //AQA fixes for unique id/aria attributes 10750 10751 if (document.querySelectorAll('#helpText').length > 0) { 10752 // $('#helpText').each(function(){ 10753 $(document.querySelectorAll('#helpText')).attr('id', function (i) { 10754 return 'helpText' + (i + 1); 10755 }); // }) 10756 10757 $(document.querySelectorAll('button[aria-controls="helpText"]')).attr('aria-controls', function (i) { 10758 return 'helpText' + (i + 1); 10759 }); 10760 } 10761 }, 10762 checkForInput: function checkForInput(element, context) { 10763 var $label = $(element).siblings("label"); 10764 10765 if ($(element).val().length > 0) { 10766 $label.addClass("input-has-value"); 10767 $(element).addClass("has-value"); 10768 } else { 10769 $label.removeClass("input-has-value"); 10770 $(element).removeClass("has-value"); 10771 } 10772 } 10773 }; 10774 10775 if ($('#webform-submission-contact-node-13-add-form').length) { 10776 $('#edit-daytime-phone-phone').attr('autocomplete', 'tel'); 10777 $('#edit-adress-address').attr('autocomplete', 'address-line1'); 10778 } 10779})(jQuery, Drupal); 10780 10781/***/ })
10781, 10782 10783/***/ 7: 10784/*!*******************************************!*\ 10785 !*** multi ./src/components/form/form.js ***! 10786 \*******************************************/ 10787/*! no static exports found */ 10788/***/ (function(module, exports, __webpack_require__) { 10789 10790module.exports = __webpack_require__(/*! /var/www/html/dev_bc_bonmatin/html/web/themes/custom/bc_brand/src/components/form/form.js */"./src/components/form/form.js"); 10791 10792 10793/***/ }) 10794 10795/******/ });;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.