0
0
Fork 0
mirror of https://github.com/healthchecks/healthchecks.git synced 2025-04-07 06:05:34 +00:00
healthchecks_healthchecks/static/js/spacetime.min.js

1 line
42 KiB
JavaScript

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).spacetime=n()}(this,function(){"use strict";var e,n=function(e,n){return e(n={exports:{}},n.exports),n.exports}(function(e,n){n.isLeapYear=function(e){return e%4==0&&e%100!=0||e%400==0},n.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.valueOf())},n.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},n.isObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},n.zeroPad=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t="0";return(e+="").length>=n?e:new Array(n-e.length+1).join(t)+e},n.titleCase=function(e){return e?e[0].toUpperCase()+e.substr(1):""},n.ordinal=function(e){var n=e%10,t=e%100;return 1===n&&11!==t?e+"st":2===n&&12!==t?e+"nd":3===n&&13!==t?e+"rd":e+"th"},n.toCardinal=function(e){return e=(e=String(e)).replace(/([0-9])(st|nd|rd|th)$/i,"$1"),parseInt(e,10)},n.normalize=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"day"===(e=(e=(e=(e=e.toLowerCase().trim()).replace(/ies$/,"y")).replace(/s$/,"")).replace(/-/g,""))?"date":e},n.getEpoch=function(e){return"number"==typeof e?e:n.isDate(e)?e.getTime():e.epoch?e.epoch:null},n.beADate=function(e,t){return!1===n.isObject(e)?t.clone().set(e):e},n.formatTimezone=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=Math.abs(e),a=e>0?"+":"-";return"".concat(a).concat(n.zeroPad(r)).concat(t,"00")}}),t=(n.isLeapYear,n.isDate,n.isArray,n.isObject,n.zeroPad,n.titleCase,n.ordinal,n.toCardinal,n.normalize,n.getEpoch,n.beADate,n.formatTimezone,n.zeroPad),r=function(e,n,r,a){var o=new Date(e),i=(o.getTimezoneOffset()||0)+60*a;i=60*i*1e3;var u=function(e){return t(e.getMonth()+1)+"/"+t(e.getDate())+":"+t(e.getHours())}(o=new Date(e+i));return u>=n&&u<r},a=function(e){var n=e.timezones[e.tz];if(void 0===n)return console.warn("Warning: couldn't find timezone "+e.tz),0;if(void 0===n.dst)return n.offset;var t=n.offset,a=n.offset+1;"n"===n.hem&&(a=t-1);var o=n.dst.split("->");return!0===r(e.epoch,o[0],o[1],t)?t:a},o=["africa","america","asia","atlantic","australia","brazil","canada","chile","europe","indian","mexico","pacific","antarctica","etc"],i=(e=Object.freeze({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/07:03->10/06:02":"4/adelaide,4/broken_hill,4/south,4/yancowinna","9.5|s":"4/darwin,4/north","8|s":"12/casey,2/kuala_lumpur,2/makassar,2/singapore,4/perth,4/west","8|n|03/25:03->09/29:23":"2/ulan_bator","8|n":"2/brunei,2/choibalsan,2/chongqing,2/chungking,2/harbin,2/hong_kong,2/irkutsk,2/kuching,2/macao,2/macau,2/manila,2/shanghai,2/taipei,2/ujung_pandang,2/ulaanbaatar","8.75|s":"4/eucla","7|s":"12/davis,2/jakarta,9/christmas","7|n":"2/bangkok,2/barnaul,2/ho_chi_minh,2/hovd,2/krasnoyarsk,2/novokuznetsk,2/novosibirsk,2/phnom_penh,2/pontianak,2/saigon,2/tomsk,2/vientiane","6|s":"12/vostok","6|n":"2/almaty,2/bishkek,2/dacca,2/dhaka,2/kashgar,2/omsk,2/qyzylorda,2/thimbu,2/thimphu,2/urumqi,9/chagos","6.5|n":"2/rangoon,9/cocos","5|s":"12/mawson,9/kerguelen","5|n":"2/aqtau,2/aqtobe,2/ashgabat,2/ashkhabad,2/atyrau,2/baku,2/dushanbe,2/karachi,2/oral,2/samarkand,2/tashkent,2/yekaterinburg,9/maldives","5.75|n":"2/kathmandu,2/katmandu","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/31:03->10/27:04":"2/nicosia,8/athens,8/bucharest,8/helsinki,8/kiev,8/mariehamn,8/nicosia,8/riga,8/sofia,8/tallinn,8/uzhgorod,8/vilnius,8/zaporozhye","3|n|03/31:02->10/27:03":"8/chisinau,8/tiraspol","3|n|03/31:00->10/26:24":"2/beirut","3|n|03/29:02->10/27:02":"2/jerusalem,2/tel_aviv","3|n|03/29:00->10/25:01":"2/amman","3|n|03/29:00->10/24:24":"2/damascus","3|n|03/23:01->10/26:01":"2/gaza,2/hebron","3|n":"0/addis_ababa,0/asmara,0/asmera,0/dar_es_salaam,0/djibouti,0/juba,0/kampala,0/mogadishu,0/nairobi,2/aden,2/baghdad,2/bahrain,2/istanbul,2/kuwait,2/qatar,2/riyadh,8/istanbul,8/kirov,8/minsk,8/moscow,8/simferopol,9/comoro,9/mayotte","2|s|03/31:02->10/27:02":"12/troll","2|s":"0/gaborone,0/harare,0/johannesburg,0/lubumbashi,0/lusaka,0/maputo,0/maseru,0/mbabane","2|n|03/31:02->10/27:03":"0/ceuta,arctic/longyearbyen,3/jan_mayen,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","2|n":"0/blantyre,0/bujumbura,0/cairo,0/khartoum,0/kigali,0/tripoli,8/kaliningrad","1|s|04/02:01->09/03:03":"0/windhoek","1|s":"0/kinshasa,0/luanda","1|n|05/05:03->06/09:02":"0/casablanca,0/el_aaiun","1|n|03/31:01->10/27:02":"3/canary,3/faeroe,3/faroe,3/madeira,8/belfast,8/dublin,8/guernsey,8/isle_of_man,8/jersey,8/lisbon,8/london","1|n":"0/algiers,0/bangui,0/brazzaville,0/douala,0/lagos,0/libreville,0/malabo,0/ndjamena,0/niamey,0/porto-novo,0/tunis","14|n":"11/kiritimati","13|s|04/07:04->09/29:03":"11/apia","13|s|01/15:02->11/05:03":"11/tongatapu","13|n":"11/enderbury,11/fakaofo","12|s|04/07:03->09/29:02":"12/mcmurdo,12/south_pole,11/auckland","12|s|01/13:03->11/03: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/07:03->04/07:02":"11/chatham","11|s":"12/macquarie,11/bougainville","11|n":"2/magadan,2/sakhalin,11/efate,11/guadalcanal,11/kosrae,11/noumea,11/pohnpei,11/ponape","11.5|n":"11/norfolk","10|s|04/07:03->10/06:02":"4/act,4/canberra,4/currie,4/hobart,4/melbourne,4/nsw,4/sydney,4/tasmania,4/victoria","10|s":"12/dumontdurville,4/brisbane,4/lindeman,4/queensland","10|n":"2/ust-nera,2/vladivostok,2/yakutsk,11/chuuk,11/guam,11/port_moresby,11/saipan,11/truk,11/yap","10.5|s|04/07:01->10/06:02":"4/lhi,4/lord_howe","0|n|03/31:00->10/27: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,0/timbuktu,1/danmarkshavn,3/reykjavik,3/st_helena,13/gmt,13/gmt+0,13/gmt-0,13/gmt0,13/greenwich,13/utc,13/universal,13/zulu","-9|n|03/10:02->11/03:02":"1/adak,1/atka","-9|n":"11/gambier","-9.5|n":"11/marquesas","-8|n|03/10:02->11/03:02":"1/anchorage,1/juneau,1/metlakatla,1/nome,1/sitka,1/yakutat","-8|n":"11/pitcairn","-7|n|03/10:02->11/03:02":"1/dawson,1/ensenada,1/los_angeles,1/santa_isabel,1/tijuana,1/vancouver,1/whitehorse,6/pacific,6/yukon,10/bajanorte","-7|n":"1/creston,1/dawson_creek,1/hermosillo,1/phoenix","-6|s|04/06:22->09/07:22":"7/easterisland,11/easter","-6|n|04/07:02->10/27:02":"1/chihuahua,1/mazatlan,10/bajasur","-6|n|03/10:02->11/03:02":"1/boise,1/cambridge_bay,1/denver,1/edmonton,1/inuvik,1/ojinaga,1/shiprock,1/yellowknife,6/mountain","-6|n":"1/belize,1/costa_rica,1/el_salvador,1/guatemala,1/managua,1/regina,1/swift_current,1/tegucigalpa,6/east-saskatchewan,6/saskatchewan,11/galapagos","-5|s":"1/lima,1/rio_branco,5/acre","-5|n|04/07:02->10/27:02":"1/bahia_banderas,1/merida,1/mexico_city,1/monterrey,10/general","-5|n|03/12:03->11/05:01":"1/north_dakota","-5|n|03/10:02->11/03:02":"1/chicago,1/knox_in,1/matamoros,1/menominee,1/rainy_river,1/rankin_inlet,1/resolute,1/winnipeg,6/central","-5|n":"1/atikokan,1/bogota,1/cancun,1/cayman,1/coral_harbour,1/eirunepe,1/guayaquil,1/jamaica,1/panama,1/porto_acre","-4|s|05/13:23->08/13:01":"12/palmer","-4|s|04/06:24->09/08:00":"1/santiago,7/continental","-4|s|03/23:24->10/06: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/12:03->11/05:01":"1/indiana,1/kentucky","-4|n|03/10:02->11/03:02":"1/detroit,1/fort_wayne,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,6/eastern","-4|n|03/10:00->11/03:01":"1/havana","-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|02/16:24->11/03:00":"1/sao_paulo,5/east","-3|s":"1/argentina,1/buenos_aires,1/cordoba,1/fortaleza,1/montevideo,1/punta_arenas,12/rothera,3/stanley","-3|n|03/10:02->11/03: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/catamarca,1/cayenne,1/jujuy,1/maceio,1/mendoza,1/paramaribo,1/recife,1/rosario,1/santarem","-2|s":"5/denoronha","-2|n|03/30:22->10/26:23":"1/godthab","-2|n|03/10:02->11/03:02":"1/miquelon","-2|n":"1/noronha,3/south_georgia","-2.5|n|03/10:02->11/03:02":"1/st_johns,6/newfoundland","-1|n":"3/cape_verde","-11|n":"11/midway,11/niue,11/pago_pago,11/samoa","-10|n":"11/honolulu,11/johnston,11/rarotonga,11/tahiti"}}))&&e.default||e,u={};Object.keys(i).forEach(function(e){var n=e.split("|"),t={offset:Number(n[0]),hem:n[1]};n[2]&&(t.dst=n[2]),i[e].split(",").forEach(function(e){e=e.replace(/(^[0-9]+)\//,function(e,n){return n=Number(n),o[n]+"/"}),u[e]=t})}),u.utc={offset:0,hem:"n"};for(var s=-13;s<=13;s+=.5){var c=s;c>0&&(c="+"+c);var h="etc/gmt"+c;u[h]={offset:-1*s,hem:"n"},u[h="utc/gmt"+c]={offset:-1*s,hem:"n"}}var f=u,d=/(\-?[0-9]+)h(rs)?/i,m=/(\-?[0-9]+)/,l=/utc([\-+]?[0-9]+)/i,p=/gmt([\-+]?[0-9]+)/i,y=function(e){return(e=Number(e))>-13&&e<13?"etc/gmt"+(e=((e*=-1)>0?"+":"")+e):null},v=function(e){var n=e.match(d);if(null!==n)return y(n[1]);if(null!==(n=e.match(l)))return y(n[1]);if(null!==(n=e.match(p))){var t=-1*Number(n[1]);return y(t)}return null!==(n=e.match(m))?y(n[1]):null},g=function(){var e=function(){if("undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;var e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;var n=e.resolvedOptions().timeZone;return n?n.toLowerCase():null}();return null===e?"utc":e}(),b=Object.keys(f).reduce(function(e,n){var t=n.split("/")[1]||"";return e[t=t.replace(/_/g," ")]=n,e},{}),k=function(e,n){if(!e)return g;var t=e.trim(),r=e.split("/");if(r.length>2&&!1===n.hasOwnProperty(t)&&(t=r[0]+"/"+r[1]),t=t.toLowerCase(),!0===n.hasOwnProperty(t))return t;if(t=function(e){return 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")}(t),!0===n.hasOwnProperty(t))return t;if(!0===b.hasOwnProperty(t))return b[t];if(!0===/[0-9]/.test(t)){var a=v(t);if(a)return a}throw new Error("Spacetime: Cannot find timezone named: '"+e+"'. Please enter an IANA timezone id.")},w={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5};w.date=w.day,w.month=25488e5,w.week=6048e5,w.year=3154e7,Object.keys(w).forEach(function(e){w[e+"s"]=w[e]});var z=w,j=function(e,n,t,r,a){var o=e.d[t]();if(o!==n){var i=null===a?null:e.d[a](),u=e.epoch,s=n-o;e.epoch+=z[r]*s,"day"===r&&Math.abs(s)>28&&n<28&&(e.epoch+=z.hour);for(var c=z[r]/2;e.d[t]()<n;)e.epoch+=c;for(;e.d[t]()>n;)e.epoch-=c;null!==a&&i!==e.d[a]()&&(e.epoch=u,e.epoch+=z[r]*s*.97)}},O={year:{valid:function(e){return e>-4e3&&e<4e3},walkTo:function(e,n){return j(e,n,"getFullYear","year",null)}},month:{valid:function(e){return e>=0&&e<=11},walkTo:function(e,n){var t=e.d,r=t.getMonth(),a=e.epoch,o=t.getYear();if(r!==n){var i=n-r;for(e.epoch+=z.day*(28*i),o!==e.d.getYear()&&(e.epoch=a);e.d.getMonth()<n;)e.epoch+=z.day;for(;e.d.getMonth()>n;)e.epoch-=z.day}}},date:{valid:function(e){return e>0&&e<=31},walkTo:function(e,n){return j(e,n,"getDate","day","getMonth")}},hour:{valid:function(e){return e>=0&&e<24},walkTo:function(e,n){return j(e,n,"getHours","hour","getDate")}},minute:{valid:function(e){return e>=0&&e<60},walkTo:function(e,n){return j(e,n,"getMinutes","minute","getHours")}},second:{valid:function(e){return e>=0&&e<60},walkTo:function(e,n){e.epoch=e.seconds(n).epoch}},millisecond:{valid:function(e){return e>=0&&e<1e3},walkTo:function(e,n){e.epoch=e.milliseconds(n).epoch}}},_=function(e,n){for(var t=Object.keys(O),r=e.clone(),a=0;a<t.length;a++){var o=t[a],i=n[o];if(void 0===i&&(i=r[o]()),"string"==typeof i&&(i=parseInt(i,10)),!O[o].valid(i))return e.epoch=null,void(!1===e.silent&&console.warn("invalid "+o+": "+i));O[o].walkTo(e,i)}},D=["jan","feb","mar","apr","may","jun","jul","aug","sept","oct","nov","dec"],P=["january","february","march","april","may","june","july","august","september","october","november","december"];var M=function(){return D},q=function(){return P},S=function(){return function(){for(var e={sep:8},n=0;n<D.length;n++)e[D[n]]=n;for(var t=0;t<P.length;t++)e[P[t]]=t;return e}()},C=function(e){D=e.short||D,P=e.long||P},E=function(e,n){if(!n)return e;"Z"===n&&(n="+0000");var t=0;/^[\+-]?[0-9]{2}:[0-9]{2}$/.test(n)&&(!0===/:00/.test(n)&&(n=n.replace(/:00/,"")),!0===/:30/.test(n)&&(n=n.replace(/:30/,".5"))),/^[\+-]?[0-9]{4}$/.test(n)&&(n=n.replace(/30$/,".5")),t=parseFloat(n),Math.abs(t)>100&&(t/=100),(t*=-1)>=0&&(t="+"+t);var r="etc/gmt"+t;return e.timezones[r]&&(e.tz=r),e},T=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=(n=n.replace(/^\s+/,"").toLowerCase()).match(/([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?[:\.]?([0-9]{1,4})?/);if(null!==t){var r=Number(t[1]);if(r<0||r>24)return e.startOf("day");var a=Number(t[2]);if(t[2].length<2||a<0||a>59)return e.startOf("day");e=(e=(e=(e=e.hour(r)).minute(a)).seconds(t[3]||0)).millisecond(t[4]||0);var o=n.match(/[\b0-9](am|pm)\b/);return null!==o&&o[1]&&(e=e.ampm(o[1])),e}if(null!==(t=n.match(/([0-9]+) ?(am|pm)/))&&t[1]){var i=Number(t[1]);return i>12||i<1?e.startOf("day"):e=(e=(e=e.hour(t[1]||0)).ampm(t[2])).startOf("hour")}return e=e.startOf("day")},I=[31,28,31,30,31,30,31,31,30,31,30,31],A=n.isLeapYear,x=function(e){if(!0!==I.hasOwnProperty(e.month))return!1;if(1===e.month)return!!(A(e.year)&&e.date<=29)||e.date<=28;var n=I[e.month]||0;return e.date<=n},Y=S(),N=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=parseInt(e.trim(),10);return n=n||(new Date).getFullYear()},$=[{reg:/^(\-?0?0?[0-9]{3,4})-([0-9]{1,2})-([0-9]{1,2})[T| ]([0-9.:]+)(Z|[0-9\-\+:]+)?$/,parse:function(e,n,t,r){var a=parseInt(n[2],10)-1,o={year:n[1],month:a,date:n[3]};return!1===x(o)?(e.epoch=null,e):(E(e,n[5]),_(e,o),e=T(e,n[4]))}},{reg:/^([0-9]{4})[\-\/]([0-9]{1,2})[\-\/]([0-9]{1,2})$/,parse:function(e,n){var t={year:n[1],month:parseInt(n[2],10)-1,date:parseInt(n[3],10)};return t.month>=12&&(t.date=parseInt(n[2],10),t.month=parseInt(n[3],10)-1),!1===x(t)?(e.epoch=null,e):(_(e,t),e=T(e))}},{reg:/^([0-9]{1,2})[\-\/]([0-9]{1,2})[\-\/]?([0-9]{4})?$/,parse:function(e,n){var t=parseInt(n[1],10)-1,r=parseInt(n[2],10);t>=12&&(t=parseInt(n[2],10)-1,r=parseInt(n[1],10));var a={year:n[3]||(new Date).getFullYear(),month:t,date:r};return!1===x(a)?(e.epoch=null,e):(_(e,a),e=T(e))}},{reg:/^([a-z]+) ([0-9]{1,2}(?:st|nd|rd|th)?),?( [0-9]{4})?( ([0-9:]+( ?am| ?pm)?))?$/i,parse:function(e,t){var r=Y[t[1].toLowerCase()],a={year:N(t[3]),month:r,date:n.toCardinal(t[2]||"")};return!1===x(a)?(e.epoch=null,e):(_(e,a),e=T(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{4})$/i,parse:function(e,n){var t=Y[n[1].toLowerCase()],r={year:N(n[2]),month:t,date:1};return!1===x(r)?(e.epoch=null,e):(_(e,r),e=T(e,n[4]))}},{reg:/^([0-9]{1,2}(?:st|nd|rd|th)?) ([a-z]+),?( [0-9]{4})?$/i,parse:function(e,t){var r=Y[t[2].toLowerCase()],a={year:N(t[3]),month:r,date:n.toCardinal(t[1])};return!1===x(a)?(e.epoch=null,e):(_(e,a),e=T(e))}},{reg:/^[0-9]{4}$/i,parse:function(e,n){var t=N(n[0]),r=new Date,a={year:t,month:r.getMonth(),date:r.getDate()};return!1===x(a)?(e.epoch=null,e):(_(e,a),e=T(e))}},{reg:/^[0-9,]+ ?b\.?c\.?$/i,parse:function(e,n){var t=n[0]||"";t=(t=t.replace(/^([0-9,]+) ?b\.?c\.?$/i,"-$1")).replace(/,/g,"");var r=parseInt(t.trim(),10),a=new Date,o={year:r,month:a.getMonth(),date:a.getDate()};return!1===x(o)?(e.epoch=null,e):(_(e,o),e=T(e))}}],L={now:function(e){return e.epoch=Date.now(),e},tonight:function(e){return e.epoch=Date.now(),e=e.hour(18)},today:function(e){return e.epoch=Date.now(),e},tomorrow:function(e){return e.epoch=Date.now(),e=(e=e.add(1,"day")).startOf("day")},yesterday:function(e){return e.epoch=Date.now(),e=(e=e.subtract(1,"day")).startOf("day")},christmas:function(e){var n=(new Date).getFullYear();return e=e.set([n,11,25,18,0,0])},"new years":function(e){var n=(new Date).getFullYear();return e=e.set([n,11,31,18,0,0])}};L["new years eve"]=L["new years"];var F=L,Z={year:(new Date).getFullYear(),month:0,date:1},H=function(e,t,r){if("number"==typeof 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;if(e.epoch=Date.now(),null==t)return e;if(!0===n.isDate(t))return e.epoch=t.getTime(),e;if(!0===n.isArray(t))return e=function(e,n){for(var t=["year","month","date","hour","minute","second","millisecond"],r=0;r<t.length;r++){var a=n[r]||Z[t[r]]||0;e=e[t[r]](a)}return e}(e,t);if(!0===n.isObject(t))return t.epoch?(e.epoch=t.epoch,e.tz=t.tz,e):e=function(e,n){n=Object.assign({},Z,n);for(var t=Object.keys(n),r=0;r<t.length;r++){var a=t[r];if(void 0!==e[a]&&"function"==typeof e[a]&&(null!==n[a]&&void 0!==n[a]&&""!==n[a])){var o=n[a]||Z[a]||0;e=e[a](o)}}return e}(e,t);if("string"!=typeof t)return e;if(t=(t=(t=t.replace(/\b(mon|tues|wed|wednes|thu|thurs|fri|sat|satur|sun)(day)?\b/i,"")).replace(/,/g,"")).replace(/ +/g," ").trim(),!0===F.hasOwnProperty(t))return e=F[t](e);for(var a=0;a<$.length;a++){var o=t.match($[a].reg);if(o)return e=$[a].parse(e,o,r)}return!1===e.silent&&console.warn("Warning: couldn't parse date-string: '"+t+"'"),e.epoch=null,e},Q=["sun","mon","tue","wed","thu","fri","sat"],B=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],G=function(){return Q},U=function(){return B},W=function(e){Q=e.short||Q,B=e.long||B},V=function(e){var t=e.timezone().current.offset,r=t<0,a="00";return.5===Math.abs(t%1)&&(a="30",t=t>=0?Math.floor(t):Math.ceil(t)),r?(t*=-1,t="-"+(t=n.zeroPad(t,2))):t="+"+(t=n.zeroPad(t,2)),"+00:00"===(t=t+":"+a)&&(t="Z"),t},J={day:function(e){return n.titleCase(e.dayName())},"day-short":function(e){return n.titleCase(G()[e.day()])},"day-number":function(e){return e.day()},"day-ordinal":function(e){return n.ordinal(e.day())},"day-pad":function(e){return n.zeroPad(e.day())},date:function(e){return e.date()},"date-ordinal":function(e){return n.ordinal(e.date())},"date-pad":function(e){return n.zeroPad(e.date())},month:function(e){return n.titleCase(e.monthName())},"month-short":function(e){return n.titleCase(M()[e.month()])},"month-number":function(e){return e.month()},"month-ordinal":function(e){return n.ordinal(e.month())},"month-pad":function(e){return n.zeroPad(e.month())},"iso-month":function(e){return n.zeroPad(e.month()+1)},year:function(e){var n=e.year();return n>0?n:(n=Math.abs(n),n+" BC")},"year-short":function(e){var n=e.year();return n>0?"'".concat(String(e.year()).substr(2,4)):(n=Math.abs(n))+" BC"},"iso-year":function(e){var t=e.year(),r=t<0,a=n.zeroPad(Math.abs(t),4);return r&&(a="-"+(a=n.zeroPad(a,6))),a},time:function(e){return e.time()},"time-24":function(e){return"".concat(e.hour24(),":").concat(n.zeroPad(e.minute()))},hour:function(e){return e.hour12()},"hour-pad":function(e){return n.zeroPad(e.hour12())},"hour-24":function(e){return e.hour24()},"hour-24-pad":function(e){return n.zeroPad(e.hour24())},minute:function(e){return e.minute()},"minute-pad":function(e){return n.zeroPad(e.minute())},second:function(e){return e.second()},"second-pad":function(e){return n.zeroPad(e.second())},ampm:function(e){return e.ampm()},quarter:function(e){return"Q"+e.quarter()},season:function(e){return e.season()},era:function(e){return e.era()},timezone:function(e){return e.timezone().name},offset:function(e){return V(e)},numeric:function(e){return"".concat(e.year(),"/").concat(n.zeroPad(e.month()+1),"/").concat(n.zeroPad(e.date()))},"numeric-us":function(e){return"".concat(n.zeroPad(e.month()+1),"/").concat(n.zeroPad(e.date()),"/").concat(e.year())},"numeric-uk":function(e){return"".concat(n.zeroPad(e.date()),"/").concat(n.zeroPad(e.month()+1),"/").concat(e.year())},"mm/dd":function(e){return"".concat(n.zeroPad(e.month()+1),"/").concat(n.zeroPad(e.date()))},iso:function(e){var t=e.format("iso-year"),r=n.zeroPad(e.month()+1),a=n.zeroPad(e.date()),o=n.zeroPad(e.h24()),i=n.zeroPad(e.minute()),u=n.zeroPad(e.second()),s=n.zeroPad(e.millisecond(),3),c=V(e);return"".concat(t,"-").concat(r,"-").concat(a,"T").concat(o,":").concat(i,":").concat(u,".").concat(s).concat(c)},"iso-short":function(e){var t=n.zeroPad(e.month()+1),r=n.zeroPad(e.date());return"".concat(e.year(),"-").concat(t,"-").concat(r)},"iso-utc":function(e){return new Date(e.epoch).toISOString()},nice:function(e){return"".concat(M()[e.month()]," ").concat(n.ordinal(e.date()),", ").concat(e.time())},"nice-year":function(e){return"".concat(M()[e.month()]," ").concat(n.ordinal(e.date()),", ").concat(e.year())},"nice-day":function(e){return"".concat(G()[e.day()]," ").concat(n.titleCase(M()[e.month()])," ").concat(n.ordinal(e.date()))},"nice-full":function(e){return"".concat(e.dayName()," ").concat(n.titleCase(e.monthName())," ").concat(n.ordinal(e.date()),", ").concat(e.time())}},K={"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",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(K).forEach(function(e){return J[e]=J[K[e]]});var R=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!0!==e.isValid())return"";if(J.hasOwnProperty(t)){var r=String(J[t](e)||"");return"ampm"!==t&&(r=n.titleCase(r)),r}if(-1!==t.indexOf("{")){var a=/\{(.+?)\}/g;return t=t.replace(a,function(n,t){return t=t.toLowerCase().trim(),J.hasOwnProperty(t)?String(J[t](e)||""):""})}return e.format("iso-short")},X=n.zeroPad,ee=n.formatTimezone,ne={G:function(e){return e.era()},GG:function(e){return e.era()},GGG:function(e){return e.era()},GGGG:function(e){return"AD"===e.era()?"Anno Domini":"Before Christ"},y:function(e){return e.year()},yy:function(e){return parseInt(String(e.year()).substr(2,4),10)},yyy:function(e){return e.year()},yyyy:function(e){return e.year()},yyyyy:function(e){return"0"+e.year()},Q:function(e){return e.quarter()},QQ:function(e){return e.quarter()},QQQ:function(e){return e.quarter()},QQQQ:function(e){return e.quarter()},M:function(e){return e.month()+1},MM:function(e){return X(e.month()+1)},MMM:function(e){return e.format("month-short")},MMMM:function(e){return e.format("month")},w:function(e){return e.week()},ww:function(e){return X(e.week())},d:function(e){return e.date()},dd:function(e){return X(e.date())},D:function(e){return e.dayOfYear()},DD:function(e){return X(e.dayOfYear())},DDD:function(e){return X(e.dayOfYear(),3)},E:function(e){return e.format("day-short")},EE:function(e){return e.format("day-short")},EEE:function(e){return e.format("day-short")},EEEE:function(e){return e.format("day")},EEEEE:function(e){return e.format("day")[0]},e:function(e){return e.day()},ee:function(e){return e.day()},eee:function(e){return e.format("day-short")},eeee:function(e){return e.format("day")},eeeee:function(e){return e.format("day")[0]},a:function(e){return e.ampm().toUpperCase()},aa:function(e){return e.ampm().toUpperCase()},aaa:function(e){return e.ampm().toUpperCase()},aaaa:function(e){return e.ampm().toUpperCase()},h:function(e){return e.h12()},hh:function(e){return X(e.h12())},H:function(e){return e.hour()},HH:function(e){return X(e.hour())},m:function(e){return e.minute()},mm:function(e){return X(e.minute())},s:function(e){return e.second()},ss:function(e){return X(e.second())},A:function(e){return e.epoch-e.startOf("day").epoch},z:function(e){return e.timezone().name},zz:function(e){return e.timezone().name},zzz:function(e){return e.timezone().name},zzzz:function(e){return e.timezone().name},Z:function(e){return ee(e.timezone().current.offset)},ZZ:function(e){return ee(e.timezone().current.offset)},ZZZ:function(e){return ee(e.timezone().current.offset)},ZZZZ:function(e){return ee(e.timezone().current.offset,":")}},te=function(e,n,t){for(var r=e,a=n,o=0;o<t;o+=1)ne[r]=ne[a],r+=e,a+=n};te("q","Q",4),te("L","M",4),te("Y","y",4),te("c","e",4),te("k","H",2),te("K","h",2),te("S","s",2),te("v","z",4),te("V","Z",4);var re=function(e,n){for(var t=n.split(""),r=[t[0]],a=!1,o=1;o<t.length;o+=1){if("'"===t[o]){if(!0!==(a=!a)||!t[o+1]||"'"!==t[o+1])continue;a=!0}!0===a||t[o]===r[r.length-1][0]?r[r.length-1]+=t[o]:r.push(t[o])}return r.reduce(function(n,t){return void 0!==ne[t]?n+=ne[t](e)||"":n+=t,n},"")},ae=["year","season","quarter","month","week","day","quarterHour","hour","minute"],oe=function(e,n){var t=e.clone().startOf(n),r=e.clone().endOf(n).epoch-t.epoch,a=(e.epoch-t.epoch)/r;return parseFloat(a.toFixed(2))},ie=function(e,t){if(t)return t=n.normalize(t),oe(e,t);var r={};return ae.forEach(function(n){r[n]=oe(e,n)}),r},ue=function(e,t){var r=e.progress();return"quarterhour"===(t=n.normalize(t))&&(t="quarterHour"),void 0!==r[t]?(r[t]>.5&&(e=e.add(1,t)),e=e.startOf(t)):!1===e.silent&&console.warn("no known unit '"+t+"'"),e},se=function(e,n,t){var r=0;for(e=e.clone();e.isBefore(n);)e=e.add(1,t),r+=1;return e.isAfter(n,t)&&(r-=1),r},ce=function(e,n,t){return e.isBefore(n)?se(e,n,t):-1*se(n,e,t)},he=function(e,n){var t=n.epoch-e.epoch,r={milliseconds:t,seconds:parseInt(t/1e3,10)};r.minutes=parseInt(r.seconds/60,10),r.hours=parseInt(r.minutes/60,10);var a=e.clone();return r.years=function(e,n){var t=n.year()-e.year();return(e=e.year(n.year())).isAfter(n)&&(t-=1),t}(a,n),a=e.add(r.years,"year"),r.months=12*r.years,a=e.add(r.months,"month"),r.months+=ce(a,n,"month"),r.weeks=52*r.years,a=e.add(r.weeks,"week"),r.weeks+=ce(a,n,"week"),r.days=7*r.weeks,a=e.add(r.days,"day"),r.days+=ce(a,n,"day"),r},fe=function(e,t,r){t=n.beADate(t,e);var a=!1;if(e.isAfter(t)){var o=e;e=t,t=o,a=!0}var i=he(e,t);return a&&(i=function(e){return Object.keys(e).forEach(function(n){e[n]*=-1}),e}(i)),r?(r=n.normalize(r),!0!==/s$/.test(r)&&(r+="s"),"dates"===r&&(r="days"),i[r]):i},de={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 me(e,n){return 1===e&&(n=n.slice(0,-1)),e+" "+n}var le=function(e,t){var r,a,o,i=function(e,n){var t=e.isBefore(n),r=t?n:e,a=t?e:n;a=a.clone();var o={years:0,months:0,days:0,hours:0,minutes:0,seconds:0};return Object.keys(o).forEach(function(e){if(!a.isSame(r,e)){var n=a.diff(r,e);a=a.add(n,e),o[e]=n}}),t&&Object.keys(o).forEach(function(e){0!==o[e]&&(o[e]*=-1)}),o}(e,t=n.beADate(t,e));if(!0===Object.keys(i).every(function(e){return!i[e]}))return{diff:i,rounded:"now",qualified:"now",precise:"now"};var u=[];return Object.keys(i).forEach(function(e,n,t){var o=Math.abs(i[e]);if(0!==o){var s=me(o,e);if(u.push(s),!r){if(r=a=s,n>4)return;var c=t[n+1],h=Math.abs(i[c]);h>de[c].almost?(r=me(o+1,e),a="almost "+r):h>de[c].over&&(a="over "+s)}}}),o=u.splice(0,2).join(", "),!0===e.isAfter(t)?(r+=" ago",a+=" ago",o+=" ago"):(r="in "+r,a="in "+a,o="in "+o),{diff:i,rounded:r,qualified:a,precise:o}},pe={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]]},ye=[null,[0,1],[3,1],[6,1],[9,1]],ve={minute:function(e){return _(e,{second:0,millisecond:0}),e},quarterhour:function(e){var n=e.minutes();return e=n>=45?e.minutes(45):n>=30?e.minutes(30):n>=15?e.minutes(15):e.minutes(0),_(e,{second:0,millisecond:0}),e},hour:function(e){return _(e,{minute:0,second:0,millisecond:0}),e},day:function(e){return _(e,{hour:0,minute:0,second:0,millisecond:0}),e},week:function(e){var n=e.clone();return(e=e.day(e._weekStart)).isAfter(n)&&(e=e.subtract(1,"week")),_(e,{hour:0,minute:0,second:0,millisecond:0}),e},month:function(e){return _(e,{date:1,hour:0,minute:0,second:0,millisecond:0}),e},quarter:function(e){var n=e.quarter();return ye[n]&&_(e,{month:ye[n][0],date:ye[n][1],hour:0,minute:0,second:0,millisecond:0}),e},season:function(e){var n=e.season(),t="north";"South"===e.hemisphere()&&(t="south");for(var r=0;r<pe[t].length;r++)if(pe[t][r][0]===n){var a=e.year();return"winter"===n&&e.month()<3&&(a-=1),_(e,{year:a,month:pe[t][r][1],date:pe[t][r][2],hour:0,minute:0,second:0,millisecond:0}),e}return e},year:function(e){return _(e,{month:0,date:1,hour:0,minute:0,second:0,millisecond:0}),e},decade:function(e){var n=(e=e.startOf("year")).year(),t=10*parseInt(n/10,10);return e=e.year(t)},century:function(e){var n=(e=e.startOf("year")).year(),t=100*parseInt(n/100,10);return e=e.year(t)}};ve.date=ve.day;var ge=function(e,t){var r=e.clone();return t=n.normalize(t),ve[t]?ve[t](r):"summer"===t||"winter"===t?(r=r.season(t),ve.season(r)):r},be=function(e,t){var r=e.clone();return t=n.normalize(t),ve[t]?r=(r=(r=ve[t](r)).add(1,t)).subtract(1,"milliseconds"):r},ke=function(e){return!!G().find(function(n){return n===e})||!!U().find(function(n){return n===e})},we=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;if(!t||!r)return[];if(t=n.normalize(t),r=e.clone().set(r),e.isAfter(r)){var a=e;e=r,r=a}var o=e.clone();ke(t)?(o=o.next(t),t="week"):o=o.next(t);for(var i=[];o.isBefore(r);)i.push(o),o=o.add(1,t);return i},ze=function(e){var n=e.timezones,t=e.tz;if(!1===n.hasOwnProperty(t)&&(t=k(e.tz,n)),null===t)return!1===e.silent&&console.warn("Warn: could not find given or local timezone - '"+e.tz+"'"),{current:{epochShift:0}};var a,o,i=n[t],u={name:(a=t,a=(a=(a=a[0].toUpperCase()+a.substr(1)).replace(/\/gmt/,"/GMT")).replace(/[\/_]([a-z])/gi,function(e){return e.toUpperCase()})),hasDst:Boolean(i.dst),default_offset:i.offset,hemisphere:"s"===i.hem?"South":"North",current:{}};if(u.hasDst){var s=(o=i.dst)?o.split("->"):[];u.change={start:s[0],back:s[1]}}var c=i.offset,h=c;return!0===u.hasDst&&(h="North"===u.hemisphere?c-1:i.offset+1),!1===u.hasDst?(u.current.offset=c,u.current.isDST=!1):!0===r(e.epoch,u.change.start,u.change.back,c)?(u.current.offset=c,u.current.isDST="North"===u.hemisphere):(u.current.offset=h,u.current.isDST="South"===u.hemisphere),u},je={set:function(e,n){var t=this.clone();return t=H(t,e),n&&(this.tz=k(n)),t},timezone:function(){return ze(this)},isDST:function(){return ze(this).current.isDST},hasDST:function(){return ze(this).hasDst},offset:function(){return 60*ze(this).current.offset},hemisphere:function(){return ze(this).hemisphere},format:function(e){return R(this,e)},unixFmt:function(e){return re(this,e)},startOf:function(e){return ge(this,e)},endOf:function(e){return be(this,e)},leapYear:function(){var e=this.year();return n.isLeapYear(e)},progress:function(e){return ie(this,e)},nearest:function(e){return ue(this,e)},diff:function(e,n){return fe(this,e,n)},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){var n=this.clone();return n.tz=k(e,n.timezones),n},every:function(e,n){return we(this,e,n)},isAwake:function(){var e=this.hour();return!(e<8||e>22)},isAsleep:function(){return!this.isAwake()},log:function(){return console.log(""),console.log(R(this,"nice-short")),this},logYear:function(){return console.log(""),console.log(R(this,"full-short")),this},debug:function(){var e=this.timezone(),n=this.format("MM")+" "+this.format("date-ordinal")+" "+this.year();return n+="\n - "+this.format("time"),console.log("\n\n",n+"\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();var n=G().indexOf(e);-1===n&&(n=U().indexOf(e)),-1===n&&(n=1),this._weekStart=n}else console.warn("Spacetime Error: Cannot understand .weekStart() input:",e);return this}};je.inDST=je.isDST,je.round=je.nearest,je.each=je.every;var Oe=je,_e=function(e){return"string"==typeof e&&(e=parseInt(e,10)),e},De=["year","month","date","hour","minute","second","millisecond"],Pe=function(e,n,t){for(var r=De.indexOf(t),a=De.slice(r,De.length),o=0;o<a.length;o++){var i=n[a[o]]();e[a[o]](i)}return e},Me=function(e,n){n=_e(n);var t=e.millisecond()-n;return e.epoch-t},qe=function(e,n){n=_e(n);var t=(e.second()-n)*z.second;return e.epoch-t},Se=function(e,n){n=_e(n);var t=e.clone(),r=(e.minute()-n)*z.minute;return e.epoch-=r,Pe(e,t,"second"),e.epoch},Ce=function(e,n){(n=_e(n))>=24?n=24:n<0&&(n=0);var t=e.clone(),r=(e.hour()-n)*z.hour;return e.epoch-=r,_(e,{hour:n}),Pe(e,t,"minute"),e.epoch},Ee=function(e,n){var t=n.match(/([0-9]{1,2}):([0-9]{1,2})(am|pm)?/);if(!t){if(!(t=n.match(/([0-9]{1,2})(am|pm)/)))return e.epoch;t.splice(2,0,"0")}var r=!1,a=parseInt(t[1],10),o=parseInt(t[2],10);return a>12&&(r=!0),!1===r&&("am"===t[3]&&12===a&&(a=0),"pm"===t[3]&&a<12&&(a+=12)),(e=(e=(e=(e=e.hour(a)).minute(o)).second(0)).millisecond(0)).epoch},Te=function(e,n){if((n=_e(n))>28){var t=I[e.month()];n>t&&(n=t)}return n<=0&&(n=1),_(e,{date:n}),e.epoch},Ie=function(e,n){"string"==typeof n&&(n=S()[n.toLowerCase()]),(n=_e(n))>=12&&(n=11),n<=0&&(n=0);var t=e.date();return t>I[n]&&(t=I[n]),_(e,{month:n,date:t}),e.epoch},Ae=function(e,n){return n=_e(n),_(e,{year:n}),e.epoch},xe=function(e,n){n=_e(n);var t=e.clone();return(n-=1)<=0?n=0:n>=365&&(n=364),e=(e=e.startOf("year")).add(n,"day"),Pe(e,t,"hour"),e.epoch},Ye={millisecond:function(e){if(void 0!==e){var n=this.clone();return n.epoch=Me(n,e),n}return this.d.getMilliseconds()},second:function(e){if(void 0!==e){var n=this.clone();return n.epoch=qe(n,e),n}return this.d.getSeconds()},minute:function(e){if(void 0!==e){var n=this.clone();return n.epoch=Se(n,e),n}return this.d.getMinutes()},hour:function(e){var n=this.d;if(void 0!==e){var t=this.clone();return t.epoch=Ce(t,e),t}return n.getHours()},hourFloat:function(e){if(void 0!==e){var n=this.clone(),t=e%1;t*=60;var r=parseInt(e,10);return n.epoch=Ce(n,r),n.epoch=Se(n,t),n}var a=this.d,o=a.getHours(),i=a.getMinutes();return o+(i/=60)},hour12:function(e){var n=this.d;if(void 0!==e){var t=this.clone(),r=(e=""+e).match(/^([0-9]+)(am|pm)$/);if(r){var a=parseInt(r[1],10);"pm"===r[2]&&(a+=12),t.epoch=Ce(t,a)}return t}var o=n.getHours();return o>12&&(o-=12),0===o&&(o=12),o},time:function(e){if(void 0!==e){var t=this.clone();return t.epoch=Ee(t,e),t}return"".concat(this.h12(),":").concat(n.zeroPad(this.minute())).concat(this.ampm())},ampm:function(e){var n="am",t=this.hour();if(t>=12&&(n="pm"),"string"!=typeof e)return n;var r=this.clone();return e=e.toLowerCase().trim(),t>=12&&"am"===e?(t-=12,r.hour(t)):t<12&&"pm"===e?(t+=12,r.hour(t)):r},dayTime:function(e){if(void 0!==e){var n={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"},t=this.clone();return e=(e=e||"").toLowerCase(),!0===n.hasOwnProperty(e)&&(t=t.time(n[e])),t}var r=this.hour();return r<6?"night":r<12?"morning":r<17?"afternoon":r<22?"evening":"night"},iso:function(e){return void 0!==e?this.set(e):this.format("iso")}},Ne={date:function(e){if(void 0!==e){var n=this.clone();return n.epoch=Te(n,e),n}return this.d.getDate()},day:function(e){if(void 0===e)return this.d.getDay();var n=this.clone(),t=e;"string"==typeof e&&(e=e.toLowerCase(),-1===(t=G().indexOf(e))&&(t=U().indexOf(e)));var r=this.d.getDay(),a=r-t,o=this.subtract(24*a,"hours");return _(o,{hour:n.hour(),minute:n.minute(),second:n.second()}),o},dayName:function(e){if(void 0===e)return U()[this.day()];var n=this.clone();return n=n.day(e)},month:function(e){if(void 0!==e){var n=this.clone();return n.epoch=Ie(n,e),n}return this.d.getMonth()}},$e=function(e){return e=(e=(e=e.minute(0)).second(0)).millisecond(1)},Le={dayOfYear:function(e){if(void 0!==e){var n=this.clone();return n.epoch=xe(n,e),n}for(var t,r=0,a=this.d.getMonth(),o=1;o<=a;o++)(t=new Date).setDate(1),t.setYear(this.d.getFullYear()),t.setHours(1),t.setMinutes(1),t.setMonth(o),t.setHours(-2),r+=t.getDate();return r+this.d.getDate()},week:function(e){if(void 0!==e){var n=this.clone();return n=(n=(n=n.month(0)).date(1)).day("monday"),"december"===(n=$e(n)).monthName()&&(n=n.add(1,"week")),e-=1,n=n.add(e,"weeks")}var t=this.clone();t=(t=t.month(0)).date(1),"december"===(t=(t=$e(t)).day("monday")).monthName()&&(t=t.add(1,"week"));var r=this.epoch;if(t.epoch>r)return 1;var a=0,o=4*this.month();for(t.epoch+=z.week*o,a+=o;a<52;a++){if(t.epoch>r)return a;t=t.add(1,"week")}return 52},monthName:function(e){if(void 0===e)return q()[this.month()];var n=this.clone();return n=n.month(e)},quarter:function(e){if(void 0!==e&&("string"==typeof e&&(e=e.replace(/^q/i,""),e=parseInt(e,10)),ye[e])){var n=this.clone(),t=ye[e][0];return n=(n=(n=n.month(t)).date(1)).startOf("day")}for(var r=this.d.getMonth(),a=1;a<ye.length;a++)if(r<ye[a][0])return a-1;return 4},season:function(e){var n="north";if("South"===this.hemisphere()&&(n="south"),void 0!==e){for(var t=this.clone(),r=0;r<pe[n].length;r++)e===pe[n][r][0]&&(t=(t=(t=t.month(pe[n][r][1])).date(1)).startOf("day"));return t}for(var a=this.d.getMonth(),o=0;o<pe[n].length-1;o++)if(a>=pe[n][o][1]&&a<pe[n][o+1][1])return pe[n][o][0];return"winter"},year:function(e){if(void 0!==e){var n=this.clone();return n.epoch=Ae(n,e),n}return this.d.getFullYear()},era:function(e){if(void 0!==e){var n=this.clone();e=e.toLowerCase();var t=n.d.getFullYear();return"bc"===e&&t>0&&(n.epoch=Ae(n,-1*t)),"ad"===e&&t<0&&(n.epoch=Ae(n,-1*t)),n}return this.d.getFullYear()<0?"BC":"AD"}},Fe=Object.assign({},Ye,Ne,Le);Fe.milliseconds=Fe.millisecond,Fe.seconds=Fe.second,Fe.minutes=Fe.minute,Fe.hours=Fe.hour,Fe.hour24=Fe.hour,Fe.h12=Fe.hour12,Fe.h24=Fe.hour24,Fe.days=Fe.day;var Ze=function(e){Object.keys(Fe).forEach(function(n){e.prototype[n]=Fe[n]})},He=["millisecond","second","minute","hour","date","month"],Qe={second:He.slice(0,1),minute:He.slice(0,2),quarterhour:He.slice(0,2),hour:He.slice(0,3),date:He.slice(0,4),month:He.slice(0,4),quarter:He.slice(0,4),season:He.slice(0,4),year:He,decade:He,century:He};Qe.week=Qe.hour,Qe.season=Qe.date,Qe.quarter=Qe.date;var Be={year:!0,quarter:!0,season:!0,month:!0,week:!0,day:!0},Ge={month:!0,quarter:!0,season:!0,year:!0},Ue=function(e){e.prototype.add=function(e,t){var r=this.clone();if(!t||0===e)return r;var a=this.clone();t=n.normalize(t),z[t]?r.epoch+=z[t]*e:"week"===t?r.epoch+=z.day*(7*e):"quarter"===t||"season"===t?r.epoch+=z.month*(4*e):"season"===t?r.epoch+=z.month*(4*e):"quarterhour"===t&&(r.epoch+=15*z.minute*e);var o={};if(Qe[t]&&Qe[t].forEach(function(e){o[e]=a[e]()}),Be[t]){var i=a.timezone().current.offset-r.timezone().current.offset;r.epoch+=3600*i*1e3}if("month"===t&&(o.month=a.month()+e,o=function(e,n){if(e.month>0){var t=parseInt(e.month/12,10);e.year=n.year()+t,e.month=e.month%12}else if(e.month<0){var r=Math.floor(Math.abs(e.month)/13,10);r=Math.abs(r)+1,e.year=n.year()-r,e.month=e.month%12,e.month=e.month+12,12===e.month&&(e.month=0)}return e}(o,a)),"week"===t){var u=a.date()+7*e;u<=28&&u>1&&(o.date=u)}else if("date"===t){var s=a.date()+e;s<=28&&s>1?o.date=s:0!==e&&a.isSame(r,"day")&&(o.date=a.date()+e)}else"year"===t&&r.year()===a.year()?r.epoch+=z.week:"decade"===t?o.year=r.year()+10:"century"===t&&(o.year=r.year()+100);if(Ge[t]){var c=I[o.month];o.date=a.date(),o.date>c&&(o.date=c)}return _(r,o),r},e.prototype.subtract=function(e,n){return this.clone().add(-1*e,n)},e.prototype.minus=e.prototype.subtract,e.prototype.plus=e.prototype.add},We={millisecond:function(e){return e.epoch},second:function(e){return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second()].join("-")},minute:function(e){return[e.year(),e.month(),e.date(),e.hour(),e.minute()].join("-")},hour:function(e){return[e.year(),e.month(),e.date(),e.hour()].join("-")},day:function(e){return[e.year(),e.month(),e.date()].join("-")},week:function(e){return[e.year(),e.week()].join("-")},month:function(e){return[e.year(),e.month()].join("-")},quarter:function(e){return[e.year(),e.quarter()].join("-")},year:function(e){return e.year()}};We.date=We.day;var Ve=function(e){e.prototype.isSame=function(n,t){return t?("string"!=typeof n&&"number"!=typeof n||(n=new e(n,this.timezone.name)),t=t.replace(/s$/,""),We[t]?We[t](this)===We[t](n):null):null}},Je=function(e){var t={isAfter:function(e){e=n.beADate(e,this);var t=n.getEpoch(e);return null===t?null:this.epoch>t},isBefore:function(e){e=n.beADate(e,this);var t=n.getEpoch(e);return null===t?null:this.epoch<t},isEqual:function(e){e=n.beADate(e,this);var t=n.getEpoch(e);return null===t?null:this.epoch===t},isBetween:function(e,t){e=n.beADate(e,this),t=n.beADate(t,this);var r=n.getEpoch(e);if(null===r)return null;var a=n.getEpoch(t);return null===a?null:r<this.epoch&&this.epoch<a}};Object.keys(t).forEach(function(n){e.prototype[n]=t[n]})},Ke=function(e){var t={i18n:function(e){n.isObject(e.days)&&W(e.days),n.isObject(e.months)&&C(e.months)}};Object.keys(t).forEach(function(n){e.prototype[n]=t[n]})},Re=f,Xe=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.epoch=null,this.tz=k(n,Re),this.silent=t.silent||!0,this._weekStart=1,void 0!==t.weekStart&&(this._weekStart=t.weekStart),Object.defineProperty(this,"d",{get:function(){var e=a(this),n=(new Date(this.epoch).getTimezoneOffset()||0)+60*e;n=60*n*1e3;var t=this.epoch+n;return new Date(t)}}),Object.defineProperty(this,"timezones",{get:function(){return Re},set:function(e){return Re=e,e}}),void 0!==e||null===e){var r=H(this,e,n);this.epoch=r.epoch}};Object.keys(Oe).forEach(function(e){Xe.prototype[e]=Oe[e]}),Xe.prototype.clone=function(){return new Xe(this.epoch,this.tz,{silent:this.silent,weekStart:this._weekStart})},Ze(Xe),Ue(Xe),Ve(Xe),Je(Xe),Ke(Xe);var en=Xe,nn=function(e,n){var t=new en(null),r=new en(null);t=t.time(e),r=n?r.time(n):t.add(59,"minutes");var a=t.hour(),o=r.hour();return Object.keys(t.timezones).filter(function(e){if(-1===e.indexOf("/"))return!1;var n=new en(null,e),i=n.hour();return i>=a&&i<=o&&(!(i===a&&n.minute()<t.minute())&&!(i===o&&n.minute()>r.minute()))})},tn=function(e,n,t){return new en(e,n,t)};return tn.now=function(e,n){return new en((new Date).getTime(),e,n)},tn.today=function(e,n){return new en((new Date).getTime(),e,n).startOf("day")},tn.tomorrow=function(e,n){return new en((new Date).getTime(),e,n).add(1,"day").startOf("day")},tn.yesterday=function(e,n){return new en((new Date).getTime(),e,n).subtract(1,"day").startOf("day")},tn.extend=function(e){return Object.keys(e).forEach(function(n){en.prototype[n]=e[n]}),this},tn.whereIts=nn,tn.version="6.0.0",tn.plugin=tn.extend,tn});