diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..4f7cdd3 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,30 @@ +module.exports = { + "env": { + "browser": true, + "commonjs": true, + "es6": true + }, + "extends": ["eslint:recommended", "plugin:import/errors", "plugin:import/warnings"], + "parserOptions": { + "ecmaVersion": 2018, + "sourceType": "module" + }, + "rules": { + "indent": [ + "warn", + 4 + ], + "linebreak-style": [ + "warn", + "unix" + ], + "quotes": [ + "warn", + "single" + ], + "semi": [ + "warn", + "never" + ] + } +}; \ No newline at end of file diff --git a/.gitignore b/.gitignore index d77eb01..cb7b007 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ node_modules npm-debug.log yarn.lock +test/utils/timezones.js diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..c3b6dd5 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,19 @@ +module.exports = function(api) { + api.cache(false) + return { + ignore: [], + plugins: [], + presets: [ + [ + '@babel/preset-env', + { + modules: false, + useBuiltIns: 'usage', + debug: false, + loose: false, + spec: false, + }, + ], + ], + } +} diff --git a/dist/jstz.d.ts b/dist/jstz.d.ts index c1a0731..70e1689 100644 --- a/dist/jstz.d.ts +++ b/dist/jstz.d.ts @@ -1,13 +1,18 @@ declare namespace jstz { class TimeZone { name():string; + stdTimezoneOffset():number; + timezoneOffset():number; } + function determine(): TimeZone; - namespace olson { - const timezones: { - [key: string]: string - } - } + + //this is not actualy exposed by the library so probably don't need to be in the spec + // namespace olson { + // const timezones: { + // [key: string]: string + // } + // } } declare module "jstz" { diff --git a/dist/jstz.esm.js b/dist/jstz.esm.js new file mode 100644 index 0000000..084fa33 --- /dev/null +++ b/dist/jstz.esm.js @@ -0,0 +1,1149 @@ +/* jstz.min.js Version: 2.1.1 Build date: 2018-12-29 */ +/* Build time: 2018-12-29 09:32:00Z Build by invoking python utilities/dst.py generate */ +var dst_rules = { + "years": [ + 2014, + 2015, + 2016, + 2017, + 2018 + ], + "zones": [ + { + "name": "Africa/Cairo", + "rules": [ + { + "e": 1411678800000, + "s": 1406844000000 + }, + false, + false, + false, + false + ] + }, + { + "name": "Africa/Casablanca", + "rules": [ + { + "e": 1414288800000, + "s": 1406944800000 + }, + { + "e": 1445738400000, + "s": 1437271200000 + }, + { + "e": 1477792800000, + "s": 1468116000000 + }, + { + "e": 1509242400000, + "s": 1498960800000 + }, + { + "e": 1540692000000, + "s": 1529200800000 + } + ] + }, + { + "name": "America/Asuncion", + "rules": [ + { + "e": 1395543600000, + "s": 1412481600000 + }, + { + "e": 1426993200000, + "s": 1443931200000 + }, + { + "e": 1459047600000, + "s": 1475380800000 + }, + { + "e": 1490497200000, + "s": 1506830400000 + }, + { + "e": 1521946800000, + "s": 1538884800000 + } + ] + }, + { + "name": "America/Campo_Grande", + "rules": [ + { + "e": 1392519600000, + "s": 1413691200000 + }, + { + "e": 1424574000000, + "s": 1445140800000 + }, + { + "e": 1456023600000, + "s": 1476590400000 + }, + { + "e": 1487473200000, + "s": 1508040000000 + }, + { + "e": 1518922800000, + "s": 1541304000000 + } + ] + }, + { + "name": "America/Goose_Bay", + "rules": [ + { + "e": 1414904400000, + "s": 1394344800000 + }, + { + "e": 1446354000000, + "s": 1425794400000 + }, + { + "e": 1478408400000, + "s": 1457848800000 + }, + { + "e": 1509858000000, + "s": 1489298400000 + }, + { + "e": 1541307600000, + "s": 1520748000000 + } + ] + }, + { + "name": "America/Havana", + "rules": [ + { + "e": 1414904400000, + "s": 1394341200000 + }, + { + "e": 1446354000000, + "s": 1425790800000 + }, + { + "e": 1478408400000, + "s": 1457845200000 + }, + { + "e": 1509858000000, + "s": 1489294800000 + }, + { + "e": 1541307600000, + "s": 1520744400000 + } + ] + }, + { + "name": "America/Mazatlan", + "rules": [ + { + "e": 1414310400000, + "s": 1396774800000 + }, + { + "e": 1445760000000, + "s": 1428224400000 + }, + { + "e": 1477814400000, + "s": 1459674000000 + }, + { + "e": 1509264000000, + "s": 1491123600000 + }, + { + "e": 1540713600000, + "s": 1522573200000 + } + ] + }, + { + "name": "America/Mexico_City", + "rules": [ + { + "e": 1414306800000, + "s": 1396771200000 + }, + { + "e": 1445756400000, + "s": 1428220800000 + }, + { + "e": 1477810800000, + "s": 1459670400000 + }, + { + "e": 1509260400000, + "s": 1491120000000 + }, + { + "e": 1540710000000, + "s": 1522569600000 + } + ] + }, + { + "name": "America/Miquelon", + "rules": [ + { + "e": 1414900800000, + "s": 1394341200000 + }, + { + "e": 1446350400000, + "s": 1425790800000 + }, + { + "e": 1478404800000, + "s": 1457845200000 + }, + { + "e": 1509854400000, + "s": 1489294800000 + }, + { + "e": 1541304000000, + "s": 1520744400000 + } + ] + }, + { + "name": "America/Santa_Isabel", + "rules": [ + { + "e": 1414918800000, + "s": 1394359200000 + }, + { + "e": 1446368400000, + "s": 1425808800000 + }, + { + "e": 1478422800000, + "s": 1457863200000 + }, + { + "e": 1509872400000, + "s": 1489312800000 + }, + { + "e": 1541322000000, + "s": 1520762400000 + } + ] + }, + { + "name": "America/Santiago", + "rules": [ + { + "e": 1398567600000, + "s": 1410062400000 + }, + false, + { + "e": 1463281200000, + "s": 1471147200000 + }, + { + "e": 1494730800000, + "s": 1502596800000 + }, + { + "e": 1526180400000, + "s": 1534046400000 + } + ] + }, + { + "name": "America/Sao_Paulo", + "rules": [ + { + "e": 1392516000000, + "s": 1413687600000 + }, + { + "e": 1424570400000, + "s": 1445137200000 + }, + { + "e": 1456020000000, + "s": 1476586800000 + }, + { + "e": 1487469600000, + "s": 1508036400000 + }, + { + "e": 1518919200000, + "s": 1541300400000 + } + ] + }, + { + "name": "Asia/Amman", + "rules": [ + { + "e": 1414706400000, + "s": 1395957600000 + }, + { + "e": 1446156000000, + "s": 1427407200000 + }, + { + "e": 1477605600000, + "s": 1459461600000 + }, + { + "e": 1509055200000, + "s": 1490911200000 + }, + { + "e": 1540504800000, + "s": 1522360800000 + } + ] + }, + { + "name": "Asia/Damascus", + "rules": [ + { + "e": 1414702800000, + "s": 1395957600000 + }, + { + "e": 1446152400000, + "s": 1427407200000 + }, + { + "e": 1477602000000, + "s": 1458856800000 + }, + { + "e": 1509051600000, + "s": 1490911200000 + }, + { + "e": 1540501200000, + "s": 1522360800000 + } + ] + }, + { + "name": "Asia/Dubai", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Gaza", + "rules": [ + { + "e": 1414098000000, + "s": 1395957600000 + }, + { + "e": 1445547600000, + "s": 1427493600000 + }, + { + "e": 1477692000000, + "s": 1458946800000 + }, + { + "e": 1509141600000, + "s": 1490396400000 + }, + { + "e": 1540591200000, + "s": 1521846000000 + } + ] + }, + { + "name": "Asia/Irkutsk", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Jerusalem", + "rules": [ + { + "e": 1414278000000, + "s": 1395964800000 + }, + { + "e": 1445727600000, + "s": 1427414400000 + }, + { + "e": 1477782000000, + "s": 1458864000000 + }, + { + "e": 1509231600000, + "s": 1490313600000 + }, + { + "e": 1540681200000, + "s": 1521763200000 + } + ] + }, + { + "name": "Asia/Kamchatka", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Krasnoyarsk", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Omsk", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Vladivostok", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Yakutsk", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Yekaterinburg", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Yerevan", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Australia/Lord_Howe", + "rules": [ + { + "e": 1396710000000, + "s": 1412436600000 + }, + { + "e": 1428159600000, + "s": 1443886200000 + }, + { + "e": 1459609200000, + "s": 1475335800000 + }, + { + "e": 1491058800000, + "s": 1506785400000 + }, + { + "e": 1522508400000, + "s": 1538839800000 + } + ] + }, + { + "name": "Australia/Perth", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Europe/Helsinki", + "rules": [ + { + "e": 1414285200000, + "s": 1396141200000 + }, + { + "e": 1445734800000, + "s": 1427590800000 + }, + { + "e": 1477789200000, + "s": 1459040400000 + }, + { + "e": 1509238800000, + "s": 1490490000000 + }, + { + "e": 1540688400000, + "s": 1521939600000 + } + ] + }, + { + "name": "Europe/Minsk", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Europe/Moscow", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Pacific/Apia", + "rules": [ + { + "e": 1396706400000, + "s": 1411826400000 + }, + { + "e": 1428156000000, + "s": 1443276000000 + }, + { + "e": 1459605600000, + "s": 1474725600000 + }, + { + "e": 1491055200000, + "s": 1506175200000 + }, + { + "e": 1522504800000, + "s": 1538229600000 + } + ] + }, + { + "name": "Pacific/Fiji", + "rules": [ + { + "e": 1421503200000, + "s": 1414850400000 + }, + { + "e": 1452952800000, + "s": 1446300000000 + }, + { + "e": 1484402400000, + "s": 1478354400000 + }, + { + "e": 1515852000000, + "s": 1509804000000 + }, + { + "e": 1547906400000, + "s": 1541253600000 + } + ] + }, + { + "name": "Europe/London", + "rules": [ + { + "e": 1414285200000, + "s": 1396141200000 + }, + { + "e": 1445734800000, + "s": 1427590800000 + }, + { + "e": 1477789200000, + "s": 1459040400000 + }, + { + "e": 1509238800000, + "s": 1490490000000 + }, + { + "e": 1540688400000, + "s": 1521939600000 + } + ] + } + ] +}; + +/*global exports, Intl*/ + +/** + * This script gives you the zone info key representing your device's time zone setting. + * + * @name jsTimezoneDetect + * @version 1.0.6 + * @author Jon Nylander + * @license MIT License - https://bitbucket.org/pellepim/jstimezonedetect/src/default/LICENCE.txt + * + * For usage and examples, visit: + * http://pellepim.bitbucket.org/jstz/ + * + * Copyright (c) Jon Nylander + */ + +const HEMISPHERE_SOUTH = 's'; + +const consts = { + DAY: 86400000, + HOUR: 3600000, + MINUTE: 60000, + SECOND: 1000, + BASELINE_YEAR: 2014, + MAX_SCORE: 864000000, // 10 days + AMBIGUITIES: { + 'America/Denver': ['America/Mazatlan'], + 'Europe/London': ['Africa/Casablanca'], + 'America/Chicago': ['America/Mexico_City'], + 'America/Asuncion': ['America/Campo_Grande', 'America/Santiago'], + 'America/Montevideo': ['America/Sao_Paulo', 'America/Santiago'], + // Europe/Minsk should not be in this list... but Windows. + 'Asia/Beirut': ['Asia/Amman', 'Asia/Jerusalem', 'Europe/Helsinki', 'Asia/Damascus', 'Africa/Cairo', 'Asia/Gaza', 'Europe/Minsk'], + 'Pacific/Auckland': ['Pacific/Fiji'], + 'America/Los_Angeles': ['America/Santa_Isabel'], + 'America/New_York': ['America/Havana'], + 'America/Halifax': ['America/Goose_Bay'], + 'America/Godthab': ['America/Miquelon'], + 'Asia/Dubai': ['Asia/Yerevan'], + 'Asia/Jakarta': ['Asia/Krasnoyarsk'], + 'Asia/Shanghai': ['Asia/Irkutsk', 'Australia/Perth'], + 'Australia/Sydney': ['Australia/Lord_Howe'], + 'Asia/Tokyo': ['Asia/Yakutsk'], + 'Asia/Dhaka': ['Asia/Omsk'], + // In the real world Yerevan is not ambigous for Baku... but Windows. + 'Asia/Baku': ['Asia/Yerevan'], + 'Australia/Brisbane': ['Asia/Vladivostok'], + 'Pacific/Noumea': ['Asia/Vladivostok'], + 'Pacific/Majuro': ['Asia/Kamchatka', 'Pacific/Fiji'], + 'Pacific/Tongatapu': ['Pacific/Apia'], + 'Asia/Baghdad': ['Europe/Minsk', 'Europe/Moscow'], + 'Asia/Karachi': ['Asia/Yekaterinburg'], + 'Africa/Johannesburg': ['Asia/Gaza', 'Africa/Cairo'] + } +}; + +/** + * Gets the offset in minutes from UTC for a certain date. + * @param {Date} date + * @returns {Number} + */ +const get_date_offset = function (date) { + var offset = -date.getTimezoneOffset(); + return (offset !== null ? offset : 0); +}; + +/** + * This function does some basic calculations to create information about + * the user's timezone. It uses REFERENCE_YEAR as a solid year for which + * the script has been tested rather than depend on the year set by the + * client device. + * + * Returns a key that can be used to do lookups in jstz.olson.timezones. + * eg: "720,1,2". + * + * @returns {String} + */ +const lookup_key = function() { + var january_offset = get_date_offset(new Date(consts.BASELINE_YEAR, 0, 2)), + june_offset = get_date_offset(new Date(consts.BASELINE_YEAR, 5, 2)), + diff = january_offset - june_offset; + + if (diff < 0) { + return january_offset + ",1"; + } else if (diff > 0) { + return june_offset + ",1," + HEMISPHERE_SOUTH; + } + + return january_offset + ",0"; +}; + + +/** + * Tries to get the time zone key directly from the operating system for those + * environments that support the ECMAScript Internationalization API. + */ +const get_from_internationalization_api = function() { + var format, timezone; + if (typeof Intl === "undefined" || typeof Intl.DateTimeFormat === "undefined") { + return; + } + format = Intl.DateTimeFormat(); + if (typeof format === "undefined" || typeof format.resolvedOptions === "undefined") { + return; + } + timezone = format.resolvedOptions().timeZone; + if (timezone && (timezone.indexOf("/") > -1 || timezone === 'UTC') && timezone.indexOf("Etc") != 0) { + return timezone; + } +}; + +/** + * Starting point for getting all the DST rules for a specific year + * for the current timezone (as described by the client system). + * + * Returns an object with start and end attributes, or false if no + * DST rules were found for the year. + * + * @param year + * @returns {Object} || {Boolean} + */ +const dst_dates = function(year) { + var yearstart = new Date(year, 0, 1, 0, 0, 1, 0).getTime(); + var yearend = new Date(year, 12, 31, 23, 59, 59).getTime(); + var current = yearstart; + var offset = (new Date(current)).getTimezoneOffset(); + var dst_start = null; + var dst_end = null; + + while (current < yearend - 86400000) { + var dateToCheck = new Date(current); + var dateToCheckOffset = dateToCheck.getTimezoneOffset(); + + if (dateToCheckOffset !== offset) { + if (dateToCheckOffset < offset) { + dst_start = dateToCheck; + } + if (dateToCheckOffset > offset) { + dst_end = dateToCheck; + } + offset = dateToCheckOffset; + } + + current += 86400000; + } + + if (dst_start && dst_end) { + return { + s: find_dst_fold(dst_start).getTime(), + e: find_dst_fold(dst_end).getTime() + }; + } + + return false; +}; + +/** + * Probably completely unnecessary function that recursively finds the + * exact (to the second) time when a DST rule was changed. + * + * @param a_date - The candidate Date. + * @param padding - integer specifying the padding to allow around the candidate + * date for finding the fold. + * @param iterator - integer specifying how many milliseconds to iterate while + * searching for the fold. + * + * @returns {Date} + */ +const find_dst_fold = function(a_date, padding, iterator) { + if (typeof padding === 'undefined') { + padding = consts.DAY; + iterator = consts.HOUR; + } + + var date_start = new Date(a_date.getTime() - padding).getTime(); + var date_end = a_date.getTime() + padding; + var offset = new Date(date_start).getTimezoneOffset(); + + var current = date_start; + + var dst_change = null; + while (current < date_end - iterator) { + var dateToCheck = new Date(current); + var dateToCheckOffset = dateToCheck.getTimezoneOffset(); + + if (dateToCheckOffset !== offset) { + dst_change = dateToCheck; + break; + } + current += iterator; + } + + if (padding === consts.DAY) { + return find_dst_fold(dst_change, consts.HOUR, consts.MINUTE); + } + + if (padding === consts.HOUR) { + return find_dst_fold(dst_change, consts.MINUTE, consts.SECOND); + } + + return dst_change; +}; + +const windows7_adaptations = function(rule_list, preliminary_timezone, score, sample) { + if (score !== 'N/A') { + return score; + } + if (preliminary_timezone === 'Asia/Beirut') { + if (sample.name === 'Africa/Cairo') { + if (rule_list[6].s === 1398376800000 && rule_list[6].e === 1411678800000) { + return 0; + } + } + if (sample.name === 'Asia/Jerusalem') { + if (rule_list[6].s === 1395964800000 && rule_list[6].e === 1411858800000) { + return 0; + } + } + } else if (preliminary_timezone === 'America/Santiago') { + if (sample.name === 'America/Asuncion') { + if (rule_list[6].s === 1412481600000 && rule_list[6].e === 1397358000000) { + return 0; + } + } + if (sample.name === 'America/Campo_Grande') { + if (rule_list[6].s === 1413691200000 && rule_list[6].e === 1392519600000) { + return 0; + } + } + } else if (preliminary_timezone === 'America/Montevideo') { + if (sample.name === 'America/Sao_Paulo') { + if (rule_list[6].s === 1413687600000 && rule_list[6].e === 1392516000000) { + return 0; + } + } + } else if (preliminary_timezone === 'Pacific/Auckland') { + if (sample.name === 'Pacific/Fiji') { + if (rule_list[6].s === 1414245600000 && rule_list[6].e === 1396101600000) { + return 0; + } + } + } + + return score; +}; + +/** + * Takes the DST rules for the current timezone, and proceeds to find matches + * in the jstz.olson.dst_rules.zones array. + * + * Compares samples to the current timezone on a scoring basis. + * + * Candidates are ruled immediately if either the candidate or the current zone + * has a DST rule where the other does not. + * + * Candidates are ruled out immediately if the current zone has a rule that is + * outside the DST scope of the candidate. + * + * Candidates are included for scoring if the current zones rules fall within the + * span of the samples rules. + * + * Low score is best, the score is calculated by summing up the differences in DST + * rules and if the consts.MAX_SCORE is overreached the candidate is ruled out. + * + * Yah follow? :) + * + * @param rule_list + * @param preliminary_timezone + * @returns {*} + */ +const best_dst_match = function (rule_list, preliminary_timezone) { + const score_sample = function(sample) { + var score = 0; + + for (var j = 0; j < rule_list.length; j++) { + + // Both sample and current time zone report DST during the year. + if (!!sample.rules[j] && !!rule_list[j]) { + + // The current time zone's DST rules are inside the sample's. Include. + if (rule_list[j].s >= sample.rules[j].s && rule_list[j].e <= sample.rules[j].e) { + score = 0; + score += Math.abs(rule_list[j].s - sample.rules[j].s); + score += Math.abs(sample.rules[j].e - rule_list[j].e); + + // The current time zone's DST rules are outside the sample's. Discard. + } else { + score = 'N/A'; + break; + } + + // The max score has been reached. Discard. + if (score > consts.MAX_SCORE) { + score = 'N/A'; + break; + } + } + } + + score = windows7_adaptations(rule_list, preliminary_timezone, score, sample); + + return score; + }; + + var scoreboard = {}; + var dst_zones = jstz.olson.dst_rules.zones; + var dst_zones_length = dst_zones.length; + var ambiguities = consts.AMBIGUITIES[preliminary_timezone]; + + for (var i = 0; i < dst_zones_length; i++) { + var sample = dst_zones[i]; + var score = score_sample(dst_zones[i]); + + if (score !== 'N/A') { + scoreboard[sample.name] = score; + } + } + + for (var tz in scoreboard) { + if (scoreboard.hasOwnProperty(tz)) { + for (var j = 0; j < ambiguities.length; j++) { + if (ambiguities[j] === tz) { + return tz; + } + } + } + } + + return preliminary_timezone; +}; + +/** + * Takes the preliminary_timezone as detected by lookup_key(). + * + * Builds up the current timezones DST rules for the years defined + * in the jstz.olson.dst_rules.years array. + * + * If there are no DST occurences for those years, immediately returns + * the preliminary timezone. Otherwise proceeds and tries to solve + * ambiguities. + * + * @param preliminary_timezone + * @returns {String} timezone_name + */ +const get_by_dst = function(preliminary_timezone) { + var get_rules = function get_rules() { + var rule_list = []; + for (var i = 0; i < jstz.olson.dst_rules.years.length; i++) { + var year_rules = dst_dates(jstz.olson.dst_rules.years[i]); + rule_list.push(year_rules); + } + return rule_list; + }; + var check_has_dst = function check_has_dst(rules) { + for (var i = 0; i < rules.length; i++) { + if (rules[i] !== false) { + return true; + } + } + return false; + }; + var rules = get_rules(); + var has_dst = check_has_dst(rules); + + if (has_dst) { + return best_dst_match(rules, preliminary_timezone); + } + + return preliminary_timezone; +}; + +/** + * Uses get_timezone_info() to formulate a key to use in the olson.timezones dictionary. + * + * Returns an object with one function ".name()" + * + * @returns Object + */ +const determine = function() { + var preliminary_tz = get_from_internationalization_api(); + + if (!preliminary_tz) { + preliminary_tz = jstz.olson.timezones[lookup_key()]; + + if (typeof consts.AMBIGUITIES[preliminary_tz] !== 'undefined') { + preliminary_tz = get_by_dst(preliminary_tz); + } + } + + return { + name: function () { + return preliminary_tz; + }, + stdTimezoneOffset : function () { + // negative to match what (new Date).getTimezoneOffset() will return + return -lookup_key().split(',')[0]; + }, + timezoneOffset : function () { + // negative to match what (new Date).getTimezoneOffset() will return + return -get_date_offset(new Date()) + } + }; +}; + +/** + * The keys in this dictionary are comma separated as such: + * + * First the offset compared to UTC time in minutes. + * + * Then a flag which is 0 if the timezone does not take daylight savings into account and 1 if it + * does. + * + * Thirdly an optional 's' signifies that the timezone is in the southern hemisphere, + * only interesting for timezones with DST. + * + * The mapped arrays is used for constructing the jstz.TimeZone object from within + * jstz.determine(); + */ +const olson = { + timezones: { + '-720,0': 'Etc/GMT+12', + '-660,0': 'Pacific/Pago_Pago', + '-660,1,s': 'Pacific/Apia', // Why? Because windows... cry! + '-600,1': 'America/Adak', + '-600,0': 'Pacific/Honolulu', + '-570,0': 'Pacific/Marquesas', + '-540,0': 'Pacific/Gambier', + '-540,1': 'America/Anchorage', + '-480,1': 'America/Los_Angeles', + '-480,0': 'Pacific/Pitcairn', + '-420,0': 'America/Phoenix', + '-420,1': 'America/Denver', + '-360,0': 'America/Guatemala', + '-360,1': 'America/Chicago', + '-360,1,s': 'Pacific/Easter', + '-300,0': 'America/Bogota', + '-300,1': 'America/New_York', + '-270,0': 'America/Caracas', + '-240,1': 'America/Halifax', + '-240,0': 'America/Santo_Domingo', + '-240,1,s': 'America/Asuncion', + '-210,1': 'America/St_Johns', + '-180,1': 'America/Godthab', + '-180,0': 'America/Argentina/Buenos_Aires', + '-180,1,s': 'America/Montevideo', + '-120,0': 'America/Noronha', + '-120,1': 'America/Noronha', + '-60,1': 'Atlantic/Azores', + '-60,0': 'Atlantic/Cape_Verde', + '0,0': 'UTC', + '0,1': 'Europe/London', + '60,1': 'Europe/Berlin', + '60,0': 'Africa/Lagos', + '60,1,s': 'Africa/Windhoek', + '120,1': 'Asia/Beirut', + '120,0': 'Africa/Johannesburg', + '180,0': 'Asia/Baghdad', + '180,1': 'Europe/Moscow', + '210,1': 'Asia/Tehran', + '240,0': 'Asia/Dubai', + '240,1': 'Asia/Baku', + '270,0': 'Asia/Kabul', + '300,1': 'Asia/Yekaterinburg', + '300,0': 'Asia/Karachi', + '330,0': 'Asia/Kolkata', + '345,0': 'Asia/Kathmandu', + '360,0': 'Asia/Dhaka', + '360,1': 'Asia/Omsk', + '390,0': 'Asia/Rangoon', + '420,1': 'Asia/Krasnoyarsk', + '420,0': 'Asia/Jakarta', + '480,0': 'Asia/Shanghai', + '480,1': 'Asia/Irkutsk', + '525,0': 'Australia/Eucla', + '525,1,s': 'Australia/Eucla', + '540,1': 'Asia/Yakutsk', + '540,0': 'Asia/Tokyo', + '570,0': 'Australia/Darwin', + '570,1,s': 'Australia/Adelaide', + '600,0': 'Australia/Brisbane', + '600,1': 'Asia/Vladivostok', + '600,1,s': 'Australia/Sydney', + '630,1,s': 'Australia/Lord_Howe', + '660,1': 'Asia/Kamchatka', + '660,0': 'Pacific/Noumea', + '690,0': 'Pacific/Norfolk', + '720,1,s': 'Pacific/Auckland', + '720,0': 'Pacific/Majuro', + '765,1,s': 'Pacific/Chatham', + '780,0': 'Pacific/Tongatapu', + '780,1,s': 'Pacific/Apia', + '840,0': 'Pacific/Kiritimati' + }, + dst_rules +}; + +const jstz = { + olson +}; + +var jstz$1 = { + determine, +}; + +export default jstz$1; diff --git a/dist/jstz.js b/dist/jstz.js index a70f587..1dbedd6 100644 --- a/dist/jstz.js +++ b/dist/jstz.js @@ -1,1436 +1,1585 @@ -(function (root) {/*global exports, Intl*/ -/** - * This script gives you the zone info key representing your device's time zone setting. - * - * @name jsTimezoneDetect - * @version 1.0.6 - * @author Jon Nylander - * @license MIT License - https://bitbucket.org/pellepim/jstimezonedetect/src/default/LICENCE.txt - * - * For usage and examples, visit: - * http://pellepim.bitbucket.org/jstz/ - * - * Copyright (c) Jon Nylander - */ - - -/** - * Namespace to hold all the code for timezone detection. - */ -var jstz = (function () { - 'use strict'; - var HEMISPHERE_SOUTH = 's', - - consts = { - DAY: 86400000, - HOUR: 3600000, - MINUTE: 60000, - SECOND: 1000, - BASELINE_YEAR: 2014, - MAX_SCORE: 864000000, // 10 days - AMBIGUITIES: { - 'America/Denver': ['America/Mazatlan'], - 'Europe/London': ['Africa/Casablanca'], - 'America/Chicago': ['America/Mexico_City'], - 'America/Asuncion': ['America/Campo_Grande', 'America/Santiago'], - 'America/Montevideo': ['America/Sao_Paulo', 'America/Santiago'], - // Europe/Minsk should not be in this list... but Windows. - 'Asia/Beirut': ['Asia/Amman', 'Asia/Jerusalem', 'Europe/Helsinki', 'Asia/Damascus', 'Africa/Cairo', 'Asia/Gaza', 'Europe/Minsk'], - 'Pacific/Auckland': ['Pacific/Fiji'], - 'America/Los_Angeles': ['America/Santa_Isabel'], - 'America/New_York': ['America/Havana'], - 'America/Halifax': ['America/Goose_Bay'], - 'America/Godthab': ['America/Miquelon'], - 'Asia/Dubai': ['Asia/Yerevan'], - 'Asia/Jakarta': ['Asia/Krasnoyarsk'], - 'Asia/Shanghai': ['Asia/Irkutsk', 'Australia/Perth'], - 'Australia/Sydney': ['Australia/Lord_Howe'], - 'Asia/Tokyo': ['Asia/Yakutsk'], - 'Asia/Dhaka': ['Asia/Omsk'], - // In the real world Yerevan is not ambigous for Baku... but Windows. - 'Asia/Baku': ['Asia/Yerevan'], - 'Australia/Brisbane': ['Asia/Vladivostok'], - 'Pacific/Noumea': ['Asia/Vladivostok'], - 'Pacific/Majuro': ['Asia/Kamchatka', 'Pacific/Fiji'], - 'Pacific/Tongatapu': ['Pacific/Apia'], - 'Asia/Baghdad': ['Europe/Minsk', 'Europe/Moscow'], - 'Asia/Karachi': ['Asia/Yekaterinburg'], - 'Africa/Johannesburg': ['Asia/Gaza', 'Africa/Cairo'] - } - }, - - /** - * Gets the offset in minutes from UTC for a certain date. - * @param {Date} date - * @returns {Number} - */ - get_date_offset = function get_date_offset(date) { - var offset = -date.getTimezoneOffset(); - return (offset !== null ? offset : 0); - }, - - /** - * This function does some basic calculations to create information about - * the user's timezone. It uses REFERENCE_YEAR as a solid year for which - * the script has been tested rather than depend on the year set by the - * client device. - * - * Returns a key that can be used to do lookups in jstz.olson.timezones. - * eg: "720,1,2". - * - * @returns {String} - */ - lookup_key = function lookup_key() { - var january_offset = get_date_offset(new Date(consts.BASELINE_YEAR, 0, 2)), - june_offset = get_date_offset(new Date(consts.BASELINE_YEAR, 5, 2)), - diff = january_offset - june_offset; - - if (diff < 0) { - return january_offset + ",1"; - } else if (diff > 0) { - return june_offset + ",1," + HEMISPHERE_SOUTH; - } +/* jstz.min.js Version: 2.1.1 Build date: 2018-12-29 */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.jstz = factory()); +}(this, function () { 'use strict'; - return january_offset + ",0"; - }, + var _isObject = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; + }; + var toString = {}.toString; - /** - * Tries to get the time zone key directly from the operating system for those - * environments that support the ECMAScript Internationalization API. - */ - get_from_internationalization_api = function get_from_internationalization_api() { - var format, timezone; - if (typeof Intl === "undefined" || typeof Intl.DateTimeFormat === "undefined") { - return; - } - format = Intl.DateTimeFormat(); - if (typeof format === "undefined" || typeof format.resolvedOptions === "undefined") { - return; - } - timezone = format.resolvedOptions().timeZone; - if (timezone && (timezone.indexOf("/") > -1 || timezone === 'UTC') && timezone.indexOf("Etc") != 0) { - return timezone; - } - }, - - /** - * Starting point for getting all the DST rules for a specific year - * for the current timezone (as described by the client system). - * - * Returns an object with start and end attributes, or false if no - * DST rules were found for the year. - * - * @param year - * @returns {Object} || {Boolean} - */ - dst_dates = function dst_dates(year) { - var yearstart = new Date(year, 0, 1, 0, 0, 1, 0).getTime(); - var yearend = new Date(year, 12, 31, 23, 59, 59).getTime(); - var current = yearstart; - var offset = (new Date(current)).getTimezoneOffset(); - var dst_start = null; - var dst_end = null; - - while (current < yearend - 86400000) { - var dateToCheck = new Date(current); - var dateToCheckOffset = dateToCheck.getTimezoneOffset(); - - if (dateToCheckOffset !== offset) { - if (dateToCheckOffset < offset) { - dst_start = dateToCheck; - } - if (dateToCheckOffset > offset) { - dst_end = dateToCheck; - } - offset = dateToCheckOffset; - } - - current += 86400000; - } + var _cof = function (it) { + return toString.call(it).slice(8, -1); + }; - if (dst_start && dst_end) { - return { - s: find_dst_fold(dst_start).getTime(), - e: find_dst_fold(dst_end).getTime() - }; - } + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } - return false; - }, - - /** - * Probably completely unnecessary function that recursively finds the - * exact (to the second) time when a DST rule was changed. - * - * @param a_date - The candidate Date. - * @param padding - integer specifying the padding to allow around the candidate - * date for finding the fold. - * @param iterator - integer specifying how many milliseconds to iterate while - * searching for the fold. - * - * @returns {Date} - */ - find_dst_fold = function find_dst_fold(a_date, padding, iterator) { - if (typeof padding === 'undefined') { - padding = consts.DAY; - iterator = consts.HOUR; - } + var _core = createCommonjsModule(function (module) { + var core = module.exports = { version: '2.6.1' }; + if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + }); - var date_start = new Date(a_date.getTime() - padding).getTime(); - var date_end = a_date.getTime() + padding; - var offset = new Date(date_start).getTimezoneOffset(); + var _global = createCommonjsModule(function (module) { + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); + if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef + }); - var current = date_start; + var _library = false; - var dst_change = null; - while (current < date_end - iterator) { - var dateToCheck = new Date(current); - var dateToCheckOffset = dateToCheck.getTimezoneOffset(); + var _shared = createCommonjsModule(function (module) { + var SHARED = '__core-js_shared__'; + var store = _global[SHARED] || (_global[SHARED] = {}); - if (dateToCheckOffset !== offset) { - dst_change = dateToCheck; - break; - } - current += iterator; - } + (module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); + })('versions', []).push({ + version: _core.version, + mode: _library ? 'pure' : 'global', + copyright: '© 2018 Denis Pushkarev (zloirock.ru)' + }); + }); - if (padding === consts.DAY) { - return find_dst_fold(dst_change, consts.HOUR, consts.MINUTE); - } + var id = 0; + var px = Math.random(); + var _uid = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); + }; - if (padding === consts.HOUR) { - return find_dst_fold(dst_change, consts.MINUTE, consts.SECOND); - } + var _wks = createCommonjsModule(function (module) { + var store = _shared('wks'); - return dst_change; - }, + var Symbol = _global.Symbol; + var USE_SYMBOL = typeof Symbol == 'function'; - windows7_adaptations = function windows7_adaptions(rule_list, preliminary_timezone, score, sample) { - if (score !== 'N/A') { - return score; - } - if (preliminary_timezone === 'Asia/Beirut') { - if (sample.name === 'Africa/Cairo') { - if (rule_list[6].s === 1398376800000 && rule_list[6].e === 1411678800000) { - return 0; - } - } - if (sample.name === 'Asia/Jerusalem') { - if (rule_list[6].s === 1395964800000 && rule_list[6].e === 1411858800000) { - return 0; - } - } - } else if (preliminary_timezone === 'America/Santiago') { - if (sample.name === 'America/Asuncion') { - if (rule_list[6].s === 1412481600000 && rule_list[6].e === 1397358000000) { - return 0; - } - } - if (sample.name === 'America/Campo_Grande') { - if (rule_list[6].s === 1413691200000 && rule_list[6].e === 1392519600000) { - return 0; - } - } - } else if (preliminary_timezone === 'America/Montevideo') { - if (sample.name === 'America/Sao_Paulo') { - if (rule_list[6].s === 1413687600000 && rule_list[6].e === 1392516000000) { - return 0; - } - } - } else if (preliminary_timezone === 'Pacific/Auckland') { - if (sample.name === 'Pacific/Fiji') { - if (rule_list[6].s === 1414245600000 && rule_list[6].e === 1396101600000) { - return 0; - } - } - } + var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid)('Symbol.' + name)); + }; - return score; - }, - - /** - * Takes the DST rules for the current timezone, and proceeds to find matches - * in the jstz.olson.dst_rules.zones array. - * - * Compares samples to the current timezone on a scoring basis. - * - * Candidates are ruled immediately if either the candidate or the current zone - * has a DST rule where the other does not. - * - * Candidates are ruled out immediately if the current zone has a rule that is - * outside the DST scope of the candidate. - * - * Candidates are included for scoring if the current zones rules fall within the - * span of the samples rules. - * - * Low score is best, the score is calculated by summing up the differences in DST - * rules and if the consts.MAX_SCORE is overreached the candidate is ruled out. - * - * Yah follow? :) - * - * @param rule_list - * @param preliminary_timezone - * @returns {*} - */ - best_dst_match = function best_dst_match(rule_list, preliminary_timezone) { - var score_sample = function score_sample(sample) { - var score = 0; - - for (var j = 0; j < rule_list.length; j++) { - - // Both sample and current time zone report DST during the year. - if (!!sample.rules[j] && !!rule_list[j]) { - - // The current time zone's DST rules are inside the sample's. Include. - if (rule_list[j].s >= sample.rules[j].s && rule_list[j].e <= sample.rules[j].e) { - score = 0; - score += Math.abs(rule_list[j].s - sample.rules[j].s); - score += Math.abs(sample.rules[j].e - rule_list[j].e); - - // The current time zone's DST rules are outside the sample's. Discard. - } else { - score = 'N/A'; - break; - } - - // The max score has been reached. Discard. - if (score > consts.MAX_SCORE) { - score = 'N/A'; - break; - } - } - } - - score = windows7_adaptations(rule_list, preliminary_timezone, score, sample); - - return score; - }; - var scoreboard = {}; - var dst_zones = jstz.olson.dst_rules.zones; - var dst_zones_length = dst_zones.length; - var ambiguities = consts.AMBIGUITIES[preliminary_timezone]; - - for (var i = 0; i < dst_zones_length; i++) { - var sample = dst_zones[i]; - var score = score_sample(dst_zones[i]); - - if (score !== 'N/A') { - scoreboard[sample.name] = score; - } - } + $exports.store = store; + }); - for (var tz in scoreboard) { - if (scoreboard.hasOwnProperty(tz)) { - for (var j = 0; j < ambiguities.length; j++) { - if (ambiguities[j] === tz) { - return tz; - } - } - } - } + // 7.2.8 IsRegExp(argument) - return preliminary_timezone; - }, - - /** - * Takes the preliminary_timezone as detected by lookup_key(). - * - * Builds up the current timezones DST rules for the years defined - * in the jstz.olson.dst_rules.years array. - * - * If there are no DST occurences for those years, immediately returns - * the preliminary timezone. Otherwise proceeds and tries to solve - * ambiguities. - * - * @param preliminary_timezone - * @returns {String} timezone_name - */ - get_by_dst = function get_by_dst(preliminary_timezone) { - var get_rules = function get_rules() { - var rule_list = []; - for (var i = 0; i < jstz.olson.dst_rules.years.length; i++) { - var year_rules = dst_dates(jstz.olson.dst_rules.years[i]); - rule_list.push(year_rules); - } - return rule_list; - }; - var check_has_dst = function check_has_dst(rules) { - for (var i = 0; i < rules.length; i++) { - if (rules[i] !== false) { - return true; - } - } - return false; - }; - var rules = get_rules(); - var has_dst = check_has_dst(rules); - - if (has_dst) { - return best_dst_match(rules, preliminary_timezone); - } - return preliminary_timezone; - }, - - /** - * Uses get_timezone_info() to formulate a key to use in the olson.timezones dictionary. - * - * Returns an object with one function ".name()" - * - * @returns Object - */ - determine = function determine() { - var preliminary_tz = get_from_internationalization_api(); - - if (!preliminary_tz) { - preliminary_tz = jstz.olson.timezones[lookup_key()]; - - if (typeof consts.AMBIGUITIES[preliminary_tz] !== 'undefined') { - preliminary_tz = get_by_dst(preliminary_tz); - } - } + var MATCH = _wks('match'); + var _isRegexp = function (it) { + var isRegExp; + return _isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : _cof(it) == 'RegExp'); + }; + + var _anObject = function (it) { + if (!_isObject(it)) throw TypeError(it + ' is not an object!'); + return it; + }; + + var _aFunction = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; + }; + + // 7.3.20 SpeciesConstructor(O, defaultConstructor) + + + var SPECIES = _wks('species'); + var _speciesConstructor = function (O, D) { + var C = _anObject(O).constructor; + var S; + return C === undefined || (S = _anObject(C)[SPECIES]) == undefined ? D : _aFunction(S); + }; + + // 7.1.4 ToInteger + var ceil = Math.ceil; + var floor = Math.floor; + var _toInteger = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); + }; + + // 7.2.1 RequireObjectCoercible(argument) + var _defined = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; + }; + + // true -> String#at + // false -> String#codePointAt + var _stringAt = function (TO_STRING) { + return function (that, pos) { + var s = String(_defined(that)); + var i = _toInteger(pos); + var l = s.length; + var a, b; + if (i < 0 || i >= l) return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; + }; + + var at = _stringAt(true); + + // `AdvanceStringIndex` abstract operation + // https://tc39.github.io/ecma262/#sec-advancestringindex + var _advanceStringIndex = function (S, index, unicode) { + return index + (unicode ? at(S, index).length : 1); + }; + + // 7.1.15 ToLength + + var min = Math.min; + var _toLength = function (it) { + return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 + }; + + // getting tag from 19.1.3.6 Object.prototype.toString() + + var TAG = _wks('toStringTag'); + // ES3 wrong here + var ARG = _cof(function () { return arguments; }()) == 'Arguments'; + + // fallback for IE11 Script Access Denied error + var tryGet = function (it, key) { + try { + return it[key]; + } catch (e) { /* empty */ } + }; + + var _classof = function (it) { + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? _cof(O) + // ES3 arguments fallback + : (B = _cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; + }; + + var builtinExec = RegExp.prototype.exec; + + // `RegExpExec` abstract operation + // https://tc39.github.io/ecma262/#sec-regexpexec + var _regexpExecAbstract = function (R, S) { + var exec = R.exec; + if (typeof exec === 'function') { + var result = exec.call(R, S); + if (typeof result !== 'object') { + throw new TypeError('RegExp exec method returned something other than an Object or null'); + } + return result; + } + if (_classof(R) !== 'RegExp') { + throw new TypeError('RegExp#exec called on incompatible receiver'); + } + return builtinExec.call(R, S); + }; - return { - name: function () { - return preliminary_tz; - }, - stdTimezoneOffset : function () { - // negative to match what (new Date).getTimezoneOffset() will return - return -lookup_key().split(',')[0]; - }, - timezoneOffset : function () { - // negative to match what (new Date).getTimezoneOffset() will return - return -get_date_offset(new Date()) - } - }; - }; + // 21.2.5.3 get RegExp.prototype.flags + + var _flags = function () { + var that = _anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; + }; + + var nativeExec = RegExp.prototype.exec; + // This always refers to the native implementation, because the + // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, + // which loads this file before patching the method. + var nativeReplace = String.prototype.replace; + + var patchedExec = nativeExec; + + var LAST_INDEX = 'lastIndex'; + + var UPDATES_LAST_INDEX_WRONG = (function () { + var re1 = /a/, + re2 = /b*/g; + nativeExec.call(re1, 'a'); + nativeExec.call(re2, 'a'); + return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0; + })(); + + // nonparticipating capturing group, copied from es5-shim's String#split patch. + var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; + + var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; + + if (PATCH) { + patchedExec = function exec(str) { + var re = this; + var lastIndex, reCopy, match, i; + + if (NPCG_INCLUDED) { + reCopy = new RegExp('^' + re.source + '$(?!\\s)', _flags.call(re)); + } + if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX]; + + match = nativeExec.call(re, str); + + if (UPDATES_LAST_INDEX_WRONG && match) { + re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex; + } + if (NPCG_INCLUDED && match && match.length > 1) { + // Fix browsers whose `exec` methods don't consistently return `undefined` + // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ + // eslint-disable-next-line no-loop-func + nativeReplace.call(match[0], reCopy, function () { + for (i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) match[i] = undefined; + } + }); + } + + return match; + }; + } + var _regexpExec = patchedExec; + + var _fails = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } + }; + + // Thank's IE8 for his funny defineProperty + var _descriptors = !_fails(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; + }); + + var document = _global.document; + // typeof document.createElement is 'object' in old IE + var is = _isObject(document) && _isObject(document.createElement); + var _domCreate = function (it) { + return is ? document.createElement(it) : {}; + }; + + var _ie8DomDefine = !_descriptors && !_fails(function () { + return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7; + }); + + // 7.1.1 ToPrimitive(input [, PreferredType]) + + // instead of the ES6 spec version, we didn't implement @@toPrimitive case + // and the second argument - flag - preferred type is a string + var _toPrimitive = function (it, S) { + if (!_isObject(it)) return it; + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val; + throw TypeError("Can't convert object to primitive value"); + }; + + var dP = Object.defineProperty; + + var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) { + _anObject(O); + P = _toPrimitive(P, true); + _anObject(Attributes); + if (_ie8DomDefine) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; + }; + + var _objectDp = { + f: f + }; + + var _propertyDesc = function (bitmap, value) { return { - determine: determine + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value }; -}()); - - -jstz.olson = jstz.olson || {}; - -/** - * The keys in this dictionary are comma separated as such: - * - * First the offset compared to UTC time in minutes. - * - * Then a flag which is 0 if the timezone does not take daylight savings into account and 1 if it - * does. - * - * Thirdly an optional 's' signifies that the timezone is in the southern hemisphere, - * only interesting for timezones with DST. - * - * The mapped arrays is used for constructing the jstz.TimeZone object from within - * jstz.determine(); - */ -jstz.olson.timezones = { - '-720,0': 'Etc/GMT+12', - '-660,0': 'Pacific/Pago_Pago', - '-660,1,s': 'Pacific/Apia', // Why? Because windows... cry! - '-600,1': 'America/Adak', - '-600,0': 'Pacific/Honolulu', - '-570,0': 'Pacific/Marquesas', - '-540,0': 'Pacific/Gambier', - '-540,1': 'America/Anchorage', - '-480,1': 'America/Los_Angeles', - '-480,0': 'Pacific/Pitcairn', - '-420,0': 'America/Phoenix', - '-420,1': 'America/Denver', - '-360,0': 'America/Guatemala', - '-360,1': 'America/Chicago', - '-360,1,s': 'Pacific/Easter', - '-300,0': 'America/Bogota', - '-300,1': 'America/New_York', - '-270,0': 'America/Caracas', - '-240,1': 'America/Halifax', - '-240,0': 'America/Santo_Domingo', - '-240,1,s': 'America/Asuncion', - '-210,1': 'America/St_Johns', - '-180,1': 'America/Godthab', - '-180,0': 'America/Argentina/Buenos_Aires', - '-180,1,s': 'America/Montevideo', - '-120,0': 'America/Noronha', - '-120,1': 'America/Noronha', - '-60,1': 'Atlantic/Azores', - '-60,0': 'Atlantic/Cape_Verde', - '0,0': 'UTC', - '0,1': 'Europe/London', - '60,1': 'Europe/Berlin', - '60,0': 'Africa/Lagos', - '60,1,s': 'Africa/Windhoek', - '120,1': 'Asia/Beirut', - '120,0': 'Africa/Johannesburg', - '180,0': 'Asia/Baghdad', - '180,1': 'Europe/Moscow', - '210,1': 'Asia/Tehran', - '240,0': 'Asia/Dubai', - '240,1': 'Asia/Baku', - '270,0': 'Asia/Kabul', - '300,1': 'Asia/Yekaterinburg', - '300,0': 'Asia/Karachi', - '330,0': 'Asia/Kolkata', - '345,0': 'Asia/Kathmandu', - '360,0': 'Asia/Dhaka', - '360,1': 'Asia/Omsk', - '390,0': 'Asia/Rangoon', - '420,1': 'Asia/Krasnoyarsk', - '420,0': 'Asia/Jakarta', - '480,0': 'Asia/Shanghai', - '480,1': 'Asia/Irkutsk', - '525,0': 'Australia/Eucla', - '525,1,s': 'Australia/Eucla', - '540,1': 'Asia/Yakutsk', - '540,0': 'Asia/Tokyo', - '570,0': 'Australia/Darwin', - '570,1,s': 'Australia/Adelaide', - '600,0': 'Australia/Brisbane', - '600,1': 'Asia/Vladivostok', - '600,1,s': 'Australia/Sydney', - '630,1,s': 'Australia/Lord_Howe', - '660,1': 'Asia/Kamchatka', - '660,0': 'Pacific/Noumea', - '690,0': 'Pacific/Norfolk', - '720,1,s': 'Pacific/Auckland', - '720,0': 'Pacific/Majuro', - '765,1,s': 'Pacific/Chatham', - '780,0': 'Pacific/Tongatapu', - '780,1,s': 'Pacific/Apia', - '840,0': 'Pacific/Kiritimati' -}; - -/* Build time: 2015-11-02 13:01:00Z Build by invoking python utilities/dst.py generate */ -jstz.olson.dst_rules = { - "years": [ - 2008, - 2009, - 2010, - 2011, - 2012, - 2013, - 2014 - ], - "zones": [ - { - "name": "Africa/Cairo", - "rules": [ - { - "e": 1219957200000, - "s": 1209074400000 - }, - { - "e": 1250802000000, - "s": 1240524000000 - }, - { - "e": 1285880400000, - "s": 1284069600000 - }, - false, - false, - false, - { - "e": 1411678800000, - "s": 1406844000000 - } - ] - }, - { - "name": "Africa/Casablanca", - "rules": [ - { - "e": 1220223600000, - "s": 1212278400000 - }, - { - "e": 1250809200000, - "s": 1243814400000 - }, - { - "e": 1281222000000, - "s": 1272758400000 - }, - { - "e": 1312066800000, - "s": 1301788800000 - }, - { - "e": 1348970400000, - "s": 1345428000000 - }, - { - "e": 1382839200000, - "s": 1376100000000 - }, - { - "e": 1414288800000, - "s": 1406944800000 - } - ] - }, - { - "name": "America/Asuncion", - "rules": [ - { - "e": 1205031600000, - "s": 1224388800000 - }, - { - "e": 1236481200000, - "s": 1255838400000 - }, - { - "e": 1270954800000, - "s": 1286078400000 - }, - { - "e": 1302404400000, - "s": 1317528000000 - }, - { - "e": 1333854000000, - "s": 1349582400000 - }, - { - "e": 1364094000000, - "s": 1381032000000 - }, - { - "e": 1395543600000, - "s": 1412481600000 - } - ] - }, - { - "name": "America/Campo_Grande", - "rules": [ - { - "e": 1203217200000, - "s": 1224388800000 - }, - { - "e": 1234666800000, - "s": 1255838400000 - }, - { - "e": 1266721200000, - "s": 1287288000000 - }, - { - "e": 1298170800000, - "s": 1318737600000 - }, - { - "e": 1330225200000, - "s": 1350792000000 - }, - { - "e": 1361070000000, - "s": 1382241600000 - }, - { - "e": 1392519600000, - "s": 1413691200000 - } - ] - }, - { - "name": "America/Goose_Bay", - "rules": [ - { - "e": 1225594860000, - "s": 1205035260000 - }, - { - "e": 1257044460000, - "s": 1236484860000 - }, - { - "e": 1289098860000, - "s": 1268539260000 - }, - { - "e": 1320555600000, - "s": 1299988860000 - }, - { - "e": 1352005200000, - "s": 1331445600000 - }, - { - "e": 1383454800000, - "s": 1362895200000 - }, - { - "e": 1414904400000, - "s": 1394344800000 - } - ] - }, - { - "name": "America/Havana", - "rules": [ - { - "e": 1224997200000, - "s": 1205643600000 - }, - { - "e": 1256446800000, - "s": 1236488400000 - }, - { - "e": 1288501200000, - "s": 1268542800000 - }, - { - "e": 1321160400000, - "s": 1300597200000 - }, - { - "e": 1352005200000, - "s": 1333256400000 - }, - { - "e": 1383454800000, - "s": 1362891600000 - }, - { - "e": 1414904400000, - "s": 1394341200000 - } - ] - }, - { - "name": "America/Mazatlan", - "rules": [ - { - "e": 1225008000000, - "s": 1207472400000 - }, - { - "e": 1256457600000, - "s": 1238922000000 - }, - { - "e": 1288512000000, - "s": 1270371600000 - }, - { - "e": 1319961600000, - "s": 1301821200000 - }, - { - "e": 1351411200000, - "s": 1333270800000 - }, - { - "e": 1382860800000, - "s": 1365325200000 - }, - { - "e": 1414310400000, - "s": 1396774800000 - } - ] - }, - { - "name": "America/Mexico_City", - "rules": [ - { - "e": 1225004400000, - "s": 1207468800000 - }, - { - "e": 1256454000000, - "s": 1238918400000 - }, - { - "e": 1288508400000, - "s": 1270368000000 - }, - { - "e": 1319958000000, - "s": 1301817600000 - }, - { - "e": 1351407600000, - "s": 1333267200000 - }, - { - "e": 1382857200000, - "s": 1365321600000 - }, - { - "e": 1414306800000, - "s": 1396771200000 - } - ] - }, - { - "name": "America/Miquelon", - "rules": [ - { - "e": 1225598400000, - "s": 1205038800000 - }, - { - "e": 1257048000000, - "s": 1236488400000 - }, - { - "e": 1289102400000, - "s": 1268542800000 - }, - { - "e": 1320552000000, - "s": 1299992400000 - }, - { - "e": 1352001600000, - "s": 1331442000000 - }, - { - "e": 1383451200000, - "s": 1362891600000 - }, - { - "e": 1414900800000, - "s": 1394341200000 - } - ] - }, - { - "name": "America/Santa_Isabel", - "rules": [ - { - "e": 1225011600000, - "s": 1207476000000 - }, - { - "e": 1256461200000, - "s": 1238925600000 - }, - { - "e": 1288515600000, - "s": 1270375200000 - }, - { - "e": 1319965200000, - "s": 1301824800000 - }, - { - "e": 1351414800000, - "s": 1333274400000 - }, - { - "e": 1382864400000, - "s": 1365328800000 - }, - { - "e": 1414314000000, - "s": 1396778400000 - } - ] - }, - { - "name": "America/Santiago", - "rules": [ - { - "e": 1206846000000, - "s": 1223784000000 - }, - { - "e": 1237086000000, - "s": 1255233600000 - }, - { - "e": 1270350000000, - "s": 1286683200000 - }, - { - "e": 1304823600000, - "s": 1313899200000 - }, - { - "e": 1335668400000, - "s": 1346558400000 - }, - { - "e": 1367118000000, - "s": 1378612800000 - }, - { - "e": 1398567600000, - "s": 1410062400000 - } - ] - }, - { - "name": "America/Sao_Paulo", - "rules": [ - { - "e": 1203213600000, - "s": 1224385200000 - }, - { - "e": 1234663200000, - "s": 1255834800000 - }, - { - "e": 1266717600000, - "s": 1287284400000 - }, - { - "e": 1298167200000, - "s": 1318734000000 - }, - { - "e": 1330221600000, - "s": 1350788400000 - }, - { - "e": 1361066400000, - "s": 1382238000000 - }, - { - "e": 1392516000000, - "s": 1413687600000 - } - ] - }, - { - "name": "Asia/Amman", - "rules": [ - { - "e": 1225404000000, - "s": 1206655200000 - }, - { - "e": 1256853600000, - "s": 1238104800000 - }, - { - "e": 1288303200000, - "s": 1269554400000 - }, - { - "e": 1319752800000, - "s": 1301608800000 - }, - false, - false, - { - "e": 1414706400000, - "s": 1395957600000 - } - ] - }, - { - "name": "Asia/Damascus", - "rules": [ - { - "e": 1225486800000, - "s": 1207260000000 - }, - { - "e": 1256850000000, - "s": 1238104800000 - }, - { - "e": 1288299600000, - "s": 1270159200000 - }, - { - "e": 1319749200000, - "s": 1301608800000 - }, - { - "e": 1351198800000, - "s": 1333058400000 - }, - { - "e": 1382648400000, - "s": 1364508000000 - }, - { - "e": 1414702800000, - "s": 1395957600000 - } - ] - }, - { - "name": "Asia/Dubai", - "rules": [ - false, - false, - false, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Gaza", - "rules": [ - { - "e": 1219957200000, - "s": 1206655200000 - }, - { - "e": 1252015200000, - "s": 1238104800000 - }, - { - "e": 1281474000000, - "s": 1269640860000 - }, - { - "e": 1312146000000, - "s": 1301608860000 - }, - { - "e": 1348178400000, - "s": 1333058400000 - }, - { - "e": 1380229200000, - "s": 1364508000000 - }, - { - "e": 1414098000000, - "s": 1395957600000 - } - ] - }, - { - "name": "Asia/Irkutsk", - "rules": [ - { - "e": 1224957600000, - "s": 1206813600000 - }, - { - "e": 1256407200000, - "s": 1238263200000 - }, - { - "e": 1288461600000, - "s": 1269712800000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Jerusalem", - "rules": [ - { - "e": 1223161200000, - "s": 1206662400000 - }, - { - "e": 1254006000000, - "s": 1238112000000 - }, - { - "e": 1284246000000, - "s": 1269561600000 - }, - { - "e": 1317510000000, - "s": 1301616000000 - }, - { - "e": 1348354800000, - "s": 1333065600000 - }, - { - "e": 1382828400000, - "s": 1364515200000 - }, - { - "e": 1414278000000, - "s": 1395964800000 - } - ] - }, - { - "name": "Asia/Kamchatka", - "rules": [ - { - "e": 1224943200000, - "s": 1206799200000 - }, - { - "e": 1256392800000, - "s": 1238248800000 - }, - { - "e": 1288450800000, - "s": 1269698400000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Krasnoyarsk", - "rules": [ - { - "e": 1224961200000, - "s": 1206817200000 - }, - { - "e": 1256410800000, - "s": 1238266800000 - }, - { - "e": 1288465200000, - "s": 1269716400000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Omsk", - "rules": [ - { - "e": 1224964800000, - "s": 1206820800000 - }, - { - "e": 1256414400000, - "s": 1238270400000 - }, - { - "e": 1288468800000, - "s": 1269720000000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Vladivostok", - "rules": [ - { - "e": 1224950400000, - "s": 1206806400000 - }, - { - "e": 1256400000000, - "s": 1238256000000 - }, - { - "e": 1288454400000, - "s": 1269705600000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Yakutsk", - "rules": [ - { - "e": 1224954000000, - "s": 1206810000000 - }, - { - "e": 1256403600000, - "s": 1238259600000 - }, - { - "e": 1288458000000, - "s": 1269709200000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Yekaterinburg", - "rules": [ - { - "e": 1224968400000, - "s": 1206824400000 - }, - { - "e": 1256418000000, - "s": 1238274000000 - }, - { - "e": 1288472400000, - "s": 1269723600000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Yerevan", - "rules": [ - { - "e": 1224972000000, - "s": 1206828000000 - }, - { - "e": 1256421600000, - "s": 1238277600000 - }, - { - "e": 1288476000000, - "s": 1269727200000 - }, - { - "e": 1319925600000, - "s": 1301176800000 - }, - false, - false, - false - ] - }, - { - "name": "Australia/Lord_Howe", - "rules": [ - { - "e": 1207407600000, - "s": 1223134200000 - }, - { - "e": 1238857200000, - "s": 1254583800000 - }, - { - "e": 1270306800000, - "s": 1286033400000 - }, - { - "e": 1301756400000, - "s": 1317483000000 - }, - { - "e": 1333206000000, - "s": 1349537400000 - }, - { - "e": 1365260400000, - "s": 1380987000000 - }, - { - "e": 1396710000000, - "s": 1412436600000 - } - ] - }, - { - "name": "Australia/Perth", - "rules": [ - { - "e": 1206813600000, - "s": 1224957600000 - }, - false, - false, - false, - false, - false, - false - ] - }, - { - "name": "Europe/Helsinki", - "rules": [ - { - "e": 1224982800000, - "s": 1206838800000 - }, - { - "e": 1256432400000, - "s": 1238288400000 - }, - { - "e": 1288486800000, - "s": 1269738000000 - }, - { - "e": 1319936400000, - "s": 1301187600000 - }, - { - "e": 1351386000000, - "s": 1332637200000 - }, - { - "e": 1382835600000, - "s": 1364691600000 - }, - { - "e": 1414285200000, - "s": 1396141200000 - } - ] - }, - { - "name": "Europe/Minsk", - "rules": [ - { - "e": 1224979200000, - "s": 1206835200000 - }, - { - "e": 1256428800000, - "s": 1238284800000 - }, - { - "e": 1288483200000, - "s": 1269734400000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Europe/Moscow", - "rules": [ - { - "e": 1224975600000, - "s": 1206831600000 - }, - { - "e": 1256425200000, - "s": 1238281200000 - }, - { - "e": 1288479600000, - "s": 1269730800000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Pacific/Apia", - "rules": [ - false, - false, - false, - { - "e": 1301752800000, - "s": 1316872800000 - }, - { - "e": 1333202400000, - "s": 1348927200000 - }, - { - "e": 1365256800000, - "s": 1380376800000 - }, - { - "e": 1396706400000, - "s": 1411826400000 - } - ] - }, - { - "name": "Pacific/Fiji", - "rules": [ - false, - false, - { - "e": 1269698400000, - "s": 1287842400000 - }, - { - "e": 1327154400000, - "s": 1319292000000 - }, - { - "e": 1358604000000, - "s": 1350741600000 - }, - { - "e": 1390050000000, - "s": 1382796000000 - }, - { - "e": 1421503200000, - "s": 1414850400000 - } - ] - }, - { - "name": "Europe/London", - "rules": [ - { - "e": 1224982800000, - "s": 1206838800000 - }, - { - "e": 1256432400000, - "s": 1238288400000 - }, - { - "e": 1288486800000, - "s": 1269738000000 - }, - { - "e": 1319936400000, - "s": 1301187600000 - }, - { - "e": 1351386000000, - "s": 1332637200000 - }, - { - "e": 1382835600000, - "s": 1364691600000 - }, - { - "e": 1414285200000, - "s": 1396141200000 - } - ] - } - ] -}; -if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { - module.exports = jstz; -} else if ((typeof define !== 'undefined' && define !== null) && (define.amd != null)) { - define([], function() { - return jstz; + }; + + var _hide = _descriptors ? function (object, key, value) { + return _objectDp.f(object, key, _propertyDesc(1, value)); + } : function (object, key, value) { + object[key] = value; + return object; + }; + + var hasOwnProperty = {}.hasOwnProperty; + var _has = function (it, key) { + return hasOwnProperty.call(it, key); + }; + + var _redefine = createCommonjsModule(function (module) { + var SRC = _uid('src'); + var TO_STRING = 'toString'; + var $toString = Function[TO_STRING]; + var TPL = ('' + $toString).split(TO_STRING); + + _core.inspectSource = function (it) { + return $toString.call(it); + }; + + (module.exports = function (O, key, val, safe) { + var isFunction = typeof val == 'function'; + if (isFunction) _has(val, 'name') || _hide(val, 'name', key); + if (O[key] === val) return; + if (isFunction) _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + if (O === _global) { + O[key] = val; + } else if (!safe) { + delete O[key]; + _hide(O, key, val); + } else if (O[key]) { + O[key] = val; + } else { + _hide(O, key, val); + } + // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative + })(Function.prototype, TO_STRING, function toString() { + return typeof this == 'function' && this[SRC] || $toString.call(this); + }); + }); + + // optional / simple context binding + + var _ctx = function (fn, that, length) { + _aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; + }; + + var PROTOTYPE = 'prototype'; + + var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE]; + var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {}); + var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); + var key, own, out, exp; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out; + // extend global + if (target) _redefine(target, key, out, type & $export.U); + // export + if (exports[key] != out) _hide(exports, key, exp); + if (IS_PROTO && expProto[key] != out) expProto[key] = out; + } + }; + _global.core = _core; + // type bitmap + $export.F = 1; // forced + $export.G = 2; // global + $export.S = 4; // static + $export.P = 8; // proto + $export.B = 16; // bind + $export.W = 32; // wrap + $export.U = 64; // safe + $export.R = 128; // real proto method for `library` + var _export = $export; + + _export({ + target: 'RegExp', + proto: true, + forced: _regexpExec !== /./.exec + }, { + exec: _regexpExec + }); + + var SPECIES$1 = _wks('species'); + + var REPLACE_SUPPORTS_NAMED_GROUPS = !_fails(function () { + // #replace needs built-in support for named groups. + // #match works fine because it just return the exec results, even if it has + // a "grops" property. + var re = /./; + re.exec = function () { + var result = []; + result.groups = { a: '7' }; + return result; + }; + return ''.replace(re, '$') !== '7'; + }); + + var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () { + // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec + var re = /(?:)/; + var originalExec = re.exec; + re.exec = function () { return originalExec.apply(this, arguments); }; + var result = 'ab'.split(re); + return result.length === 2 && result[0] === 'a' && result[1] === 'b'; + })(); + + var _fixReWks = function (KEY, length, exec) { + var SYMBOL = _wks(KEY); + + var DELEGATES_TO_SYMBOL = !_fails(function () { + // String methods call symbol-named RegEp methods + var O = {}; + O[SYMBOL] = function () { return 7; }; + return ''[KEY](O) != 7; }); -} else { - if (typeof root === 'undefined') { - window.jstz = jstz; + + var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !_fails(function () { + // Symbol-named RegExp methods call .exec + var execCalled = false; + var re = /a/; + re.exec = function () { execCalled = true; return null; }; + if (KEY === 'split') { + // RegExp[@@split] doesn't call the regex's exec method, but first creates + // a new one. We need to return the patched regex when creating the new one. + re.constructor = {}; + re.constructor[SPECIES$1] = function () { return re; }; + } + re[SYMBOL](''); + return !execCalled; + }) : undefined; + + if ( + !DELEGATES_TO_SYMBOL || + !DELEGATES_TO_EXEC || + (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || + (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) + ) { + var nativeRegExpMethod = /./[SYMBOL]; + var fns = exec( + _defined, + SYMBOL, + ''[KEY], + function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) { + if (regexp.exec === _regexpExec) { + if (DELEGATES_TO_SYMBOL && !forceStringMethod) { + // The native String method already delegates to @@method (this + // polyfilled function), leasing to infinite recursion. + // We avoid it by directly calling the native @@method method. + return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; + } + return { done: true, value: nativeMethod.call(str, regexp, arg2) }; + } + return { done: false }; + } + ); + var strfn = fns[0]; + var rxfn = fns[1]; + + _redefine(String.prototype, KEY, strfn); + _hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function (string, arg) { return rxfn.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function (string) { return rxfn.call(string, this); } + ); + } + }; + + var $min = Math.min; + var $push = [].push; + var $SPLIT = 'split'; + var LENGTH = 'length'; + var LAST_INDEX$1 = 'lastIndex'; + + // eslint-disable-next-line no-empty + var SUPPORTS_Y = !!(function () { try { return new RegExp('x', 'y'); } catch (e) {} })(); + + // @@split logic + _fixReWks('split', 2, function (defined, SPLIT, $split, maybeCallNative) { + var internalSplit; + if ( + 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || + 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || + 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || + '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || + '.'[$SPLIT](/()()/)[LENGTH] > 1 || + ''[$SPLIT](/.?/)[LENGTH] + ) { + // based on es5-shim implementation, need to rework it + internalSplit = function (separator, limit) { + var string = String(this); + if (separator === undefined && limit === 0) return []; + // If `separator` is not a regex, use native split + if (!_isRegexp(separator)) return $split.call(string, separator, limit); + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var match, lastIndex, lastLength; + while (match = _regexpExec.call(separatorCopy, string)) { + lastIndex = separatorCopy[LAST_INDEX$1]; + if (lastIndex > lastLastIndex) { + output.push(string.slice(lastLastIndex, match.index)); + if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); + lastLength = match[0][LENGTH]; + lastLastIndex = lastIndex; + if (output[LENGTH] >= splitLimit) break; + } + if (separatorCopy[LAST_INDEX$1] === match.index) separatorCopy[LAST_INDEX$1]++; // Avoid an infinite loop + } + if (lastLastIndex === string[LENGTH]) { + if (lastLength || !separatorCopy.test('')) output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; + }; + // Chakra, V8 + } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { + internalSplit = function (separator, limit) { + return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit); + }; } else { - root.jstz = jstz; + internalSplit = $split; } -} -}()); + + return [ + // `String.prototype.split` method + // https://tc39.github.io/ecma262/#sec-string.prototype.split + function split(separator, limit) { + var O = defined(this); + var splitter = separator == undefined ? undefined : separator[SPLIT]; + return splitter !== undefined + ? splitter.call(separator, O, limit) + : internalSplit.call(String(O), separator, limit); + }, + // `RegExp.prototype[@@split]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split + // + // NOTE: This cannot be properly polyfilled in engines that don't support + // the 'y' flag. + function (regexp, limit) { + var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split); + if (res.done) return res.value; + + var rx = _anObject(regexp); + var S = String(this); + var C = _speciesConstructor(rx, RegExp); + + var unicodeMatching = rx.unicode; + var flags = (rx.ignoreCase ? 'i' : '') + + (rx.multiline ? 'm' : '') + + (rx.unicode ? 'u' : '') + + (SUPPORTS_Y ? 'y' : 'g'); + + // ^(? + rx + ) is needed, in combination with some S slicing, to + // simulate the 'y' flag. + var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); + var lim = limit === undefined ? 0xffffffff : limit >>> 0; + if (lim === 0) return []; + if (S.length === 0) return _regexpExecAbstract(splitter, S) === null ? [S] : []; + var p = 0; + var q = 0; + var A = []; + while (q < S.length) { + splitter.lastIndex = SUPPORTS_Y ? q : 0; + var z = _regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q)); + var e; + if ( + z === null || + (e = $min(_toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p + ) { + q = _advanceStringIndex(S, q, unicodeMatching); + } else { + A.push(S.slice(p, q)); + if (A.length === lim) return A; + for (var i = 1; i <= z.length - 1; i++) { + A.push(z[i]); + if (A.length === lim) return A; + } + q = p = e; + } + } + A.push(S.slice(p)); + return A; + } + ]; + }); + + var dP$1 = _objectDp.f; + var FProto = Function.prototype; + var nameRE = /^\s*function ([^ (]*)/; + var NAME = 'name'; + + // 19.2.4.2 name + NAME in FProto || _descriptors && dP$1(FProto, NAME, { + configurable: true, + get: function () { + try { + return ('' + this).match(nameRE)[1]; + } catch (e) { + return ''; + } + } + }); + + /* Build time: 2018-12-29 09:32:00Z Build by invoking python utilities/dst.py generate */ + var dst_rules = { + "years": [2014, 2015, 2016, 2017, 2018], + "zones": [{ + "name": "Africa/Cairo", + "rules": [{ + "e": 1411678800000, + "s": 1406844000000 + }, false, false, false, false] + }, { + "name": "Africa/Casablanca", + "rules": [{ + "e": 1414288800000, + "s": 1406944800000 + }, { + "e": 1445738400000, + "s": 1437271200000 + }, { + "e": 1477792800000, + "s": 1468116000000 + }, { + "e": 1509242400000, + "s": 1498960800000 + }, { + "e": 1540692000000, + "s": 1529200800000 + }] + }, { + "name": "America/Asuncion", + "rules": [{ + "e": 1395543600000, + "s": 1412481600000 + }, { + "e": 1426993200000, + "s": 1443931200000 + }, { + "e": 1459047600000, + "s": 1475380800000 + }, { + "e": 1490497200000, + "s": 1506830400000 + }, { + "e": 1521946800000, + "s": 1538884800000 + }] + }, { + "name": "America/Campo_Grande", + "rules": [{ + "e": 1392519600000, + "s": 1413691200000 + }, { + "e": 1424574000000, + "s": 1445140800000 + }, { + "e": 1456023600000, + "s": 1476590400000 + }, { + "e": 1487473200000, + "s": 1508040000000 + }, { + "e": 1518922800000, + "s": 1541304000000 + }] + }, { + "name": "America/Goose_Bay", + "rules": [{ + "e": 1414904400000, + "s": 1394344800000 + }, { + "e": 1446354000000, + "s": 1425794400000 + }, { + "e": 1478408400000, + "s": 1457848800000 + }, { + "e": 1509858000000, + "s": 1489298400000 + }, { + "e": 1541307600000, + "s": 1520748000000 + }] + }, { + "name": "America/Havana", + "rules": [{ + "e": 1414904400000, + "s": 1394341200000 + }, { + "e": 1446354000000, + "s": 1425790800000 + }, { + "e": 1478408400000, + "s": 1457845200000 + }, { + "e": 1509858000000, + "s": 1489294800000 + }, { + "e": 1541307600000, + "s": 1520744400000 + }] + }, { + "name": "America/Mazatlan", + "rules": [{ + "e": 1414310400000, + "s": 1396774800000 + }, { + "e": 1445760000000, + "s": 1428224400000 + }, { + "e": 1477814400000, + "s": 1459674000000 + }, { + "e": 1509264000000, + "s": 1491123600000 + }, { + "e": 1540713600000, + "s": 1522573200000 + }] + }, { + "name": "America/Mexico_City", + "rules": [{ + "e": 1414306800000, + "s": 1396771200000 + }, { + "e": 1445756400000, + "s": 1428220800000 + }, { + "e": 1477810800000, + "s": 1459670400000 + }, { + "e": 1509260400000, + "s": 1491120000000 + }, { + "e": 1540710000000, + "s": 1522569600000 + }] + }, { + "name": "America/Miquelon", + "rules": [{ + "e": 1414900800000, + "s": 1394341200000 + }, { + "e": 1446350400000, + "s": 1425790800000 + }, { + "e": 1478404800000, + "s": 1457845200000 + }, { + "e": 1509854400000, + "s": 1489294800000 + }, { + "e": 1541304000000, + "s": 1520744400000 + }] + }, { + "name": "America/Santa_Isabel", + "rules": [{ + "e": 1414918800000, + "s": 1394359200000 + }, { + "e": 1446368400000, + "s": 1425808800000 + }, { + "e": 1478422800000, + "s": 1457863200000 + }, { + "e": 1509872400000, + "s": 1489312800000 + }, { + "e": 1541322000000, + "s": 1520762400000 + }] + }, { + "name": "America/Santiago", + "rules": [{ + "e": 1398567600000, + "s": 1410062400000 + }, false, { + "e": 1463281200000, + "s": 1471147200000 + }, { + "e": 1494730800000, + "s": 1502596800000 + }, { + "e": 1526180400000, + "s": 1534046400000 + }] + }, { + "name": "America/Sao_Paulo", + "rules": [{ + "e": 1392516000000, + "s": 1413687600000 + }, { + "e": 1424570400000, + "s": 1445137200000 + }, { + "e": 1456020000000, + "s": 1476586800000 + }, { + "e": 1487469600000, + "s": 1508036400000 + }, { + "e": 1518919200000, + "s": 1541300400000 + }] + }, { + "name": "Asia/Amman", + "rules": [{ + "e": 1414706400000, + "s": 1395957600000 + }, { + "e": 1446156000000, + "s": 1427407200000 + }, { + "e": 1477605600000, + "s": 1459461600000 + }, { + "e": 1509055200000, + "s": 1490911200000 + }, { + "e": 1540504800000, + "s": 1522360800000 + }] + }, { + "name": "Asia/Damascus", + "rules": [{ + "e": 1414702800000, + "s": 1395957600000 + }, { + "e": 1446152400000, + "s": 1427407200000 + }, { + "e": 1477602000000, + "s": 1458856800000 + }, { + "e": 1509051600000, + "s": 1490911200000 + }, { + "e": 1540501200000, + "s": 1522360800000 + }] + }, { + "name": "Asia/Dubai", + "rules": [false, false, false, false, false] + }, { + "name": "Asia/Gaza", + "rules": [{ + "e": 1414098000000, + "s": 1395957600000 + }, { + "e": 1445547600000, + "s": 1427493600000 + }, { + "e": 1477692000000, + "s": 1458946800000 + }, { + "e": 1509141600000, + "s": 1490396400000 + }, { + "e": 1540591200000, + "s": 1521846000000 + }] + }, { + "name": "Asia/Irkutsk", + "rules": [false, false, false, false, false] + }, { + "name": "Asia/Jerusalem", + "rules": [{ + "e": 1414278000000, + "s": 1395964800000 + }, { + "e": 1445727600000, + "s": 1427414400000 + }, { + "e": 1477782000000, + "s": 1458864000000 + }, { + "e": 1509231600000, + "s": 1490313600000 + }, { + "e": 1540681200000, + "s": 1521763200000 + }] + }, { + "name": "Asia/Kamchatka", + "rules": [false, false, false, false, false] + }, { + "name": "Asia/Krasnoyarsk", + "rules": [false, false, false, false, false] + }, { + "name": "Asia/Omsk", + "rules": [false, false, false, false, false] + }, { + "name": "Asia/Vladivostok", + "rules": [false, false, false, false, false] + }, { + "name": "Asia/Yakutsk", + "rules": [false, false, false, false, false] + }, { + "name": "Asia/Yekaterinburg", + "rules": [false, false, false, false, false] + }, { + "name": "Asia/Yerevan", + "rules": [false, false, false, false, false] + }, { + "name": "Australia/Lord_Howe", + "rules": [{ + "e": 1396710000000, + "s": 1412436600000 + }, { + "e": 1428159600000, + "s": 1443886200000 + }, { + "e": 1459609200000, + "s": 1475335800000 + }, { + "e": 1491058800000, + "s": 1506785400000 + }, { + "e": 1522508400000, + "s": 1538839800000 + }] + }, { + "name": "Australia/Perth", + "rules": [false, false, false, false, false] + }, { + "name": "Europe/Helsinki", + "rules": [{ + "e": 1414285200000, + "s": 1396141200000 + }, { + "e": 1445734800000, + "s": 1427590800000 + }, { + "e": 1477789200000, + "s": 1459040400000 + }, { + "e": 1509238800000, + "s": 1490490000000 + }, { + "e": 1540688400000, + "s": 1521939600000 + }] + }, { + "name": "Europe/Minsk", + "rules": [false, false, false, false, false] + }, { + "name": "Europe/Moscow", + "rules": [false, false, false, false, false] + }, { + "name": "Pacific/Apia", + "rules": [{ + "e": 1396706400000, + "s": 1411826400000 + }, { + "e": 1428156000000, + "s": 1443276000000 + }, { + "e": 1459605600000, + "s": 1474725600000 + }, { + "e": 1491055200000, + "s": 1506175200000 + }, { + "e": 1522504800000, + "s": 1538229600000 + }] + }, { + "name": "Pacific/Fiji", + "rules": [{ + "e": 1421503200000, + "s": 1414850400000 + }, { + "e": 1452952800000, + "s": 1446300000000 + }, { + "e": 1484402400000, + "s": 1478354400000 + }, { + "e": 1515852000000, + "s": 1509804000000 + }, { + "e": 1547906400000, + "s": 1541253600000 + }] + }, { + "name": "Europe/London", + "rules": [{ + "e": 1414285200000, + "s": 1396141200000 + }, { + "e": 1445734800000, + "s": 1427590800000 + }, { + "e": 1477789200000, + "s": 1459040400000 + }, { + "e": 1509238800000, + "s": 1490490000000 + }, { + "e": 1540688400000, + "s": 1521939600000 + }] + }] + }; + + /** + * This script gives you the zone info key representing your device's time zone setting. + * + * @name jsTimezoneDetect + * @version 1.0.6 + * @author Jon Nylander + * @license MIT License - https://bitbucket.org/pellepim/jstimezonedetect/src/default/LICENCE.txt + * + * For usage and examples, visit: + * http://pellepim.bitbucket.org/jstz/ + * + * Copyright (c) Jon Nylander + */ + + var HEMISPHERE_SOUTH = 's'; + var consts = { + DAY: 86400000, + HOUR: 3600000, + MINUTE: 60000, + SECOND: 1000, + BASELINE_YEAR: 2014, + MAX_SCORE: 864000000, + // 10 days + AMBIGUITIES: { + 'America/Denver': ['America/Mazatlan'], + 'Europe/London': ['Africa/Casablanca'], + 'America/Chicago': ['America/Mexico_City'], + 'America/Asuncion': ['America/Campo_Grande', 'America/Santiago'], + 'America/Montevideo': ['America/Sao_Paulo', 'America/Santiago'], + // Europe/Minsk should not be in this list... but Windows. + 'Asia/Beirut': ['Asia/Amman', 'Asia/Jerusalem', 'Europe/Helsinki', 'Asia/Damascus', 'Africa/Cairo', 'Asia/Gaza', 'Europe/Minsk'], + 'Pacific/Auckland': ['Pacific/Fiji'], + 'America/Los_Angeles': ['America/Santa_Isabel'], + 'America/New_York': ['America/Havana'], + 'America/Halifax': ['America/Goose_Bay'], + 'America/Godthab': ['America/Miquelon'], + 'Asia/Dubai': ['Asia/Yerevan'], + 'Asia/Jakarta': ['Asia/Krasnoyarsk'], + 'Asia/Shanghai': ['Asia/Irkutsk', 'Australia/Perth'], + 'Australia/Sydney': ['Australia/Lord_Howe'], + 'Asia/Tokyo': ['Asia/Yakutsk'], + 'Asia/Dhaka': ['Asia/Omsk'], + // In the real world Yerevan is not ambigous for Baku... but Windows. + 'Asia/Baku': ['Asia/Yerevan'], + 'Australia/Brisbane': ['Asia/Vladivostok'], + 'Pacific/Noumea': ['Asia/Vladivostok'], + 'Pacific/Majuro': ['Asia/Kamchatka', 'Pacific/Fiji'], + 'Pacific/Tongatapu': ['Pacific/Apia'], + 'Asia/Baghdad': ['Europe/Minsk', 'Europe/Moscow'], + 'Asia/Karachi': ['Asia/Yekaterinburg'], + 'Africa/Johannesburg': ['Asia/Gaza', 'Africa/Cairo'] + } + /** + * Gets the offset in minutes from UTC for a certain date. + * @param {Date} date + * @returns {Number} + */ + + }; + + var get_date_offset = function get_date_offset(date) { + var offset = -date.getTimezoneOffset(); + return offset !== null ? offset : 0; + }; + /** + * This function does some basic calculations to create information about + * the user's timezone. It uses REFERENCE_YEAR as a solid year for which + * the script has been tested rather than depend on the year set by the + * client device. + * + * Returns a key that can be used to do lookups in jstz.olson.timezones. + * eg: "720,1,2". + * + * @returns {String} + */ + + + var lookup_key = function lookup_key() { + var january_offset = get_date_offset(new Date(consts.BASELINE_YEAR, 0, 2)), + june_offset = get_date_offset(new Date(consts.BASELINE_YEAR, 5, 2)), + diff = january_offset - june_offset; + + if (diff < 0) { + return january_offset + ",1"; + } else if (diff > 0) { + return june_offset + ",1," + HEMISPHERE_SOUTH; + } + + return january_offset + ",0"; + }; + /** + * Tries to get the time zone key directly from the operating system for those + * environments that support the ECMAScript Internationalization API. + */ + + + var get_from_internationalization_api = function get_from_internationalization_api() { + var format, timezone; + + if (typeof Intl === "undefined" || typeof Intl.DateTimeFormat === "undefined") { + return; + } + + format = Intl.DateTimeFormat(); + + if (typeof format === "undefined" || typeof format.resolvedOptions === "undefined") { + return; + } + + timezone = format.resolvedOptions().timeZone; + + if (timezone && (timezone.indexOf("/") > -1 || timezone === 'UTC') && timezone.indexOf("Etc") != 0) { + return timezone; + } + }; + /** + * Starting point for getting all the DST rules for a specific year + * for the current timezone (as described by the client system). + * + * Returns an object with start and end attributes, or false if no + * DST rules were found for the year. + * + * @param year + * @returns {Object} || {Boolean} + */ + + + var dst_dates = function dst_dates(year) { + var yearstart = new Date(year, 0, 1, 0, 0, 1, 0).getTime(); + var yearend = new Date(year, 12, 31, 23, 59, 59).getTime(); + var current = yearstart; + var offset = new Date(current).getTimezoneOffset(); + var dst_start = null; + var dst_end = null; + + while (current < yearend - 86400000) { + var dateToCheck = new Date(current); + var dateToCheckOffset = dateToCheck.getTimezoneOffset(); + + if (dateToCheckOffset !== offset) { + if (dateToCheckOffset < offset) { + dst_start = dateToCheck; + } + + if (dateToCheckOffset > offset) { + dst_end = dateToCheck; + } + + offset = dateToCheckOffset; + } + + current += 86400000; + } + + if (dst_start && dst_end) { + return { + s: find_dst_fold(dst_start).getTime(), + e: find_dst_fold(dst_end).getTime() + }; + } + + return false; + }; + /** + * Probably completely unnecessary function that recursively finds the + * exact (to the second) time when a DST rule was changed. + * + * @param a_date - The candidate Date. + * @param padding - integer specifying the padding to allow around the candidate + * date for finding the fold. + * @param iterator - integer specifying how many milliseconds to iterate while + * searching for the fold. + * + * @returns {Date} + */ + + + var find_dst_fold = function find_dst_fold(a_date, padding, iterator) { + if (typeof padding === 'undefined') { + padding = consts.DAY; + iterator = consts.HOUR; + } + + var date_start = new Date(a_date.getTime() - padding).getTime(); + var date_end = a_date.getTime() + padding; + var offset = new Date(date_start).getTimezoneOffset(); + var current = date_start; + var dst_change = null; + + while (current < date_end - iterator) { + var dateToCheck = new Date(current); + var dateToCheckOffset = dateToCheck.getTimezoneOffset(); + + if (dateToCheckOffset !== offset) { + dst_change = dateToCheck; + break; + } + + current += iterator; + } + + if (padding === consts.DAY) { + return find_dst_fold(dst_change, consts.HOUR, consts.MINUTE); + } + + if (padding === consts.HOUR) { + return find_dst_fold(dst_change, consts.MINUTE, consts.SECOND); + } + + return dst_change; + }; + + var windows7_adaptations = function windows7_adaptations(rule_list, preliminary_timezone, score, sample) { + if (score !== 'N/A') { + return score; + } + + if (preliminary_timezone === 'Asia/Beirut') { + if (sample.name === 'Africa/Cairo') { + if (rule_list[6].s === 1398376800000 && rule_list[6].e === 1411678800000) { + return 0; + } + } + + if (sample.name === 'Asia/Jerusalem') { + if (rule_list[6].s === 1395964800000 && rule_list[6].e === 1411858800000) { + return 0; + } + } + } else if (preliminary_timezone === 'America/Santiago') { + if (sample.name === 'America/Asuncion') { + if (rule_list[6].s === 1412481600000 && rule_list[6].e === 1397358000000) { + return 0; + } + } + + if (sample.name === 'America/Campo_Grande') { + if (rule_list[6].s === 1413691200000 && rule_list[6].e === 1392519600000) { + return 0; + } + } + } else if (preliminary_timezone === 'America/Montevideo') { + if (sample.name === 'America/Sao_Paulo') { + if (rule_list[6].s === 1413687600000 && rule_list[6].e === 1392516000000) { + return 0; + } + } + } else if (preliminary_timezone === 'Pacific/Auckland') { + if (sample.name === 'Pacific/Fiji') { + if (rule_list[6].s === 1414245600000 && rule_list[6].e === 1396101600000) { + return 0; + } + } + } + + return score; + }; + /** + * Takes the DST rules for the current timezone, and proceeds to find matches + * in the jstz.olson.dst_rules.zones array. + * + * Compares samples to the current timezone on a scoring basis. + * + * Candidates are ruled immediately if either the candidate or the current zone + * has a DST rule where the other does not. + * + * Candidates are ruled out immediately if the current zone has a rule that is + * outside the DST scope of the candidate. + * + * Candidates are included for scoring if the current zones rules fall within the + * span of the samples rules. + * + * Low score is best, the score is calculated by summing up the differences in DST + * rules and if the consts.MAX_SCORE is overreached the candidate is ruled out. + * + * Yah follow? :) + * + * @param rule_list + * @param preliminary_timezone + * @returns {*} + */ + + + var best_dst_match = function best_dst_match(rule_list, preliminary_timezone) { + var score_sample = function score_sample(sample) { + var score = 0; + + for (var j = 0; j < rule_list.length; j++) { + // Both sample and current time zone report DST during the year. + if (!!sample.rules[j] && !!rule_list[j]) { + // The current time zone's DST rules are inside the sample's. Include. + if (rule_list[j].s >= sample.rules[j].s && rule_list[j].e <= sample.rules[j].e) { + score = 0; + score += Math.abs(rule_list[j].s - sample.rules[j].s); + score += Math.abs(sample.rules[j].e - rule_list[j].e); // The current time zone's DST rules are outside the sample's. Discard. + } else { + score = 'N/A'; + break; + } // The max score has been reached. Discard. + + + if (score > consts.MAX_SCORE) { + score = 'N/A'; + break; + } + } + } + + score = windows7_adaptations(rule_list, preliminary_timezone, score, sample); + return score; + }; + + var scoreboard = {}; + var dst_zones = jstz.olson.dst_rules.zones; + var dst_zones_length = dst_zones.length; + var ambiguities = consts.AMBIGUITIES[preliminary_timezone]; + + for (var i = 0; i < dst_zones_length; i++) { + var sample = dst_zones[i]; + var score = score_sample(dst_zones[i]); + + if (score !== 'N/A') { + scoreboard[sample.name] = score; + } + } + + for (var tz in scoreboard) { + if (scoreboard.hasOwnProperty(tz)) { + for (var j = 0; j < ambiguities.length; j++) { + if (ambiguities[j] === tz) { + return tz; + } + } + } + } + + return preliminary_timezone; + }; + /** + * Takes the preliminary_timezone as detected by lookup_key(). + * + * Builds up the current timezones DST rules for the years defined + * in the jstz.olson.dst_rules.years array. + * + * If there are no DST occurences for those years, immediately returns + * the preliminary timezone. Otherwise proceeds and tries to solve + * ambiguities. + * + * @param preliminary_timezone + * @returns {String} timezone_name + */ + + + var get_by_dst = function get_by_dst(preliminary_timezone) { + var get_rules = function get_rules() { + var rule_list = []; + + for (var i = 0; i < jstz.olson.dst_rules.years.length; i++) { + var year_rules = dst_dates(jstz.olson.dst_rules.years[i]); + rule_list.push(year_rules); + } + + return rule_list; + }; + + var check_has_dst = function check_has_dst(rules) { + for (var i = 0; i < rules.length; i++) { + if (rules[i] !== false) { + return true; + } + } + + return false; + }; + + var rules = get_rules(); + var has_dst = check_has_dst(rules); + + if (has_dst) { + return best_dst_match(rules, preliminary_timezone); + } + + return preliminary_timezone; + }; + /** + * Uses get_timezone_info() to formulate a key to use in the olson.timezones dictionary. + * + * Returns an object with one function ".name()" + * + * @returns Object + */ + + + var determine = function determine() { + var preliminary_tz = get_from_internationalization_api(); + + if (!preliminary_tz) { + preliminary_tz = jstz.olson.timezones[lookup_key()]; + + if (typeof consts.AMBIGUITIES[preliminary_tz] !== 'undefined') { + preliminary_tz = get_by_dst(preliminary_tz); + } + } + + return { + name: function name() { + return preliminary_tz; + }, + stdTimezoneOffset: function stdTimezoneOffset() { + // negative to match what (new Date).getTimezoneOffset() will return + return -lookup_key().split(',')[0]; + }, + timezoneOffset: function timezoneOffset() { + // negative to match what (new Date).getTimezoneOffset() will return + return -get_date_offset(new Date()); + } + }; + }; + /** + * The keys in this dictionary are comma separated as such: + * + * First the offset compared to UTC time in minutes. + * + * Then a flag which is 0 if the timezone does not take daylight savings into account and 1 if it + * does. + * + * Thirdly an optional 's' signifies that the timezone is in the southern hemisphere, + * only interesting for timezones with DST. + * + * The mapped arrays is used for constructing the jstz.TimeZone object from within + * jstz.determine(); + */ + + + var olson = { + timezones: { + '-720,0': 'Etc/GMT+12', + '-660,0': 'Pacific/Pago_Pago', + '-660,1,s': 'Pacific/Apia', + // Why? Because windows... cry! + '-600,1': 'America/Adak', + '-600,0': 'Pacific/Honolulu', + '-570,0': 'Pacific/Marquesas', + '-540,0': 'Pacific/Gambier', + '-540,1': 'America/Anchorage', + '-480,1': 'America/Los_Angeles', + '-480,0': 'Pacific/Pitcairn', + '-420,0': 'America/Phoenix', + '-420,1': 'America/Denver', + '-360,0': 'America/Guatemala', + '-360,1': 'America/Chicago', + '-360,1,s': 'Pacific/Easter', + '-300,0': 'America/Bogota', + '-300,1': 'America/New_York', + '-270,0': 'America/Caracas', + '-240,1': 'America/Halifax', + '-240,0': 'America/Santo_Domingo', + '-240,1,s': 'America/Asuncion', + '-210,1': 'America/St_Johns', + '-180,1': 'America/Godthab', + '-180,0': 'America/Argentina/Buenos_Aires', + '-180,1,s': 'America/Montevideo', + '-120,0': 'America/Noronha', + '-120,1': 'America/Noronha', + '-60,1': 'Atlantic/Azores', + '-60,0': 'Atlantic/Cape_Verde', + '0,0': 'UTC', + '0,1': 'Europe/London', + '60,1': 'Europe/Berlin', + '60,0': 'Africa/Lagos', + '60,1,s': 'Africa/Windhoek', + '120,1': 'Asia/Beirut', + '120,0': 'Africa/Johannesburg', + '180,0': 'Asia/Baghdad', + '180,1': 'Europe/Moscow', + '210,1': 'Asia/Tehran', + '240,0': 'Asia/Dubai', + '240,1': 'Asia/Baku', + '270,0': 'Asia/Kabul', + '300,1': 'Asia/Yekaterinburg', + '300,0': 'Asia/Karachi', + '330,0': 'Asia/Kolkata', + '345,0': 'Asia/Kathmandu', + '360,0': 'Asia/Dhaka', + '360,1': 'Asia/Omsk', + '390,0': 'Asia/Rangoon', + '420,1': 'Asia/Krasnoyarsk', + '420,0': 'Asia/Jakarta', + '480,0': 'Asia/Shanghai', + '480,1': 'Asia/Irkutsk', + '525,0': 'Australia/Eucla', + '525,1,s': 'Australia/Eucla', + '540,1': 'Asia/Yakutsk', + '540,0': 'Asia/Tokyo', + '570,0': 'Australia/Darwin', + '570,1,s': 'Australia/Adelaide', + '600,0': 'Australia/Brisbane', + '600,1': 'Asia/Vladivostok', + '600,1,s': 'Australia/Sydney', + '630,1,s': 'Australia/Lord_Howe', + '660,1': 'Asia/Kamchatka', + '660,0': 'Pacific/Noumea', + '690,0': 'Pacific/Norfolk', + '720,1,s': 'Pacific/Auckland', + '720,0': 'Pacific/Majuro', + '765,1,s': 'Pacific/Chatham', + '780,0': 'Pacific/Tongatapu', + '780,1,s': 'Pacific/Apia', + '840,0': 'Pacific/Kiritimati' + }, + dst_rules: dst_rules + }; + var jstz = { + olson: olson + }; + var jstz$1 = { + determine: determine + }; + + return jstz$1; + +})); diff --git a/dist/jstz.min.js b/dist/jstz.min.js index 382fc8d..93b6980 100644 --- a/dist/jstz.min.js +++ b/dist/jstz.min.js @@ -1,2 +1,2 @@ -/* jstz.min.js Version: 2.1.0 Build date: 2018-11-04 */ -!function(e){var a=function(){"use strict";var e="s",s={DAY:864e5,HOUR:36e5,MINUTE:6e4,SECOND:1e3,BASELINE_YEAR:2014,MAX_SCORE:864e6,AMBIGUITIES:{"America/Denver":["America/Mazatlan"],"Europe/London":["Africa/Casablanca"],"America/Chicago":["America/Mexico_City"],"America/Asuncion":["America/Campo_Grande","America/Santiago"],"America/Montevideo":["America/Sao_Paulo","America/Santiago"],"Asia/Beirut":["Asia/Amman","Asia/Jerusalem","Europe/Helsinki","Asia/Damascus","Africa/Cairo","Asia/Gaza","Europe/Minsk"],"Pacific/Auckland":["Pacific/Fiji"],"America/Los_Angeles":["America/Santa_Isabel"],"America/New_York":["America/Havana"],"America/Halifax":["America/Goose_Bay"],"America/Godthab":["America/Miquelon"],"Asia/Dubai":["Asia/Yerevan"],"Asia/Jakarta":["Asia/Krasnoyarsk"],"Asia/Shanghai":["Asia/Irkutsk","Australia/Perth"],"Australia/Sydney":["Australia/Lord_Howe"],"Asia/Tokyo":["Asia/Yakutsk"],"Asia/Dhaka":["Asia/Omsk"],"Asia/Baku":["Asia/Yerevan"],"Australia/Brisbane":["Asia/Vladivostok"],"Pacific/Noumea":["Asia/Vladivostok"],"Pacific/Majuro":["Asia/Kamchatka","Pacific/Fiji"],"Pacific/Tongatapu":["Pacific/Apia"],"Asia/Baghdad":["Europe/Minsk","Europe/Moscow"],"Asia/Karachi":["Asia/Yekaterinburg"],"Africa/Johannesburg":["Asia/Gaza","Africa/Cairo"]}},i=function(e){var a=-e.getTimezoneOffset();return null!==a?a:0},r=function(){var a=i(new Date(s.BASELINE_YEAR,0,2)),r=i(new Date(s.BASELINE_YEAR,5,2)),n=a-r;return n<0?a+",1":n>0?r+",1,"+e:a+",0"},n=function(){var e,a;if("undefined"!=typeof Intl&&"undefined"!=typeof Intl.DateTimeFormat&&(e=Intl.DateTimeFormat(),"undefined"!=typeof e&&"undefined"!=typeof e.resolvedOptions))return a=e.resolvedOptions().timeZone,a&&(a.indexOf("/")>-1||"UTC"===a)&&0!=a.indexOf("Etc")?a:void 0},o=function(e){for(var a=new Date(e,0,1,0,0,1,0).getTime(),s=new Date(e,12,31,23,59,59).getTime(),i=a,r=new Date(i).getTimezoneOffset(),n=null,o=null;ir&&(o=u),r=A),i+=864e5}return!(!n||!o)&&{s:t(n).getTime(),e:t(o).getTime()}},t=function l(e,a,i){"undefined"==typeof a&&(a=s.DAY,i=s.HOUR);for(var r=new Date(e.getTime()-a).getTime(),n=e.getTime()+a,o=new Date(r).getTimezoneOffset(),t=r,u=null;t=a.rules[n].s&&e[n].e<=a.rules[n].e)){r="N/A";break}if(r=0,r+=Math.abs(e[n].s-a.rules[n].s),r+=Math.abs(a.rules[n].e-e[n].e),r>s.MAX_SCORE){r="N/A";break}}return r=u(e,i,r,a)},n={},o=a.olson.dst_rules.zones,t=o.length,A=s.AMBIGUITIES[i],c=0;c0?p:h)(e)},g=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},y=function(e,n,a){return n+(a?(r=e,i=n,s=g(r)+"",c=v(i),u=s.length,0>c||c>=u?"":55296>(t=s.charCodeAt(c))||t>56319||c+1===u||56320>(o=s.charCodeAt(c+1))||o>57343?s.charAt(c):s.slice(c,c+2)).length:1);var r,i,t,o,s,c,u},k=Math.min,E=f("toStringTag"),b="Arguments"==r(function(){return arguments}()),x=/t/.exec,P=function(e,n){var a,i,t,o,s=e.exec;if("function"==typeof s){var c=s.call(e,n);if("object"!=typeof c)throw new TypeError("RegExp exec method returned something other than an Object or null");return c}if("RegExp"!==(void 0===(a=e)?"Undefined":null===a?"Null":"string"==typeof(t=function(e,n){try{return e[n]}catch(e){}}(i=Object(a),E))?t:b?r(i):"Object"==(o=r(i))&&"function"==typeof i.callee?"Arguments":o))throw new TypeError("RegExp#exec called on incompatible receiver");return x.call(e,n)},w=/t/.exec,T="".replace,M=w,S=(w.call(/a/,"a"),w.call(/b*/g,"a"),!1),O=void 0!==/()??/.exec("")[1];(S||O)&&(M=function(e){var n,a,r,i,t=this;return O&&(a=RegExp("^"+t.source+"$(?!\\s)",function(){var e=A(this),n="";return e.global&&(n+="g"),e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.unicode&&(n+="u"),e.sticky&&(n+="y"),n}.call(t))),S&&(n=t.lastIndex),r=w.call(t,e),S&&r&&(t.lastIndex=t.global?r.index+r[0].length:n),O&&r&&r.length>1&&T.call(r[0],a,function(){for(i=1;i")}),function(){var e=/(?:)/,n=e.exec;e.exec=function(){return n.apply(this,arguments)};var a="ab".split(e);return 2===a.length&&"a"===a[0]&&"b"===a[1]}()),J=Math.min,V=[].push,W=!!function(){try{return/x/y}catch(e){}}();!function(e,a,i){var t,o,s,c,u,h=f(e),p=!C(function(){var n={};return n[h]=function(){return 7},7!=""[e](n)}),E=p?!C(function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},n.constructor={},n.constructor[K]=function(){return n},n[h](""),!e}):void 0;if(!p||!E||!L){var b=/./[h],x=(t=g,o=h,s=""[e],c=function(e,n,a,r,i){return n.exec===_?p&&!i?{done:!0,value:b.call(n,a,r)}:{done:!0,value:e.call(a,n,r)}:{done:!1}},u="".split(/.?/).length?function(e,a){var i,t,o=this+"";if(void 0===e&&0===a)return[];if(!n(i=e)||(void 0!==(t=i[l])?!t:"RegExp"!=r(i)))return s.call(o,e,a);for(var c,u,f,A=[],m=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,h=void 0===a?4294967295:a>>>0,p=RegExp(e.source,m+"g");(c=_.call(p,o))&&((u=p.lastIndex)<=d||(A.push(o.slice(d,c.index)),c.length>1&&c.indexh?A.slice(0,h):A}:s,[function(e,n){var a=t(this),r=null==e?void 0:e[o];return void 0!==r?r.call(e,a,n):u.call(a+"",e,n)},function(e,n){var a=c(u,e,this,n,u!==s);if(a.done)return a.value;var r=A(e),i=this+"",t=function(e,n){var a,i=A(r).constructor;return void 0===i||null==(a=A(i)[d])?n:m(a)}(0,RegExp),o=r.unicode,f=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(W?"y":"g"),l=new t(W?r:"^(?:"+r.source+")",f),h=void 0===n?4294967295:n>>>0;if(0===h)return[];if(0===i.length)return null===P(l,i)?[i]:[];for(var p,g=0,E=0,b=[];E0?k(v(p),9007199254740991):0,i.length))===g)E=y(i,E,o);else{if(b.push(i.slice(g,E)),b.length===h)return b;for(var T=1;T<=w.length-1;T++)if(b.push(w[T]),b.length===h)return b;E=g=x}}return b.push(i.slice(g)),b}]),w=x[1];U(String.prototype,e,x[0]),z(RegExp.prototype,h,function(e,n){return w.call(e,this,n)})}}("split");var X=R.f,$=Function.prototype;"name"in $||D&&X($,"name",{configurable:!0,get:function(){try{return(""+this).match(/^\s*function ([^ (]*)/)[1]}catch(e){return""}}});var Z={DAY:864e5,HOUR:36e5,MINUTE:6e4,SECOND:1e3,BASELINE_YEAR:2014,MAX_SCORE:864e6,AMBIGUITIES:{"America/Denver":["America/Mazatlan"],"Europe/London":["Africa/Casablanca"],"America/Chicago":["America/Mexico_City"],"America/Asuncion":["America/Campo_Grande","America/Santiago"],"America/Montevideo":["America/Sao_Paulo","America/Santiago"],"Asia/Beirut":["Asia/Amman","Asia/Jerusalem","Europe/Helsinki","Asia/Damascus","Africa/Cairo","Asia/Gaza","Europe/Minsk"],"Pacific/Auckland":["Pacific/Fiji"],"America/Los_Angeles":["America/Santa_Isabel"],"America/New_York":["America/Havana"],"America/Halifax":["America/Goose_Bay"],"America/Godthab":["America/Miquelon"],"Asia/Dubai":["Asia/Yerevan"],"Asia/Jakarta":["Asia/Krasnoyarsk"],"Asia/Shanghai":["Asia/Irkutsk","Australia/Perth"],"Australia/Sydney":["Australia/Lord_Howe"],"Asia/Tokyo":["Asia/Yakutsk"],"Asia/Dhaka":["Asia/Omsk"],"Asia/Baku":["Asia/Yerevan"],"Australia/Brisbane":["Asia/Vladivostok"],"Pacific/Noumea":["Asia/Vladivostok"],"Pacific/Majuro":["Asia/Kamchatka","Pacific/Fiji"],"Pacific/Tongatapu":["Pacific/Apia"],"Asia/Baghdad":["Europe/Minsk","Europe/Moscow"],"Asia/Karachi":["Asia/Yekaterinburg"],"Africa/Johannesburg":["Asia/Gaza","Africa/Cairo"]}},Q=function(e){var n=-e.getTimezoneOffset();return null!==n?n:0},q=function(){var e=Q(new Date(Z.BASELINE_YEAR,0,2)),n=Q(new Date(Z.BASELINE_YEAR,5,2)),a=e-n;return 0>a?e+",1":a>0?n+",1,s":e+",0"},ee=function(e){for(var n=new Date(e,0,1,0,0,1,0).getTime(),a=new Date(e,12,31,23,59,59).getTime(),r=n,i=new Date(r).getTimezoneOffset(),t=null,o=null;a-864e5>r;){var s=new Date(r),c=s.getTimezoneOffset();c!==i&&(i>c&&(t=s),c>i&&(o=s),i=c),r+=864e5}return!(!t||!o)&&{s:ne(t).getTime(),e:ne(o).getTime()}},ne=function e(n,a,r){void 0===a&&(a=Z.DAY,r=Z.HOUR);for(var i=new Date(n.getTime()-a).getTime(),t=n.getTime()+a,o=new Date(i).getTimezoneOffset(),s=i,c=null;t-r>s;){var u=new Date(s);if(u.getTimezoneOffset()!==o){c=u;break}s+=r}return a===Z.DAY?e(c,Z.HOUR,Z.MINUTE):a===Z.HOUR?e(c,Z.MINUTE,Z.SECOND):c},ae={olson:{timezones:{"-720,0":"Etc/GMT+12","-660,0":"Pacific/Pago_Pago","-660,1,s":"Pacific/Apia","-600,1":"America/Adak","-600,0":"Pacific/Honolulu","-570,0":"Pacific/Marquesas","-540,0":"Pacific/Gambier","-540,1":"America/Anchorage","-480,1":"America/Los_Angeles","-480,0":"Pacific/Pitcairn","-420,0":"America/Phoenix","-420,1":"America/Denver","-360,0":"America/Guatemala","-360,1":"America/Chicago","-360,1,s":"Pacific/Easter","-300,0":"America/Bogota","-300,1":"America/New_York","-270,0":"America/Caracas","-240,1":"America/Halifax","-240,0":"America/Santo_Domingo","-240,1,s":"America/Asuncion","-210,1":"America/St_Johns","-180,1":"America/Godthab","-180,0":"America/Argentina/Buenos_Aires","-180,1,s":"America/Montevideo","-120,0":"America/Noronha","-120,1":"America/Noronha","-60,1":"Atlantic/Azores","-60,0":"Atlantic/Cape_Verde","0,0":"UTC","0,1":"Europe/London","60,1":"Europe/Berlin","60,0":"Africa/Lagos","60,1,s":"Africa/Windhoek","120,1":"Asia/Beirut","120,0":"Africa/Johannesburg","180,0":"Asia/Baghdad","180,1":"Europe/Moscow","210,1":"Asia/Tehran","240,0":"Asia/Dubai","240,1":"Asia/Baku","270,0":"Asia/Kabul","300,1":"Asia/Yekaterinburg","300,0":"Asia/Karachi","330,0":"Asia/Kolkata","345,0":"Asia/Kathmandu","360,0":"Asia/Dhaka","360,1":"Asia/Omsk","390,0":"Asia/Rangoon","420,1":"Asia/Krasnoyarsk","420,0":"Asia/Jakarta","480,0":"Asia/Shanghai","480,1":"Asia/Irkutsk","525,0":"Australia/Eucla","525,1,s":"Australia/Eucla","540,1":"Asia/Yakutsk","540,0":"Asia/Tokyo","570,0":"Australia/Darwin","570,1,s":"Australia/Adelaide","600,0":"Australia/Brisbane","600,1":"Asia/Vladivostok","600,1,s":"Australia/Sydney","630,1,s":"Australia/Lord_Howe","660,1":"Asia/Kamchatka","660,0":"Pacific/Noumea","690,0":"Pacific/Norfolk","720,1,s":"Pacific/Auckland","720,0":"Pacific/Majuro","765,1,s":"Pacific/Chatham","780,0":"Pacific/Tongatapu","780,1,s":"Pacific/Apia","840,0":"Pacific/Kiritimati"},dst_rules:{years:[2014,2015,2016,2017,2018],zones:[{name:"Africa/Cairo",rules:[{e:14116788e5,s:1406844e6},!1,!1,!1,!1]},{name:"Africa/Casablanca",rules:[{e:14142888e5,s:14069448e5},{e:14457384e5,s:14372712e5},{e:14777928e5,s:1468116e6},{e:15092424e5,s:14989608e5},{e:1540692e6,s:15292008e5}]},{name:"America/Asuncion",rules:[{e:13955436e5,s:14124816e5},{e:14269932e5,s:14439312e5},{e:14590476e5,s:14753808e5},{e:14904972e5,s:15068304e5},{e:15219468e5,s:15388848e5}]},{name:"America/Campo_Grande",rules:[{e:13925196e5,s:14136912e5},{e:1424574e6,s:14451408e5},{e:14560236e5,s:14765904e5},{e:14874732e5,s:150804e7},{e:15189228e5,s:1541304e6}]},{name:"America/Goose_Bay",rules:[{e:14149044e5,s:13943448e5},{e:1446354e6,s:14257944e5},{e:14784084e5,s:14578488e5},{e:1509858e6,s:14892984e5},{e:15413076e5,s:1520748e6}]},{name:"America/Havana",rules:[{e:14149044e5,s:13943412e5},{e:1446354e6,s:14257908e5},{e:14784084e5,s:14578452e5},{e:1509858e6,s:14892948e5},{e:15413076e5,s:15207444e5}]},{name:"America/Mazatlan",rules:[{e:14143104e5,s:13967748e5},{e:144576e7,s:14282244e5},{e:14778144e5,s:1459674e6},{e:1509264e6,s:14911236e5},{e:15407136e5,s:15225732e5}]},{name:"America/Mexico_City",rules:[{e:14143068e5,s:13967712e5},{e:14457564e5,s:14282208e5},{e:14778108e5,s:14596704e5},{e:15092604e5,s:149112e7},{e:154071e7,s:15225696e5}]},{name:"America/Miquelon",rules:[{e:14149008e5,s:13943412e5},{e:14463504e5,s:14257908e5},{e:14784048e5,s:14578452e5},{e:15098544e5,s:14892948e5},{e:1541304e6,s:15207444e5}]},{name:"America/Santa_Isabel",rules:[{e:14149188e5,s:13943592e5},{e:14463684e5,s:14258088e5},{e:14784228e5,s:14578632e5},{e:15098724e5,s:14893128e5},{e:1541322e6,s:15207624e5}]},{name:"America/Santiago",rules:[{e:13985676e5,s:14100624e5},!1,{e:14632812e5,s:14711472e5},{e:14947308e5,s:15025968e5},{e:15261804e5,s:15340464e5}]},{name:"America/Sao_Paulo",rules:[{e:1392516e6,s:14136876e5},{e:14245704e5,s:14451372e5},{e:145602e7,s:14765868e5},{e:14874696e5,s:15080364e5},{e:15189192e5,s:15413004e5}]},{name:"Asia/Amman",rules:[{e:14147064e5,s:13959576e5},{e:1446156e6,s:14274072e5},{e:14776056e5,s:14594616e5},{e:15090552e5,s:14909112e5},{e:15405048e5,s:15223608e5}]},{name:"Asia/Damascus",rules:[{e:14147028e5,s:13959576e5},{e:14461524e5,s:14274072e5},{e:1477602e6,s:14588568e5},{e:15090516e5,s:14909112e5},{e:15405012e5,s:15223608e5}]},{name:"Asia/Dubai",rules:[!1,!1,!1,!1,!1]},{name:"Asia/Gaza",rules:[{e:1414098e6,s:13959576e5},{e:14455476e5,s:14274936e5},{e:1477692e6,s:14589468e5},{e:15091416e5,s:14903964e5},{e:15405912e5,s:1521846e6}]},{name:"Asia/Irkutsk",rules:[!1,!1,!1,!1,!1]},{name:"Asia/Jerusalem",rules:[{e:1414278e6,s:13959648e5},{e:14457276e5,s:14274144e5},{e:1477782e6,s:1458864e6},{e:15092316e5,s:14903136e5},{e:15406812e5,s:15217632e5}]},{name:"Asia/Kamchatka",rules:[!1,!1,!1,!1,!1]},{name:"Asia/Krasnoyarsk",rules:[!1,!1,!1,!1,!1]},{name:"Asia/Omsk",rules:[!1,!1,!1,!1,!1]},{name:"Asia/Vladivostok",rules:[!1,!1,!1,!1,!1]},{name:"Asia/Yakutsk",rules:[!1,!1,!1,!1,!1]},{name:"Asia/Yekaterinburg",rules:[!1,!1,!1,!1,!1]},{name:"Asia/Yerevan",rules:[!1,!1,!1,!1,!1]},{name:"Australia/Lord_Howe",rules:[{e:139671e7,s:14124366e5},{e:14281596e5,s:14438862e5},{e:14596092e5,s:14753358e5},{e:14910588e5,s:15067854e5},{e:15225084e5,s:15388398e5}]},{name:"Australia/Perth",rules:[!1,!1,!1,!1,!1]},{name:"Europe/Helsinki",rules:[{e:14142852e5,s:13961412e5},{e:14457348e5,s:14275908e5},{e:14777892e5,s:14590404e5},{e:15092388e5,s:149049e7},{e:15406884e5,s:15219396e5}]},{name:"Europe/Minsk",rules:[!1,!1,!1,!1,!1]},{name:"Europe/Moscow",rules:[!1,!1,!1,!1,!1]},{name:"Pacific/Apia",rules:[{e:13967064e5,s:14118264e5},{e:1428156e6,s:1443276e6},{e:14596056e5,s:14747256e5},{e:14910552e5,s:15061752e5},{e:15225048e5,s:15382296e5}]},{name:"Pacific/Fiji",rules:[{e:14215032e5,s:14148504e5},{e:14529528e5,s:14463e8},{e:14844024e5,s:14783544e5},{e:1515852e6,s:1509804e6},{e:15479064e5,s:15412536e5}]},{name:"Europe/London",rules:[{e:14142852e5,s:13961412e5},{e:14457348e5,s:14275908e5},{e:14777892e5,s:14590404e5},{e:15092388e5,s:149049e7},{e:15406884e5,s:15219396e5}]}]}}};return{determine:function(){var e,n,a=function(){var e,n;if("undefined"!=typeof Intl&&void 0!==Intl.DateTimeFormat&&void 0!==(e=Intl.DateTimeFormat())&&void 0!==e.resolvedOptions)return(n=e.resolvedOptions().timeZone)&&(n.indexOf("/")>-1||"UTC"===n)&&0!=n.indexOf("Etc")?n:void 0}();return a||(a=ae.olson.timezones[q()],void 0!==Z.AMBIGUITIES[a]&&(e=a,n=function(){for(var e=[],n=0;na.rules[i].e){r="N/A";break}if(r=0,r+=Math.abs(e[i].s-a.rules[i].s),(r+=Math.abs(a.rules[i].e-e[i].e))>Z.MAX_SCORE){r="N/A";break}}return function(e,n,a,r){if("N/A"!==a)return a;if("Asia/Beirut"===n){if("Africa/Cairo"===r.name&&13983768e5===e[6].s&&14116788e5===e[6].e)return 0;if("Asia/Jerusalem"===r.name&&13959648e5===e[6].s&&14118588e5===e[6].e)return 0}else if("America/Santiago"===n){if("America/Asuncion"===r.name&&14124816e5===e[6].s&&1397358e6===e[6].e)return 0;if("America/Campo_Grande"===r.name&&14136912e5===e[6].s&&13925196e5===e[6].e)return 0}else if("America/Montevideo"===n){if("America/Sao_Paulo"===r.name&&14136876e5===e[6].s&&1392516e6===e[6].e)return 0}else if("Pacific/Auckland"===n&&"Pacific/Fiji"===r.name&&14142456e5===e[6].s&&13961016e5===e[6].e)return 0;return a}(e,n,r,a)},r={},i=ae.olson.dst_rules.zones,t=i.length,o=Z.AMBIGUITIES[n],s=0;t>s;s++){var c=i[s],u=a(i[s]);"N/A"!==u&&(r[c.name]=u)}for(var f in r)if(r.hasOwnProperty(f))for(var l=0;l 0) { - return june_offset + ",1," + HEMISPHERE_SOUTH; - } - - return january_offset + ",0"; - }, - - - /** - * Tries to get the time zone key directly from the operating system for those - * environments that support the ECMAScript Internationalization API. - */ - get_from_internationalization_api = function get_from_internationalization_api() { - var format, timezone; - if (typeof Intl === "undefined" || typeof Intl.DateTimeFormat === "undefined") { - return; - } - format = Intl.DateTimeFormat(); - if (typeof format === "undefined" || typeof format.resolvedOptions === "undefined") { - return; - } - timezone = format.resolvedOptions().timeZone; - if (timezone && (timezone.indexOf("/") > -1 || timezone === 'UTC') && timezone.indexOf("Etc") != 0) { - return timezone; - } - }, - - /** - * Starting point for getting all the DST rules for a specific year - * for the current timezone (as described by the client system). - * - * Returns an object with start and end attributes, or false if no - * DST rules were found for the year. - * - * @param year - * @returns {Object} || {Boolean} - */ - dst_dates = function dst_dates(year) { - var yearstart = new Date(year, 0, 1, 0, 0, 1, 0).getTime(); - var yearend = new Date(year, 12, 31, 23, 59, 59).getTime(); - var current = yearstart; - var offset = (new Date(current)).getTimezoneOffset(); - var dst_start = null; - var dst_end = null; - - while (current < yearend - 86400000) { - var dateToCheck = new Date(current); - var dateToCheckOffset = dateToCheck.getTimezoneOffset(); - - if (dateToCheckOffset !== offset) { - if (dateToCheckOffset < offset) { - dst_start = dateToCheck; - } - if (dateToCheckOffset > offset) { - dst_end = dateToCheck; - } - offset = dateToCheckOffset; - } - - current += 86400000; - } - - if (dst_start && dst_end) { - return { - s: find_dst_fold(dst_start).getTime(), - e: find_dst_fold(dst_end).getTime() - }; - } - - return false; - }, - - /** - * Probably completely unnecessary function that recursively finds the - * exact (to the second) time when a DST rule was changed. - * - * @param a_date - The candidate Date. - * @param padding - integer specifying the padding to allow around the candidate - * date for finding the fold. - * @param iterator - integer specifying how many milliseconds to iterate while - * searching for the fold. - * - * @returns {Date} - */ - find_dst_fold = function find_dst_fold(a_date, padding, iterator) { - if (typeof padding === 'undefined') { - padding = consts.DAY; - iterator = consts.HOUR; - } - - var date_start = new Date(a_date.getTime() - padding).getTime(); - var date_end = a_date.getTime() + padding; - var offset = new Date(date_start).getTimezoneOffset(); - - var current = date_start; - - var dst_change = null; - while (current < date_end - iterator) { - var dateToCheck = new Date(current); - var dateToCheckOffset = dateToCheck.getTimezoneOffset(); - - if (dateToCheckOffset !== offset) { - dst_change = dateToCheck; - break; - } - current += iterator; - } - - if (padding === consts.DAY) { - return find_dst_fold(dst_change, consts.HOUR, consts.MINUTE); - } - - if (padding === consts.HOUR) { - return find_dst_fold(dst_change, consts.MINUTE, consts.SECOND); - } - - return dst_change; - }, - - windows7_adaptations = function windows7_adaptions(rule_list, preliminary_timezone, score, sample) { - if (score !== 'N/A') { - return score; - } - if (preliminary_timezone === 'Asia/Beirut') { - if (sample.name === 'Africa/Cairo') { - if (rule_list[6].s === 1398376800000 && rule_list[6].e === 1411678800000) { - return 0; - } - } - if (sample.name === 'Asia/Jerusalem') { - if (rule_list[6].s === 1395964800000 && rule_list[6].e === 1411858800000) { - return 0; - } - } - } else if (preliminary_timezone === 'America/Santiago') { - if (sample.name === 'America/Asuncion') { - if (rule_list[6].s === 1412481600000 && rule_list[6].e === 1397358000000) { - return 0; - } - } - if (sample.name === 'America/Campo_Grande') { - if (rule_list[6].s === 1413691200000 && rule_list[6].e === 1392519600000) { - return 0; - } - } - } else if (preliminary_timezone === 'America/Montevideo') { - if (sample.name === 'America/Sao_Paulo') { - if (rule_list[6].s === 1413687600000 && rule_list[6].e === 1392516000000) { - return 0; - } - } - } else if (preliminary_timezone === 'Pacific/Auckland') { - if (sample.name === 'Pacific/Fiji') { - if (rule_list[6].s === 1414245600000 && rule_list[6].e === 1396101600000) { - return 0; - } - } - } - - return score; - }, - - /** - * Takes the DST rules for the current timezone, and proceeds to find matches - * in the jstz.olson.dst_rules.zones array. - * - * Compares samples to the current timezone on a scoring basis. - * - * Candidates are ruled immediately if either the candidate or the current zone - * has a DST rule where the other does not. - * - * Candidates are ruled out immediately if the current zone has a rule that is - * outside the DST scope of the candidate. - * - * Candidates are included for scoring if the current zones rules fall within the - * span of the samples rules. - * - * Low score is best, the score is calculated by summing up the differences in DST - * rules and if the consts.MAX_SCORE is overreached the candidate is ruled out. - * - * Yah follow? :) - * - * @param rule_list - * @param preliminary_timezone - * @returns {*} - */ - best_dst_match = function best_dst_match(rule_list, preliminary_timezone) { - var score_sample = function score_sample(sample) { - var score = 0; - - for (var j = 0; j < rule_list.length; j++) { - - // Both sample and current time zone report DST during the year. - if (!!sample.rules[j] && !!rule_list[j]) { - - // The current time zone's DST rules are inside the sample's. Include. - if (rule_list[j].s >= sample.rules[j].s && rule_list[j].e <= sample.rules[j].e) { - score = 0; - score += Math.abs(rule_list[j].s - sample.rules[j].s); - score += Math.abs(sample.rules[j].e - rule_list[j].e); - - // The current time zone's DST rules are outside the sample's. Discard. - } else { - score = 'N/A'; - break; - } - - // The max score has been reached. Discard. - if (score > consts.MAX_SCORE) { - score = 'N/A'; - break; - } - } - } - - score = windows7_adaptations(rule_list, preliminary_timezone, score, sample); - - return score; - }; - var scoreboard = {}; - var dst_zones = jstz.olson.dst_rules.zones; - var dst_zones_length = dst_zones.length; - var ambiguities = consts.AMBIGUITIES[preliminary_timezone]; - - for (var i = 0; i < dst_zones_length; i++) { - var sample = dst_zones[i]; - var score = score_sample(dst_zones[i]); - - if (score !== 'N/A') { - scoreboard[sample.name] = score; - } - } - - for (var tz in scoreboard) { - if (scoreboard.hasOwnProperty(tz)) { - for (var j = 0; j < ambiguities.length; j++) { - if (ambiguities[j] === tz) { - return tz; - } - } - } - } - - return preliminary_timezone; - }, - - /** - * Takes the preliminary_timezone as detected by lookup_key(). - * - * Builds up the current timezones DST rules for the years defined - * in the jstz.olson.dst_rules.years array. - * - * If there are no DST occurences for those years, immediately returns - * the preliminary timezone. Otherwise proceeds and tries to solve - * ambiguities. - * - * @param preliminary_timezone - * @returns {String} timezone_name - */ - get_by_dst = function get_by_dst(preliminary_timezone) { - var get_rules = function get_rules() { - var rule_list = []; - for (var i = 0; i < jstz.olson.dst_rules.years.length; i++) { - var year_rules = dst_dates(jstz.olson.dst_rules.years[i]); - rule_list.push(year_rules); - } - return rule_list; - }; - var check_has_dst = function check_has_dst(rules) { - for (var i = 0; i < rules.length; i++) { - if (rules[i] !== false) { - return true; - } - } - return false; - }; - var rules = get_rules(); - var has_dst = check_has_dst(rules); - - if (has_dst) { - return best_dst_match(rules, preliminary_timezone); - } - - return preliminary_timezone; - }, - - /** - * Uses get_timezone_info() to formulate a key to use in the olson.timezones dictionary. - * - * Returns an object with one function ".name()" - * - * @returns Object - */ - determine = function determine() { - var preliminary_tz = get_from_internationalization_api(); - - if (!preliminary_tz) { - preliminary_tz = jstz.olson.timezones[lookup_key()]; - - if (typeof consts.AMBIGUITIES[preliminary_tz] !== 'undefined') { - preliminary_tz = get_by_dst(preliminary_tz); - } - } - - return { - name: function () { - return preliminary_tz; - }, - stdTimezoneOffset : function () { - // negative to match what (new Date).getTimezoneOffset() will return - return -lookup_key().split(',')[0]; - }, - timezoneOffset : function () { - // negative to match what (new Date).getTimezoneOffset() will return - return -get_date_offset(new Date()) - } - }; - }; - - return { - determine: determine - }; -}()); - - -jstz.olson = jstz.olson || {}; - -/** - * The keys in this dictionary are comma separated as such: - * - * First the offset compared to UTC time in minutes. - * - * Then a flag which is 0 if the timezone does not take daylight savings into account and 1 if it - * does. - * - * Thirdly an optional 's' signifies that the timezone is in the southern hemisphere, - * only interesting for timezones with DST. - * - * The mapped arrays is used for constructing the jstz.TimeZone object from within - * jstz.determine(); - */ -jstz.olson.timezones = { - '-720,0': 'Etc/GMT+12', - '-660,0': 'Pacific/Pago_Pago', - '-660,1,s': 'Pacific/Apia', // Why? Because windows... cry! - '-600,1': 'America/Adak', - '-600,0': 'Pacific/Honolulu', - '-570,0': 'Pacific/Marquesas', - '-540,0': 'Pacific/Gambier', - '-540,1': 'America/Anchorage', - '-480,1': 'America/Los_Angeles', - '-480,0': 'Pacific/Pitcairn', - '-420,0': 'America/Phoenix', - '-420,1': 'America/Denver', - '-360,0': 'America/Guatemala', - '-360,1': 'America/Chicago', - '-360,1,s': 'Pacific/Easter', - '-300,0': 'America/Bogota', - '-300,1': 'America/New_York', - '-270,0': 'America/Caracas', - '-240,1': 'America/Halifax', - '-240,0': 'America/Santo_Domingo', - '-240,1,s': 'America/Asuncion', - '-210,1': 'America/St_Johns', - '-180,1': 'America/Godthab', - '-180,0': 'America/Argentina/Buenos_Aires', - '-180,1,s': 'America/Montevideo', - '-120,0': 'America/Noronha', - '-120,1': 'America/Noronha', - '-60,1': 'Atlantic/Azores', - '-60,0': 'Atlantic/Cape_Verde', - '0,0': 'UTC', - '0,1': 'Europe/London', - '60,1': 'Europe/Berlin', - '60,0': 'Africa/Lagos', - '60,1,s': 'Africa/Windhoek', - '120,1': 'Asia/Beirut', - '120,0': 'Africa/Johannesburg', - '180,0': 'Asia/Baghdad', - '180,1': 'Europe/Moscow', - '210,1': 'Asia/Tehran', - '240,0': 'Asia/Dubai', - '240,1': 'Asia/Baku', - '270,0': 'Asia/Kabul', - '300,1': 'Asia/Yekaterinburg', - '300,0': 'Asia/Karachi', - '330,0': 'Asia/Kolkata', - '345,0': 'Asia/Kathmandu', - '360,0': 'Asia/Dhaka', - '360,1': 'Asia/Omsk', - '390,0': 'Asia/Rangoon', - '420,1': 'Asia/Krasnoyarsk', - '420,0': 'Asia/Jakarta', - '480,0': 'Asia/Shanghai', - '480,1': 'Asia/Irkutsk', - '525,0': 'Australia/Eucla', - '525,1,s': 'Australia/Eucla', - '540,1': 'Asia/Yakutsk', - '540,0': 'Asia/Tokyo', - '570,0': 'Australia/Darwin', - '570,1,s': 'Australia/Adelaide', - '600,0': 'Australia/Brisbane', - '600,1': 'Asia/Vladivostok', - '600,1,s': 'Australia/Sydney', - '630,1,s': 'Australia/Lord_Howe', - '660,1': 'Asia/Kamchatka', - '660,0': 'Pacific/Noumea', - '690,0': 'Pacific/Norfolk', - '720,1,s': 'Pacific/Auckland', - '720,0': 'Pacific/Majuro', - '765,1,s': 'Pacific/Chatham', - '780,0': 'Pacific/Tongatapu', - '780,1,s': 'Pacific/Apia', - '840,0': 'Pacific/Kiritimati' -}; diff --git a/jstz.rules.js b/jstz.rules.js deleted file mode 100644 index 6ce455d..0000000 --- a/jstz.rules.js +++ /dev/null @@ -1,917 +0,0 @@ -/* Build time: 2015-11-02 13:01:00Z Build by invoking python utilities/dst.py generate */ -jstz.olson.dst_rules = { - "years": [ - 2008, - 2009, - 2010, - 2011, - 2012, - 2013, - 2014 - ], - "zones": [ - { - "name": "Africa/Cairo", - "rules": [ - { - "e": 1219957200000, - "s": 1209074400000 - }, - { - "e": 1250802000000, - "s": 1240524000000 - }, - { - "e": 1285880400000, - "s": 1284069600000 - }, - false, - false, - false, - { - "e": 1411678800000, - "s": 1406844000000 - } - ] - }, - { - "name": "Africa/Casablanca", - "rules": [ - { - "e": 1220223600000, - "s": 1212278400000 - }, - { - "e": 1250809200000, - "s": 1243814400000 - }, - { - "e": 1281222000000, - "s": 1272758400000 - }, - { - "e": 1312066800000, - "s": 1301788800000 - }, - { - "e": 1348970400000, - "s": 1345428000000 - }, - { - "e": 1382839200000, - "s": 1376100000000 - }, - { - "e": 1414288800000, - "s": 1406944800000 - } - ] - }, - { - "name": "America/Asuncion", - "rules": [ - { - "e": 1205031600000, - "s": 1224388800000 - }, - { - "e": 1236481200000, - "s": 1255838400000 - }, - { - "e": 1270954800000, - "s": 1286078400000 - }, - { - "e": 1302404400000, - "s": 1317528000000 - }, - { - "e": 1333854000000, - "s": 1349582400000 - }, - { - "e": 1364094000000, - "s": 1381032000000 - }, - { - "e": 1395543600000, - "s": 1412481600000 - } - ] - }, - { - "name": "America/Campo_Grande", - "rules": [ - { - "e": 1203217200000, - "s": 1224388800000 - }, - { - "e": 1234666800000, - "s": 1255838400000 - }, - { - "e": 1266721200000, - "s": 1287288000000 - }, - { - "e": 1298170800000, - "s": 1318737600000 - }, - { - "e": 1330225200000, - "s": 1350792000000 - }, - { - "e": 1361070000000, - "s": 1382241600000 - }, - { - "e": 1392519600000, - "s": 1413691200000 - } - ] - }, - { - "name": "America/Goose_Bay", - "rules": [ - { - "e": 1225594860000, - "s": 1205035260000 - }, - { - "e": 1257044460000, - "s": 1236484860000 - }, - { - "e": 1289098860000, - "s": 1268539260000 - }, - { - "e": 1320555600000, - "s": 1299988860000 - }, - { - "e": 1352005200000, - "s": 1331445600000 - }, - { - "e": 1383454800000, - "s": 1362895200000 - }, - { - "e": 1414904400000, - "s": 1394344800000 - } - ] - }, - { - "name": "America/Havana", - "rules": [ - { - "e": 1224997200000, - "s": 1205643600000 - }, - { - "e": 1256446800000, - "s": 1236488400000 - }, - { - "e": 1288501200000, - "s": 1268542800000 - }, - { - "e": 1321160400000, - "s": 1300597200000 - }, - { - "e": 1352005200000, - "s": 1333256400000 - }, - { - "e": 1383454800000, - "s": 1362891600000 - }, - { - "e": 1414904400000, - "s": 1394341200000 - } - ] - }, - { - "name": "America/Mazatlan", - "rules": [ - { - "e": 1225008000000, - "s": 1207472400000 - }, - { - "e": 1256457600000, - "s": 1238922000000 - }, - { - "e": 1288512000000, - "s": 1270371600000 - }, - { - "e": 1319961600000, - "s": 1301821200000 - }, - { - "e": 1351411200000, - "s": 1333270800000 - }, - { - "e": 1382860800000, - "s": 1365325200000 - }, - { - "e": 1414310400000, - "s": 1396774800000 - } - ] - }, - { - "name": "America/Mexico_City", - "rules": [ - { - "e": 1225004400000, - "s": 1207468800000 - }, - { - "e": 1256454000000, - "s": 1238918400000 - }, - { - "e": 1288508400000, - "s": 1270368000000 - }, - { - "e": 1319958000000, - "s": 1301817600000 - }, - { - "e": 1351407600000, - "s": 1333267200000 - }, - { - "e": 1382857200000, - "s": 1365321600000 - }, - { - "e": 1414306800000, - "s": 1396771200000 - } - ] - }, - { - "name": "America/Miquelon", - "rules": [ - { - "e": 1225598400000, - "s": 1205038800000 - }, - { - "e": 1257048000000, - "s": 1236488400000 - }, - { - "e": 1289102400000, - "s": 1268542800000 - }, - { - "e": 1320552000000, - "s": 1299992400000 - }, - { - "e": 1352001600000, - "s": 1331442000000 - }, - { - "e": 1383451200000, - "s": 1362891600000 - }, - { - "e": 1414900800000, - "s": 1394341200000 - } - ] - }, - { - "name": "America/Santa_Isabel", - "rules": [ - { - "e": 1225011600000, - "s": 1207476000000 - }, - { - "e": 1256461200000, - "s": 1238925600000 - }, - { - "e": 1288515600000, - "s": 1270375200000 - }, - { - "e": 1319965200000, - "s": 1301824800000 - }, - { - "e": 1351414800000, - "s": 1333274400000 - }, - { - "e": 1382864400000, - "s": 1365328800000 - }, - { - "e": 1414314000000, - "s": 1396778400000 - } - ] - }, - { - "name": "America/Santiago", - "rules": [ - { - "e": 1206846000000, - "s": 1223784000000 - }, - { - "e": 1237086000000, - "s": 1255233600000 - }, - { - "e": 1270350000000, - "s": 1286683200000 - }, - { - "e": 1304823600000, - "s": 1313899200000 - }, - { - "e": 1335668400000, - "s": 1346558400000 - }, - { - "e": 1367118000000, - "s": 1378612800000 - }, - { - "e": 1398567600000, - "s": 1410062400000 - } - ] - }, - { - "name": "America/Sao_Paulo", - "rules": [ - { - "e": 1203213600000, - "s": 1224385200000 - }, - { - "e": 1234663200000, - "s": 1255834800000 - }, - { - "e": 1266717600000, - "s": 1287284400000 - }, - { - "e": 1298167200000, - "s": 1318734000000 - }, - { - "e": 1330221600000, - "s": 1350788400000 - }, - { - "e": 1361066400000, - "s": 1382238000000 - }, - { - "e": 1392516000000, - "s": 1413687600000 - } - ] - }, - { - "name": "Asia/Amman", - "rules": [ - { - "e": 1225404000000, - "s": 1206655200000 - }, - { - "e": 1256853600000, - "s": 1238104800000 - }, - { - "e": 1288303200000, - "s": 1269554400000 - }, - { - "e": 1319752800000, - "s": 1301608800000 - }, - false, - false, - { - "e": 1414706400000, - "s": 1395957600000 - } - ] - }, - { - "name": "Asia/Damascus", - "rules": [ - { - "e": 1225486800000, - "s": 1207260000000 - }, - { - "e": 1256850000000, - "s": 1238104800000 - }, - { - "e": 1288299600000, - "s": 1270159200000 - }, - { - "e": 1319749200000, - "s": 1301608800000 - }, - { - "e": 1351198800000, - "s": 1333058400000 - }, - { - "e": 1382648400000, - "s": 1364508000000 - }, - { - "e": 1414702800000, - "s": 1395957600000 - } - ] - }, - { - "name": "Asia/Dubai", - "rules": [ - false, - false, - false, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Gaza", - "rules": [ - { - "e": 1219957200000, - "s": 1206655200000 - }, - { - "e": 1252015200000, - "s": 1238104800000 - }, - { - "e": 1281474000000, - "s": 1269640860000 - }, - { - "e": 1312146000000, - "s": 1301608860000 - }, - { - "e": 1348178400000, - "s": 1333058400000 - }, - { - "e": 1380229200000, - "s": 1364508000000 - }, - { - "e": 1414098000000, - "s": 1395957600000 - } - ] - }, - { - "name": "Asia/Irkutsk", - "rules": [ - { - "e": 1224957600000, - "s": 1206813600000 - }, - { - "e": 1256407200000, - "s": 1238263200000 - }, - { - "e": 1288461600000, - "s": 1269712800000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Jerusalem", - "rules": [ - { - "e": 1223161200000, - "s": 1206662400000 - }, - { - "e": 1254006000000, - "s": 1238112000000 - }, - { - "e": 1284246000000, - "s": 1269561600000 - }, - { - "e": 1317510000000, - "s": 1301616000000 - }, - { - "e": 1348354800000, - "s": 1333065600000 - }, - { - "e": 1382828400000, - "s": 1364515200000 - }, - { - "e": 1414278000000, - "s": 1395964800000 - } - ] - }, - { - "name": "Asia/Kamchatka", - "rules": [ - { - "e": 1224943200000, - "s": 1206799200000 - }, - { - "e": 1256392800000, - "s": 1238248800000 - }, - { - "e": 1288450800000, - "s": 1269698400000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Krasnoyarsk", - "rules": [ - { - "e": 1224961200000, - "s": 1206817200000 - }, - { - "e": 1256410800000, - "s": 1238266800000 - }, - { - "e": 1288465200000, - "s": 1269716400000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Omsk", - "rules": [ - { - "e": 1224964800000, - "s": 1206820800000 - }, - { - "e": 1256414400000, - "s": 1238270400000 - }, - { - "e": 1288468800000, - "s": 1269720000000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Vladivostok", - "rules": [ - { - "e": 1224950400000, - "s": 1206806400000 - }, - { - "e": 1256400000000, - "s": 1238256000000 - }, - { - "e": 1288454400000, - "s": 1269705600000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Yakutsk", - "rules": [ - { - "e": 1224954000000, - "s": 1206810000000 - }, - { - "e": 1256403600000, - "s": 1238259600000 - }, - { - "e": 1288458000000, - "s": 1269709200000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Yekaterinburg", - "rules": [ - { - "e": 1224968400000, - "s": 1206824400000 - }, - { - "e": 1256418000000, - "s": 1238274000000 - }, - { - "e": 1288472400000, - "s": 1269723600000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Asia/Yerevan", - "rules": [ - { - "e": 1224972000000, - "s": 1206828000000 - }, - { - "e": 1256421600000, - "s": 1238277600000 - }, - { - "e": 1288476000000, - "s": 1269727200000 - }, - { - "e": 1319925600000, - "s": 1301176800000 - }, - false, - false, - false - ] - }, - { - "name": "Australia/Lord_Howe", - "rules": [ - { - "e": 1207407600000, - "s": 1223134200000 - }, - { - "e": 1238857200000, - "s": 1254583800000 - }, - { - "e": 1270306800000, - "s": 1286033400000 - }, - { - "e": 1301756400000, - "s": 1317483000000 - }, - { - "e": 1333206000000, - "s": 1349537400000 - }, - { - "e": 1365260400000, - "s": 1380987000000 - }, - { - "e": 1396710000000, - "s": 1412436600000 - } - ] - }, - { - "name": "Australia/Perth", - "rules": [ - { - "e": 1206813600000, - "s": 1224957600000 - }, - false, - false, - false, - false, - false, - false - ] - }, - { - "name": "Europe/Helsinki", - "rules": [ - { - "e": 1224982800000, - "s": 1206838800000 - }, - { - "e": 1256432400000, - "s": 1238288400000 - }, - { - "e": 1288486800000, - "s": 1269738000000 - }, - { - "e": 1319936400000, - "s": 1301187600000 - }, - { - "e": 1351386000000, - "s": 1332637200000 - }, - { - "e": 1382835600000, - "s": 1364691600000 - }, - { - "e": 1414285200000, - "s": 1396141200000 - } - ] - }, - { - "name": "Europe/Minsk", - "rules": [ - { - "e": 1224979200000, - "s": 1206835200000 - }, - { - "e": 1256428800000, - "s": 1238284800000 - }, - { - "e": 1288483200000, - "s": 1269734400000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Europe/Moscow", - "rules": [ - { - "e": 1224975600000, - "s": 1206831600000 - }, - { - "e": 1256425200000, - "s": 1238281200000 - }, - { - "e": 1288479600000, - "s": 1269730800000 - }, - false, - false, - false, - false - ] - }, - { - "name": "Pacific/Apia", - "rules": [ - false, - false, - false, - { - "e": 1301752800000, - "s": 1316872800000 - }, - { - "e": 1333202400000, - "s": 1348927200000 - }, - { - "e": 1365256800000, - "s": 1380376800000 - }, - { - "e": 1396706400000, - "s": 1411826400000 - } - ] - }, - { - "name": "Pacific/Fiji", - "rules": [ - false, - false, - { - "e": 1269698400000, - "s": 1287842400000 - }, - { - "e": 1327154400000, - "s": 1319292000000 - }, - { - "e": 1358604000000, - "s": 1350741600000 - }, - { - "e": 1390050000000, - "s": 1382796000000 - }, - { - "e": 1421503200000, - "s": 1414850400000 - } - ] - }, - { - "name": "Europe/London", - "rules": [ - { - "e": 1224982800000, - "s": 1206838800000 - }, - { - "e": 1256432400000, - "s": 1238288400000 - }, - { - "e": 1288486800000, - "s": 1269738000000 - }, - { - "e": 1319936400000, - "s": 1301187600000 - }, - { - "e": 1351386000000, - "s": 1332637200000 - }, - { - "e": 1382835600000, - "s": 1364691600000 - }, - { - "e": 1414285200000, - "s": 1396141200000 - } - ] - } - ] -}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..3e5d5fd --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2748 @@ +{ + "name": "jstz", + "version": "2.1.1", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/core": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.2.2.tgz", + "integrity": "sha512-59vB0RWt09cAct5EIe58+NzGP4TFSD3Bz//2/ELy3ZeTeKF6VTD1AXlH8BGGbCX0PuobZBsIzO7IAI9PH67eKw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/generator": "^7.2.2", + "@babel/helpers": "^7.2.0", + "@babel/parser": "^7.2.2", + "@babel/template": "^7.2.2", + "@babel/traverse": "^7.2.2", + "@babel/types": "^7.2.2", + "convert-source-map": "^1.1.0", + "debug": "^4.1.0", + "json5": "^2.1.0", + "lodash": "^4.17.10", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.2.2.tgz", + "integrity": "sha512-I4o675J/iS8k+P38dvJ3IBGqObLXyQLTxtrR4u9cSUJOURvafeEWb/pFMOTwtNrmq73mJzyF6ueTbO1BtN0Zeg==", + "dev": true, + "requires": { + "@babel/types": "^7.2.2", + "jsesc": "^2.5.1", + "lodash": "^4.17.10", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/helper-annotate-as-pure": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz", + "integrity": "sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz", + "integrity": "sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w==", + "dev": true, + "requires": { + "@babel/helper-explode-assignable-expression": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-call-delegate": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.1.0.tgz", + "integrity": "sha512-YEtYZrw3GUK6emQHKthltKNZwszBcHK58Ygcis+gVUrF4/FmTVr5CCqQNSfmvg2y+YDEANyYoaLz/SHsnusCwQ==", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "^7.0.0", + "@babel/traverse": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-define-map": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.1.0.tgz", + "integrity": "sha512-yPPcW8dc3gZLN+U1mhYV91QU3n5uTbx7DUdf8NnPbjS0RMwBuHi9Xt2MUgppmNz7CJxTBWsGczTiEp1CSOTPRg==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.1.0", + "@babel/types": "^7.0.0", + "lodash": "^4.17.10" + } + }, + "@babel/helper-explode-assignable-expression": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz", + "integrity": "sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA==", + "dev": true, + "requires": { + "@babel/traverse": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-function-name": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", + "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", + "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0.tgz", + "integrity": "sha512-Ggv5sldXUeSKsuzLkddtyhyHe2YantsxWKNi7A+7LeD12ExRDWTRk29JCXpaHPAbMaIPZSil7n+lq78WY2VY7w==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz", + "integrity": "sha512-avo+lm/QmZlv27Zsi0xEor2fKcqWG56D5ae9dzklpIaY7cQMK5N8VSpaNVPPagiqmy7LrEjK1IWdGMOqPu5csg==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-module-imports": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz", + "integrity": "sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-module-transforms": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.2.2.tgz", + "integrity": "sha512-YRD7I6Wsv+IHuTPkAmAS4HhY0dkPobgLftHp0cRGZSdrRvmZY8rFvae/GVu3bD00qscuvK3WPHB3YdNpBXUqrA==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-simple-access": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.0.0", + "@babel/template": "^7.2.2", + "@babel/types": "^7.2.2", + "lodash": "^4.17.10" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz", + "integrity": "sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz", + "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==", + "dev": true + }, + "@babel/helper-regex": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.0.0.tgz", + "integrity": "sha512-TR0/N0NDCcUIUEbqV6dCO+LptmmSQFQ7q70lfcEB4URsjD0E1HzicrwUH+ap6BAQ2jhCX9Q4UqZy4wilujWlkg==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + }, + "@babel/helper-remap-async-to-generator": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz", + "integrity": "sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.0.0", + "@babel/helper-wrap-function": "^7.1.0", + "@babel/template": "^7.1.0", + "@babel/traverse": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-replace-supers": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.2.3.tgz", + "integrity": "sha512-GyieIznGUfPXPWu0yLS6U55Mz67AZD9cUk0BfirOWlPrXlBcan9Gz+vHGz+cPfuoweZSnPzPIm67VtQM0OWZbA==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.0.0", + "@babel/helper-optimise-call-expression": "^7.0.0", + "@babel/traverse": "^7.2.3", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-simple-access": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz", + "integrity": "sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w==", + "dev": true, + "requires": { + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz", + "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-wrap-function": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz", + "integrity": "sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.1.0", + "@babel/template": "^7.1.0", + "@babel/traverse": "^7.1.0", + "@babel/types": "^7.2.0" + } + }, + "@babel/helpers": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.2.0.tgz", + "integrity": "sha512-Fr07N+ea0dMcMN8nFpuK6dUIT7/ivt9yKQdEEnjVS83tG2pHwPi03gYmk/tyuwONnZ+sY+GFFPlWGgCtW1hF9A==", + "dev": true, + "requires": { + "@babel/template": "^7.1.2", + "@babel/traverse": "^7.1.5", + "@babel/types": "^7.2.0" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.2.3.tgz", + "integrity": "sha512-0LyEcVlfCoFmci8mXx8A5oIkpkOgyo8dRHtxBnK9RRBwxO2+JZPNsqtVEZQ7mJFPxnXF9lfmU24mHOPI0qnlkA==", + "dev": true + }, + "@babel/plugin-proposal-async-generator-functions": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz", + "integrity": "sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-remap-async-to-generator": "^7.1.0", + "@babel/plugin-syntax-async-generators": "^7.2.0" + } + }, + "@babel/plugin-proposal-json-strings": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz", + "integrity": "sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-json-strings": "^7.2.0" + } + }, + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.2.0.tgz", + "integrity": "sha512-1L5mWLSvR76XYUQJXkd/EEQgjq8HHRP6lQuZTTg0VA4tTGPpGemmCdAfQIz1rzEuWAm+ecP8PyyEm30jC1eQCg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-object-rest-spread": "^7.2.0" + } + }, + "@babel/plugin-proposal-optional-catch-binding": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz", + "integrity": "sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.2.0" + } + }, + "@babel/plugin-proposal-unicode-property-regex": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.2.0.tgz", + "integrity": "sha512-LvRVYb7kikuOtIoUeWTkOxQEV1kYvL5B6U3iWEGCzPNRus1MzJweFqORTj+0jkxozkTSYNJozPOddxmqdqsRpw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-regex": "^7.0.0", + "regexpu-core": "^4.2.0" + } + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz", + "integrity": "sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz", + "integrity": "sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz", + "integrity": "sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz", + "integrity": "sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-arrow-functions": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz", + "integrity": "sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-async-to-generator": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.2.0.tgz", + "integrity": "sha512-CEHzg4g5UraReozI9D4fblBYABs7IM6UerAVG7EJVrTLC5keh00aEuLUT+O40+mJCEzaXkYfTCUKIyeDfMOFFQ==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-remap-async-to-generator": "^7.1.0" + } + }, + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz", + "integrity": "sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-block-scoping": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.2.0.tgz", + "integrity": "sha512-vDTgf19ZEV6mx35yiPJe4fS02mPQUUcBNwWQSZFXSzTSbsJFQvHt7DqyS3LK8oOWALFOsJ+8bbqBgkirZteD5Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "lodash": "^4.17.10" + } + }, + "@babel/plugin-transform-classes": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.2.2.tgz", + "integrity": "sha512-gEZvgTy1VtcDOaQty1l10T3jQmJKlNVxLDCs+3rCVPr6nMkODLELxViq5X9l+rfxbie3XrfrMCYYY6eX3aOcOQ==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.0.0", + "@babel/helper-define-map": "^7.1.0", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-optimise-call-expression": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-replace-supers": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.0.0", + "globals": "^11.1.0" + } + }, + "@babel/plugin-transform-computed-properties": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz", + "integrity": "sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-destructuring": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.2.0.tgz", + "integrity": "sha512-coVO2Ayv7g0qdDbrNiadE4bU7lvCd9H539m2gMknyVjjMdwF/iCOM7R+E8PkntoqLkltO0rk+3axhpp/0v68VQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-dotall-regex": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.2.0.tgz", + "integrity": "sha512-sKxnyHfizweTgKZf7XsXu/CNupKhzijptfTM+bozonIuyVrLWVUvYjE2bhuSBML8VQeMxq4Mm63Q9qvcvUcciQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-regex": "^7.0.0", + "regexpu-core": "^4.1.3" + } + }, + "@babel/plugin-transform-duplicate-keys": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.2.0.tgz", + "integrity": "sha512-q+yuxW4DsTjNceUiTzK0L+AfQ0zD9rWaTLiUqHA8p0gxx7lu1EylenfzjeIWNkPy6e/0VG/Wjw9uf9LueQwLOw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz", + "integrity": "sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A==", + "dev": true, + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.1.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-for-of": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.2.0.tgz", + "integrity": "sha512-Kz7Mt0SsV2tQk6jG5bBv5phVbkd0gd27SgYD4hH1aLMJRchM0dzHaXvrWhVZ+WxAlDoAKZ7Uy3jVTW2mKXQ1WQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-function-name": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.2.0.tgz", + "integrity": "sha512-kWgksow9lHdvBC2Z4mxTsvc7YdY7w/V6B2vy9cTIPtLEE9NhwoWivaxdNM/S37elu5bqlLP/qOY906LukO9lkQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-literals": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz", + "integrity": "sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-modules-amd": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.2.0.tgz", + "integrity": "sha512-mK2A8ucqz1qhrdqjS9VMIDfIvvT2thrEsIQzbaTdc5QFzhDjQv2CkJJ5f6BXIkgbmaoax3zBr2RyvV/8zeoUZw==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.1.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.2.0.tgz", + "integrity": "sha512-V6y0uaUQrQPXUrmj+hgnks8va2L0zcZymeU7TtWEgdRLNkceafKXEduv7QzgQAE4lT+suwooG9dC7LFhdRAbVQ==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.1.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-simple-access": "^7.1.0" + } + }, + "@babel/plugin-transform-modules-systemjs": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.2.0.tgz", + "integrity": "sha512-aYJwpAhoK9a+1+O625WIjvMY11wkB/ok0WClVwmeo3mCjcNRjt+/8gHWrB5i+00mUju0gWsBkQnPpdvQ7PImmQ==", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-modules-umd": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz", + "integrity": "sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.1.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-new-target": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0.tgz", + "integrity": "sha512-yin069FYjah+LbqfGeTfzIBODex/e++Yfa0rH0fpfam9uTbuEeEOx5GLGr210ggOV77mVRNoeqSYqeuaqSzVSw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-object-super": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.2.0.tgz", + "integrity": "sha512-VMyhPYZISFZAqAPVkiYb7dUe2AsVi2/wCT5+wZdsNO31FojQJa9ns40hzZ6U9f50Jlq4w6qwzdBB2uwqZ00ebg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-replace-supers": "^7.1.0" + } + }, + "@babel/plugin-transform-parameters": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.2.0.tgz", + "integrity": "sha512-kB9+hhUidIgUoBQ0MsxMewhzr8i60nMa2KgeJKQWYrqQpqcBYtnpR+JgkadZVZoaEZ/eKu9mclFaVwhRpLNSzA==", + "dev": true, + "requires": { + "@babel/helper-call-delegate": "^7.1.0", + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-regenerator": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0.tgz", + "integrity": "sha512-sj2qzsEx8KDVv1QuJc/dEfilkg3RRPvPYx/VnKLtItVQRWt1Wqf5eVCOLZm29CiGFfYYsA3VPjfizTCV0S0Dlw==", + "dev": true, + "requires": { + "regenerator-transform": "^0.13.3" + } + }, + "@babel/plugin-transform-shorthand-properties": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz", + "integrity": "sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-spread": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz", + "integrity": "sha512-KWfky/58vubwtS0hLqEnrWJjsMGaOeSBn90Ezn5Jeg9Z8KKHmELbP1yGylMlm5N6TPKeY9A2+UaSYLdxahg01w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-sticky-regex": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz", + "integrity": "sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-regex": "^7.0.0" + } + }, + "@babel/plugin-transform-template-literals": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.2.0.tgz", + "integrity": "sha512-FkPix00J9A/XWXv4VoKJBMeSkyY9x/TqIh76wzcdfl57RJJcf8CehQ08uwfhCDNtRQYtHQKBTwKZDEyjE13Lwg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-typeof-symbol": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz", + "integrity": "sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-unicode-regex": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.2.0.tgz", + "integrity": "sha512-m48Y0lMhrbXEJnVUaYly29jRXbQ3ksxPrS1Tg8t+MHqzXhtBYAvI51euOBaoAlZLPHsieY9XPVMf80a5x0cPcA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-regex": "^7.0.0", + "regexpu-core": "^4.1.3" + } + }, + "@babel/polyfill": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.2.5.tgz", + "integrity": "sha512-8Y/t3MWThtMLYr0YNC/Q76tqN1w30+b0uQMeFUYauG2UGTR19zyUtFrAzT23zNtBxPp+LbE5E/nwV/q/r3y6ug==", + "dev": true, + "requires": { + "core-js": "^2.5.7", + "regenerator-runtime": "^0.12.0" + } + }, + "@babel/preset-env": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.2.3.tgz", + "integrity": "sha512-AuHzW7a9rbv5WXmvGaPX7wADxFkZIqKlbBh1dmZUQp4iwiPpkE/Qnrji6SC4UQCQzvWY/cpHET29eUhXS9cLPw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-async-generator-functions": "^7.2.0", + "@babel/plugin-proposal-json-strings": "^7.2.0", + "@babel/plugin-proposal-object-rest-spread": "^7.2.0", + "@babel/plugin-proposal-optional-catch-binding": "^7.2.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", + "@babel/plugin-syntax-async-generators": "^7.2.0", + "@babel/plugin-syntax-object-rest-spread": "^7.2.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.2.0", + "@babel/plugin-transform-arrow-functions": "^7.2.0", + "@babel/plugin-transform-async-to-generator": "^7.2.0", + "@babel/plugin-transform-block-scoped-functions": "^7.2.0", + "@babel/plugin-transform-block-scoping": "^7.2.0", + "@babel/plugin-transform-classes": "^7.2.0", + "@babel/plugin-transform-computed-properties": "^7.2.0", + "@babel/plugin-transform-destructuring": "^7.2.0", + "@babel/plugin-transform-dotall-regex": "^7.2.0", + "@babel/plugin-transform-duplicate-keys": "^7.2.0", + "@babel/plugin-transform-exponentiation-operator": "^7.2.0", + "@babel/plugin-transform-for-of": "^7.2.0", + "@babel/plugin-transform-function-name": "^7.2.0", + "@babel/plugin-transform-literals": "^7.2.0", + "@babel/plugin-transform-modules-amd": "^7.2.0", + "@babel/plugin-transform-modules-commonjs": "^7.2.0", + "@babel/plugin-transform-modules-systemjs": "^7.2.0", + "@babel/plugin-transform-modules-umd": "^7.2.0", + "@babel/plugin-transform-new-target": "^7.0.0", + "@babel/plugin-transform-object-super": "^7.2.0", + "@babel/plugin-transform-parameters": "^7.2.0", + "@babel/plugin-transform-regenerator": "^7.0.0", + "@babel/plugin-transform-shorthand-properties": "^7.2.0", + "@babel/plugin-transform-spread": "^7.2.0", + "@babel/plugin-transform-sticky-regex": "^7.2.0", + "@babel/plugin-transform-template-literals": "^7.2.0", + "@babel/plugin-transform-typeof-symbol": "^7.2.0", + "@babel/plugin-transform-unicode-regex": "^7.2.0", + "browserslist": "^4.3.4", + "invariant": "^2.2.2", + "js-levenshtein": "^1.1.3", + "semver": "^5.3.0" + } + }, + "@babel/template": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz", + "integrity": "sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.2.2", + "@babel/types": "^7.2.2" + } + }, + "@babel/traverse": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.2.3.tgz", + "integrity": "sha512-Z31oUD/fJvEWVR0lNZtfgvVt512ForCTNKYcJBGbPb1QZfve4WGH8Wsy7+Mev33/45fhP/hwQtvgusNdcCMgSw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/generator": "^7.2.2", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.0.0", + "@babel/parser": "^7.2.3", + "@babel/types": "^7.2.2", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.10" + } + }, + "@babel/types": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.2.2.tgz", + "integrity": "sha512-fKCuD6UFUMkR541eDWL+2ih/xFZBXPOg/7EQFeTluMDebfqR4jrpaCjLhkWlQS4hT6nRa2PMEgXKbRB5/H2fpg==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.10", + "to-fast-properties": "^2.0.0" + } + }, + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, + "@types/node": { + "version": "10.12.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", + "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==", + "dev": true + }, + "acorn": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz", + "integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==", + "dev": true + }, + "acorn-jsx": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", + "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", + "dev": true + }, + "ajv": { + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.2.tgz", + "integrity": "sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "array-differ": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-0.1.0.tgz", + "integrity": "sha1-EuLJtwa+1HyLSDtX5IdHP7CGHzo=", + "dev": true + }, + "array-union": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-0.1.0.tgz", + "integrity": "sha1-7emAiDMGZeaZ4evwIny8YDTmJ9s=", + "dev": true, + "requires": { + "array-uniq": "^0.1.0" + } + }, + "array-uniq": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-0.1.1.tgz", + "integrity": "sha1-WGHz7U5LthdVl6TgeOiqeOvpWMc=", + "dev": true + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "async": { + "version": "0.9.2", + "resolved": "http://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "browserslist": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.3.6.tgz", + "integrity": "sha512-kMGKs4BTzRWviZ8yru18xBpx+CyHG9eqgRbj9XbE3IMgtczf4aiA0Y1YCpVdvUieKGZ03kolSPXqTcscBCb9qw==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30000921", + "electron-to-chromium": "^1.3.92", + "node-releases": "^1.1.1" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "builtin-modules": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.0.0.tgz", + "integrity": "sha512-hMIeU4K2ilbXV6Uv93ZZ0Avg/M91RaKXucQ+4me2Do1txxBDyDZWCBa5bJSLqoNTRpXTLwEzIk1KmloenDDjhg==", + "dev": true + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "^0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "http://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30000925", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000925.tgz", + "integrity": "sha512-zcYupoUxtW46rOikuDF7vfL9N1Qe9ZuUBTz3n3q8fFsoJIs/h9UN6Vg/0QpjsmvImXw9mVc3g+ZBfqvUz/iALA==", + "dev": true + }, + "chai": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.0", + "type-detect": "^4.0.5" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "commander": { + "version": "2.17.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", + "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "core-js": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.1.tgz", + "integrity": "sha512-L72mmmEayPJBejKIWe2pYtGis5r0tQ5NaJekdhyXgeMQTpJoBsH0NL4ElY2LfSoV15xeQWKQ+XTTOZdyero5Xg==", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "del": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/del/-/del-0.1.3.tgz", + "integrity": "sha1-LXJKcZtaz1wLhAtCJHFeg4QGpBk=", + "dev": true, + "requires": { + "each-async": "^1.0.0", + "globby": "^0.1.1", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "each-async": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/each-async/-/each-async-1.1.1.tgz", + "integrity": "sha1-3uUim98KtrogEqOV4bhpq/iBNHM=", + "dev": true, + "requires": { + "onetime": "^1.0.0", + "set-immediate-shim": "^1.0.0" + } + }, + "electron-to-chromium": { + "version": "1.3.96", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.96.tgz", + "integrity": "sha512-ZUXBUyGLeoJxp4Nt6G/GjBRLnyz8IKQGexZ2ndWaoegThgMGFO1tdDYID5gBV32/1S83osjJHyfzvanE/8HY4Q==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "5.11.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.11.1.tgz", + "integrity": "sha512-gOKhM8JwlFOc2acbOrkYR05NW8M6DCMSvfcJiBB5NDxRE1gv8kbvxKaC9u69e6ZGEMWXcswA/7eKR229cEIpvg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.5.3", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^2.1.0", + "eslint-scope": "^4.0.0", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.0", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "imurmurhash": "^0.1.4", + "inquirer": "^6.1.0", + "js-yaml": "^3.12.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.5", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "pluralize": "^7.0.0", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "require-uncached": "^1.0.3", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.0.2", + "text-table": "^0.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + } + } + }, + "eslint-scope": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", + "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", + "dev": true + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.0.tgz", + "integrity": "sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA==", + "dev": true, + "requires": { + "acorn": "^6.0.2", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "estree-walker": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", + "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "http://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "^2.1.0" + } + }, + "external-editor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "flat-cache": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", + "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", + "dev": true, + "requires": { + "circular-json": "^0.3.1", + "graceful-fs": "^4.1.2", + "rimraf": "~2.6.2", + "write": "^0.2.1" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + } + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "glob": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", + "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", + "dev": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^2.0.1", + "once": "^1.3.0" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "globals": { + "version": "11.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz", + "integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==", + "dev": true + }, + "globby": { + "version": "0.1.1", + "resolved": "http://registry.npmjs.org/globby/-/globby-0.1.1.tgz", + "integrity": "sha1-y+xj33JLS+pFi3mhbMDjsfLKhiA=", + "dev": true, + "requires": { + "array-differ": "^0.1.0", + "array-union": "^0.1.0", + "async": "^0.9.0", + "glob": "^4.0.2" + } + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "inquirer": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.1.tgz", + "integrity": "sha512-088kl3DRT2dLU5riVMKKr1DlImd6X7smDhpXUCkJDCKvTEJeRiXh0G132HG9u5a+6Ylw9plFRY7RuTnwohYSpg==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.0", + "figures": "^2.0.0", + "lodash": "^4.17.10", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.1.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", + "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", + "dev": true + }, + "strip-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", + "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", + "dev": true, + "requires": { + "ansi-regex": "^4.0.0" + } + } + } + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "dev": true + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "dev": true, + "requires": { + "is-path-inside": "^1.0.0" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "^1.0.1" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "jest-worker": { + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-23.2.0.tgz", + "integrity": "sha1-+vcGqNo2+uYOsmlXJX+ntdjqArk=", + "dev": true, + "requires": { + "merge-stream": "^1.0.1" + } + }, + "js-levenshtein": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.4.tgz", + "integrity": "sha512-PxfGzSs0ztShKrUYPIn5r0MtyAhYcCwmndozzpz8YObbPnD1jFxzlBGbRnX2mIu6Z13xN6+PTu05TQFnZFlzow==", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json5": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", + "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "magic-string": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.1.tgz", + "integrity": "sha512-sCuTz6pYom8Rlt4ISPFn6wuFodbKMIHUMv4Qko9P17dpxb7s52KJTmRuZZqHdGmLCK9AOcDare039nRIcfdkEg==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.1" + } + }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, + "merge-stream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", + "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "minimatch": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", + "dev": true, + "requires": { + "brace-expansion": "^1.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "dependencies": { + "commander": { + "version": "2.15.1", + "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "http://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-releases": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.2.tgz", + "integrity": "sha512-j1gEV/zX821yxdWp/1vBMN0pSUjuH9oGUdLCb4PfUko6ZW7KdRs3Z+QGGwDUhYtSpQvdVVyLd2V0YvLsmdg5jQ==", + "dev": true, + "requires": { + "semver": "^5.3.0" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + }, + "dependencies": { + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + } + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "dev": true + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "randomatic": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", + "dev": true, + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz", + "integrity": "sha512-s5NGghCE4itSlUS+0WUj88G6cfMVMmH8boTPNvABf8od+2dhT9WDlWu8n01raQAJZMOK8Ch6jSexaRO7swd6aw==", + "dev": true, + "requires": { + "regenerate": "^1.4.0" + } + }, + "regenerator-runtime": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", + "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==", + "dev": true + }, + "regenerator-transform": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.3.tgz", + "integrity": "sha512-5ipTrZFSq5vU2YoGoww4uaRVAK4wyYC4TSICibbfEPOruUu8FFP7ErV0BjmbIOEpn3O/k9na9UEdYR/3m7N6uA==", + "dev": true, + "requires": { + "private": "^0.1.6" + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, + "regexpu-core": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.4.0.tgz", + "integrity": "sha512-eDDWElbwwI3K0Lo6CqbQbA6FwgtCz4kYTarrri1okfkRLZAqstU+B3voZBCjg8Fl6iq0gXrJG6MvRgLthfvgOA==", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^7.0.0", + "regjsgen": "^0.5.0", + "regjsparser": "^0.6.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.0.2" + } + }, + "regjsgen": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", + "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==", + "dev": true + }, + "regjsparser": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", + "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "http://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" + } + }, + "resolve": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.9.0.tgz", + "integrity": "sha512-TZNye00tI67lwYvzxCxHGjwTNlUV70io54/Ed4j6PscB8xVfuBJpRenI/o6dVk0cY0PYTY27AgCoGGxRnYuItQ==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + }, + "dependencies": { + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + } + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + }, + "dependencies": { + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "rollup": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.0.0.tgz", + "integrity": "sha512-LV6Qz+RkuDAfxr9YopU4k5o5P/QA7YNq9xi2Ug2IqOmhPt9sAm89vh3SkNtFok3bqZHX54eMJZ8F68HPejgqtw==", + "dev": true, + "requires": { + "@types/estree": "0.0.39", + "@types/node": "*", + "acorn": "^6.0.4" + } + }, + "rollup-plugin-babel": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-4.1.0.tgz", + "integrity": "sha512-4IYv/yTNyH4P/Cma1mWdqy42gc051i1mTe/6oe8F055WzJGSb2qs1mSDwZTo93wA6kMBgHBIR/OcBk7JMnL59Q==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "rollup-pluginutils": "^2.3.0" + } + }, + "rollup-plugin-commonjs": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.0.tgz", + "integrity": "sha512-0RM5U4Vd6iHjL6rLvr3lKBwnPsaVml+qxOGaaNUWN1lSq6S33KhITOfHmvxV3z2vy9Mk4t0g4rNlVaJJsNQPWA==", + "dev": true, + "requires": { + "estree-walker": "^0.5.2", + "magic-string": "^0.25.1", + "resolve": "^1.8.1", + "rollup-pluginutils": "^2.3.3" + } + }, + "rollup-plugin-conditional": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-conditional/-/rollup-plugin-conditional-2.2.0.tgz", + "integrity": "sha512-3yKaIMADgthqaYdw7ugtMcYnwwr/0xbxIsUwjFhs06FBYMk4RfcNssxseqU5UggO0MWYqons7IEsHM7g28CINQ==", + "dev": true + }, + "rollup-plugin-node-resolve": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.0.0.tgz", + "integrity": "sha512-7Ni+/M5RPSUBfUaP9alwYQiIKnKeXCOHiqBpKUl9kwp3jX5ZJtgXAait1cne6pGEVUUztPD6skIKH9Kq9sNtfw==", + "dev": true, + "requires": { + "builtin-modules": "^3.0.0", + "is-module": "^1.0.0", + "resolve": "^1.8.1" + } + }, + "rollup-plugin-terser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-3.0.0.tgz", + "integrity": "sha512-Ed9zRD7OoCBnh0XGlEAJle5TCUsFXMLClwKzZWnS1zbNO4MelHjfCSdFZxCAdH70M40nhZ1nRrY2GZQJhSMcjA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "jest-worker": "^23.2.0", + "serialize-javascript": "^1.5.0", + "terser": "^3.8.2" + } + }, + "rollup-pluginutils": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz", + "integrity": "sha512-2XZwja7b6P5q4RZ5FhyX1+f46xi1Z3qBKigLRZ6VTZjwbN0K1IFGMlwm06Uu0Emcre2Z63l77nq/pzn+KxIEoA==", + "dev": true, + "requires": { + "estree-walker": "^0.5.2", + "micromatch": "^2.3.11" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rxjs": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", + "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, + "serialize-javascript": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.6.1.tgz", + "integrity": "sha512-A5MOagrPFga4YaKQSWHryl7AXvbQkEqpw4NNYMTNYUNV51bA8ABHgYFpqKx+YFFrw59xMV1qGH1R4AgoNIVgCw==", + "dev": true + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "slice-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.0.0.tgz", + "integrity": "sha512-4j2WTWjp3GsZ+AOagyzVbzp4vWGtZ0hEZ/gDY/uTvm6MTxUfTUIsnMIFb1bn8o0RuXiqUw15H1bue8f22Vw2oQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", + "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "sourcemap-codec": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.4.tgz", + "integrity": "sha512-CYAPYdBu34781kLHkaW3m6b/uUSyMOC2R61gcYMWooeuaGtjof86ZA/8T+qVPPt7np1085CR9hmMGrySwEc8Xg==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "http://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/table/-/table-5.1.1.tgz", + "integrity": "sha512-NUjapYb/qd4PeFW03HnAuOJ7OMcBkJlqeClWxeNlQ0lXGSb52oZXGzkO0/I0ARegQ2eUT1g2VDJH0eUxDRcHmw==", + "dev": true, + "requires": { + "ajv": "^6.6.1", + "lodash": "^4.17.11", + "slice-ansi": "2.0.0", + "string-width": "^2.1.1" + } + }, + "terser": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-3.13.1.tgz", + "integrity": "sha512-ogyZye4DFqOtMzT92Y3Nxxw8OvXmL39HOALro4fc+EUYFFF9G/kk0znkvwMz6PPYgBtdKAodh3FPR70eugdaQA==", + "dev": true, + "requires": { + "commander": "~2.17.1", + "source-map": "~0.6.1", + "source-map-support": "~0.5.6" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz", + "integrity": "sha512-Rx7yODZC1L/T8XKo/2kNzVAQaRE88AaMvI1EF/Xnj3GW2wzN6fop9DDWuFAKUVFH7vozkz26DzP0qyWLKLIVPQ==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz", + "integrity": "sha512-2WSLa6OdYd2ng8oqiGIWnJqyFArvhn+5vgx5GTxMbUYjCYKUcuKS62YLFF0R/BDGlB1yzXjQOLtPAfHsgirEpg==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + } + } +} diff --git a/package.json b/package.json index 8d9fd56..de5ee1f 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,16 @@ { "name": "jstz", "version": "2.1.1", - "main": "index.js", + "main": "dist/jstz.min.js", + "module": "dist/jstz.esm.js", "description": "Timezone detection for JavaScript", + "license": "MIT", + "files": ["LICENSE", "README.md", "dist"], "scripts": { - "build": "gulp build", + "prebuild": "python ./utilities/dst.py generate", + "build": "rollup -c", "pretest": "npm run build", - "test": "./node_modules/.bin/mocha", + "test": "mocha", "bump:patch": "npm run build && npm version patch -m \"v%s\"", "bump:minor": "npm run build && npm version minor -m \"v%s\"", "bump:major": "npm run build && npm version major -m \"v%s\"", @@ -42,18 +46,27 @@ } ], "devDependencies": { - "chai": "^3.2.0", + "@babel/core": "^7.2.2", + "@babel/polyfill": "^7.2.5", + "@babel/preset-env": "^7.2.3", + "chai": "^4.2.0", "del": "^0.1.3", - "gulp": "^3.8.10", - "gulp-concat": "^2.4.2", - "gulp-footer": "^1.0.5", - "gulp-header": "^1.2.2", - "gulp-jshint": "^1.9.0", - "gulp-rename": "^1.2.0", - "gulp-uglify": "^1.0.1", - "gulp-wrap-commonjs": "^0.1.12", - "mocha": "^2.3.0" + "eslint": "^5.11.1", + "mocha": "^5.2.0", + "rollup": "^1.0.0", + "rollup-plugin-babel": "^4.1.0", + "rollup-plugin-commonjs": "^9.2.0", + "rollup-plugin-conditional": "^2.2.0", + "rollup-plugin-node-resolve": "^4.0.0", + "rollup-plugin-terser": "^3.0.0", + "terser": "^3.13.1" }, "typings": "./dist/jstz.d.ts", - "types": "./dist/jstz.d.ts" + "types": "./dist/jstz.d.ts", + "browserslist": [ + "last 2 version", + "> 1%", + "not dead", + "not ie <= 9" + ] } diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..4dd9ffe --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,126 @@ +/* globals process */ +import resolve from "rollup-plugin-node-resolve"; +import commonjs from "rollup-plugin-commonjs"; +import babel from "rollup-plugin-babel"; +import { terser } from "rollup-plugin-terser"; +import conditional from "rollup-plugin-conditional"; +var pkg = require('./package.json'); + +const buildTime = function () { + var now = new Date(); + var getMonth = function () { + if (now.getMonth() + 1 < 10) { + return "0" + (now.getMonth() + 1); + } + return now.getMonth() + 1; + }; + var getDate = function () { + if (now.getDate() < 10) { + return "0" + now.getDate(); + } + + return now.getDate(); + }; + + return now.getFullYear() + "-" + getMonth() + "-" + getDate() +}; + +const banner = `/* jstz.min.js Version: ${pkg.version} Build date: ${buildTime()} */` + +const getPlugins = function(minified) { + return [ + resolve({ + browser: true + }), + commonjs(), + babel({ + exclude: "node_modules/**" // only transpile our source code + }), + conditional(minified, [ + terser({ + parse: { + // parse options + }, + compress: { + toplevel: true, + hoist_props: true, + hoist_funs: true, + arguments: true, + booleans: true, + booleans_as_integers: false, + unsafe: true, + unsafe_arrows: true, + unsafe_comps: true, + unsafe_Function: true, + unsafe_math: true, + unsafe_proto: true, + unsafe_regexp: true, + unused: true, + passes: 4 + }, + mangle: { + //eval: true, + // properties: { + // keep_quoted: true + // }, + }, + output: { + beautify: false, + preamble: banner + }, + ecma: 5, + keep_classnames: false, + keep_fnames: false, + ie8: false, + module: false, + nameCache: null, + safari10: false, + toplevel: true, + warnings: true + }) + ]) + ]; +} + +export default [ + { + input: "src/jstz.js", + output: { + file: "dist/jstz.js", + format: "umd", + name: "jstz", + banner: banner + }, + treeshake: { + propertyReadSideEffects: false, + pureExternalModules: true + }, + plugins: getPlugins(false) + }, + { + input: "src/jstz.js", + output: { + file: "dist/jstz.min.js", + format: "umd", + name: "jstz" + }, + treeshake: { + propertyReadSideEffects: false, + pureExternalModules: true + }, + plugins: getPlugins(true) + }, + { + input: "src/jstz.js", + output: { + file: "dist/jstz.esm.js", + format: "esm", + name: "jstz", + banner: banner + }, + treeshake: { + propertyReadSideEffects: false, + pureExternalModules: true + } + } +]; diff --git a/src/jstz.js b/src/jstz.js new file mode 100644 index 0000000..2d7baff --- /dev/null +++ b/src/jstz.js @@ -0,0 +1,504 @@ +/*global exports, Intl*/ +import dst_rules from './jstz.rules' + +/** + * This script gives you the zone info key representing your device's time zone setting. + * + * @name jsTimezoneDetect + * @version 1.0.6 + * @author Jon Nylander + * @license MIT License - https://bitbucket.org/pellepim/jstimezonedetect/src/default/LICENCE.txt + * + * For usage and examples, visit: + * http://pellepim.bitbucket.org/jstz/ + * + * Copyright (c) Jon Nylander + */ + +const HEMISPHERE_SOUTH = 's' + +const consts = { + DAY: 86400000, + HOUR: 3600000, + MINUTE: 60000, + SECOND: 1000, + BASELINE_YEAR: 2014, + MAX_SCORE: 864000000, // 10 days + AMBIGUITIES: { + 'America/Denver': ['America/Mazatlan'], + 'Europe/London': ['Africa/Casablanca'], + 'America/Chicago': ['America/Mexico_City'], + 'America/Asuncion': ['America/Campo_Grande', 'America/Santiago'], + 'America/Montevideo': ['America/Sao_Paulo', 'America/Santiago'], + // Europe/Minsk should not be in this list... but Windows. + 'Asia/Beirut': ['Asia/Amman', 'Asia/Jerusalem', 'Europe/Helsinki', 'Asia/Damascus', 'Africa/Cairo', 'Asia/Gaza', 'Europe/Minsk'], + 'Pacific/Auckland': ['Pacific/Fiji'], + 'America/Los_Angeles': ['America/Santa_Isabel'], + 'America/New_York': ['America/Havana'], + 'America/Halifax': ['America/Goose_Bay'], + 'America/Godthab': ['America/Miquelon'], + 'Asia/Dubai': ['Asia/Yerevan'], + 'Asia/Jakarta': ['Asia/Krasnoyarsk'], + 'Asia/Shanghai': ['Asia/Irkutsk', 'Australia/Perth'], + 'Australia/Sydney': ['Australia/Lord_Howe'], + 'Asia/Tokyo': ['Asia/Yakutsk'], + 'Asia/Dhaka': ['Asia/Omsk'], + // In the real world Yerevan is not ambigous for Baku... but Windows. + 'Asia/Baku': ['Asia/Yerevan'], + 'Australia/Brisbane': ['Asia/Vladivostok'], + 'Pacific/Noumea': ['Asia/Vladivostok'], + 'Pacific/Majuro': ['Asia/Kamchatka', 'Pacific/Fiji'], + 'Pacific/Tongatapu': ['Pacific/Apia'], + 'Asia/Baghdad': ['Europe/Minsk', 'Europe/Moscow'], + 'Asia/Karachi': ['Asia/Yekaterinburg'], + 'Africa/Johannesburg': ['Asia/Gaza', 'Africa/Cairo'] + } +} + +/** + * Gets the offset in minutes from UTC for a certain date. + * @param {Date} date + * @returns {Number} + */ +const get_date_offset = function (date) { + var offset = -date.getTimezoneOffset(); + return (offset !== null ? offset : 0); +} + +/** + * This function does some basic calculations to create information about + * the user's timezone. It uses REFERENCE_YEAR as a solid year for which + * the script has been tested rather than depend on the year set by the + * client device. + * + * Returns a key that can be used to do lookups in jstz.olson.timezones. + * eg: "720,1,2". + * + * @returns {String} + */ +const lookup_key = function() { + var january_offset = get_date_offset(new Date(consts.BASELINE_YEAR, 0, 2)), + june_offset = get_date_offset(new Date(consts.BASELINE_YEAR, 5, 2)), + diff = january_offset - june_offset; + + if (diff < 0) { + return january_offset + ",1"; + } else if (diff > 0) { + return june_offset + ",1," + HEMISPHERE_SOUTH; + } + + return january_offset + ",0"; +} + + +/** + * Tries to get the time zone key directly from the operating system for those + * environments that support the ECMAScript Internationalization API. + */ +const get_from_internationalization_api = function() { + var format, timezone; + if (typeof Intl === "undefined" || typeof Intl.DateTimeFormat === "undefined") { + return; + } + format = Intl.DateTimeFormat(); + if (typeof format === "undefined" || typeof format.resolvedOptions === "undefined") { + return; + } + timezone = format.resolvedOptions().timeZone; + if (timezone && (timezone.indexOf("/") > -1 || timezone === 'UTC') && timezone.indexOf("Etc") != 0) { + return timezone; + } +} + +/** + * Starting point for getting all the DST rules for a specific year + * for the current timezone (as described by the client system). + * + * Returns an object with start and end attributes, or false if no + * DST rules were found for the year. + * + * @param year + * @returns {Object} || {Boolean} + */ +const dst_dates = function(year) { + var yearstart = new Date(year, 0, 1, 0, 0, 1, 0).getTime(); + var yearend = new Date(year, 12, 31, 23, 59, 59).getTime(); + var current = yearstart; + var offset = (new Date(current)).getTimezoneOffset(); + var dst_start = null; + var dst_end = null; + + while (current < yearend - 86400000) { + var dateToCheck = new Date(current); + var dateToCheckOffset = dateToCheck.getTimezoneOffset(); + + if (dateToCheckOffset !== offset) { + if (dateToCheckOffset < offset) { + dst_start = dateToCheck; + } + if (dateToCheckOffset > offset) { + dst_end = dateToCheck; + } + offset = dateToCheckOffset; + } + + current += 86400000; + } + + if (dst_start && dst_end) { + return { + s: find_dst_fold(dst_start).getTime(), + e: find_dst_fold(dst_end).getTime() + }; + } + + return false; +} + +/** + * Probably completely unnecessary function that recursively finds the + * exact (to the second) time when a DST rule was changed. + * + * @param a_date - The candidate Date. + * @param padding - integer specifying the padding to allow around the candidate + * date for finding the fold. + * @param iterator - integer specifying how many milliseconds to iterate while + * searching for the fold. + * + * @returns {Date} + */ +const find_dst_fold = function(a_date, padding, iterator) { + if (typeof padding === 'undefined') { + padding = consts.DAY; + iterator = consts.HOUR; + } + + var date_start = new Date(a_date.getTime() - padding).getTime(); + var date_end = a_date.getTime() + padding; + var offset = new Date(date_start).getTimezoneOffset(); + + var current = date_start; + + var dst_change = null; + while (current < date_end - iterator) { + var dateToCheck = new Date(current); + var dateToCheckOffset = dateToCheck.getTimezoneOffset(); + + if (dateToCheckOffset !== offset) { + dst_change = dateToCheck; + break; + } + current += iterator; + } + + if (padding === consts.DAY) { + return find_dst_fold(dst_change, consts.HOUR, consts.MINUTE); + } + + if (padding === consts.HOUR) { + return find_dst_fold(dst_change, consts.MINUTE, consts.SECOND); + } + + return dst_change; +} + +const windows7_adaptations = function(rule_list, preliminary_timezone, score, sample) { + if (score !== 'N/A') { + return score; + } + if (preliminary_timezone === 'Asia/Beirut') { + if (sample.name === 'Africa/Cairo') { + if (rule_list[6].s === 1398376800000 && rule_list[6].e === 1411678800000) { + return 0; + } + } + if (sample.name === 'Asia/Jerusalem') { + if (rule_list[6].s === 1395964800000 && rule_list[6].e === 1411858800000) { + return 0; + } + } + } else if (preliminary_timezone === 'America/Santiago') { + if (sample.name === 'America/Asuncion') { + if (rule_list[6].s === 1412481600000 && rule_list[6].e === 1397358000000) { + return 0; + } + } + if (sample.name === 'America/Campo_Grande') { + if (rule_list[6].s === 1413691200000 && rule_list[6].e === 1392519600000) { + return 0; + } + } + } else if (preliminary_timezone === 'America/Montevideo') { + if (sample.name === 'America/Sao_Paulo') { + if (rule_list[6].s === 1413687600000 && rule_list[6].e === 1392516000000) { + return 0; + } + } + } else if (preliminary_timezone === 'Pacific/Auckland') { + if (sample.name === 'Pacific/Fiji') { + if (rule_list[6].s === 1414245600000 && rule_list[6].e === 1396101600000) { + return 0; + } + } + } + + return score; +} + +/** + * Takes the DST rules for the current timezone, and proceeds to find matches + * in the jstz.olson.dst_rules.zones array. + * + * Compares samples to the current timezone on a scoring basis. + * + * Candidates are ruled immediately if either the candidate or the current zone + * has a DST rule where the other does not. + * + * Candidates are ruled out immediately if the current zone has a rule that is + * outside the DST scope of the candidate. + * + * Candidates are included for scoring if the current zones rules fall within the + * span of the samples rules. + * + * Low score is best, the score is calculated by summing up the differences in DST + * rules and if the consts.MAX_SCORE is overreached the candidate is ruled out. + * + * Yah follow? :) + * + * @param rule_list + * @param preliminary_timezone + * @returns {*} + */ +const best_dst_match = function (rule_list, preliminary_timezone) { + const score_sample = function(sample) { + var score = 0; + + for (var j = 0; j < rule_list.length; j++) { + + // Both sample and current time zone report DST during the year. + if (!!sample.rules[j] && !!rule_list[j]) { + + // The current time zone's DST rules are inside the sample's. Include. + if (rule_list[j].s >= sample.rules[j].s && rule_list[j].e <= sample.rules[j].e) { + score = 0; + score += Math.abs(rule_list[j].s - sample.rules[j].s); + score += Math.abs(sample.rules[j].e - rule_list[j].e); + + // The current time zone's DST rules are outside the sample's. Discard. + } else { + score = 'N/A'; + break; + } + + // The max score has been reached. Discard. + if (score > consts.MAX_SCORE) { + score = 'N/A'; + break; + } + } + } + + score = windows7_adaptations(rule_list, preliminary_timezone, score, sample); + + return score; + }; + + var scoreboard = {}; + var dst_zones = jstz.olson.dst_rules.zones; + var dst_zones_length = dst_zones.length; + var ambiguities = consts.AMBIGUITIES[preliminary_timezone]; + + for (var i = 0; i < dst_zones_length; i++) { + var sample = dst_zones[i]; + var score = score_sample(dst_zones[i]); + + if (score !== 'N/A') { + scoreboard[sample.name] = score; + } + } + + for (var tz in scoreboard) { + if (scoreboard.hasOwnProperty(tz)) { + for (var j = 0; j < ambiguities.length; j++) { + if (ambiguities[j] === tz) { + return tz; + } + } + } + } + + return preliminary_timezone; +} + +/** + * Takes the preliminary_timezone as detected by lookup_key(). + * + * Builds up the current timezones DST rules for the years defined + * in the jstz.olson.dst_rules.years array. + * + * If there are no DST occurences for those years, immediately returns + * the preliminary timezone. Otherwise proceeds and tries to solve + * ambiguities. + * + * @param preliminary_timezone + * @returns {String} timezone_name + */ +const get_by_dst = function(preliminary_timezone) { + var get_rules = function get_rules() { + var rule_list = []; + for (var i = 0; i < jstz.olson.dst_rules.years.length; i++) { + var year_rules = dst_dates(jstz.olson.dst_rules.years[i]); + rule_list.push(year_rules); + } + return rule_list; + }; + var check_has_dst = function check_has_dst(rules) { + for (var i = 0; i < rules.length; i++) { + if (rules[i] !== false) { + return true; + } + } + return false; + }; + var rules = get_rules(); + var has_dst = check_has_dst(rules); + + if (has_dst) { + return best_dst_match(rules, preliminary_timezone); + } + + return preliminary_timezone; +} + +/** + * Uses get_timezone_info() to formulate a key to use in the olson.timezones dictionary. + * + * Returns an object with one function ".name()" + * + * @returns Object + */ +const determine = function() { + var preliminary_tz = get_from_internationalization_api(); + + if (!preliminary_tz) { + preliminary_tz = jstz.olson.timezones[lookup_key()]; + + if (typeof consts.AMBIGUITIES[preliminary_tz] !== 'undefined') { + preliminary_tz = get_by_dst(preliminary_tz); + } + } + + return { + name: function () { + return preliminary_tz; + }, + stdTimezoneOffset : function () { + // negative to match what (new Date).getTimezoneOffset() will return + return -lookup_key().split(',')[0]; + }, + timezoneOffset : function () { + // negative to match what (new Date).getTimezoneOffset() will return + return -get_date_offset(new Date()) + } + }; +} + +/** + * The keys in this dictionary are comma separated as such: + * + * First the offset compared to UTC time in minutes. + * + * Then a flag which is 0 if the timezone does not take daylight savings into account and 1 if it + * does. + * + * Thirdly an optional 's' signifies that the timezone is in the southern hemisphere, + * only interesting for timezones with DST. + * + * The mapped arrays is used for constructing the jstz.TimeZone object from within + * jstz.determine(); + */ +const olson = { + timezones: { + '-720,0': 'Etc/GMT+12', + '-660,0': 'Pacific/Pago_Pago', + '-660,1,s': 'Pacific/Apia', // Why? Because windows... cry! + '-600,1': 'America/Adak', + '-600,0': 'Pacific/Honolulu', + '-570,0': 'Pacific/Marquesas', + '-540,0': 'Pacific/Gambier', + '-540,1': 'America/Anchorage', + '-480,1': 'America/Los_Angeles', + '-480,0': 'Pacific/Pitcairn', + '-420,0': 'America/Phoenix', + '-420,1': 'America/Denver', + '-360,0': 'America/Guatemala', + '-360,1': 'America/Chicago', + '-360,1,s': 'Pacific/Easter', + '-300,0': 'America/Bogota', + '-300,1': 'America/New_York', + '-270,0': 'America/Caracas', + '-240,1': 'America/Halifax', + '-240,0': 'America/Santo_Domingo', + '-240,1,s': 'America/Asuncion', + '-210,1': 'America/St_Johns', + '-180,1': 'America/Godthab', + '-180,0': 'America/Argentina/Buenos_Aires', + '-180,1,s': 'America/Montevideo', + '-120,0': 'America/Noronha', + '-120,1': 'America/Noronha', + '-60,1': 'Atlantic/Azores', + '-60,0': 'Atlantic/Cape_Verde', + '0,0': 'UTC', + '0,1': 'Europe/London', + '60,1': 'Europe/Berlin', + '60,0': 'Africa/Lagos', + '60,1,s': 'Africa/Windhoek', + '120,1': 'Asia/Beirut', + '120,0': 'Africa/Johannesburg', + '180,0': 'Asia/Baghdad', + '180,1': 'Europe/Moscow', + '210,1': 'Asia/Tehran', + '240,0': 'Asia/Dubai', + '240,1': 'Asia/Baku', + '270,0': 'Asia/Kabul', + '300,1': 'Asia/Yekaterinburg', + '300,0': 'Asia/Karachi', + '330,0': 'Asia/Kolkata', + '345,0': 'Asia/Kathmandu', + '360,0': 'Asia/Dhaka', + '360,1': 'Asia/Omsk', + '390,0': 'Asia/Rangoon', + '420,1': 'Asia/Krasnoyarsk', + '420,0': 'Asia/Jakarta', + '480,0': 'Asia/Shanghai', + '480,1': 'Asia/Irkutsk', + '525,0': 'Australia/Eucla', + '525,1,s': 'Australia/Eucla', + '540,1': 'Asia/Yakutsk', + '540,0': 'Asia/Tokyo', + '570,0': 'Australia/Darwin', + '570,1,s': 'Australia/Adelaide', + '600,0': 'Australia/Brisbane', + '600,1': 'Asia/Vladivostok', + '600,1,s': 'Australia/Sydney', + '630,1,s': 'Australia/Lord_Howe', + '660,1': 'Asia/Kamchatka', + '660,0': 'Pacific/Noumea', + '690,0': 'Pacific/Norfolk', + '720,1,s': 'Pacific/Auckland', + '720,0': 'Pacific/Majuro', + '765,1,s': 'Pacific/Chatham', + '780,0': 'Pacific/Tongatapu', + '780,1,s': 'Pacific/Apia', + '840,0': 'Pacific/Kiritimati' + }, + dst_rules +} + +const jstz = { + olson +} + +export default { + determine, +}; \ No newline at end of file diff --git a/src/jstz.rules.js b/src/jstz.rules.js new file mode 100644 index 0000000..c3ee42f --- /dev/null +++ b/src/jstz.rules.js @@ -0,0 +1,642 @@ +/* Build time: 2018-12-29 09:32:00Z Build by invoking python utilities/dst.py generate */ +export default { + "years": [ + 2014, + 2015, + 2016, + 2017, + 2018 + ], + "zones": [ + { + "name": "Africa/Cairo", + "rules": [ + { + "e": 1411678800000, + "s": 1406844000000 + }, + false, + false, + false, + false + ] + }, + { + "name": "Africa/Casablanca", + "rules": [ + { + "e": 1414288800000, + "s": 1406944800000 + }, + { + "e": 1445738400000, + "s": 1437271200000 + }, + { + "e": 1477792800000, + "s": 1468116000000 + }, + { + "e": 1509242400000, + "s": 1498960800000 + }, + { + "e": 1540692000000, + "s": 1529200800000 + } + ] + }, + { + "name": "America/Asuncion", + "rules": [ + { + "e": 1395543600000, + "s": 1412481600000 + }, + { + "e": 1426993200000, + "s": 1443931200000 + }, + { + "e": 1459047600000, + "s": 1475380800000 + }, + { + "e": 1490497200000, + "s": 1506830400000 + }, + { + "e": 1521946800000, + "s": 1538884800000 + } + ] + }, + { + "name": "America/Campo_Grande", + "rules": [ + { + "e": 1392519600000, + "s": 1413691200000 + }, + { + "e": 1424574000000, + "s": 1445140800000 + }, + { + "e": 1456023600000, + "s": 1476590400000 + }, + { + "e": 1487473200000, + "s": 1508040000000 + }, + { + "e": 1518922800000, + "s": 1541304000000 + } + ] + }, + { + "name": "America/Goose_Bay", + "rules": [ + { + "e": 1414904400000, + "s": 1394344800000 + }, + { + "e": 1446354000000, + "s": 1425794400000 + }, + { + "e": 1478408400000, + "s": 1457848800000 + }, + { + "e": 1509858000000, + "s": 1489298400000 + }, + { + "e": 1541307600000, + "s": 1520748000000 + } + ] + }, + { + "name": "America/Havana", + "rules": [ + { + "e": 1414904400000, + "s": 1394341200000 + }, + { + "e": 1446354000000, + "s": 1425790800000 + }, + { + "e": 1478408400000, + "s": 1457845200000 + }, + { + "e": 1509858000000, + "s": 1489294800000 + }, + { + "e": 1541307600000, + "s": 1520744400000 + } + ] + }, + { + "name": "America/Mazatlan", + "rules": [ + { + "e": 1414310400000, + "s": 1396774800000 + }, + { + "e": 1445760000000, + "s": 1428224400000 + }, + { + "e": 1477814400000, + "s": 1459674000000 + }, + { + "e": 1509264000000, + "s": 1491123600000 + }, + { + "e": 1540713600000, + "s": 1522573200000 + } + ] + }, + { + "name": "America/Mexico_City", + "rules": [ + { + "e": 1414306800000, + "s": 1396771200000 + }, + { + "e": 1445756400000, + "s": 1428220800000 + }, + { + "e": 1477810800000, + "s": 1459670400000 + }, + { + "e": 1509260400000, + "s": 1491120000000 + }, + { + "e": 1540710000000, + "s": 1522569600000 + } + ] + }, + { + "name": "America/Miquelon", + "rules": [ + { + "e": 1414900800000, + "s": 1394341200000 + }, + { + "e": 1446350400000, + "s": 1425790800000 + }, + { + "e": 1478404800000, + "s": 1457845200000 + }, + { + "e": 1509854400000, + "s": 1489294800000 + }, + { + "e": 1541304000000, + "s": 1520744400000 + } + ] + }, + { + "name": "America/Santa_Isabel", + "rules": [ + { + "e": 1414918800000, + "s": 1394359200000 + }, + { + "e": 1446368400000, + "s": 1425808800000 + }, + { + "e": 1478422800000, + "s": 1457863200000 + }, + { + "e": 1509872400000, + "s": 1489312800000 + }, + { + "e": 1541322000000, + "s": 1520762400000 + } + ] + }, + { + "name": "America/Santiago", + "rules": [ + { + "e": 1398567600000, + "s": 1410062400000 + }, + false, + { + "e": 1463281200000, + "s": 1471147200000 + }, + { + "e": 1494730800000, + "s": 1502596800000 + }, + { + "e": 1526180400000, + "s": 1534046400000 + } + ] + }, + { + "name": "America/Sao_Paulo", + "rules": [ + { + "e": 1392516000000, + "s": 1413687600000 + }, + { + "e": 1424570400000, + "s": 1445137200000 + }, + { + "e": 1456020000000, + "s": 1476586800000 + }, + { + "e": 1487469600000, + "s": 1508036400000 + }, + { + "e": 1518919200000, + "s": 1541300400000 + } + ] + }, + { + "name": "Asia/Amman", + "rules": [ + { + "e": 1414706400000, + "s": 1395957600000 + }, + { + "e": 1446156000000, + "s": 1427407200000 + }, + { + "e": 1477605600000, + "s": 1459461600000 + }, + { + "e": 1509055200000, + "s": 1490911200000 + }, + { + "e": 1540504800000, + "s": 1522360800000 + } + ] + }, + { + "name": "Asia/Damascus", + "rules": [ + { + "e": 1414702800000, + "s": 1395957600000 + }, + { + "e": 1446152400000, + "s": 1427407200000 + }, + { + "e": 1477602000000, + "s": 1458856800000 + }, + { + "e": 1509051600000, + "s": 1490911200000 + }, + { + "e": 1540501200000, + "s": 1522360800000 + } + ] + }, + { + "name": "Asia/Dubai", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Gaza", + "rules": [ + { + "e": 1414098000000, + "s": 1395957600000 + }, + { + "e": 1445547600000, + "s": 1427493600000 + }, + { + "e": 1477692000000, + "s": 1458946800000 + }, + { + "e": 1509141600000, + "s": 1490396400000 + }, + { + "e": 1540591200000, + "s": 1521846000000 + } + ] + }, + { + "name": "Asia/Irkutsk", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Jerusalem", + "rules": [ + { + "e": 1414278000000, + "s": 1395964800000 + }, + { + "e": 1445727600000, + "s": 1427414400000 + }, + { + "e": 1477782000000, + "s": 1458864000000 + }, + { + "e": 1509231600000, + "s": 1490313600000 + }, + { + "e": 1540681200000, + "s": 1521763200000 + } + ] + }, + { + "name": "Asia/Kamchatka", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Krasnoyarsk", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Omsk", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Vladivostok", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Yakutsk", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Yekaterinburg", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Asia/Yerevan", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Australia/Lord_Howe", + "rules": [ + { + "e": 1396710000000, + "s": 1412436600000 + }, + { + "e": 1428159600000, + "s": 1443886200000 + }, + { + "e": 1459609200000, + "s": 1475335800000 + }, + { + "e": 1491058800000, + "s": 1506785400000 + }, + { + "e": 1522508400000, + "s": 1538839800000 + } + ] + }, + { + "name": "Australia/Perth", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Europe/Helsinki", + "rules": [ + { + "e": 1414285200000, + "s": 1396141200000 + }, + { + "e": 1445734800000, + "s": 1427590800000 + }, + { + "e": 1477789200000, + "s": 1459040400000 + }, + { + "e": 1509238800000, + "s": 1490490000000 + }, + { + "e": 1540688400000, + "s": 1521939600000 + } + ] + }, + { + "name": "Europe/Minsk", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Europe/Moscow", + "rules": [ + false, + false, + false, + false, + false + ] + }, + { + "name": "Pacific/Apia", + "rules": [ + { + "e": 1396706400000, + "s": 1411826400000 + }, + { + "e": 1428156000000, + "s": 1443276000000 + }, + { + "e": 1459605600000, + "s": 1474725600000 + }, + { + "e": 1491055200000, + "s": 1506175200000 + }, + { + "e": 1522504800000, + "s": 1538229600000 + } + ] + }, + { + "name": "Pacific/Fiji", + "rules": [ + { + "e": 1421503200000, + "s": 1414850400000 + }, + { + "e": 1452952800000, + "s": 1446300000000 + }, + { + "e": 1484402400000, + "s": 1478354400000 + }, + { + "e": 1515852000000, + "s": 1509804000000 + }, + { + "e": 1547906400000, + "s": 1541253600000 + } + ] + }, + { + "name": "Europe/London", + "rules": [ + { + "e": 1414285200000, + "s": 1396141200000 + }, + { + "e": 1445734800000, + "s": 1427590800000 + }, + { + "e": 1477789200000, + "s": 1459040400000 + }, + { + "e": 1509238800000, + "s": 1490490000000 + }, + { + "e": 1540688400000, + "s": 1521939600000 + } + ] + } + ] +}; \ No newline at end of file diff --git a/test.js b/test.js deleted file mode 100644 index 3b6291c..0000000 --- a/test.js +++ /dev/null @@ -1,29 +0,0 @@ -var expect = require('chai').expect; -var jstz = require('./'); - -/** - * TODO: It would be ideal to utilize the python tests within - * ./utilities/dst.py. We aren't yet actually testing any functionality, just - * API shape. - */ -describe('API', function() { - it('Should have a "determine" method.', function () { - expect(jstz).to.respondTo('determine'); - }); - it('Timezone instance has a name method that returns a string', function() { - var timezone = jstz.determine(); - expect(timezone).to.respondTo('name'); - expect(timezone.name()).to.be.a('string'); - }); - it('Timezone instance has an stdTimezoneOffset method that returns a number', function() { - var timezone = jstz.determine(); - expect(timezone).to.respondTo('stdTimezoneOffset'); - expect(timezone.stdTimezoneOffset()).to.be.a('number'); - }); - it('Timezone instance has a timezoneOffset method that returns a number', function() { - var timezone = jstz.determine(); - expect(timezone).to.respondTo('timezoneOffset'); - expect(timezone.timezoneOffset()).to.be.a('number'); - }); -}); - diff --git a/test/test.js b/test/test.js new file mode 100644 index 0000000..717f733 --- /dev/null +++ b/test/test.js @@ -0,0 +1,58 @@ +const expect = require('chai').expect; +const assert = require('assert') +const jstz = require('../dist/jstz.min.js'); +const timezones = require('./utils/timezones') +const { exec } = require('child_process'); + +describe('API', function() { + it('Should have a "determine" method.', function () { + expect(jstz).to.respondTo('determine'); + }); + it('Timezone instance has a name method that returns a string', function() { + var timezone = jstz.determine(); + expect(timezone).to.respondTo('name'); + expect(timezone.name()).to.be.a('string'); + }); + it('Timezone instance has an stdTimezoneOffset method that returns a number', function() { + var timezone = jstz.determine(); + expect(timezone).to.respondTo('stdTimezoneOffset'); + expect(timezone.stdTimezoneOffset()).to.be.a('number'); + }); + it('Timezone instance has a timezoneOffset method that returns a number', function() { + var timezone = jstz.determine(); + expect(timezone).to.respondTo('timezoneOffset'); + expect(timezone.timezoneOffset()).to.be.a('number'); + }); +}); + +describe('Functionality', function() { + + before(function(){ + expect(timezones).to.be.a('array', 'time zones are invalid or not an array'); + }) + + describe('determine()', function() { + timezones.forEach( + function(timezone){ + beforeEach(function(){ + assert.notEqual(timezone, undefined); + }) + + it(`${timezone} should equal what jstz determines`, function(done){ + + const checkTZ = function(err, stdout){ + if (err) { + console.error(`getActualTz module failed`); + return; + } + + const actual_tz = stdout + done(assert.equal(actual_tz, timezone, `Time Zone ${timezone} failed (Expected: ${timezone} but got ${actual_tz} instead)`)) + } + //Hypotheticaly we should just be able to call jstz.determine directly after setting the process.env.TZ. + //However that doesn't work, so we spawn a child process instead and that does work. ¯\_(ツ)_/¯. + exec(`node test/utils/getActualTz.js ${timezone}`, checkTZ); + }) + }) + }); +}); \ No newline at end of file diff --git a/test/utils/getActualTz.js b/test/utils/getActualTz.js new file mode 100644 index 0000000..8f7827a --- /dev/null +++ b/test/utils/getActualTz.js @@ -0,0 +1,7 @@ +var jstz = require("../../dist/jstz.min.js"); +var expected_tz = process.argv[2]; +var actual_tz = null; + +process.env.TZ = expected_tz; +actual_tz = jstz.determine().name(); +process.stdout.write(actual_tz); \ No newline at end of file diff --git a/utilities/dst.py b/utilities/dst.py index d5a531b..0c84143 100644 --- a/utilities/dst.py +++ b/utilities/dst.py @@ -98,7 +98,7 @@ 'Pacific/Kiritimati': 'Line Islands Standard Time' } -YEARS = range(2008, 2015) +YEARS = range(2014, 2019) def set_windows_timezone(timezone): @@ -124,12 +124,20 @@ def generate_rules(): rules_json = json.dumps(rules, sort_keys=True, indent=4, separators=(',', ': ')) rules_js = """/* Build time: %s Build by invoking python utilities/dst.py generate */ -jstz.olson.dst_rules = %s;""" % (datetime.utcnow().strftime('%Y-%m-%d %H:%M:%SZ'), rules_json) +export default %s;""" % (datetime.utcnow().strftime('%Y-%m-%d %H:%M:%SZ'), rules_json) - with open('../jstz.rules.js', 'w') as rulefile: + with open('../src/jstz.rules.js', 'w') as rulefile: rulefile.write(rules_js) - print "Written to ../jstz.rules.js" + print "Written to ../src/jstz.rules.js" + + print "\nGenerating timezones for mocha tests" + timezone_json = json.dumps(AMBIGUOUS_DST_ZONES + OTHER_DST_ZONES + OTHER_TIMEZONES, sort_keys=True, indent=4, separators=(',', ': ')) + timezone_js = "module.exports = %s" % (timezone_json) + with open('../test/utils/timezones.js', 'w') as timezonefile: + timezonefile.write(timezone_js) + + print "Written to ../test/utils/timezones.js" def test(include_success=False):