Socket
Socket
Sign inDemoInstall

compromise

Package Overview
Dependencies
Maintainers
3
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compromise - npm Package Compare versions

Comparing version 13.11.4-rc6 to 13.11.4-rc7

plugins/dates/node_modules/spacetime/api/index.js

43

package.json

@@ -5,7 +5,7 @@ {

"description": "modest natural language processing",
"version": "13.11.4-rc6",
"version": "13.11.4-rc7",
"main": "./src/index.js",
"unpkg": "./builds/compromise.js",
"type": "module",
"types": "builds/types.d.ts",
"types": "types/three.d.ts",
"sideEffects": false,

@@ -34,2 +34,15 @@ "exports": {

},
"typesVersions": {
"*": {
"one": [
"types/one.d.ts"
],
"two": [
"types/two.d.ts"
],
"three": [
"types/three.d.ts"
]
}
},
"repository": {

@@ -45,2 +58,3 @@ "type": "git",

"build": "npm run version && rollup -c --silent",
"watch": "amble ./scratch.js",
"pack": "node ./scripts/pack.js",

@@ -50,13 +64,10 @@ "version": "node ./scripts/version.js",

"testb": "npm run test:smoke && TESTENV=prod npm run test",
"test:one": "tape \"./tests/one/match/*.test.js\" | tap-dancer",
"test:one": "tape \"./tests/one/**/*.test.js\" | tap-dancer",
"test:two": "tape \"./tests/two/**/*.test.js\" | tap-dancer",
"test:three": "tape \"./tests/three/**/*.test.js\" | tap-dancer",
"test:four": "tape \"./tests/four/**/*.test.js\" | tap-dancer",
"test:match": "tape \"./tests/*/match.test.js\" | tap-dancer",
"test:penn": "tape \"./tests/two/tagger/penn.test.js\" | tap-dancer",
"test:smoke": "tape \"./scripts/test/smoke.test.js\" | tap-dancer",
"test:dates": "tape \"./plugins/dates/tests/**/*.test.js\" | tap-dancer",
"test:plugins": "tape \"./plugins/**/tests/**/*.test.js\" | tap-dancer",
"debug": "node ./scripts/debug.js",
"match": "node ./scripts/match.js",
"coverage": "nyc -r lcov -n 'src/**/*' -n 'plugins/**/*' npm run test",
"coverage": "c8 -r lcov -n 'src/**/*' -n 'plugins/**/*' npm run test",
"codecov": "npm run coverage && codecov -t 15039ad1-b495-48cd-b4a0-bcf124c9b318",

@@ -66,11 +77,4 @@ "perf": "node ./scripts/perf/index.js",

"lint": "eslint ./src/**/* && eslint ./plugins/**/src/*",
"watch": "amble ./scratch.js",
"watch:dates": "amble ./plugins/dates/scratch.js",
"watch:speech": "amble ./plugins/speech/scratch.js",
"build:all": "node ./scripts/build/build-all.js && npm run build --silent",
"plugins": "node ./scripts/plugin-check.js --silent",
"plugins:install": "node ./scripts/plugins.js npm install",
"plugins:ci": "node ./scripts/plugins.js npm ci",
"plugins:build": "node ./scripts/plugins.js npm run build",
"demo": "python -m SimpleHTTPServer 8888"
"plugins:build": "node ./scripts/plugins.js npm run build"
},

@@ -103,7 +107,6 @@ "files": [

"codecov": "3.8.3",
"eslint": "8.9.0",
"eslint-plugin-regexp": "1.5.1",
"minimum-model": "^0.0.1",
"eslint": "8.11.0",
"eslint-plugin-regexp": "1.6.0",
"nlp-corpus": "^4.2.0",
"rollup": "2.68.0",
"rollup": "2.70.1",
"rollup-plugin-filesize-check": "0.0.1",

@@ -110,0 +113,0 @@ "rollup-plugin-terser": "7.0.2",

@@ -1,1 +0,1 @@

var t,e;t=this,e=function(t,e){function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=a(t),i=a(e);const r={second:!0,minute:!0,hour:!0,day:!0,week:!0,weekend:!0,month:!0,season:!0,quarter:!0,year:!0},s={wk:"week",min:"minute",sec:"second",weekend:"week"},o=function(t){let e=t.match("#Duration").text("normal");return e=e.replace(/s$/,""),s.hasOwnProperty(e)&&(e=s[e]),e},u={minute:!0},d={daybreak:"7:00am",breakfast:"8:00am",morning:"9:00am",noon:"12:00pm",midday:"12:00pm",afternoon:"2:00pm",lunchtime:"12:00pm",evening:"6:00pm",dinnertime:"6:00pm",night:"8:00pm",eod:"10:00pm",midnight:"12:00am"},m={quarter:15,half:30},l=function(t){let e=t.time("6:00am");return t.isBefore(e)?t.ampm("pm"):t},h=function(t,e){let a=t.match("(at|by|for|before|this|after)? #Time+");a=a.not("^(at|by|for|before|this|after)"),a=a.not("sharp"),a=a.not("on the dot");let i=n.default.now(e.timezone),r=i.clone(),s=a.text("reduced");if(d.hasOwnProperty(s))return{result:d[s],m:a};let o=a.match("^#Cardinal oclock (am|pm)?");if(o.found&&(i=i.hour(o.text("reduced")),i=i.startOf("hour"),i.isValid()&&!i.isEqual(r))){let t=o.match("(am|pm)");return i=t.found?i.ampm(t.text("reduced")):l(i),{result:i.time(),m:o}}if(o=a.match("(half|quarter|25|20|15|10|5) (past|after|to) #Cardinal"),o.found&&(i=function(t,e){let a=t.match("#Cardinal$"),n=t.not(a).match("(half|quarter|25|20|15|10|5)");a=a.text("reduced");let i=n.text("reduced");m.hasOwnProperty(i)&&(i=m[i]);let r=t.has("to");return e=(e=e.hour(a)).startOf("hour"),a<6&&(e=e.ampm("pm")),r?e.subtract(i,"minutes"):e.add(i,"minutes")}(o,i),i.isValid()&&!i.isEqual(r)))return i=l(i),{result:i.time(),m:o};if(o=a.match("[<min>(half|quarter|25|20|15|10|5)] (past|after)"),o.found){let t=o.groups("min").text("reduced"),a=n.default(e.today);if(m.hasOwnProperty(t)&&(t=m[t]),a=a.next("hour").startOf("hour").minute(t),a.isValid()&&!a.isEqual(r))return{result:a.time(),m:o}}if(o=a.match("[<min>(half|quarter|25|20|15|10|5)] to"),o.found){let t=o.groups("min").text("reduced"),a=n.default(e.today);if(m.hasOwnProperty(t)&&(t=m[t]),a=a.next("hour").startOf("hour").minus(t,"minutes"),a.isValid()&&!a.isEqual(r))return{result:a.time(),m:o}}if(o=a.match("[<time>#Time] (in|at) the? [<desc>(morning|evening|night|nighttime)]"),o.found){let t=o.groups("time").text("normal");if(/^[0-9]{1,2}$/.test(t)?(i=i.hour(t),i=i.startOf("hour")):i=i.time(t),i.isValid()&&!i.isEqual(r)){let t=o.groups("desc").text("reduced");return"evening"!==t&&"night"!==t||(i=i.ampm("pm")),{result:i.time(),m:o}}}if(o=a.match("this? [<desc>(morning|evening|tonight)] at [<time>(#Cardinal|#Time)]"),o.found){let t=o.groups(),e=t.time.text("reduced");if(/^[0-9]{1,2}$/.test(e)?(i=i.hour(e),i=i.startOf("hour")):i=i.time(e),i.isValid()&&!i.isEqual(r)){let e=t.desc.text("reduced");return"morning"===e&&(i=i.ampm("am")),"evening"!==e&&"tonight"!==e||(i=i.ampm("pm")),{result:i.time(),m:o}}}if(o=a.match("^#Cardinal$"),o.found){let t=o.text("reduced");if(i=i.hour(t),i=i.startOf("hour"),i.isValid()&&!i.isEqual(r))return!1===/(am|pm)/i.test(t)&&(i=l(i)),{result:i.time(),m:o}}let u=a.text("reduced");return i=i.time(u),i.isValid()&&!i.isEqual(r)?(!1===/(am|pm)/i.test(u)&&(i=l(i)),{result:i.time(),m:a}):e.dayStart?{result:e.dayStart,m:t.none()}:{result:null,m:t.none()}},c="Australia/",f="Pacific/",y={"british summer time":"Europe/London",bst:"Europe/London","british time":"Europe/London","britain time":"Europe/London","irish summer time":"Europe/Dublin","irish time":"Europe/Dublin",ireland:"Europe/Dublin","central european time":"Europe/Berlin",cet:"Europe/Berlin","central european summer time":"Europe/Berlin",cest:"Europe/Berlin","central europe":"Europe/Berlin","eastern european time":"Europe/Riga",eet:"Europe/Riga","eastern european summer time":"Europe/Riga",eest:"Europe/Riga","eastern europe time":"Europe/Riga","western european time":"Europe/Lisbon","western european summer time":"Europe/Lisbon","western europe":"Europe/Lisbon","turkey standard time":"Europe/Istanbul",trt:"Europe/Istanbul","turkish time":"Europe/Istanbul",etc:"Africa/Freetown",utc:"Africa/Freetown","greenwich standard time":"Africa/Freetown",gmt:"Africa/Freetown","east africa time":"Africa/Nairobi","east african time":"Africa/Nairobi","eastern africa time":"Africa/Nairobi","central africa time":"Africa/Khartoum","central african time":"Africa/Khartoum","south africa standard time":"Africa/Johannesburg",sast:"Africa/Johannesburg","southern africa":"Africa/Johannesburg","south african":"Africa/Johannesburg","west africa standard time":"Africa/Lagos","western africa time":"Africa/Lagos","west african time":"Africa/Lagos","australian central standard time":c+"Adelaide",acst:c+"Adelaide","australian central daylight time":c+"Adelaide",acdt:c+"Adelaide","australia central":c+"Adelaide","australian eastern standard time":c+"Brisbane",aest:c+"Brisbane","australian eastern daylight time":c+"Brisbane",aedt:c+"Brisbane","australia east":c+"Brisbane","australian western standard time":c+"Perth",awst:c+"Perth","australian western daylight time":c+"Perth",awdt:c+"Perth","australia west":c+"Perth","australian central western standard time":c+"Eucla",acwst:c+"Eucla","australia central west":c+"Eucla","lord howe standard time":c+"Lord_Howe",lhst:c+"Lord_Howe","lord howe daylight time":c+"Lord_Howe",lhdt:c+"Lord_Howe","russian standard time":"Europe/Moscow",msk:"Europe/Moscow",russian:"Europe/Moscow","central standard time":"America/Chicago","central time":"America/Chicago",cst:"America/Havana","central daylight time":"America/Chicago",cdt:"America/Havana","mountain standard time":"America/Denver","mountain time":"America/Denver",mst:"America/Denver","mountain daylight time":"America/Denver",mdt:"America/Denver","atlantic standard time":"America/Halifax","atlantic time":"America/Halifax",ast:"Asia/Baghdad","atlantic daylight time":"America/Halifax",adt:"America/Halifax","eastern standard time":"America/New_York","eastern time":"America/New_York",est:"America/New_York","eastern daylight time":"America/New_York",edt:"America/New_York","pacific time":"America/Los_Angeles","pacific standard time":"America/Los_Angeles",pst:"America/Los_Angeles","pacific daylight time":"America/Los_Angeles",pdt:"America/Los_Angeles","alaskan standard time":"America/Anchorage","alaskan time":"America/Anchorage",ahst:"America/Anchorage","alaskan daylight time":"America/Anchorage",ahdt:"America/Anchorage","hawaiian standard time":f+"Honolulu","hawaiian time":f+"Honolulu",hst:f+"Honolulu","aleutian time":f+"Honolulu","hawaii time":f+"Honolulu","newfoundland standard time":"America/St_Johns","newfoundland time":"America/St_Johns",nst:"America/St_Johns","newfoundland daylight time":"America/St_Johns",ndt:"America/St_Johns","brazil time":"America/Sao_Paulo",brt:"America/Sao_Paulo","brasília":"America/Sao_Paulo",brasilia:"America/Sao_Paulo","brazilian time":"America/Sao_Paulo","argentina time":"America/Buenos_Aires","argentinian time":"America/Buenos_Aires","amazon time":"America/Manaus",amt:"America/Manaus","amazonian time":"America/Manaus","easter island standard time":"Chile/Easterisland",east:"Chile/Easterisland","easter island summer time":"Chile/Easterisland",easst:"Chile/Easterisland","venezuelan standard time":"America/Caracas","venezuelan time":"America/Caracas",vet:"America/Caracas","venezuela time":"America/Caracas","paraguay time":"America/Asuncion",pyt:"America/Asuncion","paraguay summer time":"America/Asuncion",pyst:"America/Asuncion","cuba standard time":"America/Havana","cuba time":"America/Havana","cuba daylight time":"America/Havana","cuban time":"America/Havana","bolivia time":"America/La_Paz","bolivian time":"America/La_Paz","colombia time":"America/Bogota",cot:"America/Bogota","colombian time":"America/Bogota","acre time":"America/Eirunepe","peru time":"America/Lima","chile standard time":"America/Punta_Arenas","chile time":"America/Punta_Arenas",clst:"America/Punta_Arenas","chile summer time":"America/Punta_Arenas",cldt:"America/Punta_Arenas","uruguay time":"America/Montevideo",uyt:"America/Montevideo",ist:"Asia/Jerusalem","arabic standard time":"Asia/Baghdad","arabic time":"Asia/Baghdad","arab time":"Asia/Baghdad","iran standard time":"Asia/Tehran","iran time":"Asia/Tehran",irst:"Asia/Tehran","iran daylight time":"Asia/Tehran",irdt:"Asia/Tehran",iranian:"Asia/Tehran","pakistan standard time":"Asia/Karachi","pakistan time":"Asia/Karachi",pkt:"Asia/Karachi","india standard time":"Asia/Kolkata","indian time":"Asia/Kolkata","indochina time":"Asia/Bangkok",ict:"Asia/Bangkok","south east asia":"Asia/Bangkok","china standard time":"Asia/Shanghai",ct:"Asia/Shanghai","chinese time":"Asia/Shanghai","alma-ata time":"Asia/Almaty",almt:"Asia/Almaty","oral time":"Asia/Oral","orat time":"Asia/Oral","yakutsk time":"Asia/Yakutsk",yakt:"Asia/Yakutsk","gulf standard time":"Asia/Dubai","gulf time":"Asia/Dubai",gst:"Asia/Dubai",uae:"Asia/Dubai","hong kong time":"Asia/Hong_Kong",hkt:"Asia/Hong_Kong","western indonesian time":"Asia/Jakarta",wib:"Asia/Jakarta","indonesia time":"Asia/Jakarta","central indonesian time":"Asia/Makassar",wita:"Asia/Makassar","israel daylight time":"Asia/Jerusalem",idt:"Asia/Jerusalem","israel standard time":"Asia/Jerusalem","israel time":"Asia/Jerusalem",israeli:"Asia/Jerusalem","krasnoyarsk time":"Asia/Krasnoyarsk",krat:"Asia/Krasnoyarsk","malaysia time":"Asia/Kuala_Lumpur",myt:"Asia/Kuala_Lumpur","singapore time":"Asia/Singapore",sgt:"Asia/Singapore","korea standard time":"Asia/Seoul","korea time":"Asia/Seoul",kst:"Asia/Seoul","korean time":"Asia/Seoul","uzbekistan time":"Asia/Samarkand",uzt:"Asia/Samarkand","vladivostok time":"Asia/Vladivostok",vlat:"Asia/Vladivostok","maldives time":"Indian/Maldives",mvt:"Indian/Maldives","mauritius time":"Indian/Mauritius",mut:"Indian/Mauritius","marshall islands time":f+"Kwajalein",mht:f+"Kwajalein","samoa standard time":f+"Midway",sst:f+"Midway","somoan time":f+"Midway","chamorro standard time":f+"Guam",chst:f+"Guam","papua new guinea time":f+"Bougainville",pgt:f+"Bougainville"};let g=n.default().timezones,p=Object.keys(g).reduce((t,e)=>(t[e]=e,t),{});var D=Object.assign({},y,p);const A=/(\-?[0-9]+)h(rs)?/i,w=/(\-?[0-9]+)/,k=/utc([\-+]?[0-9]+)/i,b=/gmt([\-+]?[0-9]+)/i,x=function(t){return(t=Number(t))>-13&&t<13?"Etc/GMT"+(t=((t*=-1)>0?"+":"")+t):null},v=function(t){let e=t.match("#Timezone+");e=e.not("(in|for|by|near|at)");let a=e.text("reduced");if(D.hasOwnProperty(a))return{result:D[a],m:e};let n=function(t){let e=t.match(A);if(null!==e)return x(e[1]);if(e=t.match(k),null!==e)return x(e[1]);if(e=t.match(b),null!==e){let t=-1*Number(e[1]);return x(t)}return e=t.match(w),null!==e?x(e[1]):null}(a);return n?{result:n,m:e}:{result:null,m:t.none()}},V=function(t,e){let a=function(t){let e={},a=t.none(),n=t.match("#DateShift+");if(!1===n.found)return{res:e,m:a};if(n.match("#Cardinal #Duration").forEach(t=>{let a=t.match("#Cardinal").numbers().get()[0];if(a&&"number"==typeof a){let n=o(t);!0===r[n]&&(e[n]=a)}}),!0===n.has("(before|ago|hence|back)$")&&Object.keys(e).forEach(t=>e[t]*=-1),a=n.match("#Cardinal #Duration"),n=n.not(a),a=n.match("[<unit>#Duration] [<dir>(after|before)]"),a.found){let t=a.groups("unit").text("reduced"),n=a.groups("dir").text("reduced");"after"===n?e[t]=1:"before"===n&&(e[t]=-1)}if(a=n.match("half (a|an) [#Duration]",0),a.found){let t=o(a);e[t]=.5}return a=t.match("#DateShift+"),{result:e,m:a}}(t),n=a.result;a=function(t){let e=t.match("[<num>#Value] [<unit>#Duration+] (of|in)");if(e.found){let t=e.groups(),a=t.num.numbers().get()[0],n=t.unit.text("reduced"),i={unit:n,num:Number(a)||0};return u[n]||(i.num-=1),{result:i,m:e}}if(e=t.match("[<dir>(first|initial|last|final)] [<unit>#Duration+] (of|in)"),e.found){let t=e.groups(),a=t.dir.text("reduced"),n=t.unit.text("reduced");return"initial"===a&&(a="first"),"final"===a&&(a="last"),{result:{unit:n,dir:a},m:e}}return{result:null,m:t.none()}}(t=t.not(a.m));let i=a.result;t=t.not(a.m),a=v(t);let s=a.result;t=t.not(a.m),a=h(t,e);let d=a.result;a=function(t){let e=t.match("#WeekDay");return e.found&&!t.has("^#WeekDay$")?t.has("(this|next|last) (next|upcoming|coming|past)? #WeekDay")?{result:null,m:t.none()}:{result:e.text("reduced"),m:e}:{result:null,m:t.none()}}(t=t.not(a.m));let m=a.result;a=function(t){let e=t.match("[(start|beginning) of] .",0);return e.found?{result:"start",m:e}:(e=t.match("[end of] .",0),e.found?{result:"end",m:e}:(e=t.match("[(middle|midpoint|center) of] .",0),e.found?{result:"middle",m:e}:{result:null,m:e}))}(t=t.not(a.m));let l=a.result;return a=function(t){if(t.has("(next|last|this)$"))return{result:null,m:t.none()};let e=t.match("^this? (next|upcoming|coming)");return e.found?{result:"next",m:e}:(e=t.match("^this? (past)"),e.found?{result:"this-past",m:e}:(e=t.match("^this? (last|previous)"),e.found?{result:"last",m:e}:(e=t.match("^(this|current)"),e.found?{result:"this",m:e}:{result:null,m:t.none()})))}(t=t.not(a.m)),{shift:n,counter:i,tz:s,time:d,weekDay:m,section:l,rel:a.result,doc:t=function(t){return(t=(t=(t=(t=(t=(t=t.not("[^the] !#Value",0)).not("#Preposition$")).not("#Conjunction$")).not("sharp")).not("on the dot")).not("^on")).not("(next|last|this)$")}(t=t.not(a.m))}};class Unit{constructor(t,e,a){this.unit=e||"day",this.setTime=!1;let i={};(a=a||{}).today&&(i={date:a.today.date(),month:a.today.month(),year:a.today.year()});let r=n.default(t,a.timezone,{today:i});Object.defineProperty(this,"d",{enumerable:!1,writable:!0,value:r}),Object.defineProperty(this,"context",{enumerable:!1,writable:!0,value:a})}clone(){let t=new Unit(this.d,this.unit,this.context);return t.setTime=this.setTime,t}log(){return console.log("--"),this.d.log(),console.log("\n"),this}applyShift(t={}){return Object.keys(t).forEach(e=>{this.d=this.d.add(t[e],e),"hour"!==e&&"minute"!==e||(this.setTime=!0)}),this}applyTime(t){if(t){if(/^[0-9]{1,2}$/.test(t)?this.d=this.d.hour(t):this.d=this.d.time(t),!/[ap]m/.test(t)){let t=this.d.time("6:00am");this.d.isBefore(t)&&(this.d=this.d.ampm("pm"));let e=this.d.time("10:00pm");this.d.isAfter(e)&&(this.d=this.d.ampm("am"))}}else this.d=this.d.startOf("day");return this.setTime=!0,this}applyWeekDay(t){if(t){let e=this.d.epoch;this.d=this.d.day(t),this.d.epoch<e&&(this.d=this.d.add(1,"week"))}return this}applyRel(t){return"next"===t?this.next():"last"===t||"this-past"===t?this.last():this}applySection(t){return"start"===t?this.start():"end"===t?this.end():"middle"===t?this.middle():this}format(t){return this.d.format(t)}start(){return this.d=this.d.startOf(this.unit),this.context.dayStart&&(this.d=this.d.time(this.context.dayStart)),this}end(){if(this.d=this.d.endOf(this.unit),this.context.dayEnd){this.d=this.d.startOf("day");let t=this.d.time(this.context.dayEnd);if(t.isAfter(this.d))return this.d=t,this}return this}middle(){let t=this.d.diff(this.d.endOf(this.unit)),e=Math.round(t.minutes/2);return this.d=this.d.add(e,"minutes"),this}beforeEnd(){let t=this.d.startOf(this.unit).diff(this.d.endOf(this.unit)),e=Math.round(t.minutes/4);return this.d=this.d.endOf(this.unit),this.d=this.d.minus(e,"minutes"),this.context.dayStart&&(this.d=this.d.time(this.context.dayStart)),this}before(){return this.d=this.d.minus(1,this.unit),this.d=this.d.endOf(this.unit),this.context.dayEnd&&(this.d=this.d.time(this.context.dayEnd)),this}after(){return this.d=this.d.add(1,this.unit),this.d=this.d.startOf(this.unit),this}next(){return this.d=this.d.add(1,this.unit),this.d=this.d.startOf(this.unit),this}last(){return this.d=this.d.minus(1,this.unit),this.d=this.d.startOf(this.unit),this}}class Day extends Unit{constructor(t,e,a){super(t,e,a),this.unit="day",this.d.isValid()&&(this.d=this.d.startOf("day"))}middle(){return this.d=this.d.time("10am"),this}beforeEnd(){return this.d=this.d.time("2pm"),this}}class CalendarDate extends Day{constructor(t,e,a){super(t,e,a),this.unit="day",this.d.isValid()&&(this.d=this.d.startOf("day"))}next(){return this.d=this.d.add(1,"year"),this}last(){return this.d=this.d.minus(1,"year"),this}}class WeekDay extends Day{constructor(t,e,a){super(t,e,a),this.unit="day",this.isWeekDay=!0,"string"==typeof t?(this.d=n.default(a.today,a.timezone),this.d=this.d.day(t),this.d.isBefore(a.today)&&(this.d=this.d.add(7,"days"))):this.d=t,this.weekDay=this.d.dayName(),this.d.isValid()&&(this.d=this.d.startOf("day"))}next(){return this.d=this.d.add(7,"days"),this.d=this.d.day(this.weekDay),this}last(){return this.d=this.d.minus(7,"days"),this.d=this.d.day(this.weekDay),this}before(){return this.d=this.d.minus(1,"day"),this.d=this.d.endOf("day"),this.context.dayEnd&&(this.d=this.d.time(this.context.dayEnd)),this}applyRel(t){if("next"===t){let t=this.context.today.endOf("week").add(1,"week");return this.next(),this.d.isAfter(t)&&this.last(),this}if("this-past"===t)return this.last();if("last"===t){let t=this.context.today.startOf("week");return this.last(),!1===this.d.isBefore(t)&&this.last(),this}return this}}class Holiday extends CalendarDate{constructor(t,e,a){super(t,e,a),this.unit="day",this.d.isValid()&&(this.d=this.d.startOf("day"))}}class Hour extends Unit{constructor(t,e,a){super(t,e,a,!0),this.unit="hour",this.d.isValid()&&(this.d=this.d.startOf("hour"))}}class Minute extends Unit{constructor(t,e,a){super(t,e,a,!0),this.unit="minute",this.d.isValid()&&(this.d=this.d.startOf("minute"))}}class Moment extends Unit{constructor(t,e,a){super(t,e,a,!0),this.unit="millisecond"}}class Month extends Unit{constructor(t,e,a){super(t,e,a),this.unit="month",this.d.isValid()&&(this.d=this.d.startOf(this.unit))}next(){return this.d=this.d.add(1,"year"),this.d=this.d.startOf("month"),this}last(){return this.d=this.d.minus(1,"year"),this.d=this.d.startOf("month"),this}}class AnyQuarter extends Unit{constructor(t,e,a){super(t,e,a),this.unit="quarter",this.d.isValid()&&(this.d=this.d.startOf(this.unit))}last(){return this.d=this.d.minus(1,"quarter"),this.d=this.d.startOf(this.unit),this}}class Quarter extends Unit{constructor(t,e,a){super(t,e,a),this.unit="quarter",this.d.isValid()&&(this.d=this.d.startOf(this.unit))}next(){return this.d=this.d.add(1,"year"),this.d=this.d.startOf(this.unit),this}last(){return this.d=this.d.minus(1,"year"),this.d=this.d.startOf(this.unit),this}}class Season extends Unit{constructor(t,e,a){super(t,e,a),this.unit="season",this.d.isValid()&&(this.d=this.d.startOf(this.unit))}next(){return this.d=this.d.add(1,"year"),this.d=this.d.startOf(this.unit),this}last(){return this.d=this.d.minus(1,"year"),this.d=this.d.startOf(this.unit),this}}class Year extends Unit{constructor(t,e,a){super(t,e,a),this.unit="year",this.d.isValid()&&(this.d=this.d.startOf("year"))}}class Week extends Unit{constructor(t,e,a){super(t,e,a),this.unit="week",this.d.isValid()&&(this.d=this.d.startOf("week"))}clone(){return new Week(this.d,this.unit,this.context)}middle(){return this.d=this.d.add(2,"days"),this}beforeEnd(){return this.d=this.d.day("friday"),this}}class WeekEnd extends Unit{constructor(t,e,a){super(t,e,a),this.unit="week",this.d.isValid()&&(this.d=this.d.day("saturday"),this.d=this.d.startOf("day"))}start(){return this.d=this.d.day("saturday").startOf("day"),this}next(){return this.d=this.d.add(1,this.unit),this.d=this.d.startOf("weekend"),this}last(){return this.d=this.d.minus(1,this.unit),this.d=this.d.startOf("weekend"),this}}const M={today:t=>new Day(t.today,null,t),yesterday:t=>new Day(t.today.minus(1,"day"),null,t),tomorrow:t=>new Day(t.today.plus(1,"day"),null,t),eom:t=>{let e=t.today.endOf("month");return e=e.startOf("day"),new Day(e,null,t)},eoy:t=>{let e=t.today.endOf("year");return e=e.startOf("day"),new Day(e,null,t)},now:t=>new Moment(t.today,null,t)};M.tommorrow=M.tomorrow,M.tmrw=M.tomorrow,M.anytime=M.today,M.sometime=M.today;const T={day:Day,hour:Hour,evening:Hour,second:Moment,milliscond:Moment,instant:Moment,minute:Minute,week:Week,weekend:WeekEnd,month:class AnyMonth extends Unit{constructor(t,e,a){super(t,e,a),this.unit="month",this.d.isValid()&&(this.d=this.d.startOf(this.unit))}},quarter:AnyQuarter,year:Year,season:Season,yr:Year,qtr:AnyQuarter,wk:Week,sec:Moment,hr:Hour};let E=`^(${Object.keys(T).join("|")})$`;const O=function(t){return{date:t.today.date(),month:t.today.month(),year:t.today.year()}},C=function(t,e,a){let r=null;return r=r||function(t,e,a){let n=null;!1===t.found&&(null!==a.time&&(n=new Moment(e.today,null,e)),a.shift&&Object.keys(a.shift).length>0&&(n=a.shift.hour||a.shift.minute?new Moment(e.today,null,e):new Day(e.today,null,e)));let i=t.text("reduced");return!0===M.hasOwnProperty(i)?M[i](e):"next"===i&&a.shift&&Object.keys(a.shift).length>0?M.tomorrow(e):n}(t,e,a),r=r||function(t,e){let a=null,n=t.match("[<holiday>#Holiday+] [<year>#Year?]"),r=e.today.year();n.groups("year").found&&(r=Number(n.groups("year").text("reduced"))||r);let s=n.groups("holiday").text("reduced"),o=i.default(s,r,e.timezone);return null!==o&&(o.isBefore(e.today)&&r===e.today.year()&&(o=i.default(s,r+1,e.timezone)),a=new Holiday(o,null,e)),a}(t,e),r=r||function(t,e){let a=t.match(E);if(!0===a.found){let t=a.text("reduced");if(T.hasOwnProperty(t)){let a=T[t];return a?new a(null,t,e):null}}if(a=t.match("^#WeekDay$"),!0===a.found){let t=a.text("reduced");return new WeekDay(t,null,e)}return null}(t,e),r=r||function(t,e){let a=t.match("(spring|summer|winter|fall|autumn) [<year>#Year?]");if(a.found){let a=t.text("reduced"),i=n.default(a,e.timezone,{today:O(e)}),r=new Season(i,null,e);if(!0===r.d.isValid())return r}if(a=t.match("[<q>#FinancialQuarter] [<year>#Year?]"),a.found){let t=a.groups("q").text("reduced"),i=n.default(t,e.timezone,{today:O(e)});if(a.groups("year")){let t=Number(a.groups("year").text())||e.today.year();i=i.year(t)}let r=new Quarter(i,null,e);if(!0===r.d.isValid())return r}if(a=t.match("[<q>#Value] quarter (of|in)? [<year>#Year?]"),a.found){let t=a.groups("q").text("reduced"),i=n.default("q"+t,e.timezone,{today:O(e)});if(a.groups("year")){let t=Number(a.groups("year").text())||e.today.year();i=i.year(t)}let r=new Quarter(i,null,e);if(!0===r.d.isValid())return r}if(a=t.match("^#Year$"),a.found){let a=t.text("reduced"),i=n.default(null,e.timezone,{today:O(e)});i=i.year(a);let r=new Year(i,null,e);if(!0===r.d.isValid())return r}return null}(t,e),r=r||function(t,e){let a=e.today.year(),n=t.match("[<date>#Value] of? [<month>#Month] [<year>#Year]");if(n.found||(n=t.match("[<month>#Month] the? [<date>#Value] [<year>#Year]")),n.found){let t={month:n.groups("month").text("reduced"),date:n.groups("date").text("reduced"),year:n.groups("year").text()||a},i=new CalendarDate(t,null,e);if(!0===i.d.isValid())return i}if(n=t.match("[<month>#Month] of? [<year>#Year]"),n.found){let t={month:n.groups("month").text("reduced"),year:n.groups("year").text("reduced")||a},i=new Month(t,null,e);if(!0===i.d.isValid())return i}if(n=t.match("[<date>#Value] of? [<month>#Month]"),n.found||(n=t.match("[<month>#Month] the? [<date>#Value]")),n.found){let t={month:n.groups("month").text("reduced"),date:n.groups("date").text("reduced"),year:e.today.year()},a=new CalendarDate(t,null,e);if(a.d.month()<e.today.month()&&(t.year+=1,a=new CalendarDate(t,null,e)),!0===a.d.isValid())return a}if(t.has("#Month")){let a={month:t.match("#Month").text("reduced"),date:1,year:e.today.year()},n=new Month(a,null,e);if(n.d.month()<e.today.month()&&(a.year+=1,n=new Month(a,null,e)),!0===n.d.isValid())return n}if(n=t.match("#WeekDay [<date>#Value]"),n.found){let t={month:e.today.month(),date:n.groups("date").text("reduced"),year:e.today.year()},a=new CalendarDate(t,null,e);if(!0===a.d.isValid())return a}if(n=t.match("the [<date>#Value]"),n.found){let t={month:e.today.month(),date:n.groups("date").text("reduced"),year:e.today.year()},a=new CalendarDate(t,null,e);if(!0===a.d.isValid())return a.d.isBefore(e.today)&&(a.d=a.d.add(1,"month")),a}if(n=t.match("/[0-9]{4}-[0-9]{2}-[0-9]{2}t[0-9]{2}:/"),n.found){let a=t.text("reduced"),n=new Moment(a,null,e);if(!0===n.d.isValid())return n}let i=t.text("reduced");if(!i)return new Moment(e.today,null,e);let r=new Day(i,null,e);return!1===r.d.isValid()?null:r}(t,e),r},S={day:Day,week:Week,weekend:WeekEnd,month:Month,quarter:Quarter,season:Season,hour:Hour,minute:Minute},_=function(t,e,a){if(!t&&a.weekDay&&(t=new WeekDay(a.weekDay,null,e),a.weekDay=null),!t)return null;if(a.shift){let e=a.shift;t.applyShift(e),e.hour||e.minute?t=new Moment(t.d,null,t.context):(e.week||e.day||e.month)&&(t=new Day(t.d,null,t.context))}return a.weekDay&&"day"!==t.unit&&(t.applyWeekDay(a.weekDay),t=new WeekDay(t.d,null,t.context)),a.rel&&t.applyRel(a.rel),a.section&&t.applySection(a.section),a.time&&t.applyTime(a.time),a.counter&&a.counter.unit&&(t=function(t,e={}){let a=S[e.unit];if(!a)return t;let n=t.d;"first"===e.dir||0===e.num?(n=t.start().d,n=n.startOf(e.unit)):"last"===e.dir?(n=n.endOf(t.unit),n="weekend"===e.unit?n.day("saturday",!1):n.startOf(e.unit)):e.num&&("weekend"===e.unit&&(n=n.day("saturday",!0).add(1,"day")),n=n.add(e.num,e.unit));let i=new a(n,null,t.context);return!0===i.d.isValid()?i:t}(t,a.counter)),t},q="undefined"==typeof process?self.env||{}:process.env,z=function(t,e){let a=V(t,e);if(t=a.doc,(t=>{q.DEBUG_DATE&&(console.log(`\n==== '${t.doc.text()}' =====`),Object.keys(t).forEach(e=>{"doc"!==e&&t[e]&&console.log(e,t[e])}),t.doc.debug())})(a),a.tz){let t=(e=Object.assign({},e,{timezone:a.tz})).today.format("iso-short");e.today=e.today.goto(e.timezone).set(t)}let n=C(t,e,a);return n=_(n,e,a),n},$={mon:"monday",tue:"tuesday",tues:"wednesday",wed:"wednesday",thu:"thursday",fri:"friday",sat:"saturday",sun:"sunday",monday:"monday",tuesday:"tuesday",wednesday:"wednesday",thursday:"thursday",friday:"friday",saturday:"saturday",sunday:"sunday"},j=function(t){return t.match("(every|each)").found?"AND":t.match("(any|a)").found?"OR":null},H=function(t){let e=t.start,a=t.end;if(e.d.isAfter(a.d)){if(e.isWeekDay&&a.isWeekDay)return t.end.next(),t;let n=e;t.start=a,t.end=n}return t},P=function(t){let e=t.start,a=t.end;return e.d.isAfter(a.d)&&a.d.hour()<10&&(a.d=a.d.ampm("pm")),t},B=function(t,e){return t=t.applyShift(e.punt)},W=[].concat([{match:"[<from>#Time+] (to|until|upto|through|thru|and) [<to>#Time+ #Date+]",desc:"3pm to 4pm january 5th",parse:(t,e)=>{let a=t.groups("from"),n=t.groups("to"),i=z(n,e);if(i){let t=i.clone();if(t.applyTime(a.text("implicit")),t){let e={start:t,end:i,unit:"time"};return!1===/(am|pm)/.test(n)&&(e=P(e)),e=H(e),e}}return null}},{match:"[<main>#Date+] from [<a>#Time] (to|until|upto|through|thru|and) [<b>#Time+]",desc:"january from 3pm to 4pm",parse:(t,e)=>{let a=t.groups("main"),n=t.groups("a"),i=t.groups("b");if(a=z(a,e),a){a.applyTime(n.text("implicit"));let t=a.clone();if(t.applyTime(i.text("implicit")),t){let e={start:a,end:t,unit:"time"};return!1===/(am|pm)/.test(i.text())&&(e=P(e)),e=H(e),e}}return null}},{match:"[<from>#Date+] (to|until|upto|through|thru|and) [<to>#Time+]",desc:"january from 3pm to 4pm",parse:(t,e)=>{let a=t.groups("from"),n=t.groups("to");if(a=z(a,e),a){let t=a.clone();if(t.applyTime(n.text("implicit")),t){let e={start:a,end:t,unit:"time"};return!1===/(am|pm)/.test(n.text())&&(e=P(e)),e=H(e),e}}return null}}],[{match:"^during? #Month+ (or|and) #Month [<year>#Year]?",desc:"march or june",parse:(t,e)=>{let a=t.match("^during? [#Month]",0);t=t.not("(or|and)");let n=z(a,e);if(n){let i=[{start:n,end:n.clone().end(),unit:n.unit}],r=t.not(a);r.found&&r.match("#Month").forEach(t=>{let a=z(t,e);i.push({start:a,end:a.clone().end(),unit:a.unit})});let s=t.match("#Year$");return s.found&&(s=s.text("reduced"),i.forEach(t=>{t.start.d=t.start.d.year(s),t.end.d=t.end.d.year(s)})),i}return null}},{match:"^#Month #Value+ (or|and)? #Value$",desc:"jan 5 or 8",parse:(t,e)=>{let a=(t=t.not("(or|and)")).match("^#Month #Value"),n=z(a,e);if(n){let e=[{start:n,end:n.clone().end(),unit:n.unit}],i=t.not(a);return i.found&&i.match("#Value").forEach(t=>{let a=n.clone();a.d=a.d.date(t.text("reduced")),e.push({start:a,end:a.clone().end(),unit:a.unit})}),e}return null}},{match:"^#Month+ #Value #Value+$",desc:"jan 5 8",parse:(t,e)=>{let a=t.match("#Month"),n=t.match("#Year");t=t.not("#Year");let i=[];return t.match("#Value").forEach(t=>{let r=(t=t.clone()).prepend(a.text());n.found&&r.append(n);let s=z(r,e);s&&i.push({start:s,end:s.clone().end(),unit:s.unit})}),i}},{match:"^#Value+ (or|and)? #Value of #Month #Year?$",desc:"5 or 8 of Jan",parse:(t,e)=>{let a=t.match("#Month"),n=t.match("#Year");t=t.not("#Year");let i=[];return t.match("#Value").forEach(t=>{let r=t.append(a);n.found&&r.append(n);let s=z(r,e);s&&i.push({start:s,end:s.clone().end(),unit:s.unit})}),i}},{match:"^!(between|from|during)? [<from>#Date+] (and|or) [<to>#Date+]$",desc:"A or B",parse:(t,e)=>{let a=t.groups("from"),n=t.groups("to"),i=z(a,e),r=z(n,e);return i&&r?[{start:i,end:i.clone().end()},{start:r,end:r.clone().end()}]:null}}],[{match:"between [<start>.+] and [<end>.+]",desc:"between friday and sunday",parse:(t,e)=>{let a=t.groups("start");a=z(a,e);let n=t.groups("end");return n=z(n,e),a&&n?(n=n.before(),{start:a,end:n}):null}},{match:"[<from>#Month #Value] (to|through|thru) [<to>#Month #Value] [<year>#Year?]",desc:"june 5 to june 7",parse:(t,e)=>{let a=t.groups(),n=a.from;if(a.year&&(n=n.append(a.year)),n=z(n,e),n){let t=a.to;if(a.year&&(t=t.append(a.year)),t=z(t,e),t)return n.d.isAfter(t.d)&&(t.d=t.d.add(1,"year")),{start:n,end:t.end()}}return null}},{match:"[<month>#Month] [<from>#Value] (to|through|thru) [<to>#Value] of? [<year>#Year]",desc:"january 5 to 7 1998",parse:(t,e)=>{let{month:a,from:n,to:i,year:r}=t.groups(),s=r.clone(),o=n.prepend(a).append(r);if(o=z(o,e),o){let t=i.prepend(a).append(s);return t=z(t,e),{start:o,end:t.end()}}return null}},{match:"[<from>#Value] (to|through|thru) [<to>#Value of? #Month #Date+?]",desc:"5 to 7 of january 1998",parse:(t,e)=>{let a=t.groups("to");if(a=z(a,e),a){let e=t.groups("from"),n=a.clone();return n.d=n.d.date(e.text("implicit")),{start:n,end:a.end()}}return null}},{match:"[<from>#Month #Value] (to|through|thru) [<to>#Value]",desc:"january 5 to 7",parse:(t,e)=>{let a=t.groups("from");if(a=z(a,e),a){let e=t.groups("to"),n=a.clone();return n.d=n.d.date(e.text("implicit")),{start:a,end:n.end()}}return null}},{match:"from? [<from>#Month] (to|until|upto|through|thru) [<to>#Month] [<year>#Year]",desc:"january to may 2020",parse:(t,e)=>{let a=t.groups("from"),n=t.groups("year").numbers().get()[0],i=t.groups("to");if(a=z(a,e),i=z(i,e),a.d=a.d.year(n),i.d=i.d.year(n),a&&i){let t={start:a,end:i.end()};return t=H(t),t}return null}}],[{match:"from? [<from>.+] (to|until|upto|through|thru) [<to>.+]",desc:"from A to B",parse:(t,e)=>{let a=t.groups("from"),n=t.groups("to");if(a=z(a,e),n=z(n,e),a&&n){let t={start:a,end:n.end()};return t=H(t),t}return null}},{match:"^due? (by|before) [.+]",desc:"before june",parse:(t,e)=>{t=t.group(0);let a=z(t,e);if(a){let t=new Unit(e.today,null,e);return t.d.isAfter(a.d)&&(t=a.clone().applyShift({weeks:-2})),{start:t,end:a.clone().applyShift({day:-1}).end()}}return null}},{match:"^(on|in|at|@|during) [.+]",desc:"in june",parse:(t,e)=>{t=t.group(0);let a=z(t,e);return a?{start:a,end:a.clone().end(),unit:a.unit}:null}},{match:"^(after|following) [.+]",desc:"after june",parse:(t,e)=>{t=t.group(0);let a=z(t,e);return a?(a=a.after(),{start:a.clone(),end:B(a.clone(),e)}):null}},{match:"^(middle|center|midpoint) of [.+]",desc:"middle of",parse:(t,e)=>{t=t.group(0);let a=z(t,e),n=a.clone().middle(),i=a.beforeEnd();return a?{start:n,end:i}:null}},{match:".+ after #Time+$",desc:"tuesday after 5pm",parse:(t,e)=>{let a=z(t,e);return a?{start:a.clone(),end:a.end(),unit:"time"}:null}},{match:".+ before #Time+$",desc:"tuesday before noon",parse:(t,e)=>{let a=z(t,e);if(a){let t=a.clone(),e=a.start();if(a)return{start:e,end:t,unit:"time"}}return null}}]),N="undefined"==typeof process?self.env||{}:process.env,Y=function(t,e){let a={start:null,end:null};if(!t.found)return a;let n=z(t,e);if(n){let t=n.clone().end();a={start:n,end:t,unit:n.setTime?"time":n.unit}}return a},L=function(t,e){let a=function(t,e){let a=t.match("[<logic>(every|any|each)] [<skip>other?] [<unit>#Duration] (starting|beginning|commencing)?");if(a.found){let e={interval:{}},n=a.groups("unit").text("reduced");return e.interval[n]=1,e.choose=j(a),a.groups("skip").found&&(e.interval[n]=2),t=t.remove(a),{repeat:e}}if(a=t.match("[<logic>(every|any|each)] [<num>#Value] [<unit>#Duration] (starting|beginning|commencing)?"),a.found){let e={interval:{}},n=a.groups("unit");n.nouns().toSingular();let i=n.text("reduced");return e.interval[i]=a.groups("num").numbers().get()[0],e.choose=j(a),t=t.remove(a),{repeat:e}}if(a=t.match("[<logic>(every|any|each|a)] [<skip>other?] [<day>#WeekDay+] (starting|beginning|commencing)?"),a.found){let e={interval:{day:1},filter:{weekDays:{}}},n=a.groups("day").text("reduced");if(n=$[n],n)return e.filter.weekDays[n]=!0,e.choose=j(a),t=t.remove(a),{repeat:e}}if(a=t.match("[<logic>(every|any|each|a)] [<day>(weekday|week day|weekend|weekend day)] (starting|beginning|commencing)?"),a.found){let e={interval:{day:1},filter:{weekDays:{}}},n=a.groups("day");return n.has("(weekday|week day)")?e.filter.weekDays={monday:!0,tuesday:!0,wednesday:!0,thursday:!0,friday:!0}:n.has("(weekend|weekend day)")&&(e.filter.weekDays={saturday:!0,sunday:!0}),e.choose=j(a),t=t.remove(a),{repeat:e}}if(a=t.match("[<day>(mondays|tuesdays|wednesdays|thursdays|fridays|saturdays|sundays)] (at|near|after)? [<time>#Time+?]"),a.found){let n={interval:{day:1},filter:{weekDays:{}}},i=a.groups("day").text("reduced");if(i=i.replace(/s$/,""),i=$[i],i){n.filter.weekDays[i]=!0,n.choose="OR",t=t.remove(a);let r=a.groups("time");return r.found&&(n.time=h(r,e)),{repeat:n}}}return null}(t,e)||{},n=function(t,e){for(let i=0;i<W.length;i+=1){let r=W[i],s=t.match(r.match);if(s.found){n=` ---[${r.desc}]---`,N.DEBUG_DATE&&console.log(`\n  ${n} `);let t=r.parse(s,e);if(null!==t)return a=t,"[object Array]"!==Object.prototype.toString.call(a)&&(t=[t]),t}}var a,n;return null}(t,e);return n||(n=[Y(t,e)]),n=n.map(t=>Object.assign({},a,t)),n.forEach(t=>{t.start&&t.end&&t.start.d.epoch>t.end.d.epoch&&(t.start=t.start.start())}),n},J=function(t,e){return!1===(e=e||{}).timezone&&(e.timezone="UTC"),e.today=e.today||n.default.now(e.timezone),e.today=n.default(e.today,e.timezone),t=function(t){return t.numbers||console.warn("\nCompromise warning: compromise/three must be used with compromise-dates plugin\n"),(t=t.clone()).numbers().toNumber(),t.contractions().expand(),t.replace("week end","weekend",!0).tag("Date"),t.replace("up to","upto",!0).tag("Date"),!1===t.has("once (a|an) #Duration")&&t.match("[(a|an)] #Duration",0).replaceWith("1",{tags:!0}).compute("lexicon"),t.match("@hasDash").insertAfter("to").tag("Date"),t}(t),L(t,e)},K=function(t){if(!t.start)return{start:null,end:null,timezone:null,duration:{}};let e=t.end?function(t){let e=t.end.d.add(1,"millisecond").since(t.start.d).diff;return delete e.milliseconds,delete e.seconds,e}(t):{};return{start:t.start.format("iso"),end:t.end?t.end.format("iso"):null,timezone:t.start.d.format("timezone"),duration:e}},R=function(t,e={}){let a=h(t,e);if(!a.result)return{time:null,"24h":null};let i=n.default.now().time(a.result);return{time:a.result,"24h":i.format("time-24"),hour:i.hour(),minute:i.minute()}},I=(t,e)=>"number"==typeof e?t.eq(e):t,U={century:!0,day:!0,decade:!0,hour:!0,millisecond:!0,minute:!0,month:!0,second:!0,weekend:!0,week:!0,year:!0,quarter:!0,season:!0};let F={m:"minute",h:"hour",hr:"hour",min:"minute",sec:"second","week end":"weekend",wk:"week",yr:"year",qtr:"quarter"};Object.keys(F).forEach(t=>{F[t+"s"]=F[t]});const Q=function(t){let e={},a=t.match("#Value+ #Duration");if(a.found)a.forEach(t=>{let a=t.numbers().get()[0],n=t.terms().last().nouns().toSingular().text("reduced");F.hasOwnProperty(n)&&(n=F[n]),U.hasOwnProperty(n)&&null!==a&&(e[n]=a)});else if(t.match("(#Duration && /[0-9][a-z]+$/)").found){let a=t.text(),n=a.match(/([0-9]+)/),i=a.match(/([a-z]+)/);n&&i&&(n=n[0]||null,i=i[0]||null,F.hasOwnProperty(i)&&(i=F[i]),U.hasOwnProperty(i)&&null!==n&&(e[i]=Number(n)))}return e},G={get:function(t){let e=[];return this.forEach(t=>{let a=Q(t);e.push(a)}),"number"==typeof t?e[t]:e},json(t={}){return this.map(e=>{let a=e.toView().json(t)[0]||{};return t&&!0!==t.times&&(a.duration=Q(e)),a},[])}},X="(in|by|before|during|on|until|after|of|within|all)",Z="(last|next|this|previous|current|upcoming|coming)",tt="(start|end|middle|starting|ending|midpoint|beginning)",et="(spring|summer|winter|fall|autumn)",at=(t,e)=>{!0===t.found&&t.forEach(t=>{let a=t.text("reduced"),n=parseInt(a,10);n&&n>1e3&&n<3e3&&t.tag("Year",e)})},nt=(t,e)=>{!0===t.found&&t.forEach(t=>{let a=t.text("reduced"),n=parseInt(a,10);n&&n>1900&&n<2030&&t.tag("Year",e)})},it="date-values",rt="date-tagger",st="section-tagger",ot="time-tagger",ut=function(t,e){t.found&&(t.tag("Date",e),t.numbers().lessThan(31).ifNo("#Year").tag("#Time",e))},dt="shift-tagger",mt=["act","aft","akst","anat","art","azot","azt","bnt","bot","bt","cast","cat","cct","chast","chut","ckt","cvt","cxt","davt","eat","ect","fjt","fkst","fnt","gamt","get","gft","gilt","gyt","hast","hncu","hneg","hnnomx","hnog","hnpm","hnpmx","hntn","hovt","iot","irkt","jst","kgt","kost","lint","magt","mart","mawt","mmt","nct","nft","novt","npt","nrt","nut","nzst","omst","pet","pett","phot","phst","pont","pwt","ret","sakt","samt","sbt","sct","sret","srt","syot","taht","tft","tjt","tkt","tlt","tmt","tot","tvt","ulat","vut","wakt","wat","wet","wft","wit","wst","yekt"].reduce((t,e)=>(t[e]=!0,t),{}),lt="fix-tagger";var ht={dates:function(t){var e;return function(t){t.match("in the (night|evening|morning|afternoon|day|daytime)").tag("Time","in-the-night"),t.match("(#Value|#Time) (am|pm)").tag("Time","value-ampm"),t.match("/^[0-9]{4}-[0-9]{2}$/").tag("Date","2012-06"),t.match("(tue|thu)").tag("WeekDay","misc-weekday"),t.match("(march|april|may) (and|to|or|through|until)? (march|april|may)").tag("Date").match("(march|april|may)").tag("Month","march|april|may");let e=t.if("#Month");!0===e.found&&(e.match("#Month #Date+").tag("Date","correction-numberRange"),e.match("#Value of #Month").tag("Date","value-of-month"),e.match("#Cardinal #Month").tag("Date","cardinal-month"),e.match("#Month #Value (and|or|to)? #Value+").tag("Date","value-to-value"),e.match("#Month the #Value").tag("Date","month-the-value"),e.match("(march|may) to? #Date").tag("Date").match("^.").tag("Month","march-to"),e.match("^(march|may)$").tag("Month","single-march"),e.match("#Month or #Month").tag("Date","month-or-month"));let a=t.if("#Value");if(!0===a.found){a.match("(#WeekDay|#Month) #Value").ifNo("#Money").tag("Date","date-value"),a.match("#Value (#WeekDay|#Month)").ifNo("#Money").tag("Date","value-date"),a.match("#TextValue #TextValue").if("#Date").tag("#Date","textvalue-date"),a.match("#Value (#WeekDay|#Duration) back").tag("#Date","3-back");let t=a.if("#Duration");!0===t.found&&(t.match("for #Value #Duration").tag("Date","for-x-duration"),t.match("#Value #Duration #Conjunction").tag("Date","val-duration-conjunction"),t.match(X+"? #Value #Duration").tag("Date","value-duration"),t.match("#Value #Duration old").unTag("Date","val-years-old"))}let n=t.if(et);!0===n.found&&(n.match(`${X}? ${Z} ${et}`).tag("Date","thisNext-season"),n.match(`the? ${tt} of ${et}`).tag("Date","section-season"),n.match(`${et} ${X}? #Cardinal`).tag("Date","season-year"));let i=t.if("#Date");!0===i.found&&(i.match("#Date the? #Ordinal").tag("Date","correction"),i.match(Z+" #Date").tag("Date","thisNext-date"),i.match("due? (by|before|after|until) #Date").tag("Date","by"),i.match("(last|next|this|previous|current|upcoming|coming|the) #Date").tag("Date","next-feb"),i.match(`the? ${tt} of #Date`).tag("Date","section-of"),i.match("#Ordinal #Duration in #Date").tag("Date","duration-in"),i.match("(early|late) (at|in)? the? #Date").tag("Time","early-evening"),i.match("#Date (by|before|after|at|@|about) #Cardinal").not("^#Date").tag("Time","date-before-Cardinal"),i.match("#Date [(am|pm)]",0).unTag("Verb").unTag("Copula").tag("Time","date-am"),i.match("#Date (#Preposition|to) #Date").ifNo("#Duration").tag("Date","date-prep-date"));let r=t.if("#Cardinal");if(!0===r.found){let t=r.match("#Date #Value [#Cardinal]",0);at(t,"date-value-year"),t=r.match("#Date [#Cardinal]",0),nt(t,"date-year"),t=r.match(tt+" of [#Cardinal]"),nt(t,"section-year"),t=r.match("#Month #Value [#Cardinal]",0),at(t,"month-value-year"),t=r.match("#Month #Value to #Value [#Cardinal]",0),at(t,"month-range-year"),t=r.match("(in|of|by|during|before|starting|ending|for|year|since) [#Cardinal]",0),at(t,"in-year-1"),t=r.match("(q1|q2|q3|q4) [#Cardinal]",0),at(t,"in-year-2"),t=r.match("#Ordinal quarter of? [#Cardinal]",0),at(t,"in-year-3"),t=r.match("the year [#Cardinal]",0),at(t,"in-year-4"),t=r.match("it (is|was) [#Cardinal]",0),nt(t,"in-year-5"),r.match(tt+" of #Year").tag("Date");let e=r.match("between [#Cardinal] and [#Cardinal]");at(e.groups("0"),"between-year-and-year-1"),at(e.groups("1"),"between-year-and-year-2")}let s=t.if("#Time");!0===s.found&&s.match("(by|before|after|at|@|about) #Time").tag("Time","preposition-time");let o=t.match("^/^20[012][0-9]$/$");nt(o,"2020-ish"),t.match("(in|after) /^[0-9]+(min|sec|wk)s?/").tag("Date","shift-units"),t.match("#Date [(now|night|sometime)]",0).tag("Time","date-now"),t.match("(from|starting|until|by) now").tag("Date","for-now"),t.match("(each|every) night").tag("Date","for-now")}(t),(e=t).has("#Value")&&(e.match("#Month #Value to #Value of? #Year?").tag("Date",it),e.match("#Value to #Value of? #Month #Year?").tag("Date",it),e.match("#Value #Duration of #Date").tag("Date",it),e.match("#Value+ #Duration (after|before|into|later|afterwards|ago)?").tag("Date",it),e.match("#Value #Date").tag("Date",it),e.match("#Date #Value").tag("Date",it),e.match("#Date #Preposition #Value").tag("Date",it),e.match("#Date (after|before|during|on|in) #Value").tag("Date",it),e.match("#Value (year|month|week|day) and a half").tag("Date",it),e.match("#Value and a half (years|months|weeks|days)").tag("Date",it),e.match("on the #Ordinal").tag("Date",it),e.match("#Month #Value+ (and|or) #Value").tag("Date","date-or-date"),e.match("#Value+ (and|or) #Value of #Month ").tag("Date","date-and-date")),function(t){t.match("(spring|summer|winter|fall|autumn|springtime|wintertime|summertime)").match("#Noun").tag("Season",rt),t.match("(q1|q2|q3|q4)").tag("FinancialQuarter",rt),t.match("(this|next|last|current) quarter").tag("FinancialQuarter",rt),t.match("(this|next|last|current) season").tag("Season",rt),t.has("#Date")&&(t.match("#Date #Preposition #Date").tag("Date",rt),t.match("(once|twice) (a|an|each) #Date").tag("Date",rt),t.match("#Date+").tag("Date",rt),t.match("(by|until|on|in|at|during|over|every|each|due) the? #Date").notIf("#PhrasalVerb").tag("Date","until-june"),t.match("a #Duration").tag("Date",rt),t.match("(between|from) #Date").tag("Date",rt),t.match("(to|until|upto) #Date").tag("Date",rt),t.match("#Date and #Date").tag("Date",rt),t.match("(by|until|after|before|during|on|in|following|since) (next|this|last)? (#Date|#Date)").notIf("#PhrasalVerb").tag("Date",rt),t.match("the? #Date after next one?").tag("Date",rt),t.match("(about|approx|approximately|around) #Date").tag("Date",rt))}(t),function(t){t.has("#Date")&&(t.match("this? (last|next|past|this|previous|current|upcoming|coming|the) #Date").tag("Date",st),t.match("(starting|beginning|ending) #Date").tag("Date",st),t.match("the? (start|end|middle|beginning) of (last|next|this|the) (#Date|#Date)").tag("Date",st),t.match("(the|this) #Date").tag("Date",st),t.match("#Date up to #Date").tag("Date",st))}(t),function(t){t.match("#Cardinal oclock").tag("Time",ot),t.match("/^[0-9]{2}h[0-9]{2}$/").tag("Time",ot),t.match("/^[0-9]{2}/[0-9]{2}/").tag("Date",ot).unTag("Value"),t.match("#Value (in|at) the? (morning|evening|night|nighttime)").tag("Time",ot),t.has("#Month")||(t.match("(5|10|15|20|five|ten|fifteen|quarter|twenty|half) (to|after|past) #Cardinal").tag("Time",ot),t.match("(at|by|before) (5|10|15|20|five|ten|fifteen|twenty|quarter|half) (after|past|to)").tag("Time","at-20-past"));let e=t.if("#Date");if(e.found){e.match("/^[0-9]{4}[:-][0-9]{2}[:-][0-9]{2}T[0-9]/").tag("Time",ot),e.match("#Date [at #Cardinal]",0).notIf("#Year").tag("Time",ot),e.match("half an (hour|minute|second)").tag("Date",ot),e.match("(in|for|by|near|at) #Timezone").tag("Timezone",ot),e.match("#Time to #Time").tag("Date",ot),e.match("#Time [(sharp|on the dot)]",0).tag("Time",ot);let a=e.if("#NumberRange");if(a.found){let t=a.match("[#NumberRange+] (on|by|at)? #WeekDay",0);ut(t,"3-4-tuesday"),t=a.match("[#NumberRange+] (on|by|at)? #Month #Value",0),ut(t,"3-4 mar 3"),t=a.match("[#NumberRange] to (#NumberRange && #Time)",0),ut(t,"3-4pm"),t=a.match("(#NumberRange && #Time) to [#NumberRange]",0),ut(t,"3pm-4")}let n=e.match("(from|between) #Cardinal and #Cardinal (in|on)? (#WeekDay|tomorrow|yesterday)");ut(n,"from 9-5 tues"),n=t.match("#Cardinal to #Cardinal (#WeekDay|tomorrow|yesterday)"),ut(n,"9-5 tues"),n=e.match("(from|between) [#NumericValue] (to|and) #Time",0).tag("Time","4-to-5pm"),ut(n,"from 9-5pm"),n=e.match("(#WeekDay|tomorrow|yesterday) (from|between)? (#Cardinal|#Time) (and|to) (#Cardinal|#Time)"),ut(n,"tues 3-5"),n=e.match("#Month #Value+ (from|between) [<time>(#Cardinal|#Time) (and|to) (#Cardinal|#Time)]").group("time"),ut(n,"sep 4 from 9-5"),n=e.match("#Time to #Cardinal on? #Date"),ut(n,"3pm-4 wed"),n=e.match("#Cardinal to #Time on? #Date"),ut(n,"3-4pm wed"),n=e.match("#Cardinal to #Cardinal on? (#WeekDay|#Month #Value)"),ut(n,"3-4 wed")}t.match("(at|around|near|#Date) [#Cardinal (thirty|fifteen) (am|pm)?]",0).tag("Time",ot),t.match("(anytime|sometime) (before|after|near) #Cardinal").tag("Date","antime-after-3").lastTerm().tag("Time")}(t),function(t){t.has("#Date")&&(t.match("#Cardinal #Duration (before|after|ago|from|hence|back)").tag("DateShift",dt),t.match("in #Cardinal #Duration").tag("DateShift",dt),t.match("in (a|an) #Duration").tag("DateShift",dt),t.match("[(a|an) #Duration from] #Date",0).tag("DateShift",dt),t.match("(a|an) #Duration ago").tag("DateShift",dt),t.match("in half (a|an) #Duration").tag("DateShift",dt),t.match("in a (few|couple) of? #Duration").tag("DateShift",dt),t.match("#Cardinal #Duration and? #DateShift").tag("DateShift",dt),t.match("#DateShift and #Cardinal #Duration").tag("DateShift",dt),t.match("[#Duration (after|before)] #Date",0).tag("DateShift",dt))}(t),function(t){t.match("#Month #Ordinal and #Ordinal").tag("Date","ord-and-ord"),t.match("every other #Duration").tag("Date","every-other"),t.match("(every|any|each|a) (day|weekday|week day|weekend|weekend day)").tag("Date","any-weekday"),t.match("(every|any|each|a) (#WeekDay)").tag("Date","any-wednesday"),t.match("(every|any|each|a) (#Duration)").tag("Date","any-week")}(t),function(t){let e=t.match("#Time [#Acronym]",0);if(e.found){let t=e.text("reduced");!0===mt[t]&&e.tag("Timezone","tz-abbr")}}(t),function(t){if(t.has("#Date")){let e=t.match("#Date+ by #Date+");e.found&&!e.has("^due")&&e.match("^#Date+").unTag("Date","by-monday"),t.match("[(wed|sat)] (#Month|#Year|on|between|during|from)",0).tag("WeekDay","wed");let a=t.match("#Date+");a.match("^day$").unTag("Date","spa-day"),a.match("(in|of|by|for)? (#Possessive && #Date)").unTag("Date","tomorrows meeting");let n="(yesterday|today|tomorrow)";a.has(n)&&(a.match(n+" [#Value]$").unTag("Date","yesterday-7"),a.match(`^[#Value] ${n}$`,0).unTag("Date","7 yesterday"),a.match(`#WeekDay+ ${n}$`).unTag("Date").lastTerm().tag("Date","fri-yesterday")),a.match("on #Cardinal$").unTag("Date","on 5"),a.match("this tomorrow").terms(0).unTag("Date","this-tomorrow"),a.match("(q1|q2|q3|q4) #Year").tag("Date",lt),a.match("^#Value (this|next|last)").terms(0).unTag("Date","4 next"),a.has("(last|this|next)")&&(a.match("(last|this|next) #Duration #Value").terms(2).unTag("Date","this month 7"),a.match("!#Month #Value (last|this|next) #Date").terms(0).unTag("Date","7 this month")),a.has("^between")&&!a.has("and .")&&a.unTag("Date",lt),a.match("(in|over) the #Duration #Date+?").unTag("Date","over-the-duration"),a.has("(minutes|seconds|weeks|hours|days|months)")&&!a.has("#Value #Duration")&&a.match("(minutes|seconds|weeks|hours|days|months)").unTag("Date","log-hours"),a.has("about #Holiday")&&a.match("about").unTag("#Date","about-thanksgiving"),a.match("#Ordinal quarter of? #Year").unTag("Fraction"),a.match("(from|by|before) now").unTag("Time"),a.match("#Date+").match("^the").unTag("Date")}}(t),t}};const ct="Australia/",ft="Pacific/",yt={"british summer time":"Europe/London",bst:"Europe/London","british time":"Europe/London","britain time":"Europe/London","irish summer time":"Europe/Dublin","irish time":"Europe/Dublin","central european time":"Europe/Berlin",cet:"Europe/Berlin","central european summer time":"Europe/Berlin",cest:"Europe/Berlin","central europe":"Europe/Berlin","eastern european time":"Europe/Riga",eet:"Europe/Riga","eastern european summer time":"Europe/Riga",eest:"Europe/Riga","eastern europe time":"Europe/Riga","western european time":"Europe/Lisbon","western european summer time":"Europe/Lisbon","turkey standard time":"Europe/Istanbul","turkish time":"Europe/Istanbul",utc:"Africa/Freetown","greenwich standard time":"Africa/Freetown",gmt:"Africa/Freetown","east africa time":"Africa/Nairobi","east african time":"Africa/Nairobi","eastern africa time":"Africa/Nairobi","central africa time":"Africa/Khartoum","central african time":"Africa/Khartoum","south africa standard time":"Africa/Johannesburg","west africa standard time":"Africa/Lagos","western africa time":"Africa/Lagos","west african time":"Africa/Lagos","australian central standard time":ct+"Adelaide",acst:ct+"Adelaide","australian central daylight time":ct+"Adelaide",acdt:ct+"Adelaide","australian eastern standard time":ct+"Brisbane",aest:ct+"Brisbane","australian eastern daylight time":ct+"Brisbane",aedt:ct+"Brisbane","australian western standard time":ct+"Perth",awst:ct+"Perth","australian western daylight time":ct+"Perth",awdt:ct+"Perth","australian central western standard time":ct+"Eucla",acwst:ct+"Eucla","lord howe standard time":ct+"Lord_Howe",lhst:ct+"Lord_Howe","lord howe daylight time":ct+"Lord_Howe",lhdt:ct+"Lord_Howe","russian standard time":"Europe/Moscow",msk:"Europe/Moscow","central standard time":"America/Chicago","central time":"America/Chicago",cst:"America/Havana","central daylight time":"America/Chicago",cdt:"America/Havana","mountain standard time":"America/Denver","mountain time":"America/Denver",mst:"America/Denver","mountain daylight time":"America/Denver",mdt:"America/Denver","atlantic standard time":"America/Halifax","atlantic time":"America/Halifax",ast:"Asia/Baghdad","atlantic daylight time":"America/Halifax",adt:"America/Halifax","eastern standard time":"America/New_York","eastern time":"America/New_York",est:"America/New_York","eastern daylight time":"America/New_York",edt:"America/New_York","pacific time":"America/Los_Angeles","pacific standard time":"America/Los_Angeles",pst:"America/Los_Angeles","pacific daylight time":"America/Los_Angeles",pdt:"America/Los_Angeles","alaskan standard time":"America/Anchorage","alaskan time":"America/Anchorage",ahst:"America/Anchorage","alaskan daylight time":"America/Anchorage",ahdt:"America/Anchorage","hawaiian standard time":ft+"Honolulu","hawaiian time":ft+"Honolulu",hst:ft+"Honolulu","aleutian time":ft+"Honolulu","hawaii time":ft+"Honolulu","newfoundland standard time":"America/St_Johns","newfoundland time":"America/St_Johns","newfoundland daylight time":"America/St_Johns","brazil time":"America/Sao_Paulo","brazilian time":"America/Sao_Paulo","argentina time":"America/Buenos_Aires","argentinian time":"America/Buenos_Aires","amazon time":"America/Manaus","amazonian time":"America/Manaus","easter island standard time":"Chile/Easterisland","easter island summer time":"Chile/Easterisland",easst:"Chile/Easterisland","venezuelan standard time":"America/Caracas","venezuelan time":"America/Caracas","venezuela time":"America/Caracas","paraguay time":"America/Asuncion","paraguay summer time":"America/Asuncion","cuba standard time":"America/Havana","cuba time":"America/Havana","cuba daylight time":"America/Havana","cuban time":"America/Havana","bolivia time":"America/La_Paz","bolivian time":"America/La_Paz","colombia time":"America/Bogota","colombian time":"America/Bogota","acre time":"America/Eirunepe","peru time":"America/Lima","chile standard time":"America/Punta_Arenas","chile time":"America/Punta_Arenas",clst:"America/Punta_Arenas","chile summer time":"America/Punta_Arenas",cldt:"America/Punta_Arenas","uruguay time":"America/Montevideo",uyt:"America/Montevideo","arabic standard time":"Asia/Baghdad","iran standard time":"Asia/Tehran","iran time":"Asia/Tehran","iran daylight time":"Asia/Tehran","pakistan standard time":"Asia/Karachi","pakistan time":"Asia/Karachi","india standard time":"Asia/Kolkata","indian time":"Asia/Kolkata","indochina time":"Asia/Bangkok","china standard time":"Asia/Shanghai","alma-ata time":"Asia/Almaty","oral time":"Asia/Oral","orat time":"Asia/Oral","yakutsk time":"Asia/Yakutsk",yakt:"Asia/Yakutsk","gulf standard time":"Asia/Dubai","gulf time":"Asia/Dubai","hong kong time":"Asia/Hong_Kong","western indonesian time":"Asia/Jakarta","indonesia time":"Asia/Jakarta","central indonesian time":"Asia/Makassar","israel daylight time":"Asia/Jerusalem","israel standard time":"Asia/Jerusalem","israel time":"Asia/Jerusalem","krasnoyarsk time":"Asia/Krasnoyarsk","malaysia time":"Asia/Kuala_Lumpur","singapore time":"Asia/Singapore","korea standard time":"Asia/Seoul","korea time":"Asia/Seoul",kst:"Asia/Seoul","korean time":"Asia/Seoul","uzbekistan time":"Asia/Samarkand","vladivostok time":"Asia/Vladivostok","maldives time":"Indian/Maldives","mauritius time":"Indian/Mauritius","marshall islands time":ft+"Kwajalein","samoa standard time":ft+"Midway","somoan time":ft+"Midway","chamorro standard time":ft+"Guam","papua new guinea time":ft+"Bougainville"};let gt=n.default().timezones,pt=Object.keys(gt).reduce((t,e)=>(t[e]=e,t),{});var Dt=Object.assign({},yt,pt);let At={"a couple":"Value",thur:"WeekDay",thurs:"WeekDay"};const wt=function(t,e){t.forEach(t=>{At[t]=e})};return wt(Object.keys(Dt),"#Timezone"),wt(["weekday","summer","winter","autumn","all day","eod","eom","eoy","standard time","daylight time","tommorrow"],"#Date"),wt(["centuries","century","day","days","decade","decades","hour","hours","hr","hrs","millisecond","milliseconds","minute","minutes","min","mins","month","months","seconds","sec","secs","week end","week ends","weekend","weekends","week","weeks","wk","wks","year","years","yr","yrs","quarter","qtr","qtrs","season","seasons"],"#Duration"),wt(["all hallows eve","all saints day","all sts day","april fools","armistice day","australia day","bastille day","boxing day","canada day","christmas eve","christmas","cinco de mayo","day of the dead","dia de muertos","dieciseis de septiembre","emancipation day","grito de dolores","groundhog day","halloween","harvey milk day","inauguration day","independence day","independents day","juneteenth","labour day","national freedom day","national nurses day","new years eve","new years","purple heart day","rememberance day","rosa parks day","saint andrews day","saint patricks day","saint stephens day","saint valentines day","st andrews day","st patricks day","st stephens day","st valentines day ","valentines day","valentines","veterans day","victoria day","womens equality day","xmas","epiphany","orthodox christmas day","orthodox new year","assumption of mary","all souls day","feast of the immaculate conception","feast of our lady of guadalupe","kwanzaa","imbolc","beltaine","lughnassadh","samhain","martin luther king day","mlk day","presidents day","mardi gras","tax day","commonwealth day","mothers day","memorial day","fathers day","columbus day","indigenous peoples day","canadian thanksgiving","election day","thanksgiving","t-day","turkey day","black friday","cyber monday","ash wednesday","palm sunday","maundy thursday","good friday","holy saturday","easter","easter sunday","easter monday","orthodox good friday","orthodox holy saturday","orthodox easter","orthodox easter monday","ascension day","pentecost","whitsunday","whit sunday","whit monday","trinity sunday","corpus christi","advent","tu bishvat","tu bshevat","purim","passover","yom hashoah","lag baomer","shavuot","tisha bav","rosh hashana","yom kippur","sukkot","shmini atzeret","simchat torah","chanukah","hanukkah","isra and miraj","lailat al-qadr","eid al-fitr","id al-Fitr","eid ul-Fitr","ramadan","eid al-adha","muharram","the prophets birthday","ostara","march equinox","vernal equinox","litha","june solistice","summer solistice","mabon","september equinox","fall equinox","autumnal equinox","yule","december solstice","winter solstice","chinese new year","diwali"],"#Holiday"),wt(["noon","midnight","morning","tonight","evening","afternoon","breakfast time","lunchtime","dinnertime","midday","eod","oclock","oclock","at night"],"#Time"),{tags:{FinancialQuarter:{is:"Date",not:["Fraction"]},Season:{is:"Date"},Year:{is:"Date",not:["RomanNumeral"]},Holiday:{is:"Date",also:"Noun"},DateShift:{is:"Date",not:["Timezone","Holiday"]}},words:At,compute:ht,api:function(t){!function(t){class Dates extends t{constructor(t,e,a,n={}){super(t,e,a),this.viewType="Nouns",this.opts=n}get(t){let e=[];return this.forEach(t=>{J(t,this.opts).forEach(t=>{e.push(K(t))})}),"number"==typeof t?e[t]:e}json(t={}){return this.map(e=>{let a=e.toView().json(t)[0]||{};if(t&&!0!==t.dates){let t=J(e,this.opts);a.dates=K(t[0])}return a},[])}format(t){let e=this.freeze().map(e=>{e.repair();let a=J(e,this.opts)[0]||{};if(a.start){let n=a.start.d,i=n.format(t);if(a.end){let e=a.end.d;!1===n.isSame(e,"day")&&(i+=" to "+e.format(t))}e.replaceWith(i)}return e});return new Dates(this.document,e.pointer,null,this.opts)}}t.prototype.dates=function(t){let e=function(t){let e=t.match("#Date+");e=e.filter(t=>{let e=t.has("^#Duration+$")||t.has("^#Value #Duration+$");return!(!0!==e||!t.has("(#FinancialQuarter|quarter)"))||!1===e});let a=e.match("[#Cardinal #Duration (in|on|this|next|during|for)] #Date",0);return a.found&&(e=e.not(a)),a=e.match("[#Cardinal #Duration] #WeekDay",0),a.found&&(e=e.not(a)),a=e.match("#Date [for #Value #Duration]$",0),a.found&&(e=e.not(a)),a=e.match("[#Cardinal #Duration] #Date",0),a.found&&!e.has("#Cardinal #Duration] (ago|from|before|after|back)")&&(e=e.not(a)),a=e.match("for #Cardinal #Duration"),a.found&&(e=e.not(a)),e=e.notIf("^one (#WeekDay|#Month)$"),e=function(t){let e=null;return t.has("^(between|within) #Date")?t:(t.has("#Month")&&(e=t.match("[#Month #Value] and? #Month",0).ifNo("@hasDash$"),e.found&&(t=t.splitAfter(e)),e=t.match("[#Value #Month] and? #Value #Month",0),e.found&&(t=t.splitAfter(e)),e=t.match("^[#Month] and? #Month #Ordinal?$",0),e.found&&(t=t.splitAfter(e)),e=t.match("[#Month #Value] #Month",0).ifNo("@hasDash$"),e.found&&(t=t.splitAfter(e))),t.has("#WeekDay")&&(e=t.match("^[#WeekDay] and? #WeekDay$",0).ifNo("@hasDash$"),e.found&&(t=t.splitAfter(e)),e=t.match("#WeekDay #WeekDay and? #WeekDay"),e.found&&(t=t.splitOn("#WeekDay")),e=t.match("[#WeekDay] (and|or|this|next)? #WeekDay",0).ifNo("@hasDash$"),e.found&&(t=t.splitAfter("#WeekDay"))),e=t.match("(this|next) #Duration [(today|tomorrow|yesterday)]",0),e.found&&(t=t.splitBefore(e)),e=t.match("[(today|tomorrow|yesterday)] #Value #Month",0),e.found&&(t=t.splitAfter(e)),e=t.match("[(today|tomorrow|yesterday)] (today|tomorrow|yesterday|#WeekDay)",0).ifNo("@hasDash$"),e.found&&(t=t.splitAfter(e)),t=t.not("^and"))}(e),e=e.notIf("(#Money|#Percentage)"),e=e.notIf("^per #Duration"),e}(this);return new Dates(this.document,e.pointer,null,t)}}(t),function(t){class Times extends t{constructor(t,e,a){super(t,e,a),this.viewType="Nouns"}get(t){return I(this,t).map(R)}json(t={}){return this.map(e=>{let a=e.toView().json(t)[0]||{};return t&&!0!==t.times&&(a.time=R(e)),a},[])}}t.prototype.times=function(t){let e=this.match("#Time+ (am|pm)?");return e=I(e,t),new Times(this.document,e.pointer)}}(t),function(t){class Durations extends t{constructor(t,e,a){super(t,e,a),this.context={}}}Object.assign(Durations.prototype,G),t.prototype.durations=function(t){let e=this.match("#Value+ #Duration (and? #Value+ #Duration)?");return e=e.concat(this.match("(#Duration && /[0-9][a-z]+$/)")),e=e.notIf("#DateShift"),"number"==typeof t&&(e=e.eq(t)),new Durations(this.document,e.pointer)}}(t)},hooks:["dates"]}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("spacetime"),require("spacetime-holiday")):"function"==typeof define&&define.amd?define(["spacetime","spacetime-holiday"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).compromiseDates=e(t.spacetime,t.spacetimeHoliday);
var t,e;t=this,e=function(t,e){function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=a(t),r=a(e);const i={second:!0,minute:!0,hour:!0,day:!0,week:!0,weekend:!0,month:!0,season:!0,quarter:!0,year:!0},s={wk:"week",min:"minute",sec:"second",weekend:"week"},o=function(t){let e=t.match("#Duration").text("normal");return e=e.replace(/s$/,""),s.hasOwnProperty(e)&&(e=s[e]),e},u={minute:!0},d={daybreak:"7:00am",breakfast:"8:00am",morning:"9:00am",noon:"12:00pm",midday:"12:00pm",afternoon:"2:00pm",lunchtime:"12:00pm",evening:"6:00pm",dinnertime:"6:00pm",night:"8:00pm",eod:"10:00pm",midnight:"12:00am"},m={quarter:15,half:30},l=function(t){let e=t.time("6:00am");return t.isBefore(e)?t.ampm("pm"):t},h=function(t,e){let a=t.match("(at|by|for|before|this|after)? #Time+");a=a.not("^(at|by|for|before|this|after)"),a=a.not("sharp"),a=a.not("on the dot");let r=n.default.now(e.timezone),i=r.clone(),s=a.text("reduced");if(d.hasOwnProperty(s))return{result:d[s],m:a};let o=a.match("^#Cardinal oclock (am|pm)?");if(o.found&&(r=r.hour(o.text("reduced")),r=r.startOf("hour"),r.isValid()&&!r.isEqual(i))){let t=o.match("(am|pm)");return r=t.found?r.ampm(t.text("reduced")):l(r),{result:r.time(),m:o}}if(o=a.match("(half|quarter|25|20|15|10|5) (past|after|to) #Cardinal"),o.found&&(r=function(t,e){let a=t.match("#Cardinal$"),n=t.not(a).match("(half|quarter|25|20|15|10|5)");a=a.text("reduced");let r=n.text("reduced");m.hasOwnProperty(r)&&(r=m[r]);let i=t.has("to");return e=(e=e.hour(a)).startOf("hour"),a<6&&(e=e.ampm("pm")),i?e.subtract(r,"minutes"):e.add(r,"minutes")}(o,r),r.isValid()&&!r.isEqual(i)))return r=l(r),{result:r.time(),m:o};if(o=a.match("[<min>(half|quarter|25|20|15|10|5)] (past|after)"),o.found){let t=o.groups("min").text("reduced"),a=n.default(e.today);if(m.hasOwnProperty(t)&&(t=m[t]),a=a.next("hour").startOf("hour").minute(t),a.isValid()&&!a.isEqual(i))return{result:a.time(),m:o}}if(o=a.match("[<min>(half|quarter|25|20|15|10|5)] to"),o.found){let t=o.groups("min").text("reduced"),a=n.default(e.today);if(m.hasOwnProperty(t)&&(t=m[t]),a=a.next("hour").startOf("hour").minus(t,"minutes"),a.isValid()&&!a.isEqual(i))return{result:a.time(),m:o}}if(o=a.match("[<time>#Time] (in|at) the? [<desc>(morning|evening|night|nighttime)]"),o.found){let t=o.groups("time").text("normal");if(/^[0-9]{1,2}$/.test(t)?(r=r.hour(t),r=r.startOf("hour")):r=r.time(t),r.isValid()&&!r.isEqual(i)){let t=o.groups("desc").text("reduced");return"evening"!==t&&"night"!==t||(r=r.ampm("pm")),{result:r.time(),m:o}}}if(o=a.match("this? [<desc>(morning|evening|tonight)] at [<time>(#Cardinal|#Time)]"),o.found){let t=o.groups(),e=t.time.text("reduced");if(/^[0-9]{1,2}$/.test(e)?(r=r.hour(e),r=r.startOf("hour")):r=r.time(e),r.isValid()&&!r.isEqual(i)){let e=t.desc.text("reduced");return"morning"===e&&(r=r.ampm("am")),"evening"!==e&&"tonight"!==e||(r=r.ampm("pm")),{result:r.time(),m:o}}}if(o=a.match("^#Cardinal$"),o.found){let t=o.text("reduced");if(r=r.hour(t),r=r.startOf("hour"),r.isValid()&&!r.isEqual(i))return!1===/(am|pm)/i.test(t)&&(r=l(r)),{result:r.time(),m:o}}let u=a.text("reduced");return r=r.time(u),r.isValid()&&!r.isEqual(i)?(!1===/(am|pm)/i.test(u)&&(r=l(r)),{result:r.time(),m:a}):e.dayStart?{result:e.dayStart,m:t.none()}:{result:null,m:t.none()}},c="Australia/",f="Pacific/",y={"british summer time":"Europe/London",bst:"Europe/London","british time":"Europe/London","britain time":"Europe/London","irish summer time":"Europe/Dublin","irish time":"Europe/Dublin",ireland:"Europe/Dublin","central european time":"Europe/Berlin",cet:"Europe/Berlin","central european summer time":"Europe/Berlin",cest:"Europe/Berlin","central europe":"Europe/Berlin","eastern european time":"Europe/Riga",eet:"Europe/Riga","eastern european summer time":"Europe/Riga",eest:"Europe/Riga","eastern europe time":"Europe/Riga","western european time":"Europe/Lisbon","western european summer time":"Europe/Lisbon","western europe":"Europe/Lisbon","turkey standard time":"Europe/Istanbul",trt:"Europe/Istanbul","turkish time":"Europe/Istanbul",etc:"Africa/Freetown",utc:"Africa/Freetown","greenwich standard time":"Africa/Freetown",gmt:"Africa/Freetown","east africa time":"Africa/Nairobi","east african time":"Africa/Nairobi","eastern africa time":"Africa/Nairobi","central africa time":"Africa/Khartoum","central african time":"Africa/Khartoum","south africa standard time":"Africa/Johannesburg",sast:"Africa/Johannesburg","southern africa":"Africa/Johannesburg","south african":"Africa/Johannesburg","west africa standard time":"Africa/Lagos","western africa time":"Africa/Lagos","west african time":"Africa/Lagos","australian central standard time":c+"Adelaide",acst:c+"Adelaide","australian central daylight time":c+"Adelaide",acdt:c+"Adelaide","australia central":c+"Adelaide","australian eastern standard time":c+"Brisbane",aest:c+"Brisbane","australian eastern daylight time":c+"Brisbane",aedt:c+"Brisbane","australia east":c+"Brisbane","australian western standard time":c+"Perth",awst:c+"Perth","australian western daylight time":c+"Perth",awdt:c+"Perth","australia west":c+"Perth","australian central western standard time":c+"Eucla",acwst:c+"Eucla","australia central west":c+"Eucla","lord howe standard time":c+"Lord_Howe",lhst:c+"Lord_Howe","lord howe daylight time":c+"Lord_Howe",lhdt:c+"Lord_Howe","russian standard time":"Europe/Moscow",msk:"Europe/Moscow",russian:"Europe/Moscow","central standard time":"America/Chicago","central time":"America/Chicago",cst:"America/Havana","central daylight time":"America/Chicago",cdt:"America/Havana","mountain standard time":"America/Denver","mountain time":"America/Denver",mst:"America/Denver","mountain daylight time":"America/Denver",mdt:"America/Denver","atlantic standard time":"America/Halifax","atlantic time":"America/Halifax",ast:"Asia/Baghdad","atlantic daylight time":"America/Halifax",adt:"America/Halifax","eastern standard time":"America/New_York",eastern:"America/New_York","eastern time":"America/New_York",est:"America/New_York","eastern daylight time":"America/New_York",edt:"America/New_York","pacific time":"America/Los_Angeles","pacific standard time":"America/Los_Angeles",pst:"America/Los_Angeles","pacific daylight time":"America/Los_Angeles",pdt:"America/Los_Angeles","alaskan standard time":"America/Anchorage","alaskan time":"America/Anchorage",ahst:"America/Anchorage","alaskan daylight time":"America/Anchorage",ahdt:"America/Anchorage","hawaiian standard time":f+"Honolulu","hawaiian time":f+"Honolulu",hst:f+"Honolulu","aleutian time":f+"Honolulu","hawaii time":f+"Honolulu","newfoundland standard time":"America/St_Johns","newfoundland time":"America/St_Johns",nst:"America/St_Johns","newfoundland daylight time":"America/St_Johns",ndt:"America/St_Johns","brazil time":"America/Sao_Paulo",brt:"America/Sao_Paulo","brasília":"America/Sao_Paulo",brasilia:"America/Sao_Paulo","brazilian time":"America/Sao_Paulo","argentina time":"America/Buenos_Aires","argentinian time":"America/Buenos_Aires","amazon time":"America/Manaus",amt:"America/Manaus","amazonian time":"America/Manaus","easter island standard time":"Chile/Easterisland",east:"Chile/Easterisland","easter island summer time":"Chile/Easterisland",easst:"Chile/Easterisland","venezuelan standard time":"America/Caracas","venezuelan time":"America/Caracas",vet:"America/Caracas","venezuela time":"America/Caracas","paraguay time":"America/Asuncion",pyt:"America/Asuncion","paraguay summer time":"America/Asuncion",pyst:"America/Asuncion","cuba standard time":"America/Havana","cuba time":"America/Havana","cuba daylight time":"America/Havana","cuban time":"America/Havana","bolivia time":"America/La_Paz","bolivian time":"America/La_Paz","colombia time":"America/Bogota",cot:"America/Bogota","colombian time":"America/Bogota","acre time":"America/Eirunepe","peru time":"America/Lima","chile standard time":"America/Punta_Arenas","chile time":"America/Punta_Arenas",clst:"America/Punta_Arenas","chile summer time":"America/Punta_Arenas",cldt:"America/Punta_Arenas","uruguay time":"America/Montevideo",uyt:"America/Montevideo",ist:"Asia/Jerusalem","arabic standard time":"Asia/Baghdad","arabic time":"Asia/Baghdad","arab time":"Asia/Baghdad","iran standard time":"Asia/Tehran","iran time":"Asia/Tehran",irst:"Asia/Tehran","iran daylight time":"Asia/Tehran",irdt:"Asia/Tehran",iranian:"Asia/Tehran","pakistan standard time":"Asia/Karachi","pakistan time":"Asia/Karachi",pkt:"Asia/Karachi","india standard time":"Asia/Kolkata","indian time":"Asia/Kolkata","indochina time":"Asia/Bangkok",ict:"Asia/Bangkok","south east asia":"Asia/Bangkok","china standard time":"Asia/Shanghai",ct:"Asia/Shanghai","chinese time":"Asia/Shanghai","alma-ata time":"Asia/Almaty",almt:"Asia/Almaty","oral time":"Asia/Oral","orat time":"Asia/Oral","yakutsk time":"Asia/Yakutsk",yakt:"Asia/Yakutsk","gulf standard time":"Asia/Dubai","gulf time":"Asia/Dubai",gst:"Asia/Dubai",uae:"Asia/Dubai","hong kong time":"Asia/Hong_Kong",hkt:"Asia/Hong_Kong","western indonesian time":"Asia/Jakarta",wib:"Asia/Jakarta","indonesia time":"Asia/Jakarta","central indonesian time":"Asia/Makassar",wita:"Asia/Makassar","israel daylight time":"Asia/Jerusalem",idt:"Asia/Jerusalem","israel standard time":"Asia/Jerusalem","israel time":"Asia/Jerusalem",israeli:"Asia/Jerusalem","krasnoyarsk time":"Asia/Krasnoyarsk",krat:"Asia/Krasnoyarsk","malaysia time":"Asia/Kuala_Lumpur",myt:"Asia/Kuala_Lumpur","singapore time":"Asia/Singapore",sgt:"Asia/Singapore","korea standard time":"Asia/Seoul","korea time":"Asia/Seoul",kst:"Asia/Seoul","korean time":"Asia/Seoul","uzbekistan time":"Asia/Samarkand",uzt:"Asia/Samarkand","vladivostok time":"Asia/Vladivostok",vlat:"Asia/Vladivostok","maldives time":"Indian/Maldives",mvt:"Indian/Maldives","mauritius time":"Indian/Mauritius",mut:"Indian/Mauritius","marshall islands time":f+"Kwajalein",mht:f+"Kwajalein","samoa standard time":f+"Midway",sst:f+"Midway","somoan time":f+"Midway","chamorro standard time":f+"Guam",chst:f+"Guam","papua new guinea time":f+"Bougainville",pgt:f+"Bougainville"};let p=n.default().timezones,g=Object.keys(p).reduce((t,e)=>(t[e]=e,t),{});var w=Object.assign({},y,g);const D=/(-?[0-9]+)h(rs)?/i,A=/(-?[0-9]+)/,k=/utc([-+]?[0-9]+)/i,b=/gmt([-+]?[0-9]+)/i,x=function(t){return(t=Number(t))>-13&&t<13?"Etc/GMT"+(t=((t*=-1)>0?"+":"")+t):null},v=function(t){let e=t.match("#Timezone+");e=e.not("(in|for|by|near|at)");let a=e.text("reduced");if(w.hasOwnProperty(a))return{result:w[a],m:e};let n=function(t){let e=t.match(D);if(null!==e)return x(e[1]);if(e=t.match(k),null!==e)return x(e[1]);if(e=t.match(b),null!==e){let t=-1*Number(e[1]);return x(t)}return e=t.match(A),null!==e?x(e[1]):null}(a);return n?{result:n,m:e}:{result:null,m:t.none()}},V=function(t,e){let a=function(t){let e={},a=t.none(),n=t.match("#DateShift+");if(!1===n.found)return{res:e,m:a};if(n.match("#Cardinal #Duration").forEach(t=>{let a=t.match("#Cardinal").numbers().get()[0];if(a&&"number"==typeof a){let n=o(t);!0===i[n]&&(e[n]=a)}}),!0===n.has("(before|ago|hence|back)$")&&Object.keys(e).forEach(t=>e[t]*=-1),a=n.match("#Cardinal #Duration"),n=n.not(a),a=n.match("[<unit>#Duration] [<dir>(after|before)]"),a.found){let t=a.groups("unit").text("reduced"),n=a.groups("dir").text("reduced");"after"===n?e[t]=1:"before"===n&&(e[t]=-1)}if(a=n.match("half (a|an) [#Duration]",0),a.found){let t=o(a);e[t]=.5}return a=t.match("#DateShift+"),{result:e,m:a}}(t),n=a.result;a=function(t){let e=t.match("[<num>#Value] [<unit>#Duration+] (of|in)");if(e.found){let t=e.groups(),a=t.num.numbers().get()[0],n=t.unit.text("reduced"),r={unit:n,num:Number(a)||0};return u[n]||(r.num-=1),{result:r,m:e}}if(e=t.match("[<dir>(first|initial|last|final)] [<unit>#Duration+] (of|in)"),e.found){let t=e.groups(),a=t.dir.text("reduced"),n=t.unit.text("reduced");return"initial"===a&&(a="first"),"final"===a&&(a="last"),{result:{unit:n,dir:a},m:e}}return{result:null,m:t.none()}}(t=t.not(a.m));let r=a.result;t=t.not(a.m),a=v(t);let s=a.result;t=t.not(a.m),a=h(t,e);let d=a.result;a=function(t){let e=t.match("#WeekDay");return e.found&&!t.has("^#WeekDay$")?t.has("(this|next|last) (next|upcoming|coming|past)? #WeekDay")?{result:null,m:t.none()}:{result:e.text("reduced"),m:e}:{result:null,m:t.none()}}(t=t.not(a.m));let m=a.result;a=function(t){let e=t.match("[(start|beginning) of] .",0);return e.found?{result:"start",m:e}:(e=t.match("[end of] .",0),e.found?{result:"end",m:e}:(e=t.match("[(middle|midpoint|center) of] .",0),e.found?{result:"middle",m:e}:{result:null,m:e}))}(t=t.not(a.m));let l=a.result;return a=function(t){if(t.has("(next|last|this)$"))return{result:null,m:t.none()};let e=t.match("^this? (next|upcoming|coming)");return e.found?{result:"next",m:e}:(e=t.match("^this? (past)"),e.found?{result:"this-past",m:e}:(e=t.match("^this? (last|previous)"),e.found?{result:"last",m:e}:(e=t.match("^(this|current)"),e.found?{result:"this",m:e}:{result:null,m:t.none()})))}(t=t.not(a.m)),{shift:n,counter:r,tz:s,time:d,weekDay:m,section:l,rel:a.result,doc:t=function(t){return(t=(t=(t=(t=(t=(t=t.not("[^the] !#Value",0)).not("#Preposition$")).not("#Conjunction$")).not("sharp")).not("on the dot")).not("^(on|of)")).not("(next|last|this)$")}(t=t.not(a.m))}};class Unit{constructor(t,e,a){this.unit=e||"day",this.setTime=!1;let r={};(a=a||{}).today&&(r={date:a.today.date(),month:a.today.month(),year:a.today.year()});let i=n.default(t,a.timezone,{today:r});Object.defineProperty(this,"d",{enumerable:!1,writable:!0,value:i}),Object.defineProperty(this,"context",{enumerable:!1,writable:!0,value:a})}clone(){let t=new Unit(this.d,this.unit,this.context);return t.setTime=this.setTime,t}log(){return console.log("--"),this.d.log(),console.log("\n"),this}applyShift(t={}){return Object.keys(t).forEach(e=>{this.d=this.d.add(t[e],e),"hour"!==e&&"minute"!==e||(this.setTime=!0)}),this}applyTime(t){if(t){if(/^[0-9]{1,2}$/.test(t)?this.d=this.d.hour(t):this.d=this.d.time(t),!/[ap]m/.test(t)){let t=this.d.time("6:00am");this.d.isBefore(t)&&(this.d=this.d.ampm("pm"));let e=this.d.time("10:00pm");this.d.isAfter(e)&&(this.d=this.d.ampm("am"))}}else this.d=this.d.startOf("day");return this.setTime=!0,this}applyWeekDay(t){if(t){let e=this.d.epoch;this.d=this.d.day(t),this.d.epoch<e&&(this.d=this.d.add(1,"week"))}return this}applyRel(t){return"next"===t?this.next():"last"===t||"this-past"===t?this.last():this}applySection(t){return"start"===t?this.start():"end"===t?this.end():"middle"===t?this.middle():this}format(t){return this.d.format(t)}start(){return this.d=this.d.startOf(this.unit),this.context.dayStart&&(this.d=this.d.time(this.context.dayStart)),this}end(){if(this.d=this.d.endOf(this.unit),this.context.dayEnd){this.d=this.d.startOf("day");let t=this.d.time(this.context.dayEnd);if(t.isAfter(this.d))return this.d=t,this}return this}middle(){let t=this.d.diff(this.d.endOf(this.unit)),e=Math.round(t.minutes/2);return this.d=this.d.add(e,"minutes"),this}beforeEnd(){let t=this.d.startOf(this.unit).diff(this.d.endOf(this.unit)),e=Math.round(t.minutes/4);return this.d=this.d.endOf(this.unit),this.d=this.d.minus(e,"minutes"),this.context.dayStart&&(this.d=this.d.time(this.context.dayStart)),this}before(){return this.d=this.d.minus(1,this.unit),this.d=this.d.endOf(this.unit),this.context.dayEnd&&(this.d=this.d.time(this.context.dayEnd)),this}after(){return this.d=this.d.add(1,this.unit),this.d=this.d.startOf(this.unit),this}next(){return this.d=this.d.add(1,this.unit),this.d=this.d.startOf(this.unit),this}last(){return this.d=this.d.minus(1,this.unit),this.d=this.d.startOf(this.unit),this}}class Day extends Unit{constructor(t,e,a){super(t,e,a),this.unit="day",this.d.isValid()&&(this.d=this.d.startOf("day"))}middle(){return this.d=this.d.time("10am"),this}beforeEnd(){return this.d=this.d.time("2pm"),this}}class CalendarDate extends Day{constructor(t,e,a){super(t,e,a),this.unit="day",this.d.isValid()&&(this.d=this.d.startOf("day"))}next(){return this.d=this.d.add(1,"year"),this}last(){return this.d=this.d.minus(1,"year"),this}}class WeekDay extends Day{constructor(t,e,a){super(t,e,a),this.unit="day",this.isWeekDay=!0,"string"==typeof t?(this.d=n.default(a.today,a.timezone),this.d=this.d.day(t),this.d.isBefore(a.today)&&(this.d=this.d.add(7,"days"))):this.d=t,this.weekDay=this.d.dayName(),this.d.isValid()&&(this.d=this.d.startOf("day"))}next(){return this.d=this.d.add(7,"days"),this.d=this.d.day(this.weekDay),this}last(){return this.d=this.d.minus(7,"days"),this.d=this.d.day(this.weekDay),this}before(){return this.d=this.d.minus(1,"day"),this.d=this.d.endOf("day"),this.context.dayEnd&&(this.d=this.d.time(this.context.dayEnd)),this}applyRel(t){if("next"===t){let t=this.context.today.endOf("week").add(1,"week");return this.next(),this.d.isAfter(t)&&this.last(),this}if("this-past"===t)return this.last();if("last"===t){let t=this.context.today.startOf("week");return this.last(),!1===this.d.isBefore(t)&&this.last(),this}return this}}class Holiday extends CalendarDate{constructor(t,e,a){super(t,e,a),this.unit="day",this.d.isValid()&&(this.d=this.d.startOf("day"))}}class Hour extends Unit{constructor(t,e,a){super(t,e,a,!0),this.unit="hour",this.d.isValid()&&(this.d=this.d.startOf("hour"))}}class Minute extends Unit{constructor(t,e,a){super(t,e,a,!0),this.unit="minute",this.d.isValid()&&(this.d=this.d.startOf("minute"))}}class Moment extends Unit{constructor(t,e,a){super(t,e,a,!0),this.unit="millisecond"}}class Month extends Unit{constructor(t,e,a){super(t,e,a),this.unit="month",this.d.isValid()&&(this.d=this.d.startOf(this.unit))}next(){return this.d=this.d.add(1,"year"),this.d=this.d.startOf("month"),this}last(){return this.d=this.d.minus(1,"year"),this.d=this.d.startOf("month"),this}}class AnyQuarter extends Unit{constructor(t,e,a){super(t,e,a),this.unit="quarter",this.d.isValid()&&(this.d=this.d.startOf(this.unit))}last(){return this.d=this.d.minus(1,"quarter"),this.d=this.d.startOf(this.unit),this}}class Quarter extends Unit{constructor(t,e,a){super(t,e,a),this.unit="quarter",this.d.isValid()&&(this.d=this.d.startOf(this.unit))}next(){return this.d=this.d.add(1,"year"),this.d=this.d.startOf(this.unit),this}last(){return this.d=this.d.minus(1,"year"),this.d=this.d.startOf(this.unit),this}}class Season extends Unit{constructor(t,e,a){super(t,e,a),this.unit="season",this.d.isValid()&&(this.d=this.d.startOf(this.unit))}next(){return this.d=this.d.add(1,"year"),this.d=this.d.startOf(this.unit),this}last(){return this.d=this.d.minus(1,"year"),this.d=this.d.startOf(this.unit),this}}class Year extends Unit{constructor(t,e,a){super(t,e,a),this.unit="year",this.d.isValid()&&(this.d=this.d.startOf("year"))}}class Week extends Unit{constructor(t,e,a){super(t,e,a),this.unit="week",this.d.isValid()&&(this.d=this.d.startOf("week"))}clone(){return new Week(this.d,this.unit,this.context)}middle(){return this.d=this.d.add(2,"days"),this}beforeEnd(){return this.d=this.d.day("friday"),this}}class WeekEnd extends Unit{constructor(t,e,a){super(t,e,a),this.unit="week",this.d.isValid()&&(this.d=this.d.day("saturday"),this.d=this.d.startOf("day"))}start(){return this.d=this.d.day("saturday").startOf("day"),this}next(){return this.d=this.d.add(1,this.unit),this.d=this.d.startOf("weekend"),this}last(){return this.d=this.d.minus(1,this.unit),this.d=this.d.startOf("weekend"),this}}const M={today:t=>new Day(t.today,null,t),yesterday:t=>new Day(t.today.minus(1,"day"),null,t),tomorrow:t=>new Day(t.today.plus(1,"day"),null,t),eom:t=>{let e=t.today.endOf("month");return e=e.startOf("day"),new Day(e,null,t)},eoy:t=>{let e=t.today.endOf("year");return e=e.startOf("day"),new Day(e,null,t)},now:t=>new Moment(t.today,null,t)};M.tommorrow=M.tomorrow,M.tmrw=M.tomorrow,M.anytime=M.today,M.sometime=M.today;const T={day:Day,hour:Hour,evening:Hour,second:Moment,milliscond:Moment,instant:Moment,minute:Minute,week:Week,weekend:WeekEnd,month:class AnyMonth extends Unit{constructor(t,e,a){super(t,e,a),this.unit="month",this.d.isValid()&&(this.d=this.d.startOf(this.unit))}},quarter:AnyQuarter,year:Year,season:Season,yr:Year,qtr:AnyQuarter,wk:Week,sec:Moment,hr:Hour};let E=`^(${Object.keys(T).join("|")})$`;const O=function(t){return{date:t.today.date(),month:t.today.month(),year:t.today.year()}},C=function(t,e,a){let i=null;return i=i||function(t,e,a){let n=null;!1===t.found&&(null!==a.time&&(n=new Moment(e.today,null,e)),a.shift&&Object.keys(a.shift).length>0&&(n=a.shift.hour||a.shift.minute?new Moment(e.today,null,e):new Day(e.today,null,e)));let r=t.text("reduced");return!0===M.hasOwnProperty(r)?M[r](e):"next"===r&&a.shift&&Object.keys(a.shift).length>0?M.tomorrow(e):n}(t,e,a),i=i||function(t,e){let a=null,n=t.match("[<holiday>#Holiday+] [<year>#Year?]"),i=e.today.year();n.groups("year").found&&(i=Number(n.groups("year").text("reduced"))||i);let s=n.groups("holiday").text("reduced"),o=r.default(s,i,e.timezone);return null!==o&&(o.isBefore(e.today)&&i===e.today.year()&&(o=r.default(s,i+1,e.timezone)),a=new Holiday(o,null,e)),a}(t,e),i=i||function(t,e){let a=t.match(E);if(!0===a.found){let t=a.text("reduced");if(T.hasOwnProperty(t)){let a=T[t];return a?new a(null,t,e):null}}if(a=t.match("^#WeekDay$"),!0===a.found){let t=a.text("reduced");return new WeekDay(t,null,e)}return null}(t,e),i=i||function(t,e){let a=t.match("(spring|summer|winter|fall|autumn) [<year>#Year?]");if(a.found){let a=t.text("reduced"),r=n.default(a,e.timezone,{today:O(e)}),i=new Season(r,null,e);if(!0===i.d.isValid())return i}if(a=t.match("[<q>#FinancialQuarter] [<year>#Year?]"),a.found){let t=a.groups("q").text("reduced"),r=n.default(t,e.timezone,{today:O(e)});if(a.groups("year")){let t=Number(a.groups("year").text())||e.today.year();r=r.year(t)}let i=new Quarter(r,null,e);if(!0===i.d.isValid())return i}if(a=t.match("[<q>#Value] quarter (of|in)? [<year>#Year?]"),a.found){let t=a.groups("q").text("reduced"),r=n.default("q"+t,e.timezone,{today:O(e)});if(a.groups("year")){let t=Number(a.groups("year").text())||e.today.year();r=r.year(t)}let i=new Quarter(r,null,e);if(!0===i.d.isValid())return i}if(a=t.match("^#Year$"),a.found){let a=t.text("reduced"),r=n.default(null,e.timezone,{today:O(e)});r=r.year(a);let i=new Year(r,null,e);if(!0===i.d.isValid())return i}return null}(t,e),i=i||function(t,e){let a=e.today.year(),n=t.match("[<date>#Value] of? [<month>#Month] [<year>#Year]");if(n.found||(n=t.match("[<month>#Month] the? [<date>#Value] [<year>#Year]")),n.found){let t={month:n.groups("month").text("reduced"),date:n.groups("date").text("reduced"),year:n.groups("year").text()||a},r=new CalendarDate(t,null,e);if(!0===r.d.isValid())return r}if(n=t.match("[<month>#Month] of? [<year>#Year]"),n.found){let t={month:n.groups("month").text("reduced"),year:n.groups("year").text("reduced")||a},r=new Month(t,null,e);if(!0===r.d.isValid())return r}if(n=t.match("[<date>#Value] of? [<month>#Month]"),n.found||(n=t.match("[<month>#Month] the? [<date>#Value]")),n.found){let t={month:n.groups("month").text("reduced"),date:n.groups("date").text("reduced"),year:e.today.year()},a=new CalendarDate(t,null,e);if(a.d.month()<e.today.month()&&(t.year+=1,a=new CalendarDate(t,null,e)),!0===a.d.isValid())return a}if(t.has("#Month")){let a={month:t.match("#Month").text("reduced"),date:1,year:e.today.year()},n=new Month(a,null,e);if(n.d.month()<e.today.month()&&(a.year+=1,n=new Month(a,null,e)),!0===n.d.isValid())return n}if(n=t.match("#WeekDay [<date>#Value]"),n.found){let t={month:e.today.month(),date:n.groups("date").text("reduced"),year:e.today.year()},a=new CalendarDate(t,null,e);if(!0===a.d.isValid())return a}if(n=t.match("the [<date>#Value]"),n.found){let t={month:e.today.month(),date:n.groups("date").text("reduced"),year:e.today.year()},a=new CalendarDate(t,null,e);if(!0===a.d.isValid())return a.d.isBefore(e.today)&&(a.d=a.d.add(1,"month")),a}if(n=t.match("/[0-9]{4}-[0-9]{2}-[0-9]{2}t[0-9]{2}:/"),n.found){let a=t.text("reduced"),n=new Moment(a,null,e);if(!0===n.d.isValid())return n}let r=t.text("reduced");if(!r)return new Moment(e.today,null,e);let i=new Day(r,null,e);return!1===i.d.isValid()?null:i}(t,e),i},S={day:Day,week:Week,weekend:WeekEnd,month:Month,quarter:Quarter,season:Season,hour:Hour,minute:Minute},_=function(t,e,a){if(!t&&a.weekDay&&(t=new WeekDay(a.weekDay,null,e),a.weekDay=null),!t)return null;if(a.shift){let e=a.shift;t.applyShift(e),e.hour||e.minute?t=new Moment(t.d,null,t.context):(e.week||e.day||e.month)&&(t=new Day(t.d,null,t.context))}return a.weekDay&&"day"!==t.unit&&(t.applyWeekDay(a.weekDay),t=new WeekDay(t.d,null,t.context)),a.rel&&t.applyRel(a.rel),a.section&&t.applySection(a.section),a.time&&t.applyTime(a.time),a.counter&&a.counter.unit&&(t=function(t,e={}){let a=S[e.unit];if(!a)return t;let n=t.d;"first"===e.dir||0===e.num?(n=t.start().d,n=n.startOf(e.unit)):"last"===e.dir?(n=n.endOf(t.unit),n="weekend"===e.unit?n.day("saturday",!1):n.startOf(e.unit)):e.num&&("weekend"===e.unit&&(n=n.day("saturday",!0).add(1,"day")),n=n.add(e.num,e.unit));let r=new a(n,null,t.context);return!0===r.d.isValid()?r:t}(t,a.counter)),t},j="undefined"==typeof process?self.env||{}:process.env,q=function(t,e){let a=V(t,e);if(t=a.doc,(t=>{j.DEBUG_DATE&&(console.log(`\n==== '${t.doc.text()}' =====`),Object.keys(t).forEach(e=>{"doc"!==e&&t[e]&&console.log(e,t[e])}),t.doc.debug())})(a),a.tz){let t=(e=Object.assign({},e,{timezone:a.tz})).today.format("iso-short");e.today=e.today.goto(e.timezone).set(t)}let n=C(t,e,a);return n=_(n,e,a),n},$={mon:"monday",tue:"tuesday",tues:"wednesday",wed:"wednesday",thu:"thursday",fri:"friday",sat:"saturday",sun:"sunday",monday:"monday",tuesday:"tuesday",wednesday:"wednesday",thursday:"thursday",friday:"friday",saturday:"saturday",sunday:"sunday"},z=function(t){return t.match("(every|each)").found?"AND":t.match("(any|a)").found?"OR":null},N=function(t){let e=t.start,a=t.end;if(e.d.isAfter(a.d)){if(e.isWeekDay&&a.isWeekDay)return t.end.next(),t;let n=e;t.start=a,t.end=n}return t},H=function(t){let e=t.start,a=t.end;return e.d.isAfter(a.d)&&a.d.hour()<10&&(a.d=a.d.ampm("pm")),t},P=function(t,e){return t=t.applyShift(e.punt)},B=[].concat([{match:"[<from>#Time+] (to|until|upto|through|thru|and) [<to>#Time+ #Date+]",desc:"3pm to 4pm january 5th",parse:(t,e)=>{let a=t.groups("from"),n=t.groups("to"),r=q(n,e);if(r){let t=r.clone();if(t.applyTime(a.text("implicit")),t){let e={start:t,end:r,unit:"time"};return!1===/(am|pm)/.test(n)&&(e=H(e)),e=N(e),e}}return null}},{match:"[<main>#Date+] from [<a>#Time] (to|until|upto|through|thru|and) [<b>#Time+]",desc:"january from 3pm to 4pm",parse:(t,e)=>{let a=t.groups("main"),n=t.groups("a"),r=t.groups("b");if(a=q(a,e),a){a.applyTime(n.text("implicit"));let t=a.clone();if(t.applyTime(r.text("implicit")),t){let e={start:a,end:t,unit:"time"};return!1===/(am|pm)/.test(r.text())&&(e=H(e)),e=N(e),e}}return null}},{match:"[<from>#Date+] (to|until|upto|through|thru|and) [<to>#Time+]",desc:"january from 3pm to 4pm",parse:(t,e)=>{let a=t.groups("from"),n=t.groups("to");if(a=q(a,e),a){let t=a.clone();if(t.applyTime(n.text("implicit")),t){let e={start:a,end:t,unit:"time"};return!1===/(am|pm)/.test(n.text())&&(e=H(e)),e=N(e),e}}return null}}],[{match:"^during? #Month+ (or|and) #Month [<year>#Year]?",desc:"march or june",parse:(t,e)=>{let a=t.match("^during? [#Month]",0);t=t.not("(or|and)");let n=q(a,e);if(n){let r=[{start:n,end:n.clone().end(),unit:n.unit}],i=t.not(a);i.found&&i.match("#Month").forEach(t=>{let a=q(t,e);r.push({start:a,end:a.clone().end(),unit:a.unit})});let s=t.match("#Year$");return s.found&&(s=s.text("reduced"),r.forEach(t=>{t.start.d=t.start.d.year(s),t.end.d=t.end.d.year(s)})),r}return null}},{match:"^#Month #Value+ (or|and)? #Value$",desc:"jan 5 or 8",parse:(t,e)=>{let a=(t=t.not("(or|and)")).match("^#Month #Value"),n=q(a,e);if(n){let e=[{start:n,end:n.clone().end(),unit:n.unit}],r=t.not(a);return r.found&&r.match("#Value").forEach(t=>{let a=n.clone();a.d=a.d.date(t.text("reduced")),e.push({start:a,end:a.clone().end(),unit:a.unit})}),e}return null}},{match:"^#Month+ #Value #Value+$",desc:"jan 5 8",parse:(t,e)=>{let a=t.match("#Month"),n=t.match("#Year");t=t.not("#Year");let r=[];return t.match("#Value").forEach(t=>{let i=(t=t.clone()).prepend(a.text());n.found&&i.append(n);let s=q(i,e);s&&r.push({start:s,end:s.clone().end(),unit:s.unit})}),r}},{match:"^#Value+ (or|and)? #Value of #Month #Year?$",desc:"5 or 8 of Jan",parse:(t,e)=>{let a=t.match("#Month"),n=t.match("#Year");t=t.not("#Year");let r=[];return t.match("#Value").forEach(t=>{let i=t.append(a);n.found&&i.append(n);let s=q(i,e);s&&r.push({start:s,end:s.clone().end(),unit:s.unit})}),r}},{match:"^!(between|from|during)? [<from>#Date+] (and|or) [<to>#Date+]$",desc:"A or B",parse:(t,e)=>{let a=t.groups("from"),n=t.groups("to"),r=q(a,e),i=q(n,e);return r&&i?[{start:r,end:r.clone().end()},{start:i,end:i.clone().end()}]:null}}],[{match:"between [<start>.+] and [<end>.+]",desc:"between friday and sunday",parse:(t,e)=>{let a=t.groups("start");a=q(a,e);let n=t.groups("end");return n=q(n,e),a&&n?(n=n.before(),{start:a,end:n}):null}},{match:"[<from>#Month #Value] (to|through|thru) [<to>#Month #Value] [<year>#Year?]",desc:"june 5 to june 7",parse:(t,e)=>{let a=t.groups(),n=a.from;if(a.year&&(n=n.append(a.year)),n=q(n,e),n){let t=a.to;if(a.year&&(t=t.append(a.year)),t=q(t,e),t)return n.d.isAfter(t.d)&&(t.d=t.d.add(1,"year")),{start:n,end:t.end()}}return null}},{match:"[<month>#Month] [<from>#Value] (to|through|thru) [<to>#Value] of? [<year>#Year]",desc:"january 5 to 7 1998",parse:(t,e)=>{let{month:a,from:n,to:r,year:i}=t.groups(),s=i.clone(),o=n.prepend(a).append(i);if(o=q(o,e),o){let t=r.prepend(a).append(s);return t=q(t,e),{start:o,end:t.end()}}return null}},{match:"[<from>#Value] (to|through|thru) [<to>#Value of? #Month #Date+?]",desc:"5 to 7 of january 1998",parse:(t,e)=>{let a=t.groups("to");if(a=q(a,e),a){let e=t.groups("from"),n=a.clone();return n.d=n.d.date(e.text("implicit")),{start:n,end:a.end()}}return null}},{match:"[<from>#Month #Value] (to|through|thru) [<to>#Value]",desc:"january 5 to 7",parse:(t,e)=>{let a=t.groups("from");if(a=q(a,e),a){let e=t.groups("to"),n=a.clone();return n.d=n.d.date(e.text("implicit")),{start:a,end:n.end()}}return null}},{match:"from? [<from>#Month] (to|until|upto|through|thru) [<to>#Month] [<year>#Year]",desc:"january to may 2020",parse:(t,e)=>{let a=t.groups("from"),n=t.groups("year").numbers().get()[0],r=t.groups("to");if(a=q(a,e),r=q(r,e),a.d=a.d.year(n),r.d=r.d.year(n),a&&r){let t={start:a,end:r.end()};return t=N(t),t}return null}}],[{match:"from? [<from>.+] (to|until|upto|through|thru) [<to>.+]",desc:"from A to B",parse:(t,e)=>{let a=t.groups("from"),n=t.groups("to");if(a=q(a,e),n=q(n,e),a&&n){let t={start:a,end:n.end()};return t=N(t),t}return null}},{match:"^due? (by|before) [.+]",desc:"before june",parse:(t,e)=>{t=t.group(0);let a=q(t,e);if(a){let t=new Unit(e.today,null,e);return t.d.isAfter(a.d)&&(t=a.clone().applyShift({weeks:-2})),{start:t,end:a.clone().applyShift({day:-1}).end()}}return null}},{match:"^(on|in|at|@|during) [.+]",desc:"in june",parse:(t,e)=>{t=t.group(0);let a=q(t,e);return a?{start:a,end:a.clone().end(),unit:a.unit}:null}},{match:"^(after|following) [.+]",desc:"after june",parse:(t,e)=>{t=t.group(0);let a=q(t,e);return a?(a=a.after(),{start:a.clone(),end:P(a.clone(),e)}):null}},{match:"^(middle|center|midpoint) of [.+]",desc:"middle of",parse:(t,e)=>{t=t.group(0);let a=q(t,e),n=a.clone().middle(),r=a.beforeEnd();return a?{start:n,end:r}:null}},{match:".+ after #Time+$",desc:"tuesday after 5pm",parse:(t,e)=>{let a=q(t,e);return a?{start:a.clone(),end:a.end(),unit:"time"}:null}},{match:".+ before #Time+$",desc:"tuesday before noon",parse:(t,e)=>{let a=q(t,e);if(a){let t=a.clone(),e=a.start();if(a)return{start:e,end:t,unit:"time"}}return null}}]),W="undefined"==typeof process?self.env||{}:process.env,Y=function(t,e){let a={start:null,end:null};if(!t.found)return a;let n=q(t,e);if(n){let t=n.clone().end();a={start:n,end:t,unit:n.setTime?"time":n.unit}}return a},L=function(t,e){let a=function(t,e){let a=t.match("[<logic>(every|any|each)] [<skip>other?] [<unit>#Duration] (starting|beginning|commencing)?");if(a.found){let e={interval:{}},n=a.groups("unit").text("reduced");return e.interval[n]=1,e.choose=z(a),a.groups("skip").found&&(e.interval[n]=2),t=t.remove(a),{repeat:e}}if(a=t.match("[<logic>(every|any|each)] [<num>#Value] [<unit>#Duration] (starting|beginning|commencing)?"),a.found){let e={interval:{}},n=a.groups("unit");n.nouns().toSingular();let r=n.text("reduced");return e.interval[r]=a.groups("num").numbers().get()[0],e.choose=z(a),t=t.remove(a),{repeat:e}}if(a=t.match("[<logic>(every|any|each|a)] [<skip>other?] [<day>#WeekDay+] (starting|beginning|commencing)?"),a.found){let e={interval:{day:1},filter:{weekDays:{}}},n=a.groups("day").text("reduced");if(n=$[n],n)return e.filter.weekDays[n]=!0,e.choose=z(a),t=t.remove(a),{repeat:e}}if(a=t.match("[<logic>(every|any|each|a)] [<day>(weekday|week day|weekend|weekend day)] (starting|beginning|commencing)?"),a.found){let e={interval:{day:1},filter:{weekDays:{}}},n=a.groups("day");return n.has("(weekday|week day)")?e.filter.weekDays={monday:!0,tuesday:!0,wednesday:!0,thursday:!0,friday:!0}:n.has("(weekend|weekend day)")&&(e.filter.weekDays={saturday:!0,sunday:!0}),e.choose=z(a),t=t.remove(a),{repeat:e}}if(a=t.match("[<day>(mondays|tuesdays|wednesdays|thursdays|fridays|saturdays|sundays)] (at|near|after)? [<time>#Time+?]"),a.found){let n={interval:{day:1},filter:{weekDays:{}}},r=a.groups("day").text("reduced");if(r=r.replace(/s$/,""),r=$[r],r){n.filter.weekDays[r]=!0,n.choose="OR",t=t.remove(a);let i=a.groups("time");return i.found&&(n.time=h(i,e)),{repeat:n}}}return null}(t,e)||{},n=function(t,e){for(let r=0;r<B.length;r+=1){let i=B[r],s=t.match(i.match);if(s.found){n=` ---[${i.desc}]---`,W.DEBUG_DATE&&console.log(`\n  ${n} `);let t=i.parse(s,e);if(null!==t)return a=t,"[object Array]"!==Object.prototype.toString.call(a)&&(t=[t]),t}}var a,n;return null}(t,e);return n||(n=[Y(t,e)]),n=n.map(t=>Object.assign({},a,t)),n.forEach(t=>{t.start&&t.end&&t.start.d.epoch>t.end.d.epoch&&(t.start=t.start.start())}),n},J=function(t,e){return!1===(e=e||{}).timezone&&(e.timezone="UTC"),e.today=e.today||n.default.now(e.timezone),e.today=n.default(e.today,e.timezone),t=function(t){return t.numbers||console.warn("\nCompromise warning: compromise/three must be used with compromise-dates plugin\n"),(t=t.clone()).numbers().toNumber(),t.contractions().expand(),t.replace("week end","weekend",!0).tag("Date"),t.replace("up to","upto",!0).tag("Date"),!1===t.has("once (a|an) #Duration")&&t.match("[(a|an)] #Duration",0).replaceWith("1",{tags:!0}).compute("lexicon"),t.match("@hasDash").insertAfter("to").tag("Date"),t}(t),L(t,e)},K=function(t){if(!t.start)return{start:null,end:null,timezone:null,duration:{}};let e=t.end?function(t){let e=t.end.d.add(1,"millisecond").since(t.start.d).diff;return delete e.milliseconds,delete e.seconds,e}(t):{};return{start:t.start.format("iso"),end:t.end?t.end.format("iso"):null,timezone:t.start.d.format("timezone"),duration:e}},R=function(t,e={}){let a=h(t,e);if(!a.result)return{time:null,"24h":null};let r=n.default.now().time(a.result);return{time:a.result,"24h":r.format("time-24"),hour:r.hour(),minute:r.minute()}},U=(t,e)=>"number"==typeof e?t.eq(e):t,I={century:!0,day:!0,decade:!0,hour:!0,millisecond:!0,minute:!0,month:!0,second:!0,weekend:!0,week:!0,year:!0,quarter:!0,season:!0};let F={m:"minute",h:"hour",hr:"hour",min:"minute",sec:"second","week end":"weekend",wk:"week",yr:"year",qtr:"quarter"};Object.keys(F).forEach(t=>{F[t+"s"]=F[t]});const Q=function(t){let e={},a=t.match("#Value+ #Duration");if(a.found)a.forEach(t=>{let a=t.numbers().get()[0],n=t.terms().last().text("reduced");n=n.replace(/ies$/,"y"),n=n.replace(/s$/,""),F.hasOwnProperty(n)&&(n=F[n]),I.hasOwnProperty(n)&&null!==a&&(e[n]=a)});else if(t.match("(#Duration && /[0-9][a-z]+$/)").found){let a=t.text(),n=a.match(/([0-9]+)/),r=a.match(/([a-z]+)/);n&&r&&(n=n[0]||null,r=r[0]||null,F.hasOwnProperty(r)&&(r=F[r]),I.hasOwnProperty(r)&&null!==n&&(e[r]=Number(n)))}return e},G="(start|end|middle|starting|ending|midpoint|beginning)",X=(t,e)=>{!0===t.found&&t.forEach(t=>{let a=t.text("reduced"),n=parseInt(a,10);n&&n>1e3&&n<3e3&&t.tag("Year",e)})},Z=(t,e)=>{!0===t.found&&t.forEach(t=>{let a=t.text("reduced"),n=parseInt(a,10);n&&n>1900&&n<2030&&t.tag("Year",e)})},tt=function(t,e){t.found&&(t.tag("Date",e),t.numbers().lessThan(31).ifNo("#Year").tag("#Time",e))},et=["act","aft","akst","anat","art","azot","azt","bnt","bot","bt","cast","cat","cct","chast","chut","ckt","cvt","cxt","davt","eat","ect","fjt","fkst","fnt","gamt","get","gft","gilt","gyt","hast","hncu","hneg","hnnomx","hnog","hnpm","hnpmx","hntn","hovt","iot","irkt","jst","kgt","kost","lint","magt","mart","mawt","mmt","nct","nft","novt","npt","nrt","nut","nzst","omst","pet","pett","phot","phst","pont","pwt","ret","sakt","samt","sbt","sct","sret","srt","syot","taht","tft","tjt","tkt","tlt","tmt","tot","tvt","ulat","vut","wakt","wat","wet","wft","wit","wst","yekt"].reduce((t,e)=>(t[e]=!0,t),{}),at="(in|by|before|during|on|until|after|of|within|all)",nt="(last|next|this|previous|current|upcoming|coming)",rt="(start|end|middle|starting|ending|midpoint|beginning)",it="(spring|summer|winter|fall|autumn)",st="(yesterday|today|tomorrow)";let ot=[{match:"in the (night|evening|morning|afternoon|day|daytime)",tag:"Time",reason:"in-the-night"},{match:"(#Value|#Time) (am|pm)",tag:"Time",reason:"value-ampm"},{match:"(tue|thu)",tag:"WeekDay",reason:"misc-weekday"},{match:"#Month #Date+",tag:"Date",reason:"correction-numberRange"},{match:"#Value of #Month",tag:"Date",unTag:"Time",reason:"value-of-month"},{match:"#Cardinal #Month",tag:"Date",reason:"cardinal-month"},{match:"#Month #Value (and|or|to)? #Value+",tag:"Date",reason:"value-to-value"},{match:"#Month the #Value",tag:"Date",reason:"month-the-value"},{match:"[(march|may)] to? #Date",group:0,tag:"Month",reason:"march-to"},{match:"^(march|may)$",tag:"Month",reason:"single-march"},{match:"#Month or #Month",tag:"Date",reason:"month-or-month"},{match:"(#WeekDay|#Month) #Value",ifNo:"#Money",tag:"Date",reason:"date-value"},{match:"#Value (#WeekDay|#Month)",ifNo:"#Money",tag:"Date",reason:"value-date"},{match:"#TextValue #TextValue",if:"#Date",tag:"#Date",reason:"textvalue-date"},{match:"#Value (#WeekDay|#Duration) back",tag:"#Date",reason:"3-back"},{match:"for #Value #Duration",tag:"Date",reason:"for-x-duration"},{match:"#Value #Duration #Conjunction",tag:"Date",reason:"val-duration-conjunction"},{match:at+"? #Value #Duration",tag:"Date",reason:"value-duration"},{match:"#Value #Duration old",unTag:"Date",reason:"val-years-old"},{match:`${at}? ${nt} ${it}`,tag:"Date",reason:"thisNext-season"},{match:`the? ${rt} of ${it}`,tag:"Date",reason:"section-season"},{match:`${it} ${at}? #Cardinal`,tag:"Date",reason:"season-year"},{match:"#Date the? #Ordinal",tag:"Date",reason:"correction"},{match:nt+" #Date",tag:"Date",reason:"thisNext-date"},{match:"due? (by|before|after|until) #Date",tag:"Date",reason:"by"},{match:"(last|next|this|previous|current|upcoming|coming|the) #Date",tag:"Date",reason:"next-feb"},{match:`the? ${rt} of #Date`,tag:"Date",reason:"section-of"},{match:"#Ordinal #Duration in #Date",tag:"Date",reason:"duration-in"},{match:"(early|late) (at|in)? the? #Date",tag:"Time",reason:"early-evening"},{match:"#Date [(by|before|after|at|@|about) #Cardinal]",group:0,tag:"Time",reason:"date-before-Cardinal"},{match:"#Date (#Preposition|to) #Date",ifNo:"#Duration",tag:"Date",reason:"date-prep-date"},{match:"(by|before|after|at|@|about) #Time",tag:"Time",reason:"preposition-time"},{match:"(in|after) /^[0-9]+(min|sec|wk)s?/",tag:"Date",reason:"shift-units"},{match:"#Date [(now|night|sometime)]",group:0,tag:"Time",reason:"date-now"},{match:"(from|starting|until|by) now",tag:"Date",reason:"for-now"},{match:"(each|every) night",tag:"Date",reason:"for-now"},{match:"#Date [(am|pm)]",group:0,tag:"Time",reason:"date-am"},{match:"#Month #Value to #Value of? #Year?",tag:"Date",reason:"june 5 to 7th"},{match:"#Value to #Value of? #Month #Year?",tag:"Date",reason:"5 to 7th june"},{match:"#Value #Duration of #Date",tag:"Date",reason:"third week of may"},{match:"#Value+ #Duration (after|before|into|later|afterwards|ago)?",tag:"Date",reason:"two days after"},{match:"#Value #Date",tag:"Date",reason:"two days"},{match:"#Date #Value",tag:"Date",reason:"june 5th"},{match:"#Date #Preposition #Value",tag:"Date",reason:"tuesday at 5"},{match:"#Date (after|before|during|on|in) #Value",tag:"Date",reason:"tomorrow before 3"},{match:"#Value (year|month|week|day) and a half",tag:"Date",reason:"a year and a half"},{match:"#Value and a half (years|months|weeks|days)",tag:"Date",reason:"5 and a half years"},{match:"on the #Ordinal",tag:"Date",reason:"on the fifth"},{match:"#Month #Value+ (and|or) #Value",tag:"Date",reason:"date-or-date"},{match:"#Value+ (and|or) #Value of #Month ",tag:"Date",reason:"date-and-date"},{match:"(spring|summer|winter|fall|autumn|springtime|wintertime|summertime)",tag:"Season",reason:"date-tag1"},{match:"(q1|q2|q3|q4)",tag:"FinancialQuarter",reason:"date-tag2"},{match:"(this|next|last|current) quarter",tag:"FinancialQuarter",reason:"date-tag3"},{match:"(this|next|last|current) season",tag:"Season",reason:"date-tag4"},{match:"#Date #Preposition #Date",tag:"Date",reason:"friday to sunday"},{match:"(once|twice) (a|an|each) #Date",tag:"Date",reason:"once a day"},{match:"a #Duration",tag:"Date",reason:"a year"},{match:"(between|from) #Date",tag:"Date",reason:"between x and y"},{match:"(to|until|upto) #Date",tag:"Date",reason:"between x and y2"},{match:"#Date and #Date",tag:"Date",reason:"between x and y3"},{match:"the? #Date after next one?",tag:"Date",reason:"day after next"},{match:"(about|approx|approximately|around) #Date",tag:"Date",reason:"approximately june"},{match:"(by|until|on|in|at|during|over|every|each|due) the? #Date",ifNo:"#PhrasalVerb",tag:"Date",reason:"until june"},{match:"(by|until|after|before|during|on|in|following|since) (next|this|last)? #Date",ifNo:"#PhrasalVerb",tag:"Date",reason:"until last june"},{match:"this? (last|next|past|this|previous|current|upcoming|coming|the) #Date",tag:"Date",reason:"next september"},{match:"(starting|beginning|ending) #Date",tag:"Date",reason:"starting this june"},{match:"the? (start|end|middle|beginning) of (last|next|this|the) #Date",tag:"Date",reason:"start of june"},{match:"(the|this) #Date",tag:"Date",reason:"this coming june"},{match:"#Date up to #Date",tag:"Date",reason:"january up to june"},{match:"#Cardinal oclock",tag:"Time",reason:"2 oclock"},{match:"#Value (in|at) the? (morning|evening|night|nighttime)",tag:"Time",reason:"3 in the morning"},{match:"(5|10|15|20|five|ten|fifteen|quarter|twenty|half) (after|past) #Cardinal",tag:"Time",reason:"ten to seven"},{match:"(at|by|before) (5|10|15|20|five|ten|fifteen|twenty|quarter|half) (after|past|to)",tag:"Time",reason:"at-20-past"},{match:"#Date [at #Cardinal]",group:0,ifNo:"#Year",tag:"Time",reason:" tuesday at 4"},{match:"half an (hour|minute|second)",tag:"Date",reason:"half an hour"},{match:"(in|for|by|near|at) #Timezone",tag:"Date",reason:"in eastern time"},{match:"#Time to #Time",tag:"Date",reason:"3pm to 4pm"},{match:"#Time [(sharp|on the dot)]",group:0,tag:"Time",reason:"4pm sharp"},{match:"(at|around|near|#Date) [#Cardinal (thirty|fifteen) (am|pm)?]",group:0,tag:"Time",reason:"around four thirty"},{match:"(anytime|sometime) (before|after|near) [#Cardinal]",group:0,tag:"Time",reason:"antime-after-3"},{match:"(#Cardinal|a|an) #Duration (before|after|ago|from|hence|back)",tag:"DateShift",reason:"nine weeks frow now"},{match:"in #Cardinal #Duration",tag:"DateShift",reason:"in two weeks"},{match:"in (a|an) #Duration",tag:"DateShift",reason:"in a week"},{match:"[(a|an) #Duration from] #Date",group:0,tag:"DateShift",reason:"an hour from now"},{match:"(a|an) #Duration ago",tag:"DateShift",reason:"a month ago"},{match:"in half (a|an) #Duration",tag:"DateShift",reason:"in half an hour"},{match:"in a (few|couple) of? #Duration",tag:"DateShift",reason:"in a few weeks"},{match:"#Cardinal #Duration and? #DateShift",tag:"DateShift",reason:"three days before"},{match:"#DateShift and #Cardinal #Duration",tag:"DateShift",reason:"date-shift"},{match:"[#Duration (after|before)] #Date",group:0,tag:"DateShift",reason:"day after tomorrow"},{match:"#Month #Ordinal and #Ordinal",tag:"Date",reason:"ord-and-ord"},{match:"every other #Duration",tag:"Date",reason:"every-other"},{match:"(every|any|each|a) (day|weekday|week day|weekend|weekend day)",tag:"Date",reason:"any-weekday"},{match:"(every|any|each|a) (#WeekDay)",tag:"Date",reason:"any-wednesday"},{match:"(every|any|each|a) (#Duration)",tag:"Date",reason:"any-week"},{match:"[(wed|sat)] (#Month|#Year|on|between|during|from)",group:0,tag:"WeekDay",reason:"wed"},{match:"^day$",unTag:"Date",reason:"spa-day"},{match:"(in|of|by|for)? (#Possessive && #Date)",unTag:"Date",reason:"tomorrows meeting"},{match:st+" [#Value]$",unTag:"Date",group:0,reason:"yesterday-7"},{match:`^[#Value] ${st}$`,group:0,unTag:"Date",reason:"7 yesterday"},{match:"on #Cardinal$",unTag:"Date",reason:"on 5"},{match:"[this] tomorrow",group:0,unTag:"Date",reason:"this-tomorrow"},{match:"(q1|q2|q3|q4) #Year",tag:"Date",reason:"q2 2016"},{match:"^[#Value] (this|next|last)",group:0,unTag:"Date",reason:"4 next"},{match:"(last|this|next) #Duration [#Value]",group:0,unTag:"Date",reason:"this month 7"},{match:"[!#Month] #Value (last|this|next) #Date",group:0,unTag:"Date",reason:"7 this month"},{match:"(in|over) the #Duration #Date+?",unTag:"Date",reason:"over-the-duration"},{match:"#Ordinal quarter of? #Year",unTag:"Fraction"},{match:"(from|by|before) now",unTag:"Time",tag:"Date"}],ut=null;var dt={dates:function(t){return t.cache(),function(t){let{document:e,world:a}=t;const{methods:n}=a;ut=ut||n.two.compile(ot,n);let r=n.two.bulkMatch(e,ut,n);n.two.bulkTagger(r,e,a)}(t),function(t){t.match("(march|april|may) (and|to|or|through|until)? (march|april|may)").tag("Date").match("(march|april|may)").tag("Month","march|april|may");let e=t.if("#Cardinal");if(!0===e.found){let t=e.match("#Date #Value [#Cardinal]",0);X(t,"date-value-year"),t=e.match("#Date [#Cardinal]",0),Z(t,"date-year"),t=e.match(G+" of [#Cardinal]"),Z(t,"section-year"),t=e.match("#Month #Value [#Cardinal]",0),X(t,"month-value-year"),t=e.match("#Month #Value to #Value [#Cardinal]",0),X(t,"month-range-year"),t=e.match("(in|of|by|during|before|starting|ending|for|year|since) [#Cardinal]",0),X(t,"in-year-1"),t=e.match("(q1|q2|q3|q4) [#Cardinal]",0),X(t,"in-year-2"),t=e.match("#Ordinal quarter of? [#Cardinal]",0),X(t,"in-year-3"),t=e.match("the year [#Cardinal]",0),X(t,"in-year-4"),t=e.match("it (is|was) [#Cardinal]",0),Z(t,"in-year-5"),e.match(G+" of #Year").tag("Date");let a=e.match("between [#Cardinal] and [#Cardinal]");X(a.groups("0"),"between-year-and-year-1"),X(a.groups("1"),"between-year-and-year-2")}let a=t.match("^/^20[012][0-9]$/$");Z(a,"2020-ish")}(t),function(t){let e=t.if("#Date");if(e.found){let a=e.if("#NumberRange");if(a.found){let t=a.match("[#NumberRange+] (on|by|at)? #WeekDay",0);tt(t,"3-4-tuesday"),t=a.match("[#NumberRange+] (on|by|at)? #Month #Value",0),tt(t,"3-4 mar 3"),t=a.match("[#NumberRange] to (#NumberRange && #Time)",0),tt(t,"3-4pm"),t=a.match("(#NumberRange && #Time) to [#NumberRange]",0),tt(t,"3pm-4")}let n=e.match("(from|between) #Cardinal and #Cardinal (in|on)? (#WeekDay|tomorrow|yesterday)");tt(n,"from 9-5 tues"),n=t.match("#Cardinal to #Cardinal (#WeekDay|tomorrow|yesterday)"),tt(n,"9-5 tues"),n=e.match("(from|between) [#NumericValue] (to|and) #Time",0).tag("Time","4-to-5pm"),tt(n,"from 9-5pm"),n=e.match("(#WeekDay|tomorrow|yesterday) (from|between)? (#Cardinal|#Time) (and|to) (#Cardinal|#Time)"),tt(n,"tues 3-5"),n=e.match("#Month #Value+ (from|between) [<time>(#Cardinal|#Time) (and|to) (#Cardinal|#Time)]").group("time"),tt(n,"sep 4 from 9-5"),n=e.match("#Time to #Cardinal on? #Date"),tt(n,"3pm-4 wed"),n=e.match("#Cardinal to #Time on? #Date"),tt(n,"3-4pm wed"),n=e.match("#Cardinal to #Cardinal on? (#WeekDay|#Month #Value)"),tt(n,"3-4 wed")}}(t),function(t){let e=t.match("#Time [#Acronym]",0);if(e.found){let t=e.text("reduced");!0===et[t]&&e.tag("Timezone","tz-abbr")}}(t),function(t){if(t.has("#Date")){let e=t.match("#Date+ by #Date+");e.found&&!e.has("^due")&&e.match("^#Date+").unTag("Date","by-monday");let a=t.match("#Date+");a.has("^between")&&!a.has("and .")&&a.unTag("Date","fix-tagger"),a.has("(minutes|seconds|weeks|hours|days|months)")&&!a.has("#Value #Duration")&&a.match("(minutes|seconds|weeks|hours|days|months)").unTag("Date","log-hours"),a.has("about #Holiday")&&a.match("about").unTag("#Date","about-thanksgiving"),a.match("#Date+").match("^the").unTag("Date")}}(t),t.uncache(),t}};const mt="Australia/",lt="Pacific/",ht={"british summer time":"Europe/London",bst:"Europe/London","british time":"Europe/London","britain time":"Europe/London","irish summer time":"Europe/Dublin","irish time":"Europe/Dublin","central european time":"Europe/Berlin",cet:"Europe/Berlin","central european summer time":"Europe/Berlin",cest:"Europe/Berlin","central europe":"Europe/Berlin","eastern european time":"Europe/Riga",eet:"Europe/Riga","eastern european summer time":"Europe/Riga",eest:"Europe/Riga","eastern europe time":"Europe/Riga","western european time":"Europe/Lisbon","western european summer time":"Europe/Lisbon","turkey standard time":"Europe/Istanbul","turkish time":"Europe/Istanbul",utc:"Africa/Freetown","greenwich standard time":"Africa/Freetown",gmt:"Africa/Freetown","east africa time":"Africa/Nairobi","east african time":"Africa/Nairobi","eastern africa time":"Africa/Nairobi","central africa time":"Africa/Khartoum","central african time":"Africa/Khartoum","south africa standard time":"Africa/Johannesburg","west africa standard time":"Africa/Lagos","western africa time":"Africa/Lagos","west african time":"Africa/Lagos","australian central standard time":mt+"Adelaide",acst:mt+"Adelaide","australian central daylight time":mt+"Adelaide",acdt:mt+"Adelaide","australian eastern standard time":mt+"Brisbane",aest:mt+"Brisbane","australian eastern daylight time":mt+"Brisbane",aedt:mt+"Brisbane","australian western standard time":mt+"Perth",awst:mt+"Perth","australian western daylight time":mt+"Perth",awdt:mt+"Perth","australian central western standard time":mt+"Eucla",acwst:mt+"Eucla","lord howe standard time":mt+"Lord_Howe",lhst:mt+"Lord_Howe","lord howe daylight time":mt+"Lord_Howe",lhdt:mt+"Lord_Howe","russian standard time":"Europe/Moscow",msk:"Europe/Moscow","central standard time":"America/Chicago","central time":"America/Chicago",cst:"America/Havana","central daylight time":"America/Chicago",cdt:"America/Havana","mountain standard time":"America/Denver","mountain time":"America/Denver",mst:"America/Denver","mountain daylight time":"America/Denver",mdt:"America/Denver","atlantic standard time":"America/Halifax","atlantic time":"America/Halifax",ast:"Asia/Baghdad","atlantic daylight time":"America/Halifax",adt:"America/Halifax","eastern standard time":"America/New_York","eastern time":"America/New_York",est:"America/New_York","eastern daylight time":"America/New_York",edt:"America/New_York","pacific time":"America/Los_Angeles","pacific standard time":"America/Los_Angeles",pst:"America/Los_Angeles","pacific daylight time":"America/Los_Angeles",pdt:"America/Los_Angeles","alaskan standard time":"America/Anchorage","alaskan time":"America/Anchorage",ahst:"America/Anchorage","alaskan daylight time":"America/Anchorage",ahdt:"America/Anchorage","hawaiian standard time":lt+"Honolulu","hawaiian time":lt+"Honolulu",hst:lt+"Honolulu","aleutian time":lt+"Honolulu","hawaii time":lt+"Honolulu","newfoundland standard time":"America/St_Johns","newfoundland time":"America/St_Johns","newfoundland daylight time":"America/St_Johns","brazil time":"America/Sao_Paulo","brazilian time":"America/Sao_Paulo","argentina time":"America/Buenos_Aires","argentinian time":"America/Buenos_Aires","amazon time":"America/Manaus","amazonian time":"America/Manaus","easter island standard time":"Chile/Easterisland","easter island summer time":"Chile/Easterisland",easst:"Chile/Easterisland","venezuelan standard time":"America/Caracas","venezuelan time":"America/Caracas","venezuela time":"America/Caracas","paraguay time":"America/Asuncion","paraguay summer time":"America/Asuncion","cuba standard time":"America/Havana","cuba time":"America/Havana","cuba daylight time":"America/Havana","cuban time":"America/Havana","bolivia time":"America/La_Paz","bolivian time":"America/La_Paz","colombia time":"America/Bogota","colombian time":"America/Bogota","acre time":"America/Eirunepe","peru time":"America/Lima","chile standard time":"America/Punta_Arenas","chile time":"America/Punta_Arenas",clst:"America/Punta_Arenas","chile summer time":"America/Punta_Arenas",cldt:"America/Punta_Arenas","uruguay time":"America/Montevideo",uyt:"America/Montevideo","arabic standard time":"Asia/Baghdad","iran standard time":"Asia/Tehran","iran time":"Asia/Tehran","iran daylight time":"Asia/Tehran","pakistan standard time":"Asia/Karachi","pakistan time":"Asia/Karachi","india standard time":"Asia/Kolkata","indian time":"Asia/Kolkata","indochina time":"Asia/Bangkok","china standard time":"Asia/Shanghai","alma-ata time":"Asia/Almaty","oral time":"Asia/Oral","orat time":"Asia/Oral","yakutsk time":"Asia/Yakutsk",yakt:"Asia/Yakutsk","gulf standard time":"Asia/Dubai","gulf time":"Asia/Dubai","hong kong time":"Asia/Hong_Kong","western indonesian time":"Asia/Jakarta","indonesia time":"Asia/Jakarta","central indonesian time":"Asia/Makassar","israel daylight time":"Asia/Jerusalem","israel standard time":"Asia/Jerusalem","israel time":"Asia/Jerusalem","krasnoyarsk time":"Asia/Krasnoyarsk","malaysia time":"Asia/Kuala_Lumpur","singapore time":"Asia/Singapore","korea standard time":"Asia/Seoul","korea time":"Asia/Seoul",kst:"Asia/Seoul","korean time":"Asia/Seoul","uzbekistan time":"Asia/Samarkand","vladivostok time":"Asia/Vladivostok","maldives time":"Indian/Maldives","mauritius time":"Indian/Mauritius","marshall islands time":lt+"Kwajalein","samoa standard time":lt+"Midway","somoan time":lt+"Midway","chamorro standard time":lt+"Guam","papua new guinea time":lt+"Bougainville"};let ct=n.default().timezones,ft=Object.keys(ct).reduce((t,e)=>(t[e]=e,t),{});var yt=Object.assign({},ht,ft);let pt={"a couple":"Value",thur:"WeekDay",thurs:"WeekDay"};const gt=function(t,e){t.forEach(t=>{pt[t]=e})};gt(Object.keys(yt),"Timezone"),gt(["weekday","summer","winter","autumn","all day","eod","eom","eoy","standard time","daylight time","tommorrow"],"Date"),gt(["centuries","century","day","days","decade","decades","hour","hours","hr","hrs","millisecond","milliseconds","minute","minutes","min","mins","month","months","seconds","sec","secs","week end","week ends","weekend","weekends","week","weeks","wk","wks","year","years","yr","yrs","quarter","qtr","qtrs","season","seasons"],"Duration"),gt(["all hallows eve","all saints day","all sts day","april fools","armistice day","australia day","bastille day","boxing day","canada day","christmas eve","christmas","cinco de mayo","day of the dead","dia de muertos","dieciseis de septiembre","emancipation day","grito de dolores","groundhog day","halloween","harvey milk day","inauguration day","independence day","independents day","juneteenth","labour day","national freedom day","national nurses day","new years eve","new years","purple heart day","rememberance day","rosa parks day","saint andrews day","saint patricks day","saint stephens day","saint valentines day","st andrews day","st patricks day","st stephens day","st valentines day ","valentines day","valentines","veterans day","victoria day","womens equality day","xmas","epiphany","orthodox christmas day","orthodox new year","assumption of mary","all souls day","feast of the immaculate conception","feast of our lady of guadalupe","kwanzaa","imbolc","beltaine","lughnassadh","samhain","martin luther king day","mlk day","presidents day","mardi gras","tax day","commonwealth day","mothers day","memorial day","fathers day","columbus day","indigenous peoples day","canadian thanksgiving","election day","thanksgiving","t-day","turkey day","black friday","cyber monday","ash wednesday","palm sunday","maundy thursday","good friday","holy saturday","easter","easter sunday","easter monday","orthodox good friday","orthodox holy saturday","orthodox easter","orthodox easter monday","ascension day","pentecost","whitsunday","whit sunday","whit monday","trinity sunday","corpus christi","advent","tu bishvat","tu bshevat","purim","passover","yom hashoah","lag baomer","shavuot","tisha bav","rosh hashana","yom kippur","sukkot","shmini atzeret","simchat torah","chanukah","hanukkah","isra and miraj","lailat al-qadr","eid al-fitr","id al-Fitr","eid ul-Fitr","ramadan","eid al-adha","muharram","the prophets birthday","ostara","march equinox","vernal equinox","litha","june solistice","summer solistice","mabon","september equinox","fall equinox","autumnal equinox","yule","december solstice","winter solstice","chinese new year","diwali"],"Holiday"),gt(["noon","midnight","morning","tonight","evening","afternoon","breakfast time","lunchtime","dinnertime","midday","eod","oclock","oclock","at night"],"Time");var wt=[[/^[0-9]+(min|sec|hr|d)s?$/,"Duration","30min"],[/^[0-9]{4}-[0-9]{2}$/,"Date","2012-06"],[/^[0-9]{2}h[0-9]{2}$/,"Time","13h30"],[/^[0-9]{2}\/[0-9]{2}/,"Date","03/02"],[/^[0-9]{4}[:-][0-9]{2}[:-][0-9]{2}T[0-9]/,"Time","iso-time-tag"]];return{tags:{FinancialQuarter:{is:"Date",not:["Fraction"]},Season:{is:"Date"},Year:{is:"Date",not:["RomanNumeral"]},Holiday:{is:"Date",also:"Noun"},DateShift:{is:"Date",not:["Timezone","Holiday"]}},words:pt,compute:dt,api:function(t){!function(t){class Dates extends t{constructor(t,e,a,n={}){super(t,e,a),this.viewType="Nouns",this.opts=n}get(t){let e=[];return this.forEach(t=>{J(t,this.opts).forEach(t=>{e.push(K(t))})}),"number"==typeof t?e[t]:e}json(t={}){return this.map(e=>{let a=e.toView().json(t)[0]||{};if(t&&!0!==t.dates){let t=J(e,this.opts);a.dates=K(t[0])}return a},[])}format(t){let e=this.map(e=>{let a=J(e,this.opts)[0]||{};if(a.start){let n=a.start.d,r=n.format(t);if(a.end){let e=a.end.d;!1===n.isSame(e,"day")&&(r+=" to "+e.format(t))}e.replaceWith(r)}return e});return new Dates(this.document,e.pointer,null,this.opts)}}t.prototype.dates=function(t){let e=function(t){let e=t.match("#Date+");e=e.filter(t=>{let e=t.has("^#Duration+$")||t.has("^#Value #Duration+$");return!(!0!==e||!t.has("(#FinancialQuarter|quarter)"))||!1===e});let a=e.match("[#Cardinal #Duration (in|on|this|next|during|for)] #Date",0);return a.found&&(e=e.not(a)),a=e.match("[#Cardinal #Duration] #WeekDay",0),a.found&&(e=e.not(a)),a=e.match("#Date [for #Value #Duration]$",0),a.found&&(e=e.not(a)),a=e.match("[#Cardinal #Duration] #Date",0),a.found&&!e.has("#Cardinal #Duration] (ago|from|before|after|back)")&&(e=e.not(a)),a=e.match("for #Cardinal #Duration"),a.found&&(e=e.not(a)),e=e.notIf("^one (#WeekDay|#Month)$"),e=function(t){let e=null;return t.has("^(between|within) #Date")?t:(t.has("#Month")&&(e=t.match("[#Month #Value] and? #Month",0).ifNo("@hasDash$"),e.found&&(t=t.splitAfter(e)),e=t.match("[#Value #Month] and? #Value #Month",0),e.found&&(t=t.splitAfter(e)),e=t.match("^[#Month] and? #Month #Ordinal?$",0),e.found&&(t=t.splitAfter(e)),e=t.match("[#Month #Value] #Month",0).ifNo("@hasDash$"),e.found&&(t=t.splitAfter(e))),t.has("#WeekDay")&&(e=t.match("^[#WeekDay] and? #WeekDay$",0).ifNo("@hasDash$"),e.found&&(t=t.splitAfter(e)),e=t.match("#WeekDay #WeekDay and? #WeekDay"),e.found&&(t=t.splitOn("#WeekDay")),e=t.match("[#WeekDay] (and|or|this|next)? #WeekDay",0).ifNo("@hasDash$"),e.found&&(t=t.splitAfter("#WeekDay"))),e=t.match("(this|next) #Duration [(today|tomorrow|yesterday)]",0),e.found&&(t=t.splitBefore(e)),e=t.match("[(today|tomorrow|yesterday)] #Value #Month",0),e.found&&(t=t.splitAfter(e)),e=t.match("[(today|tomorrow|yesterday)] (today|tomorrow|yesterday|#WeekDay)",0).ifNo("@hasDash$"),e.found&&(t=t.splitAfter(e)),t=t.not("^and"))}(e),e=e.notIf("(#Money|#Percentage)"),e=e.notIf("^per #Duration"),e}(this);return new Dates(this.document,e.pointer,null,t)}}(t),function(t){class Times extends t{constructor(t,e,a){super(t,e,a),this.viewType="Nouns"}get(t){return U(this,t).map(R)}json(t={}){return this.map(e=>{let a=e.toView().json(t)[0]||{};return t&&!0!==t.times&&(a.time=R(e)),a},[])}}t.prototype.times=function(t){let e=this.match("#Time+ (am|pm)?");return e=U(e,t),new Times(this.document,e.pointer)}}(t),function(t){class Durations extends t{constructor(t,e,a){super(t,e,a),this.context={}}json(t={}){return this.map(e=>{let a=e.toView().json(t)[0]||{};return t&&!0!==t.times&&(a.duration=Q(e)),a},[])}get(t){let e=[];return this.forEach(t=>{let a=Q(t);e.push(a)}),"number"==typeof t?e[t]:e}}t.prototype.durations=function(t){let e=this.match("#Value+ #Duration (and? #Value+ #Duration)?");return e=e.concat(this.match("(#Duration && /[0-9][a-z]+$/)")),e=e.notIf("#DateShift"),"number"==typeof t&&(e=e.eq(t)),new Durations(this.document,e.pointer)}}(t)},mutate:t=>{t.model.two.regexNormal=t.model.two.regexNormal.concat(wt)},hooks:["dates"]}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("spacetime"),require("spacetime-holiday")):"function"==typeof define&&define.amd?define(["spacetime","spacetime-holiday"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).compromiseDates=e(t.spacetime,t.spacetimeHoliday);

@@ -26,12 +26,12 @@ {

"node_modules/spacetime": {
"version": "6.16.0",
"resolved": "https://registry.npmjs.org/spacetime/-/spacetime-6.16.0.tgz",
"integrity": "sha512-mkuniNOp6ssfPyJidj81tb54zKxK4vEKPTmcUsC/NEGIF8S07ppoSotdg6numT1/26rthQYmdxMY/M5a9WeJVQ=="
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/spacetime/-/spacetime-7.1.2.tgz",
"integrity": "sha512-MUTgK9KU9gMXhZddwe0nlgFnCJXT4RfuIRqyo8VcUexZa94zkxk1WpVv3THgvMFz1+Hq9okoNiGTvj6qBdN4Cg=="
},
"node_modules/spacetime-holiday": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/spacetime-holiday/-/spacetime-holiday-0.1.0.tgz",
"integrity": "sha512-rYIpSDbHnznZRstUrmYYFAaruW8e96t+1JfS0b6qMiAAQ2DrkLKc8oMotAAkB9qMTUwXXf5bIkdTHfP434uitQ==",
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/spacetime-holiday/-/spacetime-holiday-0.2.2.tgz",
"integrity": "sha512-qF2qD/KfXqjOJLmud5M8XFb+laafzOdTJsYCB/a+44ytUgpHUOpqBX2jYZxfoQkT6DsfNdctTbmWKCegVgEMEw==",
"peerDependencies": {
"spacetime": "^6.3.0"
"spacetime": ">=6.3.0"
}

@@ -38,0 +38,0 @@ }

@@ -5,3 +5,3 @@ (function (global, factory) {

(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.spacetimeHoliday = factory(global.spacetime));
}(this, (function (spacetime) { 'use strict';
})(this, (function (spacetime) { 'use strict';

@@ -13,39 +13,39 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

//yep,
var jan = 'january';
var feb = 'february';
var mar = 'march';
var apr = 'april';
var may = 'may';
var jun = 'june';
var jul = 'july';
var aug = 'august';
var sep = 'september';
var oct = 'october';
var nov = 'november';
var dec = 'december';
var fixedHolidays = {
const jan$1 = 'january';
const feb$1 = 'february';
const mar$1 = 'march';
const apr = 'april';
const may$1 = 'may';
const jun$1 = 'june';
const jul = 'july';
const aug = 'august';
const sep$1 = 'september';
const oct$1 = 'october';
const nov$1 = 'november';
const dec = 'december';
var fixed = {
'new years eve': [dec, 31],
'new years': [jan, 1],
'new years day': [jan, 1],
'inauguration day': [jan, 20],
'australia day': [jan, 26],
'national freedom day': [feb, 1],
'groundhog day': [feb, 2],
'rosa parks day': [feb, 4],
'valentines day': [feb, 14],
'saint valentines day': [feb, 14],
'st valentines day ': [feb, 14],
'saint patricks day': [mar, 17],
'st patricks day': [mar, 17],
'new years': [jan$1, 1],
'new years day': [jan$1, 1],
'inauguration day': [jan$1, 20],
'australia day': [jan$1, 26],
'national freedom day': [feb$1, 1],
'groundhog day': [feb$1, 2],
'rosa parks day': [feb$1, 4],
'valentines day': [feb$1, 14],
'saint valentines day': [feb$1, 14],
'st valentines day ': [feb$1, 14],
'saint patricks day': [mar$1, 17],
'st patricks day': [mar$1, 17],
'april fools': [apr, 1],
'april fools day': [apr, 1],
'emancipation day': [apr, 16],
'tax day': [apr, 15],
//US
'labour day': [may, 1],
'cinco de mayo': [may, 5],
'national nurses day': [may, 6],
'harvey milk day': [may, 22],
'victoria day': [may, 24],
juneteenth: [jun, 19],
'tax day': [apr, 15], //US
'labour day': [may$1, 1],
'cinco de mayo': [may$1, 5],
'national nurses day': [may$1, 6],
'harvey milk day': [may$1, 22],
'victoria day': [may$1, 24],
juneteenth: [jun$1, 19],
'canada day': [jul, 1],

@@ -57,18 +57,16 @@ 'independence day': [jul, 4],

'womens equality day': [aug, 26],
'16 de septiembre': [sep, 16],
'dieciseis de septiembre': [sep, 16],
'grito de dolores': [sep, 16],
halloween: [oct, 31],
'all hallows eve': [oct, 31],
'day of the dead': [oct, 31],
// Ranged holiday [nov, 2],
'dia de muertos': [oct, 31],
// Ranged holiday [nov, 2],
'veterans day': [nov, 11],
'st andrews day': [nov, 30],
'saint andrews day': [nov, 30],
'all saints day': [nov, 1],
'all sts day': [nov, 1],
'armistice day': [nov, 11],
'rememberance day': [nov, 11],
'16 de septiembre': [sep$1, 16],
'dieciseis de septiembre': [sep$1, 16],
'grito de dolores': [sep$1, 16],
halloween: [oct$1, 31],
'all hallows eve': [oct$1, 31],
'day of the dead': [oct$1, 31], // Ranged holiday [nov, 2],
'dia de muertos': [oct$1, 31], // Ranged holiday [nov, 2],
'veterans day': [nov$1, 11],
'st andrews day': [nov$1, 30],
'saint andrews day': [nov$1, 30],
'all saints day': [nov$1, 1],
'all sts day': [nov$1, 1],
'armistice day': [nov$1, 11],
'rememberance day': [nov$1, 11],
'christmas eve': [dec, 24],

@@ -80,25 +78,28 @@ christmas: [dec, 25],

'saint stephens day': [dec, 26],
// Fixed religious and cultural holidays
// Catholic + Christian
epiphany: [jan, 6],
'orthodox christmas day': [jan, 7],
'orthodox new year': [jan, 14],
epiphany: [jan$1, 6],
'orthodox christmas day': [jan$1, 7],
'orthodox new year': [jan$1, 14],
'assumption of mary': [aug, 15],
'all souls day': [nov, 2],
'all souls day': [nov$1, 2],
'feast of the immaculate conception': [dec, 8],
'feast of our lady of guadalupe': [dec, 12],
// Kwanzaa
kwanzaa: [dec, 26],
// Ranged holiday [jan, 1],
kwanzaa: [dec, 26], // Ranged holiday [jan, 1],
// Pagan / metal 🤘
imbolc: [feb, 2],
beltaine: [may, 1],
imbolc: [feb$1, 2],
beltaine: [may$1, 1],
lughnassadh: [aug, 1],
samhain: [oct, 31]
samhain: [oct$1, 31]
};
var fixedDates = function fixedDates(str, normal, year, tz) {
if (fixedHolidays.hasOwnProperty(str) || fixedHolidays.hasOwnProperty(normal)) {
var arr = fixedHolidays[str] || fixedHolidays[normal] || [];
var s = spacetime__default['default'].now(tz);
// holidays that are the same date every year
const fixedDates$1 = function (str, normal, year, tz) {
if (fixed.hasOwnProperty(str) || fixed.hasOwnProperty(normal)) {
let arr = fixed[str] || fixed[normal] || [];
let s = spacetime__default["default"].now(tz);
s = s.year(year);

@@ -108,53 +109,45 @@ s = s.startOf('year');

s = s.date(arr[1]);
if (s.isValid()) {
return s;
return s
}
}
return null;
return null
};
var fixedDates$2 = fixedDates$1;
var _01FixedDates = fixedDates;
//these are holidays on the 'nth weekday of month'
var jan$1 = 'january';
var feb$1 = 'february';
var mar$1 = 'march'; // const apr = 'april'
var may$1 = 'may';
var jun$1 = 'june'; // const jul = 'july'
const jan = 'january';
const feb = 'february';
const mar = 'march';
// const apr = 'april'
const may = 'may';
const jun = 'june';
// const jul = 'july'
// const aug = 'august'
const sep = 'september';
const oct = 'october';
const nov = 'november';
// const dec = 'december'
var sep$1 = 'september';
var oct$1 = 'october';
var nov$1 = 'november'; // const dec = 'december'
var mon = 'monday'; // const tues = 'tuesday'
const mon = 'monday';
// const tues = 'tuesday'
// const wed = 'wednesday'
const thurs = 'thursday';
const fri = 'friday';
// const sat = 'saturday'
const sun = 'sunday';
var thurs = 'thursday';
var fri = 'friday'; // const sat = 'saturday'
let holidays$3 = {
'martin luther king day': [3, mon, jan], //[third monday in january],
'presidents day': [3, mon, feb], //[third monday in february],
var sun = 'sunday';
var holidays = {
'martin luther king day': [3, mon, jan$1],
//[third monday in january],
'presidents day': [3, mon, feb$1],
//[third monday in february],
'commonwealth day': [2, mon, mar$1],
//[second monday in march],
'mothers day': [2, sun, may$1],
//[second Sunday in May],
'fathers day': [3, sun, jun$1],
//[third Sunday in June],
'labor day': [1, mon, sep$1],
//[first monday in september],
'columbus day': [2, mon, oct$1],
//[second monday in october],
'canadian thanksgiving': [2, mon, oct$1],
//[second monday in october],
thanksgiving: [4, thurs, nov$1],
// [fourth Thursday in November],
'black friday': [4, fri, nov$1] //[fourth friday in november],
'commonwealth day': [2, mon, mar], //[second monday in march],
'mothers day': [2, sun, may], //[second Sunday in May],
'fathers day': [3, sun, jun], //[third Sunday in June],
'labor day': [1, mon, sep], //[first monday in september],
'columbus day': [2, mon, oct], //[second monday in october],
'canadian thanksgiving': [2, mon, oct], //[second monday in october],
thanksgiving: [4, thurs, nov], // [fourth Thursday in November],
'black friday': [4, fri, nov] //[fourth friday in november],
// 'memorial day': [may], //[last monday in may],

@@ -164,136 +157,241 @@ // 'us election': [nov], // [Tuesday following the first Monday in November],

// 'advent': [] // fourth Sunday before Christmas
};
}; // add aliases
// add aliases
holidays$3['turday day'] = holidays$3.thanksgiving;
holidays$3['indigenous peoples day'] = holidays$3['columbus day'];
holidays$3['mlk day'] = holidays$3['martin luther king day'];
var calendar = holidays$3;
holidays['turday day'] = holidays.thanksgiving;
holidays['indigenous peoples day'] = holidays['columbus day'];
holidays['mlk day'] = holidays['martin luther king day'];
var calendarHolidays = holidays;
// holidays that are the same date every year
const fixedDates = function (str, normal, year, tz) {
if (calendar.hasOwnProperty(str) || calendar.hasOwnProperty(normal)) {
let arr = calendar[str] || calendar[normal] || [];
let s = spacetime__default["default"].now(tz);
s = s.year(year);
var fixedDates$1 = function fixedDates(str, normal, year, tz) {
if (calendarHolidays.hasOwnProperty(str) || calendarHolidays.hasOwnProperty(normal)) {
var arr = calendarHolidays[str] || calendarHolidays[normal] || [];
var s = spacetime__default['default'].now(tz);
s = s.year(year); // [3rd, 'monday', 'january']
// [3rd, 'monday', 'january']
s = s.month(arr[2]);
s = s.startOf('month'); // make it january
s = s.startOf('month');
// make it january
let month = s.month();
var month = s.month(); // make it the 1st monday
// make it the 1st monday
s = s.day(arr[1]);
if (s.month() !== month) {
s = s.add(1, 'week');
} // make it nth monday
}
// make it nth monday
if (arr[0] > 1) {
s = s.add(arr[0] - 1, 'week');
}
if (s.isValid()) {
return s;
return s
}
}
return null;
return null
};
var nthWeekday = fixedDates;
var _02NthWeekday = fixedDates$1;
// https://www.timeanddate.com/calendar/determining-easter-date.html
// https://www.timeanddate.com/calendar/determining-easter-date.html
var dates = {
let dates$2 = {
easter: 0,
'ash wednesday': -46,
// (46 days before easter)
'palm sunday': 7,
// (1 week before easter)
'maundy thursday': -3,
// (3 days before easter)
'good friday': -2,
// (2 days before easter)
'holy saturday': -1,
// (1 days before easter)
'easter saturday': -1,
// (1 day before easter)
'easter monday': 1,
// (1 day after easter)
'ascension day': 39,
// (39 days after easter)
'whit sunday': 49,
// / pentecost (49 days after easter)
'whit monday': 50,
// (50 days after easter)
'trinity sunday': 65,
// (56 days after easter)
'corpus christi': 60,
// (60 days after easter)
'ash wednesday': -46, // (46 days before easter)
'palm sunday': 7, // (1 week before easter)
'maundy thursday': -3, // (3 days before easter)
'good friday': -2, // (2 days before easter)
'holy saturday': -1, // (1 days before easter)
'easter saturday': -1, // (1 day before easter)
'easter monday': 1, // (1 day after easter)
'ascension day': 39, // (39 days after easter)
'whit sunday': 49, // / pentecost (49 days after easter)
'whit monday': 50, // (50 days after easter)
'trinity sunday': 65, // (56 days after easter)
'corpus christi': 60, // (60 days after easter)
'mardi gras': -47 //(47 days before easter)
};
dates['easter sunday'] = dates.easter;
dates['pentecost'] = dates['whit sunday'];
dates['whitsun'] = dates['whit sunday'];
var easterHolidays = dates;
dates$2['easter sunday'] = dates$2.easter;
dates$2.pentecost = dates$2['whit sunday'];
dates$2.whitsun = dates$2['whit sunday'];
var holidays$2 = dates$2;
// by John Dyer
// based on the algorithm by Oudin (1940) from http://www.tondering.dk/claus/cal/easter.php
var calcEaster = function calcEaster(year) {
var f = Math.floor,
// Golden Number - 1
G = year % 19,
C = f(year / 100),
// related to Epact
H = (C - f(C / 4) - f((8 * C + 13) / 25) + 19 * G + 15) % 30,
// number of days from 21 March to the Paschal full moon
I = H - f(H / 28) * (1 - f(29 / (H + 1)) * f((21 - G) / 11)),
// weekday for the Paschal full moon
J = (year + f(year / 4) + I + 2 - C + f(C / 4)) % 7,
// number of days from 21 March to the Sunday on or before the Paschal full moon
L = I - J,
month = 3 + f((L + 40) / 44),
date = L + 28 - 31 * f(month / 4);
const calcEaster = function (year) {
let f = Math.floor,
// Golden Number - 1
G = year % 19,
C = f(year / 100),
// related to Epact
H = (C - f(C / 4) - f((8 * C + 13) / 25) + 19 * G + 15) % 30,
// number of days from 21 March to the Paschal full moon
I = H - f(H / 28) * (1 - f(29 / (H + 1)) * f((21 - G) / 11)),
// weekday for the Paschal full moon
J = (year + f(year / 4) + I + 2 - C + f(C / 4)) % 7,
// number of days from 21 March to the Sunday on or before the Paschal full moon
L = I - J,
month = 3 + f((L + 40) / 44),
date = L + 28 - 31 * f(month / 4);
month = month === 4 ? 'April' : 'March';
return month + ' ' + date;
return month + ' ' + date
};
var calcEaster_1 = calcEaster;
var calcEaster$1 = calcEaster;
var easterDates = function easterDates(str, normal, year, tz) {
if (easterHolidays.hasOwnProperty(str) || easterHolidays.hasOwnProperty(normal)) {
var days = easterHolidays[str] || easterHolidays[normal] || [];
var date = calcEaster_1(year);
//calculate any holidays based on easter
const easterDates = function (str, normal, year, tz) {
if (holidays$2.hasOwnProperty(str) || holidays$2.hasOwnProperty(normal)) {
let days = holidays$2[str] || holidays$2[normal] || [];
let date = calcEaster$1(year);
if (!date) {
return null; //no easter for this year
return null //no easter for this year
}
var e = spacetime__default['default'](date, tz);
let e = spacetime__default["default"](date, tz);
e = e.year(year);
var s = e.add(days, 'day');
let s = e.add(days, 'day');
if (s.isValid()) {
return s;
return s
}
}
return null;
return null
};
var easterDates$1 = easterDates;
var _03EasterDates = easterDates;
// http://www.astropixels.com/ephemeris/soleq2001.html
// http://www.astropixels.com/ephemeris/soleq2001.html
// years 2000-2100
var exceptions = {
spring: [2003, 2007, 2044, 2048, 2052, 2056, 2060, 2064, 2068, 2072, 2076, 2077, 2080, 2081, 2084, 2085, 2088, 2089, 2092, 2093, 2096, 2097],
summer: [2021, 2016, 2020, 2024, 2028, 2032, 2036, 2040, 2041, 2044, 2045, 2048, 2049, 2052, 2053, 2056, 2057, 2060, 2061, 2064, 2065, 2068, 2069, 2070, 2072, 2073, 2074, 2076, 2077, 2078, 2080, 2081, 2082, 2084, 2085, 2086, 2088, 2089, 2090, 2092, 2093, 2094, 2096, 2097, 2098, 2099],
fall: [2002, 2003, 2004, 2006, 2007, 2010, 2011, 2014, 2015, 2018, 2019, 2022, 2023, 2026, 2027, 2031, 2035, 2039, 2043, 2047, 2051, 2055, 2059, 2092, 2096],
winter: [2002, 2003, 2006, 2007, 2011, 2015, 2019, 2023, 2027, 2031, 2035, 2039, 2043, 2080, 2084, 2088, 2092, 2096]
const exceptions = {
spring: [
2003,
2007,
2044,
2048,
2052,
2056,
2060,
2064,
2068,
2072,
2076,
2077,
2080,
2081,
2084,
2085,
2088,
2089,
2092,
2093,
2096,
2097
],
summer: [
2021,
2016,
2020,
2024,
2028,
2032,
2036,
2040,
2041,
2044,
2045,
2048,
2049,
2052,
2053,
2056,
2057,
2060,
2061,
2064,
2065,
2068,
2069,
2070,
2072,
2073,
2074,
2076,
2077,
2078,
2080,
2081,
2082,
2084,
2085,
2086,
2088,
2089,
2090,
2092,
2093,
2094,
2096,
2097,
2098,
2099
],
fall: [
2002,
2003,
2004,
2006,
2007,
2010,
2011,
2014,
2015,
2018,
2019,
2022,
2023,
2026,
2027,
2031,
2035,
2039,
2043,
2047,
2051,
2055,
2059,
2092,
2096
],
winter: [
2002,
2003,
2006,
2007,
2011,
2015,
2019,
2023,
2027,
2031,
2035,
2039,
2043,
2080,
2084,
2088,
2092,
2096
]
};
var winter20th = [2080, 2084, 2088, 2092, 2096];
var calcSeasons = function calcSeasons(year) {
const winter20th = [2080, 2084, 2088, 2092, 2096];
const calcSeasons = function (year) {
// most common defaults
var res = {
let res = {
spring: 'March 20 ' + year,

@@ -304,31 +402,24 @@ summer: 'June 21 ' + year,

};
if (exceptions.spring.indexOf(year) !== -1) {
res.spring = 'March 19 ' + year;
}
if (exceptions.summer.indexOf(year) !== -1) {
res.summer = 'June 20 ' + year;
}
if (exceptions.fall.indexOf(year) !== -1) {
res.fall = 'Sept 21 ' + year;
} // winter can be 20th, 21st, or 22nd
}
// winter can be 20th, 21st, or 22nd
if (exceptions.winter.indexOf(year) !== -1) {
res.winter = 'Dec 22 ' + year;
}
if (winter20th.indexOf(year) !== -1) {
res.winter = 'Dec 20 ' + year;
}
return res;
return res
};
var calcSeasons$1 = calcSeasons;
var seasons = calcSeasons;
// these are properly calculated in ./lib/seasons
var dates$1 = {
let dates$1 = {
'spring equinox': 'spring',

@@ -338,9 +429,12 @@ 'summer solistice': 'summer',

'winter solstice': 'winter'
}; // aliases
};
// aliases
dates$1['march equinox'] = dates$1['spring equinox'];
dates$1['vernal equinox'] = dates$1['spring equinox'];
dates$1['ostara'] = dates$1['spring equinox'];
dates$1['june solstice'] = dates$1['summer solistice'];
dates$1['litha'] = dates$1['summer solistice'];
dates$1['autumn equinox'] = dates$1['fall equinox'];

@@ -351,29 +445,27 @@ dates$1['autumnal equinox'] = dates$1['fall equinox'];

dates$1['mabon'] = dates$1['fall equinox'];
dates$1['december solstice'] = dates$1['winter solistice'];
dates$1['dec solstice'] = dates$1['winter solistice'];
dates$1['yule'] = dates$1['winter solistice'];
var astroHolidays = dates$1;
var astroDates = function astroDates(str, normal, year, tz) {
if (astroHolidays.hasOwnProperty(str) || astroHolidays.hasOwnProperty(normal)) {
var season = astroHolidays[str] || astroHolidays[normal];
var seasons$1 = seasons(year);
var holidays$1 = dates$1;
if (!season || !seasons$1 || !seasons$1[season]) {
return null; // couldn't figure it out
const astroDates = function (str, normal, year, tz) {
if (holidays$1.hasOwnProperty(str) || holidays$1.hasOwnProperty(normal)) {
let season = holidays$1[str] || holidays$1[normal];
let seasons = calcSeasons$1(year);
if (!season || !seasons || !seasons[season]) {
return null // couldn't figure it out
}
var s = spacetime__default['default'](seasons$1[season], tz);
let s = spacetime__default["default"](seasons[season], tz);
if (s.isValid()) {
return s;
return s
}
}
return null;
return null
};
var astroDates$1 = astroDates;
var _04Astronomical = astroDates;
var dates$2 = {
let dates = {
// Muslim holidays

@@ -385,4 +477,3 @@ 'isra and miraj': 'april 13',

'eid ul-Fitr': 'june 15',
ramadan: 'may 16',
// Range holiday
ramadan: 'may 16', // Range holiday
'eid al-adha': 'sep 22',

@@ -392,36 +483,34 @@ muharram: 'sep 12',

};
var lunarHolidays = dates$2;
var holidays = dates;
var dayDiff = -10.64;
// (lunar year is 354.36 days)
const dayDiff = -10.64;
var lunarDates = function lunarDates(str, normal, year, tz) {
if (lunarHolidays.hasOwnProperty(str) || lunarHolidays.hasOwnProperty(normal)) {
var date = lunarHolidays[str] || lunarHolidays[normal] || [];
const lunarDates = function (str, normal, year, tz) {
if (holidays.hasOwnProperty(str) || holidays.hasOwnProperty(normal)) {
let date = holidays[str] || holidays[normal] || [];
if (!date) {
return null;
} // start at 2018
var s = spacetime__default['default'](date + ' 2018', tz);
var diff = year - 2018;
var toAdd = diff * dayDiff;
return null
}
// start at 2018
let s = spacetime__default["default"](date + ' 2018', tz);
let diff = year - 2018;
let toAdd = diff * dayDiff;
s = s.add(toAdd, 'day');
s = s.startOf('day'); // now set the correct year
s = s.startOf('day');
// now set the correct year
s = s.year(year);
if (s.isValid()) {
return s;
return s
}
}
return null;
return null
};
var lunarDates$1 = lunarDates;
var _05LunarDates = lunarDates;
const nowYear = spacetime__default["default"].now().year();
var nowYear = spacetime__default['default'].now().year();
var spacetimeHoliday = function spacetimeHoliday(str, year, tz) {
const spacetimeHoliday = function (str, year, tz) {
year = year || nowYear;

@@ -433,49 +522,37 @@ str = str || '';

var normal = str.replace(/ day$/, '');
let normal = str.replace(/ day$/, '');
normal = normal.replace(/^the /, '');
normal = normal.replace(/^orthodox /, ''); //orthodox good friday
// try easier, unmoving holidays
var s = _01FixedDates(str, normal, year, tz);
let s = fixedDates$2(str, normal, year, tz);
if (s !== null) {
return s;
} // try 'nth monday' holidays
s = _02NthWeekday(str, normal, year, tz);
return s
}
// try 'nth monday' holidays
s = nthWeekday(str, normal, year, tz);
if (s !== null) {
return s;
} // easter-based holidays
s = _03EasterDates(str, normal, year, tz);
return s
}
// easter-based holidays
s = easterDates$1(str, normal, year, tz);
if (s !== null) {
return s;
} // solar-based holidays
s = _04Astronomical(str, normal, year, tz);
return s
}
// solar-based holidays
s = astroDates$1(str, normal, year, tz);
if (s !== null) {
return s;
} // mostly muslim holidays
s = _05LunarDates(str, normal, year, tz);
return s
}
// mostly muslim holidays
s = lunarDates$1(str, normal, year, tz);
if (s !== null) {
return s;
return s
}
return null;
return null
};
var src = spacetimeHoliday;
return spacetimeHoliday;
return src;
})));
//# sourceMappingURL=spacetime-holiday.js.map
}));

@@ -1,1 +0,1 @@

!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("spacetime")):"function"==typeof define&&define.amd?define(["spacetime"],e):(a="undefined"!=typeof globalThis?globalThis:a||self).spacetimeHoliday=e(a.spacetime)}(this,(function(a){"use strict";function e(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var n=e(a),r="january",t="february",i="march",s="april",d="may",l="july",o="august",u="september",y="october",m="november",f="december",c={"new years eve":[f,31],"new years":[r,1],"new years day":[r,1],"inauguration day":[r,20],"australia day":[r,26],"national freedom day":[t,1],"groundhog day":[t,2],"rosa parks day":[t,4],"valentines day":[t,14],"saint valentines day":[t,14],"st valentines day ":[t,14],"saint patricks day":[i,17],"st patricks day":[i,17],"april fools":[s,1],"april fools day":[s,1],"emancipation day":[s,16],"tax day":[s,15],"labour day":[d,1],"cinco de mayo":[d,5],"national nurses day":[d,6],"harvey milk day":[d,22],"victoria day":[d,24],juneteenth:["june",19],"canada day":[l,1],"independence day":[l,4],"independents day":[l,4],"bastille day":[l,14],"purple heart day":[o,7],"womens equality day":[o,26],"16 de septiembre":[u,16],"dieciseis de septiembre":[u,16],"grito de dolores":[u,16],halloween:[y,31],"all hallows eve":[y,31],"day of the dead":[y,31],"dia de muertos":[y,31],"veterans day":[m,11],"st andrews day":[m,30],"saint andrews day":[m,30],"all saints day":[m,1],"all sts day":[m,1],"armistice day":[m,11],"rememberance day":[m,11],"christmas eve":[f,24],christmas:[f,25],xmas:[f,25],"boxing day":[f,26],"st stephens day":[f,26],"saint stephens day":[f,26],epiphany:[r,6],"orthodox christmas day":[r,7],"orthodox new year":[r,14],"assumption of mary":[o,15],"all souls day":[m,2],"feast of the immaculate conception":[f,8],"feast of our lady of guadalupe":[f,12],kwanzaa:[f,26],imbolc:[t,2],beltaine:[d,1],lughnassadh:[o,1],samhain:[y,31]},p=function(a,e,r,t){if(c.hasOwnProperty(a)||c.hasOwnProperty(e)){var i=c[a]||c[e]||[],s=n.default.now(t);if((s=(s=(s=(s=s.year(r)).startOf("year")).month(i[0])).date(i[1])).isValid())return s}return null},h="october",w="november",v="monday",g="sunday",b={"martin luther king day":[3,v,"january"],"presidents day":[3,v,"february"],"commonwealth day":[2,v,"march"],"mothers day":[2,g,"may"],"fathers day":[3,g,"june"],"labor day":[1,v,"september"],"columbus day":[2,v,h],"canadian thanksgiving":[2,v,h],thanksgiving:[4,"thursday",w],"black friday":[4,"friday",w]};b["turday day"]=b.thanksgiving,b["indigenous peoples day"]=b["columbus day"],b["mlk day"]=b["martin luther king day"];var x=b,q=function(a,e,r,t){if(x.hasOwnProperty(a)||x.hasOwnProperty(e)){var i=x[a]||x[e]||[],s=n.default.now(t),d=(s=(s=(s=s.year(r)).month(i[2])).startOf("month")).month();if((s=s.day(i[1])).month()!==d&&(s=s.add(1,"week")),i[0]>1&&(s=s.add(i[0]-1,"week")),s.isValid())return s}return null},O={easter:0,"ash wednesday":-46,"palm sunday":7,"maundy thursday":-3,"good friday":-2,"holy saturday":-1,"easter saturday":-1,"easter monday":1,"ascension day":39,"whit sunday":49,"whit monday":50,"trinity sunday":65,"corpus christi":60,"mardi gras":-47};O["easter sunday"]=O.easter,O.pentecost=O["whit sunday"],O.whitsun=O["whit sunday"];var j=O,k=function(a){var e=Math.floor,n=a%19,r=e(a/100),t=(r-e(r/4)-e((8*r+13)/25)+19*n+15)%30,i=t-e(t/28)*(1-e(29/(t+1))*e((21-n)/11)),s=i-(a+e(a/4)+i+2-r+e(r/4))%7,d=3+e((s+40)/44),l=s+28-31*e(d/4);return(d=4===d?"April":"March")+" "+l},P=function(a,e,r,t){if(j.hasOwnProperty(a)||j.hasOwnProperty(e)){var i=j[a]||j[e]||[],s=k(r);if(!s)return null;var d=n.default(s,t),l=(d=d.year(r)).add(i,"day");if(l.isValid())return l}return null},V={spring:[2003,2007,2044,2048,2052,2056,2060,2064,2068,2072,2076,2077,2080,2081,2084,2085,2088,2089,2092,2093,2096,2097],summer:[2021,2016,2020,2024,2028,2032,2036,2040,2041,2044,2045,2048,2049,2052,2053,2056,2057,2060,2061,2064,2065,2068,2069,2070,2072,2073,2074,2076,2077,2078,2080,2081,2082,2084,2085,2086,2088,2089,2090,2092,2093,2094,2096,2097,2098,2099],fall:[2002,2003,2004,2006,2007,2010,2011,2014,2015,2018,2019,2022,2023,2026,2027,2031,2035,2039,2043,2047,2051,2055,2059,2092,2096],winter:[2002,2003,2006,2007,2011,2015,2019,2023,2027,2031,2035,2039,2043,2080,2084,2088,2092,2096]},M=[2080,2084,2088,2092,2096],D=function(a){var e={spring:"March 20 "+a,summer:"June 21 "+a,fall:"Sept 22 "+a,winter:"Dec 21 "+a};return-1!==V.spring.indexOf(a)&&(e.spring="March 19 "+a),-1!==V.summer.indexOf(a)&&(e.summer="June 20 "+a),-1!==V.fall.indexOf(a)&&(e.fall="Sept 21 "+a),-1!==V.winter.indexOf(a)&&(e.winter="Dec 22 "+a),-1!==M.indexOf(a)&&(e.winter="Dec 20 "+a),e},S={"spring equinox":"spring","summer solistice":"summer","fall equinox":"fall","winter solstice":"winter"};S["march equinox"]=S["spring equinox"],S["vernal equinox"]=S["spring equinox"],S.ostara=S["spring equinox"],S["june solstice"]=S["summer solistice"],S.litha=S["summer solistice"],S["autumn equinox"]=S["fall equinox"],S["autumnal equinox"]=S["fall equinox"],S["september equinox"]=S["fall equinox"],S["sept equinox"]=S["fall equinox"],S.mabon=S["fall equinox"],S["december solstice"]=S["winter solistice"],S["dec solstice"]=S["winter solistice"],S.yule=S["winter solistice"];var F=S,J=function(a,e,r,t){if(F.hasOwnProperty(a)||F.hasOwnProperty(e)){var i=F[a]||F[e],s=D(r);if(!i||!s||!s[i])return null;var d=n.default(s[i],t);if(d.isValid())return d}return null},T={"isra and miraj":"april 13","lailat al-qadr":"june 10","eid al-fitr":"june 15","id al-Fitr":"june 15","eid ul-Fitr":"june 15",ramadan:"may 16","eid al-adha":"sep 22",muharram:"sep 12","prophets birthday":"nov 21"},z=function(a,e,r,t){if(T.hasOwnProperty(a)||T.hasOwnProperty(e)){var i=T[a]||T[e]||[];if(!i)return null;var s=n.default(i+" 2018",t),d=-10.64*(r-2018);if((s=(s=(s=s.add(d,"day")).startOf("day")).year(r)).isValid())return s}return null},A=n.default.now().year();return function(a,e,n){e=e||A,a=a||"";var r=(a=(a=(a=String(a)).trim().toLowerCase()).replace(/'s/,"s")).replace(/ day$/,"");r=(r=r.replace(/^the /,"")).replace(/^orthodox /,"");var t=p(a,r,e,n);return null!==t||null!==(t=q(a,r,e,n))||null!==(t=P(a,r,e,n))||null!==(t=J(a,r,e,n))||null!==(t=z(a,r,e,n))?t:null}}));
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("spacetime")):"function"==typeof define&&define.amd?define(["spacetime"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).spacetimeHoliday=a(e.spacetime)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(e);const t="january",r="february",i="march",s="april",l="may",d="july",o="august",u="september",y="october",m="november",f="december";var c={"new years eve":[f,31],"new years":[t,1],"new years day":[t,1],"inauguration day":[t,20],"australia day":[t,26],"national freedom day":[r,1],"groundhog day":[r,2],"rosa parks day":[r,4],"valentines day":[r,14],"saint valentines day":[r,14],"st valentines day ":[r,14],"saint patricks day":[i,17],"st patricks day":[i,17],"april fools":[s,1],"april fools day":[s,1],"emancipation day":[s,16],"tax day":[s,15],"labour day":[l,1],"cinco de mayo":[l,5],"national nurses day":[l,6],"harvey milk day":[l,22],"victoria day":[l,24],juneteenth:["june",19],"canada day":[d,1],"independence day":[d,4],"independents day":[d,4],"bastille day":[d,14],"purple heart day":[o,7],"womens equality day":[o,26],"16 de septiembre":[u,16],"dieciseis de septiembre":[u,16],"grito de dolores":[u,16],halloween:[y,31],"all hallows eve":[y,31],"day of the dead":[y,31],"dia de muertos":[y,31],"veterans day":[m,11],"st andrews day":[m,30],"saint andrews day":[m,30],"all saints day":[m,1],"all sts day":[m,1],"armistice day":[m,11],"rememberance day":[m,11],"christmas eve":[f,24],christmas:[f,25],xmas:[f,25],"boxing day":[f,26],"st stephens day":[f,26],"saint stephens day":[f,26],epiphany:[t,6],"orthodox christmas day":[t,7],"orthodox new year":[t,14],"assumption of mary":[o,15],"all souls day":[m,2],"feast of the immaculate conception":[f,8],"feast of our lady of guadalupe":[f,12],kwanzaa:[f,26],imbolc:[r,2],beltaine:[l,1],lughnassadh:[o,1],samhain:[y,31]};var p=function(e,a,t,r){if(c.hasOwnProperty(e)||c.hasOwnProperty(a)){let i=c[e]||c[a]||[],s=n.default.now(r);if(s=s.year(t),s=s.startOf("year"),s=s.month(i[0]),s=s.date(i[1]),s.isValid())return s}return null};const h="october",w="november",g="monday",b="sunday";let v={"martin luther king day":[3,g,"january"],"presidents day":[3,g,"february"],"commonwealth day":[2,g,"march"],"mothers day":[2,b,"may"],"fathers day":[3,b,"june"],"labor day":[1,g,"september"],"columbus day":[2,g,h],"canadian thanksgiving":[2,g,h],thanksgiving:[4,"thursday",w],"black friday":[4,"friday",w]};v["turday day"]=v.thanksgiving,v["indigenous peoples day"]=v["columbus day"],v["mlk day"]=v["martin luther king day"];var x=v;var q=function(e,a,t,r){if(x.hasOwnProperty(e)||x.hasOwnProperty(a)){let i=x[e]||x[a]||[],s=n.default.now(r);s=s.year(t),s=s.month(i[2]),s=s.startOf("month");let l=s.month();if(s=s.day(i[1]),s.month()!==l&&(s=s.add(1,"week")),i[0]>1&&(s=s.add(i[0]-1,"week")),s.isValid())return s}return null};let O={easter:0,"ash wednesday":-46,"palm sunday":7,"maundy thursday":-3,"good friday":-2,"holy saturday":-1,"easter saturday":-1,"easter monday":1,"ascension day":39,"whit sunday":49,"whit monday":50,"trinity sunday":65,"corpus christi":60,"mardi gras":-47};O["easter sunday"]=O.easter,O.pentecost=O["whit sunday"],O.whitsun=O["whit sunday"];var j=O;var k=function(e){let a=Math.floor,n=e%19,t=a(e/100),r=(t-a(t/4)-a((8*t+13)/25)+19*n+15)%30,i=r-a(r/28)*(1-a(29/(r+1))*a((21-n)/11)),s=i-(e+a(e/4)+i+2-t+a(t/4))%7,l=3+a((s+40)/44),d=s+28-31*a(l/4);return l=4===l?"April":"March",l+" "+d};var P=function(e,a,t,r){if(j.hasOwnProperty(e)||j.hasOwnProperty(a)){let i=j[e]||j[a]||[],s=k(t);if(!s)return null;let l=n.default(s,r);l=l.year(t);let d=l.add(i,"day");if(d.isValid())return d}return null};const V={spring:[2003,2007,2044,2048,2052,2056,2060,2064,2068,2072,2076,2077,2080,2081,2084,2085,2088,2089,2092,2093,2096,2097],summer:[2021,2016,2020,2024,2028,2032,2036,2040,2041,2044,2045,2048,2049,2052,2053,2056,2057,2060,2061,2064,2065,2068,2069,2070,2072,2073,2074,2076,2077,2078,2080,2081,2082,2084,2085,2086,2088,2089,2090,2092,2093,2094,2096,2097,2098,2099],fall:[2002,2003,2004,2006,2007,2010,2011,2014,2015,2018,2019,2022,2023,2026,2027,2031,2035,2039,2043,2047,2051,2055,2059,2092,2096],winter:[2002,2003,2006,2007,2011,2015,2019,2023,2027,2031,2035,2039,2043,2080,2084,2088,2092,2096]},M=[2080,2084,2088,2092,2096];var D=function(e){let a={spring:"March 20 "+e,summer:"June 21 "+e,fall:"Sept 22 "+e,winter:"Dec 21 "+e};return-1!==V.spring.indexOf(e)&&(a.spring="March 19 "+e),-1!==V.summer.indexOf(e)&&(a.summer="June 20 "+e),-1!==V.fall.indexOf(e)&&(a.fall="Sept 21 "+e),-1!==V.winter.indexOf(e)&&(a.winter="Dec 22 "+e),-1!==M.indexOf(e)&&(a.winter="Dec 20 "+e),a};let S={"spring equinox":"spring","summer solistice":"summer","fall equinox":"fall","winter solstice":"winter"};S["march equinox"]=S["spring equinox"],S["vernal equinox"]=S["spring equinox"],S.ostara=S["spring equinox"],S["june solstice"]=S["summer solistice"],S.litha=S["summer solistice"],S["autumn equinox"]=S["fall equinox"],S["autumnal equinox"]=S["fall equinox"],S["september equinox"]=S["fall equinox"],S["sept equinox"]=S["fall equinox"],S.mabon=S["fall equinox"],S["december solstice"]=S["winter solistice"],S["dec solstice"]=S["winter solistice"],S.yule=S["winter solistice"];var F=S;var J=function(e,a,t,r){if(F.hasOwnProperty(e)||F.hasOwnProperty(a)){let i=F[e]||F[a],s=D(t);if(!i||!s||!s[i])return null;let l=n.default(s[i],r);if(l.isValid())return l}return null};var T={"isra and miraj":"april 13","lailat al-qadr":"june 10","eid al-fitr":"june 15","id al-Fitr":"june 15","eid ul-Fitr":"june 15",ramadan:"may 16","eid al-adha":"sep 22",muharram:"sep 12","prophets birthday":"nov 21"};var z=function(e,a,t,r){if(T.hasOwnProperty(e)||T.hasOwnProperty(a)){let i=T[e]||T[a]||[];if(!i)return null;let s=n.default(i+" 2018",r),l=-10.64*(t-2018);if(s=s.add(l,"day"),s=s.startOf("day"),s=s.year(t),s.isValid())return s}return null};const A=n.default.now().year();return function(e,a,n){a=a||A,e=e||"";let t=(e=(e=(e=String(e)).trim().toLowerCase()).replace(/'s/,"s")).replace(/ day$/,"");t=t.replace(/^the /,""),t=t.replace(/^orthodox /,"");let r=p(e,t,a,n);return null!==r?r:(r=q(e,t,a,n),null!==r?r:(r=P(e,t,a,n),null!==r?r:(r=J(e,t,a,n),null!==r?r:(r=z(e,t,a,n),null!==r?r:null))))}}));
{
"name": "spacetime-holiday",
"description": "reckoning of common holiday dates ",
"version": "0.1.0",
"version": "0.2.2",
"main": "builds/spacetime-holiday.js",
"unpkg": "builds/spacetime-holiday.min.js",
"module": "./builds/spacetime-holiday.mjs",
"type": "commonjs",
"type": "module",
"sideEffects": false,
"exports": {
".": {
"require": "./builds/spacetime-holiday.js",
"import": "./builds/spacetime-holiday.mjs",
"default": "./builds/spacetime-holiday.mjs"
}
},
"author": "Spencer Kelly",
"homepage": "https://github.com/spencermountain/spacetime-holiday",
"homepage": "https://github.com/spencermountain/spacetime/tree/master/plugins/spacetime-holiday",
"repository": {
"type": "git",
"url": "git+https://github.com/spencermountain/spacetime.git"
},
"scripts": {
"watch": "amble scratch.js",
"build": "rollup -c",
"build": "rollup -c --silent",
"test": "TESTENV=dev tape ./tests/**/*.test.js | tap-dancer",

@@ -27,20 +39,11 @@ "testb": "TESTENV=prod tape ./tests/**/*.test.js | tap-dancer"

},
"dependencies": {},
"peerDependencies": {
"spacetime": "^6.3.0"
"spacetime": ">=6.3.0"
},
"devDependencies": {
"@babel/core": "7.12.9",
"@babel/preset-env": "7.12.7",
"amble": "1.2.0",
"rollup": "2.33.3",
"rollup-plugin-babel": "4.4.0",
"rollup-plugin-commonjs": "10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "5.2.0",
"rollup-plugin-terser": "7.0.2",
"tap-dancer": "0.3.1",
"tape": "5.0.1"
"amble": "1.3.0",
"tap-dancer": "0.3.4",
"tape": "5.5.2"
},
"licence": "MIT"
}
}

@@ -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,n)=>{const[a,r]=e.split("/"),[o,i]=r.split(":");return Date.UTC(n,a-1,o,i)-36e5*t};var t=(t,n,a,r,o)=>{const i=new Date(t).getUTCFullYear(),s=e(n,o,i),u=e(a,r,i);return t>=s&&t<u};var n=e=>{let 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;let a=n.offset,r=n.offset+1;"n"===n.hem&&(r=a-1);let o=n.dst.split("->");return!0===t(e.epoch,o[0],o[1],a,r)?a:r},a={"9|s":"2/dili,2/jayapura","9|n":"2/chita,2/khandyga,2/pyongyang,2/seoul,2/tokyo,11/palau,japan,rok","9.5|s|04/03:03->10/02: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,singapore","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,hongkong,prc,roc","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/ho_chi_minh,2/tomsk,2/vientiane,2/saigon","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/yangon,9/cocos,2/rangoon","5|s":"12/mawson,9/kerguelen","5|n":"2/aqtau,2/aqtobe,2/ashgabat,2/atyrau,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/kolkata,2/colombo,2/calcutta","4|s":"9/reunion","4|n":"2/baku,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,iran","4.5|n":"2/kabul","3|s":"12/syowa,9/antananarivo","3|n|03/27:03->10/30: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/27:02->10/30:03":"8/chisinau,8/tiraspol","3|n|03/27:00->10/29:24":"2/beirut","3|n|03/26:00->10/28:01":"2/gaza,2/hebron","3|n|03/25:02->10/30:02":"2/jerusalem,2/tel_aviv,israel","3|n|03/25:00->10/27:24":"2/damascus","3|n|02/25:00->10/28:01":"2/amman","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/kuwait,2/qatar,2/riyadh,8/istanbul,8/kirov,8/minsk,8/moscow,8/simferopol,9/comoro,9/mayotte,2/istanbul,turkey,w-su","2|s|03/27:02->10/30:02":"12/troll","2|s":"0/gaborone,0/harare,0/johannesburg,0/lubumbashi,0/lusaka,0/maputo,0/maseru,0/mbabane","2|n|03/27:02->10/30: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,poland","2|n":"0/blantyre,0/bujumbura,0/cairo,0/khartoum,0/kigali,0/tripoli,8/kaliningrad,egypt,libya","1|s":"0/brazzaville,0/kinshasa,0/luanda,0/windhoek","1|n|03/27:03->05/08:02":"0/casablanca,0/el_aaiun","1|n|03/27:01->10/30:02":"3/canary,3/faroe,3/madeira,8/dublin,8/guernsey,8/isle_of_man,8/jersey,8/lisbon,8/london,3/faeroe,eire,8/belfast,gb-eire,gb,portugal","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/03:03->09/25:02":"12/mcmurdo,11/auckland,12/south_pole,nz","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,kwajalein","12.75|s|04/03:03->04/03:02":"11/chatham,nz-chat","11|s|04/03:03->10/02:02":"12/macquarie","11|s":"11/bougainville","11|n":"2/magadan,2/sakhalin,11/efate,11/guadalcanal,11/kosrae,11/noumea,11/pohnpei,11/ponape","11.5|n|04/03:03->10/02:02":"11/norfolk","10|s|04/03:03->10/02: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/chuuk,11/truk,11/yap","10.5|s|04/03:01->10/02:02":"4/lord_howe,4/lhi","0|n|03/27:00->10/30: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/greenwich,13/uct,13/universal,13/zulu,gmt-0,gmt+0,gmt0,greenwich,iceland,uct,universal,utc,zulu","-9|n|03/13:02->11/06:02":"1/adak,1/atka,us/aleutian","-9|n":"11/gambier","-9.5|n":"11/marquesas","-8|n|03/13:02->11/06:02":"1/anchorage,1/juneau,1/metlakatla,1/nome,1/sitka,1/yakutat,us/alaska","-8|n":"11/pitcairn","-7|n|03/13:02->11/06: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/02:22->09/03:22":"11/easter,7/easterisland","-6|n|04/03:02->10/30:02":"1/chihuahua,1/mazatlan,10/bajasur","-6|n|03/13:02->11/06:02":"1/boise,1/cambridge_bay,1/denver,1/edmonton,1/inuvik,1/ojinaga,1/yellowknife,1/shiprock,6/mountain,navajo,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/03:02->10/30:02":"1/bahia_banderas,1/merida,1/mexico_city,1/monterrey,10/general","-5|n|03/13:02->11/06: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,jamaica","-4|s|05/13:23->08/13:01":"12/palmer","-4|s|04/02:24->09/04:00":"1/santiago,7/continental","-4|s|03/26:24->10/02: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/13:02->11/06: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/13:00->11/06:01":"1/havana,cuba","-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/comodrivadavia,1/argentina/buenos_aires,1/argentina/catamarca,1/argentina/cordoba,1/argentina/jujuy,1/argentina/mendoza,1/argentina/rosario,1/rosario,5/east","-3|n|03/13:02->11/06: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/26:22->10/29:23":"1/nuuk,1/godthab","-2|n|03/13:02->11/06:02":"1/miquelon","-2|n":"1/noronha,3/south_georgia,5/denoronha","-2.5|n|03/13:02->11/06: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=["africa","america","asia","atlantic","australia","brazil","canada","chile","europe","indian","mexico","pacific","antarctica","etc"];let o={};Object.keys(a).forEach(e=>{let t=e.split("|"),n={offset:Number(t[0]),hem:t[1]};t[2]&&(n.dst=t[2]),a[e].split(",").forEach(e=>{e=e.replace(/(^[0-9]+)\//,(e,t)=>(t=Number(t),r[t]+"/")),o[e]=n})}),o.utc={offset:0,hem:"n"};for(let e=-14;e<=14;e+=.5){let t=e;t>0&&(t="+"+t);let n="etc/gmt"+t;o[n]={offset:-1*e,hem:"n"},n="utc/gmt"+t,o[n]={offset:-1*e,hem:"n"}}var i=o;const s=/(\-?[0-9]+)h(rs)?/i,u=/(\-?[0-9]+)/,l=/utc([\-+]?[0-9]+)/i,c=/gmt([\-+]?[0-9]+)/i,h=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(s);if(null!==t)return h(t[1]);if(t=e.match(l),null!==t)return h(t[1]);if(t=e.match(c),null!==t){let e=-1*Number(t[1]);return h(e)}return t=e.match(u),null!==t?h(t[1]):null};const d=(()=>{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(i).reduce((e,t)=>{let n=t.split("/")[1]||"";return n=n.replace(/_/g," "),e[n]=t,e},{});var p=(e,t)=>{if(!e)return d;"string"!=typeof e&&console.error("Timezone must be a string - recieved: '",e,"'\n");let n=e.trim();if(n=n.toLowerCase(),!0===t.hasOwnProperty(n))return n;if(n=(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"))(n),!0===t.hasOwnProperty(n))return n;if(!0===f.hasOwnProperty(n))return f[n];if(!0===/[0-9]/.test(n)){let e=m(n);if(e)return e}throw new Error("Spacetime: Cannot find timezone named: '"+e+"'. Please enter an IANA timezone id.")};function y(e){return e%4==0&&e%100!=0||e%400==0}function g(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.valueOf())}function b(e){return"[object Object]"===Object.prototype.toString.call(e)}function k(e,t=2){return(e+="").length>=t?e:new Array(t-e.length+1).join("0")+e}function w(e){let t=e%10,n=e%100;return 1===t&&11!==n?e+"st":2===t&&12!==n?e+"nd":3===t&&13!==n?e+"rd":e+"th"}function v(e){return e=(e=String(e)).replace(/([0-9])(st|nd|rd|th)$/i,"$1"),parseInt(e,10)}function _(e=""){return"day"===(e=(e=(e=(e=e.toLowerCase().trim()).replace(/ies$/,"y")).replace(/s$/,"")).replace(/-/g,""))||"days"===e?"date":"min"===e||"mins"===e?"minute":e}function j(e){return"number"==typeof e?e:g(e)?e.getTime():e.epoch?e.epoch:null}function z(e,t){return!1===b(e)?t.clone().set(e):e}function $(e,t=""){const n=e>0?"+":"-",a=Math.abs(e);return`${n}${k(parseInt(""+a,10))}${t}${k(a%1*60)}`}const O={year:(new Date).getFullYear(),month:0,date:1};var D={parseArray:(e,t,n)=>{if(0===t.length)return e;let a=["year","month","date","hour","minute","second","millisecond"];for(let r=0;r<a.length;r++){let o=t[r]||n[a[r]]||O[a[r]]||0;e=e[a[r]](o)}return e},parseObject:(e,t,n)=>{if(0===Object.keys(t).length)return e;t=Object.assign({},O,n,t);let a=Object.keys(t);for(let r=0;r<a.length;r++){let o=a[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]||n[o]||O[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 M=function(e){return e.epoch=Date.now(),Object.keys(e._today||{}).forEach(t=>{"function"==typeof e[t]&&(e=e[t](e._today[t]))}),e},S={now:e=>M(e),today:e=>M(e),tonight:e=>e=(e=M(e)).hour(18),tomorrow:e=>e=(e=(e=M(e)).add(1,"day")).startOf("day"),yesterday:e=>e=(e=(e=M(e)).subtract(1,"day")).startOf("day"),christmas:e=>{let t=M(e).year();return e=e.set([t,11,25,18,0,0])},"new years":e=>{let t=M(e).year();return e=e.set([t,11,31,18,0,0])}};S["new years eve"]=S["new years"];var q=S;var N=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 I={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5};I.date=I.day,I.month=25488e5,I.week=6048e5,I.year=3154e7,Object.keys(I).forEach(e=>{I[e+"s"]=I[e]});var T=I;const E=(e,t,n,a,r)=>{let o=e.d[n]();if(o===t)return;let i=null===r?null:e.d[r](),s=e.epoch,u=t-o;e.epoch+=T[a]*u,"day"===a&&Math.abs(u)>28&&t<28&&(e.epoch+=T.hour),null!==r&&i!==e.d[r]()&&(e.epoch=s);const l=T[a]/2;for(;e.d[n]()<t;)e.epoch+=l;for(;e.d[n]()>t;)e.epoch-=l;null!==r&&i!==e.d[r]()&&(e.epoch=s)},C={year:{valid:e=>e>-4e3&&e<4e3,walkTo:(e,t)=>E(e,t,"getFullYear","year",null)},month:{valid:e=>e>=0&&e<=11,walkTo:(e,t)=>{let n=e.d,a=n.getMonth(),r=e.epoch,o=n.getFullYear();if(a===t)return;let i=t-a;for(e.epoch+=T.day*(28*i),o!==e.d.getFullYear()&&(e.epoch=r);e.d.getMonth()<t;)e.epoch+=T.day;for(;e.d.getMonth()>t;)e.epoch-=T.day}},date:{valid:e=>e>0&&e<=31,walkTo:(e,t)=>E(e,t,"getDate","day","getMonth")},hour:{valid:e=>e>=0&&e<24,walkTo:(e,t)=>E(e,t,"getHours","hour","getDate")},minute:{valid:e=>e>=0&&e<60,walkTo:(e,t)=>E(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 x=(e,t)=>{let n=Object.keys(C),a=e.clone();for(let r=0;r<n.length;r++){let o=n[r],i=t[o];if(void 0===i&&(i=a[o]()),"string"==typeof i&&(i=parseInt(i,10)),!C[o].valid(i))return e.epoch=null,void(!1===e.silent&&console.warn("invalid "+o+": "+i));C[o].walkTo(e,i)}};var Y=[31,28,31,30,31,30,31,31,30,31,30,31];let A=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],F=["january","february","march","april","may","june","july","august","september","october","november","december"];function B(){return A}function H(){return function(){const e={sep:8};for(let t=0;t<A.length;t++)e[A[t]]=t;for(let t=0;t<F.length;t++)e[F[t]]=t;return e}()}var L=(e,t)=>{if(!t)return e;let n=0;if(/^[\+-]?[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")),n=parseFloat(t),Math.abs(n)>100&&(n/=100),0===n||"Z"===t||"z"===t)return e.tz="etc/gmt",e;n*=-1,n>=0&&(n="+"+n);let a="etc/gmt"+n;return e.timezones[a]&&(e.tz=a),e};var P=(e,t="")=>{let n=(t=t.replace(/^\s+/,"").toLowerCase()).match(/([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?[:\.]?([0-9]{1,4})?/);if(null!==n){let a=Number(n[1]);if(a<0||a>24)return e.startOf("day");let r=Number(n[2]);if(n[2].length<2||r<0||r>59)return e.startOf("day");e=(e=(e=(e=e.hour(a)).minute(r)).seconds(n[3]||0)).millisecond(function(e=""){return(e=String(e)).length>3?e=e.substr(0,3):1===e.length?e+="00":2===e.length&&(e+="0"),Number(e)||0}(n[4]));let o=t.match(/[\b0-9] ?(am|pm)\b/);return null!==o&&o[1]&&(e=e.ampm(o[1])),e}if(n=t.match(/([0-9]+) ?(am|pm)/),null!==n&&n[1]){let t=Number(n[1]);return t>12||t<1?e.startOf("day"):e=(e=(e=e.hour(n[1]||0)).ampm(n[2])).startOf("hour")}return e=e.startOf("day")};let Z=H();const Q=e=>{if(!0!==Y.hasOwnProperty(e.month))return!1;if(1===e.month)return!!(y(e.year)&&e.date<=29)||e.date<=28;let t=Y[e.month]||0;return e.date<=t},G=(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 n=parseInt(e,10);return!n&&t&&(n=t.year),n=n||(new Date).getFullYear(),n},U=function(e){return"sept"===(e=e.toLowerCase().trim())?Z.sep:Z[e]};var V=[].concat([{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 n={year:t[1],month:parseInt(t[2],10)-1,date:t[3]};return!1===Q(n)?(e.epoch=null,e):(L(e,t[5]),x(e,n),e=P(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 n={year:t[1],month:parseInt(t[2],10)-1,date:parseInt(t[3],10)};return n.month>=12&&(n.date=parseInt(t[2],10),n.month=parseInt(t[3],10)-1),!1===Q(n)?(e.epoch=null,e):(x(e,n),e=P(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 n={year:G(t[1],e._today),month:U(t[2]),date:v(t[3]||"")};return!1===Q(n)?(e.epoch=null,e):(x(e,n),e=P(e,t[4]))}}],[{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 n=parseInt(t[1],10)-1,a=parseInt(t[2],10);(e.british||n>=12)&&(a=parseInt(t[1],10),n=parseInt(t[2],10)-1);let r={date:a,month:n,year:G(t[3],e._today)||(new Date).getFullYear()};return!1===Q(r)?(e.epoch=null,e):(x(e,r),e=P(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 n={year:G(t[3],e._today),month:U(t[1]),date:v(t[2]||"")};return!1===Q(n)?(e.epoch=null,e):(x(e,n),e=P(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2})( [0-9]{4})?( ([0-9:]+( ?am| ?pm| ?gmt)?))?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:U(t[1]),date:v(t[2]||"")};return!1===Q(n)?(e.epoch=null,e):(x(e,n),e=P(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2})( [0-9:]+)?( \+[0-9]{4})?( [0-9]{4})?$/i,parse:(e,t)=>{let n={year:G(t[5],e._today),month:U(t[1]),date:v(t[2]||"")};return!1===Q(n)?(e.epoch=null,e):(x(e,n),e=P(e,t[3]))}}],[{reg:/^([0-9]{1,2})[\-\/]([a-z]+)[\-\/]?([0-9]{4})?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:U(t[2]),date:v(t[1]||"")};return!1===Q(n)?(e.epoch=null,e):(x(e,n),e=P(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 n={year:G(t[3],e._today),month:U(t[2]),date:v(t[1])};return n.month&&!1!==Q(n)?(x(e,n),e=P(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 n={date:Number(t[1]),month:U(t[2]),year:Number(t[3])};return!1===Q(n)?(e.epoch=null,e):(x(e,n),e=e.startOf("day"),e=P(e,t[4]))}}],[{reg:/^([0-9]{4})[\-\/]([0-9]{2})$/i,parse:(e,t)=>{let n={year:t[1],month:parseInt(t[2],10)-1,date:1};return!1===Q(n)?(e.epoch=null,e):(x(e,n),e=P(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{4})$/i,parse:(e,t)=>{let n={year:G(t[2],e._today),month:U(t[1]),date:e._today.date||1};return!1===Q(n)?(e.epoch=null,e):(x(e,n),e=P(e,t[4]))}},{reg:/^(q[0-9])( of)?( [0-9]{4})?/i,parse:(e,t)=>{let n=t[1]||"";e=e.quarter(n);let a=t[3]||"";return a&&(a=a.trim(),e=e.year(a)),e}},{reg:/^(spring|summer|winter|fall|autumn)( of)?( [0-9]{4})?/i,parse:(e,t)=>{let n=t[1]||"";e=e.season(n);let a=t[3]||"";return a&&(a=a.trim(),e=e.year(a)),e}},{reg:/^[0-9,]+ ?b\.?c\.?$/i,parse:(e,t)=>{let n=t[0]||"";n=n.replace(/^([0-9,]+) ?b\.?c\.?$/i,"-$1");let a=new Date,r={year:parseInt(n.trim(),10),month:a.getMonth(),date:a.getDate()};return!1===Q(r)?(e.epoch=null,e):(x(e,r),e=P(e))}},{reg:/^[0-9,]+ ?(a\.?d\.?|c\.?e\.?)$/i,parse:(e,t)=>{let n=t[0]||"";n=n.replace(/,/g,"");let a=new Date,r={year:parseInt(n.trim(),10),month:a.getMonth(),date:a.getDate()};return!1===Q(r)?(e.epoch=null,e):(x(e,r),e=P(e))}},{reg:/^[0-9]{4}( ?a\.?d\.?)?$/i,parse:(e,t)=>{let n=e._today;n.month&&!n.date&&(n.date=1);let a=new Date,r={year:G(t[0],n),month:n.month||a.getMonth(),date:n.date||a.getDate()};return!1===Q(r)?(e.epoch=null,e):(x(e,r),e=P(e))}}]);var W=function(e,t,n){for(let a=0;a<V.length;a++){let r=t.match(V[a].reg);if(r){let t=V[a].parse(e,r,n);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:J,parseObject:K,parseNumber:R}=D,X={year:(new Date).getFullYear(),month:0,date:1};var ee=(e,t)=>{let n=e._today||X;if("number"==typeof t)return R(e,t);if(e.epoch=Date.now(),e._today&&b(e._today)&&Object.keys(e._today).length>0){let t=K(e,n,X);t.isValid()&&(e.epoch=t.epoch)}return null==t||""===t?e:!0===g(t)?(e.epoch=t.getTime(),e):!0===function(e){return"[object Array]"===Object.prototype.toString.call(e)}(t)?e=J(e,t,n):!0===b(t)?t.epoch?(e.epoch=t.epoch,e.tz=t.tz,e):e=K(e,t,n):"string"!=typeof t?e:(t=N(t),!0===q.hasOwnProperty(t)?e=q[t](e):W(e,t))};let te=["sun","mon","tue","wed","thu","fri","sat"],ne=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function ae(){return te}function re(){return ne}const oe={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 ie=!0;var se=e=>{let t=e.timezone().current.offset;return t?$(t,":"):"Z"};const ue=e=>ie?function(e){return e?e[0].toUpperCase()+e.substr(1):""}(e):e,le={day:e=>ue(e.dayName()),"day-short":e=>ue(ae()[e.day()]),"day-number":e=>e.day(),"day-ordinal":e=>w(e.day()),"day-pad":e=>k(e.day()),date:e=>e.date(),"date-ordinal":e=>w(e.date()),"date-pad":e=>k(e.date()),month:e=>ue(e.monthName()),"month-short":e=>ue(B()[e.month()]),"month-number":e=>e.month(),"month-ordinal":e=>w(e.month()),"month-pad":e=>k(e.month()),"iso-month":e=>k(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?"'"+String(e.year()).substr(2,4):(t=Math.abs(t),t+" BC")},"iso-year":e=>{let t=e.year(),n=t<0,a=k(Math.abs(t),4);return n&&(a=k(a,6),a="-"+a),a},time:e=>e.time(),"time-24":e=>`${e.hour24()}:${k(e.minute())}`,hour:e=>e.hour12(),"hour-pad":e=>k(e.hour12()),"hour-24":e=>e.hour24(),"hour-24-pad":e=>k(e.hour24()),minute:e=>e.minute(),"minute-pad":e=>k(e.minute()),second:e=>e.second(),"second-pad":e=>k(e.second()),millisecond:e=>e.millisecond(),"millisecond-pad":e=>k(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=>se(e),numeric:e=>`${e.year()}/${k(e.month()+1)}/${k(e.date())}`,"numeric-us":e=>`${k(e.month()+1)}/${k(e.date())}/${e.year()}`,"numeric-uk":e=>`${k(e.date())}/${k(e.month()+1)}/${e.year()}`,"mm/dd":e=>`${k(e.month()+1)}/${k(e.date())}`,iso:e=>`${e.format("iso-year")}-${k(e.month()+1)}-${k(e.date())}T${k(e.h24())}:${k(e.minute())}:${k(e.second())}.${k(e.millisecond(),3)}${se(e)}`,"iso-short":e=>{let t=k(e.month()+1),n=k(e.date());var a;return`${(a=e.year())>=0?k(a,4):"-"+k(a=Math.abs(a),4)}-${t}-${n}`},"iso-utc":e=>new Date(e.epoch).toISOString(),nice:e=>`${B()[e.month()]} ${w(e.date())}, ${e.time()}`,"nice-24":e=>`${B()[e.month()]} ${w(e.date())}, ${e.hour24()}:${k(e.minute())}`,"nice-year":e=>`${B()[e.month()]} ${w(e.date())}, ${e.year()}`,"nice-day":e=>`${ae()[e.day()]} ${ue(B()[e.month()])} ${w(e.date())}`,"nice-full":e=>`${e.dayName()} ${ue(e.monthName())} ${w(e.date())}, ${e.time()}`,"nice-full-24":e=>`${e.dayName()} ${ue(e.monthName())} ${w(e.date())}, ${e.hour24()}:${k(e.minute())}`},ce={"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(ce).forEach(e=>le[e]=le[ce[e]]);var he=(e,t="")=>{if(!0!==e.isValid())return"";if(le.hasOwnProperty(t)){let n=le[t](e)||"";return"json"!==t&&(n=String(n),"ampm"!==t&&(n=ue(n))),n}if(-1!==t.indexOf("{")){let n=/\{(.+?)\}/g;return t=t.replace(n,(t,n)=>{if(n=n.toLowerCase().trim(),le.hasOwnProperty(n)){let t=String(le[n](e));return"ampm"!==n?ue(t):t}return""})}return e.format("iso-short")};const 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=>k(Number(String(e.year()).substr(2,4))),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=>k(e.month()+1),MMM:e=>e.format("month-short"),MMMM:e=>e.format("month"),w:e=>e.week(),ww:e=>k(e.week()),d:e=>e.date(),dd:e=>k(e.date()),D:e=>e.dayOfYear(),DD:e=>k(e.dayOfYear()),DDD:e=>k(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=>k(e.h12()),H:e=>e.hour(),HH:e=>k(e.hour()),m:e=>e.minute(),mm:e=>k(e.minute()),s:e=>e.second(),ss:e=>k(e.second()),SSS:e=>k(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=>$(e.timezone().current.offset),ZZ:e=>$(e.timezone().current.offset),ZZZ:e=>$(e.timezone().current.offset),ZZZZ:e=>$(e.timezone().current.offset,":")},de=(e,t,n)=>{let a=e,r=t;for(let o=0;o<n;o+=1)me[a]=me[r],a+=e,r+=t};de("q","Q",4),de("L","M",4),de("Y","y",4),de("c","e",4),de("k","H",2),de("K","h",2),de("S","s",2),de("v","z",4),de("V","Z",4);var fe=(e,t)=>{let n=t.split("");return n=function(e){for(let t=0;t<e.length;t+=1)if("'"===e[t])for(let n=t+1;n<e.length;n+=1){if(e[n]&&(e[t]+=e[n]),"'"===e[n]){e[n]=null;break}e[n]=null}return e.filter(e=>e)}(n),n=function(e){for(let t=0;t<e.length;t+=1){let n=e[t];for(let a=t+1;a<e.length&&e[a]===n;a+=1)e[t]+=e[a],e[a]=null}return(e=e.filter(e=>e)).map(e=>("''"===e&&(e="'"),e))}(n),n.reduce((t,n)=>(void 0!==me[n]?t+=me[n](e)||"":(/^'.{1,}'$/.test(n)&&(n=n.replace(/'/g,"")),t+=n),t),"")};const pe=["year","season","quarter","month","week","day","quarterHour","hour","minute"],ye=function(e,t){let n=e.clone().startOf(t),a=e.clone().endOf(t).epoch-n.epoch,r=(e.epoch-n.epoch)/a;return parseFloat(r.toFixed(2))};var ge=(e,t)=>{if(t)return t=_(t),ye(e,t);let n={};return pe.forEach(t=>{n[t]=ye(e,t)}),n};var be=(e,t)=>{let n=e.progress();return"quarterhour"===(t=_(t))&&(t="quarterHour"),void 0!==n[t]?(n[t]>.5&&(e=e.add(1,t)),e=e.startOf(t)):!1===e.silent&&console.warn("no known unit '"+t+"'"),e};const ke=(e,t,n)=>{let a=0;for(e=e.clone();e.isBefore(t);)e=e.add(1,n),a+=1;return e.isAfter(t,n)&&(a-=1),a};var we=(e,t,n)=>e.isBefore(t)?ke(e,t,n):-1*ke(t,e,n);var ve=function(e,t){let n=t.epoch-e.epoch,a={milliseconds:n,seconds:parseInt(n/1e3,10)};a.minutes=parseInt(a.seconds/60,10),a.hours=parseInt(a.minutes/60,10);let r=e.clone();return a.years=((e,t)=>{let n=t.year()-e.year();return(e=e.year(t.year())).isAfter(t)&&(n-=1),n})(r,t),r=e.add(a.years,"year"),a.months=12*a.years,r=e.add(a.months,"month"),a.months+=we(r,t,"month"),a.weeks=52*a.years,r=e.add(a.weeks,"week"),a.weeks+=we(r,t,"week"),a.days=7*a.weeks,r=e.add(a.days,"day"),a.days+=we(r,t,"day"),a};var _e=function(e,t,n){t=z(t,e);let a=!1;if(e.isAfter(t)){let n=e;e=t,t=n,a=!0}let r=ve(e,t);return a&&(r=function(e){return Object.keys(e).forEach(t=>{e[t]*=-1}),e}(r)),n?(n=_(n),!0!==/s$/.test(n)&&(n+="s"),"dates"===n&&(n="days"),r[n]):r};const je=e=>Math.abs(e)||0;var ze=function(e){let t="P";return t+=je(e.years)+"Y",t+=je(e.months)+"M",t+=je(e.days)+"DT",t+=je(e.hours)+"H",t+=je(e.minutes)+"M",t+=je(e.seconds)+"S",t};const $e={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 Oe(e,t){return 1===e&&(t=t.slice(0,-1)),e+" "+t}var De=function(e){let t=null,n=null,a=[],r=[];return Object.keys(e).forEach((o,i,s)=>{const u=Math.abs(e[o]);if(0===u)return;a.push(u+o[0]);const l=Oe(u,o);if(r.push(l),!t){if(t=n=l,i>4)return;const a=s[i+1],r=Math.abs(e[a]);r>$e[a].almost?(t=Oe(u+1,o),n="almost "+t):r>$e[a].over&&(n="over "+l)}}),{qualified:n,rounded:t,abbreviated:a,englishValues:r}};var Me=(e,t)=>{const n=function(e,t){const n=e.isBefore(t),a=n?t:e;let r=n?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(a,e))return;let t=r.diff(a,e);r=r.add(t,e),o[e]=t}),n&&Object.keys(o).forEach(e=>{0!==o[e]&&(o[e]*=-1)}),o}(e,t=z(t,e));if(!0===Object.keys(n).every(e=>!n[e]))return{diff:n,rounded:"now",qualified:"now",precise:"now",abbreviated:[],iso:"P0Y0M0DT0H0M0S",direction:"present"};let a,r="future",{rounded:o,qualified:i,englishValues:s,abbreviated:u}=De(n);a=s.splice(0,2).join(", "),!0===e.isAfter(t)?(o+=" ago",i+=" ago",a+=" ago",r="past"):(o="in "+o,i="in "+i,a="in "+a);let l=ze(n);return{diff:n,rounded:o,qualified:i,precise:a,abbreviated:u,iso:l,direction:r}};var Se={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]]},qe=[null,[0,1],[3,1],[6,1],[9,1]];const Ne={minute:e=>(x(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),x(e,{second:0,millisecond:0}),e},hour:e=>(x(e,{minute:0,second:0,millisecond:0}),e),day:e=>(x(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")),x(e,{hour:0,minute:0,second:0,millisecond:0}),e},month:e=>(x(e,{date:1,hour:0,minute:0,second:0,millisecond:0}),e),quarter:e=>{let t=e.quarter();return qe[t]&&x(e,{month:qe[t][0],date:qe[t][1],hour:0,minute:0,second:0,millisecond:0}),e},season:e=>{let t=e.season(),n="north";"South"===e.hemisphere()&&(n="south");for(let a=0;a<Se[n].length;a++)if(Se[n][a][0]===t){let r=e.year();return"winter"===t&&e.month()<3&&(r-=1),x(e,{year:r,month:Se[n][a][1],date:Se[n][a][2],hour:0,minute:0,second:0,millisecond:0}),e}return e},year:e=>(x(e,{month:0,date:1,hour:0,minute:0,second:0,millisecond:0}),e),decade:e=>{let t=(e=e.startOf("year")).year(),n=10*parseInt(t/10,10);return e=e.year(n)},century:e=>{let t=(e=e.startOf("year")).year(),n=100*parseInt(t/100,10);return e=e.year(n)}};Ne.date=Ne.day;var Ie=function(e,t,n){if(!t||!n)return[];if(t=_(t),n=e.clone().set(n),e.isAfter(n)){let t=e;e=n,n=t}let a=e.clone();if(function(e){return!!ae().find(t=>t===e)||!!re().find(t=>t===e)}(t))a=a.next(t),t="week";else{a.startOf(t).isBefore(e)&&(a=a.next(t))}let r=[];for(;a.isBefore(n);)r.push(a),a=a.add(1,t);return r};var Te=e=>{let n=e.timezones,a=e.tz;if(!1===n.hasOwnProperty(a)&&(a=p(e.tz,n)),null===a)return!1===e.silent&&console.warn("Warn: could not find given or local timezone - '"+e.tz+"'"),{current:{epochShift:0}};let r=n[a],o={name:(i=a,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 Ee=["century","decade","year","month","date","day","hour","minute","second","millisecond"],Ce={set:function(e,t){let n=this.clone();return n=ee(n,e,null),t&&(this.tz=p(t)),n},timezone:function(){return Te(this)},isDST:function(){return Te(this).current.isDST},hasDST:function(){return Te(this).hasDst},offset:function(){return 60*Te(this).current.offset},hemisphere:function(){return Te(this).hemisphere},format:function(e){return he(this,e)},unixFmt:function(e){return fe(this,e)},startOf:function(e){return((e,t)=>{let n=e.clone();return t=_(t),Ne[t]?Ne[t](n):"summer"===t||"winter"===t?(n=n.season(t),Ne.season(n)):n})(this,e)},endOf:function(e){return((e,t)=>{let n=e.clone();return t=_(t),Ne[t]?(n=Ne[t](n),n=n.add(1,t),n=n.subtract(1,"millisecond"),n):n})(this,e)},leapYear:function(){return y(this.year())},progress:function(e){return ge(this,e)},nearest:function(e){return be(this,e)},diff:function(e,t){return _e(this,e,t)},since:function(e){return e||(e=this.clone().set()),Me(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=p(e,t.timezones),t},every:function(e,t){if("object"==typeof e&&"string"==typeof t){let n=t;t=e,e=n}return Ie(this,e,t)},isAwake:function(){let e=this.hour();return!(e<8||e>22)},isAsleep:function(){return!this.isAwake()},daysInMonth:function(){switch(this.month()){case 0:return 31;case 1:return this.leapYear()?29:28;case 2:return 31;case 3:return 30;case 4:return 31;case 5:return 30;case 6:case 7:return 31;case 8:return 30;case 9:return 31;case 10:return 30;case 11:return 31;default:throw new Error("Invalid Month state.")}},log:function(){return console.log(""),console.log(he(this,"nice-short")),this},logYear:function(){return console.log(""),console.log(he(this,"full-short")),this},json:function(){return Ee.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=ae().indexOf(e);-1===t&&(t=re().indexOf(e)),-1===t&&(t=1),this._weekStart=t}else console.warn("Spacetime Error: Cannot understand .weekStart() input:",e);return this}};Ce.inDST=Ce.isDST,Ce.round=Ce.nearest,Ce.each=Ce.every;var xe=Ce;const Ye=e=>("string"==typeof e&&(e=parseInt(e,10)),e),Ae=["year","month","date","hour","minute","second","millisecond"],Fe=(e,t,n)=>{let a=Ae.indexOf(n),r=Ae.slice(a,Ae.length);for(let n=0;n<r.length;n++){let a=t[r[n]]();e[r[n]](a)}return e},Be=function(e,t,n,a){return!0===n&&e.isBefore(t)?e=e.add(1,a):!1===n&&e.isAfter(t)&&(e=e.minus(1,a)),e},He=function(e,t,n){t=Ye(t);let a=e.clone(),r=(e.minute()-t)*T.minute;return e.epoch-=r,Fe(e,a,"second"),(e=Be(e,a,n,"hour")).epoch},Le=function(e,t,n){(t=Ye(t))>=24?t=24:t<0&&(t=0);let a=e.clone(),r=e.hour()-t,o=r*T.hour;return e.epoch-=o,e.date()!==a.date()&&(e=a.clone(),r>1&&(r-=1),r<1&&(r+=1),o=r*T.hour,e.epoch-=o),x(e,{hour:t}),Fe(e,a,"minute"),(e=Be(e,a,n,"day")).epoch},Pe=function(e,t){return"string"==typeof t&&/^'[0-9]{2}$/.test(t)&&(t=t.replace(/'/,"").trim(),t=(t=Number(t))>30?1900+t:2e3+t),t=Ye(t),x(e,{year:t}),e.epoch};let Ze="am",Qe="pm";var Ge={millisecond:function(e){if(void 0!==e){let t=this.clone();return t.epoch=function(e,t){t=Ye(t);let n=e.millisecond()-t;return e.epoch-n}(t,e),t}return this.d.getMilliseconds()},second:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){t=Ye(t);let a=e.clone(),r=(e.second()-t)*T.second;return e.epoch=e.epoch-r,(e=Be(e,a,n,"minute")).epoch}(n,e,t),n}return this.d.getSeconds()},minute:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=He(n,e,t),n}return this.d.getMinutes()},hour:function(e,t){let n=this.d;if(void 0!==e){let n=this.clone();return n.epoch=Le(n,e,t),n}return n.getHours()},hourFloat:function(e,t){if(void 0!==e){let n=this.clone(),a=e%1;a*=60;let r=parseInt(e,10);return n.epoch=Le(n,r,t),n.epoch=He(n,a,t),n}let n=this.d,a=n.getHours(),r=n.getMinutes();return r/=60,a+r},hour12:function(e,t){let n=this.d;if(void 0!==e){let n=this.clone(),a=(e=""+e).match(/^([0-9]+)(am|pm)$/);if(a){let e=parseInt(a[1],10);"pm"===a[2]&&(e+=12),n.epoch=Le(n,e,t)}return n}let a=n.getHours();return a>12&&(a-=12),0===a&&(a=12),a},time:function(e,t){if(void 0!==e){let n=this.clone();return e=e.toLowerCase().trim(),n.epoch=function(e,t,n){let a=t.match(/([0-9]{1,2})[:h]([0-9]{1,2})(:[0-9]{1,2})? ?(am|pm)?/);if(!a){if(a=t.match(/([0-9]{1,2}) ?(am|pm)/),!a)return e.epoch;a.splice(2,0,"0"),a.splice(3,0,"")}let r=!1,o=parseInt(a[1],10),i=parseInt(a[2],10);i>=60&&(i=59),o>12&&(r=!0),!1===r&&("am"===a[4]&&12===o&&(o=0),"pm"===a[4]&&o<12&&(o+=12)),a[3]=a[3]||"",a[3]=a[3].replace(/:/,"");let s=parseInt(a[3],10)||0,u=e.clone();return e=(e=(e=(e=e.hour(o)).minute(i)).second(s)).millisecond(0),(e=Be(e,u,n,"day")).epoch}(n,e,t),n}return`${this.h12()}:${k(this.minute())}${this.ampm()}`},ampm:function(e,t){let n=Ze,a=this.hour();if(a>=12&&(n=Qe),"string"!=typeof e)return n;let r=this.clone();return e=e.toLowerCase().trim(),a>=12&&"am"===e?(a-=12,r.hour(a,t)):a<12&&"pm"===e?(a+=12,r.hour(a,t)):r},dayTime:function(e,t){if(void 0!==e){const 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"};let a=this.clone();return e=(e=e||"").toLowerCase(),!0===n.hasOwnProperty(e)&&(a=a.time(n[e],t)),a}let n=this.hour();return n<6?"night":n<12?"morning":n<17?"afternoon":n<22?"evening":"night"},iso:function(e){return void 0!==e?this.set(e):this.format("iso")}};var Ue={date:function(e,t){if(void 0!==e){let n=this.clone();return(e=parseInt(e,10))&&(n.epoch=function(e,t,n){if((t=Ye(t))>28){let n=e.month(),a=Y[n];1===n&&29===t&&y(e.year())&&(a=29),t>a&&(t=a)}t<=0&&(t=1);let a=e.clone();return x(e,{date:t}),(e=Be(e,a,n,"month")).epoch}(n,e,t)),n}return this.d.getDate()},day:function(e,t){if(void 0===e)return this.d.getDay();let n=this.clone(),a=e;"string"==typeof e&&(e=e.toLowerCase(),oe.hasOwnProperty(e)?a=oe[e]:(a=ae().indexOf(e),-1===a&&(a=re().indexOf(e))));let r=this.d.getDay()-a;!0===t&&r>0&&(r-=7),!1===t&&r<0&&(r+=7);let o=this.subtract(r,"days");return x(o,{hour:n.hour(),minute:n.minute(),second:n.second()}),o},dayName:function(e,t){if(void 0===e)return re()[this.day()];let n=this.clone();return n=n.day(e,t),n}};const Ve=e=>e=(e=(e=e.minute(0)).second(0)).millisecond(1);var We={dayOfYear:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){t=Ye(t);let a=e.clone();return(t-=1)<=0?t=0:t>=365&&(t=364),e=(e=e.startOf("year")).add(t,"day"),Fe(e,a,"hour"),(e=Be(e,a,n,"year")).epoch}(n,e,t),n}let n,a=0,r=this.d.getMonth();for(let e=1;e<=r;e++)n=new Date,n.setDate(1),n.setFullYear(this.d.getFullYear()),n.setHours(1),n.setMinutes(1),n.setMonth(e),n.setHours(-2),a+=n.getDate();return a+this.d.getDate()},week:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){let a=e.clone();return t=Ye(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=Be(e,a,n,"year")).epoch}(this,e,t),n=Ve(n),n}let n=this.clone();n=n.month(0),n=n.date(1),n=Ve(n),n=n.day("monday"),"december"===n.monthName()&&n.date()>=28&&(n=n.add(1,"week"));let a=1;1===n.date()&&(a=0),n=n.minus(1,"second");const r=this.epoch;if(n.epoch>r)return 1;let o=0,i=4*this.month();for(n.epoch+=T.week*i,o+=i;o<=52;o++){if(n.epoch>r)return o+a;n=n.add(1,"week")}return 52},month:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){"string"==typeof t&&(t=H()[t.toLowerCase()]),(t=Ye(t))>=12&&(t=11),t<=0&&(t=0);let a=e.date();a>Y[t]&&(a=Y[t]);let r=e.clone();return x(e,{month:t,d:a}),(e=Be(e,r,n,"year")).epoch}(n,e,t),n}return this.d.getMonth()},monthName:function(e,t){if(void 0!==e){let n=this.clone();return n=n.month(e,t),n}return F[this.month()]},quarter:function(e,t){if(void 0!==e&&("string"==typeof e&&(e=e.replace(/^q/i,""),e=parseInt(e,10)),qe[e])){let n=this.clone(),a=qe[e][0];return n=n.month(a,t),n=n.date(1,t),n=n.startOf("day"),n}let n=this.d.getMonth();for(let e=1;e<qe.length;e++)if(n<qe[e][0])return e-1;return 4},season:function(e,t){let n="north";if("South"===this.hemisphere()&&(n="south"),void 0!==e){let a=this.clone();for(let r=0;r<Se[n].length;r++)e===Se[n][r][0]&&(a=a.month(Se[n][r][1],t),a=a.date(1),a=a.startOf("day"));return a}let a=this.d.getMonth();for(let e=0;e<Se[n].length-1;e++)if(a>=Se[n][e][1]&&a<Se[n][e+1][1])return Se[n][e][0];return"winter"},year:function(e){if(void 0!==e){let t=this.clone();return t.epoch=Pe(t,e),t}return this.d.getFullYear()},era:function(e){if(void 0!==e){let t=this.clone();e=e.toLowerCase();let n=t.d.getFullYear();return"bc"===e&&n>0&&(t.epoch=Pe(t,-1*n)),"ad"===e&&n<0&&(t.epoch=Pe(t,-1*n)),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,n)=>(n.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 Je=Object.assign({},Ge,Ue,We);Je.milliseconds=Je.millisecond,Je.seconds=Je.second,Je.minutes=Je.minute,Je.hours=Je.hour,Je.hour24=Je.hour,Je.h12=Je.hour12,Je.h24=Je.hour24,Je.days=Je.day;var Ke=e=>{Object.keys(Je).forEach(t=>{e.prototype[t]=Je[t]})};const Re=function(e,t){return 1===e&&y(t)?29:Y[e]},Xe=(e,t)=>{if(e.month>0){let n=parseInt(e.month/12,10);e.year=t.year()+n,e.month=e.month%12}else if(e.month<0){let n=Math.abs(e.month),a=parseInt(n/12,10);n%12!=0&&(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},et=(e,t,n)=>{let a=t.year(),r=t.month(),o=Re(r,a);for(;n>o;)n-=o,r+=1,r>=12&&(r-=12,a+=1),o=Re(r,a);return e.month=r,e.date=n,e},tt=(e,t,n)=>{e.year=t.year(),e.month=t.month();let a=t.date();for(e.date=a-Math.abs(n);e.date<1;){e.month-=1,e.month<0&&(e.month=11,e.year-=1);let t=Re(e.month,e.year);e.date+=t}return e},nt=["millisecond","second","minute","hour","date","month"];let at={second:nt.slice(0,1),minute:nt.slice(0,2),quarterhour:nt.slice(0,2),hour:nt.slice(0,3),date:nt.slice(0,4),month:nt.slice(0,4),quarter:nt.slice(0,4),season:nt.slice(0,4),year:nt,decade:nt,century:nt};at.week=at.hour,at.season=at.date,at.quarter=at.date;const rt={year:!0,quarter:!0,season:!0,month:!0,week:!0,date:!0},ot={month:!0,quarter:!0,season:!0,year:!0};var it=e=>{e.prototype.add=function(e,t){let n=this.clone();if(!t||0===e)return n;let a=this.clone();if("millisecond"===(t=_(t)))return n.epoch+=e,n;"fortnight"===t&&(e*=2,t="week"),T[t]?n.epoch+=T[t]*e:"week"===t||"weekend"===t?n.epoch+=T.day*(7*e):"quarter"===t||"season"===t?n.epoch+=T.month*(3*e):"quarterhour"===t&&(n.epoch+=15*T.minute*e);let r={};if(at[t]&&at[t].forEach(e=>{r[e]=a[e]()}),rt[t]){const e=a.timezone().current.offset-n.timezone().current.offset;n.epoch+=3600*e*1e3}if("month"===t&&(r.month=a.month()+e,r=Xe(r,a)),"week"===t){let t=a.date()+7*e;t<=28&&t>1&&(r.date=t)}if("weekend"===t&&"saturday"!==n.dayName())n=n.day("saturday",!0);else if("date"===t){if(e<0)r=tt(r,a,e);else{let t=a.date()+e;r=et(r,a,t)}0!==e&&a.isSame(n,"day")&&(r.date=a.date()+e)}else if("quarter"===t){if(r.month=a.month()+3*e,r.year=a.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=a.date()}else if("year"===t){let t=a.year()+e,r=n.year();if(r<t){let t=Math.floor(e/4)||1;n.epoch+=Math.abs(T.day*t)}else if(r>t){let t=Math.floor(e/4)||1;n.epoch+=T.day*t}}else"decade"===t?r.year=n.year()+10:"century"===t&&(r.year=n.year()+100);if(ot[t]){let e=Y[r.month];r.date=a.date(),r.date>e&&(r.date=e)}return Object.keys(r).length>1&&x(n,r),n},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 st={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()};st.date=st.day;var ut=e=>{e.prototype.isSame=function(t,n,a=!0){let r=this;if(!n)return null;if("string"==typeof t&&"object"==typeof n){let e=t;t=n,n=e}return"string"!=typeof t&&"number"!=typeof t||(t=new e(t,this.timezone.name)),n=n.replace(/s$/,""),!0===a&&r.tz!==t.tz&&((t=t.clone()).tz=r.tz),st[n]?st[n](r)===st[n](t):null}};var lt=e=>{const t={isAfter:function(e){let t=j(e=z(e,this));return null===t?null:this.epoch>t},isBefore:function(e){let t=j(e=z(e,this));return null===t?null:this.epoch<t},isEqual:function(e){let t=j(e=z(e,this));return null===t?null:this.epoch===t},isBetween:function(e,t,n=!1){e=z(e,this),t=z(t,this);let a=j(e);if(null===a)return null;let r=j(t);return null===r?null:n?this.isBetween(e,t)||this.isEqual(e)||this.isEqual(t):a<this.epoch&&this.epoch<r}};Object.keys(t).forEach(n=>{e.prototype[n]=t[n]})};var ct=e=>{const t={i18n:e=>{var t,n,a;b(e.days)&&(t=e.days,te=t.short||te,ne=t.long||ne),b(e.months)&&function(e){A=e.short||A,F=e.long||F}(e.months),a=e.useTitleCase,"[object Boolean]"===Object.prototype.toString.call(a)&&(n=e.useTitleCase,ie=n),b(e.ampm)&&function(e){Ze=e.am||Ze,Qe=e.pm||Qe}(e.ampm)}};Object.keys(t).forEach(n=>{e.prototype[n]=t[n]})};let ht=i;const mt=function(e,t,a={}){this.epoch=null,this.tz=p(t,ht),this.silent=void 0===a.silent||a.silent,this.british=a.dmy||a.british,this._weekStart=1,void 0!==a.weekStart&&(this._weekStart=a.weekStart),this._today={},void 0!==a.today&&(this._today=a.today),Object.defineProperty(this,"d",{get:function(){let e=n(this),t=(new Date(this.epoch).getTimezoneOffset()||0)+60*e;t=60*t*1e3;let a=this.epoch+t;return new Date(a)}}),Object.defineProperty(this,"timezones",{get:()=>ht,set:e=>(ht=e,e)});let r=ee(this,e);this.epoch=r.epoch};Object.keys(xe).forEach(e=>{mt.prototype[e]=xe[e]}),mt.prototype.clone=function(){return new mt(this.epoch,this.tz,{silent:this.silent,weekStart:this._weekStart,today:this._today,parsers:this.parsers})},mt.prototype.toLocalDate=function(){return this.toNativeDate()},mt.prototype.toNativeDate=function(){return new Date(this.epoch)},Ke(mt),it(mt),ut(mt),lt(mt),ct(mt);var dt=mt;var ft=(e,t)=>{let n=new dt(null),a=new dt(null);n=n.time(e),a=t?a.time(t):n.add(59,"minutes");let r=n.hour(),o=a.hour();return Object.keys(n.timezones).filter(e=>{if(-1===e.indexOf("/"))return!1;let t=new dt(null,e),i=t.hour();return i>=r&&i<=o&&(!(i===r&&t.minute()<n.minute())&&!(i===o&&t.minute()>a.minute()))})};const pt=(e,t,n)=>new dt(e,t,n),yt=function(e){let t=e._today||{};return Object.keys(t).forEach(n=>{e=e[n](t[n])}),e};return pt.now=(e,t)=>{let n=new dt((new Date).getTime(),e,t);return n=yt(n),n},pt.today=(e,t)=>{let n=new dt((new Date).getTime(),e,t);return n=yt(n),n.startOf("day")},pt.tomorrow=(e,t)=>{let n=new dt((new Date).getTime(),e,t);return n=yt(n),n.add(1,"day").startOf("day")},pt.yesterday=(e,t)=>{let n=new dt((new Date).getTime(),e,t);return n=yt(n),n.subtract(1,"day").startOf("day")},pt.extend=function(e={}){return Object.keys(e).forEach(t=>{dt.prototype[t]=e[t]}),this},pt.timezones=function(){return(new dt).timezones},pt.max=function(e,t){let n=new dt(null,e,t);return n.epoch=864e13,n},pt.min=function(e,t){let n=new dt(null,e,t);return n.epoch=-864e13,n},pt.whereIts=ft,pt.version="7.1.2",pt.plugin=pt.extend,pt}));

@@ -7,5 +7,63 @@ This project follows semVer, where:

<!-- ### [unreleased]
-->
### 7.1.2 [Feb 2022]
- **[fix]** - add more deprecated iana codes
### 7.1.1 [Feb 2022]
- **[new]** - support custom i18n strings for am/pm
- **[new]** - more alias support for deprecated iana codes
- **[fix]** - for silent/verbose mode
- update deps
### 7.1.0 [Jan 2022]
- **[change]** - rename cjs build to .cjs [#319](https://github.com/spencermountain/spacetime/issues/319)
### 7.0.2 [Jan 2022]
- **[fix]** - another esm build path #316
### 7.0.1 [Jan 2022]
- **[fix]** - esm build path
### 7.0.0 [Jan 2022]
- **[change]** - update to 2022 DST dates
- **[change]** - return 'Sep' instead of 'Sept' in format('month-short') and 'MMM' #304
- **[change]** - convert to ES-modules, + exports fields
- **[change]** - make .every() results inclusive of start
- **[change]** - alias old IANA codes to contemporary ones
- **[change]** - move cal plugin to repo spencermountain/scal
- **[new]** - add ISO duration to .since() results (thanks Adam)
- **[fix]** - iso-parsing issues #320
- **[fix]** - typescript issue #305
- **[fix]** - subtract months issue #312
- **[fix]** - unix 'yy' format issue #302
- **[change]** - return 'Etc/GMT' not 'Etc/GMT+0'
- **[change]** - update deps
- bump + republish plugins
### v6.16.4 [Nov 2021]
- **[fix]** - ISO fmt parsing #310
- **[update]** - gaza, hebron dst date change
- update deps
### v6.16.3 [Aug 2021]
- **[new]** - .daysInMonth() method (thanks m1212e!)
- **[change]** - replace deprecated timezone aliases (thanks Michael!)
- **[change]** - date/day naming inconsistency in add method (thanks Andy!)
- **[fix]** - typescript fixes (thanks Adam!)
- **[fix]** - many-year add issue #235
- **[fix]** - iso format year-padding for BC years
- update deps
### v6.16.2 [June 2021]
- **[fix]** - offset for `asia/baku` #292
- **[fix]** - date-parser for #291
- update deps
### v6.16.1 [May 2021]
- **[new]** - add millisecond pad #283
- update deps
### v6.16.0 [April 2021]

@@ -12,0 +70,0 @@

{
"name": "spacetime",
"version": "6.16.0",
"version": "7.1.2",
"description": "figure-out dates across timezones",
"main": "builds/spacetime.js",
"main": "src/index.js",
"unpkg": "builds/spacetime.min.js",
"module": "builds/spacetime.mjs",
"types": "types/index.d.ts",
"type": "module",
"sideEffects": false,
"exports": {
".": {
"require": "./builds/spacetime.cjs",
"import": "./src/index.js"
}
},
"scripts": {
"build": "npm run version && rollup -c --silent",
"build": "npm run pack && npm run version && rollup -c --silent",
"build:tz": "node ./scripts/updateZonefile.js",

@@ -24,7 +30,2 @@ "pack": "node ./zonefile/pack.js",

},
"browserslist": [
"defaults",
"not IE 11",
"maintained node versions"
],
"repository": {

@@ -35,5 +36,7 @@ "type": "git",

"files": [
"src",
"builds",
"api",
"types"
"types",
"zonefile"
],

@@ -48,8 +51,5 @@ "prettier": {

"devDependencies": {
"@babel/core": "7.13.15",
"@babel/preset-env": "7.13.15",
"codecov": "3.8.1",
"codecov": "3.8.3",
"nyc": "^15.1.0",
"rollup": "2.45.2",
"rollup-plugin-babel": "4.4.0",
"rollup": "2.68.0",
"rollup-plugin-commonjs": "10.1.0",

@@ -60,8 +60,8 @@ "rollup-plugin-filesize-check": "0.0.1",

"rollup-plugin-terser": "7.0.2",
"shelljs": "0.8.4",
"tap-dancer": "0.3.1",
"tape": "5.2.2",
"shelljs": "0.8.5",
"tap-dancer": "0.3.4",
"tape": "5.5.2",
"timekeeper": "2.2.0"
},
"license": "Apache-2.0"
}
}

@@ -158,3 +158,3 @@ <div align="center">

<div align="center">
<a href="https://github.com/spencermountain/somehow-calendar">somehow-calendar</a>
<a href="https://github.com/spencermountain/scal">spacetime-calendar</a>
• <a href="https://github.com/spencermountain/spacetime/tree/master/plugins/week-of-month">week-of-month</a>

@@ -194,2 +194,6 @@ • <a href="https://github.com/spencermountain/spacetime/tree/master/plugins/week-start">week-start</a>

s = spacetime.max() // the furthest-possible future date (27k years from now)
// To get the native Date object back
// NOTE: this returns the date in the local browsers timezone
jsDate = spacetimeDate.toNativeDate()
```

@@ -531,2 +535,6 @@

},
ampm: {
am: ' a. m.',
pm: ' a. m.'
},
useTitleCase: true // automatically in .format()

@@ -533,0 +541,0 @@ });

@@ -43,2 +43,3 @@ export type TimeUnit =

| 'second-pad'
| 'millisecond'
| 'ampm'

@@ -45,0 +46,0 @@ | 'quarter'

@@ -6,3 +6,3 @@ import { TimeUnit, Format } from './constraints'

/**
* @deprecated use toLocalDate. This is an implementation detail that was not intended for external use
* @deprecated use toNativeDate. This is an implementation detail that was not intended for external use
* @returns the date as a native date object

@@ -30,5 +30,11 @@ */

/** @returns the native Date object at the same epoch */
/**
* @deprecated use toNativeDate()
* @returns the native Date object at the same epoch
*/
toLocalDate(): Date
/** @returns the native Date object at the same epoch */
toNativeDate(): Date
/** @returns a bunch of meta-data about your current timezone */

@@ -38,3 +44,3 @@ timezone: () => TimezoneMeta

/** output nicely-formatted strings */
format: (format: Format) => string | object
format: (format: Format) => string

@@ -66,3 +72,3 @@ /** output formatted string using unix formatting code (yyyy.MM.dd h:mm a) */

/** list all dates up to a certain time */
every: (unit: Spacetime | string| TimeUnit, end: Spacetime | string| TimeUnit) => Spacetime[]
every: (unit: Spacetime | string | TimeUnit, end: Spacetime | string | TimeUnit) => Spacetime[]

@@ -88,3 +94,7 @@ /** list all dates up to a certain time */

/** detect if two date/times are the same day, week, or year, etc */
isSame: (date: Spacetime | Date | TimeUnit, unit: Spacetime | Date | TimeUnit, tzSensitive?: boolean) => boolean
isSame: (
date: Spacetime | Date | TimeUnit,
unit: Spacetime | Date | TimeUnit,
tzSensitive?: boolean
) => boolean

@@ -241,2 +251,5 @@ /** given a date and a unit, count how many of them you'd need to make the dates equal */

weekStart(value: number | string): Spacetime
/** returns the amount of days the current month has (December => 31, June => 30, ...) */
daysInMonth: () => number
}

@@ -287,6 +300,9 @@

export interface Since {
diff: Diff
rounded: string
qualified: string
precise: string
diff: Diff
abbreviated: string[]
iso: string
direction: 'past' | 'present' | 'future'
}

@@ -303,2 +319,2 @@

export type ParsableDate = Date | number | Array<number> | string
export type ParsableDate = Spacetime | Date | number | Array<number> | string

@@ -42,7 +42,6 @@ {

"dependencies": {
"spacetime": "6.16.0",
"spacetime-holiday": "0.1.0"
"spacetime": "7.1.2",
"spacetime-holiday": "0.2.2"
},
"devDependencies": {},
"license": "MIT"
}
}

@@ -10,3 +10,3 @@ import { terser } from 'rollup-plugin-terser'

output: [{ file: 'builds/compromise-dates.cjs', format: 'umd', name: 'compromiseDates' }],
plugins: [sizeCheck({ expect: 45, warn: 15 })],
plugins: [sizeCheck({ expect: 113, warn: 15 })],
},

@@ -16,3 +16,3 @@ {

output: [{ file: 'builds/compromise-dates.min.js', format: 'umd', name: 'compromiseDates' }],
plugins: [terser(opts), sizeCheck({ expect: 45, warn: 15 })],
plugins: [terser(opts), sizeCheck({ expect: 61, warn: 15 })],
},

@@ -22,4 +22,4 @@ {

output: [{ file: 'builds/compromise-dates.mjs', format: 'esm' }],
plugins: [terser(opts), sizeCheck({ expect: 45, warn: 15 })],
plugins: [terser(opts), sizeCheck({ expect: 61, warn: 15 })],
}
]

@@ -0,1 +1,2 @@

/* eslint-disable no-console, no-unused-vars */
import nlp from '../../src/three.js'

@@ -42,3 +43,8 @@ import spacetime from 'spacetime'

txt = '130pm' //! <- expand issue
txt = 'by september 5th'
txt = '1 year 9 months from now '
// txt = 'on april fools 2020 '
// console.log(nlp.model().one.lexicon['april fools'])
// txt = 'four thirty'

@@ -59,3 +65,3 @@ // txt = 'on april 22nd'

// doc.match('#Value (year|month|week|day) and a half').debug()
let m = doc.dates(context)
let m = doc.durations(context)
console.log(m.get())

@@ -0,1 +1,2 @@

/* eslint-disable no-console*/
import corpus from 'nlp-corpus'

@@ -2,0 +3,0 @@ import nlp from '../../../src/three.js'

import parse from './parse.js'
const methods = {
/** easy getter for the time */
get: function (options) {
let arr = []
this.forEach((doc) => {
let res = parse(doc)
arr.push(res)
})
if (typeof options === 'number') {
return arr[options]
}
return arr
},
/** overload the original json with duration information */
json(opts = {}) {
return this.map(m => {
let json = m.toView().json(opts)[0] || {}
if (opts && opts.times !== true) {
json.duration = parse(m)
}
return json
}, [])
}
/** change to a standard duration format */
// normalize: function () {
// this.forEach((doc) => {
// let duration = parse(doc)
// let list = []
// Object.keys(duration).forEach((unit) => {
// let num = duration[unit]
// let word = unit
// if (num !== 1) {
// word += 's'
// }
// list.push(`${num} ${word}`)
// })
// // splice-in an 'and'
// if (list.length > 1) {
// let beforeEnd = list.length - 1
// list.splice(beforeEnd, 0, 'and')
// }
// let text = list.join(' ')
// doc.replaceWith(text)
// })
// return this
// },
}

@@ -58,5 +11,25 @@ const addDurations = function (View) {

}
/** overload the original json with duration information */
json(opts = {}) {
return this.map(m => {
let json = m.toView().json(opts)[0] || {}
if (opts && opts.times !== true) {
json.duration = parse(m)
}
return json
}, [])
}
/** easy getter for the time */
get(options) {
let arr = []
this.forEach((doc) => {
let res = parse(doc)
arr.push(res)
})
if (typeof options === 'number') {
return arr[options]
}
return arr
}
}
//add-in methods
Object.assign(Durations.prototype, methods)

@@ -63,0 +36,0 @@ /** phrases like '2 months' */

@@ -40,3 +40,5 @@ const known = {

let num = m.numbers().get()[0]
let unit = m.terms().last().nouns().toSingular().text('reduced')
let unit = m.terms().last().text('reduced')
unit = unit.replace(/ies$/, 'y')
unit = unit.replace(/s$/, '')
// turn 'mins' into 'minute'

@@ -43,0 +45,0 @@ if (mapping.hasOwnProperty(unit)) {

@@ -51,5 +51,4 @@ import split from './split.js'

dates = dates.notIf('^per #Duration')
// dates.debug()
return dates
}
export default findDate

@@ -18,5 +18,3 @@

if (!doc.numbers) {
console.warn(
`Warning: compromise-numbers plugin is not loaded.\n You should load this plugin \n - https://bit.ly/3t8RfFG`
)
console.warn(`Warning: compromise-numbers plugin is not loaded.\n You should load this plugin \n - https://bit.ly/3t8RfFG`) //eslint-disable-line
} else {

@@ -50,5 +48,4 @@ // doc.numbers().normalize()

doc.match('@hasDash').insertAfter('to').tag('Date')
// doc.debug()
return doc
}
export default normalize
const normalize = function (doc) {
if (!doc.numbers) {
console.warn(`\nCompromise warning: compromise/three must be used with compromise-dates plugin\n`)
console.warn(`\nCompromise warning: compromise/three must be used with compromise-dates plugin\n`) // eslint-disable-line
}

@@ -6,0 +6,0 @@

import informal from './_timezones.js'
const isOffset = /(\-?[0-9]+)h(rs)?/i
const isNumber = /(\-?[0-9]+)/
const utcOffset = /utc([\-+]?[0-9]+)/i
const gmtOffset = /gmt([\-+]?[0-9]+)/i
const isOffset = /(-?[0-9]+)h(rs)?/i
const isNumber = /(-?[0-9]+)/
const utcOffset = /utc([-+]?[0-9]+)/i
const gmtOffset = /gmt([-+]?[0-9]+)/i

@@ -8,0 +8,0 @@ const toIana = function (num) {

@@ -1,2 +0,2 @@

import spacetime from 'spacetime'
// import spacetime from 'spacetime'
import tokenize from './01-tokenize/index.js'

@@ -9,9 +9,9 @@ import parse from './02-parse/index.js'

if (env.DEBUG_DATE) {
console.log(`\n==== '${parts.doc.text()}' =====`)
console.log(`\n==== '${parts.doc.text()}' =====`) // eslint-disable-line
Object.keys(parts).forEach(k => {
if (k !== 'doc' && parts[k]) {
console.log(k, parts[k])
console.log(k, parts[k])// eslint-disable-line
}
})
parts.doc.debug()
parts.doc.debug()// allow
}

@@ -18,0 +18,0 @@ }

@@ -36,5 +36,5 @@ import spacetime from 'spacetime'

log() {
console.log('--')
console.log('--')//eslint-disable-line
this.d.log()
console.log('\n')
console.log('\n')//eslint-disable-line
return this

@@ -41,0 +41,0 @@ }

@@ -1,2 +0,2 @@

import normalize from './normalize.js'
// import normalize from './normalize.js'
import parseTime from './parse/one/01-tokenize/03-time.js'

@@ -3,0 +3,0 @@ import spacetime from 'spacetime'

@@ -9,9 +9,9 @@ const getDuration = function (range) {

const getRange = function (diff) {
if (diff.years) {
return 'decade'
}
// console.log(diff)
return null
}
// const getRange = function (diff) {
// if (diff.years) {
// return 'decade'
// }
// // console.log(diff)
// return null
// }

@@ -18,0 +18,0 @@ const toJSON = function (range) {

//ambiguous 'may' and 'march'
const preps = '(in|by|before|during|on|until|after|of|within|all)' //6
const thisNext = '(last|next|this|previous|current|upcoming|coming)' //2
// const preps = '(in|by|before|during|on|until|after|of|within|all)' //6
// const thisNext = '(last|next|this|previous|current|upcoming|coming)' //2
const sections = '(start|end|middle|starting|ending|midpoint|beginning)' //2
const seasons = '(spring|summer|winter|fall|autumn)'
// const seasons = '(spring|summer|winter|fall|autumn)'

@@ -7,0 +7,0 @@ //ensure a year is approximately typical for common years

@@ -1,2 +0,1 @@

const here = 'time-tagger'

@@ -3,0 +2,0 @@ // 3-4 can be a time-range, sometimes

@@ -14,3 +14,5 @@ const preps = '(in|by|before|during|on|until|after|of|within|all)' //6

// 2012-06
{ match: '/^[0-9]{4}-[0-9]{2}$/', tag: 'Date', reason: '2012-06' },
// { match: '/^[0-9]{4}-[0-9]{2}$/', tag: 'Date', reason: '2012-06' },
// 30mins
// { match: '/^[0-9]+(min|sec|hr|d)s?$/', tag: 'Duration', reason: '30min' },
// misc weekday words

@@ -29,3 +31,3 @@ { match: '(tue|thu)', tag: 'WeekDay', reason: 'misc-weekday' },

// march to april
{ match: '[(march|may)] to? #Date', tag: 'Date', group: 0, tag: 'Month', reason: 'march-to' },
{ match: '[(march|may)] to? #Date', group: 0, tag: 'Month', reason: 'march-to' },
// 'march'

@@ -136,5 +138,5 @@ { match: '^(march|may)$', tag: 'Month', reason: 'single-march' },

// until june
{ match: '(by|until|on|in|at|during|over|every|each|due) the? #Date', notIf: '#PhrasalVerb', tag: 'Date', reason: 'until june' },
{ match: '(by|until|on|in|at|during|over|every|each|due) the? #Date', ifNo: '#PhrasalVerb', tag: 'Date', reason: 'until june' },
// until last june
{ match: '(by|until|after|before|during|on|in|following|since) (next|this|last)? #Date', notIf: '#PhrasalVerb', tag: 'Date', reason: 'until last june' },
{ match: '(by|until|after|before|during|on|in|following|since) (next|this|last)? #Date', ifNo: '#PhrasalVerb', tag: 'Date', reason: 'until last june' },

@@ -154,6 +156,6 @@ //next september

{ match: '#Cardinal oclock', tag: 'Time', reason: '2 oclock' },
// 13h30
{ match: '/^[0-9]{2}h[0-9]{2}$/', tag: 'Time', reason: '13h30' },
// 03/02
{ match: '/^[0-9]{2}/[0-9]{2}/', tag: 'Date', unTag: 'Value', reason: '03/02' },
// // 13h30
// { match: '/^[0-9]{2}h[0-9]{2}$/', tag: 'Time', reason: '13h30' },
// // 03/02
// { match: '/^[0-9]{2}/[0-9]{2}/', tag: 'Date', unTag: 'Value', reason: '03/02' },
// 3 in the morning

@@ -166,5 +168,5 @@ { match: '#Value (in|at) the? (morning|evening|night|nighttime)', tag: 'Time', reason: '3 in the morning' },

// iso (2020-03-02T00:00:00.000Z)
{ match: '/^[0-9]{4}[:-][0-9]{2}[:-][0-9]{2}T[0-9]/', tag: 'Time', reason: 'iso-time-tag' },
// { match: '/^[0-9]{4}[:-][0-9]{2}[:-][0-9]{2}T[0-9]/', tag: 'Time', reason: 'iso-time-tag' },
// tuesday at 4
{ match: '#Date [at #Cardinal]', group: 0, notIf: '#Year', tag: 'Time', reason: ' tuesday at 4' },
{ match: '#Date [at #Cardinal]', group: 0, ifNo: '#Year', tag: 'Time', reason: ' tuesday at 4' },
// half an hour

@@ -186,19 +188,19 @@ { match: 'half an (hour|minute|second)', tag: 'Date', reason: 'half an hour' },

//'two days before'/ 'nine weeks frow now'
{ match: '(#Cardinal|a|an) #Duration (before|after|ago|from|hence|back)', tag: 'DateShift', reason: 'date-shift' },
{ match: '(#Cardinal|a|an) #Duration (before|after|ago|from|hence|back)', tag: 'DateShift', reason: 'nine weeks frow now' },
// in two weeks
{ match: 'in #Cardinal #Duration', tag: 'DateShift', reason: 'date-shift' },
{ match: 'in (a|an) #Duration', tag: 'DateShift', reason: 'date-shift' },
{ match: 'in #Cardinal #Duration', tag: 'DateShift', reason: 'in two weeks' },
{ match: 'in (a|an) #Duration', tag: 'DateShift', reason: 'in a week' },
// an hour from now
{ match: '[(a|an) #Duration from] #Date', group: 0, tag: 'DateShift', reason: 'date-shift' },
{ match: '[(a|an) #Duration from] #Date', group: 0, tag: 'DateShift', reason: 'an hour from now' },
// a month ago
{ match: '(a|an) #Duration ago', tag: 'DateShift', reason: 'date-shift' },
{ match: '(a|an) #Duration ago', tag: 'DateShift', reason: 'a month ago' },
// in half an hour
{ match: 'in half (a|an) #Duration', tag: 'DateShift', reason: 'date-shift' },
{ match: 'in half (a|an) #Duration', tag: 'DateShift', reason: 'in half an hour' },
// in a few weeks
{ match: 'in a (few|couple) of? #Duration', tag: 'DateShift', reason: 'date-shift' },
{ match: 'in a (few|couple) of? #Duration', tag: 'DateShift', reason: 'in a few weeks' },
//two weeks and three days before
{ match: '#Cardinal #Duration and? #DateShift', tag: 'DateShift', reason: 'date-shift' },
{ match: '#Cardinal #Duration and? #DateShift', tag: 'DateShift', reason: 'three days before' },
{ match: '#DateShift and #Cardinal #Duration', tag: 'DateShift', reason: 'date-shift' },
// 'day after tomorrow'
{ match: '[#Duration (after|before)] #Date', group: 0, tag: 'DateShift', reason: 'date-shift' },
{ match: '[#Duration (after|before)] #Date', group: 0, tag: 'DateShift', reason: 'day after tomorrow' },

@@ -205,0 +207,0 @@ // july 3rd and 4th

import api from './api/index.js'
import compute from './compute/index.js'
import tags from './tags.js'
import words from './words/index.js'
import tags from './model/tags.js'
import words from './model/words/index.js'
import regex from './model/regex.js'

@@ -11,3 +12,6 @@ export default {

api,
mutate: (world) => {
world.model.two.regexNormal = world.model.two.regexNormal.concat(regex)
},
hooks: ['dates']
}

@@ -14,2 +14,3 @@ // -- Copyright (c) 2016-present, Facebook, Inc.

// eslint-disable-next-line
const mk = function (y, m, d, h, sec, mil) {

@@ -16,0 +17,0 @@ if (isArray(y) && isArray(m)) {

@@ -30,3 +30,3 @@ import test from 'tape'

if (!found) {
console.log(a[0])
console.log(a[0])//eslint-disable-line
}

@@ -33,0 +33,0 @@ t.equal(found.unit, a[1], '[unit] ' + a[0])

@@ -11,2 +11,3 @@ // a bunch of tests copy+pasted from the chronic date parser,

// eslint-disable-next-line
const mk = function (y, m, d, h, sec, mil) {

@@ -13,0 +14,0 @@ let s = spacetime.now().year(y)

import test from 'tape'
import nlp from './_lib.js'
const relaxed = 14
// const relaxed = 14

@@ -5,0 +5,0 @@ let february = 1

import test from 'tape'
import nlp from './_lib.js'
const here = '[date/durations]'

@@ -47,3 +48,3 @@ test('durations vs dates', function (t) {

let arr = [
['20m', { minute: 20 }],
// ['20m', { minute: 20 }],
['20min', { minute: 20 }],

@@ -57,5 +58,5 @@ ['20mins', { minute: 20 }],

arr.forEach((a) => {
let doc = nlp(a[0]).tag('Duration')
let doc = nlp(a[0])//.tag('Duration')
let found = doc.durations().get()[0]
t.deepEqual(found, a[1], a[0])
t.deepEqual(found, a[1], here + a[0])
})

@@ -62,0 +63,0 @@ t.end()

@@ -131,23 +131,23 @@ import test from 'tape'

['on the 6th', [2016, march, 6]],
['6th yesterday', [2016, february, 9]],
['6 yesterday', [2016, february, 9]],
['today the 6th', [2016, march, 6]],
['today on the 6th', [2016, march, 6]],
['6th today', [2016, february, 10]],
['6 today', [2016, february, 10]],
['tomorrow the 6th', [2016, march, 6]],
['tomorrow on the 6th', [2016, march, 6]],
['6th tomorrow', [2016, february, 11]],
['6 tomorrow', [2016, february, 11]],
// ['6th yesterday', [2016, february, 9]],
// ['6 yesterday', [2016, february, 9]],
// ['today the 6th', [2016, march, 6]],
// ['today on the 6th', [2016, march, 6]],
// ['6th today', [2016, february, 10]],
// ['6 today', [2016, february, 10]],
// ['tomorrow the 6th', [2016, march, 6]],
// ['tomorrow on the 6th', [2016, march, 6]],
// ['6th tomorrow', [2016, february, 11]],
// ['6 tomorrow', [2016, february, 11]],
['friday the 6th', [2016, march, 6]],
['friday on the 6th', [2016, march, 6]],
['6th on friday', [2016, february, 12]],
['6th this friday', [2016, february, 12]],
['6 on friday', [2016, february, 12]],
['6 this friday', [2016, february, 12]],
// ['6th on friday', [2016, february, 12]],
// ['6th this friday', [2016, february, 12]],
// ['6 on friday', [2016, february, 12]],
// ['6 this friday', [2016, february, 12]],
// ['next week on the 6th', [2016, march, 6]],
['6th next week', [2016, february, 15]],
['6 next week', [2016, february, 15]],
['6 on next week', [2016, february, 15]],
['6 this next week', [2016, february, 15]],
// ['6th next week', [2016, february, 15]],
// ['6 next week', [2016, february, 15]],
// ['6 on next week', [2016, february, 15]],
// ['6 this next week', [2016, february, 15]],
],

@@ -154,0 +154,0 @@ },

@@ -14,10 +14,10 @@ import test from 'tape'

'see if april will come to the party',
'remind june that april is coming',
'call jan',
'ask sep to eat bacon',
// 'remind june that april is coming',
// 'call jan',
// 'ask sep to eat bacon',
'go shopping with april',
'assign all tasks to april',
// 'assign all tasks to april',
'buy eggs for april',
'buy eggs for may',
'buy eggs with may',
// 'buy eggs for may',
// 'buy eggs with may',
'shop with april',

@@ -24,0 +24,0 @@ 'go there with jan',

@@ -22,3 +22,3 @@ import test from 'tape'

test('today is always today', (t) => {
;[
let arr=[
'Europe/Paris',

@@ -36,3 +36,4 @@ 'Europe/London',

null,
].forEach((tz) => {
]
arr.forEach((tz) => {
let context = {

@@ -39,0 +40,0 @@ timezone: tz,

@@ -9,15 +9,15 @@ import { terser } from 'rollup-plugin-terser'

input: 'src/plugin.js',
output: [{ file: 'builds/compromise-speech.cjs', format: 'umd', name: 'compromiseSpeech' }],
plugins: [sizeCheck({ expect: 45, warn: 15 })],
output: [{ file: 'builds/compromise-stream.cjs', format: 'umd', name: 'compromiseStream' }],
plugins: [sizeCheck({ expect: 11, warn: 15 })],
},
{
input: 'src/plugin.js',
output: [{ file: 'builds/compromise-speech.min.js', format: 'umd', name: 'compromiseSpeech' }],
plugins: [terser(opts), sizeCheck({ expect: 45, warn: 15 })],
output: [{ file: 'builds/compromise-stream.min.js', format: 'umd', name: 'compromiseStream' }],
plugins: [terser(opts), sizeCheck({ expect: 4, warn: 15 })],
},
{
input: 'src/plugin.js',
output: [{ file: 'builds/compromise-speech.mjs', format: 'esm' }],
plugins: [terser(opts), sizeCheck({ expect: 45, warn: 15 })],
output: [{ file: 'builds/compromise-stream.mjs', format: 'esm' }],
plugins: [terser(opts), sizeCheck({ expect: 4, warn: 15 })],
}
]

@@ -0,1 +1,2 @@

/* eslint-disable no-console, no-unused-vars */
import nlp from '../../src/three.js'

@@ -14,2 +15,4 @@

console.log(nlp(txt).syllables())
let doc = nlp('calgary')
doc.compute('soundsLike')
console.log(JSON.stringify(doc.json()[0], null, 2))

@@ -17,3 +17,18 @@ const api = function (View) {

}
/** */
View.prototype.soundsLike = function () {
this.compute('soundsLike')
let all = []
this.docs.forEach(terms => {
let some = []
terms.forEach(term => {
some = some.concat(term.soundsLike)
})
if (some.length > 0) {
all.push(some)
}
})
return all
}
}
export default api

@@ -18,3 +18,3 @@ //individual manipulations of the text

s = s.replace(/cia/g, 'xia')
s = s.replace(/c(i|e|y)/g, 's$1')
s = s.replace(/c([iey])/g, 's$1')
return s.replace(/c/g, 'k')

@@ -27,3 +27,5 @@ },

dropG: (s) => {
s = s.replace(/gh(^$|[^aeiou])/g, 'h$1')
// Drop 'G' if followed by 'H' and 'H' is not at the end or before a vowel.
s = s.replace(/gh(^$|[^aeiou])/g, 'h$1')//eslint-disable-line
// Drop 'G' if followed by 'N' or 'NED' and is at the end.
return s.replace(/g(n|ned)$/g, '$1')

@@ -33,3 +35,3 @@ },

s = s.replace(/gh/g, 'f')
s = s.replace(/([^g]|^)(g)(i|e|y)/g, '$1j$3')
s = s.replace(/([^g]|^)(g)([iey])/g, '$1j$3')
s = s.replace(/gg/g, 'g')

@@ -36,0 +38,0 @@ return s.replace(/g/g, 'k')

const starts_with_single_vowel_combos = /^(eu)/i
const joining_consonant_vowel = /^[^aeiou][e]([^d]|$)/
const joining_consonant_vowel = /^[^aeiou]e([^d]|$)/
const cvcv_same_consonant = /^([^aeiouy])[aeiouy]\1[aeiouy]/

@@ -9,3 +9,3 @@ const cvcv_same_vowel = /^[^aeiouy]([aeiouy])[^aeiouy]\1/

const ends_with_vowel = /[aeiouy]$/
const starts_with_consonant_vowel = /^[^aeiouy][h]?[aeiouy]/
const starts_with_consonant_vowel = /^[^aeiouy]h?[aeiouy]/

@@ -18,3 +18,3 @@ const ones = [

// -ing, -ent
/[aeiou][n][gt]$/,
/[aeiou]n[gt]$/,

@@ -21,0 +21,0 @@ // -ate, -age

@@ -6,3 +6,3 @@ //chop a string into pronounced syllables

const ends_with_vowel = /[aeiouy]$/
const starts_with_consonant_vowel = /^[^aeiouy][h]?[aeiouy]/
const starts_with_consonant_vowel = /^[^aeiouy]h?[aeiouy]/
const starts_with_e_then_specials = /^e[sm]/

@@ -9,0 +9,0 @@ const starts_with_e = /^e/

{
"name": "compromise-plugin-stats",
"name": "compromise-stats",
"version": "0.0.0",

@@ -4,0 +4,0 @@ "lockfileVersion": 2,

@@ -25,6 +25,32 @@ <div align="center">

##### TFIDF
[tf-idf](https://en.wikipedia.org/wiki/Tf%E2%80%93idf) is a type of word-analysis that can discover the most-characteristic, or unique words in a text.
It combines uniqueness of words, and their frequency in the document.
This plugin comes pre-built with a standard english model, so you can fingerprint an arbitrary text with `.tfidif()`
- **.tfidf(opts, model?)** -
alternatively, you can build your own model, from a compromise document:
- **.buildIDF()** -
```js
let model=nlp(shakespeareWords)
let doc = nlp('thou art so sus.')
doc.tfidf()
// [ [ 'sus', 5.78 ], [ 'thou', 2.3 ], [ 'art', 1.75 ], [ 'so', 0.44 ] ]
```
if you want to combine tfidf with other analysis, you can add numbers to individual terms, like this:
```js
let doc = nlp('no, my son is also named Bort')
doc.compute('tfidf')
let json = doc.json()
json[0].terms[6]
// {"text":"Bort", "tags":[], "tfidf":5.78, ... }
```
TF-IDF values are scaled, but have an unbounded maximum. The result for 'foo foo foo foo' would increase every with repitition.
##### Ngrams
`npm install compromise-ngrams`
- **[.ngrams({})](https://observablehq.com/@spencermountain/compromise-ngram)** - list all repeating sub-phrases, by word-count

@@ -31,0 +57,0 @@ - **[.unigrams()](https://observablehq.com/@spencermountain/compromise-ngram)** - n-grams with one word

@@ -10,3 +10,3 @@ import { terser } from 'rollup-plugin-terser'

output: [{ file: 'builds/compromise-stats.cjs', format: 'umd', name: 'compromiseStats' }],
plugins: [sizeCheck({ expect: 15, warn: 15 })],
plugins: [sizeCheck({ expect: 76, warn: 15 })],
},

@@ -16,3 +16,3 @@ {

output: [{ file: 'builds/compromise-stats.min.js', format: 'umd', name: 'compromiseStats' }],
plugins: [terser(opts), sizeCheck({ expect: 15, warn: 15 })],
plugins: [terser(opts), sizeCheck({ expect: 67, warn: 15 })],
},

@@ -22,4 +22,4 @@ {

output: [{ file: 'builds/compromise-stats.mjs', format: 'esm' }],
plugins: [terser(opts), sizeCheck({ expect: 15, warn: 15 })],
plugins: [terser(opts), sizeCheck({ expect: 67, warn: 15 })],
}
]

@@ -0,1 +1,2 @@

/* eslint-disable no-console, no-unused-vars */
// import corpus from 'nlp-corpus'

@@ -10,7 +11,7 @@ import nlp from '../../src/three.js'

let txt = 'i think we see that fook are nice. foopsie are cool'
let txt = 'no, my son is also named Bort'
let doc = nlp(txt)
console.log(doc.tfidf())
// doc.compute('tfidf')
// console.log(doc.json()[0])
// console.log(doc.tfidf())
doc.compute('tfidf')
console.log(JSON.stringify(doc.json()[0].terms[6]))

@@ -0,1 +1,2 @@

/* eslint-disable no-console */
import corpus from 'nlp-corpus'

@@ -2,0 +3,0 @@ import fs from 'fs'

import { pack } from 'efrt'
const hasNumber = /[0-9,;!:|¦]/
const hasPunct = /[.,\/#!$%\^&\*;:{}=\-_`~()']/
const hasPunct = /[.,/#!$%^&*;:{}=\-_`~()']/
const hasLetter = /[a-z]/

@@ -6,0 +6,0 @@

@@ -10,3 +10,4 @@ {

"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz",
"integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g=="
"integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==",
"dev": true
},

@@ -39,5 +40,6 @@ "node_modules/compromise": {

"resolved": "https://registry.npmjs.org/node-wget-promise/-/node-wget-promise-0.1.6.tgz",
"integrity": "sha512-EB1aleH7rp+rjdZRugezC8Nk7QJ6uXueYDUumFXkXQy7Z3HoW+0G6/cxjVMSmQHZmt4TC7xdpleOYnw65/ciLw=="
"integrity": "sha512-EB1aleH7rp+rjdZRugezC8Nk7QJ6uXueYDUumFXkXQy7Z3HoW+0G6/cxjVMSmQHZmt4TC7xdpleOYnw65/ciLw==",
"dev": true
}
}
}

@@ -10,3 +10,3 @@ import { terser } from 'rollup-plugin-terser'

output: [{ file: 'builds/compromise-wikipedia.cjs', format: 'umd', name: 'compromiseWikipedia' }],
plugins: [sizeCheck({ expect: 45, warn: 15 })],
plugins: [sizeCheck({ expect: 492, warn: 15 })],
},

@@ -16,3 +16,3 @@ {

output: [{ file: 'builds/compromise-wikipedia.min.js', format: 'umd', name: 'compromiseWikipedia' }],
plugins: [terser(opts), sizeCheck({ expect: 45, warn: 15 })],
plugins: [terser(opts), sizeCheck({ expect: 387, warn: 15 })],
},

@@ -22,4 +22,4 @@ {

output: [{ file: 'builds/compromise-wikipedia.mjs', format: 'esm' }],
plugins: [terser(opts), sizeCheck({ expect: 45, warn: 15 })],
plugins: [terser(opts), sizeCheck({ expect: 387, warn: 15 })],
}
]
// import corpus from 'nlp-corpus'
import nlp from '../../src/one.js'
import plugin from './src/index.js'
import plugin from './src/plugin.js'
nlp.extend(plugin)

@@ -10,2 +10,5 @@

txt = 'i saw the toronto raptors play a cleveland foops'
nlp(txt).wikipedia().debug()
// nlp(txt).wikipedia().debug()
let doc = nlp('You could always go to McGill, the Harvard of Canada!')
let m = doc.wikipedia()
m.debug()

@@ -0,1 +1,2 @@

/* eslint-disable no-console */
import wget from 'node-wget-promise'

@@ -6,5 +7,5 @@ import { yellow } from 'colorette'

let d = new Date()
const month = `${d.getMonth() + 1}`.padStart(2, '0')
const year = d.getFullYear()
let date = new Date()
const month = `${date.getMonth() + 1}`.padStart(2, '0')
const year = date.getFullYear()

@@ -15,5 +16,5 @@ // create the filename for the last dump

d.setDate(d.getDate() - 10) // do yesterday
const month = `${d.getMonth() + 1}`.padStart(2, '0')
const date = `${d.getDate()}`.padStart(2, '0')
return `${d.getFullYear()}${month}${date}`
const m = `${d.getMonth() + 1}`.padStart(2, '0')
const str = `${d.getDate()}`.padStart(2, '0')
return `${d.getFullYear()}${m}${str}`
}

@@ -20,0 +21,0 @@

@@ -1,4 +0,4 @@

import { readFileSync, writeFileSync } from 'fs'
/* eslint-disable no-console */
import fs from 'fs'
import sh from 'shelljs'
import fs from 'fs'
import { blue, yellow } from 'colorette'

@@ -33,3 +33,3 @@ import nlp from '../../../../src/two.js'

const hasPunct = /[.,\/#!$%\^&\*;:{}=_`~()+\\]/
const hasPunct = /[.,/#!$%^&*;:{}=_`~()+\\]/

@@ -64,3 +64,3 @@ //tot to internal id

let nope = 0
let arr = readFileSync(tsvOut).toString().split(/\n/)
let arr = fs.readFileSync(tsvOut).toString().split(/\n/)
for (let i = 0; i < arr.length; i += 1) {

@@ -95,3 +95,3 @@ let a = arr[i].split(' ')

final = JSON.stringify(final, null, 2)
writeFileSync(output, final)
fs.writeFileSync(output, final)
return final

@@ -98,0 +98,0 @@ }

@@ -0,1 +1,2 @@

/* eslint-disable no-console */
import { pack } from 'efrt'

@@ -2,0 +3,0 @@ import fs from 'fs'

@@ -1,2 +0,2 @@

import download from './01-download.js'
// import download from './01-download.js'
import filter from './02-filter.js'

@@ -3,0 +3,0 @@ import compress from './03-compress.js'

@@ -0,1 +1,2 @@

/* eslint-disable no-console, no-unused-vars */
import corpus from 'nlp-corpus'

@@ -2,0 +3,0 @@ import nlp from '../../../src/one.js'

@@ -0,1 +1,2 @@

/* eslint-disable no-console */
import sh from 'shelljs'

@@ -2,0 +3,0 @@ import fs from 'fs'

@@ -1,5 +0,5 @@

// import nlp from 'compromise'
import nlp from '../../../src/two.js'
/* eslint-disable no-console */
import nlp from '../../../src/one.js'
import { unpack } from 'efrt'
import model from '../_model.js'
import model from './_model.js'

@@ -6,0 +6,0 @@ // const hasNum = /[0-9]/

import test from 'tape'
import nlp from '../../../src/one.js'
import plugin from '../src/index.js'
import plugin from '../src/plugin.js'
nlp.extend(plugin)

@@ -8,3 +8,3 @@

let doc = nlp('i learned css')
let res = doc.articleNames().json()
let res = doc.wikipedia().json()
t.equal(res.length, 1, 'found-1 result')

@@ -14,3 +14,3 @@ t.equal(res[0].text, 'css', 'found css result')

doc = nlp('Melania Trump was trending')
res = doc.articleNames().json({ normal: true })
res = doc.wikipedia().json({ normal: true })
t.equal(res[0].normal, 'melania trump', 'found trump result')

@@ -23,5 +23,5 @@

let doc = nlp('i learned the csss grid layout')
let res = doc.articleNames().json()
let res = doc.wikipedia().json()
t.equal(res.length, 0, 'found 0 results')
t.end()
})

@@ -34,10 +34,16 @@ <div align="center">

<!-- spacer -->
<img height="85px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
<img height="25px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
<div align="left">
isn't it weird how we can <i>write text</i>, but not parse it?
<div align="left">
do you find it strange, how we struggle to parse text?
<br/>
<ul>
<i>↬<sub>ᔐᖜ</sub>↬-</i>
<br/>
how <b>error-prone</b> and <b><i>tricky</i></b> the simplest things become?
<div>
<img height="25px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
</div>
<sub>how easy text is to make, then how difficult it is <i>to use</i>?</sub>
</ul>

@@ -47,10 +53,9 @@ </div>

<div align="center">
it's like we've agreed that
<div align="right">
<sub >how it becomes</sub>
<div>
text is a dead-end.
<sub>basically a dead-end</sub>
<br/>
<sub>for our information?</sub>
</div>
<sub>and the knowledge in it</sub>
<br/>
<sub>should not really be used.</sub>
</div>

@@ -62,7 +67,14 @@

<div align="left">
<img height="30px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>compromise <a href="https://observablehq.com/@spencermountain/compromise-justification">tries its best</a> to parse text.
</div>
<img height="30px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>compromise <a href="https://observablehq.com/@spencermountain/compromise-justification">tries its best</a> to turn text into data.
<br/>
<img height="30px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>it makes limited and sensible decisions.
<br/>
<sub >
<img height="15px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/> it is not as smart as you'd think.
</sub>
<div align="left">
<img height="30px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
<img height="45px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
<!--
it is

@@ -72,19 +84,40 @@ <a href="https://docs.compromise.cool/compromise-filesize">small,

and often <i><a href="https://docs.compromise.cool/compromise-accuracy">good-enough</a></i>.
<br/>
<sub >
<img height="30px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/> it is not as smart as you'd think.
</sub>
<br/>
<!-- spacer -->
<!-- <img height="45px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
it is though - very open-ended, hackable, and open to engineering. -->
</div>
<br/> -->
</div>
<img height="30px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
```js
import nlp from 'compromise'
let doc = nlp('she sells seashells by the seashore.')
doc.verbs().toPastTense()
doc.text()
// 'she sold seashells by the seashore.'
```
<!-- spacer -->
<img height="50px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
<div align="center">
the idea is to be not fancy at all:
</div>
```js
if (doc.has('simon says #Verb')) {
return true
}
```
<!-- spacer -->
<img height="50px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
<img height="30px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
<div align="center">
<img height="50px" src="https://user-images.githubusercontent.com/399657/68221814-05ed1680-ffb8-11e9-8b6b-c7528d163871.png"/>
</div>
### .match():
<div align="left">
pull-out parts of a text:
</div>
```js

@@ -95,9 +128,2 @@ let doc = nlp(entireNovel)

```
```js
if (!doc.has('simon says #Verb')) {
return 'do nothing'
}
```
<div align="right">

@@ -110,38 +136,73 @@ <a href="https://docs.compromise.cool/compromise-match">match docs</a>

### .verbs():
compute metadata, and grab it:
```js
let doc = nlp('she sells seashells by the seashore.')
doc.verbs().toPastTense()
doc.text()
// 'she sold seashells by the seashore.'
import plg from 'compromise-speech'
nlp.extend(plg)
let doc = nlp('Milwaukee has certainly had its share of visitors..')
doc.compute('syllables')
doc.places().json()
/*
[{
"text": "Milwaukee",
"terms": [{
"normal": "milwaukee",
"syllables": ["mil", "waukee"]
}]
}]
*/
```
<div align="center">
<img height="50px" src="https://user-images.githubusercontent.com/399657/68221814-05ed1680-ffb8-11e9-8b6b-c7528d163871.png"/>
</div>
quickly flip between parsed and unparsed forms:
```js
let doc = nlp('soft and yielding like a nerf ball')
doc.out({ '#Adjective': (m)=>`<i>${m.text()}</i>` })
// '<i>soft</i> and <i>yielding</i> like a nerf ball'
```
<div align="right">
<a href="https://docs.compromise.cool/verbs">verb docs</a>
<a href="https://docs.compromise.cool/compromise-output">output docs</a>
</div>
<div align="center">
<img height="50px" src="https://user-images.githubusercontent.com/399657/68221824-09809d80-ffb8-11e9-9ef0-6ed3574b0ce8.png"/>
<img height="50px" src="https://user-images.githubusercontent.com/399657/68221837-0d142480-ffb8-11e9-9d30-90669f1b897c.png"/>
</div>
### .nouns():
avoid idiomatic problems, and brittle parsers:
```js
let doc = nlp('the purple dinosaur')
doc.nouns().toPlural()
doc.text()
// 'the purple dinosaurs'
let doc = nlp("we're not gonna take it..")
doc.has('gonna') // true
doc.has('going to') // true (implicit)
// transform
doc.contractions().expand()
dox.text()
// 'we are not going to take it..'
```
<div align="right">
<a href="https://docs.compromise.cool/nouns">noun docs</a>
<a href="https://docs.compromise.cool/compromise-contractions">contraction docs</a>
</div>
<div align="center">
<img height="50px" src="https://user-images.githubusercontent.com/399657/68221731-e8b84800-ffb7-11e9-8453-6395e0e903fa.png"/>
<!-- <img src="https://user-images.githubusercontent.com/399657/68221731-e8b84800-ffb7-11e9-8453-6395e0e903fa.png"/> -->
<div align="center">
<img height="50px" src="https://user-images.githubusercontent.com/399657/68221814-05ed1680-ffb8-11e9-8b6b-c7528d163871.png"/>
</div>
### .numbers():
<!-- spacer -->
<img height="30" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
</div>
whip stuff around like it's data:
```js
let doc = nlp('ninety five thousand and fifty two')
doc.numbers().add(2)
doc.numbers().add(20)
doc.text()
// 'ninety five thousand and fifty four'
// 'ninety five thousand and seventy two'
```

@@ -152,29 +213,25 @@

</div>
<div align="center">
<img height="50px" src="https://user-images.githubusercontent.com/399657/68221814-05ed1680-ffb8-11e9-8b6b-c7528d163871.png"/>
<img height="50px" src="https://user-images.githubusercontent.com/399657/68221837-0d142480-ffb8-11e9-9d30-90669f1b897c.png"/>
</div>
### .contractions():
<div align="center">
<img height="50px" src="https://user-images.githubusercontent.com/399657/68221731-e8b84800-ffb7-11e9-8453-6395e0e903fa.png"/>
</div>
<sub>because it actually is:</sub>
```js
let doc = nlp("we're not gonna take it, no we ain't gonna take it.")
// match an implicit term
doc.has('going') // true
// transform
doc.contractions().expand()
dox.text()
// 'we are not going to take it, no we are not going to take it.'
let doc = nlp('the purple dinosaur')
doc.nouns().toPlural()
doc.text()
// 'the purple dinosaurs'
```
<div align="right">
<a href="https://docs.compromise.cool/compromise-contractions">contraction docs</a>
<a href="https://docs.compromise.cool/nouns">noun docs</a>
</div>
<div align="center">
<img src="https://user-images.githubusercontent.com/399657/68221731-e8b84800-ffb7-11e9-8453-6395e0e903fa.png"/>
<!-- spacer -->
<img height="30" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
</div>
Use it on the client-side:

@@ -192,3 +249,3 @@

or the back:
or likewise:

@@ -204,7 +261,45 @@ ```typescript

<!--
bragging graphs
-->
<!-- spacer -->
<img height="30" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
compromise is **~200kb** (minified):
<div align="center">
<!-- filesize -->
<a href="https://bundlephobia.com/result?p=compromise">
<img width="600" src="https://user-images.githubusercontent.com/399657/68234819-14dfc300-ffd0-11e9-8b30-cb8545707b29.png"/>
</a>
</div>
it's pretty fast. It can run on keypress:
<div align="center">
<a href="https://observablehq.com/@spencermountain/compromise-performance">
<img width="600" src="https://user-images.githubusercontent.com/399657/68234798-0abdc480-ffd0-11e9-9ac5-8875d185a631.png"/>
</a>
</div>
it works mainly by <a href="https://observablehq.com/@spencermountain/verbs">conjugating all forms</a> of a basic word list.
The final lexicon is <a href="https://observablehq.com/@spencermountain/compromise-lexicon">~14,000 words</a>:
<div align="center">
<img width="600" src="https://user-images.githubusercontent.com/399657/68234805-0d201e80-ffd0-11e9-8dc6-f7a600352555.png"/>
</div>
you can read more about how it works, [here](https://observablehq.com/@spencermountain/compromise-internals). it's weird.
<!-- spacer -->
<img height="75px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
<!--
one/two/three parts
-->
<p align="left">
<sub >full api:</sub>
<sub>okay,</sub>
<h1>

@@ -222,9 +317,23 @@ <code>compromise/one</code>

let data = doc.json()
// [{ terms:[{ text:"Wayne's", normal:"wayne"}, ...] }]
/* [{
normal:"wayne's world party time",
terms:[{ text: "Wayne's", normal: "wayne" },
...
]
}]
*/
```
<b>one</b> splits your text up, wraps it in a handy API,
<ul>
<sub>and does nothing else -</sub>
</ul>
<img height="15px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
##### Output
- **[.text()](https://observablehq.com/@spencermountain/compromise-text)** - return the document as text
- **[.json({})](https://observablehq.com/@spencermountain/compromise-json)** - return the document as data
- **[.json()](https://observablehq.com/@spencermountain/compromise-json)** - return the document as data
- **[.debug()](https://observablehq.com/@spencermountain/compromise-output)** - pretty-print the interpreted document

@@ -258,3 +367,3 @@

_(all match methods use the [match-syntax](https://docs.compromise.cool/compromise-match-syntax).)_
_(match methods use the [match-syntax](https://docs.compromise.cool/compromise-match-syntax).)_

@@ -328,5 +437,14 @@ - **[.match('')](https://observablehq.com/@spencermountain/compromise-match)** - return a new Doc, with this one as a parent

<img height="25px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
</p>
<img height="85px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
<b>one</b> is fast - most sentences take a 10th of a millisecond.
It can do <b>~1mb</b> of text a second - or 10 wikipedia pages.
<i>Infinite jest</i> is takes 3s.
You can also paralellize, or stream text to it with <a href="">compromise-speed</a>.
<p>
<img height="85px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
</p>

@@ -350,4 +468,15 @@

```
<p>
<img height="25px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
</p>
<b>two</b> automatically calculates the very basic grammar of each word.
<sub>this is more useful than people sometimes realize.</sub>
Really light grammar helps you write cleaner templates, and get closer to the information.
Part-of-speech tagging is profoundly-difficult task to get 100% on. It is also a profoundly easy task to get 85% on.
<img height="15px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
##### Contractions

@@ -357,8 +486,19 @@ - **[.contractions()](https://observablehq.com/@spencermountain/compromise-contractions)** - things like "didn't"

</p>
<p>
<img height="85px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
</p>
you can see the grammar of each word by running `doc.debug()`, and the reasoning for each tag with `nlp.verbose('tagger')`.
compromise has <b>83 tags</b>, arranged in <a href="https://observablehq.com/@spencermountain/compromise-tags">a handsome graph</a>.
<b>#FirstName</b> → <b>#Person</b> → <b>#ProperNoun</b> → <b>#Noun</b>
if you prefer <a href="https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html"><i>Penn tags</i></a>, you can derive them with:
```js
let doc = nlp('welcome thrillho')
doc.compute('penn')
doc.json()
```
<!-- three -->

@@ -381,29 +521,5 @@ <p align="center">

##### Selections
<b>three</b> is a set of tooling to <i>zoom into</i> and operate on parts of a text.
- **[.clauses()](https://observablehq.com/@spencermountain/compromise-selections)** - split-up sentences into multi-term phrases
- **[.hyphenated()](https://observablehq.com/@spencermountain/compromise-selections)** - all terms connected with a hyphen or dash like `'wash-out'`
- **[.phoneNumbers()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'(939) 555-0113'`
- **[.hashTags()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'#nlp'`
- **[.emails()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'hi@compromise.cool'`
- **[.emoticons()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `:)`
- **[.emojis()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `💋`
- **[.atMentions()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'@nlp_compromise'`
- **[.urls()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'compromise.cool'`
- **[.adverbs()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'quickly'`
- **[.pronouns()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'he'`
- **[.conjunctions()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'but'`
- **[.prepositions()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'of'`
- **[.abbreviations()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'Mrs.'`
- **[.people()](https://observablehq.com/@spencermountain/topics-named-entity-recognition)** - names like 'John F. Kennedy'
- **[.places()](https://observablehq.com/@spencermountain/topics-named-entity-recognition)** - like 'Paris, France'
- **[.organizations()](https://observablehq.com/@spencermountain/topics-named-entity-recognition)** - like 'Google, Inc'
- **[.topics()](https://observablehq.com/@spencermountain/topics-named-entity-recognition)** - `people()` + `places()` + `organizations()`
- **[.parentheses()](https://observablehq.com/@spencermountain/compromise-selections)** - return anything inside (parentheses)
- **[.possessives()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `"Spencer's"`
- **[.quotations()](https://observablehq.com/@spencermountain/compromise-selections)** - return any terms inside quotation marks
- **[.acronyms()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'FBI'`
- **[.lists()](https://observablehq.com/@spencermountain/compromise-lists)** - things like `'eats, shoots, and leaves'`
- **[.lists().items()](https://observablehq.com/@spencermountain/compromise-lists)** - return the partitioned things in the list
- **[.lists().add()](https://observablehq.com/@spencermountain/compromise-lists)** - put a new item in the list
`.numbers()` grabs all the numbers in a document, for example - and extends it with new methods, like `.subtract()`.

@@ -497,2 +613,30 @@ ##### Nouns

##### Misc selections
- **[.clauses()](https://observablehq.com/@spencermountain/compromise-selections)** - split-up sentences into multi-term phrases
- **[.hyphenated()](https://observablehq.com/@spencermountain/compromise-selections)** - all terms connected with a hyphen or dash like `'wash-out'`
- **[.phoneNumbers()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'(939) 555-0113'`
- **[.hashTags()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'#nlp'`
- **[.emails()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'hi@compromise.cool'`
- **[.emoticons()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `:)`
- **[.emojis()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `💋`
- **[.atMentions()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'@nlp_compromise'`
- **[.urls()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'compromise.cool'`
- **[.adverbs()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'quickly'`
- **[.pronouns()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'he'`
- **[.conjunctions()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'but'`
- **[.prepositions()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'of'`
- **[.abbreviations()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'Mrs.'`
- **[.people()](https://observablehq.com/@spencermountain/topics-named-entity-recognition)** - names like 'John F. Kennedy'
- **[.places()](https://observablehq.com/@spencermountain/topics-named-entity-recognition)** - like 'Paris, France'
- **[.organizations()](https://observablehq.com/@spencermountain/topics-named-entity-recognition)** - like 'Google, Inc'
- **[.topics()](https://observablehq.com/@spencermountain/topics-named-entity-recognition)** - `people()` + `places()` + `organizations()`
- **[.parentheses()](https://observablehq.com/@spencermountain/compromise-selections)** - return anything inside (parentheses)
- **[.possessives()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `"Spencer's"`
- **[.quotations()](https://observablehq.com/@spencermountain/compromise-selections)** - return any terms inside quotation marks
- **[.acronyms()](https://observablehq.com/@spencermountain/compromise-selections)** - things like `'FBI'`
- **[.lists()](https://observablehq.com/@spencermountain/compromise-lists)** - things like `'eats, shoots, and leaves'`
- **[.lists().items()](https://observablehq.com/@spencermountain/compromise-lists)** - return the partitioned things in the list
- **[.lists().add()](https://observablehq.com/@spencermountain/compromise-lists)** - put a new item in the list
<!-- - **[.contract()](https://observablehq.com/@spencermountain/compromise-contractions)** - `"she would"` -> `"she'd"` -->

@@ -508,35 +652,3 @@

<!--
bragging graphs
-->
<!-- spacer -->
<img height="30" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
compromise is **180kb** (minified):
<div align="center">
<!-- filesize -->
<a href="https://bundlephobia.com/result?p=compromise">
<img width="600" src="https://user-images.githubusercontent.com/399657/68234819-14dfc300-ffd0-11e9-8b30-cb8545707b29.png"/>
</a>
</div>
it's pretty fast. It can run on keypress:
<div align="center">
<a href="https://observablehq.com/@spencermountain/compromise-performance">
<img width="600" src="https://user-images.githubusercontent.com/399657/68234798-0abdc480-ffd0-11e9-9ac5-8875d185a631.png"/>
</a>
</div>
it works mainly by <a href="https://observablehq.com/@spencermountain/verbs">conjugating all forms</a> of a basic word list.
The final lexicon is <a href="https://observablehq.com/@spencermountain/compromise-lexicon">~14,000 words</a>:
<div align="center">
<img width="600" src="https://user-images.githubusercontent.com/399657/68234805-0d201e80-ffd0-11e9-8dc6-f7a600352555.png"/>
</div>
you can read more about how it works, [here](https://observablehq.com/@spencermountain/compromise-internals). it's weird.
<!-- spacer -->

@@ -552,4 +664,5 @@ <!-- <img height="25px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/> -->

decide how words get interpreted:
compromise comes with a considerate, common-sense baseline for english grammar. You're free to change, or lay-waste to any settings - which is the fun part actually.
the easiest part is just to suggest tags for any given words:
```js

@@ -566,7 +679,6 @@ let myWords = {

```js
const nlp = require('compromise')
nlp.extend((Doc, world) => {
import nlp from 'compromise'
nlp.extend({
// add new tags
world.addTags({
tags: {
Character: {

@@ -576,20 +688,15 @@ isA: 'Person',

},
})
},
// add or change words in the lexicon
world.addWords({
words: {
kermit: 'Character',
gonzo: 'Character',
})
// add methods to run after the tagger
world.postProcess(doc => {
doc.match('light the lights').tag('#Verb . #Plural')
})
// add a whole new method
Doc.prototype.kermitVoice = function () {
this.sentences().prepend('well,')
this.match('i [(am|was)]').prepend('um,')
return this
},
// add new methods to compromise
api: (View) => {
View.prototype.kermitVoice = function () {
this.sentences().prepend('well,')
this.match('i [(am|was)]').prepend('um,')
return this
}
}

@@ -626,23 +733,28 @@ })

| Concepts | API | Plugins |
| ------------------ | :---------------------------------: | ---------------------------: | --- |
| [Accuracy](https://observablehq.com/@spencermountain/compromise-accuracy) | [Accessors](https://observablehq.com/@spencermountain/compromise-accessors) | [Adjectives](https://observablehq.com/@spencermountain/compromise-adjectives) |
| Concepts | API | Plugins |
| ------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------: | -------------------------------------------------------------------------------------: |
| [Accuracy](https://observablehq.com/@spencermountain/compromise-accuracy) | [Accessors](https://observablehq.com/@spencermountain/compromise-accessors) | [Adjectives](https://observablehq.com/@spencermountain/compromise-adjectives) |
| [Caching](https://observablehq.com/@spencermountain/compromise-cache) | [Constructor-methods](https://observablehq.com/@spencermountain/compromise-constructor-methods) | [Dates](https://observablehq.com/@spencermountain/compromise-dates) |
| [Case](https://observablehq.com/@spencermountain/compromise-case) | [Contractions](https://observablehq.com/@spencermountain/compromise-contractions) | [Export](https://observablehq.com/@spencermountain/compromise-export) |
| [Filesize](https://observablehq.com/@spencermountain/compromise-filesize) | [Insert](https://observablehq.com/@spencermountain/compromise-insert) | [Hash](https://observablehq.com/@spencermountain/compromise-hash) |
| [Internals](https://observablehq.com/@spencermountain/compromise-internals) | [Json](https://observablehq.com/@spencermountain/compromise-json) | [Html](https://observablehq.com/@spencermountain/compromise-html) |
| [Justification](https://observablehq.com/@spencermountain/compromise-justification) | [Lists](https://observablehq.com/@spencermountain/compromise-lists) | [Keypress](https://observablehq.com/@spencermountain/compromise-keypress) |
| [Lexicon](https://observablehq.com/@spencermountain/compromise-lexicon) | [Loops](https://observablehq.com/@spencermountain/compromise-loops) | [Ngrams](https://observablehq.com/@spencermountain/compromise-ngram) |
| [Match-syntax](https://observablehq.com/@spencermountain/compromise-match-syntax) | [Match](https://observablehq.com/@spencermountain/compromise-match) | [Numbers](https://observablehq.com/@spencermountain/compromise-values) |
| [Performance](https://observablehq.com/@spencermountain/compromise-performance) | [Nouns](https://observablehq.com/@spencermountain/nouns) | [Paragraphs](https://observablehq.com/@spencermountain/compromise-paragraphs) |
| [Plugins](https://observablehq.com/@spencermountain/compromise-plugins) | [Output](https://observablehq.com/@spencermountain/compromise-output) | [Scan](https://observablehq.com/@spencermountain/compromise-scan) |
| [Projects](https://observablehq.com/@spencermountain/compromise-projects) | [Selections](https://observablehq.com/@spencermountain/compromise-selections) | [Sentences](https://observablehq.com/@spencermountain/compromise-sentences) |
| [Tagger](https://observablehq.com/@spencermountain/compromise-tagger) | [Sorting](https://observablehq.com/@spencermountain/compromise-sorting) | [Syllables](https://observablehq.com/@spencermountain/compromise-syllables) |
| [Tags](https://observablehq.com/@spencermountain/compromise-tags) | [Split](https://observablehq.com/@spencermountain/compromise-split) | [Pronounce](https://observablehq.com/@spencermountain/compromise-pronounce) | |
| [Tokenization](https://observablehq.com/@spencermountain/compromise-tokenization) | [Text](https://observablehq.com/@spencermountain/compromise-text) | [Strict](https://observablehq.com/@spencermountain/compromise-strict) |
| [Named-Entities](https://observablehq.com/@spencermountain/compromise-topics) | [Utils](https://observablehq.com/@spencermountain/compromise-utils) | [Penn-tags](https://observablehq.com/@spencermountain/compromise-penn-tags) |
| [Whitespace](https://observablehq.com/@spencermountain/compromise-whitespace) | [Verbs](https://observablehq.com/@spencermountain/verbs) | [Typeahead](https://observablehq.com/@spencermountain/compromise/compromise-typeahead) |
| [World data](https://observablehq.com/@spencermountain/compromise-world) | [Normalization](https://observablehq.com/@spencermountain/compromise-normalization) | |
| [Fuzzy-matching](https://observablehq.com/@spencermountain/compromise-fuzzy-matching) | [Typescript](https://observablehq.com/@spencermountain/compromise-typescript) | |
| [Case](https://observablehq.com/@spencermountain/compromise-case) | [Contractions](https://observablehq.com/@spencermountain/compromise-contractions) | [Export](https://observablehq.com/@spencermountain/compromise-export) |
| [Filesize](https://observablehq.com/@spencermountain/compromise-filesize) | [Insert](https://observablehq.com/@spencermountain/compromise-insert) | [Hash](https://observablehq.com/@spencermountain/compromise-hash) |
| [Internals](https://observablehq.com/@spencermountain/compromise-internals) | [Json](https://observablehq.com/@spencermountain/compromise-json) | [Html](https://observablehq.com/@spencermountain/compromise-html) |
| [Justification](https://observablehq.com/@spencermountain/compromise-justification) | [Lists](https://observablehq.com/@spencermountain/compromise-lists) | [Keypress](https://observablehq.com/@spencermountain/compromise-keypress) |
| [Lexicon](https://observablehq.com/@spencermountain/compromise-lexicon) | [Loops](https://observablehq.com/@spencermountain/compromise-loops) | [Ngrams](https://observablehq.com/@spencermountain/compromise-ngram) |
| [Match-syntax](https://observablehq.com/@spencermountain/compromise-match-syntax) | [Match](https://observablehq.com/@spencermountain/compromise-match) | [Numbers](https://observablehq.com/@spencermountain/compromise-values) |
| [Performance](https://observablehq.com/@spencermountain/compromise-performance) | [Nouns](https://observablehq.com/@spencermountain/nouns) | [Paragraphs](https://observablehq.com/@spencermountain/compromise-paragraphs) |
| [Plugins](https://observablehq.com/@spencermountain/compromise-plugins) | [Output](https://observablehq.com/@spencermountain/compromise-output) | [Scan](https://observablehq.com/@spencermountain/compromise-scan) |
| [Projects](https://observablehq.com/@spencermountain/compromise-projects) | [Selections](https://observablehq.com/@spencermountain/compromise-selections) | [Sentences](https://observablehq.com/@spencermountain/compromise-sentences) |
| [Tagger](https://observablehq.com/@spencermountain/compromise-tagger) | [Sorting](https://observablehq.com/@spencermountain/compromise-sorting) | [Syllables](https://observablehq.com/@spencermountain/compromise-syllables) |
| [Tags](https://observablehq.com/@spencermountain/compromise-tags) | [Split](https://observablehq.com/@spencermountain/compromise-split) | [Pronounce](https://observablehq.com/@spencermountain/compromise-pronounce) | |
| [Tokenization](https://observablehq.com/@spencermountain/compromise-tokenization) | [Text](https://observablehq.com/@spencermountain/compromise-text) | [Strict](https://observablehq.com/@spencermountain/compromise-strict) |
| [Named-Entities](https://observablehq.com/@spencermountain/compromise-topics) | [Utils](https://observablehq.com/@spencermountain/compromise-utils) | [Penn-tags](https://observablehq.com/@spencermountain/compromise-penn-tags) |
| [Whitespace](https://observablehq.com/@spencermountain/compromise-whitespace) | [Verbs](https://observablehq.com/@spencermountain/verbs) | [Typeahead](https://observablehq.com/@spencermountain/compromise/compromise-typeahead) |
| [World data](https://observablehq.com/@spencermountain/compromise-world) | [Normalization](https://observablehq.com/@spencermountain/compromise-normalization) | |
| [Fuzzy-matching](https://observablehq.com/@spencermountain/compromise-fuzzy-matching) | [Typescript](https://observablehq.com/@spencermountain/compromise-typescript) | |
<div >
<img height="25px" src="https://user-images.githubusercontent.com/399657/68221862-17ceb980-ffb8-11e9-87d4-7b30b6488f16.png"/>
</div>
##### Talks:

@@ -665,3 +777,2 @@

- **[Chat dialogue framework](http://superscriptjs.com/)** - by Rob Ellis
- **[Automated Bechdel Test](https://github.com/guardian/bechdel-test)** - by The Guardian

@@ -693,8 +804,7 @@ - **[Story generation framework](https://perchance.org/welcome)** - by Jose Phrocca

- **[.tokenize()](https://observablehq.com/@spencermountain/compromise-tokenization)** - parse text without running POS-tagging
- **[.extend()](https://observablehq.com/@spencermountain/compromise-constructor-methods)** - mix in a compromise-plugin
- **[.fromJSON()](https://observablehq.com/@spencermountain/compromise-constructor-methods)** - load a compromise object from `.json()` result
- **[.plugin()](https://observablehq.com/@spencermountain/compromise-constructor-methods)** - mix in a compromise-plugin
- **[.verbose()](https://observablehq.com/@spencermountain/compromise-constructor-methods)** - log our decision-making for debugging
- **[.version()](https://observablehq.com/@spencermountain/compromise-constructor-methods)** - current semver version of the library
- **[.version](https://observablehq.com/@spencermountain/compromise-constructor-methods)** - current semver version of the library
- **[.parseMatch()](https://observablehq.com/@spencermountain/compromise-constructor-methods)** - pre-parse any match statements for faster lookups
- **[.world()](https://observablehq.com/@spencermountain/compromise-constructor-methods)** - grab all current linguistic data
- **[.parseMatch()](https://observablehq.com/@spencermountain/compromise-constructor-methods)** - pre-parse any match statements for faster lookups

@@ -801,8 +911,2 @@ <div align="center">

##### Strict-match
`npm install compromise-strict`
- **[.strictMatch()](https://observablehq.com/@spencermountain/compromise-strict)** - perform a compromise match using a formal parser
##### Syllables

@@ -832,9 +936,7 @@

import nlp from 'compromise'
import ngrams from 'compromise-ngrams'
import numbers from 'compromise-numbers'
import stats from 'compromise-stats'
const nlpEx = nlp.extend(ngrams).extend(numbers)
const nlpEx = nlp.extend(stats)
nlpEx('This is type safe!').ngrams({ min: 1 })
nlpEx('This is type safe!').numbers()
```

@@ -943,6 +1045,7 @@

- &nbsp; **[naturalNode](https://github.com/NaturalNode/natural)** - fancier statistical nlp in javascript
- &nbsp; **[dariusk/pos-js ](https://github.com/dariusk/pos-js)** - fastTag fork in javascript
- &nbsp; **[compendium-js](https://github.com/Ulflander/compendium-js)** - POS and sentiment analysis in javascript
- &nbsp; **[nodeBox linguistics](https://www.nodebox.net/code/index.php/Linguistics)** - conjugation, inflection in javascript
- &nbsp; **[reText](https://github.com/wooorm/retext)** - very impressive [text utilities](https://github.com/wooorm/retext/blob/master/doc/plugins.md) in javascript
- &nbsp; **[superScript](http://superscriptjs.com/)** - conversation engine in js
- &nbsp; **[superScript](https://github.com/superscriptjs/superscript)** - conversation engine in js
- &nbsp; **[jsPos](https://code.google.com/archive/p/jspos/)** - javascript build of the time-tested Brill-tagger

@@ -949,0 +1052,0 @@

@@ -1,1 +0,1 @@

export default '13.11.4-rc5'
export default '13.11.4-rc7'
const cache = function (view) {
view._cache = view.methods.one.cacheDoc(view.document)
}
export default {
cache
cache: function (view) {
view._cache = view.methods.one.cacheDoc(view.document)
}
}

@@ -9,3 +9,2 @@ import methods from './methods/index.js'

methods,
// hooks: ['cache']
}

@@ -25,5 +25,4 @@ import { spliceArr } from './lib/insert.js'

let ptrs = input.fullPointer
ptrs = ptrs.map(a => {
ptrs.forEach(a => {
a[0] += home.document.length
return a
})

@@ -40,3 +39,3 @@ home.document = combineDocs(home.document, input.document)

if (typeof input === 'string') {
let json = methods.one.tokenize(input, world)
let json = methods.one.tokenize.fromString(input, world)
let ptrs = this.fullPointer

@@ -43,0 +42,0 @@ let lastN = ptrs[ptrs.length - 1][0]

@@ -7,8 +7,5 @@ import caseFns from './case.js'

import sort from './sort.js'
import fork from './fork.js'
import concat from './concat.js'
import freeze from './freeze.js'
import repair from './repair.js'
const methods = Object.assign({}, caseFns, insert, replace, remove, whitespace, sort, fork, concat, freeze, repair)
const methods = Object.assign({}, caseFns, insert, replace, remove, whitespace, sort, concat)

@@ -15,0 +12,0 @@ const addAPI = function (View) {

@@ -6,3 +6,3 @@ import { cleanAppend, cleanPrepend } from './lib/insert.js'

const expand = function (m) {
if (m.has('@hasContraction') && m.after('^.').has('@hasContraction')) {
if (m.has('@hasContraction')) {//&& m.after('^.').has('@hasContraction')
let more = m.grow('@hasContraction')

@@ -16,3 +16,3 @@ more.contractions().expand()

const addIds = function (terms) {
terms.forEach((term, i) => {
terms.forEach((term) => {
term.id = uuid(term)

@@ -27,3 +27,3 @@ })

if (typeof input === 'string') {
return methods.one.tokenize(input, world)[0] //assume one sentence
return methods.one.tokenize.fromString(input, world)[0] //assume one sentence
}

@@ -61,5 +61,3 @@ //allow a view object

// harden the pointer
if (!document[n][ptr[1]]) {
console.log('soft-pointer', ptr)
} else {
if (document[n] && document[n][ptr[1]]) {
ptr[3] = document[n][ptr[1]].id

@@ -66,0 +64,0 @@ }

@@ -7,4 +7,6 @@ // punctuation we wanna transfer

child.forEach(term => term.dirty = true)
let args = [index, 0].concat(child)
Array.prototype.splice.apply(parent, args)
if (parent) {
let args = [index, 0].concat(child)
Array.prototype.splice.apply(parent, args)
}
return parent

@@ -25,3 +27,3 @@ }

const movePunct = (source, end, needle) => {
const juicy = /[.?!,;:)-–—'"]/g
const juicy = /[-.?!,;:)–—'"]/g
let wasLast = source[end - 1]

@@ -35,3 +37,3 @@ if (!wasLast) {

let last = needle[needle.length - 1]
last.post = punct + last.post //+ ' '
last.post = punct + last.post
// remove it, from source

@@ -85,3 +87,3 @@ wasLast.post = wasLast.post.replace(juicy, '')

moveTitleCase(home, start, needle)
movePunct(home, end, needle)
// movePunct(home, end, needle)
spliceArr(home, start, needle)

@@ -92,3 +94,3 @@ }

let [n, , end] = ptr
let total = document[n].length
let total = (document[n] || []).length
if (end < total) {

@@ -105,6 +107,12 @@ // are we in the middle?

movePunct(home, end, needle)
// is there another sentence after?
if (document[n + 1]) {
needle[needle.length - 1].post += ' '
}
}
spliceArr(home, ptr[2], needle)
// set new endId
ptr[4] = needle[needle.length - 1].id
}
export { cleanPrepend, cleanAppend, spliceArr }

@@ -47,3 +47,2 @@

}
// console.log(document)
return document

@@ -53,16 +52,6 @@ }

const removeSelf = function (m, view) {
}
const removePart = function (m, view) {
}
const methods = {
/** */
remove: function (reg) {
const { indexN } = this.methods.one
const { indexN } = this.methods.one.pointer
// two modes:

@@ -118,9 +107,14 @@ // - a. remove self, from full parent

})
// strip hardened-pointers
ptrs = ptrs.map(ptr => ptr.slice(0, 3))
// remove old hard-pointers
ptrs = ptrs.map((ptr) => {
ptr[3] = null
ptr[4] = null
return ptr
})
// mutate original
self.ptrs = ptrs
self.document = document
self.compute('index')
if (reg) {
return self.toView(ptrs).compute('index') //return new document
return self.toView(ptrs) //return new document
}

@@ -127,0 +121,0 @@ return self.none()

@@ -23,3 +23,3 @@ const dollarStub = /\$[0-9a-z]+/g

let groups = main.groups()
input = input.replace(dollarStub, (a, b, c) => {
input = input.replace(dollarStub, (a) => {
let num = a.replace(/\$/, '')

@@ -26,0 +26,0 @@ if (groups.hasOwnProperty(num)) {

@@ -10,9 +10,9 @@ import methods from './lib/_sort.js'

let ptrs = view.fullPointer
let all = []
ptrs.forEach((ptr, i) => {
all.push(view.update([ptr]))
ptrs = ptrs.sort((a, b) => {
a = view.update([a])
b = view.update([b])
return fn(a, b)
})
let none = view.none()
//! not working yet
return none.concat(all.sort(fn))
view.ptrs = ptrs //mutate original
return view
}

@@ -69,3 +69,3 @@

let res = this.filter(m => {
let txt = m.text('normal')
let txt = m.text('machine')
if (already.has(txt)) {

@@ -72,0 +72,0 @@ return false

@@ -9,3 +9,3 @@ import uuid from './uuid.js'

let term = docs[n][i]
term.id = uuid(term)
term.id = term.id || uuid(term)
}

@@ -12,0 +12,0 @@ }

@@ -64,5 +64,2 @@ /*

if (id.length !== 9) {
console.error('id !9 ' + id)
}
return term.normal + '|' + id.toUpperCase()

@@ -69,0 +66,0 @@ }

@@ -20,3 +20,2 @@ // always a contracttion

'else',
'name', //name's dave

@@ -26,55 +25,4 @@ // 'god', //god's gift

// // always a posessive
// const never = new Set([
// 'one',
// 'men',
// 'man',
// 'woman',
// 'women',
// 'girl',
// 'boy',
// 'mankind',
// 'world',
// 'today',
// 'tomorrow',
// ])
// // spencer's cool
const afterYes = new Set([
// 'cool',
// 'nice',
// 'beautiful',
// 'ugly',
// 'good',
// 'bad',
// 'ok',
// 'right',
// 'wrong',
// 'big',
// 'small',
// 'large',
// 'huge',
// 'above',
// 'below',
// 'in',
// 'out',
// 'inside',
// 'outside',
// 'always',
// 'even',
// 'same',
// 'still',
// 'cold',
// 'hot',
// 'old',
// 'young',
// 'rich',
// 'poor',
// 'early',
// 'late',
// 'new',
// 'old',
// 'tiny',
// 'huge',
// adverbs

@@ -104,5 +52,2 @@ 'really',

}
// if (never.has(before)) {
// return false
// }

@@ -115,58 +60,2 @@ // gandhi's so cool

// if (nextTerm) {
// console.log(term.normal, nextTerm.normal)
// } else {
// console.log(term.normal)
// }
// console.log(before)
// these can't be possessive
// if (hereThere.hasOwnProperty(term.machine)) {
// return false
// }
// // if we already know it
// if (term.tags.has('Possessive')) {
// return true
// }
// //a pronoun can't be possessive - "he's house"
// if (term.tags.has('Pronoun') || term.tags.has('QuestionWord')) {
// return false
// }
// if (banList.hasOwnProperty(term.normal)) {
// return false
// }
// //if end of sentence, it is possessive - "was spencer's"
// let nextTerm = terms[i + 1]
// if (!nextTerm) {
// return true
// }
// //a gerund suggests 'is walking'
// if (nextTerm.tags.has('Verb')) {
// //fix 'jamie's bite'
// if (nextTerm.tags.has('Infinitive')) {
// return true
// }
// //fix 'spencer's runs'
// if (nextTerm.tags.has('PresentTense')) {
// return true
// }
// return false
// }
// //spencer's house
// if (nextTerm.tags.has('Noun')) {
// // 'spencer's here'
// if (hereThere.hasOwnProperty(nextTerm.normal) === true) {
// return false
// }
// return true
// }
// //rocket's red glare
// let twoTerm = terms[i + 2]
// if (twoTerm && twoTerm.tags.has('Noun') && !twoTerm.tags.has('Pronoun')) {
// return true
// }
// //othwerwise, an adjective suggests 'is good'
// if (nextTerm.tags.has('Adjective') || nextTerm.tags.has('Adverb') || nextTerm.tags.has('Verb')) {
// return false
// }
// default to posessive

@@ -173,0 +62,0 @@ return false

@@ -25,3 +25,3 @@ import splice from './_splice.js'

// bob's
s: (terms, i, world) => {
s: (terms, i) => {
// [bob's house] vs [bob's cool]

@@ -31,2 +31,3 @@ if (shouldSplit(terms, i) === true) {

}
return null
},

@@ -33,0 +34,0 @@ }

@@ -33,2 +33,3 @@ export default [

// { after: `cause`, out: ['because'] },
{ word: "'tis", out: ['it', 'is'] },

@@ -35,0 +36,0 @@ { word: "'twas", out: ['it', 'was'] },

@@ -1,2 +0,2 @@

const prefix = /^(under|over|mis|re|un|dis|pre|post)-?/
const prefix = /^(under|over|mis|re|un|dis|semi|pre|post)-?/
// anti|non|extra|inter|intra|over

@@ -11,2 +11,3 @@ const allowPrefix = new Set(['Verb', 'Infinitive', 'PastTense', 'Gerund', 'PresentTense', 'Adjective', 'Participle'])

const lexicon = model.one.lexicon
// basic lexicon lookup

@@ -13,0 +14,0 @@ let t = terms[i]

@@ -8,3 +8,2 @@ /** insert new words/phrases into the lexicon */

}
// normalize tag vals

@@ -33,4 +32,2 @@ Object.keys(words).forEach(k => {

export default {
addWords
}
export default { addWords }
// derive clever things from our lexicon key-value pairs
const expand = function (words, world) {
const expand = function (words) {
// const { methods, model } = world

@@ -4,0 +4,0 @@ let lex = {}

@@ -1,2 +0,1 @@

import fastTag from './fastTag.js'
import expandLexicon from './expand.js'

@@ -7,4 +6,3 @@

expandLexicon,
fastTag
}
}

@@ -7,3 +7,3 @@ import compute from './compute/index.js'

one: {
lexicon: {},
lexicon: {}, //setup blank lexicon
_multiCache: {},

@@ -10,0 +10,0 @@ }

@@ -6,3 +6,3 @@ // edited by Spencer Kelly

const { methods, model } = world
let terms = methods.one.splitTerms(phrase, model).map(methods.one.splitWhitespace)
let terms = methods.one.tokenize.splitTerms(phrase, model).map(methods.one.tokenize.splitWhitespace)
return terms.map(term => term.text.toLowerCase())

@@ -71,3 +71,3 @@ }

}
return { goNext, endAs, failTo, }
return { goNext, endAs, failTo }
}

@@ -74,0 +74,0 @@ export default buildTrie

@@ -21,4 +21,4 @@ // follow our trie structure

let term = terms[i - len + 1]
let [n, start] = term.index
results.push([n, start, start + len, term.id])
let [no, start] = term.index
results.push([no, start, start + len, term.id])
}

@@ -44,3 +44,3 @@ }

if (!trie.goNext || !trie.goNext[0]) {
console.error('Compromise invalid lookup trie')
console.error('Compromise invalid lookup trie')//eslint-disable-line
return view.none()

@@ -47,0 +47,0 @@ }

@@ -0,29 +1,12 @@

import api from './api/index.js'
import compress from './api/compile/compress.js'
import build from './api/compile/build.js'
import compress from './api/compile/compress.js'
import scan from './api/scan.js'
const isObject = val => {
return Object.prototype.toString.call(val) === '[object Object]'
}
const api = function (View) {
/** pre-compile a list of matches to lookup */
const lib = {
/** turn an array or object into a compressed trie*/
View.prototype.compile = function (obj) {
const trie = build(obj, this.world)
compile: function (input) {
const trie = build(input, this.world())
return compress(trie)
}
/** find all matches in this document */
View.prototype.lookup = function (input, opts = {}) {
if (!input) {
return this.none()
}
if (typeof input === 'string') {
input = [input]
}
let trie = isObject(input) ? input : build(input, this.world)
let res = scan(this, trie, opts)
res = res.settle()
return res
}
}

@@ -33,2 +16,3 @@

api,
lib
}

@@ -8,5 +8,5 @@ export const relPointer = function (ptrs, parent) {

if (parent[n]) {
ptr[0] = parent[n][0]
ptr[1] += parent[n][1]
ptr[2] += parent[n][1]
ptr[0] = parent[n][0] //n
ptr[1] += parent[n][1] //start
ptr[2] += parent[n][1] //end
}

@@ -13,0 +13,0 @@ })

@@ -1,6 +0,4 @@

// import { indexN } from '../../pointers/methods/lib/index.js'
const before = function (regs, group) {
const { indexN } = this.methods.one
const { indexN } = this.methods.one.pointer
let pre = []

@@ -23,3 +21,3 @@ let byN = indexN(this.fullPointer)

const after = function (regs, group) {
const { indexN } = this.methods.one
const { indexN } = this.methods.one.pointer
let post = []

@@ -43,4 +41,4 @@ let byN = indexN(this.fullPointer)

const growLeft = function (regs, group) {
regs = this.world.methods.one.parseMatch(regs)
const growLeft = function (regs, group, opts) {
regs = this.world.methods.one.parseMatch(regs, opts)
regs[regs.length - 1].end = true// ensure matches are beside us ←

@@ -59,4 +57,4 @@ let ptrs = this.fullPointer

const growRight = function (regs, group) {
regs = this.world.methods.one.parseMatch(regs)
const growRight = function (regs, group, opts) {
regs = this.world.methods.one.parseMatch(regs, opts)
regs[0].start = true// ensure matches are beside us →

@@ -69,2 +67,3 @@ let ptrs = this.fullPointer

ptrs[n][2] += terms.length
ptrs[n][4] = null //remove end-id
}

@@ -71,0 +70,0 @@ })

import { fixPointers, isView } from './_lib.js'
const match = function (regs, group) {
const match = function (regs, group, opts) {
const one = this.methods.one

@@ -11,3 +11,3 @@ // support param as view object

if (typeof regs === 'string') {
regs = one.parseMatch(regs)
regs = one.parseMatch(regs, opts)
}

@@ -22,3 +22,3 @@ let todo = { regs, group }

const matchOne = function (regs, group) {
const matchOne = function (regs, group, opts) {
const one = this.methods.one

@@ -30,3 +30,3 @@ // support at view as a param

if (typeof regs === 'string') {
regs = one.parseMatch(regs)
regs = one.parseMatch(regs, opts)
}

@@ -41,7 +41,7 @@ let todo = { regs, group, justOne: true }

const has = function (regs, group) {
const has = function (regs, group, opts) {
const one = this.methods.one
let ptrs
if (typeof regs === 'string') {
regs = one.parseMatch(regs)
regs = one.parseMatch(regs, opts)
let todo = { regs, group, justOne: true }

@@ -56,6 +56,6 @@ ptrs = one.match(this.docs, todo, this._cache).ptrs

// 'if'
const ifFn = function (regs, group) {
const ifFn = function (regs, group, opts) {
const one = this.methods.one
if (typeof regs === 'string') {
regs = one.parseMatch(regs)
regs = one.parseMatch(regs, opts)
let todo = { regs, group, justOne: true }

@@ -76,3 +76,3 @@ let ptrs = this.fullPointer

const ifNo = function (regs, group) {
const ifNo = function (regs, group, opts) {
const { methods } = this

@@ -86,3 +86,3 @@ const one = methods.one

if (typeof regs === 'string') {
regs = one.parseMatch(regs)
regs = one.parseMatch(regs, opts)
}

@@ -89,0 +89,0 @@ return this.filter(m => {

@@ -10,7 +10,2 @@ const combine = function (left, right) {

}
// are we splitting within a contraction?
// if (m.has('@hasContraction')) {
// let more = m.grow('@hasContraction')
// more.contractions().expand()
// }
return m

@@ -30,3 +25,3 @@ }

methods.splitOn = function (m, group) {
const { splitAll } = this.methods.one
const { splitAll } = this.methods.one.pointer
let splits = getDoc(m, this, group).fullPointer

@@ -48,3 +43,3 @@ let all = splitAll(this.fullPointer, splits)

methods.splitBefore = function (m, group) {
const { splitAll } = this.methods.one
const { splitAll } = this.methods.one.pointer
let splits = getDoc(m, this, group).fullPointer

@@ -57,2 +52,3 @@ let all = splitAll(this.fullPointer, splits)

if (o.match && o.after) {
// console.log(combine(o.match, o.after))
res.push(combine(o.match, o.after))

@@ -71,3 +67,3 @@ } else {

methods.splitAfter = function (m, group) {
const { splitAll } = this.methods.one
const { splitAll } = this.methods.one.pointer
let splits = getDoc(m, this, group).fullPointer

@@ -74,0 +70,0 @@ let all = splitAll(this.fullPointer, splits)

@@ -1,8 +0,8 @@

/** pre-parse any match statements */
const parseMatch = function (str) {
const world = this.world()
return world.methods.one.parseMatch(str)
}
export default {
parseMatch
/** pre-parse any match statements */
parseMatch: function (str, opts) {
const world = this.world()
return world.methods.one.parseMatch(str, opts)
}
}

@@ -30,20 +30,13 @@ import fuzzy from './_fuzzy.js'

}
// support ~ match
if (reg.soft === true && reg.word === term.root) {
return true
}
// support fuzzy match param
if (reg.fuzzy !== undefined) {
// support ~ fuzzy match
if (reg.fuzzy === true) {
if (reg.word === term.root) {
return true
}
let score = fuzzy(reg.word, term.normal)
if (score > reg.fuzzy) {
if (score >= reg.min) {
return true
}
// support fuzzy + soft match
if (reg.soft === true) {
score = fuzzy(reg.word, term.root)
if (score > reg.fuzzy) {
return true
}
}
}
// match slashes and things
if (term.alias && term.alias.some(str => str === reg.word)) {

@@ -87,3 +80,3 @@ return true

if (reg.machine !== undefined) {
return term.normal === reg.machine || term.machine === reg.machine
return term.normal === reg.machine || term.machine === reg.machine || term.root === reg.machine
}

@@ -90,0 +83,0 @@ //support {word/sense}

@@ -82,4 +82,5 @@ import failFast from './01-failFast.js'

results.ptrs.forEach(ptr => {
let [n, start] = ptr
ptr.push(docs[n][start].id)
let [n, start, end] = ptr
ptr[3] = docs[n][start].id//start-id
ptr[4] = docs[n][end - 1].id//end-id
})

@@ -86,0 +87,0 @@ return results

// match 'foo /yes/' and not 'foo/no/bar'
const bySlashes = /(?:^|\s)([![^]*(?:<[^<]*>)?\/.*?[^\\/]\/[?\]+*$~]*)(?:\s|$)/
// match '(yes) but not foo(no)bar'
const byParentheses = /([![^]*(?:<[^<]*>)?\([^)]+[^\\)]\)[?\]+*$~]*)(?:\s|$)/
const byParentheses = /([!~[^]*(?:<[^<]*>)?\([^)]+[^\\)]\)[?\]+*$~]*)(?:\s|$)/
// okay

@@ -6,0 +6,0 @@ const byWord = / /g

@@ -42,3 +42,3 @@ const hasMinMax = /\{([0-9]+)(, *[0-9]*)?\}/

//
const parseToken = function (w) {
const parseToken = function (w, opts) {
let obj = {}

@@ -95,2 +95,13 @@ //collect any flags (do it twice)

}
//soft-match
if (start(w) === '~' && end(w) === '~' && w.length > 2) {
w = stripBoth(w)
obj.fuzzy = true
obj.min = opts.fuzzy || 0.85
if (/\(/.test(w) === false) {
obj.word = w
return obj
}
}
//wrapped-flags

@@ -115,3 +126,3 @@ if (start(w) === '(' && end(w) === ')') {

obj.choices = obj.choices.map(str => {
return str.split(/ /g).map(parseToken)
return str.split(/ /g).map(s => parseToken(s, opts))
})

@@ -126,9 +137,3 @@ w = ''

}
//soft-match
if (start(w) === '~' && end(w) === '~') {
w = stripBoth(w)
obj.soft = true
obj.word = w
return obj
}
//machine/sense overloaded

@@ -135,0 +140,0 @@ if (start(w) === '{' && end(w) === '}') {

@@ -33,2 +33,5 @@ // name any [unnamed] capture-groups with a number

}
if (token.fuzzy === true) {
return token
}
// are they all straight-up words? then optimize them.

@@ -40,2 +43,6 @@ let shouldPack = token.choices.every(block => {

let reg = block[0]
// ~fuzzy~ words need more care
if (reg.fuzzy === true) {
return false
}
// ^ and $ get lost in fastOr

@@ -62,11 +69,27 @@ if (reg.start || reg.end) {

const postProcess = function (regs, opts = {}) {
// support ~(a|b|c)~
const fuzzyOr = function (regs) {
return regs.map(reg => {
if (reg.fuzzy && reg.choices) {
// pass fuzzy-data to each OR choice
reg.choices.forEach(r => {
if (r.length === 1 && r[0].word) {
r[0].fuzzy = true
r[0].min = reg.min
}
})
}
return reg
})
}
const postProcess = function (regs) {
// ensure all capture groups names are filled between start and end
regs = nameGroups(regs)
// convert 'choices' format to 'fastOr' format
if (!opts.fuzzy) {
regs = doFastOrMode(regs)
}
regs = doFastOrMode(regs)
// support ~(foo|bar)~
regs = fuzzyOr(regs)
return regs
}
export default postProcess
import parseBlocks from './01-parseBlocks.js'
import parseToken from './02-parseToken.js'
import postProcess from './03-postProcess.js'
// add fuzziness etc to each reg
const addOptions = function (tokens, opts) {
// add default fuzzy-search limit
if (opts.fuzzy === true) {
opts.fuzzy = 0.85
}
if (typeof opts.fuzzy === 'number') {
tokens = tokens.map(reg => {
// add a fuzzy-match on 'word' tokens
if (opts.fuzzy > 0 && reg.word) {
reg.fuzzy = opts.fuzzy
}
//add it to or|and choices too
if (reg.choices) {
reg.choices.forEach(block => {
block.forEach(r => {
r.fuzzy = opts.fuzzy
})
})
}
return reg
})
}
return tokens
}
/** parse a match-syntax string into json */

@@ -43,4 +19,2 @@ const syntax = function (input, opts = {}) {

tokens = postProcess(tokens, opts)
// add fuzzy limits, etc
tokens = addOptions(tokens, opts)
// console.log(tokens)

@@ -47,0 +21,0 @@ return tokens

@@ -5,3 +5,3 @@ const trimEnd = /[,:;)\]*.?~!\u0022\uFF02\u201D\u2019\u00BB\u203A\u2032\u2033\u2034\u301E\u00B4—-]+$/

const punctToKill = /[,:;)('"\u201D]/
const punctToKill = /[,:;)('"\u201D\]]/
const isHyphen = /^[-–—]$/

@@ -22,2 +22,8 @@ const hasSpace = / /

post = post.replace(punctToKill, '')
// cleanup exclamations
post = post.replace(/\?!+/, '?')
post = post.replace(/!+/, '!')
post = post.replace(/\?+/, '?')
// kill elipses
post = post.replace(/\.{2,}/, '')
}

@@ -24,0 +30,0 @@ if (opts.whitespace === 'some') {

@@ -0,1 +1,2 @@

/* eslint-disable no-console */
const logClientSide = function (view) {

@@ -2,0 +3,0 @@ console.log('%c -=-=- ', 'background-color:#6699cc;')

@@ -33,5 +33,3 @@ /* eslint-disable no-console */

}
if (typeof module !== undefined) {
text = cli.yellow(text)
}
text = cli.yellow(text)
let word = "'" + text + "'"

@@ -38,0 +36,0 @@ word = word.padEnd(18)

@@ -1,18 +0,58 @@

const trailSpace = /\s+$/
const isClass = /^\../
const isId = /^#./
const toText = function (term) {
let pre = term.pre || ''
let post = term.post || ''
return pre + term.text + post
const escapeXml = (str) => {
str = str.replace(/&/g, '&amp;')
str = str.replace(/</g, '&lt;')
str = str.replace(/>/g, '&gt;')
str = str.replace(/"/g, '&quot;')
str = str.replace(/'/g, '&apos;');
return str
}
const html = function (obj) {
// index ids to highlight
// interpret .class, #id, tagName
const toTag = function (k) {
let start = ''
let end = '</span>'
k = escapeXml(k)
if (isClass.test(k)) {
start = `<span class="${k.replace(/^\./, '')}"`
} else if (isId.test(k)) {
start = `<span id="${k.replace(/^#/, '')}"`
} else {
start = `<${k}`
end = `</${k}>`
}
start += '>'
return { start, end }
}
const getIndex = function (doc, obj) {
let starts = {}
let ends = {}
Object.keys(obj).forEach(k => {
let ptrs = obj[k].fullPointer
ptrs.forEach(a => {
starts[a[3]] = { tag: k, end: a[2] }
let res = obj[k]
let tag = toTag(k)
if (typeof res === 'string') {
res = doc.match(res)
}
res.docs.forEach(terms => {
// don't highlight implicit terms
if (terms.every(t => t.implicit)) {
return
}
let a = terms[0].id
starts[a] = starts[a] || []
starts[a].push(tag.start)
let b = terms[terms.length - 1].id
ends[b] = ends[b] || []
ends[b].push(tag.end)
})
})
return { starts, ends }
}
const html = function (obj) {
// index ids to highlight
let { starts, ends } = getIndex(this, obj)
// create the text output

@@ -25,18 +65,9 @@ let out = ''

if (starts.hasOwnProperty(t.id)) {
let { tag, end } = starts[t.id]
out += `<span class="${tag}">`
for (let k = i; k < end; k += 1) {
out += toText(terms[k])
}
// move trailing whitespace after tag
let after = ''
out = out.replace(trailSpace, (a, b) => {
after = a
return ''
})
out += `</span>${after}`
i = end - 1
} else {
out += toText(t)
out += starts[t.id].join('')
}
out += t.pre || '' + t.text || ''
if (ends.hasOwnProperty(t.id)) {
out += ends[t.id].join('')
}
out += t.post || ''
}

@@ -43,0 +74,0 @@ })

@@ -0,9 +1,7 @@

import html from './html.js'
import json from './json.js'
import out from './out.js'
import text from './text.js'
import json from './json.js'
import html from './html.js'
const methods = Object.assign({}, out, text, json, html)
// aliases
methods.data = methods.json

@@ -10,0 +8,0 @@ const addAPI = function (View) {

@@ -48,10 +48,10 @@ import { textFromTerms } from './_text.js'

const toJSON = function (view, opts) {
opts = opts || {}
if (typeof opts === 'string') {
opts = {}
const toJSON = function (view, option) {
option = option || {}
if (typeof option === 'string') {
option = {}
}
opts = Object.assign({}, defaults, opts)
option = Object.assign({}, defaults, option)
// run any necessary upfront steps
if (opts.offset) {
if (option.offset) {
view.compute('offset')

@@ -61,4 +61,4 @@ }

let res = {}
Object.keys(opts).forEach(k => {
if (opts[k] && fns[k]) {
Object.keys(option).forEach(k => {
if (option[k] && fns[k]) {
res[k] = fns[k](terms, view, i)

@@ -72,3 +72,3 @@ }

export default {
const methods = {
/** return data */

@@ -82,2 +82,4 @@ json: function (n) {

},
}
}
methods.data = methods.json
export default methods
import debug from './debug/index.js'
import wrap from './wrap.js'
const isObject = val => {
return Object.prototype.toString.call(val) === '[object Object]'
}
// sort by frequency
const topk = function (arr) {
let obj = {}
arr.forEach(a => {
obj[a] = obj[a] || 0
obj[a] += 1
})
let res = Object.keys(obj).map(k => {
return { normal: k, count: obj[k] }
})
return res.sort((a, b) => (a.count > b.count ? -1 : 0))
}
/** some named output formats */
const out = function (method) {
// support custom outputs
if (isObject(method)) {
return wrap(this, method)
}
// text out formats

@@ -36,4 +59,3 @@ if (method === 'text') {

if (method === 'freq' || method === 'frequency' || method === 'topk') {
let terms = this.compute('freq').terms().unique().termList()
return terms.sort((a, b) => (a.freq > b.freq ? -1 : 0))
return topk(this.json({ normal: true }).map(o => o.normal))
}

@@ -60,3 +82,3 @@

if (method === 'debug') {
return this.debug()
return this.debug() //allow
}

@@ -63,0 +85,0 @@ return this.text()

@@ -17,6 +17,2 @@ import { textFromDoc } from './_text.js'

opts = Object.assign({}, fmts[fmt])
// silently trigger a root?
// if (fmt === 'root' && this.document[0][0] && !this.document[0][0].root) {
// this.compute('root')
// }
} else if (fmt && isObject(fmt)) {

@@ -23,0 +19,0 @@ opts = Object.assign({}, fmt, opts)//todo: fixme

@@ -0,1 +1,4 @@

import getUnion from './lib/union.js'
import getDifference from './lib/difference.js'
import getIntersection from './lib/intersection.js'

@@ -10,4 +13,4 @@ const getDoc = (m, view) => {

let [n, start] = ptr
if (docs[n][start]) {
ptr.push(docs[n][start].id)
if (docs[n] && docs[n][start]) {
ptr[3] = docs[n][start].id
}

@@ -22,3 +25,2 @@ return ptr

methods.union = function (m) {
const { getUnion } = this.methods.one
m = getDoc(m, this)

@@ -33,3 +35,2 @@ let ptrs = getUnion(this.fullPointer, m.fullPointer)

methods.intersection = function (m) {
const { getIntersection } = this.methods.one
m = getDoc(m, this)

@@ -42,4 +43,3 @@ let ptrs = getIntersection(this.fullPointer, m.fullPointer)

// only parts of a that b does not have
methods.difference = function (m) {
const { getDifference } = this.methods.one
methods.not = function (m) {
m = getDoc(m, this)

@@ -50,7 +50,6 @@ let ptrs = getDifference(this.fullPointer, m.fullPointer)

}
methods.not = methods.difference
methods.difference = methods.not
// get opposite of a
methods.complement = function () {
const { getDifference } = this.methods.one
let doc = this.all()

@@ -64,3 +63,2 @@ let ptrs = getDifference(doc.fullPointer, this.fullPointer)

methods.settle = function () {
const { getUnion } = this.methods.one
let ptrs = this.fullPointer

@@ -67,0 +65,0 @@ ptrs.forEach(ptr => {

const max = 4
// sweep-around looking for our term uuid
// sweep-around looking for our start term uuid
const blindSweep = function (id, doc, n) {

@@ -24,2 +24,17 @@ for (let i = 0; i < max; i += 1) {

const repairEnding = function (ptr, document) {
let [n, start, , , endId] = ptr
let terms = document[n]
// look for end-id
let newEnd = terms.findIndex(t => t.id === endId)
if (newEnd === -1) {
// if end-term wasn't found, so go all the way to the end
ptr[2] = document[n].length
ptr[4] = terms.length ? terms[terms.length - 1].id : null
} else {
ptr[2] = newEnd // repair ending pointer
}
return document[n].slice(start, ptr[2] + 1)
}
/** return a subset of the document, from a pointer */

@@ -32,3 +47,3 @@ const getDoc = function (ptrs, document) {

}
let [n, start, end, id] = ptr //parsePointer(ptr)
let [n, start, end, id, endId] = ptr //parsePointer(ptr)
let terms = document[n] || []

@@ -48,3 +63,4 @@ if (start === undefined) {

// actually change the pointer
ptrs[i] = [wild[0], wild[1], wild[1] + len, terms[0].id]
let startId = terms[0] ? terms[0].id : null
ptrs[i] = [wild[0], wild[1], wild[1] + len, startId]
}

@@ -60,2 +76,6 @@ } else {

}
// test end-id, if it exists
if (endId && terms[terms.length - 1].id !== endId) {
terms = repairEnding(ptr, document)
}
// otherwise, looks good!

@@ -62,0 +82,0 @@ doc.push(terms)

@@ -1,6 +0,3 @@

import { indexN, doesOverlap } from './lib/_lib.js'
import getDifference from './lib/difference.js'
import getIntersection from './lib/intersection.js'
import getUnion from './lib/union.js'
import splitAll from './lib/split.js'
import { indexN } from '../api/lib/_lib.js'
import splitAll from '../api/lib/split.js'
import getDoc from './getDoc.js'

@@ -23,9 +20,7 @@

getDoc,
getUnion,
getIntersection,
getDifference,
indexN,
doesOverlap,
splitAll,
pointer: {
indexN,
splitAll,
}
},
}
import methods from './methods/index.js'
import api from './api/index.js'
export default {

@@ -4,0 +5,0 @@ methods,

@@ -5,5 +5,4 @@ // wire-up more pos-tags to our model

const tagSet = model.one.tagSet
const addTags = methods.one.addTags
let res = addTags(tags, tagSet)
const fn = methods.one.addTags
let res = fn(tags, tagSet)
model.one.tagSet = res

@@ -10,0 +9,0 @@ return this

import methods from './methods/index.js'
import api from './api/index.js'
import lib from './lib.js'
import tagRank from './compute/tagRank.js'
export default {

@@ -9,2 +11,5 @@ model: {

},
compute: {
tagRank
},
methods,

@@ -11,0 +16,0 @@ api,

@@ -9,9 +9,2 @@ /** some basic operations on a string to reduce noise */

str = str.replace(/[,;.!?]+$/, '')
// coerce single curly quotes
// str = str.replace(/[\u0027\u0060\u00B4\u2018\u2019\u201A\u201B\u2032\u2035\u2039\u203A]+/g, "'")
// // coerce double curly quotes
// str = str.replace(
// /[\u0022\u00AB\u00BB\u201C\u201D\u201E\u201F\u2033\u2034\u2036\u2037\u2E42\u301D\u301E\u301F\uFF02]+/g,
// '"'
// )
//coerce Unicode ellipses

@@ -18,0 +11,0 @@ str = str.replace(/\u2026/g, '...')

import cleanup from './01-cleanup.js'
import doUnicode from './02-unicode.js'
import doAcronyms from './03-acronyms.js'
// import doUnicode from './02-unicode.js'
import doAcronyms from './02-acronyms.js'
const normalize = function (term, world) {
const killUnicode = world.methods.one.killUnicode
// console.log(world.methods.one)
let str = term.text || ''
str = cleanup(str)
//(very) rough ASCII transliteration - bjŏrk -> bjork
str = doUnicode(str, world)
str = killUnicode(str, world)
str = doAcronyms(str)

@@ -11,0 +13,0 @@ term.normal = str

@@ -5,26 +5,22 @@ import sentence from './01-sentences/index.js'

import normalize from '../compute/normal/index.js'
import killUnicode from './unicode.js'
// turn a string input into a 'document' json format
const tokenize = function (input, world) {
const fromString = function (input, world) {
const { methods, model } = world
const { splitSentences, splitTerms, splitWhitespace } = methods.one
const { splitSentences, splitTerms, splitWhitespace } = methods.one.tokenize
input = input || ''
if (typeof input === 'number') {
input = String(input)
}
if (typeof input === 'string') {
// split into sentences
let sentences = splitSentences(input, model)
// split into word objects
input = sentences.map((txt, n) => {
let terms = splitTerms(txt, model)
// split into [pre-text-post]
terms = terms.map(splitWhitespace)
// add normalized term format, always
terms.forEach((term, i) => {
normalize(term, world)
})
return terms
// split into sentences
let sentences = splitSentences(input, model)
// split into word objects
input = sentences.map((txt) => {
let terms = splitTerms(txt, model)
// split into [pre-text-post]
terms = terms.map(splitWhitespace)
// add normalized term format, always
terms.forEach((t) => {
normalize(t, world)
})
}
return terms
})
return input

@@ -35,7 +31,10 @@ }

one: {
splitSentences: sentence,
splitTerms: term,
splitWhitespace: whitespace,
tokenize,
killUnicode,
tokenize: {
splitSentences: sentence,
splitTerms: term,
splitWhitespace: whitespace,
fromString,
},
},
}

@@ -16,3 +16,3 @@ import methods from './methods/index.js'

// Object.assign(model, _model)
// methods.one.tokenize = tokenize
// methods.one.tokenize.fromString = tokenize
// parsers.push('normal')

@@ -19,0 +19,0 @@ // parsers.push('alias')

@@ -5,3 +5,3 @@ // assume any discovered prefixes

if (docs.length === 0) {
return
return this
}

@@ -8,0 +8,0 @@ let lastPhrase = docs[docs.length - 1] || []

// lookup last word in the type-ahead prefixes
const compute = function (view) {
const typeahead = function (view) {
const prefixes = view.model.one.typeahead

@@ -18,2 +18,3 @@ const docs = view.docs

// add full-word as an implicit result
lastTerm.implicit = found
lastTerm.machine = found

@@ -28,2 +29,2 @@ lastTerm.typeahead = true

export default { typeahead: compute }
export default { typeahead }

@@ -33,4 +33,3 @@ import allPrefixes from './allPrefixes.js'

export default {
typeahead: prepare,
typeAhead: prepare,
typeahead: prepare
}

@@ -7,3 +7,3 @@ import compute from './compute.js'

one: {
typeahead: {}
typeahead: {} //set a blank key-val
}

@@ -10,0 +10,0 @@ }

@@ -25,6 +25,5 @@ import splice from './_splice.js'

if (isPossessive(terms, i)) {
world.methods.one.setTag([terms[i]], 'Possessive', world)
} else {
return apostropheS(terms, i)
return world.methods.one.setTag([terms[i]], 'Possessive', world, '2-contraction')
}
return apostropheS(terms, i)
},

@@ -38,3 +37,3 @@ }

//really easy ones
const contractions = (view) => {
const contractionTwo = (view) => {
let { world, document } = view

@@ -69,2 +68,2 @@ // each sentence

}
export default contractions
export default { contractionTwo }
const banList = {
that: true,
there: true,
}
const hereThere = {
let: true,
here: true,
there: true,
everywhere: true,
}
const beforePossessive = {
in: true,//in sunday's
by: true,//by sunday's
for: true,//for sunday's
}
const isPossessive = (terms, i) => {
let term = terms[i]
// these can't be possessive
if (hereThere.hasOwnProperty(term.machine)) {
if (banList.hasOwnProperty(term.machine || term.normal)) {
return false

@@ -25,5 +29,2 @@ }

}
if (banList.hasOwnProperty(term.normal)) {
return false
}
//if end of sentence, it is possessive - "was spencer's"

@@ -48,4 +49,5 @@ let nextTerm = terms[i + 1]

if (nextTerm.tags.has('Noun')) {
let nextStr = nextTerm.machine || nextTerm.normal
// 'spencer's here'
if (hereThere.hasOwnProperty(nextTerm.normal) === true) {
if (nextStr === 'here' || nextStr === 'there' || nextStr === 'everywhere') {
return false

@@ -55,2 +57,6 @@ }

}
// by sunday's final
if (terms[i - 1] && beforePossessive[terms[i - 1].normal] === true) {
return true
}
//rocket's red glare

@@ -57,0 +63,0 @@ let twoTerm = terms[i + 2]

import api from './api/index.js'
import apostropheS from './compute/index.js'
import compute from './compute/index.js'
export default { compute: { apostropheS }, api, hooks: ['apostropheS'] }
export default {
compute,
api,
hooks: ['contractionTwo']
}
// runs all match/tag patterns in model.two.matches

@@ -11,11 +10,4 @@ const postTagger = function (view) {

let found = methods.two.bulkMatch(document, byGroup, methods)
// console.log(found.length, 'found')
methods.two.bulkTagger(found, document, world)
// 2nd time?
// let subset = new Set(found.map(todo => todo.pointer[0]))
// subset = Array.from(subset).map(n => document[n])
// found = methods.two.bulkMatch(subset, byGroup, methods)
// methods.two.bulkTagger(found, subset, world)
// leave a nice cache for the next person?
// view.compute('cache')
view.uncache()

@@ -22,0 +14,0 @@ return document

import parse from './01-parse.js'
import expand from './02-expand.js'
import buildUp from './02-build-up.js'
import cache from './03-cache.js'

@@ -11,4 +11,4 @@ import group from './04-group.js'

// convert (a|b) to ['a', 'b']
matches = expand(matches)
matches = expand(matches) // run this twice
matches = buildUp(matches)
matches = buildUp(matches) // run this twice
// retrieve the needs of each match statement

@@ -15,0 +15,0 @@ matches = cache(matches, methods)

@@ -44,4 +44,4 @@ // order matters

// are welcome
{ match: '#Copula [#Expression]', group: 0, tag: 'Noun', reason: 'are-welcome' },
// { match: '#Copula [#Expression]', group: 0, tag: 'Noun', reason: 'are-welcome' },
]
export default matches

@@ -10,2 +10,4 @@ export default [

{ match: 'does (#Adverb|not)? [#Adjective]', group: 0, tag: 'PresentTense', reason: 'does-mean' },
// okay by me
{ match: '[(fine|okay|cool|ok)] by me', group: 0, tag: 'Adjective', reason: 'okay-by-me' },
// i mean

@@ -12,0 +14,0 @@ { match: 'i (#Adverb|do)? not? [mean]', group: 0, tag: 'PresentTense', reason: 'i-mean' },

@@ -14,3 +14,3 @@ const infNouns =

//the nice swim
{ match: '(the|this|those|these) #Adjective [#Verb]', group: 0, tag: 'Noun', ifNo: '#Copula', reason: 'the-adj-verb' },
{ match: '(the|this|those|these) #Adjective [%Verb|Noun%]', group: 0, tag: 'Noun', ifNo: '#Copula', reason: 'the-adj-verb' },
// the truly nice swim

@@ -56,2 +56,4 @@ { match: '(the|this|those|these) #Adverb #Adjective [#Verb]', group: 0, tag: 'Noun', reason: 'determiner4' },

{ match: '#Determiner [(shit|damn|hell)]', group: 0, tag: 'Noun', reason: 'swears-noun' },
// go to shit
{ match: 'to [(shit|hell)]', group: 0, tag: 'Noun', reason: 'to-swears' },
// the staff were

@@ -113,2 +115,14 @@ { match: '(the|these) [#Singular] (were|are)', group: 0, tag: 'Plural', reason: 'singular-were' },

{ match: '[#PresentTense] (of|by|for) (a|an|the) #Noun #Copula', group: 0, tag: 'Plural', reason: 'photographs-of' },
// soft music playing
// { match: '%Noun|Gerund%$', tag: 'Noun', reason: 'music-playing' },
// fight and win
{ match: '#Infinitive and [%Noun|Verb%]', group: 0, tag: 'Infinitive', reason: 'fight and win' },
// hopes and dreams
// { match: '#Noun and [%Plural|Verb%]', group: 0, tag: 'Plural', reason: 'hopes-and-dreams' },
// bride and groom
{ match: '#Noun and [%Noun|Verb%]', group: 0, tag: 'Singular', ifNo: ['#ProperNoun'], reason: 'bride-and-groom' },
// an impressionist painting
{ match: '#Determiner [%Adj|Noun%] #Noun', group: 0, tag: 'Adjective', ifNo: ['#ProperNoun'], reason: 'a-complex-relationship' },
// visit houses
{ match: '^[%Noun|Verb%] #Noun', group: 0, tag: 'Verb', reason: 'visit-boards' },
]

@@ -68,2 +68,4 @@ export default [

{ match: '[#ProperNoun] #Person', group: 0, tag: 'Person', reason: 'proper-person', safe: true },
//Cliff Clavin
{ match: '%Person|Noun% #ProperNoun', tag: 'Person', reason: 'switch-person', safe: true },
// john keith jones

@@ -70,0 +72,0 @@ {

@@ -60,2 +60,8 @@ // these are some of our heaviest-used matches

},
// tell me
{ match: '#Imperative [(me|him|her)]', group: 0, tag: 'Reflexive', reason: 'tell-him' },
// walk yourself
// { match: '#Imperative [#Reflexive]', group: 0, tag: 'Auxiliary', reason: 'tell-him' },
// there is no x
{ match: '(is|was) #Adverb? [no]', group: 0, tag: 'Negative', reason: 'is-no' },
]
// this is really hard to do
const notIf = ['i', 'we', 'they'] //we do not go
export default [
// do not go

@@ -9,2 +8,4 @@ { match: '^do not? [#Infinitive #Particle?]', notIf, group: 0, tag: 'Imperative', reason: 'do-eat' },

{ match: '^please do? not? [#Infinitive #Particle?]', group: 0, tag: 'Imperative', reason: 'please-go' },
// just go
{ match: '^just do? not? [#Infinitive #Particle?]', group: 0, tag: 'Imperative', reason: 'just-go' },
// do it better

@@ -16,3 +17,4 @@ { match: '^[#Infinitive] it #Comparative', notIf, group: 0, tag: 'Imperative', reason: 'do-it-better' },

// { match: '^[#Infinitive]$', group: 0, tag: 'Imperative', reason: 'go' },
{ match: '^[#Infinitive] (#Adjective|#Adverb)$', group: 0, tag: 'Imperative', reason: 'go' },
// go quickly.
{ match: '^[#Infinitive] (#Adjective|#Adverb)$', group: 0, tag: 'Imperative', ifNo: ['so', 'such', 'rather', 'enough'], reason: 'go-quickly' },
// turn down the noise

@@ -22,2 +24,26 @@ { match: '^[#Infinitive] (up|down|over) #Determiner', group: 0, tag: 'Imperative', reason: 'turn-down' },

{ match: '^[#Infinitive] (your|my|the|some|a|an)', group: 0, tag: 'Imperative', reason: 'eat-my-shorts' },
// tell him the story
{ match: '^[#Infinitive] (him|her|it|us|me)', group: 0, tag: 'Imperative', reason: 'tell-him' },
// one-word imperatives
{ match: '^(go|stop|wait|hurry) please?$', tag: 'Imperative', reason: 'go' },
// somebody call
{ match: '^(somebody|everybody) [#Infinitive]', group: 0, tag: 'Imperative', reason: 'somebody-call' },
// let's leave
{ match: '^let (us|me) [#Infinitive]', group: 0, tag: 'Imperative', reason: 'lets-leave' },
// shut the door
{ match: '^[(shut|close|open|start|stop|end|keep)] #Determiner #Noun', group: 0, tag: 'Imperative', reason: 'shut-the-door' },
// go to toronto
{ match: '^[go] to .', group: 0, tag: 'Imperative', reason: 'go-to-toronto' },
// never say
{ match: '^never [#Infinitive]', group: 0, tag: 'Imperative', reason: 'never-stop' },
// stay away
{ match: '^stay (out|away|back)', tag: 'Imperative', reason: 'stay-away' },
// stay cool
{ match: '^[stay] #Adjective', tag: 'Imperative', reason: 'stay-cool' },
// keep it silent
{ match: '^[keep it] #Adjective', group: 0, tag: 'Imperative', reason: 'keep-it-cool' },
// don't be late
{ match: '^do not [#Infinitive]', group: 0, tag: 'Imperative', reason: 'do-not-be' },
// allow yourself
{ match: '[#Infinitive] (yourself|yourselves)', group: 0, tag: 'Imperative', reason: 'allow-yourself' },
]

@@ -64,2 +64,6 @@ export default [

{ match: `[(look|looks)] #Adjective`, group: 0, tag: 'PresentTense', reason: 'looks-good' },
// needs to learn
{ match: `[(need|needs)] to #Infinitive`, group: 0, tag: 'PresentTense', reason: 'need-to-learn' },
// stops thinking
{ match: `[(start|starts|stop|stops|begin|begins)] #Gerund`, group: 0, tag: 'Verb', reason: 'starts-thinking' },
//were under cooked

@@ -77,2 +81,7 @@ {

{ match: '[fuck] (#Determiner|#Possessive|them)', group: 0, tag: 'Verb', reason: 'swear3-verb' },
// jobs that fit
{ match: '#Plural that %Noun|Verb%', tag: '. #Preposition #Infinitive', reason: 'jobs-that-work' },
// works for me
{ match: '[works] for me', group: 0, tag: '#PresentTense', reason: 'works-for-me' },
]

@@ -1,2 +0,1 @@

import tagRank from './tagRank.js'
import preTagger from './tagger/index.js'

@@ -6,2 +5,2 @@ import root from './root.js'

export default { preTagger, tagRank, root, penn }
export default { preTagger, root, penn }
const toRoot = {
// 'spencer's' -> 'spencer'
'Possessive': (term, world) => {
'Possessive': (term) => {
let str = term.machine || term.normal || term.text

@@ -38,2 +38,8 @@ str = str.replace(/'s$/, '')

},
// 'suddenly' -> 'sudden'
'Adverb': (term, world) => {
const toAdj = world.methods.two.transform.advToAdjective
let str = term.machine || term.normal || term.text
return toAdj(str)
},
}

@@ -40,0 +46,0 @@

@@ -0,7 +1,18 @@

const prefix = /^(under|over|mis|re|un|dis|semi)-?/
const tagSwitch = function (terms, i, model) {
const switches = model.two.switches
if (switches.hasOwnProperty(terms[i].normal)) {
terms[i].switch = switches[terms[i].normal]
let term = terms[i]
if (switches.hasOwnProperty(term.normal)) {
term.switch = switches[term.normal]
return
}
// support 'restrike' -> 'strike'
if (prefix.test(term.normal)) {
let stem = term.normal.replace(prefix, '')
if (stem.length > 3 && switches.hasOwnProperty(stem)) {
term.switch = switches[stem]
}
}
}
export default tagSwitch

@@ -50,3 +50,5 @@ import fastTag from '../_fastTag.js'

}
return null
}
export default tagYear

@@ -6,2 +6,3 @@

}
return null
}

@@ -12,34 +13,2 @@ const isAloneVerb = (terms, i) => {

}
}
// "food and programs" vs "writes and programs"
const isList = function (terms, i, vb) {
// "x and ___"
if (terms[i - 1] && terms[i - 2] && !terms[i - 2].switch) {
let str = terms[i - 1].normal
if (str === 'and' || str === 'or') {
// 'Noun and ___'
if (terms[i - 2].tags.has('Noun')) {
return 'Noun'
}
// 'writes and ___'
if (terms[i - 2].tags.has(vb)) {
return vb
}
}
}
// "___ and programs"
if (terms[i + 1] && terms[i + 2] && !terms[i + 2].switch) {
let str = terms[i + 1].normal
if (str === 'and' || str === 'or') {
// 'Noun and ___'
if (terms[i + 2].tags.has('Noun')) {
return 'Noun'
}
// 'writes and ___'
if (terms[i + 2].tags.has(vb)) {
return vb
}
}
}
return null

@@ -65,6 +34,6 @@ }

'Noun|Verb': (terms, i) => {
return isList(terms, i, 'Infinitive') || isCapital(terms, i) || isAloneVerb(terms, i)
return isCapital(terms, i) || isAloneVerb(terms, i)
},
'Plural|Verb': (terms, i) => {
return isList(terms, i, 'PresentTense') || isCapital(terms, i) || isAloneVerb(terms, i)
return isCapital(terms, i) || isAloneVerb(terms, i)
},

@@ -74,6 +43,6 @@ 'Person|Noun': (terms, i) => {

},
// 'Person|Verb': (terms, i) => {
// return isCapital(terms, i)
// },
'Person|Verb': (terms, i) => {
return i !== 0 && isCapital(terms, i)
},
}
export default adhoc

@@ -0,1 +1,3 @@

import fastTag from '../_fastTag.js'
const isTitleCase = function (str) {

@@ -22,8 +24,9 @@ return /^[A-Z][a-z'\u00C0-\u00FF]/.test(str)

let term = terms[i]
if (orgWords[term.normal] === true && isOrg(terms[i - 1])) {
terms[i].tags.add('Organization')
let str = term.machine || term.normal
if (orgWords[str] === true && isOrg(terms[i - 1])) {
fastTag(terms[i], 'Organization', '3-[org-word]')
// loop backwards, tag organization-like things
for (let t = terms.length - 1; t >= 0; t -= 1) {
for (let t = i; t >= 0; t -= 1) {
if (isOrg(terms[t])) {
terms[t].tags.add('Organization')
fastTag(terms[t], 'Organization', '3-[org-word]')
} else {

@@ -30,0 +33,0 @@ break

@@ -0,1 +1,3 @@

import fastTag from '../_fastTag.js'
// 'out lived' is a verb-phrase

@@ -16,11 +18,9 @@ // 'over booked' is too

if (nextTerm.tags.has('Verb')) {
term.tags.clear()
term.tags.add('Verb')
term.tags.add('Prefix')
fastTag(term, 'Verb', '3-[prefix]')
fastTag(term, 'Prefix', '3-[prefix]')
}
// 'pseudo clean'
if (nextTerm.tags.has('Adjective')) {
term.tags.clear()
term.tags.add('Adjective')
term.tags.add('Prefix')
fastTag(term, 'Adjective', '3-[prefix]')
fastTag(term, 'Prefix', '3-[prefix]')
}

@@ -27,0 +27,0 @@ }

@@ -1,5 +0,4 @@

import fastTag from '../_fastTag.js'
const env = typeof process === 'undefined' ? self.env || {} : process.env // eslint-disable-line
import adhoc from './_adhoc.js'
const prefix = /^(under|over|mis|re|un|dis)-?/
const prefix = /^(under|over|mis|re|un|dis|semi)-?/

@@ -13,3 +12,3 @@ const checkWord = (term, obj) => {

if (found && env.DEBUG_TAGS) {
console.log(`\n \x1b[2m\x1b[3m ↓ - '${str}' \x1b[0m`)
console.log(`\n \x1b[2m\x1b[3m ↓ - '${str}' \x1b[0m`)//eslint-disable-line
}

@@ -31,3 +30,3 @@ return found

if (found && env.DEBUG_TAGS) {
console.log(`\n \x1b[2m\x1b[3m ↓ - '${term.normal}' (#${found}) \x1b[0m`)
console.log(`\n \x1b[2m\x1b[3m ↓ - '${term.normal}' (#${found}) \x1b[0m`)//eslint-disable-line
}

@@ -40,3 +39,3 @@ found = obj[found]

if (!clues) {
return
return null
}

@@ -56,18 +55,9 @@ const tagSet = model.one.tagSet

const setTag = function (term, tag, model) {
if (!term.tags.has(tag)) {
term.tags.clear()
fastTag(term, tag, `3-[variable]`)
if (model.one.tagSet[tag]) {
let parents = model.one.tagSet[tag].parents
fastTag(term, parents, ` -inferred by #${tag}`)
}
}
}
// words like 'bob' that can change between two tags
const doSwitches = function (terms, i, model) {
const doSwitches = function (terms, i, world) {
const model = world.model
const setTag = world.methods.one.setTag
const { switches, clues } = model.two
const term = terms[i]
let str = term.normal || term.implicit
let str = term.normal || term.implicit || ''
// support prefixes for switching words

@@ -79,4 +69,2 @@ if (prefix.test(str) && !switches[str]) {

let form = term.switch
// console.log(`\n'${term.normal}' : ${form}`)
// console.log(clues[form])
// skip propernouns, acronyms, etc

@@ -94,7 +82,8 @@ if (term.tags.has('Acronym') || term.tags.has('PhrasalVerb')) {

if (env.DEBUG_TAGS) {
console.log(`\n \x1b[32m [variable] - '${str}' - (${form}) → #${tag} \x1b[0m\n`)
console.log(`\n \x1b[32m [variable] - '${str}' - (${form}) → #${tag} \x1b[0m\n`)//eslint-disable-line
}
setTag(term, tag, model)
// setTag(term, tag, model)
setTag([term], tag, world, null, `3-[variable]`)
} else if (env.DEBUG_TAGS) {
console.log(`\n -> X - '${str}' : ${form} `)
console.log(`\n -> X - '${str}' : ${form} `)//eslint-disable-line
}

@@ -101,0 +90,0 @@ }

@@ -26,2 +26,9 @@ //similar to plural/singularize rules, but not the same

}
// plural words as exceptions to suffix-rules
const exceptions = new Set([
'formulas',
'koalas',
'israelis',
'menus',
])

@@ -45,3 +52,2 @@ const notPlural = [

'aus',
'bus',
'cus',

@@ -69,2 +75,6 @@ 'eus',//nucleus

}
// 'menus' etc
if (exceptions.has(str)) {
return true
}
let end = str[str.length - 1]

@@ -79,3 +89,3 @@ // look at 'firemen'

// look for 'virus'
if (notPlural.find(end => str.endsWith(end))) {
if (notPlural.find(suff => str.endsWith(suff))) {
return false

@@ -82,0 +92,0 @@ }

@@ -54,3 +54,3 @@

const thirdPass = function (terms, model) {
const thirdPass = function (terms, model, world) {
for (let i = 0; i < terms.length; i += 1) {

@@ -72,3 +72,3 @@ // let these tags get layered

// verb-noun disambiguation, etc
third.variables(terms, i, model)
third.variables(terms, i, world)
}

@@ -78,3 +78,3 @@ }

const preTagger = function (view) {
const { methods, model } = view
const { methods, model, world } = view
// assign known-words

@@ -91,3 +91,3 @@ // view.compute('lexicon')

// guess by the neighbours
thirdPass(terms, model)
thirdPass(terms, model, world)
}

@@ -94,0 +94,0 @@ // leave a nice cache for the next people

@@ -37,2 +37,3 @@ // transformations to make on our lexicon

PhrasalVerb: (word, lex, methods, model) => {
let already = model.one.lexicon
lex[word] = ['PhrasalVerb', 'Infinitive']

@@ -42,3 +43,5 @@ let _multi = model.one._multiCache

// add root verb
lex[inf] = lex[inf] || 'Infinitive'
if (!already[inf]) {
lex[inf] = lex[inf] || 'Infinitive'
}
// conjugate it

@@ -48,8 +51,8 @@ let all = methods.two.transform.verbConjugate(inf, model)

// not 'walker up', or 'had taken up'
if (a[0] === 'Actor' || a[0] === 'PerfectTense' || a[0] === 'Pluperfect' || a[1] === '') {
if (a[0] === 'Actor' || a[1] === '') {
return
}
// add the root verb, alone
if (lex[a[1]] === undefined) {
lex[a[1]] = lex[a[1]] || a[0]
if (!lex[a[1]] && !already[a[1]]) {
lex[a[1]] = a[0]
}

@@ -56,0 +59,0 @@ _multi[a[1]] = true

@@ -7,3 +7,7 @@ import nounToPlural from './nouns/toPlural/index.js'

import getTense from './verbs/getTense/index.js'
import advToAdjective from './adverbs/toAdjective.js'
import adjToAdverb from './adverbs/toAdverb.js'
import adjToNoun from './adverbs/toNoun.js'
import { adjToSuperlative, adjToComparative, adjFromSuperlative, adjFromComparative } from './adjectives/index.js'

@@ -16,3 +20,5 @@

adjToSuperlative, adjToComparative, adjFromSuperlative, adjFromComparative
adjToSuperlative, adjToComparative, adjFromSuperlative, adjFromComparative,
advToAdjective, adjToAdverb, adjToNoun
}

@@ -5,3 +5,3 @@ // import irregularVerbs from './conjugations.js'

const { irregularPlurals } = model.two
const { lexicon, } = model.one
const { lexicon } = model.one
Object.entries(irregularPlurals).forEach(a => {

@@ -8,0 +8,0 @@ lexicon[a[0]] = lexicon[a[0]] || 'Singular'

@@ -14,3 +14,3 @@

const expandModels = function (model) {
let { lexicon, } = model.one
let { lexicon } = model.one
const { toPast, toPresent, toGerund, toSuperlative, toComparative } = model.two.models

@@ -17,0 +17,0 @@ let res = {}

@@ -53,2 +53,7 @@ const n = 'Singular'

neither: n,//
// strong adjectives
favorite: n,//
best: n,//
daily: n,//
weekly: n,//
},

@@ -55,0 +60,0 @@ afterWords: {

@@ -43,2 +43,3 @@ const v = 'Infinitive'

it: v,
being: v,
},

@@ -59,5 +60,5 @@ afterWords: {

by: v,
in: v, //bob in
// in: v, //bob in
out: v,
on: v,
// on: v,
off: v,

@@ -64,0 +65,0 @@ when: v,//starts when

@@ -12,4 +12,12 @@ import adj from './_adj.js'

}),
afterTags: Object.assign({}, adj.afterTags, gerund.afterTags),
beforeWords: Object.assign({}, adj.beforeWords, gerund.beforeWords),
afterTags: Object.assign({}, adj.afterTags, gerund.afterTags, {
Singular: 'Adjective'//shocking ignorance
}),
beforeWords: Object.assign({}, adj.beforeWords, gerund.beforeWords, {
is: 'Adjective',
was: 'Adjective'
}),
afterWords: Object.assign({}, adj.afterWords, gerund.afterWords, {

@@ -16,0 +24,0 @@ to: 'Gerund',

@@ -29,2 +29,3 @@ import adj from './_adj.js'

been: 'PastTense',
it: 'PastTense',//it intoxicated him
as: 'PastTense',//as requested

@@ -31,0 +32,0 @@ for: 'Adjective',//for discounted items

@@ -14,3 +14,3 @@ import adj from './_adj.js'

// always clean
Adverb: undefined
Adverb: undefined, Negative: undefined
}),

@@ -20,3 +20,3 @@ afterTags: Object.assign({}, adj.afterTags, verb.afterTags, misc.afterTags),

// have seperate contracts
have: undefined, had: undefined,
have: undefined, had: undefined, not: undefined,
//went wrong, got wrong

@@ -23,0 +23,0 @@ went: 'Adjective', goes: 'Adjective', got: 'Adjective',

@@ -39,3 +39,4 @@ import adjGerund from './adj-gerund.js'

afterWords: copy(clues['Noun|Verb'].afterWords, {
his: 'PresentTense', her: 'PresentTense', its: 'PresentTense'
his: 'PresentTense', her: 'PresentTense', its: 'PresentTense',
in: null, to: null,
}),

@@ -42,0 +43,0 @@ beforeTags: copy(clues['Noun|Verb'].beforeTags, {

@@ -24,2 +24,8 @@ import noun from './_noun.js'

instead: 'Infinitive',
// that: 'Singular',//subject that was
// for: 'Infinitive',//work for
about: 'Infinitive',//talk about
to: null,
by: null,
in: null
}),

@@ -26,0 +32,0 @@ }

@@ -13,3 +13,2 @@ import irregularPlurals from './irregulars/plurals.js'

import orgWords from './orgWords.js'
import expandLexicon from './_expand/index.js'

@@ -16,0 +15,0 @@

@@ -12,19 +12,23 @@ // generated in ./lib/lexicon

"QuestionWord": "true¦how3wh0;at,e1ich,o0y;!m,se;n,re; come,'s",
"Reflexive": "true¦h4my5o1the0your2;ir1m1;ne3ur0;sel0;f,ves;er0im0;self",
"Uncountable": "true¦0:2J;1:1M;2:1Z;a28b1Zc1Rd1Je1Bf15g0Yh0Ri0Lj0Kk0Jl0Fm05n03o02pWrRsGt8vi7w3;a5i4oo3;d,l;ldlife,ne;rm7t2;neg1Ool0Ktae;e9h8oothpas1Hr4un3yranny;a,gst1O;affZea14ou4ue nor3;th;ble3sers,t;!shoot1R;ermod25und2;a,nnis;aBcene0Geri1hAil9ki8o7p6t4u3weepstak1;g1Enshi0Z;ati24e3;am,el;ace1Xeci1;ap,cc2;n,ttl1;k,v2;eep,ingl1;d0Mfe1Ql3nd,t0A;m1Gt;a6e4ic3;e,ke0U;c3laxa0Rsearch;ogni0Qrea0Q;bi1in;aUe7hys0lastDo5re3;amble,mis1s3ten1F;en1Esu0B;l3rk;it0yC;a1Jtr05;bstetr0vercrowd12xyg0V;a3ews;il polVtional securi1B;aAe8o5u3;mps,s3;ic;n3o14;ey,o3;gamy;a3chan0rchandi11tallurgy;sl1t;chine3themat0; learn0Qry;aught2e5i4ogi17u3;ck,g0S;ce,ghtn0Nngui15teraR;ath2isuRss;indergart0Enowled0Q;azz,ewelCusti10;ce,gnor7mp4n3tself;formaYternet;a3ort5;ti3;en0V;an0U;a6eIisto5o3;ckey,mework,ne3rserad7spitali0N;s0My;ry;ir,libXppiGs3;h3te;ish;ene6l5o4r3um,ymna0O;aDeed;lf,re;utWyce0A; 3t0;edit01po3;ol;icFlour,o5urni3;tu3;re;od,rgive3uri2wl;ne3;ss;conom0duca9lectr8n6quip7th0very4xper3;ti00;body,o3thR;ne;joy3tertain3;ment;iciYon0;tiO;e8i4ope,raugh3ynasW;ts;abet1s3;honSrepu3;te;es;b3miN;ut;a9elci8h5iv0lass0o3urrency;al,ld w3nfusiEttEusco7;ar;aos,e4ick3;en;eGw8;us;d,rI;a8eef,i6lood,owls,read,u3;nt4tt2;er;ing;lliarDs3;on;g3ss;ga3;ge;cDdviCeroAir9m5ni4ppeal court,spi3thlet0;rin;se;en5n3;es3;ty;ds;craft;b0d3naut0;ynam0;ce;id,ou3;st0;ics",
"Plural": "true¦ones,records",
"Value": "true¦a few",
"Imperative": "true¦come here",
"PhrasalVerb": "true¦0:81;1:7Q;2:8E;3:84;4:7J;5:8H;6:7P;7:7E;8:7C;9:86;A:7Z;B:89;C:87;D:80;E:6L;F:6D;a8Kb73c66d61e60f4Yg4Gh3Viron0j3Rk3Ml33m2Pn2No2Lp22quietEr1Ns0GtWuUvacuum 1wJyammerAzG;ero Dip HonG;e0k0;by,up;aNeIhHiGor7Vrit37;mp0n34pe0r8s8;eel Dip 8P;aIiGn2S;gh Grd0;in,up;n Dr G;d2in,o4D;it 6Hk8lk Hrm 0Ysh Gt79v5F;aw3d2o5up;aw3in,o84;rgeAsG;e 1herF;aVeThRiNoMrIuGypL;ckFrn G;d2in,o45up;aHiGot0y 2O;ckleEp 8A;ckEdG;e 0N;neEp 2Zs4Z;ck IdHe Gghte5Yme0p o0Ire0;aw3ba4d2in,up;e 6Hy 1;by,oC;ink Grow 6U;ba4ov6up;aGe 6Fll5G;m 1r 53;ckAke Hlk G;ov6shit,u5H;aGba4d2in,o3Pup;ba4ft6p5Mw3;a0Lc0Ke0Eh0Ai07l03m02n01o00pVquar4XtMuKwG;earIiG;ngHtch G;aw3ba4o7O; by;ck Git 1m 1ss0;in,o7Bup;aMe10iLoJrHuG;c36d2O;aigh22iG;ke 6Wn3L;p Grm24;by,in,oC;n31r 1tc44;c30mp0nd Gr7Fve9y 1;ba4d2up;ar2YeJiIlHrGurA;ingAuc8;a3Rit 5R;l17n 1;e69ll0;ber 1rt0und like;ap 56ow D;ash 5Woke0;eep HiGow 7;c1Lp 1;in,oG;ff,v6;de12gn HngGt 5Rz8; al5Mle0;in,o5up;aIoGu5A;ot Gut0w 6U;aw3ba4f3SoC;c2GdeFk5Pve9;e Kll1Gnd Jrv8tG; Gtl4W;d2f5Bin,o5upG;!on;aw3ba4d2in,o2Nup;o6Dto;al5Iout0rap5I;il9v8;aTeQiPoLuG;b 5Ble0n Gstl8;aIba4d2inHoGt3Lu0X;ut,v6;!to;c2HrBw3;ll Iot HuG;g33nd9;a2Hf3Ao5;arBin,o5;ng 5Ip9;aGel9inFnt0;c5Rd G;o3Bup;c1Tt0;aUeTiRlPoNrKsyc2RuG;ll It G;aGba4d2in,o1Zt3Rup;p3Ww3;ap3Vd2in,o5t3Pup;attleAess HiJoG;p 1;ah1Zon;iGp 5Wr4CurEwer 5W;nt0;ay4SuG;gFmp 7;ck Gg0leAn 7p4P;o1Oup;el 4ZncilF;c4Hir 2Xn0ss ItHy G;ba4oC; d2c2E;aw3ba4in,o1J;pGw4C;e4Bt D;arrowEerd0oG;d9teE;aQeNiMoIuG;ddl8lG;l 3W;c12nkeyIp 7uth9ve G;aGd2in,o5up;l41w3; wi3Y;ss0x 1;asur8lHss G;a1Oup;t 7;ke Hn 7rGs1Xx0;k 7ry9;do,o4Vup;aWeRiMoGuck0;aKc3Ug JoGse0;k Gse3S;aft6ba4d2forw2Sin4Iov6uG;nd6p;in,o0V;d 7;e 04ghtJnIsHvG;e 3E;ten 4Y;e 1k 1; 1e3J;ave It HvelG; o4H;d2go,in,o5up;in,oG;pen,ut;c8p 1sh GtchAugh9y26;in43o5;eHick9nock G;d2o4Aup;eGyF;l 2Yp G;aw3ba4d2fYin,o0Dto,up;aIoHuG;ic8mpF;ke3BtE;c3Kzz 1;aVeQiNoKuG;nHrrGsh 7;y 1;kerEt G;arBd2;lGneFrse34;d Ge 1;ba4d2fast,o04up;de Ht G;ba4on,up;aw3o5;aGlp0;d Il 2Gr Gt 1;fGof;rom;in,oWu1K;cJm 1nHve Gz2B;it,to;d Gg 2MkerJ;d2in,o5;k 1;aUeOive Mloss 27oIrHunG; f0O;in3Now 2H; Gof 26;aHb1Fit,oGrBt0Qu1A;ff,n,v6;bo5ft6hMw3;aw3ba4d2in,oGrise,up,w3;ff,n,ut;ar 7ek0t G;aHb19d2in,oGrBup;ff,n,ut,v6;cHhGl23rBt,w3;ead;ross;d aHnG;g 1;bo5;a0Ae03iUlQoMrIuG;ck Ge28;arBup;eHighten GownAy 1;aw3oC;eGshe1U; 1z8;lIol G;aGwi1N;bo5rB;d 7low 1;aHeGip0;sh0;g 7ke0mGrGttenE;e 2Y;gNlLnJrHsGzzle0;h 2W;e Gm 1;aw3ba4up;d0isG;h 1;e Gl 1G;aw3fLin,o5;ht ba4ure0;eLnHsG;s 1;cId G;fGoC;or;e D;dYl 1;cKll Grm0t13;ap07bId2in,oHtG;hrough;ff,ut,v6;a4ehi27;e G;d2oCup;a0Ldge0nd 0Py8;oJrG;aHess 7op G;aw3bWin,o1U;gAwA; 0Iubl0Y;a00hXleaWoJrGut 16;ackAeep Goss D;by,d2in,oGup;n,ut;me JoHuntG; o1W;k 7l G;d2oC;aMbLforJin,oItHuG;nd6;ogeth6;n,ut,v6;th,wG;ard;a4y;pGrBw3;art;n 7;eGipF;ck Der G;on,up;lNncel0rKsItch HveF; in;o1Eup;h Dt G;doubt,oC;ry HvG;e 02;aw3o19;l HmE; d2;aGba4d2o16up;rBw3;a0Me0El07oYrLuG;bblIcklZil05lk 7ndlZrGst VtHy 16zz9;n 0AsG;t D;e G;ov6;anReaPiHush G;oCup;ghLng G;aIba4d2fGin,o5up;orG;th;bo5lGrBw3;ong;teG;n 1;k G;d2in,o5up;ch0;arNg 7iLn8oJssIttlHunce Gx D;aw3ba4;e 7; arB;k Dt 1;e 1;l 7;d2up;d 1;aLeed0oGurt0;cIw G;aw3ba4d2o5up;ck;k G;in,oX;ck0nk0st9; oLaJef 1nd G;d2ov6up;er;up;r0t G;d2in,oQup;ff,nG;to;ck Mil0nIrgHsG;h D;ainAe D;g DkA; on;in,o5; o5;aw3d2oGup;ff,ut;ay;cPdLsk Iuction9; oC;ff;arBo5;ouG;nd;d G;d2oGup;ff,n;own;t G;o5up;ut",
"Verb": "true¦born,cannot,gonna,has,keep tabs,m0;ake sure,sg",
"Demonym": "true¦0:15;1:12;a0Vb0Oc0Dd0Ce08f07g04h02iYjVkTlPmLnIomHpEqatari,rCs7t5u4v3welAz2;am0Gimbabwe0;enezuel0ietnam0I;gAkrai1;aiwTex0hai,rinida0Ju2;ni0Prkmen;a5cotti4e3ingapoOlovak,oma0Spaniard,udRw2y0W;ede,iss;negal0Cr09;sh;mo0uT;o5us0Jw2;and0;a2eru0Fhilippi0Nortugu07uerto r0S;kist3lesti1na2raguay0;ma1;ani;ami00i2orweP;caragu0geri2;an,en;a3ex0Lo2;ngo0Drocc0;cedo1la2;gasy,y07;a4eb9i2;b2thua1;e0Cy0;o,t01;azakh,eny0o2uwaiI;re0;a2orda1;ma0Ap2;anO;celandic,nd4r2sraeli,ta01vo05;a2iB;ni0qi;i0oneU;aiAin2ondur0unO;di;amEe2hanai0reek,uatemal0;or2rm0;gi0;ilipino,ren8;cuadoVgyp4mira3ngli2sto1thiopi0urope0;shm0;ti;ti0;aPominUut3;a9h6o4roat3ub0ze2;ch;!i0;lom2ngol5;bi0;a6i2;le0n2;ese;lifor1m2na3;bo2eroo1;di0;angladeshi,el6o4r3ul2;gaE;azi9it;li2s1;vi0;aru2gi0;si0;fAl7merBngol0r5si0us2;sie,tr2;a2i0;li0;genti2me1;ne;ba1ge2;ri0;ni0;gh0r2;ic0;an",
"Organization": "true¦0:4B;a3Eb2Wc2Dd25e21f1Wg1Oh1Ji1Gj1Ek1Cl17m0Vn0Io0Fp08qu07r00sTtGuBv8w3xiaomi,y1;amaha,m12ou1w12;gov,tu2X;a3e1orld trade organizati2Q;lls fargo,st1;fie27inghou2G;l1rner br3G;gree35l street journ28m16;an halOeriz2Lisa,o1;dafo2Ml1;kswagMvo;b4kip,n2ps,s1;a tod2Wps;es38i1;lev31ted natio2Y;er,s; mobi2Oaco bePd bMeAgi frida9h3im horto2Wmz,o1witt2Z;shiba,y1;ota,s r Z;e 1in lizzy;b3carpen35daily ma2Zguess w2holli0rolling st1Qs1w2;mashing pumpki2Ruprem0;ho;ea1lack eyed pe3Jyrds;ch bo1tl0;ys;l2n3Bs1xas instrumen1I;co,la m14;efoni0Bus;a6e4ieme2Jnp,o2pice gir5quare03ta1ubaru;rbucks,to2P;ny,undgard1;en;a2Tx pisto1;ls;few29insbury2PlesforYmsu21;.e.m.,adiohead,b6e3oyal 1yana2Z;b1dutch she4;ank;aders dige1Gd 1max,vl1Q;bu1c1Yhot chili peppe2Mlobst2B;ll;c,s;ant2Zizno2H;a5bs,e3fiz27hilip morrCi2r1;emier29udenti16;nk floyd,zza hut;psi2Atro1uge0A;br2Uchina,n2U;lant2Mn1yp12; 2ason1Zda2H;ld navy,pec,range juli2xf1;am;us;aAb9e6fl,h5i4o1sa,vid3wa;k2tre dame,vart1;is;ia;ke,ntendo,ss0L;l,s;c,st1Gtflix,w1; 1sweek;kids on the block,york09;a,c;nd1Us2t1;ional aca2Ho,we0Q;a,cYd0O;aBcdonaldAe7i5lb,o3tv,y1;spa1;ce;b1Lnsanto,ody blu0t1;ley crue,or0N;crosoft,t1;as,subisM;dica2rcedes benz,talli1;ca;id,re;'s,s;c's milk,tt13z1Y;'ore08a3e1g,ittle caesa1J;novo,x1;is,mark; 1bour party;pres0Az boy;atv,fc,kk,m1od1I;art;iffy lu0Loy divisi0Fpmorgan1sa;! cha06;bm,hop,n1tv;g,te1;l,rpol;asbro,ewlett pack1Qi3o1sbc,yundai;me dep1n1K;ot;tac1zbollah;hi;eneral 6hq,ithub,l5mb,o2reen d0Ku1;cci,ns n ros0;ldman sachs,o1;dye1g0D;ar;axo smith kli02encoU;electr0Jm1;oto0V;a4bi,da,edex,i2leetwood mac,o1rito l0C;rd,xcW;at,nancial1restoX; tim0;cebook,nnie mae;b07sa,u3xxon1; m1m1;ob0G;!rosceptics;aiml0Ae6isney,o4u1;nkin donu2po0Wran dur1;an;ts;j,w j1;on0;a,f lepp0Yll,peche mode,r spiegYstiny's chi1;ld;aHbc,hDiBloudflaAnn,o3r1;aigsli5eedence clearwater reviv1ossra05;al;ca c6inba5l4m1o0Ast05;ca2p1;aq;st;dplOgate;se;ola;re;a,sco1tigroup;! systems;ev2i1;ck fil-a,na daily;r1y;on;dbury,pital o1rl's jr;ne;aEbc,eBf9l5mw,ni,o1p,rexiteeU;ei3mbardiIston 1;glo1pizza;be;ng;o2ue c1;roV;ckbuster video,omingda1;le; g1g1;oodriL;cht2e ge0rkshire hathaw1;ay;el;idu,nana republ3s1xt5y5;f,kin robbi1;ns;ic;bYcTdidSerosmith,iRlKmEnheuser-busDol,pple9r6s3utodesk,v2y1;er;is,on;hland1sociated F; o1;il;by4g2m1;co;os; compu2bee1;'s;te1;rs;ch;c,d,erican3t1;!r1;ak; ex1;pre1;ss; 5catel2ta1;ir;!-lu1;ce1;nt;jazeera,qae1;da;g,rbnb;as;/dc,a3er,tivision1;! blizz1;ard;demy of scienc0;es;ba,c",
"Possessive": "true¦any6h4its,my3no8o1somet7the0yo1;ir1mselves;ur0;!s;!s1;ers0ims0;elf;o1t0;hing;ne",
"Noun|Verb": "true¦0:7L;1:6E;2:7H;3:7R;4:7U;5:7Q;6:6Q;7:7Y;8:7B;9:6Y;A:6M;B:7T;a7Fb6Rc5Qd55e4Xf49g40h3Si3Mj3Kk3Il38m30n2Wo2Tp22ques7Hr1Es09tVuTvOwEyDzC;ip,o69;awn,e1Xie4P;aJeaIhGiEoCre7H;nd0rC;k,ry;mp,nCpe,re,sh,tneB;!d,g;e6DiC;p,st6;r,th0;it,rCs5t2ve,x;ehou1ra7;aFiEoC;iClunte0te,w;ce,d;be,ew,s9;cuum,l36;pCsh0;da5gra4U;aNeMhrLiKoJrFuDwiCy4J;n,st;nCrn;e,n5Y;aEeDiCu8;bu5ck,gg0m,p;at,nd;ck,de,in,nsf0p,v5U;ll,ne,r3Nss,t71u2;ck,e,me,p,re;e1Low,u8;ar,e,st;g,lCrg5Ys5;k,ly;a4Kc0Be08h03i01kZlXmWnVou67pRtHuDwC;ear,it2;b1Vit,m,ppDrCspe4;ge,pri1vey;lCo57;e54y;aJeIiHoFrDuCy6;dy,ff,mb6;a67eCi4A;am,ss,t2;p,rC;e,m;ck,t2;m,p;ck,in,ke,ll,mp,nd,rCte,y;!e,t;aEeed,iDla4Gons6HrCy;ay,e10ink6u3;n,r6Dte;n,rk;ee1Cow;e0Gi6o3X;eep,iC;ce,p,t;ateboa5UiC;!p;de,gnC;!al;aFeEiDoC;ck,p,w;ft,p,v0;d,i2Y;pe,re;aDed,nCr5Vt;se,t1U;l,r2t;aFhedu6oErC;at2eC;en,w;re,ut;le,n,r0H;aXeGiFoEuC;b,in,le,n,sC;h,t;a8ck,ll,ot;de,ng,p,s19;as5AcQdo,el,fOgNje4lMmKnJpHque8sEturn,vCwa58;eCi1G;al,r1;er5FoDt,uC;lt,me;l5Drt;air,eaCly,o3V;l,t;dezvo22t;aCedy;ke,rk;ea1i3B;a4Wist0r4A;act5Aorm,uC;nd,se;aCo4Tru9;ll;ck,i1ke,l44nCtU;ge,k;aZeWhUiRlMoKrDuC;mp,n2rcha1sh;ai1eGi3oCu3H;be,ceEdu3grCje4mi1te8;amCeB;!me;ed,ss;sCy;er4Rs;i7lCol,p,re,s2Pw0;i3l;aEeDuC;g,nA;ad;ce,nCy;!t;ck,lDnCpe,t,vot;!e;e,ot;a1oC;ne,tograph;ak,eDn,rCt;fu3Tm9;!l;ckaAiDn,rtCss,t2u1;!y;nt,r;bDff0il,oCrie7utli2S;ze;je4;a3LeEoC;d,tC;e,i3;ed,gle4rd,t;aGeEiDoCurd0;d2Vnit45p,ve;lk,n2Zrr44x;asu13n3PrCss;ge,it;il,nDp,rk30sCt2;h,k;da5oeuv0Z;aIeFiEoCump;aCbby,ck,g,ok,ve;d,n;cen1ft,m9nGst;aDc0EvC;el,y;ch,d,p,se;bDcCnd,t2un2;e,k;el,o26;e2EiCno3D;ck,ll,ss;am,o17uC;dAi3;mpGnDr37ssC;ue;cr1Adex,fluDha6k,se1WterviCvoi3;ew;en3;a4le1R;aGeEiDoCu7;ld,no1Uok,pe,r1st,u1;ghlight,ke,re,t;aClp;d,t;ndDrCte;bo31m,neBve8;!le;aJeek,loBoIrEuC;arCeBi0N;antee,d;aEiDoCumb6;om,u2C;nd,p;de,sp;of,ssip;in,me,s,ze;aYeUiPlLoIrEuC;el,nCzz;c2Hd;aDoCy;st,wn;cCme;tuR;cDg,ol,rC;ce,e1Qm;us;aEe0Mip,oCy;at,od,wC;!er;g,re,sh,vo11;eFgElDnCre,sh,t,x;an3i0H;e,m,t0;ht,uG;ld;aDeCn3;d,l;r,tuC;re;ce,il,ll,rm,vo23;cho,nIsGxCye;cEerci1hib9pCtra4;eriCo0L;en3me7;el,hanA;caCtima5;pe;count0d,gine0vy;aUeNiHoGrDuCye;b,mp;aDeam,iC;ft,nk,ve;ft,in;cu08dAubt;p,sEvC;e,iCor3;de;charAliDpC;at2lay;ke;al,ba5cGfeFlEma0Zpos9siDtaC;il;gn,re;ay,ega5;at,ct;liZrC;ea1;maAn3rCte;e,t;a09ent08h01lYoIrEuC;be,rCt;e,l;aft,eEoDuCy;sh;p,ss,wd;d9ep;de,in,lPmJnEok,py,re,st,uCv0;gh,nCp6;sXt;ceEdu4glomeFstru4tCveK;a4rC;a8ol;ntCrn;ra5;biGfoFmEpC;leCou0Aromi1;me7;a08e7u5;rt;ne;lap1oC;r,ur;aDiC;ck,p;im,w;aDeCip;at,ck,er;iFllenAmpi0BnDrCse,uffe0H;ge,t;ge,nC;el;n,r;er,re;ke,ll,mp,p,rDsh,t2u1ve;se;d,e;aVeSiRlOoKrFuCypaB;bb6ck6dgDff0lCrn,st,zz;ly;et;anFeaEidAoadC;ca8;ge;ch,k;ch,d;aEmb,ne,oDss,tt6x,ycott;le;k,st,t;rd,st;aDeCitz,oR;nd;me;as,d,ke,te;aDnef9t;it;r,t;il,lan3nErgaDsC;e,h;in;!d,g,k;c02dVffilUge,iTlt0nQppNrJssHttFucDwaC;rd;tiC;on;aCempt;ck;i8ocO;st;chDmoC;ur;!iC;ve;eDroa2;ch;al;chCsw0;or;er;d,m,r;ia5;dFvC;an3oca5;te;ce;i4reB;ss;ct;cChe,t;eEoC;rd,u7;nt;nt,ss",
"Possessive": "true¦any2its,my,no4o0somet3their1yo0;ur0;!s;o1t0;hing;ne",
"Noun|Verb": "true¦0:7O;1:6H;2:7K;3:7U;4:7X;5:7T;6:6T;7:7E;8:71;9:6P;a7Gb6Sc5Rd56e4Yf4Ag41h3Ti3Nj3Lk3Jl39m30n2Wo2Sp20ques7Ir1Cs07tTuRvMwCyBzA;ip,o6A;awn,e1Vie4Q;aHeaGhEiCoAre7I;nd0rA;k,ry;mp,nApe,re,sh,tne7Z;!d,g;e6EiA;p,st6;r,th0;it,rAs5t2ve,x;ehou1ra7Y;aDiCoA;iAlunte0te,w;ce,d;be,ew,s8;cuum,l37;pAsh0;da5gra4V;aLeKhrJiIoHrDuBwiAy4K;n,st;nArn;e,n5Z;aCeBiAu7;bu5ck,gg0m,p;at,nd;ck,de,in,nsf0p,v5V;ll,ne,r3Oss,t72u2;ck,e,me,p,re;e1Kow,u7;ar,e,st;g,lArg5Zs5;k,ly;a4Lc09e06h01iZkXlVmUnTou68pPtFuBwA;ear,it2;b1Vit,m,ppBrAspe4;ge,pri1vey;lAo58;e55y;aHeGiFoDrBuAy6;dy,ff,mb6;a68eAi4B;am,ss,t2;p,rA;e,m;ck,t2;m,p;ck,in,ke,ll,mp,nd,rAte,y;!e,t;aCeed,iBla4Hons6IrAy;ay,e0Zink6u3;n,r6Ete;n,rk;ee1Cow;e0Ei6o3Y;eep,iA;ce,p,t;ateboa5ViA;!p;de,gnAze;!al;aDeCiBoA;ck,p,w;ft,p,v0;d,i2Z;pe,re;aBed,nAr5Wt;se,t1V;l,r2t;aDhedu6oCrA;at2eA;en,w;re,ut;le,n,r0G;aVeEiDoCuA;b,in,le,n,sA;h,t;a7ck,ll,ot;de,ng,p,s1A;as5BcOdo,el,fMgLje4lKmInHo0TpFque7sCturn,vAwa59;eAi1H;al,r1;er5GoBt,uA;lt,me;l5Ert;air,eaAly,o3W;l,t;dezvo23t;aAedy;ke,rk;ea1i3C;a4Xist0r4B;act5Borm,uA;nd,se;aAo4Uru8;ll;ck,i1ke,l45nAtT;ge,k;aYeVhTiQlLoIrBuA;mp,n2rcha1sh;ai1eEi3oAu3I;be,ceCdu3grAje4mi1te7;amAe5A;!me;ed,ss;sAy;er4Ss;iBlAol,p,re,s2Qw0;i3l;nt,s4H;aCeBuA;g,n9;ad;ce,nAy;!t;ck,lBnApe,t,vot;!e;e,ot;a1oA;ne,tograph;ak,eBn,rAt;fu3Tm8;!l;cka9iBn,rtAss,t2u1;!y;nt,r;bCff0il,oBrAutli2S;d0ie4Q;ze;je4;a3KeCoA;d,tA;e,i3;ed,gle4rd,t;aFeDiCoBuA;rd0;d2Tnit43p,ve;lk,n2Xrr42x;asu11n3NrAss;ge,it;il,nBp,rk2YsAt2;h,k;da5oeuv0X;aGeDiCoAump;aAbby,ck,g,ok,ve;d,n;cen1ft,m8nEst;aBc0CvA;el,y;ch,d,p,se;bBcAnd,t2un2;e,k;el,o24;e2CiAno3B;ck,ll,ss;am,o15uA;d9i3;mpEnBr35ssA;ue;cr18dex,fluBha6k,se1UterviAvoi3;ew;en3;a4le1P;aEeCiBoAu3Q;ld,no1Sok,pe,r1st,u1;ghlight,ke,re,t;aAlp;d,t;ndBrAte;bo2Zm,ne3Fve7;!le;aHeek,lo3DoGrCuA;arAe3Ci0Ln;antee,d;aCiBoAumb6;om,u2A;nd,p;de,sp;of,ssip;in,me,ng,s,ze;aWeSiNlJoGrCuA;el,nAzz;c2Fd;aBoAy;st,wn;cAme;tuP;cBg,ol,rA;ce,e1Om;us;aCe0Kip,oAy;at,od,wA;!er;g,re,sh,vo0Z;eDgClBnAre,sh,t,x;an3i0F;e,m,t0;ht,uE;ld;aBeAn3;d,l;r,tuA;re;ce,il,ll,rm,vo21;cho,nGsExAye;cCerci1hib8pAtra4;eriAo0J;en3me2I;el,han9;caAtima5;pe;count0d,gine0vy;aSeLiFoErBuAye;b,mp;aBeam,iA;ft,nk,ve;ft,in;cu06d9ubt;p,sCvA;e,iAor3;de;char9liBpA;at2lay;ke;al,ba5cEfeDlCma0Xpos8siBtaA;il;gn,re;ay,ega5;at,ct;liXrA;ea1;ma9n3rAte;e,t;a07ent06hZlWoGrCuA;be,rAt;e,l;aft,eCoBuAy;sh;p,ss,wd;d8ep;de,in,lNmHnCok,py,re,st,uAv0;gh,nAp6;sVt;ceCdu4glomeDstru4tAveI;a4rA;a7ol;ntArn;ra5;biEfoDmCpA;leAou08romi1;me1B;a06e1Au5;rt;ne;lap1oA;r,ur;aBiA;ck,p;im,w;aBeAip;at,ck,er;iDllen9mpi09nBrAse,uffe0F;ge,m,t;ge,nA;el;n,r;er,re;ke,ll,mp,p,rBsh,t2u1ve;se;d,e;aTeQiPlMoIrDuAypa0M;bb6ck6dgBff0lArn,st,zz;ly;et;anDeaCid9oadA;ca7;ge;ch,k;ch,d;aCmb,ne,oBss,tt6x,ycott;le;k,st,t;rd,st;aBeAitz,oP;nd;me;as,d,ke,te;aBnef8t;it;r,t;il,lan3nCrgaBsA;e,h;in;!d,g,k;c00dTffilSge,iRlt0nOppLrHssFttDucBwaA;rd;tiA;on;aAempt;ck;i7ocM;st;chBmoA;ur;!iA;ve;eBroa2;ch;al;chAsw0;or;er;d,m,r;ia5;dDvA;an3oca5;te;ce;i4reA;ss;ct;cAhe,t;eCoA;rd,uA;nt;nt,ss",
"Actor": "true¦aJbGcFdCfAgardenIh9instructPjournalLlawyIm8nurse,opeOp5r3s1t0;echnCherapK;ailNcientJecretary,oldiGu0;pervKrgeon;e0oofE;ceptionGsearC;hotographClumbColi1r0sychologF;actitionBogrammB;cem6t5;echanic,inist9us4;airdress8ousekeep8;arm7ire0;fight6m2;eputy,iet0;ici0;an;arpent2lerk;ricklay1ut0;ch0;er;ccoun6d2ge7r0ssis6ttenda7;chitect,t0;ist;minist1v0;is1;rat0;or;ta0;nt",
"Honorific": "true¦aNbrigadiMcGdFexcellency,fiAliCma9officMp5queen,r2s0taoiseach,vice4;e0ultI;cond liArgeaB;abbi,e0;ar0verend; adJ;astFr0;eside6i0ofessE;me ministEnce0;!ss;gistrate,r4yB;eld mar3rst l0;ady,i0;eutena0;nt;shA;oct5utchess;aptain,hance3o0;lonel,mmand4ngress0unci2;m0wom0;an;ll0;or;er;d0yatullah;mir0;al",
"Pronoun": "true¦'em,elle,h4i3me,ourselves,she5th1us,we,you0;!rself;e0ou;m,y;!l,t;e0im;!'s",
"Singular": "true¦0:47;1:4Q;2:4R;3:4G;4:4E;5:3H;6:4D;7:48;a4Gb3Wc32d2Me2Ef26g1Vh1Kin1Ijel3k1Gl1Dm16n14o10p0Lqu0Kr0BsRtIuFvBw8;a8ha34om22;f0i49t0Cy8;! arou44;arn44e9o8;cabu05l4N;gHr8;di6t1C;nc2Xp2Hr9s 8;doll3Is4N;bani1in2; rex,aFeEhDiBoAr9u8v show;m29n5rntHto10;agedy,ibe,o3R;p5rq37;c,de,m8;etD;ere,i7;am,mp32;ct5le4x return;aQcOeNhMiLkJoItDuAy8;ll8n1Yst48;ab2J;b9nri12per bowl,r8;f0roga1;st35tot2;aBepAipe3Hr9udent8;! lo1C;ang0i7;fa17mo17;ff0t2T;loi3Gme0Y;elet0Vi8;er,ll,rm3B;te,ze;ack,or3T;ab0Mcurity gu26;e4ho8;l2Pol;la2S;av0NeBhetor5i9o8;de4om;te,v8;erb0F;bBcAf8publ5spi1;er8orm0;e4r2;it2ord label;a1u3J;estion mark,ot20;aJeIhHiGlEr9u8yram11;ddi7ppy,rpo0A;eBie2Vo8;bl3Cs8;pe6t8;a1itu1;mi05roga1Dss relea05;a8ebisci1;q1Zte,y0;cn5er,g;armaci2NotocoF;dest2ncil,rcen33t2;n9te8;!nt;el2Iop3;bjec14c9pia1rde2thers,ve8;n,rview;cu8e08;pi0;an23it1Xot8umb0;a1Xhi7;aCed5ili0Vo9u8é09;m0Lr2;m9nopo3pLrni7sq1Kt8u0Z;h0i0W;!my;mm2nd10te8yf3;ri2;aurea1i9u8;ddi1nch;ght bulb,p07;ey8ittI;!no1;cide4dices,se6te4vert8;eb1I;aHeaDighBo8uman right,ygie0Z;le,me9tb8;ed;! run; scho12ri8;se;d9v8;en; start,ph8;one;m,ndful,ze;aGeEirl1IlaOoDr9u8;l3n,y;an8enadi0id;a14d8; slam,fa8mo8;th0;d,lf0;lat0Entlem8;an;df3ng,r8;l5n1A;aEella,iClBol3r8;ee market,i9on8;ti0;e15ga1;ame,u1;nan8ref3;ci0;br5mi3n0Uth0;conoEffDgg,lecto0NnCs1Pth5venBx9yel8;id;ampWe8te4;cuNmpl0H;i7t;er1E;e6i1D;my;adMeGiDo9r8uB;agonf3i0;cAg19i3or,ssi0wn8;si8;de;to0AumenA;ale6gni9nn0s8vide0M;conte4incenBtri6;ta08;aCc2fBni2te8;c8rre4;ti8;ve;ault 02err2;th;!dy;aXeUhMiLlJoCr8;edit cAit5uc8;ib8;le;ard;efficDlBmmuniqLnApi0rr2t0Su8yo1;ri0s8;in;ne6suH;ic,um8;ni06;ie4;er8ie4;gy,ic;ty,vil wI;aCeqBocoAr8;istmas car8ysanthemum;ol;la1;ue;ndeli0racter8;ist5;ic;ili7ll9r8;e2tifica1;ar;hi0naApit2r8shi0ucus;bohyd8ri0;ra1;ry;aOeNiKlemJoGrCu8;ddhiLnAr8tterf3;glar8i2;!y;ny;eak9o8;!th0;faFthro8;ugh;dy,g,y8;!frie8;nd;ish;cyc8oG;li8;st;an,l3;nki7rri0;er;ng;cLdIllGnDppeti1rray,sAthle1u8;nt,to8;psy;ce4pe6;ct;nt;ec9oma3ti9;ly;do1;er8y;gy; homin9van8;tage;em;cru2e9qui8;tt2;ta1;te;al",
"Uncountable": "true¦0:2J;1:1M;2:1Z;a28b1Zc1Rd1Je1Bf15g0Yh0Ri0Lj0Kk0Jl0Em04n02o01pWrRsGt8vi7w3;a5i4oo3;d,l;ldlife,ne;rm7t2;neg1Ool0Ktae;e9h8oothpas1Hr4un3yranny;a,gst1O;affYea14ou4ue nor3;th;ble3sers,t;!shoot1R;ermod25und2;a,nnis;aBcene0Geri1hAil9ki8o7p6t4u3weepstak1;g1Enshi0Z;ati24e3;am,el;ace1Xeci1;ap,cc2;n,ttl1;k,v2;eep,ingl1;d0Mfe1Ql3nd,t0A;m1Gt;a6e4ic3;e,ke0U;c3laxa0Rsearch;ogni0Qrea0Q;bi1in;aUe6hys0lastCo4re3;mis1sN;l3rk;it0yC;a1Ktr06;bstetr0vercrowd13xyg0W;a3ews;il polWtional securi1C;aAe8o5u3;mps,s3;ic;n3o15;ey,o3;gamy;a3chan0rchandi12tallurgy;sl1t;chine3themat0; learn0Rry;aught2e5i4ogi18u3;ck,g0T;ce,ghtn0Ongui16teraS;ath2i3ss;suR;indergart0Enowled0Q;azz,ewelCusti10;ce,gnor7mp4n3tself;formaYternet;a3ort5;ti3;en0V;an0U;a6eIisto5o3;ckey,mework,ne3rserad7spitali0N;s0My;ry;ir,libXppiGs3;h3te;ish;ene6l5o4r3um,ymna0O;aDeed;lf,re;utWyce0A; 3t0;edit01po3;ol;icFlour,o5urni3;tu3;re;od,rgive3uri2wl;ne3;ss;conom0duca9lectr8n6quip7th0very4xper3;ti00;body,o3thR;ne;joy3tertain3;ment;iciYon0;tiO;e8i4raugh3ynasW;ts;abet1s3;honSrepu3;te;es;b3miN;ut;a9elci8h5iv0lass0o3urrency;al,ld w3nfusiEttEusco7;ar;aos,e4ick3;en;eGw8;us;d,rI;a8eef,i6lood,owls,read,u3;nt4tt2;er;ing;lliarDs3;on;g3ss;ga3;ge;cDdviCeroAir9m5ni4spi3thlet0;rin;se;en5n3;es3;ty;ds;craft;b0d3naut0;ynam0;ce;id,ou3;st0;ics",
"Pronoun": "true¦'em,elle,h3i2me,she4th0us,we,you;e0ou;m,y;!l,t;e0im;!'s",
"Singular": "true¦0:49;1:4S;2:4T;3:4I;4:4G;5:3H;6:4F;7:4A;a4Ib3Wc32d2Ne2Ff27g1Wh1Kin1Ijel3k1Gl1Dm16n14o10p0Kqu0Jr0AsRtIuFvBw8;a8ha34om23;f0i4At0By8;! arou45;arn45e9o8;cabu04l4P;gHr8;di6t1C;nc2Xp2Ir9s 8;doll3Is4P;bani1in2; rex,aFeEhDiBoAr9u8v show;m2An5rntHto10;agedy,ibe,o3S;p5rq37;c,de,m8;etD;ere,i7;am,mp32;ct5le4x return;aPcNeMhLi1kJoItDuAy8;ll8n1Zst4A;ab2J;b9nri13per bowl,r8;f0roga1;st35tot2;aBepAipe3Ir9udent8;! lo1D;ang0i7;fa18mo18;ff0t2T;loi3Hme0Z;elet0Wi8;er,ll,rm3C;ack,or3W;ab0Ncurity gu27;e4ho8;l2Qol;la2T;av0PeBhetor5i9o8;de4om;te,v8;erb0G;bBcAf8publ5r0Hspi1;er8orm0;e4r2;it2ord label;a1u3M;estion mark,ot21;aKeJhIiGlEr9u8yram13;ddi7ppy,rpo0C;eBie2Xo8;bl3Fs8;pe6t8;a1itu1;diction,mi07roga1Ess relea07;a8ebisci1;q20te,y0;cn5e8g;!r;armaci2OotocoF;dest2ncil,rcen35t2;n9te8;!nt;el2Jop3;bjec14c9pia1rde2thers,ve8;n,rview;cu8e09;pi0;an23it1Xot8umb0;a1Xhi7;aCed5ili0Vo9u8é0A;m0Mr2;m9nopo3pLrni7sq1Kt8u0Z;h0i0W;!my;mm2nd10te8yf3;ri2;aurea1i9u8;ddi1nch;ght bulb,p08;ey8ittJ;!no1;cide4dices,se6te4vert8;eb1I;aIeaEighCo8uman right,ygie0Z;le,me9tb8;ed;! r8;un; scho11ri8;se;d9v8;en; start,ph8;one;m,ndful,ze;aGeEirl1IlaOoDr9u8;l3y;an8enadi0id;a13d8; slam,fa8mo8;th0;d,lf0;lat0Dntlem8;an;df3r8;l5n1A;aEella,iClBol3r8;ee market,i9on8;ti0;e15ga1;ame,u1;nan8ref3;ci0;br5mi3n0Tth0;conoEffDgg,lecto0MnCs1Qth5venBx9yel8;id;ampVe8te4;cuMmpl0G;i7t;er1F;e6i1E;my;adLeFiCo9r8u0N;agonf3i0;c9g1Ai3or,ssi0wn8;si0K;to0AumenA;ale6gni9nn0s8vide0N;conte4incenBtri6;ta08;aCc2fBni2te8;c8rre4;ti8;ve;ault 02err2;th;!dy;aXeUhMiLlJoCr8;edit cAit5uc8;ib8;le;ard;efficDlBmmuniqLnApi0rr2t0Uu8yo1;ri0s8;in;ne6suH;ic,um8;ni07;ie4;er8ie4;gy,ic;ty,vil wI;aCeqBocoAr8;istmas car8ysanthemum;ol;la1;ue;ndeli0racter8;ist5;ic;ili7ll9r8;e2tifica1;ar;hi0naApit2r8shi0ucus;bohyd8ri0;ra1;ry;aPeOiLlemKoHrCu8;ddhiMnAr8tterf3;glar8i2;!y;ny;eakAi9o8;!th0;de;faFthro8;ugh;dy,g,y8;!frie8;nd;ish;cyc8oH;li8;st;an,l3;nki7r8;!ri0;er;ng;cLdIllGnDppeti1rray,sAthle1u8;nt,to8;psy;ce4pe6;ct;nt;ec9oma3ti9;ly;do1;er8y;gy; homin9van8;tage;em;cru2e9qui8;tt2;ta1;te;al",
"Preposition": "true¦'o,-,aLbIcHdGexcept,fFinEmid,notwithstandiRoCpSqua,sBt7u4v2w0;/o,hereNith0;!in,oR;ersus,i0;a,s-a-vis;n1p0;!on;like,til;h0ill,owards;an,r0;ough0u;!oI;ans,ince,o that;',f0n1ut;!f;!to;or,rom;espite,own,u3;hez,irca;ar1e0oAy;sides,tween;ri6;',bo7cross,ft6lo5m3propos,round,s1t0;!op;! long 0;as;id0ong0;!st;ng;er;ut",
"SportsTeam": "true¦0:1A;1:1H;2:1G;a1Eb16c0Td0Kfc dallas,g0Ihouston 0Hindiana0Gjacksonville jagua0k0El0Bm01newToQpJqueens parkIreal salt lake,sAt5utah jazz,vancouver whitecaps,w3yW;ashington 3est ham0Rh10;natio1Oredski2wizar0W;ampa bay 6e5o3;ronto 3ttenham hotspur;blue ja0Mrapto0;nnessee tita2xasC;buccanee0ra0K;a7eattle 5heffield0Kporting kansas0Wt3;. louis 3oke0V;c1Frams;marine0s3;eah15ounG;cramento Rn 3;antonio spu0diego 3francisco gJjose earthquak1;char08paA; ran07;a8h5ittsburgh 4ortland t3;imbe0rail blaze0;pirat1steele0;il3oenix su2;adelphia 3li1;eagl1philNunE;dr1;akland 3klahoma city thunder,rlando magic;athle0Mrai3;de0; 3castle01;england 7orleans 6york 3;city fc,g4je0FknXme0Fred bul0Yy3;anke1;ian0D;pelica2sain0C;patrio0Brevolut3;ion;anchester Be9i3ontreal impact;ami 7lwaukee b6nnesota 3;t4u0Fvi3;kings;imberwolv1wi2;rewe0uc0K;dolphi2heat,marli2;mphis grizz3ts;li1;cXu08;a4eicesterVos angeles 3;clippe0dodDla9; galaxy,ke0;ansas city 3nE;chiefs,roya0E; pace0polis colU;astr06dynamo,rockeTtexa2;olden state warrio0reen bay pac3;ke0;.c.Aallas 7e3i05od5;nver 5troit 3;lio2pisto2ti3;ge0;broncZnuggeM;cowbo4maver3;ic00;ys; uQ;arCelKh8incinnati 6leveland 5ol3;orado r3umbus crew sc;api5ocki1;brow2cavalie0india2;bengaWre3;ds;arlotte horAicago 3;b4cubs,fire,wh3;iteB;ea0ulR;diff3olina panthe0; c3;ity;altimore 9lackburn rove0oston 5rooklyn 3uffalo bilN;ne3;ts;cel4red3; sox;tics;rs;oriol1rave2;rizona Ast8tlanta 3;brav1falco2h4u3;nited;aw9;ns;es;on villa,r3;os;c5di3;amondbac3;ks;ardi3;na3;ls",
"Person|Noun": "true¦a07b01cYdRePfOgMhJjFkClBm9olive,p6r3s2trini00v0wang;an,enus,iol0;a,et;ky,on5umm03;ay,e1o0uby;b9d,se;ed,x;atQe0ol;aIn0;ny;a0eloTiles;x,ya;aBeo,iG;elv1i0;ng,tM;in;a2e1o0;lDy;an,w3;de,smi4y;a0iKol8;ll,z0;el;ail,e0rant;ne;aith,ern,lo;a0dDmir,ula,ve;rl;a4e3i1ol0;ly;ck,x0;ie;an,ja;i0wn;sy;h0liff,rystal;ari0in,ristian;ty;ak4e3i2r0;an0ook;dy;ll;nedict,rg;er;l0rt;fredo,ma",
"Person|Noun": "true¦a07b01cYdRePfOgMhJjFkClBm9olive,p6r3s2trini00v0wang;an,enus,iol0;a,et;ky,on5umm03;ay,e1o0uby;b9d,se;ed,x;atQe0ol;aIn0;ny;a0eloTiles;x,ya;aBeo,iG;elv1i0;ng,tM;in;a2e1o0;lDy;an,w3;de,smi4y;a0iKol8;ll,z0;el;ail,e0;ne;aith,ern,lo;a0dDmir,ula,ve;rl;a4e3i1ol0;ly;ck,x0;ie;an,ja;i0wn;sy;h0liff,rystal;ari0in,ristian;ty;ak4e3i2r0;an0ook;dy;ll;nedict,rg;er;l0rt;fredo,ma",
"Noun|Gerund": "true¦0:26;1:25;2:1W;3:1I;4:1Y;a24b1Nc1Bd15en13f0Xg0Vh0Si0Qjog1Zk0Ol0Km0Hn0Fo0Bp04ques07rVsFtAunder9volunt14w5yCzo2;a7ed1Ri3or6r5;ap1Nest1Bi1;ki0r1N;i1r2s1Ttc1T;st1Mta4;al4e8hin4i7ra5y1J;c4di0i2v5;el15;mi0p1G;a1Xs1;ai12cHeGhEin1OkatClYmo4nowBpeAt8u6w5;ea3im1T;f01r5;fi0vi0I;a1Kretc1Iu5;d1AfI;l0Wn1B;b6i0;eb5i0;oar18;ip14o5;rte2u1;a1r09t1;h6o3re5;a1Ge2;edu0Noo0N;aCe8i11o6u5;li0n2;o5wi0;fi0;a7c6hear1Cnde3por1struct5;r1Au3;or0Vyc0G;di0so2;p0Qti0;aAeacek9la8o6r5ublis0X;a0Peten0Rin1oces16;iso2si5;tio2;n2yi0;ee0K;cka0Tin1rt0K;f7pe6rgani5vula1;si0zi0;ni0ra1;fe3;e5ur0W;gotia1twor4;a6e5i2onito3;e1ssa0L;nufactu3rke1;a7ea6i5od0Jyi0;cen0Qf1s1;r2si0;n09ug0E;i5n0J;c4lS;ci0magi2n5ro2;nova1terac1;andPea1i6o5un1;l03wO;ki0ri0;athe3rie5ui01;vi0;ar0CenHi7l6or5ros1unZ;ecas1mat1;ir1ooX;l6n5;anDdi0;i0li0;di0gin5;ee3;a8eba1irec1o7r5umO;awi0es05i5;n4vi0;ub1wnloaO;n5ti0;ci0;aEelebra1hClAo7r5ur6;aw5osZ;li0;a6di0lo3mplai2n5o4pi0ve3;duc1sul1;cLti0;apCea3imHo5ubH;ni0tJ;a5ee3;n1t1;m8s1te3;ri0;aIeFitDlCoAr8u5;il8ll6r5;pi0;yi0;an5;di0;a1m5o4;bi0;esGoa1;c5i0;hi0;gin2lon5t1;gi0;ni0;bys6c4ki0;ki0;it1;c8dverti7gi0rg6ssu5;mi0;ui0;si0;coun1ti0;ti0;ng",
"Unit": "true¦0:0W;a0Rb0Pc0Bd0Aex09f06g03he01in0Kjoule0kUlSmInHoGpDquart0square 9t5volts,w4y2ze3°1µs;c,f,n;a0Cd0Iears old,o1;tt06;att0b;able3e2on1;!ne0;a1r02;spoX;c09d08f3i06kilo0Am1ya05;e0Dil1;e0li08;eet0o04;ascals,e2i1ou0H;c0Ent0;rcent,tU;hms,uR;an0BewtO;/s,e6i1m²,²,³;/h,cro4l1;e1li02;! pEs 1²;anEpD;g01s06;gLter1;! 2s1;! 1;per second;iVu1;men0x;elvins,ilo2m1nM;/h,²;byUgSmeter1;! p2s1;! p1;er1; hour;ct1rtz0;aTogM;all2ig6ra1;in0m0;on0;a2emtMluid ou1tE;nce0;hrenheit,rad0;abyH;eciCmA;arat0eAm9oulomb0u1;bic 1p0;c5d4fo3i2meAya1;rd0;nch0;ot0;eci2;enti1;me4;²,³;lsius,nti1;g2li1me1;ter0;ram0;bl,y1;te0;c4tt1;os1;eco1;nd0;re0;!s",
"Adj|Noun": "true¦a0Gb0Bc04de03eYfTgold,homel00iRjuveniVlQmMnLoKpJrGsAt6u3va1w0;atershed,elcome;gabo3nilla,ria0;bSnt;ndergr0pstairs;adua08ou0;nd;a2e0oken;en,r0;min08rorist;boo,n;e3istRol2qua1tandard,u0;bordina01per3;re,t;e,v06;cret,n0ri02;ior;e0outine;ar,lOntZp0;resentNublican;ati00eriodicXotentiXrincipX;ffiPpposiSvW;agging,ovel;a8e1in0obi8;iature,or;di0trW;an,um;attBiberQ;dePn0;cumbRdividuOnocR;a2e0luid;llow,ma0;le;t,vo0;riFuriF;l2x0;c0pI;ess;d0iB;er;mographHriv2;hi9o0rude;m2n1oper0;ative;cre5stituCtemporary;mer1p0;anion,lex;ci6;lank,o3r0;i1u0;te;ef;ttom,urgeois;cadem4d2l1nim0rab;al;ert;olesc0ult;ent;ic",
"Adj|Noun": "true¦0:0N;a0Mb0Hc08de07e02fWgold,homel04iUjuveniZlTmOnNoMpLrIsBt7u4va2w1;atershed,elcome;gabo4nilla,ria1;bWnt;ndergr1pstairs;adua0Eou1;nd;a3e1oken;en,r1;min0ror06;boo,n;e5istVo3qua2tandard,u1;bordina07per5;re,t;cial01l1;e,v0B;cret,n1ri0;ior;e1outine;ar,lRnt0p1;resentQublican;ati05eriodic0otenti0rincip0;ffiUpposiXv0;agging,ovel;aBe3in2o1;biAdernQ;iature,or;di1tr00;an,um;attDiber0;de0mpressionLn1;cumbVdividu0nocV;a4e1luid;llow,m1;a1inH;le;t,vo1;riIuriI;l3x1;c1pL;ess;d1iE;er;mographKriv3;hiCo1rude;m3n2oper1;ative;cre8stituFtemporary;m2p1;anion,lex;er2un1;ist;ci0;lank,o4r1;i2u1;te;ef;ttom,urgeois;cadem5d3l2nim0rab;al;ert;olesc1ult;ent;ic",
"ProperNoun": "true¦barbie,c4diego,e3f2kirby,m0nis,riel;ercedes,i0;ckey,ssy;inn,ranco;lmo,uro;atalina,hristi",

@@ -47,3 +51,3 @@ "Ordinal": "true¦eBf7nin5s3t0zeroE;enDhir1we0;lfCn7;d,t3;e0ixt8;cond,vent7;et0th;e6ie7;i2o0;r0urt3;tie4;ft1rst;ight0lev1;e0h,ie1;en0;th",

"Person": "true¦ashton kutchUbTcOdMeKgastPhIinez,jHkGleFmDnettLoCpAr5s4t2va1w0;arrDoode;lentino rossi,n go4;a0heresa may,iger woods,yra banks;tum,ylor;addam hussain,carlett johanssKlobodan milosevic;ay romano,e3o1ush limbau0;gh;d stewart,nald0;inho,o;ese witherspoFilly;a0ipJ;lmIris hiltD;prah winfrFra;essia0itt romnEubarek;en;bron james,e;anye west,endall,iefer sutherland,obe bryant;aime,effers7k rowling;a0itlBulk hogan;lle berry,rris5;ff0meril lagasse,zekiel;ie;a0enzel washingt2ick wolf;lt1nte;ar1lint0;on;dinal wols1son0;! palm2;ey;arack obama,rock;er",
"Adjective": "true¦0:8Y;1:7W;2:7T;3:8P;4:8J;5:7X;6:6A;7:82;8:89;9:5T;A:8O;B:75;a7Jb73c6Md65e5Nf55g4Xh4Mi3Rjuni44k3Pl3Dm31n2So2Dp1Uquart61r1Js0St0KuNvJwCye1H;ast51eGholeFiEoCrittB;man6oCrthwhi5u0G;dBzy;despr8Cs6B;!sa5;ather13eCll o5Gste30;!k6;aEeDiCola5A;b8Zce versa,gi2O;ng4Srsa58;ca0lu51;lt07nIpErDsCttermo8R;ef71u4;b64ge0; Eb29pDsCti34;ca5et,ide dP;er,i4I;f3Tto da3;aXbecom2cWdQePfOiNknMmLpKrHsDtoGus1wC;a07iel4B;eBi2DoEpDuC;pervis1spect2;e0okB;ld;eCu6;cognRgul7GlCsolv1;at1ent2;a8recedeZ;arri1et;own;que,vers4;air,oreseB;mploy1nd2xpect1;eCue;cid1rC;!a6Ocov9ly2sEwC;aCei2I;t9y;iz1to40;heck1onvinc2;ppeal2ssum2tteDuthorC;iz1;nd1;i2Era;aHeEhough56ip 1NoDrC;anspa6Vi3;geth9le7Xrp8;ena6CmpDrC;r3Ctia6M;e7Ho6K;leCst3N;nt1;a01cZeXhWiUmug,nobb3WoPpNqueam3WtHuCymb6X;bEi generis,pCr6;erCre1M;! dup9b,viV;du1sCurb4X;eq6Ztanda7J;atu66eGi0TrCyl3Q;aCin4B;ightCy; fCfC;or5U;adfa7Bri5;ar6VeCirit1lend8ot on;c2Ve31; call1lub5mb9phistic6BrFuDvC;erei5Fiet;ndCth0X;pro6D;d8ry;g20nC;ce57g5;am30e9;co1Kem6lf3AnCre7;so5V;ath2holCient2K;ar6;cr1me,tisfac5M;aKeFheumato8iDoC;bu6UttBy4;ghtCv4;-w2f53;b00cFdu6LlEsCtard1;is3DoC;lu3na0;e1Euc3B;e0ondi3;b8ciC;al,st;aPeNicayu7laMopuli6KrDuC;bl5Vnjabi;eHiFoC;!b2QfDmi3CpCvB;er,ort4B;a7u60;maCor,sti7va3;!ry;ci5Xexist2mCpa8;a1RiC;er,um;c8id;ac27rCti3;feAma32ti32v5R;i27rDsC;s40t;allDtC;-ti05i4;el;bNffLkKld JnHrGth9utFverC;!aDni0Gseas,t,wC;ei0Frou0F;ll;do0Yer,si4J;d2Ug1L; bCbCgo2li7;oa5W;fashion1school;!ay; gua5TbCli7si4D;eat;eDsC;ce7er0Eo0T;dia0se;aJeIiHoCuanc1;nDrthCt1U;!eN;chaDdescri5Iprof29sC;top;la0;ght6;arby,cessa4Bighbor6xt;k1usiat2;aJeIinHoDuC;d14ltip5;deEl13nCot,st;ochroCth6;me;rn;dblUi;nac2re;cEgenta,in,j06keshift,mmDnCscu4E;da3Uy;ali2Ioth;ab37ho;aMeIiFoDuC;mber2sh;ngCut19;stand2term;ghtweiDteraC;l,te;ght;ft-w2gCss9th4;al,eDitiC;ma3;nda3N;ngu8ps1st;aput,ind6nC;ow2;gno4Sll04mWnEpso 23rC;a3releC;va0; RaQcoNdKe28fJhibi3AiXnIsEtCvalu0T;aAeC;n43rdepende0;a7iDolCubordi3O;ub5ve0;de,gC;nifica0;a3er;eriDluenPreq3U;eDiFoC;or;fini3termi3G;mpDrC;reA;le3;ccu3Xdeq3Sppr34;fCsitu,vitro;ro0;mGpC;arEeDl0QoCrop9;li3r0N;nd2rfeA;ti4;aDeCi0S;d2Wn3H;tu20;eg4iC;c0Jte3L;aJelIiGoDumC;a7dr3G;me ma2CnDrrCs05ur6;if31;e3Oo2J;ghfalut1LspC;an2Y;lVpf1W;lDnCrd00tJ;dy;f,low1;aiIener2Tiga26lob4oHraEuC;ilCng ho;ty;cDtC;ef1Ois;ef1N;od;nf1L;aQeNinMlKoFrC;aDeCozB;q2Ptf1I;gi5nt2I;olFrC; keeps,eCge0Gm9tu2Bwa36;go2i1BseeC;ab5;ish;ag35uC;e0oresce0;al,i3;dDmini7rC;ti5; up;bl1i0l2Fmiliar,r Cux;oCreach2;ff;aQfficie0lOmLnJqu4reAthere4veIxC;aAem2PplFquisi3traEuC;be2UlC;ta0;!va1H;icC;it;n,ryday; Cti0O;rou3sui3;erDiC;ne0;ge0;dCe18;er6;g9sC;t,ygo2;er;aQeIiDoCrea15ue;mina0ne,rma0ubK;dact1Jfficult,m,sDverC;ge0se;creDeJjoi0pa1XtC;a0inA;et,te; IadpHceGfiFgene1UliDreliAspe1UvoC;id,ut;ca3ghC;tf0A;a0ni3;as1;an;facto;i6ngeroY;ly;arRertaQivil,oFrDuC;nn2stoma0N;aCu0Jystal0Z;vBz1;erLgniza0loKmInDr02veC;rt;cFduJgr14jEsDtraC;dic0Bry;eq12ta0;oi0ug4;a0Xi13;mensu19passC;io0N;ni4ss4;ci0T;in;diac,efN;aNeHizarGliLoErCuck nak1;and new,isk,oC;kBn1D;gCldface,na fiU;us;re;autifGhiFloEnCst,yoF;eWiCt;gn;v1w;nd;ul;ckEnkDrrB;en;ru0W;!wards; priori,b0Oc0Ld0Ef0Bg09h08l01mp5ntiquYpSrMsleep,ttracti0AuIvFwC;aDkC;wa0V;ke,re;ant garDeraC;ge;de;diEtC;heCoimmu7;ntY;toH;bitFchiv4roEtiC;fiC;ci4;ga0;raC;ry;pCt;aFetiz2rC;oprC;ia3;ing;re0;at1;ed;le;cohGiKkaEl,oDterC;na3;of;li7;ne;olC;ic;ead;ainXed,gressiC;ve;flDra8;id;ue0; GeEvC;erC;se;pt,qC;ua3;hoc,infinitC;um;cuDtu4u3;al;ra3;erNlLoJrGsDuC;nda0;e0olu3traA;ct;te;eaDuC;pt;st;aCve;rd;aCe;ze;ra0;nt",
"Adjective": "true¦0:92;1:80;2:7X;3:8T;4:8N;5:6E;6:81;7:86;8:8D;9:5W;A:8S;a7Mb76c6Pd67e5Pf57g4Zh4Oi3Tjuni46k3Rl3Fm33n2Uo2Fp1Wquart63r1Ls0Rt0JuMvIwBye1J;ast53eFholeEiDoB;man5oBrthwhi6u0F;d7Gzy;despr8Fs6E;!sa6;ather13eBll o5Iste32;!k5;aDeCiBola5C;b92ce versa,gi2Q;ng4Ursa5A;ca0lu53;lt06nHpDrCsBttermo8U;ef74u4;b67ge0; Db2BpCsBti36;ca6et,ide dO;er,i4K;f3Vto da3;aWbecom2cVdPeOfNiMknLmKpJrGsCtoFus1wB;a06iel4D;e6Yi2FoDpCuB;pervis1spect2;e0ok6W;ld;eBu5;cognQgul0LlBsolv1;at1ent2;a8recedeY;arri1et;own;que,vers4;air,orese6N;mploy1nd2xpect1;eBue;cid1rB;!a6Rcov9ly2sDwB;aBei2K;t9y;iz1to42;heck1onvinc2;ppeal2ssum2tteCuthorB;iz1;nd1;i2Gra;aGeDhough59ip 1PoCrB;anspa6Yi3;geth9le80rp8;ena6FmpCrB;r3Etia6P;e7Ko6N;leBst3P;nt1;a03c01eZhYiWkiVmug,nobb3YoPpMqueam3YtGuBymb70;bDi generis,pBr5;erBre1O;! dup9b,viX;du1sBurb50;eq72tanda7M;atu69eFi0VrByl3S;aBin4D;ightBy; fBfB;or5X;adfa7Eri6;arCeBirit1lend8ot on;c2Xe33;k5se; caGlub6mb9phisticFrEuCvB;erei5Hiet;ndBth0Y;pro6F;d8ry;at1;ll1;g1ZnB;ce57g6;am2Ze9;co1Jem5lf39nBre7;so5V;ath2holBient2J;ar5;cr1me,tisfac5M;aJeEheumato8iCoB;bu6Utt57y4;ghtBv4;-w2f53;bZcEdu6LlDsBtard1;is3CoB;lu3na0;e1Duc3A;e0ondi3;b8ciB;al,st;aOeMicayu7laLopuli6KrCuB;bl5Vnjabi;eGiEoB;!b2PfCmi3BpBv4U;er,ort4B;a7u60;maBor,sti7va3;!ry;ci5Xexist2mBpa8;a1QiB;er,um;c8id;ac26rBti3;feAma31ti31v5R;i26rCsB;s40t;allCtB;-ti04i4;el;bMffKkJld InGrFth9utEverB;!aCni0Fseas,t,wB;ei0Erou0E;ll;do0Xer,si4J;d2Tg1K; bBbBgo2li7;oa5W;fashion1school;!ay; gua5TbBli7si4D;eat;eCsB;ce7er0Do0S;dia0se;aIeHiGoBuanc1;nCrthBt1T;!eM;chaCdescri5Iprof28sB;top;la0;ght5;arby,cessa4Bighbor5xt;k1usiat2;aIeHinGoCuB;d13ltip6;deDl12nBot,st;ochroBth5;me;rn;dblTi;nac2re;cDgenta,in,j05keshift,mmCnBscu4E;da3Uy;ali2Ioth;ab37ho;aLeHiEoCuB;mber2sh;ngBut18;stand2term;ghtweiCteraB;l,te;ght;ft-w2gBss9th4;al,eCitiB;ma3;nda3N;ngu8ps1st;aput,ind5nB;ow2;gno4Sll03mVnDpso 23rB;a3releB;va0; QaPcoMdJe28fIhibi3AiWnHsDtBvalu0S;aAeB;n43rdep1S;a7iColBubordi3O;ub6ve0;de,gB;nifica0;a3er;eriCluenOreq3U;eCiEoB;or;fini3p1Jtermi3G;mpCrB;reA;le3;ccu3Xdeq3Sppr34;fBsitu,vitro;ro0;mFpB;arDeCl0PoBrop9;li3r0M;nd2rfeA;ti4;aCeBi0R;d2Wn3H;tu20;eg4iB;c0Ite3L;aIelHiFoCumB;a7dr3G;me ma2CnCrrBs04ur5;if31;e3Oo2J;ghfalut1LspB;an2Y;lUpf1W;lCnBrdZtI;dy;f,low1;aiHener2Tiga26lob4oGraDuB;ilBng ho;ty;cCtB;ef1Ois;ef1N;od;nf1L;aPeMinLlJoErB;aCeBoz1L;q2Ptf1I;gi6nt2I;olErB; keeps,eBge0Gm9tu2Bwa36;go2i1BseeB;ab6;ish;ag35uB;e0oresce0;al,i3;dCmini7rB;ti6; up;bl1i0l2Fmiliar,r Bux;oBreach2;ff;aPfficie0lNmKnIqu4reAthere4veHxB;aAem2PplEquisi3traDuB;be2UlB;ta0;!va1H;icB;it;n,ryday; Bti0O;rou3sui3;erCiB;ne0;ge0;dBe18;er5;g9sB;t,ygo2;er;aQeHiCoBrea15ue;mina0ne,rma0ubK;dact1Jfficult,m,sCverB;ge0se;creCeJjoi0pa1XtB;a0inA;et,te; IadpHceGfiFgene1UliDpCreliAspe1UvoB;id,ut;ende0;ca3ghB;tf09;a0ni3;as1;an;facto;i5ngeroX;ly;arQertaPivil,oErCuB;nn2stoma0M;aBu0Iystal0Y;v01z1;erKgniza0loJmHnCr01veB;rt;cEduIgr13jDsCtraB;dic0Ary;eq11ta0;oi0ug4;a0Wi12;mensu18passB;io0M;ni4ss4;ci0S;in;diac,efM;aMeGizarFliKoDrBuck nak1;and new,isk,oB;kLn1C;gBldface,na fiT;us;re;autifFhiEloDnBst,yoE;eViBt;gn;v1w;nd;ul;ckDnkCrrB;en;ru0V;!wards; priori,b0Nc0Kd0Df0Ag08h07l00mp6ntiquXpRrLsleep,ttracti09uHvEwB;aCkB;wa0U;ke,re;ant garCeraB;ge;de;diDtB;heBoimmu7;ntX;toG;bitEchiv4roDtiB;fiB;ci4;ga0;raB;ry;pBt;aEetiz2rB;oprB;ia3;ing;re0;at1e;ed;le;cohFiJkaDl,oCterB;na3;of;li7;ne;olB;ic;ead;ainWed,gressiB;ve;flCra8;id;ue0; FeDvB;erB;se;pt,qB;ua3;hoc,infinitB;um;cuCtu4u3;al;ra3;erMlKoIrFsCuB;nda0;e0olu3traA;ct;te;eaCuB;pt;st;aBve;rd;aBe;ze;ra0;nt",
"Determiner": "true¦aBboth,d9e6few,l4mu8neiDplenty,s3th2various,wh0;at0ich0;evC;at,e4is,ose;everal,ome;a,e0;!ast,s;a1i6l0very;!se;ch;e0u;!s;!n0;!o0y;th0;er",

@@ -55,11 +59,10 @@ "Adverb": "true¦a09b05d01eXfRhPinOjustNkinda,mLnIoDpBquite,r8s4t1up0very,well; to,wards5;h1iny bit,o0wiO;o,t6w05;en,us;eldom,o0uch;!me1rt0; of;hZtimes,w0B;a1e0;alT;ndomSthN;ar excellDer0oint blank; Nhaps;f3n0;ce0ly;! 0;ag04moY; courIten;ewKo0; longEt 0;onIwithstanding;aybe,eanwhiAore0;!ovB;! aboW;deed,steX;en0;ce;or2u0;lArther0;!moL; 0ev3;examp0good,suJ;le;n1v0;er; mas0ough;se;e0irect1; 1finite0;ly;juAtrop;ackw2y 0;far,n0;ow;ard; DbroCd nauseam,gBl6ny3part,s2t 0w4;be6l0mo6wor6;arge,ea5; soon,ide;mo1w0;ay;re;l 1mo0one,ready,so,ways;st;b1t0;hat;ut;ain;ad;lot,posteriori",

"Comparable": "true¦0:3D;1:3H;2:3S;3:2F;a3Wb3Ec32d2Se2Lf28g1Wh1Mi1Fj1Ek1Bl14m0Yn0To0Sp0Jqu0Hr08sJtEuDvBw5y4za0R;el11ou3C;a8e6hi1Hi4ry;ck0Dde,l4n2ry,se;d,y;a4i3V;k,ry;nti36ry;a4erda1ulgar;gue,in,st;g0pcomi33;a7en2Vhi6i5ough,r4;anqu2Aen2ue;dy,g38me0ny,r03;ck,rs26;ll,me,rt,wd3K;aRcarQePhNiMkin0BlImGoEpDt7u5w4;eet,ift;b4dd0Vperfi1Yrre26;sta24t3;a8e7iff,r5u4;pUr2;a4ict,o2R;ig2Yn0N;a2ep,rn;le,rk;e1Qi2Yright0;ci1Xft,l4on,re;emn,id;a4el0;ll,rt;e6i4y;g2Pm4;!y;ek,nd2V;ck,l0mp3;a4iRort,rill,y;dy,l01rp;ve0Jxy;ce,y;d,fe,int0l1Gv0V;a9e7i6o4ude;mantic,o17sy,u4;gh,nd;ch,pe,tzy;a4d,mo0A;dy,l;gg5ndom,p4re,w;id;ed;ai1i4;ck,et;hoBi1ElAo9r6u4;ny,r4;e,p3;egna1ic5o4;fouSud;ey,k0;liXor;ain,easa1;ny;dd,i0ld,ranL;aive,e6i5o4;b3isy,rm0Xsy;ce,mb3;a4w;r,t;ad,e6ild,o5u4;nda10te;ist,o2;a5ek,l4;low;s0ty;a8ewd,i7o4ucky;f0In5o14u4ve0w0Yy0M;d,sy;e0g;ke0tt3ve0;me,r4te;ge;e5i4;nd;en;ol0ui1D;cy,ll,n4;s7t4;e4ima5;llege1rmedia4;te;ecu4ta1;re;aBe8i7o6u4;ge,m4ng1F;b3id;me0t;gh,l0;a4fWsita1;dy,v4;en0y;nd16ppy,r4;d,sh;aEenDhBiAl9oofy,r4;a7e6is0o4ue13;o4ss;vy;at,en,y;nd,y;ad,ib,ooE;a1d2;a4o4;st0;t3uiT;u2y;aEeeb3i9lat,o7r6u4;ll,n4r0T;!ny;aEesh,iend0;a4rmFul;my;erce6n4;an4e;ciB;! ;le;ir,ke,n08r,st,ul4;ty;a7erie,sse5v4xtre0G;il;nti4;al;r5s4;tern,y;ly,th0;aCe9i6ru5u4;ll,mb;nk;r5vi4;ne;e,ty;a4ep,nB;d4f,r;!ly;ppVrk;aDhAl8o6r5u4;dd0r0te;isp,uel;ar4ld,mmon,st0ward0zy;se;e4ou2;ar,vO;e4il0;ap,e4;sy;gey,lm,ri4;ng;aJiHlEoCr6u4;r0sy;ly;a8i5o4;ad,wn;g5llia1;nt;ht;sh,ve;ld,un4;cy;a5o4ue;nd,o2;ck,nd;g,tt4;er;d,ld,w2;dy;bsu7ng6we4;so4;me;ry;rd",
"Infinitive": "true¦0:8K;1:88;2:92;3:8Q;4:7T;5:7I;6:8Y;7:8R;8:7V;9:96;A:95;B:8M;C:7J;D:7F;E:7N;F:7Z;G:7O;a7Wb7Bc6Ld5Ee4Cf42g3Yh3Ui3Bj38k35l2Wm2Pnou3To2Kp23qu22r18s08tWuRvaQwH;aNeMiKrH;eIiH;ng,te;ak,st4;d5e79thH;draw,er;a2d,ep;i2ke,nHrn;d0t;li93ry;nHplift;cov0dIear7FlHplug,tie,ve7Y;eaAo3J;erHo;go,sta95val8Vwhelm;aQeOhLoKrH;aHemb4;ffi3Emp4nsH;aEpi8;pp4ugh5;aIiIrHwaC;eat5i2;nk;aHll,m8R;ch,se;ck4ilor,keHmp0r7G;! paC;a0Fc0Ee0Ch08i06l04m03n02o00pVqua45tOuJwH;all6Xe2EiH;m,ng;bJccumb,ffIggeBmm8Sp2FrH;mouFvi2;er,i3;li7Smer7siHveC;de,st;aLe7LiJrH;ang4eHi2;ng20w;fHnW;f5le;gg0rH;t4ve;awn,eKiJlIoHri69;il,of;ay,it;ll,t;ak,nd;lHothe,w;icDve;eak,i0L;aAugg4;aHi9;m,y;ft,nHt;g,k;aJi5DoIriHun;nk,v5P;ot,rt5;ke,rp5tt0ve;eHll,nd,que7Bv0w;!k,m;aven7ul7P;dd5tis18y;att4eIip5oH;am,ut;a06b04c02d01fYgroup,heaXiWlUmTnSpQq30sMtKvH;amp,eIiHo2P;sDve;l,rt;i8rH;ie2ofD;eFiJtHurfa3;aCo1VrH;a5RiEuctu8;de,gn,st;el,hra1lHreseF;a3e61;d0ew,o03;e2Vo2;a6eFiHoad,y;e2nq3Fve;mbur1nf2O;r1t;inIleEocus,reAuH;el,rbiA;an3e;aEu3;ei2k77la3HoHyc4;gni56up,v0;oot,uH;ff;ct,d,liH;se,ze;aAenGit,o6;aVerTiSlumm0VoRrJuH;b3Ike,niArHt;poCs6L;eLoH;cJd,hibDnoIpo1sp0tru9vH;e,i9o4Q;un3;la33u8;aGc1NdIf0ocTsup0FvH;a5EeF;etermi40iE;aGrt4R;er3npoiF;cei2fo3AiAmea6plex,sHva9;eve8iB;mp0n13rHtrol,ve,y;a5Jt5F;bser2cKpJutIverHwe;lap,s15tu5Yu1;gr4Knu1Wpa3;era6i3Qpo1;cupy;aMe09iIoHultiply;leBu5T;micJnIsH;pla3s;ce,g4us;!k;im,ke,na7;aOeKiHo1u33;e,ng0quHv5;eHi5V;fy;aJnH;d,gH;th5;rn,ve;ng20u19;eInH;e3Kow;ep;o41uH;gg4xtaH;po1;mUnH;c0MdRfQgeBhPitia6ju8q0YsNtJun5HvH;eHo0N;nt,st;erIimi5EoxiPrH;odu3u9;aEn,prHru5E;et;iBpi8tHu8;il,ruE;abDibD;eBo24u1;iHul7;ca6;b51mer1pH;aCer40ly,oIrH;is5Co2;rt,se,veH;riA;aJear,iHoiBuC;de,jaHnd0;ck;mp0ng,pp5ve;ath0et,i2le1PoJrH;aHow;b,pp4ze;!ve4I;ast5er3Fi4YlPorKrIuH;lf3Nr3J;ee2ZolH;ic;bid,eJfeDgHs45;eHi2;!t;clo1go,sHwa4A;had2W;ee,i2L;a0GdDl0Em09nRquip,rQsPtGvNxH;cLeCha4iKpItH;ing0Qol;eHi8loDo1un7;ct,di6;st,t;lu9;alua6oH;ke,l2;chew,pou1tab11;a1u49;aXcUdSfRgPhan3joy,lOqNrMsuLtJvH;e0TisH;a7i4E;er,i3rH;a2IenGuB;e,re;iGol;ui8;ar7iB;a7eHra2ulf;nd0;or3;ang0oHu8;r1w;lo1ou0ArIuH;mb0;oaGy3S;b4ct;bIer7pH;hasi1Xow0;a0Sody,rH;a3oiH;d0l;ap1eEuH;ci3Ide;rHt;ma0Mn;a0Me01iJo,rHwind4;aw,ed7oH;p,wn;agno1e,ff0g,mi25sKvH;eHul7;rHst;ge,t;ab4bTcOlod7mant4pMru3AsLtH;iHoCu2R;lIngH;uiA;!l;ol2ua9;eHla3o1ro2;n1r1;a17e2QlJoHuss;uHv0;ra7;aHo1;im;a32ur1;af5bYcSduEep5fQliPmMnKpJra1RtaGvH;eHol2;lop;aCiEoC;oHy;te,un3;eIoH;liA;an;mDv0;a3i04oHraud,y;rm;ei2iLoJrH;ee,yH;!pt;de,mHup4;missi2Opo1;de,ma6ph0;aIrief,uH;g,nk;rk;mp5rk5uF;a04ea1h02i01l00oIrHurta15;a2ea6ipp4;ales3eXhabDinci9llWmUnHrro9;cRdOfMju8no6qu0sKtJvH;eHin3;ne,r7;a0Iin1Zribu6;er2iHoli21pi8titu6ult;d0st;iHroFu1;de,gu8;eIoH;ne;mn,n1;eHlu9;al,i2;buBe,men3pH;e6ly;eEi9u9;r3xiB;ean1iR;rcumveFte;eHoo1;riAw;ncHre5t0ulk;el;aZeTi1PlQoOrKuH;iIrHy;st,y;ld;aJeIiHoad5;ng;astfeLed;ke;il,l0WmbaHrrNth0;rd;aIeHow;ed;ze;!come,gLha2liKnd,queaJstItHwild0;ray;ow;th;e2tt4;in;bysDckfi8ff4;it;b10c0Od0Gffix,gr0Fl0Bm07n01ppXrWsPttMuKveCwaH;it,k5;en;rt;gHto06;meF;aGeBraE;ct;ch;pi8sItoH;niA;aJeHi03u8;mb4rt;le;il;re;g0Ei1ou1ran7;eaJly,oiFrH;ai1o2;nt;r,se;aLiPnItH;icipa6;eIoHul;un3y;al;ly1;aIu1;se;lgaHze;ma6;iJlH;e7oHu9;t,w;gn;ee;aZjLminiJoIsoH;rb;pt,rn;st0;er;ouIuB;st;rn;cKhie2knowled7quiHtiva6;es3re;ce;ge;eNomJrIusH;e,tom;ue;moIpH;any,liA;da6;te;pt;andNet,i9oJsH;coJol2;ve;liArt,uH;nd;sh;de;on",
"Infinitive": "true¦0:8T;1:8G;2:9B;3:8Z;4:80;5:7N;6:97;7:82;8:90;9:9F;A:9E;B:8V;C:7U;D:7Q;E:7K;F:87;a80b7Ec6Od5Fe4Df43g3Zh3Vi3Bj38k35l2Wm2Pnou3Uo2Kp23qu22r18s08tWuRvPwG;aMeLiJrG;eHiG;ng,te;ak,st4;d5e7CthG;draw,er;a2d,ep;i2ke,nGrn;d0t;aGie;li9Ary;nGplift;cov0dHear7HlGplug,tie,ve83;eaAo3J;erGo;go,sta9Cval92whelm;aPeNhKoJrG;aGemb4;ffi3Emp4nsG;aCpi7;pp4ugh5;aHiHrGwaD;eat5i2;nk;aGll,m8Y;ch,se;ck4ilor,keGmp0r7L;! paD;a0Ec0De0Bh07i05l03m02n01oZpUqua45tNuIwG;all6Ze2DiG;m,ng;bIccumb,ffHggeBmm8Zp2ErG;mouFvi2;er,i3;li7Ymer8siGveD;de,st;aKe7RiIrG;ang4eGi2;ng1Zw;fGnV;f5le;gg0rGte ch5F;t4ve;awn,eJiIlHoGri6B;il,of;ay,it;ll,t;ak,nd;lGot6Lw;icEve;eak,i0K;aAugg4;aGi9;m,y;ft,nGt;g,k;aIi5FoHriGun;nk,v5R;ot,rt5;ke,rp5tt0ve;eGll,nd,que7Iv0w;!k,m;aven8ul7W;dd5tis17y;att4eHip5oG;am,ut;a05b03c01d00fXgroup,heaWiVlTmSnRpPq30sLtJvG;amp,eHiGo2P;sEve;l,rt;i7rG;ie2ofE;eFiItGurfa3;aDo1VrG;a5TiCuctu7;de,gn,st;el,hra1lGreseF;a3e66;d0ew,o02;a5Oe2Vo2;a6eFiGoad,y;e2nq3Fve;mbur1nf2O;r1t;inHleCocus,reAuG;el,rbiA;an3e;aCu3;ei2k7Ela3IoGyc4;gni58nci4up,v0;oot,uG;ff;ct,d,liG;se,ze;aAen5Nit,o6;aUerSiRlumm0UoQrIuG;b3Jke,niArGt;poDs6S;eKoG;cId,fe33hibEnoHpo1sp0tru9vG;e,i9o4S;un3;la34u7;a5Ec1NdHf0ocSsup0EvG;a5JeF;etermi42iC;a5Brt4T;er3npoiF;cei2fo3BiAmea6plex,sGva9;eve7iB;mp0n13rGtrol,ve,y;a5Pt5L;bser2cJpIutHverGwe;lap,s15tu65u1;gr4Mnu1Wpa3;era6i3Spo1;cupy;aLe08iHoGultiply;leBu60;micInHsG;pla3s;ce,g4us;!k;im,ke,na8;aNeJiGo1u35;e,ke,ng0quGv5;eGi62;fy;aInG;d,gG;th5;rn,ve;ng20u19;eHnG;e3Mow;ep;o43uG;gg4xtaG;po1;gno7mUnG;cSdQfPgeBhOitia6ju7q0YsMtIun5OvG;eGo0N;nt,st;erHimi5LoxiOrG;odu3u9;aCn,prGru5L;et;iBpi7tGu7;il,ruC;abEibE;eBo25u1;iGul8;ca6;i6lu9;b57mer1pG;aDer44ly,oHrG;is5Io2;rt,se,veG;riA;aIear,iGoiBuD;de,jaGnd0;ck;mp0ng,pp5ve;ath0et,i2le1PoIrG;aGow;b,pp4ze;!ve4O;ast5er3Ji54lOorJrHuG;lf3Rr3N;ee30olG;ic;b3CeIfeEgGs4A;eGi2;!t;clo1go,sGwa4G;had2X;ee,i2M;a0FdEl0Dm08nQquip,rPsOt3CvMxG;cKeDha4iJpHtG;ing0Pol;eGi7loEo1un8;ct,di6;st,t;lu9;alua6oG;ke,l2;chew,pou1tab11;a1u4F;aWcTdRfQgOhan3joy,lNqMrLsuKtIvG;e0TisG;a8i4K;er,i3rG;a2Jen2XuB;e,re;i2Vol;ui7;ar8iB;a8eGra2ulf;nd0;or3;ang0oGu7;r1w;lo1ou0ArHuG;mb0;oa2Ly3Y;b4ct;bHer8pG;hasi1Yow0;a0Tody,rG;a3oiG;d0l;ap1eCuG;ci3Ode;rGt;ma0Nn;a0Ne01iIo,rGwind4;aw,ed8oG;p,wn;agno1e,ff0g,mi29sJvG;eGul8;rGst;ge,t;ab4bTcNlod8mant4pLru3GsKtG;iGoDu2W;lHngG;uiA;!l;ol2ua9;eGla3o1ro2;n1r1;a18e2WlJoHuG;ss;uGv0;ra8;aGo1;im;a37ur1;af5bXcRduCep5fPliOmLnJpIra1Uta1OvG;eGol2;lop;aDiCoD;oGy;te,un3;eHoG;liA;an;mEv0;a3i04oGraud,y;rm;ei2iKoIrG;ee,yG;!pt;de,mGup4;missi2Tpo1;de,ma6ph0;aIrHuG;g,nk;ief;rk;mp5rk5uF;a03ea1h01i00lZoHrGurta17;a2ea6ipp4;ales3eWhabEinci9llVmTnGrro9;cQdNfLju7no6qu0sJtIvG;eGin3;ne,r8;a0Hin23ribu6;er2iGoli25pi7titu6ult;d0st;iGroFu1;de,gu7rm;eHoG;ne;mn,n1;eGlu9;al,i2;buBe,men3pG;e6ly;eCi9u9;r3xiB;ean1iQ;rcumveFte;eGoo1;riAw;ncGre5t0ulk;el;aYeSi1TlPoNrJuG;iHrGy;st,y;ld;aIeHiGoad5;ng;astfeKed;ke;il,l10mbaGrrMth0;rd;aHeGow;ed;ze;!come,gKha2liJnd,queaIstHtGwild0;ray;ow;th;e2tt4;in;bysEckfi7ff4tG;he;it;b13c0Rd0Iffix,gr0Hl0Dm09n03ppZrXsQttNuLvIwaG;it,k5;en;eDoG;id;rt;gGto06;meF;aHeBraC;ct;ch;pi7sHtoG;niA;aIeGi03u7;mb4rt;le;il;re;g0Fi1ou1rG;an8i2;eaIly,oiFrG;ai1o2;nt;r,se;aKiOnHtG;icipa6;eHoGul;un3y;al;ly1;aHu1;se;lgaGze;ma6;iIlG;e8oGu9;t,w;gn;ee;aZjLmiIoHsoG;rb;pt,rn;niGt;st0;er;ouHuB;st;rn;cJhie2knowled8quiGtiva6;es3re;ce;ge;eMomIrHusG;e,tom;ue;moHpG;any,liA;da6;te;pt;andMet,i9oIsG;coIol2;ve;liArt,uG;nd;sh;de;on",
"Modal": "true¦c5lets,m4ought3sh1w0;ill,o5;a0o4;ll,nt;! to,a;ight,ust;an,o0;uld",
"Verb": "true¦born,cannot,fr5g4h2keep tabs,less6m1s0wors6;e5hown;ake sure,sg;as0e2;!t2;iv1onna;ight0;en",
"PhrasalVerb": "true¦0:81;1:7Q;2:8E;3:84;4:7J;5:8H;6:7P;7:7E;8:7C;9:86;A:7Z;B:89;C:87;D:80;E:6L;F:6D;a8Kb73c66d61e60f4Yg4Gh3Viron0j3Rk3Ml33m2Pn2No2Lp22quietEr1Ns0GtWuUvacuum 1wJyammerAzG;ero Dip HonG;e0k0;by,up;aNeIhHiGor7Vrit37;mp0n34pe0r8s8;eel Dip 8P;aIiGn2S;gh Grd0;in,up;n Dr G;d2in,o4D;it 6Hk8lk Hrm 0Ysh Gt79v5F;aw3d2o5up;aw3in,o84;rgeAsG;e 1herF;aVeThRiNoMrIuGypL;ckFrn G;d2in,o45up;aHiGot0y 2O;ckleEp 8A;ckEdG;e 0N;neEp 2Zs4Z;ck IdHe Gghte5Yme0p o0Ire0;aw3ba4d2in,up;e 6Hy 1;by,oC;ink Grow 6U;ba4ov6up;aGe 6Fll5G;m 1r 53;ckAke Hlk G;ov6shit,u5H;aGba4d2in,o3Pup;ba4ft6p5Mw3;a0Lc0Ke0Eh0Ai07l03m02n01o00pVquar4XtMuKwG;earIiG;ngHtch G;aw3ba4o7O; by;ck Git 1m 1ss0;in,o7Bup;aMe10iLoJrHuG;c36d2O;aigh22iG;ke 6Wn3L;p Grm24;by,in,oC;n31r 1tc44;c30mp0nd Gr7Fve9y 1;ba4d2up;ar2YeJiIlHrGurA;ingAuc8;a3Rit 5R;l17n 1;e69ll0;ber 1rt0und like;ap 56ow D;ash 5Woke0;eep HiGow 7;c1Lp 1;in,oG;ff,v6;de12gn HngGt 5Rz8; al5Mle0;in,o5up;aIoGu5A;ot Gut0w 6U;aw3ba4f3SoC;c2GdeFk5Pve9;e Kll1Gnd Jrv8tG; Gtl4W;d2f5Bin,o5upG;!on;aw3ba4d2in,o2Nup;o6Dto;al5Iout0rap5I;il9v8;aTeQiPoLuG;b 5Ble0n Gstl8;aIba4d2inHoGt3Lu0X;ut,v6;!to;c2HrBw3;ll Iot HuG;g33nd9;a2Hf3Ao5;arBin,o5;ng 5Ip9;aGel9inFnt0;c5Rd G;o3Bup;c1Tt0;aUeTiRlPoNrKsyc2RuG;ll It G;aGba4d2in,o1Zt3Rup;p3Ww3;ap3Vd2in,o5t3Pup;attleAess HiJoG;p 1;ah1Zon;iGp 5Wr4CurEwer 5W;nt0;ay4SuG;gFmp 7;ck Gg0leAn 7p4P;o1Oup;el 4ZncilF;c4Hir 2Xn0ss ItHy G;ba4oC; d2c2E;aw3ba4in,o1J;pGw4C;e4Bt D;arrowEerd0oG;d9teE;aQeNiMoIuG;ddl8lG;l 3W;c12nkeyIp 7uth9ve G;aGd2in,o5up;l41w3; wi3Y;ss0x 1;asur8lHss G;a1Oup;t 7;ke Hn 7rGs1Xx0;k 7ry9;do,o4Vup;aWeRiMoGuck0;aKc3Ug JoGse0;k Gse3S;aft6ba4d2forw2Sin4Iov6uG;nd6p;in,o0V;d 7;e 04ghtJnIsHvG;e 3E;ten 4Y;e 1k 1; 1e3J;ave It HvelG; o4H;d2go,in,o5up;in,oG;pen,ut;c8p 1sh GtchAugh9y26;in43o5;eHick9nock G;d2o4Aup;eGyF;l 2Yp G;aw3ba4d2fYin,o0Dto,up;aIoHuG;ic8mpF;ke3BtE;c3Kzz 1;aVeQiNoKuG;nHrrGsh 7;y 1;kerEt G;arBd2;lGneFrse34;d Ge 1;ba4d2fast,o04up;de Ht G;ba4on,up;aw3o5;aGlp0;d Il 2Gr Gt 1;fGof;rom;in,oWu1K;cJm 1nHve Gz2B;it,to;d Gg 2MkerJ;d2in,o5;k 1;aUeOive Mloss 27oIrHunG; f0O;in3Now 2H; Gof 26;aHb1Fit,oGrBt0Qu1A;ff,n,v6;bo5ft6hMw3;aw3ba4d2in,oGrise,up,w3;ff,n,ut;ar 7ek0t G;aHb19d2in,oGrBup;ff,n,ut,v6;cHhGl23rBt,w3;ead;ross;d aHnG;g 1;bo5;a0Ae03iUlQoMrIuG;ck Ge28;arBup;eHighten GownAy 1;aw3oC;eGshe1U; 1z8;lIol G;aGwi1N;bo5rB;d 7low 1;aHeGip0;sh0;g 7ke0mGrGttenE;e 2Y;gNlLnJrHsGzzle0;h 2W;e Gm 1;aw3ba4up;d0isG;h 1;e Gl 1G;aw3fLin,o5;ht ba4ure0;eLnHsG;s 1;cId G;fGoC;or;e D;dYl 1;cKll Grm0t13;ap07bId2in,oHtG;hrough;ff,ut,v6;a4ehi27;e G;d2oCup;a0Ldge0nd 0Py8;oJrG;aHess 7op G;aw3bWin,o1U;gAwA; 0Iubl0Y;a00hXleaWoJrGut 16;ackAeep Goss D;by,d2in,oGup;n,ut;me JoHuntG; o1W;k 7l G;d2oC;aMbLforJin,oItHuG;nd6;ogeth6;n,ut,v6;th,wG;ard;a4y;pGrBw3;art;n 7;eGipF;ck Der G;on,up;lNncel0rKsItch HveF; in;o1Eup;h Dt G;doubt,oC;ry HvG;e 02;aw3o19;l HmE; d2;aGba4d2o16up;rBw3;a0Me0El07oYrLuG;bblIcklZil05lk 7ndlZrGst VtHy 16zz9;n 0AsG;t D;e G;ov6;anReaPiHush G;oCup;ghLng G;aIba4d2fGin,o5up;orG;th;bo5lGrBw3;ong;teG;n 1;k G;d2in,o5up;ch0;arNg 7iLn8oJssIttlHunce Gx D;aw3ba4;e 7; arB;k Dt 1;e 1;l 7;d2up;d 1;aLeed0oGurt0;cIw G;aw3ba4d2o5up;ck;k G;in,oX;ck0nk0st9; oLaJef 1nd G;d2ov6up;er;up;r0t G;d2in,oQup;ff,nG;to;ck Mil0nIrgHsG;h D;ainAe D;g DkA; on;in,o5; o5;aw3d2oGup;ff,ut;ay;cPdLsk Iuction9; oC;ff;arBo5;ouG;nd;d G;d2oGup;ff,n;own;t G;o5up;ut",
"Adj|Gerund": "true¦0:2C;1:2E;2:22;3:20;4:24;5:1X;a1Zb1Uc1Cd0Ze0Uf0Kg0Eh0Di07jud1Sl04m01oXpTrNsCt7up6veWw0Lyiel5;lif0sZ;aUe9hr7i3ouc22r6wis0;eZoub2us0yi1;ea0Ji6;l2vi1;l2mp0;atisf28creec1Xhoc0Bkyrocke0lo0ZoEpDt9u7we6;e0Yl2;pp1Gr6;gi1pri4roun5;a7ea1Zi6ri07un18;mula0r3;gge3r6;t2vi1;ark2ee5;a6ot1O;ki1ri1;aAe7ive0o6us1M;a3l2;fres1Kig0ZlaCs0v6war5;ea2itali6ol0M;si1zi1;gi1ll1Smb2vi1;a1Rerple8ier19r6un1F;e6o0X;ce5s4vai2;xi1;ffs8pKut7ver6wi1;arc1Blap0Dri5whel1H;goi1l1Lst0U;et0;eande3i7o0Bu6;mb2;s4tiga0;a7i6o08;fesa07mi0vi1;cHg0Rs0;mAn6rri08;c8s7te13vi6;go1Cti1;pi3ul0;orpo1Area4;po4;arrowi1ea2orrif17umilia0;lAr6;a0ipWo7uel6;i1li1;undbrea6wi1;ki1;a3ea0W;aEetc0Pit0lBo9r7ulf6;il2;ee0Vigh6ust0Z;te01;r6un5;ebo5th0E;a7o6;a0we3;mi1tte3;di1scina0;m9n7x6;ac0ci0is0;ab2c6du3ga01sQ;han0oura00;barras4erZpowe3;aHeAi6;s6zz0K;appoin0gus0sen0t6;r6u0L;ac0es4;biliBcAfiKgra5m9pres4ser8v6;asAelo6;pi1;vi1;an5eaG;a0BliF;ta0;maMri1sYun0;aMhJlo4o6ripp2ut0;mCn6rrespon5;cerAf9spi3t6vinO;in7r6;as0ibu0ol2;ui1;lic0u4;ni1;fAm9p6;e7ro6;mi4;l2ti1;an5;or0;a6ea0il2;llen6rO;gi1;lMptiva0;e9in5lin5o7rui4u6;d5st2;i2oJri1un6;ci1;coH;bsoOcJgonHlarGmEppea2rCs6;pi3su3to6;n7un5;di1;is6;hi1;ri1;res0;li1;a9u4;si1;mi1;i6zi1;zi1;c6hi1;ele7ompan6;yi1;ra0;ti1;rbi1;ng",
"Adj|Past": "true¦0:2U;1:2L;2:2O;a2Db28c1Qd1Ae14f0Zg0Yh0Vi0Oj0Nknown,l0Km0Fn0Do0Ap03qua02rTsDt9u7v5w3;arp0ea3or5;kHth2N;a3e0U;ri0;ni3pd1s0;fi0t0;ar5hreatCr3wi2M;a3ou18;ck0in0pp0;get0ni1K;aGcaFeEhDimCm00oak0pAt6u3;bsid23gge2Hs3;pe3ta1O;ct0nd0;at0e5r3uU;ength3ip0;en0;am0reotyp0;eci3ik0ott0;al1Vfi0;pHul1;ar0ut;al0c1Fle2t1N;r0tt21;t3ut0;is1Gur1;aAe3;c7duc0f19g6l1new0qu5s3;pe2t3;or0ri2;e1Yir0;ist1Tul1;eiv0o3;mme0Ard0v1R;lli0ti17;li16;arallel0l7o6r3ump0;e4o3;c0Ilo0Hnou1Ppos0te2;fe0Koc8pZ;i1Cli0P;a3e15;nn0;c4rgan17verlo3;ok0;cupi0;e3ot0;ed0gle2;a5e4ix0o3;di0St0E;as0Nlt0;n3rk0;ag0ufact0L;eft,i4o3;ad0st;cens0mit0st0;agg0us0K;mp8n3sol1;br0debt0f6t3volv0;e3ox0C;gr1n3re14;d0si0G;e2oW;li0oMrov0;amm0We1o3;ok0r3;ri0B;ift0one;aMe6i5lavo05ocus0r3;a3i0;ct03g0Hm0;niUx0;ar0;duc1n7quipp0stabliSx3;p3te5;a4e3;ct0rie0N;nd0;ha0LsV;aHe9i3;gniXminiLre2s3;a6c5grun00t3;o3rAurb0;rt0;iplOou04;bl0;cenSdLf7lay0pr6ra5t3velop0;a3ermL;il0;ng0;ess0;e4o3;rm0;rr0;mag0t0;alcul1eGharg0lFo8r5u3;lt3stomQ;iv1;a4owd0u3;sh0;ck0mp0;d0lo8m5n3ok0vV;centr1s3troll0;idTolid1;b4pl3;ic1;in0;ur0;assi5os0;lebr1n5r3;ti3;fi0;tralA;a6i5o3urn0;il0r0t3und;tl0;as0;laIs0;bandon0cJdGffe2lDnBpp9ss7u3ward0;g4thor3;iz0;me3;nt0;o5u3;m0r0;li0re3;ci1;im1ticip1;at0;leg0t3;er0;ct0;ju4o6va3;nc0;st0;ce3knowledg0;pt0;ed",
"Participle": "true¦f4g3h2less6s1w0;ors5ritt5;e4h5;ast3e2;iv2one;l2r0;ight0;en;own",
"Adj|Gerund": "true¦0:2C;1:2E;2:22;3:20;4:24;5:1X;a1Zb1Uc1Cd0Ze0Uf0Kg0Eh0Di07jud1Sl04m01oXpTrNsCt7up6veWw0Lyiel5;lif0sZ;aUe9hr7i3ouc22r6wis0;eZoub2us0yi1;ea0Ji6;l2vi1;l2mp0;atisf28creec1Xhoc0Bkyrocke0lo0ZoEpDt9u7we6;e0Yl2;pp1Gr6;gi1pri4roun5;a7ea1Zi6ri07un18;mula0r3;gge3r6;t2vi1;ark2ee5;a6ot1O;ki1ri1;aAe7ive0o6us1M;a3l2;defi0Zfres1Kig0ZlaCs0v6war5;ea2itali6ol0M;si1zi1;gi1ll1Smb2vi1;a1Rerple8ier19r6un1F;e6o0X;ce5s4vai2;xi1;ffs8pKut7ver6wi1;arc1Blap0Dri5whel1H;goi1l1Lst0U;et0;eande3i7o0Bu6;mb2;s4tiga0;a7i6o08;fesa07mi0vi1;cHg0Rs0;mAn6rri08;c8s7te13vi6;go1Cti1;pi3ul0;orpo1Area4;po4;arrowi1ea2orrif17umilia0;lAr6;a0ipWo7uel6;i1li1;undbrea6wi1;ki1;a3ea0W;aEetc0Pit0lBo9r7ulf6;il2;ee0Vigh6ust0Z;te01;r6un5;ebo5th0E;a7o6;a0we3;mi1tte3;di1scina0;m9n7x6;ac0ci0is0;ab2c6du3ga01sQ;han0oura00;barras4erZpowe3;aHeAi6;s6zz0K;appoin0gus0sen0t6;r6u0L;ac0es4;biliBcAfiKgra5m9pres4ser8v6;asAelo6;pi1;vi1;an5eaG;a0BliF;ta0;maMri1sYun0;aMhJlo4o6ripp2ut0;mCn6rrespon5;cerAf9spi3t6vinO;in7r6;as0ibu0ol2;ui1;lic0u4;ni1;fAm9p6;e7ro6;mi4;l2ti1;an5;or0;a6ea0il2;llen6rO;gi1;lMptiva0;e9in5lin5o7rui4u6;d5st2;i2oJri1un6;ci1;coH;bsoOcJgonHlarGmEppea2rCs6;pi3su3to6;n7un5;di1;is6;hi1;ri1;res0;li1;a9u4;si1;mi1;i6zi1;zi1;c6hi1;ele7ompan6;yi1;ra0;ti1;rbi1;ng",
"Adj|Past": "true¦0:2T;1:2K;2:2N;3:23;a2Db28c1Qd1Ae14f0Zgift0h0Wi0Pj0Oknown,l0Lm0Gn0Eo0Bp04qua03rUsEtAu8v6w4;arp0ea4or6;kIth2N;a4e0V;ri0;ni4pd1s0;fi0t0;ar6hreatDr4wi2M;a4ou18;ck0in0pp0;get0ni1K;aHcaGeFhEimDm01oak0pBt7u4;bsid23gge2Hs4;pe4ta1O;ct0nd0;at0e6r4uV;ength4ip0;en0;am0reotyp0;eci4ik0ott0;al1Vfi0;pIul1;ar0ut;al0c1Fle2t1N;r0tt21;t4ut0;is3ur1;aBe4;c8duc0f19g7l1new0qu6s4;pe2t4;or0ri2;e1Yir0;ist1Tul1;eiv0o4;mme0Ard0v1R;lli0ti3;li3;arallel0l8o7r4ump0;e5o4;c0Ilo0Hnou1Ppos0te2;fe0Koc9pZ;i1Cli0P;a4e15;nn0;c5rgan17verlo4;ok0;cupi0;e4ot0;ed0gle2;a6e5ix0o4;di3t0E;as0Nlt0;n4rk0;ag0ufact0L;eft,i5o4;ad0st;cens0mit0st0;agg0us0K;mp9n4sol1;br0debt0f7t4volv0;e4ox0C;gr1n4re14;d0si3;e2oW;li0oMrov0;amm0We1o4;ok0r4;ri3;aNe7i6lavo06ocus0r4;a4i0;ct04g0Im0;niVx0;ar0;duc1n8quipp0stabliTx4;p4te6;a5e4;ct0rie0O;nd0;ha0MsW;aIeAi4;gni3miniMre2s4;a7c6grun01t4;o4rBurb0;rt0;iplPou05;bl0;cenTdMf8lay0pr7ra6t4velop0;a4ermM;il0;ng0;ess0;e5o4;rm0;rr0;mag0t0;alcul1eHharg0lGo9r6u4;lt4stomR;iv1;a5owd0u4;sh0;ck0mp0;d0lo9m6n4ok0vW;centr1s4troll0;idUolid1;b5pl4;ic1;in0;ur0;assi3os0;lebr1n6r4;ti3;fi0;tralB;a7i6o4urn0;il0r0t4und;tl0;as0;laJs0;bandon0cKdHffe2lEnCppAss8u4ward0;g5thor4;iz0;me4;nt0;o6u4;m0r0;li0re4;ci1;im1ticip1;at0;leg0t4;er0;ct0;ju5o7va4;nc0;st0;ce4knowledg0;pt0;ed",
"Person|Verb": "true¦b1chu2drew,grant,ja2ma0ollie,pat,rob,sue,wade;ck,rk;ob,u0;ck",
"Person|Place": "true¦alexand5darwin,h3jordan,k2orlando,s0victo5;a0ydney;lvador,mara,ntiago;ent,obe;amil0ous0;ton;ria",
"Person|Date": "true¦a2j0sep;an0une;!uary;p0ugust,v0;ril",
"Person|Verb": "true¦b1chu2drew,ja2ma0ollie,pat,rob,sue,wade;ck,rk;ob,u0;ck"
"Person|Date": "true¦a2j0sep;an0une;!uary;p0ugust,v0;ril"
}

@@ -30,3 +30,3 @@ import lexData from './_data.js'

switches[w] = tag
// pluralize Infinitive|Singular
// pluralize Noun|Verb switches
if (tag === 'Noun|Verb') {

@@ -33,0 +33,0 @@ let plural = toPlural(w, tmpModel)

@@ -96,3 +96,3 @@ //regex suffix patterns and their most common parts of speech,

[/[^aeiou]ician$/, Actor, 'musician'],
[/[aeiou][ktrp]in$/, 'Gerund', "cookin'"], // 'cookin', 'hootin'
[/[aeiou][ktrp]in'$/, 'Gerund', "cookin'"], // 'cookin', 'hootin'
],

@@ -99,0 +99,0 @@ o: [

@@ -49,4 +49,2 @@ const vb = 'Verb'

['Modal', nn],
['Pluperfect', nn],
['PerfectTense', vb], //32%
],

@@ -60,2 +58,3 @@ // looking at the next word:

['him', vb],
['it', vb],//relaunch it
['were', nn],

@@ -62,0 +61,0 @@ ['took', nn],

@@ -50,3 +50,3 @@ //just a foolish lookup of known suffixes

nny: Adj,
oid: Adj,
// oid: Adj,
ous: Adj,

@@ -68,3 +68,2 @@ que: Adj,

ign: Inf,
ect: Inf,
ful: Adj,

@@ -111,3 +110,3 @@ bal: Adj,

sson: Last,
tage: Inf,
// tage: Inf,
tion: Sing,

@@ -155,3 +154,2 @@ tage: Noun,

phite: Sing,
alist: Sing,
tized: Past,

@@ -170,2 +168,3 @@ urned: Past,

osome: Sing,
tment: Sing,
ports: Plrl,

@@ -179,3 +178,2 @@ rough: Adj,

archy: Noun,
dient: Noun,
pathy: Noun,

@@ -182,0 +180,0 @@ opoly: Noun,

@@ -29,3 +29,3 @@ const anything = ['Noun', 'Verb', 'Adjective', 'Adverb', 'Value', 'QuestionWord']

Preposition: {
not: ['Noun', 'Verb', 'Adjective', 'Adverb', 'QuestionWord'],
not: ['Noun', 'Verb', 'Adjective', 'Adverb', 'QuestionWord', 'Determiner'],
},

@@ -66,7 +66,7 @@ QuestionWord: {

Negative: {
not: ['Noun', 'Adjective', 'Value'],
not: ['Noun', 'Adjective', 'Value', 'Expression'],
},
Condition: {
not: ['Verb', 'Adjective', 'Noun', 'Value'],
},
}
}

@@ -11,2 +11,3 @@ const entity = ['Person', 'Place', 'Organization']

},
// 'Canada'
ProperNoun: {

@@ -35,2 +36,3 @@ is: 'Noun',

},
// 'dr.'
Honorific: {

@@ -54,2 +56,3 @@ is: 'Noun',

},
// 'california'
Region: {

@@ -79,5 +82,7 @@ is: 'Place',

},
// 'gravity'
Uncountable: {
is: 'Noun',
},
// 'it'
Pronoun: {

@@ -87,2 +92,3 @@ is: 'Noun',

},
// 'swimmer'
Actor: {

@@ -92,2 +98,3 @@ is: 'Noun',

},
// walking
Activity: {

@@ -97,2 +104,3 @@ is: 'Noun',

},
// kilometres
Unit: {

@@ -102,2 +110,3 @@ is: 'Noun',

},
// canadian
Demonym: {

@@ -108,5 +117,10 @@ is: 'Noun',

},
// [spencer's] hat
Possessive: {
is: 'Noun',
},
// 'yourself'
Reflexive: {
is: 'Pronoun',
},
}

@@ -18,3 +18,3 @@ export default {

Multiple: {
is: 'Value',
is: 'TextValue',
},

@@ -21,0 +21,0 @@ RomanNumeral: {

@@ -5,2 +5,3 @@ export default {

},
// 'he [walks]'
PresentTense: {

@@ -10,2 +11,3 @@ is: 'Verb',

},
// 'will [walk]'
Infinitive: {

@@ -15,5 +17,7 @@ is: 'PresentTense',

},
// '[walk] now!'
Imperative: {
is: 'Infinitive',
},
// walking
Gerund: {

@@ -23,2 +27,3 @@ is: 'PresentTense',

},
// walked
PastTense: {

@@ -28,5 +33,7 @@ is: 'Verb',

},
// is/was
Copula: {
is: 'Verb',
},
// '[could] walk'
Modal: {

@@ -36,15 +43,16 @@ is: 'Verb',

},
PerfectTense: {
is: 'Verb',
not: ['Gerund'],
// 'awaken'
Participle: {
is: 'PastTense',
},
Pluperfect: {
// '[will have had] walked'
Auxiliary: {
is: 'Verb',
not: ['PastTense', 'PresentTense', 'Gerund', 'Conjunction'],
},
Participle: {
is: 'PastTense',
},
// 'walk out'
PhrasalVerb: {
is: 'Verb',
},
// 'walk [out]'
Particle: {

@@ -54,6 +62,2 @@ is: 'PhrasalVerb',

},
Auxiliary: {
is: 'Verb',
not: ['PastTense', 'PresentTense', 'Gerund', 'Conjunction'],
},
}

@@ -1,17 +0,8 @@

import selections from './selections/index.js'
import clauses from './clauses.js'
import quotations from './quotations.js'
import parentheses from './parentheses.js'
import getChunks from './chunks.js'
const chunker = function (View) {
View.prototype.chunks = function () {
return getChunks(this)
}
selections(View)
const api = function (View) {
View.prototype.chunks = getChunks
View.prototype.clauses = clauses
View.prototype.quotations = quotations
View.prototype.parentheses = parentheses
}
export default chunker
export default api

@@ -1,6 +0,6 @@

const chunks = function (view) {
const chunks = function () {
let carry = []
let roll = null
let same = null
view.docs.forEach(terms => {
this.docs.forEach(terms => {
terms.forEach(term => {

@@ -21,4 +21,5 @@ // start a new chunk

}
return view.update(carry)
return this.update(carry)
}
export default chunks

@@ -1,4 +0,1 @@

// const byWord = {
// that: 'Conjunction',
// }

@@ -25,8 +22,5 @@ // simply chunk Nouns as <Noun>

if (term.tags.has('QuestionWord')) {
term.chunk = 'Conjunction'
term.chunk = 'Pivot'
continue
}
// if (byWord.hasOwnProperty(term.normal)) {
// term.chunk = byWord[term.normal]
// }
}

@@ -33,0 +27,0 @@ }

@@ -21,2 +21,4 @@ const rules = [

{ match: '#Adverb+ {Verb}', chunk: 'Verb' },
// quickly and suddenly run
{ match: '#Adverb+ and #Adverb #Verb', chunk: 'Verb' },
// run quickly

@@ -40,2 +42,10 @@ { match: '{Verb} #Adverb+', chunk: 'Verb' },

{ match: '(want|wants|wanted) to #Infinitive', chunk: 'Verb' },
// walk ourselves
{ match: '#Verb #Reflexive', chunk: 'Verb' },
// tell him the story
{ match: '#Verb [#Pronoun] #Determiner', group: 0, chunk: 'Verb' },
// tries to walk
{ match: '#Verb [to] #Adverb? #Infinitive', group: 0, chunk: 'Verb' },
// upon seeing
{ match: '[#Preposition] #Gerund', group: 0, chunk: 'Verb' },

@@ -46,3 +56,3 @@ // === Noun ===

// the fox
{ match: '#Determiner <Noun>', chunk: 'Noun' },
{ match: '(the|this) <Noun>', chunk: 'Noun' },
// brown fox

@@ -56,3 +66,3 @@ { match: '#Adjective+ <Noun>', chunk: 'Noun' },

// indoor and outdoor seating
{ match: '#Noun and #Determiner? #Noun', chunk: 'Noun' },
{ match: '#Singular and #Determiner? #Singular', chunk: 'Noun' },
// that is why

@@ -68,4 +78,4 @@ // { match: '[that] (is|was)', group: 0, chunk: 'Noun' },

terms.forEach(term => {
if (term.chunk) {
return //don't overwrite
if (term.chunk === todo.chunk) {
return
}

@@ -72,0 +82,0 @@ if (env.DEBUG_CHUNKS) {

const fixUp = function (docs) {
let byChunk = []
let current = null
docs.forEach(terms => {

@@ -6,12 +8,26 @@ // ensure an adjective chunk is preceded by a copula

let term = terms[i]
if (term.tags.has('#Copula')) {
return
if (current && term.chunk === current) {
byChunk[byChunk.length - 1].terms.push(term)
} else {
byChunk.push({ chunk: term.chunk, terms: [term] })
current = term.chunk
}
if (term.chunk === 'Adjective') {
term.chunk = 'Noun'
// console.log(`✗ ${term.normal}`)
}
})
// ensure every verb-phrase actually has a verb
byChunk.forEach(c => {
if (c.chunk === 'Verb') {
const hasVerb = c.terms.find(t => t.tags.has('Verb'))
if (!hasVerb) {
c.terms.forEach(t => t.chunk = null)
}
}
if (c.chunk === 'Noun') {
const hasNoun = c.terms.find(t => t.tags.has('Noun'))
if (!hasNoun) {
c.terms.forEach(t => t.chunk = null)
}
}
})
}
export default fixUp

@@ -7,5 +7,5 @@ import easyMode from './01-easy.js'

Noun
.Verb
Verb
Adjective
Preposition
Pivot
*/

@@ -12,0 +12,0 @@

@@ -55,2 +55,5 @@ import find from './find.js'

let str = toOrdinal(obj)
if (m.after('^#Noun').found) {
str += ' of' // three fifths of dentists
}
m.replaceWith(str)

@@ -57,0 +60,0 @@ })

@@ -7,6 +7,6 @@ import toText from '../../numbers/format/toText/index.js'

}
let a = toText(obj.numerator)
let b = toText(obj.denominator)
let a = toText({ num: obj.numerator })
let b = toText({ num: obj.denominator })
return `${a} out of ${b}`
}
export default toCardinal

@@ -10,4 +10,4 @@ import toText from '../../numbers/format/toText/index.js'

// create [two] [fifths]
let start = toText(obj.numerator)
let end = textOrdinal(obj.denominator)
let start = toText({ num: obj.numerator })
let end = textOrdinal({ num: obj.denominator })
// 'one secondth' -> 'one half'

@@ -14,0 +14,0 @@ if (obj.denominator === 2) {

@@ -8,2 +8,5 @@ const findFractions = function (doc, n) {

})
// thirty seconds
m = m.notIf('#Value seconds')
if (typeof n === 'number') {

@@ -10,0 +13,0 @@ m = m.eq(n)

import find from './find.js'
import parse from './parse/index.js'
import format from './format/index.js'
import parseText from './parse/toNumber/index.js'

@@ -20,5 +19,3 @@ // return the nth elem of a doc

get(n) {
return getNth(this, n)
.map(parse)
.map(o => o.num)
return getNth(this, n).map(parse).map(o => o.num)
}

@@ -44,3 +41,3 @@ json(n) {

/** return only cardinal numbers*/
isCardina() {
isCardinal() {
return this.if('#Cardinal')

@@ -94,3 +91,3 @@ }

if (obj.num === null) {
return
return val
}

@@ -108,3 +105,3 @@ let fmt = val.has('#Ordinal') ? 'TextOrdinal' : 'TextCardinal'

let m = this
let res = m.forEach(val => {
let res = m.map(val => {
if (!val.has('#Ordinal')) {

@@ -115,3 +112,3 @@ return val

if (obj.num === null) {
return
return val
}

@@ -122,2 +119,3 @@ let fmt = val.has('#TextValue') ? 'TextCardinal' : 'Cardinal'

val.tag('Cardinal')
return val
})

@@ -135,3 +133,3 @@ return new Numbers(res.document, res.pointer)

if (obj.num === null) {
return
return val
}

@@ -176,3 +174,3 @@ let fmt = val.has('#TextValue') ? 'TextOrdinal' : 'Ordinal'

/** set these number to n */
set(n, agree) {
set(n) {
if (n === undefined) {

@@ -189,3 +187,3 @@ return this // don't bother

if (obj.num === null) {
return
return val
}

@@ -197,2 +195,6 @@ let fmt = val.has('#Ordinal') ? 'Ordinal' : 'Cardinal'

let str = format(obj, fmt)
// add commas to number
if (obj.hasComma && fmt === 'Cardinal') {
str = Number(str).toLocaleString()
}
val = val.not('#Currency')

@@ -206,3 +208,3 @@ val.replaceWith(str, { tags: true })

}
add(n, agree) {
add(n) {
if (!n) {

@@ -218,3 +220,3 @@ return this // don't bother

if (obj.num === null) {
return
return val
}

@@ -227,3 +229,2 @@ obj.num += n

let str = format(obj, fmt)
val = val.not('#Currency')
val.replaceWith(str, { tags: true })

@@ -230,0 +231,0 @@ // handle plural/singular unit

@@ -19,4 +19,8 @@ import numOrdinal from './toOrdinal/numOrdinal.js'

// assume Cardinal
return obj.prefix + String(obj.num) + obj.suffix
let num = obj.num
if (obj.hasComma) {
num = num.toLocaleString()
}
return obj.prefix + String(num) + obj.suffix
}
export default format
import parseText from './toNumber/index.js'
import parseFraction from '../../fractions/parse.js'
const parseNumeric = function (str, p, isFraction) {
const parseNumeric = function (str, m) {
str = str.replace(/,/g, '')
//parse a numeric-number (easy)
let arr = str.split(/^([^0-9]*)([0-9.,]*)([^0-9]*)$/)
if (arr && arr[2] && p.terms().length < 2) {
let num = parseFloat(arr[2] || str)
//parse a numeric-number
let arr = str.split(/([0-9.,]*)/)
let [prefix, num] = arr
let suffix = arr.slice(2).join('')
if (num !== '' && m.length < 2) {
num = Number(num || str)
//ensure that num is an actual number

@@ -15,3 +17,3 @@ if (typeof num !== 'number') {

// strip an ordinal off the suffix
let suffix = arr[3] || ''
suffix = suffix || ''
if (suffix === 'st' || suffix === 'nd' || suffix === 'rd' || suffix === 'th') {

@@ -21,13 +23,12 @@ suffix = ''

// support M for million, k for thousand
if (suffix === 'm' || suffix === 'M') {
num *= 1000000
suffix = ''
}
if (suffix === 'k' || suffix === 'k') {
num *= 1000
suffix = ''
}
num = isFraction ? 1 / num : num
// if (suffix === 'm' || suffix === 'M') {
// num *= 1000000
// suffix = ''
// }
// if (suffix === 'k' || suffix === 'k') {
// num *= 1000
// suffix = ''
// }
return {
prefix: arr[1] || '',
prefix: prefix || '',
num: num,

@@ -49,6 +50,8 @@ suffix: suffix,

// parse a numeric-number like '$4.00'
let res = parseNumeric(str, m)
if (res !== null) {
res.hasComma = hasComma
return res
if (m.terms().length === 1 && !m.has('#Multiple')) {
let res = parseNumeric(str, m)
if (res !== null) {
res.hasComma = hasComma
return res
}
}

@@ -55,0 +58,0 @@ // -- parse text-formats --

@@ -1,6 +0,7 @@

import questions from './questions.js'
import parse from './parse.js'
import isQuestion from './questions.js'
import parse from './parse/index.js'
import toPast from './conjugate/toPast.js'
import toPresent from './conjugate/toPresent.js'
import toFuture from './conjugate/toFuture.js'
import { toNegative, toPositive } from './conjugate/toNegative.js'
import toInfinitive from './conjugate/toInfinitive.js'

@@ -17,33 +18,62 @@

}
json(opts = {}) {
return this.map(m => {
let json = m.toView().json(opts)[0] || {}
let { subj, verb, pred } = parse(m)
json.sentence = {
subject: subj.text('normal'),
verb: verb.text('normal'),
predicate: pred.text('normal'),
}
return json
}, [])
}
toPastTense(n) {
return getNth(this, n).map(vb => {
let parsed = parse(vb)
return toPast(vb, parsed)
return getNth(this, n).map(s => {
let parsed = parse(s)
return toPast(s, parsed)
})
}
toPresentTense(n) {
return getNth(this, n).map(vb => {
let parsed = parse(vb)
return toPresent(vb, parsed)
return getNth(this, n).map(s => {
let parsed = parse(s)
return toPresent(s, parsed)
})
}
toFutureTense(n) {
return getNth(this, n).map(s => {
let parsed = parse(s)
s = toFuture(s, parsed)
return s
})
}
toInfinitive(n) {
return getNth(this, n).map(s => {
let parsed = parse(s)
return toInfinitive(s, parsed)
})
}
toNegative(n) {
return getNth(this, n).map(vb => {
let parsed = parse(vb)
return toFuture(vb, parsed)
return toNegative(vb, parsed)
})
}
toInfinitive(n) {
toPositive(n) {
return getNth(this, n).map(vb => {
let parsed = parse(vb)
return toInfinitive(vb, parsed)
return toPositive(vb, parsed)
})
}
toNegative(n) {
// return getNth(this, n).map(vb => {
// let parsed = parse(vb)
// return toInfinitive(vb, parsed)
// })
return this
isQuestion(n) {
return this.questions(n)
}
isExclamation(n) {
let res = this.filter(s => s.lastTerm().has('@hasExclamation'))
return getNth(res, n)
}
isStatement(n) {
let res = this.filter(s => !s.isExclamation().found && !s.isQuestion().found)
return getNth(res, n)
}
// overloaded - keep Sentences class

@@ -68,3 +98,3 @@ update(pointer) {

questions: function (n) {
let m = questions(this)
let m = isQuestion(this)
return getNth(m, n)

@@ -71,0 +101,0 @@ },

const toFuture = function (s) {
let verbs = s.verbs()
// translate the first verb, no-stress
let first = verbs.eq(0)
first.toFutureTense()
s = s.fullSentence()

@@ -16,10 +14,8 @@ verbs = s.verbs()//re-do it

verbs = verbs.filter((v) => !v.lookBehind('to$').found)
// verbs.debug()
// otherwise, I guess so?
if (verbs.found) {
verbs.verbs().toFutureTense()
verbs.verbs().toInfinitive()
}
}
// s = s.fullSentence()

@@ -26,0 +22,0 @@ // s.compute('chunks')

const toPast = function (s) {
let verbs = s.verbs()
// translate the first verb, no-stress
let first = verbs.eq(0)
// already past
if (verbs.has('#PastTense')) {
if (first.has('#PastTense')) {
return s
}
// translate the first verb, no-stress
let first = verbs.eq(0)
first.toPastTense()

@@ -18,5 +16,6 @@

verbs = verbs.filter((v) => !v.lookBehind('to$').found)
// keep -ing verbs
verbs = verbs.if('#PresentTense')
verbs = verbs.if('!#Gerund')
verbs = verbs.notIf('#Gerund')

@@ -23,0 +22,0 @@ //run-on infinitive-list - 'to walk, sit and eat'

const toPresent = function (s) {
s.verbs().toPresentTense()
let verbs = s.verbs()
// translate the first verb, no-stress
let first = verbs.eq(0)
// already present
// if (first.has('#PresentTense')) {
// return s
// }
first.toPresentTense()
// force agreement with any 2nd/3rd verbs:
if (verbs.length > 1) {
verbs = verbs.slice(1)
// remove any sorta infinitive - 'to engage'
verbs = verbs.filter((v) => !v.lookBehind('to$').found)
// keep -ing verbs
// verbs = verbs.if('#PresentTense')
verbs = verbs.notIf('#Gerund')
//run-on infinitive-list - 'to walk, sit and eat'
// let list = s.match('to #Verb+ #Conjunction #Verb').terms()
// verbs = verbs.not(list)
// otherwise, I guess so?
if (verbs.found) {
verbs.verbs().toPresentTense()
}
}
// s.compute('chunks')

@@ -4,0 +32,0 @@ return s

import api from './api.js'
export default { api }

@@ -47,5 +47,5 @@ //is this sentence asking a question?

// e.g., Anyway the wind blows, what doesn't really matter to me
if (clauses.has('^#QuestionWord')) {
return true
}
// if (clauses.has('^#QuestionWord')) {
// return true
// }

@@ -52,0 +52,0 @@ //is wayne gretskzy alive

@@ -7,3 +7,2 @@ import find from './find.js'

const addMethod = function (View) {
View.prototype.places = function (n) {

@@ -10,0 +9,0 @@ let m = find(this)

@@ -13,4 +13,4 @@ // return the nth elem of a doc

//return them to normal ordering
m.sort('sequence')
// yup.unique() //? not sure
m = m.sort('seq')
// m = m.unique()
m = getNth(m, n)

@@ -22,5 +22,3 @@ return m

View.prototype.topics = find
// aliases
View.prototype.entities = find
}
export default api

@@ -12,3 +12,5 @@ import find from '../find.js'

import toNegative from './conjugate/toNegative.js'
// import debug from './debug.js'
// return the nth elem of a doc

@@ -41,2 +43,5 @@ export const getNth = (doc, n) => (typeof n === 'number' ? doc.eq(n) : doc)

}
adverbs(n) {
return getNth(this, n).map(vb => vb.match('#Adverb'))
}
isSingular(n) {

@@ -43,0 +48,0 @@ return getNth(this, n).filter(vb => {

@@ -7,2 +7,6 @@ import { noop, getTense } from '../lib.js'

const { root, auxiliary } = parsed
// 'i may'
if (root.has('#Modal')) {
return vb
}
let str = root.text('normal')

@@ -53,3 +57,3 @@ str = verbToInfinitive(str, vb.model, getTense(root))

// has walked ->
'present-perfect': (vb, parsed) => {
'present-perfect': (vb) => {
vb.match('(have|has)').replaceWith('will have')

@@ -64,3 +68,3 @@ return vb

// has been walking
'present-perfect-progressive': vb => vb.replace('has', 'will have',),
'present-perfect-progressive': vb => vb.replace('has', 'will have'),
// had been walking

@@ -123,2 +127,8 @@ 'past-perfect-progressive': vb => vb.replace('had', 'will have'),

'modal-past': noop,
// started looking
'gerund-phrase': (vb, parsed) => {
parsed.root = parsed.root.not('#Gerund$')
simple(vb, parsed)
return vb.remove('(had|have)')
},
// wanted to walk

@@ -125,0 +135,0 @@ 'want-infinitive': vb => {

@@ -1,2 +0,2 @@

import { getTense } from '../lib.js'
import { getTense, isAreAm } from '../lib.js'
const keep = { tags: true }

@@ -6,2 +6,3 @@

const toGerund = function (vb, parsed) {
// console.log(form)
const { verbToInfinitive, verbConjugate } = vb.methods.two.transform

@@ -12,15 +13,21 @@ const { root, auxiliary } = parsed

}
// conjugate '-ing' verb
let str = root.text('normal')
str = verbToInfinitive(str, vb.model, getTense(root))
let gerund = verbConjugate(str, vb.model).Gerund
// 'are walking', 'is walking'
if (gerund) {
gerund = `${isAreAm(vb, parsed)} ${gerund}`
// console.log(root, gerund)
// vb.match(root).debug()
vb.replace(root, gerund, keep)
}
// remove any auxiliary
// remove any existing auxiliary
if (auxiliary.found) {
auxiliary.terms().forEach(m => {
vb.remove(m) //super awkward
})
vb.remove(auxiliary)
}
// remove any auxiliary
vb.replace('not is', 'is not')
vb.replace('not are', 'are not')
vb.fullSentence().compute(['preTagger', 'postTagger', 'chunks'])

@@ -27,0 +34,0 @@ return vb

@@ -53,2 +53,3 @@ import { doDoes, toInf } from '../lib.js'

vb = toInf(vb, parsed)
// vb.debug()
// did not walk

@@ -60,3 +61,3 @@ vb.prepend('did not')

// walk! -> 'do not walk'
'imperative': (vb, parsed) => {
'imperative': (vb) => {
vb.prepend('do not')

@@ -73,3 +74,3 @@ return vb

'passive-past': (vb, parsed) => {
'passive-past': (vb) => {
// got walked -> did not get walked

@@ -90,3 +91,3 @@ if (vb.has('got')) {

},
'auxiliary-past': (vb, parsed) => {
'auxiliary-past': (vb) => {
// used to walk

@@ -93,0 +94,0 @@ if (vb.has('used')) {

@@ -1,2 +0,2 @@

import { noop, getTense, isPlural } from '../lib.js'
import { noop, getTense, wasWere, noWill } from '../lib.js'
const keep = { tags: true }

@@ -17,2 +17,6 @@

const root = parsed.root
// 'i may'
if (root.has('#Modal')) {
return vb
}
let str = root.text({ keepPunct: false })

@@ -26,4 +30,4 @@ str = verbToInfinitive(str, vb.model, getTense(root))

str = str === 'been' ? 'was' : str
if (str === 'was' && isPlural(vb, parsed)) {
str = 'were'
if (str === 'was') {
str = wasWere(vb, parsed)
}

@@ -63,2 +67,4 @@ if (str) {

}

@@ -99,3 +105,6 @@

vb.match(parsed.root).insertBefore('had')
vb.remove('(will|have)')
if (vb.has('will')) {
vb = noWill(vb)
}
vb.remove('have')
return vb

@@ -184,2 +193,9 @@ },

},
// started looking
'gerund-phrase': (vb, parsed) => {
parsed.root = parsed.root.not('#Gerund$')
fns.simple(vb, parsed)
noWill(vb)
return vb
},
}

@@ -186,0 +202,0 @@

@@ -9,3 +9,2 @@ import { noop, isPlural, isAreAm, doDoes, getSubject, toInf, getTense } from '../lib.js'

let str = root.text('normal')
str = verbToInfinitive(str, vb.model, getTense(root))

@@ -24,2 +23,3 @@ // 'i walk' vs 'he walks'

}
// vb.replace('not ' + str, str + ' not')
return vb

@@ -90,2 +90,3 @@ }

vb = vb.remove('will')
vb.replace('not ' + str, str + ' not')
} else {

@@ -114,3 +115,4 @@ simple(vb, parsed)

'present-perfect': (vb, parsed) => {
// return vb.replace('(have|had)', 'has')
simple(vb, parsed)
vb = vb.remove('(have|had|has)')
return vb

@@ -205,2 +207,8 @@ },

},
// started looking
'gerund-phrase': (vb, parsed) => {
parsed.root = parsed.root.not('#Gerund$')
simple(vb, parsed)
return vb.remove('(will|have)')
},
// wanted to walk

@@ -207,0 +215,0 @@ 'want-infinitive': (vb, parsed) => {

@@ -5,13 +5,2 @@ /* eslint-disable no-console */

const reset = '\x1b[0m'
// const c = {
// green: str => '\x1b[32m' + str + reset,
// red: str => '\x1b[31m' + str + reset,
// blue: str => '\x1b[34m' + str + reset,
// magenta: str => '\x1b[35m' + str + reset,
// cyan: str => '\x1b[36m' + str + reset,
// yellow: str => '\x1b[33m' + str + reset,
// black: str => '\x1b[30m' + str + reset,
// dim: str => '\x1b[2m' + str + reset,
// italic: str => '\x1b[3m' + str + reset,
// }
const yellow = str => `\x1b[2m\x1b[33m\x1b[3m ${str} ${reset}`

@@ -47,4 +36,4 @@ const bgGreen = str => `\x1b[42m\x1b[30m •${str}• ${reset}`

// call the original debug
vb.update(vb.pointer).debug()
// vb.update(vb.pointer).debug()
}
export default debug

@@ -14,2 +14,10 @@ import getSubject from './parse/getSubject.js'

const wasWere = (vb, parsed) => {
let { subject, plural } = getSubject(vb, parsed)
if (plural || subject.has('we')) {
return 'were'
}
return 'was'
}
// present-tense copula

@@ -46,13 +54,2 @@ const isAreAm = function (vb, parsed) {

const toInf = function (vb, parsed) {
const { verbToInfinitive } = vb.methods.two.transform
let str = parsed.root.text({ keepPunct: false })
str = verbToInfinitive(str, vb.model)
if (str) {
vb.replace(parsed.root, str)
}
return vb
}
const getTense = function (m) {

@@ -74,2 +71,23 @@ if (m.has('#Participle')) {

export { noop, isPlural, isAreAm, doDoes, toInf, getSubject, getTense }
const toInf = function (vb, parsed) {
const { verbToInfinitive } = vb.methods.two.transform
let str = parsed.root.text({ keepPunct: false })
str = verbToInfinitive(str, vb.model, getTense(vb))
if (str) {
vb.replace(parsed.root, str)
}
return vb
}
// i will start looking -> i started looking
// i will not start looking -> i did not start looking
const noWill = (vb) => {
if (vb.has('will not')) {
return vb.replace('will not', 'have not')
}
return vb.remove('will')
}
export { noop, isPlural, isAreAm, doDoes, toInf, getSubject, getTense, wasWere, noWill }

@@ -19,3 +19,3 @@ // split adverbs as before/after the root

// it must be the second one
if (parts.eq(0).is(root)) {
if (parts.eq(0).isDoc(root)) {
res.post = parts.eq(1).adverbs()

@@ -22,0 +22,0 @@ return res

@@ -16,3 +16,3 @@ const shouldSkip = function (last) {

// if it was raining..
if (m.has('^(if|unless|while|but|for|per)')) {
if (m.has('^(if|unless|while|but|for|per|at|by|that|which|who|from)')) {
return false

@@ -57,3 +57,3 @@ }

if (nouns.found === false) {
let det = before.match('^(that|this|those)')
det = before.match('^(that|this|those)')
if (det.found) {

@@ -80,6 +80,6 @@ return det

// 'we are' vs 'he is'
if (vb.has('are')) {
if (vb.has('(are|were|does)')) {
return true
}
if (subj.has('(those|they)')) {
if (subj.has('(those|they|we)')) {
return true

@@ -86,0 +86,0 @@ }

@@ -25,2 +25,24 @@ const present = { tense: 'PresentTense' }

],
'want-infinitive': [
['^(want|wants|wanted) to #Infinitive$', [present]],
['^wanted to #Infinitive$', [past]],
['^will want to #Infinitive$', [future]],
],
'gerund-phrase': [
// started looking
['^#PastTense #Gerund$', [past]],
// starts looking
['^#PresentTense #Gerund$', [present]],
// start looking
['^#Infinitive #Gerund$', [present]],
// will start looking
['^will #Infinitive #Gerund$', [future]],
// have started looking
['^have #PastTense #Gerund$', [past]],
// will have started looking
['^will have #PastTense #Gerund$', [past]],
],
'simple-present': [

@@ -38,3 +60,3 @@ // he walks',

// he will walk
['^will #Infinitive$', [future]],
['^will #Adverb? #Infinitive', [future]],
],

@@ -64,2 +86,4 @@

['^had #PastTense$', [past, complete]],
// had been to see
['^had #PastTense to #Infinitive', [past, complete]],
],

@@ -140,7 +164,2 @@ 'future-perfect': [

],
'want-infinitive': [
['^(want|wants|wanted) to #Infinitive$', [present]],
['^wanted to #Infinitive$', [past]],
['^will want to #Infinitive$', [future]],
],
'modal-infinitive': [

@@ -147,0 +166,0 @@ // he can walk

@@ -13,4 +13,4 @@ import forms from './forms.js'

// remove negatives
if (vb.has('not')) {
vb = vb.remove('not')
if (vb.has('#Negative')) {
vb = vb.remove('#Negative')
}

@@ -27,2 +27,3 @@ // remove prefixes like 'anti'

// vb = vb.remove('#Adverb')
vb = vb.not('#Adverb')
return vb

@@ -29,0 +30,0 @@ }

@@ -9,4 +9,4 @@ import getRoot from './root.js'

}
let aux = parts.eq(0).clone()
aux.remove('(#Adverb|#Negative|#Prefix)')
let aux = parts.eq(0)
aux = aux.not('(#Adverb|#Negative|#Prefix)')
return aux

@@ -13,0 +13,0 @@ }

@@ -6,3 +6,2 @@ // find the main verb, from a verb phrase

root = vb.not('(#Negative|#Auxiliary|#Modal|#Adverb|#Prefix)')
// main = main.match('!#Particle')
}

@@ -15,8 +14,3 @@ // fallback to just the last word, sometimes

root = root.not('(want|wants|wanted) to')
// look for more auxiliaries
// if (root.has('was #Verb')) {
// root = root.not('was')
// }
// root = root.not('[(want|wants|wanted) to] #PresentTense', 0)
// fallback

@@ -23,0 +17,0 @@ if (!root.found) {

@@ -31,2 +31,4 @@ const findVerbs = function (doc) {

}
// 'allow yourself'
m = m.not('#Reflexive$')
//ensure there's actually a verb

@@ -33,0 +35,0 @@ m = m.if('#Verb')

/** add words to assume by prefix in typeahead */
/** log the decision-making to console */

@@ -15,6 +11,2 @@ const verbose = function (set) {

/** pre-compile a list of matches to lookup */
const compile = function (input) {
return this().compile(input)
}
export { verbose, compile }
export { verbose }
const isObject = function (item) {
// let isSet = item instanceof Set
return item && typeof item === 'object' && !Array.isArray(item)

@@ -13,2 +12,5 @@ }

mergeDeep(model[key], plugin[key]) //recursion
// } else if (isArray(plugin[key])) {
// console.log(key)
// console.log(model)
} else {

@@ -15,0 +17,0 @@ Object.assign(model, { [key]: plugin[key] })

@@ -21,4 +21,11 @@ const forEach = function (cb) {

// user can return either from their callback
if (res[0] !== undefined && typeof res[0] === 'object' && (res[0] === null || !res[0].isView)) {
return res
if (res[0] !== undefined) {
// array of strings
if (typeof res[0] === 'string') {
return res
}
// array of objects
if (typeof res[0] === 'object' && (res[0] === null || !res[0].isView)) {
return res
}
}

@@ -25,0 +32,0 @@ // return a View object

@@ -78,3 +78,3 @@ const utils = {

/** are these two views looking at the same words? */
is: function (b) {
isDoc: function (b) {
if (!b || !b.isView) {

@@ -81,0 +81,0 @@ return false

@@ -59,3 +59,3 @@ import world from './world.js'

return pointers.map(a => {
let [n, start, end, id] = a
let [n, start, end, id, endId] = a
start = start || 0

@@ -66,4 +66,7 @@ end = end || (document[n] || []).length

id = id || document[n][start].id
if (document[n][end - 1]) {
endId = endId || document[n][end - 1].id
}
}
return [n, start, end, id]
return [n, start, end, id, endId]
})

@@ -98,7 +101,7 @@ }

fromText(input) {
const { methods, world } = this
const { methods } = this
//assume ./01-tokenize is installed
let document = methods.one.tokenize(input, world)
let document = methods.one.tokenize.fromString(input, this.world)
let doc = new View(document)
doc.world = world
doc.world = this.world
// doc.compute(world.hooks)

@@ -105,0 +108,0 @@ doc.compute(['normal', 'lexicon', 'preTagger'])

import View from './API/View.js'
import tmp from './API/world.js'
import tmpWrld from './API/world.js'
import version from './_version.js'
import extend from './API/extend.js'
import clone from './API/clone.js'
import { verbose, compile } from './API/_lib.js'
import { verbose } from './API/_lib.js'
import handleInputs from './API/inputs.js'
let world = Object.assign({}, tmp)
let world = Object.assign({}, tmpWrld)
const nlp = function (input, lex) {
const { methods, hooks } = world
if (lex) {
nlp.addWords(lex)
}
//assume ./01-tokenize is installed
let document = methods.one.tokenize(input, world)
let doc = new View(document)
doc.world = world
doc.compute(hooks)
let doc = handleInputs(input, View, world)
doc.compute(world.hooks)
return doc

@@ -29,3 +25,3 @@ }

nlp.tokenize = function (input, lex) {
const { methods, compute } = this._world
const { compute } = this._world
// add user-given words to lexicon

@@ -36,4 +32,3 @@ if (lex) {

// run the tokenizer
let document = methods.one.tokenize(input, this._world)
let doc = new View(document)
let doc = handleInputs(input, View, world)
// give contractions a shot, at least

@@ -46,10 +41,2 @@ if (compute.contractions) {

/** deep-clone the library's model*/
nlp.fork = function (str) {
this._world = Object.assign({}, this._world)
this._world.methods = Object.assign({}, this._world.methods)
this._world.model = clone(this._world.model)
this._world.model.fork = str
return this
}

@@ -63,8 +50,3 @@ /** extend compromise functionality */

/** log the decision-making to console */
nlp.verbose = verbose
/** pre-compile a list of matches to lookup */
nlp.compile = compile
/** current library release version */
nlp.version = version
/** reach-into compromise internals */

@@ -84,3 +66,7 @@ nlp.world = function () {

// apply our only default plugins
/** log the decision-making to console */
nlp.verbose = verbose
/** current library release version */
nlp.version = version
export default nlp
import nlp from './two.js'
import chunker from './3-three/chunker/plugin.js'
import misc from './3-three/misc/plugin.js'
import normalize from './3-three/normalize/plugin.js'
import nouns from './3-three/nouns/plugin.js'
import numbers from './3-three/numbers/plugin.js'
import redact from './3-three/redact/plugin.js'
import sentences from './3-three/sentences/plugin.js'
import subjects from './3-three/topics/plugin.js'
import topics from './3-three/topics/plugin.js'
import verbs from './3-three/verbs/plugin.js'
import redact from './3-three/redact/plugin.js'
nlp.plugin(chunker) //
nlp.plugin(misc) //
nlp.plugin(normalize) //
nlp.plugin(nouns) //
nlp.plugin(numbers) //
nlp.plugin(redact) //
nlp.plugin(sentences) //
nlp.plugin(subjects) //
nlp.plugin(topics) //
nlp.plugin(verbs) //
nlp.plugin(redact) //
export default nlp

@@ -5,2 +5,3 @@ import nlp from './one.js'

import postTag from './2-two/postTagger/plugin.js'
import swap from './2-two/swap/plugin.js'

@@ -10,3 +11,4 @@ nlp.plugin(preTag) //~103kb

nlp.plugin(postTag) //~33kb
nlp.plugin(swap) //
export default nlp

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc