1 line
32 KiB
JavaScript
1 line
32 KiB
JavaScript
|
!function(a,i){"use strict";"function"==typeof define&&define.amd?define(["moment"],i):"object"==typeof module&&module.exports?module.exports=i(require("moment")):i(a.moment)}(this,function(a){"use strict";function i(a){return a>96?a-87:a>64?a-29:a-48}function e(a){var e=0,r=a.split("."),o=r[0],A=r[1]||"",c=1,n=0,t=1;for(45===a.charCodeAt(0)&&(e=1,t=-1),e;e<o.length;e++)n=60*n+i(o.charCodeAt(e));for(e=0;e<A.length;e++)c/=60,n+=i(A.charCodeAt(e))*c;return n*t}function r(a){for(var i=0;i<a.length;i++)a[i]=e(a[i])}function o(a,i){for(var e=0;e<i;e++)a[e]=Math.round((a[e-1]||0)+6e4*a[e]);a[i-1]=1/0}function A(a,i){var e,r=[];for(e=0;e<i.length;e++)r[e]=a[i[e]];return r}function c(a){var i=a.split("|"),e=i[2].split(" "),c=i[3].split(""),n=i[4].split(" ");return r(e),r(c),r(n),o(n,c.length),{name:i[0],abbrs:A(i[1].split(" "),c),offsets:A(e,c),untils:n,population:0|i[5]}}function n(a){a&&this._set(c(a))}function t(a){var i=a.toTimeString(),e=i.match(/\([a-z ]+\)/i);"GMT"===(e=e&&e[0]?(e=e[0].match(/[A-Z]/g))?e.join(""):void 0:(e=i.match(/[A-Z]{3,5}/g))?e[0]:void 0)&&(e=void 0),this.at=+a,this.abbr=e,this.offset=a.getTimezoneOffset()}function s(a){this.zone=a,this.offsetScore=0,this.abbrScore=0}function u(a,i){for(var e,r;r=6e4*((i.at-a.at)/12e4|0);)(e=new t(new Date(a.at+r))).offset===a.offset?a=e:i=e;return a}function m(){var a,i,e,r=(new Date).getFullYear()-2,o=new t(new Date(r,0,1)),A=[o];for(e=1;e<48;e++)(i=new t(new Date(r,e,1))).offset!==o.offset&&(a=u(o,i),A.push(a),A.push(new t(new Date(a.at+6e4)))),o=i;for(e=0;e<4;e++)A.push(new t(new Date(r+e,0,1))),A.push(new t(new Date(r+e,6,1)));return A}function f(a,i){return a.offsetScore!==i.offsetScore?a.offsetScore-i.offsetScore:a.abbrScore!==i.abbrScore?a.abbrScore-i.abbrScore:i.zone.population-a.zone.population}function l(a,i){var e,o;for(r(i),e=0;e<i.length;e++)o=i[e],D[o]=D[o]||{},D[o][a]=!0}function p(a){var i,e,r,o=a.length,A={},c=[];for(i=0;i<o;i++){r=D[a[i].offset]||{};for(e in r)r.hasOwnProperty(e)&&(A[e]=!0)}for(i in A)A.hasOwnProperty(i)&&c.push(O[i]);return c}function b(){try{var a=Intl.DateTimeFormat().resolvedOptions().timeZone;if(a&&a.length>3){var i=O[M(a)];if(i)return i;S("Moment Timezone found "+a+" from the Intl api, but did not have that data loaded.")}}catch(a){}var e,r,o,A=m(),c=A.length,n=p(A),t=[];for(r=0;r<n.length;r++){for(e=new s(h(n[r]),c),o=0;o<c;o++)e.scoreOffsetAt(A[o]);t.push(e)}return t.sort(f),t.length>0?t[0].zone.name:void 0}function M(a){return(a||"").toLowerCase().replace(/\//g,"_")}function d(a){var i,e,r,o;for("string"==typeof a&&(a=[a]),i=0;i<a.length;i++)o=M(e=(r=a[i].split("|"))[0]),N[o]=a[i],O[o]=e,l(o,r[2].split(" "))}function h(a,i){a=M(a);var e,r=N[a];return r instanceof n?r:"string"==typeof r?(r=new n(r),N[a]=r,r):C[a]&&i!==h&&(e=h(C[a],h))?((r=N[a]=new n)._set(e),r.name=O[a],r):null}function z(a){var i,e,r,o;for("string"==typeof a&&(a=[a]),i=0;i<a.length;i++)r=M((e=a[i].split("|"))[0]),o=M(e[1]),C[r]=o,O[r]=e[0],C[o]=r,O[o]=e[1]}function E(a){d(a.zones),z(a.links),P.dataVersion=a.version}function g(a){return g.didShowError||(g.didShowError=!0,S("moment.tz.zoneExists('"+a+"') has been deprecated in favor of !moment.tz.zone('"+a+"')")),!!h(a)}function T(a){var i="X"===a._f||"x"===a._f;return!(!a._a||void 0!==a._tzm||i)}function S(a){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(a)}function P(i){var e=Array.prototype.slice.call(arguments,0,-1),r=arguments[arguments.length-1],o=h(r),A=a.utc.apply(null,e);return o&&!a.isMoment(i)&&T(A)&&A.add(o.parse(A),"minutes"),A.tz(r),A}function _(a){return function(){return this._z?this._z.abbr(this):a.call(this)}}var k,N={},C={},O={},D={},G=a.version.split("."),B=+G[0],L=+G[1];(B<2||2===B&&L<6)&&S("Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js "+a.version+". See momentjs.com"),n.prototype={_set:function(a){this.name=a.name,this.abbrs=a.abbrs,this.untils=a.untils,this.offsets=a.offsets,this.population=a.population},_index:function(a){var i,e=+a,r=this.untils;for(i=0;i<r.length;i++)if(e<r[i])return i},parse:function(a){var i,e,r,o,A=+a,c=this.
|