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