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