wp/wp-includes/js/dist/vendor/moment.js
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 22 8c2e4d02f4ef
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
     1 //! moment.js
     1 //! moment.js
     2 //! version : 2.29.1
     2 //! version : 2.29.4
     3 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
     3 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
     4 //! license : MIT
     4 //! license : MIT
     5 //! momentjs.com
     5 //! momentjs.com
     6 
     6 
     7 ;(function (global, factory) {
     7 ;(function (global, factory) {
    74         );
    74         );
    75     }
    75     }
    76 
    76 
    77     function map(arr, fn) {
    77     function map(arr, fn) {
    78         var res = [],
    78         var res = [],
    79             i;
    79             i,
    80         for (i = 0; i < arr.length; ++i) {
    80             arrLen = arr.length;
       
    81         for (i = 0; i < arrLen; ++i) {
    81             res.push(fn(arr[i], i));
    82             res.push(fn(arr[i], i));
    82         }
    83         }
    83         return res;
    84         return res;
    84     }
    85     }
    85 
    86 
   204     // so we can properly clone ourselves.
   205     // so we can properly clone ourselves.
   205     var momentProperties = (hooks.momentProperties = []),
   206     var momentProperties = (hooks.momentProperties = []),
   206         updateInProgress = false;
   207         updateInProgress = false;
   207 
   208 
   208     function copyConfig(to, from) {
   209     function copyConfig(to, from) {
   209         var i, prop, val;
   210         var i,
       
   211             prop,
       
   212             val,
       
   213             momentPropertiesLen = momentProperties.length;
   210 
   214 
   211         if (!isUndefined(from._isAMomentObject)) {
   215         if (!isUndefined(from._isAMomentObject)) {
   212             to._isAMomentObject = from._isAMomentObject;
   216             to._isAMomentObject = from._isAMomentObject;
   213         }
   217         }
   214         if (!isUndefined(from._i)) {
   218         if (!isUndefined(from._i)) {
   237         }
   241         }
   238         if (!isUndefined(from._locale)) {
   242         if (!isUndefined(from._locale)) {
   239             to._locale = from._locale;
   243             to._locale = from._locale;
   240         }
   244         }
   241 
   245 
   242         if (momentProperties.length > 0) {
   246         if (momentPropertiesLen > 0) {
   243             for (i = 0; i < momentProperties.length; i++) {
   247             for (i = 0; i < momentPropertiesLen; i++) {
   244                 prop = momentProperties[i];
   248                 prop = momentProperties[i];
   245                 val = from[prop];
   249                 val = from[prop];
   246                 if (!isUndefined(val)) {
   250                 if (!isUndefined(val)) {
   247                     to[prop] = val;
   251                     to[prop] = val;
   248                 }
   252                 }
   293             }
   297             }
   294             if (firstTime) {
   298             if (firstTime) {
   295                 var args = [],
   299                 var args = [],
   296                     arg,
   300                     arg,
   297                     i,
   301                     i,
   298                     key;
   302                     key,
   299                 for (i = 0; i < arguments.length; i++) {
   303                     argLen = arguments.length;
       
   304                 for (i = 0; i < argLen; i++) {
   300                     arg = '';
   305                     arg = '';
   301                     if (typeof arguments[i] === 'object') {
   306                     if (typeof arguments[i] === 'object') {
   302                         arg += '\n[' + i + '] ';
   307                         arg += '\n[' + i + '] ';
   303                         for (key in arguments[0]) {
   308                         for (key in arguments[0]) {
   304                             if (hasOwnProp(arguments[0], key)) {
   309                             if (hasOwnProp(arguments[0], key)) {
   444             Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +
   449             Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +
   445             absNumber
   450             absNumber
   446         );
   451         );
   447     }
   452     }
   448 
   453 
   449     var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
   454     var formattingTokens =
       
   455             /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
   450         localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
   456         localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
   451         formatFunctions = {},
   457         formatFunctions = {},
   452         formatTokenFunctions = {};
   458         formatTokenFunctions = {};
   453 
   459 
   454     // token:    'M'
   460     // token:    'M'
   748 
   754 
   749     function stringSet(units, value) {
   755     function stringSet(units, value) {
   750         if (typeof units === 'object') {
   756         if (typeof units === 'object') {
   751             units = normalizeObjectUnits(units);
   757             units = normalizeObjectUnits(units);
   752             var prioritized = getPrioritizedUnits(units),
   758             var prioritized = getPrioritizedUnits(units),
   753                 i;
   759                 i,
   754             for (i = 0; i < prioritized.length; i++) {
   760                 prioritizedLen = prioritized.length;
       
   761             for (i = 0; i < prioritizedLen; i++) {
   755                 this[prioritized[i].unit](units[prioritized[i].unit]);
   762                 this[prioritized[i].unit](units[prioritized[i].unit]);
   756             }
   763             }
   757         } else {
   764         } else {
   758             units = normalizeUnits(units);
   765             units = normalizeUnits(units);
   759             if (isFunction(this[units])) {
   766             if (isFunction(this[units])) {
   779         matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
   786         matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
   780         matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z
   787         matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z
   781         matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
   788         matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
   782         // any word (or two) characters or numbers including two/three word month in arabic.
   789         // any word (or two) characters or numbers including two/three word month in arabic.
   783         // includes scottish gaelic two word and hyphenated months
   790         // includes scottish gaelic two word and hyphenated months
   784         matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
   791         matchWord =
       
   792             /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
   785         regexes;
   793         regexes;
   786 
   794 
   787     regexes = {};
   795     regexes = {};
   788 
   796 
   789     function addRegexToken(token, regex, strictRegex) {
   797     function addRegexToken(token, regex, strictRegex) {
   805     // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
   813     // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
   806     function unescapeFormat(s) {
   814     function unescapeFormat(s) {
   807         return regexEscape(
   815         return regexEscape(
   808             s
   816             s
   809                 .replace('\\', '')
   817                 .replace('\\', '')
   810                 .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (
   818                 .replace(
   811                     matched,
   819                     /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
   812                     p1,
   820                     function (matched, p1, p2, p3, p4) {
   813                     p2,
   821                         return p1 || p2 || p3 || p4;
   814                     p3,
   822                     }
   815                     p4
   823                 )
   816                 ) {
       
   817                     return p1 || p2 || p3 || p4;
       
   818                 })
       
   819         );
   824         );
   820     }
   825     }
   821 
   826 
   822     function regexEscape(s) {
   827     function regexEscape(s) {
   823         return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
   828         return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
   825 
   830 
   826     var tokens = {};
   831     var tokens = {};
   827 
   832 
   828     function addParseToken(token, callback) {
   833     function addParseToken(token, callback) {
   829         var i,
   834         var i,
   830             func = callback;
   835             func = callback,
       
   836             tokenLen;
   831         if (typeof token === 'string') {
   837         if (typeof token === 'string') {
   832             token = [token];
   838             token = [token];
   833         }
   839         }
   834         if (isNumber(callback)) {
   840         if (isNumber(callback)) {
   835             func = function (input, array) {
   841             func = function (input, array) {
   836                 array[callback] = toInt(input);
   842                 array[callback] = toInt(input);
   837             };
   843             };
   838         }
   844         }
   839         for (i = 0; i < token.length; i++) {
   845         tokenLen = token.length;
       
   846         for (i = 0; i < tokenLen; i++) {
   840             tokens[token[i]] = func;
   847             tokens[token[i]] = func;
   841         }
   848         }
   842     }
   849     }
   843 
   850 
   844     function addWeekParseToken(token, callback) {
   851     function addWeekParseToken(token, callback) {
   945         }
   952         }
   946     });
   953     });
   947 
   954 
   948     // LOCALES
   955     // LOCALES
   949 
   956 
   950     var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
   957     var defaultLocaleMonths =
   951             '_'
   958             'January_February_March_April_May_June_July_August_September_October_November_December'.split(
   952         ),
   959                 '_'
   953         defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(
   960             ),
   954             '_'
   961         defaultLocaleMonthsShort =
   955         ),
   962             'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
   956         MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
   963         MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
   957         defaultMonthsShortRegex = matchWord,
   964         defaultMonthsShortRegex = matchWord,
   958         defaultMonthsRegex = matchWord;
   965         defaultMonthsRegex = matchWord;
   959 
   966 
   960     function localeMonths(m, format) {
   967     function localeMonths(m, format) {
  1392     addRegexToken('w', match1to2);
  1399     addRegexToken('w', match1to2);
  1393     addRegexToken('ww', match1to2, match2);
  1400     addRegexToken('ww', match1to2, match2);
  1394     addRegexToken('W', match1to2);
  1401     addRegexToken('W', match1to2);
  1395     addRegexToken('WW', match1to2, match2);
  1402     addRegexToken('WW', match1to2, match2);
  1396 
  1403 
  1397     addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
  1404     addWeekParseToken(
  1398         input,
  1405         ['w', 'ww', 'W', 'WW'],
  1399         week,
  1406         function (input, week, config, token) {
  1400         config,
  1407             week[token.substr(0, 1)] = toInt(input);
  1401         token
  1408         }
  1402     ) {
  1409     );
  1403         week[token.substr(0, 1)] = toInt(input);
       
  1404     });
       
  1405 
  1410 
  1406     // HELPERS
  1411     // HELPERS
  1407 
  1412 
  1408     // LOCALES
  1413     // LOCALES
  1409 
  1414 
  1524     // LOCALES
  1529     // LOCALES
  1525     function shiftWeekdays(ws, n) {
  1530     function shiftWeekdays(ws, n) {
  1526         return ws.slice(n, 7).concat(ws.slice(0, n));
  1531         return ws.slice(n, 7).concat(ws.slice(0, n));
  1527     }
  1532     }
  1528 
  1533 
  1529     var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  1534     var defaultLocaleWeekdays =
  1530             '_'
  1535             'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  1531         ),
       
  1532         defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  1536         defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  1533         defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  1537         defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  1534         defaultWeekdaysRegex = matchWord,
  1538         defaultWeekdaysRegex = matchWord,
  1535         defaultWeekdaysShortRegex = matchWord,
  1539         defaultWeekdaysShortRegex = matchWord,
  1536         defaultWeekdaysMinRegex = matchWord;
  1540         defaultWeekdaysMinRegex = matchWord;
  2074             i++;
  2078             i++;
  2075         }
  2079         }
  2076         return globalLocale;
  2080         return globalLocale;
  2077     }
  2081     }
  2078 
  2082 
       
  2083     function isLocaleNameSane(name) {
       
  2084         // Prevent names that look like filesystem paths, i.e contain '/' or '\'
       
  2085         return name.match('^[^/\\\\]*$') != null;
       
  2086     }
       
  2087 
  2079     function loadLocale(name) {
  2088     function loadLocale(name) {
  2080         var oldLocale = null,
  2089         var oldLocale = null,
  2081             aliasedRequire;
  2090             aliasedRequire;
  2082         // TODO: Find a better way to register and load all the locales in Node
  2091         // TODO: Find a better way to register and load all the locales in Node
  2083         if (
  2092         if (
  2084             locales[name] === undefined &&
  2093             locales[name] === undefined &&
  2085             typeof module !== 'undefined' &&
  2094             typeof module !== 'undefined' &&
  2086             module &&
  2095             module &&
  2087             module.exports
  2096             module.exports &&
       
  2097             isLocaleNameSane(name)
  2088         ) {
  2098         ) {
  2089             try {
  2099             try {
  2090                 oldLocale = globalLocale._abbr;
  2100                 oldLocale = globalLocale._abbr;
  2091                 aliasedRequire = require;
  2101                 aliasedRequire = require;
  2092                 aliasedRequire('./locale/' + name);
  2102                 aliasedRequire('./locale/' + name);
  2299         return m;
  2309         return m;
  2300     }
  2310     }
  2301 
  2311 
  2302     // iso 8601 regex
  2312     // iso 8601 regex
  2303     // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
  2313     // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
  2304     var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
  2314     var extendedIsoRegex =
  2305         basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
  2315             /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
       
  2316         basicIsoRegex =
       
  2317             /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
  2306         tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
  2318         tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
  2307         isoDates = [
  2319         isoDates = [
  2308             ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  2320             ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  2309             ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  2321             ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  2310             ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  2322             ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  2331             ['HHmm', /\d\d\d\d/],
  2343             ['HHmm', /\d\d\d\d/],
  2332             ['HH', /\d\d/],
  2344             ['HH', /\d\d/],
  2333         ],
  2345         ],
  2334         aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
  2346         aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
  2335         // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
  2347         // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
  2336         rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
  2348         rfc2822 =
       
  2349             /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
  2337         obsOffsets = {
  2350         obsOffsets = {
  2338             UT: 0,
  2351             UT: 0,
  2339             GMT: 0,
  2352             GMT: 0,
  2340             EDT: -4 * 60,
  2353             EDT: -4 * 60,
  2341             EST: -5 * 60,
  2354             EST: -5 * 60,
  2354             string = config._i,
  2367             string = config._i,
  2355             match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  2368             match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  2356             allowTime,
  2369             allowTime,
  2357             dateFormat,
  2370             dateFormat,
  2358             timeFormat,
  2371             timeFormat,
  2359             tzFormat;
  2372             tzFormat,
       
  2373             isoDatesLen = isoDates.length,
       
  2374             isoTimesLen = isoTimes.length;
  2360 
  2375 
  2361         if (match) {
  2376         if (match) {
  2362             getParsingFlags(config).iso = true;
  2377             getParsingFlags(config).iso = true;
  2363 
  2378             for (i = 0, l = isoDatesLen; i < l; i++) {
  2364             for (i = 0, l = isoDates.length; i < l; i++) {
       
  2365                 if (isoDates[i][1].exec(match[1])) {
  2379                 if (isoDates[i][1].exec(match[1])) {
  2366                     dateFormat = isoDates[i][0];
  2380                     dateFormat = isoDates[i][0];
  2367                     allowTime = isoDates[i][2] !== false;
  2381                     allowTime = isoDates[i][2] !== false;
  2368                     break;
  2382                     break;
  2369                 }
  2383                 }
  2371             if (dateFormat == null) {
  2385             if (dateFormat == null) {
  2372                 config._isValid = false;
  2386                 config._isValid = false;
  2373                 return;
  2387                 return;
  2374             }
  2388             }
  2375             if (match[3]) {
  2389             if (match[3]) {
  2376                 for (i = 0, l = isoTimes.length; i < l; i++) {
  2390                 for (i = 0, l = isoTimesLen; i < l; i++) {
  2377                     if (isoTimes[i][1].exec(match[3])) {
  2391                     if (isoTimes[i][1].exec(match[3])) {
  2378                         // match[2] should be 'T' or space
  2392                         // match[2] should be 'T' or space
  2379                         timeFormat = (match[2] || ' ') + isoTimes[i][0];
  2393                         timeFormat = (match[2] || ' ') + isoTimes[i][0];
  2380                         break;
  2394                         break;
  2381                     }
  2395                     }
  2438     }
  2452     }
  2439 
  2453 
  2440     function preprocessRFC2822(s) {
  2454     function preprocessRFC2822(s) {
  2441         // Remove comments and folding whitespace and replace multiple-spaces with a single space
  2455         // Remove comments and folding whitespace and replace multiple-spaces with a single space
  2442         return s
  2456         return s
  2443             .replace(/\([^)]*\)|[\n\t]/g, ' ')
  2457             .replace(/\([^()]*\)|[\n\t]/g, ' ')
  2444             .replace(/(\s\s+)/g, ' ')
  2458             .replace(/(\s\s+)/g, ' ')
  2445             .replace(/^\s\s*/, '')
  2459             .replace(/^\s\s*/, '')
  2446             .replace(/\s\s*$/, '');
  2460             .replace(/\s\s*$/, '');
  2447     }
  2461     }
  2448 
  2462 
  2751             tokens,
  2765             tokens,
  2752             token,
  2766             token,
  2753             skipped,
  2767             skipped,
  2754             stringLength = string.length,
  2768             stringLength = string.length,
  2755             totalParsedInputLength = 0,
  2769             totalParsedInputLength = 0,
  2756             era;
  2770             era,
       
  2771             tokenLen;
  2757 
  2772 
  2758         tokens =
  2773         tokens =
  2759             expandFormat(config._f, config._locale).match(formattingTokens) || [];
  2774             expandFormat(config._f, config._locale).match(formattingTokens) || [];
  2760 
  2775         tokenLen = tokens.length;
  2761         for (i = 0; i < tokens.length; i++) {
  2776         for (i = 0; i < tokenLen; i++) {
  2762             token = tokens[i];
  2777             token = tokens[i];
  2763             parsedInput = (string.match(getParseRegexForToken(token, config)) ||
  2778             parsedInput = (string.match(getParseRegexForToken(token, config)) ||
  2764                 [])[0];
  2779                 [])[0];
  2765             if (parsedInput) {
  2780             if (parsedInput) {
  2766                 skipped = string.substr(0, string.indexOf(parsedInput));
  2781                 skipped = string.substr(0, string.indexOf(parsedInput));
  2851             bestMoment,
  2866             bestMoment,
  2852             scoreToBeat,
  2867             scoreToBeat,
  2853             i,
  2868             i,
  2854             currentScore,
  2869             currentScore,
  2855             validFormatFound,
  2870             validFormatFound,
  2856             bestFormatIsValid = false;
  2871             bestFormatIsValid = false,
  2857 
  2872             configfLen = config._f.length;
  2858         if (config._f.length === 0) {
  2873 
       
  2874         if (configfLen === 0) {
  2859             getParsingFlags(config).invalidFormat = true;
  2875             getParsingFlags(config).invalidFormat = true;
  2860             config._d = new Date(NaN);
  2876             config._d = new Date(NaN);
  2861             return;
  2877             return;
  2862         }
  2878         }
  2863 
  2879 
  2864         for (i = 0; i < config._f.length; i++) {
  2880         for (i = 0; i < configfLen; i++) {
  2865             currentScore = 0;
  2881             currentScore = 0;
  2866             validFormatFound = false;
  2882             validFormatFound = false;
  2867             tempConfig = copyConfig({}, config);
  2883             tempConfig = copyConfig({}, config);
  2868             if (config._useUTC != null) {
  2884             if (config._useUTC != null) {
  2869                 tempConfig._useUTC = config._useUTC;
  2885                 tempConfig._useUTC = config._useUTC;
  3100     ];
  3116     ];
  3101 
  3117 
  3102     function isDurationValid(m) {
  3118     function isDurationValid(m) {
  3103         var key,
  3119         var key,
  3104             unitHasDecimal = false,
  3120             unitHasDecimal = false,
  3105             i;
  3121             i,
       
  3122             orderLen = ordering.length;
  3106         for (key in m) {
  3123         for (key in m) {
  3107             if (
  3124             if (
  3108                 hasOwnProp(m, key) &&
  3125                 hasOwnProp(m, key) &&
  3109                 !(
  3126                 !(
  3110                     indexOf.call(ordering, key) !== -1 &&
  3127                     indexOf.call(ordering, key) !== -1 &&
  3113             ) {
  3130             ) {
  3114                 return false;
  3131                 return false;
  3115             }
  3132             }
  3116         }
  3133         }
  3117 
  3134 
  3118         for (i = 0; i < ordering.length; ++i) {
  3135         for (i = 0; i < orderLen; ++i) {
  3119             if (m[ordering[i]]) {
  3136             if (m[ordering[i]]) {
  3120                 if (unitHasDecimal) {
  3137                 if (unitHasDecimal) {
  3121                     return false; // only allow non-integers for smallest unit
  3138                     return false; // only allow non-integers for smallest unit
  3122                 }
  3139                 }
  3123                 if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
  3140                 if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
  3438     // ASP.NET json date format regex
  3455     // ASP.NET json date format regex
  3439     var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
  3456     var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
  3440         // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  3457         // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  3441         // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  3458         // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  3442         // and further modified to allow for strings containing both week and day
  3459         // and further modified to allow for strings containing both week and day
  3443         isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
  3460         isoRegex =
       
  3461             /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
  3444 
  3462 
  3445     function createDuration(input, key) {
  3463     function createDuration(input, key) {
  3446         var duration = input,
  3464         var duration = input,
  3447             // matching against regexp is expensive, do it on demand
  3465             // matching against regexp is expensive, do it on demand
  3448             match = null,
  3466             match = null,
  3659                 'milliseconds',
  3677                 'milliseconds',
  3660                 'millisecond',
  3678                 'millisecond',
  3661                 'ms',
  3679                 'ms',
  3662             ],
  3680             ],
  3663             i,
  3681             i,
  3664             property;
  3682             property,
  3665 
  3683             propertyLen = properties.length;
  3666         for (i = 0; i < properties.length; i += 1) {
  3684 
       
  3685         for (i = 0; i < propertyLen; i += 1) {
  3667             property = properties[i];
  3686             property = properties[i];
  3668             propertyTest = propertyTest || hasOwnProp(input, property);
  3687             propertyTest = propertyTest || hasOwnProp(input, property);
  3669         }
  3688         }
  3670 
  3689 
  3671         return objectTest && propertyTest;
  3690         return objectTest && propertyTest;
  4284     addRegexToken('NN', matchEraAbbr);
  4303     addRegexToken('NN', matchEraAbbr);
  4285     addRegexToken('NNN', matchEraAbbr);
  4304     addRegexToken('NNN', matchEraAbbr);
  4286     addRegexToken('NNNN', matchEraName);
  4305     addRegexToken('NNNN', matchEraName);
  4287     addRegexToken('NNNNN', matchEraNarrow);
  4306     addRegexToken('NNNNN', matchEraNarrow);
  4288 
  4307 
  4289     addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (
  4308     addParseToken(
  4290         input,
  4309         ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'],
  4291         array,
  4310         function (input, array, config, token) {
  4292         config,
  4311             var era = config._locale.erasParse(input, token, config._strict);
  4293         token
  4312             if (era) {
  4294     ) {
  4313                 getParsingFlags(config).era = era;
  4295         var era = config._locale.erasParse(input, token, config._strict);
  4314             } else {
  4296         if (era) {
  4315                 getParsingFlags(config).invalidEra = input;
  4297             getParsingFlags(config).era = era;
  4316             }
  4298         } else {
  4317         }
  4299             getParsingFlags(config).invalidEra = input;
  4318     );
  4300         }
       
  4301     });
       
  4302 
  4319 
  4303     addRegexToken('y', matchUnsigned);
  4320     addRegexToken('y', matchUnsigned);
  4304     addRegexToken('yy', matchUnsigned);
  4321     addRegexToken('yy', matchUnsigned);
  4305     addRegexToken('yyy', matchUnsigned);
  4322     addRegexToken('yyy', matchUnsigned);
  4306     addRegexToken('yyyy', matchUnsigned);
  4323     addRegexToken('yyyy', matchUnsigned);
  4588     addRegexToken('GGGG', match1to4, match4);
  4605     addRegexToken('GGGG', match1to4, match4);
  4589     addRegexToken('gggg', match1to4, match4);
  4606     addRegexToken('gggg', match1to4, match4);
  4590     addRegexToken('GGGGG', match1to6, match6);
  4607     addRegexToken('GGGGG', match1to6, match6);
  4591     addRegexToken('ggggg', match1to6, match6);
  4608     addRegexToken('ggggg', match1to6, match6);
  4592 
  4609 
  4593     addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
  4610     addWeekParseToken(
  4594         input,
  4611         ['gggg', 'ggggg', 'GGGG', 'GGGGG'],
  4595         week,
  4612         function (input, week, config, token) {
  4596         config,
  4613             week[token.substr(0, 2)] = toInt(input);
  4597         token
  4614         }
  4598     ) {
  4615     );
  4599         week[token.substr(0, 2)] = toInt(input);
       
  4600     });
       
  4601 
  4616 
  4602     addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  4617     addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  4603         week[token] = hooks.parseTwoDigitYear(input);
  4618         week[token] = hooks.parseTwoDigitYear(input);
  4604     });
  4619     });
  4605 
  4620 
  5618         config._d = new Date(toInt(input));
  5633         config._d = new Date(toInt(input));
  5619     });
  5634     });
  5620 
  5635 
  5621     //! moment.js
  5636     //! moment.js
  5622 
  5637 
  5623     hooks.version = '2.29.1';
  5638     hooks.version = '2.29.4';
  5624 
  5639 
  5625     setHookCallback(createLocal);
  5640     setHookCallback(createLocal);
  5626 
  5641 
  5627     hooks.fn = proto;
  5642     hooks.fn = proto;
  5628     hooks.min = min;
  5643     hooks.min = min;