spacetime
Advanced tools
Comparing version 6.16.0 to 6.16.1
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).spacetime=t()}(this,(function(){"use strict";const e=(e,t,a)=>{const[n,r]=e.split("/"),[o,i]=r.split(":");return Date.UTC(a,n-1,o,i)-36e5*t};var t=(t,a,n,r,o)=>{const i=new Date(t).getUTCFullYear(),s=e(a,o,i),u=e(n,r,i);return t>=s&&t<u};var a=e=>{let a=e.timezones[e.tz];if(void 0===a)return console.warn("Warning: couldn't find timezone "+e.tz),0;if(void 0===a.dst)return a.offset;let n=a.offset,r=a.offset+1;"n"===a.hem&&(r=n-1);let o=a.dst.split("->");return!0===t(e.epoch,o[0],o[1],n,r)?n:r},n=["africa","america","asia","atlantic","australia","brazil","canada","chile","europe","indian","mexico","pacific","antarctica","etc"];var r,o=(r=Object.freeze({__proto__:null,default:{"9|s":"2/dili,2/jayapura","9|n":"2/chita,2/khandyga,2/pyongyang,2/seoul,2/tokyo,11/palau","9.5|s|04/04:03->10/03:02":"4/adelaide,4/broken_hill,4/south,4/yancowinna","9.5|s":"4/darwin,4/north","8|s|03/08:01->10/04:00":"12/casey","8|s":"2/kuala_lumpur,2/makassar,2/singapore,4/perth,2/ujung_pandang,4/west","8|n":"2/brunei,2/choibalsan,2/hong_kong,2/irkutsk,2/kuching,2/macau,2/manila,2/shanghai,2/taipei,2/ulaanbaatar,2/chongqing,2/chungking,2/harbin,2/macao,2/ulan_bator","8.75|s":"4/eucla","7|s":"12/davis,2/jakarta,9/christmas","7|n":"2/bangkok,2/barnaul,2/hovd,2/krasnoyarsk,2/novokuznetsk,2/novosibirsk,2/phnom_penh,2/pontianak,2/saigon,2/tomsk,2/vientiane,2/ho_chi_minh","6|s":"12/vostok","6|n":"2/almaty,2/bishkek,2/dhaka,2/omsk,2/qyzylorda,2/qostanay,2/thimphu,2/urumqi,9/chagos,2/dacca,2/kashgar,2/thimbu","6.5|n":"2/rangoon,9/cocos,2/yangon","5|s":"12/mawson,9/kerguelen","5|n":"2/aqtau,2/aqtobe,2/ashgabat,2/atyrau,2/baku,2/dushanbe,2/karachi,2/oral,2/samarkand,2/tashkent,2/yekaterinburg,9/maldives,2/ashkhabad","5.75|n":"2/katmandu,2/kathmandu","5.5|n":"2/calcutta,2/colombo,2/kolkata","4|s":"9/reunion","4|n":"2/dubai,2/muscat,2/tbilisi,2/yerevan,8/astrakhan,8/samara,8/saratov,8/ulyanovsk,8/volgograd,2/volgograd,9/mahe,9/mauritius","4.5|n|03/22:00->09/21:24":"2/tehran","4.5|n":"2/kabul","3|s":"12/syowa,9/antananarivo","3|n|03/28:03->10/31:04":"2/famagusta,2/nicosia,8/athens,8/bucharest,8/helsinki,8/kiev,8/mariehamn,8/riga,8/sofia,8/tallinn,8/uzhgorod,8/vilnius,8/zaporozhye,8/nicosia","3|n|03/28:02->10/31:03":"8/chisinau,8/tiraspol","3|n|03/28:00->10/30:24":"2/beirut","3|n|03/27:00->10/30:01":"2/gaza,2/hebron","3|n|03/26:02->10/31:02":"2/jerusalem,2/tel_aviv","3|n|03/26:00->10/29:01":"2/amman","3|n|03/26:00->10/28:24":"2/damascus","3|n":"0/addis_ababa,0/asmera,0/dar_es_salaam,0/djibouti,0/juba,0/kampala,0/mogadishu,0/nairobi,2/aden,2/baghdad,2/bahrain,2/kuwait,2/qatar,2/riyadh,8/istanbul,8/kirov,8/minsk,8/moscow,8/simferopol,9/comoro,9/mayotte,0/asmara,2/istanbul","2|s|03/28:02->10/31:02":"12/troll","2|s":"0/gaborone,0/harare,0/johannesburg,0/lubumbashi,0/lusaka,0/maputo,0/maseru,0/mbabane","2|n|03/28:02->10/31:03":"0/ceuta,arctic/longyearbyen,8/amsterdam,8/andorra,8/belgrade,8/berlin,8/bratislava,8/brussels,8/budapest,8/busingen,8/copenhagen,8/gibraltar,8/ljubljana,8/luxembourg,8/madrid,8/malta,8/monaco,8/oslo,8/paris,8/podgorica,8/prague,8/rome,8/san_marino,8/sarajevo,8/skopje,8/stockholm,8/tirane,8/vaduz,8/vatican,8/vienna,8/warsaw,8/zagreb,8/zurich,3/jan_mayen","2|n":"0/blantyre,0/bujumbura,0/cairo,0/khartoum,0/kigali,0/tripoli,8/kaliningrad","1|s":"0/brazzaville,0/kinshasa,0/luanda,0/windhoek","1|n|04/11:03->05/16:02":"0/casablanca,0/el_aaiun","1|n|03/28:01->10/31:02":"3/canary,3/faeroe,3/madeira,8/dublin,8/guernsey,8/isle_of_man,8/jersey,8/lisbon,8/london,3/faroe,8/belfast","1|n":"0/algiers,0/bangui,0/douala,0/lagos,0/libreville,0/malabo,0/ndjamena,0/niamey,0/porto-novo,0/tunis","14|n":"11/kiritimati","13|s|04/04:04->09/26:03":"11/apia","13|s|01/15:02->11/05:03":"11/tongatapu","13|n":"11/enderbury,11/fakaofo","12|s|04/04:03->09/26:02":"12/mcmurdo,11/auckland,12/south_pole","12|s|01/17:03->11/14:02":"11/fiji","12|n":"2/anadyr,2/kamchatka,2/srednekolymsk,11/funafuti,11/kwajalein,11/majuro,11/nauru,11/tarawa,11/wake,11/wallis","12.75|s|04/04:03->09/26:02":"11/chatham","11|s|04/04:03->10/03:02":"12/macquarie","11|s":"11/bougainville","11|n":"2/magadan,2/sakhalin,11/efate,11/guadalcanal,11/kosrae,11/noumea,11/ponape,11/pohnpei","11.5|n|04/04:03->10/03:02":"11/norfolk","10|s|04/04:03->10/03:02":"4/currie,4/hobart,4/melbourne,4/sydney,4/act,4/canberra,4/nsw,4/tasmania,4/victoria","10|s":"12/dumontdurville,4/brisbane,4/lindeman,11/port_moresby,4/queensland","10|n":"2/ust-nera,2/vladivostok,2/yakutsk,11/guam,11/saipan,11/truk,11/chuuk,11/yap","10.5|s|04/04:01->10/03:02":"4/lord_howe,4/lhi","0|n|03/28:00->10/31:01":"1/scoresbysund,3/azores","0|n":"0/abidjan,0/accra,0/bamako,0/banjul,0/bissau,0/conakry,0/dakar,0/freetown,0/lome,0/monrovia,0/nouakchott,0/ouagadougou,0/sao_tome,1/danmarkshavn,3/reykjavik,3/st_helena,13/gmt,13/utc,0/timbuktu,13/gmt-0,13/gmt+0,13/gmt0,13/greenwich,13/uct,13/universal,13/zulu","-9|n|03/14:02->11/07:02":"1/adak,1/atka,us/aleutian","-9|n":"11/gambier","-9.5|n":"11/marquesas","-8|n|03/14:02->11/07:02":"1/anchorage,1/juneau,1/metlakatla,1/nome,1/sitka,1/yakutat,us/alaska","-8|n":"11/pitcairn","-7|n|03/14:02->11/07:02":"1/los_angeles,1/santa_isabel,1/tijuana,1/vancouver,1/ensenada,6/pacific,10/bajanorte,us/pacific-new,us/pacific","-7|n|03/08:02->11/01:01":"1/dawson,1/whitehorse,6/yukon","-7|n":"1/creston,1/dawson_creek,1/fort_nelson,1/hermosillo,1/phoenix,us/arizona","-6|s|04/03:22->09/04:22":"11/easter,7/easterisland","-6|n|04/04:02->10/31:02":"1/chihuahua,1/mazatlan,10/bajasur","-6|n|03/14:02->11/07:02":"1/boise,1/cambridge_bay,1/denver,1/edmonton,1/inuvik,1/ojinaga,1/yellowknife,1/shiprock,6/mountain,us/mountain","-6|n":"1/belize,1/costa_rica,1/el_salvador,1/guatemala,1/managua,1/regina,1/swift_current,1/tegucigalpa,11/galapagos,6/east-saskatchewan,6/saskatchewan","-5|s":"1/lima,1/rio_branco,1/porto_acre,5/acre","-5|n|04/04:02->10/31:02":"1/bahia_banderas,1/merida,1/mexico_city,1/monterrey,10/general","-5|n|03/14:02->11/07:02":"1/chicago,1/matamoros,1/menominee,1/rainy_river,1/rankin_inlet,1/resolute,1/winnipeg,1/indiana/knox,1/indiana/tell_city,1/north_dakota/beulah,1/north_dakota/center,1/north_dakota/new_salem,1/knox_in,6/central,us/central,us/indiana-starke","-5|n|03/12:03->11/05:01":"1/north_dakota","-5|n":"1/bogota,1/cancun,1/cayman,1/coral_harbour,1/eirunepe,1/guayaquil,1/jamaica,1/panama,1/atikokan","-4|s|05/13:23->08/13:01":"12/palmer","-4|s|04/03:24->09/05:00":"1/santiago,7/continental","-4|s|03/27:24->10/03:00":"1/asuncion","-4|s|02/16:24->11/03:00":"1/campo_grande,1/cuiaba","-4|s":"1/la_paz,1/manaus,5/west","-4|n|03/14:02->11/07:02":"1/detroit,1/grand_turk,1/indianapolis,1/iqaluit,1/louisville,1/montreal,1/nassau,1/new_york,1/nipigon,1/pangnirtung,1/port-au-prince,1/thunder_bay,1/toronto,1/indiana/marengo,1/indiana/petersburg,1/indiana/vevay,1/indiana/vincennes,1/indiana/winamac,1/kentucky/monticello,1/fort_wayne,1/indiana/indianapolis,1/kentucky/louisville,6/eastern,us/east-indiana,us/eastern,us/michigan","-4|n|03/14:00->11/07:01":"1/havana","-4|n|03/12:03->11/05:01":"1/indiana,1/kentucky","-4|n":"1/anguilla,1/antigua,1/aruba,1/barbados,1/blanc-sablon,1/boa_vista,1/caracas,1/curacao,1/dominica,1/grenada,1/guadeloupe,1/guyana,1/kralendijk,1/lower_princes,1/marigot,1/martinique,1/montserrat,1/port_of_spain,1/porto_velho,1/puerto_rico,1/santo_domingo,1/st_barthelemy,1/st_kitts,1/st_lucia,1/st_thomas,1/st_vincent,1/tortola,1/virgin","-3|s":"1/argentina,1/buenos_aires,1/catamarca,1/cordoba,1/fortaleza,1/jujuy,1/mendoza,1/montevideo,1/punta_arenas,1/sao_paulo,12/rothera,3/stanley,1/argentina/la_rioja,1/argentina/rio_gallegos,1/argentina/salta,1/argentina/san_juan,1/argentina/san_luis,1/argentina/tucuman,1/argentina/ushuaia,1/argentina/buenos_aires,1/argentina/catamarca,1/argentina/comodrivadavia,1/argentina/cordoba,1/argentina/jujuy,1/argentina/mendoza,1/rosario,5/east","-3|n|03/14:02->11/07:02":"1/glace_bay,1/goose_bay,1/halifax,1/moncton,1/thule,3/bermuda,6/atlantic","-3|n":"1/araguaina,1/bahia,1/belem,1/cayenne,1/maceio,1/paramaribo,1/recife,1/santarem","-2|n|03/27:22->10/30:23":"1/godthab,1/nuuk","-2|n|03/14:02->11/07:02":"1/miquelon","-2|n":"1/noronha,3/south_georgia,5/denoronha","-2.5|n|03/14:02->11/07:02":"1/st_johns,6/newfoundland","-1|n":"3/cape_verde","-11|n":"11/midway,11/niue,11/pago_pago,11/samoa,us/samoa","-10|n":"11/honolulu,11/johnston,11/rarotonga,11/tahiti,us/hawaii"}}))&&r.default||r;let i={};Object.keys(o).forEach(e=>{let t=e.split("|"),a={offset:Number(t[0]),hem:t[1]};t[2]&&(a.dst=t[2]),o[e].split(",").forEach(e=>{e=e.replace(/(^[0-9]+)\//,(e,t)=>(t=Number(t),n[t]+"/")),i[e]=a})}),i.utc={offset:0,hem:"n"};for(let e=-14;e<=14;e+=.5){let t=e;t>0&&(t="+"+t);let a="etc/gmt"+t;i[a]={offset:-1*e,hem:"n"},a="utc/gmt"+t,i[a]={offset:-1*e,hem:"n"}}var s=i;const u=/(\-?[0-9]+)h(rs)?/i,l=/(\-?[0-9]+)/,c=/utc([\-+]?[0-9]+)/i,h=/gmt([\-+]?[0-9]+)/i,d=function(e){return(e=Number(e))>=-13&&e<=13?"etc/gmt"+(e=((e*=-1)>0?"+":"")+e):null};var m=function(e){let t=e.match(u);if(null!==t)return d(t[1]);if(t=e.match(c),null!==t)return d(t[1]);if(t=e.match(h),null!==t){let e=-1*Number(t[1]);return d(e)}return t=e.match(l),null!==t?d(t[1]):null};const p=(()=>{let e=(()=>{if("undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;let e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;let t=e.resolvedOptions().timeZone;return t?t.toLowerCase():null})();return null===e?"utc":e})(),f=Object.keys(s).reduce((e,t)=>{let a=t.split("/")[1]||"";return a=a.replace(/_/g," "),e[a]=t,e},{});var y=(e,t)=>{if(!e)return p;"string"!=typeof e&&console.error("Timezone must be a string - recieved: '",e,"'\n");let a=e.trim();if(a=a.toLowerCase(),!0===t.hasOwnProperty(a))return a;if(a=(e=>(e=(e=(e=(e=(e=e.replace(/ time/g,"")).replace(/ (standard|daylight|summer)/g,"")).replace(/\b(east|west|north|south)ern/g,"$1")).replace(/\b(africa|america|australia)n/g,"$1")).replace(/\beuropean/g,"europe")).replace(/\islands/g,"island"))(a),!0===t.hasOwnProperty(a))return a;if(!0===f.hasOwnProperty(a))return f[a];if(!0===/[0-9]/.test(a)){let e=m(a);if(e)return e}throw new Error("Spacetime: Cannot find timezone named: '"+e+"'. Please enter an IANA timezone id.")},g=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){t.isLeapYear=e=>e%4==0&&e%100!=0||e%400==0,t.isDate=e=>"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.valueOf()),t.isArray=e=>"[object Array]"===Object.prototype.toString.call(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isBoolean=e=>"[object Boolean]"===Object.prototype.toString.call(e),t.zeroPad=(e,t=2)=>(e+="").length>=t?e:new Array(t-e.length+1).join("0")+e,t.titleCase=e=>e?e[0].toUpperCase()+e.substr(1):"",t.ordinal=e=>{let t=e%10,a=e%100;return 1===t&&11!==a?e+"st":2===t&&12!==a?e+"nd":3===t&&13!==a?e+"rd":e+"th"},t.toCardinal=e=>(e=(e=String(e)).replace(/([0-9])(st|nd|rd|th)$/i,"$1"),parseInt(e,10)),t.normalize=(e="")=>"day"===(e=(e=(e=(e=e.toLowerCase().trim()).replace(/ies$/,"y")).replace(/s$/,"")).replace(/-/g,""))||"days"===e?"date":"min"===e||"mins"===e?"minute":e,t.getEpoch=e=>"number"==typeof e?e:t.isDate(e)?e.getTime():e.epoch?e.epoch:null,t.beADate=(e,a)=>!1===t.isObject(e)?a.clone().set(e):e,t.formatTimezone=(e,a="")=>{const n=e>0?"+":"-",r=Math.abs(e),o=t.zeroPad(parseInt(""+r,10)),i=t.zeroPad(r%1*60);return"".concat(n).concat(o).concat(a).concat(i)}}));g.isLeapYear,g.isDate,g.isArray,g.isObject,g.isBoolean,g.zeroPad,g.titleCase,g.ordinal,g.toCardinal,g.normalize,g.getEpoch,g.beADate,g.formatTimezone;const b={year:(new Date).getFullYear(),month:0,date:1};var k={parseArray:(e,t,a)=>{if(0===t.length)return e;let n=["year","month","date","hour","minute","second","millisecond"];for(let r=0;r<n.length;r++){let o=t[r]||a[n[r]]||b[n[r]]||0;e=e[n[r]](o)}return e},parseObject:(e,t,a)=>{if(0===Object.keys(t).length)return e;t=Object.assign({},b,a,t);let n=Object.keys(t);for(let r=0;r<n.length;r++){let o=n[r];if(void 0===e[o]||"function"!=typeof e[o])continue;if(null===t[o]||void 0===t[o]||""===t[o])continue;let i=t[o]||a[o]||b[o]||0;e=e[o](i)}return e},parseNumber:function(e,t){return t>0&&t<25e8&&!1===e.silent&&(console.warn(" - Warning: You are setting the date to January 1970."),console.warn(" - did input seconds instead of milliseconds?")),e.epoch=t,e}};const w=function(e){return e.epoch=Date.now(),Object.keys(e._today||{}).forEach(t=>{"function"==typeof e[t]&&(e=e[t](e._today[t]))}),e},v={now:e=>w(e),today:e=>w(e),tonight:e=>e=(e=w(e)).hour(18),tomorrow:e=>e=(e=(e=w(e)).add(1,"day")).startOf("day"),yesterday:e=>e=(e=(e=w(e)).subtract(1,"day")).startOf("day"),christmas:e=>{let t=w(e).year();return e=e.set([t,11,25,18,0,0])},"new years":e=>{let t=w(e).year();return e=e.set([t,11,31,18,0,0])}};v["new years eve"]=v["new years"];var z=v;var _=function(e){return e=(e=(e=(e=e.replace(/\b(mon|tues?|wed|wednes|thur?s?|fri|sat|satur|sun)(day)?\b/i,"")).replace(/([0-9])(th|rd|st|nd)/,"$1")).replace(/,/g,"")).replace(/ +/g," ").trim()};let j={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5};j.date=j.day,j.month=25488e5,j.week=6048e5,j.year=3154e7,Object.keys(j).forEach(e=>{j[e+"s"]=j[e]});var O=j;const D=(e,t,a,n,r)=>{let o=e.d[a]();if(o===t)return;let i=null===r?null:e.d[r](),s=e.epoch,u=t-o;e.epoch+=O[n]*u,"day"===n&&Math.abs(u)>28&&t<28&&(e.epoch+=O.hour),null!==r&&i!==e.d[r]()&&(e.epoch=s);const l=O[n]/2;for(;e.d[a]()<t;)e.epoch+=l;for(;e.d[a]()>t;)e.epoch-=l;null!==r&&i!==e.d[r]()&&(e.epoch=s)},M={year:{valid:e=>e>-4e3&&e<4e3,walkTo:(e,t)=>D(e,t,"getFullYear","year",null)},month:{valid:e=>e>=0&&e<=11,walkTo:(e,t)=>{let a=e.d,n=a.getMonth(),r=e.epoch,o=a.getFullYear();if(n===t)return;let i=t-n;for(e.epoch+=O.day*(28*i),o!==e.d.getFullYear()&&(e.epoch=r);e.d.getMonth()<t;)e.epoch+=O.day;for(;e.d.getMonth()>t;)e.epoch-=O.day}},date:{valid:e=>e>0&&e<=31,walkTo:(e,t)=>D(e,t,"getDate","day","getMonth")},hour:{valid:e=>e>=0&&e<24,walkTo:(e,t)=>D(e,t,"getHours","hour","getDate")},minute:{valid:e=>e>=0&&e<60,walkTo:(e,t)=>D(e,t,"getMinutes","minute","getHours")},second:{valid:e=>e>=0&&e<60,walkTo:(e,t)=>{e.epoch=e.seconds(t).epoch}},millisecond:{valid:e=>e>=0&&e<1e3,walkTo:(e,t)=>{e.epoch=e.milliseconds(t).epoch}}};var P=(e,t)=>{let a=Object.keys(M),n=e.clone();for(let r=0;r<a.length;r++){let o=a[r],i=t[o];if(void 0===i&&(i=n[o]()),"string"==typeof i&&(i=parseInt(i,10)),!M[o].valid(i))return e.epoch=null,void(!1===e.silent&&console.warn("invalid "+o+": "+i));M[o].walkTo(e,i)}};var q=[31,28,31,30,31,30,31,31,30,31,30,31];let S=["jan","feb","mar","apr","may","jun","jul","aug","sept","oct","nov","dec"],T=["january","february","march","april","may","june","july","august","september","october","november","december"];var E=()=>S,N=()=>T,C=()=>function(){const e={sep:8};for(let t=0;t<S.length;t++)e[S[t]]=t;for(let t=0;t<T.length;t++)e[T[t]]=t;return e}(),I=e=>{S=e.short||S,T=e.long||T};var $=(e,t)=>{if(!t)return e;"Z"!==t&&"z"!==t||(t="+0000");let a=0;/^[\+-]?[0-9]{2}:[0-9]{2}$/.test(t)&&(!0===/:00/.test(t)&&(t=t.replace(/:00/,"")),!0===/:30/.test(t)&&(t=t.replace(/:30/,".5"))),/^[\+-]?[0-9]{4}$/.test(t)&&(t=t.replace(/30$/,".5")),a=parseFloat(t),Math.abs(a)>100&&(a/=100),a*=-1,a>=0&&(a="+"+a);let n="etc/gmt"+a;return e.timezones[n]&&(e.tz=n),e};var A=(e,t="")=>{let a=(t=t.replace(/^\s+/,"").toLowerCase()).match(/([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?[:\.]?([0-9]{1,4})?/);if(null!==a){let n=Number(a[1]);if(n<0||n>24)return e.startOf("day");let r=Number(a[2]);if(a[2].length<2||r<0||r>59)return e.startOf("day");a[4]>999&&(a[4]=parseInt("".concat(a[4]).substring(0,3),10)),e=(e=(e=(e=e.hour(n)).minute(r)).seconds(a[3]||0)).millisecond(a[4]||0);let o=t.match(/[\b0-9](am|pm)\b/);return null!==o&&o[1]&&(e=e.ampm(o[1])),e}if(a=t.match(/([0-9]+) ?(am|pm)/),null!==a&&a[1]){let t=Number(a[1]);return t>12||t<1?e.startOf("day"):e=(e=(e=e.hour(a[1]||0)).ampm(a[2])).startOf("hour")}return e=e.startOf("day")};const Y=g.isLeapYear,x=C();var L={parseOffset:$,parseTime:A,parseYear:(e="",t)=>{if(e=e.trim(),!0===/^'[0-9][0-9]$/.test(e)){let t=Number(e.replace(/'/,""));return t>50?1900+t:2e3+t}let a=parseInt(e,10);return!a&&t&&(a=t.year),a=a||(new Date).getFullYear(),a},parseMonth:function(e){return e=e.toLowerCase().trim(),x[e]},validate:e=>{if(!0!==q.hasOwnProperty(e.month))return!1;if(1===e.month)return!!(Y(e.year)&&e.date<=29)||e.date<=28;let t=q[e.month]||0;return e.date<=t}};const{validate:F,parseTime:B,parseYear:Z,parseMonth:H,parseOffset:Q}=L;var G=[{reg:/^(\-?0?0?[0-9]{3,4})-([0-9]{1,2})-([0-9]{1,2})[T| ]([0-9.:]+)(Z|[0-9\-\+:]+)?$/i,parse:(e,t)=>{let a={year:t[1],month:parseInt(t[2],10)-1,date:t[3]};return!1===F(a)?(e.epoch=null,e):(Q(e,t[5]),P(e,a),e=B(e,t[4]))}},{reg:/^([0-9]{4})[\-\/\. ]([0-9]{1,2})[\-\/\. ]([0-9]{1,2})( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let a={year:t[1],month:parseInt(t[2],10)-1,date:parseInt(t[3],10)};return a.month>=12&&(a.date=parseInt(t[2],10),a.month=parseInt(t[3],10)-1),!1===F(a)?(e.epoch=null,e):(P(e,a),e=B(e,t[4]))}},{reg:/^([0-9]{4})[\-\/\. ]([a-z]+)[\-\/\. ]([0-9]{1,2})( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let a={year:Z(t[1],e._today),month:H(t[2]),date:g.toCardinal(t[3]||"")};return!1===F(a)?(e.epoch=null,e):(P(e,a),e=B(e,t[4]))}}];const{validate:U,parseTime:V,parseYear:W,parseMonth:J}=L;var K=[{reg:/^([0-9]{1,2})[\-\/.]([0-9]{1,2})[\-\/.]?([0-9]{4})?( [0-9]{1,2}:[0-9]{2}:?[0-9]{0,2}? ?(am|pm|gmt))?$/i,parse:(e,t)=>{let a=parseInt(t[1],10)-1,n=parseInt(t[2],10);(e.british||a>=12)&&(n=parseInt(t[1],10),a=parseInt(t[2],10)-1);let r={date:n,month:a,year:W(t[3],e._today)||(new Date).getFullYear()};return!1===U(r)?(e.epoch=null,e):(P(e,r),e=V(e,t[4]))}},{reg:/^([a-z]+)[\-\/\. ]([0-9]{1,2})[\-\/\. ]?([0-9]{4}|'[0-9]{2})?( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let a={year:W(t[3],e._today),month:J(t[1]),date:g.toCardinal(t[2]||"")};return!1===U(a)?(e.epoch=null,e):(P(e,a),e=V(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2})( [0-9]{4})?( ([0-9:]+( ?am| ?pm| ?gmt)?))?$/i,parse:(e,t)=>{let a={year:W(t[3],e._today),month:J(t[1]),date:g.toCardinal(t[2]||"")};return!1===U(a)?(e.epoch=null,e):(P(e,a),e=V(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2})( [0-9:]+)?( \+[0-9]{4})?( [0-9]{4})?$/i,parse:(e,t)=>{let a={year:W(t[5],e._today),month:J(t[1]),date:g.toCardinal(t[2]||"")};return!1===U(a)?(e.epoch=null,e):(P(e,a),e=V(e,t[3]))}}];const{validate:R,parseTime:X,parseYear:ee,parseMonth:te}=L;var ae=[{reg:/^([0-9]{1,2})[\-\/]([a-z]+)[\-\/]?([0-9]{4})?$/i,parse:(e,t)=>{let a={year:ee(t[3],e._today),month:te(t[2]),date:g.toCardinal(t[1]||"")};return!1===R(a)?(e.epoch=null,e):(P(e,a),e=X(e,t[4]))}},{reg:/^([0-9]{1,2})( [a-z]+)( [0-9]{4}| '[0-9]{2})? ?([0-9]{1,2}:[0-9]{2}:?[0-9]{0,2}? ?(am|pm|gmt))?$/i,parse:(e,t)=>{let a={year:ee(t[3],e._today),month:te(t[2]),date:g.toCardinal(t[1])};return a.month&&!1!==R(a)?(P(e,a),e=X(e,t[4])):(e.epoch=null,e)}},{reg:/^([0-9]{1,2})[\. -/]([a-z]+)[\. -/]([0-9]{4})?( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let a={date:Number(t[1]),month:te(t[2]),year:Number(t[3])};return!1===R(a)?(e.epoch=null,e):(P(e,a),e=e.startOf("day"),e=X(e,t[4]))}}];const{validate:ne,parseTime:re,parseYear:oe,parseMonth:ie}=L;var se=[].concat(G,K,ae,[{reg:/^([0-9]{4})[\-\/]([0-9]{2})$/i,parse:(e,t)=>{let a={year:t[1],month:parseInt(t[2],10)-1,date:1};return!1===ne(a)?(e.epoch=null,e):(P(e,a),e=re(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{4})$/i,parse:(e,t)=>{let a={year:oe(t[2],e._today),month:ie(t[1]),date:e._today.date||1};return!1===ne(a)?(e.epoch=null,e):(P(e,a),e=re(e,t[4]))}},{reg:/^(q[0-9])( of)?( [0-9]{4})?/i,parse:(e,t)=>{let a=t[1]||"";e=e.quarter(a);let n=t[3]||"";return n&&(n=n.trim(),e=e.year(n)),e}},{reg:/^(spring|summer|winter|fall|autumn)( of)?( [0-9]{4})?/i,parse:(e,t)=>{let a=t[1]||"";e=e.season(a);let n=t[3]||"";return n&&(n=n.trim(),e=e.year(n)),e}},{reg:/^[0-9,]+ ?b\.?c\.?$/i,parse:(e,t)=>{let a=t[0]||"";a=a.replace(/^([0-9,]+) ?b\.?c\.?$/i,"-$1");let n=new Date,r={year:parseInt(a.trim(),10),month:n.getMonth(),date:n.getDate()};return!1===ne(r)?(e.epoch=null,e):(P(e,r),e=re(e))}},{reg:/^[0-9,]+ ?(a\.?d\.?|c\.?e\.?)$/i,parse:(e,t)=>{let a=t[0]||"";a=a.replace(/,/g,"");let n=new Date,r={year:parseInt(a.trim(),10),month:n.getMonth(),date:n.getDate()};return!1===ne(r)?(e.epoch=null,e):(P(e,r),e=re(e))}},{reg:/^[0-9]{4}( ?a\.?d\.?)?$/i,parse:(e,t)=>{let a=e._today;a.month&&!a.date&&(a.date=1);let n=new Date,r={year:oe(t[0],a),month:a.month||n.getMonth(),date:a.date||n.getDate()};return!1===ne(r)?(e.epoch=null,e):(P(e,r),e=re(e))}}]);var ue=function(e,t,a){for(let n=0;n<se.length;n++){let r=t.match(se[n].reg);if(r){let t=se[n].parse(e,r,a);if(null!==t&&t.isValid())return t}}return!1===e.silent&&console.warn("Warning: couldn't parse date-string: '"+t+"'"),e.epoch=null,e};const{parseArray:le,parseObject:ce,parseNumber:he}=k,de={year:(new Date).getFullYear(),month:0,date:1};var me=(e,t)=>{let a=e._today||de;if("number"==typeof t)return he(e,t);if(e.epoch=Date.now(),e._today&&g.isObject(e._today)&&Object.keys(e._today).length>0){let t=ce(e,a,de);t.isValid()&&(e.epoch=t.epoch)}return null==t||""===t?e:!0===g.isDate(t)?(e.epoch=t.getTime(),e):!0===g.isArray(t)?e=le(e,t,a):!0===g.isObject(t)?t.epoch?(e.epoch=t.epoch,e.tz=t.tz,e):e=ce(e,t,a):"string"!=typeof t?e:(t=_(t),!0===z.hasOwnProperty(t)?e=z[t](e):ue(e,t))};let pe=["sun","mon","tue","wed","thu","fri","sat"],fe=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];var ye={short:()=>pe,long:()=>fe,set:e=>{pe=e.short||pe,fe=e.long||fe},aliases:{mo:1,tu:2,we:3,th:4,fr:5,sa:6,su:7,tues:2,weds:3,wedn:3,thur:4,thurs:4}};let ge=!0;var be=()=>ge,ke=e=>{ge=e};var we=e=>{let t=e.timezone().current.offset;return t?g.formatTimezone(t,":"):"Z"};const ve=e=>be()?g.titleCase(e):e,ze={day:e=>ve(e.dayName()),"day-short":e=>ve(ye.short()[e.day()]),"day-number":e=>e.day(),"day-ordinal":e=>g.ordinal(e.day()),"day-pad":e=>g.zeroPad(e.day()),date:e=>e.date(),"date-ordinal":e=>g.ordinal(e.date()),"date-pad":e=>g.zeroPad(e.date()),month:e=>ve(e.monthName()),"month-short":e=>ve(E()[e.month()]),"month-number":e=>e.month(),"month-ordinal":e=>g.ordinal(e.month()),"month-pad":e=>g.zeroPad(e.month()),"iso-month":e=>g.zeroPad(e.month()+1),year:e=>{let t=e.year();return t>0?t:(t=Math.abs(t),t+" BC")},"year-short":e=>{let t=e.year();return t>0?"'".concat(String(e.year()).substr(2,4)):(t=Math.abs(t),t+" BC")},"iso-year":e=>{let t=e.year(),a=t<0,n=g.zeroPad(Math.abs(t),4);return a&&(n=g.zeroPad(n,6),n="-"+n),n},time:e=>e.time(),"time-24":e=>"".concat(e.hour24(),":").concat(g.zeroPad(e.minute())),hour:e=>e.hour12(),"hour-pad":e=>g.zeroPad(e.hour12()),"hour-24":e=>e.hour24(),"hour-24-pad":e=>g.zeroPad(e.hour24()),minute:e=>e.minute(),"minute-pad":e=>g.zeroPad(e.minute()),second:e=>e.second(),"second-pad":e=>g.zeroPad(e.second()),ampm:e=>e.ampm(),quarter:e=>"Q"+e.quarter(),season:e=>e.season(),era:e=>e.era(),json:e=>e.json(),timezone:e=>e.timezone().name,offset:e=>we(e),numeric:e=>"".concat(e.year(),"/").concat(g.zeroPad(e.month()+1),"/").concat(g.zeroPad(e.date())),"numeric-us":e=>"".concat(g.zeroPad(e.month()+1),"/").concat(g.zeroPad(e.date()),"/").concat(e.year()),"numeric-uk":e=>"".concat(g.zeroPad(e.date()),"/").concat(g.zeroPad(e.month()+1),"/").concat(e.year()),"mm/dd":e=>"".concat(g.zeroPad(e.month()+1),"/").concat(g.zeroPad(e.date())),iso:e=>{let t=e.format("iso-year"),a=g.zeroPad(e.month()+1),n=g.zeroPad(e.date()),r=g.zeroPad(e.h24()),o=g.zeroPad(e.minute()),i=g.zeroPad(e.second()),s=g.zeroPad(e.millisecond(),3),u=we(e);return"".concat(t,"-").concat(a,"-").concat(n,"T").concat(r,":").concat(o,":").concat(i,".").concat(s).concat(u)},"iso-short":e=>{let t=g.zeroPad(e.month()+1),a=g.zeroPad(e.date());return"".concat(e.year(),"-").concat(t,"-").concat(a)},"iso-utc":e=>new Date(e.epoch).toISOString(),nice:e=>"".concat(E()[e.month()]," ").concat(g.ordinal(e.date()),", ").concat(e.time()),"nice-24":e=>"".concat(E()[e.month()]," ").concat(g.ordinal(e.date()),", ").concat(e.hour24(),":").concat(g.zeroPad(e.minute())),"nice-year":e=>"".concat(E()[e.month()]," ").concat(g.ordinal(e.date()),", ").concat(e.year()),"nice-day":e=>"".concat(ye.short()[e.day()]," ").concat(ve(E()[e.month()])," ").concat(g.ordinal(e.date())),"nice-full":e=>"".concat(e.dayName()," ").concat(ve(e.monthName())," ").concat(g.ordinal(e.date()),", ").concat(e.time()),"nice-full-24":e=>"".concat(e.dayName()," ").concat(ve(e.monthName())," ").concat(g.ordinal(e.date()),", ").concat(e.hour24(),":").concat(g.zeroPad(e.minute()))},_e={"day-name":"day","month-name":"month","iso 8601":"iso","time-h24":"time-24","time-12":"time","time-h12":"time",tz:"timezone","day-num":"day-number","month-num":"month-number","month-iso":"iso-month","year-iso":"iso-year","nice-short":"nice","nice-short-24":"nice-24",mdy:"numeric-us",dmy:"numeric-uk",ymd:"numeric","yyyy/mm/dd":"numeric","mm/dd/yyyy":"numeric-us","dd/mm/yyyy":"numeric-us","little-endian":"numeric-uk","big-endian":"numeric","day-nice":"nice-day"};Object.keys(_e).forEach(e=>ze[e]=ze[_e[e]]);var je=(e,t="")=>{if(!0!==e.isValid())return"";if(ze.hasOwnProperty(t)){let a=ze[t](e)||"";return"json"!==t&&(a=String(a),"ampm"!==t&&(a=ve(a))),a}if(-1!==t.indexOf("{")){let a=/\{(.+?)\}/g;return t=t.replace(a,(t,a)=>{if(a=a.toLowerCase().trim(),ze.hasOwnProperty(a)){let t=String(ze[a](e));return"ampm"!==a?ve(t):t}return""})}return e.format("iso-short")};const Oe=g.zeroPad,De=g.formatTimezone,Me={G:e=>e.era(),GG:e=>e.era(),GGG:e=>e.era(),GGGG:e=>"AD"===e.era()?"Anno Domini":"Before Christ",y:e=>e.year(),yy:e=>parseInt(String(e.year()).substr(2,4),10),yyy:e=>e.year(),yyyy:e=>e.year(),yyyyy:e=>"0"+e.year(),Q:e=>e.quarter(),QQ:e=>e.quarter(),QQQ:e=>e.quarter(),QQQQ:e=>e.quarter(),M:e=>e.month()+1,MM:e=>Oe(e.month()+1),MMM:e=>e.format("month-short"),MMMM:e=>e.format("month"),w:e=>e.week(),ww:e=>Oe(e.week()),d:e=>e.date(),dd:e=>Oe(e.date()),D:e=>e.dayOfYear(),DD:e=>Oe(e.dayOfYear()),DDD:e=>Oe(e.dayOfYear(),3),E:e=>e.format("day-short"),EE:e=>e.format("day-short"),EEE:e=>e.format("day-short"),EEEE:e=>e.format("day"),EEEEE:e=>e.format("day")[0],e:e=>e.day(),ee:e=>e.day(),eee:e=>e.format("day-short"),eeee:e=>e.format("day"),eeeee:e=>e.format("day")[0],a:e=>e.ampm().toUpperCase(),aa:e=>e.ampm().toUpperCase(),aaa:e=>e.ampm().toUpperCase(),aaaa:e=>e.ampm().toUpperCase(),h:e=>e.h12(),hh:e=>Oe(e.h12()),H:e=>e.hour(),HH:e=>Oe(e.hour()),m:e=>e.minute(),mm:e=>Oe(e.minute()),s:e=>e.second(),ss:e=>Oe(e.second()),A:e=>e.epoch-e.startOf("day").epoch,z:e=>e.timezone().name,zz:e=>e.timezone().name,zzz:e=>e.timezone().name,zzzz:e=>e.timezone().name,Z:e=>De(e.timezone().current.offset),ZZ:e=>De(e.timezone().current.offset),ZZZ:e=>De(e.timezone().current.offset),ZZZZ:e=>De(e.timezone().current.offset,":")},Pe=(e,t,a)=>{let n=e,r=t;for(let o=0;o<a;o+=1)Me[n]=Me[r],n+=e,r+=t};Pe("q","Q",4),Pe("L","M",4),Pe("Y","y",4),Pe("c","e",4),Pe("k","H",2),Pe("K","h",2),Pe("S","s",2),Pe("v","z",4),Pe("V","Z",4);var qe=(e,t)=>{let a=t.split("");return a=function(e){for(let t=0;t<e.length;t+=1)if("'"===e[t])for(let a=t+1;a<e.length;a+=1){if(e[a]&&(e[t]+=e[a]),"'"===e[a]){e[a]=null;break}e[a]=null}return e.filter(e=>e)}(a),a=function(e){for(let t=0;t<e.length;t+=1){let a=e[t];for(let n=t+1;n<e.length&&e[n]===a;n+=1)e[t]+=e[n],e[n]=null}return(e=e.filter(e=>e)).map(e=>("''"===e&&(e="'"),e))}(a),a.reduce((t,a)=>(void 0!==Me[a]?t+=Me[a](e)||"":(/^'.{1,}'$/.test(a)&&(a=a.replace(/'/g,"")),t+=a),t),"")};const Se=["year","season","quarter","month","week","day","quarterHour","hour","minute"],Te=function(e,t){let a=e.clone().startOf(t),n=e.clone().endOf(t).epoch-a.epoch,r=(e.epoch-a.epoch)/n;return parseFloat(r.toFixed(2))};var Ee=(e,t)=>{if(t)return t=g.normalize(t),Te(e,t);let a={};return Se.forEach(t=>{a[t]=Te(e,t)}),a};var Ne=(e,t)=>{let a=e.progress();return"quarterhour"===(t=g.normalize(t))&&(t="quarterHour"),void 0!==a[t]?(a[t]>.5&&(e=e.add(1,t)),e=e.startOf(t)):!1===e.silent&&console.warn("no known unit '"+t+"'"),e};const Ce=(e,t,a)=>{let n=0;for(e=e.clone();e.isBefore(t);)e=e.add(1,a),n+=1;return e.isAfter(t,a)&&(n-=1),n};var Ie=(e,t,a)=>e.isBefore(t)?Ce(e,t,a):-1*Ce(t,e,a);var $e=function(e,t){let a=t.epoch-e.epoch,n={milliseconds:a,seconds:parseInt(a/1e3,10)};n.minutes=parseInt(n.seconds/60,10),n.hours=parseInt(n.minutes/60,10);let r=e.clone();return n.years=((e,t)=>{let a=t.year()-e.year();return(e=e.year(t.year())).isAfter(t)&&(a-=1),a})(r,t),r=e.add(n.years,"year"),n.months=12*n.years,r=e.add(n.months,"month"),n.months+=Ie(r,t,"month"),n.weeks=52*n.years,r=e.add(n.weeks,"week"),n.weeks+=Ie(r,t,"week"),n.days=7*n.weeks,r=e.add(n.days,"day"),n.days+=Ie(r,t,"day"),n};var Ae=function(e,t,a){t=g.beADate(t,e);let n=!1;if(e.isAfter(t)){let a=e;e=t,t=a,n=!0}let r=$e(e,t);return n&&(r=function(e){return Object.keys(e).forEach(t=>{e[t]*=-1}),e}(r)),a?(a=g.normalize(a),!0!==/s$/.test(a)&&(a+="s"),"dates"===a&&(a="days"),r[a]):r};const Ye={months:{almost:10,over:4},days:{almost:25,over:10},hours:{almost:20,over:8},minutes:{almost:50,over:20},seconds:{almost:50,over:20}};function xe(e,t){return 1===e&&(t=t.slice(0,-1)),e+" "+t}var Le=(e,t)=>{const a=function(e,t){const a=e.isBefore(t),n=a?t:e;let r=a?e:t;r=r.clone();const o={years:0,months:0,days:0,hours:0,minutes:0,seconds:0};return Object.keys(o).forEach(e=>{if(r.isSame(n,e))return;let t=r.diff(n,e);r=r.add(t,e),o[e]=t}),a&&Object.keys(o).forEach(e=>{0!==o[e]&&(o[e]*=-1)}),o}(e,t=g.beADate(t,e));if(!0===Object.keys(a).every(e=>!a[e]))return{diff:a,rounded:"now",qualified:"now",precise:"now"};let n,r,o,i=[];return Object.keys(a).forEach((e,t,o)=>{const s=Math.abs(a[e]);if(0===s)return;const u=xe(s,e);if(i.push(u),!n){if(n=r=u,t>4)return;const i=o[t+1],l=Math.abs(a[i]);l>Ye[i].almost?(n=xe(s+1,e),r="almost "+n):l>Ye[i].over&&(r="over "+u)}}),o=i.splice(0,2).join(", "),!0===e.isAfter(t)?(n+=" ago",r+=" ago",o+=" ago"):(n="in "+n,r="in "+r,o="in "+o),{diff:a,rounded:n,qualified:r,precise:o}},Fe={north:[["spring",2,1],["summer",5,1],["fall",8,1],["autumn",8,1],["winter",11,1]],south:[["fall",2,1],["autumn",2,1],["winter",5,1],["spring",8,1],["summer",11,1]]},Be=[null,[0,1],[3,1],[6,1],[9,1]];const Ze={minute:e=>(P(e,{second:0,millisecond:0}),e),quarterhour:e=>{let t=e.minutes();return e=t>=45?e.minutes(45):t>=30?e.minutes(30):t>=15?e.minutes(15):e.minutes(0),P(e,{second:0,millisecond:0}),e},hour:e=>(P(e,{minute:0,second:0,millisecond:0}),e),day:e=>(P(e,{hour:0,minute:0,second:0,millisecond:0}),e),week:e=>{let t=e.clone();return(e=e.day(e._weekStart)).isAfter(t)&&(e=e.subtract(1,"week")),P(e,{hour:0,minute:0,second:0,millisecond:0}),e},month:e=>(P(e,{date:1,hour:0,minute:0,second:0,millisecond:0}),e),quarter:e=>{let t=e.quarter();return Be[t]&&P(e,{month:Be[t][0],date:Be[t][1],hour:0,minute:0,second:0,millisecond:0}),e},season:e=>{let t=e.season(),a="north";"South"===e.hemisphere()&&(a="south");for(let n=0;n<Fe[a].length;n++)if(Fe[a][n][0]===t){let r=e.year();return"winter"===t&&e.month()<3&&(r-=1),P(e,{year:r,month:Fe[a][n][1],date:Fe[a][n][2],hour:0,minute:0,second:0,millisecond:0}),e}return e},year:e=>(P(e,{month:0,date:1,hour:0,minute:0,second:0,millisecond:0}),e),decade:e=>{let t=(e=e.startOf("year")).year(),a=10*parseInt(t/10,10);return e=e.year(a)},century:e=>{let t=(e=e.startOf("year")).year(),a=100*parseInt(t/100,10);return e=e.year(a)}};Ze.date=Ze.day;var He=(e,t)=>{let a=e.clone();return t=g.normalize(t),Ze[t]?Ze[t](a):"summer"===t||"winter"===t?(a=a.season(t),Ze.season(a)):a},Qe=(e,t)=>{let a=e.clone();return t=g.normalize(t),Ze[t]?(a=Ze[t](a),a=a.add(1,t),a=a.subtract(1,"millisecond"),a):a};var Ge=function(e,t="",a){if(!t||!a)return[];if(t=g.normalize(t),a=e.clone().set(a),e.isAfter(a)){let t=e;e=a,a=t}let n=e.clone();!function(e){return!!ye.short().find(t=>t===e)||!!ye.long().find(t=>t===e)}(t)?n=n.next(t):(n=n.next(t),t="week");let r=[];for(;n.isBefore(a);)r.push(n),n=n.add(1,t);return r};var Ue=e=>{let a=e.timezones,n=e.tz;if(!1===a.hasOwnProperty(n)&&(n=y(e.tz,a)),null===n)return!1===e.silent&&console.warn("Warn: could not find given or local timezone - '"+e.tz+"'"),{current:{epochShift:0}};let r=a[n],o={name:(i=n,i=(i=(i=i[0].toUpperCase()+i.substr(1)).replace(/\/gmt/,"/GMT")).replace(/[\/_]([a-z])/gi,e=>e.toUpperCase())),hasDst:Boolean(r.dst),default_offset:r.offset,hemisphere:"s"===r.hem?"South":"North",current:{}};var i,s;if(o.hasDst){let e=(s=r.dst)?s.split("->"):[];o.change={start:e[0],back:e[1]}}let u=r.offset,l=u;return!0===o.hasDst&&(l="North"===o.hemisphere?u-1:r.offset+1),!1===o.hasDst?(o.current.offset=u,o.current.isDST=!1):!0===t(e.epoch,o.change.start,o.change.back,u,l)?(o.current.offset=u,o.current.isDST="North"===o.hemisphere):(o.current.offset=l,o.current.isDST="South"===o.hemisphere),o};const Ve=["century","decade","year","month","date","day","hour","minute","second","millisecond"],We={set:function(e,t){let a=this.clone();return a=me(a,e),t&&(this.tz=y(t)),a},timezone:function(){return Ue(this)},isDST:function(){return Ue(this).current.isDST},hasDST:function(){return Ue(this).hasDst},offset:function(){return 60*Ue(this).current.offset},hemisphere:function(){return Ue(this).hemisphere},format:function(e){return je(this,e)},unixFmt:function(e){return qe(this,e)},startOf:function(e){return He(this,e)},endOf:function(e){return Qe(this,e)},leapYear:function(){let e=this.year();return g.isLeapYear(e)},progress:function(e){return Ee(this,e)},nearest:function(e){return Ne(this,e)},diff:function(e,t){return Ae(this,e,t)},since:function(e){return e||(e=this.clone().set()),Le(this,e)},next:function(e){return this.add(1,e).startOf(e)},last:function(e){return this.subtract(1,e).startOf(e)},isValid:function(){return!(!this.epoch&&0!==this.epoch)&&!isNaN(this.d.getTime())},goto:function(e){let t=this.clone();return t.tz=y(e,t.timezones),t},every:function(e,t){if("object"==typeof e&&"string"==typeof t){let a=t;t=e,e=a}return Ge(this,e,t)},isAwake:function(){let e=this.hour();return!(e<8||e>22)},isAsleep:function(){return!this.isAwake()},log:function(){return console.log(""),console.log(je(this,"nice-short")),this},logYear:function(){return console.log(""),console.log(je(this,"full-short")),this},json:function(){return Ve.reduce((e,t)=>(e[t]=this[t](),e),{})},debug:function(){let e=this.timezone(),t=this.format("MM")+" "+this.format("date-ordinal")+" "+this.year();return t+="\n - "+this.format("time"),console.log("\n\n",t+"\n - "+e.name+" ("+e.current.offset+")"),this},from:function(e){return(e=this.clone().set(e)).since(this)},fromNow:function(){return this.clone().set(Date.now()).since(this)},weekStart:function(e){if("number"==typeof e)return this._weekStart=e,this;if("string"==typeof e){e=e.toLowerCase().trim();let t=ye.short().indexOf(e);-1===t&&(t=ye.long().indexOf(e)),-1===t&&(t=1),this._weekStart=t}else console.warn("Spacetime Error: Cannot understand .weekStart() input:",e);return this}};We.inDST=We.isDST,We.round=We.nearest,We.each=We.every;var Je=We;const Ke=g.isLeapYear,Re=e=>("string"==typeof e&&(e=parseInt(e,10)),e),Xe=["year","month","date","hour","minute","second","millisecond"],et=(e,t,a)=>{let n=Xe.indexOf(a),r=Xe.slice(n,Xe.length);for(let a=0;a<r.length;a++){let n=t[r[a]]();e[r[a]](n)}return e},tt=function(e,t,a,n){return!0===a&&e.isBefore(t)?e=e.add(1,n):!1===a&&e.isAfter(t)&&(e=e.minus(1,n)),e};var at=(e,t)=>{t=Re(t);let a=e.millisecond()-t;return e.epoch-a},nt=(e,t,a)=>{t=Re(t);let n=e.clone(),r=(e.second()-t)*O.second;return e.epoch=e.epoch-r,(e=tt(e,n,a,"minute")).epoch},rt=(e,t,a)=>{t=Re(t);let n=e.clone(),r=(e.minute()-t)*O.minute;return e.epoch-=r,et(e,n,"second"),(e=tt(e,n,a,"hour")).epoch},ot=(e,t,a)=>{(t=Re(t))>=24?t=24:t<0&&(t=0);let n=e.clone(),r=e.hour()-t,o=r*O.hour;return e.epoch-=o,e.date()!==n.date()&&(e=n.clone(),r>1&&(r-=1),r<1&&(r+=1),o=r*O.hour,e.epoch-=o),P(e,{hour:t}),et(e,n,"minute"),(e=tt(e,n,a,"day")).epoch},it=(e,t,a)=>{let n=t.match(/([0-9]{1,2})[:h]([0-9]{1,2})(:[0-9]{1,2})? ?(am|pm)?/);if(!n){if(n=t.match(/([0-9]{1,2}) ?(am|pm)/),!n)return e.epoch;n.splice(2,0,"0"),n.splice(3,0,"")}let r=!1,o=parseInt(n[1],10),i=parseInt(n[2],10);i>=60&&(i=59),o>12&&(r=!0),!1===r&&("am"===n[4]&&12===o&&(o=0),"pm"===n[4]&&o<12&&(o+=12)),n[3]=n[3]||"",n[3]=n[3].replace(/:/,"");let s=parseInt(n[3],10)||0,u=e.clone();return e=(e=(e=(e=e.hour(o)).minute(i)).second(s)).millisecond(0),(e=tt(e,u,a,"day")).epoch},st=(e,t,a)=>{if((t=Re(t))>28){let a=e.month(),n=q[a];1===a&&29===t&&Ke(e.year())&&(n=29),t>n&&(t=n)}t<=0&&(t=1);let n=e.clone();return P(e,{date:t}),(e=tt(e,n,a,"month")).epoch},ut=(e,t,a)=>{"string"==typeof t&&(t=C()[t.toLowerCase()]),(t=Re(t))>=12&&(t=11),t<=0&&(t=0);let n=e.date();n>q[t]&&(n=q[t]);let r=e.clone();return P(e,{month:t,date:n}),(e=tt(e,r,a,"year")).epoch},lt=(e,t)=>("string"==typeof t&&/^'[0-9]{2}$/.test(t)&&(t=t.replace(/'/,"").trim(),t=(t=Number(t))>30?1900+t:2e3+t),t=Re(t),P(e,{year:t}),e.epoch),ct=(e,t,a)=>{let n=e.clone();return t=Re(t),"december"===(e=(e=(e=e.month(0)).date(1)).day("monday")).monthName()&&e.date()>=28&&(e=e.add(1,"week")),t-=1,e=e.add(t,"weeks"),(e=tt(e,n,a,"year")).epoch},ht=(e,t,a)=>{t=Re(t);let n=e.clone();return(t-=1)<=0?t=0:t>=365&&(t=364),e=(e=e.startOf("year")).add(t,"day"),et(e,n,"hour"),(e=tt(e,n,a,"year")).epoch};var dt={millisecond:function(e){if(void 0!==e){let t=this.clone();return t.epoch=at(t,e),t}return this.d.getMilliseconds()},second:function(e,t){if(void 0!==e){let a=this.clone();return a.epoch=nt(a,e,t),a}return this.d.getSeconds()},minute:function(e,t){if(void 0!==e){let a=this.clone();return a.epoch=rt(a,e,t),a}return this.d.getMinutes()},hour:function(e,t){let a=this.d;if(void 0!==e){let a=this.clone();return a.epoch=ot(a,e,t),a}return a.getHours()},hourFloat:function(e,t){if(void 0!==e){let a=this.clone(),n=e%1;n*=60;let r=parseInt(e,10);return a.epoch=ot(a,r,t),a.epoch=rt(a,n,t),a}let a=this.d,n=a.getHours(),r=a.getMinutes();return r/=60,n+r},hour12:function(e,t){let a=this.d;if(void 0!==e){let a=this.clone(),n=(e=""+e).match(/^([0-9]+)(am|pm)$/);if(n){let e=parseInt(n[1],10);"pm"===n[2]&&(e+=12),a.epoch=ot(a,e,t)}return a}let n=a.getHours();return n>12&&(n-=12),0===n&&(n=12),n},time:function(e,t){if(void 0!==e){let a=this.clone();return e=e.toLowerCase().trim(),a.epoch=it(a,e,t),a}return"".concat(this.h12(),":").concat(g.zeroPad(this.minute())).concat(this.ampm())},ampm:function(e,t){let a="am",n=this.hour();if(n>=12&&(a="pm"),"string"!=typeof e)return a;let r=this.clone();return e=e.toLowerCase().trim(),n>=12&&"am"===e?(n-=12,r.hour(n,t)):n<12&&"pm"===e?(n+=12,r.hour(n,t)):r},dayTime:function(e,t){if(void 0!==e){const a={morning:"7:00am",breakfast:"7:00am",noon:"12:00am",lunch:"12:00pm",afternoon:"2:00pm",evening:"6:00pm",dinner:"6:00pm",night:"11:00pm",midnight:"23:59pm"};let n=this.clone();return e=(e=e||"").toLowerCase(),!0===a.hasOwnProperty(e)&&(n=n.time(a[e],t)),n}let a=this.hour();return a<6?"night":a<12?"morning":a<17?"afternoon":a<22?"evening":"night"},iso:function(e){return void 0!==e?this.set(e):this.format("iso")}};var mt={date:function(e,t){if(void 0!==e){let a=this.clone();return(e=parseInt(e,10))&&(a.epoch=st(a,e,t)),a}return this.d.getDate()},day:function(e,t){if(void 0===e)return this.d.getDay();let a=this.clone(),n=e;"string"==typeof e&&(e=e.toLowerCase(),ye.aliases.hasOwnProperty(e)?n=ye.aliases[e]:(n=ye.short().indexOf(e),-1===n&&(n=ye.long().indexOf(e))));let r=this.d.getDay()-n;!0===t&&r>0&&(r-=7),!1===t&&r<0&&(r+=7);let o=this.subtract(r,"days");return P(o,{hour:a.hour(),minute:a.minute(),second:a.second()}),o},dayName:function(e,t){if(void 0===e)return ye.long()[this.day()];let a=this.clone();return a=a.day(e,t),a}};const pt=e=>e=(e=(e=e.minute(0)).second(0)).millisecond(1);var ft={dayOfYear:function(e,t){if(void 0!==e){let a=this.clone();return a.epoch=ht(a,e,t),a}let a,n=0,r=this.d.getMonth();for(let e=1;e<=r;e++)a=new Date,a.setDate(1),a.setFullYear(this.d.getFullYear()),a.setHours(1),a.setMinutes(1),a.setMonth(e),a.setHours(-2),n+=a.getDate();return n+this.d.getDate()},week:function(e,t){if(void 0!==e){let a=this.clone();return a.epoch=ct(this,e,t),a=pt(a),a}let a=this.clone();a=a.month(0),a=a.date(1),a=pt(a),a=a.day("monday"),"december"===a.monthName()&&a.date()>=28&&(a=a.add(1,"week"));let n=1;1===a.date()&&(n=0),a=a.minus(1,"second");const r=this.epoch;if(a.epoch>r)return 1;let o=0,i=4*this.month();for(a.epoch+=O.week*i,o+=i;o<=52;o++){if(a.epoch>r)return o+n;a=a.add(1,"week")}return 52},month:function(e,t){if(void 0!==e){let a=this.clone();return a.epoch=ut(a,e,t),a}return this.d.getMonth()},monthName:function(e,t){if(void 0!==e){let a=this.clone();return a=a.month(e,t),a}return N()[this.month()]},quarter:function(e,t){if(void 0!==e&&("string"==typeof e&&(e=e.replace(/^q/i,""),e=parseInt(e,10)),Be[e])){let a=this.clone(),n=Be[e][0];return a=a.month(n,t),a=a.date(1,t),a=a.startOf("day"),a}let a=this.d.getMonth();for(let e=1;e<Be.length;e++)if(a<Be[e][0])return e-1;return 4},season:function(e,t){let a="north";if("South"===this.hemisphere()&&(a="south"),void 0!==e){let n=this.clone();for(let r=0;r<Fe[a].length;r++)e===Fe[a][r][0]&&(n=n.month(Fe[a][r][1],t),n=n.date(1),n=n.startOf("day"));return n}let n=this.d.getMonth();for(let e=0;e<Fe[a].length-1;e++)if(n>=Fe[a][e][1]&&n<Fe[a][e+1][1])return Fe[a][e][0];return"winter"},year:function(e){if(void 0!==e){let t=this.clone();return t.epoch=lt(t,e),t}return this.d.getFullYear()},era:function(e){if(void 0!==e){let t=this.clone();e=e.toLowerCase();let a=t.d.getFullYear();return"bc"===e&&a>0&&(t.epoch=lt(t,-1*a)),"ad"===e&&a<0&&(t.epoch=lt(t,-1*a)),t}return this.d.getFullYear()<0?"BC":"AD"},decade:function(e){if(void 0!==e){if(!(e=(e=(e=String(e)).replace(/([0-9])'?s$/,"$1")).replace(/([0-9])(th|rd|st|nd)/,"$1")))return console.warn("Spacetime: Invalid decade input"),this;2===e.length&&/[0-9][0-9]/.test(e)&&(e="19"+e);let t=Number(e);return isNaN(t)?this:(t=10*Math.floor(t/10),this.year(t))}return this.startOf("decade").year()},century:function(e){if(void 0!==e){"string"==typeof e&&(e=(e=(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1")).replace(/([0-9]+) ?(b\.?c\.?|a\.?d\.?)/i,(e,t,a)=>(a.match(/b\.?c\.?/i)&&(t="-"+t),t))).replace(/c$/,""));let t=Number(e);return isNaN(e)?(console.warn("Spacetime: Invalid century input"),this):(0===t&&(t=1),t=t>=0?100*(t-1):100*(t+1),this.year(t))}let t=this.startOf("century").year();return t=Math.floor(t/100),t<0?t-1:t+1},millenium:function(e){if(void 0!==e){if("string"==typeof e&&(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1"),e=Number(e),isNaN(e)))return console.warn("Spacetime: Invalid millenium input"),this;e>0&&(e-=1);let t=1e3*e;return 0===t&&(t=1),this.year(t)}let t=Math.floor(this.year()/1e3);return t>=0&&(t+=1),t}};const yt=Object.assign({},dt,mt,ft);yt.milliseconds=yt.millisecond,yt.seconds=yt.second,yt.minutes=yt.minute,yt.hours=yt.hour,yt.hour24=yt.hour,yt.h12=yt.hour12,yt.h24=yt.hour24,yt.days=yt.day;var gt=e=>{Object.keys(yt).forEach(t=>{e.prototype[t]=yt[t]})};const bt=g.isLeapYear,kt=function(e,t){return 1===e&&bt(t)?29:q[e]};var wt=(e,t)=>{if(e.month>0){let a=parseInt(e.month/12,10);e.year=t.year()+a,e.month=e.month%12}else if(e.month<0){let a=Math.floor(Math.abs(e.month)/13,10);a=Math.abs(a)+1,e.year=t.year()-a,e.month=e.month%12,e.month=e.month+12,12===e.month&&(e.month=0)}return e},vt=(e,t,a)=>{let n=t.year(),r=t.month(),o=kt(r,n);for(;a>o;)a-=o,r+=1,r>=12&&(r-=12,n+=1),o=kt(r,n);return e.month=r,e.date=a,e},zt=(e,t,a)=>{e.year=t.year(),e.month=t.month();let n=t.date();for(e.date=n-Math.abs(a);e.date<1;){e.month-=1,e.month<0&&(e.month=11,e.year-=1);let t=kt(e.month,e.year);e.date+=t}return e};const _t=["millisecond","second","minute","hour","date","month"];let jt={second:_t.slice(0,1),minute:_t.slice(0,2),quarterhour:_t.slice(0,2),hour:_t.slice(0,3),date:_t.slice(0,4),month:_t.slice(0,4),quarter:_t.slice(0,4),season:_t.slice(0,4),year:_t,decade:_t,century:_t};jt.week=jt.hour,jt.season=jt.date,jt.quarter=jt.date;const Ot={year:!0,quarter:!0,season:!0,month:!0,week:!0,day:!0},Dt={month:!0,quarter:!0,season:!0,year:!0};var Mt=e=>{e.prototype.add=function(e,t){let a=this.clone();if(!t||0===e)return a;let n=this.clone();if("millisecond"===(t=g.normalize(t)))return a.epoch+=e,a;"fortnight"===t&&(e*=2,t="week"),O[t]?a.epoch+=O[t]*e:"week"===t||"weekend"===t?a.epoch+=O.day*(7*e):"quarter"===t||"season"===t?a.epoch+=O.month*(3*e):"quarterhour"===t&&(a.epoch+=15*O.minute*e);let r={};if(jt[t]&&jt[t].forEach(e=>{r[e]=n[e]()}),Ot[t]){const e=n.timezone().current.offset-a.timezone().current.offset;a.epoch+=3600*e*1e3}if("month"===t&&(r.month=n.month()+e,r=wt(r,n)),"week"===t){let t=n.date()+7*e;t<=28&&t>1&&(r.date=t)}if("weekend"===t&&"saturday"!==a.dayName())a=a.day("saturday",!0);else if("date"===t){if(e<0)r=zt(r,n,e);else{let t=n.date()+e;r=vt(r,n,t)}0!==e&&n.isSame(a,"day")&&(r.date=n.date()+e)}else if("quarter"===t){if(r.month=n.month()+3*e,r.year=n.year(),r.month<0){let e=Math.floor(r.month/12),t=r.month+12*Math.abs(e);r.month=t,r.year+=e}else if(r.month>=12){let e=Math.floor(r.month/12);r.month=r.month%12,r.year+=e}r.date=n.date()}else if("year"===t){let t=n.year()+e,r=a.year();(r<t||r>t)&&(a.epoch+=O.day)}else"decade"===t?r.year=a.year()+10:"century"===t&&(r.year=a.year()+100);if(Dt[t]){let e=q[r.month];r.date=n.date(),r.date>e&&(r.date=e)}return Object.keys(r).length>1&&P(a,r),a},e.prototype.subtract=function(e,t){return this.clone().add(-1*e,t)},e.prototype.minus=e.prototype.subtract,e.prototype.plus=e.prototype.add};const Pt={millisecond:e=>e.epoch,second:e=>[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second()].join("-"),minute:e=>[e.year(),e.month(),e.date(),e.hour(),e.minute()].join("-"),hour:e=>[e.year(),e.month(),e.date(),e.hour()].join("-"),day:e=>[e.year(),e.month(),e.date()].join("-"),week:e=>[e.year(),e.week()].join("-"),month:e=>[e.year(),e.month()].join("-"),quarter:e=>[e.year(),e.quarter()].join("-"),year:e=>e.year()};Pt.date=Pt.day;var qt=e=>{e.prototype.isSame=function(t,a,n=!0){let r=this;if(!a)return null;if("string"==typeof t&&"object"==typeof a){let e=t;t=a,a=e}return"string"!=typeof t&&"number"!=typeof t||(t=new e(t,this.timezone.name)),a=a.replace(/s$/,""),!0===n&&r.tz!==t.tz&&((t=t.clone()).tz=r.tz),Pt[a]?Pt[a](r)===Pt[a](t):null}};var St=e=>{const t={isAfter:function(e){e=g.beADate(e,this);let t=g.getEpoch(e);return null===t?null:this.epoch>t},isBefore:function(e){e=g.beADate(e,this);let t=g.getEpoch(e);return null===t?null:this.epoch<t},isEqual:function(e){e=g.beADate(e,this);let t=g.getEpoch(e);return null===t?null:this.epoch===t},isBetween:function(e,t,a=!1){e=g.beADate(e,this),t=g.beADate(t,this);let n=g.getEpoch(e);if(null===n)return null;let r=g.getEpoch(t);return null===r?null:a?this.isBetween(e,t)||this.isEqual(e)||this.isEqual(t):n<this.epoch&&this.epoch<r}};Object.keys(t).forEach(a=>{e.prototype[a]=t[a]})};var Tt=e=>{const t={i18n:e=>{g.isObject(e.days)&&ye.set(e.days),g.isObject(e.months)&&I(e.months),g.isBoolean(e.useTitleCase)&&ke(e.useTitleCase)}};Object.keys(t).forEach(a=>{e.prototype[a]=t[a]})};let Et=s;const Nt=function(e,t,n={}){this.epoch=null,this.tz=y(t,Et),this.silent=n.silent||!0,this.british=n.dmy||n.british,this._weekStart=1,void 0!==n.weekStart&&(this._weekStart=n.weekStart),this._today={},void 0!==n.today&&(this._today=n.today),Object.defineProperty(this,"d",{get:function(){let e=a(this),t=(new Date(this.epoch).getTimezoneOffset()||0)+60*e;t=60*t*1e3;let n=this.epoch+t;return new Date(n)}}),Object.defineProperty(this,"timezones",{get:()=>Et,set:e=>(Et=e,e)});let r=me(this,e);this.epoch=r.epoch};Object.keys(Je).forEach(e=>{Nt.prototype[e]=Je[e]}),Nt.prototype.clone=function(){return new Nt(this.epoch,this.tz,{silent:this.silent,weekStart:this._weekStart,today:this._today,parsers:this.parsers})},Nt.prototype.toLocalDate=function(){return new Date(this.epoch)},gt(Nt),Mt(Nt),qt(Nt),St(Nt),Tt(Nt);var Ct=Nt;var It=(e,t)=>{let a=new Ct(null),n=new Ct(null);a=a.time(e),n=t?n.time(t):a.add(59,"minutes");let r=a.hour(),o=n.hour();return Object.keys(a.timezones).filter(e=>{if(-1===e.indexOf("/"))return!1;let t=new Ct(null,e),i=t.hour();return i>=r&&i<=o&&(!(i===r&&t.minute()<a.minute())&&!(i===o&&t.minute()>n.minute()))})};const $t=(e,t,a)=>new Ct(e,t,a),At=function(e){let t=e._today||{};return Object.keys(t).forEach(a=>{e=e[a](t[a])}),e};return $t.now=(e,t)=>{let a=new Ct((new Date).getTime(),e,t);return a=At(a),a},$t.today=(e,t)=>{let a=new Ct((new Date).getTime(),e,t);return a=At(a),a.startOf("day")},$t.tomorrow=(e,t)=>{let a=new Ct((new Date).getTime(),e,t);return a=At(a),a.add(1,"day").startOf("day")},$t.yesterday=(e,t)=>{let a=new Ct((new Date).getTime(),e,t);return a=At(a),a.subtract(1,"day").startOf("day")},$t.extend=function(e={}){return Object.keys(e).forEach(t=>{Ct.prototype[t]=e[t]}),this},$t.timezones=function(){return(new Ct).timezones},$t.max=function(e,t){let a=new Ct(null,e,t);return a.epoch=864e13,a},$t.min=function(e,t){let a=new Ct(null,e,t);return a.epoch=-864e13,a},$t.whereIts=It,$t.version="6.16.0",$t.plugin=$t.extend,$t})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).spacetime=t()}(this,(function(){"use strict";const e=(e,t,a)=>{const[n,r]=e.split("/"),[o,i]=r.split(":");return Date.UTC(a,n-1,o,i)-36e5*t};var t=(t,a,n,r,o)=>{const i=new Date(t).getUTCFullYear(),s=e(a,o,i),u=e(n,r,i);return t>=s&&t<u};var a=e=>{let a=e.timezones[e.tz];if(void 0===a)return console.warn("Warning: couldn't find timezone "+e.tz),0;if(void 0===a.dst)return a.offset;let n=a.offset,r=a.offset+1;"n"===a.hem&&(r=n-1);let o=a.dst.split("->");return!0===t(e.epoch,o[0],o[1],n,r)?n:r},n=["africa","america","asia","atlantic","australia","brazil","canada","chile","europe","indian","mexico","pacific","antarctica","etc"];var r,o=(r=Object.freeze({__proto__:null,default:{"9|s":"2/dili,2/jayapura","9|n":"2/chita,2/khandyga,2/pyongyang,2/seoul,2/tokyo,11/palau","9.5|s|04/04:03->10/03:02":"4/adelaide,4/broken_hill,4/south,4/yancowinna","9.5|s":"4/darwin,4/north","8|s|03/08:01->10/04:00":"12/casey","8|s":"2/kuala_lumpur,2/makassar,2/singapore,4/perth,2/ujung_pandang,4/west","8|n":"2/brunei,2/choibalsan,2/hong_kong,2/irkutsk,2/kuching,2/macau,2/manila,2/shanghai,2/taipei,2/ulaanbaatar,2/chongqing,2/chungking,2/harbin,2/macao,2/ulan_bator","8.75|s":"4/eucla","7|s":"12/davis,2/jakarta,9/christmas","7|n":"2/bangkok,2/barnaul,2/hovd,2/krasnoyarsk,2/novokuznetsk,2/novosibirsk,2/phnom_penh,2/pontianak,2/saigon,2/tomsk,2/vientiane,2/ho_chi_minh","6|s":"12/vostok","6|n":"2/almaty,2/bishkek,2/dhaka,2/omsk,2/qyzylorda,2/qostanay,2/thimphu,2/urumqi,9/chagos,2/dacca,2/kashgar,2/thimbu","6.5|n":"2/rangoon,9/cocos,2/yangon","5|s":"12/mawson,9/kerguelen","5|n":"2/aqtau,2/aqtobe,2/ashgabat,2/atyrau,2/baku,2/dushanbe,2/karachi,2/oral,2/samarkand,2/tashkent,2/yekaterinburg,9/maldives,2/ashkhabad","5.75|n":"2/katmandu,2/kathmandu","5.5|n":"2/calcutta,2/colombo,2/kolkata","4|s":"9/reunion","4|n":"2/dubai,2/muscat,2/tbilisi,2/yerevan,8/astrakhan,8/samara,8/saratov,8/ulyanovsk,8/volgograd,2/volgograd,9/mahe,9/mauritius","4.5|n|03/22:00->09/21:24":"2/tehran","4.5|n":"2/kabul","3|s":"12/syowa,9/antananarivo","3|n|03/28:03->10/31:04":"2/famagusta,2/nicosia,8/athens,8/bucharest,8/helsinki,8/kiev,8/mariehamn,8/riga,8/sofia,8/tallinn,8/uzhgorod,8/vilnius,8/zaporozhye,8/nicosia","3|n|03/28:02->10/31:03":"8/chisinau,8/tiraspol","3|n|03/28:00->10/30:24":"2/beirut","3|n|03/27:00->10/30:01":"2/gaza,2/hebron","3|n|03/26:02->10/31:02":"2/jerusalem,2/tel_aviv","3|n|03/26:00->10/29:01":"2/amman","3|n|03/26:00->10/28:24":"2/damascus","3|n":"0/addis_ababa,0/asmera,0/dar_es_salaam,0/djibouti,0/juba,0/kampala,0/mogadishu,0/nairobi,2/aden,2/baghdad,2/bahrain,2/kuwait,2/qatar,2/riyadh,8/istanbul,8/kirov,8/minsk,8/moscow,8/simferopol,9/comoro,9/mayotte,0/asmara,2/istanbul","2|s|03/28:02->10/31:02":"12/troll","2|s":"0/gaborone,0/harare,0/johannesburg,0/lubumbashi,0/lusaka,0/maputo,0/maseru,0/mbabane","2|n|03/28:02->10/31:03":"0/ceuta,arctic/longyearbyen,8/amsterdam,8/andorra,8/belgrade,8/berlin,8/bratislava,8/brussels,8/budapest,8/busingen,8/copenhagen,8/gibraltar,8/ljubljana,8/luxembourg,8/madrid,8/malta,8/monaco,8/oslo,8/paris,8/podgorica,8/prague,8/rome,8/san_marino,8/sarajevo,8/skopje,8/stockholm,8/tirane,8/vaduz,8/vatican,8/vienna,8/warsaw,8/zagreb,8/zurich,3/jan_mayen","2|n":"0/blantyre,0/bujumbura,0/cairo,0/khartoum,0/kigali,0/tripoli,8/kaliningrad","1|s":"0/brazzaville,0/kinshasa,0/luanda,0/windhoek","1|n|04/11:03->05/16:02":"0/casablanca,0/el_aaiun","1|n|03/28:01->10/31:02":"3/canary,3/faeroe,3/madeira,8/dublin,8/guernsey,8/isle_of_man,8/jersey,8/lisbon,8/london,3/faroe,8/belfast","1|n":"0/algiers,0/bangui,0/douala,0/lagos,0/libreville,0/malabo,0/ndjamena,0/niamey,0/porto-novo,0/tunis","14|n":"11/kiritimati","13|s|04/04:04->09/26:03":"11/apia","13|s|01/15:02->11/05:03":"11/tongatapu","13|n":"11/enderbury,11/fakaofo","12|s|04/04:03->09/26:02":"12/mcmurdo,11/auckland,12/south_pole","12|s|01/17:03->11/14:02":"11/fiji","12|n":"2/anadyr,2/kamchatka,2/srednekolymsk,11/funafuti,11/kwajalein,11/majuro,11/nauru,11/tarawa,11/wake,11/wallis","12.75|s|04/04:03->09/26:02":"11/chatham","11|s|04/04:03->10/03:02":"12/macquarie","11|s":"11/bougainville","11|n":"2/magadan,2/sakhalin,11/efate,11/guadalcanal,11/kosrae,11/noumea,11/ponape,11/pohnpei","11.5|n|04/04:03->10/03:02":"11/norfolk","10|s|04/04:03->10/03:02":"4/currie,4/hobart,4/melbourne,4/sydney,4/act,4/canberra,4/nsw,4/tasmania,4/victoria","10|s":"12/dumontdurville,4/brisbane,4/lindeman,11/port_moresby,4/queensland","10|n":"2/ust-nera,2/vladivostok,2/yakutsk,11/guam,11/saipan,11/truk,11/chuuk,11/yap","10.5|s|04/04:01->10/03:02":"4/lord_howe,4/lhi","0|n|03/28:00->10/31:01":"1/scoresbysund,3/azores","0|n":"0/abidjan,0/accra,0/bamako,0/banjul,0/bissau,0/conakry,0/dakar,0/freetown,0/lome,0/monrovia,0/nouakchott,0/ouagadougou,0/sao_tome,1/danmarkshavn,3/reykjavik,3/st_helena,13/gmt,13/utc,0/timbuktu,13/gmt-0,13/gmt+0,13/gmt0,13/greenwich,13/uct,13/universal,13/zulu","-9|n|03/14:02->11/07:02":"1/adak,1/atka,us/aleutian","-9|n":"11/gambier","-9.5|n":"11/marquesas","-8|n|03/14:02->11/07:02":"1/anchorage,1/juneau,1/metlakatla,1/nome,1/sitka,1/yakutat,us/alaska","-8|n":"11/pitcairn","-7|n|03/14:02->11/07:02":"1/los_angeles,1/santa_isabel,1/tijuana,1/vancouver,1/ensenada,6/pacific,10/bajanorte,us/pacific-new,us/pacific","-7|n|03/08:02->11/01:01":"1/dawson,1/whitehorse,6/yukon","-7|n":"1/creston,1/dawson_creek,1/fort_nelson,1/hermosillo,1/phoenix,us/arizona","-6|s|04/03:22->09/04:22":"11/easter,7/easterisland","-6|n|04/04:02->10/31:02":"1/chihuahua,1/mazatlan,10/bajasur","-6|n|03/14:02->11/07:02":"1/boise,1/cambridge_bay,1/denver,1/edmonton,1/inuvik,1/ojinaga,1/yellowknife,1/shiprock,6/mountain,us/mountain","-6|n":"1/belize,1/costa_rica,1/el_salvador,1/guatemala,1/managua,1/regina,1/swift_current,1/tegucigalpa,11/galapagos,6/east-saskatchewan,6/saskatchewan","-5|s":"1/lima,1/rio_branco,1/porto_acre,5/acre","-5|n|04/04:02->10/31:02":"1/bahia_banderas,1/merida,1/mexico_city,1/monterrey,10/general","-5|n|03/14:02->11/07:02":"1/chicago,1/matamoros,1/menominee,1/rainy_river,1/rankin_inlet,1/resolute,1/winnipeg,1/indiana/knox,1/indiana/tell_city,1/north_dakota/beulah,1/north_dakota/center,1/north_dakota/new_salem,1/knox_in,6/central,us/central,us/indiana-starke","-5|n|03/12:03->11/05:01":"1/north_dakota","-5|n":"1/bogota,1/cancun,1/cayman,1/coral_harbour,1/eirunepe,1/guayaquil,1/jamaica,1/panama,1/atikokan","-4|s|05/13:23->08/13:01":"12/palmer","-4|s|04/03:24->09/05:00":"1/santiago,7/continental","-4|s|03/27:24->10/03:00":"1/asuncion","-4|s|02/16:24->11/03:00":"1/campo_grande,1/cuiaba","-4|s":"1/la_paz,1/manaus,5/west","-4|n|03/14:02->11/07:02":"1/detroit,1/grand_turk,1/indianapolis,1/iqaluit,1/louisville,1/montreal,1/nassau,1/new_york,1/nipigon,1/pangnirtung,1/port-au-prince,1/thunder_bay,1/toronto,1/indiana/marengo,1/indiana/petersburg,1/indiana/vevay,1/indiana/vincennes,1/indiana/winamac,1/kentucky/monticello,1/fort_wayne,1/indiana/indianapolis,1/kentucky/louisville,6/eastern,us/east-indiana,us/eastern,us/michigan","-4|n|03/14:00->11/07:01":"1/havana","-4|n|03/12:03->11/05:01":"1/indiana,1/kentucky","-4|n":"1/anguilla,1/antigua,1/aruba,1/barbados,1/blanc-sablon,1/boa_vista,1/caracas,1/curacao,1/dominica,1/grenada,1/guadeloupe,1/guyana,1/kralendijk,1/lower_princes,1/marigot,1/martinique,1/montserrat,1/port_of_spain,1/porto_velho,1/puerto_rico,1/santo_domingo,1/st_barthelemy,1/st_kitts,1/st_lucia,1/st_thomas,1/st_vincent,1/tortola,1/virgin","-3|s":"1/argentina,1/buenos_aires,1/catamarca,1/cordoba,1/fortaleza,1/jujuy,1/mendoza,1/montevideo,1/punta_arenas,1/sao_paulo,12/rothera,3/stanley,1/argentina/la_rioja,1/argentina/rio_gallegos,1/argentina/salta,1/argentina/san_juan,1/argentina/san_luis,1/argentina/tucuman,1/argentina/ushuaia,1/argentina/buenos_aires,1/argentina/catamarca,1/argentina/comodrivadavia,1/argentina/cordoba,1/argentina/jujuy,1/argentina/mendoza,1/rosario,5/east","-3|n|03/14:02->11/07:02":"1/glace_bay,1/goose_bay,1/halifax,1/moncton,1/thule,3/bermuda,6/atlantic","-3|n":"1/araguaina,1/bahia,1/belem,1/cayenne,1/maceio,1/paramaribo,1/recife,1/santarem","-2|n|03/27:22->10/30:23":"1/godthab,1/nuuk","-2|n|03/14:02->11/07:02":"1/miquelon","-2|n":"1/noronha,3/south_georgia,5/denoronha","-2.5|n|03/14:02->11/07:02":"1/st_johns,6/newfoundland","-1|n":"3/cape_verde","-11|n":"11/midway,11/niue,11/pago_pago,11/samoa,us/samoa","-10|n":"11/honolulu,11/johnston,11/rarotonga,11/tahiti,us/hawaii"}}))&&r.default||r;let i={};Object.keys(o).forEach(e=>{let t=e.split("|"),a={offset:Number(t[0]),hem:t[1]};t[2]&&(a.dst=t[2]),o[e].split(",").forEach(e=>{e=e.replace(/(^[0-9]+)\//,(e,t)=>(t=Number(t),n[t]+"/")),i[e]=a})}),i.utc={offset:0,hem:"n"};for(let e=-14;e<=14;e+=.5){let t=e;t>0&&(t="+"+t);let a="etc/gmt"+t;i[a]={offset:-1*e,hem:"n"},a="utc/gmt"+t,i[a]={offset:-1*e,hem:"n"}}var s=i;const u=/(\-?[0-9]+)h(rs)?/i,l=/(\-?[0-9]+)/,c=/utc([\-+]?[0-9]+)/i,h=/gmt([\-+]?[0-9]+)/i,d=function(e){return(e=Number(e))>=-13&&e<=13?"etc/gmt"+(e=((e*=-1)>0?"+":"")+e):null};var m=function(e){let t=e.match(u);if(null!==t)return d(t[1]);if(t=e.match(c),null!==t)return d(t[1]);if(t=e.match(h),null!==t){let e=-1*Number(t[1]);return d(e)}return t=e.match(l),null!==t?d(t[1]):null};const p=(()=>{let e=(()=>{if("undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;let e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;let t=e.resolvedOptions().timeZone;return t?t.toLowerCase():null})();return null===e?"utc":e})(),f=Object.keys(s).reduce((e,t)=>{let a=t.split("/")[1]||"";return a=a.replace(/_/g," "),e[a]=t,e},{});var y=(e,t)=>{if(!e)return p;"string"!=typeof e&&console.error("Timezone must be a string - recieved: '",e,"'\n");let a=e.trim();if(a=a.toLowerCase(),!0===t.hasOwnProperty(a))return a;if(a=(e=>(e=(e=(e=(e=(e=e.replace(/ time/g,"")).replace(/ (standard|daylight|summer)/g,"")).replace(/\b(east|west|north|south)ern/g,"$1")).replace(/\b(africa|america|australia)n/g,"$1")).replace(/\beuropean/g,"europe")).replace(/\islands/g,"island"))(a),!0===t.hasOwnProperty(a))return a;if(!0===f.hasOwnProperty(a))return f[a];if(!0===/[0-9]/.test(a)){let e=m(a);if(e)return e}throw new Error("Spacetime: Cannot find timezone named: '"+e+"'. Please enter an IANA timezone id.")},g=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){t.isLeapYear=e=>e%4==0&&e%100!=0||e%400==0,t.isDate=e=>"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.valueOf()),t.isArray=e=>"[object Array]"===Object.prototype.toString.call(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isBoolean=e=>"[object Boolean]"===Object.prototype.toString.call(e),t.zeroPad=(e,t=2)=>(e+="").length>=t?e:new Array(t-e.length+1).join("0")+e,t.titleCase=e=>e?e[0].toUpperCase()+e.substr(1):"",t.ordinal=e=>{let t=e%10,a=e%100;return 1===t&&11!==a?e+"st":2===t&&12!==a?e+"nd":3===t&&13!==a?e+"rd":e+"th"},t.toCardinal=e=>(e=(e=String(e)).replace(/([0-9])(st|nd|rd|th)$/i,"$1"),parseInt(e,10)),t.normalize=(e="")=>"day"===(e=(e=(e=(e=e.toLowerCase().trim()).replace(/ies$/,"y")).replace(/s$/,"")).replace(/-/g,""))||"days"===e?"date":"min"===e||"mins"===e?"minute":e,t.getEpoch=e=>"number"==typeof e?e:t.isDate(e)?e.getTime():e.epoch?e.epoch:null,t.beADate=(e,a)=>!1===t.isObject(e)?a.clone().set(e):e,t.formatTimezone=(e,a="")=>{const n=e>0?"+":"-",r=Math.abs(e),o=t.zeroPad(parseInt(""+r,10)),i=t.zeroPad(r%1*60);return"".concat(n).concat(o).concat(a).concat(i)}}));g.isLeapYear,g.isDate,g.isArray,g.isObject,g.isBoolean,g.zeroPad,g.titleCase,g.ordinal,g.toCardinal,g.normalize,g.getEpoch,g.beADate,g.formatTimezone;const b={year:(new Date).getFullYear(),month:0,date:1};var k={parseArray:(e,t,a)=>{if(0===t.length)return e;let n=["year","month","date","hour","minute","second","millisecond"];for(let r=0;r<n.length;r++){let o=t[r]||a[n[r]]||b[n[r]]||0;e=e[n[r]](o)}return e},parseObject:(e,t,a)=>{if(0===Object.keys(t).length)return e;t=Object.assign({},b,a,t);let n=Object.keys(t);for(let r=0;r<n.length;r++){let o=n[r];if(void 0===e[o]||"function"!=typeof e[o])continue;if(null===t[o]||void 0===t[o]||""===t[o])continue;let i=t[o]||a[o]||b[o]||0;e=e[o](i)}return e},parseNumber:function(e,t){return t>0&&t<25e8&&!1===e.silent&&(console.warn(" - Warning: You are setting the date to January 1970."),console.warn(" - did input seconds instead of milliseconds?")),e.epoch=t,e}};const w=function(e){return e.epoch=Date.now(),Object.keys(e._today||{}).forEach(t=>{"function"==typeof e[t]&&(e=e[t](e._today[t]))}),e},v={now:e=>w(e),today:e=>w(e),tonight:e=>e=(e=w(e)).hour(18),tomorrow:e=>e=(e=(e=w(e)).add(1,"day")).startOf("day"),yesterday:e=>e=(e=(e=w(e)).subtract(1,"day")).startOf("day"),christmas:e=>{let t=w(e).year();return e=e.set([t,11,25,18,0,0])},"new years":e=>{let t=w(e).year();return e=e.set([t,11,31,18,0,0])}};v["new years eve"]=v["new years"];var z=v;var _=function(e){return e=(e=(e=(e=e.replace(/\b(mon|tues?|wed|wednes|thur?s?|fri|sat|satur|sun)(day)?\b/i,"")).replace(/([0-9])(th|rd|st|nd)/,"$1")).replace(/,/g,"")).replace(/ +/g," ").trim()};let j={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5};j.date=j.day,j.month=25488e5,j.week=6048e5,j.year=3154e7,Object.keys(j).forEach(e=>{j[e+"s"]=j[e]});var O=j;const D=(e,t,a,n,r)=>{let o=e.d[a]();if(o===t)return;let i=null===r?null:e.d[r](),s=e.epoch,u=t-o;e.epoch+=O[n]*u,"day"===n&&Math.abs(u)>28&&t<28&&(e.epoch+=O.hour),null!==r&&i!==e.d[r]()&&(e.epoch=s);const l=O[n]/2;for(;e.d[a]()<t;)e.epoch+=l;for(;e.d[a]()>t;)e.epoch-=l;null!==r&&i!==e.d[r]()&&(e.epoch=s)},M={year:{valid:e=>e>-4e3&&e<4e3,walkTo:(e,t)=>D(e,t,"getFullYear","year",null)},month:{valid:e=>e>=0&&e<=11,walkTo:(e,t)=>{let a=e.d,n=a.getMonth(),r=e.epoch,o=a.getFullYear();if(n===t)return;let i=t-n;for(e.epoch+=O.day*(28*i),o!==e.d.getFullYear()&&(e.epoch=r);e.d.getMonth()<t;)e.epoch+=O.day;for(;e.d.getMonth()>t;)e.epoch-=O.day}},date:{valid:e=>e>0&&e<=31,walkTo:(e,t)=>D(e,t,"getDate","day","getMonth")},hour:{valid:e=>e>=0&&e<24,walkTo:(e,t)=>D(e,t,"getHours","hour","getDate")},minute:{valid:e=>e>=0&&e<60,walkTo:(e,t)=>D(e,t,"getMinutes","minute","getHours")},second:{valid:e=>e>=0&&e<60,walkTo:(e,t)=>{e.epoch=e.seconds(t).epoch}},millisecond:{valid:e=>e>=0&&e<1e3,walkTo:(e,t)=>{e.epoch=e.milliseconds(t).epoch}}};var P=(e,t)=>{let a=Object.keys(M),n=e.clone();for(let r=0;r<a.length;r++){let o=a[r],i=t[o];if(void 0===i&&(i=n[o]()),"string"==typeof i&&(i=parseInt(i,10)),!M[o].valid(i))return e.epoch=null,void(!1===e.silent&&console.warn("invalid "+o+": "+i));M[o].walkTo(e,i)}};var S=[31,28,31,30,31,30,31,31,30,31,30,31];let q=["jan","feb","mar","apr","may","jun","jul","aug","sept","oct","nov","dec"],T=["january","february","march","april","may","june","july","august","september","october","november","december"];var E=()=>q,N=()=>T,C=()=>function(){const e={sep:8};for(let t=0;t<q.length;t++)e[q[t]]=t;for(let t=0;t<T.length;t++)e[T[t]]=t;return e}(),I=e=>{q=e.short||q,T=e.long||T};var $=(e,t)=>{if(!t)return e;"Z"!==t&&"z"!==t||(t="+0000");let a=0;/^[\+-]?[0-9]{2}:[0-9]{2}$/.test(t)&&(!0===/:00/.test(t)&&(t=t.replace(/:00/,"")),!0===/:30/.test(t)&&(t=t.replace(/:30/,".5"))),/^[\+-]?[0-9]{4}$/.test(t)&&(t=t.replace(/30$/,".5")),a=parseFloat(t),Math.abs(a)>100&&(a/=100),a*=-1,a>=0&&(a="+"+a);let n="etc/gmt"+a;return e.timezones[n]&&(e.tz=n),e};var A=(e,t="")=>{let a=(t=t.replace(/^\s+/,"").toLowerCase()).match(/([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?[:\.]?([0-9]{1,4})?/);if(null!==a){let n=Number(a[1]);if(n<0||n>24)return e.startOf("day");let r=Number(a[2]);if(a[2].length<2||r<0||r>59)return e.startOf("day");a[4]>999&&(a[4]=parseInt("".concat(a[4]).substring(0,3),10)),e=(e=(e=(e=e.hour(n)).minute(r)).seconds(a[3]||0)).millisecond(a[4]||0);let o=t.match(/[\b0-9](am|pm)\b/);return null!==o&&o[1]&&(e=e.ampm(o[1])),e}if(a=t.match(/([0-9]+) ?(am|pm)/),null!==a&&a[1]){let t=Number(a[1]);return t>12||t<1?e.startOf("day"):e=(e=(e=e.hour(a[1]||0)).ampm(a[2])).startOf("hour")}return e=e.startOf("day")};const Y=g.isLeapYear,x=C();var L={parseOffset:$,parseTime:A,parseYear:(e="",t)=>{if(e=e.trim(),!0===/^'[0-9][0-9]$/.test(e)){let t=Number(e.replace(/'/,""));return t>50?1900+t:2e3+t}let a=parseInt(e,10);return!a&&t&&(a=t.year),a=a||(new Date).getFullYear(),a},parseMonth:function(e){return e=e.toLowerCase().trim(),x[e]},validate:e=>{if(!0!==S.hasOwnProperty(e.month))return!1;if(1===e.month)return!!(Y(e.year)&&e.date<=29)||e.date<=28;let t=S[e.month]||0;return e.date<=t}};const{validate:F,parseTime:B,parseYear:Z,parseMonth:H,parseOffset:Q}=L;var G=[{reg:/^(\-?0?0?[0-9]{3,4})-([0-9]{1,2})-([0-9]{1,2})[T| ]([0-9.:]+)(Z|[0-9\-\+:]+)?$/i,parse:(e,t)=>{let a={year:t[1],month:parseInt(t[2],10)-1,date:t[3]};return!1===F(a)?(e.epoch=null,e):(Q(e,t[5]),P(e,a),e=B(e,t[4]))}},{reg:/^([0-9]{4})[\-\/\. ]([0-9]{1,2})[\-\/\. ]([0-9]{1,2})( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let a={year:t[1],month:parseInt(t[2],10)-1,date:parseInt(t[3],10)};return a.month>=12&&(a.date=parseInt(t[2],10),a.month=parseInt(t[3],10)-1),!1===F(a)?(e.epoch=null,e):(P(e,a),e=B(e,t[4]))}},{reg:/^([0-9]{4})[\-\/\. ]([a-z]+)[\-\/\. ]([0-9]{1,2})( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let a={year:Z(t[1],e._today),month:H(t[2]),date:g.toCardinal(t[3]||"")};return!1===F(a)?(e.epoch=null,e):(P(e,a),e=B(e,t[4]))}}];const{validate:U,parseTime:V,parseYear:W,parseMonth:J}=L;var K=[{reg:/^([0-9]{1,2})[\-\/.]([0-9]{1,2})[\-\/.]?([0-9]{4})?( [0-9]{1,2}:[0-9]{2}:?[0-9]{0,2}? ?(am|pm|gmt))?$/i,parse:(e,t)=>{let a=parseInt(t[1],10)-1,n=parseInt(t[2],10);(e.british||a>=12)&&(n=parseInt(t[1],10),a=parseInt(t[2],10)-1);let r={date:n,month:a,year:W(t[3],e._today)||(new Date).getFullYear()};return!1===U(r)?(e.epoch=null,e):(P(e,r),e=V(e,t[4]))}},{reg:/^([a-z]+)[\-\/\. ]([0-9]{1,2})[\-\/\. ]?([0-9]{4}|'[0-9]{2})?( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let a={year:W(t[3],e._today),month:J(t[1]),date:g.toCardinal(t[2]||"")};return!1===U(a)?(e.epoch=null,e):(P(e,a),e=V(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2})( [0-9]{4})?( ([0-9:]+( ?am| ?pm| ?gmt)?))?$/i,parse:(e,t)=>{let a={year:W(t[3],e._today),month:J(t[1]),date:g.toCardinal(t[2]||"")};return!1===U(a)?(e.epoch=null,e):(P(e,a),e=V(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2})( [0-9:]+)?( \+[0-9]{4})?( [0-9]{4})?$/i,parse:(e,t)=>{let a={year:W(t[5],e._today),month:J(t[1]),date:g.toCardinal(t[2]||"")};return!1===U(a)?(e.epoch=null,e):(P(e,a),e=V(e,t[3]))}}];const{validate:R,parseTime:X,parseYear:ee,parseMonth:te}=L;var ae=[{reg:/^([0-9]{1,2})[\-\/]([a-z]+)[\-\/]?([0-9]{4})?$/i,parse:(e,t)=>{let a={year:ee(t[3],e._today),month:te(t[2]),date:g.toCardinal(t[1]||"")};return!1===R(a)?(e.epoch=null,e):(P(e,a),e=X(e,t[4]))}},{reg:/^([0-9]{1,2})( [a-z]+)( [0-9]{4}| '[0-9]{2})? ?([0-9]{1,2}:[0-9]{2}:?[0-9]{0,2}? ?(am|pm|gmt))?$/i,parse:(e,t)=>{let a={year:ee(t[3],e._today),month:te(t[2]),date:g.toCardinal(t[1])};return a.month&&!1!==R(a)?(P(e,a),e=X(e,t[4])):(e.epoch=null,e)}},{reg:/^([0-9]{1,2})[\. -/]([a-z]+)[\. -/]([0-9]{4})?( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let a={date:Number(t[1]),month:te(t[2]),year:Number(t[3])};return!1===R(a)?(e.epoch=null,e):(P(e,a),e=e.startOf("day"),e=X(e,t[4]))}}];const{validate:ne,parseTime:re,parseYear:oe,parseMonth:ie}=L;var se=[].concat(G,K,ae,[{reg:/^([0-9]{4})[\-\/]([0-9]{2})$/i,parse:(e,t)=>{let a={year:t[1],month:parseInt(t[2],10)-1,date:1};return!1===ne(a)?(e.epoch=null,e):(P(e,a),e=re(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{4})$/i,parse:(e,t)=>{let a={year:oe(t[2],e._today),month:ie(t[1]),date:e._today.date||1};return!1===ne(a)?(e.epoch=null,e):(P(e,a),e=re(e,t[4]))}},{reg:/^(q[0-9])( of)?( [0-9]{4})?/i,parse:(e,t)=>{let a=t[1]||"";e=e.quarter(a);let n=t[3]||"";return n&&(n=n.trim(),e=e.year(n)),e}},{reg:/^(spring|summer|winter|fall|autumn)( of)?( [0-9]{4})?/i,parse:(e,t)=>{let a=t[1]||"";e=e.season(a);let n=t[3]||"";return n&&(n=n.trim(),e=e.year(n)),e}},{reg:/^[0-9,]+ ?b\.?c\.?$/i,parse:(e,t)=>{let a=t[0]||"";a=a.replace(/^([0-9,]+) ?b\.?c\.?$/i,"-$1");let n=new Date,r={year:parseInt(a.trim(),10),month:n.getMonth(),date:n.getDate()};return!1===ne(r)?(e.epoch=null,e):(P(e,r),e=re(e))}},{reg:/^[0-9,]+ ?(a\.?d\.?|c\.?e\.?)$/i,parse:(e,t)=>{let a=t[0]||"";a=a.replace(/,/g,"");let n=new Date,r={year:parseInt(a.trim(),10),month:n.getMonth(),date:n.getDate()};return!1===ne(r)?(e.epoch=null,e):(P(e,r),e=re(e))}},{reg:/^[0-9]{4}( ?a\.?d\.?)?$/i,parse:(e,t)=>{let a=e._today;a.month&&!a.date&&(a.date=1);let n=new Date,r={year:oe(t[0],a),month:a.month||n.getMonth(),date:a.date||n.getDate()};return!1===ne(r)?(e.epoch=null,e):(P(e,r),e=re(e))}}]);var ue=function(e,t,a){for(let n=0;n<se.length;n++){let r=t.match(se[n].reg);if(r){let t=se[n].parse(e,r,a);if(null!==t&&t.isValid())return t}}return!1===e.silent&&console.warn("Warning: couldn't parse date-string: '"+t+"'"),e.epoch=null,e};const{parseArray:le,parseObject:ce,parseNumber:he}=k,de={year:(new Date).getFullYear(),month:0,date:1};var me=(e,t)=>{let a=e._today||de;if("number"==typeof t)return he(e,t);if(e.epoch=Date.now(),e._today&&g.isObject(e._today)&&Object.keys(e._today).length>0){let t=ce(e,a,de);t.isValid()&&(e.epoch=t.epoch)}return null==t||""===t?e:!0===g.isDate(t)?(e.epoch=t.getTime(),e):!0===g.isArray(t)?e=le(e,t,a):!0===g.isObject(t)?t.epoch?(e.epoch=t.epoch,e.tz=t.tz,e):e=ce(e,t,a):"string"!=typeof t?e:(t=_(t),!0===z.hasOwnProperty(t)?e=z[t](e):ue(e,t))};let pe=["sun","mon","tue","wed","thu","fri","sat"],fe=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];var ye={short:()=>pe,long:()=>fe,set:e=>{pe=e.short||pe,fe=e.long||fe},aliases:{mo:1,tu:2,we:3,th:4,fr:5,sa:6,su:7,tues:2,weds:3,wedn:3,thur:4,thurs:4}};let ge=!0;var be=()=>ge,ke=e=>{ge=e};var we=e=>{let t=e.timezone().current.offset;return t?g.formatTimezone(t,":"):"Z"};const ve=e=>be()?g.titleCase(e):e,ze={day:e=>ve(e.dayName()),"day-short":e=>ve(ye.short()[e.day()]),"day-number":e=>e.day(),"day-ordinal":e=>g.ordinal(e.day()),"day-pad":e=>g.zeroPad(e.day()),date:e=>e.date(),"date-ordinal":e=>g.ordinal(e.date()),"date-pad":e=>g.zeroPad(e.date()),month:e=>ve(e.monthName()),"month-short":e=>ve(E()[e.month()]),"month-number":e=>e.month(),"month-ordinal":e=>g.ordinal(e.month()),"month-pad":e=>g.zeroPad(e.month()),"iso-month":e=>g.zeroPad(e.month()+1),year:e=>{let t=e.year();return t>0?t:(t=Math.abs(t),t+" BC")},"year-short":e=>{let t=e.year();return t>0?"'".concat(String(e.year()).substr(2,4)):(t=Math.abs(t),t+" BC")},"iso-year":e=>{let t=e.year(),a=t<0,n=g.zeroPad(Math.abs(t),4);return a&&(n=g.zeroPad(n,6),n="-"+n),n},time:e=>e.time(),"time-24":e=>"".concat(e.hour24(),":").concat(g.zeroPad(e.minute())),hour:e=>e.hour12(),"hour-pad":e=>g.zeroPad(e.hour12()),"hour-24":e=>e.hour24(),"hour-24-pad":e=>g.zeroPad(e.hour24()),minute:e=>e.minute(),"minute-pad":e=>g.zeroPad(e.minute()),second:e=>e.second(),"second-pad":e=>g.zeroPad(e.second()),millisecond:e=>e.millisecond(),"millisecond-pad":e=>g.zeroPad(e.millisecond(),3),ampm:e=>e.ampm(),quarter:e=>"Q"+e.quarter(),season:e=>e.season(),era:e=>e.era(),json:e=>e.json(),timezone:e=>e.timezone().name,offset:e=>we(e),numeric:e=>"".concat(e.year(),"/").concat(g.zeroPad(e.month()+1),"/").concat(g.zeroPad(e.date())),"numeric-us":e=>"".concat(g.zeroPad(e.month()+1),"/").concat(g.zeroPad(e.date()),"/").concat(e.year()),"numeric-uk":e=>"".concat(g.zeroPad(e.date()),"/").concat(g.zeroPad(e.month()+1),"/").concat(e.year()),"mm/dd":e=>"".concat(g.zeroPad(e.month()+1),"/").concat(g.zeroPad(e.date())),iso:e=>{let t=e.format("iso-year"),a=g.zeroPad(e.month()+1),n=g.zeroPad(e.date()),r=g.zeroPad(e.h24()),o=g.zeroPad(e.minute()),i=g.zeroPad(e.second()),s=g.zeroPad(e.millisecond(),3),u=we(e);return"".concat(t,"-").concat(a,"-").concat(n,"T").concat(r,":").concat(o,":").concat(i,".").concat(s).concat(u)},"iso-short":e=>{let t=g.zeroPad(e.month()+1),a=g.zeroPad(e.date());return"".concat(e.year(),"-").concat(t,"-").concat(a)},"iso-utc":e=>new Date(e.epoch).toISOString(),nice:e=>"".concat(E()[e.month()]," ").concat(g.ordinal(e.date()),", ").concat(e.time()),"nice-24":e=>"".concat(E()[e.month()]," ").concat(g.ordinal(e.date()),", ").concat(e.hour24(),":").concat(g.zeroPad(e.minute())),"nice-year":e=>"".concat(E()[e.month()]," ").concat(g.ordinal(e.date()),", ").concat(e.year()),"nice-day":e=>"".concat(ye.short()[e.day()]," ").concat(ve(E()[e.month()])," ").concat(g.ordinal(e.date())),"nice-full":e=>"".concat(e.dayName()," ").concat(ve(e.monthName())," ").concat(g.ordinal(e.date()),", ").concat(e.time()),"nice-full-24":e=>"".concat(e.dayName()," ").concat(ve(e.monthName())," ").concat(g.ordinal(e.date()),", ").concat(e.hour24(),":").concat(g.zeroPad(e.minute()))},_e={"day-name":"day","month-name":"month","iso 8601":"iso","time-h24":"time-24","time-12":"time","time-h12":"time",tz:"timezone","day-num":"day-number","month-num":"month-number","month-iso":"iso-month","year-iso":"iso-year","nice-short":"nice","nice-short-24":"nice-24",mdy:"numeric-us",dmy:"numeric-uk",ymd:"numeric","yyyy/mm/dd":"numeric","mm/dd/yyyy":"numeric-us","dd/mm/yyyy":"numeric-us","little-endian":"numeric-uk","big-endian":"numeric","day-nice":"nice-day"};Object.keys(_e).forEach(e=>ze[e]=ze[_e[e]]);var je=(e,t="")=>{if(!0!==e.isValid())return"";if(ze.hasOwnProperty(t)){let a=ze[t](e)||"";return"json"!==t&&(a=String(a),"ampm"!==t&&(a=ve(a))),a}if(-1!==t.indexOf("{")){let a=/\{(.+?)\}/g;return t=t.replace(a,(t,a)=>{if(a=a.toLowerCase().trim(),ze.hasOwnProperty(a)){let t=String(ze[a](e));return"ampm"!==a?ve(t):t}return""})}return e.format("iso-short")};const Oe=g.zeroPad,De=g.formatTimezone,Me={G:e=>e.era(),GG:e=>e.era(),GGG:e=>e.era(),GGGG:e=>"AD"===e.era()?"Anno Domini":"Before Christ",y:e=>e.year(),yy:e=>parseInt(String(e.year()).substr(2,4),10),yyy:e=>e.year(),yyyy:e=>e.year(),yyyyy:e=>"0"+e.year(),Q:e=>e.quarter(),QQ:e=>e.quarter(),QQQ:e=>e.quarter(),QQQQ:e=>e.quarter(),M:e=>e.month()+1,MM:e=>Oe(e.month()+1),MMM:e=>e.format("month-short"),MMMM:e=>e.format("month"),w:e=>e.week(),ww:e=>Oe(e.week()),d:e=>e.date(),dd:e=>Oe(e.date()),D:e=>e.dayOfYear(),DD:e=>Oe(e.dayOfYear()),DDD:e=>Oe(e.dayOfYear(),3),E:e=>e.format("day-short"),EE:e=>e.format("day-short"),EEE:e=>e.format("day-short"),EEEE:e=>e.format("day"),EEEEE:e=>e.format("day")[0],e:e=>e.day(),ee:e=>e.day(),eee:e=>e.format("day-short"),eeee:e=>e.format("day"),eeeee:e=>e.format("day")[0],a:e=>e.ampm().toUpperCase(),aa:e=>e.ampm().toUpperCase(),aaa:e=>e.ampm().toUpperCase(),aaaa:e=>e.ampm().toUpperCase(),h:e=>e.h12(),hh:e=>Oe(e.h12()),H:e=>e.hour(),HH:e=>Oe(e.hour()),m:e=>e.minute(),mm:e=>Oe(e.minute()),s:e=>e.second(),ss:e=>Oe(e.second()),SSS:e=>Oe(e.millisecond(),3),A:e=>e.epoch-e.startOf("day").epoch,z:e=>e.timezone().name,zz:e=>e.timezone().name,zzz:e=>e.timezone().name,zzzz:e=>e.timezone().name,Z:e=>De(e.timezone().current.offset),ZZ:e=>De(e.timezone().current.offset),ZZZ:e=>De(e.timezone().current.offset),ZZZZ:e=>De(e.timezone().current.offset,":")},Pe=(e,t,a)=>{let n=e,r=t;for(let o=0;o<a;o+=1)Me[n]=Me[r],n+=e,r+=t};Pe("q","Q",4),Pe("L","M",4),Pe("Y","y",4),Pe("c","e",4),Pe("k","H",2),Pe("K","h",2),Pe("S","s",2),Pe("v","z",4),Pe("V","Z",4);var Se=(e,t)=>{let a=t.split("");return a=function(e){for(let t=0;t<e.length;t+=1)if("'"===e[t])for(let a=t+1;a<e.length;a+=1){if(e[a]&&(e[t]+=e[a]),"'"===e[a]){e[a]=null;break}e[a]=null}return e.filter(e=>e)}(a),a=function(e){for(let t=0;t<e.length;t+=1){let a=e[t];for(let n=t+1;n<e.length&&e[n]===a;n+=1)e[t]+=e[n],e[n]=null}return(e=e.filter(e=>e)).map(e=>("''"===e&&(e="'"),e))}(a),a.reduce((t,a)=>(void 0!==Me[a]?t+=Me[a](e)||"":(/^'.{1,}'$/.test(a)&&(a=a.replace(/'/g,"")),t+=a),t),"")};const qe=["year","season","quarter","month","week","day","quarterHour","hour","minute"],Te=function(e,t){let a=e.clone().startOf(t),n=e.clone().endOf(t).epoch-a.epoch,r=(e.epoch-a.epoch)/n;return parseFloat(r.toFixed(2))};var Ee=(e,t)=>{if(t)return t=g.normalize(t),Te(e,t);let a={};return qe.forEach(t=>{a[t]=Te(e,t)}),a};var Ne=(e,t)=>{let a=e.progress();return"quarterhour"===(t=g.normalize(t))&&(t="quarterHour"),void 0!==a[t]?(a[t]>.5&&(e=e.add(1,t)),e=e.startOf(t)):!1===e.silent&&console.warn("no known unit '"+t+"'"),e};const Ce=(e,t,a)=>{let n=0;for(e=e.clone();e.isBefore(t);)e=e.add(1,a),n+=1;return e.isAfter(t,a)&&(n-=1),n};var Ie=(e,t,a)=>e.isBefore(t)?Ce(e,t,a):-1*Ce(t,e,a);var $e=function(e,t){let a=t.epoch-e.epoch,n={milliseconds:a,seconds:parseInt(a/1e3,10)};n.minutes=parseInt(n.seconds/60,10),n.hours=parseInt(n.minutes/60,10);let r=e.clone();return n.years=((e,t)=>{let a=t.year()-e.year();return(e=e.year(t.year())).isAfter(t)&&(a-=1),a})(r,t),r=e.add(n.years,"year"),n.months=12*n.years,r=e.add(n.months,"month"),n.months+=Ie(r,t,"month"),n.weeks=52*n.years,r=e.add(n.weeks,"week"),n.weeks+=Ie(r,t,"week"),n.days=7*n.weeks,r=e.add(n.days,"day"),n.days+=Ie(r,t,"day"),n};var Ae=function(e,t,a){t=g.beADate(t,e);let n=!1;if(e.isAfter(t)){let a=e;e=t,t=a,n=!0}let r=$e(e,t);return n&&(r=function(e){return Object.keys(e).forEach(t=>{e[t]*=-1}),e}(r)),a?(a=g.normalize(a),!0!==/s$/.test(a)&&(a+="s"),"dates"===a&&(a="days"),r[a]):r};const Ye={months:{almost:10,over:4},days:{almost:25,over:10},hours:{almost:20,over:8},minutes:{almost:50,over:20},seconds:{almost:50,over:20}};function xe(e,t){return 1===e&&(t=t.slice(0,-1)),e+" "+t}var Le=(e,t)=>{const a=function(e,t){const a=e.isBefore(t),n=a?t:e;let r=a?e:t;r=r.clone();const o={years:0,months:0,days:0,hours:0,minutes:0,seconds:0};return Object.keys(o).forEach(e=>{if(r.isSame(n,e))return;let t=r.diff(n,e);r=r.add(t,e),o[e]=t}),a&&Object.keys(o).forEach(e=>{0!==o[e]&&(o[e]*=-1)}),o}(e,t=g.beADate(t,e));if(!0===Object.keys(a).every(e=>!a[e]))return{diff:a,rounded:"now",qualified:"now",precise:"now"};let n,r,o,i=[];return Object.keys(a).forEach((e,t,o)=>{const s=Math.abs(a[e]);if(0===s)return;const u=xe(s,e);if(i.push(u),!n){if(n=r=u,t>4)return;const i=o[t+1],l=Math.abs(a[i]);l>Ye[i].almost?(n=xe(s+1,e),r="almost "+n):l>Ye[i].over&&(r="over "+u)}}),o=i.splice(0,2).join(", "),!0===e.isAfter(t)?(n+=" ago",r+=" ago",o+=" ago"):(n="in "+n,r="in "+r,o="in "+o),{diff:a,rounded:n,qualified:r,precise:o}},Fe={north:[["spring",2,1],["summer",5,1],["fall",8,1],["autumn",8,1],["winter",11,1]],south:[["fall",2,1],["autumn",2,1],["winter",5,1],["spring",8,1],["summer",11,1]]},Be=[null,[0,1],[3,1],[6,1],[9,1]];const Ze={minute:e=>(P(e,{second:0,millisecond:0}),e),quarterhour:e=>{let t=e.minutes();return e=t>=45?e.minutes(45):t>=30?e.minutes(30):t>=15?e.minutes(15):e.minutes(0),P(e,{second:0,millisecond:0}),e},hour:e=>(P(e,{minute:0,second:0,millisecond:0}),e),day:e=>(P(e,{hour:0,minute:0,second:0,millisecond:0}),e),week:e=>{let t=e.clone();return(e=e.day(e._weekStart)).isAfter(t)&&(e=e.subtract(1,"week")),P(e,{hour:0,minute:0,second:0,millisecond:0}),e},month:e=>(P(e,{date:1,hour:0,minute:0,second:0,millisecond:0}),e),quarter:e=>{let t=e.quarter();return Be[t]&&P(e,{month:Be[t][0],date:Be[t][1],hour:0,minute:0,second:0,millisecond:0}),e},season:e=>{let t=e.season(),a="north";"South"===e.hemisphere()&&(a="south");for(let n=0;n<Fe[a].length;n++)if(Fe[a][n][0]===t){let r=e.year();return"winter"===t&&e.month()<3&&(r-=1),P(e,{year:r,month:Fe[a][n][1],date:Fe[a][n][2],hour:0,minute:0,second:0,millisecond:0}),e}return e},year:e=>(P(e,{month:0,date:1,hour:0,minute:0,second:0,millisecond:0}),e),decade:e=>{let t=(e=e.startOf("year")).year(),a=10*parseInt(t/10,10);return e=e.year(a)},century:e=>{let t=(e=e.startOf("year")).year(),a=100*parseInt(t/100,10);return e=e.year(a)}};Ze.date=Ze.day;var He=(e,t)=>{let a=e.clone();return t=g.normalize(t),Ze[t]?Ze[t](a):"summer"===t||"winter"===t?(a=a.season(t),Ze.season(a)):a},Qe=(e,t)=>{let a=e.clone();return t=g.normalize(t),Ze[t]?(a=Ze[t](a),a=a.add(1,t),a=a.subtract(1,"millisecond"),a):a};var Ge=function(e,t="",a){if(!t||!a)return[];if(t=g.normalize(t),a=e.clone().set(a),e.isAfter(a)){let t=e;e=a,a=t}let n=e.clone();!function(e){return!!ye.short().find(t=>t===e)||!!ye.long().find(t=>t===e)}(t)?n=n.next(t):(n=n.next(t),t="week");let r=[];for(;n.isBefore(a);)r.push(n),n=n.add(1,t);return r};var Ue=e=>{let a=e.timezones,n=e.tz;if(!1===a.hasOwnProperty(n)&&(n=y(e.tz,a)),null===n)return!1===e.silent&&console.warn("Warn: could not find given or local timezone - '"+e.tz+"'"),{current:{epochShift:0}};let r=a[n],o={name:(i=n,i=(i=(i=i[0].toUpperCase()+i.substr(1)).replace(/\/gmt/,"/GMT")).replace(/[\/_]([a-z])/gi,e=>e.toUpperCase())),hasDst:Boolean(r.dst),default_offset:r.offset,hemisphere:"s"===r.hem?"South":"North",current:{}};var i,s;if(o.hasDst){let e=(s=r.dst)?s.split("->"):[];o.change={start:e[0],back:e[1]}}let u=r.offset,l=u;return!0===o.hasDst&&(l="North"===o.hemisphere?u-1:r.offset+1),!1===o.hasDst?(o.current.offset=u,o.current.isDST=!1):!0===t(e.epoch,o.change.start,o.change.back,u,l)?(o.current.offset=u,o.current.isDST="North"===o.hemisphere):(o.current.offset=l,o.current.isDST="South"===o.hemisphere),o};const Ve=["century","decade","year","month","date","day","hour","minute","second","millisecond"],We={set:function(e,t){let a=this.clone();return a=me(a,e),t&&(this.tz=y(t)),a},timezone:function(){return Ue(this)},isDST:function(){return Ue(this).current.isDST},hasDST:function(){return Ue(this).hasDst},offset:function(){return 60*Ue(this).current.offset},hemisphere:function(){return Ue(this).hemisphere},format:function(e){return je(this,e)},unixFmt:function(e){return Se(this,e)},startOf:function(e){return He(this,e)},endOf:function(e){return Qe(this,e)},leapYear:function(){let e=this.year();return g.isLeapYear(e)},progress:function(e){return Ee(this,e)},nearest:function(e){return Ne(this,e)},diff:function(e,t){return Ae(this,e,t)},since:function(e){return e||(e=this.clone().set()),Le(this,e)},next:function(e){return this.add(1,e).startOf(e)},last:function(e){return this.subtract(1,e).startOf(e)},isValid:function(){return!(!this.epoch&&0!==this.epoch)&&!isNaN(this.d.getTime())},goto:function(e){let t=this.clone();return t.tz=y(e,t.timezones),t},every:function(e,t){if("object"==typeof e&&"string"==typeof t){let a=t;t=e,e=a}return Ge(this,e,t)},isAwake:function(){let e=this.hour();return!(e<8||e>22)},isAsleep:function(){return!this.isAwake()},log:function(){return console.log(""),console.log(je(this,"nice-short")),this},logYear:function(){return console.log(""),console.log(je(this,"full-short")),this},json:function(){return Ve.reduce((e,t)=>(e[t]=this[t](),e),{})},debug:function(){let e=this.timezone(),t=this.format("MM")+" "+this.format("date-ordinal")+" "+this.year();return t+="\n - "+this.format("time"),console.log("\n\n",t+"\n - "+e.name+" ("+e.current.offset+")"),this},from:function(e){return(e=this.clone().set(e)).since(this)},fromNow:function(){return this.clone().set(Date.now()).since(this)},weekStart:function(e){if("number"==typeof e)return this._weekStart=e,this;if("string"==typeof e){e=e.toLowerCase().trim();let t=ye.short().indexOf(e);-1===t&&(t=ye.long().indexOf(e)),-1===t&&(t=1),this._weekStart=t}else console.warn("Spacetime Error: Cannot understand .weekStart() input:",e);return this}};We.inDST=We.isDST,We.round=We.nearest,We.each=We.every;var Je=We;const Ke=g.isLeapYear,Re=e=>("string"==typeof e&&(e=parseInt(e,10)),e),Xe=["year","month","date","hour","minute","second","millisecond"],et=(e,t,a)=>{let n=Xe.indexOf(a),r=Xe.slice(n,Xe.length);for(let a=0;a<r.length;a++){let n=t[r[a]]();e[r[a]](n)}return e},tt=function(e,t,a,n){return!0===a&&e.isBefore(t)?e=e.add(1,n):!1===a&&e.isAfter(t)&&(e=e.minus(1,n)),e};var at=(e,t)=>{t=Re(t);let a=e.millisecond()-t;return e.epoch-a},nt=(e,t,a)=>{t=Re(t);let n=e.clone(),r=(e.second()-t)*O.second;return e.epoch=e.epoch-r,(e=tt(e,n,a,"minute")).epoch},rt=(e,t,a)=>{t=Re(t);let n=e.clone(),r=(e.minute()-t)*O.minute;return e.epoch-=r,et(e,n,"second"),(e=tt(e,n,a,"hour")).epoch},ot=(e,t,a)=>{(t=Re(t))>=24?t=24:t<0&&(t=0);let n=e.clone(),r=e.hour()-t,o=r*O.hour;return e.epoch-=o,e.date()!==n.date()&&(e=n.clone(),r>1&&(r-=1),r<1&&(r+=1),o=r*O.hour,e.epoch-=o),P(e,{hour:t}),et(e,n,"minute"),(e=tt(e,n,a,"day")).epoch},it=(e,t,a)=>{let n=t.match(/([0-9]{1,2})[:h]([0-9]{1,2})(:[0-9]{1,2})? ?(am|pm)?/);if(!n){if(n=t.match(/([0-9]{1,2}) ?(am|pm)/),!n)return e.epoch;n.splice(2,0,"0"),n.splice(3,0,"")}let r=!1,o=parseInt(n[1],10),i=parseInt(n[2],10);i>=60&&(i=59),o>12&&(r=!0),!1===r&&("am"===n[4]&&12===o&&(o=0),"pm"===n[4]&&o<12&&(o+=12)),n[3]=n[3]||"",n[3]=n[3].replace(/:/,"");let s=parseInt(n[3],10)||0,u=e.clone();return e=(e=(e=(e=e.hour(o)).minute(i)).second(s)).millisecond(0),(e=tt(e,u,a,"day")).epoch},st=(e,t,a)=>{if((t=Re(t))>28){let a=e.month(),n=S[a];1===a&&29===t&&Ke(e.year())&&(n=29),t>n&&(t=n)}t<=0&&(t=1);let n=e.clone();return P(e,{date:t}),(e=tt(e,n,a,"month")).epoch},ut=(e,t,a)=>{"string"==typeof t&&(t=C()[t.toLowerCase()]),(t=Re(t))>=12&&(t=11),t<=0&&(t=0);let n=e.date();n>S[t]&&(n=S[t]);let r=e.clone();return P(e,{month:t,date:n}),(e=tt(e,r,a,"year")).epoch},lt=(e,t)=>("string"==typeof t&&/^'[0-9]{2}$/.test(t)&&(t=t.replace(/'/,"").trim(),t=(t=Number(t))>30?1900+t:2e3+t),t=Re(t),P(e,{year:t}),e.epoch),ct=(e,t,a)=>{let n=e.clone();return t=Re(t),"december"===(e=(e=(e=e.month(0)).date(1)).day("monday")).monthName()&&e.date()>=28&&(e=e.add(1,"week")),t-=1,e=e.add(t,"weeks"),(e=tt(e,n,a,"year")).epoch},ht=(e,t,a)=>{t=Re(t);let n=e.clone();return(t-=1)<=0?t=0:t>=365&&(t=364),e=(e=e.startOf("year")).add(t,"day"),et(e,n,"hour"),(e=tt(e,n,a,"year")).epoch};var dt={millisecond:function(e){if(void 0!==e){let t=this.clone();return t.epoch=at(t,e),t}return this.d.getMilliseconds()},second:function(e,t){if(void 0!==e){let a=this.clone();return a.epoch=nt(a,e,t),a}return this.d.getSeconds()},minute:function(e,t){if(void 0!==e){let a=this.clone();return a.epoch=rt(a,e,t),a}return this.d.getMinutes()},hour:function(e,t){let a=this.d;if(void 0!==e){let a=this.clone();return a.epoch=ot(a,e,t),a}return a.getHours()},hourFloat:function(e,t){if(void 0!==e){let a=this.clone(),n=e%1;n*=60;let r=parseInt(e,10);return a.epoch=ot(a,r,t),a.epoch=rt(a,n,t),a}let a=this.d,n=a.getHours(),r=a.getMinutes();return r/=60,n+r},hour12:function(e,t){let a=this.d;if(void 0!==e){let a=this.clone(),n=(e=""+e).match(/^([0-9]+)(am|pm)$/);if(n){let e=parseInt(n[1],10);"pm"===n[2]&&(e+=12),a.epoch=ot(a,e,t)}return a}let n=a.getHours();return n>12&&(n-=12),0===n&&(n=12),n},time:function(e,t){if(void 0!==e){let a=this.clone();return e=e.toLowerCase().trim(),a.epoch=it(a,e,t),a}return"".concat(this.h12(),":").concat(g.zeroPad(this.minute())).concat(this.ampm())},ampm:function(e,t){let a="am",n=this.hour();if(n>=12&&(a="pm"),"string"!=typeof e)return a;let r=this.clone();return e=e.toLowerCase().trim(),n>=12&&"am"===e?(n-=12,r.hour(n,t)):n<12&&"pm"===e?(n+=12,r.hour(n,t)):r},dayTime:function(e,t){if(void 0!==e){const a={morning:"7:00am",breakfast:"7:00am",noon:"12:00am",lunch:"12:00pm",afternoon:"2:00pm",evening:"6:00pm",dinner:"6:00pm",night:"11:00pm",midnight:"23:59pm"};let n=this.clone();return e=(e=e||"").toLowerCase(),!0===a.hasOwnProperty(e)&&(n=n.time(a[e],t)),n}let a=this.hour();return a<6?"night":a<12?"morning":a<17?"afternoon":a<22?"evening":"night"},iso:function(e){return void 0!==e?this.set(e):this.format("iso")}};var mt={date:function(e,t){if(void 0!==e){let a=this.clone();return(e=parseInt(e,10))&&(a.epoch=st(a,e,t)),a}return this.d.getDate()},day:function(e,t){if(void 0===e)return this.d.getDay();let a=this.clone(),n=e;"string"==typeof e&&(e=e.toLowerCase(),ye.aliases.hasOwnProperty(e)?n=ye.aliases[e]:(n=ye.short().indexOf(e),-1===n&&(n=ye.long().indexOf(e))));let r=this.d.getDay()-n;!0===t&&r>0&&(r-=7),!1===t&&r<0&&(r+=7);let o=this.subtract(r,"days");return P(o,{hour:a.hour(),minute:a.minute(),second:a.second()}),o},dayName:function(e,t){if(void 0===e)return ye.long()[this.day()];let a=this.clone();return a=a.day(e,t),a}};const pt=e=>e=(e=(e=e.minute(0)).second(0)).millisecond(1);var ft={dayOfYear:function(e,t){if(void 0!==e){let a=this.clone();return a.epoch=ht(a,e,t),a}let a,n=0,r=this.d.getMonth();for(let e=1;e<=r;e++)a=new Date,a.setDate(1),a.setFullYear(this.d.getFullYear()),a.setHours(1),a.setMinutes(1),a.setMonth(e),a.setHours(-2),n+=a.getDate();return n+this.d.getDate()},week:function(e,t){if(void 0!==e){let a=this.clone();return a.epoch=ct(this,e,t),a=pt(a),a}let a=this.clone();a=a.month(0),a=a.date(1),a=pt(a),a=a.day("monday"),"december"===a.monthName()&&a.date()>=28&&(a=a.add(1,"week"));let n=1;1===a.date()&&(n=0),a=a.minus(1,"second");const r=this.epoch;if(a.epoch>r)return 1;let o=0,i=4*this.month();for(a.epoch+=O.week*i,o+=i;o<=52;o++){if(a.epoch>r)return o+n;a=a.add(1,"week")}return 52},month:function(e,t){if(void 0!==e){let a=this.clone();return a.epoch=ut(a,e,t),a}return this.d.getMonth()},monthName:function(e,t){if(void 0!==e){let a=this.clone();return a=a.month(e,t),a}return N()[this.month()]},quarter:function(e,t){if(void 0!==e&&("string"==typeof e&&(e=e.replace(/^q/i,""),e=parseInt(e,10)),Be[e])){let a=this.clone(),n=Be[e][0];return a=a.month(n,t),a=a.date(1,t),a=a.startOf("day"),a}let a=this.d.getMonth();for(let e=1;e<Be.length;e++)if(a<Be[e][0])return e-1;return 4},season:function(e,t){let a="north";if("South"===this.hemisphere()&&(a="south"),void 0!==e){let n=this.clone();for(let r=0;r<Fe[a].length;r++)e===Fe[a][r][0]&&(n=n.month(Fe[a][r][1],t),n=n.date(1),n=n.startOf("day"));return n}let n=this.d.getMonth();for(let e=0;e<Fe[a].length-1;e++)if(n>=Fe[a][e][1]&&n<Fe[a][e+1][1])return Fe[a][e][0];return"winter"},year:function(e){if(void 0!==e){let t=this.clone();return t.epoch=lt(t,e),t}return this.d.getFullYear()},era:function(e){if(void 0!==e){let t=this.clone();e=e.toLowerCase();let a=t.d.getFullYear();return"bc"===e&&a>0&&(t.epoch=lt(t,-1*a)),"ad"===e&&a<0&&(t.epoch=lt(t,-1*a)),t}return this.d.getFullYear()<0?"BC":"AD"},decade:function(e){if(void 0!==e){if(!(e=(e=(e=String(e)).replace(/([0-9])'?s$/,"$1")).replace(/([0-9])(th|rd|st|nd)/,"$1")))return console.warn("Spacetime: Invalid decade input"),this;2===e.length&&/[0-9][0-9]/.test(e)&&(e="19"+e);let t=Number(e);return isNaN(t)?this:(t=10*Math.floor(t/10),this.year(t))}return this.startOf("decade").year()},century:function(e){if(void 0!==e){"string"==typeof e&&(e=(e=(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1")).replace(/([0-9]+) ?(b\.?c\.?|a\.?d\.?)/i,(e,t,a)=>(a.match(/b\.?c\.?/i)&&(t="-"+t),t))).replace(/c$/,""));let t=Number(e);return isNaN(e)?(console.warn("Spacetime: Invalid century input"),this):(0===t&&(t=1),t=t>=0?100*(t-1):100*(t+1),this.year(t))}let t=this.startOf("century").year();return t=Math.floor(t/100),t<0?t-1:t+1},millenium:function(e){if(void 0!==e){if("string"==typeof e&&(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1"),e=Number(e),isNaN(e)))return console.warn("Spacetime: Invalid millenium input"),this;e>0&&(e-=1);let t=1e3*e;return 0===t&&(t=1),this.year(t)}let t=Math.floor(this.year()/1e3);return t>=0&&(t+=1),t}};const yt=Object.assign({},dt,mt,ft);yt.milliseconds=yt.millisecond,yt.seconds=yt.second,yt.minutes=yt.minute,yt.hours=yt.hour,yt.hour24=yt.hour,yt.h12=yt.hour12,yt.h24=yt.hour24,yt.days=yt.day;var gt=e=>{Object.keys(yt).forEach(t=>{e.prototype[t]=yt[t]})};const bt=g.isLeapYear,kt=function(e,t){return 1===e&&bt(t)?29:S[e]};var wt=(e,t)=>{if(e.month>0){let a=parseInt(e.month/12,10);e.year=t.year()+a,e.month=e.month%12}else if(e.month<0){let a=Math.floor(Math.abs(e.month)/13,10);a=Math.abs(a)+1,e.year=t.year()-a,e.month=e.month%12,e.month=e.month+12,12===e.month&&(e.month=0)}return e},vt=(e,t,a)=>{let n=t.year(),r=t.month(),o=kt(r,n);for(;a>o;)a-=o,r+=1,r>=12&&(r-=12,n+=1),o=kt(r,n);return e.month=r,e.date=a,e},zt=(e,t,a)=>{e.year=t.year(),e.month=t.month();let n=t.date();for(e.date=n-Math.abs(a);e.date<1;){e.month-=1,e.month<0&&(e.month=11,e.year-=1);let t=kt(e.month,e.year);e.date+=t}return e};const _t=["millisecond","second","minute","hour","date","month"];let jt={second:_t.slice(0,1),minute:_t.slice(0,2),quarterhour:_t.slice(0,2),hour:_t.slice(0,3),date:_t.slice(0,4),month:_t.slice(0,4),quarter:_t.slice(0,4),season:_t.slice(0,4),year:_t,decade:_t,century:_t};jt.week=jt.hour,jt.season=jt.date,jt.quarter=jt.date;const Ot={year:!0,quarter:!0,season:!0,month:!0,week:!0,day:!0},Dt={month:!0,quarter:!0,season:!0,year:!0};var Mt=e=>{e.prototype.add=function(e,t){let a=this.clone();if(!t||0===e)return a;let n=this.clone();if("millisecond"===(t=g.normalize(t)))return a.epoch+=e,a;"fortnight"===t&&(e*=2,t="week"),O[t]?a.epoch+=O[t]*e:"week"===t||"weekend"===t?a.epoch+=O.day*(7*e):"quarter"===t||"season"===t?a.epoch+=O.month*(3*e):"quarterhour"===t&&(a.epoch+=15*O.minute*e);let r={};if(jt[t]&&jt[t].forEach(e=>{r[e]=n[e]()}),Ot[t]){const e=n.timezone().current.offset-a.timezone().current.offset;a.epoch+=3600*e*1e3}if("month"===t&&(r.month=n.month()+e,r=wt(r,n)),"week"===t){let t=n.date()+7*e;t<=28&&t>1&&(r.date=t)}if("weekend"===t&&"saturday"!==a.dayName())a=a.day("saturday",!0);else if("date"===t){if(e<0)r=zt(r,n,e);else{let t=n.date()+e;r=vt(r,n,t)}0!==e&&n.isSame(a,"day")&&(r.date=n.date()+e)}else if("quarter"===t){if(r.month=n.month()+3*e,r.year=n.year(),r.month<0){let e=Math.floor(r.month/12),t=r.month+12*Math.abs(e);r.month=t,r.year+=e}else if(r.month>=12){let e=Math.floor(r.month/12);r.month=r.month%12,r.year+=e}r.date=n.date()}else if("year"===t){let t=n.year()+e,r=a.year();(r<t||r>t)&&(a.epoch+=O.day)}else"decade"===t?r.year=a.year()+10:"century"===t&&(r.year=a.year()+100);if(Dt[t]){let e=S[r.month];r.date=n.date(),r.date>e&&(r.date=e)}return Object.keys(r).length>1&&P(a,r),a},e.prototype.subtract=function(e,t){return this.clone().add(-1*e,t)},e.prototype.minus=e.prototype.subtract,e.prototype.plus=e.prototype.add};const Pt={millisecond:e=>e.epoch,second:e=>[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second()].join("-"),minute:e=>[e.year(),e.month(),e.date(),e.hour(),e.minute()].join("-"),hour:e=>[e.year(),e.month(),e.date(),e.hour()].join("-"),day:e=>[e.year(),e.month(),e.date()].join("-"),week:e=>[e.year(),e.week()].join("-"),month:e=>[e.year(),e.month()].join("-"),quarter:e=>[e.year(),e.quarter()].join("-"),year:e=>e.year()};Pt.date=Pt.day;var St=e=>{e.prototype.isSame=function(t,a,n=!0){let r=this;if(!a)return null;if("string"==typeof t&&"object"==typeof a){let e=t;t=a,a=e}return"string"!=typeof t&&"number"!=typeof t||(t=new e(t,this.timezone.name)),a=a.replace(/s$/,""),!0===n&&r.tz!==t.tz&&((t=t.clone()).tz=r.tz),Pt[a]?Pt[a](r)===Pt[a](t):null}};var qt=e=>{const t={isAfter:function(e){e=g.beADate(e,this);let t=g.getEpoch(e);return null===t?null:this.epoch>t},isBefore:function(e){e=g.beADate(e,this);let t=g.getEpoch(e);return null===t?null:this.epoch<t},isEqual:function(e){e=g.beADate(e,this);let t=g.getEpoch(e);return null===t?null:this.epoch===t},isBetween:function(e,t,a=!1){e=g.beADate(e,this),t=g.beADate(t,this);let n=g.getEpoch(e);if(null===n)return null;let r=g.getEpoch(t);return null===r?null:a?this.isBetween(e,t)||this.isEqual(e)||this.isEqual(t):n<this.epoch&&this.epoch<r}};Object.keys(t).forEach(a=>{e.prototype[a]=t[a]})};var Tt=e=>{const t={i18n:e=>{g.isObject(e.days)&&ye.set(e.days),g.isObject(e.months)&&I(e.months),g.isBoolean(e.useTitleCase)&&ke(e.useTitleCase)}};Object.keys(t).forEach(a=>{e.prototype[a]=t[a]})};let Et=s;const Nt=function(e,t,n={}){this.epoch=null,this.tz=y(t,Et),this.silent=n.silent||!0,this.british=n.dmy||n.british,this._weekStart=1,void 0!==n.weekStart&&(this._weekStart=n.weekStart),this._today={},void 0!==n.today&&(this._today=n.today),Object.defineProperty(this,"d",{get:function(){let e=a(this),t=(new Date(this.epoch).getTimezoneOffset()||0)+60*e;t=60*t*1e3;let n=this.epoch+t;return new Date(n)}}),Object.defineProperty(this,"timezones",{get:()=>Et,set:e=>(Et=e,e)});let r=me(this,e);this.epoch=r.epoch};Object.keys(Je).forEach(e=>{Nt.prototype[e]=Je[e]}),Nt.prototype.clone=function(){return new Nt(this.epoch,this.tz,{silent:this.silent,weekStart:this._weekStart,today:this._today,parsers:this.parsers})},Nt.prototype.toLocalDate=function(){return new Date(this.epoch)},gt(Nt),Mt(Nt),St(Nt),qt(Nt),Tt(Nt);var Ct=Nt;var It=(e,t)=>{let a=new Ct(null),n=new Ct(null);a=a.time(e),n=t?n.time(t):a.add(59,"minutes");let r=a.hour(),o=n.hour();return Object.keys(a.timezones).filter(e=>{if(-1===e.indexOf("/"))return!1;let t=new Ct(null,e),i=t.hour();return i>=r&&i<=o&&(!(i===r&&t.minute()<a.minute())&&!(i===o&&t.minute()>n.minute()))})};const $t=(e,t,a)=>new Ct(e,t,a),At=function(e){let t=e._today||{};return Object.keys(t).forEach(a=>{e=e[a](t[a])}),e};return $t.now=(e,t)=>{let a=new Ct((new Date).getTime(),e,t);return a=At(a),a},$t.today=(e,t)=>{let a=new Ct((new Date).getTime(),e,t);return a=At(a),a.startOf("day")},$t.tomorrow=(e,t)=>{let a=new Ct((new Date).getTime(),e,t);return a=At(a),a.add(1,"day").startOf("day")},$t.yesterday=(e,t)=>{let a=new Ct((new Date).getTime(),e,t);return a=At(a),a.subtract(1,"day").startOf("day")},$t.extend=function(e={}){return Object.keys(e).forEach(t=>{Ct.prototype[t]=e[t]}),this},$t.timezones=function(){return(new Ct).timezones},$t.max=function(e,t){let a=new Ct(null,e,t);return a.epoch=864e13,a},$t.min=function(e,t){let a=new Ct(null,e,t);return a.epoch=-864e13,a},$t.whereIts=It,$t.version="6.16.1",$t.plugin=$t.extend,$t})); |
@@ -10,2 +10,7 @@ This project follows semVer, where: | ||
### v6.16.1 [April 2021] | ||
- **[new]** - add millisecond pad #283 | ||
- update deps | ||
### v6.16.0 [April 2021] | ||
@@ -12,0 +17,0 @@ |
{ | ||
"name": "spacetime", | ||
"version": "6.16.0", | ||
"version": "6.16.1", | ||
"description": "figure-out dates across timezones", | ||
@@ -46,7 +46,7 @@ "main": "builds/spacetime.js", | ||
"devDependencies": { | ||
"@babel/core": "7.13.15", | ||
"@babel/preset-env": "7.13.15", | ||
"codecov": "3.8.1", | ||
"@babel/core": "7.14.0", | ||
"@babel/preset-env": "7.14.1", | ||
"codecov": "3.8.2", | ||
"nyc": "^15.1.0", | ||
"rollup": "2.45.2", | ||
"rollup": "2.47.0", | ||
"rollup-plugin-babel": "4.4.0", | ||
@@ -53,0 +53,0 @@ "rollup-plugin-commonjs": "10.1.0", |
@@ -43,2 +43,3 @@ export type TimeUnit = | ||
| 'second-pad' | ||
| 'millisecond' | ||
| 'ampm' | ||
@@ -45,0 +46,0 @@ | 'quarter' |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
257221
4416