/** * Initializes the tab widget * * @param {string} menuEntries * @param {string} contentEntries * @param {object} options * @return {void} */ var TabBar = function(menuEntries, contentEntries, options) { /** * Available options * * startIndex: starting tab index (beginning at 0) * enableAutoPlay: usage of an auto play mechanism to switch between tabs * autoPlayInterval: the time gap between the switch between two slides * enableMouseOver: usage of mouse over in addition the normal click event for changing a tab * classPrefix: prefix for all assigned classes * hashName: prefix for the location hash listener * pollingInterval: location hash polling interval * animateCallback: animation callback function * * Events: * onBeforeInitialize * onAfterInitialize * onTabChange * * @cfg {Object} */ this.options = { startIndex: 0, enableAutoPlay: false, autoPlayInterval: 7000, enableMouseOver: false, classPrefix: 'tx-dftabs-', hashName: 'tab', pollingInterval: 1000, animationCallback: null, onBeforeInitialize: null, onAfterInitialize: null, onTabChange: null, changeHashOnTabChange: false }; $.extend(this.options, options); /** * Tab Entry Array with Fields of Type "Object" * * Structure: * menuItem: related menu element * contentItem: related content element * * @type {Array} */ this.elementMap = []; /** * The Active Tab * * @type {int} */ this.previousTab = this.options.startIndex; /** * The AutoPlay Instance * * @type {int} */ this.autoPlay = 0; /** * Timed Display Method * * @type {int} */ this.timedDisplayFunction = 0; for (var i = 0; i < menuEntries.length; ++i) { this.elementMap[i] = {}; this.elementMap[i].menuItem = $(menuEntries[i]); this.elementMap[i].contentItem = $(contentEntries[i]); } this.finalizeInitialisation(); }; /** * A tab-bar widget with very basic functionality * * @author Stefan Galinski */ TabBar.prototype = { /** * Finalizes the initialisation * * @return {void} */ finalizeInitialisation: function() { this.trigger('beforeInitialize', this); this.previousTab = this.options.startIndex; this.parseContentLinks().addEvents().initAutoPlay().addLocationHashPolling(); this.trigger('afterInitialize', this); }, /** * Parses all links and adds a smooth scrolling to the tab if the link * references to an internal tab on the very same page * * @return {TabBar} */ parseContentLinks: function() { $.each(this.elementMap, function(index, element) { var links = element.contentItem.find('a'); links.each(function(index, link) { var parts = link.href.split('#'); if (parts[1] && parts[1].substr(this.options.hashName.length) === this.options.hashName && parts[0] === location.href.split('#')[0]) { var hashIndex = parts[1].substr(this.options.hashName.length); $(link).click(this.scrollToTab.bind(this, hashIndex)); } }.bind(this)); }.bind(this)); return this; }, /** * Scrolls to the menu item of the given tab index * * @param {int} tabIndex * @return {void} */ scrollToTab: function(tabIndex) { $(window).scrollTop(this.elementMap[tabIndex].menuItem.offset().y); }, /** * Adds the requested events to the tab menu elements * * @return {TabBar} */ addEvents: function() { $.each(this.elementMap, function(index, element) { if (this.options.enableMouseOver) { element.menuItem.mouseenter(this.timedDisplay.bind(this, index)); element.contentItem.mouseenter(this.clearTimedDisplay.bind(this)); } else { element.menuItem.click(function(event) { event.preventDefault(); this.display.call(this, index) }.bind(this)); } if (this.options.enableAutoPlay) { if (this.options.enableMouseOver) { element.menuItem.mouseenter(this.stopAutoPlay.bind(this)); element.menuItem.mouseleave(this.startAutoPlay.bind(this)); element.menuItem.click(this.startAutoPlay.bind(this)); } else { element.menuItem.click(this.stopAutoPlay.bind(this)); } } }.bind(this)); return this; }, /** * Initializes the autoplay mechanism based on the visibility state * * Note: If the visibility state isn't available, the autoplay functionality is * started directly. * * @return {TabBar} */ initAutoPlay: function() { var hidden = null, visibilityChange = null; if (typeof document.hidden !== 'undefined') { hidden = 'hidden'; visibilityChange = 'visibilitychange'; } else if (typeof document.mozHidden !== 'undefined') { hidden = 'mozHidden'; visibilityChange = 'mozvisibilitychange'; } else if (typeof document.msHidden !== 'undefined') { hidden = 'msHidden'; visibilityChange = 'msvisibilitychange'; } else if (typeof document.webkitHidden !== 'undefined') { hidden = 'webkitHidden'; visibilityChange = 'webkitvisibilitychange'; } if (visibilityChange) { document.addEventListener( visibilityChange, this.toggleAutoplayBasedOnVisibility.bind(this, [hidden]), false ); this.toggleAutoplayBasedOnVisibility(hidden); } else { this.startAutoPlay(); } return this; }, /** * Adds an URL hash evaluation with a polling interval of 1000ms to grant the possibility to * manually open content elements by changing the location hash inside the URL (e.g. acc123). * * @return {void} */ addLocationHashPolling: function() { setTimeout(this.hashHandler.bind(this), 1); setInterval(this.hashHandler.bind(this), 100); }, /** * Location Hash Handler * * @return {void} */ hashHandler: function() { if (this.locationHash === window.location.hash) { return; } var index = -1; this.locationHash = window.location.hash; if (this.locationHash !== '') { var matchExpression = new RegExp(this.options.hashName + '(\\d+)', 'i'); var matchResult = matchExpression.exec(this.locationHash); index = parseInt(matchResult ? matchResult[1] : '', 10); if (index >= 0 && index < this.elementMap.length) { this.display(index, false); } } else { if (this.previousTab !== this.options.startIndex) { this.display(this.options.startIndex, false); } } }, /** * Adds a small delay before displaying a tab (useful for mouseover) * * Note: The delay method is saved in the class property "timedDisplayFunction". * * @param {int} nextTabIndex * @return {TabBar} */ timedDisplay: function(nextTabIndex) { this.clearTimedDisplay(); this.timedDisplayFunction = setTimeout(this.display.bind(this, nextTabIndex), 250); return this; }, /** * Clears the timed display function * * @return {TabBar} */ clearTimedDisplay: function() { clearTimeout(this.timedDisplayFunction); return this; }, /** * Displays the given tab index * * @param {int} nextTabIndex * @param {Boolean} triggeredByAutoPlay * @return {TabBar} */ display: function(nextTabIndex, triggeredByAutoPlay) { if (triggeredByAutoPlay !== true) { triggeredByAutoPlay = false; } nextTabIndex = parseInt(nextTabIndex, 10); var tabIndexInRange = nextTabIndex >= 0 && nextTabIndex < this.elementMap.length; if (isNaN(nextTabIndex) || this.previousTab === nextTabIndex || !tabIndexInRange) { return this; } if (this.options.animationCallback) { this.options.animationCallback.call(this, nextTabIndex, triggeredByAutoPlay); } else { this.animate(nextTabIndex); } this.trigger('tabChange', this, this.previousTab, nextTabIndex); if (this.options.changeHashOnTabChange) { // save current scroll position in order to apply it after hash changed // this prevents the content from jumping around as the tabs change var currentScrollY = window.scrollY; window.location.hash = this.options.hashName + nextTabIndex; window.scrollTo(0, currentScrollY); } return this; }, /** * Default "animation" of the transition between two tabs. In real it's just * a toggling of the selected classes for the content and menu items. Define * your own animation function to get a nice effect. * * @param {int} nextTabIndex * @return {TabBar} */ animate: function(nextTabIndex) { this.toggleContentItemSelectionClasses(nextTabIndex); this.toggleMenuEntrySelectionClasses(nextTabIndex); this.previousTab = nextTabIndex; return this; }, /** * Toggles the "tabContentSelected" class on the last and current content elements * * @param {int} nextTabIndex * @return {TabBar} */ toggleContentItemSelectionClasses: function(nextTabIndex) { var selectedClass = this.options.classPrefix + 'tabContentSelected'; this.elementMap[this.previousTab].contentItem.removeClass(selectedClass); this.elementMap[nextTabIndex].contentItem.addClass(selectedClass); return this; }, /** * Toggles the "tabMenuEntrySelected" class on the last and current menu entries * * @param {int} nextTabIndex * @return {TabBar} */ toggleMenuEntrySelectionClasses: function(nextTabIndex) { var selectedClass = this.options.classPrefix + 'tabMenuEntrySelected'; this.elementMap[nextTabIndex].menuItem.addClass(selectedClass); this.elementMap[this.previousTab].menuItem.removeClass(selectedClass); return this; }, /** * Toggles the autplay setting based on the visibility state of the page * * @param {string} hidden field with the hidden state in the document object * @return {TabBar} */ toggleAutoplayBasedOnVisibility: function(hidden) { if (!document[hidden]) { this.startAutoPlay(); } else { this.stopAutoPlay(); } return this; }, /** * Implements the auto-play mechanism * * @return {void} */ autoPlayMechanism: function() { if (this.previousTab < this.elementMap.length - 1) { this.display(this.previousTab + 1, true); } else { this.display(0, true); } }, /** * Starts the auto-play mechanism * * @return {TabBar} */ startAutoPlay: function() { if (this.options.enableAutoPlay && !this.autoPlay) { this.autoPlay = setInterval(this.autoPlayMechanism.bind(this), this.options.autoPlayInterval); } return this; }, /** * Stops the auto-play mechanism * * @return {TabBar} */ stopAutoPlay: function() { clearInterval(this.autoPlay); this.autoPlay = 0; return this; }, /** * Triggers an event * * @return {void} */ trigger: function(event) { var onFunction = 'on' + event.charAt(0).toUpperCase() + event.slice(1); if (typeof this.options[onFunction] === 'function') { var args = Array.prototype.slice.call(arguments); args.shift(); this.options[onFunction].call(this, args[0], args[1], args[2], args[3]); } } }; $(document).ready(function() { //----- modalLanguage ----- if (document.cookie.indexOf('modal_shown=') >= 0) { //do nothing if modal_shown cookie is present } else { $('#languageModal').modal('show'); //show modal pop up document.cookie = 'modal_shown=seen; expires=;'; //set cookie modal_shown //cookie will expire when browser is closed } // Stop video playing when the MODAL is being closed (has finished closing) $('.videomodalcap').on('hidden.bs.modal', function(e) { $('.videomodalcap iframe').each(function() { var videoURL = $(this).attr('src'); $(this).attr('src', videoURL); }); }); //----- wow scroll appear ----- $(".contiene-prods > .row > div").addClass("wow fadeInLeft slow"); $(".capacitaciones-articulos > div").addClass("wow fadeInUp slower"); $(".contiene-historia > div").addClass("wow slideInUp slow"); wow = new WOW({ animateClass: 'animated', offset: 100 }); wow.init(); //----- CAROUSEL ----- $(".hp-slider").attr({ "data-pause":"false", "data-interval":"10000" }); //----- directional-hover ----- $('#direction-aware-hover figure').on('mouseenter mouseleave', hoverDirection); //----- restar circle efect------ $("#buttonRight").click(function() { var el = $(this), newone = el.clone(true); el.before(newone); $("#" + el.attr("id") + ":last-child").remove(); }); $("#buttonLeft").click(function() { var el = $(this), newone = el.clone(true); el.before(newone); $("#" + el.attr("id") + ":last-child").remove(); }); //----- fix submenu lineas ----- var altura = $('#submenu-lineas').offset().top; jQuery(window).scroll(function(){ if ( $(window).scrollTop() > altura ){ $('#submenu-lineas').addClass('fixed'); } else { $('#submenu-lineas').removeClass('fixed'); } }); //------ submenu productos active ----- var spath = window.location.href; $(".productos-direct li a").each(function() { if (this.href === spath) { $(this).addClass('active'); } }); }); //------ PARALLAX BG ----- jQuery(function(){ jQuery(window).scroll(function(){ if(jQuery(this).scrollTop() < 15) { jQuery('html').css({'background-position':'center 0%'}); jQuery('#oscureceback').css({'opacity':'0'}); } if(jQuery(this).scrollTop() > 15) { jQuery('html').css({'background-position':'center -2%'}); jQuery('#oscureceback').css({'opacity':'.5'}); } /*if(jQuery(this).scrollTop() > 100) { jQuery('html').css({'background-position':'center -4%'}); jQuery('#oscureceback').css({'opacity':'1'}); jQuery('#arrow-down').html(""); }*/ // hide logo if(jQuery(this).scrollTop() > jQuery(window).height()*0.1) { jQuery(".navbar-brand-logo-normal").css("display", "none"); jQuery("#language_menu").css("display", "none"); } if(jQuery(this).scrollTop() < $(window).height()*0.1) { jQuery(".navbar-brand-logo-normal").css("display", "block"); jQuery("#language_menu").css("display", "block"); } }); }); function hoverDirection(event) { var $overlay = $(this).find('figcaption'), side = getMouseDirection(event), animateTo, positionIn = { top: '0%', left: '0%' }, positionOut = (function() { switch(side) { case 0: return { top: '-100%', left: '0%' }; break; case 1: return { top: '0%', left: '100%' }; break; case 2: return { top: '100%', left: '0%' }; break; default: return { top: '0%', left: '-100%' }; break; } })(); if ( event.type === 'mouseenter' ) { animateTo = positionIn; $overlay.css(positionOut); } else { animateTo = positionOut; } $overlay.stop(true).animate(animateTo, 200, 'linear'); } function getMouseDirection(event) { var $item = $(event.currentTarget), offset = $item.offset(), w = $item.outerWidth(), h = $item.outerHeight(), x = (event.pageX - offset.left - w / 2) * ((w > h) ? h / w: 1), y = (event.pageY - offset.top - h / 2) * ((h > w) ? w / h: 1), direction = Math.round((Math.atan2(y, x) * (180 / Math.PI) + 180) / 90 + 3) % 4; return direction; } (function() { var MutationObserver, Util, WeakMap, getComputedStyle, getComputedStyleRX, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; Util = (function() { function Util() {} Util.prototype.extend = function(custom, defaults) { var key, value; for (key in defaults) { value = defaults[key]; if (custom[key] == null) { custom[key] = value; } } return custom; }; Util.prototype.isMobile = function(agent) { return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(agent); }; Util.prototype.createEvent = function(event, bubble, cancel, detail) { var customEvent; if (bubble == null) { bubble = false; } if (cancel == null) { cancel = false; } if (detail == null) { detail = null; } if (document.createEvent != null) { customEvent = document.createEvent('CustomEvent'); customEvent.initCustomEvent(event, bubble, cancel, detail); } else if (document.createEventObject != null) { customEvent = document.createEventObject(); customEvent.eventType = event; } else { customEvent.eventName = event; } return customEvent; }; Util.prototype.emitEvent = function(elem, event) { if (elem.dispatchEvent != null) { return elem.dispatchEvent(event); } else if (event in (elem != null)) { return elem[event](); } else if (("on" + event) in (elem != null)) { return elem["on" + event](); } }; Util.prototype.addEvent = function(elem, event, fn) { if (elem.addEventListener != null) { return elem.addEventListener(event, fn, false); } else if (elem.attachEvent != null) { return elem.attachEvent("on" + event, fn); } else { return elem[event] = fn; } }; Util.prototype.removeEvent = function(elem, event, fn) { if (elem.removeEventListener != null) { return elem.removeEventListener(event, fn, false); } else if (elem.detachEvent != null) { return elem.detachEvent("on" + event, fn); } else { return delete elem[event]; } }; Util.prototype.innerHeight = function() { if ('innerHeight' in window) { return window.innerHeight; } else { return document.documentElement.clientHeight; } }; return Util; })(); WeakMap = this.WeakMap || this.MozWeakMap || (WeakMap = (function() { function WeakMap() { this.keys = []; this.values = []; } WeakMap.prototype.get = function(key) { var i, item, j, len, ref; ref = this.keys; for (i = j = 0, len = ref.length; j < len; i = ++j) { item = ref[i]; if (item === key) { return this.values[i]; } } }; WeakMap.prototype.set = function(key, value) { var i, item, j, len, ref; ref = this.keys; for (i = j = 0, len = ref.length; j < len; i = ++j) { item = ref[i]; if (item === key) { this.values[i] = value; return; } } this.keys.push(key); return this.values.push(value); }; return WeakMap; })()); MutationObserver = this.MutationObserver || this.WebkitMutationObserver || this.MozMutationObserver || (MutationObserver = (function() { function MutationObserver() { if (typeof console !== "undefined" && console !== null) { console.warn('MutationObserver is not supported by your browser.'); } if (typeof console !== "undefined" && console !== null) { console.warn('WOW.js cannot detect dom mutations, please call .sync() after loading new content.'); } } MutationObserver.notSupported = true; MutationObserver.prototype.observe = function() {}; return MutationObserver; })()); getComputedStyle = this.getComputedStyle || function(el, pseudo) { this.getPropertyValue = function(prop) { var ref; if (prop === 'float') { prop = 'styleFloat'; } if (getComputedStyleRX.test(prop)) { prop.replace(getComputedStyleRX, function(_, _char) { return _char.toUpperCase(); }); } return ((ref = el.currentStyle) != null ? ref[prop] : void 0) || null; }; return this; }; getComputedStyleRX = /(\-([a-z]){1})/g; this.WOW = (function() { WOW.prototype.defaults = { boxClass: 'wow', animateClass: 'animated', offset: 0, mobile: true, live: true, callback: null, scrollContainer: null }; function WOW(options) { if (options == null) { options = {}; } this.scrollCallback = bind(this.scrollCallback, this); this.scrollHandler = bind(this.scrollHandler, this); this.resetAnimation = bind(this.resetAnimation, this); this.start = bind(this.start, this); this.scrolled = true; this.config = this.util().extend(options, this.defaults); if (options.scrollContainer != null) { this.config.scrollContainer = document.querySelector(options.scrollContainer); } this.animationNameCache = new WeakMap(); this.wowEvent = this.util().createEvent(this.config.boxClass); } WOW.prototype.init = function() { var ref; this.element = window.document.documentElement; if ((ref = document.readyState) === "interactive" || ref === "complete") { this.start(); } else { this.util().addEvent(document, 'DOMContentLoaded', this.start); } return this.finished = []; }; WOW.prototype.start = function() { var box, j, len, ref; this.stopped = false; this.boxes = (function() { var j, len, ref, results; ref = this.element.querySelectorAll("." + this.config.boxClass); results = []; for (j = 0, len = ref.length; j < len; j++) { box = ref[j]; results.push(box); } return results; }).call(this); this.all = (function() { var j, len, ref, results; ref = this.boxes; results = []; for (j = 0, len = ref.length; j < len; j++) { box = ref[j]; results.push(box); } return results; }).call(this); if (this.boxes.length) { if (this.disabled()) { this.resetStyle(); } else { ref = this.boxes; for (j = 0, len = ref.length; j < len; j++) { box = ref[j]; this.applyStyle(box, true); } } } if (!this.disabled()) { this.util().addEvent(this.config.scrollContainer || window, 'scroll', this.scrollHandler); this.util().addEvent(window, 'resize', this.scrollHandler); this.interval = setInterval(this.scrollCallback, 50); } if (this.config.live) { return new MutationObserver((function(_this) { return function(records) { var k, len1, node, record, results; results = []; for (k = 0, len1 = records.length; k < len1; k++) { record = records[k]; results.push((function() { var l, len2, ref1, results1; ref1 = record.addedNodes || []; results1 = []; for (l = 0, len2 = ref1.length; l < len2; l++) { node = ref1[l]; results1.push(this.doSync(node)); } return results1; }).call(_this)); } return results; }; })(this)).observe(document.body, { childList: true, subtree: true }); } }; WOW.prototype.stop = function() { this.stopped = true; this.util().removeEvent(this.config.scrollContainer || window, 'scroll', this.scrollHandler); this.util().removeEvent(window, 'resize', this.scrollHandler); if (this.interval != null) { return clearInterval(this.interval); } }; WOW.prototype.sync = function(element) { if (MutationObserver.notSupported) { return this.doSync(this.element); } }; WOW.prototype.doSync = function(element) { var box, j, len, ref, results; if (element == null) { element = this.element; } if (element.nodeType !== 1) { return; } element = element.parentNode || element; ref = element.querySelectorAll("." + this.config.boxClass); results = []; for (j = 0, len = ref.length; j < len; j++) { box = ref[j]; if (indexOf.call(this.all, box) < 0) { this.boxes.push(box); this.all.push(box); if (this.stopped || this.disabled()) { this.resetStyle(); } else { this.applyStyle(box, true); } results.push(this.scrolled = true); } else { results.push(void 0); } } return results; }; WOW.prototype.show = function(box) { this.applyStyle(box); box.className = box.className + " " + this.config.animateClass; if (this.config.callback != null) { this.config.callback(box); } this.util().emitEvent(box, this.wowEvent); this.util().addEvent(box, 'animationend', this.resetAnimation); this.util().addEvent(box, 'oanimationend', this.resetAnimation); this.util().addEvent(box, 'webkitAnimationEnd', this.resetAnimation); this.util().addEvent(box, 'MSAnimationEnd', this.resetAnimation); return box; }; WOW.prototype.applyStyle = function(box, hidden) { var delay, duration, iteration; duration = box.getAttribute('data-wow-duration'); delay = box.getAttribute('data-wow-delay'); iteration = box.getAttribute('data-wow-iteration'); return this.animate((function(_this) { return function() { return _this.customStyle(box, hidden, duration, delay, iteration); }; })(this)); }; WOW.prototype.animate = (function() { if ('requestAnimationFrame' in window) { return function(callback) { return window.requestAnimationFrame(callback); }; } else { return function(callback) { return callback(); }; } })(); WOW.prototype.resetStyle = function() { var box, j, len, ref, results; ref = this.boxes; results = []; for (j = 0, len = ref.length; j < len; j++) { box = ref[j]; results.push(box.style.visibility = 'visible'); } return results; }; WOW.prototype.resetAnimation = function(event) { var target; if (event.type.toLowerCase().indexOf('animationend') >= 0) { target = event.target || event.srcElement; return target.className = target.className.replace(this.config.animateClass, '').trim(); } }; WOW.prototype.customStyle = function(box, hidden, duration, delay, iteration) { if (hidden) { this.cacheAnimationName(box); } box.style.visibility = hidden ? 'hidden' : 'visible'; if (duration) { this.vendorSet(box.style, { animationDuration: duration }); } if (delay) { this.vendorSet(box.style, { animationDelay: delay }); } if (iteration) { this.vendorSet(box.style, { animationIterationCount: iteration }); } this.vendorSet(box.style, { animationName: hidden ? 'none' : this.cachedAnimationName(box) }); return box; }; WOW.prototype.vendors = ["moz", "webkit"]; WOW.prototype.vendorSet = function(elem, properties) { var name, results, value, vendor; results = []; for (name in properties) { value = properties[name]; elem["" + name] = value; results.push((function() { var j, len, ref, results1; ref = this.vendors; results1 = []; for (j = 0, len = ref.length; j < len; j++) { vendor = ref[j]; results1.push(elem["" + vendor + (name.charAt(0).toUpperCase()) + (name.substr(1))] = value); } return results1; }).call(this)); } return results; }; WOW.prototype.vendorCSS = function(elem, property) { var j, len, ref, result, style, vendor; style = getComputedStyle(elem); result = style.getPropertyCSSValue(property); ref = this.vendors; for (j = 0, len = ref.length; j < len; j++) { vendor = ref[j]; result = result || style.getPropertyCSSValue("-" + vendor + "-" + property); } return result; }; WOW.prototype.animationName = function(box) { var animationName, error; try { animationName = this.vendorCSS(box, 'animation-name').cssText; } catch (error) { animationName = getComputedStyle(box).getPropertyValue('animation-name'); } if (animationName === 'none') { return ''; } else { return animationName; } }; WOW.prototype.cacheAnimationName = function(box) { return this.animationNameCache.set(box, this.animationName(box)); }; WOW.prototype.cachedAnimationName = function(box) { return this.animationNameCache.get(box); }; WOW.prototype.scrollHandler = function() { return this.scrolled = true; }; WOW.prototype.scrollCallback = function() { var box; if (this.scrolled) { this.scrolled = false; this.boxes = (function() { var j, len, ref, results; ref = this.boxes; results = []; for (j = 0, len = ref.length; j < len; j++) { box = ref[j]; if (!(box)) { continue; } if (this.isVisible(box)) { this.show(box); continue; } results.push(box); } return results; }).call(this); if (!(this.boxes.length || this.config.live)) { return this.stop(); } } }; WOW.prototype.offsetTop = function(element) { var top; while (element.offsetTop === void 0) { element = element.parentNode; } top = element.offsetTop; while (element = element.offsetParent) { top += element.offsetTop; } return top; }; WOW.prototype.isVisible = function(box) { var bottom, offset, top, viewBottom, viewTop; offset = box.getAttribute('data-wow-offset') || this.config.offset; viewTop = (this.config.scrollContainer && this.config.scrollContainer.scrollTop) || window.pageYOffset; viewBottom = viewTop + Math.min(this.element.clientHeight, this.util().innerHeight()) - offset; top = this.offsetTop(box); bottom = top + box.clientHeight; return top <= viewBottom && bottom >= viewTop; }; WOW.prototype.util = function() { return this._util != null ? this._util : this._util = new Util(); }; WOW.prototype.disabled = function() { return !this.config.mobile && this.util().isMobile(navigator.userAgent); }; return WOW; })(); }).call(this); /* @license Papa Parse v5.1.0 https://github.com/mholt/PapaParse License: MIT */ !function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof module&&"undefined"!=typeof exports?module.exports=t():e.Papa=t()}(this,function s(){"use strict";var f="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==f?f:{};var n=!f.document&&!!f.postMessage,o=n&&/blob:/i.test((f.location||{}).protocol),a={},h=0,b={parse:function(e,t){var r=(t=t||{}).dynamicTyping||!1;q(r)&&(t.dynamicTypingFunction=r,r={});if(t.dynamicTyping=r,t.transform=!!q(t.transform)&&t.transform,t.worker&&b.WORKERS_SUPPORTED){var i=function(){if(!b.WORKERS_SUPPORTED)return!1;var e=(r=f.URL||f.webkitURL||null,i=s.toString(),b.BLOB_URL||(b.BLOB_URL=r.createObjectURL(new Blob(["(",i,")();"],{type:"text/javascript"})))),t=new f.Worker(e);var r,i;return t.onmessage=_,t.id=h++,a[t.id]=t}();return i.userStep=t.step,i.userChunk=t.chunk,i.userComplete=t.complete,i.userError=t.error,t.step=q(t.step),t.chunk=q(t.chunk),t.complete=q(t.complete),t.error=q(t.error),delete t.worker,void i.postMessage({input:e,config:t,workerId:i.id})}var n=null;b.NODE_STREAM_INPUT,"string"==typeof e?n=t.download?new l(t):new p(t):!0===e.readable&&q(e.read)&&q(e.on)?n=new m(t):(f.File&&e instanceof File||e instanceof Object)&&(n=new c(t));return n.stream(e)},unparse:function(e,t){var n=!1,_=!0,g=",",v="\r\n",s='"',a=s+s,r=!1,i=null;!function(){if("object"!=typeof t)return;"string"!=typeof t.delimiter||b.BAD_DELIMITERS.filter(function(e){return-1!==t.delimiter.indexOf(e)}).length||(g=t.delimiter);("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes);"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(r=t.skipEmptyLines);"string"==typeof t.newline&&(v=t.newline);"string"==typeof t.quoteChar&&(s=t.quoteChar);"boolean"==typeof t.header&&(_=t.header);if(Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");i=t.columns}void 0!==t.escapeChar&&(a=t.escapeChar+s)}();var o=new RegExp(U(s),"g");"string"==typeof e&&(e=JSON.parse(e));if(Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return u(null,e,r);if("object"==typeof e[0])return u(i||h(e[0]),e,r)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:h(e.data[0])),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),u(e.fields||[],e.data||[],r);throw new Error("Unable to serialize unrecognized input");function h(e){if("object"!=typeof e)return[];var t=[];for(var r in e)t.push(r);return t}function u(e,t,r){var i="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var n=Array.isArray(e)&&0=this._config.preview;if(o)f.postMessage({results:n,workerId:b.WORKER_ID,finished:a});else if(q(this._config.chunk)&&!t){if(this._config.chunk(n,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);n=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(n.data),this._completeResults.errors=this._completeResults.errors.concat(n.errors),this._completeResults.meta=n.meta),this._completed||!a||!q(this._config.complete)||n&&n.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),a||n&&n.meta.paused||this._nextChunk(),n}this._halted=!0},this._sendError=function(e){q(this._config.error)?this._config.error(e):o&&this._config.error&&f.postMessage({workerId:b.WORKER_ID,error:e,finished:!1})}}function l(e){var i;(e=e||{}).chunkSize||(e.chunkSize=b.RemoteChunkSize),u.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(i=new XMLHttpRequest,this._config.withCredentials&&(i.withCredentials=this._config.withCredentials),n||(i.onload=y(this._chunkLoaded,this),i.onerror=y(this._chunkError,this)),i.open("GET",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var t in e)i.setRequestHeader(t,e[t])}if(this._config.chunkSize){var r=this._start+this._config.chunkSize-1;i.setRequestHeader("Range","bytes="+this._start+"-"+r)}try{i.send()}catch(e){this._chunkError(e.message)}n&&0===i.status&&this._chunkError()}},this._chunkLoaded=function(){4===i.readyState&&(i.status<200||400<=i.status?this._chunkError():(this._start+=i.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader("Content-Range");if(null===t)return-1;return parseInt(t.substr(t.lastIndexOf("/")+1))}(i),this.parseChunk(i.responseText)))},this._chunkError=function(e){var t=i.statusText||e;this._sendError(new Error(t))}}function c(e){var i,n;(e=e||{}).chunkSize||(e.chunkSize=b.LocalChunkSize),u.call(this,e);var s="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,s?((i=new FileReader).onload=y(this._chunkLoaded,this),i.onerror=y(this._chunkError,this)):i=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(i.error)}}function p(e){var r;u.call(this,e=e||{}),this.stream=function(e){return r=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e=this._config.chunkSize,t=e?r.substr(0,e):r;return r=e?r.substr(e):"",this._finished=!r,this.parseChunk(t)}}}function m(e){u.call(this,e=e||{});var t=[],r=!0,i=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){i&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):r=!0},this._streamData=y(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=y(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=y(function(){this._streamCleanUp(),i=!0,this._streamData("")},this),this._streamCleanUp=y(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function r(g){var a,o,h,i=Math.pow(2,53),n=-i,s=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,u=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,t=this,r=0,f=0,d=!1,e=!1,l=[],c={data:[],errors:[],meta:{}};if(q(g.step)){var p=g.step;g.step=function(e){if(c=e,_())m();else{if(m(),0===c.data.length)return;r+=e.data.length,g.preview&&r>g.preview?o.abort():p(c,t)}}}function v(e){return"greedy"===g.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function m(){if(c&&h&&(k("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+b.DefaultDelimiter+"'"),h=!1),g.skipEmptyLines)for(var e=0;e=l.length?"__parsed_extra":l[r]),g.transform&&(s=g.transform(s,n)),s=y(n,s),"__parsed_extra"===n?(i[n]=i[n]||[],i[n].push(s)):i[n]=s}return g.header&&(r>l.length?k("FieldMismatch","TooManyFields","Too many fields: expected "+l.length+" fields but parsed "+r,f+t):r=i.length/2?"\r\n":"\r"}(e,i)),h=!1,g.delimiter)q(g.delimiter)&&(g.delimiter=g.delimiter(e),c.meta.delimiter=g.delimiter);else{var n=function(e,t,r,i,n){var s,a,o,h;n=n||[",","\t","|",";",b.RECORD_SEP,b.UNIT_SEP];for(var u=0;u=L)return R(!0)}else for(g=z,z++;;){if(-1===(g=a.indexOf(O,g+1)))return t||u.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:h.length,index:z}),w();if(g===i-1)return w(a.substring(z,g).replace(_,O));if(O!==M||a[g+1]!==M){if(O===M||0===g||a[g-1]!==M){var y=E(-1===m?p:Math.min(p,m));if(a[g+1+y]===D){f.push(a.substring(z,g).replace(_,O)),a[z=g+1+y+e]!==O&&(g=a.indexOf(O,z)),p=a.indexOf(D,z),m=a.indexOf(I,z);break}var k=E(m);if(a.substr(g+1+k,n)===I){if(f.push(a.substring(z,g).replace(_,O)),C(g+1+k+n),p=a.indexOf(D,z),g=a.indexOf(O,z),o&&(S(),j))return R();if(L&&h.length>=L)return R(!0);break}u.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:h.length,index:z}),g++}}else g++}return w();function b(e){h.push(e),d=z}function E(e){var t=0;if(-1!==e){var r=a.substring(g+1,e);r&&""===r.trim()&&(t=r.length)}return t}function w(e){return t||(void 0===e&&(e=a.substr(z)),f.push(e),z=i,b(f),o&&S()),R()}function C(e){z=e,b(f),f=[],m=a.indexOf(I,z)}function R(e,t){return{data:t||!1?h[0]:h,errors:u,meta:{delimiter:D,linebreak:I,aborted:j,truncated:!!e,cursor:d+(r||0)}}}function S(){A(R(void 0,!0)),h=[],u=[]}function x(e,t,r){var i={nextDelim:void 0,quoteSearch:void 0},n=a.indexOf(O,t+1);if(t