kangaz.com.au
Open in
urlscan Pro
27.121.68.103
Public Scan
URL:
https://kangaz.com.au/templates/Skyline_v2/resources/js/browserify.build.js
Submission: On December 23 via api from US — Scanned from AU
Submission: On December 23 via api from US — Scanned from AU
Form analysis
0 forms found in the DOMText Content
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ var initSitelocation = require('../../common_javascript/initialize-sitelocation'); var siteLocation = require('@yola/sitelocation'); var callAsync = require('../../common_javascript/call-async'); require('@yola/mobilemenu'); var initMenu = function() { var els = [ document.querySelector('.yola_content_wrap'), document.querySelector('.yola_footer_wrap'), document.querySelector('.yola_banner_wrap'), document.getElementById('sys_yolacredit_wrap'), document.getElementById('yola_heading_block') ]; var mobileMenuOpen = function(event) { els.forEach(function(el) { if (!el) { return; } el.classList.add('small_device_hide'); }); }; var mobileMenuClose = function(event) { els.forEach(function(el) { if (!el) { return; } el.classList.remove('small_device_hide'); }); }; $('.mob_menu').mobileMenu({ onOpen: mobileMenuOpen, onClose: mobileMenuClose }); }; /* With all Javascript bundled into one file, javascript is significantly * more brittle, especially given that users have the power to overwrite * globals that could interfere with bundled code. Initializing each component * on its own turn of the event loop should minimize failures to individual * Javascript components, instead of the whole site. */ callAsync(initMenu); callAsync(initSitelocation(siteLocation, 'locationData')); },{"../../common_javascript/call-async":73,"../../common_javascript/initialize-sitelocation":74,"@yola/mobilemenu":2,"@yola/sitelocation":8}],2:[function(require,module,exports){ 'use strict'; /* * jQuery mobilemenu plugin */ (function ($, window, document, undefined) { var pluginName = 'mobileMenu'; var subName = 'subMenu'; var defaults = {}; //The plugin constructor function MobileMenu(element, options) { this.$element = $(element); this.options = $.extend({}, defaults, options); this._defaults = defaults; this._name = pluginName; this._onOpen = options.onOpen || $.noop; this._onClose = options.onClose || $.noop; this.init(); } MobileMenu.prototype.init = function() { var menuToggle = this.menuToggle.bind(this); var subToggle = this.subToggle.bind(this); this.$menuToggleBtn = this.$element.find('.mob_menu_toggle'); this.$menuToggleBtn.on('click', menuToggle); this.$subMenuToggleBtns = this.$element.find('.mob_more_toggle'); this.$subMenuToggleBtns.on('click', subToggle); this.$subMenuWrappers = this.$element.find('li'); }; MobileMenu.prototype.menuToggle = function(event) { this.$element.toggleClass('menu_open'); if(! this.$element.hasClass('menu_open')) { this.closeSubMenus(); this._onClose(event); } else { this._onOpen(event); } }; MobileMenu.prototype.subToggle = function(event) { var $buttonClicked = $(event.target); var $subMenu = $buttonClicked.closest('li'); $subMenu.toggleClass('sub_menu_open'); this.closeSubMenus($subMenu); }; MobileMenu.prototype.closeSubMenus = function(exclude) { if(! exclude) { return this.$subMenuWrappers.removeClass('sub_menu_open'); } this.$subMenuWrappers.each(function(index) { if(this !== exclude.get(0)) { $(this).removeClass('sub_menu_open'); } }); }; $.fn[pluginName] = function(options) { return this.each(function() { if (!$.data(this, 'plugin_' + pluginName)) { var pluginInstance = new MobileMenu(this, options); $.data(this, 'plugin_' + pluginName, pluginInstance); } }); }; })(jQuery, window, document); },{}],3:[function(require,module,exports){ module.exports={"cs":{"Address":"Adresa","Call":"Zavolat","Closed":"ZavÅ™eno","Closed all day":"ZavÅ™eno celý den","Closes":"ZavÃrá","Current Location":"Aktuálnà pozice","Currently closed":"MomentálnÄ› zavÅ™eno","Day":"Den","Friday":"Pátek","Hours":"Hodiny","Map":"Mapa","Monday":"PondÄ›lÃ","Open now":"OtevÅ™Ãt nynÃ","Open today from %s to %s":"Dnes otevÅ™eno od %s do %s","Opens":"OtevÃrá","Phone":"Telefon","Saturday":"Sobota","Sunday":"NedÄ›le","This Week":"Tento týden","Thursday":"ÄŒtvrtek","Today":"Dnes","Today's Hours":"DneÅ¡nà otevÃracà doba","Tuesday":"Úterý","Wednesday":"StÅ™eda"},"da":{"Address":"Adresse","Call":"Ring","Closed":"Lukket","Closed all day":"Lukket hele dagen","Closes":"Lukker","Current Location":"Nuværende placering","Currently closed":"Lukket lige nu","Day":"Dag","Friday":"Fredag","Hours":"Ã…bningstider","Map":"Kort","Monday":"Mandag","Open now":"Ã…ben nu","Open today from %s to %s":"Ã…ben i dag fra %s til %s","Opens":"Ã…bner","Phone":"Telefon","Saturday":"Lørdag","Sunday":"Søndag","This Week":"Denne uge","Thursday":"Torsdag","Today":"I dag","Today's Hours":"Dagens Ã¥bningstider","Tuesday":"Tirsdag","Wednesday":"Onsdag"},"de":{"Address":"Adresse","Call":"Telefon","Closed":"Geschlossen","Closed all day":"Ganztägig geschlossen","Closes":"schließt","Current Location":"aktueller Standort","Currently closed":"derzeit geschlossen","Day":"Wochentag","Friday":"Freitag","Hours":"Öffnungszeiten","Map":"Karte","Monday":"Montag","Open now":"Jetzt geöffnet","Open today from %s to %s":"Heute geöffnet von %s bis %s","Opens":"öffnet","Phone":"Telefon","Saturday":"Samstag","Sunday":"Sonntag","This Week":"diese Woche","Thursday":"Donnerstag","Today":"heute","Today's Hours":"Öffnungszeiten heute","Tuesday":"Dienstag","Wednesday":"Mittwoch"},"es":{"Address":"Dirección","Call":"Llamar","Closed":"Cerrada","Closed all day":"Cerrado todo el dÃa","Closes":"Cierra","Current Location":"Ubicación actual","Currently closed":"Cerrado de momento","Day":"DÃa","Friday":"Viernes","Hours":"Horas","Map":"Mapa","Monday":"Lunes","Open now":"Abrir ahora","Open today from %s to %s":"Abrir hoy de %s a %s","Opens":"Abre","Phone":"Teléfono","Saturday":"Sábado","Sunday":"Domingo","This Week":"Esta semana","Thursday":"Jueves","Today":"Hoy","Today's Hours":"Horas para el dÃa de hoy","Tuesday":"Martes","Wednesday":"Miércoles"},"fr":{"Address":"Adresse","Call":"Appel","Closed":"Fermé","Closed all day":"Fermé toute la journée","Closes":"Ferme","Current Location":"Emplacement actuel","Currently closed":"Actuellement fermé","Day":"Jour","Friday":"Vendredi","Hours":"Heures","Map":"Carte","Monday":"Lundi","Open now":"Ouvert maintenant","Open today from %s to %s":"Ouvert aujourd'hui de %s à %s","Opens":"Ouvre","Phone":"Téléphone","Saturday":"Samedi","Sunday":"Dimanche","This Week":"Cette semaine","Thursday":"Jeudi","Today":"Aujourd'hui","Today's Hours":"Heures du Jour","Tuesday":"Mardi","Wednesday":"Mercredi"},"hu":{"Address":"CÃm","Call":"HÃvás","Closed":"Zárva","Closed all day":"Egész nap zárva","Closes":"Bezár","Current Location":"Jelenlegi hely","Currently closed":"Jelenleg zárva","Day":"Nap","Friday":"Péntek","Hours":"Órák","Map":"Térkép","Monday":"HétfÅ‘","Open now":"Most nyitva","Open today from %s to %s":"Mai napon nyitva %s-tól %s-ig","Opens":"Nyit","Phone":"Telefon","Saturday":"Szombat","Sunday":"Vasárnap","This Week":"Ezen a héten","Thursday":"Csütörtök","Today":"Ma","Today's Hours":"Mai órák","Tuesday":"Kedd","Wednesday":"Szerda"},"id":{"Address":"Alamat","Call":"Telepon","Closed":"Tutup","Closed all day":"Tutup sepanjang hari","Closes":"Menutup","Current Location":"Lokasi saat ini","Currently closed":"Saat ini tutup","Day":"Hari","Friday":"Jumat","Hours":"Jam","Map":"Peta","Monday":"Senin","Open now":"Buka sekarang","Open today from %s to %s":"Hari ini buka dari %s sampai %s","Opens":"Buka","Phone":"Telepon","Saturday":"Sabtu","Sunday":"Hari Minggu","This Week":"Minggu ini","Thursday":"Kamis","Today":"Hari ini","Today's Hours":"Jam hari ini","Tuesday":"Selasa","Wednesday":"Hari Rabu"},"it":{"Address":"indirizzo","Call":"Chiamata","Closed":"Chiuso","Closed all day":"Chiuso tutto il giorno","Closes":"Chiude","Current Location":"Indirizzo attuale","Currently closed":"Attualmente chiuso","Day":"Giorno","Friday":"Venerdi'","Hours":"Ore","Map":"Mappa","Monday":"Lunedi'","Open now":"Aperto adesso","Open today from %s to %s":"aperto oggi dalle %s alle %s","Opens":"Apre","Phone":"Telefono","Saturday":"Sabato","Sunday":"Domenica","This Week":"Questa settimana","Thursday":"Giovedi'","Today":"Oggi","Today's Hours":"Ore di oggi","Tuesday":"Martedi'","Wednesday":"Mercoledi'"},"ja":{"Address":"アドレス","Call":"電話","Closed":"閉鎖","Closed all day":"閉店日","Closes":"閉店","Current Location":"ç¾åœ¨åœ°","Currently closed":"ç¾åœ¨ã€é–‰ã˜ã¦ã„ã¾ã™","Day":"曜日","Friday":"金曜日","Hours":"時","Map":"地図","Monday":"月曜日","Open now":"ç¾åœ¨ã€é–‹ã„ã¦ã„ã¾ã™","Open today from %s to %s":"本日ã€%s時ã‹ã‚‰%s時ã¾ã§ã‚ªãƒ¼ãƒ—ン","Opens":"開店","Phone":"電話","Saturday":"土曜日","Sunday":"日曜日","This Week":"今週","Thursday":"木曜日","Today":"今日","Today's Hours":"今日ã®å°±æ¥æ™‚é–“","Tuesday":"ç«æ›œæ—¥","Wednesday":"水曜日"},"nb":{"Address":"Adresse","Call":"Ring","Closed":"Stengt","Closed all day":"Stengt hele dagen","Closes":"Stenger","Current Location":"NÃ¥værende posisjon","Currently closed":"For øyeblikket lukket","Day":"Dag","Friday":"Fredag","Hours":"Timer","Map":"Kart","Monday":"Mandag","Open now":"Ã…pen nÃ¥","Open today from %s to %s":"Ã…pen i dag fra %s til %s","Opens":"Ã…pner","Phone":"Telefon","Saturday":"Lørdag","Sunday":"Søndag","This Week":"Denne uken","Thursday":"Torsdag","Today":"I dag","Today's Hours":"Dagens Ã¥pningstider","Tuesday":"Tirsdag","Wednesday":"Onsdag"},"nl":{"Address":"Adres","Call":"Bel","Closed":"Gesloten","Closed all day":"De hele dag gesloten","Closes":"Sluit","Current Location":"Huidige locatie","Currently closed":"Momenteel gesloten","Day":"Dag","Friday":"Vrijdag","Hours":"Uren","Map":"Kaart","Monday":"Maandag","Open now":"Nu open","Open today from %s to %s":"Vandaag open van %s tot %s","Opens":"Opent","Phone":"Telefoon","Saturday":"Zaterdag","Sunday":"Zondag","This Week":"Deze Week","Thursday":"Donderdag","Today":"Vandaag","Today's Hours":"Uren van vandaag","Tuesday":"Dinsdag","Wednesday":"Woensdag"},"pl":{"Address":"Adres","Call":"PoÅ‚Ä…czenie","Closed":"ZamkniÄ™ty","Closed all day":"ZamkniÄ™te przez caÅ‚y dzieÅ„","Closes":"Zamyka","Current Location":"Aktualna lokalizacja","Currently closed":"Aktualnie zamkniÄ™te","Day":"DzieÅ„","Friday":"PiÄ…tek","Hours":"Godziny","Map":"Mapa","Monday":"PoniedziaÅ‚ek","Open now":"Otwarte teraz","Open today from %s to %s":"Otwarte dzisiaj od %s do %s","Opens":"Otwiera","Phone":"Nr telefonu","Saturday":"Sobota","Sunday":"Niedziela","This Week":"W tym tygodniu","Thursday":"Czwartek","Today":"Dzisiaj","Today's Hours":"Dzisiejsze godziny","Tuesday":"Wtorek","Wednesday":"Åšroda"},"pt_BR":{"Address":"Endereço","Call":"Ligar","Closed":"Fechado","Closed all day":"Fechado durante todo o dia","Closes":"Fecha","Current Location":"Localização Atual","Currently closed":"Atualmente fechado","Day":"Dia","Friday":"Sexta-feira","Hours":"Horas","Map":"Mapa","Monday":"Segunda-feira","Open now":"Aberto agora","Open today from %s to %s":"Aberto hoje das %s as %s","Opens":"Abre","Phone":"Telefone","Saturday":"Sábado","Sunday":"Domingo","This Week":"Esta Semana","Thursday":"Quinta-feira","Today":"Hoje","Today's Hours":"Horário de Hoje","Tuesday":"Terça-feira","Wednesday":"Quarta-feira"},"ru":{"Address":"ÐдреÑ","Call":"Звонок","Closed":"Закрыто","Closed all day":"Закрыто веÑÑŒ день","Closes":"ЗакрываетÑÑ","Current Location":"Ðынешнее МеÑтонахождение","Currently closed":"Ð’ данный момент закрыт","Day":"День","Friday":"ПÑтница","Hours":"ЧаÑÑ‹","Map":"Карта","Monday":"Понедельник","Open now":"Открыть ÑейчаÑ","Open today from %s to %s":"Открыто ÑÐµÐ³Ð¾Ð´Ð½Ñ Ñ %s до %s","Opens":"ОткрываетÑÑ","Phone":"Телефон","Saturday":"Суббота","Sunday":"ВоÑкреÑенье","This Week":"Ðа Ñтой неделе","Thursday":"Четверг","Today":"СегоднÑ","Today's Hours":"Рабочие чаÑÑ‹ ÑегоднÑ","Tuesday":"Вторник","Wednesday":"Среда"},"sk":{"Address":"Adresa","Call":"ZavolaÅ¥","Closed":"Zavreté","Closed all day":"Zavreté celý deň","Closes":"Zaviera sa","Current Location":"Aktuálna poloha","Currently closed":"Momentálne uzavreté","Day":"Deň","Friday":"Piatok","Hours":"HodÃn","Map":"Mapa","Monday":"Pondelok","Open now":"Teraz otvorené","Open today from %s to %s":"Dnes otvorené od %s do %s","Opens":"Otvára sa","Phone":"Telefón","Saturday":"Sobota","Sunday":"Nedeľa","This Week":"Tento týždeň","Thursday":"Å tvrtok","Today":"Dnes","Today's Hours":"DneÅ¡ný hodiny","Tuesday":"Utorok","Wednesday":"Streda"},"sv":{"Address":"Adress","Call":"Ring","Closed":"Stängd","Closed all day":"Stängt hela dagen","Closes":"Stänger","Current Location":"Nuvarande plats","Currently closed":"Stängt för närvarande","Day":"Dag","Friday":"Fredag","Hours":"Timmar","Map":"Karta","Monday":"MÃ¥ndag","Open now":"Öppna nu","Open today from %s to %s":"Öppet idag frÃ¥n %s till %s","Opens":"Öppnar","Phone":"Telefon","Saturday":"Lördag","Sunday":"Söndag","This Week":"Den här veckan","Thursday":"Torsdag","Today":"Idag","Today's Hours":"Dagens timmar","Tuesday":"Tisdag","Wednesday":"Onsdag"},"zh_CN":{"Address":"地å€","Call":"拨打","Closed":"已关é—","Closed all day":"全天关é—","Closes":"å…³é—","Current Location":"当å‰ä½ç½®","Currently closed":"当å‰å·²å…³é—","Day":"天","Friday":"星期五","Hours":"è¥ä¸šæ—¶é—´","Map":"地图","Monday":"星期一","Open now":"现在打开","Open today from %s to %s":"今天从 %s 到 %s打开","Opens":"打开","Phone":"电è¯","Saturday":"星期å…","Sunday":"星期日","This Week":"本周","Thursday":"星期四","Today":"今天","Today's Hours":"今天的å°æ—¶æ•°","Tuesday":"星期二","Wednesday":"星期三"}} },{}],4:[function(require,module,exports){ 'use strict'; var canonicalize = function(phoneNumber) { if(! phoneNumber) { return null; } var canonicalPhone; var phoneString = '' + phoneNumber; var match = /^\+?[0-9()\-\s.]+$/.exec(phoneString); if(match === null) { console.error('Found invalid characters in phone number: ' + phoneString); return null; } canonicalPhone = phoneString.replace(/[()\-\s.]+/g, ''); if(canonicalPhone[0] === '+') { return canonicalPhone; } if(canonicalPhone.length === 10) { return '+1' + canonicalPhone; } if(canonicalPhone.length === 11 && canonicalPhone[0] === '1') { return '+' + canonicalPhone; } return canonicalPhone; }; module.exports = canonicalize; },{}],5:[function(require,module,exports){ 'use strict'; var cards = []; var counter = { getCards: function() { return cards; }, register: function(card) { cards.push(card); this.positionCards(); }, unregister: function(card) { var cardIndex = cards.indexOf(card); cards.splice(cardIndex, 1); this.positionCards(); }, /* This function is responsible for vertically positioning * stacked cards. The first card in the cards array will * be positioned at the top, and the second below it and * so on. */ positionCards: function() { var cardEl; var cardHeight; var spacing = 15; var verticalSpacing = 0; for(var i = 0; i < cards.length; i++) { cardEl = cards[i].getCardEl(); cardHeight = cards[i].getCardHeight(); cardHeight += spacing; cardEl.style.top = (verticalSpacing + spacing) + 'px'; verticalSpacing += cardHeight; } } }; module.exports = counter; },{}],6:[function(require,module,exports){ 'use strict'; var siteData = require('./site-data'); var transCatalog = require('../i18n-catalog.json'); var Handlebars = require('hbsfy/runtime'); var trans = function(text) { var locale = siteData.getLocale() || ''; if (! locale) { return text; } if (! transCatalog[locale]) { setTimeout(function() { throw new Error('Locale does not exist: ' + locale); }); return text; } if(! transCatalog[locale][text]) { return text; } return transCatalog[locale][text]; }; Handlebars.registerHelper('trans', trans); module.exports = trans; },{"../i18n-catalog.json":3,"./site-data":13,"hbsfy/runtime":42}],7:[function(require,module,exports){ 'use strict'; var gettext = require('./gettext'); var sprintf = require('sprintf-js').sprintf; var todaysHoursHTML = require('./templates/today-hours.hbs'); var weekHTML = require('./templates/hours-table.hbs'); require('date-utils'); var hoursRenderer = { days: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], formatTime: function(time) { var formattedTime = ''; var timeSplat = time.split(':'); var hourDigit = Number(timeSplat[0]); var isPm = hourDigit >= 12; if(hourDigit > 12) { hourDigit -= 12; } else if (hourDigit === 0) { hourDigit = 12; } formattedTime = hourDigit + ':' + timeSplat[1]; formattedTime += isPm ? ' pm' : ' am'; return formattedTime; }, today: function(hours) { var date = new Date(); var day = date.toFormat('DDD').substring(0,2); var todaysHours = hours[day]; if(! todaysHours) { return; } var openTime = this.formatTime(todaysHours.open); var closeTime = this.formatTime(todaysHours.close); return { open: openTime, close: closeTime }; }, openToday: function(hours) { var openStatus; var todaysHours = this.today(hours); if(! todaysHours) { return sprintf(gettext('Closed all day')); } openStatus = gettext('Open today from %s to %s'); return sprintf(openStatus, todaysHours.open, todaysHours.close); }, isOpenNow: function(now, hours) { var today = this.days[now.getDay()]; var todaysHours = hours[today]; if (! todaysHours) { return false; } var openSplat = todaysHours.open.split(':'); var closeSplat = todaysHours.close.split(':'); var openDate = new Date( now.getFullYear(), now.getMonth(), now.getDate(), Number(openSplat[0]), Number(openSplat[1]) ); var closeDate = new Date( now.getFullYear(), now.getMonth(), now.getDate(), Number(closeSplat[0]), Number(closeSplat[1]) ); return now > openDate && now < closeDate; }, week: function(hours) { var now = new Date(); var wrapper = document.createElement('div'); var todaysHours = this.today(hours); var isOpenNow = this.isOpenNow(now, hours); var dayRow, openEl, closeEl, openNowEl, openNowMsg, openCloseClass, todayEl; var todayElContext; var injectDay = function(day) { dayRow = wrapper.querySelector('.' + day); openEl = dayRow.querySelector('td:nth-child(2)'); closeEl = dayRow.querySelector('td:nth-child(3)'); if(! hours[day]) { openEl.innerHTML = gettext('Closed'); return; } openEl.innerHTML = this.formatTime(hours[day].open); closeEl.innerHTML = this.formatTime(hours[day].close); }; wrapper.innerHTML = weekHTML(); this.days.forEach(injectDay.bind(this)); todayEl = wrapper.querySelector('.today'); todayElContext = { hasHours: todaysHours, opens: todaysHours && todaysHours.open, closes: todaysHours && todaysHours.close }; todayEl.innerHTML = todaysHoursHTML(todayElContext); openNowEl = wrapper.querySelector('.now'); openCloseClass = isOpenNow ? 'open' : 'closed'; openNowMsg = isOpenNow ? gettext('Open now') : gettext('Currently closed'); openNowEl.innerHTML = openNowMsg; openNowEl.classList.add(openCloseClass); return wrapper; } }; module.exports = hoursRenderer; },{"./gettext":6,"./templates/hours-table.hbs":16,"./templates/today-hours.hbs":22,"date-utils":39,"sprintf-js":72}],8:[function(require,module,exports){ 'use strict'; require('./gettext'); var Router = require('./router'); var setupMessaging = require('./messaging'); require('date-utils'); require('classlist-polyfill'); setupMessaging(Router); module.exports = { initialize: Router.initInstance }; },{"./gettext":6,"./messaging":9,"./router":12,"classlist-polyfill":38,"date-utils":39}],9:[function(require,module,exports){ 'use strict'; var windowManager = require('./window-manager'); var initializeMessageListening = function(router) { var topWindow = windowManager.get('top'); var receiveMessage = function(event) { var parentOrigin = topWindow.location.origin; if (event.origin !== parentOrigin) { console.log('Message from an unknown source: ', event.origin); return; } if (typeof event.data !== 'object') { console.log('Message has no event.data property'); return; } router.forceInit(event.data); }; windowManager.get().addEventListener('message', receiveMessage); }; module.exports = initializeMessageListening; },{"./window-manager":32}],10:[function(require,module,exports){ 'use strict'; /* Hideable is a mixin for objects that can be shown and hidden * from view. */ var hideable = { hide: function(cb, timeout) { var displayNone = function() { this[this.contentName].classList.add('hide'); this[this.contentName].classList.remove('open'); if(typeof cb === 'function') { cb(); } }; if(timeout === undefined) { timeout = 400; } if(this.noscroll) { this.removeNoScroll(); } this[this.contentName].classList.remove(this.transIn || ''); this[this.contentName].classList.add(this.transOut || ''); setTimeout(displayNone.bind(this), timeout); }, show: function() { if(this.noscroll) { this.addNoScroll(); } this[this.contentName].classList.add('open'); this[this.contentName].classList.remove('hide'); this[this.contentName].classList.add(this.transIn || ''); this[this.contentName].classList.remove(this.transOut || ''); }, addNoScroll: function() { document.body.classList.add('noscroll'); }, removeNoScroll: function() { document.body.classList.remove('noscroll'); } }; module.exports = hideable; },{}],11:[function(require,module,exports){ 'use strict'; var renderable = { render: function(cb) { if(! this.isRendered) { this[this.wrapperName].appendChild(this[this.contentName]); } if(typeof this.onRender === 'function') { this.onRender(cb); } this.isRendered = true; }, remove: function() { if(this.isRendered) { this[this.wrapperName].removeChild(this[this.contentName]); } if(typeof this.onRemove === 'function') { this.onRemove(); } this.isRendered = false; } }; module.exports = renderable; },{}],12:[function(require,module,exports){ 'use strict'; var AmpersandRouter = require('ampersand-router'); var PageView = require('./views/page'); var siteData = require('./site-data'); var SiteLocationRouter = AmpersandRouter.extend({ routes: { 'toolbar': 'toolbar', 'exit': 'exit', 'toolbar/map': 'map', 'toolbar/hours': 'hours' }, initialize: function() { this.pageView = new PageView(); }, toolbar: function() { this.pageView.renderToolbar(); }, exit: function() { this.pageView.removeAll(); this.navigate('', {replace: true}); }, map: function() { this.pageView.renderMap(); }, hours: function() { this.pageView.renderHours(); }, tearDown: function() { var navOpts = { trigger: true, replace: true }; this.navigate('exit', navOpts); this.pageView.removeAll(); this.pageView.removeActionButton(); } }); SiteLocationRouter.initInstance = function(data) { if(SiteLocationRouter.instance) { console.info('Sitelocation already instantiated.'); return; } siteData.set(data); if(! PageView.shouldRender()) { console.info('No data for sitelocation to render.'); return; } var router = new SiteLocationRouter(); if(! router.history.started()) { router.history.start({ pushState: false }); } SiteLocationRouter.instance = router; return router; }; SiteLocationRouter.forceInit = function(data) { var route = data.route || 'exit'; var navOpts = { trigger: true, replace: true }; delete data.route; if(this.instance) { this.instance.tearDown(); delete this.instance; } this.initInstance(data); if(this.instance) { this.instance.navigate(route, navOpts); } }; module.exports = SiteLocationRouter; },{"./site-data":13,"./views/page":30,"ampersand-router":36}],13:[function(require,module,exports){ 'use strict'; var siteData = { data: {}, set: function(key, value) { if(typeof key === 'object') { this.data = key; } this.data[key] = value; }, get: function(key) { if (key === 'locale') { return this.getLocale(); } return this.data[key]; }, getLocale: function() { var langSplat; var lang = this.get('lang') || ''; if(lang === 'en') { return ''; } if (lang.length !== 5) { return lang; } langSplat = lang.split('-'); return langSplat[0].toLowerCase() + '_' + langSplat[1].toUpperCase(); } }; module.exports = siteData; },{}],14:[function(require,module,exports){ // hbsfy compiled Handlebars template var HandlebarsCompiler = require('hbsfy/runtime'); module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { return "<div class=\"title\">" + container.escapeExpression((helpers.trans || (depth0 && depth0.trans) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Address",{"name":"trans","hash":{},"data":data})) + ":</div>\n<address>\n <div class=\"line-one\"></div>\n <div class=\"line-two\"></div>\n</address>\n"; },"useData":true}); },{"hbsfy/runtime":42}],15:[function(require,module,exports){ // hbsfy compiled Handlebars template var HandlebarsCompiler = require('hbsfy/runtime'); module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { return "<div class=\"title\">" + container.escapeExpression((helpers.trans || (depth0 && depth0.trans) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Today's Hours",{"name":"trans","hash":{},"data":data})) + ":</div>\n<div class=\"hours\"></div>\n"; },"useData":true}); },{"hbsfy/runtime":42}],16:[function(require,module,exports){ // hbsfy compiled Handlebars template var HandlebarsCompiler = require('hbsfy/runtime'); module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=container.escapeExpression; return "<h2>" + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Hours",{"name":"trans","hash":{},"data":data})) + "</h2>\n\n<h3>" + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Today",{"name":"trans","hash":{},"data":data})) + "</h3>\n\n<div class=\"today\"></div>\n\n<h3>" + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"This Week",{"name":"trans","hash":{},"data":data})) + "</h3>\n\n<table>\n <thead>\n <tr>\n <th>" + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Day",{"name":"trans","hash":{},"data":data})) + "</th>\n <th>" + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Opens",{"name":"trans","hash":{},"data":data})) + "</th>\n <th>" + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Closes",{"name":"trans","hash":{},"data":data})) + "</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"Su\">\n <td>" + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Sunday",{"name":"trans","hash":{},"data":data})) + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"Mo\">\n <td>" + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Monday",{"name":"trans","hash":{},"data":data})) + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"Tu\">\n <td>" + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Tuesday",{"name":"trans","hash":{},"data":data})) + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"We\">\n <td>" + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Wednesday",{"name":"trans","hash":{},"data":data})) + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"Th\">\n <td>" + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Thursday",{"name":"trans","hash":{},"data":data})) + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"Fr\">\n <td>" + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Friday",{"name":"trans","hash":{},"data":data})) + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"Sa\">\n <td>" + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Saturday",{"name":"trans","hash":{},"data":data})) + "</td>\n <td></td>\n <td></td>\n </tr>\n </tbody>\n</table>\n"; },"useData":true}); },{"hbsfy/runtime":42}],17:[function(require,module,exports){ // hbsfy compiled Handlebars template var HandlebarsCompiler = require('hbsfy/runtime'); module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { return "<input class=\"animated\" placeholder=\"" + container.escapeExpression((helpers.trans || (depth0 && depth0.trans) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Current Location",{"name":"trans","hash":{},"data":data})) + "\">\n<div class=\"transport-toggle\">\n <button class=\"walk-icon\" data-mode=\"walking\">\n <svg id=\"walk-icon\" x=\"0px\" y=\"0px\" width=\"25px\" height=\"25px\" viewBox=\"0 0 100 100\" enable-background=\"new 0 0 100 100\" xml:space=\"preserve\">\n <path d=\"M48.947,11.08c0-3.972-3.111-7.08-7.081-7.08c-3.974,0-7.082,3.108-7.082,7.08 c0,3.971,3.108,7.082,7.082,7.082C45.835,18.162,48.947,15.051,48.947,11.08z\"/>\n <path d=\"M71.465,30.522c0,0-8.447-4.743-12.188-6.708c-3.744-1.97-11.175-7.06-17.801-1.17 C38.467,25.319,35,39,35,39l-14,8.634l2.299,3.204l15.251-5.544l4.262-5.516l4.513,9.945l-9.109,15.962l-7.188,26.828l7.438,2.508 l8.357-25.072l6.185-6.102l13.539,32.01l6.52-3.01L62.119,53.902c0,0,1.365-2.799,1.365-7.254c0-5.11-4.039-13.473-4.039-13.473 l6.611,1.518l1.48,16.639l4.162,0.391L71.465,30.522z\"/>\n </svg>\n </button>\n <button class=\"drive-icon selected\" data-mode=\"driving\">\n <svg id=\"drive-icon\" x=\"0px\" y=\"0px\" width=\"25px\" height=\"20px\" viewBox=\"0 0 100 83.648\" enable-background=\"new 0 0 100 83.648\" xml:space=\"preserve\">\n <path d=\"M15.727,43.753\"/>\n <path d=\"M90.925,28.696L82.728,7.529C81.195,3.477,77.845,0.029,71.505,0h-11.56H40.188H28.427\n c-6.311,0.029-9.661,3.477-11.222,7.529L9.006,28.696C5.751,29.116-0.01,32.941,0,40.187v26.951h7.999v8.603\n c-0.02,10.606,14.989,10.48,14.985,0v-8.603H50h26.948v8.603c0.033,10.48,15.042,10.606,15.052,0v-8.603h8V40.187\n C99.975,32.941,94.21,29.116,90.925,28.696z M15.727,50.874c-3.834,0.011-6.938-3.187-6.922-7.12\n c-0.016-3.96,3.088-7.161,6.922-7.128c3.822-0.033,6.926,3.168,6.921,7.128C22.653,47.687,19.548,50.884,15.727,50.874z M50,28.497\n h-0.067H17.541l6.182-16.668c0.746-2.366,1.904-4.059,4.639-4.1h21.571H50H71.64c2.693,0.041,3.854,1.733,4.636,4.1l6.183,16.668H50\n z M84.274,50.874c-3.861,0.011-6.967-3.187-6.988-7.12c0.021-3.96,3.127-7.161,6.988-7.128c3.795-0.033,6.898,3.168,6.922,7.128\n C91.172,47.687,88.069,50.884,84.274,50.874z\"/>\n <path d=\"M84.274,43.753\"/>\n </svg>\n </button>\n</div>\n"; },"useData":true}); },{"hbsfy/runtime":42}],18:[function(require,module,exports){ // hbsfy compiled Handlebars template var HandlebarsCompiler = require('hbsfy/runtime'); module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var helper; return "<iframe\n frameborder=\"0\"\n style=\"border:0;width:100%;height:100%;\"\n src=\"" + container.escapeExpression(((helper = (helper = helpers.mapSource || (depth0 != null ? depth0.mapSource : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"mapSource","hash":{},"data":data}) : helper))) + "\"\n allowfullscreen>\n</iframe>\n"; },"useData":true}); },{"hbsfy/runtime":42}],19:[function(require,module,exports){ // hbsfy compiled Handlebars template var HandlebarsCompiler = require('hbsfy/runtime'); module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=container.escapeExpression; return "<div>\n <a id=\"location-tools-phone\" class=\"phone hide\" href=\"\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" id=\"Capa_1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 578.106 578.106\" style=\"enable-background:new 0 0 578.106 578.106;\" xml:space=\"preserve\">\n <g>\n <path d=\"M577.83,456.128c1.225,9.385-1.635,17.545-8.568,24.48l-81.396,80.781 c-3.672,4.08-8.465,7.551-14.381,10.404c-5.916,2.857-11.729,4.693-17.439,5.508c-0.408,0-1.635,0.105-3.676,0.309 c-2.037,0.203-4.689,0.307-7.953,0.307c-7.754,0-20.301-1.326-37.641-3.979s-38.555-9.182-63.645-19.584 c-25.096-10.404-53.553-26.012-85.376-46.818c-31.823-20.805-65.688-49.367-101.592-85.68 c-28.56-28.152-52.224-55.08-70.992-80.783c-18.768-25.705-33.864-49.471-45.288-71.299 c-11.425-21.828-19.993-41.616-25.705-59.364S4.59,177.362,2.55,164.51s-2.856-22.95-2.448-30.294 c0.408-7.344,0.612-11.424,0.612-12.24c0.816-5.712,2.652-11.526,5.508-17.442s6.324-10.71,10.404-14.382L98.022,8.756 c5.712-5.712,12.24-8.568,19.584-8.568c5.304,0,9.996,1.53,14.076,4.59s7.548,6.834,10.404,11.322l65.484,124.236 c3.672,6.528,4.692,13.668,3.06,21.42c-1.632,7.752-5.1,14.28-10.404,19.584l-29.988,29.988c-0.816,0.816-1.53,2.142-2.142,3.978 s-0.918,3.366-0.918,4.59c1.632,8.568,5.304,18.36,11.016,29.376c4.896,9.792,12.444,21.726,22.644,35.802 s24.684,30.293,43.452,48.653c18.36,18.77,34.68,33.354,48.96,43.76c14.277,10.4,26.215,18.053,35.803,22.949 c9.588,4.896,16.932,7.854,22.031,8.871l7.648,1.531c0.816,0,2.145-0.307,3.979-0.918c1.836-0.613,3.162-1.326,3.979-2.143 l34.883-35.496c7.348-6.527,15.912-9.791,25.705-9.791c6.938,0,12.443,1.223,16.523,3.672h0.611l118.115,69.768 C571.098,441.238,576.197,447.968,577.83,456.128z\"/>\n </g>\n </svg>\n\n " + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Call",{"name":"trans","hash":{},"data":data})) + "\n </a>\n <a id=\"location-tools-location\" class=\"map hide\" href=\"#toolbar/map\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" id=\"Capa_1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 51.114 51.114\" style=\"enable-background:new 0 0 51.114 51.114;\" xml:space=\"preserve\">\n <g>\n <path d=\"M41.945,16.388C41.943,7.337,34.609,0,25.56,0C16.507,0,9.169,7.337,9.169,16.388 c0,7.812,12.208,28.683,15.553,34.251c0.176,0.295,0.494,0.475,0.837,0.475c0.343,0,0.662-0.18,0.836-0.474 C29.738,45.072,41.945,24.2,41.945,16.388z M25.559,29.068c-6.991,0-12.683-5.688-12.683-12.681 c0-6.992,5.69-12.681,12.683-12.681s12.679,5.689,12.679,12.681C38.238,23.379,32.551,29.068,25.559,29.068z\"/>\n </g>\n </svg>\n\n " + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Map",{"name":"trans","hash":{},"data":data})) + "\n </a>\n <a id=\"location-tools-hours\" class=\"hours hide\" href=\"#toolbar/hours\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" id=\"Capa_1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 612 612\" style=\"enable-background:new 0 0 612 612;\" xml:space=\"preserve\">\n <g id=\"clock\">\n <path d=\"M306,0C136.992,0,0,136.992,0,306s136.992,306,306,306s306-137.012,306-306S475.008,0,306,0z M306,573.157 C158.451,573.157,38.843,453.55,38.843,306C38.843,158.451,158.451,38.843,306,38.843c147.55,0,267.157,119.608,267.157,267.157 C573.157,453.55,453.55,573.157,306,573.157z M325.125,115.955h-37.657l0.593,209.782l132.077,112.952l23.313-32.876 l-118.326-99.221V115.955z\"/>\n </g>\n </svg>\n\n " + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Hours",{"name":"trans","hash":{},"data":data})) + "\n </a>\n</div>\n"; },"useData":true}); },{"hbsfy/runtime":42}],20:[function(require,module,exports){ // hbsfy compiled Handlebars template var HandlebarsCompiler = require('hbsfy/runtime'); module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { return "<div class=\"title\">" + container.escapeExpression((helpers.trans || (depth0 && depth0.trans) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Phone",{"name":"trans","hash":{},"data":data})) + ":</div>\n<div class=\"phone\"></div>\n"; },"useData":true}); },{"hbsfy/runtime":42}],21:[function(require,module,exports){ // hbsfy compiled Handlebars template var HandlebarsCompiler = require('hbsfy/runtime'); module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { return "<svg width=\"20\" height=\"20\">\n <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"20\" stroke-width=\"2\"></line>\n <line x1=\"0\" y1=\"10\" x2=\"20\" y2=\"10\" stroke-width=\"2\"></line>\n</svg>\n"; },"useData":true}); },{"hbsfy/runtime":42}],22:[function(require,module,exports){ // hbsfy compiled Handlebars template var HandlebarsCompiler = require('hbsfy/runtime'); module.exports = HandlebarsCompiler.template({"1":function(container,depth0,helpers,partials,data) { var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; return " <time class=\"open\">" + alias4(((helper = (helper = helpers.opens || (depth0 != null ? depth0.opens : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"opens","hash":{},"data":data}) : helper))) + "</time> - <time class=\"close\">" + alias4(((helper = (helper = helpers.closes || (depth0 != null ? depth0.closes : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"closes","hash":{},"data":data}) : helper))) + "</time>\n"; },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1; return "<span class=\"now\"></span>\n" + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.hasHours : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); },"useData":true}); },{"hbsfy/runtime":42}],23:[function(require,module,exports){ 'use strict'; var renderable = require('../mixins/renderable'); var windowManager = require('../window-manager'); var actionButtonHTML = require('../templates/plus.hbs'); function ActionButton(options) { this.options = options || {}; this.actionButton = document.createElement('button'); this.actionButton.setAttribute('class', 'action-button'); this.actionButton.innerHTML = actionButtonHTML(); this.wrapperEl = this.options.wrapperEl || document.body; this.wrapperName = 'wrapperEl'; this.contentName = 'actionButton'; this.actionButton.addEventListener('click', this.toggle.bind(this)); } ActionButton.prototype = Object.create(renderable); ActionButton.prototype.toggle = function(event) { var window = windowManager.get(); if(this.actionButton.classList.contains('open')) { window.location.hash = 'exit'; this.close(); } else { window.location.hash = 'toolbar'; this.open(); } }; ActionButton.prototype.open = function(event) { this.actionButton.classList.add('open'); if(typeof this.openCallback === 'function') { this.openCallback(event); } }; ActionButton.prototype.close = function(event) { this.actionButton.classList.remove('open'); if(typeof this.closeCallback === 'function') { this.closeCallback(event); } }; ActionButton.prototype.onOpen = function(func) { this.openCallback = func; }; ActionButton.prototype.onClose = function(func) { this.closeCallback = func; }; module.exports = ActionButton; },{"../mixins/renderable":11,"../templates/plus.hbs":21,"../window-manager":32}],24:[function(require,module,exports){ 'use strict'; var hideable = require('../mixins/hideable'); var renderable = require('../mixins/renderable'); var extend = require('extend'); function Backdrop(options) { this.options = options || {}; this.backdropEl = document.createElement('div'); this.backdropEl.setAttribute('class', 'backdrop animated hide'); this.transIn = 'fadein'; this.transOut = 'fadeout'; this.contentName = 'backdropEl'; this.wrapperName = 'wrapper'; this.wrapper = this.options.wrapperEl || document.body; } extend(Backdrop.prototype, hideable, renderable); Backdrop.prototype.onClick = function(route) { return this.backdropEl.addEventListener('click', function() { window.location.hash = route; }); }; module.exports = Backdrop; },{"../mixins/hideable":10,"../mixins/renderable":11,"extend":41}],25:[function(require,module,exports){ 'use strict'; var siteData = require('../site-data'); var canonicalizePhone = require('../canonicalize-phone'); var Card = require('./card'); var hoursRenderer = require('../hours-renderer'); var addressHTML = require('../templates/address.hbs'); var hoursHTML = require('../templates/hours-card.hbs'); var phoneHTML = require('../templates/phone-card.hbs'); function CardListing(options) { var location = siteData.get('location'); var hoursData = siteData.get('hours'); var addrSecondLine; var phoneNumber = siteData.get('phone'); this.cards = []; this.options = options || {}; if(location) { addrSecondLine = location.city + ' ' + location.state + ', '; addrSecondLine += location.zipcode; this.addressCard = new Card({ html: addressHTML(), zLayer: 120 }); this.addressCard.inject('.line-one', location.address); this.addressCard.inject('.line-two', addrSecondLine); this.cards.push(this.addressCard); } if(hoursData) { this.hoursCard = new Card({ html: hoursHTML(), zLayer: 120 }); this.hoursCard.inject('.hours', hoursRenderer.openToday(hoursData)); this.cards.push(this.hoursCard); } if(canonicalizePhone(phoneNumber) !== null) { this.phoneCard = new Card({ html: phoneHTML(), zLayer: 120 }); this.phoneCard.inject('.phone', phoneNumber); this.cards.push(this.phoneCard); } } CardListing.prototype.renderCards = function() { for(var i = 0; i < this.cards.length; i++) { this.cards[i].render(); this.cards[i].show(); } }; CardListing.prototype.removeCards = function() { for(var i = 0; i < this.cards.length; i++) { this.cards[i].hideAndRemove(); } }; module.exports = CardListing; },{"../canonicalize-phone":4,"../hours-renderer":7,"../site-data":13,"../templates/address.hbs":14,"../templates/hours-card.hbs":15,"../templates/phone-card.hbs":20,"./card":26}],26:[function(require,module,exports){ 'use strict'; var cardCounter = require('../card-counter'); var renderable = require('../mixins/renderable'); var hideable = require('../mixins/hideable'); var extend = require('extend'); function Card(options) { this.options = options || {}; this.html = options.html; this.contentName = 'cardEl'; this.cardEl = document.createElement('div'); this.cardEl.classList.add('info-card'); this.cardEl.classList.add('animated'); this.cardEl.classList.add('zoomIn'); this.cardEl.innerHTML = options.html; this.cardEl.style['z-index'] = options.zLayer || 0; this.closeEl = document.createElement('button'); this.closeEl.classList.add('close'); this.closeEl.classList.add('fa'); this.closeEl.classList.add('fa-times'); this.closeEl.addEventListener('click', this.hideAndRemove.bind(this)); this.cardEl.appendChild(this.closeEl); this.wrapperName = 'wrapper'; this.wrapper = this.options.wrapperEl || document.body; this.transIn = 'zoomIn'; this.transOut = 'zoomOut'; } extend(Card.prototype, hideable, renderable); Card.prototype.hideAndRemove = function() { this.hide(this.remove.bind(this)); }; Card.prototype.inject = function(selector, content) { this.cardEl.querySelector(selector).innerHTML = content; }; Card.prototype.getCardEl = function() { return this.cardEl; }; Card.prototype.getCardHeight = function() { var cardHeight = this.cardEl.offsetHeight; cardHeight += parseInt(this.cardEl.style['margin-top']) || 0; cardHeight += parseInt(this.cardEl.style['margin-bottom']) || 0; return cardHeight; }; Card.prototype.onRender = function() { cardCounter.register(this); }; Card.prototype.onRemove = function() { cardCounter.unregister(this); }; module.exports = Card; },{"../card-counter":5,"../mixins/hideable":10,"../mixins/renderable":11,"extend":41}],27:[function(require,module,exports){ 'use strict'; var hoursRenderer = require('../hours-renderer'); var hideable = require('../mixins/hideable'); var renderable = require('../mixins/renderable'); var extend = require('extend'); function HoursView(options) { this.options = options || {}; this.hours = options.hours; this.hoursEl = hoursRenderer.week(this.hours); this.contentEl = document.createElement('div'); this.contentEl.classList.add('hours-view'); this.contentEl.classList.add('animated'); this.contentEl.classList.add('hide'); this.contentEl.appendChild(this.hoursEl); this.contentName = 'contentEl'; this.wrapper = this.options.wrapperEl || document.body; /* Properties to be consumed by hideable mixin */ this.transIn = 'fadein'; this.transOut = 'fadeout'; this.contentName = 'contentEl'; this.wrapperName = 'wrapper'; this.setHeight(options.height || 500); } extend(HoursView.prototype, hideable, renderable); HoursView.prototype.setHeight = function(newHeight) { this.contentEl.style.height = newHeight + 'px'; }; module.exports = HoursView; },{"../hours-renderer":7,"../mixins/hideable":10,"../mixins/renderable":11,"extend":41}],28:[function(require,module,exports){ 'use strict'; var toolbarTemplate = require('../templates/map-toolbar.hbs'); var renderable = require('../mixins/renderable'); var hideable = require('../mixins/hideable'); var extend = require('extend'); function MapToolbarView(options) { options = options || {}; this.options = options; this.wrapperName = options.wrapperName; this.wrapper = options.wrapper; this.contentName = 'contentEl'; this.contentEl = document.createElement('section'); this.contentEl.innerHTML = toolbarTemplate(); this.contentEl.classList.add('animated'); this.contentEl.classList.add('map-toolbar'); this.searchInput = this.contentEl.querySelector('input'); this.toggleDrive = this.contentEl.querySelector('.drive-icon'); this.toggleWalk = this.contentEl.querySelector('.walk-icon'); this.transIn = 'fadein'; this.transOut = 'fadeout'; this.selectedMode = 'driving'; } extend(MapToolbarView.prototype, renderable, hideable); /* This function handles the UI of the walk/drive selection. * It removes the style from the currently selected button and * adds it to the button passed in from the event handler. */ MapToolbarView.prototype.select = function(button) { var selectedEl = this.contentEl.querySelector('.selected'); selectedEl.classList.remove('selected'); button.classList.add('selected'); this.selectedMode = button.getAttribute('data-mode'); }; module.exports = MapToolbarView; },{"../mixins/hideable":10,"../mixins/renderable":11,"../templates/map-toolbar.hbs":17,"extend":41}],29:[function(require,module,exports){ /* global google, navigator */ 'use strict'; var debounce = require('debounce'); var extend = require('extend'); var url = require('url'); var googleMapsTemplate = require('../templates/map.hbs'); var MapToolbarView = require('./map-toolbar'); var renderable = require('../mixins/renderable'); var BASEURL = 'https://www.google.com/maps/embed/v1/'; /* This function is the Map constructor. * Options include: * * - height: the height of the map view * - google embed API key * - address, city, state, zipcode */ function MapView(options) { options = options || {}; this.options = options; this.height = options.height || '100%'; this.address = options.address + ' ' + options.city + ', ' + options.state; this.address += ' ' + options.zipcode; this.mapOptions = { embedAPIKey: options.embedAPIKey, businessLocation: this.address }; this.mapContext = {}; this.setupMarkup(); this.getOriginLocation(); this.attachListeners(); } extend(MapView.prototype, renderable); MapView.prototype.setupMarkup = function() { var searchHeightOffset; this.contentName = 'contentEl'; this.contentEl = document.createElement('div'); this.wrapperName = 'wrapper'; this.wrapper = this.options.wrapperEl || document.body; this.mapToolbar = new MapToolbarView({ wrapper: this.contentEl, wrapperName: this.wrapperName }); this.mapToolbar.render(); searchHeightOffset = this.mapToolbar.offsetHeight || 50; this.mapWrapper = document.createElement('div'); this.mapWrapper.classList.add('google-map'); this.mapWrapper.classList.add('animated'); this.mapWrapper.style.height = this.height - searchHeightOffset + 'px'; this.contentEl.appendChild(this.mapWrapper); }; MapView.prototype.attachListeners = function() { var debounceCurrentLocation = debounce( this.getOriginLocation.bind(this), 1000); this.mapToolbar.searchInput.addEventListener( 'input', debounceCurrentLocation); this.mapToolbar.toggleDrive.addEventListener( 'click', this.setTransportMode.bind(this), false); this.mapToolbar.toggleWalk.addEventListener( 'click', this.setTransportMode.bind(this), false); }; MapView.prototype.setTransportMode = function(event) { var button = event.currentTarget; if (!button.classList.contains('selected')) { var mode = button.getAttribute('data-mode'); this.mapToolbar.select(button); this.mapOptions.directionsMode = mode; this.renderDirectionsMode(); } }; /* This function sets the origin location using * one of two methods: * * 1. It will use user provided address if the user * has entered a value via the seach box at the * top of the view. * * 2. If the user has not entered a value in the * search box and the user has a geolocation * enabled device and the site has SSL enabled, * then the function will use navigator to get * the current location. * * If 1 and 2 are not available, the map will * simply display a marker where the given business * address is located. */ MapView.prototype.getOriginLocation = function() { var setCurrentLocation = function(position) { var latStr = String(position.coords.latitude); var lngStr = String(position.coords.longitude); this.mapOptions.originLocation = latStr + ',' + lngStr; this.render(); }.bind(this); if(this.mapToolbar.searchInput.value) { this.mapOptions.originLocation = this.mapToolbar.searchInput.value; this.renderDirectionsMode(); return; } if(navigator.geolocation) { // HTML5 Geolocation API // renders business location if current position cannot be retrieved navigator.geolocation.getCurrentPosition( setCurrentLocation, this.renderPlaceMode.bind(this), {timeout: 3500} ); return; } this.renderPlaceMode(); }; MapView.prototype.renderPlaceMode = function() { var placeModeUrl = BASEURL + 'place'; var urlObj = url.parse(placeModeUrl); urlObj.query ={ key: this.mapOptions.embedAPIKey, q: this.mapOptions.businessLocation }; this.mapContext.mapSource = urlObj.format(); this.render(); }; MapView.prototype.renderDirectionsMode = function() { var directionsModeUrl = BASEURL + 'directions'; var urlObj = url.parse(directionsModeUrl); urlObj.query = { key: this.mapOptions.embedAPIKey, origin: this.mapOptions.originLocation, destination: this.mapOptions.businessLocation } if(this.mapOptions.directionsMode) { urlObj.query.mode = this.mapOptions.directionsMode; } this.mapContext.mapSource = urlObj.format(); this.render(); }; MapView.prototype.getWrapper = function() { return this.mapWrapper; }; /* Show the Map */ MapView.prototype.show = function() { this.mapWrapper.classList.add('open'); this.mapWrapper.classList.add('fadein'); this.mapWrapper.classList.remove('fadeout'); this.mapToolbar.show(); }; /* Hide the Map */ MapView.prototype.hide = function(cb, timeout) { if(timeout === undefined) { timeout = 400; } this.mapWrapper.classList.add('fadeout'); this.mapWrapper.classList.remove('fadein'); this.mapToolbar.hide(); var removeOpenClass = function() { this.mapWrapper.classList.remove('open'); this.mapToolbar.contentEl.classList.remove('open'); if(typeof cb === 'function') { cb(); } }; setTimeout(removeOpenClass.bind(this), timeout); }; MapView.prototype.onRender = function() { this.mapWrapper.innerHTML = googleMapsTemplate(this.mapContext); }; module.exports = MapView; },{"../mixins/renderable":11,"../templates/map.hbs":18,"./map-toolbar":28,"debounce":40,"extend":41,"url":98}],30:[function(require,module,exports){ 'use strict'; var MapView = require('./map'); var Backdrop = require('./backdrop'); var Toolbar = require('./toolbar'); var ActionButton = require('./action-button'); var HoursView = require('./hours'); var animatedScrollTo = require('animated-scrollto'); var siteData = require('../site-data'); var CardListing = require('./card-listing'); var canonicalizePhone = require('../canonicalize-phone'); var getViewportHeight = function() { return Math.max( document.documentElement.clientHeight, window.innerHeight || 0); }; function PageView(options) { this.options = options || {}; this.actionButton = new ActionButton(); this.toolbar = new Toolbar(); this.backdrop = new Backdrop(); this.mapHoursHeight = getViewportHeight() - this.toolbar.getHeight(); this.cardListing = new CardListing(); this.initializePhone(); var hasLoc = siteData.get('location'); var hasPhone = siteData.get('phone'); var hasHours = siteData.get('hours'); if(hasHours) { this.initializeHours(); } if(hasLoc) { this.initializeMap(); } if(hasLoc || hasHours || hasPhone) { this.actionButton.render(); } this.backdrop.onClick('exit'); var resize = function(event) { var mapHoursHeight = getViewportHeight() - this.toolbar.getHeight(); if(this.mapView && this.mapView.google) { this.mapView.setHeight(mapHoursHeight); } if(this.hoursView) { this.hoursView.setHeight(mapHoursHeight); } }; window.addEventListener('resize', resize.bind(this)); } PageView.prototype.initializeMap = function() { var location = siteData.get('location'); var embedAPIKey = siteData.get('embedAPIKey'); this.mapView = new MapView({ address: location.address, city: location.city, state: location.state, zipcode: location.zipcode, height: this.mapHoursHeight, embedAPIKey: embedAPIKey }); this.toolbar.showButton('map'); }; PageView.prototype.initializeHours = function() { this.hoursView = new HoursView({ hours: siteData.get('hours'), height: this.mapHoursHeight }); this.toolbar.showButton('hours'); }; PageView.prototype.initializePhone = function() { var phoneNumber = siteData.get('phone'); var canonicalPhone = canonicalizePhone(phoneNumber); if(canonicalPhone !== null) { this.toolbar.phoneNumber(canonicalPhone); this.toolbar.showButton('phone'); } }; PageView.prototype.open = function() { animatedScrollTo(document.body, 0, 400); this.backdrop.render(); this.backdrop.show(); this.actionButton.open(); this.toolbar.render(); this.toolbar.show(); this.actionButton.open(); }; PageView.prototype.renderToolbar = function() { this.open(); this.cardListing.renderCards(); }; PageView.prototype.renderHours = function() { if(this.hoursView) { this.hoursView.render(); this.hoursView.show(); } this.removeMap(); this.open(); this.cardListing.removeCards(); }; PageView.prototype.renderMap = function() { if(this.mapView) { this.mapView.render(); this.mapView.show(); } this.removeHours(); this.open(); this.cardListing.removeCards(); }; PageView.prototype.removeActionButton = function() { if(this.actionButton.isRendered) { this.actionButton.remove(); } }; PageView.prototype.removeMap = function() { if(this.mapView) { this.mapView.hide(this.mapView.remove.bind(this.mapView)); } }; PageView.prototype.removeHours = function() { if(this.hoursView) { this.hoursView.hide(this.hoursView.remove.bind(this.hoursView)); } }; PageView.prototype.removeToolbar = function() { this.toolbar.hide(this.toolbar.remove.bind(this.toolbar)); }; PageView.prototype.removeBackdrop = function() { this.backdrop.hide(this.backdrop.remove.bind(this.backdrop)); }; PageView.prototype.removeAll = function() { this.removeHours(); this.removeMap(); this.removeBackdrop(); this.removeToolbar(); this.actionButton.close(); this.cardListing.removeCards(); }; PageView.shouldRender = function() { var phone = siteData.get('phone'); var hours = siteData.get('hours'); var location = siteData.get('location'); return phone || hours || location; }; module.exports = PageView; },{"../canonicalize-phone":4,"../site-data":13,"./action-button":23,"./backdrop":24,"./card-listing":25,"./hours":27,"./map":29,"./toolbar":31,"animated-scrollto":37}],31:[function(require,module,exports){ 'use strict'; var hideable = require('../mixins/hideable'); var renderable = require('../mixins/renderable'); var extend = require('extend'); var toolbarHTML = require('../templates/mobile-features.hbs'); function Toolbar(options) { this.options = options || {}; this.contentEl = document.createElement('section'); this.contentName = 'contentEl'; this.wrapperEl = this.options.wrapperEl || document.body; this.wrapperName = 'wrapperEl'; this.transIn = 'fadeinup'; this.transOut = 'fadeoutdown'; this.contentEl.innerHTML = toolbarHTML(); this.contentEl.classList.add('mobile-features'); this.contentEl.classList.add('animated'); this.contentEl.classList.add('hide'); this.noscroll = true; } extend(Toolbar.prototype, hideable, renderable); Toolbar.prototype.getWrapperEl = function() { return this.contentEl; }; Toolbar.prototype.showButton = function(buttonName) { var buttonEl = this.contentEl.querySelector('.' + buttonName); buttonEl.classList.remove('hide'); }; Toolbar.prototype.phoneNumber = function(phoneNumber) { var callEl = this.contentEl.querySelector('#location-tools-phone'); callEl.href = 'tel:' + phoneNumber; }; Toolbar.prototype.getHeight = function() { return this.contentEl.offsetHeight || 70; }; Toolbar.prototype.onDirectionsClick = function(func) { this.contentEl.querySelector('#location-tools-map') .addEventListener('click', func); }; Toolbar.prototype.onPhoneClick = function(func) { this.contentEl.querySelector('#location-tools-phone') .addEventListener('click', func); }; Toolbar.prototype.onHoursClick = function(func) { this.contentEl.querySelector('#location-tools-hours') .addEventListener('click', func); }; module.exports = Toolbar; },{"../mixins/hideable":10,"../mixins/renderable":11,"../templates/mobile-features.hbs":19,"extend":41}],32:[function(require,module,exports){ 'use strict'; var windowManager = { set: function(_window) { this.window = _window; }, get: function() { return this.window; }, reset: function() { this.window = this.originalWindow; }, init: function(_window) { this.window = _window; this.originalWindow = _window; } }; windowManager.init(window); module.exports = windowManager; },{}],33:[function(require,module,exports){ var assign = require('lodash.assign'); /// Following code is largely pasted from Backbone.js // Helper function to correctly set up the prototype chain, for subclasses. // Similar to `goog.inherits`, but uses a hash of prototype properties and // class properties to be extended. var extend = function(protoProps) { var parent = this; var child; var args = [].slice.call(arguments); // The constructor function for the new subclass is either defined by you // (the "constructor" property in your `extend` definition), or defaulted // by us to simply call the parent's constructor. if (protoProps && protoProps.hasOwnProperty('constructor')) { child = protoProps.constructor; } else { child = function () { return parent.apply(this, arguments); }; } // Add static properties to the constructor function from parent assign(child, parent); // Set the prototype chain to inherit from `parent`, without calling // `parent`'s constructor function. var Surrogate = function(){ this.constructor = child; }; Surrogate.prototype = parent.prototype; child.prototype = new Surrogate(); // Mix in all prototype properties to the subclass if supplied. if (protoProps) { args.unshift(child.prototype); assign.apply(null, args); } // Set a convenience property in case the parent's prototype is needed // later. child.__super__ = parent.prototype; return child; }; // Expose the extend function module.exports = extend; },{"lodash.assign":56}],34:[function(require,module,exports){ ;if (typeof window !== "undefined") { window.ampersand = window.ampersand || {}; window.ampersand["ampersand-events"] = window.ampersand["ampersand-events"] || []; window.ampersand["ampersand-events"].push("1.1.1");} var runOnce = require('lodash.once'); var uniqueId = require('lodash.uniqueid'); var keys = require('lodash.keys'); var isEmpty = require('lodash.isempty'); var each = require('lodash.foreach'); var bind = require('lodash.bind'); var assign = require('lodash.assign'); var slice = Array.prototype.slice; var eventSplitter = /\s+/; var Events = { // Bind an event to a `callback` function. Passing `"all"` will bind // the callback to all events fired. on: function(name, callback, context) { if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this; this._events || (this._events = {}); var events = this._events[name] || (this._events[name] = []); events.push({callback: callback, context: context, ctx: context || this}); return this; }, // Bind an event to only be triggered a single time. After the first time // the callback is invoked, it will be removed. once: function(name, callback, context) { if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this; var self = this; var once = runOnce(function() { self.off(name, once); callback.apply(this, arguments); }); once._callback = callback; return this.on(name, once, context); }, // Remove one or many callbacks. If `context` is null, removes all // callbacks with that function. If `callback` is null, removes all // callbacks for the event. If `name` is null, removes all bound // callbacks for all events. off: function(name, callback, context) { var retain, ev, events, names, i, l, j, k; if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this; if (!name && !callback && !context) { this._events = void 0; return this; } names = name ? [name] : keys(this._events); for (i = 0, l = names.length; i < l; i++) { name = names[i]; if (events = this._events[name]) { this._events[name] = retain = []; if (callback || context) { for (j = 0, k = events.length; j < k; j++) { ev = events[j]; if ((callback && callback !== ev.callback && callback !== ev.callback._callback) || (context && context !== ev.context)) { retain.push(ev); } } } if (!retain.length) delete this._events[name]; } } return this; }, // Trigger one or many events, firing all bound callbacks. Callbacks are // passed the same arguments as `trigger` is, apart from the event name // (unless you're listening on `"all"`, which will cause your callback to // receive the true name of the event as the first argument). trigger: function(name) { if (!this._events) return this; var args = slice.call(arguments, 1); if (!eventsApi(this, 'trigger', name, args)) return this; var events = this._events[name]; var allEvents = this._events.all; if (events) triggerEvents(events, args); if (allEvents) triggerEvents(allEvents, arguments); return this; }, // Tell this object to stop listening to either specific events ... or // to every object it's currently listening to. stopListening: function(obj, name, callback) { var listeningTo = this._listeningTo; if (!listeningTo) return this; var remove = !name && !callback; if (!callback && typeof name === 'object') callback = this; if (obj) (listeningTo = {})[obj._listenId] = obj; for (var id in listeningTo) { obj = listeningTo[id]; obj.off(name, callback, this); if (remove || isEmpty(obj._events)) delete this._listeningTo[id]; } return this; }, // extend an object with event capabilities if passed // or just return a new one. createEmitter: function (obj) { return assign(obj || {}, Events); } }; Events.bind = Events.on; Events.unbind = Events.off; // Implement fancy features of the Events API such as multiple event // names `"change blur"` and jQuery-style event maps `{change: action}` // in terms of the existing API. var eventsApi = function(obj, action, name, rest) { if (!name) return true; // Handle event maps. if (typeof name === 'object') { for (var key in name) { obj[action].apply(obj, [key, name[key]].concat(rest)); } return false; } // Handle space separated event names. if (eventSplitter.test(name)) { var names = name.split(eventSplitter); for (var i = 0, l = names.length; i < l; i++) { obj[action].apply(obj, [names[i]].concat(rest)); } return false; } return true; }; // A difficult-to-believe, but optimized internal dispatch function for // triggering events. Tries to keep the usual cases speedy. var triggerEvents = function(events, args) { var ev; var i = -1; var l = events.length; var a1 = args[0]; var a2 = args[1]; var a3 = args[2]; switch (args.length) { case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return; case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return; case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return; case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return; default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return; } }; var listenMethods = { listenTo: 'on', listenToOnce: 'once' }; // Inversion-of-control versions of `on` and `once`. Tell *this* object to // listen to an event in another object ... keeping track of what it's // listening to. each(listenMethods, function(implementation, method) { Events[method] = function(obj, name, callback, run) { var listeningTo = this._listeningTo || (this._listeningTo = {}); var id = obj._listenId || (obj._listenId = uniqueId('l')); listeningTo[id] = obj; if (!callback && typeof name === 'object') callback = this; obj[implementation](name, callback, this); return this; }; }); Events.listenToAndRun = function (obj, name, callback) { Events.listenTo.apply(this, arguments); if (!callback && typeof name === 'object') callback = this; callback.apply(this); return this; }; module.exports = Events; },{"lodash.assign":56,"lodash.bind":58,"lodash.foreach":59,"lodash.isempty":63,"lodash.keys":67,"lodash.once":68,"lodash.uniqueid":71}],35:[function(require,module,exports){ var Events = require('ampersand-events'); var extend = require('lodash.assign'); var bind = require('lodash.bind'); // Handles cross-browser history management, based on either // [pushState](http://diveintohtml5.info/history.html) and real URLs, or // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange) // and URL fragments. If the browser supports neither. var History = function () { this.handlers = []; this.checkUrl = bind(this.checkUrl, this); // Ensure that `History` can be used outside of the browser. if (typeof window !== 'undefined') { this.location = window.location; this.history = window.history; } }; // Cached regex for stripping a leading hash/slash and trailing space. var routeStripper = /^[#\/]|\s+$/g; // Cached regex for stripping leading and trailing slashes. var rootStripper = /^\/+|\/+$/g; // Cached regex for stripping urls of hash. var pathStripper = /#.*$/; // Has the history handling already been started? History.started = false; // Set up all inheritable **Backbone.History** properties and methods. extend(History.prototype, Events, { // The default interval to poll for hash changes, if necessary, is // twenty times a second. interval: 50, // Are we at the app root? atRoot: function () { var path = this.location.pathname.replace(/[^\/]$/, '$&/'); return path === this.root && !this.location.search; }, // Gets the true hash value. Cannot use location.hash directly due to bug // in Firefox where location.hash will always be decoded. getHash: function (window) { var match = (window || this).location.href.match(/#(.*)$/); return match ? match[1] : ''; }, // Get the pathname and search params, without the root. getPath: function () { var path = decodeURI(this.location.pathname + this.location.search); var root = this.root.slice(0, -1); if (!path.indexOf(root)) path = path.slice(root.length); return path.slice(1); }, // Get the cross-browser normalized URL fragment from the path or hash. getFragment: function (fragment) { if (fragment == null) { if (this._hasPushState || !this._wantsHashChange) { fragment = this.getPath(); } else { fragment = this.getHash(); } } return fragment.replace(routeStripper, ''); }, // Start the hash change handling, returning `true` if the current URL matches // an existing route, and `false` otherwise. start: function (options) { if (History.started) throw new Error("Backbone.history has already been started"); History.started = true; // Figure out the initial configuration. // Is pushState desired ... is it available? this.options = extend({root: '/', pushState: true}, this.options, options); this.root = this.options.root; this._wantsHashChange = this.options.hashChange !== false; this._hasHashChange = 'onhashchange' in window; this._wantsPushState = !!this.options.pushState; this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState); this.fragment = this.getFragment(); // Add a cross-platform `addEventListener` shim for older browsers. var addEventListener = window.addEventListener; // Normalize root to always include a leading and trailing slash. this.root = ('/' + this.root + '/').replace(rootStripper, '/'); // Depending on whether we're using pushState or hashes, and whether // 'onhashchange' is supported, determine how we check the URL state. if (this._hasPushState) { addEventListener('popstate', this.checkUrl, false); } else if (this._wantsHashChange && this._hasHashChange) { addEventListener('hashchange', this.checkUrl, false); } else if (this._wantsHashChange) { this._checkUrlInterval = setInterval(this.checkUrl, this.interval); } // Transition from hashChange to pushState or vice versa if both are // requested. if (this._wantsHashChange && this._wantsPushState) { // If we've started off with a route from a `pushState`-enabled // browser, but we're currently in a browser that doesn't support it... if (!this._hasPushState && !this.atRoot()) { this.location.replace(this.root + '#' + this.getPath()); // Return immediately as browser will do redirect to new url return true; // Or if we've started out with a hash-based route, but we're currently // in a browser where it could be `pushState`-based instead... } else if (this._hasPushState && this.atRoot()) { this.navigate(this.getHash(), {replace: true}); } } if (!this.options.silent) return this.loadUrl(); }, // Returns the value of History.started. Allows an app or units tests to // check whether or not the router has been started with // router.history.started(); otherwise the started flag is inaccessible started: function () { return History.started; }, // Disable Backbone.history, perhaps temporarily. Not useful in a real app, // but possibly useful for unit testing Routers. stop: function () { // Add a cross-platform `removeEventListener` shim for older browsers. var removeEventListener = window.removeEventListener; // Remove window listeners. if (this._hasPushState) { removeEventListener('popstate', this.checkUrl, false); } else if (this._wantsHashChange && this._hasHashChange) { removeEventListener('hashchange', this.checkUrl, false); } // Some environments will throw when clearing an undefined interval. if (this._checkUrlInterval) clearInterval(this._checkUrlInterval); History.started = false; }, // Add a route to be tested when the fragment changes. Routes added later // may override previous routes. route: function (route, callback) { this.handlers.unshift({route: route, callback: callback}); }, urlChanged: function () { var current = this.getFragment(); if (current === this.fragment) return false; return true; }, // Checks the current URL to see if it has changed, and if it has, // calls `loadUrl`. checkUrl: function (e) { this.urlChanged() && this.loadUrl(); }, // Attempt to load the current URL fragment. If a route succeeds with a // match, returns `true`. If no defined routes matches the fragment, // returns `false`. loadUrl: function (fragment) { fragment = this.fragment = this.getFragment(fragment); return this.handlers.some(function (handler) { if (handler.route.test(fragment)) { handler.callback(fragment); return true; } }); }, // Save a fragment into the hash history, or replace the URL state if the // 'replace' option is passed. You are responsible for properly URL-encoding // the fragment in advance. // // The options object can contain `trigger: false` if you wish to have the // route callback not be fired (sometimes desirable), or `replace: true`, if // you wish to modify the current URL without adding an entry to the history. navigate: function (fragment, options) { if (!History.started) return false; options = extend({trigger: true}, options); var url = this.root + (fragment = this.getFragment(fragment || '')); // Strip the hash and decode for matching. fragment = decodeURI(fragment.replace(pathStripper, '')); if (this.fragment === fragment) return; this.fragment = fragment; // Don't include a trailing slash on the root. if (fragment === '' && url !== '/') url = url.slice(0, -1); // If pushState is available, we use it to set the fragment as a real URL. if (this._hasPushState) { this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url); // If hash changes haven't been explicitly disabled, update the hash // fragment to store history. } else if (this._wantsHashChange) { this._updateHash(this.location, fragment, options.replace); // If you've told us that you explicitly don't want fallback hashchange- // based history, then `navigate` becomes a page refresh. } else { return this.location.assign(url); } if (options.trigger) return this.loadUrl(fragment); }, // Update the hash location, either replacing the current entry, or adding // a new one to the browser history. _updateHash: function (location, fragment, replace) { if (replace) { var href = location.href.replace(/(javascript:|#).*$/, ''); location.replace(href + '#' + fragment); } else { // Some browsers require that `hash` contains a leading #. location.hash = '#' + fragment; } } }); module.exports = new History(); },{"ampersand-events":34,"lodash.assign":56,"lodash.bind":58}],36:[function(require,module,exports){ ;if (typeof window !== "undefined") { window.ampersand = window.ampersand || {}; window.ampersand["ampersand-router"] = window.ampersand["ampersand-router"] || []; window.ampersand["ampersand-router"].push("3.0.2");} var classExtend = require('ampersand-class-extend'); var Events = require('ampersand-events'); var extend = require('lodash.assign'); var isRegexp = require('lodash.isregexp'); var isFunction = require('lodash.isfunction'); var result = require('lodash.result'); var ampHistory = require('./ampersand-history'); // Routers map faux-URLs to actions, and fire events when routes are // matched. Creating a new one sets its `routes` hash, if not set statically. var Router = module.exports = function (options) { options || (options = {}); this.history = options.history || ampHistory; if (options.routes) this.routes = options.routes; this._bindRoutes(); this.initialize.apply(this, arguments); }; // Cached regular expressions for matching named param parts and splatted // parts of route strings. var optionalParam = /\((.*?)\)/g; var namedParam = /(\(\?)?:\w+/g; var splatParam = /\*\w+/g; var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g; // Set up all inheritable **Backbone.Router** properties and methods. extend(Router.prototype, Events, { // Initialize is an empty function by default. Override it with your own // initialization logic. initialize: function () {}, // Manually bind a single named route to a callback. For example: // // this.route('search/:query/p:num', 'search', function (query, num) { // ... // }); // route: function (route, name, callback) { if (!isRegexp(route)) route = this._routeToRegExp(route); if (isFunction(name)) { callback = name; name = ''; } if (!callback) callback = this[name]; var router = this; this.history.route(route, function (fragment) { var args = router._extractParameters(route, fragment); if (router.execute(callback, args, name) !== false) { router.trigger.apply(router, ['route:' + name].concat(args)); router.trigger('route', name, args); router.history.trigger('route', router, name, args); } }); return this; }, // Execute a route handler with the provided parameters. This is an // excellent place to do pre-route setup or post-route cleanup. execute: function (callback, args, name) { if (callback) callback.apply(this, args); }, // Simple proxy to `ampHistory` to save a fragment into the history. navigate: function (fragment, options) { this.history.navigate(fragment, options); return this; }, // Reload the current route as if it was navigated to from somewhere // else reload: function () { this.history.loadUrl(this.history.fragment); return this; }, // Helper for doing `internal` redirects without adding to history // and thereby breaking backbutton functionality. redirectTo: function (newUrl) { this.navigate(newUrl, {replace: true}); }, // Bind all defined routes to `history`. We have to reverse the // order of the routes here to support behavior where the most general // routes can be defined at the bottom of the route map. _bindRoutes: function () { if (!this.routes) return; this.routes = result(this, 'routes'); var route, routes = Object.keys(this.routes); while ((route = routes.pop()) != null) { this.route(route, this.routes[route]); } }, // Convert a route string into a regular expression, suitable for matching // against the current location hash. _routeToRegExp: function (route) { route = route .replace(escapeRegExp, '\\$&') .replace(optionalParam, '(?:$1)?') .replace(namedParam, function (match, optional) { return optional ? match : '([^/?]+)'; }) .replace(splatParam, '([^?]*?)'); return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$'); }, // Given a route, and a URL fragment that it matches, return the array of // extracted decoded parameters. Empty or unmatched parameters will be // treated as `null` to normalize cross-browser behavior. _extractParameters: function (route, fragment) { var params = route.exec(fragment).slice(1); return params.map(function (param, i) { // Don't decode the search params. if (i === params.length - 1) return param || null; return param ? decodeURIComponent(param) : null; }); } }); Router.extend = classExtend; },{"./ampersand-history":35,"ampersand-class-extend":33,"ampersand-events":34,"lodash.assign":56,"lodash.isfunction":64,"lodash.isregexp":65,"lodash.result":70}],37:[function(require,module,exports){ (function (window) { var requestAnimFrame = (function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(callback){window.setTimeout(callback,1000/60);};})(); var easeInOutQuad = function (t, b, c, d) { t /= d/2; if (t < 1) return c/2*t*t + b; t--; return -c/2 * (t*(t-2) - 1) + b; }; var animatedScrollTo = function (element, to, duration, callback) { var start = element.scrollTop, change = to - start, animationStart = +new Date(); var animating = true; var lastpos = null; var animateScroll = function() { if (!animating) { return; } requestAnimFrame(animateScroll); var now = +new Date(); var val = Math.floor(easeInOutQuad(now - animationStart, start, change, duration)); if (lastpos) { if (lastpos === element.scrollTop) { lastpos = val; element.scrollTop = val; } else { animating = false; } } else { lastpos = val; element.scrollTop = val; } if (now > animationStart + duration) { element.scrollTop = to; animating = false; if (callback) { callback(); } } }; requestAnimFrame(animateScroll); }; if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { module.exports = animatedScrollTo; } else { window.animatedScrollTo = animatedScrollTo; } })(window); },{}],38:[function(require,module,exports){ /* * classList.js: Cross-browser full element.classList implementation. * 2014-07-23 * * By Eli Grey, http://eligrey.com * Public Domain. * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. */ /*global self, document, DOMException */ /*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/ /* Copied from MDN: * https://developer.mozilla.org/en-US/docs/Web/API/Element/classList */ if ("document" in window.self) { // Full polyfill for browsers with no classList support // Including IE < Edge missing SVGElement.classList if (!("classList" in document.createElement("_")) || document.createElementNS && !("classList" in document.createElementNS("http://www.w3.org/2000/svg","g"))) { (function (view) { "use strict"; if (!('Element' in view)) return; var classListProp = "classList" , protoProp = "prototype" , elemCtrProto = view.Element[protoProp] , objCtr = Object , strTrim = String[protoProp].trim || function () { return this.replace(/^\s+|\s+$/g, ""); } , arrIndexOf = Array[protoProp].indexOf || function (item) { var i = 0 , len = this.length ; for (; i < len; i++) { if (i in this && this[i] === item) { return i; } } return -1; } // Vendors: please allow content code to instantiate DOMExceptions , DOMEx = function (type, message) { this.name = type; this.code = DOMException[type]; this.message = message; } , checkTokenAndGetIndex = function (classList, token) { if (token === "") { throw new DOMEx( "SYNTAX_ERR" , "An invalid or illegal string was specified" ); } if (/\s/.test(token)) { throw new DOMEx( "INVALID_CHARACTER_ERR" , "String contains an invalid character" ); } return arrIndexOf.call(classList, token); } , ClassList = function (elem) { var trimmedClasses = strTrim.call(elem.getAttribute("class") || "") , classes = trimmedClasses ? trimmedClasses.split(/\s+/) : [] , i = 0 , len = classes.length ; for (; i < len; i++) { this.push(classes[i]); } this._updateClassName = function () { elem.setAttribute("class", this.toString()); }; } , classListProto = ClassList[protoProp] = [] , classListGetter = function () { return new ClassList(this); } ; // Most DOMException implementations don't allow calling DOMException's toString() // on non-DOMExceptions. Error's toString() is sufficient here. DOMEx[protoProp] = Error[protoProp]; classListProto.item = function (i) { return this[i] || null; }; classListProto.contains = function (token) { token += ""; return checkTokenAndGetIndex(this, token) !== -1; }; classListProto.add = function () { var tokens = arguments , i = 0 , l = tokens.length , token , updated = false ; do { token = tokens[i] + ""; if (checkTokenAndGetIndex(this, token) === -1) { this.push(token); updated = true; } } while (++i < l); if (updated) { this._updateClassName(); } }; classListProto.remove = function () { var tokens = arguments , i = 0 , l = tokens.length , token , updated = false , index ; do { token = tokens[i] + ""; index = checkTokenAndGetIndex(this, token); while (index !== -1) { this.splice(index, 1); updated = true; index = checkTokenAndGetIndex(this, token); } } while (++i < l); if (updated) { this._updateClassName(); } }; classListProto.toggle = function (token, force) { token += ""; var result = this.contains(token) , method = result ? force !== true && "remove" : force !== false && "add" ; if (method) { this[method](token); } if (force === true || force === false) { return force; } else { return !result; } }; classListProto.toString = function () { return this.join(" "); }; if (objCtr.defineProperty) { var classListPropDesc = { get: classListGetter , enumerable: true , configurable: true }; try { objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc); } catch (ex) { // IE 8 doesn't support enumerable:true if (ex.number === -0x7FF5EC54) { classListPropDesc.enumerable = false; objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc); } } } else if (objCtr[protoProp].__defineGetter__) { elemCtrProto.__defineGetter__(classListProp, classListGetter); } }(window.self)); } else { // There is full or partial native classList support, so just check if we need // to normalize the add/remove and toggle APIs. (function () { "use strict"; var testElement = document.createElement("_"); testElement.classList.add("c1", "c2"); // Polyfill for IE 10/11 and Firefox <26, where classList.add and // classList.remove exist but support only one argument at a time. if (!testElement.classList.contains("c2")) { var createMethod = function(method) { var original = DOMTokenList.prototype[method]; DOMTokenList.prototype[method] = function(token) { var i, len = arguments.length; for (i = 0; i < len; i++) { token = arguments[i]; original.call(this, token); } }; }; createMethod('add'); createMethod('remove'); } testElement.classList.toggle("c3", false); // Polyfill for IE 10 and Firefox <24, where classList.toggle does not // support the second argument. if (testElement.classList.contains("c3")) { var _toggle = DOMTokenList.prototype.toggle; DOMTokenList.prototype.toggle = function(token, force) { if (1 in arguments && !this.contains(token) === !force) { return force; } else { return _toggle.call(this, token); } }; } testElement = null; }()); } } },{}],39:[function(require,module,exports){ /* © 2011 by Jerry Sievert Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ (function () { /** @class Date */ // constants var monthsAbbr = [], monthsFull = [], daysAbbr = [], daysFull = [], dayNames = {}, monthsAll, daysAll = [], monthNames = []; monthsAbbr = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]; monthsFull = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ]; daysAbbr = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ]; daysFull = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ]; dayNames = { 'su': 0, 'sun': 0, 'sunday': 0, 'mo': 1, 'mon': 1, 'monday': 1, 'tu': 2, 'tue': 2, 'tuesday': 2, 'we': 3, 'wed': 3, 'wednesday': 3, 'th': 4, 'thu': 4, 'thursday': 4, 'fr': 5, 'fri': 5, 'friday': 5, 'sa': 6, 'sat': 6, 'saturday': 6 }; monthsAll = monthsFull.concat(monthsAbbr); daysAll = [ 'su', 'sun', 'sunday', 'mo', 'mon', 'monday', 'tu', 'tue', 'tuesday', 'we', 'wed', 'wednesday', 'th', 'thu', 'thursday', 'fr', 'fri', 'friday', 'sa', 'sat', 'saturday' ]; monthNames = { 'jan': 0, 'january': 0, 'feb': 1, 'february': 1, 'mar': 2, 'march': 2, 'apr': 3, 'april': 3, 'may': 4, 'jun': 5, 'june': 5, 'jul': 6, 'july': 6, 'aug': 7, 'august': 7, 'sep': 8, 'september': 8, 'oct': 9, 'october': 9, 'nov': 10, 'november': 10, 'dec': 11, 'december': 11 }; var daysInMonth = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]; // private helper functions /** @ignore */ function pad(str, length) { str = String(str); while (str.length < length) { str = '0' + str; } return str; } var isInteger = function (str) { if (str.match(/^(\d+)$/)) { return true; } return false; }; var getInt = function (str, i, minlength, maxlength) { for (var x = maxlength; x >= minlength; x--) { var token = str.substring(i, i + x); if (token.length < minlength) { return null; } if (isInteger(token)) { return token; } } return null; }; // static class methods var origParse = Date.parse; // ------------------------------------------------------------------ // getDateFromFormat( date_string , format_string ) // // This function takes a date string and a format string. It matches // If the date string matches the format string, it returns the // getTime() of the date. If it does not match, it returns NaN. // Original Author: Matt Kruse <matt@mattkruse.com> // WWW: http://www.mattkruse.com/ // Adapted from: http://www.mattkruse.com/javascript/date/source.html // ------------------------------------------------------------------ var getDateFromFormat = function (val, format) { val = val + ""; format = format + ""; var iVal = 0; var iFormat = 0; var c = ""; var token = ""; var token2 = ""; var x, y; var now = new Date(); var year = now.getYear(); var month = now.getMonth() + 1; var date = 1; var hh = 0; var mm = 0; var ss = 0; var ampm = ""; while (iFormat < format.length) { // Get next token from format string c = format.charAt(iFormat); token = ""; while ((format.charAt(iFormat) === c) && (iFormat < format.length)) { token += format.charAt(iFormat++); } // Extract contents of value based on format token if (token === "yyyy" || token === "yy" || token === "y") { if (token === "yyyy") { x = 4; y = 4; } if (token === "yy") { x = 2; y = 2; } if (token === "y") { x = 2; y = 4; } year = getInt(val, iVal, x, y); if (year === null) { return NaN; } iVal += year.length; if (year.length === 2) { if (year > 70) { year = 1900 + (year - 0); } else { year = 2000 + (year - 0); } } } else if (token === "MMM" || token === "NNN") { month = 0; for (var i = 0; i < monthsAll.length; i++) { var monthName = monthsAll[i]; if (val.substring(iVal, iVal + monthName.length).toLowerCase() === monthName.toLowerCase()) { if (token === "MMM" || (token === "NNN" && i > 11)) { month = i + 1; if (month > 12) { month -= 12; } iVal += monthName.length; break; } } } if ((month < 1) || (month > 12)) { return NaN; } } else if (token === "EE" || token === "E") { for (var n = 0; n < daysAll.length; n++) { var dayName = daysAll[n]; if (val.substring(iVal, iVal + dayName.length).toLowerCase() === dayName.toLowerCase()) { iVal += dayName.length; break; } } } else if (token === "MM" || token === "M") { month = getInt(val, iVal, token.length, 2); if (month === null || (month < 1) || (month > 12)) { return NaN; } iVal += month.length; } else if (token === "dd" || token === "d") { date = getInt(val, iVal, token.length, 2); if (date === null || (date < 1) || (date > 31)) { return NaN; } iVal += date.length; } else if (token === "hh" || token === "h") { hh = getInt(val, iVal, token.length, 2); if (hh === null || (hh < 1) || (hh > 12)) { return NaN; } iVal += hh.length; } else if (token === "HH" || token === "H") { hh = getInt(val, iVal, token.length, 2); if (hh === null || (hh < 0) || (hh > 23)) { return NaN; } iVal += hh.length; } else if (token === "KK" || token === "K") { hh = getInt(val, iVal, token.length, 2); if (hh === null || (hh < 0) || (hh > 11)) { return NaN; } iVal += hh.length; } else if (token === "kk" || token === "k") { hh = getInt(val, iVal, token.length, 2); if (hh === null || (hh < 1) || (hh > 24)) { return NaN; } iVal += hh.length; hh--; } else if (token === "mm" || token === "m") { mm = getInt(val, iVal, token.length, 2); if (mm === null || (mm < 0) || (mm > 59)) { return NaN; } iVal += mm.length; } else if (token === "ss" || token === "s") { ss = getInt(val, iVal, token.length, 2); if (ss === null || (ss < 0) || (ss > 59)) { return NaN; } iVal += ss.length; } else if (token === "a") { if (val.substring(iVal, iVal + 2).toLowerCase() === "am") { ampm = "AM"; } else if (val.substring(iVal, iVal + 2).toLowerCase() === "pm") { ampm = "PM"; } else { return NaN; } iVal += 2; } else { if (val.substring(iVal, iVal + token.length) !== token) { return NaN; } else { iVal += token.length; } } } // If there are any trailing characters left in the value, it doesn't match if (iVal !== val.length) { return NaN; } // Is date valid for month? if (month === 2) { // Check for leap year if (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)) { // leap year if (date > 29) { return NaN; } } else { if (date > 28) { return NaN; } } } if ((month === 4) || (month === 6) || (month === 9) || (month === 11)) { if (date > 30) { return NaN; } } // Correct hours value if (hh < 12 && ampm === "PM") { hh = hh - 0 + 12; } else if (hh > 11 && ampm === "AM") { hh -= 12; } var newdate = new Date(year, month - 1, date, hh, mm, ss); return newdate.getTime(); }; /** @ignore */ Date.parse = function (date, format) { if (format) { return getDateFromFormat(date, format); } var timestamp = origParse(date), minutesOffset = 0, match; if (isNaN(timestamp) && (match = /^(\d{4}|[+\-]\d{6})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?))?/.exec(date))) { if (match[8] !== 'Z') { minutesOffset = +match[10] * 60 + (+match[11]); if (match[9] === '+') { minutesOffset = 0 - minutesOffset; } } match[7] = match[7] || '000'; timestamp = Date.UTC(+match[1], +match[2] - 1, +match[3], +match[4], +match[5] + minutesOffset, +match[6], +match[7].substr(0, 3)); } return timestamp; }; function polyfill(name, func) { if (Date.prototype[name] === undefined) { Date.prototype[name] = func; } } /** Returns new instance of Date object with the date set to today and the time set to midnight @static @returns {Date} Today's Date @function today @memberof Date */ Date.today = function () { return new Date().clearTime(); }; /** Returns new instance of Date object with the date set to today and the time set to midnight in UTC @static @returns {Date} Today's Date in UTC @function UTCtoday @memberof Date */ Date.UTCtoday = function () { return new Date().clearUTCTime(); }; /** Returns new instance of Date object with the date set to tomorrow and the time set to midnight @static @returns {Date} Tomorrow's Date @function tomorrow @memberof Date */ Date.tomorrow = function () { return Date.today().add({days: 1}); }; /** Returns new instance of Date object with the date set to tomorrow and the time set to midnight in UTC @static @returns {Date} Tomorrow's Date in UTC @function UTCtomorrow @memberof Date */ Date.UTCtomorrow = function () { return Date.UTCtoday().add({days: 1}); }; /** Returns new instance of Date object with the date set to yesterday and the time set to midnight @static @returns {Date} Yesterday's Date @function yesterday @memberof Date */ Date.yesterday = function () { return Date.today().add({days: -1}); }; /** Returns new instance of Date object with the date set to yesterday and the time set to midnight in UTC @static @returns {Date} Yesterday's Date in UTC @function UTCyesterday @memberof Date */ Date.UTCyesterday = function () { return Date.UTCtoday().add({days: -1}); }; /** Returns whether the day is valid @static @param day {Number} day of the month @param year {Number} year @param month {Number} month of the year [0-11] @returns {Boolean} @function validateDay @memberof Date */ Date.validateDay = function (day, year, month) { var date = new Date(year, month, day); return (date.getFullYear() === year && date.getMonth() === month && date.getDate() === day); }; /** Returns whether the year is valid @static @param year {Number} year @returns {Boolean} @function validateYear @memberof Date */ Date.validateYear = function (year) { return (year >= 0 && year <= 9999); }; /** Returns whether the second is valid @static @param second {Number} second @returns {Boolean} @function validateSecond @memberof Date */ Date.validateSecond = function (second) { return (second >= 0 && second < 60); }; /** Returns whether the month is valid [0-11] @static @param month {Number} month @returns {Boolean} @function validateMonth @memberof Date */ Date.validateMonth = function (month) { return (month >= 0 && month < 12); }; /** Returns whether the minute is valid @static @param minute {Number} minute @returns {Boolean} @function validateMinute @memberof Date */ Date.validateMinute = function (minute) { return (minute >= 0 && minute < 60); }; /** Returns whether the millisecond is valid @static @param millisecond {Number} millisecond @returns {Boolean} @function validateMillisecond @memberof Date */ Date.validateMillisecond = function (milli) { return (milli >= 0 && milli < 1000); }; /** Returns whether the hour is valid [0-23] @static @param hour {Number} hour @returns {Boolean} @function validateHour @memberof Date */ Date.validateHour = function (hour) { return (hour >= 0 && hour < 24); }; /** Compares two dates @static @param date1 {Date} first date @param date2 {Date} second date @returns {Number} -1 if date1 is less than date2, 0 if they are equal, 1 if date1 is more than date2 @function compare @memberof Date */ Date.compare = function (date1, date2) { if (date1.valueOf() < date2.valueOf()) { return -1; } else if (date1.valueOf() > date2.valueOf()) { return 1; } return 0; }; /** Compares two dates to the millisecond @static @param date1 {Date} first date @param date2 {Date} second date @returns {Boolean} @function equals @memberof Date */ Date.equals = function (date1, date2) { return date1.valueOf() === date2.valueOf(); }; /** Compares two dates by day @static @param date1 {Date} first date @param date2 {Date} second date @returns {Boolean} @function equalsDay @memberof Date */ Date.equalsDay = function (date1, date2) { return date1.toYMD() === date2.toYMD(); }; /** Returns the day number for a day [0-6] @static @param day {String} day name @returns {Number} @function getDayNumberFromName @memberof Date */ Date.getDayNumberFromName = function (name) { return dayNames[name.toLowerCase()]; }; /** Returns the day number for a month [0-11] @static @param month {String} month name @returns {Number} @function getMonthNumberFromName @memberof Date */ Date.getMonthNumberFromName = function (name) { return monthNames[name.toLowerCase()]; }; /** Returns the month name for a month [0-11] @static @param month {Number} month @returns {String} @function getMonthNameFromNumber @memberof Date */ Date.getMonthNameFromNumber = function (number) { return monthsFull[number]; }; /** Returns the month name abbreviated for a month [0-11] @static @param month {Number} month @returns {String} @function getMonthAbbrFromNumber @memberof Date */ Date.getMonthAbbrFromNumber = function (number) { return monthsAbbr[number]; }; /** Returns whether or not the year is a leap year @static @param year {Number} year @returns {Boolean} @function isLeapYear @memberof Date */ Date.isLeapYear = function (year) { return (new Date(year, 1, 29).getDate() === 29); }; /** Returns the number of days in a month @static @param year {Number} year @param month {Number} month @returns {Number} @function getDaysInMonth @memberof Date */ Date.getDaysInMonth = function (year, month) { if (month === 1) { return Date.isLeapYear(year) ? 29 : 28; } return daysInMonth[month]; }; /** Returns the abbreviated month name @returns {String} @function getMonthAbbr @instance @memberof Date */ polyfill('getMonthAbbr', function () { return monthsAbbr[this.getMonth()]; }); /** Returns the month name @returns {String} @function getMonthName @instance @memberof Date */ polyfill('getMonthName', function () { return monthsFull[this.getMonth()]; }); /** Returns the name of last month @returns {String} @function getLastMonthName @instance @memberof Date */ polyfill('getLastMonthName', function () { var i = this.getMonth(); i = (i === 0 ? 11 : i - 1); return monthsFull[i]; }); /** Returns the current UTC office @returns {String} @function getUTCOffset @instance @memberof Date */ polyfill('getUTCOffset', function () { var tz = pad(Math.abs(this.getTimezoneOffset() / 0.6), 4); if (this.getTimezoneOffset() > 0) { tz = '-' + tz; } return tz; }); /** Returns a padded Common Log Format @returns {String} @function toCLFString @deprecated Will be deprecated in version 2.0 in favor of toFormat @instance @memberof Date */ polyfill('toCLFString', function () { return pad(this.getDate(), 2) + '/' + this.getMonthAbbr() + '/' + this.getFullYear() + ':' + pad(this.getHours(), 2) + ':' + pad(this.getMinutes(), 2) + ':' + pad(this.getSeconds(), 2) + ' ' + this.getUTCOffset(); }); /** Returns a padded Year/Month/Day @returns {String} @param separator {String} optional, defaults to "-" @function toYMD @deprecated Will be deprecated in version 2.0 in favor of toFormat @instance @memberof Date */ polyfill('toYMD', function (separator) { separator = typeof separator === 'undefined' ? '-' : separator; return this.getFullYear() + separator + pad(this.getMonth() + 1, 2) + separator + pad(this.getDate(), 2); }); /** Returns a formatted String for database insertion @returns {String} @function toDBString @deprecated Will be deprecated in version 2.0 in favor of toFormat @instance @memberof Date */ polyfill('toDBString', function () { return this.getUTCFullYear() + '-' + pad(this.getUTCMonth() + 1, 2) + '-' + pad(this.getUTCDate(), 2) + ' ' + pad(this.getUTCHours(), 2) + ':' + pad(this.getUTCMinutes(), 2) + ':' + pad(this.getUTCSeconds(), 2); }); /** Sets the time to 00:00:00.0000 and returns a new Date object @returns {Date} @function clearTime @instance @memberof Date */ polyfill('clearTime', function () { this.setHours(0); this.setMinutes(0); this.setSeconds(0); this.setMilliseconds(0); return this; }); /** Sets the time to 00:00:00.0000 and returns a new Date object with set to UTC @returns {Date} @function clearUTCTime @instance @memberof Date */ polyfill('clearUTCTime', function () { this.setUTCHours(0); this.setUTCMinutes(0); this.setUTCSeconds(0); this.setUTCMilliseconds(0); return this; }); /** Adds `milliseconds`, `seconds`, `minutes`, `hours`, `days`, `weeks`, `months`, and `years` and returns a new Date. Usage: `data.add({ "seconds": 10, "days": 1 })` @param additions {Object} @returns {Date} @function add @instance @memberof Date */ polyfill('add', function (obj) { if (obj.milliseconds !== undefined) { this.setMilliseconds(this.getMilliseconds() + obj.milliseconds); } if (obj.seconds !== undefined) { this.setSeconds(this.getSeconds() + obj.seconds); } if (obj.minutes !== undefined) { this.setMinutes(this.getMinutes() + obj.minutes); } if (obj.hours !== undefined) { this.setHours(this.getHours() + obj.hours); } if (obj.days !== undefined) { this.setDate(this.getDate() + obj.days); } if (obj.weeks !== undefined) { this.setDate(this.getDate() + (obj.weeks * 7)); } if (obj.months !== undefined) { this.setMonth(this.getMonth() + obj.months); } if (obj.years !== undefined) { this.setFullYear(this.getFullYear() + obj.years); } return this; }); /** Adds milliseconds to the Date and returns it @returns {Date} @param milliseconds {Number} Number of milliseconds to add @function addMilliseconds @deprecated Will be deprecated in version 2.0 in favor of add @instance @memberof Date */ polyfill('addMilliseconds', function (milliseconds) { return this.add({ milliseconds: milliseconds }); }); /** Adds seconds to the Date and returns it @returns {Date} @param seconds {Number} Number of seconds to add @function addSeconds @deprecated Will be deprecated in version 2.0 in favor of add @instance @memberof Date */ polyfill('addSeconds', function (seconds) { return this.add({ seconds: seconds }); }); /** Adds minutes to the Date and returns it @returns {Date} @param minutes {Number} Number of minutes to add @function addMinutes @deprecated Will be deprecated in version 2.0 in favor of add @instance @memberof Date */ polyfill('addMinutes', function (minutes) { return this.add({ minutes: minutes }); }); /** Adds hours to the Date and returns it @returns {Date} @param hours {Number} Number of hours to add @function addHours @deprecated Will be deprecated in version 2.0 in favor of add @instance @memberof Date */ polyfill('addHours', function (hours) { return this.add({ hours: hours }); }); /** Adds days to the Date and returns it @returns {Date} @param days {Number} Number of days to add @function addSeconds @deprecated Will be deprecated in version 2.0 in favor of add @instance @memberof Date */ polyfill('addDays', function (days) { return this.add({ days: days }); }); /** Adds weeks to the Date and returns it @returns {Date} @param weeks {Number} Number of weeks to add @function addWeeks @deprecated Will be deprecated in version 2.0 in favor of add @instance @memberof Date */ polyfill('addWeeks', function (weeks) { return this.add({ days: (weeks * 7) }); }); /** Adds months to the Date and returns it @returns {Date} @param months {Number} Number of months to add @function addMonths @deprecated Will be deprecated in version 2.0 in favor of add @instance @memberof Date */ polyfill('addMonths', function (months) { return this.add({ months: months }); }); /** Adds years to the Date and returns it @returns {Date} @param years {Number} Number of years to add @function addYears @deprecated Will be deprecated in version 2.0 in favor of add @instance @memberof Date */ polyfill('addYears', function (years) { return this.add({ years: years }); }); /** Removes `milliseconds`, `seconds`, `minutes`, `hours`, `days`, `weeks`, `months`, and `years` and returns a new Date. Usage: `data.remove({ "seconds": 10, "days": 1 })` @param removals {Object} @returns {Date} @function remove @instance @memberof Date */ polyfill('remove', function (obj) { if (obj.seconds !== undefined) { this.setSeconds(this.getSeconds() - obj.seconds); } if (obj.minutes !== undefined) { this.setMinutes(this.getMinutes() - obj.minutes); } if (obj.hours !== undefined) { this.setHours(this.getHours() - obj.hours); } if (obj.days !== undefined) { this.setDate(this.getDate() - obj.days); } if (obj.weeks !== undefined) { this.setDate(this.getDate() - (obj.weeks * 7)); } if (obj.months !== undefined) { this.setMonth(this.getMonth() - obj.months); } if (obj.years !== undefined) { this.setFullYear(this.getFullYear() - obj.years); } return this; }); /** Removes milliseconds from the Date and returns it @returns {Date} @param milliseconds {Number} Number of millseconds to remove @function removeMilliseconds @deprecated Will be deprecated in version 2.0 in favor of remove @instance @memberof Date */ polyfill('removeMilliseconds', function (milliseconds) { throw new Error('Not implemented'); }); /** Removes seconds from the Date and returns it @returns {Date} @param seconds {Number} Number of seconds to remove @function removeSeconds @deprecated Will be deprecated in version 2.0 in favor of remove @instance @memberof Date */ polyfill('removeSeconds', function (seconds) { return this.remove({ seconds: seconds }); }); /** Removes minutes from the Date and returns it @returns {Date} @param seconds {Number} Number of minutes to remove @function removeMinutes @deprecated Will be deprecated in version 2.0 in favor of remove @instance @memberof Date */ polyfill('removeMinutes', function (minutes) { return this.remove({ minutes: minutes }); }); /** Removes hours from the Date and returns it @returns {Date} @param hours {Number} Number of hours to remove @function removeHours @deprecated Will be deprecated in version 2.0 in favor of remove @instance @memberof Date */ polyfill('removeHours', function (hours) { return this.remove({ hours: hours }); }); /** Removes days from the Date and returns it @returns {Date} @param days {Number} Number of days to remove @function removeDays @deprecated Will be deprecated in version 2.0 in favor of remove @instance @memberof Date */ polyfill('removeDays', function (days) { return this.remove({ days: days }); }); /** Removes weeks from the Date and returns it @returns {Date} @param weeks {Number} Number of weeks to remove @function removeWeeks @deprecated Will be deprecated in version 2.0 in favor of remove @instance @memberof Date */ polyfill('removeWeeks', function (weeks) { return this.remove({ days: (weeks * 7) }); }); /** Removes months from the Date and returns it @returns {Date} @param months {Number} Number of months to remove @function removeMonths @deprecated Will be deprecated in version 2.0 in favor of remove @instance @memberof Date */ polyfill('removeMonths', function (months) { return this.remove({ months: months }); }); /** Removes years from the Date and returns it @returns {Date} @param years {Number} Number of years to remove @function removeYears @deprecated Will be deprecated in version 2.0 in favor of remove @instance @memberof Date */ polyfill('removeYears', function (years) { return this.remove({ years: years }); }); /** Adds weekdays based on a Mon-Fri work schedule and returns it @returns {Date} @param weekdays {Number} Number of weekdays to add @function addWeekdays @instance @memberof Date */ polyfill('addWeekdays', function (weekdays) { var day = this.getDay(); if (day === 0) { day = 7; } var daysOffset = weekdays; var weekspan = Math.floor(( weekdays + day - 1 ) / 5.0); if (weekdays > 0){ daysOffset += weekspan * 2; if ( day > 5 ) { daysOffset -= day - 5; } } else { daysOffset += Math.min( weekspan * 2, 0); if ( day > 6 ) { daysOffset -= 1; } } return this.addDays( daysOffset ); }); /** Sets the time and date to now @function setTimeToNow @instance @memberof Date */ polyfill('setTimeToNow', function () { var n = new Date(); this.setMilliseconds(n.getMilliseconds()); this.setSeconds(n.getSeconds()); this.setMinutes(n.getMinutes()); this.setHours(n.getHours()); }); /** Returns a cloned copy of the current Date @function clone @instance @memberof Date */ polyfill('clone', function () { return new Date(this.valueOf()); }); /** Returns whether this Date is between a start and end date @function between @returns {Boolean} @instance @memberof Date */ polyfill('between', function (start, end) { return (this.valueOf() >= start.valueOf() && this.valueOf() <= end.valueOf()); }); /** Compares a Date to this Date @param {Date} Date to compare to @function compareTo @returns {Number} -1 if less than date, 0 if they are equal, 1 if more than date @instance @memberof Date */ polyfill('compareTo', function (date) { return Date.compare(this, date); }); /** Compares a Date and time to this Date and time for equality @param {Date} Date to compare to @function equals @returns {Boolean} @instance @memberof Date */ polyfill('equals', function (date) { return Date.equals(this, date); }); /** Compares a Date to this Date for equality @param {Date} Date to compare to @function equalsDay @returns {Boolean} @instance @memberof Date */ polyfill('equalsDay', function (date) { return Date.equalsDay(this, date); }); /** Checks to see if the Date is today @function isToday @returns {Boolean} @instance @memberof Date */ polyfill('isToday', function () { return Date.equalsDay(this, Date.today()); }); /** Compares a Date to this Date for to see if it is after the Date passed @param {Date} Date to compare to @function isAfter @returns {Boolean} @instance @memberof Date */ polyfill('isAfter', function (date) { date = date ? date : new Date(); return (this.compareTo(date) > 0); }); /** Compares a Date to this Date for to see if it is before the Date passed @param {Date} Date to compare to @function isBefore @returns {Boolean} @instance @memberof Date */ polyfill('isBefore', function (date) { date = date ? date : new Date(); return (this.compareTo(date) < 0); }); /** Returns `true` if the Date is a weekend using standard Saturday/Sunday definition of a weekend @function isWeekend @returns {Boolean} @instance @memberof Date */ polyfill('isWeekend', function (date) { return (this.getDay() % 6 === 0); }); /** Returns the number of days between this Date and the Date passed in @function getDaysBetween @param {Date} Date to compare to @returns {Number} @instance @memberof Date */ polyfill('getDaysBetween', function (date) { return ((date.clone().valueOf() - this.valueOf()) / 86400000) | 0; }); /** Returns the number of hours between this Date and the Date passed in @function getHoursBetween @param {Date} Date to compare to @returns {Number} @instance @memberof Date */ polyfill('getHoursBetween', function (date) { return ((date.clone().valueOf() - this.valueOf()) / 3600000) | 0; }); /** Returns the number of minutes between this Date and the Date passed in @function getMinutesBetween @param {Date} Date to compare to @returns {Number} @instance @memberof Date */ polyfill('getMinutesBetween', function (date) { return ((date.clone().valueOf() - this.valueOf()) / 60000) | 0; }); /** Returns the number of seconds between this Date and the Date passed in @function getSecondsBetween @param {Date} Date to compare to @returns {Number} @instance @memberof Date */ polyfill('getSecondsBetween', function (date) { return ((date.clone().valueOf() - this.valueOf()) / 1000) | 0; }); /** Returns the number of milliseconds between this Date and the Date passed in @function getMillisecondsBetween @param {Date} Date to compare to @returns {Number} @instance @memberof Date */ polyfill('getMillisecondsBetween', function (date) { return ((date.clone().valueOf() - this.valueOf())) | 0; }); /** Returns the number of months between this Date and the Date passed in @function getMonthsBetween @param {Date} Date to compare to @returns {Number} @instance @memberof Date */ polyfill('getMonthsBetween', function (date) { var daysDiff = Math.abs(((+this) / (86400 * 1000)) - ((+date) / (86400 * 1000))); var start = new Date((+date) < (+this) ? (+date) : (+this)); var end = new Date((date) > (+this) ? (+date) : (+this)); var months = 0; while (+start < +end) { months++; start = start.addMonths(1); } var days = Math.abs(((+start) / (86400 * 1000)) - ((+end) / (86400 * 1000))); return months - (days / 31); }); /** Returns the ordinal number of this Date @function getOrdinalNumber @returns {Number} @instance @memberof Date */ polyfill('getOrdinalNumber', function () { return Math.ceil((this.clone().clearTime() - new Date(this.getFullYear(), 0, 1)) / 86400000) + 1; }); /** Returns the a formatted version of this Date @function toFormat @param format {String} Format of the Date, using `YYYY`, `YY`, `MM`, `DD`, `HH`, `HH24`, `MI`, `SS`, etc @returns {String} @instance @memberof Date */ polyfill('toFormat', function (format) { return toFormat(format, getReplaceMap(this)); }); /** Returns the a formatted version of the UTC version of this Date @function toUTCFormat @param format {String} Format of the Date, using `YYYY`, `YY`, `MM`, `DD`, `HH`, `HH24`, `MI`, `SS`, etc @returns {String} @instance @memberof Date */ polyfill('toUTCFormat', function (format) { return toFormat(format, getUTCReplaceMap(this)); }); /** Returns the week number of this Date @function getWeekNumber @returns {Number} @instance @memberof Date */ polyfill('getWeekNumber', function() { var onejan = new Date(this.getFullYear(),0,1); return Math.ceil((((this - onejan) / 86400000) + onejan.getDay()+1)/7); }); /** Returns the week number of this Date, zero padded @function getFullWeekNumber @returns {Number} @instance @memberof Date */ polyfill('getFullWeekNumber', function() { var weekNumber = '' + this.getWeekNumber(); if (weekNumber.length === 1) { weekNumber = "0" + weekNumber; } return weekNumber; }); var toFormat = function(format, replaceMap) { var f = [ format ], i, l, s; var replace = function (str, rep) { var i = 0, l = f.length, j, ll, t, n = []; for (; i < l; i++) { if (typeof f[i] == 'string') { t = f[i].split(str); for (j = 0, ll = t.length - 1; j < ll; j++) { n.push(t[j]); n.push([rep]); // replacement pushed as non-string } n.push(t[ll]); } else { // must be a replacement, don't process, just push n.push(f[i]); } } f = n; }; for (i in replaceMap) { replace(i, replaceMap[i]); } s = ''; for (i = 0, l = f.length; i < l; i++) s += typeof f[i] == 'string' ? f[i] : f[i][0]; return f.join(''); }; var getReplaceMap = function(date) { var hours = (date.getHours() % 12) ? date.getHours() % 12 : 12; return { 'YYYY': date.getFullYear(), 'YY': String(date.getFullYear()).slice(-2), 'MMMM': monthsFull[date.getMonth()], 'MMM': monthsAbbr[date.getMonth()], 'MM': pad(date.getMonth() + 1, 2), 'MI': pad(date.getMinutes(), 2), 'M': date.getMonth() + 1, 'DDDD': daysFull[date.getDay()], 'DDD': daysAbbr[date.getDay()], 'DD': pad(date.getDate(), 2), 'D': date.getDate(), 'HH24': pad(date.getHours(), 2), 'HH': pad(hours, 2), 'H': hours, 'SS': pad(date.getSeconds(), 2), 'PP': (date.getHours() >= 12) ? 'PM' : 'AM', 'P': (date.getHours() >= 12) ? 'pm' : 'am', 'LL': pad(date.getMilliseconds(), 3) }; }; var getUTCReplaceMap = function(date) { var hours = (date.getUTCHours() % 12) ? date.getUTCHours() % 12 : 12; return { 'YYYY': date.getUTCFullYear(), 'YY': String(date.getUTCFullYear()).slice(-2), 'MMMM': monthsFull[date.getUTCMonth()], 'MMM': monthsAbbr[date.getUTCMonth()], 'MM': pad(date.getUTCMonth() + 1, 2), 'MI': pad(date.getUTCMinutes(), 2), 'M': date.getUTCMonth() + 1, 'DDDD': daysFull[date.getUTCDay()], 'DDD': daysAbbr[date.getUTCDay()], 'DD': pad(date.getUTCDate(), 2), 'D': date.getUTCDate(), 'HH24': pad(date.getUTCHours(), 2), 'HH': pad(hours, 2), 'H': hours, 'SS': pad(date.getUTCSeconds(), 2), 'PP': (date.getUTCHours() >= 12) ? 'PM' : 'AM', 'P': (date.getUTCHours() >= 12) ? 'pm' : 'am', 'LL': pad(date.getUTCMilliseconds(), 3) }; }; /* * change the language * @param lang => support "es" Spanish, "fr" french, "pt-BR" Portuguese Brazil * translate => diego */ var language = function (lang) { if (lang == "es") { monthsAbbr = [ 'Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic' ]; monthsFull = [ 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre' ]; daysAbbr = [ 'Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab' ]; daysFull = [ 'Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado' ]; dayNames = { 'do': 0, 'dom': 0, 'domingo': 0, 'lu': 1, 'lun': 1, 'lunes': 1, 'ma': 2, 'mar': 2, 'martes': 2, 'mi': 3, 'mie': 3, 'miercoles': 3, 'ju': 4, 'jue': 4, 'jueves': 4, 'vi': 5, 'vie': 5, 'viernes': 5, 'sa': 6, 'sab': 6, 'sabado': 6 }; monthsAll = monthsFull.concat(monthsAbbr); daysAll = [ 'do', 'dom', 'domingo', 'lu', 'lun', 'lunes', 'ma', 'mar', 'martes', 'mi', 'mie', 'miércoles', 'ju', 'jue', 'jueves', 'vi', 'vie', 'viernes', 'sa', 'sab', 'sábado' ]; monthNames = { 'ene': 0, 'enero': 0, 'feb': 1, 'febrero': 1, 'mar': 2, 'marzo': 2, 'abr': 3, 'abril': 3, 'may': 4, 'mayo':4, 'jun': 5, 'junio': 5, 'jul': 6, 'julio': 6, 'ago': 7, 'agosto': 7, 'sep': 8, 'septiembre': 8, 'oct': 9, 'octubre': 9, 'nov': 10, 'noviembre': 10, 'dic': 11, 'diciembre': 11 }; } else if (lang == "fr") { monthsAbbr = [ 'Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Jui', 'Jul', 'Aoû', 'Sep', 'Oct', 'Nov', 'Déc' ]; monthsFull = [ 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre' ]; daysAbbr = [ 'Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam' ]; daysFull = [ 'Dimanchi', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi' ]; dayNames = { 'di': 0, 'dim': 0, 'dimanchi': 0, 'lu': 1, 'lun': 1, 'lundi': 1, 'ma': 2, 'mar': 2, 'mardi': 2, 'me': 3, 'mer': 3, 'mercredi': 3, 'je': 4, 'jeu': 4, 'jeudi': 4, 've': 5, 'ven': 5, 'vendredi': 5, 'sa': 6, 'sam': 6, 'samedi': 6 }; monthsAll = monthsFull.concat(monthsAbbr); daysAll = [ 'di', 'dim', 'dimanchi', 'lu', 'lun', 'lundi', 'ma', 'mar', 'mardi', 'me', 'mer', 'mercredi', 'je', 'jeu', 'jeudi', 've', 'ven', 'vendredi', 'sa', 'sam', 'samedi' ]; monthNames = { 'jan': 0, 'janvier': 0, 'fév': 1, 'février': 1, 'mar': 2, 'mars': 2, 'avr': 3, 'avril': 3, 'mai': 4, 'jui': 5, 'juin': 5, 'jul': 6, 'juillet': 6, 'aoû': 7, 'août': 7, 'sep': 8, 'septembre': 8, 'oct': 9, 'octobre': 9, 'nov': 10, 'novembre': 10, 'déc': 11, 'décembre': 11 }; } else if (lang == "pt-BR") { monthsAbbr = [ 'Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez' ]; monthsFull = [ 'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro' ]; daysAbbr = [ 'Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab' ]; daysFull = [ 'Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado' ]; dayNames = { 'do': 0, 'dom': 0, 'domingo': 0, 'se': 1, 'seg': 1, 'segunda': 1, 'te': 2, 'ter': 2, 'terca': 2, 'qa': 3, 'qua': 3, 'quarta': 3, 'qi': 4, 'qui': 4, 'quinta': 4, 'se': 5, 'sex': 5, 'sexta': 5, 'sa': 6, 'sab': 6, 'sabado': 6 }; monthsAll = monthsFull.concat(monthsAbbr); daysAll = [ 'do', 'dom', 'domingo', 'se', 'seg', 'segunda', 'te', 'ter', 'terça', 'qa', 'qua', 'quarta', 'qi', 'qui', 'quinta', 'se', 'sex', 'sexta', 'sa', 'sab', 'sábado' ]; monthNames = { 'jan': 0, 'janeiro': 0, 'fev': 1, 'fevereiro': 1, 'mar': 2, 'março': 2, 'abr': 3, 'abril': 3, 'mai': 4, 'jun': 5, 'junho': 5, 'jul': 6, 'julho': 6, 'ago': 7, 'agosto': 7, 'set': 8, 'setembro': 8, 'out': 9, 'outubro': 9, 'nov': 10, 'novembro': 10, 'dez': 11, 'dezembro': 11 }; } }; // Are we being imported?.. if (typeof module !== "undefined" && typeof module.exports === "object") { module.exports.language = language; } else if (typeof exports === "object") { exports.language = language; } else if (typeof Date.language === "undefined"){ // ...if not and if no language, then add statically to Date (for browsers.) Date.language = language; } }()); },{}],40:[function(require,module,exports){ /** * Returns a function, that, as long as it continues to be invoked, will not * be triggered. The function will be called after it stops being called for * N milliseconds. If `immediate` is passed, trigger the function on the * leading edge, instead of the trailing. The function also has a property 'clear' * that is a function which will clear the timer to prevent previously scheduled executions. * * @source underscore.js * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/ * @param {Function} function to wrap * @param {Number} timeout in ms (`100`) * @param {Boolean} whether to execute at the beginning (`false`) * @api public */ module.exports = function debounce(func, wait, immediate){ var timeout, args, context, timestamp, result; if (null == wait) wait = 100; function later() { var last = Date.now() - timestamp; if (last < wait && last >= 0) { timeout = setTimeout(later, wait - last); } else { timeout = null; if (!immediate) { result = func.apply(context, args); context = args = null; } } }; var debounced = function(){ context = this; args = arguments; timestamp = Date.now(); var callNow = immediate && !timeout; if (!timeout) timeout = setTimeout(later, wait); if (callNow) { result = func.apply(context, args); context = args = null; } return result; }; debounced.clear = function() { if (timeout) { clearTimeout(timeout); timeout = null; } }; return debounced; }; },{}],41:[function(require,module,exports){ 'use strict'; var hasOwn = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var defineProperty = Object.defineProperty; var gOPD = Object.getOwnPropertyDescriptor; var isArray = function isArray(arr) { if (typeof Array.isArray === 'function') { return Array.isArray(arr); } return toStr.call(arr) === '[object Array]'; }; var isPlainObject = function isPlainObject(obj) { if (!obj || toStr.call(obj) !== '[object Object]') { return false; } var hasOwnConstructor = hasOwn.call(obj, 'constructor'); var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); // Not own constructor property must be Object if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for (key in obj) { /**/ } return typeof key === 'undefined' || hasOwn.call(obj, key); }; // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target var setProperty = function setProperty(target, options) { if (defineProperty && options.name === '__proto__') { defineProperty(target, options.name, { enumerable: true, configurable: true, value: options.newValue, writable: true }); } else { target[options.name] = options.newValue; } }; // Return undefined instead of __proto__ if '__proto__' is not an own property var getProperty = function getProperty(obj, name) { if (name === '__proto__') { if (!hasOwn.call(obj, name)) { return void 0; } else if (gOPD) { // In early versions of node, obj['__proto__'] is buggy when obj has // __proto__ as an own property. Object.getOwnPropertyDescriptor() works. return gOPD(obj, name).value; } } return obj[name]; }; module.exports = function extend() { var options, name, src, copy, copyIsArray, clone; var target = arguments[0]; var i = 1; var length = arguments.length; var deep = false; // Handle a deep copy situation if (typeof target === 'boolean') { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { target = {}; } for (; i < length; ++i) { options = arguments[i]; // Only deal with non-null/undefined values if (options != null) { // Extend the base object for (name in options) { src = getProperty(target, name); copy = getProperty(options, name); // Prevent never-ending loop if (target !== copy) { // Recurse if we're merging plain objects or arrays if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { if (copyIsArray) { copyIsArray = false; clone = src && isArray(src) ? src : []; } else { clone = src && isPlainObject(src) ? src : {}; } // Never move original objects, clone them setProperty(target, { name: name, newValue: extend(deep, clone, copy) }); // Don't bring in undefined values } else if (typeof copy !== 'undefined') { setProperty(target, { name: name, newValue: copy }); } } } } } // Return the modified object return target; }; },{}],42:[function(require,module,exports){ module.exports = require("handlebars/runtime")["default"]; },{"handlebars/runtime":93}],43:[function(require,module,exports){ /** * lodash 3.0.0 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ /** * A specialized version of `_.forEach` for arrays without support for callback * shorthands or `this` binding. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, length = array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } module.exports = arrayEach; },{}],44:[function(require,module,exports){ /** * lodash 3.2.0 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ var baseCopy = require('lodash._basecopy'), keys = require('lodash.keys'); /** * The base implementation of `_.assign` without support for argument juggling, * multiple sources, and `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssign(object, source) { return source == null ? object : baseCopy(source, keys(source), object); } module.exports = baseAssign; },{"lodash._basecopy":45,"lodash.keys":67}],45:[function(require,module,exports){ /** * lodash 3.0.1 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property names to copy. * @param {Object} [object={}] The object to copy properties to. * @returns {Object} Returns `object`. */ function baseCopy(source, props, object) { object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; object[key] = source[key]; } return object; } module.exports = baseCopy; },{}],46:[function(require,module,exports){ /** * lodash 3.7.2 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ /** * The base implementation of `get` without support for string paths * and default values. * * @private * @param {Object} object The object to query. * @param {Array} path The path of the property to get. * @param {string} [pathKey] The key representation of path. * @returns {*} Returns the resolved value. */ function baseGet(object, path, pathKey) { if (object == null) { return; } if (pathKey !== undefined && pathKey in toObject(object)) { path = [pathKey]; } var index = 0, length = path.length; while (object != null && index < length) { object = object[path[index++]]; } return (index && index == length) ? object : undefined; } /** * Converts `value` to an object if it's not one. * * @private * @param {*} value The value to process. * @returns {Object} Returns the object. */ function toObject(value) { return isObject(value) ? value : Object(value); } /** * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(1); * // => false */ function isObject(value) { // Avoid a V8 JIT bug in Chrome 19-20. // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; return !!value && (type == 'object' || type == 'function'); } module.exports = baseGet; },{}],47:[function(require,module,exports){ /** * lodash 3.0.3 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ /** * The base implementation of `_.slice` without an iteratee call guard. * * @private * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function baseSlice(array, start, end) { var index = -1, length = array.length; start = start == null ? 0 : (+start || 0); if (start < 0) { start = -start > length ? 0 : (length + start); } end = (end === undefined || end > length) ? length : (+end || 0); if (end < 0) { end += length; } length = start > end ? 0 : ((end - start) >>> 0); start >>>= 0; var result = Array(length); while (++index < length) { result[index] = array[index + start]; } return result; } module.exports = baseSlice; },{}],48:[function(require,module,exports){ /** * lodash 3.0.1 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ /** * A specialized version of `baseCallback` which only supports `this` binding * and specifying the number of arguments to provide to `func`. * * @private * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. * @param {number} [argCount] The number of arguments to provide to `func`. * @returns {Function} Returns the callback. */ function bindCallback(func, thisArg, argCount) { if (typeof func != 'function') { return identity; } if (thisArg === undefined) { return func; } switch (argCount) { case 1: return function(value) { return func.call(thisArg, value); }; case 3: return function(value, index, collection) { return func.call(thisArg, value, index, collection); }; case 4: return function(accumulator, value, index, collection) { return func.call(thisArg, accumulator, value, index, collection); }; case 5: return function(value, other, key, object, source) { return func.call(thisArg, value, other, key, object, source); }; } return function() { return func.apply(thisArg, arguments); }; } /** * This method returns the first argument provided to it. * * @static * @memberOf _ * @category Utility * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'user': 'fred' }; * * _.identity(object) === object; * // => true */ function identity(value) { return value; } module.exports = bindCallback; },{}],49:[function(require,module,exports){ /** * lodash 3.1.1 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ var bindCallback = require('lodash._bindcallback'), isIterateeCall = require('lodash._isiterateecall'), restParam = require('lodash.restparam'); /** * Creates a function that assigns properties of source object(s) to a given * destination object. * * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return restParam(function(object, sources) { var index = -1, length = object == null ? 0 : sources.length, customizer = length > 2 ? sources[length - 2] : undefined, guard = length > 2 ? sources[2] : undefined, thisArg = length > 1 ? sources[length - 1] : undefined; if (typeof customizer == 'function') { customizer = bindCallback(customizer, thisArg, 5); length -= 2; } else { customizer = typeof thisArg == 'function' ? thisArg : undefined; length -= (customizer ? 1 : 0); } if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, customizer); } } return object; }); } module.exports = createAssigner; },{"lodash._bindcallback":48,"lodash._isiterateecall":52,"lodash.restparam":69}],50:[function(require,module,exports){ /** * lodash 3.2.0 (Custom Build) <https://lodash.com/> * Build: `lodash modularize exports="npm" -o ./` * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ var root = require('lodash._root'); /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, BIND_KEY_FLAG = 2, CURRY_BOUND_FLAG = 4, CURRY_FLAG = 8, CURRY_RIGHT_FLAG = 16, PARTIAL_FLAG = 32, PARTIAL_RIGHT_FLAG = 64, ARY_FLAG = 128, FLIP_FLAG = 512; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 1.7976931348623157e+308, NAN = 0 / 0; /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; /** `Object#toString` result references. */ var funcTag = '[object Function]', genTag = '[object GeneratorFunction]'; /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** Built-in method references without a dependency on `root`. */ var freeParseInt = parseInt; /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {...*} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { var length = args.length; switch (length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; length = length == null ? MAX_SAFE_INTEGER : length; return value > -1 && value % 1 == 0 && value < length; } /** * Replaces all `placeholder` elements in `array` with an internal placeholder * and returns an array of their indexes. * * @private * @param {Array} array The array to modify. * @param {*} placeholder The placeholder to replace. * @returns {Array} Returns the new array of placeholder indexes. */ function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = -1, result = []; while (++index < length) { if (array[index] === placeholder) { array[index] = PLACEHOLDER; result[++resIndex] = index; } } return result; } /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max, nativeMin = Math.min; /** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} prototype The object to inherit from. * @returns {Object} Returns the new object. */ var baseCreate = (function() { function object() {} return function(prototype) { if (isObject(prototype)) { object.prototype = prototype; var result = new object; object.prototype = undefined; } return result || {}; }; }()); /** * Creates an array that is the composition of partially applied arguments, * placeholders, and provided arguments into a single array of arguments. * * @private * @param {Array|Object} args The provided arguments. * @param {Array} partials The arguments to prepend to those provided. * @param {Array} holders The `partials` placeholder indexes. * @returns {Array} Returns the new array of composed arguments. */ function composeArgs(args, partials, holders) { var holdersLength = holders.length, argsIndex = -1, argsLength = nativeMax(args.length - holdersLength, 0), leftIndex = -1, leftLength = partials.length, result = Array(leftLength + argsLength); while (++leftIndex < leftLength) { result[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { result[holders[argsIndex]] = args[argsIndex]; } while (argsLength--) { result[leftIndex++] = args[argsIndex++]; } return result; } /** * This function is like `composeArgs` except that the arguments composition * is tailored for `_.partialRight`. * * @private * @param {Array|Object} args The provided arguments. * @param {Array} partials The arguments to append to those provided. * @param {Array} holders The `partials` placeholder indexes. * @returns {Array} Returns the new array of composed arguments. */ function composeArgsRight(args, partials, holders) { var holdersIndex = -1, holdersLength = holders.length, argsIndex = -1, argsLength = nativeMax(args.length - holdersLength, 0), rightIndex = -1, rightLength = partials.length, result = Array(argsLength + rightLength); while (++argsIndex < argsLength) { result[argsIndex] = args[argsIndex]; } var offset = argsIndex; while (++rightIndex < rightLength) { result[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { result[offset + holders[holdersIndex]] = args[argsIndex++]; } return result; } /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } /** * Creates a function that wraps `func` to invoke it with the optional `this` * binding of `thisArg`. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new wrapped function. */ function createBaseWrapper(func, bitmask, thisArg) { var isBind = bitmask & BIND_FLAG, Ctor = createCtorWrapper(func); function wrapper() { var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return fn.apply(isBind ? thisArg : this, arguments); } return wrapper; } /** * Creates a function that produces an instance of `Ctor` regardless of * whether it was invoked as part of a `new` expression or by `call` or `apply`. * * @private * @param {Function} Ctor The constructor to wrap. * @returns {Function} Returns the new wrapped function. */ function createCtorWrapper(Ctor) { return function() { // Use a `switch` statement to work with class constructors. // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; switch (args.length) { case 0: return new Ctor; case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args); // Mimic the constructor's `return` behavior. // See https://es5.github.io/#x13.2.2 for more details. return isObject(result) ? result : thisBinding; }; } /** * Creates a function that wraps `func` to enable currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. * @param {number} arity The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createCurryWrapper(func, bitmask, arity) { var Ctor = createCtorWrapper(func); function wrapper() { var length = arguments.length, index = length, args = Array(length), fn = (this && this !== root && this instanceof wrapper) ? Ctor : func, placeholder = wrapper.placeholder; while (index--) { args[index] = arguments[index]; } var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) ? [] : replaceHolders(args, placeholder); length -= holders.length; return length < arity ? createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, undefined, args, holders, undefined, undefined, arity - length) : apply(fn, this, args); } return wrapper; } /** * Creates a function that wraps `func` to invoke it with optional `this` * binding of `thisArg`, partial application, and currying. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [partialsRight] The arguments to append to those provided to the new function. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & ARY_FLAG, isBind = bitmask & BIND_FLAG, isBindKey = bitmask & BIND_KEY_FLAG, isCurry = bitmask & CURRY_FLAG, isCurryRight = bitmask & CURRY_RIGHT_FLAG, isFlip = bitmask & FLIP_FLAG, Ctor = isBindKey ? undefined : createCtorWrapper(func); function wrapper() { var length = arguments.length, index = length, args = Array(length); while (index--) { args[index] = arguments[index]; } if (partials) { args = composeArgs(args, partials, holders); } if (partialsRight) { args = composeArgsRight(args, partialsRight, holdersRight); } if (isCurry || isCurryRight) { var placeholder = wrapper.placeholder, argsHolders = replaceHolders(args, placeholder); length -= argsHolders.length; if (length < arity) { return createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, thisArg, args, argsHolders, argPos, ary, arity - length); } } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; if (argPos) { args = reorder(args, argPos); } else if (isFlip && args.length > 1) { args.reverse(); } if (isAry && ary < args.length) { args.length = ary; } if (this && this !== root && this instanceof wrapper) { fn = Ctor || createCtorWrapper(fn); } return fn.apply(thisBinding, args); } return wrapper; } /** * Creates a function that wraps `func` to invoke it with the optional `this` * binding of `thisArg` and the `partials` prepended to those provided to * the wrapper. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to the new function. * @returns {Function} Returns the new wrapped function. */ function createPartialWrapper(func, bitmask, thisArg, partials) { var isBind = bitmask & BIND_FLAG, Ctor = createCtorWrapper(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } return apply(fn, isBind ? thisArg : this, args); } return wrapper; } /** * Creates a function that wraps `func` to continue currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. * @param {Function} wrapFunc The function to create the `func` wrapper. * @param {*} placeholder The placeholder to replace. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & CURRY_FLAG, newArgPos = argPos ? copyArray(argPos) : undefined, newsHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials; bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); if (!(bitmask & CURRY_BOUND_FLAG)) { bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); } var result = wrapFunc(func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, arity); result.placeholder = placeholder; return result; } /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask of wrapper flags. * The bitmask may be composed of the following flags: * 1 - `_.bind` * 2 - `_.bindKey` * 4 - `_.curry` or `_.curryRight` of a bound function * 8 - `_.curry` * 16 - `_.curryRight` * 32 - `_.partial` * 64 - `_.partialRight` * 128 - `_.rearg` * 256 - `_.ary` * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to be partially applied. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & BIND_KEY_FLAG; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); partials = holders = undefined; } ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); arity = arity === undefined ? arity : toInteger(arity); length -= holders ? holders.length : 0; if (bitmask & PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined; } var newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; func = newData[0]; bitmask = newData[1]; thisArg = newData[2]; partials = newData[3]; holders = newData[4]; arity = newData[9] = newData[9] == null ? (isBindKey ? 0 : func.length) : nativeMax(newData[9] - length, 0); if (!arity && bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG)) { bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG); } if (!bitmask || bitmask == BIND_FLAG) { var result = createBaseWrapper(func, bitmask, thisArg); } else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) { result = createCurryWrapper(func, bitmask, arity); } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) { result = createPartialWrapper(func, bitmask, thisArg, partials); } else { result = createHybridWrapper.apply(undefined, newData); } return result; } /** * Reorder `array` according to the specified indexes where the element at * the first index is assigned as the first element, the element at * the second index is assigned as the second element, and so on. * * @private * @param {Array} array The array to reorder. * @param {Array} indexes The arranged array indexes. * @returns {Array} Returns `array`. */ function reorder(array, indexes) { var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array); while (length--) { var index = indexes[length]; array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; } return array; } /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 8 which returns 'object' for typed array constructors, and // PhantomJS 1.9 which returns 'function' for `NodeList` instances. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } /** * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return !!value && (type == 'object' || type == 'function'); } /** * Converts `value` to an integer. * * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). * * @static * @memberOf _ * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3'); * // => 3 */ function toInteger(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = (value < 0 ? -1 : 1); return sign * MAX_INTEGER; } var remainder = value % 1; return value === value ? (remainder ? value - remainder : value) : 0; } /** * Converts `value` to a number. * * @static * @memberOf _ * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3); * // => 3 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3'); * // => 3 */ function toNumber(value) { if (isObject(value)) { var other = isFunction(value.valueOf) ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = value.replace(reTrim, ''); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : (reIsBadHex.test(value) ? NAN : +value); } module.exports = createWrapper; },{"lodash._root":54}],51:[function(require,module,exports){ /** * lodash 3.9.1 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ /** `Object#toString` result references. */ var funcTag = '[object Function]'; /** Used to detect host constructors (Safari > 5). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** * Checks if `value` is object-like. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** Used for native method references. */ var objectProto = Object.prototype; /** Used to resolve the decompiled source of functions. */ var fnToString = Function.prototype.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objToString = objectProto.toString; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = object == null ? undefined : object[key]; return isNative(value) ? value : undefined; } /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator // in older versions of Chrome and Safari which return 'function' for regexes // and Safari 8 equivalents which return 'object' for typed array constructors. return isObject(value) && objToString.call(value) == funcTag; } /** * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(1); * // => false */ function isObject(value) { // Avoid a V8 JIT bug in Chrome 19-20. // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; return !!value && (type == 'object' || type == 'function'); } /** * Checks if `value` is a native function. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, else `false`. * @example * * _.isNative(Array.prototype.push); * // => true * * _.isNative(_); * // => false */ function isNative(value) { if (value == null) { return false; } if (isFunction(value)) { return reIsNative.test(fnToString.call(value)); } return isObjectLike(value) && reIsHostCtor.test(value); } module.exports = getNative; },{}],52:[function(require,module,exports){ /** * lodash 3.0.9 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ /** Used to detect unsigned integer values. */ var reIsUint = /^\d+$/; /** * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) * of an array-like value. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } /** * Gets the "length" property value of `object`. * * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) * that affects Safari on at least iOS 8.1-8.3 ARM64. * * @private * @param {Object} object The object to query. * @returns {*} Returns the "length" value. */ var getLength = baseProperty('length'); /** * Checks if `value` is array-like. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. */ function isArrayLike(value) { return value != null && isLength(getLength(value)); } /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; length = length == null ? MAX_SAFE_INTEGER : length; return value > -1 && value % 1 == 0 && value < length; } /** * Checks if the provided arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object)) { var other = object[index]; return value === value ? (value === other) : (other !== other); } return false; } /** * Checks if `value` is a valid array-like length. * * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(1); * // => false */ function isObject(value) { // Avoid a V8 JIT bug in Chrome 19-20. // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; return !!value && (type == 'object' || type == 'function'); } module.exports = isIterateeCall; },{}],53:[function(require,module,exports){ /** * lodash 3.0.0 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; /** * Replaces all `placeholder` elements in `array` with an internal placeholder * and returns an array of their indexes. * * @private * @param {Array} array The array to modify. * @param {*} placeholder The placeholder to replace. * @returns {Array} Returns the new array of placeholder indexes. */ function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = -1, result = []; while (++index < length) { if (array[index] === placeholder) { array[index] = PLACEHOLDER; result[++resIndex] = index; } } return result; } module.exports = replaceHolders; },{}],54:[function(require,module,exports){ (function (global){(function (){ /** * lodash 3.0.1 (Custom Build) <https://lodash.com/> * Build: `lodash modularize exports="npm" -o ./` * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ /** Used to determine if values are of the language type `Object`. */ var objectTypes = { 'function': true, 'object': true }; /** Detect free variable `exports`. */ var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : undefined; /** Detect free variable `module`. */ var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : undefined; /** Detect free variable `global` from Node.js. */ var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); /** Detect free variable `self`. */ var freeSelf = checkGlobal(objectTypes[typeof self] && self); /** Detect free variable `window`. */ var freeWindow = checkGlobal(objectTypes[typeof window] && window); /** Detect `this` as the global object. */ var thisGlobal = checkGlobal(objectTypes[typeof this] && this); /** * Used as a reference to the global object. * * The `this` value is used if it's the global object to avoid Greasemonkey's * restricted `window` object, otherwise the `window` object is used. */ var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); /** * Checks if `value` is a global object. * * @private * @param {*} value The value to check. * @returns {null|Object} Returns `value` if it's a global object, else `null`. */ function checkGlobal(value) { return (value && value.Object === Object) ? value : null; } module.exports = root; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],55:[function(require,module,exports){ /** * lodash 3.8.1 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ var isArray = require('lodash.isarray'); /** Used to match property names within property paths. */ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Converts `value` to a string if it's not one. An empty string is returned * for `null` or `undefined` values. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { return value == null ? '' : (value + ''); } /** * Converts `value` to property path array if it's not one. * * @private * @param {*} value The value to process. * @returns {Array} Returns the property path array. */ function toPath(value) { if (isArray(value)) { return value; } var result = []; baseToString(value).replace(rePropName, function(match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); }); return result; } module.exports = toPath; },{"lodash.isarray":62}],56:[function(require,module,exports){ /** * lodash 3.2.0 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ var baseAssign = require('lodash._baseassign'), createAssigner = require('lodash._createassigner'), keys = require('lodash.keys'); /** * A specialized version of `_.assign` for customizing assigned values without * support for argument juggling, multiple sources, and `this` binding `customizer` * functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {Function} customizer The function to customize assigned values. * @returns {Object} Returns `object`. */ function assignWith(object, source, customizer) { var index = -1, props = keys(source), length = props.length; while (++index < length) { var key = props[index], value = object[key], result = customizer(value, source[key], key, object, source); if ((result === result ? (result !== value) : (value === value)) || (value === undefined && !(key in object))) { object[key] = result; } } return object; } /** * Assigns own enumerable properties of source object(s) to the destination * object. Subsequent sources overwrite property assignments of previous sources. * If `customizer` is provided it is invoked to produce the assigned values. * The `customizer` is bound to `thisArg` and invoked with five arguments: * (objectValue, sourceValue, key, object, source). * * **Note:** This method mutates `object` and is based on * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign). * * @static * @memberOf _ * @alias extend * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @param {Function} [customizer] The function to customize assigned values. * @param {*} [thisArg] The `this` binding of `customizer`. * @returns {Object} Returns `object`. * @example * * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); * // => { 'user': 'fred', 'age': 40 } * * // using a customizer callback * var defaults = _.partialRight(_.assign, function(value, other) { * return _.isUndefined(value) ? other : value; * }); * * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); * // => { 'user': 'barney', 'age': 36 } */ var assign = createAssigner(function(object, source, customizer) { return customizer ? assignWith(object, source, customizer) : baseAssign(object, source); }); module.exports = assign; },{"lodash._baseassign":44,"lodash._createassigner":49,"lodash.keys":67}],57:[function(require,module,exports){ /** * lodash 3.0.3 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** * Creates a function that invokes `func`, with the `this` binding and arguments * of the created function, while it is called less than `n` times. Subsequent * calls to the created function return the result of the last `func` invocation. * * @static * @memberOf _ * @category Function * @param {number} n The number of calls at which `func` is no longer invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * jQuery('#add').on('click', _.before(5, addContactToList)); * // => allows adding up to 4 contacts to the list */ function before(n, func) { var result; if (typeof func != 'function') { if (typeof n == 'function') { var temp = n; n = func; func = temp; } else { throw new TypeError(FUNC_ERROR_TEXT); } } return function() { if (--n > 0) { result = func.apply(this, arguments); } if (n <= 1) { func = undefined; } return result; }; } module.exports = before; },{}],58:[function(require,module,exports){ /** * lodash 3.1.0 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ var createWrapper = require('lodash._createwrapper'), replaceHolders = require('lodash._replaceholders'), restParam = require('lodash.restparam'); /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, PARTIAL_FLAG = 32; /** * Creates a function that invokes `func` with the `this` binding of `thisArg` * and prepends any additional `_.bind` arguments to those provided to the * bound function. * * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. * * **Note:** Unlike native `Function#bind` this method does not set the `length` * property of bound functions. * * @static * @memberOf _ * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * var greet = function(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * }; * * var object = { 'user': 'fred' }; * * var bound = _.bind(greet, object, 'hi'); * bound('!'); * // => 'hi fred!' * * // using placeholders * var bound = _.bind(greet, object, _, '!'); * bound('hi'); * // => 'hi fred!' */ var bind = restParam(function(func, thisArg, partials) { var bitmask = BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, bind.placeholder); bitmask |= PARTIAL_FLAG; } return createWrapper(func, bitmask, thisArg, partials, holders); }); // Assign default placeholders. bind.placeholder = {}; module.exports = bind; },{"lodash._createwrapper":50,"lodash._replaceholders":53,"lodash.restparam":69}],59:[function(require,module,exports){ /** * lodash 3.0.3 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ var arrayEach = require('lodash._arrayeach'), baseEach = require('lodash._baseeach'), bindCallback = require('lodash._bindcallback'), isArray = require('lodash.isarray'); /** * Creates a function for `_.forEach` or `_.forEachRight`. * * @private * @param {Function} arrayFunc The function to iterate over an array. * @param {Function} eachFunc The function to iterate over a collection. * @returns {Function} Returns the new each function. */ function createForEach(arrayFunc, eachFunc) { return function(collection, iteratee, thisArg) { return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee) : eachFunc(collection, bindCallback(iteratee, thisArg, 3)); }; } /** * Iterates over elements of `collection` invoking `iteratee` for each element. * The `iteratee` is bound to `thisArg` and invoked with three arguments: * (value, index|key, collection). Iteratee functions may exit iteration early * by explicitly returning `false`. * * **Note:** As with other "Collections" methods, objects with a "length" property * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` * may be used for object iteration. * * @static * @memberOf _ * @alias each * @category Collection * @param {Array|Object|string} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [thisArg] The `this` binding of `iteratee`. * @returns {Array|Object|string} Returns `collection`. * @example * * _([1, 2]).forEach(function(n) { * console.log(n); * }).value(); * // => logs each value from left to right and returns the array * * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { * console.log(n, key); * }); * // => logs each value-key pair and returns the object (iteration order is not guaranteed) */ var forEach = createForEach(arrayEach, baseEach); module.exports = forEach; },{"lodash._arrayeach":43,"lodash._baseeach":60,"lodash._bindcallback":48,"lodash.isarray":62}],60:[function(require,module,exports){ /** * lodash 3.0.4 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ var keys = require('lodash.keys'); /** * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) * of an array-like value. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * The base implementation of `_.forEach` without support for callback * shorthands and `this` binding. * * @private * @param {Array|Object|string} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object|string} Returns `collection`. */ var baseEach = createBaseEach(baseForOwn); /** * The base implementation of `baseForIn` and `baseForOwn` which iterates * over `object` properties returned by `keysFunc` invoking `iteratee` for * each property. Iteratee functions may exit iteration early by explicitly * returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = createBaseFor(); /** * The base implementation of `_.forOwn` without support for callback * shorthands and `this` binding. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { return baseFor(object, iteratee, keys); } /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } /** * Creates a `baseEach` or `baseEachRight` function. * * @private * @param {Function} eachFunc The function to iterate over a collection. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { var length = collection ? getLength(collection) : 0; if (!isLength(length)) { return eachFunc(collection, iteratee); } var index = fromRight ? length : -1, iterable = toObject(collection); while ((fromRight ? index-- : ++index < length)) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } /** * Creates a base function for `_.forIn` or `_.forInRight`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var iterable = toObject(object), props = keysFunc(object), length = props.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length)) { var key = props[index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } /** * Gets the "length" property value of `object`. * * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) * that affects Safari on at least iOS 8.1-8.3 ARM64. * * @private * @param {Object} object The object to query. * @returns {*} Returns the "length" value. */ var getLength = baseProperty('length'); /** * Checks if `value` is a valid array-like length. * * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Converts `value` to an object if it's not one. * * @private * @param {*} value The value to process. * @returns {Object} Returns the object. */ function toObject(value) { return isObject(value) ? value : Object(value); } /** * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(1); * // => false */ function isObject(value) { // Avoid a V8 JIT bug in Chrome 19-20. // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; return !!value && (type == 'object' || type == 'function'); } module.exports = baseEach; },{"lodash.keys":67}],61:[function(require,module,exports){ /** * lodash (Custom Build) <https://lodash.com/> * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors <https://jquery.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** Built-in value references. */ var propertyIsEnumerable = objectProto.propertyIsEnumerable; /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ function isArguments(value) { // Safari 8.1 makes `arguments.callee` enumerable in strict mode. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); } /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 8-9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return !!value && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return !!value && typeof value == 'object'; } module.exports = isArguments; },{}],62:[function(require,module,exports){ /** * lodash 3.0.4 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ /** `Object#toString` result references. */ var arrayTag = '[object Array]', funcTag = '[object Function]'; /** Used to detect host constructors (Safari > 5). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** * Checks if `value` is object-like. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** Used for native method references. */ var objectProto = Object.prototype; /** Used to resolve the decompiled source of functions. */ var fnToString = Function.prototype.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objToString = objectProto.toString; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /* Native method references for those with the same name as other `lodash` methods. */ var nativeIsArray = getNative(Array, 'isArray'); /** * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) * of an array-like value. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = object == null ? undefined : object[key]; return isNative(value) ? value : undefined; } /** * Checks if `value` is a valid array-like length. * * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(function() { return arguments; }()); * // => false */ var isArray = nativeIsArray || function(value) { return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; }; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator // in older versions of Chrome and Safari which return 'function' for regexes // and Safari 8 equivalents which return 'object' for typed array constructors. return isObject(value) && objToString.call(value) == funcTag; } /** * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(1); * // => false */ function isObject(value) { // Avoid a V8 JIT bug in Chrome 19-20. // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; return !!value && (type == 'object' || type == 'function'); } /** * Checks if `value` is a native function. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, else `false`. * @example * * _.isNative(Array.prototype.push); * // => true * * _.isNative(_); * // => false */ function isNative(value) { if (value == null) { return false; } if (isFunction(value)) { return reIsNative.test(fnToString.call(value)); } return isObjectLike(value) && reIsHostCtor.test(value); } module.exports = isArray; },{}],63:[function(require,module,exports){ /** * lodash 3.0.4 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ var isArguments = require('lodash.isarguments'), isArray = require('lodash.isarray'), isFunction = require('lodash.isfunction'), isString = require('lodash.isstring'), keys = require('lodash.keys'); /** * Checks if `value` is object-like. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) * of an array-like value. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } /** * Gets the "length" property value of `object`. * * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) * that affects Safari on at least iOS 8.1-8.3 ARM64. * * @private * @param {Object} object The object to query. * @returns {*} Returns the "length" value. */ var getLength = baseProperty('length'); /** * Checks if `value` is array-like. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. */ function isArrayLike(value) { return value != null && isLength(getLength(value)); } /** * Checks if `value` is a valid array-like length. * * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is empty. A value is considered empty unless it is an * `arguments` object, array, string, or jQuery-like collection with a length * greater than `0` or an object with own enumerable properties. * * @static * @memberOf _ * @category Lang * @param {Array|Object|string} value The value to inspect. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * _.isEmpty(null); * // => true * * _.isEmpty(true); * // => true * * _.isEmpty(1); * // => true * * _.isEmpty([1, 2, 3]); * // => false * * _.isEmpty({ 'a': 1 }); * // => false */ function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) || (isObjectLike(value) && isFunction(value.splice)))) { return !value.length; } return !keys(value).length; } module.exports = isEmpty; },{"lodash.isarguments":61,"lodash.isarray":62,"lodash.isfunction":64,"lodash.isstring":66,"lodash.keys":67}],64:[function(require,module,exports){ (function (global){(function (){ /** * Lodash (Custom Build) <https://lodash.com/> * Build: `lodash modularize exports="npm" -o ./` * Copyright JS Foundation and other contributors <https://js.foundation/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** `Object#toString` result references. */ var asyncTag = '[object AsyncFunction]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', nullTag = '[object Null]', proxyTag = '[object Proxy]', undefinedTag = '[object Undefined]'; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Built-in value references. */ var Symbol = root.Symbol, symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); } /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } module.exports = isFunction; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],65:[function(require,module,exports){ /** * lodash 3.0.5 (Custom Build) <https://lodash.com/> * Build: `lodash modularize exports="npm" -o ./` * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ /** `Object#toString` result references. */ var regexpTag = '[object RegExp]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return !!value && (type == 'object' || type == 'function'); } /** * Checks if `value` is classified as a `RegExp` object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isRegExp(/abc/); * // => true * * _.isRegExp('/abc/'); * // => false */ function isRegExp(value) { return isObject(value) && objectToString.call(value) == regexpTag; } module.exports = isRegExp; },{}],66:[function(require,module,exports){ /** * lodash 3.0.1 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ /** `Object#toString` result references. */ var stringTag = '[object String]'; /** * Checks if `value` is object-like. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** Used for native method references. */ var objectProto = Object.prototype; /** * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) * of values. */ var objToString = objectProto.toString; /** * Checks if `value` is classified as a `String` primitive or object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isString('abc'); * // => true * * _.isString(1); * // => false */ function isString(value) { return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag); } module.exports = isString; },{}],67:[function(require,module,exports){ /** * lodash 3.1.2 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ var getNative = require('lodash._getnative'), isArguments = require('lodash.isarguments'), isArray = require('lodash.isarray'); /** Used to detect unsigned integer values. */ var reIsUint = /^\d+$/; /** Used for native method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /* Native method references for those with the same name as other `lodash` methods. */ var nativeKeys = getNative(Object, 'keys'); /** * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) * of an array-like value. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } /** * Gets the "length" property value of `object`. * * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) * that affects Safari on at least iOS 8.1-8.3 ARM64. * * @private * @param {Object} object The object to query. * @returns {*} Returns the "length" value. */ var getLength = baseProperty('length'); /** * Checks if `value` is array-like. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. */ function isArrayLike(value) { return value != null && isLength(getLength(value)); } /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; length = length == null ? MAX_SAFE_INTEGER : length; return value > -1 && value % 1 == 0 && value < length; } /** * Checks if `value` is a valid array-like length. * * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * A fallback implementation of `Object.keys` which creates an array of the * own enumerable property names of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function shimKeys(object) { var props = keysIn(object), propsLength = props.length, length = propsLength && object.length; var allowIndexes = !!length && isLength(length) && (isArray(object) || isArguments(object)); var index = -1, result = []; while (++index < propsLength) { var key = props[index]; if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { result.push(key); } } return result; } /** * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(1); * // => false */ function isObject(value) { // Avoid a V8 JIT bug in Chrome 19-20. // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; return !!value && (type == 'object' || type == 'function'); } /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * for more details. * * @static * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */ var keys = !nativeKeys ? shimKeys : function(object) { var Ctor = object == null ? undefined : object.constructor; if ((typeof Ctor == 'function' && Ctor.prototype === object) || (typeof object != 'function' && isArrayLike(object))) { return shimKeys(object); } return isObject(object) ? nativeKeys(object) : []; }; /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { if (object == null) { return []; } if (!isObject(object)) { object = Object(object); } var length = object.length; length = (length && isLength(length) && (isArray(object) || isArguments(object)) && length) || 0; var Ctor = object.constructor, index = -1, isProto = typeof Ctor == 'function' && Ctor.prototype === object, result = Array(length), skipIndexes = length > 0; while (++index < length) { result[index] = (index + ''); } for (var key in object) { if (!(skipIndexes && isIndex(key, length)) && !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } return result; } module.exports = keys; },{"lodash._getnative":51,"lodash.isarguments":61,"lodash.isarray":62}],68:[function(require,module,exports){ /** * lodash 3.0.1 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ var before = require('lodash.before'); /** * Creates a function that is restricted to invoking `func` once. Repeat calls * to the function return the value of the first call. The `func` is invoked * with the `this` binding and arguments of the created function. * * @static * @memberOf _ * @category Function * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var initialize = _.once(createApplication); * initialize(); * initialize(); * // `initialize` invokes `createApplication` once */ function once(func) { return before(2, func); } module.exports = once; },{"lodash.before":57}],69:[function(require,module,exports){ /** * lodash 3.6.1 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; /* Native method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * Creates a function that invokes `func` with the `this` binding of the * created function and arguments from `start` and beyond provided as an array. * * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). * * @static * @memberOf _ * @category Function * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. * @example * * var say = _.restParam(function(what, names) { * return what + ' ' + _.initial(names).join(', ') + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); * }); * * say('hello', 'fred', 'barney', 'pebbles'); * // => 'hello fred, barney, & pebbles' */ function restParam(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), rest = Array(length); while (++index < length) { rest[index] = args[start + index]; } switch (start) { case 0: return func.call(this, rest); case 1: return func.call(this, args[0], rest); case 2: return func.call(this, args[0], args[1], rest); } var otherArgs = Array(start + 1); index = -1; while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = rest; return func.apply(this, otherArgs); }; } module.exports = restParam; },{}],70:[function(require,module,exports){ /** * lodash 3.1.2 (Custom Build) <https://lodash.com/> * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ var baseGet = require('lodash._baseget'), baseSlice = require('lodash._baseslice'), toPath = require('lodash._topath'), isArray = require('lodash.isarray'), isFunction = require('lodash.isfunction'); /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { var type = typeof value; if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { return true; } if (isArray(value)) { return false; } var result = !reIsDeepProp.test(value); return result || (object != null && value in toObject(object)); } /** * Converts `value` to an object if it's not one. * * @private * @param {*} value The value to process. * @returns {Object} Returns the object. */ function toObject(value) { return isObject(value) ? value : Object(value); } /** * Gets the last element of `array`. * * @static * @memberOf _ * @category Array * @param {Array} array The array to query. * @returns {*} Returns the last element of `array`. * @example * * _.last([1, 2, 3]); * // => 3 */ function last(array) { var length = array ? array.length : 0; return length ? array[length - 1] : undefined; } /** * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(1); * // => false */ function isObject(value) { // Avoid a V8 JIT bug in Chrome 19-20. // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; return !!value && (type == 'object' || type == 'function'); } /** * This method is like `_.get` except that if the resolved value is a function * it is invoked with the `this` binding of its parent object and its result * is returned. * * @static * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to resolve. * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; * * _.result(object, 'a[0].b.c1'); * // => 3 * * _.result(object, 'a[0].b.c2'); * // => 4 * * _.result(object, 'a.b.c', 'default'); * // => 'default' * * _.result(object, 'a.b.c', _.constant('default')); * // => 'default' */ function result(object, path, defaultValue) { var result = object == null ? undefined : object[path]; if (result === undefined) { if (object != null && !isKey(path, object)) { path = toPath(path); object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); result = object == null ? undefined : object[last(path)]; } result = result === undefined ? defaultValue : result; } return isFunction(result) ? result.call(object) : result; } module.exports = result; },{"lodash._baseget":46,"lodash._baseslice":47,"lodash._topath":55,"lodash.isarray":62,"lodash.isfunction":64}],71:[function(require,module,exports){ /** * lodash 3.2.0 (Custom Build) <https://lodash.com/> * Build: `lodash modularize exports="npm" -o ./` * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <https://lodash.com/license> */ var root = require('lodash._root'); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** `Object#toString` result references. */ var symbolTag = '[object Symbol]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to generate unique IDs. */ var idCounter = 0; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** Built-in value references. */ var Symbol = root.Symbol; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolToString = Symbol ? symbolProto.toString : undefined; /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike(value) && objectToString.call(value) == symbolTag); } /** * Converts `value` to a string if it's not one. An empty string is returned * for `null` and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @category Lang * @param {*} value The value to process. * @returns {string} Returns the string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (value == null) { return ''; } if (isSymbol(value)) { return Symbol ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * Generates a unique ID. If `prefix` is provided the ID is appended to it. * * @static * @memberOf _ * @category Util * @param {string} [prefix] The value to prefix the ID with. * @returns {string} Returns the unique ID. * @example * * _.uniqueId('contact_'); * // => 'contact_104' * * _.uniqueId(); * // => '105' */ function uniqueId(prefix) { var id = ++idCounter; return toString(prefix) + id; } module.exports = uniqueId; },{"lodash._root":54}],72:[function(require,module,exports){ (function(window) { var re = { not_string: /[^s]/, number: /[diefg]/, json: /[j]/, not_json: /[^j]/, text: /^[^\x25]+/, modulo: /^\x25{2}/, placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/, key: /^([a-z_][a-z_\d]*)/i, key_access: /^\.([a-z_][a-z_\d]*)/i, index_access: /^\[(\d+)\]/, sign: /^[\+\-]/ } function sprintf() { var key = arguments[0], cache = sprintf.cache if (!(cache[key] && cache.hasOwnProperty(key))) { cache[key] = sprintf.parse(key) } return sprintf.format.call(null, cache[key], arguments) } sprintf.format = function(parse_tree, argv) { var cursor = 1, tree_length = parse_tree.length, node_type = "", arg, output = [], i, k, match, pad, pad_character, pad_length, is_positive = true, sign = "" for (i = 0; i < tree_length; i++) { node_type = get_type(parse_tree[i]) if (node_type === "string") { output[output.length] = parse_tree[i] } else if (node_type === "array") { match = parse_tree[i] // convenience purposes only if (match[2]) { // keyword argument arg = argv[cursor] for (k = 0; k < match[2].length; k++) { if (!arg.hasOwnProperty(match[2][k])) { throw new Error(sprintf("[sprintf] property '%s' does not exist", match[2][k])) } arg = arg[match[2][k]] } } else if (match[1]) { // positional argument (explicit) arg = argv[match[1]] } else { // positional argument (implicit) arg = argv[cursor++] } if (get_type(arg) == "function") { arg = arg() } if (re.not_string.test(match[8]) && re.not_json.test(match[8]) && (get_type(arg) != "number" && isNaN(arg))) { throw new TypeError(sprintf("[sprintf] expecting number but found %s", get_type(arg))) } if (re.number.test(match[8])) { is_positive = arg >= 0 } switch (match[8]) { case "b": arg = arg.toString(2) break case "c": arg = String.fromCharCode(arg) break case "d": case "i": arg = parseInt(arg, 10) break case "j": arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0) break case "e": arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential() break case "f": arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg) break case "g": arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg) break case "o": arg = arg.toString(8) break case "s": arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg) break case "u": arg = arg >>> 0 break case "x": arg = arg.toString(16) break case "X": arg = arg.toString(16).toUpperCase() break } if (re.json.test(match[8])) { output[output.length] = arg } else { if (re.number.test(match[8]) && (!is_positive || match[3])) { sign = is_positive ? "+" : "-" arg = arg.toString().replace(re.sign, "") } else { sign = "" } pad_character = match[4] ? match[4] === "0" ? "0" : match[4].charAt(1) : " " pad_length = match[6] - (sign + arg).length pad = match[6] ? (pad_length > 0 ? str_repeat(pad_character, pad_length) : "") : "" output[output.length] = match[5] ? sign + arg + pad : (pad_character === "0" ? sign + pad + arg : pad + sign + arg) } } } return output.join("") } sprintf.cache = {} sprintf.parse = function(fmt) { var _fmt = fmt, match = [], parse_tree = [], arg_names = 0 while (_fmt) { if ((match = re.text.exec(_fmt)) !== null) { parse_tree[parse_tree.length] = match[0] } else if ((match = re.modulo.exec(_fmt)) !== null) { parse_tree[parse_tree.length] = "%" } else if ((match = re.placeholder.exec(_fmt)) !== null) { if (match[2]) { arg_names |= 1 var field_list = [], replacement_field = match[2], field_match = [] if ((field_match = re.key.exec(replacement_field)) !== null) { field_list[field_list.length] = field_match[1] while ((replacement_field = replacement_field.substring(field_match[0].length)) !== "") { if ((field_match = re.key_access.exec(replacement_field)) !== null) { field_list[field_list.length] = field_match[1] } else if ((field_match = re.index_access.exec(replacement_field)) !== null) { field_list[field_list.length] = field_match[1] } else { throw new SyntaxError("[sprintf] failed to parse named argument key") } } } else { throw new SyntaxError("[sprintf] failed to parse named argument key") } match[2] = field_list } else { arg_names |= 2 } if (arg_names === 3) { throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported") } parse_tree[parse_tree.length] = match } else { throw new SyntaxError("[sprintf] unexpected placeholder") } _fmt = _fmt.substring(match[0].length) } return parse_tree } var vsprintf = function(fmt, argv, _argv) { _argv = (argv || []).slice(0) _argv.splice(0, 0, fmt) return sprintf.apply(null, _argv) } /** * helpers */ function get_type(variable) { return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase() } function str_repeat(input, multiplier) { return Array(multiplier + 1).join(input) } /** * export to either browser or node.js */ if (typeof exports !== "undefined") { exports.sprintf = sprintf exports.vsprintf = vsprintf } else { window.sprintf = sprintf window.vsprintf = vsprintf if (typeof define === "function" && define.amd) { define(function() { return { sprintf: sprintf, vsprintf: vsprintf } }) } } })(typeof window === "undefined" ? this : window); },{}],73:[function(require,module,exports){ module.exports = function(func) { setTimeout(func, 0); }; },{}],74:[function(require,module,exports){ var checkEmpty = function(locationData) { if(! locationData || locationData.trim().length === 0 ) { return null; } return locationData; }; var parseJsonLocationData = function(jsonLocationDataEl) { if(!jsonLocationDataEl) { return {address: {}}; } return JSON.parse(jsonLocationDataEl.textContent); }; var getEmbedKey = function(locationDataEl) { if(!locationDataEl) { return ''; } return locationDataEl.getAttribute('data-embed-key'); }; var formatHours = function(hoursData) { if (! hoursData || hoursData.length === 0) { return null; } var hoursArray = hoursData.map(function(day) { var daySplat = day.split(' '); var dayAbbrev = daySplat[0]; var openCloseSplat = daySplat[1].split('-'); return { day: dayAbbrev, open: openCloseSplat[0], close: openCloseSplat[1] }; }); return hoursArray.reduce(function(accumulatedDayObject, dayObject) { accumulatedDayObject[dayObject.day] = { open: dayObject.open, close: dayObject.close }; return accumulatedDayObject; }, {}); }; var initializeSiteLocation = function(siteLocation, locationDataID) { var initializeHelper = function() { var locationDataEl = document.getElementById(locationDataID); var embedAPIKey = getEmbedKey(locationDataEl); var jsonld = parseJsonLocationData(locationDataEl); var hoursObject, locationData, address, city, state, zipcode, country; address = checkEmpty(jsonld.address.streetAddress); city = checkEmpty(jsonld.address.addressLocality); state = checkEmpty(jsonld.address.addressRegion); zipcode = checkEmpty(jsonld.address.postalCode); country = checkEmpty(jsonld.address.addressCountry); hoursObject = formatHours(jsonld.openingHours); if(address || city || state || zipcode || country) { locationData = { address: address, city: city, state: state, zipcode: zipcode, country: country }; } var cleintWidth = document.documentElement.clientWidth; var innerWidth = window.innerWidth || 0; var viewportWidth = Math.max(cleintWidth, innerWidth); var lang = document.body.lang || 'en'; /* Only initialize the sitelocation view if the viewport is smaller than * 736 pixels. */ if(viewportWidth <= 736) { siteLocation.initialize({ lang: lang, hours: hoursObject, phone: checkEmpty(jsonld.telephone), location: locationData, embedAPIKey: embedAPIKey }); } }; return initializeHelper; }; module.exports = initializeSiteLocation; },{}],75:[function(require,module,exports){ 'use strict'; exports.__esModule = true; // istanbul ignore next function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } // istanbul ignore next function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } var _handlebarsBase = require('./handlebars/base'); var base = _interopRequireWildcard(_handlebarsBase); // Each of these augment the Handlebars object. No need to setup here. // (This is done to easily share code between commonjs and browse envs) var _handlebarsSafeString = require('./handlebars/safe-string'); var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString); var _handlebarsException = require('./handlebars/exception'); var _handlebarsException2 = _interopRequireDefault(_handlebarsException); var _handlebarsUtils = require('./handlebars/utils'); var Utils = _interopRequireWildcard(_handlebarsUtils); var _handlebarsRuntime = require('./handlebars/runtime'); var runtime = _interopRequireWildcard(_handlebarsRuntime); var _handlebarsNoConflict = require('./handlebars/no-conflict'); var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict); // For compatibility and usage outside of module systems, make the Handlebars object a namespace function create() { var hb = new base.HandlebarsEnvironment(); Utils.extend(hb, base); hb.SafeString = _handlebarsSafeString2['default']; hb.Exception = _handlebarsException2['default']; hb.Utils = Utils; hb.escapeExpression = Utils.escapeExpression; hb.VM = runtime; hb.template = function (spec) { return runtime.template(spec, hb); }; return hb; } var inst = create(); inst.create = create; _handlebarsNoConflict2['default'](inst); inst['default'] = inst; exports['default'] = inst; module.exports = exports['default']; },{"./handlebars/base":76,"./handlebars/exception":79,"./handlebars/no-conflict":89,"./handlebars/runtime":90,"./handlebars/safe-string":91,"./handlebars/utils":92}],76:[function(require,module,exports){ 'use strict'; exports.__esModule = true; exports.HandlebarsEnvironment = HandlebarsEnvironment; // istanbul ignore next function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _utils = require('./utils'); var _exception = require('./exception'); var _exception2 = _interopRequireDefault(_exception); var _helpers = require('./helpers'); var _decorators = require('./decorators'); var _logger = require('./logger'); var _logger2 = _interopRequireDefault(_logger); var VERSION = '4.0.14'; exports.VERSION = VERSION; var COMPILER_REVISION = 7; exports.COMPILER_REVISION = COMPILER_REVISION; var REVISION_CHANGES = { 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it 2: '== 1.0.0-rc.3', 3: '== 1.0.0-rc.4', 4: '== 1.x.x', 5: '== 2.0.0-alpha.x', 6: '>= 2.0.0-beta.1', 7: '>= 4.0.0' }; exports.REVISION_CHANGES = REVISION_CHANGES; var objectType = '[object Object]'; function HandlebarsEnvironment(helpers, partials, decorators) { this.helpers = helpers || {}; this.partials = partials || {}; this.decorators = decorators || {}; _helpers.registerDefaultHelpers(this); _decorators.registerDefaultDecorators(this); } HandlebarsEnvironment.prototype = { constructor: HandlebarsEnvironment, logger: _logger2['default'], log: _logger2['default'].log, registerHelper: function registerHelper(name, fn) { if (_utils.toString.call(name) === objectType) { if (fn) { throw new _exception2['default']('Arg not supported with multiple helpers'); } _utils.extend(this.helpers, name); } else { this.helpers[name] = fn; } }, unregisterHelper: function unregisterHelper(name) { delete this.helpers[name]; }, registerPartial: function registerPartial(name, partial) { if (_utils.toString.call(name) === objectType) { _utils.extend(this.partials, name); } else { if (typeof partial === 'undefined') { throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined'); } this.partials[name] = partial; } }, unregisterPartial: function unregisterPartial(name) { delete this.partials[name]; }, registerDecorator: function registerDecorator(name, fn) { if (_utils.toString.call(name) === objectType) { if (fn) { throw new _exception2['default']('Arg not supported with multiple decorators'); } _utils.extend(this.decorators, name); } else { this.decorators[name] = fn; } }, unregisterDecorator: function unregisterDecorator(name) { delete this.decorators[name]; } }; var log = _logger2['default'].log; exports.log = log; exports.createFrame = _utils.createFrame; exports.logger = _logger2['default']; },{"./decorators":77,"./exception":79,"./helpers":80,"./logger":88,"./utils":92}],77:[function(require,module,exports){ 'use strict'; exports.__esModule = true; exports.registerDefaultDecorators = registerDefaultDecorators; // istanbul ignore next function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _decoratorsInline = require('./decorators/inline'); var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline); function registerDefaultDecorators(instance) { _decoratorsInline2['default'](instance); } },{"./decorators/inline":78}],78:[function(require,module,exports){ 'use strict'; exports.__esModule = true; var _utils = require('../utils'); exports['default'] = function (instance) { instance.registerDecorator('inline', function (fn, props, container, options) { var ret = fn; if (!props.partials) { props.partials = {}; ret = function (context, options) { // Create a new partials stack frame prior to exec. var original = container.partials; container.partials = _utils.extend({}, original, props.partials); var ret = fn(context, options); container.partials = original; return ret; }; } props.partials[options.args[0]] = options.fn; return ret; }); }; module.exports = exports['default']; },{"../utils":92}],79:[function(require,module,exports){ 'use strict'; exports.__esModule = true; var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; function Exception(message, node) { var loc = node && node.loc, line = undefined, column = undefined; if (loc) { line = loc.start.line; column = loc.start.column; message += ' - ' + line + ':' + column; } var tmp = Error.prototype.constructor.call(this, message); // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. for (var idx = 0; idx < errorProps.length; idx++) { this[errorProps[idx]] = tmp[errorProps[idx]]; } /* istanbul ignore else */ if (Error.captureStackTrace) { Error.captureStackTrace(this, Exception); } try { if (loc) { this.lineNumber = line; // Work around issue under safari where we can't directly set the column value /* istanbul ignore next */ if (Object.defineProperty) { Object.defineProperty(this, 'column', { value: column, enumerable: true }); } else { this.column = column; } } } catch (nop) { /* Ignore if the browser is very particular */ } } Exception.prototype = new Error(); exports['default'] = Exception; module.exports = exports['default']; },{}],80:[function(require,module,exports){ 'use strict'; exports.__esModule = true; exports.registerDefaultHelpers = registerDefaultHelpers; // istanbul ignore next function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _helpersBlockHelperMissing = require('./helpers/block-helper-missing'); var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing); var _helpersEach = require('./helpers/each'); var _helpersEach2 = _interopRequireDefault(_helpersEach); var _helpersHelperMissing = require('./helpers/helper-missing'); var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing); var _helpersIf = require('./helpers/if'); var _helpersIf2 = _interopRequireDefault(_helpersIf); var _helpersLog = require('./helpers/log'); var _helpersLog2 = _interopRequireDefault(_helpersLog); var _helpersLookup = require('./helpers/lookup'); var _helpersLookup2 = _interopRequireDefault(_helpersLookup); var _helpersWith = require('./helpers/with'); var _helpersWith2 = _interopRequireDefault(_helpersWith); function registerDefaultHelpers(instance) { _helpersBlockHelperMissing2['default'](instance); _helpersEach2['default'](instance); _helpersHelperMissing2['default'](instance); _helpersIf2['default'](instance); _helpersLog2['default'](instance); _helpersLookup2['default'](instance); _helpersWith2['default'](instance); } },{"./helpers/block-helper-missing":81,"./helpers/each":82,"./helpers/helper-missing":83,"./helpers/if":84,"./helpers/log":85,"./helpers/lookup":86,"./helpers/with":87}],81:[function(require,module,exports){ 'use strict'; exports.__esModule = true; var _utils = require('../utils'); exports['default'] = function (instance) { instance.registerHelper('blockHelperMissing', function (context, options) { var inverse = options.inverse, fn = options.fn; if (context === true) { return fn(this); } else if (context === false || context == null) { return inverse(this); } else if (_utils.isArray(context)) { if (context.length > 0) { if (options.ids) { options.ids = [options.name]; } return instance.helpers.each(context, options); } else { return inverse(this); } } else { if (options.data && options.ids) { var data = _utils.createFrame(options.data); data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name); options = { data: data }; } return fn(context, options); } }); }; module.exports = exports['default']; },{"../utils":92}],82:[function(require,module,exports){ 'use strict'; exports.__esModule = true; // istanbul ignore next function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _utils = require('../utils'); var _exception = require('../exception'); var _exception2 = _interopRequireDefault(_exception); exports['default'] = function (instance) { instance.registerHelper('each', function (context, options) { if (!options) { throw new _exception2['default']('Must pass iterator to #each'); } var fn = options.fn, inverse = options.inverse, i = 0, ret = '', data = undefined, contextPath = undefined; if (options.data && options.ids) { contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; } if (_utils.isFunction(context)) { context = context.call(this); } if (options.data) { data = _utils.createFrame(options.data); } function execIteration(field, index, last) { if (data) { data.key = field; data.index = index; data.first = index === 0; data.last = !!last; if (contextPath) { data.contextPath = contextPath + field; } } ret = ret + fn(context[field], { data: data, blockParams: _utils.blockParams([context[field], field], [contextPath + field, null]) }); } if (context && typeof context === 'object') { if (_utils.isArray(context)) { for (var j = context.length; i < j; i++) { if (i in context) { execIteration(i, i, i === context.length - 1); } } } else { var priorKey = undefined; for (var key in context) { if (context.hasOwnProperty(key)) { // We're running the iterations one step out of sync so we can detect // the last iteration without have to scan the object twice and create // an itermediate keys array. if (priorKey !== undefined) { execIteration(priorKey, i - 1); } priorKey = key; i++; } } if (priorKey !== undefined) { execIteration(priorKey, i - 1, true); } } } if (i === 0) { ret = inverse(this); } return ret; }); }; module.exports = exports['default']; },{"../exception":79,"../utils":92}],83:[function(require,module,exports){ 'use strict'; exports.__esModule = true; // istanbul ignore next function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _exception = require('../exception'); var _exception2 = _interopRequireDefault(_exception); exports['default'] = function (instance) { instance.registerHelper('helperMissing', function () /* [args, ]options */{ if (arguments.length === 1) { // A missing field in a {{foo}} construct. return undefined; } else { // Someone is actually trying to call something, blow up. throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); } }); }; module.exports = exports['default']; },{"../exception":79}],84:[function(require,module,exports){ 'use strict'; exports.__esModule = true; var _utils = require('../utils'); exports['default'] = function (instance) { instance.registerHelper('if', function (conditional, options) { if (_utils.isFunction(conditional)) { conditional = conditional.call(this); } // Default behavior is to render the positive path if the value is truthy and not empty. // The `includeZero` option may be set to treat the condtional as purely not empty based on the // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) { return options.inverse(this); } else { return options.fn(this); } }); instance.registerHelper('unless', function (conditional, options) { return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash }); }); }; module.exports = exports['default']; },{"../utils":92}],85:[function(require,module,exports){ 'use strict'; exports.__esModule = true; exports['default'] = function (instance) { instance.registerHelper('log', function () /* message, options */{ var args = [undefined], options = arguments[arguments.length - 1]; for (var i = 0; i < arguments.length - 1; i++) { args.push(arguments[i]); } var level = 1; if (options.hash.level != null) { level = options.hash.level; } else if (options.data && options.data.level != null) { level = options.data.level; } args[0] = level; instance.log.apply(instance, args); }); }; module.exports = exports['default']; },{}],86:[function(require,module,exports){ 'use strict'; exports.__esModule = true; exports['default'] = function (instance) { instance.registerHelper('lookup', function (obj, field) { if (!obj) { return obj; } if (field === 'constructor' && !obj.propertyIsEnumerable(field)) { return undefined; } return obj[field]; }); }; module.exports = exports['default']; },{}],87:[function(require,module,exports){ 'use strict'; exports.__esModule = true; var _utils = require('../utils'); exports['default'] = function (instance) { instance.registerHelper('with', function (context, options) { if (_utils.isFunction(context)) { context = context.call(this); } var fn = options.fn; if (!_utils.isEmpty(context)) { var data = options.data; if (options.data && options.ids) { data = _utils.createFrame(options.data); data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]); } return fn(context, { data: data, blockParams: _utils.blockParams([context], [data && data.contextPath]) }); } else { return options.inverse(this); } }); }; module.exports = exports['default']; },{"../utils":92}],88:[function(require,module,exports){ 'use strict'; exports.__esModule = true; var _utils = require('./utils'); var logger = { methodMap: ['debug', 'info', 'warn', 'error'], level: 'info', // Maps a given level value to the `methodMap` indexes above. lookupLevel: function lookupLevel(level) { if (typeof level === 'string') { var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase()); if (levelMap >= 0) { level = levelMap; } else { level = parseInt(level, 10); } } return level; }, // Can be overridden in the host environment log: function log(level) { level = logger.lookupLevel(level); if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) { var method = logger.methodMap[level]; if (!console[method]) { // eslint-disable-line no-console method = 'log'; } for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { message[_key - 1] = arguments[_key]; } console[method].apply(console, message); // eslint-disable-line no-console } } }; exports['default'] = logger; module.exports = exports['default']; },{"./utils":92}],89:[function(require,module,exports){ (function (global){(function (){ /* global window */ 'use strict'; exports.__esModule = true; exports['default'] = function (Handlebars) { /* istanbul ignore next */ var root = typeof global !== 'undefined' ? global : window, $Handlebars = root.Handlebars; /* istanbul ignore next */ Handlebars.noConflict = function () { if (root.Handlebars === Handlebars) { root.Handlebars = $Handlebars; } return Handlebars; }; }; module.exports = exports['default']; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],90:[function(require,module,exports){ 'use strict'; exports.__esModule = true; exports.checkRevision = checkRevision; exports.template = template; exports.wrapProgram = wrapProgram; exports.resolvePartial = resolvePartial; exports.invokePartial = invokePartial; exports.noop = noop; // istanbul ignore next function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } // istanbul ignore next function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } var _utils = require('./utils'); var Utils = _interopRequireWildcard(_utils); var _exception = require('./exception'); var _exception2 = _interopRequireDefault(_exception); var _base = require('./base'); function checkRevision(compilerInfo) { var compilerRevision = compilerInfo && compilerInfo[0] || 1, currentRevision = _base.COMPILER_REVISION; if (compilerRevision !== currentRevision) { if (compilerRevision < currentRevision) { var runtimeVersions = _base.REVISION_CHANGES[currentRevision], compilerVersions = _base.REVISION_CHANGES[compilerRevision]; throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); } else { // Use the embedded version info since the runtime doesn't know about this revision yet throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); } } } function template(templateSpec, env) { /* istanbul ignore next */ if (!env) { throw new _exception2['default']('No environment passed to template'); } if (!templateSpec || !templateSpec.main) { throw new _exception2['default']('Unknown template object: ' + typeof templateSpec); } templateSpec.main.decorator = templateSpec.main_d; // Note: Using env.VM references rather than local var references throughout this section to allow // for external users to override these as psuedo-supported APIs. env.VM.checkRevision(templateSpec.compiler); function invokePartialWrapper(partial, context, options) { if (options.hash) { context = Utils.extend({}, context, options.hash); if (options.ids) { options.ids[0] = true; } } partial = env.VM.resolvePartial.call(this, partial, context, options); var result = env.VM.invokePartial.call(this, partial, context, options); if (result == null && env.compile) { options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env); result = options.partials[options.name](context, options); } if (result != null) { if (options.indent) { var lines = result.split('\n'); for (var i = 0, l = lines.length; i < l; i++) { if (!lines[i] && i + 1 === l) { break; } lines[i] = options.indent + lines[i]; } result = lines.join('\n'); } return result; } else { throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); } } // Just add water var container = { strict: function strict(obj, name) { if (!(name in obj)) { throw new _exception2['default']('"' + name + '" not defined in ' + obj); } return obj[name]; }, lookup: function lookup(depths, name) { var len = depths.length; for (var i = 0; i < len; i++) { if (depths[i] && depths[i][name] != null) { return depths[i][name]; } } }, lambda: function lambda(current, context) { return typeof current === 'function' ? current.call(context) : current; }, escapeExpression: Utils.escapeExpression, invokePartial: invokePartialWrapper, fn: function fn(i) { var ret = templateSpec[i]; ret.decorator = templateSpec[i + '_d']; return ret; }, programs: [], program: function program(i, data, declaredBlockParams, blockParams, depths) { var programWrapper = this.programs[i], fn = this.fn(i); if (data || depths || blockParams || declaredBlockParams) { programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths); } else if (!programWrapper) { programWrapper = this.programs[i] = wrapProgram(this, i, fn); } return programWrapper; }, data: function data(value, depth) { while (value && depth--) { value = value._parent; } return value; }, merge: function merge(param, common) { var obj = param || common; if (param && common && param !== common) { obj = Utils.extend({}, common, param); } return obj; }, // An empty object to use as replacement for null-contexts nullContext: Object.seal({}), noop: env.VM.noop, compilerInfo: templateSpec.compiler }; function ret(context) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var data = options.data; ret._setup(options); if (!options.partial && templateSpec.useData) { data = initData(context, data); } var depths = undefined, blockParams = templateSpec.useBlockParams ? [] : undefined; if (templateSpec.useDepths) { if (options.depths) { depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths; } else { depths = [context]; } } function main(context /*, options*/) { return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths); } main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams); return main(context, options); } ret.isTop = true; ret._setup = function (options) { if (!options.partial) { container.helpers = container.merge(options.helpers, env.helpers); if (templateSpec.usePartial) { container.partials = container.merge(options.partials, env.partials); } if (templateSpec.usePartial || templateSpec.useDecorators) { container.decorators = container.merge(options.decorators, env.decorators); } } else { container.helpers = options.helpers; container.partials = options.partials; container.decorators = options.decorators; } }; ret._child = function (i, data, blockParams, depths) { if (templateSpec.useBlockParams && !blockParams) { throw new _exception2['default']('must pass block params'); } if (templateSpec.useDepths && !depths) { throw new _exception2['default']('must pass parent depths'); } return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths); }; return ret; } function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) { function prog(context) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var currentDepths = depths; if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) { currentDepths = [context].concat(depths); } return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths); } prog = executeDecorators(fn, prog, container, depths, data, blockParams); prog.program = i; prog.depth = depths ? depths.length : 0; prog.blockParams = declaredBlockParams || 0; return prog; } function resolvePartial(partial, context, options) { if (!partial) { if (options.name === '@partial-block') { partial = options.data['partial-block']; } else { partial = options.partials[options.name]; } } else if (!partial.call && !options.name) { // This is a dynamic partial that returned a string options.name = partial; partial = options.partials[partial]; } return partial; } function invokePartial(partial, context, options) { // Use the current closure context to save the partial-block if this partial var currentPartialBlock = options.data && options.data['partial-block']; options.partial = true; if (options.ids) { options.data.contextPath = options.ids[0] || options.data.contextPath; } var partialBlock = undefined; if (options.fn && options.fn !== noop) { (function () { options.data = _base.createFrame(options.data); // Wrapper function to get access to currentPartialBlock from the closure var fn = options.fn; partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; // Restore the partial-block from the closure for the execution of the block // i.e. the part inside the block of the partial call. options.data = _base.createFrame(options.data); options.data['partial-block'] = currentPartialBlock; return fn(context, options); }; if (fn.partials) { options.partials = Utils.extend({}, options.partials, fn.partials); } })(); } if (partial === undefined && partialBlock) { partial = partialBlock; } if (partial === undefined) { throw new _exception2['default']('The partial ' + options.name + ' could not be found'); } else if (partial instanceof Function) { return partial(context, options); } } function noop() { return ''; } function initData(context, data) { if (!data || !('root' in data)) { data = data ? _base.createFrame(data) : {}; data.root = context; } return data; } function executeDecorators(fn, prog, container, depths, data, blockParams) { if (fn.decorator) { var props = {}; prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths); Utils.extend(prog, props); } return prog; } },{"./base":76,"./exception":79,"./utils":92}],91:[function(require,module,exports){ // Build out our basic SafeString type 'use strict'; exports.__esModule = true; function SafeString(string) { this.string = string; } SafeString.prototype.toString = SafeString.prototype.toHTML = function () { return '' + this.string; }; exports['default'] = SafeString; module.exports = exports['default']; },{}],92:[function(require,module,exports){ 'use strict'; exports.__esModule = true; exports.extend = extend; exports.indexOf = indexOf; exports.escapeExpression = escapeExpression; exports.isEmpty = isEmpty; exports.createFrame = createFrame; exports.blockParams = blockParams; exports.appendContextPath = appendContextPath; var escape = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', '`': '`', '=': '=' }; var badChars = /[&<>"'`=]/g, possible = /[&<>"'`=]/; function escapeChar(chr) { return escape[chr]; } function extend(obj /* , ...source */) { for (var i = 1; i < arguments.length; i++) { for (var key in arguments[i]) { if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { obj[key] = arguments[i][key]; } } } return obj; } var toString = Object.prototype.toString; exports.toString = toString; // Sourced from lodash // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt /* eslint-disable func-style */ var isFunction = function isFunction(value) { return typeof value === 'function'; }; // fallback for older versions of Chrome and Safari /* istanbul ignore next */ if (isFunction(/x/)) { exports.isFunction = isFunction = function (value) { return typeof value === 'function' && toString.call(value) === '[object Function]'; }; } exports.isFunction = isFunction; /* eslint-enable func-style */ /* istanbul ignore next */ var isArray = Array.isArray || function (value) { return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; }; exports.isArray = isArray; // Older IE versions do not directly support indexOf so we must implement our own, sadly. function indexOf(array, value) { for (var i = 0, len = array.length; i < len; i++) { if (array[i] === value) { return i; } } return -1; } function escapeExpression(string) { if (typeof string !== 'string') { // don't escape SafeStrings, since they're already safe if (string && string.toHTML) { return string.toHTML(); } else if (string == null) { return ''; } else if (!string) { return string + ''; } // Force a string conversion as this will be done by the append regardless and // the regex test will do this transparently behind the scenes, causing issues if // an object's to string has escaped characters in it. string = '' + string; } if (!possible.test(string)) { return string; } return string.replace(badChars, escapeChar); } function isEmpty(value) { if (!value && value !== 0) { return true; } else if (isArray(value) && value.length === 0) { return true; } else { return false; } } function createFrame(object) { var frame = extend({}, object); frame._parent = object; return frame; } function blockParams(params, ids) { params.path = ids; return params; } function appendContextPath(contextPath, id) { return (contextPath ? contextPath + '.' : '') + id; } },{}],93:[function(require,module,exports){ // Create a simple path alias to allow browserify to resolve // the runtime on a supported path. module.exports = require('./dist/cjs/handlebars.runtime')['default']; },{"./dist/cjs/handlebars.runtime":75}],94:[function(require,module,exports){ (function (global){(function (){ /*! https://mths.be/punycode v1.4.1 by @mathias */ ;(function(root) { /** Detect free variables */ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; var freeModule = typeof module == 'object' && module && !module.nodeType && module; var freeGlobal = typeof global == 'object' && global; if ( freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal ) { root = freeGlobal; } /** * The `punycode` object. * @name punycode * @type Object */ var punycode, /** Highest positive signed 32-bit float value */ maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 /** Bootstring parameters */ base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, // 0x80 delimiter = '-', // '\x2D' /** Regular expressions */ regexPunycode = /^xn--/, regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators /** Error messages */ errors = { 'overflow': 'Overflow: input needs wider integers to process', 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 'invalid-input': 'Invalid input' }, /** Convenience shortcuts */ baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, /** Temporary variable */ key; /*--------------------------------------------------------------------------*/ /** * A generic error utility function. * @private * @param {String} type The error type. * @returns {Error} Throws a `RangeError` with the applicable error message. */ function error(type) { throw new RangeError(errors[type]); } /** * A generic `Array#map` utility function. * @private * @param {Array} array The array to iterate over. * @param {Function} callback The function that gets called for every array * item. * @returns {Array} A new array of values returned by the callback function. */ function map(array, fn) { var length = array.length; var result = []; while (length--) { result[length] = fn(array[length]); } return result; } /** * A simple `Array#map`-like wrapper to work with domain name strings or email * addresses. * @private * @param {String} domain The domain name or email address. * @param {Function} callback The function that gets called for every * character. * @returns {Array} A new string of characters returned by the callback * function. */ function mapDomain(string, fn) { var parts = string.split('@'); var result = ''; if (parts.length > 1) { // In email addresses, only the domain name should be punycoded. Leave // the local part (i.e. everything up to `@`) intact. result = parts[0] + '@'; string = parts[1]; } // Avoid `split(regex)` for IE8 compatibility. See #17. string = string.replace(regexSeparators, '\x2E'); var labels = string.split('.'); var encoded = map(labels, fn).join('.'); return result + encoded; } /** * Creates an array containing the numeric code points of each Unicode * character in the string. While JavaScript uses UCS-2 internally, * this function will convert a pair of surrogate halves (each of which * UCS-2 exposes as separate characters) into a single code point, * matching UTF-16. * @see `punycode.ucs2.encode` * @see <https://mathiasbynens.be/notes/javascript-encoding> * @memberOf punycode.ucs2 * @name decode * @param {String} string The Unicode input string (UCS-2). * @returns {Array} The new array of code points. */ function ucs2decode(string) { var output = [], counter = 0, length = string.length, value, extra; while (counter < length) { value = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // high surrogate, and there is a next character extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // low surrogate output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // unmatched surrogate; only append this code unit, in case the next // code unit is the high surrogate of a surrogate pair output.push(value); counter--; } } else { output.push(value); } } return output; } /** * Creates a string based on an array of numeric code points. * @see `punycode.ucs2.decode` * @memberOf punycode.ucs2 * @name encode * @param {Array} codePoints The array of numeric code points. * @returns {String} The new Unicode string (UCS-2). */ function ucs2encode(array) { return map(array, function(value) { var output = ''; if (value > 0xFFFF) { value -= 0x10000; output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); value = 0xDC00 | value & 0x3FF; } output += stringFromCharCode(value); return output; }).join(''); } /** * Converts a basic code point into a digit/integer. * @see `digitToBasic()` * @private * @param {Number} codePoint The basic numeric code point value. * @returns {Number} The numeric value of a basic code point (for use in * representing integers) in the range `0` to `base - 1`, or `base` if * the code point does not represent a value. */ function basicToDigit(codePoint) { if (codePoint - 48 < 10) { return codePoint - 22; } if (codePoint - 65 < 26) { return codePoint - 65; } if (codePoint - 97 < 26) { return codePoint - 97; } return base; } /** * Converts a digit/integer into a basic code point. * @see `basicToDigit()` * @private * @param {Number} digit The numeric value of a basic code point. * @returns {Number} The basic code point whose value (when used for * representing integers) is `digit`, which needs to be in the range * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is * used; else, the lowercase form is used. The behavior is undefined * if `flag` is non-zero and `digit` has no uppercase form. */ function digitToBasic(digit, flag) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); } /** * Bias adaptation function as per section 3.4 of RFC 3492. * https://tools.ietf.org/html/rfc3492#section-3.4 * @private */ function adapt(delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor(delta / baseMinusTMin); } return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); } /** * Converts a Punycode string of ASCII-only symbols to a string of Unicode * symbols. * @memberOf punycode * @param {String} input The Punycode string of ASCII-only symbols. * @returns {String} The resulting string of Unicode symbols. */ function decode(input) { // Don't use UCS-2 var output = [], inputLength = input.length, out, i = 0, n = initialN, bias = initialBias, basic, j, index, oldi, w, k, digit, t, /** Cached calculation results */ baseMinusT; // Handle the basic code points: let `basic` be the number of input code // points before the last delimiter, or `0` if there is none, then copy // the first basic code points to the output. basic = input.lastIndexOf(delimiter); if (basic < 0) { basic = 0; } for (j = 0; j < basic; ++j) { // if it's not a basic code point if (input.charCodeAt(j) >= 0x80) { error('not-basic'); } output.push(input.charCodeAt(j)); } // Main decoding loop: start just after the last delimiter if any basic code // points were copied; start at the beginning otherwise. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { // `index` is the index of the next character to be consumed. // Decode a generalized variable-length integer into `delta`, // which gets added to `i`. The overflow checking is easier // if we increase `i` as we go, then subtract off its starting // value at the end to obtain `delta`. for (oldi = i, w = 1, k = base; /* no condition */; k += base) { if (index >= inputLength) { error('invalid-input'); } digit = basicToDigit(input.charCodeAt(index++)); if (digit >= base || digit > floor((maxInt - i) / w)) { error('overflow'); } i += digit * w; t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (digit < t) { break; } baseMinusT = base - t; if (w > floor(maxInt / baseMinusT)) { error('overflow'); } w *= baseMinusT; } out = output.length + 1; bias = adapt(i - oldi, out, oldi == 0); // `i` was supposed to wrap around from `out` to `0`, // incrementing `n` each time, so we'll fix that now: if (floor(i / out) > maxInt - n) { error('overflow'); } n += floor(i / out); i %= out; // Insert `n` at position `i` of the output output.splice(i++, 0, n); } return ucs2encode(output); } /** * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. * @memberOf punycode * @param {String} input The string of Unicode symbols. * @returns {String} The resulting Punycode string of ASCII-only symbols. */ function encode(input) { var n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, currentValue, output = [], /** `inputLength` will hold the number of code points in `input`. */ inputLength, /** Cached calculation results */ handledCPCountPlusOne, baseMinusT, qMinusT; // Convert the input in UCS-2 to Unicode input = ucs2decode(input); // Cache the length inputLength = input.length; // Initialize the state n = initialN; delta = 0; bias = initialBias; // Handle the basic code points for (j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue < 0x80) { output.push(stringFromCharCode(currentValue)); } } handledCPCount = basicLength = output.length; // `handledCPCount` is the number of code points that have been handled; // `basicLength` is the number of basic code points. // Finish the basic string - if it is not empty - with a delimiter if (basicLength) { output.push(delimiter); } // Main encoding loop: while (handledCPCount < inputLength) { // All non-basic code points < n have been handled already. Find the next // larger one: for (m = maxInt, j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue >= n && currentValue < m) { m = currentValue; } } // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, // but guard against overflow handledCPCountPlusOne = handledCPCount + 1; if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { error('overflow'); } delta += (m - n) * handledCPCountPlusOne; n = m; for (j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue < n && ++delta > maxInt) { error('overflow'); } if (currentValue == n) { // Represent delta as a generalized variable-length integer for (q = delta, k = base; /* no condition */; k += base) { t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (q < t) { break; } qMinusT = q - t; baseMinusT = base - t; output.push( stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) ); q = floor(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q, 0))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); delta = 0; ++handledCPCount; } } ++delta; ++n; } return output.join(''); } /** * Converts a Punycode string representing a domain name or an email address * to Unicode. Only the Punycoded parts of the input will be converted, i.e. * it doesn't matter if you call it on a string that has already been * converted to Unicode. * @memberOf punycode * @param {String} input The Punycoded domain name or email address to * convert to Unicode. * @returns {String} The Unicode representation of the given Punycode * string. */ function toUnicode(input) { return mapDomain(input, function(string) { return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; }); } /** * Converts a Unicode string representing a domain name or an email address to * Punycode. Only the non-ASCII parts of the domain name will be converted, * i.e. it doesn't matter if you call it with a domain that's already in * ASCII. * @memberOf punycode * @param {String} input The domain name or email address to convert, as a * Unicode string. * @returns {String} The Punycode representation of the given domain name or * email address. */ function toASCII(input) { return mapDomain(input, function(string) { return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; }); } /*--------------------------------------------------------------------------*/ /** Define the public API */ punycode = { /** * A string representing the current Punycode.js version number. * @memberOf punycode * @type String */ 'version': '1.4.1', /** * An object of methods to convert from JavaScript's internal character * representation (UCS-2) to Unicode code points, and back. * @see <https://mathiasbynens.be/notes/javascript-encoding> * @memberOf punycode * @type Object */ 'ucs2': { 'decode': ucs2decode, 'encode': ucs2encode }, 'decode': decode, 'encode': encode, 'toASCII': toASCII, 'toUnicode': toUnicode }; /** Expose `punycode` */ // Some AMD build optimizers, like r.js, check for specific condition patterns // like the following: if ( typeof define == 'function' && typeof define.amd == 'object' && define.amd ) { define('punycode', function() { return punycode; }); } else if (freeExports && freeModule) { if (module.exports == freeExports) { // in Node.js, io.js, or RingoJS v0.8.0+ freeModule.exports = punycode; } else { // in Narwhal or RingoJS v0.7.0- for (key in punycode) { punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); } } } else { // in Rhino or a web browser root.punycode = punycode; } }(this)); }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],95:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; // If obj.hasOwnProperty has been overridden, then calling // obj.hasOwnProperty(prop) will break. // See: https://github.com/joyent/node/issues/1707 function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } module.exports = function(qs, sep, eq, options) { sep = sep || '&'; eq = eq || '='; var obj = {}; if (typeof qs !== 'string' || qs.length === 0) { return obj; } var regexp = /\+/g; qs = qs.split(sep); var maxKeys = 1000; if (options && typeof options.maxKeys === 'number') { maxKeys = options.maxKeys; } var len = qs.length; // maxKeys <= 0 means that we should not limit keys count if (maxKeys > 0 && len > maxKeys) { len = maxKeys; } for (var i = 0; i < len; ++i) { var x = qs[i].replace(regexp, '%20'), idx = x.indexOf(eq), kstr, vstr, k, v; if (idx >= 0) { kstr = x.substr(0, idx); vstr = x.substr(idx + 1); } else { kstr = x; vstr = ''; } k = decodeURIComponent(kstr); v = decodeURIComponent(vstr); if (!hasOwnProperty(obj, k)) { obj[k] = v; } else if (isArray(obj[k])) { obj[k].push(v); } else { obj[k] = [obj[k], v]; } } return obj; }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; },{}],96:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; var stringifyPrimitive = function(v) { switch (typeof v) { case 'string': return v; case 'boolean': return v ? 'true' : 'false'; case 'number': return isFinite(v) ? v : ''; default: return ''; } }; module.exports = function(obj, sep, eq, name) { sep = sep || '&'; eq = eq || '='; if (obj === null) { obj = undefined; } if (typeof obj === 'object') { return map(objectKeys(obj), function(k) { var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; if (isArray(obj[k])) { return map(obj[k], function(v) { return ks + encodeURIComponent(stringifyPrimitive(v)); }).join(sep); } else { return ks + encodeURIComponent(stringifyPrimitive(obj[k])); } }).join(sep); } if (!name) return ''; return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj)); }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; function map (xs, f) { if (xs.map) return xs.map(f); var res = []; for (var i = 0; i < xs.length; i++) { res.push(f(xs[i], i)); } return res; } var objectKeys = Object.keys || function (obj) { var res = []; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); } return res; }; },{}],97:[function(require,module,exports){ 'use strict'; exports.decode = exports.parse = require('./decode'); exports.encode = exports.stringify = require('./encode'); },{"./decode":95,"./encode":96}],98:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; var punycode = require('punycode'); var util = require('./util'); exports.parse = urlParse; exports.resolve = urlResolve; exports.resolveObject = urlResolveObject; exports.format = urlFormat; exports.Url = Url; function Url() { this.protocol = null; this.slashes = null; this.auth = null; this.host = null; this.port = null; this.hostname = null; this.hash = null; this.search = null; this.query = null; this.pathname = null; this.path = null; this.href = null; } // Reference: RFC 3986, RFC 1808, RFC 2396 // define these here so at least they only have to be // compiled once on the first module load. var protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, // Special case for a simple path URL simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, // RFC 2396: characters reserved for delimiting URLs. // We actually just auto-escape these. delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], // RFC 2396: characters not allowed for various reasons. unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), // Allowed by RFCs, but cause of XSS attacks. Always escape these. autoEscape = ['\''].concat(unwise), // Characters that are never ever allowed in a hostname. // Note that any invalid chars are also handled, but these // are the ones that are *expected* to be seen, so we fast-path // them. nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), hostEndingChars = ['/', '?', '#'], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, // protocols that can allow "unsafe" and "unwise" chars. unsafeProtocol = { 'javascript': true, 'javascript:': true }, // protocols that never have a hostname. hostlessProtocol = { 'javascript': true, 'javascript:': true }, // protocols that always contain a // bit. slashedProtocol = { 'http': true, 'https': true, 'ftp': true, 'gopher': true, 'file': true, 'http:': true, 'https:': true, 'ftp:': true, 'gopher:': true, 'file:': true }, querystring = require('querystring'); function urlParse(url, parseQueryString, slashesDenoteHost) { if (url && util.isObject(url) && url instanceof Url) return url; var u = new Url; u.parse(url, parseQueryString, slashesDenoteHost); return u; } Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { if (!util.isString(url)) { throw new TypeError("Parameter 'url' must be a string, not " + typeof url); } // Copy chrome, IE, opera backslash-handling behavior. // Back slashes before the query string get converted to forward slashes // See: https://code.google.com/p/chromium/issues/detail?id=25916 var queryIndex = url.indexOf('?'), splitter = (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', uSplit = url.split(splitter), slashRegex = /\\/g; uSplit[0] = uSplit[0].replace(slashRegex, '/'); url = uSplit.join(splitter); var rest = url; // trim before proceeding. // This is to support parse stuff like " http://foo.com \n" rest = rest.trim(); if (!slashesDenoteHost && url.split('#').length === 1) { // Try fast path regexp var simplePath = simplePathPattern.exec(rest); if (simplePath) { this.path = rest; this.href = rest; this.pathname = simplePath[1]; if (simplePath[2]) { this.search = simplePath[2]; if (parseQueryString) { this.query = querystring.parse(this.search.substr(1)); } else { this.query = this.search.substr(1); } } else if (parseQueryString) { this.search = ''; this.query = {}; } return this; } } var proto = protocolPattern.exec(rest); if (proto) { proto = proto[0]; var lowerProto = proto.toLowerCase(); this.protocol = lowerProto; rest = rest.substr(proto.length); } // figure out if it's got a host // user@server is *always* interpreted as a hostname, and url // resolution will treat //foo/bar as host=foo,path=bar because that's // how the browser resolves relative URLs. if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { var slashes = rest.substr(0, 2) === '//'; if (slashes && !(proto && hostlessProtocol[proto])) { rest = rest.substr(2); this.slashes = true; } } if (!hostlessProtocol[proto] && (slashes || (proto && !slashedProtocol[proto]))) { // there's a hostname. // the first instance of /, ?, ;, or # ends the host. // // If there is an @ in the hostname, then non-host chars *are* allowed // to the left of the last @ sign, unless some host-ending character // comes *before* the @-sign. // URLs are obnoxious. // // ex: // http://a@b@c/ => user:a@b host:c // http://a@b?@c => user:a host:c path:/?@c // v0.12 TODO(isaacs): This is not quite how Chrome does things. // Review our test case against browsers more comprehensively. // find the first instance of any hostEndingChars var hostEnd = -1; for (var i = 0; i < hostEndingChars.length; i++) { var hec = rest.indexOf(hostEndingChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; } // at this point, either we have an explicit point where the // auth portion cannot go past, or the last @ char is the decider. var auth, atSign; if (hostEnd === -1) { // atSign can be anywhere. atSign = rest.lastIndexOf('@'); } else { // atSign must be in auth portion. // http://a@b/c@d => host:b auth:a path:/c@d atSign = rest.lastIndexOf('@', hostEnd); } // Now we have a portion which is definitely the auth. // Pull that off. if (atSign !== -1) { auth = rest.slice(0, atSign); rest = rest.slice(atSign + 1); this.auth = decodeURIComponent(auth); } // the host is the remaining to the left of the first non-host char hostEnd = -1; for (var i = 0; i < nonHostChars.length; i++) { var hec = rest.indexOf(nonHostChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; } // if we still have not hit it, then the entire thing is a host. if (hostEnd === -1) hostEnd = rest.length; this.host = rest.slice(0, hostEnd); rest = rest.slice(hostEnd); // pull out port. this.parseHost(); // we've indicated that there is a hostname, // so even if it's empty, it has to be present. this.hostname = this.hostname || ''; // if hostname begins with [ and ends with ] // assume that it's an IPv6 address. var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; // validate a little. if (!ipv6Hostname) { var hostparts = this.hostname.split(/\./); for (var i = 0, l = hostparts.length; i < l; i++) { var part = hostparts[i]; if (!part) continue; if (!part.match(hostnamePartPattern)) { var newpart = ''; for (var j = 0, k = part.length; j < k; j++) { if (part.charCodeAt(j) > 127) { // we replace non-ASCII char with a temporary placeholder // we need this to make sure size of hostname is not // broken by replacing non-ASCII by nothing newpart += 'x'; } else { newpart += part[j]; } } // we test again with ASCII char only if (!newpart.match(hostnamePartPattern)) { var validParts = hostparts.slice(0, i); var notHost = hostparts.slice(i + 1); var bit = part.match(hostnamePartStart); if (bit) { validParts.push(bit[1]); notHost.unshift(bit[2]); } if (notHost.length) { rest = '/' + notHost.join('.') + rest; } this.hostname = validParts.join('.'); break; } } } } if (this.hostname.length > hostnameMaxLen) { this.hostname = ''; } else { // hostnames are always lower case. this.hostname = this.hostname.toLowerCase(); } if (!ipv6Hostname) { // IDNA Support: Returns a punycoded representation of "domain". // It only converts parts of the domain name that // have non-ASCII characters, i.e. it doesn't matter if // you call it with a domain that already is ASCII-only. this.hostname = punycode.toASCII(this.hostname); } var p = this.port ? ':' + this.port : ''; var h = this.hostname || ''; this.host = h + p; this.href += this.host; // strip [ and ] from the hostname // the host field still retains them, though if (ipv6Hostname) { this.hostname = this.hostname.substr(1, this.hostname.length - 2); if (rest[0] !== '/') { rest = '/' + rest; } } } // now rest is set to the post-host stuff. // chop off any delim chars. if (!unsafeProtocol[lowerProto]) { // First, make 100% sure that any "autoEscape" chars get // escaped, even if encodeURIComponent doesn't think they // need to be. for (var i = 0, l = autoEscape.length; i < l; i++) { var ae = autoEscape[i]; if (rest.indexOf(ae) === -1) continue; var esc = encodeURIComponent(ae); if (esc === ae) { esc = escape(ae); } rest = rest.split(ae).join(esc); } } // chop off from the tail first. var hash = rest.indexOf('#'); if (hash !== -1) { // got a fragment string. this.hash = rest.substr(hash); rest = rest.slice(0, hash); } var qm = rest.indexOf('?'); if (qm !== -1) { this.search = rest.substr(qm); this.query = rest.substr(qm + 1); if (parseQueryString) { this.query = querystring.parse(this.query); } rest = rest.slice(0, qm); } else if (parseQueryString) { // no query string, but parseQueryString still requested this.search = ''; this.query = {}; } if (rest) this.pathname = rest; if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { this.pathname = '/'; } //to support http.request if (this.pathname || this.search) { var p = this.pathname || ''; var s = this.search || ''; this.path = p + s; } // finally, reconstruct the href based on what has been validated. this.href = this.format(); return this; }; // format a parsed object into a url string function urlFormat(obj) { // ensure it's an object, and not a string url. // If it's an obj, this is a no-op. // this way, you can call url_format() on strings // to clean up potentially wonky urls. if (util.isString(obj)) obj = urlParse(obj); if (!(obj instanceof Url)) return Url.prototype.format.call(obj); return obj.format(); } Url.prototype.format = function() { var auth = this.auth || ''; if (auth) { auth = encodeURIComponent(auth); auth = auth.replace(/%3A/i, ':'); auth += '@'; } var protocol = this.protocol || '', pathname = this.pathname || '', hash = this.hash || '', host = false, query = ''; if (this.host) { host = auth + this.host; } else if (this.hostname) { host = auth + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']'); if (this.port) { host += ':' + this.port; } } if (this.query && util.isObject(this.query) && Object.keys(this.query).length) { query = querystring.stringify(this.query); } var search = this.search || (query && ('?' + query)) || ''; if (protocol && protocol.substr(-1) !== ':') protocol += ':'; // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. // unless they had them to begin with. if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) { host = '//' + (host || ''); if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; } else if (!host) { host = ''; } if (hash && hash.charAt(0) !== '#') hash = '#' + hash; if (search && search.charAt(0) !== '?') search = '?' + search; pathname = pathname.replace(/[?#]/g, function(match) { return encodeURIComponent(match); }); search = search.replace('#', '%23'); return protocol + host + pathname + search + hash; }; function urlResolve(source, relative) { return urlParse(source, false, true).resolve(relative); } Url.prototype.resolve = function(relative) { return this.resolveObject(urlParse(relative, false, true)).format(); }; function urlResolveObject(source, relative) { if (!source) return relative; return urlParse(source, false, true).resolveObject(relative); } Url.prototype.resolveObject = function(relative) { if (util.isString(relative)) { var rel = new Url(); rel.parse(relative, false, true); relative = rel; } var result = new Url(); var tkeys = Object.keys(this); for (var tk = 0; tk < tkeys.length; tk++) { var tkey = tkeys[tk]; result[tkey] = this[tkey]; } // hash is always overridden, no matter what. // even href="" will remove it. result.hash = relative.hash; // if the relative url is empty, then there's nothing left to do here. if (relative.href === '') { result.href = result.format(); return result; } // hrefs like //foo/bar always cut to the protocol. if (relative.slashes && !relative.protocol) { // take everything except the protocol from relative var rkeys = Object.keys(relative); for (var rk = 0; rk < rkeys.length; rk++) { var rkey = rkeys[rk]; if (rkey !== 'protocol') result[rkey] = relative[rkey]; } //urlParse appends trailing / to urls like http://www.example.com if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) { result.path = result.pathname = '/'; } result.href = result.format(); return result; } if (relative.protocol && relative.protocol !== result.protocol) { // if it's a known url protocol, then changing // the protocol does weird things // first, if it's not file:, then we MUST have a host, // and if there was a path // to begin with, then we MUST have a path. // if it is file:, then the host is dropped, // because that's known to be hostless. // anything else is assumed to be absolute. if (!slashedProtocol[relative.protocol]) { var keys = Object.keys(relative); for (var v = 0; v < keys.length; v++) { var k = keys[v]; result[k] = relative[k]; } result.href = result.format(); return result; } result.protocol = relative.protocol; if (!relative.host && !hostlessProtocol[relative.protocol]) { var relPath = (relative.pathname || '').split('/'); while (relPath.length && !(relative.host = relPath.shift())); if (!relative.host) relative.host = ''; if (!relative.hostname) relative.hostname = ''; if (relPath[0] !== '') relPath.unshift(''); if (relPath.length < 2) relPath.unshift(''); result.pathname = relPath.join('/'); } else { result.pathname = relative.pathname; } result.search = relative.search; result.query = relative.query; result.host = relative.host || ''; result.auth = relative.auth; result.hostname = relative.hostname || relative.host; result.port = relative.port; // to support http.request if (result.pathname || result.search) { var p = result.pathname || ''; var s = result.search || ''; result.path = p + s; } result.slashes = result.slashes || relative.slashes; result.href = result.format(); return result; } var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), isRelAbs = ( relative.host || relative.pathname && relative.pathname.charAt(0) === '/' ), mustEndAbs = (isRelAbs || isSourceAbs || (result.host && relative.pathname)), removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split('/') || [], relPath = relative.pathname && relative.pathname.split('/') || [], psychotic = result.protocol && !slashedProtocol[result.protocol]; // if the url is a non-slashed url, then relative // links like ../.. should be able // to crawl up to the hostname, as well. This is strange. // result.protocol has already been set by now. // Later on, put the first path part into the host field. if (psychotic) { result.hostname = ''; result.port = null; if (result.host) { if (srcPath[0] === '') srcPath[0] = result.host; else srcPath.unshift(result.host); } result.host = ''; if (relative.protocol) { relative.hostname = null; relative.port = null; if (relative.host) { if (relPath[0] === '') relPath[0] = relative.host; else relPath.unshift(relative.host); } relative.host = null; } mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); } if (isRelAbs) { // it's absolute. result.host = (relative.host || relative.host === '') ? relative.host : result.host; result.hostname = (relative.hostname || relative.hostname === '') ? relative.hostname : result.hostname; result.search = relative.search; result.query = relative.query; srcPath = relPath; // fall through to the dot-handling below. } else if (relPath.length) { // it's relative // throw away the existing file, and take the new path instead. if (!srcPath) srcPath = []; srcPath.pop(); srcPath = srcPath.concat(relPath); result.search = relative.search; result.query = relative.query; } else if (!util.isNullOrUndefined(relative.search)) { // just pull out the search. // like href='?foo'. // Put this after the other two cases because it simplifies the booleans if (psychotic) { result.hostname = result.host = srcPath.shift(); //occationaly the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift(); } } result.search = relative.search; result.query = relative.query; //to support http.request if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } result.href = result.format(); return result; } if (!srcPath.length) { // no path at all. easy. // we've already handled the other stuff above. result.pathname = null; //to support http.request if (result.search) { result.path = '/' + result.search; } else { result.path = null; } result.href = result.format(); return result; } // if a url ENDs in . or .., then it must get a trailing slash. // however, if it ends in anything else non-slashy, // then it must NOT get a trailing slash. var last = srcPath.slice(-1)[0]; var hasTrailingSlash = ( (result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..') || last === ''); // strip single dots, resolve double dots to parent dir // if the path tries to go above the root, `up` ends up > 0 var up = 0; for (var i = srcPath.length; i >= 0; i--) { last = srcPath[i]; if (last === '.') { srcPath.splice(i, 1); } else if (last === '..') { srcPath.splice(i, 1); up++; } else if (up) { srcPath.splice(i, 1); up--; } } // if the path is allowed to go above the root, restore leading ..s if (!mustEndAbs && !removeAllDots) { for (; up--; up) { srcPath.unshift('..'); } } if (mustEndAbs && srcPath[0] !== '' && (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { srcPath.unshift(''); } if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { srcPath.push(''); } var isAbsolute = srcPath[0] === '' || (srcPath[0] && srcPath[0].charAt(0) === '/'); // put the host back if (psychotic) { result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; //occationaly the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift(); } } mustEndAbs = mustEndAbs || (result.host && srcPath.length); if (mustEndAbs && !isAbsolute) { srcPath.unshift(''); } if (!srcPath.length) { result.pathname = null; result.path = null; } else { result.pathname = srcPath.join('/'); } //to support request.http if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } result.auth = relative.auth || result.auth; result.slashes = result.slashes || relative.slashes; result.href = result.format(); return result; }; Url.prototype.parseHost = function() { var host = this.host; var port = portPattern.exec(host); if (port) { port = port[0]; if (port !== ':') { this.port = port.substr(1); } host = host.substr(0, host.length - port.length); } if (host) this.hostname = host; }; },{"./util":99,"punycode":94,"querystring":97}],99:[function(require,module,exports){ 'use strict'; module.exports = { isString: function(arg) { return typeof(arg) === 'string'; }, isObject: function(arg) { return typeof(arg) === 'object' && arg !== null; }, isNull: function(arg) { return arg === null; }, isNullOrUndefined: function(arg) { return arg == null; } }; },{}]},{},[1]);