From 72e7a95904775498cf32ecd80fb0df6c94b5ee08 Mon Sep 17 00:00:00 2001 From: Daniel Triendl Date: Tue, 27 Jun 2023 17:25:14 +0200 Subject: [PATCH] Bump version to 9.1.0 --- 3CX_TAPI.user.js | 16026 +++++++++++---------------------------------- package.json | 2 +- 2 files changed, 3955 insertions(+), 12073 deletions(-) diff --git a/3CX_TAPI.user.js b/3CX_TAPI.user.js index 362bf30..7b430e2 100644 --- a/3CX_TAPI.user.js +++ b/3CX_TAPI.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name 3CX TAPI // @namespace http://cp-solutions.at -// @version 9.0.3 +// @version 9.1.0 // @author Daniel Triendl // @copyright Copyright 2021 CP Solutions GmbH // @source https://source.cp-austria.at/git/CPATRD/3cx_tapi.git @@ -9,8 +9,8 @@ // @match https://192.168.0.154:5001/webclient* // @match https://cpsolution.my3cx.at:5001/webclient* // @require https://cdn.jsdelivr.net/gh/CoeJoder/waitForKeyElements.js@v1.2/waitForKeyElements.js -// @require https://cdn.jsdelivr.net/npm/axios@0.27.2/dist/axios.min.js -// @require https://cdn.jsdelivr.net/npm/axios-userscript-adapter@0.1.12/dist/axiosGmxhrAdapter.min.js +// @require https://cdn.jsdelivr.net/npm/axios@^1.4.0/dist/axios.min.js +// @require https://cdn.jsdelivr.net/npm/axios-userscript-adapter@^0.2.0-alpha.2/dist/axiosGmxhrAdapter.min.js // @grant GM.xmlHttpRequest // @grant GM.notification // @grant GM.getValue @@ -19,119 +19,914 @@ // @run-at document-end // ==/UserScript== - -/******/ (function() { // webpackBootstrap +/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ "./node_modules/chrono-node/dist/calculation/mergingCalculation.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "./node_modules/css-loader/dist/runtime/api.js": +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.mergeDateTimeComponent = exports.mergeDateTimeResult = void 0; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +module.exports = function (cssWithMappingToString) { + var list = []; -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); + // return the list of modules as css string + list.toString = function toString() { + return this.map(function (item) { + var content = ""; + var needLayer = typeof item[5] !== "undefined"; + if (item[4]) { + content += "@supports (".concat(item[4], ") {"); + } + if (item[2]) { + content += "@media ".concat(item[2], " {"); + } + if (needLayer) { + content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {"); + } + content += cssWithMappingToString(item); + if (needLayer) { + content += "}"; + } + if (item[2]) { + content += "}"; + } + if (item[4]) { + content += "}"; + } + return content; + }).join(""); + }; -function mergeDateTimeResult(dateResult, timeResult) { - const result = dateResult.clone(); - const beginDate = dateResult.start; - const beginTime = timeResult.start; - result.start = mergeDateTimeComponent(beginDate, beginTime); - - if (dateResult.end != null || timeResult.end != null) { - const endDate = dateResult.end == null ? dateResult.start : dateResult.end; - const endTime = timeResult.end == null ? timeResult.start : timeResult.end; - const endDateTime = mergeDateTimeComponent(endDate, endTime); - - if (dateResult.end == null && endDateTime.date().getTime() < result.start.date().getTime()) { - if (endDateTime.isCertain("day")) { - endDateTime.assign("day", endDateTime.get("day") + 1); - } else { - endDateTime.imply("day", endDateTime.get("day") + 1); + // import a list of modules into the list + list.i = function i(modules, media, dedupe, supports, layer) { + if (typeof modules === "string") { + modules = [[null, modules, undefined]]; + } + var alreadyImportedModules = {}; + if (dedupe) { + for (var k = 0; k < this.length; k++) { + var id = this[k][0]; + if (id != null) { + alreadyImportedModules[id] = true; + } } } - - result.end = endDateTime; - } - - return result; -} - -exports.mergeDateTimeResult = mergeDateTimeResult; - -function mergeDateTimeComponent(dateComponent, timeComponent) { - const dateTimeComponent = dateComponent.clone(); - - if (timeComponent.isCertain("hour")) { - dateTimeComponent.assign("hour", timeComponent.get("hour")); - dateTimeComponent.assign("minute", timeComponent.get("minute")); - - if (timeComponent.isCertain("second")) { - dateTimeComponent.assign("second", timeComponent.get("second")); - - if (timeComponent.isCertain("millisecond")) { - dateTimeComponent.assign("millisecond", timeComponent.get("millisecond")); - } else { - dateTimeComponent.imply("millisecond", timeComponent.get("millisecond")); + for (var _k = 0; _k < modules.length; _k++) { + var item = [].concat(modules[_k]); + if (dedupe && alreadyImportedModules[item[0]]) { + continue; } - } else { - dateTimeComponent.imply("second", timeComponent.get("second")); - dateTimeComponent.imply("millisecond", timeComponent.get("millisecond")); + if (typeof layer !== "undefined") { + if (typeof item[5] === "undefined") { + item[5] = layer; + } else { + item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}"); + item[5] = layer; + } + } + if (media) { + if (!item[2]) { + item[2] = media; + } else { + item[1] = "@media ".concat(item[2], " {").concat(item[1], "}"); + item[2] = media; + } + } + if (supports) { + if (!item[4]) { + item[4] = "".concat(supports); + } else { + item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}"); + item[4] = supports; + } + } + list.push(item); } - } else { - dateTimeComponent.imply("hour", timeComponent.get("hour")); - dateTimeComponent.imply("minute", timeComponent.get("minute")); - dateTimeComponent.imply("second", timeComponent.get("second")); - dateTimeComponent.imply("millisecond", timeComponent.get("millisecond")); - } - - if (timeComponent.isCertain("timezoneOffset")) { - dateTimeComponent.assign("timezoneOffset", timeComponent.get("timezoneOffset")); - } - - if (timeComponent.isCertain("meridiem")) { - dateTimeComponent.assign("meridiem", timeComponent.get("meridiem")); - } else if (timeComponent.get("meridiem") != null && dateTimeComponent.get("meridiem") == null) { - dateTimeComponent.imply("meridiem", timeComponent.get("meridiem")); - } - - if (dateTimeComponent.get("meridiem") == index_1.Meridiem.PM && dateTimeComponent.get("hour") < 12) { - if (timeComponent.isCertain("hour")) { - dateTimeComponent.assign("hour", dateTimeComponent.get("hour") + 12); - } else { - dateTimeComponent.imply("hour", dateTimeComponent.get("hour") + 12); - } - } - - return dateTimeComponent; -} - -exports.mergeDateTimeComponent = mergeDateTimeComponent; + }; + return list; +}; /***/ }), -/***/ "./node_modules/chrono-node/dist/calculation/years.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ "./node_modules/css-loader/dist/runtime/noSourceMaps.js": +/***/ ((module) => { "use strict"; -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod +module.exports = function (i) { + return i[1]; +}; + +/***/ }), + +/***/ "./node_modules/dayjs/dayjs.min.js": +/***/ (function(module) { + +!function (t, e) { + true ? module.exports = e() : 0; +}(this, function () { + "use strict"; + + var t = 1e3, + e = 6e4, + n = 36e5, + r = "millisecond", + i = "second", + s = "minute", + u = "hour", + a = "day", + o = "week", + f = "month", + h = "quarter", + c = "year", + d = "date", + l = "Invalid Date", + $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, + y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, + M = { + name: "en", + weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), + months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), + ordinal: function (t) { + var e = ["th", "st", "nd", "rd"], + n = t % 100; + return "[" + t + (e[(n - 20) % 10] || e[n] || e[0]) + "]"; + } + }, + m = function (t, e, n) { + var r = String(t); + return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t; + }, + v = { + s: m, + z: function (t) { + var e = -t.utcOffset(), + n = Math.abs(e), + r = Math.floor(n / 60), + i = n % 60; + return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0"); + }, + m: function t(e, n) { + if (e.date() < n.date()) return -t(n, e); + var r = 12 * (n.year() - e.year()) + (n.month() - e.month()), + i = e.clone().add(r, f), + s = n - i < 0, + u = e.clone().add(r + (s ? -1 : 1), f); + return +(-(r + (n - i) / (s ? i - u : u - i)) || 0); + }, + a: function (t) { + return t < 0 ? Math.ceil(t) || 0 : Math.floor(t); + }, + p: function (t) { + return { + M: f, + y: c, + w: o, + d: a, + D: d, + h: u, + m: s, + s: i, + ms: r, + Q: h + }[t] || String(t || "").toLowerCase().replace(/s$/, ""); + }, + u: function (t) { + return void 0 === t; + } + }, + g = "en", + D = {}; + D[g] = M; + var p = function (t) { + return t instanceof _; + }, + S = function t(e, n, r) { + var i; + if (!e) return g; + if ("string" == typeof e) { + var s = e.toLowerCase(); + D[s] && (i = s), n && (D[s] = n, i = s); + var u = e.split("-"); + if (!i && u.length > 1) return t(u[0]); + } else { + var a = e.name; + D[a] = e, i = a; + } + return !r && i && (g = i), i || !r && g; + }, + w = function (t, e) { + if (p(t)) return t.clone(); + var n = "object" == typeof e ? e : {}; + return n.date = t, n.args = arguments, new _(n); + }, + O = v; + O.l = S, O.i = p, O.w = function (t, e) { + return w(t, { + locale: e.$L, + utc: e.$u, + x: e.$x, + $offset: e.$offset + }); + }; + var _ = function () { + function M(t) { + this.$L = S(t.locale, null, !0), this.parse(t); + } + var m = M.prototype; + return m.parse = function (t) { + this.$d = function (t) { + var e = t.date, + n = t.utc; + if (null === e) return new Date(NaN); + if (O.u(e)) return new Date(); + if (e instanceof Date) return new Date(e); + if ("string" == typeof e && !/Z$/i.test(e)) { + var r = e.match($); + if (r) { + var i = r[2] - 1 || 0, + s = (r[7] || "0").substring(0, 3); + return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s); + } + } + return new Date(e); + }(t), this.$x = t.x || {}, this.init(); + }, m.init = function () { + var t = this.$d; + this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds(); + }, m.$utils = function () { + return O; + }, m.isValid = function () { + return !(this.$d.toString() === l); + }, m.isSame = function (t, e) { + var n = w(t); + return this.startOf(e) <= n && n <= this.endOf(e); + }, m.isAfter = function (t, e) { + return w(t) < this.startOf(e); + }, m.isBefore = function (t, e) { + return this.endOf(e) < w(t); + }, m.$g = function (t, e, n) { + return O.u(t) ? this[e] : this.set(n, t); + }, m.unix = function () { + return Math.floor(this.valueOf() / 1e3); + }, m.valueOf = function () { + return this.$d.getTime(); + }, m.startOf = function (t, e) { + var n = this, + r = !!O.u(e) || e, + h = O.p(t), + l = function (t, e) { + var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n); + return r ? i : i.endOf(a); + }, + $ = function (t, e) { + return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n); + }, + y = this.$W, + M = this.$M, + m = this.$D, + v = "set" + (this.$u ? "UTC" : ""); + switch (h) { + case c: + return r ? l(1, 0) : l(31, 11); + case f: + return r ? l(1, M) : l(0, M + 1); + case o: + var g = this.$locale().weekStart || 0, + D = (y < g ? y + 7 : y) - g; + return l(r ? m - D : m + (6 - D), M); + case a: + case d: + return $(v + "Hours", 0); + case u: + return $(v + "Minutes", 1); + case s: + return $(v + "Seconds", 2); + case i: + return $(v + "Milliseconds", 3); + default: + return this.clone(); + } + }, m.endOf = function (t) { + return this.startOf(t, !1); + }, m.$set = function (t, e) { + var n, + o = O.p(t), + h = "set" + (this.$u ? "UTC" : ""), + l = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o], + $ = o === a ? this.$D + (e - this.$W) : e; + if (o === f || o === c) { + var y = this.clone().set(d, 1); + y.$d[l]($), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d; + } else l && this.$d[l]($); + return this.init(), this; + }, m.set = function (t, e) { + return this.clone().$set(t, e); + }, m.get = function (t) { + return this[O.p(t)](); + }, m.add = function (r, h) { + var d, + l = this; + r = Number(r); + var $ = O.p(h), + y = function (t) { + var e = w(l); + return O.w(e.date(e.date() + Math.round(t * r)), l); + }; + if ($ === f) return this.set(f, this.$M + r); + if ($ === c) return this.set(c, this.$y + r); + if ($ === a) return y(1); + if ($ === o) return y(7); + var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[$] || 1, + m = this.$d.getTime() + r * M; + return O.w(m, this); + }, m.subtract = function (t, e) { + return this.add(-1 * t, e); + }, m.format = function (t) { + var e = this, + n = this.$locale(); + if (!this.isValid()) return n.invalidDate || l; + var r = t || "YYYY-MM-DDTHH:mm:ssZ", + i = O.z(this), + s = this.$H, + u = this.$m, + a = this.$M, + o = n.weekdays, + f = n.months, + h = function (t, n, i, s) { + return t && (t[n] || t(e, r)) || i[n].slice(0, s); + }, + c = function (t) { + return O.s(s % 12 || 12, t, "0"); + }, + d = n.meridiem || function (t, e, n) { + var r = t < 12 ? "AM" : "PM"; + return n ? r.toLowerCase() : r; + }, + $ = { + YY: String(this.$y).slice(-2), + YYYY: O.s(this.$y, 4, "0"), + M: a + 1, + MM: O.s(a + 1, 2, "0"), + MMM: h(n.monthsShort, a, f, 3), + MMMM: h(f, a), + D: this.$D, + DD: O.s(this.$D, 2, "0"), + d: String(this.$W), + dd: h(n.weekdaysMin, this.$W, o, 2), + ddd: h(n.weekdaysShort, this.$W, o, 3), + dddd: o[this.$W], + H: String(s), + HH: O.s(s, 2, "0"), + h: c(1), + hh: c(2), + a: d(s, u, !0), + A: d(s, u, !1), + m: String(u), + mm: O.s(u, 2, "0"), + s: String(this.$s), + ss: O.s(this.$s, 2, "0"), + SSS: O.s(this.$ms, 3, "0"), + Z: i + }; + return r.replace(y, function (t, e) { + return e || $[t] || i.replace(":", ""); + }); + }, m.utcOffset = function () { + return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); + }, m.diff = function (r, d, l) { + var $, + y = O.p(d), + M = w(r), + m = (M.utcOffset() - this.utcOffset()) * e, + v = this - M, + g = O.m(this, M); + return g = ($ = {}, $[c] = g / 12, $[f] = g, $[h] = g / 3, $[o] = (v - m) / 6048e5, $[a] = (v - m) / 864e5, $[u] = v / n, $[s] = v / e, $[i] = v / t, $)[y] || v, l ? g : O.a(g); + }, m.daysInMonth = function () { + return this.endOf(f).$D; + }, m.$locale = function () { + return D[this.$L]; + }, m.locale = function (t, e) { + if (!t) return this.$L; + var n = this.clone(), + r = S(t, e, !0); + return r && (n.$L = r), n; + }, m.clone = function () { + return O.w(this.$d, this); + }, m.toDate = function () { + return new Date(this.valueOf()); + }, m.toJSON = function () { + return this.isValid() ? this.toISOString() : null; + }, m.toISOString = function () { + return this.$d.toISOString(); + }, m.toString = function () { + return this.$d.toUTCString(); + }, M; + }(), + T = _.prototype; + return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) { + T[t[1]] = function (e) { + return this.$g(e, t[0], t[1]); + }; + }), w.extend = function (t, e) { + return t.$i || (t(e, _, w), t.$i = !0), w; + }, w.locale = S, w.isDayjs = p, w.unix = function (t) { + return w(1e3 * t); + }, w.en = D[g], w.Ls = D, w.p = {}, w; +}); + +/***/ }), + +/***/ "./node_modules/dayjs/plugin/quarterOfYear.js": +/***/ (function(module) { + +!function (t, n) { + true ? module.exports = n() : 0; +}(this, function () { + "use strict"; + + var t = "month", + n = "quarter"; + return function (e, i) { + var r = i.prototype; + r.quarter = function (t) { + return this.$utils().u(t) ? Math.ceil((this.month() + 1) / 3) : this.month(this.month() % 3 + 3 * (t - 1)); + }; + var s = r.add; + r.add = function (e, i) { + return e = Number(e), this.$utils().p(i) === n ? this.add(3 * e, t) : s.bind(this)(e, i); + }; + var u = r.startOf; + r.startOf = function (e, i) { + var r = this.$utils(), + s = !!r.u(i) || i; + if (r.p(e) === n) { + var o = this.quarter() - 1; + return s ? this.month(3 * o).startOf(t).startOf("day") : this.month(3 * o + 2).endOf(t).endOf("day"); + } + return u.bind(this)(e, i); + }; + }; +}); + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/search.css": +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, `.tapi-search-autocomplete { + /*the container must be positioned relative:*/ + position: relative; + display: inline-block; + margin-right: 20px; + } +.tapi-search-autocomplete input { + border: 1px solid transparent; + background-color: #f1f1f1; + /*padding: 10px;*/ + /*font-size: 16px;*/ +} +.tapi-search-autocomplete input[type=text] { + background-color: #f1f1f1; + width: 100%; +} + +.tapi-search-autocomplete-items { + position: absolute; + border: 1px solid #d4d4d4; + border-bottom: none; + border-top: none; + z-index: 99; + /*position the autocomplete items to be the same width as the container:*/ + top: 100%; + left: 0; + right: 0; +} +.tapi-search-autocomplete-items div { + padding: 10px; + cursor: pointer; + background-color: #fff; + border-bottom: 1px solid #d4d4d4; + color: #000; +} +.tapi-search-autocomplete-items div:hover, .tapi-search-autocomplete-active { + /*when hovering an item:*/ + background-color: #E7E6E6 !important; +} +`, ""]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./src/status.css": +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); +// Module +___CSS_LOADER_EXPORT___.push([module.id, `.tapi-dropdown { + position: relative; + display: inline-block; +} + +.tapi-dropdown-content { + display: none; + position: absolute; + min-width: 200px; + overflow: auto; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + z-index: 1; + color: #000; + background-color: #fff; +} + +.show { + display: block; +} +`, ""]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js": +/***/ ((module) => { + +"use strict"; + + +var stylesInDOM = []; +function getIndexByIdentifier(identifier) { + var result = -1; + for (var i = 0; i < stylesInDOM.length; i++) { + if (stylesInDOM[i].identifier === identifier) { + result = i; + break; + } + } + return result; +} +function modulesToDom(list, options) { + var idCountMap = {}; + var identifiers = []; + for (var i = 0; i < list.length; i++) { + var item = list[i]; + var id = options.base ? item[0] + options.base : item[0]; + var count = idCountMap[id] || 0; + var identifier = "".concat(id, " ").concat(count); + idCountMap[id] = count + 1; + var indexByIdentifier = getIndexByIdentifier(identifier); + var obj = { + css: item[1], + media: item[2], + sourceMap: item[3], + supports: item[4], + layer: item[5] + }; + if (indexByIdentifier !== -1) { + stylesInDOM[indexByIdentifier].references++; + stylesInDOM[indexByIdentifier].updater(obj); + } else { + var updater = addElementStyle(obj, options); + options.byIndex = i; + stylesInDOM.splice(i, 0, { + identifier: identifier, + updater: updater, + references: 1 + }); + } + identifiers.push(identifier); + } + return identifiers; +} +function addElementStyle(obj, options) { + var api = options.domAPI(options); + api.update(obj); + var updater = function updater(newObj) { + if (newObj) { + if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) { + return; + } + api.update(obj = newObj); + } else { + api.remove(); + } + }; + return updater; +} +module.exports = function (list, options) { + options = options || {}; + list = list || []; + var lastIdentifiers = modulesToDom(list, options); + return function update(newList) { + newList = newList || []; + for (var i = 0; i < lastIdentifiers.length; i++) { + var identifier = lastIdentifiers[i]; + var index = getIndexByIdentifier(identifier); + stylesInDOM[index].references--; + } + var newLastIdentifiers = modulesToDom(newList, options); + for (var _i = 0; _i < lastIdentifiers.length; _i++) { + var _identifier = lastIdentifiers[_i]; + var _index = getIndexByIdentifier(_identifier); + if (stylesInDOM[_index].references === 0) { + stylesInDOM[_index].updater(); + stylesInDOM.splice(_index, 1); + } + } + lastIdentifiers = newLastIdentifiers; }; }; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.findYearClosestToRef = exports.findMostLikelyADYear = void 0; +/***/ }), -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); +/***/ "./node_modules/style-loader/dist/runtime/insertBySelector.js": +/***/ ((module) => { + +"use strict"; + + +var memo = {}; + +/* istanbul ignore next */ +function getTarget(target) { + if (typeof memo[target] === "undefined") { + var styleTarget = document.querySelector(target); + + // Special case to return head of iframe instead of iframe itself + if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { + try { + // This will throw an exception if access to iframe is blocked + // due to cross-origin restrictions + styleTarget = styleTarget.contentDocument.head; + } catch (e) { + // istanbul ignore next + styleTarget = null; + } + } + memo[target] = styleTarget; + } + return memo[target]; +} + +/* istanbul ignore next */ +function insertBySelector(insert, style) { + var target = getTarget(insert); + if (!target) { + throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid."); + } + target.appendChild(style); +} +module.exports = insertBySelector; + +/***/ }), + +/***/ "./node_modules/style-loader/dist/runtime/insertStyleElement.js": +/***/ ((module) => { + +"use strict"; + + +/* istanbul ignore next */ +function insertStyleElement(options) { + var element = document.createElement("style"); + options.setAttributes(element, options.attributes); + options.insert(element, options.options); + return element; +} +module.exports = insertStyleElement; + +/***/ }), + +/***/ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js": +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +/* istanbul ignore next */ +function setAttributesWithoutAttributes(styleElement) { + var nonce = true ? __webpack_require__.nc : 0; + if (nonce) { + styleElement.setAttribute("nonce", nonce); + } +} +module.exports = setAttributesWithoutAttributes; + +/***/ }), + +/***/ "./node_modules/style-loader/dist/runtime/styleDomAPI.js": +/***/ ((module) => { + +"use strict"; + + +/* istanbul ignore next */ +function apply(styleElement, options, obj) { + var css = ""; + if (obj.supports) { + css += "@supports (".concat(obj.supports, ") {"); + } + if (obj.media) { + css += "@media ".concat(obj.media, " {"); + } + var needLayer = typeof obj.layer !== "undefined"; + if (needLayer) { + css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {"); + } + css += obj.css; + if (needLayer) { + css += "}"; + } + if (obj.media) { + css += "}"; + } + if (obj.supports) { + css += "}"; + } + var sourceMap = obj.sourceMap; + if (sourceMap && typeof btoa !== "undefined") { + css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */"); + } + + // For old IE + /* istanbul ignore if */ + options.styleTagTransform(css, styleElement, options.options); +} +function removeStyleElement(styleElement) { + // istanbul ignore if + if (styleElement.parentNode === null) { + return false; + } + styleElement.parentNode.removeChild(styleElement); +} + +/* istanbul ignore next */ +function domAPI(options) { + if (typeof document === "undefined") { + return { + update: function update() {}, + remove: function remove() {} + }; + } + var styleElement = options.insertStyleElement(options); + return { + update: function update(obj) { + apply(styleElement, options, obj); + }, + remove: function remove() { + removeStyleElement(styleElement); + } + }; +} +module.exports = domAPI; + +/***/ }), + +/***/ "./node_modules/style-loader/dist/runtime/styleTagTransform.js": +/***/ ((module) => { + +"use strict"; + + +/* istanbul ignore next */ +function styleTagTransform(css, styleElement) { + if (styleElement.styleSheet) { + styleElement.styleSheet.cssText = css; + } else { + while (styleElement.firstChild) { + styleElement.removeChild(styleElement.firstChild); + } + styleElement.appendChild(document.createTextNode(css)); + } +} +module.exports = styleTagTransform; + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ id: moduleId, +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/nonce */ +/******/ (() => { +/******/ __webpack_require__.nc = undefined; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. +(() => { +"use strict"; + +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/utils/pattern.js +function repeatedTimeunitPattern(prefix, singleTimeunitPattern) { + const singleTimeunitPatternNoCapture = singleTimeunitPattern.replace(/\((?!\?)/g, "(?:"); + return `${prefix}${singleTimeunitPatternNoCapture}\\s{0,5}(?:,?\\s{0,5}${singleTimeunitPatternNoCapture}){0,10}`; +} +function extractTerms(dictionary) { + let keys; + if (dictionary instanceof Array) { + keys = [...dictionary]; + } else if (dictionary instanceof Map) { + keys = Array.from(dictionary.keys()); + } else { + keys = Object.keys(dictionary); + } + return keys; +} +function matchAnyPattern(dictionary) { + const joinedTerms = extractTerms(dictionary).sort((a, b) => b.length - a.length).join("|").replace(/\./g, "\\."); + return `(?:${joinedTerms})`; +} +// EXTERNAL MODULE: ./node_modules/dayjs/dayjs.min.js +var dayjs_min = __webpack_require__("./node_modules/dayjs/dayjs.min.js"); +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/calculation/years.js function findMostLikelyADYear(yearNumber) { if (yearNumber < 100) { @@ -141,2839 +936,27 @@ function findMostLikelyADYear(yearNumber) { yearNumber = yearNumber + 2000; } } - return yearNumber; } - -exports.findMostLikelyADYear = findMostLikelyADYear; - function findYearClosestToRef(refDate, day, month) { - const refMoment = dayjs_1.default(refDate); + const refMoment = dayjs_min(refDate); let dateMoment = refMoment; dateMoment = dateMoment.month(month - 1); dateMoment = dateMoment.date(day); dateMoment = dateMoment.year(refMoment.year()); const nextYear = dateMoment.add(1, "y"); const lastYear = dateMoment.add(-1, "y"); - if (Math.abs(nextYear.diff(refMoment)) < Math.abs(dateMoment.diff(refMoment))) { dateMoment = nextYear; } else if (Math.abs(lastYear.diff(refMoment)) < Math.abs(dateMoment.diff(refMoment))) { dateMoment = lastYear; } - return dateMoment.year(); } +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/constants.js -exports.findYearClosestToRef = findYearClosestToRef; -/***/ }), - -/***/ "./node_modules/chrono-node/dist/chrono.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.ParsingContext = exports.Chrono = void 0; - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const en_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/index.js"); - -class Chrono { - constructor(configuration) { - configuration = configuration || en_1.createCasualConfiguration(); - this.parsers = [...configuration.parsers]; - this.refiners = [...configuration.refiners]; - } - - clone() { - return new Chrono({ - parsers: [...this.parsers], - refiners: [...this.refiners] - }); - } - - parseDate(text, referenceDate, option) { - const results = this.parse(text, referenceDate, option); - return results.length > 0 ? results[0].start.date() : null; - } - - parse(text, referenceDate, option) { - const context = new ParsingContext(text, referenceDate, option); - let results = []; - this.parsers.forEach(parser => { - const parsedResults = Chrono.executeParser(context, parser); - results = results.concat(parsedResults); - }); - results.sort((a, b) => { - return a.index - b.index; - }); - this.refiners.forEach(function (refiner) { - results = refiner.refine(context, results); - }); - return results; - } - - static executeParser(context, parser) { - const results = []; - const pattern = parser.pattern(context); - const originalText = context.text; - let remainingText = context.text; - let match = pattern.exec(remainingText); - - while (match) { - const index = match.index + originalText.length - remainingText.length; - match.index = index; - const result = parser.extract(context, match); - - if (!result) { - remainingText = originalText.substring(match.index + 1); - match = pattern.exec(remainingText); - continue; - } - - let parsedResult = null; - - if (result instanceof results_1.ParsingResult) { - parsedResult = result; - } else if (result instanceof results_1.ParsingComponents) { - parsedResult = context.createParsingResult(match.index, match[0]); - parsedResult.start = result; - } else { - parsedResult = context.createParsingResult(match.index, match[0], result); - } - - context.debug(() => console.log(`${parser.constructor.name} extracted result ${parsedResult}`)); - results.push(parsedResult); - remainingText = originalText.substring(index + parsedResult.text.length); - match = pattern.exec(remainingText); - } - - return results; - } - -} - -exports.Chrono = Chrono; - -class ParsingContext { - constructor(text, refDate, option) { - this.text = text; - this.reference = new results_1.ReferenceWithTimezone(refDate); - this.option = option !== null && option !== void 0 ? option : {}; - this.refDate = this.reference.instant; - } - - createParsingComponents(components) { - if (components instanceof results_1.ParsingComponents) { - return components; - } - - return new results_1.ParsingComponents(this.reference, components); - } - - createParsingResult(index, textOrEndIndex, startComponents, endComponents) { - const text = typeof textOrEndIndex === "string" ? textOrEndIndex : this.text.substring(index, textOrEndIndex); - const start = startComponents ? this.createParsingComponents(startComponents) : null; - const end = endComponents ? this.createParsingComponents(endComponents) : null; - return new results_1.ParsingResult(this.reference, index, text, start, end); - } - - debug(block) { - if (this.option.debug) { - if (this.option.debug instanceof Function) { - this.option.debug(block); - } else { - const handler = this.option.debug; - handler.debug(block); - } - } - } - -} - -exports.ParsingContext = ParsingContext; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/common/abstractRefiners.js": -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.MergingRefiner = exports.Filter = void 0; - -class Filter { - refine(context, results) { - return results.filter(r => this.isValid(context, r)); - } - -} - -exports.Filter = Filter; - -class MergingRefiner { - refine(context, results) { - if (results.length < 2) { - return results; - } - - const mergedResults = []; - let curResult = results[0]; - let nextResult = null; - - for (let i = 1; i < results.length; i++) { - nextResult = results[i]; - const textBetween = context.text.substring(curResult.index + curResult.text.length, nextResult.index); - - if (!this.shouldMergeResults(textBetween, curResult, nextResult, context)) { - mergedResults.push(curResult); - curResult = nextResult; - } else { - const left = curResult; - const right = nextResult; - const mergedResult = this.mergeResults(textBetween, left, right, context); - context.debug(() => { - console.log(`${this.constructor.name} merged ${left} and ${right} into ${mergedResult}`); - }); - curResult = mergedResult; - } - } - - if (curResult != null) { - mergedResults.push(curResult); - } - - return mergedResults; - } - -} - -exports.MergingRefiner = MergingRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/common/calculation/weekdays.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.getBackwardDaysToWeekday = exports.getDaysForwardToWeekday = exports.getDaysToWeekdayClosest = exports.getDaysToWeekday = exports.createParsingComponentsAtWeekday = void 0; - -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js"); - -function createParsingComponentsAtWeekday(reference, weekday, modifier) { - const refDate = reference.getDateWithAdjustedTimezone(); - const daysToWeekday = getDaysToWeekday(refDate, weekday, modifier); - let components = new results_1.ParsingComponents(reference); - components = timeunits_1.addImpliedTimeUnits(components, { - "day": daysToWeekday - }); - components.assign("weekday", weekday); - return components; -} - -exports.createParsingComponentsAtWeekday = createParsingComponentsAtWeekday; - -function getDaysToWeekday(refDate, weekday, modifier) { - const refWeekday = refDate.getDay(); - - switch (modifier) { - case "this": - return getDaysForwardToWeekday(refDate, weekday); - - case "last": - return getBackwardDaysToWeekday(refDate, weekday); - - case "next": - if (refWeekday == index_1.Weekday.SUNDAY) { - return weekday == index_1.Weekday.SUNDAY ? 7 : weekday; - } - - if (refWeekday == index_1.Weekday.SATURDAY) { - if (weekday == index_1.Weekday.SATURDAY) return 7; - if (weekday == index_1.Weekday.SUNDAY) return 8; - return 1 + weekday; - } - - if (weekday < refWeekday && weekday != index_1.Weekday.SUNDAY) { - return getDaysForwardToWeekday(refDate, weekday); - } else { - return getDaysForwardToWeekday(refDate, weekday) + 7; - } - - } - - return getDaysToWeekdayClosest(refDate, weekday); -} - -exports.getDaysToWeekday = getDaysToWeekday; - -function getDaysToWeekdayClosest(refDate, weekday) { - const backward = getBackwardDaysToWeekday(refDate, weekday); - const forward = getDaysForwardToWeekday(refDate, weekday); - return forward < -backward ? forward : backward; -} - -exports.getDaysToWeekdayClosest = getDaysToWeekdayClosest; - -function getDaysForwardToWeekday(refDate, weekday) { - const refWeekday = refDate.getDay(); - let forwardCount = weekday - refWeekday; - - if (forwardCount < 0) { - forwardCount += 7; - } - - return forwardCount; -} - -exports.getDaysForwardToWeekday = getDaysForwardToWeekday; - -function getBackwardDaysToWeekday(refDate, weekday) { - const refWeekday = refDate.getDay(); - let backwardCount = weekday - refWeekday; - - if (backwardCount >= 0) { - backwardCount -= 7; - } - - return backwardCount; -} - -exports.getBackwardDaysToWeekday = getBackwardDaysToWeekday; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/common/casualReferences.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.noon = exports.morning = exports.midnight = exports.yesterdayEvening = exports.evening = exports.lastNight = exports.tonight = exports.theDayAfter = exports.tomorrow = exports.theDayBefore = exports.yesterday = exports.today = exports.now = void 0; - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js"); - -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); - -function now(reference) { - const targetDate = dayjs_1.default(reference.instant); - const component = new results_1.ParsingComponents(reference, {}); - dayjs_2.assignSimilarDate(component, targetDate); - dayjs_2.assignSimilarTime(component, targetDate); - - if (reference.timezoneOffset !== null) { - component.assign("timezoneOffset", targetDate.utcOffset()); - } - - return component; -} - -exports.now = now; - -function today(reference) { - const targetDate = dayjs_1.default(reference.instant); - const component = new results_1.ParsingComponents(reference, {}); - dayjs_2.assignSimilarDate(component, targetDate); - dayjs_2.implySimilarTime(component, targetDate); - return component; -} - -exports.today = today; - -function yesterday(reference) { - return theDayBefore(reference, 1); -} - -exports.yesterday = yesterday; - -function theDayBefore(reference, numDay) { - return theDayAfter(reference, -numDay); -} - -exports.theDayBefore = theDayBefore; - -function tomorrow(reference) { - return theDayAfter(reference, 1); -} - -exports.tomorrow = tomorrow; - -function theDayAfter(reference, nDays) { - let targetDate = dayjs_1.default(reference.instant); - const component = new results_1.ParsingComponents(reference, {}); - targetDate = targetDate.add(nDays, "day"); - dayjs_2.assignSimilarDate(component, targetDate); - dayjs_2.implySimilarTime(component, targetDate); - return component; -} - -exports.theDayAfter = theDayAfter; - -function tonight(reference, implyHour = 22) { - const targetDate = dayjs_1.default(reference.instant); - const component = new results_1.ParsingComponents(reference, {}); - component.imply("hour", implyHour); - component.imply("meridiem", index_1.Meridiem.PM); - dayjs_2.assignSimilarDate(component, targetDate); - return component; -} - -exports.tonight = tonight; - -function lastNight(reference, implyHour = 0) { - let targetDate = dayjs_1.default(reference.instant); - const component = new results_1.ParsingComponents(reference, {}); - - if (targetDate.hour() < 6) { - targetDate = targetDate.add(-1, "day"); - } - - dayjs_2.assignSimilarDate(component, targetDate); - component.imply("hour", implyHour); - return component; -} - -exports.lastNight = lastNight; - -function evening(reference, implyHour = 20) { - const component = new results_1.ParsingComponents(reference, {}); - component.imply("meridiem", index_1.Meridiem.PM); - component.imply("hour", implyHour); - return component; -} - -exports.evening = evening; - -function yesterdayEvening(reference, implyHour = 20) { - let targetDate = dayjs_1.default(reference.instant); - const component = new results_1.ParsingComponents(reference, {}); - targetDate = targetDate.add(-1, "day"); - dayjs_2.assignSimilarDate(component, targetDate); - component.imply("hour", implyHour); - component.imply("meridiem", index_1.Meridiem.PM); - return component; -} - -exports.yesterdayEvening = yesterdayEvening; - -function midnight(reference) { - const component = new results_1.ParsingComponents(reference, {}); - component.imply("hour", 0); - component.imply("minute", 0); - component.imply("second", 0); - return component; -} - -exports.midnight = midnight; - -function morning(reference, implyHour = 6) { - const component = new results_1.ParsingComponents(reference, {}); - component.imply("meridiem", index_1.Meridiem.AM); - component.imply("hour", implyHour); - return component; -} - -exports.morning = morning; - -function noon(reference) { - const component = new results_1.ParsingComponents(reference, {}); - component.imply("meridiem", index_1.Meridiem.AM); - component.imply("hour", 12); - return component; -} - -exports.noon = noon; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js": -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.AbstractParserWithWordBoundaryChecking = void 0; - -class AbstractParserWithWordBoundaryChecking { - constructor() { - this.cachedInnerPattern = null; - this.cachedPattern = null; - } - - patternLeftBoundary() { - return `(\\W|^)`; - } - - pattern(context) { - const innerPattern = this.innerPattern(context); - - if (innerPattern == this.cachedInnerPattern) { - return this.cachedPattern; - } - - this.cachedPattern = new RegExp(`${this.patternLeftBoundary()}${innerPattern.source}`, innerPattern.flags); - this.cachedInnerPattern = innerPattern; - return this.cachedPattern; - } - - extract(context, match) { - var _a; - - const header = (_a = match[1]) !== null && _a !== void 0 ? _a : ""; - match.index = match.index + header.length; - match[0] = match[0].substring(header.length); - - for (let i = 2; i < match.length; i++) { - match[i - 1] = match[i]; - } - - return this.innerExtract(context, match); - } - -} - -exports.AbstractParserWithWordBoundaryChecking = AbstractParserWithWordBoundaryChecking; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/common/parsers/AbstractTimeExpressionParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.AbstractTimeExpressionParser = void 0; - -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); - -function primaryTimePattern(leftBoundary, primaryPrefix, primarySuffix, flags) { - return new RegExp(`${leftBoundary}` + `${primaryPrefix}` + `(\\d{1,4})` + `(?:` + `(?:\\.|:|:)` + `(\\d{1,2})` + `(?:` + `(?::|:)` + `(\\d{2})` + `(?:\\.(\\d{1,6}))?` + `)?` + `)?` + `(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?` + `${primarySuffix}`, flags); -} - -function followingTimePatten(followingPhase, followingSuffix) { - return new RegExp(`^(${followingPhase})` + `(\\d{1,4})` + `(?:` + `(?:\\.|\\:|\\:)` + `(\\d{1,2})` + `(?:` + `(?:\\.|\\:|\\:)` + `(\\d{1,2})(?:\\.(\\d{1,6}))?` + `)?` + `)?` + `(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?` + `${followingSuffix}`, "i"); -} - -const HOUR_GROUP = 2; -const MINUTE_GROUP = 3; -const SECOND_GROUP = 4; -const MILLI_SECOND_GROUP = 5; -const AM_PM_HOUR_GROUP = 6; - -class AbstractTimeExpressionParser { - constructor(strictMode = false) { - this.cachedPrimaryPrefix = null; - this.cachedPrimarySuffix = null; - this.cachedPrimaryTimePattern = null; - this.cachedFollowingPhase = null; - this.cachedFollowingSuffix = null; - this.cachedFollowingTimePatten = null; - this.strictMode = strictMode; - } - - patternFlags() { - return "i"; - } - - primaryPatternLeftBoundary() { - return `(^|\\s|T|\\b)`; - } - - primarySuffix() { - return `(?=\\W|$)`; - } - - followingSuffix() { - return `(?=\\W|$)`; - } - - pattern(context) { - return this.getPrimaryTimePatternThroughCache(); - } - - extract(context, match) { - const startComponents = this.extractPrimaryTimeComponents(context, match); - - if (!startComponents) { - match.index += match[0].length; - return null; - } - - const index = match.index + match[1].length; - const text = match[0].substring(match[1].length); - const result = context.createParsingResult(index, text, startComponents); - match.index += match[0].length; - const remainingText = context.text.substring(match.index); - const followingPattern = this.getFollowingTimePatternThroughCache(); - const followingMatch = followingPattern.exec(remainingText); - - if (text.match(/^\d{3,4}/) && followingMatch && followingMatch[0].match(/^\s*([+-])\s*\d{2,4}$/)) { - return null; - } - - if (!followingMatch || followingMatch[0].match(/^\s*([+-])\s*\d{3,4}$/)) { - return this.checkAndReturnWithoutFollowingPattern(result); - } - - result.end = this.extractFollowingTimeComponents(context, followingMatch, result); - - if (result.end) { - result.text += followingMatch[0]; - } - - return this.checkAndReturnWithFollowingPattern(result); - } - - extractPrimaryTimeComponents(context, match, strict = false) { - const components = context.createParsingComponents(); - let minute = 0; - let meridiem = null; - let hour = parseInt(match[HOUR_GROUP]); - - if (hour > 100) { - if (this.strictMode || match[MINUTE_GROUP] != null) { - return null; - } - - minute = hour % 100; - hour = Math.floor(hour / 100); - } - - if (hour > 24) { - return null; - } - - if (match[MINUTE_GROUP] != null) { - if (match[MINUTE_GROUP].length == 1 && !match[AM_PM_HOUR_GROUP]) { - return null; - } - - minute = parseInt(match[MINUTE_GROUP]); - } - - if (minute >= 60) { - return null; - } - - if (hour > 12) { - meridiem = index_1.Meridiem.PM; - } - - if (match[AM_PM_HOUR_GROUP] != null) { - if (hour > 12) return null; - const ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase(); - - if (ampm == "a") { - meridiem = index_1.Meridiem.AM; - - if (hour == 12) { - hour = 0; - } - } - - if (ampm == "p") { - meridiem = index_1.Meridiem.PM; - - if (hour != 12) { - hour += 12; - } - } - } - - components.assign("hour", hour); - components.assign("minute", minute); - - if (meridiem !== null) { - components.assign("meridiem", meridiem); - } else { - if (hour < 12) { - components.imply("meridiem", index_1.Meridiem.AM); - } else { - components.imply("meridiem", index_1.Meridiem.PM); - } - } - - if (match[MILLI_SECOND_GROUP] != null) { - const millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3)); - if (millisecond >= 1000) return null; - components.assign("millisecond", millisecond); - } - - if (match[SECOND_GROUP] != null) { - const second = parseInt(match[SECOND_GROUP]); - if (second >= 60) return null; - components.assign("second", second); - } - - return components; - } - - extractFollowingTimeComponents(context, match, result) { - const components = context.createParsingComponents(); - - if (match[MILLI_SECOND_GROUP] != null) { - const millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3)); - if (millisecond >= 1000) return null; - components.assign("millisecond", millisecond); - } - - if (match[SECOND_GROUP] != null) { - const second = parseInt(match[SECOND_GROUP]); - if (second >= 60) return null; - components.assign("second", second); - } - - let hour = parseInt(match[HOUR_GROUP]); - let minute = 0; - let meridiem = -1; - - if (match[MINUTE_GROUP] != null) { - minute = parseInt(match[MINUTE_GROUP]); - } else if (hour > 100) { - minute = hour % 100; - hour = Math.floor(hour / 100); - } - - if (minute >= 60 || hour > 24) { - return null; - } - - if (hour >= 12) { - meridiem = index_1.Meridiem.PM; - } - - if (match[AM_PM_HOUR_GROUP] != null) { - if (hour > 12) { - return null; - } - - const ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase(); - - if (ampm == "a") { - meridiem = index_1.Meridiem.AM; - - if (hour == 12) { - hour = 0; - - if (!components.isCertain("day")) { - components.imply("day", components.get("day") + 1); - } - } - } - - if (ampm == "p") { - meridiem = index_1.Meridiem.PM; - if (hour != 12) hour += 12; - } - - if (!result.start.isCertain("meridiem")) { - if (meridiem == index_1.Meridiem.AM) { - result.start.imply("meridiem", index_1.Meridiem.AM); - - if (result.start.get("hour") == 12) { - result.start.assign("hour", 0); - } - } else { - result.start.imply("meridiem", index_1.Meridiem.PM); - - if (result.start.get("hour") != 12) { - result.start.assign("hour", result.start.get("hour") + 12); - } - } - } - } - - components.assign("hour", hour); - components.assign("minute", minute); - - if (meridiem >= 0) { - components.assign("meridiem", meridiem); - } else { - const startAtPM = result.start.isCertain("meridiem") && result.start.get("hour") > 12; - - if (startAtPM) { - if (result.start.get("hour") - 12 > hour) { - components.imply("meridiem", index_1.Meridiem.AM); - } else if (hour <= 12) { - components.assign("hour", hour + 12); - components.assign("meridiem", index_1.Meridiem.PM); - } - } else if (hour > 12) { - components.imply("meridiem", index_1.Meridiem.PM); - } else if (hour <= 12) { - components.imply("meridiem", index_1.Meridiem.AM); - } - } - - if (components.date().getTime() < result.start.date().getTime()) { - components.imply("day", components.get("day") + 1); - } - - return components; - } - - checkAndReturnWithoutFollowingPattern(result) { - if (result.text.match(/^\d$/)) { - return null; - } - - if (result.text.match(/^\d\d\d+$/)) { - return null; - } - - if (result.text.match(/\d[apAP]$/)) { - return null; - } - - const endingWithNumbers = result.text.match(/[^\d:.](\d[\d.]+)$/); - - if (endingWithNumbers) { - const endingNumbers = endingWithNumbers[1]; - - if (this.strictMode) { - return null; - } - - if (endingNumbers.includes(".") && !endingNumbers.match(/\d(\.\d{2})+$/)) { - return null; - } - - const endingNumberVal = parseInt(endingNumbers); - - if (endingNumberVal > 24) { - return null; - } - } - - return result; - } - - checkAndReturnWithFollowingPattern(result) { - if (result.text.match(/^\d+-\d+$/)) { - return null; - } - - const endingWithNumbers = result.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/); - - if (endingWithNumbers) { - if (this.strictMode) { - return null; - } - - const startingNumbers = endingWithNumbers[1]; - const endingNumbers = endingWithNumbers[2]; - - if (endingNumbers.includes(".") && !endingNumbers.match(/\d(\.\d{2})+$/)) { - return null; - } - - const endingNumberVal = parseInt(endingNumbers); - const startingNumberVal = parseInt(startingNumbers); - - if (endingNumberVal > 24 || startingNumberVal > 24) { - return null; - } - } - - return result; - } - - getPrimaryTimePatternThroughCache() { - const primaryPrefix = this.primaryPrefix(); - const primarySuffix = this.primarySuffix(); - - if (this.cachedPrimaryPrefix === primaryPrefix && this.cachedPrimarySuffix === primarySuffix) { - return this.cachedPrimaryTimePattern; - } - - this.cachedPrimaryTimePattern = primaryTimePattern(this.primaryPatternLeftBoundary(), primaryPrefix, primarySuffix, this.patternFlags()); - this.cachedPrimaryPrefix = primaryPrefix; - this.cachedPrimarySuffix = primarySuffix; - return this.cachedPrimaryTimePattern; - } - - getFollowingTimePatternThroughCache() { - const followingPhase = this.followingPhase(); - const followingSuffix = this.followingSuffix(); - - if (this.cachedFollowingPhase === followingPhase && this.cachedFollowingSuffix === followingSuffix) { - return this.cachedFollowingTimePatten; - } - - this.cachedFollowingTimePatten = followingTimePatten(followingPhase, followingSuffix); - this.cachedFollowingPhase = followingPhase; - this.cachedFollowingSuffix = followingSuffix; - return this.cachedFollowingTimePatten; - } - -} - -exports.AbstractTimeExpressionParser = AbstractTimeExpressionParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/common/parsers/ISOFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})" + "(?:T" + "([0-9]{1,2}):([0-9]{1,2})" + "(?:" + ":([0-9]{1,2})(?:\\.(\\d{1,4}))?" + ")?" + "(?:" + "Z|([+-]\\d{2}):?(\\d{2})?" + ")?" + ")?" + "(?=\\W|$)", "i"); -const YEAR_NUMBER_GROUP = 1; -const MONTH_NUMBER_GROUP = 2; -const DATE_NUMBER_GROUP = 3; -const HOUR_NUMBER_GROUP = 4; -const MINUTE_NUMBER_GROUP = 5; -const SECOND_NUMBER_GROUP = 6; -const MILLISECOND_NUMBER_GROUP = 7; -const TZD_HOUR_OFFSET_GROUP = 8; -const TZD_MINUTE_OFFSET_GROUP = 9; - -class ISOFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const components = {}; - components["year"] = parseInt(match[YEAR_NUMBER_GROUP]); - components["month"] = parseInt(match[MONTH_NUMBER_GROUP]); - components["day"] = parseInt(match[DATE_NUMBER_GROUP]); - - if (match[HOUR_NUMBER_GROUP] != null) { - components["hour"] = parseInt(match[HOUR_NUMBER_GROUP]); - components["minute"] = parseInt(match[MINUTE_NUMBER_GROUP]); - - if (match[SECOND_NUMBER_GROUP] != null) { - components["second"] = parseInt(match[SECOND_NUMBER_GROUP]); - } - - if (match[MILLISECOND_NUMBER_GROUP] != null) { - components["millisecond"] = parseInt(match[MILLISECOND_NUMBER_GROUP]); - } - - if (match[TZD_HOUR_OFFSET_GROUP] == null) { - components["timezoneOffset"] = 0; - } else { - const hourOffset = parseInt(match[TZD_HOUR_OFFSET_GROUP]); - let minuteOffset = 0; - - if (match[TZD_MINUTE_OFFSET_GROUP] != null) { - minuteOffset = parseInt(match[TZD_MINUTE_OFFSET_GROUP]); - } - - let offset = hourOffset * 60; - - if (offset < 0) { - offset -= minuteOffset; - } else { - offset += minuteOffset; - } - - components["timezoneOffset"] = offset; - } - } - - return components; - } - -} - -exports["default"] = ISOFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/common/parsers/SlashDateFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -const PATTERN = new RegExp("([^\\d]|^)" + "([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})" + "(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?" + "(\\W|$)", "i"); -const OPENING_GROUP = 1; -const ENDING_GROUP = 5; -const FIRST_NUMBERS_GROUP = 2; -const SECOND_NUMBERS_GROUP = 3; -const YEAR_GROUP = 4; - -class SlashDateFormatParser { - constructor(littleEndian) { - this.groupNumberMonth = littleEndian ? SECOND_NUMBERS_GROUP : FIRST_NUMBERS_GROUP; - this.groupNumberDay = littleEndian ? FIRST_NUMBERS_GROUP : SECOND_NUMBERS_GROUP; - } - - pattern() { - return PATTERN; - } - - extract(context, match) { - if (match[OPENING_GROUP] == "/" || match[ENDING_GROUP] == "/") { - match.index += match[0].length; - return; - } - - const index = match.index + match[OPENING_GROUP].length; - const text = match[0].substr(match[OPENING_GROUP].length, match[0].length - match[OPENING_GROUP].length - match[ENDING_GROUP].length); - - if (text.match(/^\d\.\d$/) || text.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)) { - return; - } - - if (!match[YEAR_GROUP] && match[0].indexOf("/") < 0) { - return; - } - - const result = context.createParsingResult(index, text); - let month = parseInt(match[this.groupNumberMonth]); - let day = parseInt(match[this.groupNumberDay]); - - if (month < 1 || month > 12) { - if (month > 12) { - if (day >= 1 && day <= 12 && month <= 31) { - [day, month] = [month, day]; - } else { - return null; - } - } - } - - if (day < 1 || day > 31) { - return null; - } - - result.start.assign("day", day); - result.start.assign("month", month); - - if (match[YEAR_GROUP]) { - const rawYearNumber = parseInt(match[YEAR_GROUP]); - const year = years_1.findMostLikelyADYear(rawYearNumber); - result.start.assign("year", year); - } else { - const year = years_1.findYearClosestToRef(context.refDate, day, month); - result.start.imply("year", year); - } - - return result; - } - -} - -exports["default"] = SlashDateFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const abstractRefiners_1 = __webpack_require__("./node_modules/chrono-node/dist/common/abstractRefiners.js"); - -class AbstractMergeDateRangeRefiner extends abstractRefiners_1.MergingRefiner { - shouldMergeResults(textBetween, currentResult, nextResult) { - return !currentResult.end && !nextResult.end && textBetween.match(this.patternBetween()) != null; - } - - mergeResults(textBetween, fromResult, toResult) { - if (!fromResult.start.isOnlyWeekdayComponent() && !toResult.start.isOnlyWeekdayComponent()) { - toResult.start.getCertainComponents().forEach(key => { - if (!fromResult.start.isCertain(key)) { - fromResult.start.assign(key, toResult.start.get(key)); - } - }); - fromResult.start.getCertainComponents().forEach(key => { - if (!toResult.start.isCertain(key)) { - toResult.start.assign(key, fromResult.start.get(key)); - } - }); - } - - if (fromResult.start.date().getTime() > toResult.start.date().getTime()) { - let fromMoment = fromResult.start.dayjs(); - let toMoment = toResult.start.dayjs(); - - if (fromResult.start.isOnlyWeekdayComponent() && fromMoment.add(-7, "days").isBefore(toMoment)) { - fromMoment = fromMoment.add(-7, "days"); - fromResult.start.imply("day", fromMoment.date()); - fromResult.start.imply("month", fromMoment.month() + 1); - fromResult.start.imply("year", fromMoment.year()); - } else if (toResult.start.isOnlyWeekdayComponent() && toMoment.add(7, "days").isAfter(fromMoment)) { - toMoment = toMoment.add(7, "days"); - toResult.start.imply("day", toMoment.date()); - toResult.start.imply("month", toMoment.month() + 1); - toResult.start.imply("year", toMoment.year()); - } else { - [toResult, fromResult] = [fromResult, toResult]; - } - } - - const result = fromResult.clone(); - result.start = fromResult.start; - result.end = toResult.start; - result.index = Math.min(fromResult.index, toResult.index); - - if (fromResult.index < toResult.index) { - result.text = fromResult.text + textBetween + toResult.text; - } else { - result.text = toResult.text + textBetween + fromResult.text; - } - - return result; - } - -} - -exports["default"] = AbstractMergeDateRangeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateTimeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const abstractRefiners_1 = __webpack_require__("./node_modules/chrono-node/dist/common/abstractRefiners.js"); - -const mergingCalculation_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/mergingCalculation.js"); - -class ENMergeDateTimeRefiner extends abstractRefiners_1.MergingRefiner { - shouldMergeResults(textBetween, currentResult, nextResult) { - return (currentResult.start.isOnlyDate() && nextResult.start.isOnlyTime() || nextResult.start.isOnlyDate() && currentResult.start.isOnlyTime()) && textBetween.match(this.patternBetween()) != null; - } - - mergeResults(textBetween, currentResult, nextResult) { - const result = currentResult.start.isOnlyDate() ? mergingCalculation_1.mergeDateTimeResult(currentResult, nextResult) : mergingCalculation_1.mergeDateTimeResult(nextResult, currentResult); - result.index = currentResult.index; - result.text = currentResult.text + textBetween + nextResult.text; - return result; - } - -} - -exports["default"] = ENMergeDateTimeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/common/refiners/ExtractTimezoneAbbrRefiner.js": -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -const TIMEZONE_NAME_PATTERN = new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)", "i"); -const DEFAULT_TIMEZONE_ABBR_MAP = { - ACDT: 630, - ACST: 570, - ADT: -180, - AEDT: 660, - AEST: 600, - AFT: 270, - AKDT: -480, - AKST: -540, - ALMT: 360, - AMST: -180, - AMT: -240, - ANAST: 720, - ANAT: 720, - AQTT: 300, - ART: -180, - AST: -240, - AWDT: 540, - AWST: 480, - AZOST: 0, - AZOT: -60, - AZST: 300, - AZT: 240, - BNT: 480, - BOT: -240, - BRST: -120, - BRT: -180, - BST: 60, - BTT: 360, - CAST: 480, - CAT: 120, - CCT: 390, - CDT: -300, - CEST: 120, - CET: 60, - CHADT: 825, - CHAST: 765, - CKT: -600, - CLST: -180, - CLT: -240, - COT: -300, - CST: -360, - CVT: -60, - CXT: 420, - ChST: 600, - DAVT: 420, - EASST: -300, - EAST: -360, - EAT: 180, - ECT: -300, - EDT: -240, - EEST: 180, - EET: 120, - EGST: 0, - EGT: -60, - EST: -300, - ET: -300, - FJST: 780, - FJT: 720, - FKST: -180, - FKT: -240, - FNT: -120, - GALT: -360, - GAMT: -540, - GET: 240, - GFT: -180, - GILT: 720, - GMT: 0, - GST: 240, - GYT: -240, - HAA: -180, - HAC: -300, - HADT: -540, - HAE: -240, - HAP: -420, - HAR: -360, - HAST: -600, - HAT: -90, - HAY: -480, - HKT: 480, - HLV: -210, - HNA: -240, - HNC: -360, - HNE: -300, - HNP: -480, - HNR: -420, - HNT: -150, - HNY: -540, - HOVT: 420, - ICT: 420, - IDT: 180, - IOT: 360, - IRDT: 270, - IRKST: 540, - IRKT: 540, - IRST: 210, - IST: 330, - JST: 540, - KGT: 360, - KRAST: 480, - KRAT: 480, - KST: 540, - KUYT: 240, - LHDT: 660, - LHST: 630, - LINT: 840, - MAGST: 720, - MAGT: 720, - MART: -510, - MAWT: 300, - MDT: -360, - MESZ: 120, - MEZ: 60, - MHT: 720, - MMT: 390, - MSD: 240, - MSK: 240, - MST: -420, - MUT: 240, - MVT: 300, - MYT: 480, - NCT: 660, - NDT: -90, - NFT: 690, - NOVST: 420, - NOVT: 360, - NPT: 345, - NST: -150, - NUT: -660, - NZDT: 780, - NZST: 720, - OMSST: 420, - OMST: 420, - PDT: -420, - PET: -300, - PETST: 720, - PETT: 720, - PGT: 600, - PHOT: 780, - PHT: 480, - PKT: 300, - PMDT: -120, - PMST: -180, - PONT: 660, - PST: -480, - PT: -480, - PWT: 540, - PYST: -180, - PYT: -240, - RET: 240, - SAMT: 240, - SAST: 120, - SBT: 660, - SCT: 240, - SGT: 480, - SRT: -180, - SST: -660, - TAHT: -600, - TFT: 300, - TJT: 300, - TKT: 780, - TLT: 540, - TMT: 300, - TVT: 720, - ULAT: 480, - UTC: 0, - UYST: -120, - UYT: -180, - UZT: 300, - VET: -210, - VLAST: 660, - VLAT: 660, - VUT: 660, - WAST: 120, - WAT: 60, - WEST: 60, - WESZ: 60, - WET: 0, - WEZ: 0, - WFT: 720, - WGST: -120, - WGT: -180, - WIB: 420, - WIT: 540, - WITA: 480, - WST: 780, - WT: 0, - YAKST: 600, - YAKT: 600, - YAPT: 600, - YEKST: 360, - YEKT: 360 -}; - -class ExtractTimezoneAbbrRefiner { - constructor(timezoneOverrides) { - this.timezone = Object.assign(Object.assign({}, DEFAULT_TIMEZONE_ABBR_MAP), timezoneOverrides); - } - - refine(context, results) { - var _a; - - const timezoneOverrides = (_a = context.option.timezones) !== null && _a !== void 0 ? _a : {}; - results.forEach(result => { - var _a, _b; - - const suffix = context.text.substring(result.index + result.text.length); - const match = TIMEZONE_NAME_PATTERN.exec(suffix); - - if (!match) { - return; - } - - const timezoneAbbr = match[1].toUpperCase(); - const extractedTimezoneOffset = (_b = (_a = timezoneOverrides[timezoneAbbr]) !== null && _a !== void 0 ? _a : this.timezone[timezoneAbbr]) !== null && _b !== void 0 ? _b : null; - - if (extractedTimezoneOffset === null) { - return; - } - - context.debug(() => { - console.log(`Extracting timezone: '${timezoneAbbr}' into: ${extractedTimezoneOffset} for: ${result.start}`); - }); - const currentTimezoneOffset = result.start.get("timezoneOffset"); - - if (currentTimezoneOffset !== null && extractedTimezoneOffset != currentTimezoneOffset) { - if (result.start.isCertain("timezoneOffset")) { - return; - } - - if (timezoneAbbr != match[1]) { - return; - } - } - - if (result.start.isOnlyDate()) { - if (timezoneAbbr != match[1]) { - return; - } - } - - result.text += match[0]; - - if (!result.start.isCertain("timezoneOffset")) { - result.start.assign("timezoneOffset", extractedTimezoneOffset); - } - - if (result.end != null && !result.end.isCertain("timezoneOffset")) { - result.end.assign("timezoneOffset", extractedTimezoneOffset); - } - }); - return results; - } - -} - -exports["default"] = ExtractTimezoneAbbrRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/common/refiners/ExtractTimezoneOffsetRefiner.js": -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -const TIMEZONE_OFFSET_PATTERN = new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?", "i"); -const TIMEZONE_OFFSET_SIGN_GROUP = 1; -const TIMEZONE_OFFSET_HOUR_OFFSET_GROUP = 2; -const TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP = 3; - -class ExtractTimezoneOffsetRefiner { - refine(context, results) { - results.forEach(function (result) { - if (result.start.isCertain("timezoneOffset")) { - return; - } - - const suffix = context.text.substring(result.index + result.text.length); - const match = TIMEZONE_OFFSET_PATTERN.exec(suffix); - - if (!match) { - return; - } - - context.debug(() => { - console.log(`Extracting timezone: '${match[0]}' into : ${result}`); - }); - const hourOffset = parseInt(match[TIMEZONE_OFFSET_HOUR_OFFSET_GROUP]); - const minuteOffset = parseInt(match[TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP] || "0"); - let timezoneOffset = hourOffset * 60 + minuteOffset; - - if (timezoneOffset > 14 * 60) { - return; - } - - if (match[TIMEZONE_OFFSET_SIGN_GROUP] === "-") { - timezoneOffset = -timezoneOffset; - } - - if (result.end != null) { - result.end.assign("timezoneOffset", timezoneOffset); - } - - result.start.assign("timezoneOffset", timezoneOffset); - result.text += match[0]; - }); - return results; - } - -} - -exports["default"] = ExtractTimezoneOffsetRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/common/refiners/ForwardDateRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -class ForwardDateRefiner { - refine(context, results) { - if (!context.option.forwardDate) { - return results; - } - - results.forEach(function (result) { - let refMoment = dayjs_1.default(context.refDate); - - if (result.start.isOnlyDayMonthComponent() && refMoment.isAfter(result.start.dayjs())) { - for (let i = 0; i < 3 && refMoment.isAfter(result.start.dayjs()); i++) { - result.start.imply("year", result.start.get("year") + 1); - context.debug(() => { - console.log(`Forward yearly adjusted for ${result} (${result.start})`); - }); - - if (result.end && !result.end.isCertain("year")) { - result.end.imply("year", result.end.get("year") + 1); - context.debug(() => { - console.log(`Forward yearly adjusted for ${result} (${result.end})`); - }); - } - } - } - - if (result.start.isOnlyWeekdayComponent() && refMoment.isAfter(result.start.dayjs())) { - if (refMoment.day() >= result.start.get("weekday")) { - refMoment = refMoment.day(result.start.get("weekday") + 7); - } else { - refMoment = refMoment.day(result.start.get("weekday")); - } - - result.start.imply("day", refMoment.date()); - result.start.imply("month", refMoment.month() + 1); - result.start.imply("year", refMoment.year()); - context.debug(() => { - console.log(`Forward weekly adjusted for ${result} (${result.start})`); - }); - - if (result.end && result.end.isOnlyWeekdayComponent()) { - if (refMoment.day() > result.end.get("weekday")) { - refMoment = refMoment.day(result.end.get("weekday") + 7); - } else { - refMoment = refMoment.day(result.end.get("weekday")); - } - - result.end.imply("day", refMoment.date()); - result.end.imply("month", refMoment.month() + 1); - result.end.imply("year", refMoment.year()); - context.debug(() => { - console.log(`Forward weekly adjusted for ${result} (${result.end})`); - }); - } - } - }); - return results; - } - -} - -exports["default"] = ForwardDateRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/common/refiners/MergeWeekdayComponentRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const abstractRefiners_1 = __webpack_require__("./node_modules/chrono-node/dist/common/abstractRefiners.js"); - -class MergeWeekdayComponentRefiner extends abstractRefiners_1.MergingRefiner { - mergeResults(textBetween, currentResult, nextResult) { - const newResult = nextResult.clone(); - newResult.index = currentResult.index; - newResult.text = currentResult.text + textBetween + newResult.text; - newResult.start.assign("weekday", currentResult.start.get("weekday")); - - if (newResult.end) { - newResult.end.assign("weekday", currentResult.start.get("weekday")); - } - - return newResult; - } - - shouldMergeResults(textBetween, currentResult, nextResult) { - const weekdayThenNormalDate = currentResult.start.isOnlyWeekdayComponent() && !currentResult.start.isCertain("hour") && nextResult.start.isCertain("day"); - return weekdayThenNormalDate && textBetween.match(/^,?\s*$/) != null; - } - -} - -exports["default"] = MergeWeekdayComponentRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/common/refiners/OverlapRemovalRefiner.js": -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -class OverlapRemovalRefiner { - refine(context, results) { - if (results.length < 2) { - return results; - } - - const filteredResults = []; - let prevResult = results[0]; - - for (let i = 1; i < results.length; i++) { - const result = results[i]; - - if (result.index < prevResult.index + prevResult.text.length) { - if (result.text.length > prevResult.text.length) { - prevResult = result; - } - } else { - filteredResults.push(prevResult); - prevResult = result; - } - } - - if (prevResult != null) { - filteredResults.push(prevResult); - } - - return filteredResults; - } - -} - -exports["default"] = OverlapRemovalRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/common/refiners/UnlikelyFormatFilter.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const abstractRefiners_1 = __webpack_require__("./node_modules/chrono-node/dist/common/abstractRefiners.js"); - -class UnlikelyFormatFilter extends abstractRefiners_1.Filter { - constructor(strictMode) { - super(); - this.strictMode = strictMode; - } - - isValid(context, result) { - if (result.text.replace(" ", "").match(/^\d*(\.\d*)?$/)) { - context.debug(() => { - console.log(`Removing unlikely result '${result.text}'`); - }); - return false; - } - - if (!result.start.isValidDate()) { - context.debug(() => { - console.log(`Removing invalid result: ${result} (${result.start})`); - }); - return false; - } - - if (result.end && !result.end.isValidDate()) { - context.debug(() => { - console.log(`Removing invalid result: ${result} (${result.end})`); - }); - return false; - } - - if (this.strictMode) { - return this.isStrictModeValid(context, result); - } - - return true; - } - - isStrictModeValid(context, result) { - if (result.start.isOnlyWeekdayComponent()) { - context.debug(() => { - console.log(`(Strict) Removing weekday only component: ${result} (${result.end})`); - }); - return false; - } - - if (result.start.isOnlyTime() && (!result.start.isCertain("hour") || !result.start.isCertain("minute"))) { - context.debug(() => { - console.log(`(Strict) Removing uncertain time component: ${result} (${result.end})`); - }); - return false; - } - - return true; - } - -} - -exports["default"] = UnlikelyFormatFilter; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/configurations.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.includeCommonConfiguration = void 0; - -const ExtractTimezoneAbbrRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/ExtractTimezoneAbbrRefiner.js")); - -const ExtractTimezoneOffsetRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/ExtractTimezoneOffsetRefiner.js")); - -const OverlapRemovalRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/OverlapRemovalRefiner.js")); - -const ForwardDateRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/ForwardDateRefiner.js")); - -const UnlikelyFormatFilter_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/UnlikelyFormatFilter.js")); - -const ISOFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/parsers/ISOFormatParser.js")); - -const MergeWeekdayComponentRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/MergeWeekdayComponentRefiner.js")); - -function includeCommonConfiguration(configuration, strictMode = false) { - configuration.parsers.unshift(new ISOFormatParser_1.default()); - configuration.refiners.unshift(new MergeWeekdayComponentRefiner_1.default()); - configuration.refiners.unshift(new ExtractTimezoneAbbrRefiner_1.default()); - configuration.refiners.unshift(new ExtractTimezoneOffsetRefiner_1.default()); - configuration.refiners.unshift(new OverlapRemovalRefiner_1.default()); - configuration.refiners.push(new OverlapRemovalRefiner_1.default()); - configuration.refiners.push(new ForwardDateRefiner_1.default()); - configuration.refiners.push(new UnlikelyFormatFilter_1.default(strictMode)); - return configuration; -} - -exports.includeCommonConfiguration = includeCommonConfiguration; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/index.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function () { - return m[k]; - } - }); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}); - -var __importStar = this && this.__importStar || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - - __setModuleDefault(result, mod); - - return result; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.parseDate = exports.parse = exports.casual = exports.strict = exports.ru = exports.zh = exports.nl = exports.pt = exports.ja = exports.fr = exports.de = exports.Weekday = exports.Meridiem = exports.Chrono = exports.en = void 0; - -const en = __importStar(__webpack_require__("./node_modules/chrono-node/dist/locales/en/index.js")); - -exports.en = en; - -const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js"); - -Object.defineProperty(exports, "Chrono", ({ - enumerable: true, - get: function () { - return chrono_1.Chrono; - } -})); -var Meridiem; - -(function (Meridiem) { - Meridiem[Meridiem["AM"] = 0] = "AM"; - Meridiem[Meridiem["PM"] = 1] = "PM"; -})(Meridiem = exports.Meridiem || (exports.Meridiem = {})); - -var Weekday; - -(function (Weekday) { - Weekday[Weekday["SUNDAY"] = 0] = "SUNDAY"; - Weekday[Weekday["MONDAY"] = 1] = "MONDAY"; - Weekday[Weekday["TUESDAY"] = 2] = "TUESDAY"; - Weekday[Weekday["WEDNESDAY"] = 3] = "WEDNESDAY"; - Weekday[Weekday["THURSDAY"] = 4] = "THURSDAY"; - Weekday[Weekday["FRIDAY"] = 5] = "FRIDAY"; - Weekday[Weekday["SATURDAY"] = 6] = "SATURDAY"; -})(Weekday = exports.Weekday || (exports.Weekday = {})); - -const de = __importStar(__webpack_require__("./node_modules/chrono-node/dist/locales/de/index.js")); - -exports.de = de; - -const fr = __importStar(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/index.js")); - -exports.fr = fr; - -const ja = __importStar(__webpack_require__("./node_modules/chrono-node/dist/locales/ja/index.js")); - -exports.ja = ja; - -const pt = __importStar(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/index.js")); - -exports.pt = pt; - -const nl = __importStar(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/index.js")); - -exports.nl = nl; - -const zh = __importStar(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/index.js")); - -exports.zh = zh; - -const ru = __importStar(__webpack_require__("./node_modules/chrono-node/dist/locales/ru/index.js")); - -exports.ru = ru; -exports.strict = en.strict; -exports.casual = en.casual; - -function parse(text, ref, option) { - return exports.casual.parse(text, ref, option); -} - -exports.parse = parse; - -function parseDate(text, ref, option) { - return exports.casual.parseDate(text, ref, option); -} - -exports.parseDate = parseDate; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/de/constants.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.parseTimeUnits = exports.TIME_UNITS_PATTERN = exports.parseYear = exports.YEAR_PATTERN = exports.parseNumberPattern = exports.NUMBER_PATTERN = exports.TIME_UNIT_DICTIONARY = exports.INTEGER_WORD_DICTIONARY = exports.MONTH_DICTIONARY = exports.WEEKDAY_DICTIONARY = void 0; - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -exports.WEEKDAY_DICTIONARY = { - "sonntag": 0, - "so": 0, - "montag": 1, - "mo": 1, - "dienstag": 2, - "di": 2, - "mittwoch": 3, - "mi": 3, - "donnerstag": 4, - "do": 4, - "freitag": 5, - "fr": 5, - "samstag": 6, - "sa": 6 -}; -exports.MONTH_DICTIONARY = { - "januar": 1, - "jänner": 1, - "janner": 1, - "jan": 1, - "jan.": 1, - "februar": 2, - "feber": 2, - "feb": 2, - "feb.": 2, - "märz": 3, - "maerz": 3, - "mär": 3, - "mär.": 3, - "mrz": 3, - "mrz.": 3, - "april": 4, - "apr": 4, - "apr.": 4, - "mai": 5, - "juni": 6, - "jun": 6, - "jun.": 6, - "juli": 7, - "jul": 7, - "jul.": 7, - "august": 8, - "aug": 8, - "aug.": 8, - "september": 9, - "sep": 9, - "sep.": 9, - "sept": 9, - "sept.": 9, - "oktober": 10, - "okt": 10, - "okt.": 10, - "november": 11, - "nov": 11, - "nov.": 11, - "dezember": 12, - "dez": 12, - "dez.": 12 -}; -exports.INTEGER_WORD_DICTIONARY = { - "eins": 1, - "eine": 1, - "einem": 1, - "einen": 1, - "einer": 1, - "zwei": 2, - "drei": 3, - "vier": 4, - "fünf": 5, - "fuenf": 5, - "sechs": 6, - "sieben": 7, - "acht": 8, - "neun": 9, - "zehn": 10, - "elf": 11, - "zwölf": 12, - "zwoelf": 12 -}; -exports.TIME_UNIT_DICTIONARY = { - sek: "second", - sekunde: "second", - sekunden: "second", - min: "minute", - minute: "minute", - minuten: "minute", - h: "hour", - std: "hour", - stunde: "hour", - stunden: "hour", - tag: "d", - tage: "d", - tagen: "d", - woche: "week", - wochen: "week", - monat: "month", - monate: "month", - monaten: "month", - monats: "month", - quartal: "quarter", - quartals: "quarter", - quartale: "quarter", - quartalen: "quarter", - a: "year", - j: "year", - jr: "year", - jahr: "year", - jahre: "year", - jahren: "year", - jahres: "year" -}; -exports.NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s*an?)?|an?\\b(?:\\s*few)?|few|several|a?\\s*couple\\s*(?:of)?)`; - -function parseNumberPattern(match) { - const num = match.toLowerCase(); - - if (exports.INTEGER_WORD_DICTIONARY[num] !== undefined) { - return exports.INTEGER_WORD_DICTIONARY[num]; - } else if (num === "a" || num === "an") { - return 1; - } else if (num.match(/few/)) { - return 3; - } else if (num.match(/half/)) { - return 0.5; - } else if (num.match(/couple/)) { - return 2; - } else if (num.match(/several/)) { - return 7; - } - - return parseFloat(num); -} - -exports.parseNumberPattern = parseNumberPattern; -exports.YEAR_PATTERN = `(?:[0-9]{1,4}(?:\\s*[vn]\\.?\\s*(?:C(?:hr)?|(?:u\\.?|d\\.?(?:\\s*g\\.?)?)?\\s*Z)\\.?|\\s*(?:u\\.?|d\\.?(?:\\s*g\\.)?)\\s*Z\\.?)?)`; - -function parseYear(match) { - if (/v/i.test(match)) { - return -parseInt(match.replace(/[^0-9]+/gi, "")); - } - - if (/n/i.test(match)) { - return parseInt(match.replace(/[^0-9]+/gi, "")); - } - - if (/z/i.test(match)) { - return parseInt(match.replace(/[^0-9]+/gi, "")); - } - - const rawYearNumber = parseInt(match); - return years_1.findMostLikelyADYear(rawYearNumber); -} - -exports.parseYear = parseYear; -const SINGLE_TIME_UNIT_PATTERN = `(${exports.NUMBER_PATTERN})\\s{0,5}(${pattern_1.matchAnyPattern(exports.TIME_UNIT_DICTIONARY)})\\s{0,5}`; -const SINGLE_TIME_UNIT_REGEX = new RegExp(SINGLE_TIME_UNIT_PATTERN, "i"); -exports.TIME_UNITS_PATTERN = pattern_1.repeatedTimeunitPattern("", SINGLE_TIME_UNIT_PATTERN); - -function parseTimeUnits(timeunitText) { - const fragments = {}; - let remainingText = timeunitText; - let match = SINGLE_TIME_UNIT_REGEX.exec(remainingText); - - while (match) { - collectDateTimeFragment(fragments, match); - remainingText = remainingText.substring(match[0].length); - match = SINGLE_TIME_UNIT_REGEX.exec(remainingText); - } - - return fragments; -} - -exports.parseTimeUnits = parseTimeUnits; - -function collectDateTimeFragment(fragments, match) { - const num = parseNumberPattern(match[1]); - const unit = exports.TIME_UNIT_DICTIONARY[match[2].toLowerCase()]; - fragments[unit] = num; -} - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/de/index.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0; - -const configurations_1 = __webpack_require__("./node_modules/chrono-node/dist/configurations.js"); - -const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js"); - -const SlashDateFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/parsers/SlashDateFormatParser.js")); - -const ISOFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/parsers/ISOFormatParser.js")); - -const DETimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/parsers/DETimeExpressionParser.js")); - -const DEWeekdayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/parsers/DEWeekdayParser.js")); - -const DESpecificTimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/parsers/DESpecificTimeExpressionParser.js")); - -const DEMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/refiners/DEMergeDateRangeRefiner.js")); - -const DEMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/refiners/DEMergeDateTimeRefiner.js")); - -const DECasualDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/parsers/DECasualDateParser.js")); - -const DECasualTimeParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/parsers/DECasualTimeParser.js")); - -const DEMonthNameLittleEndianParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/parsers/DEMonthNameLittleEndianParser.js")); - -const DETimeUnitRelativeFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/parsers/DETimeUnitRelativeFormatParser.js")); - -exports.casual = new chrono_1.Chrono(createCasualConfiguration()); -exports.strict = new chrono_1.Chrono(createConfiguration(true)); - -function parse(text, ref, option) { - return exports.casual.parse(text, ref, option); -} - -exports.parse = parse; - -function parseDate(text, ref, option) { - return exports.casual.parseDate(text, ref, option); -} - -exports.parseDate = parseDate; - -function createCasualConfiguration(littleEndian = true) { - const option = createConfiguration(false, littleEndian); - option.parsers.unshift(new DECasualTimeParser_1.default()); - option.parsers.unshift(new DECasualDateParser_1.default()); - option.parsers.unshift(new DETimeUnitRelativeFormatParser_1.default()); - return option; -} - -exports.createCasualConfiguration = createCasualConfiguration; - -function createConfiguration(strictMode = true, littleEndian = true) { - return configurations_1.includeCommonConfiguration({ - parsers: [new ISOFormatParser_1.default(), new SlashDateFormatParser_1.default(littleEndian), new DETimeExpressionParser_1.default(), new DESpecificTimeExpressionParser_1.default(), new DEMonthNameLittleEndianParser_1.default(), new DEWeekdayParser_1.default()], - refiners: [new DEMergeDateRangeRefiner_1.default(), new DEMergeDateTimeRefiner_1.default()] - }, strictMode); -} - -exports.createConfiguration = createConfiguration; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/de/parsers/DECasualDateParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function () { - return m[k]; - } - }); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}); - -var __importStar = this && this.__importStar || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - - __setModuleDefault(result, mod); - - return result; -}; - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js"); - -const DECasualTimeParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/de/parsers/DECasualTimeParser.js")); - -const references = __importStar(__webpack_require__("./node_modules/chrono-node/dist/common/casualReferences.js")); - -const PATTERN = new RegExp(`(jetzt|heute|morgen|übermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)` + `(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?` + `(?=\\W|$)`, "i"); -const DATE_GROUP = 1; -const TIME_GROUP = 2; - -class DECasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern(context) { - return PATTERN; - } - - innerExtract(context, match) { - let targetDate = dayjs_1.default(context.refDate); - const dateKeyword = (match[DATE_GROUP] || "").toLowerCase(); - const timeKeyword = (match[TIME_GROUP] || "").toLowerCase(); - let component = context.createParsingComponents(); - - switch (dateKeyword) { - case "jetzt": - component = references.now(context.reference); - break; - - case "heute": - component = references.today(context.reference); - break; - - case "morgen": - dayjs_2.assignTheNextDay(component, targetDate); - break; - - case "übermorgen": - case "uebermorgen": - targetDate = targetDate.add(1, "day"); - dayjs_2.assignTheNextDay(component, targetDate); - break; - - case "gestern": - targetDate = targetDate.add(-1, "day"); - dayjs_2.assignSimilarDate(component, targetDate); - dayjs_2.implySimilarTime(component, targetDate); - break; - - case "vorgestern": - targetDate = targetDate.add(-2, "day"); - dayjs_2.assignSimilarDate(component, targetDate); - dayjs_2.implySimilarTime(component, targetDate); - break; - - default: - if (dateKeyword.match(/letzte\s*nacht/)) { - if (targetDate.hour() > 6) { - targetDate = targetDate.add(-1, "day"); - } - - dayjs_2.assignSimilarDate(component, targetDate); - component.imply("hour", 0); - } - - break; - } - - if (timeKeyword) { - component = DECasualTimeParser_1.default.extractTimeComponents(component, timeKeyword); - } - - return component; - } - -} - -exports["default"] = DECasualDateParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/de/parsers/DECasualTimeParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js"); - -const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js"); - -class DECasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern(context) { - return /(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i; - } - - innerExtract(context, match) { - const targetDate = dayjs_1.default(context.refDate); - const timeKeywordPattern = match[2].toLowerCase(); - const component = context.createParsingComponents(); - dayjs_2.implySimilarTime(component, targetDate); - return DECasualTimeParser.extractTimeComponents(component, timeKeywordPattern); - } - - static extractTimeComponents(component, timeKeywordPattern) { - switch (timeKeywordPattern) { - case "morgen": - component.imply("hour", 6); - component.imply("minute", 0); - component.imply("second", 0); - component.imply("meridiem", index_1.Meridiem.AM); - break; - - case "vormittag": - component.imply("hour", 9); - component.imply("minute", 0); - component.imply("second", 0); - component.imply("meridiem", index_1.Meridiem.AM); - break; - - case "mittag": - case "mittags": - component.imply("hour", 12); - component.imply("minute", 0); - component.imply("second", 0); - component.imply("meridiem", index_1.Meridiem.AM); - break; - - case "nachmittag": - component.imply("hour", 15); - component.imply("minute", 0); - component.imply("second", 0); - component.imply("meridiem", index_1.Meridiem.PM); - break; - - case "abend": - component.imply("hour", 18); - component.imply("minute", 0); - component.imply("second", 0); - component.imply("meridiem", index_1.Meridiem.PM); - break; - - case "nacht": - component.imply("hour", 22); - component.imply("minute", 0); - component.imply("second", 0); - component.imply("meridiem", index_1.Meridiem.PM); - break; - - case "mitternacht": - if (component.get("hour") > 1) { - component = timeunits_1.addImpliedTimeUnits(component, { - "day": 1 - }); - } - - component.imply("hour", 0); - component.imply("minute", 0); - component.imply("second", 0); - component.imply("meridiem", index_1.Meridiem.AM); - break; - } - - return component; - } - -} - -exports["default"] = DECasualTimeParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/de/parsers/DEMonthNameLittleEndianParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/de/constants.js"); - -const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/de/constants.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp("(?:am\\s*?)?" + "(?:den\\s*?)?" + `([0-9]{1,2})\\.` + `(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\–|\\s)\\s*([0-9]{1,2})\\.?)?\\s*` + `(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` + `(?:(?:-|/|,?\\s*)(${constants_2.YEAR_PATTERN}(?![^\\s]\\d)))?` + `(?=\\W|$)`, "i"); -const DATE_GROUP = 1; -const DATE_TO_GROUP = 2; -const MONTH_NAME_GROUP = 3; -const YEAR_GROUP = 4; - -class DEMonthNameLittleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const result = context.createParsingResult(match.index, match[0]); - const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()]; - const day = parseInt(match[DATE_GROUP]); - - if (day > 31) { - match.index = match.index + match[DATE_GROUP].length; - return null; - } - - result.start.assign("month", month); - result.start.assign("day", day); - - if (match[YEAR_GROUP]) { - const yearNumber = constants_2.parseYear(match[YEAR_GROUP]); - result.start.assign("year", yearNumber); - } else { - const year = years_1.findYearClosestToRef(context.refDate, day, month); - result.start.imply("year", year); - } - - if (match[DATE_TO_GROUP]) { - const endDate = parseInt(match[DATE_TO_GROUP]); - result.end = result.start.clone(); - result.end.assign("day", endDate); - } - - return result; - } - -} - -exports["default"] = DEMonthNameLittleEndianParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/de/parsers/DESpecificTimeExpressionParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); - -const FIRST_REG_PATTERN = new RegExp("(^|\\s|T)" + "(?:(?:um|von)\\s*)?" + "(\\d{1,2})(?:h|:)?" + "(?:(\\d{1,2})(?:m|:)?)?" + "(?:(\\d{1,2})(?:s)?)?" + "(?:\\s*Uhr)?" + "(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?" + "(?=\\W|$)", "i"); -const SECOND_REG_PATTERN = new RegExp("^\\s*(\\-|\\–|\\~|\\〜|bis(?:\\s+um)?|\\?)\\s*" + "(\\d{1,2})(?:h|:)?" + "(?:(\\d{1,2})(?:m|:)?)?" + "(?:(\\d{1,2})(?:s)?)?" + "(?:\\s*Uhr)?" + "(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?" + "(?=\\W|$)", "i"); -const HOUR_GROUP = 2; -const MINUTE_GROUP = 3; -const SECOND_GROUP = 4; -const AM_PM_HOUR_GROUP = 5; - -class DESpecificTimeExpressionParser { - pattern(context) { - return FIRST_REG_PATTERN; - } - - extract(context, match) { - const result = context.createParsingResult(match.index + match[1].length, match[0].substring(match[1].length)); - - if (result.text.match(/^\d{4}$/)) { - match.index += match[0].length; - return null; - } - - result.start = DESpecificTimeExpressionParser.extractTimeComponent(result.start.clone(), match); - - if (!result.start) { - match.index += match[0].length; - return null; - } - - const remainingText = context.text.substring(match.index + match[0].length); - const secondMatch = SECOND_REG_PATTERN.exec(remainingText); - - if (secondMatch) { - result.end = DESpecificTimeExpressionParser.extractTimeComponent(result.start.clone(), secondMatch); - - if (result.end) { - result.text += secondMatch[0]; - } - } - - return result; - } - - static extractTimeComponent(extractingComponents, match) { - let hour = 0; - let minute = 0; - let meridiem = null; - hour = parseInt(match[HOUR_GROUP]); - - if (match[MINUTE_GROUP] != null) { - minute = parseInt(match[MINUTE_GROUP]); - } - - if (minute >= 60 || hour > 24) { - return null; - } - - if (hour >= 12) { - meridiem = index_1.Meridiem.PM; - } - - if (match[AM_PM_HOUR_GROUP] != null) { - if (hour > 12) return null; - const ampm = match[AM_PM_HOUR_GROUP].toLowerCase(); - - if (ampm.match(/morgen|vormittag/)) { - meridiem = index_1.Meridiem.AM; - - if (hour == 12) { - hour = 0; - } - } - - if (ampm.match(/nachmittag|abend/)) { - meridiem = index_1.Meridiem.PM; - - if (hour != 12) { - hour += 12; - } - } - - if (ampm.match(/nacht/)) { - if (hour == 12) { - meridiem = index_1.Meridiem.AM; - hour = 0; - } else if (hour < 6) { - meridiem = index_1.Meridiem.AM; - } else { - meridiem = index_1.Meridiem.PM; - hour += 12; - } - } - } - - extractingComponents.assign("hour", hour); - extractingComponents.assign("minute", minute); - - if (meridiem !== null) { - extractingComponents.assign("meridiem", meridiem); - } else { - if (hour < 12) { - extractingComponents.imply("meridiem", index_1.Meridiem.AM); - } else { - extractingComponents.imply("meridiem", index_1.Meridiem.PM); - } - } - - if (match[SECOND_GROUP] != null) { - const second = parseInt(match[SECOND_GROUP]); - if (second >= 60) return null; - extractingComponents.assign("second", second); - } - - return extractingComponents; - } - -} - -exports["default"] = DESpecificTimeExpressionParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/de/parsers/DETimeExpressionParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractTimeExpressionParser_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractTimeExpressionParser.js"); - -class DETimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser { - primaryPrefix() { - return "(?:(?:um|von)\\s*)?"; - } - - followingPhase() { - return "\\s*(?:\\-|\\–|\\~|\\〜|bis)\\s*"; - } - - extractPrimaryTimeComponents(context, match) { - if (match[0].match(/^\s*\d{4}\s*$/)) { - return null; - } - - return super.extractPrimaryTimeComponents(context, match); - } - -} - -exports["default"] = DETimeExpressionParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/de/parsers/DETimeUnitRelativeFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/de/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -class DETimeUnitAgoFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - constructor() { - super(); - } - - innerPattern() { - return new RegExp(`(?:\\s*((?:nächste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?|vor|in)\\s*)?` + `(${constants_1.NUMBER_PATTERN})?` + `(?:\\s*(nächste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?` + `\\s*(${pattern_1.matchAnyPattern(constants_1.TIME_UNIT_DICTIONARY)})`, "i"); - } - - innerExtract(context, match) { - const num = match[2] ? constants_1.parseNumberPattern(match[2]) : 1; - const unit = constants_1.TIME_UNIT_DICTIONARY[match[4].toLowerCase()]; - let timeUnits = {}; - timeUnits[unit] = num; - let modifier = match[1] || match[3] || ""; - modifier = modifier.toLowerCase(); - - if (!modifier) { - return; - } - - if (/vor/.test(modifier) || /letzte/.test(modifier) || /vergangen/.test(modifier)) { - timeUnits = timeunits_1.reverseTimeUnits(timeUnits); - } - - return results_1.ParsingComponents.createRelativeFromReference(context.reference, timeUnits); - } - -} - -exports["default"] = DETimeUnitAgoFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/de/parsers/DEWeekdayParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/de/constants.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const weekdays_1 = __webpack_require__("./node_modules/chrono-node/dist/common/calculation/weekdays.js"); - -const PATTERN = new RegExp("(?:(?:\\,|\\(|\\()\\s*)?" + "(?:a[mn]\\s*?)?" + "(?:(diese[mn]|letzte[mn]|n(?:ä|ae)chste[mn])\\s*)?" + `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` + "(?:\\s*(?:\\,|\\)|\\)))?" + "(?:\\s*(diese|letzte|n(?:ä|ae)chste)\\s*woche)?" + "(?=\\W|$)", "i"); -const PREFIX_GROUP = 1; -const SUFFIX_GROUP = 3; -const WEEKDAY_GROUP = 2; - -class DEWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase(); - const offset = constants_1.WEEKDAY_DICTIONARY[dayOfWeek]; - const prefix = match[PREFIX_GROUP]; - const postfix = match[SUFFIX_GROUP]; - let modifierWord = prefix || postfix; - modifierWord = modifierWord || ""; - modifierWord = modifierWord.toLowerCase(); - let modifier = null; - - if (modifierWord.match(/letzte/)) { - modifier = "last"; - } else if (modifierWord.match(/chste/)) { - modifier = "next"; - } else if (modifierWord.match(/diese/)) { - modifier = "this"; - } - - return weekdays_1.createParsingComponentsAtWeekday(context.reference, offset, modifier); - } - -} - -exports["default"] = DEWeekdayParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/de/refiners/DEMergeDateRangeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js")); - -class DEMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default { - patternBetween() { - return /^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i; - } - -} - -exports["default"] = DEMergeDateRangeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/de/refiners/DEMergeDateTimeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateTimeRefiner.js")); - -class DEMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default { - patternBetween() { - return new RegExp("^\\s*(T|um|am|,|-)?\\s*$"); - } - -} - -exports["default"] = DEMergeDateTimeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/constants.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.parseTimeUnits = exports.TIME_UNITS_PATTERN = exports.parseYear = exports.YEAR_PATTERN = exports.parseOrdinalNumberPattern = exports.ORDINAL_NUMBER_PATTERN = exports.parseNumberPattern = exports.NUMBER_PATTERN = exports.TIME_UNIT_DICTIONARY = exports.ORDINAL_WORD_DICTIONARY = exports.INTEGER_WORD_DICTIONARY = exports.MONTH_DICTIONARY = exports.FULL_MONTH_NAME_DICTIONARY = exports.WEEKDAY_DICTIONARY = void 0; - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -exports.WEEKDAY_DICTIONARY = { +const WEEKDAY_DICTIONARY = { sunday: 0, sun: 0, "sun.": 0, @@ -3000,7 +983,7 @@ exports.WEEKDAY_DICTIONARY = { sat: 6, "sat.": 6 }; -exports.FULL_MONTH_NAME_DICTIONARY = { +const FULL_MONTH_NAME_DICTIONARY = { january: 1, february: 2, march: 3, @@ -3014,7 +997,8 @@ exports.FULL_MONTH_NAME_DICTIONARY = { november: 11, december: 12 }; -exports.MONTH_DICTIONARY = Object.assign(Object.assign({}, exports.FULL_MONTH_NAME_DICTIONARY), { +const MONTH_DICTIONARY = { + ...FULL_MONTH_NAME_DICTIONARY, jan: 1, "jan.": 1, feb: 2, @@ -3039,8 +1023,8 @@ exports.MONTH_DICTIONARY = Object.assign(Object.assign({}, exports.FULL_MONTH_NA "nov.": 11, dec: 12, "dec.": 12 -}); -exports.INTEGER_WORD_DICTIONARY = { +}; +const INTEGER_WORD_DICTIONARY = { one: 1, two: 2, three: 3, @@ -3054,7 +1038,7 @@ exports.INTEGER_WORD_DICTIONARY = { eleven: 11, twelve: 12 }; -exports.ORDINAL_WORD_DICTIONARY = { +const ORDINAL_WORD_DICTIONARY = { first: 1, second: 2, third: 3, @@ -3097,10 +1081,30 @@ exports.ORDINAL_WORD_DICTIONARY = { "thirty first": 31, "thirty-first": 31 }; -exports.TIME_UNIT_DICTIONARY = { +const TIME_UNIT_DICTIONARY_NO_ABBR = { + second: "second", + seconds: "second", + minute: "minute", + minutes: "minute", + hour: "hour", + hours: "hour", + day: "d", + days: "d", + week: "week", + weeks: "week", + month: "month", + months: "month", + quarter: "quarter", + quarters: "quarter", + year: "year", + years: "year" +}; +const TIME_UNIT_DICTIONARY = { + s: "second", sec: "second", second: "second", seconds: "second", + m: "minute", min: "minute", mins: "minute", minute: "minute", @@ -3110,10 +1114,15 @@ exports.TIME_UNIT_DICTIONARY = { hrs: "hour", hour: "hour", hours: "hour", + d: "d", day: "d", days: "d", + w: "w", week: "week", weeks: "week", + mo: "month", + mon: "month", + mos: "month", month: "month", months: "month", qtr: "quarter", @@ -3122,16 +1131,15 @@ exports.TIME_UNIT_DICTIONARY = { y: "year", yr: "year", year: "year", - years: "year" + years: "year", + ...TIME_UNIT_DICTIONARY_NO_ABBR }; -exports.NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|a?\\s{0,2}couple\\s{0,2}(?:of)?)`; - +const NUMBER_PATTERN = `(?:${matchAnyPattern(INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|the|a?\\s{0,2}couple\\s{0,2}(?:of)?)`; function parseNumberPattern(match) { const num = match.toLowerCase(); - - if (exports.INTEGER_WORD_DICTIONARY[num] !== undefined) { - return exports.INTEGER_WORD_DICTIONARY[num]; - } else if (num === "a" || num === "an") { + if (INTEGER_WORD_DICTIONARY[num] !== undefined) { + return INTEGER_WORD_DICTIONARY[num]; + } else if (num === "a" || num === "an" || num == "the") { return 1; } else if (num.match(/few/)) { return 3; @@ -3142,7695 +1150,100 @@ function parseNumberPattern(match) { } else if (num.match(/several/)) { return 7; } - return parseFloat(num); } - -exports.parseNumberPattern = parseNumberPattern; -exports.ORDINAL_NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`; - +const ORDINAL_NUMBER_PATTERN = `(?:${matchAnyPattern(ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`; function parseOrdinalNumberPattern(match) { let num = match.toLowerCase(); - - if (exports.ORDINAL_WORD_DICTIONARY[num] !== undefined) { - return exports.ORDINAL_WORD_DICTIONARY[num]; + if (ORDINAL_WORD_DICTIONARY[num] !== undefined) { + return ORDINAL_WORD_DICTIONARY[num]; } - num = num.replace(/(?:st|nd|rd|th)$/i, ""); return parseInt(num); } - -exports.parseOrdinalNumberPattern = parseOrdinalNumberPattern; -exports.YEAR_PATTERN = `(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9])`; - +const YEAR_PATTERN = `(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9])`; function parseYear(match) { if (/BE/i.test(match)) { match = match.replace(/BE/i, ""); return parseInt(match) - 543; } - if (/BCE?/i.test(match)) { match = match.replace(/BCE?/i, ""); return -parseInt(match); } - if (/(AD|CE)/i.test(match)) { match = match.replace(/(AD|CE)/i, ""); return parseInt(match); } - const rawYearNumber = parseInt(match); - return years_1.findMostLikelyADYear(rawYearNumber); + return findMostLikelyADYear(rawYearNumber); } - -exports.parseYear = parseYear; -const SINGLE_TIME_UNIT_PATTERN = `(${exports.NUMBER_PATTERN})\\s{0,3}(${pattern_1.matchAnyPattern(exports.TIME_UNIT_DICTIONARY)})`; +const SINGLE_TIME_UNIT_PATTERN = `(${NUMBER_PATTERN})\\s{0,3}(${matchAnyPattern(TIME_UNIT_DICTIONARY)})`; const SINGLE_TIME_UNIT_REGEX = new RegExp(SINGLE_TIME_UNIT_PATTERN, "i"); -exports.TIME_UNITS_PATTERN = pattern_1.repeatedTimeunitPattern(`(?:(?:about|around)\\s{0,3})?`, SINGLE_TIME_UNIT_PATTERN); - +const SINGLE_TIME_UNIT_NO_ABBR_PATTERN = `(${NUMBER_PATTERN})\\s{0,3}(${matchAnyPattern(TIME_UNIT_DICTIONARY_NO_ABBR)})`; +const TIME_UNITS_PATTERN = repeatedTimeunitPattern(`(?:(?:about|around)\\s{0,3})?`, SINGLE_TIME_UNIT_PATTERN); +const TIME_UNITS_NO_ABBR_PATTERN = repeatedTimeunitPattern(`(?:(?:about|around)\\s{0,3})?`, SINGLE_TIME_UNIT_NO_ABBR_PATTERN); function parseTimeUnits(timeunitText) { const fragments = {}; let remainingText = timeunitText; let match = SINGLE_TIME_UNIT_REGEX.exec(remainingText); - while (match) { collectDateTimeFragment(fragments, match); remainingText = remainingText.substring(match[0].length).trim(); match = SINGLE_TIME_UNIT_REGEX.exec(remainingText); } - return fragments; } - -exports.parseTimeUnits = parseTimeUnits; - function collectDateTimeFragment(fragments, match) { const num = parseNumberPattern(match[1]); - const unit = exports.TIME_UNIT_DICTIONARY[match[2].toLowerCase()]; + const unit = TIME_UNIT_DICTIONARY[match[2].toLowerCase()]; fragments[unit] = num; } - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/index.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.GB = exports.strict = exports.casual = void 0; - -const ENTimeUnitWithinFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitWithinFormatParser.js")); - -const ENMonthNameLittleEndianParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENMonthNameLittleEndianParser.js")); - -const ENMonthNameMiddleEndianParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENMonthNameMiddleEndianParser.js")); - -const ENMonthNameParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENMonthNameParser.js")); - -const ENCasualYearMonthDayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENCasualYearMonthDayParser.js")); - -const ENSlashMonthFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENSlashMonthFormatParser.js")); - -const ENTimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENTimeExpressionParser.js")); - -const ENTimeUnitAgoFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitAgoFormatParser.js")); - -const ENTimeUnitLaterFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitLaterFormatParser.js")); - -const ENMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/refiners/ENMergeDateRangeRefiner.js")); - -const ENMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/refiners/ENMergeDateTimeRefiner.js")); - -const configurations_1 = __webpack_require__("./node_modules/chrono-node/dist/configurations.js"); - -const ENCasualDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENCasualDateParser.js")); - -const ENCasualTimeParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENCasualTimeParser.js")); - -const ENWeekdayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENWeekdayParser.js")); - -const ENRelativeDateFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENRelativeDateFormatParser.js")); - -const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js"); - -const SlashDateFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/parsers/SlashDateFormatParser.js")); - -const ENTimeUnitCasualRelativeFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitCasualRelativeFormatParser.js")); - -const ENMergeRelativeDateRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/en/refiners/ENMergeRelativeDateRefiner.js")); - -exports.casual = new chrono_1.Chrono(createCasualConfiguration(false)); -exports.strict = new chrono_1.Chrono(createConfiguration(true, false)); -exports.GB = new chrono_1.Chrono(createConfiguration(false, true)); - -function parse(text, ref, option) { - return exports.casual.parse(text, ref, option); -} - -exports.parse = parse; - -function parseDate(text, ref, option) { - return exports.casual.parseDate(text, ref, option); -} - -exports.parseDate = parseDate; - -function createCasualConfiguration(littleEndian = false) { - const option = createConfiguration(false, littleEndian); - option.parsers.unshift(new ENCasualDateParser_1.default()); - option.parsers.unshift(new ENCasualTimeParser_1.default()); - option.parsers.unshift(new ENMonthNameParser_1.default()); - option.parsers.unshift(new ENRelativeDateFormatParser_1.default()); - option.parsers.unshift(new ENTimeUnitCasualRelativeFormatParser_1.default()); - return option; -} - -exports.createCasualConfiguration = createCasualConfiguration; - -function createConfiguration(strictMode = true, littleEndian = false) { - return configurations_1.includeCommonConfiguration({ - parsers: [new SlashDateFormatParser_1.default(littleEndian), new ENTimeUnitWithinFormatParser_1.default(), new ENMonthNameLittleEndianParser_1.default(), new ENMonthNameMiddleEndianParser_1.default(), new ENWeekdayParser_1.default(), new ENCasualYearMonthDayParser_1.default(), new ENSlashMonthFormatParser_1.default(), new ENTimeExpressionParser_1.default(strictMode), new ENTimeUnitAgoFormatParser_1.default(strictMode), new ENTimeUnitLaterFormatParser_1.default(strictMode)], - refiners: [new ENMergeRelativeDateRefiner_1.default(), new ENMergeDateTimeRefiner_1.default(), new ENMergeDateRangeRefiner_1.default()] - }, strictMode); -} - -exports.createConfiguration = createConfiguration; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENCasualDateParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function () { - return m[k]; - } - }); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}); - -var __importStar = this && this.__importStar || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - - __setModuleDefault(result, mod); - - return result; -}; - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js"); - -const references = __importStar(__webpack_require__("./node_modules/chrono-node/dist/common/casualReferences.js")); - -const PATTERN = /(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i; - -class ENCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern(context) { - return PATTERN; - } - - innerExtract(context, match) { - let targetDate = dayjs_1.default(context.refDate); - const lowerText = match[0].toLowerCase(); - const component = context.createParsingComponents(); - - switch (lowerText) { - case "now": - return references.now(context.reference); - - case "today": - return references.today(context.reference); - - case "yesterday": - return references.yesterday(context.reference); - - case "tomorrow": - case "tmr": - case "tmrw": - return references.tomorrow(context.reference); - - case "tonight": - return references.tonight(context.reference); - - default: - if (lowerText.match(/last\s*night/)) { - if (targetDate.hour() > 6) { - targetDate = targetDate.add(-1, "day"); - } - - dayjs_2.assignSimilarDate(component, targetDate); - component.imply("hour", 0); - } - - break; - } - - return component; - } - -} - -exports["default"] = ENCasualDateParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENCasualTimeParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js"); - -const PATTERN = /(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i; - -class ENCasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const targetDate = dayjs_1.default(context.refDate); - const component = context.createParsingComponents(); - - switch (match[1].toLowerCase()) { - case "afternoon": - component.imply("meridiem", index_1.Meridiem.PM); - component.imply("hour", 15); - break; - - case "evening": - case "night": - component.imply("meridiem", index_1.Meridiem.PM); - component.imply("hour", 20); - break; - - case "midnight": - dayjs_2.assignTheNextDay(component, targetDate); - component.imply("hour", 0); - component.imply("minute", 0); - component.imply("second", 0); - break; - - case "morning": - component.imply("meridiem", index_1.Meridiem.AM); - component.imply("hour", 6); - break; - - case "noon": - component.imply("meridiem", index_1.Meridiem.AM); - component.imply("hour", 12); - break; - } - - return component; - } - -} - -exports["default"] = ENCasualTimeParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENCasualYearMonthDayParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp(`([0-9]{4})[\\.\\/\\s]` + `(?:(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]` + `([0-9]{1,2})` + "(?=\\W|$)", "i"); -const YEAR_NUMBER_GROUP = 1; -const MONTH_NAME_GROUP = 2; -const MONTH_NUMBER_GROUP = 3; -const DATE_NUMBER_GROUP = 4; - -class ENCasualYearMonthDayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const month = match[MONTH_NUMBER_GROUP] ? parseInt(match[MONTH_NUMBER_GROUP]) : constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()]; - - if (month < 1 || month > 12) { - return null; - } - - const year = parseInt(match[YEAR_NUMBER_GROUP]); - const day = parseInt(match[DATE_NUMBER_GROUP]); - return { - day: day, - month: month, - year: year - }; - } - -} - -exports["default"] = ENCasualYearMonthDayParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENMonthNameLittleEndianParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const constants_3 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp(`(?:on\\s{0,3})?` + `(${constants_3.ORDINAL_NUMBER_PATTERN})` + `(?:` + `\\s{0,3}(?:to|\\-|\\–|until|through|till)?\\s{0,3}` + `(${constants_3.ORDINAL_NUMBER_PATTERN})` + ")?" + `(?:-|/|\\s{0,3}(?:of)?\\s{0,3})` + `(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` + "(?:" + `(?:-|/|,?\\s{0,3})` + `(${constants_2.YEAR_PATTERN}(?![^\\s]\\d))` + ")?" + "(?=\\W|$)", "i"); -const DATE_GROUP = 1; -const DATE_TO_GROUP = 2; -const MONTH_NAME_GROUP = 3; -const YEAR_GROUP = 4; - -class ENMonthNameLittleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const result = context.createParsingResult(match.index, match[0]); - const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()]; - const day = constants_3.parseOrdinalNumberPattern(match[DATE_GROUP]); - - if (day > 31) { - match.index = match.index + match[DATE_GROUP].length; - return null; - } - - result.start.assign("month", month); - result.start.assign("day", day); - - if (match[YEAR_GROUP]) { - const yearNumber = constants_2.parseYear(match[YEAR_GROUP]); - result.start.assign("year", yearNumber); - } else { - const year = years_1.findYearClosestToRef(context.refDate, day, month); - result.start.imply("year", year); - } - - if (match[DATE_TO_GROUP]) { - const endDate = constants_3.parseOrdinalNumberPattern(match[DATE_TO_GROUP]); - result.end = result.start.clone(); - result.end.assign("day", endDate); - } - - return result; - } - -} - -exports["default"] = ENMonthNameLittleEndianParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENMonthNameMiddleEndianParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const constants_3 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp(`(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` + "(?:-|/|\\s*,?\\s*)" + `(${constants_2.ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*` + "(?:" + "(?:to|\\-)\\s*" + `(${constants_2.ORDINAL_NUMBER_PATTERN})\\s*` + ")?" + "(?:" + "(?:-|/|\\s*,?\\s*)" + `(${constants_3.YEAR_PATTERN})` + ")?" + "(?=\\W|$)(?!\\:\\d)", "i"); -const MONTH_NAME_GROUP = 1; -const DATE_GROUP = 2; -const DATE_TO_GROUP = 3; -const YEAR_GROUP = 4; - -class ENMonthNameMiddleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()]; - const day = constants_2.parseOrdinalNumberPattern(match[DATE_GROUP]); - - if (day > 31) { - return null; - } - - const components = context.createParsingComponents({ - day: day, - month: month - }); - - if (match[YEAR_GROUP]) { - const year = constants_3.parseYear(match[YEAR_GROUP]); - components.assign("year", year); - } else { - const year = years_1.findYearClosestToRef(context.refDate, day, month); - components.imply("year", year); - } - - if (!match[DATE_TO_GROUP]) { - return components; - } - - const endDate = constants_2.parseOrdinalNumberPattern(match[DATE_TO_GROUP]); - const result = context.createParsingResult(match.index, match[0]); - result.start = components; - result.end = components.clone(); - result.end.assign("day", endDate); - return result; - } - -} - -exports["default"] = ENMonthNameMiddleEndianParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENMonthNameParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp(`((?:in)\\s*)?` + `(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` + `\\s*` + `(?:` + `[,-]?\\s*(${constants_2.YEAR_PATTERN})?` + ")?" + "(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)", "i"); -const PREFIX_GROUP = 1; -const MONTH_NAME_GROUP = 2; -const YEAR_GROUP = 3; - -class ENMonthNameParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const monthName = match[MONTH_NAME_GROUP].toLowerCase(); - - if (match[0].length <= 3 && !constants_1.FULL_MONTH_NAME_DICTIONARY[monthName]) { - return null; - } - - const result = context.createParsingResult(match.index + (match[PREFIX_GROUP] || "").length, match.index + match[0].length); - result.start.imply("day", 1); - const month = constants_1.MONTH_DICTIONARY[monthName]; - result.start.assign("month", month); - - if (match[YEAR_GROUP]) { - const year = constants_2.parseYear(match[YEAR_GROUP]); - result.start.assign("year", year); - } else { - const year = years_1.findYearClosestToRef(context.refDate, 1, month); - result.start.imply("year", year); - } - - return result; - } - -} - -exports["default"] = ENMonthNameParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENRelativeDateFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const PATTERN = new RegExp(`(this|last|past|next|after\\s*this)\\s*(${pattern_1.matchAnyPattern(constants_1.TIME_UNIT_DICTIONARY)})(?=\\s*)` + "(?=\\W|$)", "i"); -const MODIFIER_WORD_GROUP = 1; -const RELATIVE_WORD_GROUP = 2; - -class ENRelativeDateFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const modifier = match[MODIFIER_WORD_GROUP].toLowerCase(); - const unitWord = match[RELATIVE_WORD_GROUP].toLowerCase(); - const timeunit = constants_1.TIME_UNIT_DICTIONARY[unitWord]; - - if (modifier == "next" || modifier.startsWith("after")) { - const timeUnits = {}; - timeUnits[timeunit] = 1; - return results_1.ParsingComponents.createRelativeFromReference(context.reference, timeUnits); - } - - if (modifier == "last" || modifier == "past") { - const timeUnits = {}; - timeUnits[timeunit] = -1; - return results_1.ParsingComponents.createRelativeFromReference(context.reference, timeUnits); - } - - const components = context.createParsingComponents(); - let date = dayjs_1.default(context.reference.instant); - - if (unitWord.match(/week/i)) { - date = date.add(-date.get("d"), "d"); - components.imply("day", date.date()); - components.imply("month", date.month() + 1); - components.imply("year", date.year()); - } else if (unitWord.match(/month/i)) { - date = date.add(-date.date() + 1, "d"); - components.imply("day", date.date()); - components.assign("year", date.year()); - components.assign("month", date.month() + 1); - } else if (unitWord.match(/year/i)) { - date = date.add(-date.date() + 1, "d"); - date = date.add(-date.month(), "month"); - components.imply("day", date.date()); - components.imply("month", date.month() + 1); - components.assign("year", date.year()); - } - - return components; - } - -} - -exports["default"] = ENRelativeDateFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENSlashMonthFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})" + "", "i"); -const MONTH_GROUP = 1; -const YEAR_GROUP = 2; - -class ENSlashMonthFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const year = parseInt(match[YEAR_GROUP]); - const month = parseInt(match[MONTH_GROUP]); - return context.createParsingComponents().imply("day", 1).assign("month", month).assign("year", year); - } - -} - -exports["default"] = ENSlashMonthFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENTimeExpressionParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); - -const AbstractTimeExpressionParser_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractTimeExpressionParser.js"); - -class ENTimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser { - constructor(strictMode) { - super(strictMode); - } - - followingPhase() { - return "\\s*(?:\\-|\\–|\\~|\\〜|to|\\?)\\s*"; - } - - primaryPrefix() { - return "(?:(?:at|from)\\s*)??"; - } - - primarySuffix() { - return "(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"; - } - - extractPrimaryTimeComponents(context, match) { - const components = super.extractPrimaryTimeComponents(context, match); - - if (components) { - if (match[0].endsWith("night")) { - const hour = components.get("hour"); - - if (hour >= 6 && hour < 12) { - components.assign("hour", components.get("hour") + 12); - components.assign("meridiem", index_1.Meridiem.PM); - } else if (hour < 6) { - components.assign("meridiem", index_1.Meridiem.AM); - } - } - - if (match[0].endsWith("afternoon")) { - components.assign("meridiem", index_1.Meridiem.PM); - const hour = components.get("hour"); - - if (hour >= 0 && hour <= 6) { - components.assign("hour", components.get("hour") + 12); - } - } - - if (match[0].endsWith("morning")) { - components.assign("meridiem", index_1.Meridiem.AM); - const hour = components.get("hour"); - - if (hour < 12) { - components.assign("hour", components.get("hour")); - } - } - } - - return components; - } - -} - -exports["default"] = ENTimeExpressionParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitAgoFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js"); - -const PATTERN = new RegExp(`(${constants_1.TIME_UNITS_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=(?:\\W|$))`, "i"); -const STRICT_PATTERN = new RegExp(`(${constants_1.TIME_UNITS_PATTERN})\\s{0,5}ago(?=(?:\\W|$))`, "i"); - -class ENTimeUnitAgoFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - constructor(strictMode) { - super(); - this.strictMode = strictMode; - } - - innerPattern() { - return this.strictMode ? STRICT_PATTERN : PATTERN; - } - - innerExtract(context, match) { - const timeUnits = constants_1.parseTimeUnits(match[1]); - const outputTimeUnits = timeunits_1.reverseTimeUnits(timeUnits); - return results_1.ParsingComponents.createRelativeFromReference(context.reference, outputTimeUnits); - } - -} - -exports["default"] = ENTimeUnitAgoFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitCasualRelativeFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js"); - -const PATTERN = new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${constants_1.TIME_UNITS_PATTERN})(?=\\W|$)`, "i"); - -class ENTimeUnitCasualRelativeFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const prefix = match[1].toLowerCase(); - let timeUnits = constants_1.parseTimeUnits(match[2]); - - switch (prefix) { - case "last": - case "past": - case "-": - timeUnits = timeunits_1.reverseTimeUnits(timeUnits); - break; - } - - return results_1.ParsingComponents.createRelativeFromReference(context.reference, timeUnits); - } - -} - -exports["default"] = ENTimeUnitCasualRelativeFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitLaterFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp(`(${constants_1.TIME_UNITS_PATTERN})\\s{0,5}(?:later|after|from now|henceforth|forward|out)` + "(?=(?:\\W|$))", "i"); -const STRICT_PATTERN = new RegExp("" + "(" + constants_1.TIME_UNITS_PATTERN + ")" + "(later|from now)" + "(?=(?:\\W|$))", "i"); -const GROUP_NUM_TIMEUNITS = 1; - -class ENTimeUnitLaterFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - constructor(strictMode) { - super(); - this.strictMode = strictMode; - } - - innerPattern() { - return this.strictMode ? STRICT_PATTERN : PATTERN; - } - - innerExtract(context, match) { - const fragments = constants_1.parseTimeUnits(match[GROUP_NUM_TIMEUNITS]); - return results_1.ParsingComponents.createRelativeFromReference(context.reference, fragments); - } - -} - -exports["default"] = ENTimeUnitLaterFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENTimeUnitWithinFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN_WITH_PREFIX = new RegExp(`(?:within|in|for)\\s*` + `(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${constants_1.TIME_UNITS_PATTERN})(?=\\W|$)`, "i"); -const PATTERN_WITHOUT_PREFIX = new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${constants_1.TIME_UNITS_PATTERN})(?=\\W|$)`, "i"); - -class ENTimeUnitWithinFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern(context) { - return context.option.forwardDate ? PATTERN_WITHOUT_PREFIX : PATTERN_WITH_PREFIX; - } - - innerExtract(context, match) { - const timeUnits = constants_1.parseTimeUnits(match[1]); - return results_1.ParsingComponents.createRelativeFromReference(context.reference, timeUnits); - } - -} - -exports["default"] = ENTimeUnitWithinFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/parsers/ENWeekdayParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const weekdays_1 = __webpack_require__("./node_modules/chrono-node/dist/common/calculation/weekdays.js"); - -const PATTERN = new RegExp("(?:(?:\\,|\\(|\\()\\s*)?" + "(?:on\\s*?)?" + "(?:(this|last|past|next)\\s*)?" + `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` + "(?:\\s*(?:\\,|\\)|\\)))?" + "(?:\\s*(this|last|past|next)\\s*week)?" + "(?=\\W|$)", "i"); -const PREFIX_GROUP = 1; -const WEEKDAY_GROUP = 2; -const POSTFIX_GROUP = 3; - -class ENWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase(); - const weekday = constants_1.WEEKDAY_DICTIONARY[dayOfWeek]; - const prefix = match[PREFIX_GROUP]; - const postfix = match[POSTFIX_GROUP]; - let modifierWord = prefix || postfix; - modifierWord = modifierWord || ""; - modifierWord = modifierWord.toLowerCase(); - let modifier = null; - - if (modifierWord == "last" || modifierWord == "past") { - modifier = "last"; - } else if (modifierWord == "next") { - modifier = "next"; - } else if (modifierWord == "this") { - modifier = "this"; - } - - return weekdays_1.createParsingComponentsAtWeekday(context.reference, weekday, modifier); - } - -} - -exports["default"] = ENWeekdayParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/refiners/ENMergeDateRangeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js")); - -class ENMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default { - patternBetween() { - return /^\s*(to|-)\s*$/i; - } - -} - -exports["default"] = ENMergeDateRangeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/refiners/ENMergeDateTimeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateTimeRefiner.js")); - -class ENMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default { - patternBetween() { - return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$"); - } - -} - -exports["default"] = ENMergeDateTimeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/en/refiners/ENMergeRelativeDateRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const abstractRefiners_1 = __webpack_require__("./node_modules/chrono-node/dist/common/abstractRefiners.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/en/constants.js"); - -const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js"); - -function hasImpliedEarlierReferenceDate(result) { - return result.text.match(/\s+(before|from)$/i) != null; -} - -function hasImpliedLaterReferenceDate(result) { - return result.text.match(/\s+(after|since)$/i) != null; -} - -class ENMergeRelativeDateRefiner extends abstractRefiners_1.MergingRefiner { - patternBetween() { - return /^\s*$/i; - } - - shouldMergeResults(textBetween, currentResult, nextResult) { - if (!textBetween.match(this.patternBetween())) { - return false; - } - - if (!hasImpliedEarlierReferenceDate(currentResult) && !hasImpliedLaterReferenceDate(currentResult)) { - return false; - } - - return !!nextResult.start.get("day") && !!nextResult.start.get("month") && !!nextResult.start.get("year"); - } - - mergeResults(textBetween, currentResult, nextResult) { - let timeUnits = constants_1.parseTimeUnits(currentResult.text); - - if (hasImpliedEarlierReferenceDate(currentResult)) { - timeUnits = timeunits_1.reverseTimeUnits(timeUnits); - } - - const components = results_1.ParsingComponents.createRelativeFromReference(new results_1.ReferenceWithTimezone(nextResult.start.date()), timeUnits); - return new results_1.ParsingResult(nextResult.reference, currentResult.index, `${currentResult.text}${textBetween}${nextResult.text}`, components); - } - -} - -exports["default"] = ENMergeRelativeDateRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/fr/constants.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.parseTimeUnits = exports.TIME_UNITS_PATTERN = exports.parseYear = exports.YEAR_PATTERN = exports.parseOrdinalNumberPattern = exports.ORDINAL_NUMBER_PATTERN = exports.parseNumberPattern = exports.NUMBER_PATTERN = exports.TIME_UNIT_DICTIONARY = exports.INTEGER_WORD_DICTIONARY = exports.MONTH_DICTIONARY = exports.WEEKDAY_DICTIONARY = void 0; - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -exports.WEEKDAY_DICTIONARY = { - "dimanche": 0, - "dim": 0, - "lundi": 1, - "lun": 1, - "mardi": 2, - "mar": 2, - "mercredi": 3, - "mer": 3, - "jeudi": 4, - "jeu": 4, - "vendredi": 5, - "ven": 5, - "samedi": 6, - "sam": 6 -}; -exports.MONTH_DICTIONARY = { - "janvier": 1, - "jan": 1, - "jan.": 1, - "février": 2, - "fév": 2, - "fév.": 2, - "fevrier": 2, - "fev": 2, - "fev.": 2, - "mars": 3, - "mar": 3, - "mar.": 3, - "avril": 4, - "avr": 4, - "avr.": 4, - "mai": 5, - "juin": 6, - "jun": 6, - "juillet": 7, - "juil": 7, - "jul": 7, - "jul.": 7, - "août": 8, - "aout": 8, - "septembre": 9, - "sep": 9, - "sep.": 9, - "sept": 9, - "sept.": 9, - "octobre": 10, - "oct": 10, - "oct.": 10, - "novembre": 11, - "nov": 11, - "nov.": 11, - "décembre": 12, - "decembre": 12, - "dec": 12, - "dec.": 12 -}; -exports.INTEGER_WORD_DICTIONARY = { - "un": 1, - "deux": 2, - "trois": 3, - "quatre": 4, - "cinq": 5, - "six": 6, - "sept": 7, - "huit": 8, - "neuf": 9, - "dix": 10, - "onze": 11, - "douze": 12, - "treize": 13 -}; -exports.TIME_UNIT_DICTIONARY = { - "sec": "second", - "seconde": "second", - "secondes": "second", - "min": "minute", - "mins": "minute", - "minute": "minute", - "minutes": "minute", - "h": "hour", - "hr": "hour", - "hrs": "hour", - "heure": "hour", - "heures": "hour", - "jour": "d", - "jours": "d", - "semaine": "week", - "semaines": "week", - "mois": "month", - "trimestre": "quarter", - "trimestres": "quarter", - "ans": "year", - "année": "year", - "années": "year" -}; -exports.NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`; - -function parseNumberPattern(match) { - const num = match.toLowerCase(); - - if (exports.INTEGER_WORD_DICTIONARY[num] !== undefined) { - return exports.INTEGER_WORD_DICTIONARY[num]; - } else if (num === "une" || num === "un") { - return 1; - } else if (num.match(/quelques?/)) { - return 3; - } else if (num.match(/demi-?/)) { - return 0.5; - } - - return parseFloat(num); -} - -exports.parseNumberPattern = parseNumberPattern; -exports.ORDINAL_NUMBER_PATTERN = `(?:[0-9]{1,2}(?:er)?)`; - -function parseOrdinalNumberPattern(match) { - let num = match.toLowerCase(); - num = num.replace(/(?:er)$/i, ""); - return parseInt(num); -} - -exports.parseOrdinalNumberPattern = parseOrdinalNumberPattern; -exports.YEAR_PATTERN = `(?:[1-9][0-9]{0,3}\\s*(?:AC|AD|p\\.\\s*C(?:hr?)?\\.\\s*n\\.)|[1-2][0-9]{3}|[5-9][0-9])`; - -function parseYear(match) { - if (/AC/i.test(match)) { - match = match.replace(/BC/i, ""); - return -parseInt(match); - } - - if (/AD/i.test(match) || /C/i.test(match)) { - match = match.replace(/[^\d]+/i, ""); - return parseInt(match); - } - - let yearNumber = parseInt(match); - - if (yearNumber < 100) { - if (yearNumber > 50) { - yearNumber = yearNumber + 1900; - } else { - yearNumber = yearNumber + 2000; - } - } - - return yearNumber; -} - -exports.parseYear = parseYear; -const SINGLE_TIME_UNIT_PATTERN = `(${exports.NUMBER_PATTERN})\\s{0,5}(${pattern_1.matchAnyPattern(exports.TIME_UNIT_DICTIONARY)})\\s{0,5}`; -const SINGLE_TIME_UNIT_REGEX = new RegExp(SINGLE_TIME_UNIT_PATTERN, "i"); -exports.TIME_UNITS_PATTERN = pattern_1.repeatedTimeunitPattern("", SINGLE_TIME_UNIT_PATTERN); - -function parseTimeUnits(timeunitText) { - const fragments = {}; - let remainingText = timeunitText; - let match = SINGLE_TIME_UNIT_REGEX.exec(remainingText); - - while (match) { - collectDateTimeFragment(fragments, match); - remainingText = remainingText.substring(match[0].length); - match = SINGLE_TIME_UNIT_REGEX.exec(remainingText); - } - - return fragments; -} - -exports.parseTimeUnits = parseTimeUnits; - -function collectDateTimeFragment(fragments, match) { - const num = parseNumberPattern(match[1]); - const unit = exports.TIME_UNIT_DICTIONARY[match[2].toLowerCase()]; - fragments[unit] = num; -} - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/fr/index.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0; - -const configurations_1 = __webpack_require__("./node_modules/chrono-node/dist/configurations.js"); - -const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js"); - -const FRCasualDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRCasualDateParser.js")); - -const FRCasualTimeParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRCasualTimeParser.js")); - -const SlashDateFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/parsers/SlashDateFormatParser.js")); - -const FRTimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeExpressionParser.js")); - -const FRMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/refiners/FRMergeDateTimeRefiner.js")); - -const FRMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/refiners/FRMergeDateRangeRefiner.js")); - -const FRWeekdayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRWeekdayParser.js")); - -const FRSpecificTimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRSpecificTimeExpressionParser.js")); - -const FRMonthNameLittleEndianParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRMonthNameLittleEndianParser.js")); - -const FRTimeUnitAgoFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeUnitAgoFormatParser.js")); - -const FRTimeUnitWithinFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeUnitWithinFormatParser.js")); - -const FRTimeUnitRelativeFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeUnitRelativeFormatParser.js")); - -exports.casual = new chrono_1.Chrono(createCasualConfiguration()); -exports.strict = new chrono_1.Chrono(createConfiguration(true)); - -function parse(text, ref, option) { - return exports.casual.parse(text, ref, option); -} - -exports.parse = parse; - -function parseDate(text, ref, option) { - return exports.casual.parseDate(text, ref, option); -} - -exports.parseDate = parseDate; - -function createCasualConfiguration(littleEndian = true) { - const option = createConfiguration(false, littleEndian); - option.parsers.unshift(new FRCasualDateParser_1.default()); - option.parsers.unshift(new FRCasualTimeParser_1.default()); - option.parsers.unshift(new FRTimeUnitRelativeFormatParser_1.default()); - return option; -} - -exports.createCasualConfiguration = createCasualConfiguration; - -function createConfiguration(strictMode = true, littleEndian = true) { - return configurations_1.includeCommonConfiguration({ - parsers: [new SlashDateFormatParser_1.default(littleEndian), new FRMonthNameLittleEndianParser_1.default(), new FRTimeExpressionParser_1.default(), new FRSpecificTimeExpressionParser_1.default(), new FRTimeUnitAgoFormatParser_1.default(), new FRTimeUnitWithinFormatParser_1.default(), new FRWeekdayParser_1.default()], - refiners: [new FRMergeDateTimeRefiner_1.default(), new FRMergeDateRangeRefiner_1.default()] - }, strictMode); -} - -exports.createConfiguration = createConfiguration; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRCasualDateParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function () { - return m[k]; - } - }); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}); - -var __importStar = this && this.__importStar || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - - __setModuleDefault(result, mod); - - return result; -}; - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js"); - -const references = __importStar(__webpack_require__("./node_modules/chrono-node/dist/common/casualReferences.js")); - -class FRCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern(context) { - return /(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i; - } - - innerExtract(context, match) { - let targetDate = dayjs_1.default(context.refDate); - const lowerText = match[0].toLowerCase(); - const component = context.createParsingComponents(); - - switch (lowerText) { - case "maintenant": - return references.now(context.reference); - - case "aujourd'hui": - return references.today(context.reference); - - case "hier": - return references.yesterday(context.reference); - - case "demain": - return references.tomorrow(context.reference); - - default: - if (lowerText.match(/cette\s*nuit/)) { - dayjs_2.assignSimilarDate(component, targetDate); - component.imply("hour", 22); - component.imply("meridiem", index_1.Meridiem.PM); - } else if (lowerText.match(/la\s*veille/)) { - targetDate = targetDate.add(-1, "day"); - dayjs_2.assignSimilarDate(component, targetDate); - component.imply("hour", 0); - } - - } - - return component; - } - -} - -exports["default"] = FRCasualDateParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRCasualTimeParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -class FRCasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern(context) { - return /(cet?)?\s*(matin|soir|après-midi|aprem|a midi|à minuit)(?=\W|$)/i; - } - - innerExtract(context, match) { - const suffixLower = match[2].toLowerCase(); - const component = context.createParsingComponents(); - - switch (suffixLower) { - case "après-midi": - case "aprem": - component.imply("hour", 14); - component.imply("minute", 0); - component.imply("meridiem", index_1.Meridiem.PM); - break; - - case "soir": - component.imply("hour", 18); - component.imply("minute", 0); - component.imply("meridiem", index_1.Meridiem.PM); - break; - - case "matin": - component.imply("hour", 8); - component.imply("minute", 0); - component.imply("meridiem", index_1.Meridiem.AM); - break; - - case "a midi": - component.imply("hour", 12); - component.imply("minute", 0); - component.imply("meridiem", index_1.Meridiem.AM); - break; - - case "à minuit": - component.imply("hour", 0); - component.imply("meridiem", index_1.Meridiem.AM); - break; - } - - return component; - } - -} - -exports["default"] = FRCasualTimeParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRMonthNameLittleEndianParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/fr/constants.js"); - -const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/fr/constants.js"); - -const constants_3 = __webpack_require__("./node_modules/chrono-node/dist/locales/fr/constants.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp("(?:on\\s*?)?" + `(${constants_3.ORDINAL_NUMBER_PATTERN})` + `(?:\\s*(?:au|\\-|\\–|jusqu'au?|\\s)\\s*(${constants_3.ORDINAL_NUMBER_PATTERN}))?` + `(?:-|/|\\s*(?:de)?\\s*)` + `(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` + `(?:(?:-|/|,?\\s*)(${constants_2.YEAR_PATTERN}(?![^\\s]\\d)))?` + `(?=\\W|$)`, "i"); -const DATE_GROUP = 1; -const DATE_TO_GROUP = 2; -const MONTH_NAME_GROUP = 3; -const YEAR_GROUP = 4; - -class FRMonthNameLittleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const result = context.createParsingResult(match.index, match[0]); - const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()]; - const day = constants_3.parseOrdinalNumberPattern(match[DATE_GROUP]); - - if (day > 31) { - match.index = match.index + match[DATE_GROUP].length; - return null; - } - - result.start.assign("month", month); - result.start.assign("day", day); - - if (match[YEAR_GROUP]) { - const yearNumber = constants_2.parseYear(match[YEAR_GROUP]); - result.start.assign("year", yearNumber); - } else { - const year = years_1.findYearClosestToRef(context.refDate, day, month); - result.start.imply("year", year); - } - - if (match[DATE_TO_GROUP]) { - const endDate = constants_3.parseOrdinalNumberPattern(match[DATE_TO_GROUP]); - result.end = result.start.clone(); - result.end.assign("day", endDate); - } - - return result; - } - -} - -exports["default"] = FRMonthNameLittleEndianParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRSpecificTimeExpressionParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); - -const FIRST_REG_PATTERN = new RegExp("(^|\\s|T)" + "(?:(?:[àa])\\s*)?" + "(\\d{1,2})(?:h|:)?" + "(?:(\\d{1,2})(?:m|:)?)?" + "(?:(\\d{1,2})(?:s|:)?)?" + "(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?" + "(?=\\W|$)", "i"); -const SECOND_REG_PATTERN = new RegExp("^\\s*(\\-|\\–|\\~|\\〜|[àa]|\\?)\\s*" + "(\\d{1,2})(?:h|:)?" + "(?:(\\d{1,2})(?:m|:)?)?" + "(?:(\\d{1,2})(?:s|:)?)?" + "(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?" + "(?=\\W|$)", "i"); -const HOUR_GROUP = 2; -const MINUTE_GROUP = 3; -const SECOND_GROUP = 4; -const AM_PM_HOUR_GROUP = 5; - -class FRSpecificTimeExpressionParser { - pattern(context) { - return FIRST_REG_PATTERN; - } - - extract(context, match) { - const result = context.createParsingResult(match.index + match[1].length, match[0].substring(match[1].length)); - - if (result.text.match(/^\d{4}$/)) { - match.index += match[0].length; - return null; - } - - result.start = FRSpecificTimeExpressionParser.extractTimeComponent(result.start.clone(), match); - - if (!result.start) { - match.index += match[0].length; - return null; - } - - const remainingText = context.text.substring(match.index + match[0].length); - const secondMatch = SECOND_REG_PATTERN.exec(remainingText); - - if (secondMatch) { - result.end = FRSpecificTimeExpressionParser.extractTimeComponent(result.start.clone(), secondMatch); - - if (result.end) { - result.text += secondMatch[0]; - } - } - - return result; - } - - static extractTimeComponent(extractingComponents, match) { - let hour = 0; - let minute = 0; - let meridiem = null; - hour = parseInt(match[HOUR_GROUP]); - - if (match[MINUTE_GROUP] != null) { - minute = parseInt(match[MINUTE_GROUP]); - } - - if (minute >= 60 || hour > 24) { - return null; - } - - if (hour >= 12) { - meridiem = index_1.Meridiem.PM; - } - - if (match[AM_PM_HOUR_GROUP] != null) { - if (hour > 12) return null; - const ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase(); - - if (ampm == "a") { - meridiem = index_1.Meridiem.AM; - - if (hour == 12) { - hour = 0; - } - } - - if (ampm == "p") { - meridiem = index_1.Meridiem.PM; - - if (hour != 12) { - hour += 12; - } - } - } - - extractingComponents.assign("hour", hour); - extractingComponents.assign("minute", minute); - - if (meridiem !== null) { - extractingComponents.assign("meridiem", meridiem); - } else { - if (hour < 12) { - extractingComponents.imply("meridiem", index_1.Meridiem.AM); - } else { - extractingComponents.imply("meridiem", index_1.Meridiem.PM); - } - } - - if (match[SECOND_GROUP] != null) { - const second = parseInt(match[SECOND_GROUP]); - if (second >= 60) return null; - extractingComponents.assign("second", second); - } - - return extractingComponents; - } - -} - -exports["default"] = FRSpecificTimeExpressionParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeExpressionParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractTimeExpressionParser_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractTimeExpressionParser.js"); - -class FRTimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser { - primaryPrefix() { - return "(?:(?:[àa])\\s*)?"; - } - - followingPhase() { - return "\\s*(?:\\-|\\–|\\~|\\〜|[àa]|\\?)\\s*"; - } - - extractPrimaryTimeComponents(context, match) { - if (match[0].match(/^\s*\d{4}\s*$/)) { - return null; - } - - return super.extractPrimaryTimeComponents(context, match); - } - -} - -exports["default"] = FRTimeExpressionParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeUnitAgoFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/fr/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js"); - -class FRTimeUnitAgoFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - constructor() { - super(); - } - - innerPattern() { - return new RegExp(`il y a\\s*(${constants_1.TIME_UNITS_PATTERN})(?=(?:\\W|$))`, "i"); - } - - innerExtract(context, match) { - const timeUnits = constants_1.parseTimeUnits(match[1]); - const outputTimeUnits = timeunits_1.reverseTimeUnits(timeUnits); - return results_1.ParsingComponents.createRelativeFromReference(context.reference, outputTimeUnits); - } - -} - -exports["default"] = FRTimeUnitAgoFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeUnitRelativeFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/fr/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -class FRTimeUnitAgoFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - constructor() { - super(); - } - - innerPattern() { - return new RegExp(`(?:les?|la|l'|du|des?)\\s*` + `(${constants_1.NUMBER_PATTERN})?` + `(?:\\s*(prochaine?s?|derni[eè]re?s?|pass[ée]e?s?|pr[ée]c[ée]dents?|suivante?s?))?` + `\\s*(${pattern_1.matchAnyPattern(constants_1.TIME_UNIT_DICTIONARY)})` + `(?:\\s*(prochaine?s?|derni[eè]re?s?|pass[ée]e?s?|pr[ée]c[ée]dents?|suivante?s?))?`, "i"); - } - - innerExtract(context, match) { - const num = match[1] ? constants_1.parseNumberPattern(match[1]) : 1; - const unit = constants_1.TIME_UNIT_DICTIONARY[match[3].toLowerCase()]; - let timeUnits = {}; - timeUnits[unit] = num; - let modifier = match[2] || match[4] || ""; - modifier = modifier.toLowerCase(); - - if (!modifier) { - return; - } - - if (/derni[eè]re?s?/.test(modifier) || /pass[ée]e?s?/.test(modifier) || /pr[ée]c[ée]dents?/.test(modifier)) { - timeUnits = timeunits_1.reverseTimeUnits(timeUnits); - } - - return results_1.ParsingComponents.createRelativeFromReference(context.reference, timeUnits); - } - -} - -exports["default"] = FRTimeUnitAgoFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRTimeUnitWithinFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/fr/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -class FRTimeUnitWithinFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${constants_1.TIME_UNITS_PATTERN})(?=\\W|$)`, "i"); - } - - innerExtract(context, match) { - const timeUnits = constants_1.parseTimeUnits(match[1]); - return results_1.ParsingComponents.createRelativeFromReference(context.reference, timeUnits); - } - -} - -exports["default"] = FRTimeUnitWithinFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/fr/parsers/FRWeekdayParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/fr/constants.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const weekdays_1 = __webpack_require__("./node_modules/chrono-node/dist/common/calculation/weekdays.js"); - -const PATTERN = new RegExp("(?:(?:\\,|\\(|\\()\\s*)?" + "(?:(?:ce)\\s*)?" + `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` + "(?:\\s*(?:\\,|\\)|\\)))?" + "(?:\\s*(dernier|prochain)\\s*)?" + "(?=\\W|\\d|$)", "i"); -const WEEKDAY_GROUP = 1; -const POSTFIX_GROUP = 2; - -class FRWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase(); - const weekday = constants_1.WEEKDAY_DICTIONARY[dayOfWeek]; - - if (weekday === undefined) { - return null; - } - - let suffix = match[POSTFIX_GROUP]; - suffix = suffix || ""; - suffix = suffix.toLowerCase(); - let modifier = null; - - if (suffix == "dernier") { - modifier = "last"; - } else if (suffix == "prochain") { - modifier = "next"; - } - - return weekdays_1.createParsingComponentsAtWeekday(context.reference, weekday, modifier); - } - -} - -exports["default"] = FRWeekdayParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/fr/refiners/FRMergeDateRangeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js")); - -class FRMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default { - patternBetween() { - return /^\s*(à|a|-)\s*$/i; - } - -} - -exports["default"] = FRMergeDateRangeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/fr/refiners/FRMergeDateTimeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateTimeRefiner.js")); - -class FRMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default { - patternBetween() { - return new RegExp("^\\s*(T|à|a|vers|de|,|-)?\\s*$"); - } - -} - -exports["default"] = FRMergeDateTimeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ja/constants.js": -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.toHankaku = void 0; - -function toHankaku(text) { - return String(text).replace(/\u2019/g, "\u0027").replace(/\u201D/g, "\u0022").replace(/\u3000/g, "\u0020").replace(/\uFFE5/g, "\u00A5").replace(/[\uFF01\uFF03-\uFF06\uFF08\uFF09\uFF0C-\uFF19\uFF1C-\uFF1F\uFF21-\uFF3B\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5E]/g, alphaNum); -} - -exports.toHankaku = toHankaku; - -function alphaNum(token) { - return String.fromCharCode(token.charCodeAt(0) - 65248); -} - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ja/index.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0; - -const JPStandardParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ja/parsers/JPStandardParser.js")); - -const JPMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ja/refiners/JPMergeDateRangeRefiner.js")); - -const JPCasualDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ja/parsers/JPCasualDateParser.js")); - -const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js"); - -exports.casual = new chrono_1.Chrono(createCasualConfiguration()); -exports.strict = new chrono_1.Chrono(createConfiguration()); - -function parse(text, ref, option) { - return exports.casual.parse(text, ref, option); -} - -exports.parse = parse; - -function parseDate(text, ref, option) { - return exports.casual.parseDate(text, ref, option); -} - -exports.parseDate = parseDate; - -function createCasualConfiguration() { - const option = createConfiguration(); - option.parsers.unshift(new JPCasualDateParser_1.default()); - return option; -} - -exports.createCasualConfiguration = createCasualConfiguration; - -function createConfiguration() { - return { - parsers: [new JPStandardParser_1.default()], - refiners: [new JPMergeDateRangeRefiner_1.default()] - }; -} - -exports.createConfiguration = createConfiguration; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ja/parsers/JPCasualDateParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function () { - return m[k]; - } - }); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}); - -var __importStar = this && this.__importStar || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - - __setModuleDefault(result, mod); - - return result; -}; - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); - -const references = __importStar(__webpack_require__("./node_modules/chrono-node/dist/common/casualReferences.js")); - -const PATTERN = /今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i; - -class JPCasualDateParser { - pattern() { - return PATTERN; - } - - extract(context, match) { - const text = match[0]; - const date = dayjs_1.default(context.refDate); - const components = context.createParsingComponents(); - - switch (text) { - case "昨日": - return references.yesterday(context.reference); - - case "明日": - return references.tomorrow(context.reference); - - case "今日": - case "当日": - return references.today(context.reference); - } - - if (text == "今夜" || text == "今夕" || text == "今晩") { - components.imply("hour", 22); - components.assign("meridiem", index_1.Meridiem.PM); - } else if (text.match("今朝")) { - components.imply("hour", 6); - components.assign("meridiem", index_1.Meridiem.AM); - } - - components.assign("day", date.date()); - components.assign("month", date.month() + 1); - components.assign("year", date.year()); - return components; - } - -} - -exports["default"] = JPCasualDateParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ja/parsers/JPStandardParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/ja/constants.js"); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const PATTERN = /(?:(?:([同今本])|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i; -const SPECIAL_YEAR_GROUP = 1; -const TYPICAL_YEAR_GROUP = 2; -const ERA_GROUP = 3; -const YEAR_NUMBER_GROUP = 4; -const MONTH_GROUP = 5; -const DAY_GROUP = 6; - -class JPStandardParser { - pattern() { - return PATTERN; - } - - extract(context, match) { - const month = parseInt(constants_1.toHankaku(match[MONTH_GROUP])); - const day = parseInt(constants_1.toHankaku(match[DAY_GROUP])); - const components = context.createParsingComponents({ - day: day, - month: month - }); - - if (match[SPECIAL_YEAR_GROUP] && match[SPECIAL_YEAR_GROUP].match("同|今|本")) { - const moment = dayjs_1.default(context.refDate); - components.assign("year", moment.year()); - } - - if (match[TYPICAL_YEAR_GROUP]) { - const yearNumText = match[YEAR_NUMBER_GROUP]; - let year = yearNumText == "元" ? 1 : parseInt(constants_1.toHankaku(yearNumText)); - - if (match[ERA_GROUP] == "令和") { - year += 2018; - } else if (match[ERA_GROUP] == "平成") { - year += 1988; - } else if (match[ERA_GROUP] == "昭和") { - year += 1925; - } - - components.assign("year", year); - } else { - const year = years_1.findYearClosestToRef(context.refDate, day, month); - components.imply("year", year); - } - - return components; - } - -} - -exports["default"] = JPStandardParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ja/refiners/JPMergeDateRangeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js")); - -class JPMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default { - patternBetween() { - return /^\s*(から|ー|-)\s*$/i; - } - -} - -exports["default"] = JPMergeDateRangeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/constants.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.parseTimeUnits = exports.TIME_UNITS_PATTERN = exports.parseYear = exports.YEAR_PATTERN = exports.parseOrdinalNumberPattern = exports.ORDINAL_NUMBER_PATTERN = exports.parseNumberPattern = exports.NUMBER_PATTERN = exports.TIME_UNIT_DICTIONARY = exports.ORDINAL_WORD_DICTIONARY = exports.INTEGER_WORD_DICTIONARY = exports.MONTH_DICTIONARY = exports.WEEKDAY_DICTIONARY = void 0; - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -exports.WEEKDAY_DICTIONARY = { - zondag: 0, - zon: 0, - "zon.": 0, - zo: 0, - "zo.": 0, - maandag: 1, - ma: 1, - "ma.": 1, - dinsdag: 2, - din: 2, - "din.": 2, - di: 2, - "di.": 2, - woensdag: 3, - woe: 3, - "woe.": 3, - wo: 3, - "wo.": 3, - donderdag: 4, - dond: 4, - "dond.": 4, - do: 4, - "do.": 4, - vrijdag: 5, - vrij: 5, - "vrij.": 5, - vr: 5, - "vr.": 5, - zaterdag: 6, - zat: 6, - "zat.": 6, - "za": 6, - "za.": 6 -}; -exports.MONTH_DICTIONARY = { - januari: 1, - jan: 1, - "jan.": 1, - februari: 2, - feb: 2, - "feb.": 2, - maart: 3, - mar: 3, - "mar.": 3, - april: 4, - apr: 4, - "apr.": 4, - mei: 5, - juni: 6, - jun: 6, - "jun.": 6, - juli: 7, - jul: 7, - "jul.": 7, - augustus: 8, - aug: 8, - "aug.": 8, - september: 9, - sep: 9, - "sep.": 9, - sept: 9, - "sept.": 9, - oktober: 10, - okt: 10, - "okt.": 10, - november: 11, - nov: 11, - "nov.": 11, - december: 12, - dec: 12, - "dec.": 12 -}; -exports.INTEGER_WORD_DICTIONARY = { - een: 1, - twee: 2, - drie: 3, - vier: 4, - vijf: 5, - zes: 6, - zeven: 7, - acht: 8, - negen: 9, - tien: 10, - elf: 11, - twaalf: 12 -}; -exports.ORDINAL_WORD_DICTIONARY = { - eerste: 1, - tweede: 2, - derde: 3, - vierde: 4, - vijfde: 5, - zesde: 6, - zevende: 7, - achtste: 8, - negende: 9, - tiende: 10, - elfde: 11, - twaalfde: 12, - dertiende: 13, - veertiende: 14, - vijftiende: 15, - zestiende: 16, - zeventiende: 17, - achttiende: 18, - negentiende: 19, - twintigste: 20, - "eenentwintigste": 21, - "tweeëntwintigste": 22, - "drieentwintigste": 23, - "vierentwintigste": 24, - "vijfentwintigste": 25, - "zesentwintigste": 26, - "zevenentwintigste": 27, - "achtentwintig": 28, - "negenentwintig": 29, - "dertigste": 30, - "eenendertigste": 31 -}; -exports.TIME_UNIT_DICTIONARY = { - sec: "second", - second: "second", - seconden: "second", - min: "minute", - mins: "minute", - minute: "minute", - minuut: "minute", - minuten: "minute", - minuutje: "minute", - h: "hour", - hr: "hour", - hrs: "hour", - uur: "hour", - u: "hour", - uren: "hour", - dag: "d", - dagen: "d", - week: "week", - weken: "week", - maand: "month", - maanden: "month", - jaar: "year", - jr: "year", - jaren: "year" -}; -exports.NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`; - -function parseNumberPattern(match) { - const num = match.toLowerCase(); - - if (exports.INTEGER_WORD_DICTIONARY[num] !== undefined) { - return exports.INTEGER_WORD_DICTIONARY[num]; - } else if (num === "paar") { - return 2; - } else if (num === "half" || num.match(/halve?/)) { - return 0.5; - } - - return parseFloat(num.replace(",", ".")); -} - -exports.parseNumberPattern = parseNumberPattern; -exports.ORDINAL_NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`; - -function parseOrdinalNumberPattern(match) { - let num = match.toLowerCase(); - - if (exports.ORDINAL_WORD_DICTIONARY[num] !== undefined) { - return exports.ORDINAL_WORD_DICTIONARY[num]; - } - - num = num.replace(/(?:ste|de)$/i, ""); - return parseInt(num); -} - -exports.parseOrdinalNumberPattern = parseOrdinalNumberPattern; -exports.YEAR_PATTERN = `(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])`; - -function parseYear(match) { - if (/voor Christus/i.test(match)) { - match = match.replace(/voor Christus/i, ""); - return -parseInt(match); - } - - if (/na Christus/i.test(match)) { - match = match.replace(/na Christus/i, ""); - return parseInt(match); - } - - const rawYearNumber = parseInt(match); - return years_1.findMostLikelyADYear(rawYearNumber); -} - -exports.parseYear = parseYear; -const SINGLE_TIME_UNIT_PATTERN = `(${exports.NUMBER_PATTERN})\\s{0,5}(${pattern_1.matchAnyPattern(exports.TIME_UNIT_DICTIONARY)})\\s{0,5}`; -const SINGLE_TIME_UNIT_REGEX = new RegExp(SINGLE_TIME_UNIT_PATTERN, "i"); -exports.TIME_UNITS_PATTERN = pattern_1.repeatedTimeunitPattern(`(?:(?:binnen|in)\\s*)?`, SINGLE_TIME_UNIT_PATTERN); - -function parseTimeUnits(timeunitText) { - const fragments = {}; - let remainingText = timeunitText; - let match = SINGLE_TIME_UNIT_REGEX.exec(remainingText); - - while (match) { - collectDateTimeFragment(fragments, match); - remainingText = remainingText.substring(match[0].length); - match = SINGLE_TIME_UNIT_REGEX.exec(remainingText); - } - - return fragments; -} - -exports.parseTimeUnits = parseTimeUnits; - -function collectDateTimeFragment(fragments, match) { - const num = parseNumberPattern(match[1]); - const unit = exports.TIME_UNIT_DICTIONARY[match[2].toLowerCase()]; - fragments[unit] = num; -} - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/index.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0; - -const configurations_1 = __webpack_require__("./node_modules/chrono-node/dist/configurations.js"); - -const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js"); - -const NLMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/refiners/NLMergeDateRangeRefiner.js")); - -const NLMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/refiners/NLMergeDateTimeRefiner.js")); - -const NLCasualDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualDateParser.js")); - -const NLCasualTimeParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualTimeParser.js")); - -const SlashDateFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/parsers/SlashDateFormatParser.js")); - -const NLTimeUnitWithinFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLTimeUnitWithinFormatParser.js")); - -const NLWeekdayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLWeekdayParser.js")); - -const NLMonthNameMiddleEndianParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLMonthNameMiddleEndianParser.js")); - -const NLMonthNameParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLMonthNameParser.js")); - -const NLSlashMonthFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLSlashMonthFormatParser.js")); - -const NLTimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLTimeExpressionParser.js")); - -const NLCasualYearMonthDayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualYearMonthDayParser.js")); - -const NLCasualDateTimeParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualDateTimeParser.js")); - -const NLTimeUnitCasualRelativeFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLTimeUnitCasualRelativeFormatParser.js")); - -const NLRelativeDateFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLRelativeDateFormatParser.js")); - -const NLTimeUnitAgoFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLTimeUnitAgoFormatParser.js")); - -const NLTimeUnitLaterFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/nl/parsers/NLTimeUnitLaterFormatParser.js")); - -exports.casual = new chrono_1.Chrono(createCasualConfiguration()); -exports.strict = new chrono_1.Chrono(createConfiguration(true)); - -function parse(text, ref, option) { - return exports.casual.parse(text, ref, option); -} - -exports.parse = parse; - -function parseDate(text, ref, option) { - return exports.casual.parseDate(text, ref, option); -} - -exports.parseDate = parseDate; - -function createCasualConfiguration(littleEndian = true) { - const option = createConfiguration(false, littleEndian); - option.parsers.unshift(new NLCasualDateParser_1.default()); - option.parsers.unshift(new NLCasualTimeParser_1.default()); - option.parsers.unshift(new NLCasualDateTimeParser_1.default()); - option.parsers.unshift(new NLMonthNameParser_1.default()); - option.parsers.unshift(new NLRelativeDateFormatParser_1.default()); - option.parsers.unshift(new NLTimeUnitCasualRelativeFormatParser_1.default()); - return option; -} - -exports.createCasualConfiguration = createCasualConfiguration; - -function createConfiguration(strictMode = true, littleEndian = true) { - return configurations_1.includeCommonConfiguration({ - parsers: [new SlashDateFormatParser_1.default(littleEndian), new NLTimeUnitWithinFormatParser_1.default(), new NLMonthNameMiddleEndianParser_1.default(), new NLMonthNameParser_1.default(), new NLWeekdayParser_1.default(), new NLCasualYearMonthDayParser_1.default(), new NLSlashMonthFormatParser_1.default(), new NLTimeExpressionParser_1.default(strictMode), new NLTimeUnitAgoFormatParser_1.default(strictMode), new NLTimeUnitLaterFormatParser_1.default(strictMode)], - refiners: [new NLMergeDateTimeRefiner_1.default(), new NLMergeDateRangeRefiner_1.default()] - }, strictMode); -} - -exports.createConfiguration = createConfiguration; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualDateParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function () { - return m[k]; - } - }); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}); - -var __importStar = this && this.__importStar || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - - __setModuleDefault(result, mod); - - return result; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const references = __importStar(__webpack_require__("./node_modules/chrono-node/dist/common/casualReferences.js")); - -class NLCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern(context) { - return /(nu|vandaag|morgen|morgend|gisteren)(?=\W|$)/i; - } - - innerExtract(context, match) { - const lowerText = match[0].toLowerCase(); - const component = context.createParsingComponents(); - - switch (lowerText) { - case "nu": - return references.now(context.reference); - - case "vandaag": - return references.today(context.reference); - - case "morgen": - case "morgend": - return references.tomorrow(context.reference); - - case "gisteren": - return references.yesterday(context.reference); - } - - return component; - } - -} - -exports["default"] = NLCasualDateParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualDateTimeParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); - -const dayjs_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js"); - -const dayjs_2 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const DATE_GROUP = 1; -const TIME_OF_DAY_GROUP = 2; - -class NLCasualDateTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern(context) { - return /(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i; - } - - innerExtract(context, match) { - const dateText = match[DATE_GROUP].toLowerCase(); - const timeText = match[TIME_OF_DAY_GROUP].toLowerCase(); - const component = context.createParsingComponents(); - const targetDate = dayjs_2.default(context.refDate); - - switch (dateText) { - case "gisteren": - dayjs_1.assignSimilarDate(component, targetDate.add(-1, "day")); - break; - - case "van": - dayjs_1.assignSimilarDate(component, targetDate); - break; - - case "morgen": - dayjs_1.assignTheNextDay(component, targetDate); - break; - } - - switch (timeText) { - case "ochtend": - component.imply("meridiem", index_1.Meridiem.AM); - component.imply("hour", 6); - break; - - case "middag": - component.imply("meridiem", index_1.Meridiem.AM); - component.imply("hour", 12); - break; - - case "namiddag": - component.imply("meridiem", index_1.Meridiem.PM); - component.imply("hour", 15); - break; - - case "avond": - component.imply("meridiem", index_1.Meridiem.PM); - component.imply("hour", 20); - break; - } - - return component; - } - -} - -exports["default"] = NLCasualDateTimeParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualTimeParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js"); - -const DAY_GROUP = 1; -const MOMENT_GROUP = 2; - -class NLCasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return /(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i; - } - - innerExtract(context, match) { - const targetDate = dayjs_1.default(context.refDate); - const component = context.createParsingComponents(); - - if (match[DAY_GROUP] === "deze") { - component.assign("day", context.refDate.getDate()); - component.assign("month", context.refDate.getMonth() + 1); - component.assign("year", context.refDate.getFullYear()); - } - - switch (match[MOMENT_GROUP].toLowerCase()) { - case "namiddag": - case "'s namiddags": - component.imply("meridiem", index_1.Meridiem.PM); - component.imply("hour", 15); - break; - - case "avond": - case "'s avonds'": - component.imply("meridiem", index_1.Meridiem.PM); - component.imply("hour", 20); - break; - - case "middernacht": - dayjs_2.assignTheNextDay(component, targetDate); - component.imply("hour", 0); - component.imply("minute", 0); - component.imply("second", 0); - break; - - case "ochtend": - case "'s ochtends": - component.imply("meridiem", index_1.Meridiem.AM); - component.imply("hour", 6); - break; - - case "middag": - case "'s middags": - component.imply("meridiem", index_1.Meridiem.AM); - component.imply("hour", 12); - break; - } - - return component; - } - -} - -exports["default"] = NLCasualTimeParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLCasualYearMonthDayParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp(`([0-9]{4})[\\.\\/\\s]` + `(?:(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]` + `([0-9]{1,2})` + "(?=\\W|$)", "i"); -const YEAR_NUMBER_GROUP = 1; -const MONTH_NAME_GROUP = 2; -const MONTH_NUMBER_GROUP = 3; -const DATE_NUMBER_GROUP = 4; - -class NLCasualYearMonthDayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const month = match[MONTH_NUMBER_GROUP] ? parseInt(match[MONTH_NUMBER_GROUP]) : constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()]; - - if (month < 1 || month > 12) { - return null; - } - - const year = parseInt(match[YEAR_NUMBER_GROUP]); - const day = parseInt(match[DATE_NUMBER_GROUP]); - return { - day: day, - month: month, - year: year - }; - } - -} - -exports["default"] = NLCasualYearMonthDayParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLMonthNameMiddleEndianParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js"); - -const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js"); - -const constants_3 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp("(?:on\\s*?)?" + `(${constants_2.ORDINAL_NUMBER_PATTERN})` + "(?:\\s*" + "(?:tot|\\-|\\–|until|through|till|\\s)\\s*" + `(${constants_2.ORDINAL_NUMBER_PATTERN})` + ")?" + "(?:-|/|\\s*(?:of)?\\s*)" + "(" + pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY) + ")" + "(?:" + "(?:-|/|,?\\s*)" + `(${constants_3.YEAR_PATTERN}(?![^\\s]\\d))` + ")?" + "(?=\\W|$)", "i"); -const MONTH_NAME_GROUP = 3; -const DATE_GROUP = 1; -const DATE_TO_GROUP = 2; -const YEAR_GROUP = 4; - -class NLMonthNameMiddleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()]; - const day = constants_2.parseOrdinalNumberPattern(match[DATE_GROUP]); - - if (day > 31) { - match.index = match.index + match[DATE_GROUP].length; - return null; - } - - const components = context.createParsingComponents({ - day: day, - month: month - }); - - if (match[YEAR_GROUP]) { - const year = constants_3.parseYear(match[YEAR_GROUP]); - components.assign("year", year); - } else { - const year = years_1.findYearClosestToRef(context.refDate, day, month); - components.imply("year", year); - } - - if (!match[DATE_TO_GROUP]) { - return components; - } - - const endDate = constants_2.parseOrdinalNumberPattern(match[DATE_TO_GROUP]); - const result = context.createParsingResult(match.index, match[0]); - result.start = components; - result.end = components.clone(); - result.end.assign("day", endDate); - return result; - } - -} - -exports["default"] = NLMonthNameMiddleEndianParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLMonthNameParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js"); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp(`(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` + `\\s*` + `(?:` + `[,-]?\\s*(${constants_2.YEAR_PATTERN})?` + ")?" + "(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)", "i"); -const MONTH_NAME_GROUP = 1; -const YEAR_GROUP = 2; - -class NLMonthNameParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const components = context.createParsingComponents(); - components.imply("day", 1); - const monthName = match[MONTH_NAME_GROUP]; - const month = constants_1.MONTH_DICTIONARY[monthName.toLowerCase()]; - components.assign("month", month); - - if (match[YEAR_GROUP]) { - const year = constants_2.parseYear(match[YEAR_GROUP]); - components.assign("year", year); - } else { - const year = years_1.findYearClosestToRef(context.refDate, 1, month); - components.imply("year", year); - } - - return components; - } - -} - -exports["default"] = NLMonthNameParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLRelativeDateFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const PATTERN = new RegExp(`(dit|deze|komende|volgend|volgende|afgelopen|vorige)\\s*(${pattern_1.matchAnyPattern(constants_1.TIME_UNIT_DICTIONARY)})(?=\\s*)` + "(?=\\W|$)", "i"); -const MODIFIER_WORD_GROUP = 1; -const RELATIVE_WORD_GROUP = 2; - -class NLRelativeDateFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const modifier = match[MODIFIER_WORD_GROUP].toLowerCase(); - const unitWord = match[RELATIVE_WORD_GROUP].toLowerCase(); - const timeunit = constants_1.TIME_UNIT_DICTIONARY[unitWord]; - - if (modifier == "volgend" || modifier == "volgende" || modifier == "komende") { - const timeUnits = {}; - timeUnits[timeunit] = 1; - return results_1.ParsingComponents.createRelativeFromReference(context.reference, timeUnits); - } - - if (modifier == "afgelopen" || modifier == "vorige") { - const timeUnits = {}; - timeUnits[timeunit] = -1; - return results_1.ParsingComponents.createRelativeFromReference(context.reference, timeUnits); - } - - const components = context.createParsingComponents(); - let date = dayjs_1.default(context.reference.instant); - - if (unitWord.match(/week/i)) { - date = date.add(-date.get("d"), "d"); - components.imply("day", date.date()); - components.imply("month", date.month() + 1); - components.imply("year", date.year()); - } else if (unitWord.match(/maand/i)) { - date = date.add(-date.date() + 1, "d"); - components.imply("day", date.date()); - components.assign("year", date.year()); - components.assign("month", date.month() + 1); - } else if (unitWord.match(/jaar/i)) { - date = date.add(-date.date() + 1, "d"); - date = date.add(-date.month(), "month"); - components.imply("day", date.date()); - components.imply("month", date.month() + 1); - components.assign("year", date.year()); - } - - return components; - } - -} - -exports["default"] = NLRelativeDateFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLSlashMonthFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})" + "", "i"); -const MONTH_GROUP = 1; -const YEAR_GROUP = 2; - -class NLSlashMonthFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const year = parseInt(match[YEAR_GROUP]); - const month = parseInt(match[MONTH_GROUP]); - return context.createParsingComponents().imply("day", 1).assign("month", month).assign("year", year); - } - -} - -exports["default"] = NLSlashMonthFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLTimeExpressionParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractTimeExpressionParser_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractTimeExpressionParser.js"); - -class NLTimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser { - primaryPrefix() { - return "(?:(?:om)\\s*)?"; - } - - followingPhase() { - return "\\s*(?:\\-|\\–|\\~|\\〜|om|\\?)\\s*"; - } - - primarySuffix() { - return "(?:\\s*(?:uur))?(?!/)(?=\\W|$)"; - } - - extractPrimaryTimeComponents(context, match) { - if (match[0].match(/^\s*\d{4}\s*$/)) { - return null; - } - - return super.extractPrimaryTimeComponents(context, match); - } - -} - -exports["default"] = NLTimeExpressionParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLTimeUnitAgoFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js"); - -const PATTERN = new RegExp("" + "(" + constants_1.TIME_UNITS_PATTERN + ")" + "(?:geleden|voor|eerder)(?=(?:\\W|$))", "i"); -const STRICT_PATTERN = new RegExp("" + "(" + constants_1.TIME_UNITS_PATTERN + ")" + "geleden(?=(?:\\W|$))", "i"); - -class NLTimeUnitAgoFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - constructor(strictMode) { - super(); - this.strictMode = strictMode; - } - - innerPattern() { - return this.strictMode ? STRICT_PATTERN : PATTERN; - } - - innerExtract(context, match) { - const timeUnits = constants_1.parseTimeUnits(match[1]); - const outputTimeUnits = timeunits_1.reverseTimeUnits(timeUnits); - return results_1.ParsingComponents.createRelativeFromReference(context.reference, outputTimeUnits); - } - -} - -exports["default"] = NLTimeUnitAgoFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLTimeUnitCasualRelativeFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js"); - -const PATTERN = new RegExp(`(deze|vorige|afgelopen|komende|over|\\+|-)\\s*(${constants_1.TIME_UNITS_PATTERN})(?=\\W|$)`, "i"); - -class NLTimeUnitCasualRelativeFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const prefix = match[1].toLowerCase(); - let timeUnits = constants_1.parseTimeUnits(match[2]); - - switch (prefix) { - case "vorige": - case "afgelopen": - case "-": - timeUnits = timeunits_1.reverseTimeUnits(timeUnits); - break; - } - - return results_1.ParsingComponents.createRelativeFromReference(context.reference, timeUnits); - } - -} - -exports["default"] = NLTimeUnitCasualRelativeFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLTimeUnitLaterFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp("" + "(" + constants_1.TIME_UNITS_PATTERN + ")" + "(later|na|vanaf nu|voortaan|vooruit|uit)" + "(?=(?:\\W|$))", "i"); -const STRICT_PATTERN = new RegExp("" + "(" + constants_1.TIME_UNITS_PATTERN + ")" + "(later|vanaf nu)" + "(?=(?:\\W|$))", "i"); -const GROUP_NUM_TIMEUNITS = 1; - -class NLTimeUnitLaterFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - constructor(strictMode) { - super(); - this.strictMode = strictMode; - } - - innerPattern() { - return this.strictMode ? STRICT_PATTERN : PATTERN; - } - - innerExtract(context, match) { - const fragments = constants_1.parseTimeUnits(match[GROUP_NUM_TIMEUNITS]); - return results_1.ParsingComponents.createRelativeFromReference(context.reference, fragments); - } - -} - -exports["default"] = NLTimeUnitLaterFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLTimeUnitWithinFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -class NLTimeUnitWithinFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return new RegExp(`(?:binnen|in|binnen de|voor)\\s*` + "(" + constants_1.TIME_UNITS_PATTERN + ")" + `(?=\\W|$)`, "i"); - } - - innerExtract(context, match) { - const timeUnits = constants_1.parseTimeUnits(match[1]); - return results_1.ParsingComponents.createRelativeFromReference(context.reference, timeUnits); - } - -} - -exports["default"] = NLTimeUnitWithinFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/parsers/NLWeekdayParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/nl/constants.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const weekdays_1 = __webpack_require__("./node_modules/chrono-node/dist/common/calculation/weekdays.js"); - -const PATTERN = new RegExp("(?:(?:\\,|\\(|\\()\\s*)?" + "(?:op\\s*?)?" + "(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?" + `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` + "(?=\\W|$)", "i"); -const PREFIX_GROUP = 1; -const WEEKDAY_GROUP = 2; -const POSTFIX_GROUP = 3; - -class NLWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase(); - const weekday = constants_1.WEEKDAY_DICTIONARY[dayOfWeek]; - const prefix = match[PREFIX_GROUP]; - const postfix = match[POSTFIX_GROUP]; - let modifierWord = prefix || postfix; - modifierWord = modifierWord || ""; - modifierWord = modifierWord.toLowerCase(); - let modifier = null; - - if (modifierWord == "vorige") { - modifier = "last"; - } else if (modifierWord == "volgende") { - modifier = "next"; - } else if (modifierWord == "deze") { - modifier = "this"; - } - - return weekdays_1.createParsingComponentsAtWeekday(context.reference, weekday, modifier); - } - -} - -exports["default"] = NLWeekdayParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/refiners/NLMergeDateRangeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js")); - -class NLMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default { - patternBetween() { - return /^\s*(tot|-)\s*$/i; - } - -} - -exports["default"] = NLMergeDateRangeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/nl/refiners/NLMergeDateTimeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateTimeRefiner.js")); - -class NLMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default { - patternBetween() { - return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$"); - } - -} - -exports["default"] = NLMergeDateTimeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/pt/constants.js": -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.parseYear = exports.YEAR_PATTERN = exports.MONTH_DICTIONARY = exports.WEEKDAY_DICTIONARY = void 0; -exports.WEEKDAY_DICTIONARY = { - "domingo": 0, - "dom": 0, - "segunda": 1, - "segunda-feira": 1, - "seg": 1, - "terça": 2, - "terça-feira": 2, - "ter": 2, - "quarta": 3, - "quarta-feira": 3, - "qua": 3, - "quinta": 4, - "quinta-feira": 4, - "qui": 4, - "sexta": 5, - "sexta-feira": 5, - "sex": 5, - "sábado": 6, - "sabado": 6, - "sab": 6 -}; -exports.MONTH_DICTIONARY = { - "janeiro": 1, - "jan": 1, - "jan.": 1, - "fevereiro": 2, - "fev": 2, - "fev.": 2, - "março": 3, - "mar": 3, - "mar.": 3, - "abril": 4, - "abr": 4, - "abr.": 4, - "maio": 5, - "mai": 5, - "mai.": 5, - "junho": 6, - "jun": 6, - "jun.": 6, - "julho": 7, - "jul": 7, - "jul.": 7, - "agosto": 8, - "ago": 8, - "ago.": 8, - "setembro": 9, - "set": 9, - "set.": 9, - "outubro": 10, - "out": 10, - "out.": 10, - "novembro": 11, - "nov": 11, - "nov.": 11, - "dezembro": 12, - "dez": 12, - "dez.": 12 -}; -exports.YEAR_PATTERN = "[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?"; - -function parseYear(match) { - if (match.match(/^[0-9]{1,4}$/)) { - let yearNumber = parseInt(match); - - if (yearNumber < 100) { - if (yearNumber > 50) { - yearNumber = yearNumber + 1900; - } else { - yearNumber = yearNumber + 2000; - } - } - - return yearNumber; - } - - if (match.match(/a\.?\s*c\.?/i)) { - match = match.replace(/a\.?\s*c\.?/i, ""); - return -parseInt(match); - } - - return parseInt(match); -} - -exports.parseYear = parseYear; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/pt/index.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0; - -const configurations_1 = __webpack_require__("./node_modules/chrono-node/dist/configurations.js"); - -const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js"); - -const SlashDateFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/parsers/SlashDateFormatParser.js")); - -const PTWeekdayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/parsers/PTWeekdayParser.js")); - -const PTTimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/parsers/PTTimeExpressionParser.js")); - -const PTMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/refiners/PTMergeDateTimeRefiner.js")); - -const PTMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/refiners/PTMergeDateRangeRefiner.js")); - -const PTMonthNameLittleEndianParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/parsers/PTMonthNameLittleEndianParser.js")); - -const PTCasualDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/parsers/PTCasualDateParser.js")); - -const PTCasualTimeParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/pt/parsers/PTCasualTimeParser.js")); - -exports.casual = new chrono_1.Chrono(createCasualConfiguration()); -exports.strict = new chrono_1.Chrono(createConfiguration(true)); - -function parse(text, ref, option) { - return exports.casual.parse(text, ref, option); -} - -exports.parse = parse; - -function parseDate(text, ref, option) { - return exports.casual.parseDate(text, ref, option); -} - -exports.parseDate = parseDate; - -function createCasualConfiguration(littleEndian = true) { - const option = createConfiguration(false, littleEndian); - option.parsers.push(new PTCasualDateParser_1.default()); - option.parsers.push(new PTCasualTimeParser_1.default()); - return option; -} - -exports.createCasualConfiguration = createCasualConfiguration; - -function createConfiguration(strictMode = true, littleEndian = true) { - return configurations_1.includeCommonConfiguration({ - parsers: [new SlashDateFormatParser_1.default(littleEndian), new PTWeekdayParser_1.default(), new PTTimeExpressionParser_1.default(), new PTMonthNameLittleEndianParser_1.default()], - refiners: [new PTMergeDateTimeRefiner_1.default(), new PTMergeDateRangeRefiner_1.default()] - }, strictMode); -} - -exports.createConfiguration = createConfiguration; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/pt/parsers/PTCasualDateParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function () { - return m[k]; - } - }); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}); - -var __importStar = this && this.__importStar || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - - __setModuleDefault(result, mod); - - return result; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const references = __importStar(__webpack_require__("./node_modules/chrono-node/dist/common/casualReferences.js")); - -class PTCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern(context) { - return /(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i; - } - - innerExtract(context, match) { - const lowerText = match[0].toLowerCase(); - const component = context.createParsingComponents(); - - switch (lowerText) { - case "agora": - return references.now(context.reference); - - case "hoje": - return references.today(context.reference); - - case "amanha": - case "amanhã": - return references.tomorrow(context.reference); - - case "ontem": - return references.yesterday(context.reference); - } - - return component; - } - -} - -exports["default"] = PTCasualDateParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/pt/parsers/PTCasualTimeParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const dayjs_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js"); - -const dayjs_2 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -class PTCasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return /(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i; - } - - innerExtract(context, match) { - const targetDate = dayjs_2.default(context.refDate); - const component = context.createParsingComponents(); - - switch (match[1].toLowerCase()) { - case "tarde": - component.imply("meridiem", index_1.Meridiem.PM); - component.imply("hour", 15); - break; - - case "noite": - component.imply("meridiem", index_1.Meridiem.PM); - component.imply("hour", 22); - break; - - case "manha": - case "manhã": - component.imply("meridiem", index_1.Meridiem.AM); - component.imply("hour", 6); - break; - - case "meia-noite": - dayjs_1.assignTheNextDay(component, targetDate); - component.imply("hour", 0); - component.imply("minute", 0); - component.imply("second", 0); - break; - - case "meio-dia": - component.imply("meridiem", index_1.Meridiem.AM); - component.imply("hour", 12); - break; - } - - return component; - } - -} - -exports["default"] = PTCasualTimeParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/pt/parsers/PTMonthNameLittleEndianParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/pt/constants.js"); - -const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/pt/constants.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp(`([0-9]{1,2})(?:º|ª|°)?` + "(?:\\s*(?:desde|de|\\-|\\–|ao?|\\s)\\s*([0-9]{1,2})(?:º|ª|°)?)?\\s*(?:de)?\\s*" + `(?:-|/|\\s*(?:de|,)?\\s*)` + `(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` + `(?:\\s*(?:de|,)?\\s*(${constants_2.YEAR_PATTERN}))?` + `(?=\\W|$)`, "i"); -const DATE_GROUP = 1; -const DATE_TO_GROUP = 2; -const MONTH_NAME_GROUP = 3; -const YEAR_GROUP = 4; - -class PTMonthNameLittleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const result = context.createParsingResult(match.index, match[0]); - const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()]; - const day = parseInt(match[DATE_GROUP]); - - if (day > 31) { - match.index = match.index + match[DATE_GROUP].length; - return null; - } - - result.start.assign("month", month); - result.start.assign("day", day); - - if (match[YEAR_GROUP]) { - const yearNumber = constants_2.parseYear(match[YEAR_GROUP]); - result.start.assign("year", yearNumber); - } else { - const year = years_1.findYearClosestToRef(context.refDate, day, month); - result.start.imply("year", year); - } - - if (match[DATE_TO_GROUP]) { - const endDate = parseInt(match[DATE_TO_GROUP]); - result.end = result.start.clone(); - result.end.assign("day", endDate); - } - - return result; - } - -} - -exports["default"] = PTMonthNameLittleEndianParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/pt/parsers/PTTimeExpressionParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractTimeExpressionParser_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractTimeExpressionParser.js"); - -class PTTimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser { - primaryPrefix() { - return "(?:(?:ao?|às?|das|da|de|do)\\s*)?"; - } - - followingPhase() { - return "\\s*(?:\\-|\\–|\\~|\\〜|a(?:o)?|\\?)\\s*"; - } - -} - -exports["default"] = PTTimeExpressionParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/pt/parsers/PTWeekdayParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/pt/constants.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const weekdays_1 = __webpack_require__("./node_modules/chrono-node/dist/common/calculation/weekdays.js"); - -const PATTERN = new RegExp("(?:(?:\\,|\\(|\\()\\s*)?" + "(?:(este|esta|passado|pr[oó]ximo)\\s*)?" + `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` + "(?:\\s*(?:\\,|\\)|\\)))?" + "(?:\\s*(este|esta|passado|pr[óo]ximo)\\s*semana)?" + "(?=\\W|\\d|$)", "i"); -const PREFIX_GROUP = 1; -const WEEKDAY_GROUP = 2; -const POSTFIX_GROUP = 3; - -class PTWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase(); - const weekday = constants_1.WEEKDAY_DICTIONARY[dayOfWeek]; - - if (weekday === undefined) { - return null; - } - - const prefix = match[PREFIX_GROUP]; - const postfix = match[POSTFIX_GROUP]; - let norm = prefix || postfix || ""; - norm = norm.toLowerCase(); - let modifier = null; - - if (norm == "passado") { - modifier = "this"; - } else if (norm == "próximo" || norm == "proximo") { - modifier = "next"; - } else if (norm == "este") { - modifier = "this"; - } - - return weekdays_1.createParsingComponentsAtWeekday(context.reference, weekday, modifier); - } - -} - -exports["default"] = PTWeekdayParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/pt/refiners/PTMergeDateRangeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js")); - -class PTMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default { - patternBetween() { - return /^\s*(?:-)\s*$/i; - } - -} - -exports["default"] = PTMergeDateRangeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/pt/refiners/PTMergeDateTimeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateTimeRefiner.js")); - -class PTMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default { - patternBetween() { - return new RegExp("^\\s*(?:,|à)?\\s*$"); - } - -} - -exports["default"] = PTMergeDateTimeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ru/constants.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.parseTimeUnits = exports.TIME_UNITS_PATTERN = exports.parseYear = exports.YEAR_PATTERN = exports.parseOrdinalNumberPattern = exports.ORDINAL_NUMBER_PATTERN = exports.parseNumberPattern = exports.NUMBER_PATTERN = exports.TIME_UNIT_DICTIONARY = exports.ORDINAL_WORD_DICTIONARY = exports.INTEGER_WORD_DICTIONARY = exports.MONTH_DICTIONARY = exports.FULL_MONTH_NAME_DICTIONARY = exports.WEEKDAY_DICTIONARY = exports.REGEX_PARTS = void 0; - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -exports.REGEX_PARTS = { - leftBoundary: "([^\\p{L}\\p{N}_]|^)", - rightBoundary: "(?=[^\\p{L}\\p{N}_]|$)", - flags: "iu" -}; -exports.WEEKDAY_DICTIONARY = { - воскресенье: 0, - воскресенья: 0, - вск: 0, - "вск.": 0, - понедельник: 1, - понедельника: 1, - пн: 1, - "пн.": 1, - вторник: 2, - вторника: 2, - вт: 2, - "вт.": 2, - среда: 3, - среды: 3, - среду: 3, - ср: 3, - "ср.": 3, - четверг: 4, - четверга: 4, - чт: 4, - "чт.": 4, - пятница: 5, - пятницу: 5, - пятницы: 5, - пт: 5, - "пт.": 5, - суббота: 6, - субботу: 6, - субботы: 6, - сб: 6, - "сб.": 6 -}; -exports.FULL_MONTH_NAME_DICTIONARY = { - январь: 1, - января: 1, - январе: 1, - февраль: 2, - февраля: 2, - феврале: 2, - март: 3, - марта: 3, - марте: 3, - апрель: 4, - апреля: 4, - апреле: 4, - май: 5, - мая: 5, - мае: 5, - июнь: 6, - июня: 6, - июне: 6, - июль: 7, - июля: 7, - июле: 7, - август: 8, - августа: 8, - августе: 8, - сентябрь: 9, - сентября: 9, - сентябре: 9, - октябрь: 10, - октября: 10, - октябре: 10, - ноябрь: 11, - ноября: 11, - ноябре: 11, - декабрь: 12, - декабря: 12, - декабре: 12 -}; -exports.MONTH_DICTIONARY = Object.assign(Object.assign({}, exports.FULL_MONTH_NAME_DICTIONARY), { - янв: 1, - "янв.": 1, - фев: 2, - "фев.": 2, - мар: 3, - "мар.": 3, - апр: 4, - "апр.": 4, - авг: 8, - "авг.": 8, - сен: 9, - "сен.": 9, - окт: 10, - "окт.": 10, - ноя: 11, - "ноя.": 11, - дек: 12, - "дек.": 12 -}); -exports.INTEGER_WORD_DICTIONARY = { - один: 1, - одна: 1, - одной: 1, - одну: 1, - две: 2, - два: 2, - двух: 2, - три: 3, - трех: 3, - трёх: 3, - четыре: 4, - четырех: 4, - четырёх: 4, - пять: 5, - пяти: 5, - шесть: 6, - шести: 6, - семь: 7, - семи: 7, - восемь: 8, - восьми: 8, - девять: 9, - девяти: 9, - десять: 10, - десяти: 10, - одиннадцать: 11, - одиннадцати: 11, - двенадцать: 12, - двенадцати: 12 -}; -exports.ORDINAL_WORD_DICTIONARY = { - первое: 1, - первого: 1, - второе: 2, - второго: 2, - третье: 3, - третьего: 3, - четвертое: 4, - четвертого: 4, - пятое: 5, - пятого: 5, - шестое: 6, - шестого: 6, - седьмое: 7, - седьмого: 7, - восьмое: 8, - восьмого: 8, - девятое: 9, - девятого: 9, - десятое: 10, - десятого: 10, - одиннадцатое: 11, - одиннадцатого: 11, - двенадцатое: 12, - двенадцатого: 12, - тринадцатое: 13, - тринадцатого: 13, - четырнадцатое: 14, - четырнадцатого: 14, - пятнадцатое: 15, - пятнадцатого: 15, - шестнадцатое: 16, - шестнадцатого: 16, - семнадцатое: 17, - семнадцатого: 17, - восемнадцатое: 18, - восемнадцатого: 18, - девятнадцатое: 19, - девятнадцатого: 19, - двадцатое: 20, - двадцатого: 20, - "двадцать первое": 21, - "двадцать первого": 21, - "двадцать второе": 22, - "двадцать второго": 22, - "двадцать третье": 23, - "двадцать третьего": 23, - "двадцать четвертое": 24, - "двадцать четвертого": 24, - "двадцать пятое": 25, - "двадцать пятого": 25, - "двадцать шестое": 26, - "двадцать шестого": 26, - "двадцать седьмое": 27, - "двадцать седьмого": 27, - "двадцать восьмое": 28, - "двадцать восьмого": 28, - "двадцать девятое": 29, - "двадцать девятого": 29, - "тридцатое": 30, - "тридцатого": 30, - "тридцать первое": 31, - "тридцать первого": 31 -}; -exports.TIME_UNIT_DICTIONARY = { - сек: "second", - секунда: "second", - секунд: "second", - секунды: "second", - секунду: "second", - секундочка: "second", - секундочки: "second", - секундочек: "second", - секундочку: "second", - мин: "minute", - минута: "minute", - минут: "minute", - минуты: "minute", - минуту: "minute", - минуток: "minute", - минутки: "minute", - минутку: "minute", - час: "hour", - часов: "hour", - часа: "hour", - часу: "hour", - часиков: "hour", - часика: "hour", - часике: "hour", - часик: "hour", - день: "d", - дня: "d", - дней: "d", - суток: "d", - сутки: "d", - неделя: "week", - неделе: "week", - недели: "week", - неделю: "week", - недель: "week", - недельке: "week", - недельки: "week", - неделек: "week", - месяц: "month", - месяце: "month", - месяцев: "month", - месяца: "month", - квартал: "quarter", - квартале: "quarter", - кварталов: "quarter", - год: "year", - года: "year", - году: "year", - годов: "year", - лет: "year", - годик: "year", - годика: "year", - годиков: "year" -}; -exports.NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|пол|несколько|пар(?:ы|у)|\\s{0,3})`; - -function parseNumberPattern(match) { - const num = match.toLowerCase(); - - if (exports.INTEGER_WORD_DICTIONARY[num] !== undefined) { - return exports.INTEGER_WORD_DICTIONARY[num]; - } - - if (num.match(/несколько/)) { - return 3; - } else if (num.match(/пол/)) { - return 0.5; - } else if (num.match(/пар/)) { - return 2; - } else if (num === "") { - return 1; - } - - return parseFloat(num); -} - -exports.parseNumberPattern = parseNumberPattern; -exports.ORDINAL_NUMBER_PATTERN = `(?:${pattern_1.matchAnyPattern(exports.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:го|ого|е|ое)?)`; - -function parseOrdinalNumberPattern(match) { - let num = match.toLowerCase(); - - if (exports.ORDINAL_WORD_DICTIONARY[num] !== undefined) { - return exports.ORDINAL_WORD_DICTIONARY[num]; - } - - return parseInt(num); -} - -exports.parseOrdinalNumberPattern = parseOrdinalNumberPattern; -const year = "(?:\\s+(?:году|года|год|г|г.))?"; -exports.YEAR_PATTERN = `(?:[1-9][0-9]{0,3}${year}\\s*(?:н.э.|до н.э.|н. э.|до н. э.)|[1-2][0-9]{3}${year}|[5-9][0-9]${year})`; - -function parseYear(match) { - if (/(год|года|г|г.)/i.test(match)) { - match = match.replace(/(год|года|г|г.)/i, ""); - } - - if (/(до н.э.|до н. э.)/i.test(match)) { - match = match.replace(/(до н.э.|до н. э.)/i, ""); - return -parseInt(match); - } - - if (/(н. э.|н.э.)/i.test(match)) { - match = match.replace(/(н. э.|н.э.)/i, ""); - return parseInt(match); - } - - const rawYearNumber = parseInt(match); - return years_1.findMostLikelyADYear(rawYearNumber); -} - -exports.parseYear = parseYear; -const SINGLE_TIME_UNIT_PATTERN = `(${exports.NUMBER_PATTERN})\\s{0,3}(${pattern_1.matchAnyPattern(exports.TIME_UNIT_DICTIONARY)})`; -const SINGLE_TIME_UNIT_REGEX = new RegExp(SINGLE_TIME_UNIT_PATTERN, "i"); -exports.TIME_UNITS_PATTERN = pattern_1.repeatedTimeunitPattern(`(?:(?:около|примерно)\\s{0,3})?`, SINGLE_TIME_UNIT_PATTERN); - -function parseTimeUnits(timeunitText) { - const fragments = {}; - let remainingText = timeunitText; - let match = SINGLE_TIME_UNIT_REGEX.exec(remainingText); - - while (match) { - collectDateTimeFragment(fragments, match); - remainingText = remainingText.substring(match[0].length).trim(); - match = SINGLE_TIME_UNIT_REGEX.exec(remainingText); - } - - return fragments; -} - -exports.parseTimeUnits = parseTimeUnits; - -function collectDateTimeFragment(fragments, match) { - const num = parseNumberPattern(match[1]); - const unit = exports.TIME_UNIT_DICTIONARY[match[2].toLowerCase()]; - fragments[unit] = num; -} - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ru/index.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = void 0; - -const RUTimeUnitWithinFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ru/parsers/RUTimeUnitWithinFormatParser.js")); - -const RUMonthNameLittleEndianParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ru/parsers/RUMonthNameLittleEndianParser.js")); - -const RUMonthNameParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ru/parsers/RUMonthNameParser.js")); - -const RUTimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ru/parsers/RUTimeExpressionParser.js")); - -const RUTimeUnitAgoFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ru/parsers/RUTimeUnitAgoFormatParser.js")); - -const RUMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ru/refiners/RUMergeDateRangeRefiner.js")); - -const RUMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ru/refiners/RUMergeDateTimeRefiner.js")); - -const configurations_1 = __webpack_require__("./node_modules/chrono-node/dist/configurations.js"); - -const RUCasualDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ru/parsers/RUCasualDateParser.js")); - -const RUCasualTimeParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ru/parsers/RUCasualTimeParser.js")); - -const RUWeekdayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ru/parsers/RUWeekdayParser.js")); - -const RURelativeDateFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ru/parsers/RURelativeDateFormatParser.js")); - -const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js"); - -const SlashDateFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/parsers/SlashDateFormatParser.js")); - -const RUTimeUnitCasualRelativeFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/ru/parsers/RUTimeUnitCasualRelativeFormatParser.js")); - -exports.casual = new chrono_1.Chrono(createCasualConfiguration()); -exports.strict = new chrono_1.Chrono(createConfiguration(true)); - -function parse(text, ref, option) { - return exports.casual.parse(text, ref, option); -} - -exports.parse = parse; - -function parseDate(text, ref, option) { - return exports.casual.parseDate(text, ref, option); -} - -exports.parseDate = parseDate; - -function createCasualConfiguration() { - const option = createConfiguration(false); - option.parsers.unshift(new RUCasualDateParser_1.default()); - option.parsers.unshift(new RUCasualTimeParser_1.default()); - option.parsers.unshift(new RUMonthNameParser_1.default()); - option.parsers.unshift(new RURelativeDateFormatParser_1.default()); - option.parsers.unshift(new RUTimeUnitCasualRelativeFormatParser_1.default()); - return option; -} - -exports.createCasualConfiguration = createCasualConfiguration; - -function createConfiguration(strictMode = true) { - return configurations_1.includeCommonConfiguration({ - parsers: [new SlashDateFormatParser_1.default(true), new RUTimeUnitWithinFormatParser_1.default(), new RUMonthNameLittleEndianParser_1.default(), new RUWeekdayParser_1.default(), new RUTimeExpressionParser_1.default(strictMode), new RUTimeUnitAgoFormatParser_1.default()], - refiners: [new RUMergeDateTimeRefiner_1.default(), new RUMergeDateRangeRefiner_1.default()] - }, strictMode); -} - -exports.createConfiguration = createConfiguration; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ru/parsers/RUCasualDateParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function () { - return m[k]; - } - }); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}); - -var __importStar = this && this.__importStar || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - - __setModuleDefault(result, mod); - - return result; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const references = __importStar(__webpack_require__("./node_modules/chrono-node/dist/common/casualReferences.js")); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/ru/constants.js"); - -const PATTERN = new RegExp(`(?:с|со)?\\s*(сегодня|вчера|завтра|послезавтра|позавчера)${constants_1.REGEX_PARTS.rightBoundary}`, constants_1.REGEX_PARTS.flags); - -class RUCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - patternLeftBoundary() { - return constants_1.REGEX_PARTS.leftBoundary; - } - - innerPattern(context) { - return PATTERN; - } - - innerExtract(context, match) { - const lowerText = match[1].toLowerCase(); - const component = context.createParsingComponents(); - - switch (lowerText) { - case "сегодня": - return references.today(context.reference); - - case "вчера": - return references.yesterday(context.reference); - - case "завтра": - return references.tomorrow(context.reference); - - case "послезавтра": - return references.theDayAfter(context.reference, 2); - - case "позавчера": - return references.theDayBefore(context.reference, 2); - } - - return component; - } - -} - -exports["default"] = RUCasualDateParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ru/parsers/RUCasualTimeParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function () { - return m[k]; - } - }); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}); - -var __importStar = this && this.__importStar || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - - __setModuleDefault(result, mod); - - return result; -}; - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const references = __importStar(__webpack_require__("./node_modules/chrono-node/dist/common/casualReferences.js")); - -const dayjs_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js"); - -const dayjs_2 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/ru/constants.js"); - -const PATTERN = new RegExp(`(сейчас|прошлым\\s*вечером|прошлой\\s*ночью|следующей\\s*ночью|сегодня\\s*ночью|этой\\s*ночью|ночью|этим утром|утром|утра|в\\s*полдень|вечером|вечера|в\\s*полночь)` + `${constants_1.REGEX_PARTS.rightBoundary}`, constants_1.REGEX_PARTS.flags); - -class RUCasualTimeParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - patternLeftBoundary() { - return constants_1.REGEX_PARTS.leftBoundary; - } - - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - let targetDate = dayjs_2.default(context.refDate); - const lowerText = match[0].toLowerCase(); - const component = context.createParsingComponents(); - - if (lowerText === "сейчас") { - return references.now(context.reference); - } - - if (lowerText === "вечером" || lowerText === "вечера") { - return references.evening(context.reference); - } - - if (lowerText.endsWith("утром") || lowerText.endsWith("утра")) { - return references.morning(context.reference); - } - - if (lowerText.match(/в\s*полдень/)) { - return references.noon(context.reference); - } - - if (lowerText.match(/прошлой\s*ночью/)) { - return references.lastNight(context.reference); - } - - if (lowerText.match(/прошлым\s*вечером/)) { - return references.yesterdayEvening(context.reference); - } - - if (lowerText.match(/следующей\s*ночью/)) { - const daysToAdd = targetDate.hour() < 22 ? 1 : 2; - targetDate = targetDate.add(daysToAdd, "day"); - dayjs_1.assignSimilarDate(component, targetDate); - component.imply("hour", 0); - } - - if (lowerText.match(/в\s*полночь/) || lowerText.endsWith("ночью")) { - return references.midnight(context.reference); - } - - return component; - } - -} - -exports["default"] = RUCasualTimeParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ru/parsers/RUMonthNameLittleEndianParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/ru/constants.js"); - -const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/ru/constants.js"); - -const constants_3 = __webpack_require__("./node_modules/chrono-node/dist/locales/ru/constants.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp(`(?:с)?\\s*(${constants_3.ORDINAL_NUMBER_PATTERN})` + `(?:` + `\\s{0,3}(?:по|-|–|до)?\\s{0,3}` + `(${constants_3.ORDINAL_NUMBER_PATTERN})` + `)?` + `(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})` + `(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` + `(?:` + `(?:-|\\/|,?\\s{0,3})` + `(${constants_2.YEAR_PATTERN}(?![^\\s]\\d))` + `)?` + `${constants_1.REGEX_PARTS.rightBoundary}`, constants_1.REGEX_PARTS.flags); -const DATE_GROUP = 1; -const DATE_TO_GROUP = 2; -const MONTH_NAME_GROUP = 3; -const YEAR_GROUP = 4; - -class RUMonthNameLittleEndianParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - patternLeftBoundary() { - return constants_1.REGEX_PARTS.leftBoundary; - } - - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const result = context.createParsingResult(match.index, match[0]); - const month = constants_1.MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()]; - const day = constants_3.parseOrdinalNumberPattern(match[DATE_GROUP]); - - if (day > 31) { - match.index = match.index + match[DATE_GROUP].length; - return null; - } - - result.start.assign("month", month); - result.start.assign("day", day); - - if (match[YEAR_GROUP]) { - const yearNumber = constants_2.parseYear(match[YEAR_GROUP]); - result.start.assign("year", yearNumber); - } else { - const year = years_1.findYearClosestToRef(context.refDate, day, month); - result.start.imply("year", year); - } - - if (match[DATE_TO_GROUP]) { - const endDate = constants_3.parseOrdinalNumberPattern(match[DATE_TO_GROUP]); - result.end = result.start.clone(); - result.end.assign("day", endDate); - } - - return result; - } - -} - -exports["default"] = RUMonthNameLittleEndianParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ru/parsers/RUMonthNameParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/ru/constants.js"); - -const years_1 = __webpack_require__("./node_modules/chrono-node/dist/calculation/years.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const constants_2 = __webpack_require__("./node_modules/chrono-node/dist/locales/ru/constants.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = new RegExp(`((?:в)\\s*)?` + `(${pattern_1.matchAnyPattern(constants_1.MONTH_DICTIONARY)})` + `\\s*` + `(?:` + `[,-]?\\s*(${constants_2.YEAR_PATTERN})?` + `)?` + `(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`, constants_1.REGEX_PARTS.flags); -const MONTH_NAME_GROUP = 2; -const YEAR_GROUP = 3; - -class RUMonthNameParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - patternLeftBoundary() { - return constants_1.REGEX_PARTS.leftBoundary; - } - - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const monthName = match[MONTH_NAME_GROUP].toLowerCase(); - - if (match[0].length <= 3 && !constants_1.FULL_MONTH_NAME_DICTIONARY[monthName]) { - return null; - } - - const result = context.createParsingResult(match.index, match.index + match[0].length); - result.start.imply("day", 1); - const month = constants_1.MONTH_DICTIONARY[monthName]; - result.start.assign("month", month); - - if (match[YEAR_GROUP]) { - const year = constants_2.parseYear(match[YEAR_GROUP]); - result.start.assign("year", year); - } else { - const year = years_1.findYearClosestToRef(context.refDate, 1, month); - result.start.imply("year", year); - } - - return result; - } - -} - -exports["default"] = RUMonthNameParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ru/parsers/RURelativeDateFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/ru/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const PATTERN = new RegExp(`(в прошлом|на прошлой|на следующей|в следующем|на этой|в этом)\\s*(${pattern_1.matchAnyPattern(constants_1.TIME_UNIT_DICTIONARY)})(?=\\s*)${constants_1.REGEX_PARTS.rightBoundary}`, constants_1.REGEX_PARTS.flags); -const MODIFIER_WORD_GROUP = 1; -const RELATIVE_WORD_GROUP = 2; - -class RURelativeDateFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - patternLeftBoundary() { - return constants_1.REGEX_PARTS.leftBoundary; - } - - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const modifier = match[MODIFIER_WORD_GROUP].toLowerCase(); - const unitWord = match[RELATIVE_WORD_GROUP].toLowerCase(); - const timeunit = constants_1.TIME_UNIT_DICTIONARY[unitWord]; - - if (modifier == "на следующей" || modifier == "в следующем") { - const timeUnits = {}; - timeUnits[timeunit] = 1; - return results_1.ParsingComponents.createRelativeFromReference(context.reference, timeUnits); - } - - if (modifier == "в прошлом" || modifier == "на прошлой") { - const timeUnits = {}; - timeUnits[timeunit] = -1; - return results_1.ParsingComponents.createRelativeFromReference(context.reference, timeUnits); - } - - const components = context.createParsingComponents(); - let date = dayjs_1.default(context.reference.instant); - - if (timeunit.match(/week/i)) { - date = date.add(-date.get("d"), "d"); - components.imply("day", date.date()); - components.imply("month", date.month() + 1); - components.imply("year", date.year()); - } else if (timeunit.match(/month/i)) { - date = date.add(-date.date() + 1, "d"); - components.imply("day", date.date()); - components.assign("year", date.year()); - components.assign("month", date.month() + 1); - } else if (timeunit.match(/year/i)) { - date = date.add(-date.date() + 1, "d"); - date = date.add(-date.month(), "month"); - components.imply("day", date.date()); - components.imply("month", date.month() + 1); - components.assign("year", date.year()); - } - - return components; - } - -} - -exports["default"] = RURelativeDateFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ru/parsers/RUTimeExpressionParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); - -const AbstractTimeExpressionParser_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractTimeExpressionParser.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/ru/constants.js"); - -class RUTimeExpressionParser extends AbstractTimeExpressionParser_1.AbstractTimeExpressionParser { - constructor(strictMode) { - super(strictMode); - } - - patternFlags() { - return constants_1.REGEX_PARTS.flags; - } - - primaryPatternLeftBoundary() { - return `(^|\\s|T|(?:[^\\p{L}\\p{N}_]))`; - } - - followingPhase() { - return `\\s*(?:\\-|\\–|\\~|\\〜|до|и|по|\\?)\\s*`; - } - - primaryPrefix() { - return `(?:(?:в|с)\\s*)??`; - } - - primarySuffix() { - return `(?:\\s*(?:утра|вечера|после полудня))?(?!\\/)${constants_1.REGEX_PARTS.rightBoundary}`; - } - - extractPrimaryTimeComponents(context, match) { - const components = super.extractPrimaryTimeComponents(context, match); - - if (components) { - if (match[0].endsWith("вечера")) { - const hour = components.get("hour"); - - if (hour >= 6 && hour < 12) { - components.assign("hour", components.get("hour") + 12); - components.assign("meridiem", index_1.Meridiem.PM); - } else if (hour < 6) { - components.assign("meridiem", index_1.Meridiem.AM); - } - } - - if (match[0].endsWith("после полудня")) { - components.assign("meridiem", index_1.Meridiem.PM); - const hour = components.get("hour"); - - if (hour >= 0 && hour <= 6) { - components.assign("hour", components.get("hour") + 12); - } - } - - if (match[0].endsWith("утра")) { - components.assign("meridiem", index_1.Meridiem.AM); - const hour = components.get("hour"); - - if (hour < 12) { - components.assign("hour", components.get("hour")); - } - } - } - - return components; - } - -} - -exports["default"] = RUTimeExpressionParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ru/parsers/RUTimeUnitAgoFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/ru/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js"); - -const PATTERN = new RegExp(`(${constants_1.TIME_UNITS_PATTERN})\\s{0,5}назад(?=(?:\\W|$))`, constants_1.REGEX_PARTS.flags); - -class RUTimeUnitAgoFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - patternLeftBoundary() { - return constants_1.REGEX_PARTS.leftBoundary; - } - - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const timeUnits = constants_1.parseTimeUnits(match[1]); - const outputTimeUnits = timeunits_1.reverseTimeUnits(timeUnits); - return results_1.ParsingComponents.createRelativeFromReference(context.reference, outputTimeUnits); - } - -} - -exports["default"] = RUTimeUnitAgoFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ru/parsers/RUTimeUnitCasualRelativeFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/ru/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const timeunits_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/timeunits.js"); - -const PATTERN = new RegExp(`(эти|последние|прошлые|следующие|после|через|\\+|-)\\s*(${constants_1.TIME_UNITS_PATTERN})${constants_1.REGEX_PARTS.rightBoundary}`, constants_1.REGEX_PARTS.flags); - -class RUTimeUnitCasualRelativeFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - patternLeftBoundary() { - return constants_1.REGEX_PARTS.leftBoundary; - } - - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const prefix = match[1].toLowerCase(); - let timeUnits = constants_1.parseTimeUnits(match[2]); - - switch (prefix) { - case "последние": - case "прошлые": - case "-": - timeUnits = timeunits_1.reverseTimeUnits(timeUnits); - break; - } - - return results_1.ParsingComponents.createRelativeFromReference(context.reference, timeUnits); - } - -} - -exports["default"] = RUTimeUnitCasualRelativeFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ru/parsers/RUTimeUnitWithinFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/ru/constants.js"); - -const results_1 = __webpack_require__("./node_modules/chrono-node/dist/results.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const PATTERN = `(?:(?:около|примерно)\\s*(?:~\\s*)?)?(${constants_1.TIME_UNITS_PATTERN})${constants_1.REGEX_PARTS.rightBoundary}`; -const PATTERN_WITH_PREFIX = new RegExp(`(?:в течение|в течении)\\s*${PATTERN}`, constants_1.REGEX_PARTS.flags); -const PATTERN_WITHOUT_PREFIX = new RegExp(PATTERN, "i"); - -class RUTimeUnitWithinFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - patternLeftBoundary() { - return constants_1.REGEX_PARTS.leftBoundary; - } - - innerPattern(context) { - return context.option.forwardDate ? PATTERN_WITHOUT_PREFIX : PATTERN_WITH_PREFIX; - } - - innerExtract(context, match) { - const timeUnits = constants_1.parseTimeUnits(match[1]); - return results_1.ParsingComponents.createRelativeFromReference(context.reference, timeUnits); - } - -} - -exports["default"] = RUTimeUnitWithinFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ru/parsers/RUWeekdayParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/ru/constants.js"); - -const pattern_1 = __webpack_require__("./node_modules/chrono-node/dist/utils/pattern.js"); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const weekdays_1 = __webpack_require__("./node_modules/chrono-node/dist/common/calculation/weekdays.js"); - -const PATTERN = new RegExp(`(?:(?:,|\\(|()\\s*)?` + `(?:в\\s*?)?` + `(?:(эту|этот|прошлый|прошлую|следующий|следующую|следующего)\\s*)?` + `(${pattern_1.matchAnyPattern(constants_1.WEEKDAY_DICTIONARY)})` + `(?:\\s*(?:,|\\)|)))?` + `(?:\\s*на\\s*(этой|прошлой|следующей)\\s*неделе)?` + `${constants_1.REGEX_PARTS.rightBoundary}`, constants_1.REGEX_PARTS.flags); -const PREFIX_GROUP = 1; -const WEEKDAY_GROUP = 2; -const POSTFIX_GROUP = 3; - -class RUWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - patternLeftBoundary() { - return constants_1.REGEX_PARTS.leftBoundary; - } - - innerExtract(context, match) { - const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase(); - const weekday = constants_1.WEEKDAY_DICTIONARY[dayOfWeek]; - const prefix = match[PREFIX_GROUP]; - const postfix = match[POSTFIX_GROUP]; - let modifierWord = prefix || postfix; - modifierWord = modifierWord || ""; - modifierWord = modifierWord.toLowerCase(); - let modifier = null; - - if (modifierWord == "прошлый" || modifierWord == "прошлую" || modifierWord == "прошлой") { - modifier = "last"; - } else if (modifierWord == "следующий" || modifierWord == "следующую" || modifierWord == "следующей" || modifierWord == "следующего") { - modifier = "next"; - } else if (modifierWord == "этот" || modifierWord == "эту" || modifierWord == "этой") { - modifier = "this"; - } - - return weekdays_1.createParsingComponentsAtWeekday(context.reference, weekday, modifier); - } - -} - -exports["default"] = RUWeekdayParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ru/refiners/RUMergeDateRangeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js")); - -class RUMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default { - patternBetween() { - return /^\s*(и до|и по|до|по|-)\s*$/i; - } - -} - -exports["default"] = RUMergeDateRangeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/ru/refiners/RUMergeDateTimeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateTimeRefiner.js")); - -class RUMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default { - patternBetween() { - return new RegExp(`^\\s*(T|в|,|-)?\\s*$`); - } - -} - -exports["default"] = RUMergeDateTimeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hans/constants.js": -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.zhStringToYear = exports.zhStringToNumber = exports.WEEKDAY_OFFSET = exports.NUMBER = void 0; -exports.NUMBER = { - "零": 0, - "〇": 0, - "一": 1, - "二": 2, - "两": 2, - "三": 3, - "四": 4, - "五": 5, - "六": 6, - "七": 7, - "八": 8, - "九": 9, - "十": 10 -}; -exports.WEEKDAY_OFFSET = { - "天": 0, - "日": 0, - "一": 1, - "二": 2, - "三": 3, - "四": 4, - "五": 5, - "六": 6 -}; - -function zhStringToNumber(text) { - let number = 0; - - for (let i = 0; i < text.length; i++) { - const char = text[i]; - - if (char === "十") { - number = number === 0 ? exports.NUMBER[char] : number * exports.NUMBER[char]; - } else { - number += exports.NUMBER[char]; - } - } - - return number; -} - -exports.zhStringToNumber = zhStringToNumber; - -function zhStringToYear(text) { - let string = ""; - - for (let i = 0; i < text.length; i++) { - const char = text[i]; - string = string + exports.NUMBER[char]; - } - - return parseInt(string); -} - -exports.zhStringToYear = zhStringToYear; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hans/index.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = exports.hans = void 0; - -const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js"); - -const ExtractTimezoneOffsetRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/ExtractTimezoneOffsetRefiner.js")); - -const configurations_1 = __webpack_require__("./node_modules/chrono-node/dist/configurations.js"); - -const ZHHansCasualDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hans/parsers/ZHHansCasualDateParser.js")); - -const ZHHansDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hans/parsers/ZHHansDateParser.js")); - -const ZHHansDeadlineFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hans/parsers/ZHHansDeadlineFormatParser.js")); - -const ZHHansRelationWeekdayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hans/parsers/ZHHansRelationWeekdayParser.js")); - -const ZHHansTimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hans/parsers/ZHHansTimeExpressionParser.js")); - -const ZHHansWeekdayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hans/parsers/ZHHansWeekdayParser.js")); - -const ZHHansMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hans/refiners/ZHHansMergeDateRangeRefiner.js")); - -const ZHHansMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hans/refiners/ZHHansMergeDateTimeRefiner.js")); - -exports.hans = new chrono_1.Chrono(createCasualConfiguration()); -exports.casual = new chrono_1.Chrono(createCasualConfiguration()); -exports.strict = new chrono_1.Chrono(createConfiguration()); - -function parse(text, ref, option) { - return exports.casual.parse(text, ref, option); -} - -exports.parse = parse; - -function parseDate(text, ref, option) { - return exports.casual.parseDate(text, ref, option); -} - -exports.parseDate = parseDate; - -function createCasualConfiguration() { - const option = createConfiguration(); - option.parsers.unshift(new ZHHansCasualDateParser_1.default()); - return option; -} - -exports.createCasualConfiguration = createCasualConfiguration; - -function createConfiguration() { - const configuration = configurations_1.includeCommonConfiguration({ - parsers: [new ZHHansDateParser_1.default(), new ZHHansRelationWeekdayParser_1.default(), new ZHHansWeekdayParser_1.default(), new ZHHansTimeExpressionParser_1.default(), new ZHHansDeadlineFormatParser_1.default()], - refiners: [new ZHHansMergeDateRangeRefiner_1.default(), new ZHHansMergeDateTimeRefiner_1.default()] - }); - configuration.refiners = configuration.refiners.filter(refiner => !(refiner instanceof ExtractTimezoneOffsetRefiner_1.default)); - return configuration; -} - -exports.createConfiguration = createConfiguration; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hans/parsers/ZHHansCasualDateParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const NOW_GROUP = 1; -const DAY_GROUP_1 = 2; -const TIME_GROUP_1 = 3; -const TIME_GROUP_2 = 4; -const DAY_GROUP_3 = 5; -const TIME_GROUP_3 = 6; - -class ZHHansCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern(context) { - return new RegExp("(现在|立(?:刻|即)|即刻)|" + "(今|明|前|大前|后|大后|昨)(早|晚)|" + "(上(?:午)|早(?:上)|下(?:午)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|" + "(今|明|前|大前|后|大后|昨)(?:日|天)" + "(?:[\\s|,|,]*)" + "(?:(上(?:午)|早(?:上)|下(?:午)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?", "i"); - } - - innerExtract(context, match) { - const index = match.index; - const result = context.createParsingResult(index, match[0]); - const refMoment = dayjs_1.default(context.refDate); - let startMoment = refMoment; - - if (match[NOW_GROUP]) { - result.start.imply("hour", refMoment.hour()); - result.start.imply("minute", refMoment.minute()); - result.start.imply("second", refMoment.second()); - result.start.imply("millisecond", refMoment.millisecond()); - } else if (match[DAY_GROUP_1]) { - const day1 = match[DAY_GROUP_1]; - const time1 = match[TIME_GROUP_1]; - - if (day1 == "明") { - if (refMoment.hour() > 1) { - startMoment = startMoment.add(1, "day"); - } - } else if (day1 == "昨") { - startMoment = startMoment.add(-1, "day"); - } else if (day1 == "前") { - startMoment = startMoment.add(-2, "day"); - } else if (day1 == "大前") { - startMoment = startMoment.add(-3, "day"); - } else if (day1 == "后") { - startMoment = startMoment.add(2, "day"); - } else if (day1 == "大后") { - startMoment = startMoment.add(3, "day"); - } - - if (time1 == "早") { - result.start.imply("hour", 6); - } else if (time1 == "晚") { - result.start.imply("hour", 22); - result.start.imply("meridiem", 1); - } - } else if (match[TIME_GROUP_2]) { - const timeString2 = match[TIME_GROUP_2]; - const time2 = timeString2[0]; - - if (time2 == "早" || time2 == "上") { - result.start.imply("hour", 6); - } else if (time2 == "下") { - result.start.imply("hour", 15); - result.start.imply("meridiem", 1); - } else if (time2 == "中") { - result.start.imply("hour", 12); - result.start.imply("meridiem", 1); - } else if (time2 == "夜" || time2 == "晚") { - result.start.imply("hour", 22); - result.start.imply("meridiem", 1); - } else if (time2 == "凌") { - result.start.imply("hour", 0); - } - } else if (match[DAY_GROUP_3]) { - const day3 = match[DAY_GROUP_3]; - - if (day3 == "明") { - if (refMoment.hour() > 1) { - startMoment = startMoment.add(1, "day"); - } - } else if (day3 == "昨") { - startMoment = startMoment.add(-1, "day"); - } else if (day3 == "前") { - startMoment = startMoment.add(-2, "day"); - } else if (day3 == "大前") { - startMoment = startMoment.add(-3, "day"); - } else if (day3 == "后") { - startMoment = startMoment.add(2, "day"); - } else if (day3 == "大后") { - startMoment = startMoment.add(3, "day"); - } - - const timeString3 = match[TIME_GROUP_3]; - - if (timeString3) { - const time3 = timeString3[0]; - - if (time3 == "早" || time3 == "上") { - result.start.imply("hour", 6); - } else if (time3 == "下") { - result.start.imply("hour", 15); - result.start.imply("meridiem", 1); - } else if (time3 == "中") { - result.start.imply("hour", 12); - result.start.imply("meridiem", 1); - } else if (time3 == "夜" || time3 == "晚") { - result.start.imply("hour", 22); - result.start.imply("meridiem", 1); - } else if (time3 == "凌") { - result.start.imply("hour", 0); - } - } - } - - result.start.assign("day", startMoment.date()); - result.start.assign("month", startMoment.month() + 1); - result.start.assign("year", startMoment.year()); - return result; - } - -} - -exports["default"] = ZHHansCasualDateParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hans/parsers/ZHHansDateParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/zh/hans/constants.js"); - -const YEAR_GROUP = 1; -const MONTH_GROUP = 2; -const DAY_GROUP = 3; - -class ZHHansDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return new RegExp("(" + "\\d{2,4}|" + "[" + Object.keys(constants_1.NUMBER).join("") + "]{4}|" + "[" + Object.keys(constants_1.NUMBER).join("") + "]{2}" + ")?" + "(?:\\s*)" + "(?:年)?" + "(?:[\\s|,|,]*)" + "(" + "\\d{1,2}|" + "[" + Object.keys(constants_1.NUMBER).join("") + "]{1,3}" + ")" + "(?:\\s*)" + "(?:月)" + "(?:\\s*)" + "(" + "\\d{1,2}|" + "[" + Object.keys(constants_1.NUMBER).join("") + "]{1,3}" + ")?" + "(?:\\s*)" + "(?:日|号)?"); - } - - innerExtract(context, match) { - const startMoment = dayjs_1.default(context.refDate); - const result = context.createParsingResult(match.index, match[0]); - let month = parseInt(match[MONTH_GROUP]); - if (isNaN(month)) month = constants_1.zhStringToNumber(match[MONTH_GROUP]); - result.start.assign("month", month); - - if (match[DAY_GROUP]) { - let day = parseInt(match[DAY_GROUP]); - if (isNaN(day)) day = constants_1.zhStringToNumber(match[DAY_GROUP]); - result.start.assign("day", day); - } else { - result.start.imply("day", startMoment.date()); - } - - if (match[YEAR_GROUP]) { - let year = parseInt(match[YEAR_GROUP]); - if (isNaN(year)) year = constants_1.zhStringToYear(match[YEAR_GROUP]); - result.start.assign("year", year); - } else { - result.start.imply("year", startMoment.year()); - } - - return result; - } - -} - -exports["default"] = ZHHansDateParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hans/parsers/ZHHansDeadlineFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/zh/hans/constants.js"); - -const PATTERN = new RegExp("(\\d+|[" + Object.keys(constants_1.NUMBER).join("") + "]+|半|几)(?:\\s*)" + "(?:个)?" + "(秒(?:钟)?|分钟|小时|钟|日|天|星期|礼拜|月|年)" + "(?:(?:之|过)?后|(?:之)?内)", "i"); -const NUMBER_GROUP = 1; -const UNIT_GROUP = 2; - -class ZHHansDeadlineFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const result = context.createParsingResult(match.index, match[0]); - let number = parseInt(match[NUMBER_GROUP]); - - if (isNaN(number)) { - number = constants_1.zhStringToNumber(match[NUMBER_GROUP]); - } - - if (isNaN(number)) { - const string = match[NUMBER_GROUP]; - - if (string === "几") { - number = 3; - } else if (string === "半") { - number = 0.5; - } else { - return null; - } - } - - let date = dayjs_1.default(context.refDate); - const unit = match[UNIT_GROUP]; - const unitAbbr = unit[0]; - - if (unitAbbr.match(/[日天星礼月年]/)) { - if (unitAbbr == "日" || unitAbbr == "天") { - date = date.add(number, "d"); - } else if (unitAbbr == "星" || unitAbbr == "礼") { - date = date.add(number * 7, "d"); - } else if (unitAbbr == "月") { - date = date.add(number, "month"); - } else if (unitAbbr == "年") { - date = date.add(number, "year"); - } - - result.start.assign("year", date.year()); - result.start.assign("month", date.month() + 1); - result.start.assign("day", date.date()); - return result; - } - - if (unitAbbr == "秒") { - date = date.add(number, "second"); - } else if (unitAbbr == "分") { - date = date.add(number, "minute"); - } else if (unitAbbr == "小" || unitAbbr == "钟") { - date = date.add(number, "hour"); - } - - result.start.imply("year", date.year()); - result.start.imply("month", date.month() + 1); - result.start.imply("day", date.date()); - result.start.assign("hour", date.hour()); - result.start.assign("minute", date.minute()); - result.start.assign("second", date.second()); - return result; - } - -} - -exports["default"] = ZHHansDeadlineFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hans/parsers/ZHHansRelationWeekdayParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/zh/hans/constants.js"); - -const PATTERN = new RegExp("(?上|下|这)(?:个)?(?:星期|礼拜|周)(?" + Object.keys(constants_1.WEEKDAY_OFFSET).join("|") + ")"); - -class ZHHansRelationWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const result = context.createParsingResult(match.index, match[0]); - const dayOfWeek = match.groups.weekday; - const offset = constants_1.WEEKDAY_OFFSET[dayOfWeek]; - if (offset === undefined) return null; - let modifier = null; - const prefix = match.groups.prefix; - - if (prefix == "上") { - modifier = "last"; - } else if (prefix == "下") { - modifier = "next"; - } else if (prefix == "这") { - modifier = "this"; - } - - let startMoment = dayjs_1.default(context.refDate); - let startMomentFixed = false; - const refOffset = startMoment.day(); - - if (modifier == "last" || modifier == "past") { - startMoment = startMoment.day(offset - 7); - startMomentFixed = true; - } else if (modifier == "next") { - startMoment = startMoment.day(offset + 7); - startMomentFixed = true; - } else if (modifier == "this") { - startMoment = startMoment.day(offset); - } else { - if (Math.abs(offset - 7 - refOffset) < Math.abs(offset - refOffset)) { - startMoment = startMoment.day(offset - 7); - } else if (Math.abs(offset + 7 - refOffset) < Math.abs(offset - refOffset)) { - startMoment = startMoment.day(offset + 7); - } else { - startMoment = startMoment.day(offset); - } - } - - result.start.assign("weekday", offset); - - if (startMomentFixed) { - result.start.assign("day", startMoment.date()); - result.start.assign("month", startMoment.month() + 1); - result.start.assign("year", startMoment.year()); - } else { - result.start.imply("day", startMoment.date()); - result.start.imply("month", startMoment.month() + 1); - result.start.imply("year", startMoment.year()); - } - - return result; - } - -} - -exports["default"] = ZHHansRelationWeekdayParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hans/parsers/ZHHansTimeExpressionParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/zh/hans/constants.js"); - -const FIRST_REG_PATTERN = new RegExp("(?:从|自)?" + "(?:" + "(今|明|前|大前|后|大后|昨)(早|朝|晚)|" + "(上(?:午)|早(?:上)|下(?:午)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|" + "(今|明|前|大前|后|大后|昨)(?:日|天)" + "(?:[\\s,,]*)" + "(?:(上(?:午)|早(?:上)|下(?:午)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?" + ")?" + "(?:[\\s,,]*)" + "(?:(\\d+|[" + Object.keys(constants_1.NUMBER).join("") + "]+)(?:\\s*)(?:点|时|:|:)" + "(?:\\s*)" + "(\\d+|半|正|整|[" + Object.keys(constants_1.NUMBER).join("") + "]+)?(?:\\s*)(?:分|:|:)?" + "(?:\\s*)" + "(\\d+|[" + Object.keys(constants_1.NUMBER).join("") + "]+)?(?:\\s*)(?:秒)?)" + "(?:\\s*(A.M.|P.M.|AM?|PM?))?", "i"); -const SECOND_REG_PATTERN = new RegExp("(?:^\\s*(?:到|至|\\-|\\–|\\~|\\〜)\\s*)" + "(?:" + "(今|明|前|大前|后|大后|昨)(早|朝|晚)|" + "(上(?:午)|早(?:上)|下(?:午)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|" + "(今|明|前|大前|后|大后|昨)(?:日|天)" + "(?:[\\s,,]*)" + "(?:(上(?:午)|早(?:上)|下(?:午)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?" + ")?" + "(?:[\\s,,]*)" + "(?:(\\d+|[" + Object.keys(constants_1.NUMBER).join("") + "]+)(?:\\s*)(?:点|时|:|:)" + "(?:\\s*)" + "(\\d+|半|正|整|[" + Object.keys(constants_1.NUMBER).join("") + "]+)?(?:\\s*)(?:分|:|:)?" + "(?:\\s*)" + "(\\d+|[" + Object.keys(constants_1.NUMBER).join("") + "]+)?(?:\\s*)(?:秒)?)" + "(?:\\s*(A.M.|P.M.|AM?|PM?))?", "i"); -const DAY_GROUP_1 = 1; -const ZH_AM_PM_HOUR_GROUP_1 = 2; -const ZH_AM_PM_HOUR_GROUP_2 = 3; -const DAY_GROUP_3 = 4; -const ZH_AM_PM_HOUR_GROUP_3 = 5; -const HOUR_GROUP = 6; -const MINUTE_GROUP = 7; -const SECOND_GROUP = 8; -const AM_PM_HOUR_GROUP = 9; - -class ZHHansTimeExpressionParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return FIRST_REG_PATTERN; - } - - innerExtract(context, match) { - if (match.index > 0 && context.text[match.index - 1].match(/\w/)) { - return null; - } - - const refMoment = dayjs_1.default(context.refDate); - const result = context.createParsingResult(match.index, match[0]); - const startMoment = refMoment.clone(); - - if (match[DAY_GROUP_1]) { - const day1 = match[DAY_GROUP_1]; - - if (day1 == "明") { - if (refMoment.hour() > 1) { - startMoment.add(1, "day"); - } - } else if (day1 == "昨") { - startMoment.add(-1, "day"); - } else if (day1 == "前") { - startMoment.add(-2, "day"); - } else if (day1 == "大前") { - startMoment.add(-3, "day"); - } else if (day1 == "后") { - startMoment.add(2, "day"); - } else if (day1 == "大后") { - startMoment.add(3, "day"); - } - - result.start.assign("day", startMoment.date()); - result.start.assign("month", startMoment.month() + 1); - result.start.assign("year", startMoment.year()); - } else if (match[DAY_GROUP_3]) { - const day3 = match[DAY_GROUP_3]; - - if (day3 == "明") { - startMoment.add(1, "day"); - } else if (day3 == "昨") { - startMoment.add(-1, "day"); - } else if (day3 == "前") { - startMoment.add(-2, "day"); - } else if (day3 == "大前") { - startMoment.add(-3, "day"); - } else if (day3 == "后") { - startMoment.add(2, "day"); - } else if (day3 == "大后") { - startMoment.add(3, "day"); - } - - result.start.assign("day", startMoment.date()); - result.start.assign("month", startMoment.month() + 1); - result.start.assign("year", startMoment.year()); - } else { - result.start.imply("day", startMoment.date()); - result.start.imply("month", startMoment.month() + 1); - result.start.imply("year", startMoment.year()); - } - - let hour = 0; - let minute = 0; - let meridiem = -1; - - if (match[SECOND_GROUP]) { - let second = parseInt(match[SECOND_GROUP]); - - if (isNaN(second)) { - second = constants_1.zhStringToNumber(match[SECOND_GROUP]); - } - - if (second >= 60) return null; - result.start.assign("second", second); - } - - hour = parseInt(match[HOUR_GROUP]); - - if (isNaN(hour)) { - hour = constants_1.zhStringToNumber(match[HOUR_GROUP]); - } - - if (match[MINUTE_GROUP]) { - if (match[MINUTE_GROUP] == "半") { - minute = 30; - } else if (match[MINUTE_GROUP] == "正" || match[MINUTE_GROUP] == "整") { - minute = 0; - } else { - minute = parseInt(match[MINUTE_GROUP]); - - if (isNaN(minute)) { - minute = constants_1.zhStringToNumber(match[MINUTE_GROUP]); - } - } - } else if (hour > 100) { - minute = hour % 100; - hour = Math.floor(hour / 100); - } - - if (minute >= 60) { - return null; - } - - if (hour > 24) { - return null; - } - - if (hour >= 12) { - meridiem = 1; - } - - if (match[AM_PM_HOUR_GROUP]) { - if (hour > 12) return null; - const ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase(); - - if (ampm == "a") { - meridiem = 0; - if (hour == 12) hour = 0; - } - - if (ampm == "p") { - meridiem = 1; - if (hour != 12) hour += 12; - } - } else if (match[ZH_AM_PM_HOUR_GROUP_1]) { - const zhAMPMString1 = match[ZH_AM_PM_HOUR_GROUP_1]; - const zhAMPM1 = zhAMPMString1[0]; - - if (zhAMPM1 == "早") { - meridiem = 0; - if (hour == 12) hour = 0; - } else if (zhAMPM1 == "晚") { - meridiem = 1; - if (hour != 12) hour += 12; - } - } else if (match[ZH_AM_PM_HOUR_GROUP_2]) { - const zhAMPMString2 = match[ZH_AM_PM_HOUR_GROUP_2]; - const zhAMPM2 = zhAMPMString2[0]; - - if (zhAMPM2 == "上" || zhAMPM2 == "早" || zhAMPM2 == "凌") { - meridiem = 0; - if (hour == 12) hour = 0; - } else if (zhAMPM2 == "下" || zhAMPM2 == "晚") { - meridiem = 1; - if (hour != 12) hour += 12; - } - } else if (match[ZH_AM_PM_HOUR_GROUP_3]) { - const zhAMPMString3 = match[ZH_AM_PM_HOUR_GROUP_3]; - const zhAMPM3 = zhAMPMString3[0]; - - if (zhAMPM3 == "上" || zhAMPM3 == "早" || zhAMPM3 == "凌") { - meridiem = 0; - if (hour == 12) hour = 0; - } else if (zhAMPM3 == "下" || zhAMPM3 == "晚") { - meridiem = 1; - if (hour != 12) hour += 12; - } - } - - result.start.assign("hour", hour); - result.start.assign("minute", minute); - - if (meridiem >= 0) { - result.start.assign("meridiem", meridiem); - } else { - if (hour < 12) { - result.start.imply("meridiem", 0); - } else { - result.start.imply("meridiem", 1); - } - } - - match = SECOND_REG_PATTERN.exec(context.text.substring(result.index + result.text.length)); - - if (!match) { - if (result.text.match(/^\d+$/)) { - return null; - } - - return result; - } - - const endMoment = startMoment.clone(); - result.end = context.createParsingComponents(); - - if (match[DAY_GROUP_1]) { - const day1 = match[DAY_GROUP_1]; - - if (day1 == "明") { - if (refMoment.hour() > 1) { - endMoment.add(1, "day"); - } - } else if (day1 == "昨") { - endMoment.add(-1, "day"); - } else if (day1 == "前") { - endMoment.add(-2, "day"); - } else if (day1 == "大前") { - endMoment.add(-3, "day"); - } else if (day1 == "后") { - endMoment.add(2, "day"); - } else if (day1 == "大后") { - endMoment.add(3, "day"); - } - - result.end.assign("day", endMoment.date()); - result.end.assign("month", endMoment.month() + 1); - result.end.assign("year", endMoment.year()); - } else if (match[DAY_GROUP_3]) { - const day3 = match[DAY_GROUP_3]; - - if (day3 == "明") { - endMoment.add(1, "day"); - } else if (day3 == "昨") { - endMoment.add(-1, "day"); - } else if (day3 == "前") { - endMoment.add(-2, "day"); - } else if (day3 == "大前") { - endMoment.add(-3, "day"); - } else if (day3 == "后") { - endMoment.add(2, "day"); - } else if (day3 == "大后") { - endMoment.add(3, "day"); - } - - result.end.assign("day", endMoment.date()); - result.end.assign("month", endMoment.month() + 1); - result.end.assign("year", endMoment.year()); - } else { - result.end.imply("day", endMoment.date()); - result.end.imply("month", endMoment.month() + 1); - result.end.imply("year", endMoment.year()); - } - - hour = 0; - minute = 0; - meridiem = -1; - - if (match[SECOND_GROUP]) { - let second = parseInt(match[SECOND_GROUP]); - - if (isNaN(second)) { - second = constants_1.zhStringToNumber(match[SECOND_GROUP]); - } - - if (second >= 60) return null; - result.end.assign("second", second); - } - - hour = parseInt(match[HOUR_GROUP]); - - if (isNaN(hour)) { - hour = constants_1.zhStringToNumber(match[HOUR_GROUP]); - } - - if (match[MINUTE_GROUP]) { - if (match[MINUTE_GROUP] == "半") { - minute = 30; - } else if (match[MINUTE_GROUP] == "正" || match[MINUTE_GROUP] == "整") { - minute = 0; - } else { - minute = parseInt(match[MINUTE_GROUP]); - - if (isNaN(minute)) { - minute = constants_1.zhStringToNumber(match[MINUTE_GROUP]); - } - } - } else if (hour > 100) { - minute = hour % 100; - hour = Math.floor(hour / 100); - } - - if (minute >= 60) { - return null; - } - - if (hour > 24) { - return null; - } - - if (hour >= 12) { - meridiem = 1; - } - - if (match[AM_PM_HOUR_GROUP]) { - if (hour > 12) return null; - const ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase(); - - if (ampm == "a") { - meridiem = 0; - if (hour == 12) hour = 0; - } - - if (ampm == "p") { - meridiem = 1; - if (hour != 12) hour += 12; - } - - if (!result.start.isCertain("meridiem")) { - if (meridiem == 0) { - result.start.imply("meridiem", 0); - - if (result.start.get("hour") == 12) { - result.start.assign("hour", 0); - } - } else { - result.start.imply("meridiem", 1); - - if (result.start.get("hour") != 12) { - result.start.assign("hour", result.start.get("hour") + 12); - } - } - } - } else if (match[ZH_AM_PM_HOUR_GROUP_1]) { - const zhAMPMString1 = match[ZH_AM_PM_HOUR_GROUP_1]; - const zhAMPM1 = zhAMPMString1[0]; - - if (zhAMPM1 == "早") { - meridiem = 0; - if (hour == 12) hour = 0; - } else if (zhAMPM1 == "晚") { - meridiem = 1; - if (hour != 12) hour += 12; - } - } else if (match[ZH_AM_PM_HOUR_GROUP_2]) { - const zhAMPMString2 = match[ZH_AM_PM_HOUR_GROUP_2]; - const zhAMPM2 = zhAMPMString2[0]; - - if (zhAMPM2 == "上" || zhAMPM2 == "早" || zhAMPM2 == "凌") { - meridiem = 0; - if (hour == 12) hour = 0; - } else if (zhAMPM2 == "下" || zhAMPM2 == "晚") { - meridiem = 1; - if (hour != 12) hour += 12; - } - } else if (match[ZH_AM_PM_HOUR_GROUP_3]) { - const zhAMPMString3 = match[ZH_AM_PM_HOUR_GROUP_3]; - const zhAMPM3 = zhAMPMString3[0]; - - if (zhAMPM3 == "上" || zhAMPM3 == "早" || zhAMPM3 == "凌") { - meridiem = 0; - if (hour == 12) hour = 0; - } else if (zhAMPM3 == "下" || zhAMPM3 == "晚") { - meridiem = 1; - if (hour != 12) hour += 12; - } - } - - result.text = result.text + match[0]; - result.end.assign("hour", hour); - result.end.assign("minute", minute); - - if (meridiem >= 0) { - result.end.assign("meridiem", meridiem); - } else { - const startAtPM = result.start.isCertain("meridiem") && result.start.get("meridiem") == 1; - - if (startAtPM && result.start.get("hour") > hour) { - result.end.imply("meridiem", 0); - } else if (hour > 12) { - result.end.imply("meridiem", 1); - } - } - - if (result.end.date().getTime() < result.start.date().getTime()) { - result.end.imply("day", result.end.get("day") + 1); - } - - return result; - } - -} - -exports["default"] = ZHHansTimeExpressionParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hans/parsers/ZHHansWeekdayParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/zh/hans/constants.js"); - -const PATTERN = new RegExp("(?:星期|礼拜|周)(?" + Object.keys(constants_1.WEEKDAY_OFFSET).join("|") + ")"); - -class ZHHansWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const result = context.createParsingResult(match.index, match[0]); - const dayOfWeek = match.groups.weekday; - const offset = constants_1.WEEKDAY_OFFSET[dayOfWeek]; - if (offset === undefined) return null; - let startMoment = dayjs_1.default(context.refDate); - const startMomentFixed = false; - const refOffset = startMoment.day(); - - if (Math.abs(offset - 7 - refOffset) < Math.abs(offset - refOffset)) { - startMoment = startMoment.day(offset - 7); - } else if (Math.abs(offset + 7 - refOffset) < Math.abs(offset - refOffset)) { - startMoment = startMoment.day(offset + 7); - } else { - startMoment = startMoment.day(offset); - } - - result.start.assign("weekday", offset); - - if (startMomentFixed) { - result.start.assign("day", startMoment.date()); - result.start.assign("month", startMoment.month() + 1); - result.start.assign("year", startMoment.year()); - } else { - result.start.imply("day", startMoment.date()); - result.start.imply("month", startMoment.month() + 1); - result.start.imply("year", startMoment.year()); - } - - return result; - } - -} - -exports["default"] = ZHHansWeekdayParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hans/refiners/ZHHansMergeDateRangeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js")); - -class ZHHansMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default { - patternBetween() { - return /^\s*(至|到|-|~|~|-|ー)\s*$/i; - } - -} - -exports["default"] = ZHHansMergeDateRangeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hans/refiners/ZHHansMergeDateTimeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateTimeRefiner.js")); - -class ZHHansMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default { - patternBetween() { - return /^\s*$/i; - } - -} - -exports["default"] = ZHHansMergeDateTimeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hant/constants.js": -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.zhStringToYear = exports.zhStringToNumber = exports.WEEKDAY_OFFSET = exports.NUMBER = void 0; -exports.NUMBER = { - "零": 0, - "一": 1, - "二": 2, - "兩": 2, - "三": 3, - "四": 4, - "五": 5, - "六": 6, - "七": 7, - "八": 8, - "九": 9, - "十": 10, - "廿": 20, - "卅": 30 -}; -exports.WEEKDAY_OFFSET = { - "天": 0, - "日": 0, - "一": 1, - "二": 2, - "三": 3, - "四": 4, - "五": 5, - "六": 6 -}; - -function zhStringToNumber(text) { - let number = 0; - - for (let i = 0; i < text.length; i++) { - const char = text[i]; - - if (char === "十") { - number = number === 0 ? exports.NUMBER[char] : number * exports.NUMBER[char]; - } else { - number += exports.NUMBER[char]; - } - } - - return number; -} - -exports.zhStringToNumber = zhStringToNumber; - -function zhStringToYear(text) { - let string = ""; - - for (let i = 0; i < text.length; i++) { - const char = text[i]; - string = string + exports.NUMBER[char]; - } - - return parseInt(string); -} - -exports.zhStringToYear = zhStringToYear; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hant/index.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.createConfiguration = exports.createCasualConfiguration = exports.parseDate = exports.parse = exports.strict = exports.casual = exports.hant = void 0; - -const chrono_1 = __webpack_require__("./node_modules/chrono-node/dist/chrono.js"); - -const ExtractTimezoneOffsetRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/ExtractTimezoneOffsetRefiner.js")); - -const configurations_1 = __webpack_require__("./node_modules/chrono-node/dist/configurations.js"); - -const ZHHantCasualDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hant/parsers/ZHHantCasualDateParser.js")); - -const ZHHantDateParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hant/parsers/ZHHantDateParser.js")); - -const ZHHantDeadlineFormatParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hant/parsers/ZHHantDeadlineFormatParser.js")); - -const ZHHantRelationWeekdayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hant/parsers/ZHHantRelationWeekdayParser.js")); - -const ZHHantTimeExpressionParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hant/parsers/ZHHantTimeExpressionParser.js")); - -const ZHHantWeekdayParser_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hant/parsers/ZHHantWeekdayParser.js")); - -const ZHHantMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hant/refiners/ZHHantMergeDateRangeRefiner.js")); - -const ZHHantMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hant/refiners/ZHHantMergeDateTimeRefiner.js")); - -exports.hant = new chrono_1.Chrono(createCasualConfiguration()); -exports.casual = new chrono_1.Chrono(createCasualConfiguration()); -exports.strict = new chrono_1.Chrono(createConfiguration()); - -function parse(text, ref, option) { - return exports.casual.parse(text, ref, option); -} - -exports.parse = parse; - -function parseDate(text, ref, option) { - return exports.casual.parseDate(text, ref, option); -} - -exports.parseDate = parseDate; - -function createCasualConfiguration() { - const option = createConfiguration(); - option.parsers.unshift(new ZHHantCasualDateParser_1.default()); - return option; -} - -exports.createCasualConfiguration = createCasualConfiguration; - -function createConfiguration() { - const configuration = configurations_1.includeCommonConfiguration({ - parsers: [new ZHHantDateParser_1.default(), new ZHHantRelationWeekdayParser_1.default(), new ZHHantWeekdayParser_1.default(), new ZHHantTimeExpressionParser_1.default(), new ZHHantDeadlineFormatParser_1.default()], - refiners: [new ZHHantMergeDateRangeRefiner_1.default(), new ZHHantMergeDateTimeRefiner_1.default()] - }); - configuration.refiners = configuration.refiners.filter(refiner => !(refiner instanceof ExtractTimezoneOffsetRefiner_1.default)); - return configuration; -} - -exports.createConfiguration = createConfiguration; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hant/parsers/ZHHantCasualDateParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const NOW_GROUP = 1; -const DAY_GROUP_1 = 2; -const TIME_GROUP_1 = 3; -const TIME_GROUP_2 = 4; -const DAY_GROUP_3 = 5; -const TIME_GROUP_3 = 6; - -class ZHHantCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern(context) { - return new RegExp("(而家|立(?:刻|即)|即刻)|" + "(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|" + "(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|" + "(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)" + "(?:[\\s|,|,]*)" + "(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?", "i"); - } - - innerExtract(context, match) { - const index = match.index; - const result = context.createParsingResult(index, match[0]); - const refMoment = dayjs_1.default(context.refDate); - let startMoment = refMoment; - - if (match[NOW_GROUP]) { - result.start.imply("hour", refMoment.hour()); - result.start.imply("minute", refMoment.minute()); - result.start.imply("second", refMoment.second()); - result.start.imply("millisecond", refMoment.millisecond()); - } else if (match[DAY_GROUP_1]) { - const day1 = match[DAY_GROUP_1]; - const time1 = match[TIME_GROUP_1]; - - if (day1 == "明" || day1 == "聽") { - if (refMoment.hour() > 1) { - startMoment = startMoment.add(1, "day"); - } - } else if (day1 == "昨" || day1 == "尋" || day1 == "琴") { - startMoment = startMoment.add(-1, "day"); - } else if (day1 == "前") { - startMoment = startMoment.add(-2, "day"); - } else if (day1 == "大前") { - startMoment = startMoment.add(-3, "day"); - } else if (day1 == "後") { - startMoment = startMoment.add(2, "day"); - } else if (day1 == "大後") { - startMoment = startMoment.add(3, "day"); - } - - if (time1 == "早" || time1 == "朝") { - result.start.imply("hour", 6); - } else if (time1 == "晚") { - result.start.imply("hour", 22); - result.start.imply("meridiem", 1); - } - } else if (match[TIME_GROUP_2]) { - const timeString2 = match[TIME_GROUP_2]; - const time2 = timeString2[0]; - - if (time2 == "早" || time2 == "朝" || time2 == "上") { - result.start.imply("hour", 6); - } else if (time2 == "下" || time2 == "晏") { - result.start.imply("hour", 15); - result.start.imply("meridiem", 1); - } else if (time2 == "中") { - result.start.imply("hour", 12); - result.start.imply("meridiem", 1); - } else if (time2 == "夜" || time2 == "晚") { - result.start.imply("hour", 22); - result.start.imply("meridiem", 1); - } else if (time2 == "凌") { - result.start.imply("hour", 0); - } - } else if (match[DAY_GROUP_3]) { - const day3 = match[DAY_GROUP_3]; - - if (day3 == "明" || day3 == "聽") { - if (refMoment.hour() > 1) { - startMoment = startMoment.add(1, "day"); - } - } else if (day3 == "昨" || day3 == "尋" || day3 == "琴") { - startMoment = startMoment.add(-1, "day"); - } else if (day3 == "前") { - startMoment = startMoment.add(-2, "day"); - } else if (day3 == "大前") { - startMoment = startMoment.add(-3, "day"); - } else if (day3 == "後") { - startMoment = startMoment.add(2, "day"); - } else if (day3 == "大後") { - startMoment = startMoment.add(3, "day"); - } - - const timeString3 = match[TIME_GROUP_3]; - - if (timeString3) { - const time3 = timeString3[0]; - - if (time3 == "早" || time3 == "朝" || time3 == "上") { - result.start.imply("hour", 6); - } else if (time3 == "下" || time3 == "晏") { - result.start.imply("hour", 15); - result.start.imply("meridiem", 1); - } else if (time3 == "中") { - result.start.imply("hour", 12); - result.start.imply("meridiem", 1); - } else if (time3 == "夜" || time3 == "晚") { - result.start.imply("hour", 22); - result.start.imply("meridiem", 1); - } else if (time3 == "凌") { - result.start.imply("hour", 0); - } - } - } - - result.start.assign("day", startMoment.date()); - result.start.assign("month", startMoment.month() + 1); - result.start.assign("year", startMoment.year()); - return result; - } - -} - -exports["default"] = ZHHantCasualDateParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hant/parsers/ZHHantDateParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/zh/hant/constants.js"); - -const YEAR_GROUP = 1; -const MONTH_GROUP = 2; -const DAY_GROUP = 3; - -class ZHHantDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return new RegExp("(" + "\\d{2,4}|" + "[" + Object.keys(constants_1.NUMBER).join("") + "]{4}|" + "[" + Object.keys(constants_1.NUMBER).join("") + "]{2}" + ")?" + "(?:\\s*)" + "(?:年)?" + "(?:[\\s|,|,]*)" + "(" + "\\d{1,2}|" + "[" + Object.keys(constants_1.NUMBER).join("") + "]{1,2}" + ")" + "(?:\\s*)" + "(?:月)" + "(?:\\s*)" + "(" + "\\d{1,2}|" + "[" + Object.keys(constants_1.NUMBER).join("") + "]{1,2}" + ")?" + "(?:\\s*)" + "(?:日|號)?"); - } - - innerExtract(context, match) { - const startMoment = dayjs_1.default(context.refDate); - const result = context.createParsingResult(match.index, match[0]); - let month = parseInt(match[MONTH_GROUP]); - if (isNaN(month)) month = constants_1.zhStringToNumber(match[MONTH_GROUP]); - result.start.assign("month", month); - - if (match[DAY_GROUP]) { - let day = parseInt(match[DAY_GROUP]); - if (isNaN(day)) day = constants_1.zhStringToNumber(match[DAY_GROUP]); - result.start.assign("day", day); - } else { - result.start.imply("day", startMoment.date()); - } - - if (match[YEAR_GROUP]) { - let year = parseInt(match[YEAR_GROUP]); - if (isNaN(year)) year = constants_1.zhStringToYear(match[YEAR_GROUP]); - result.start.assign("year", year); - } else { - result.start.imply("year", startMoment.year()); - } - - return result; - } - -} - -exports["default"] = ZHHantDateParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hant/parsers/ZHHantDeadlineFormatParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/zh/hant/constants.js"); - -const PATTERN = new RegExp("(\\d+|[" + Object.keys(constants_1.NUMBER).join("") + "]+|半|幾)(?:\\s*)" + "(?:個)?" + "(秒(?:鐘)?|分鐘|小時|鐘|日|天|星期|禮拜|月|年)" + "(?:(?:之|過)?後|(?:之)?內)", "i"); -const NUMBER_GROUP = 1; -const UNIT_GROUP = 2; - -class ZHHantDeadlineFormatParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const result = context.createParsingResult(match.index, match[0]); - let number = parseInt(match[NUMBER_GROUP]); - - if (isNaN(number)) { - number = constants_1.zhStringToNumber(match[NUMBER_GROUP]); - } - - if (isNaN(number)) { - const string = match[NUMBER_GROUP]; - - if (string === "幾") { - number = 3; - } else if (string === "半") { - number = 0.5; - } else { - return null; - } - } - - let date = dayjs_1.default(context.refDate); - const unit = match[UNIT_GROUP]; - const unitAbbr = unit[0]; - - if (unitAbbr.match(/[日天星禮月年]/)) { - if (unitAbbr == "日" || unitAbbr == "天") { - date = date.add(number, "d"); - } else if (unitAbbr == "星" || unitAbbr == "禮") { - date = date.add(number * 7, "d"); - } else if (unitAbbr == "月") { - date = date.add(number, "month"); - } else if (unitAbbr == "年") { - date = date.add(number, "year"); - } - - result.start.assign("year", date.year()); - result.start.assign("month", date.month() + 1); - result.start.assign("day", date.date()); - return result; - } - - if (unitAbbr == "秒") { - date = date.add(number, "second"); - } else if (unitAbbr == "分") { - date = date.add(number, "minute"); - } else if (unitAbbr == "小" || unitAbbr == "鐘") { - date = date.add(number, "hour"); - } - - result.start.imply("year", date.year()); - result.start.imply("month", date.month() + 1); - result.start.imply("day", date.date()); - result.start.assign("hour", date.hour()); - result.start.assign("minute", date.minute()); - result.start.assign("second", date.second()); - return result; - } - -} - -exports["default"] = ZHHantDeadlineFormatParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hant/parsers/ZHHantRelationWeekdayParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/zh/hant/constants.js"); - -const PATTERN = new RegExp("(?上|今|下|這|呢)(?:個)?(?:星期|禮拜|週)(?" + Object.keys(constants_1.WEEKDAY_OFFSET).join("|") + ")"); - -class ZHHantRelationWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const result = context.createParsingResult(match.index, match[0]); - const dayOfWeek = match.groups.weekday; - const offset = constants_1.WEEKDAY_OFFSET[dayOfWeek]; - if (offset === undefined) return null; - let modifier = null; - const prefix = match.groups.prefix; - - if (prefix == "上") { - modifier = "last"; - } else if (prefix == "下") { - modifier = "next"; - } else if (prefix == "今" || prefix == "這" || prefix == "呢") { - modifier = "this"; - } - - let startMoment = dayjs_1.default(context.refDate); - let startMomentFixed = false; - const refOffset = startMoment.day(); - - if (modifier == "last" || modifier == "past") { - startMoment = startMoment.day(offset - 7); - startMomentFixed = true; - } else if (modifier == "next") { - startMoment = startMoment.day(offset + 7); - startMomentFixed = true; - } else if (modifier == "this") { - startMoment = startMoment.day(offset); - } else { - if (Math.abs(offset - 7 - refOffset) < Math.abs(offset - refOffset)) { - startMoment = startMoment.day(offset - 7); - } else if (Math.abs(offset + 7 - refOffset) < Math.abs(offset - refOffset)) { - startMoment = startMoment.day(offset + 7); - } else { - startMoment = startMoment.day(offset); - } - } - - result.start.assign("weekday", offset); - - if (startMomentFixed) { - result.start.assign("day", startMoment.date()); - result.start.assign("month", startMoment.month() + 1); - result.start.assign("year", startMoment.year()); - } else { - result.start.imply("day", startMoment.date()); - result.start.imply("month", startMoment.month() + 1); - result.start.imply("year", startMoment.year()); - } - - return result; - } - -} - -exports["default"] = ZHHantRelationWeekdayParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hant/parsers/ZHHantTimeExpressionParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/zh/hant/constants.js"); - -const FIRST_REG_PATTERN = new RegExp("(?:由|從|自)?" + "(?:" + "(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|" + "(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|" + "(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)" + "(?:[\\s,,]*)" + "(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?" + ")?" + "(?:[\\s,,]*)" + "(?:(\\d+|[" + Object.keys(constants_1.NUMBER).join("") + "]+)(?:\\s*)(?:點|時|:|:)" + "(?:\\s*)" + "(\\d+|半|正|整|[" + Object.keys(constants_1.NUMBER).join("") + "]+)?(?:\\s*)(?:分|:|:)?" + "(?:\\s*)" + "(\\d+|[" + Object.keys(constants_1.NUMBER).join("") + "]+)?(?:\\s*)(?:秒)?)" + "(?:\\s*(A.M.|P.M.|AM?|PM?))?", "i"); -const SECOND_REG_PATTERN = new RegExp("(?:^\\s*(?:到|至|\\-|\\–|\\~|\\〜)\\s*)" + "(?:" + "(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|" + "(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|" + "(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)" + "(?:[\\s,,]*)" + "(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?" + ")?" + "(?:[\\s,,]*)" + "(?:(\\d+|[" + Object.keys(constants_1.NUMBER).join("") + "]+)(?:\\s*)(?:點|時|:|:)" + "(?:\\s*)" + "(\\d+|半|正|整|[" + Object.keys(constants_1.NUMBER).join("") + "]+)?(?:\\s*)(?:分|:|:)?" + "(?:\\s*)" + "(\\d+|[" + Object.keys(constants_1.NUMBER).join("") + "]+)?(?:\\s*)(?:秒)?)" + "(?:\\s*(A.M.|P.M.|AM?|PM?))?", "i"); -const DAY_GROUP_1 = 1; -const ZH_AM_PM_HOUR_GROUP_1 = 2; -const ZH_AM_PM_HOUR_GROUP_2 = 3; -const DAY_GROUP_3 = 4; -const ZH_AM_PM_HOUR_GROUP_3 = 5; -const HOUR_GROUP = 6; -const MINUTE_GROUP = 7; -const SECOND_GROUP = 8; -const AM_PM_HOUR_GROUP = 9; - -class ZHHantTimeExpressionParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return FIRST_REG_PATTERN; - } - - innerExtract(context, match) { - if (match.index > 0 && context.text[match.index - 1].match(/\w/)) { - return null; - } - - const refMoment = dayjs_1.default(context.refDate); - const result = context.createParsingResult(match.index, match[0]); - const startMoment = refMoment.clone(); - - if (match[DAY_GROUP_1]) { - var day1 = match[DAY_GROUP_1]; - - if (day1 == "明" || day1 == "聽") { - if (refMoment.hour() > 1) { - startMoment.add(1, "day"); - } - } else if (day1 == "昨" || day1 == "尋" || day1 == "琴") { - startMoment.add(-1, "day"); - } else if (day1 == "前") { - startMoment.add(-2, "day"); - } else if (day1 == "大前") { - startMoment.add(-3, "day"); - } else if (day1 == "後") { - startMoment.add(2, "day"); - } else if (day1 == "大後") { - startMoment.add(3, "day"); - } - - result.start.assign("day", startMoment.date()); - result.start.assign("month", startMoment.month() + 1); - result.start.assign("year", startMoment.year()); - } else if (match[DAY_GROUP_3]) { - var day3 = match[DAY_GROUP_3]; - - if (day3 == "明" || day3 == "聽") { - startMoment.add(1, "day"); - } else if (day3 == "昨" || day3 == "尋" || day3 == "琴") { - startMoment.add(-1, "day"); - } else if (day3 == "前") { - startMoment.add(-2, "day"); - } else if (day3 == "大前") { - startMoment.add(-3, "day"); - } else if (day3 == "後") { - startMoment.add(2, "day"); - } else if (day3 == "大後") { - startMoment.add(3, "day"); - } - - result.start.assign("day", startMoment.date()); - result.start.assign("month", startMoment.month() + 1); - result.start.assign("year", startMoment.year()); - } else { - result.start.imply("day", startMoment.date()); - result.start.imply("month", startMoment.month() + 1); - result.start.imply("year", startMoment.year()); - } - - let hour = 0; - let minute = 0; - let meridiem = -1; - - if (match[SECOND_GROUP]) { - var second = parseInt(match[SECOND_GROUP]); - - if (isNaN(second)) { - second = constants_1.zhStringToNumber(match[SECOND_GROUP]); - } - - if (second >= 60) return null; - result.start.assign("second", second); - } - - hour = parseInt(match[HOUR_GROUP]); - - if (isNaN(hour)) { - hour = constants_1.zhStringToNumber(match[HOUR_GROUP]); - } - - if (match[MINUTE_GROUP]) { - if (match[MINUTE_GROUP] == "半") { - minute = 30; - } else if (match[MINUTE_GROUP] == "正" || match[MINUTE_GROUP] == "整") { - minute = 0; - } else { - minute = parseInt(match[MINUTE_GROUP]); - - if (isNaN(minute)) { - minute = constants_1.zhStringToNumber(match[MINUTE_GROUP]); - } - } - } else if (hour > 100) { - minute = hour % 100; - hour = Math.floor(hour / 100); - } - - if (minute >= 60) { - return null; - } - - if (hour > 24) { - return null; - } - - if (hour >= 12) { - meridiem = 1; - } - - if (match[AM_PM_HOUR_GROUP]) { - if (hour > 12) return null; - var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase(); - - if (ampm == "a") { - meridiem = 0; - if (hour == 12) hour = 0; - } - - if (ampm == "p") { - meridiem = 1; - if (hour != 12) hour += 12; - } - } else if (match[ZH_AM_PM_HOUR_GROUP_1]) { - var zhAMPMString1 = match[ZH_AM_PM_HOUR_GROUP_1]; - var zhAMPM1 = zhAMPMString1[0]; - - if (zhAMPM1 == "朝" || zhAMPM1 == "早") { - meridiem = 0; - if (hour == 12) hour = 0; - } else if (zhAMPM1 == "晚") { - meridiem = 1; - if (hour != 12) hour += 12; - } - } else if (match[ZH_AM_PM_HOUR_GROUP_2]) { - var zhAMPMString2 = match[ZH_AM_PM_HOUR_GROUP_2]; - var zhAMPM2 = zhAMPMString2[0]; - - if (zhAMPM2 == "上" || zhAMPM2 == "朝" || zhAMPM2 == "早" || zhAMPM2 == "凌") { - meridiem = 0; - if (hour == 12) hour = 0; - } else if (zhAMPM2 == "下" || zhAMPM2 == "晏" || zhAMPM2 == "晚") { - meridiem = 1; - if (hour != 12) hour += 12; - } - } else if (match[ZH_AM_PM_HOUR_GROUP_3]) { - var zhAMPMString3 = match[ZH_AM_PM_HOUR_GROUP_3]; - var zhAMPM3 = zhAMPMString3[0]; - - if (zhAMPM3 == "上" || zhAMPM3 == "朝" || zhAMPM3 == "早" || zhAMPM3 == "凌") { - meridiem = 0; - if (hour == 12) hour = 0; - } else if (zhAMPM3 == "下" || zhAMPM3 == "晏" || zhAMPM3 == "晚") { - meridiem = 1; - if (hour != 12) hour += 12; - } - } - - result.start.assign("hour", hour); - result.start.assign("minute", minute); - - if (meridiem >= 0) { - result.start.assign("meridiem", meridiem); - } else { - if (hour < 12) { - result.start.imply("meridiem", 0); - } else { - result.start.imply("meridiem", 1); - } - } - - match = SECOND_REG_PATTERN.exec(context.text.substring(result.index + result.text.length)); - - if (!match) { - if (result.text.match(/^\d+$/)) { - return null; - } - - return result; - } - - const endMoment = startMoment.clone(); - result.end = context.createParsingComponents(); - - if (match[DAY_GROUP_1]) { - var day1 = match[DAY_GROUP_1]; - - if (day1 == "明" || day1 == "聽") { - if (refMoment.hour() > 1) { - endMoment.add(1, "day"); - } - } else if (day1 == "昨" || day1 == "尋" || day1 == "琴") { - endMoment.add(-1, "day"); - } else if (day1 == "前") { - endMoment.add(-2, "day"); - } else if (day1 == "大前") { - endMoment.add(-3, "day"); - } else if (day1 == "後") { - endMoment.add(2, "day"); - } else if (day1 == "大後") { - endMoment.add(3, "day"); - } - - result.end.assign("day", endMoment.date()); - result.end.assign("month", endMoment.month() + 1); - result.end.assign("year", endMoment.year()); - } else if (match[DAY_GROUP_3]) { - var day3 = match[DAY_GROUP_3]; - - if (day3 == "明" || day3 == "聽") { - endMoment.add(1, "day"); - } else if (day3 == "昨" || day3 == "尋" || day3 == "琴") { - endMoment.add(-1, "day"); - } else if (day3 == "前") { - endMoment.add(-2, "day"); - } else if (day3 == "大前") { - endMoment.add(-3, "day"); - } else if (day3 == "後") { - endMoment.add(2, "day"); - } else if (day3 == "大後") { - endMoment.add(3, "day"); - } - - result.end.assign("day", endMoment.date()); - result.end.assign("month", endMoment.month() + 1); - result.end.assign("year", endMoment.year()); - } else { - result.end.imply("day", endMoment.date()); - result.end.imply("month", endMoment.month() + 1); - result.end.imply("year", endMoment.year()); - } - - hour = 0; - minute = 0; - meridiem = -1; - - if (match[SECOND_GROUP]) { - var second = parseInt(match[SECOND_GROUP]); - - if (isNaN(second)) { - second = constants_1.zhStringToNumber(match[SECOND_GROUP]); - } - - if (second >= 60) return null; - result.end.assign("second", second); - } - - hour = parseInt(match[HOUR_GROUP]); - - if (isNaN(hour)) { - hour = constants_1.zhStringToNumber(match[HOUR_GROUP]); - } - - if (match[MINUTE_GROUP]) { - if (match[MINUTE_GROUP] == "半") { - minute = 30; - } else if (match[MINUTE_GROUP] == "正" || match[MINUTE_GROUP] == "整") { - minute = 0; - } else { - minute = parseInt(match[MINUTE_GROUP]); - - if (isNaN(minute)) { - minute = constants_1.zhStringToNumber(match[MINUTE_GROUP]); - } - } - } else if (hour > 100) { - minute = hour % 100; - hour = Math.floor(hour / 100); - } - - if (minute >= 60) { - return null; - } - - if (hour > 24) { - return null; - } - - if (hour >= 12) { - meridiem = 1; - } - - if (match[AM_PM_HOUR_GROUP]) { - if (hour > 12) return null; - var ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase(); - - if (ampm == "a") { - meridiem = 0; - if (hour == 12) hour = 0; - } - - if (ampm == "p") { - meridiem = 1; - if (hour != 12) hour += 12; - } - - if (!result.start.isCertain("meridiem")) { - if (meridiem == 0) { - result.start.imply("meridiem", 0); - - if (result.start.get("hour") == 12) { - result.start.assign("hour", 0); - } - } else { - result.start.imply("meridiem", 1); - - if (result.start.get("hour") != 12) { - result.start.assign("hour", result.start.get("hour") + 12); - } - } - } - } else if (match[ZH_AM_PM_HOUR_GROUP_1]) { - var zhAMPMString1 = match[ZH_AM_PM_HOUR_GROUP_1]; - var zhAMPM1 = zhAMPMString1[0]; - - if (zhAMPM1 == "朝" || zhAMPM1 == "早") { - meridiem = 0; - if (hour == 12) hour = 0; - } else if (zhAMPM1 == "晚") { - meridiem = 1; - if (hour != 12) hour += 12; - } - } else if (match[ZH_AM_PM_HOUR_GROUP_2]) { - var zhAMPMString2 = match[ZH_AM_PM_HOUR_GROUP_2]; - var zhAMPM2 = zhAMPMString2[0]; - - if (zhAMPM2 == "上" || zhAMPM2 == "朝" || zhAMPM2 == "早" || zhAMPM2 == "凌") { - meridiem = 0; - if (hour == 12) hour = 0; - } else if (zhAMPM2 == "下" || zhAMPM2 == "晏" || zhAMPM2 == "晚") { - meridiem = 1; - if (hour != 12) hour += 12; - } - } else if (match[ZH_AM_PM_HOUR_GROUP_3]) { - var zhAMPMString3 = match[ZH_AM_PM_HOUR_GROUP_3]; - var zhAMPM3 = zhAMPMString3[0]; - - if (zhAMPM3 == "上" || zhAMPM3 == "朝" || zhAMPM3 == "早" || zhAMPM3 == "凌") { - meridiem = 0; - if (hour == 12) hour = 0; - } else if (zhAMPM3 == "下" || zhAMPM3 == "晏" || zhAMPM3 == "晚") { - meridiem = 1; - if (hour != 12) hour += 12; - } - } - - result.text = result.text + match[0]; - result.end.assign("hour", hour); - result.end.assign("minute", minute); - - if (meridiem >= 0) { - result.end.assign("meridiem", meridiem); - } else { - const startAtPM = result.start.isCertain("meridiem") && result.start.get("meridiem") == 1; - - if (startAtPM && result.start.get("hour") > hour) { - result.end.imply("meridiem", 0); - } else if (hour > 12) { - result.end.imply("meridiem", 1); - } - } - - if (result.end.date().getTime() < result.start.date().getTime()) { - result.end.imply("day", result.end.get("day") + 1); - } - - return result; - } - -} - -exports["default"] = ZHHantTimeExpressionParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hant/parsers/ZHHantWeekdayParser.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const AbstractParserWithWordBoundary_1 = __webpack_require__("./node_modules/chrono-node/dist/common/parsers/AbstractParserWithWordBoundary.js"); - -const constants_1 = __webpack_require__("./node_modules/chrono-node/dist/locales/zh/hant/constants.js"); - -const PATTERN = new RegExp("(?:星期|禮拜|週)(?" + Object.keys(constants_1.WEEKDAY_OFFSET).join("|") + ")"); - -class ZHHantWeekdayParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { - innerPattern() { - return PATTERN; - } - - innerExtract(context, match) { - const result = context.createParsingResult(match.index, match[0]); - const dayOfWeek = match.groups.weekday; - const offset = constants_1.WEEKDAY_OFFSET[dayOfWeek]; - if (offset === undefined) return null; - let startMoment = dayjs_1.default(context.refDate); - const startMomentFixed = false; - const refOffset = startMoment.day(); - - if (Math.abs(offset - 7 - refOffset) < Math.abs(offset - refOffset)) { - startMoment = startMoment.day(offset - 7); - } else if (Math.abs(offset + 7 - refOffset) < Math.abs(offset - refOffset)) { - startMoment = startMoment.day(offset + 7); - } else { - startMoment = startMoment.day(offset); - } - - result.start.assign("weekday", offset); - - if (startMomentFixed) { - result.start.assign("day", startMoment.date()); - result.start.assign("month", startMoment.month() + 1); - result.start.assign("year", startMoment.year()); - } else { - result.start.imply("day", startMoment.date()); - result.start.imply("month", startMoment.month() + 1); - result.start.imply("year", startMoment.year()); - } - - return result; - } - -} - -exports["default"] = ZHHantWeekdayParser; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hant/refiners/ZHHantMergeDateRangeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateRangeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateRangeRefiner.js")); - -class ZHHantMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner_1.default { - patternBetween() { - return /^\s*(至|到|\-|\~|~|-|ー)\s*$/i; - } - -} - -exports["default"] = ZHHantMergeDateRangeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/hant/refiners/ZHHantMergeDateTimeRefiner.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const AbstractMergeDateTimeRefiner_1 = __importDefault(__webpack_require__("./node_modules/chrono-node/dist/common/refiners/AbstractMergeDateTimeRefiner.js")); - -class ZHHantMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner_1.default { - patternBetween() { - return /^\s*$/i; - } - -} - -exports["default"] = ZHHantMergeDateTimeRefiner; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/locales/zh/index.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function () { - return m[k]; - } - }); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}); - -var __exportStar = this && this.__exportStar || function (m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; - -var __importStar = this && this.__importStar || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - - __setModuleDefault(result, mod); - - return result; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.hans = void 0; - -__exportStar(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hant/index.js"), exports); - -exports.hans = __importStar(__webpack_require__("./node_modules/chrono-node/dist/locales/zh/hans/index.js")); - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/results.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.ParsingResult = exports.ParsingComponents = exports.ReferenceWithTimezone = void 0; - -const quarterOfYear_1 = __importDefault(__webpack_require__("./node_modules/dayjs/plugin/quarterOfYear.js")); - -const dayjs_1 = __importDefault(__webpack_require__("./node_modules/dayjs/dayjs.min.js")); - -const dayjs_2 = __webpack_require__("./node_modules/chrono-node/dist/utils/dayjs.js"); - -const timezone_1 = __webpack_require__("./node_modules/chrono-node/dist/timezone.js"); - -dayjs_1.default.extend(quarterOfYear_1.default); - -class ReferenceWithTimezone { - constructor(input) { - var _a; - - input = input !== null && input !== void 0 ? input : new Date(); - - if (input instanceof Date) { - this.instant = input; - } else { - this.instant = (_a = input.instant) !== null && _a !== void 0 ? _a : new Date(); - this.timezoneOffset = timezone_1.toTimezoneOffset(input.timezone); - } - } - - getDateWithAdjustedTimezone() { - return new Date(this.instant.getTime() + this.getSystemTimezoneAdjustmentMinute(this.instant) * 60000); - } - - getSystemTimezoneAdjustmentMinute(date, overrideTimezoneOffset) { - var _a; - - if (!date || date.getTime() < 0) { - date = new Date(); - } - - const currentTimezoneOffset = -date.getTimezoneOffset(); - const targetTimezoneOffset = (_a = overrideTimezoneOffset !== null && overrideTimezoneOffset !== void 0 ? overrideTimezoneOffset : this.timezoneOffset) !== null && _a !== void 0 ? _a : currentTimezoneOffset; - return currentTimezoneOffset - targetTimezoneOffset; - } - -} - -exports.ReferenceWithTimezone = ReferenceWithTimezone; - -class ParsingComponents { - constructor(reference, knownComponents) { - this.reference = reference; - this.knownValues = {}; - this.impliedValues = {}; - - if (knownComponents) { - for (const key in knownComponents) { - this.knownValues[key] = knownComponents[key]; - } - } - - const refDayJs = dayjs_1.default(reference.instant); - this.imply("day", refDayJs.date()); - this.imply("month", refDayJs.month() + 1); - this.imply("year", refDayJs.year()); - this.imply("hour", 12); - this.imply("minute", 0); - this.imply("second", 0); - this.imply("millisecond", 0); - } - - get(component) { - if (component in this.knownValues) { - return this.knownValues[component]; - } - - if (component in this.impliedValues) { - return this.impliedValues[component]; - } - - return null; - } - - isCertain(component) { - return component in this.knownValues; - } - - getCertainComponents() { - return Object.keys(this.knownValues); - } - - imply(component, value) { - if (component in this.knownValues) { - return this; - } - - this.impliedValues[component] = value; - return this; - } - - assign(component, value) { - this.knownValues[component] = value; - delete this.impliedValues[component]; - return this; - } - - delete(component) { - delete this.knownValues[component]; - delete this.impliedValues[component]; - } - - clone() { - const component = new ParsingComponents(this.reference); - component.knownValues = {}; - component.impliedValues = {}; - - for (const key in this.knownValues) { - component.knownValues[key] = this.knownValues[key]; - } - - for (const key in this.impliedValues) { - component.impliedValues[key] = this.impliedValues[key]; - } - - return component; - } - - isOnlyDate() { - return !this.isCertain("hour") && !this.isCertain("minute") && !this.isCertain("second"); - } - - isOnlyTime() { - return !this.isCertain("weekday") && !this.isCertain("day") && !this.isCertain("month"); - } - - isOnlyWeekdayComponent() { - return this.isCertain("weekday") && !this.isCertain("day") && !this.isCertain("month"); - } - - isOnlyDayMonthComponent() { - return this.isCertain("day") && this.isCertain("month") && !this.isCertain("year"); - } - - isValidDate() { - const date = this.dateWithoutTimezoneAdjustment(); - if (date.getFullYear() !== this.get("year")) return false; - if (date.getMonth() !== this.get("month") - 1) return false; - if (date.getDate() !== this.get("day")) return false; - if (this.get("hour") != null && date.getHours() != this.get("hour")) return false; - if (this.get("minute") != null && date.getMinutes() != this.get("minute")) return false; - return true; - } - - toString() { - return `[ParsingComponents {knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}, reference: ${JSON.stringify(this.reference)}]`; - } - - dayjs() { - return dayjs_1.default(this.date()); - } - - date() { - const date = this.dateWithoutTimezoneAdjustment(); - const timezoneAdjustment = this.reference.getSystemTimezoneAdjustmentMinute(date, this.get("timezoneOffset")); - return new Date(date.getTime() + timezoneAdjustment * 60000); - } - - dateWithoutTimezoneAdjustment() { - const date = new Date(this.get("year"), this.get("month") - 1, this.get("day"), this.get("hour"), this.get("minute"), this.get("second"), this.get("millisecond")); - date.setFullYear(this.get("year")); - return date; - } - - static createRelativeFromReference(reference, fragments) { - let date = dayjs_1.default(reference.instant); - - for (const key in fragments) { - date = date.add(fragments[key], key); - } - - const components = new ParsingComponents(reference); - - if (fragments["hour"] || fragments["minute"] || fragments["second"]) { - dayjs_2.assignSimilarTime(components, date); - dayjs_2.assignSimilarDate(components, date); - - if (reference.timezoneOffset !== null) { - components.assign("timezoneOffset", -reference.instant.getTimezoneOffset()); - } - } else { - dayjs_2.implySimilarTime(components, date); - - if (reference.timezoneOffset !== null) { - components.imply("timezoneOffset", -reference.instant.getTimezoneOffset()); - } - - if (fragments["d"]) { - components.assign("day", date.date()); - components.assign("month", date.month() + 1); - components.assign("year", date.year()); - } else { - if (fragments["week"]) { - components.imply("weekday", date.day()); - } - - components.imply("day", date.date()); - - if (fragments["month"]) { - components.assign("month", date.month() + 1); - components.assign("year", date.year()); - } else { - components.imply("month", date.month() + 1); - - if (fragments["year"]) { - components.assign("year", date.year()); - } else { - components.imply("year", date.year()); - } - } - } - } - - return components; - } - -} - -exports.ParsingComponents = ParsingComponents; - -class ParsingResult { - constructor(reference, index, text, start, end) { - this.reference = reference; - this.refDate = reference.instant; - this.index = index; - this.text = text; - this.start = start || new ParsingComponents(reference); - this.end = end; - } - - clone() { - const result = new ParsingResult(this.reference, this.index, this.text); - result.start = this.start ? this.start.clone() : null; - result.end = this.end ? this.end.clone() : null; - return result; - } - - date() { - return this.start.date(); - } - - toString() { - return `[ParsingResult {index: ${this.index}, text: '${this.text}', ...}]`; - } - -} - -exports.ParsingResult = ParsingResult; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/timezone.js": -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.toTimezoneOffset = exports.TIMEZONE_ABBR_MAP = void 0; -exports.TIMEZONE_ABBR_MAP = { +// EXTERNAL MODULE: ./node_modules/dayjs/plugin/quarterOfYear.js +var quarterOfYear = __webpack_require__("./node_modules/dayjs/plugin/quarterOfYear.js"); +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/utils/dayjs.js + +function assignTheNextDay(component, targetDayJs) { + targetDayJs = targetDayJs.add(1, "day"); + dayjs_assignSimilarDate(component, targetDayJs); + implySimilarTime(component, targetDayJs); +} +function implyTheNextDay(component, targetDayJs) { + targetDayJs = targetDayJs.add(1, "day"); + implySimilarDate(component, targetDayJs); + implySimilarTime(component, targetDayJs); +} +function dayjs_assignSimilarDate(component, targetDayJs) { + component.assign("day", targetDayJs.date()); + component.assign("month", targetDayJs.month() + 1); + component.assign("year", targetDayJs.year()); +} +function assignSimilarTime(component, targetDayJs) { + component.assign("hour", targetDayJs.hour()); + component.assign("minute", targetDayJs.minute()); + component.assign("second", targetDayJs.second()); + component.assign("millisecond", targetDayJs.millisecond()); + if (component.get("hour") < 12) { + component.assign("meridiem", esm_Meridiem.AM); + } else { + component.assign("meridiem", esm_Meridiem.PM); + } +} +function implySimilarDate(component, targetDayJs) { + component.imply("day", targetDayJs.date()); + component.imply("month", targetDayJs.month() + 1); + component.imply("year", targetDayJs.year()); +} +function implySimilarTime(component, targetDayJs) { + component.imply("hour", targetDayJs.hour()); + component.imply("minute", targetDayJs.minute()); + component.imply("second", targetDayJs.second()); + component.imply("millisecond", targetDayJs.millisecond()); +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/timezone.js + + +const TIMEZONE_ABBR_MAP = { ACDT: 630, ACST: 570, ADT: -180, @@ -10864,7 +1277,12 @@ exports.TIMEZONE_ABBR_MAP = { CCT: 390, CDT: -300, CEST: 120, - CET: 60, + CET: { + timezoneOffsetDuringDst: 2 * 60, + timezoneOffsetNonDst: 60, + dstStart: year => getLastWeekdayOfMonth(year, Month.MARCH, Weekday.SUNDAY, 2), + dstEnd: year => getLastWeekdayOfMonth(year, Month.OCTOBER, Weekday.SUNDAY, 3) + }, CHADT: 825, CHAST: 765, CKT: -600, @@ -10872,6 +1290,12 @@ exports.TIMEZONE_ABBR_MAP = { CLT: -240, COT: -300, CST: -360, + CT: { + timezoneOffsetDuringDst: -5 * 60, + timezoneOffsetNonDst: -6 * 60, + dstStart: year => getNthWeekdayOfMonth(year, Month.MARCH, Weekday.SUNDAY, 2, 2), + dstEnd: year => getNthWeekdayOfMonth(year, Month.NOVEMBER, Weekday.SUNDAY, 1, 2) + }, CVT: -60, CXT: 420, ChST: 600, @@ -10886,7 +1310,12 @@ exports.TIMEZONE_ABBR_MAP = { EGST: 0, EGT: -60, EST: -300, - ET: -300, + ET: { + timezoneOffsetDuringDst: -4 * 60, + timezoneOffsetNonDst: -5 * 60, + dstStart: year => getNthWeekdayOfMonth(year, Month.MARCH, Weekday.SUNDAY, 2, 2), + dstEnd: year => getNthWeekdayOfMonth(year, Month.NOVEMBER, Weekday.SUNDAY, 1, 2) + }, FJST: 780, FJT: 720, FKST: -180, @@ -10948,6 +1377,12 @@ exports.TIMEZONE_ABBR_MAP = { MSD: 240, MSK: 180, MST: -420, + MT: { + timezoneOffsetDuringDst: -6 * 60, + timezoneOffsetNonDst: -7 * 60, + dstStart: year => getNthWeekdayOfMonth(year, Month.MARCH, Weekday.SUNDAY, 2, 2), + dstEnd: year => getNthWeekdayOfMonth(year, Month.NOVEMBER, Weekday.SUNDAY, 1, 2) + }, MUT: 240, MVT: 300, MYT: 480, @@ -10975,7 +1410,12 @@ exports.TIMEZONE_ABBR_MAP = { PMST: -180, PONT: 660, PST: -480, - PT: -480, + PT: { + timezoneOffsetDuringDst: -7 * 60, + timezoneOffsetNonDst: -8 * 60, + dstStart: year => getNthWeekdayOfMonth(year, Month.MARCH, Weekday.SUNDAY, 2, 2), + dstEnd: year => getNthWeekdayOfMonth(year, Month.NOVEMBER, Weekday.SUNDAY, 1, 2) + }, PWT: 540, PYST: -180, PYT: -240, @@ -11023,1259 +1463,2729 @@ exports.TIMEZONE_ABBR_MAP = { YEKST: 360, YEKT: 360 }; - -function toTimezoneOffset(timezoneInput) { - var _a; - - if (timezoneInput === null || timezoneInput === undefined) { +function getNthWeekdayOfMonth(year, month, weekday, n, hour = 0) { + let dayOfMonth = 0; + let i = 0; + while (i < n) { + dayOfMonth++; + const date = new Date(year, month - 1, dayOfMonth); + if (date.getDay() === weekday) i++; + } + return new Date(year, month - 1, dayOfMonth, hour); +} +function getLastWeekdayOfMonth(year, month, weekday, hour = 0) { + const oneIndexedWeekday = weekday === 0 ? 7 : weekday; + const date = new Date(year, month - 1 + 1, 1, 12); + const firstWeekdayNextMonth = date.getDay() === 0 ? 7 : date.getDay(); + let dayDiff; + if (firstWeekdayNextMonth === oneIndexedWeekday) dayDiff = 7;else if (firstWeekdayNextMonth < oneIndexedWeekday) dayDiff = 7 + firstWeekdayNextMonth - oneIndexedWeekday;else dayDiff = firstWeekdayNextMonth - oneIndexedWeekday; + date.setDate(date.getDate() - dayDiff); + return new Date(year, month - 1, date.getDate(), hour); +} +function toTimezoneOffset(timezoneInput, date, timezoneOverrides = {}) { + if (timezoneInput == null) { return null; } - if (typeof timezoneInput === "number") { return timezoneInput; } - - return (_a = exports.TIMEZONE_ABBR_MAP[timezoneInput]) !== null && _a !== void 0 ? _a : null; + const matchedTimezone = timezoneOverrides[timezoneInput] ?? TIMEZONE_ABBR_MAP[timezoneInput]; + if (matchedTimezone == null) { + return null; + } + if (typeof matchedTimezone == "number") { + return matchedTimezone; + } + if (date == null) { + return null; + } + if (dayjs_min(date).isAfter(matchedTimezone.dstStart(date.getFullYear())) && !dayjs_min(date).isAfter(matchedTimezone.dstEnd(date.getFullYear()))) { + return matchedTimezone.timezoneOffsetDuringDst; + } + return matchedTimezone.timezoneOffsetNonDst; } - -exports.toTimezoneOffset = toTimezoneOffset; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/utils/dayjs.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/results.js -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.implySimilarTime = exports.assignSimilarTime = exports.assignSimilarDate = exports.assignTheNextDay = void 0; -const index_1 = __webpack_require__("./node_modules/chrono-node/dist/index.js"); -function assignTheNextDay(component, targetDayJs) { - targetDayJs = targetDayJs.add(1, "day"); - assignSimilarDate(component, targetDayJs); - implySimilarTime(component, targetDayJs); -} - -exports.assignTheNextDay = assignTheNextDay; - -function assignSimilarDate(component, targetDayJs) { - component.assign("day", targetDayJs.date()); - component.assign("month", targetDayJs.month() + 1); - component.assign("year", targetDayJs.year()); -} - -exports.assignSimilarDate = assignSimilarDate; - -function assignSimilarTime(component, targetDayJs) { - component.assign("hour", targetDayJs.hour()); - component.assign("minute", targetDayJs.minute()); - component.assign("second", targetDayJs.second()); - component.assign("millisecond", targetDayJs.millisecond()); - - if (component.get("hour") < 12) { - component.assign("meridiem", index_1.Meridiem.AM); - } else { - component.assign("meridiem", index_1.Meridiem.PM); +dayjs_min.extend(quarterOfYear); +class ReferenceWithTimezone { + constructor(input) { + input = input ?? new Date(); + if (input instanceof Date) { + this.instant = input; + } else { + this.instant = input.instant ?? new Date(); + this.timezoneOffset = toTimezoneOffset(input.timezone, this.instant); + } + } + getDateWithAdjustedTimezone() { + return new Date(this.instant.getTime() + this.getSystemTimezoneAdjustmentMinute(this.instant) * 60000); + } + getSystemTimezoneAdjustmentMinute(date, overrideTimezoneOffset) { + if (!date || date.getTime() < 0) { + date = new Date(); + } + const currentTimezoneOffset = -date.getTimezoneOffset(); + const targetTimezoneOffset = overrideTimezoneOffset ?? this.timezoneOffset ?? currentTimezoneOffset; + return currentTimezoneOffset - targetTimezoneOffset; } } - -exports.assignSimilarTime = assignSimilarTime; - -function implySimilarTime(component, targetDayJs) { - component.imply("hour", targetDayJs.hour()); - component.imply("minute", targetDayJs.minute()); - component.imply("second", targetDayJs.second()); - component.imply("millisecond", targetDayJs.millisecond()); -} - -exports.implySimilarTime = implySimilarTime; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/utils/pattern.js": -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.matchAnyPattern = exports.extractTerms = exports.repeatedTimeunitPattern = void 0; - -function repeatedTimeunitPattern(prefix, singleTimeunitPattern) { - const singleTimeunitPatternNoCapture = singleTimeunitPattern.replace(/\((?!\?)/g, "(?:"); - return `${prefix}${singleTimeunitPatternNoCapture}\\s{0,5}(?:,?\\s{0,5}${singleTimeunitPatternNoCapture}){0,10}`; -} - -exports.repeatedTimeunitPattern = repeatedTimeunitPattern; - -function extractTerms(dictionary) { - let keys; - - if (dictionary instanceof Array) { - keys = [...dictionary]; - } else if (dictionary instanceof Map) { - keys = Array.from(dictionary.keys()); - } else { - keys = Object.keys(dictionary); +class results_ParsingComponents { + constructor(reference, knownComponents) { + this.reference = reference; + this.knownValues = {}; + this.impliedValues = {}; + if (knownComponents) { + for (const key in knownComponents) { + this.knownValues[key] = knownComponents[key]; + } + } + const refDayJs = dayjs_min(reference.instant); + this.imply("day", refDayJs.date()); + this.imply("month", refDayJs.month() + 1); + this.imply("year", refDayJs.year()); + this.imply("hour", 12); + this.imply("minute", 0); + this.imply("second", 0); + this.imply("millisecond", 0); + } + get(component) { + if (component in this.knownValues) { + return this.knownValues[component]; + } + if (component in this.impliedValues) { + return this.impliedValues[component]; + } + return null; + } + isCertain(component) { + return component in this.knownValues; + } + getCertainComponents() { + return Object.keys(this.knownValues); + } + imply(component, value) { + if (component in this.knownValues) { + return this; + } + this.impliedValues[component] = value; + return this; + } + assign(component, value) { + this.knownValues[component] = value; + delete this.impliedValues[component]; + return this; + } + delete(component) { + delete this.knownValues[component]; + delete this.impliedValues[component]; + } + clone() { + const component = new results_ParsingComponents(this.reference); + component.knownValues = {}; + component.impliedValues = {}; + for (const key in this.knownValues) { + component.knownValues[key] = this.knownValues[key]; + } + for (const key in this.impliedValues) { + component.impliedValues[key] = this.impliedValues[key]; + } + return component; + } + isOnlyDate() { + return !this.isCertain("hour") && !this.isCertain("minute") && !this.isCertain("second"); + } + isOnlyTime() { + return !this.isCertain("weekday") && !this.isCertain("day") && !this.isCertain("month"); + } + isOnlyWeekdayComponent() { + return this.isCertain("weekday") && !this.isCertain("day") && !this.isCertain("month"); + } + isDateWithUnknownYear() { + return this.isCertain("month") && !this.isCertain("year"); + } + isValidDate() { + const date = this.dateWithoutTimezoneAdjustment(); + if (date.getFullYear() !== this.get("year")) return false; + if (date.getMonth() !== this.get("month") - 1) return false; + if (date.getDate() !== this.get("day")) return false; + if (this.get("hour") != null && date.getHours() != this.get("hour")) return false; + if (this.get("minute") != null && date.getMinutes() != this.get("minute")) return false; + return true; + } + toString() { + return `[ParsingComponents {knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}, reference: ${JSON.stringify(this.reference)}]`; + } + dayjs() { + return dayjs_min(this.date()); + } + date() { + const date = this.dateWithoutTimezoneAdjustment(); + const timezoneAdjustment = this.reference.getSystemTimezoneAdjustmentMinute(date, this.get("timezoneOffset")); + return new Date(date.getTime() + timezoneAdjustment * 60000); + } + dateWithoutTimezoneAdjustment() { + const date = new Date(this.get("year"), this.get("month") - 1, this.get("day"), this.get("hour"), this.get("minute"), this.get("second"), this.get("millisecond")); + date.setFullYear(this.get("year")); + return date; + } + static createRelativeFromReference(reference, fragments) { + let date = dayjs_min(reference.instant); + for (const key in fragments) { + date = date.add(fragments[key], key); + } + const components = new results_ParsingComponents(reference); + if (fragments["hour"] || fragments["minute"] || fragments["second"]) { + assignSimilarTime(components, date); + dayjs_assignSimilarDate(components, date); + if (reference.timezoneOffset !== null) { + components.assign("timezoneOffset", -reference.instant.getTimezoneOffset()); + } + } else { + implySimilarTime(components, date); + if (reference.timezoneOffset !== null) { + components.imply("timezoneOffset", -reference.instant.getTimezoneOffset()); + } + if (fragments["d"]) { + components.assign("day", date.date()); + components.assign("month", date.month() + 1); + components.assign("year", date.year()); + } else { + if (fragments["week"]) { + components.imply("weekday", date.day()); + } + components.imply("day", date.date()); + if (fragments["month"]) { + components.assign("month", date.month() + 1); + components.assign("year", date.year()); + } else { + components.imply("month", date.month() + 1); + if (fragments["year"]) { + components.assign("year", date.year()); + } else { + components.imply("year", date.year()); + } + } + } + } + return components; } - - return keys; } - -exports.extractTerms = extractTerms; - -function matchAnyPattern(dictionary) { - const joinedTerms = extractTerms(dictionary).sort((a, b) => b.length - a.length).join("|").replace(/\./g, "\\."); - return `(?:${joinedTerms})`; +class ParsingResult { + constructor(reference, index, text, start, end) { + this.reference = reference; + this.refDate = reference.instant; + this.index = index; + this.text = text; + this.start = start || new results_ParsingComponents(reference); + this.end = end; + } + clone() { + const result = new ParsingResult(this.reference, this.index, this.text); + result.start = this.start ? this.start.clone() : null; + result.end = this.end ? this.end.clone() : null; + return result; + } + date() { + return this.start.date(); + } + toString() { + return `[ParsingResult {index: ${this.index}, text: '${this.text}', ...}]`; + } } - -exports.matchAnyPattern = matchAnyPattern; - -/***/ }), - -/***/ "./node_modules/chrono-node/dist/utils/timeunits.js": -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/common/parsers/AbstractParserWithWordBoundary.js +class AbstractParserWithWordBoundaryChecking { + constructor() { + this.cachedInnerPattern = null; + this.cachedPattern = null; + } + patternLeftBoundary() { + return `(\\W|^)`; + } + pattern(context) { + const innerPattern = this.innerPattern(context); + if (innerPattern == this.cachedInnerPattern) { + return this.cachedPattern; + } + this.cachedPattern = new RegExp(`${this.patternLeftBoundary()}${innerPattern.source}`, innerPattern.flags); + this.cachedInnerPattern = innerPattern; + return this.cachedPattern; + } + extract(context, match) { + const header = match[1] ?? ""; + match.index = match.index + header.length; + match[0] = match[0].substring(header.length); + for (let i = 2; i < match.length; i++) { + match[i - 1] = match[i]; + } + return this.innerExtract(context, match); + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/parsers/ENTimeUnitWithinFormatParser.js -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.addImpliedTimeUnits = exports.reverseTimeUnits = void 0; +const PATTERN_WITHOUT_PREFIX = new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${TIME_UNITS_PATTERN})(?=\\W|$)`, "i"); +const PATTERN_WITH_PREFIX = new RegExp(`(?:within|in|for)\\s*` + `(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${TIME_UNITS_PATTERN})(?=\\W|$)`, "i"); +const PATTERN_WITH_PREFIX_STRICT = new RegExp(`(?:within|in|for)\\s*` + `(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${TIME_UNITS_NO_ABBR_PATTERN})(?=\\W|$)`, "i"); +class ENTimeUnitWithinFormatParser extends AbstractParserWithWordBoundaryChecking { + constructor(strictMode) { + super(); + this.strictMode = strictMode; + } + innerPattern(context) { + if (this.strictMode) { + return PATTERN_WITH_PREFIX_STRICT; + } + return context.option.forwardDate ? PATTERN_WITHOUT_PREFIX : PATTERN_WITH_PREFIX; + } + innerExtract(context, match) { + const timeUnits = parseTimeUnits(match[1]); + return results_ParsingComponents.createRelativeFromReference(context.reference, timeUnits); + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/parsers/ENMonthNameLittleEndianParser.js + + + + + + +const PATTERN = new RegExp(`(?:on\\s{0,3})?` + `(${ORDINAL_NUMBER_PATTERN})` + `(?:` + `\\s{0,3}(?:to|\\-|\\–|until|through|till)?\\s{0,3}` + `(${ORDINAL_NUMBER_PATTERN})` + ")?" + `(?:-|/|\\s{0,3}(?:of)?\\s{0,3})` + `(${matchAnyPattern(MONTH_DICTIONARY)})` + "(?:" + `(?:-|/|,?\\s{0,3})` + `(${YEAR_PATTERN}(?![^\\s]\\d))` + ")?" + "(?=\\W|$)", "i"); +const DATE_GROUP = 1; +const DATE_TO_GROUP = 2; +const MONTH_NAME_GROUP = 3; +const YEAR_GROUP = 4; +class ENMonthNameLittleEndianParser extends AbstractParserWithWordBoundaryChecking { + innerPattern() { + return PATTERN; + } + innerExtract(context, match) { + const result = context.createParsingResult(match.index, match[0]); + const month = MONTH_DICTIONARY[match[MONTH_NAME_GROUP].toLowerCase()]; + const day = parseOrdinalNumberPattern(match[DATE_GROUP]); + if (day > 31) { + match.index = match.index + match[DATE_GROUP].length; + return null; + } + result.start.assign("month", month); + result.start.assign("day", day); + if (match[YEAR_GROUP]) { + const yearNumber = parseYear(match[YEAR_GROUP]); + result.start.assign("year", yearNumber); + } else { + const year = findYearClosestToRef(context.refDate, day, month); + result.start.imply("year", year); + } + if (match[DATE_TO_GROUP]) { + const endDate = parseOrdinalNumberPattern(match[DATE_TO_GROUP]); + result.end = result.start.clone(); + result.end.assign("day", endDate); + } + return result; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/parsers/ENMonthNameMiddleEndianParser.js + + + + + + +const ENMonthNameMiddleEndianParser_PATTERN = new RegExp(`(${matchAnyPattern(MONTH_DICTIONARY)})` + "(?:-|/|\\s*,?\\s*)" + `(${ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*` + "(?:" + "(?:to|\\-)\\s*" + `(${ORDINAL_NUMBER_PATTERN})\\s*` + ")?" + "(?:" + "(?:-|/|\\s*,?\\s*)" + `(${YEAR_PATTERN})` + ")?" + "(?=\\W|$)(?!\\:\\d)", "i"); +const ENMonthNameMiddleEndianParser_MONTH_NAME_GROUP = 1; +const ENMonthNameMiddleEndianParser_DATE_GROUP = 2; +const ENMonthNameMiddleEndianParser_DATE_TO_GROUP = 3; +const ENMonthNameMiddleEndianParser_YEAR_GROUP = 4; +class ENMonthNameMiddleEndianParser extends AbstractParserWithWordBoundaryChecking { + innerPattern() { + return ENMonthNameMiddleEndianParser_PATTERN; + } + innerExtract(context, match) { + const month = MONTH_DICTIONARY[match[ENMonthNameMiddleEndianParser_MONTH_NAME_GROUP].toLowerCase()]; + const day = parseOrdinalNumberPattern(match[ENMonthNameMiddleEndianParser_DATE_GROUP]); + if (day > 31) { + return null; + } + const components = context.createParsingComponents({ + day: day, + month: month + }); + if (match[ENMonthNameMiddleEndianParser_YEAR_GROUP]) { + const year = parseYear(match[ENMonthNameMiddleEndianParser_YEAR_GROUP]); + components.assign("year", year); + } else { + const year = findYearClosestToRef(context.refDate, day, month); + components.imply("year", year); + } + if (!match[ENMonthNameMiddleEndianParser_DATE_TO_GROUP]) { + return components; + } + const endDate = parseOrdinalNumberPattern(match[ENMonthNameMiddleEndianParser_DATE_TO_GROUP]); + const result = context.createParsingResult(match.index, match[0]); + result.start = components; + result.end = components.clone(); + result.end.assign("day", endDate); + return result; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/parsers/ENMonthNameParser.js + + + + + +const ENMonthNameParser_PATTERN = new RegExp(`((?:in)\\s*)?` + `(${matchAnyPattern(MONTH_DICTIONARY)})` + `\\s*` + `(?:` + `[,-]?\\s*(${YEAR_PATTERN})?` + ")?" + "(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)", "i"); +const PREFIX_GROUP = 1; +const ENMonthNameParser_MONTH_NAME_GROUP = 2; +const ENMonthNameParser_YEAR_GROUP = 3; +class ENMonthNameParser extends AbstractParserWithWordBoundaryChecking { + innerPattern() { + return ENMonthNameParser_PATTERN; + } + innerExtract(context, match) { + const monthName = match[ENMonthNameParser_MONTH_NAME_GROUP].toLowerCase(); + if (match[0].length <= 3 && !FULL_MONTH_NAME_DICTIONARY[monthName]) { + return null; + } + const result = context.createParsingResult(match.index + (match[PREFIX_GROUP] || "").length, match.index + match[0].length); + result.start.imply("day", 1); + const month = MONTH_DICTIONARY[monthName]; + result.start.assign("month", month); + if (match[ENMonthNameParser_YEAR_GROUP]) { + const year = parseYear(match[ENMonthNameParser_YEAR_GROUP]); + result.start.assign("year", year); + } else { + const year = findYearClosestToRef(context.refDate, 1, month); + result.start.imply("year", year); + } + return result; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/parsers/ENCasualYearMonthDayParser.js + + + +const ENCasualYearMonthDayParser_PATTERN = new RegExp(`([0-9]{4})[\\.\\/\\s]` + `(?:(${matchAnyPattern(MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]` + `([0-9]{1,2})` + "(?=\\W|$)", "i"); +const YEAR_NUMBER_GROUP = 1; +const ENCasualYearMonthDayParser_MONTH_NAME_GROUP = 2; +const MONTH_NUMBER_GROUP = 3; +const DATE_NUMBER_GROUP = 4; +class ENCasualYearMonthDayParser extends AbstractParserWithWordBoundaryChecking { + innerPattern() { + return ENCasualYearMonthDayParser_PATTERN; + } + innerExtract(context, match) { + const month = match[MONTH_NUMBER_GROUP] ? parseInt(match[MONTH_NUMBER_GROUP]) : MONTH_DICTIONARY[match[ENCasualYearMonthDayParser_MONTH_NAME_GROUP].toLowerCase()]; + if (month < 1 || month > 12) { + return null; + } + const year = parseInt(match[YEAR_NUMBER_GROUP]); + const day = parseInt(match[DATE_NUMBER_GROUP]); + return { + day: day, + month: month, + year: year + }; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/parsers/ENSlashMonthFormatParser.js + +const ENSlashMonthFormatParser_PATTERN = new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})" + "", "i"); +const MONTH_GROUP = 1; +const ENSlashMonthFormatParser_YEAR_GROUP = 2; +class ENSlashMonthFormatParser extends AbstractParserWithWordBoundaryChecking { + innerPattern() { + return ENSlashMonthFormatParser_PATTERN; + } + innerExtract(context, match) { + const year = parseInt(match[ENSlashMonthFormatParser_YEAR_GROUP]); + const month = parseInt(match[MONTH_GROUP]); + return context.createParsingComponents().imply("day", 1).assign("month", month).assign("year", year); + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/common/parsers/AbstractTimeExpressionParser.js + +function primaryTimePattern(leftBoundary, primaryPrefix, primarySuffix, flags) { + return new RegExp(`${leftBoundary}` + `${primaryPrefix}` + `(\\d{1,4})` + `(?:` + `(?:\\.|:|:)` + `(\\d{1,2})` + `(?:` + `(?::|:)` + `(\\d{2})` + `(?:\\.(\\d{1,6}))?` + `)?` + `)?` + `(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?` + `${primarySuffix}`, flags); +} +function followingTimePatten(followingPhase, followingSuffix) { + return new RegExp(`^(${followingPhase})` + `(\\d{1,4})` + `(?:` + `(?:\\.|\\:|\\:)` + `(\\d{1,2})` + `(?:` + `(?:\\.|\\:|\\:)` + `(\\d{1,2})(?:\\.(\\d{1,6}))?` + `)?` + `)?` + `(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?` + `${followingSuffix}`, "i"); +} +const HOUR_GROUP = 2; +const MINUTE_GROUP = 3; +const SECOND_GROUP = 4; +const MILLI_SECOND_GROUP = 5; +const AM_PM_HOUR_GROUP = 6; +class AbstractTimeExpressionParser { + constructor(strictMode = false) { + this.cachedPrimaryPrefix = null; + this.cachedPrimarySuffix = null; + this.cachedPrimaryTimePattern = null; + this.cachedFollowingPhase = null; + this.cachedFollowingSuffix = null; + this.cachedFollowingTimePatten = null; + this.strictMode = strictMode; + } + patternFlags() { + return "i"; + } + primaryPatternLeftBoundary() { + return `(^|\\s|T|\\b)`; + } + primarySuffix() { + return `(?=\\W|$)`; + } + followingSuffix() { + return `(?=\\W|$)`; + } + pattern(context) { + return this.getPrimaryTimePatternThroughCache(); + } + extract(context, match) { + const startComponents = this.extractPrimaryTimeComponents(context, match); + if (!startComponents) { + match.index += match[0].length; + return null; + } + const index = match.index + match[1].length; + const text = match[0].substring(match[1].length); + const result = context.createParsingResult(index, text, startComponents); + match.index += match[0].length; + const remainingText = context.text.substring(match.index); + const followingPattern = this.getFollowingTimePatternThroughCache(); + const followingMatch = followingPattern.exec(remainingText); + if (text.match(/^\d{3,4}/) && followingMatch && followingMatch[0].match(/^\s*([+-])\s*\d{2,4}$/)) { + return null; + } + if (!followingMatch || followingMatch[0].match(/^\s*([+-])\s*\d{3,4}$/)) { + return this.checkAndReturnWithoutFollowingPattern(result); + } + result.end = this.extractFollowingTimeComponents(context, followingMatch, result); + if (result.end) { + result.text += followingMatch[0]; + } + return this.checkAndReturnWithFollowingPattern(result); + } + extractPrimaryTimeComponents(context, match, strict = false) { + const components = context.createParsingComponents(); + let minute = 0; + let meridiem = null; + let hour = parseInt(match[HOUR_GROUP]); + if (hour > 100) { + if (this.strictMode || match[MINUTE_GROUP] != null) { + return null; + } + minute = hour % 100; + hour = Math.floor(hour / 100); + } + if (hour > 24) { + return null; + } + if (match[MINUTE_GROUP] != null) { + if (match[MINUTE_GROUP].length == 1 && !match[AM_PM_HOUR_GROUP]) { + return null; + } + minute = parseInt(match[MINUTE_GROUP]); + } + if (minute >= 60) { + return null; + } + if (hour > 12) { + meridiem = esm_Meridiem.PM; + } + if (match[AM_PM_HOUR_GROUP] != null) { + if (hour > 12) return null; + const ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase(); + if (ampm == "a") { + meridiem = esm_Meridiem.AM; + if (hour == 12) { + hour = 0; + } + } + if (ampm == "p") { + meridiem = esm_Meridiem.PM; + if (hour != 12) { + hour += 12; + } + } + } + components.assign("hour", hour); + components.assign("minute", minute); + if (meridiem !== null) { + components.assign("meridiem", meridiem); + } else { + if (hour < 12) { + components.imply("meridiem", esm_Meridiem.AM); + } else { + components.imply("meridiem", esm_Meridiem.PM); + } + } + if (match[MILLI_SECOND_GROUP] != null) { + const millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3)); + if (millisecond >= 1000) return null; + components.assign("millisecond", millisecond); + } + if (match[SECOND_GROUP] != null) { + const second = parseInt(match[SECOND_GROUP]); + if (second >= 60) return null; + components.assign("second", second); + } + return components; + } + extractFollowingTimeComponents(context, match, result) { + const components = context.createParsingComponents(); + if (match[MILLI_SECOND_GROUP] != null) { + const millisecond = parseInt(match[MILLI_SECOND_GROUP].substring(0, 3)); + if (millisecond >= 1000) return null; + components.assign("millisecond", millisecond); + } + if (match[SECOND_GROUP] != null) { + const second = parseInt(match[SECOND_GROUP]); + if (second >= 60) return null; + components.assign("second", second); + } + let hour = parseInt(match[HOUR_GROUP]); + let minute = 0; + let meridiem = -1; + if (match[MINUTE_GROUP] != null) { + minute = parseInt(match[MINUTE_GROUP]); + } else if (hour > 100) { + minute = hour % 100; + hour = Math.floor(hour / 100); + } + if (minute >= 60 || hour > 24) { + return null; + } + if (hour >= 12) { + meridiem = esm_Meridiem.PM; + } + if (match[AM_PM_HOUR_GROUP] != null) { + if (hour > 12) { + return null; + } + const ampm = match[AM_PM_HOUR_GROUP][0].toLowerCase(); + if (ampm == "a") { + meridiem = esm_Meridiem.AM; + if (hour == 12) { + hour = 0; + if (!components.isCertain("day")) { + components.imply("day", components.get("day") + 1); + } + } + } + if (ampm == "p") { + meridiem = esm_Meridiem.PM; + if (hour != 12) hour += 12; + } + if (!result.start.isCertain("meridiem")) { + if (meridiem == esm_Meridiem.AM) { + result.start.imply("meridiem", esm_Meridiem.AM); + if (result.start.get("hour") == 12) { + result.start.assign("hour", 0); + } + } else { + result.start.imply("meridiem", esm_Meridiem.PM); + if (result.start.get("hour") != 12) { + result.start.assign("hour", result.start.get("hour") + 12); + } + } + } + } + components.assign("hour", hour); + components.assign("minute", minute); + if (meridiem >= 0) { + components.assign("meridiem", meridiem); + } else { + const startAtPM = result.start.isCertain("meridiem") && result.start.get("hour") > 12; + if (startAtPM) { + if (result.start.get("hour") - 12 > hour) { + components.imply("meridiem", esm_Meridiem.AM); + } else if (hour <= 12) { + components.assign("hour", hour + 12); + components.assign("meridiem", esm_Meridiem.PM); + } + } else if (hour > 12) { + components.imply("meridiem", esm_Meridiem.PM); + } else if (hour <= 12) { + components.imply("meridiem", esm_Meridiem.AM); + } + } + if (components.date().getTime() < result.start.date().getTime()) { + components.imply("day", components.get("day") + 1); + } + return components; + } + checkAndReturnWithoutFollowingPattern(result) { + if (result.text.match(/^\d$/)) { + return null; + } + if (result.text.match(/^\d\d\d+$/)) { + return null; + } + if (result.text.match(/\d[apAP]$/)) { + return null; + } + const endingWithNumbers = result.text.match(/[^\d:.](\d[\d.]+)$/); + if (endingWithNumbers) { + const endingNumbers = endingWithNumbers[1]; + if (this.strictMode) { + return null; + } + if (endingNumbers.includes(".") && !endingNumbers.match(/\d(\.\d{2})+$/)) { + return null; + } + const endingNumberVal = parseInt(endingNumbers); + if (endingNumberVal > 24) { + return null; + } + } + return result; + } + checkAndReturnWithFollowingPattern(result) { + if (result.text.match(/^\d+-\d+$/)) { + return null; + } + const endingWithNumbers = result.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/); + if (endingWithNumbers) { + if (this.strictMode) { + return null; + } + const startingNumbers = endingWithNumbers[1]; + const endingNumbers = endingWithNumbers[2]; + if (endingNumbers.includes(".") && !endingNumbers.match(/\d(\.\d{2})+$/)) { + return null; + } + const endingNumberVal = parseInt(endingNumbers); + const startingNumberVal = parseInt(startingNumbers); + if (endingNumberVal > 24 || startingNumberVal > 24) { + return null; + } + } + return result; + } + getPrimaryTimePatternThroughCache() { + const primaryPrefix = this.primaryPrefix(); + const primarySuffix = this.primarySuffix(); + if (this.cachedPrimaryPrefix === primaryPrefix && this.cachedPrimarySuffix === primarySuffix) { + return this.cachedPrimaryTimePattern; + } + this.cachedPrimaryTimePattern = primaryTimePattern(this.primaryPatternLeftBoundary(), primaryPrefix, primarySuffix, this.patternFlags()); + this.cachedPrimaryPrefix = primaryPrefix; + this.cachedPrimarySuffix = primarySuffix; + return this.cachedPrimaryTimePattern; + } + getFollowingTimePatternThroughCache() { + const followingPhase = this.followingPhase(); + const followingSuffix = this.followingSuffix(); + if (this.cachedFollowingPhase === followingPhase && this.cachedFollowingSuffix === followingSuffix) { + return this.cachedFollowingTimePatten; + } + this.cachedFollowingTimePatten = followingTimePatten(followingPhase, followingSuffix); + this.cachedFollowingPhase = followingPhase; + this.cachedFollowingSuffix = followingSuffix; + return this.cachedFollowingTimePatten; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/parsers/ENTimeExpressionParser.js + + +class ENTimeExpressionParser extends AbstractTimeExpressionParser { + constructor(strictMode) { + super(strictMode); + } + followingPhase() { + return "\\s*(?:\\-|\\–|\\~|\\〜|to|until|through|till|\\?)\\s*"; + } + primaryPrefix() { + return "(?:(?:at|from)\\s*)??"; + } + primarySuffix() { + return "(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"; + } + extractPrimaryTimeComponents(context, match) { + const components = super.extractPrimaryTimeComponents(context, match); + if (components) { + if (match[0].endsWith("night")) { + const hour = components.get("hour"); + if (hour >= 6 && hour < 12) { + components.assign("hour", components.get("hour") + 12); + components.assign("meridiem", esm_Meridiem.PM); + } else if (hour < 6) { + components.assign("meridiem", esm_Meridiem.AM); + } + } + if (match[0].endsWith("afternoon")) { + components.assign("meridiem", esm_Meridiem.PM); + const hour = components.get("hour"); + if (hour >= 0 && hour <= 6) { + components.assign("hour", components.get("hour") + 12); + } + } + if (match[0].endsWith("morning")) { + components.assign("meridiem", esm_Meridiem.AM); + const hour = components.get("hour"); + if (hour < 12) { + components.assign("hour", components.get("hour")); + } + } + } + return components; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/utils/timeunits.js function reverseTimeUnits(timeUnits) { const reversed = {}; - for (const key in timeUnits) { reversed[key] = -timeUnits[key]; } - return reversed; } - -exports.reverseTimeUnits = reverseTimeUnits; - function addImpliedTimeUnits(components, timeUnits) { const output = components.clone(); let date = components.dayjs(); - for (const key in timeUnits) { date = date.add(timeUnits[key], key); } - if ("day" in timeUnits || "d" in timeUnits || "week" in timeUnits || "month" in timeUnits || "year" in timeUnits) { output.imply("day", date.date()); output.imply("month", date.month() + 1); output.imply("year", date.year()); } - if ("second" in timeUnits || "minute" in timeUnits || "hour" in timeUnits) { output.imply("second", date.second()); output.imply("minute", date.minute()); output.imply("hour", date.hour()); } - return output; } +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/parsers/ENTimeUnitAgoFormatParser.js -exports.addImpliedTimeUnits = addImpliedTimeUnits; -/***/ }), -/***/ "./node_modules/css-loader/dist/runtime/api.js": -/***/ (function(module) { -"use strict"; - -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -module.exports = function (cssWithMappingToString) { - var list = []; // return the list of modules as css string - - list.toString = function toString() { - return this.map(function (item) { - var content = ""; - var needLayer = typeof item[5] !== "undefined"; - - if (item[4]) { - content += "@supports (".concat(item[4], ") {"); - } - - if (item[2]) { - content += "@media ".concat(item[2], " {"); - } - - if (needLayer) { - content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {"); - } - - content += cssWithMappingToString(item); - - if (needLayer) { - content += "}"; - } - - if (item[2]) { - content += "}"; - } - - if (item[4]) { - content += "}"; - } - - return content; - }).join(""); - }; // import a list of modules into the list - - - list.i = function i(modules, media, dedupe, supports, layer) { - if (typeof modules === "string") { - modules = [[null, modules, undefined]]; - } - - var alreadyImportedModules = {}; - - if (dedupe) { - for (var k = 0; k < this.length; k++) { - var id = this[k][0]; - - if (id != null) { - alreadyImportedModules[id] = true; - } - } - } - - for (var _k = 0; _k < modules.length; _k++) { - var item = [].concat(modules[_k]); - - if (dedupe && alreadyImportedModules[item[0]]) { - continue; - } - - if (typeof layer !== "undefined") { - if (typeof item[5] === "undefined") { - item[5] = layer; - } else { - item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}"); - item[5] = layer; - } - } - - if (media) { - if (!item[2]) { - item[2] = media; - } else { - item[1] = "@media ".concat(item[2], " {").concat(item[1], "}"); - item[2] = media; - } - } - - if (supports) { - if (!item[4]) { - item[4] = "".concat(supports); - } else { - item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}"); - item[4] = supports; - } - } - - list.push(item); - } - }; - - return list; -}; - -/***/ }), - -/***/ "./node_modules/css-loader/dist/runtime/noSourceMaps.js": -/***/ (function(module) { - -"use strict"; - - -module.exports = function (i) { - return i[1]; -}; - -/***/ }), - -/***/ "./node_modules/dayjs/dayjs.min.js": -/***/ (function(module) { - -!function (t, e) { - true ? module.exports = e() : 0; -}(this, function () { - "use strict"; - - var t = 1e3, - e = 6e4, - n = 36e5, - r = "millisecond", - i = "second", - s = "minute", - u = "hour", - a = "day", - o = "week", - f = "month", - h = "quarter", - c = "year", - d = "date", - $ = "Invalid Date", - l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, - y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, - M = { - name: "en", - weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_") - }, - m = function (t, e, n) { - var r = String(t); - return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t; - }, - g = { - s: m, - z: function (t) { - var e = -t.utcOffset(), - n = Math.abs(e), - r = Math.floor(n / 60), - i = n % 60; - return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0"); - }, - m: function t(e, n) { - if (e.date() < n.date()) return -t(n, e); - var r = 12 * (n.year() - e.year()) + (n.month() - e.month()), - i = e.clone().add(r, f), - s = n - i < 0, - u = e.clone().add(r + (s ? -1 : 1), f); - return +(-(r + (n - i) / (s ? i - u : u - i)) || 0); - }, - a: function (t) { - return t < 0 ? Math.ceil(t) || 0 : Math.floor(t); - }, - p: function (t) { - return { - M: f, - y: c, - w: o, - d: a, - D: d, - h: u, - m: s, - s: i, - ms: r, - Q: h - }[t] || String(t || "").toLowerCase().replace(/s$/, ""); - }, - u: function (t) { - return void 0 === t; - } - }, - D = "en", - v = {}; - - v[D] = M; - - var p = function (t) { - return t instanceof _; - }, - S = function (t, e, n) { - var r; - if (!t) return D; - if ("string" == typeof t) v[t] && (r = t), e && (v[t] = e, r = t);else { - var i = t.name; - v[i] = t, r = i; - } - return !n && r && (D = r), r || !n && D; - }, - w = function (t, e) { - if (p(t)) return t.clone(); - var n = "object" == typeof e ? e : {}; - return n.date = t, n.args = arguments, new _(n); - }, - O = g; - - O.l = S, O.i = p, O.w = function (t, e) { - return w(t, { - locale: e.$L, - utc: e.$u, - x: e.$x, - $offset: e.$offset - }); - }; - - var _ = function () { - function M(t) { - this.$L = S(t.locale, null, !0), this.parse(t); - } - - var m = M.prototype; - return m.parse = function (t) { - this.$d = function (t) { - var e = t.date, - n = t.utc; - if (null === e) return new Date(NaN); - if (O.u(e)) return new Date(); - if (e instanceof Date) return new Date(e); - - if ("string" == typeof e && !/Z$/i.test(e)) { - var r = e.match(l); - - if (r) { - var i = r[2] - 1 || 0, - s = (r[7] || "0").substring(0, 3); - return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s); - } - } - - return new Date(e); - }(t), this.$x = t.x || {}, this.init(); - }, m.init = function () { - var t = this.$d; - this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds(); - }, m.$utils = function () { - return O; - }, m.isValid = function () { - return !(this.$d.toString() === $); - }, m.isSame = function (t, e) { - var n = w(t); - return this.startOf(e) <= n && n <= this.endOf(e); - }, m.isAfter = function (t, e) { - return w(t) < this.startOf(e); - }, m.isBefore = function (t, e) { - return this.endOf(e) < w(t); - }, m.$g = function (t, e, n) { - return O.u(t) ? this[e] : this.set(n, t); - }, m.unix = function () { - return Math.floor(this.valueOf() / 1e3); - }, m.valueOf = function () { - return this.$d.getTime(); - }, m.startOf = function (t, e) { - var n = this, - r = !!O.u(e) || e, - h = O.p(t), - $ = function (t, e) { - var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n); - return r ? i : i.endOf(a); - }, - l = function (t, e) { - return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n); - }, - y = this.$W, - M = this.$M, - m = this.$D, - g = "set" + (this.$u ? "UTC" : ""); - - switch (h) { - case c: - return r ? $(1, 0) : $(31, 11); - - case f: - return r ? $(1, M) : $(0, M + 1); - - case o: - var D = this.$locale().weekStart || 0, - v = (y < D ? y + 7 : y) - D; - return $(r ? m - v : m + (6 - v), M); - - case a: - case d: - return l(g + "Hours", 0); - - case u: - return l(g + "Minutes", 1); - - case s: - return l(g + "Seconds", 2); - - case i: - return l(g + "Milliseconds", 3); - - default: - return this.clone(); - } - }, m.endOf = function (t) { - return this.startOf(t, !1); - }, m.$set = function (t, e) { - var n, - o = O.p(t), - h = "set" + (this.$u ? "UTC" : ""), - $ = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o], - l = o === a ? this.$D + (e - this.$W) : e; - - if (o === f || o === c) { - var y = this.clone().set(d, 1); - y.$d[$](l), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d; - } else $ && this.$d[$](l); - - return this.init(), this; - }, m.set = function (t, e) { - return this.clone().$set(t, e); - }, m.get = function (t) { - return this[O.p(t)](); - }, m.add = function (r, h) { - var d, - $ = this; - r = Number(r); - - var l = O.p(h), - y = function (t) { - var e = w($); - return O.w(e.date(e.date() + Math.round(t * r)), $); - }; - - if (l === f) return this.set(f, this.$M + r); - if (l === c) return this.set(c, this.$y + r); - if (l === a) return y(1); - if (l === o) return y(7); - var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[l] || 1, - m = this.$d.getTime() + r * M; - return O.w(m, this); - }, m.subtract = function (t, e) { - return this.add(-1 * t, e); - }, m.format = function (t) { - var e = this; - if (!this.isValid()) return $; - - var n = t || "YYYY-MM-DDTHH:mm:ssZ", - r = O.z(this), - i = this.$locale(), - s = this.$H, - u = this.$m, - a = this.$M, - o = i.weekdays, - f = i.months, - h = function (t, r, i, s) { - return t && (t[r] || t(e, n)) || i[r].substr(0, s); - }, - c = function (t) { - return O.s(s % 12 || 12, t, "0"); - }, - d = i.meridiem || function (t, e, n) { - var r = t < 12 ? "AM" : "PM"; - return n ? r.toLowerCase() : r; - }, - l = { - YY: String(this.$y).slice(-2), - YYYY: this.$y, - M: a + 1, - MM: O.s(a + 1, 2, "0"), - MMM: h(i.monthsShort, a, f, 3), - MMMM: h(f, a), - D: this.$D, - DD: O.s(this.$D, 2, "0"), - d: String(this.$W), - dd: h(i.weekdaysMin, this.$W, o, 2), - ddd: h(i.weekdaysShort, this.$W, o, 3), - dddd: o[this.$W], - H: String(s), - HH: O.s(s, 2, "0"), - h: c(1), - hh: c(2), - a: d(s, u, !0), - A: d(s, u, !1), - m: String(u), - mm: O.s(u, 2, "0"), - s: String(this.$s), - ss: O.s(this.$s, 2, "0"), - SSS: O.s(this.$ms, 3, "0"), - Z: r - }; - - return n.replace(y, function (t, e) { - return e || l[t] || r.replace(":", ""); - }); - }, m.utcOffset = function () { - return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); - }, m.diff = function (r, d, $) { - var l, - y = O.p(d), - M = w(r), - m = (M.utcOffset() - this.utcOffset()) * e, - g = this - M, - D = O.m(this, M); - return D = (l = {}, l[c] = D / 12, l[f] = D, l[h] = D / 3, l[o] = (g - m) / 6048e5, l[a] = (g - m) / 864e5, l[u] = g / n, l[s] = g / e, l[i] = g / t, l)[y] || g, $ ? D : O.a(D); - }, m.daysInMonth = function () { - return this.endOf(f).$D; - }, m.$locale = function () { - return v[this.$L]; - }, m.locale = function (t, e) { - if (!t) return this.$L; - var n = this.clone(), - r = S(t, e, !0); - return r && (n.$L = r), n; - }, m.clone = function () { - return O.w(this.$d, this); - }, m.toDate = function () { - return new Date(this.valueOf()); - }, m.toJSON = function () { - return this.isValid() ? this.toISOString() : null; - }, m.toISOString = function () { - return this.$d.toISOString(); - }, m.toString = function () { - return this.$d.toUTCString(); - }, M; - }(), - b = _.prototype; - - return w.prototype = b, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) { - b[t[1]] = function (e) { - return this.$g(e, t[0], t[1]); - }; - }), w.extend = function (t, e) { - return t.$i || (t(e, _, w), t.$i = !0), w; - }, w.locale = S, w.isDayjs = p, w.unix = function (t) { - return w(1e3 * t); - }, w.en = v[D], w.Ls = v, w.p = {}, w; -}); - -/***/ }), - -/***/ "./node_modules/dayjs/plugin/quarterOfYear.js": -/***/ (function(module) { - -!function (t, n) { - true ? module.exports = n() : 0; -}(this, function () { - "use strict"; - - var t = "month", - n = "quarter"; - return function (e, i) { - var r = i.prototype; - - r.quarter = function (t) { - return this.$utils().u(t) ? Math.ceil((this.month() + 1) / 3) : this.month(this.month() % 3 + 3 * (t - 1)); - }; - - var s = r.add; - - r.add = function (e, i) { - return e = Number(e), this.$utils().p(i) === n ? this.add(3 * e, t) : s.bind(this)(e, i); - }; - - var u = r.startOf; - - r.startOf = function (e, i) { - var r = this.$utils(), - s = !!r.u(i) || i; - - if (r.p(e) === n) { - var o = this.quarter() - 1; - return s ? this.month(3 * o).startOf(t).startOf("day") : this.month(3 * o + 2).endOf(t).endOf("day"); - } - - return u.bind(this)(e, i); - }; - }; -}); - -/***/ }), - -/***/ "./node_modules/css-loader/dist/cjs.js!./src/search.css": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"); -/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); -/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); -// Imports - - -var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); -// Module -___CSS_LOADER_EXPORT___.push([module.id, ".tapi-search-result {\n color: #000;\n padding: 5px;\n}\n\n.tapi-search-result:hover, .tapi-search-result-selected {\n background-color: #E7E6E6;\n}\n\n", ""]); -// Exports -/* harmony default export */ __webpack_exports__["Z"] = (___CSS_LOADER_EXPORT___); - - -/***/ }), - -/***/ "./node_modules/css-loader/dist/cjs.js!./src/status.css": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"); -/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); -/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); -// Imports - - -var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); -// Module -___CSS_LOADER_EXPORT___.push([module.id, ".tapi-dropdown {\n position: relative;\n display: inline-block;\n}\n\n.tapi-dropdown-content {\n display: none;\n position: absolute;\n min-width: 200px;\n overflow: auto;\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n z-index: 1;\n color: #000;\n background-color: #fff;\n}\n\n.show {\n display: block;\n}\n", ""]); -// Exports -/* harmony default export */ __webpack_exports__["Z"] = (___CSS_LOADER_EXPORT___); - - -/***/ }), - -/***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js": -/***/ (function(module) { - -"use strict"; - - -var stylesInDOM = []; - -function getIndexByIdentifier(identifier) { - var result = -1; - - for (var i = 0; i < stylesInDOM.length; i++) { - if (stylesInDOM[i].identifier === identifier) { - result = i; - break; - } +const ENTimeUnitAgoFormatParser_PATTERN = new RegExp(`(${TIME_UNITS_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`, "i"); +const STRICT_PATTERN = new RegExp(`(${TIME_UNITS_NO_ABBR_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`, "i"); +class ENTimeUnitAgoFormatParser extends AbstractParserWithWordBoundaryChecking { + constructor(strictMode) { + super(); + this.strictMode = strictMode; } + innerPattern() { + return this.strictMode ? STRICT_PATTERN : ENTimeUnitAgoFormatParser_PATTERN; + } + innerExtract(context, match) { + const timeUnits = parseTimeUnits(match[1]); + const outputTimeUnits = reverseTimeUnits(timeUnits); + return results_ParsingComponents.createRelativeFromReference(context.reference, outputTimeUnits); + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/parsers/ENTimeUnitLaterFormatParser.js + + +const ENTimeUnitLaterFormatParser_PATTERN = new RegExp(`(${TIME_UNITS_PATTERN})\\s{0,5}(?:later|after|from now|henceforth|forward|out)` + "(?=(?:\\W|$))", "i"); +const ENTimeUnitLaterFormatParser_STRICT_PATTERN = new RegExp("" + "(" + TIME_UNITS_NO_ABBR_PATTERN + ")" + "(later|from now)" + "(?=(?:\\W|$))", "i"); +const GROUP_NUM_TIMEUNITS = 1; +class ENTimeUnitLaterFormatParser extends AbstractParserWithWordBoundaryChecking { + constructor(strictMode) { + super(); + this.strictMode = strictMode; + } + innerPattern() { + return this.strictMode ? ENTimeUnitLaterFormatParser_STRICT_PATTERN : ENTimeUnitLaterFormatParser_PATTERN; + } + innerExtract(context, match) { + const fragments = parseTimeUnits(match[GROUP_NUM_TIMEUNITS]); + return results_ParsingComponents.createRelativeFromReference(context.reference, fragments); + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/common/abstractRefiners.js +class Filter { + refine(context, results) { + return results.filter(r => this.isValid(context, r)); + } +} +class MergingRefiner { + refine(context, results) { + if (results.length < 2) { + return results; + } + const mergedResults = []; + let curResult = results[0]; + let nextResult = null; + for (let i = 1; i < results.length; i++) { + nextResult = results[i]; + const textBetween = context.text.substring(curResult.index + curResult.text.length, nextResult.index); + if (!this.shouldMergeResults(textBetween, curResult, nextResult, context)) { + mergedResults.push(curResult); + curResult = nextResult; + } else { + const left = curResult; + const right = nextResult; + const mergedResult = this.mergeResults(textBetween, left, right, context); + context.debug(() => { + console.log(`${this.constructor.name} merged ${left} and ${right} into ${mergedResult}`); + }); + curResult = mergedResult; + } + } + if (curResult != null) { + mergedResults.push(curResult); + } + return mergedResults; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/common/refiners/AbstractMergeDateRangeRefiner.js + +class AbstractMergeDateRangeRefiner extends MergingRefiner { + shouldMergeResults(textBetween, currentResult, nextResult) { + return !currentResult.end && !nextResult.end && textBetween.match(this.patternBetween()) != null; + } + mergeResults(textBetween, fromResult, toResult) { + if (!fromResult.start.isOnlyWeekdayComponent() && !toResult.start.isOnlyWeekdayComponent()) { + toResult.start.getCertainComponents().forEach(key => { + if (!fromResult.start.isCertain(key)) { + fromResult.start.imply(key, toResult.start.get(key)); + } + }); + fromResult.start.getCertainComponents().forEach(key => { + if (!toResult.start.isCertain(key)) { + toResult.start.imply(key, fromResult.start.get(key)); + } + }); + } + if (fromResult.start.date().getTime() > toResult.start.date().getTime()) { + let fromMoment = fromResult.start.dayjs(); + let toMoment = toResult.start.dayjs(); + if (toResult.start.isOnlyWeekdayComponent() && toMoment.add(7, "days").isAfter(fromMoment)) { + toMoment = toMoment.add(7, "days"); + toResult.start.imply("day", toMoment.date()); + toResult.start.imply("month", toMoment.month() + 1); + toResult.start.imply("year", toMoment.year()); + } else if (fromResult.start.isOnlyWeekdayComponent() && fromMoment.add(-7, "days").isBefore(toMoment)) { + fromMoment = fromMoment.add(-7, "days"); + fromResult.start.imply("day", fromMoment.date()); + fromResult.start.imply("month", fromMoment.month() + 1); + fromResult.start.imply("year", fromMoment.year()); + } else if (toResult.start.isDateWithUnknownYear() && toMoment.add(1, "years").isAfter(fromMoment)) { + toMoment = toMoment.add(1, "years"); + toResult.start.imply("year", toMoment.year()); + } else if (fromResult.start.isDateWithUnknownYear() && fromMoment.add(-1, "years").isBefore(toMoment)) { + fromMoment = fromMoment.add(-1, "years"); + fromResult.start.imply("year", fromMoment.year()); + } else { + [toResult, fromResult] = [fromResult, toResult]; + } + } + const result = fromResult.clone(); + result.start = fromResult.start; + result.end = toResult.start; + result.index = Math.min(fromResult.index, toResult.index); + if (fromResult.index < toResult.index) { + result.text = fromResult.text + textBetween + toResult.text; + } else { + result.text = toResult.text + textBetween + fromResult.text; + } + return result; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/refiners/ENMergeDateRangeRefiner.js + +class ENMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner { + patternBetween() { + return /^\s*(to|-|–|until|through|till)\s*$/i; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/calculation/mergingCalculation.js + + +function mergeDateTimeResult(dateResult, timeResult) { + const result = dateResult.clone(); + const beginDate = dateResult.start; + const beginTime = timeResult.start; + result.start = mergeDateTimeComponent(beginDate, beginTime); + if (dateResult.end != null || timeResult.end != null) { + const endDate = dateResult.end == null ? dateResult.start : dateResult.end; + const endTime = timeResult.end == null ? timeResult.start : timeResult.end; + const endDateTime = mergeDateTimeComponent(endDate, endTime); + if (dateResult.end == null && endDateTime.date().getTime() < result.start.date().getTime()) { + const nextDayJs = endDateTime.dayjs().add(1, "day"); + if (endDateTime.isCertain("day")) { + dayjs_assignSimilarDate(endDateTime, nextDayJs); + } else { + implySimilarDate(endDateTime, nextDayJs); + } + } + result.end = endDateTime; + } return result; } - -function modulesToDom(list, options) { - var idCountMap = {}; - var identifiers = []; - - for (var i = 0; i < list.length; i++) { - var item = list[i]; - var id = options.base ? item[0] + options.base : item[0]; - var count = idCountMap[id] || 0; - var identifier = "".concat(id, " ").concat(count); - idCountMap[id] = count + 1; - var indexByIdentifier = getIndexByIdentifier(identifier); - var obj = { - css: item[1], - media: item[2], - sourceMap: item[3], - supports: item[4], - layer: item[5] - }; - - if (indexByIdentifier !== -1) { - stylesInDOM[indexByIdentifier].references++; - stylesInDOM[indexByIdentifier].updater(obj); +function mergeDateTimeComponent(dateComponent, timeComponent) { + const dateTimeComponent = dateComponent.clone(); + if (timeComponent.isCertain("hour")) { + dateTimeComponent.assign("hour", timeComponent.get("hour")); + dateTimeComponent.assign("minute", timeComponent.get("minute")); + if (timeComponent.isCertain("second")) { + dateTimeComponent.assign("second", timeComponent.get("second")); + if (timeComponent.isCertain("millisecond")) { + dateTimeComponent.assign("millisecond", timeComponent.get("millisecond")); + } else { + dateTimeComponent.imply("millisecond", timeComponent.get("millisecond")); + } } else { - var updater = addElementStyle(obj, options); - options.byIndex = i; - stylesInDOM.splice(i, 0, { - identifier: identifier, - updater: updater, - references: 1 - }); + dateTimeComponent.imply("second", timeComponent.get("second")); + dateTimeComponent.imply("millisecond", timeComponent.get("millisecond")); } - - identifiers.push(identifier); + } else { + dateTimeComponent.imply("hour", timeComponent.get("hour")); + dateTimeComponent.imply("minute", timeComponent.get("minute")); + dateTimeComponent.imply("second", timeComponent.get("second")); + dateTimeComponent.imply("millisecond", timeComponent.get("millisecond")); } - - return identifiers; + if (timeComponent.isCertain("timezoneOffset")) { + dateTimeComponent.assign("timezoneOffset", timeComponent.get("timezoneOffset")); + } + if (timeComponent.isCertain("meridiem")) { + dateTimeComponent.assign("meridiem", timeComponent.get("meridiem")); + } else if (timeComponent.get("meridiem") != null && dateTimeComponent.get("meridiem") == null) { + dateTimeComponent.imply("meridiem", timeComponent.get("meridiem")); + } + if (dateTimeComponent.get("meridiem") == esm_Meridiem.PM && dateTimeComponent.get("hour") < 12) { + if (timeComponent.isCertain("hour")) { + dateTimeComponent.assign("hour", dateTimeComponent.get("hour") + 12); + } else { + dateTimeComponent.imply("hour", dateTimeComponent.get("hour") + 12); + } + } + return dateTimeComponent; } +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/common/refiners/AbstractMergeDateTimeRefiner.js -function addElementStyle(obj, options) { - var api = options.domAPI(options); - api.update(obj); - var updater = function updater(newObj) { - if (newObj) { - if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) { +class AbstractMergeDateTimeRefiner extends MergingRefiner { + shouldMergeResults(textBetween, currentResult, nextResult) { + return (currentResult.start.isOnlyDate() && nextResult.start.isOnlyTime() || nextResult.start.isOnlyDate() && currentResult.start.isOnlyTime()) && textBetween.match(this.patternBetween()) != null; + } + mergeResults(textBetween, currentResult, nextResult) { + const result = currentResult.start.isOnlyDate() ? mergeDateTimeResult(currentResult, nextResult) : mergeDateTimeResult(nextResult, currentResult); + result.index = currentResult.index; + result.text = currentResult.text + textBetween + nextResult.text; + return result; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/refiners/ENMergeDateTimeRefiner.js + +class ENMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner { + patternBetween() { + return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$"); + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/common/refiners/ExtractTimezoneAbbrRefiner.js + +const TIMEZONE_NAME_PATTERN = new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)", "i"); +class ExtractTimezoneAbbrRefiner { + constructor(timezoneOverrides) { + this.timezoneOverrides = timezoneOverrides; + } + refine(context, results) { + const timezoneOverrides = context.option.timezones ?? {}; + results.forEach(result => { + const suffix = context.text.substring(result.index + result.text.length); + const match = TIMEZONE_NAME_PATTERN.exec(suffix); + if (!match) { return; } + const timezoneAbbr = match[1].toUpperCase(); + const refDate = result.start.date() ?? result.refDate ?? new Date(); + const tzOverrides = { + ...this.timezoneOverrides, + ...timezoneOverrides + }; + const extractedTimezoneOffset = toTimezoneOffset(timezoneAbbr, refDate, tzOverrides); + if (extractedTimezoneOffset == null) { + return; + } + context.debug(() => { + console.log(`Extracting timezone: '${timezoneAbbr}' into: ${extractedTimezoneOffset} for: ${result.start}`); + }); + const currentTimezoneOffset = result.start.get("timezoneOffset"); + if (currentTimezoneOffset !== null && extractedTimezoneOffset != currentTimezoneOffset) { + if (result.start.isCertain("timezoneOffset")) { + return; + } + if (timezoneAbbr != match[1]) { + return; + } + } + if (result.start.isOnlyDate()) { + if (timezoneAbbr != match[1]) { + return; + } + } + result.text += match[0]; + if (!result.start.isCertain("timezoneOffset")) { + result.start.assign("timezoneOffset", extractedTimezoneOffset); + } + if (result.end != null && !result.end.isCertain("timezoneOffset")) { + result.end.assign("timezoneOffset", extractedTimezoneOffset); + } + }); + return results; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/common/refiners/ExtractTimezoneOffsetRefiner.js +const TIMEZONE_OFFSET_PATTERN = new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?", "i"); +const TIMEZONE_OFFSET_SIGN_GROUP = 1; +const TIMEZONE_OFFSET_HOUR_OFFSET_GROUP = 2; +const TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP = 3; +class ExtractTimezoneOffsetRefiner { + refine(context, results) { + results.forEach(function (result) { + if (result.start.isCertain("timezoneOffset")) { + return; + } + const suffix = context.text.substring(result.index + result.text.length); + const match = TIMEZONE_OFFSET_PATTERN.exec(suffix); + if (!match) { + return; + } + context.debug(() => { + console.log(`Extracting timezone: '${match[0]}' into : ${result}`); + }); + const hourOffset = parseInt(match[TIMEZONE_OFFSET_HOUR_OFFSET_GROUP]); + const minuteOffset = parseInt(match[TIMEZONE_OFFSET_MINUTE_OFFSET_GROUP] || "0"); + let timezoneOffset = hourOffset * 60 + minuteOffset; + if (timezoneOffset > 14 * 60) { + return; + } + if (match[TIMEZONE_OFFSET_SIGN_GROUP] === "-") { + timezoneOffset = -timezoneOffset; + } + if (result.end != null) { + result.end.assign("timezoneOffset", timezoneOffset); + } + result.start.assign("timezoneOffset", timezoneOffset); + result.text += match[0]; + }); + return results; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/common/refiners/OverlapRemovalRefiner.js +class OverlapRemovalRefiner { + refine(context, results) { + if (results.length < 2) { + return results; + } + const filteredResults = []; + let prevResult = results[0]; + for (let i = 1; i < results.length; i++) { + const result = results[i]; + if (result.index < prevResult.index + prevResult.text.length) { + if (result.text.length > prevResult.text.length) { + prevResult = result; + } + } else { + filteredResults.push(prevResult); + prevResult = result; + } + } + if (prevResult != null) { + filteredResults.push(prevResult); + } + return filteredResults; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/common/refiners/ForwardDateRefiner.js - api.update(obj = newObj); + +class ForwardDateRefiner { + refine(context, results) { + if (!context.option.forwardDate) { + return results; + } + results.forEach(function (result) { + let refMoment = dayjs_min(context.refDate); + if (result.start.isOnlyTime() && refMoment.isAfter(result.start.dayjs())) { + refMoment = refMoment.add(1, "day"); + implySimilarDate(result.start, refMoment); + if (result.end && result.end.isOnlyTime()) { + implySimilarDate(result.end, refMoment); + if (result.start.dayjs().isAfter(result.end.dayjs())) { + refMoment = refMoment.add(1, "day"); + implySimilarDate(result.end, refMoment); + } + } + } + if (result.start.isOnlyWeekdayComponent() && refMoment.isAfter(result.start.dayjs())) { + if (refMoment.day() >= result.start.get("weekday")) { + refMoment = refMoment.day(result.start.get("weekday") + 7); + } else { + refMoment = refMoment.day(result.start.get("weekday")); + } + result.start.imply("day", refMoment.date()); + result.start.imply("month", refMoment.month() + 1); + result.start.imply("year", refMoment.year()); + context.debug(() => { + console.log(`Forward weekly adjusted for ${result} (${result.start})`); + }); + if (result.end && result.end.isOnlyWeekdayComponent()) { + if (refMoment.day() > result.end.get("weekday")) { + refMoment = refMoment.day(result.end.get("weekday") + 7); + } else { + refMoment = refMoment.day(result.end.get("weekday")); + } + result.end.imply("day", refMoment.date()); + result.end.imply("month", refMoment.month() + 1); + result.end.imply("year", refMoment.year()); + context.debug(() => { + console.log(`Forward weekly adjusted for ${result} (${result.end})`); + }); + } + } + if (result.start.isDateWithUnknownYear() && refMoment.isAfter(result.start.dayjs())) { + for (let i = 0; i < 3 && refMoment.isAfter(result.start.dayjs()); i++) { + result.start.imply("year", result.start.get("year") + 1); + context.debug(() => { + console.log(`Forward yearly adjusted for ${result} (${result.start})`); + }); + if (result.end && !result.end.isCertain("year")) { + result.end.imply("year", result.end.get("year") + 1); + context.debug(() => { + console.log(`Forward yearly adjusted for ${result} (${result.end})`); + }); + } + } + } + }); + return results; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/common/refiners/UnlikelyFormatFilter.js + +class UnlikelyFormatFilter extends Filter { + constructor(strictMode) { + super(); + this.strictMode = strictMode; + } + isValid(context, result) { + if (result.text.replace(" ", "").match(/^\d*(\.\d*)?$/)) { + context.debug(() => { + console.log(`Removing unlikely result '${result.text}'`); + }); + return false; + } + if (!result.start.isValidDate()) { + context.debug(() => { + console.log(`Removing invalid result: ${result} (${result.start})`); + }); + return false; + } + if (result.end && !result.end.isValidDate()) { + context.debug(() => { + console.log(`Removing invalid result: ${result} (${result.end})`); + }); + return false; + } + if (this.strictMode) { + return this.isStrictModeValid(context, result); + } + return true; + } + isStrictModeValid(context, result) { + if (result.start.isOnlyWeekdayComponent()) { + context.debug(() => { + console.log(`(Strict) Removing weekday only component: ${result} (${result.end})`); + }); + return false; + } + if (result.start.isOnlyTime() && (!result.start.isCertain("hour") || !result.start.isCertain("minute"))) { + context.debug(() => { + console.log(`(Strict) Removing uncertain time component: ${result} (${result.end})`); + }); + return false; + } + return true; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/common/parsers/ISOFormatParser.js + +const ISOFormatParser_PATTERN = new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})" + "(?:T" + "([0-9]{1,2}):([0-9]{1,2})" + "(?:" + ":([0-9]{1,2})(?:\\.(\\d{1,4}))?" + ")?" + "(?:" + "Z|([+-]\\d{2}):?(\\d{2})?" + ")?" + ")?" + "(?=\\W|$)", "i"); +const ISOFormatParser_YEAR_NUMBER_GROUP = 1; +const ISOFormatParser_MONTH_NUMBER_GROUP = 2; +const ISOFormatParser_DATE_NUMBER_GROUP = 3; +const HOUR_NUMBER_GROUP = 4; +const MINUTE_NUMBER_GROUP = 5; +const SECOND_NUMBER_GROUP = 6; +const MILLISECOND_NUMBER_GROUP = 7; +const TZD_HOUR_OFFSET_GROUP = 8; +const TZD_MINUTE_OFFSET_GROUP = 9; +class ISOFormatParser extends AbstractParserWithWordBoundaryChecking { + innerPattern() { + return ISOFormatParser_PATTERN; + } + innerExtract(context, match) { + const components = {}; + components["year"] = parseInt(match[ISOFormatParser_YEAR_NUMBER_GROUP]); + components["month"] = parseInt(match[ISOFormatParser_MONTH_NUMBER_GROUP]); + components["day"] = parseInt(match[ISOFormatParser_DATE_NUMBER_GROUP]); + if (match[HOUR_NUMBER_GROUP] != null) { + components["hour"] = parseInt(match[HOUR_NUMBER_GROUP]); + components["minute"] = parseInt(match[MINUTE_NUMBER_GROUP]); + if (match[SECOND_NUMBER_GROUP] != null) { + components["second"] = parseInt(match[SECOND_NUMBER_GROUP]); + } + if (match[MILLISECOND_NUMBER_GROUP] != null) { + components["millisecond"] = parseInt(match[MILLISECOND_NUMBER_GROUP]); + } + if (match[TZD_HOUR_OFFSET_GROUP] == null) { + components["timezoneOffset"] = 0; + } else { + const hourOffset = parseInt(match[TZD_HOUR_OFFSET_GROUP]); + let minuteOffset = 0; + if (match[TZD_MINUTE_OFFSET_GROUP] != null) { + minuteOffset = parseInt(match[TZD_MINUTE_OFFSET_GROUP]); + } + let offset = hourOffset * 60; + if (offset < 0) { + offset -= minuteOffset; + } else { + offset += minuteOffset; + } + components["timezoneOffset"] = offset; + } + } + return components; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/common/refiners/MergeWeekdayComponentRefiner.js + +class MergeWeekdayComponentRefiner extends MergingRefiner { + mergeResults(textBetween, currentResult, nextResult) { + const newResult = nextResult.clone(); + newResult.index = currentResult.index; + newResult.text = currentResult.text + textBetween + newResult.text; + newResult.start.assign("weekday", currentResult.start.get("weekday")); + if (newResult.end) { + newResult.end.assign("weekday", currentResult.start.get("weekday")); + } + return newResult; + } + shouldMergeResults(textBetween, currentResult, nextResult) { + const weekdayThenNormalDate = currentResult.start.isOnlyWeekdayComponent() && !currentResult.start.isCertain("hour") && nextResult.start.isCertain("day"); + return weekdayThenNormalDate && textBetween.match(/^,?\s*$/) != null; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/configurations.js + + + + + + + +function includeCommonConfiguration(configuration, strictMode = false) { + configuration.parsers.unshift(new ISOFormatParser()); + configuration.refiners.unshift(new MergeWeekdayComponentRefiner()); + configuration.refiners.unshift(new ExtractTimezoneOffsetRefiner()); + configuration.refiners.unshift(new OverlapRemovalRefiner()); + configuration.refiners.push(new ExtractTimezoneAbbrRefiner()); + configuration.refiners.push(new OverlapRemovalRefiner()); + configuration.refiners.push(new ForwardDateRefiner()); + configuration.refiners.push(new UnlikelyFormatFilter(strictMode)); + return configuration; +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/common/casualReferences.js + + + + +function now(reference) { + const targetDate = dayjs_min(reference.instant); + const component = new results_ParsingComponents(reference, {}); + dayjs_assignSimilarDate(component, targetDate); + assignSimilarTime(component, targetDate); + if (reference.timezoneOffset !== null) { + component.assign("timezoneOffset", targetDate.utcOffset()); + } + return component; +} +function today(reference) { + const targetDate = dayjs_min(reference.instant); + const component = new results_ParsingComponents(reference, {}); + dayjs_assignSimilarDate(component, targetDate); + implySimilarTime(component, targetDate); + return component; +} +function yesterday(reference) { + return theDayBefore(reference, 1); +} +function theDayBefore(reference, numDay) { + return theDayAfter(reference, -numDay); +} +function tomorrow(reference) { + return theDayAfter(reference, 1); +} +function theDayAfter(reference, nDays) { + let targetDate = dayjs_min(reference.instant); + const component = new results_ParsingComponents(reference, {}); + targetDate = targetDate.add(nDays, "day"); + dayjs_assignSimilarDate(component, targetDate); + implySimilarTime(component, targetDate); + return component; +} +function tonight(reference, implyHour = 22) { + const targetDate = dayjs_min(reference.instant); + const component = new results_ParsingComponents(reference, {}); + component.imply("hour", implyHour); + component.imply("meridiem", esm_Meridiem.PM); + dayjs_assignSimilarDate(component, targetDate); + return component; +} +function lastNight(reference, implyHour = 0) { + let targetDate = dayjs(reference.instant); + const component = new ParsingComponents(reference, {}); + if (targetDate.hour() < 6) { + targetDate = targetDate.add(-1, "day"); + } + assignSimilarDate(component, targetDate); + component.imply("hour", implyHour); + return component; +} +function evening(reference, implyHour = 20) { + const component = new results_ParsingComponents(reference, {}); + component.imply("meridiem", esm_Meridiem.PM); + component.imply("hour", implyHour); + return component; +} +function yesterdayEvening(reference, implyHour = 20) { + let targetDate = dayjs(reference.instant); + const component = new ParsingComponents(reference, {}); + targetDate = targetDate.add(-1, "day"); + assignSimilarDate(component, targetDate); + component.imply("hour", implyHour); + component.imply("meridiem", Meridiem.PM); + return component; +} +function midnight(reference) { + const component = new results_ParsingComponents(reference, {}); + const targetDate = dayjs_min(reference.instant); + if (targetDate.hour() > 2) { + implyTheNextDay(component, targetDate); + } + component.assign("hour", 0); + component.imply("minute", 0); + component.imply("second", 0); + component.imply("millisecond", 0); + return component; +} +function morning(reference, implyHour = 6) { + const component = new results_ParsingComponents(reference, {}); + component.imply("meridiem", esm_Meridiem.AM); + component.imply("hour", implyHour); + component.imply("minute", 0); + component.imply("second", 0); + component.imply("millisecond", 0); + return component; +} +function afternoon(reference, implyHour = 15) { + const component = new results_ParsingComponents(reference, {}); + component.imply("meridiem", esm_Meridiem.PM); + component.imply("hour", implyHour); + component.imply("minute", 0); + component.imply("second", 0); + component.imply("millisecond", 0); + return component; +} +function noon(reference) { + const component = new results_ParsingComponents(reference, {}); + component.imply("meridiem", esm_Meridiem.AM); + component.imply("hour", 12); + component.imply("minute", 0); + component.imply("second", 0); + component.imply("millisecond", 0); + return component; +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/parsers/ENCasualDateParser.js + + + + +const ENCasualDateParser_PATTERN = /(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i; +class ENCasualDateParser extends AbstractParserWithWordBoundaryChecking { + innerPattern(context) { + return ENCasualDateParser_PATTERN; + } + innerExtract(context, match) { + let targetDate = dayjs_min(context.refDate); + const lowerText = match[0].toLowerCase(); + const component = context.createParsingComponents(); + switch (lowerText) { + case "now": + return now(context.reference); + case "today": + return today(context.reference); + case "yesterday": + return yesterday(context.reference); + case "tomorrow": + case "tmr": + case "tmrw": + return tomorrow(context.reference); + case "tonight": + return tonight(context.reference); + default: + if (lowerText.match(/last\s*night/)) { + if (targetDate.hour() > 6) { + targetDate = targetDate.add(-1, "day"); + } + dayjs_assignSimilarDate(component, targetDate); + component.imply("hour", 0); + } + break; + } + return component; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/parsers/ENCasualTimeParser.js + + +const ENCasualTimeParser_PATTERN = /(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|midday|noon)(?=\W|$)/i; +class ENCasualTimeParser extends AbstractParserWithWordBoundaryChecking { + innerPattern() { + return ENCasualTimeParser_PATTERN; + } + innerExtract(context, match) { + switch (match[1].toLowerCase()) { + case "afternoon": + return afternoon(context.reference); + case "evening": + case "night": + return evening(context.reference); + case "midnight": + return midnight(context.reference); + case "morning": + return morning(context.reference); + case "noon": + case "midday": + return noon(context.reference); + } + return null; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/common/calculation/weekdays.js + + + +function createParsingComponentsAtWeekday(reference, weekday, modifier) { + const refDate = reference.getDateWithAdjustedTimezone(); + const daysToWeekday = getDaysToWeekday(refDate, weekday, modifier); + let components = new results_ParsingComponents(reference); + components = addImpliedTimeUnits(components, { + "day": daysToWeekday + }); + components.assign("weekday", weekday); + return components; +} +function getDaysToWeekday(refDate, weekday, modifier) { + const refWeekday = refDate.getDay(); + switch (modifier) { + case "this": + return getDaysForwardToWeekday(refDate, weekday); + case "last": + return getBackwardDaysToWeekday(refDate, weekday); + case "next": + if (refWeekday == Weekday.SUNDAY) { + return weekday == Weekday.SUNDAY ? 7 : weekday; + } + if (refWeekday == Weekday.SATURDAY) { + if (weekday == Weekday.SATURDAY) return 7; + if (weekday == Weekday.SUNDAY) return 8; + return 1 + weekday; + } + if (weekday < refWeekday && weekday != Weekday.SUNDAY) { + return getDaysForwardToWeekday(refDate, weekday); + } else { + return getDaysForwardToWeekday(refDate, weekday) + 7; + } + } + return getDaysToWeekdayClosest(refDate, weekday); +} +function getDaysToWeekdayClosest(refDate, weekday) { + const backward = getBackwardDaysToWeekday(refDate, weekday); + const forward = getDaysForwardToWeekday(refDate, weekday); + return forward < -backward ? forward : backward; +} +function getDaysForwardToWeekday(refDate, weekday) { + const refWeekday = refDate.getDay(); + let forwardCount = weekday - refWeekday; + if (forwardCount < 0) { + forwardCount += 7; + } + return forwardCount; +} +function getBackwardDaysToWeekday(refDate, weekday) { + const refWeekday = refDate.getDay(); + let backwardCount = weekday - refWeekday; + if (backwardCount >= 0) { + backwardCount -= 7; + } + return backwardCount; +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/parsers/ENWeekdayParser.js + + + + +const ENWeekdayParser_PATTERN = new RegExp("(?:(?:\\,|\\(|\\()\\s*)?" + "(?:on\\s*?)?" + "(?:(this|last|past|next)\\s*)?" + `(${matchAnyPattern(WEEKDAY_DICTIONARY)})` + "(?:\\s*(?:\\,|\\)|\\)))?" + "(?:\\s*(this|last|past|next)\\s*week)?" + "(?=\\W|$)", "i"); +const ENWeekdayParser_PREFIX_GROUP = 1; +const WEEKDAY_GROUP = 2; +const POSTFIX_GROUP = 3; +class ENWeekdayParser extends AbstractParserWithWordBoundaryChecking { + innerPattern() { + return ENWeekdayParser_PATTERN; + } + innerExtract(context, match) { + const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase(); + const weekday = WEEKDAY_DICTIONARY[dayOfWeek]; + const prefix = match[ENWeekdayParser_PREFIX_GROUP]; + const postfix = match[POSTFIX_GROUP]; + let modifierWord = prefix || postfix; + modifierWord = modifierWord || ""; + modifierWord = modifierWord.toLowerCase(); + let modifier = null; + if (modifierWord == "last" || modifierWord == "past") { + modifier = "last"; + } else if (modifierWord == "next") { + modifier = "next"; + } else if (modifierWord == "this") { + modifier = "this"; + } + return createParsingComponentsAtWeekday(context.reference, weekday, modifier); + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/parsers/ENRelativeDateFormatParser.js + + + + + +const ENRelativeDateFormatParser_PATTERN = new RegExp(`(this|last|past|next|after\\s*this)\\s*(${matchAnyPattern(TIME_UNIT_DICTIONARY)})(?=\\s*)` + "(?=\\W|$)", "i"); +const MODIFIER_WORD_GROUP = 1; +const RELATIVE_WORD_GROUP = 2; +class ENRelativeDateFormatParser extends AbstractParserWithWordBoundaryChecking { + innerPattern() { + return ENRelativeDateFormatParser_PATTERN; + } + innerExtract(context, match) { + const modifier = match[MODIFIER_WORD_GROUP].toLowerCase(); + const unitWord = match[RELATIVE_WORD_GROUP].toLowerCase(); + const timeunit = TIME_UNIT_DICTIONARY[unitWord]; + if (modifier == "next" || modifier.startsWith("after")) { + const timeUnits = {}; + timeUnits[timeunit] = 1; + return results_ParsingComponents.createRelativeFromReference(context.reference, timeUnits); + } + if (modifier == "last" || modifier == "past") { + const timeUnits = {}; + timeUnits[timeunit] = -1; + return results_ParsingComponents.createRelativeFromReference(context.reference, timeUnits); + } + const components = context.createParsingComponents(); + let date = dayjs_min(context.reference.instant); + if (unitWord.match(/week/i)) { + date = date.add(-date.get("d"), "d"); + components.imply("day", date.date()); + components.imply("month", date.month() + 1); + components.imply("year", date.year()); + } else if (unitWord.match(/month/i)) { + date = date.add(-date.date() + 1, "d"); + components.imply("day", date.date()); + components.assign("year", date.year()); + components.assign("month", date.month() + 1); + } else if (unitWord.match(/year/i)) { + date = date.add(-date.date() + 1, "d"); + date = date.add(-date.month(), "month"); + components.imply("day", date.date()); + components.imply("month", date.month() + 1); + components.assign("year", date.year()); + } + return components; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/chrono.js + + +class Chrono { + constructor(configuration) { + configuration = configuration || createCasualConfiguration(); + this.parsers = [...configuration.parsers]; + this.refiners = [...configuration.refiners]; + } + clone() { + return new Chrono({ + parsers: [...this.parsers], + refiners: [...this.refiners] + }); + } + parseDate(text, referenceDate, option) { + const results = this.parse(text, referenceDate, option); + return results.length > 0 ? results[0].start.date() : null; + } + parse(text, referenceDate, option) { + const context = new ParsingContext(text, referenceDate, option); + let results = []; + this.parsers.forEach(parser => { + const parsedResults = Chrono.executeParser(context, parser); + results = results.concat(parsedResults); + }); + results.sort((a, b) => { + return a.index - b.index; + }); + this.refiners.forEach(function (refiner) { + results = refiner.refine(context, results); + }); + return results; + } + static executeParser(context, parser) { + const results = []; + const pattern = parser.pattern(context); + const originalText = context.text; + let remainingText = context.text; + let match = pattern.exec(remainingText); + while (match) { + const index = match.index + originalText.length - remainingText.length; + match.index = index; + const result = parser.extract(context, match); + if (!result) { + remainingText = originalText.substring(match.index + 1); + match = pattern.exec(remainingText); + continue; + } + let parsedResult = null; + if (result instanceof ParsingResult) { + parsedResult = result; + } else if (result instanceof results_ParsingComponents) { + parsedResult = context.createParsingResult(match.index, match[0]); + parsedResult.start = result; + } else { + parsedResult = context.createParsingResult(match.index, match[0], result); + } + context.debug(() => console.log(`${parser.constructor.name} extracted result ${parsedResult}`)); + results.push(parsedResult); + remainingText = originalText.substring(index + parsedResult.text.length); + match = pattern.exec(remainingText); + } + return results; + } +} +class ParsingContext { + constructor(text, refDate, option) { + this.text = text; + this.reference = new ReferenceWithTimezone(refDate); + this.option = option ?? {}; + this.refDate = this.reference.instant; + } + createParsingComponents(components) { + if (components instanceof results_ParsingComponents) { + return components; + } + return new results_ParsingComponents(this.reference, components); + } + createParsingResult(index, textOrEndIndex, startComponents, endComponents) { + const text = typeof textOrEndIndex === "string" ? textOrEndIndex : this.text.substring(index, textOrEndIndex); + const start = startComponents ? this.createParsingComponents(startComponents) : null; + const end = endComponents ? this.createParsingComponents(endComponents) : null; + return new ParsingResult(this.reference, index, text, start, end); + } + debug(block) { + if (this.option.debug) { + if (this.option.debug instanceof Function) { + this.option.debug(block); + } else { + const handler = this.option.debug; + handler.debug(block); + } + } + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/common/parsers/SlashDateFormatParser.js + +const SlashDateFormatParser_PATTERN = new RegExp("([^\\d]|^)" + "([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})" + "(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?" + "(\\W|$)", "i"); +const OPENING_GROUP = 1; +const ENDING_GROUP = 5; +const FIRST_NUMBERS_GROUP = 2; +const SECOND_NUMBERS_GROUP = 3; +const SlashDateFormatParser_YEAR_GROUP = 4; +class SlashDateFormatParser { + constructor(littleEndian) { + this.groupNumberMonth = littleEndian ? SECOND_NUMBERS_GROUP : FIRST_NUMBERS_GROUP; + this.groupNumberDay = littleEndian ? FIRST_NUMBERS_GROUP : SECOND_NUMBERS_GROUP; + } + pattern() { + return SlashDateFormatParser_PATTERN; + } + extract(context, match) { + if (match[OPENING_GROUP].length == 0 && match.index > 0 && match.index < context.text.length) { + const previousChar = context.text[match.index - 1]; + if (previousChar >= "0" && previousChar <= "9") { + return; + } + } + const index = match.index + match[OPENING_GROUP].length; + const text = match[0].substr(match[OPENING_GROUP].length, match[0].length - match[OPENING_GROUP].length - match[ENDING_GROUP].length); + if (text.match(/^\d\.\d$/) || text.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)) { + return; + } + if (!match[SlashDateFormatParser_YEAR_GROUP] && match[0].indexOf("/") < 0) { + return; + } + const result = context.createParsingResult(index, text); + let month = parseInt(match[this.groupNumberMonth]); + let day = parseInt(match[this.groupNumberDay]); + if (month < 1 || month > 12) { + if (month > 12) { + if (day >= 1 && day <= 12 && month <= 31) { + [day, month] = [month, day]; + } else { + return null; + } + } + } + if (day < 1 || day > 31) { + return null; + } + result.start.assign("day", day); + result.start.assign("month", month); + if (match[SlashDateFormatParser_YEAR_GROUP]) { + const rawYearNumber = parseInt(match[SlashDateFormatParser_YEAR_GROUP]); + const year = findMostLikelyADYear(rawYearNumber); + result.start.assign("year", year); } else { - api.remove(); + const year = findYearClosestToRef(context.refDate, day, month); + result.start.imply("year", year); } - }; - - return updater; + return result; + } } +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/parsers/ENTimeUnitCasualRelativeFormatParser.js -module.exports = function (list, options) { - options = options || {}; - list = list || []; - var lastIdentifiers = modulesToDom(list, options); - return function update(newList) { - newList = newList || []; - for (var i = 0; i < lastIdentifiers.length; i++) { - var identifier = lastIdentifiers[i]; - var index = getIndexByIdentifier(identifier); - stylesInDOM[index].references--; + + +const ENTimeUnitCasualRelativeFormatParser_PATTERN = new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${TIME_UNITS_PATTERN})(?=\\W|$)`, "i"); +const PATTERN_NO_ABBR = new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${TIME_UNITS_NO_ABBR_PATTERN})(?=\\W|$)`, "i"); +class ENTimeUnitCasualRelativeFormatParser extends AbstractParserWithWordBoundaryChecking { + constructor(allowAbbreviations = true) { + super(); + this.allowAbbreviations = allowAbbreviations; + } + innerPattern() { + return this.allowAbbreviations ? ENTimeUnitCasualRelativeFormatParser_PATTERN : PATTERN_NO_ABBR; + } + innerExtract(context, match) { + const prefix = match[1].toLowerCase(); + let timeUnits = parseTimeUnits(match[2]); + switch (prefix) { + case "last": + case "past": + case "-": + timeUnits = reverseTimeUnits(timeUnits); + break; } + return results_ParsingComponents.createRelativeFromReference(context.reference, timeUnits); + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/refiners/ENMergeRelativeDateRefiner.js - var newLastIdentifiers = modulesToDom(newList, options); - for (var _i = 0; _i < lastIdentifiers.length; _i++) { - var _identifier = lastIdentifiers[_i]; - var _index = getIndexByIdentifier(_identifier); - if (stylesInDOM[_index].references === 0) { - stylesInDOM[_index].updater(); - - stylesInDOM.splice(_index, 1); - } +function hasImpliedEarlierReferenceDate(result) { + return result.text.match(/\s+(before|from)$/i) != null; +} +function hasImpliedLaterReferenceDate(result) { + return result.text.match(/\s+(after|since)$/i) != null; +} +class ENMergeRelativeDateRefiner extends MergingRefiner { + patternBetween() { + return /^\s*$/i; + } + shouldMergeResults(textBetween, currentResult, nextResult) { + if (!textBetween.match(this.patternBetween())) { + return false; } + if (!hasImpliedEarlierReferenceDate(currentResult) && !hasImpliedLaterReferenceDate(currentResult)) { + return false; + } + return !!nextResult.start.get("day") && !!nextResult.start.get("month") && !!nextResult.start.get("year"); + } + mergeResults(textBetween, currentResult, nextResult) { + let timeUnits = parseTimeUnits(currentResult.text); + if (hasImpliedEarlierReferenceDate(currentResult)) { + timeUnits = reverseTimeUnits(timeUnits); + } + const components = results_ParsingComponents.createRelativeFromReference(new ReferenceWithTimezone(nextResult.start.date()), timeUnits); + return new ParsingResult(nextResult.reference, currentResult.index, `${currentResult.text}${textBetween}${nextResult.text}`, components); + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/en/index.js - lastIdentifiers = newLastIdentifiers; - }; + + + + + + + + + + + + + + + + + + + +const casual = new Chrono(createCasualConfiguration(false)); +const strict = new Chrono(createConfiguration(true, false)); +const GB = new Chrono(createConfiguration(false, true)); +function parse(text, ref, option) { + return casual.parse(text, ref, option); +} +function parseDate(text, ref, option) { + return casual.parseDate(text, ref, option); +} +function createCasualConfiguration(littleEndian = false) { + const option = createConfiguration(false, littleEndian); + option.parsers.unshift(new ENCasualDateParser()); + option.parsers.unshift(new ENCasualTimeParser()); + option.parsers.unshift(new ENMonthNameParser()); + option.parsers.unshift(new ENRelativeDateFormatParser()); + option.parsers.unshift(new ENTimeUnitCasualRelativeFormatParser()); + return option; +} +function createConfiguration(strictMode = true, littleEndian = false) { + return includeCommonConfiguration({ + parsers: [new SlashDateFormatParser(littleEndian), new ENTimeUnitWithinFormatParser(strictMode), new ENMonthNameLittleEndianParser(), new ENMonthNameMiddleEndianParser(), new ENWeekdayParser(), new ENCasualYearMonthDayParser(), new ENSlashMonthFormatParser(), new ENTimeExpressionParser(strictMode), new ENTimeUnitAgoFormatParser(strictMode), new ENTimeUnitLaterFormatParser(strictMode)], + refiners: [new ENMergeRelativeDateRefiner(), new ENMergeDateTimeRefiner(), new ENMergeDateRangeRefiner()] + }, strictMode); +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/index.js + + + +var esm_Meridiem; +(function (Meridiem) { + Meridiem[Meridiem["AM"] = 0] = "AM"; + Meridiem[Meridiem["PM"] = 1] = "PM"; +})(esm_Meridiem || (esm_Meridiem = {})); +var Weekday; +(function (Weekday) { + Weekday[Weekday["SUNDAY"] = 0] = "SUNDAY"; + Weekday[Weekday["MONDAY"] = 1] = "MONDAY"; + Weekday[Weekday["TUESDAY"] = 2] = "TUESDAY"; + Weekday[Weekday["WEDNESDAY"] = 3] = "WEDNESDAY"; + Weekday[Weekday["THURSDAY"] = 4] = "THURSDAY"; + Weekday[Weekday["FRIDAY"] = 5] = "FRIDAY"; + Weekday[Weekday["SATURDAY"] = 6] = "SATURDAY"; +})(Weekday || (Weekday = {})); +var Month; +(function (Month) { + Month[Month["JANUARY"] = 1] = "JANUARY"; + Month[Month["FEBRUARY"] = 2] = "FEBRUARY"; + Month[Month["MARCH"] = 3] = "MARCH"; + Month[Month["APRIL"] = 4] = "APRIL"; + Month[Month["MAY"] = 5] = "MAY"; + Month[Month["JUNE"] = 6] = "JUNE"; + Month[Month["JULY"] = 7] = "JULY"; + Month[Month["AUGUST"] = 8] = "AUGUST"; + Month[Month["SEPTEMBER"] = 9] = "SEPTEMBER"; + Month[Month["OCTOBER"] = 10] = "OCTOBER"; + Month[Month["NOVEMBER"] = 11] = "NOVEMBER"; + Month[Month["DECEMBER"] = 12] = "DECEMBER"; +})(Month || (Month = {})); + + + + + + + + + +const esm_strict = strict; +const esm_casual = casual; +function esm_parse(text, ref, option) { + return esm_casual.parse(text, ref, option); +} +function esm_parseDate(text, ref, option) { + return esm_casual.parseDate(text, ref, option); +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/de/parsers/DETimeExpressionParser.js + +class DETimeExpressionParser extends AbstractTimeExpressionParser { + primaryPrefix() { + return "(?:(?:um|von)\\s*)?"; + } + followingPhase() { + return "\\s*(?:\\-|\\–|\\~|\\〜|bis)\\s*"; + } + extractPrimaryTimeComponents(context, match) { + if (match[0].match(/^\s*\d{4}\s*$/)) { + return null; + } + return super.extractPrimaryTimeComponents(context, match); + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/de/constants.js + + +const constants_WEEKDAY_DICTIONARY = { + "sonntag": 0, + "so": 0, + "montag": 1, + "mo": 1, + "dienstag": 2, + "di": 2, + "mittwoch": 3, + "mi": 3, + "donnerstag": 4, + "do": 4, + "freitag": 5, + "fr": 5, + "samstag": 6, + "sa": 6 }; - -/***/ }), - -/***/ "./node_modules/style-loader/dist/runtime/insertBySelector.js": -/***/ (function(module) { - -"use strict"; +const constants_MONTH_DICTIONARY = { + "januar": 1, + "jänner": 1, + "janner": 1, + "jan": 1, + "jan.": 1, + "februar": 2, + "feber": 2, + "feb": 2, + "feb.": 2, + "märz": 3, + "maerz": 3, + "mär": 3, + "mär.": 3, + "mrz": 3, + "mrz.": 3, + "april": 4, + "apr": 4, + "apr.": 4, + "mai": 5, + "juni": 6, + "jun": 6, + "jun.": 6, + "juli": 7, + "jul": 7, + "jul.": 7, + "august": 8, + "aug": 8, + "aug.": 8, + "september": 9, + "sep": 9, + "sep.": 9, + "sept": 9, + "sept.": 9, + "oktober": 10, + "okt": 10, + "okt.": 10, + "november": 11, + "nov": 11, + "nov.": 11, + "dezember": 12, + "dez": 12, + "dez.": 12 +}; +const constants_INTEGER_WORD_DICTIONARY = { + "eins": 1, + "eine": 1, + "einem": 1, + "einen": 1, + "einer": 1, + "zwei": 2, + "drei": 3, + "vier": 4, + "fünf": 5, + "fuenf": 5, + "sechs": 6, + "sieben": 7, + "acht": 8, + "neun": 9, + "zehn": 10, + "elf": 11, + "zwölf": 12, + "zwoelf": 12 +}; +const constants_TIME_UNIT_DICTIONARY = { + sek: "second", + sekunde: "second", + sekunden: "second", + min: "minute", + minute: "minute", + minuten: "minute", + h: "hour", + std: "hour", + stunde: "hour", + stunden: "hour", + tag: "d", + tage: "d", + tagen: "d", + woche: "week", + wochen: "week", + monat: "month", + monate: "month", + monaten: "month", + monats: "month", + quartal: "quarter", + quartals: "quarter", + quartale: "quarter", + quartalen: "quarter", + a: "year", + j: "year", + jr: "year", + jahr: "year", + jahre: "year", + jahren: "year", + jahres: "year" +}; +const constants_NUMBER_PATTERN = `(?:${matchAnyPattern(constants_INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|halb?|halbe?|einigen?|wenigen?|mehreren?)`; +function constants_parseNumberPattern(match) { + const num = match.toLowerCase(); + if (constants_INTEGER_WORD_DICTIONARY[num] !== undefined) { + return constants_INTEGER_WORD_DICTIONARY[num]; + } else if (num === "ein" || num === "einer" || num === "einem" || num === "einen" || num === "eine") { + return 1; + } else if (num.match(/wenigen/)) { + return 2; + } else if (num.match(/halb/) || num.match(/halben/)) { + return 0.5; + } else if (num.match(/einigen/)) { + return 3; + } else if (num.match(/mehreren/)) { + return 7; + } + return parseFloat(num); +} +const constants_YEAR_PATTERN = `(?:[0-9]{1,4}(?:\\s*[vn]\\.?\\s*(?:C(?:hr)?|(?:u\\.?|d\\.?(?:\\s*g\\.?)?)?\\s*Z)\\.?|\\s*(?:u\\.?|d\\.?(?:\\s*g\\.)?)\\s*Z\\.?)?)`; +function constants_parseYear(match) { + if (/v/i.test(match)) { + return -parseInt(match.replace(/[^0-9]+/gi, "")); + } + if (/n/i.test(match)) { + return parseInt(match.replace(/[^0-9]+/gi, "")); + } + if (/z/i.test(match)) { + return parseInt(match.replace(/[^0-9]+/gi, "")); + } + const rawYearNumber = parseInt(match); + return findMostLikelyADYear(rawYearNumber); +} +const constants_SINGLE_TIME_UNIT_PATTERN = `(${constants_NUMBER_PATTERN})\\s{0,5}(${matchAnyPattern(constants_TIME_UNIT_DICTIONARY)})\\s{0,5}`; +const constants_SINGLE_TIME_UNIT_REGEX = new RegExp(constants_SINGLE_TIME_UNIT_PATTERN, "i"); +const constants_TIME_UNITS_PATTERN = repeatedTimeunitPattern("", constants_SINGLE_TIME_UNIT_PATTERN); +function constants_parseTimeUnits(timeunitText) { + const fragments = {}; + let remainingText = timeunitText; + let match = constants_SINGLE_TIME_UNIT_REGEX.exec(remainingText); + while (match) { + constants_collectDateTimeFragment(fragments, match); + remainingText = remainingText.substring(match[0].length); + match = constants_SINGLE_TIME_UNIT_REGEX.exec(remainingText); + } + return fragments; +} +function constants_collectDateTimeFragment(fragments, match) { + const num = constants_parseNumberPattern(match[1]); + const unit = constants_TIME_UNIT_DICTIONARY[match[2].toLowerCase()]; + fragments[unit] = num; +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/de/parsers/DEWeekdayParser.js -var memo = {}; -/* istanbul ignore next */ -function getTarget(target) { - if (typeof memo[target] === "undefined") { - var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself - if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { - try { - // This will throw an exception if access to iframe is blocked - // due to cross-origin restrictions - styleTarget = styleTarget.contentDocument.head; - } catch (e) { - // istanbul ignore next - styleTarget = null; +const DEWeekdayParser_PATTERN = new RegExp("(?:(?:\\,|\\(|\\()\\s*)?" + "(?:a[mn]\\s*?)?" + "(?:(diese[mn]|letzte[mn]|n(?:ä|ae)chste[mn])\\s*)?" + `(${matchAnyPattern(constants_WEEKDAY_DICTIONARY)})` + "(?:\\s*(?:\\,|\\)|\\)))?" + "(?:\\s*(diese|letzte|n(?:ä|ae)chste)\\s*woche)?" + "(?=\\W|$)", "i"); +const DEWeekdayParser_PREFIX_GROUP = 1; +const SUFFIX_GROUP = 3; +const DEWeekdayParser_WEEKDAY_GROUP = 2; +class DEWeekdayParser extends AbstractParserWithWordBoundaryChecking { + innerPattern() { + return DEWeekdayParser_PATTERN; + } + innerExtract(context, match) { + const dayOfWeek = match[DEWeekdayParser_WEEKDAY_GROUP].toLowerCase(); + const offset = constants_WEEKDAY_DICTIONARY[dayOfWeek]; + const prefix = match[DEWeekdayParser_PREFIX_GROUP]; + const postfix = match[SUFFIX_GROUP]; + let modifierWord = prefix || postfix; + modifierWord = modifierWord || ""; + modifierWord = modifierWord.toLowerCase(); + let modifier = null; + if (modifierWord.match(/letzte/)) { + modifier = "last"; + } else if (modifierWord.match(/chste/)) { + modifier = "next"; + } else if (modifierWord.match(/diese/)) { + modifier = "this"; + } + return createParsingComponentsAtWeekday(context.reference, offset, modifier); + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/de/parsers/DESpecificTimeExpressionParser.js + +const FIRST_REG_PATTERN = new RegExp("(^|\\s|T)" + "(?:(?:um|von)\\s*)?" + "(\\d{1,2})(?:h|:)?" + "(?:(\\d{1,2})(?:m|:)?)?" + "(?:(\\d{1,2})(?:s)?)?" + "(?:\\s*Uhr)?" + "(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?" + "(?=\\W|$)", "i"); +const SECOND_REG_PATTERN = new RegExp("^\\s*(\\-|\\–|\\~|\\〜|bis(?:\\s+um)?|\\?)\\s*" + "(\\d{1,2})(?:h|:)?" + "(?:(\\d{1,2})(?:m|:)?)?" + "(?:(\\d{1,2})(?:s)?)?" + "(?:\\s*Uhr)?" + "(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?" + "(?=\\W|$)", "i"); +const DESpecificTimeExpressionParser_HOUR_GROUP = 2; +const DESpecificTimeExpressionParser_MINUTE_GROUP = 3; +const DESpecificTimeExpressionParser_SECOND_GROUP = 4; +const DESpecificTimeExpressionParser_AM_PM_HOUR_GROUP = 5; +class DESpecificTimeExpressionParser { + pattern(context) { + return FIRST_REG_PATTERN; + } + extract(context, match) { + const result = context.createParsingResult(match.index + match[1].length, match[0].substring(match[1].length)); + if (result.text.match(/^\d{4}$/)) { + match.index += match[0].length; + return null; + } + result.start = DESpecificTimeExpressionParser.extractTimeComponent(result.start.clone(), match); + if (!result.start) { + match.index += match[0].length; + return null; + } + const remainingText = context.text.substring(match.index + match[0].length); + const secondMatch = SECOND_REG_PATTERN.exec(remainingText); + if (secondMatch) { + result.end = DESpecificTimeExpressionParser.extractTimeComponent(result.start.clone(), secondMatch); + if (result.end) { + result.text += secondMatch[0]; } } - - memo[target] = styleTarget; + return result; } - - return memo[target]; -} -/* istanbul ignore next */ - - -function insertBySelector(insert, style) { - var target = getTarget(insert); - - if (!target) { - throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid."); - } - - target.appendChild(style); -} - -module.exports = insertBySelector; - -/***/ }), - -/***/ "./node_modules/style-loader/dist/runtime/insertStyleElement.js": -/***/ (function(module) { - -"use strict"; - - -/* istanbul ignore next */ -function insertStyleElement(options) { - var element = document.createElement("style"); - options.setAttributes(element, options.attributes); - options.insert(element, options.options); - return element; -} - -module.exports = insertStyleElement; - -/***/ }), - -/***/ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js": -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; - - -/* istanbul ignore next */ -function setAttributesWithoutAttributes(styleElement) { - var nonce = true ? __webpack_require__.nc : 0; - - if (nonce) { - styleElement.setAttribute("nonce", nonce); - } -} - -module.exports = setAttributesWithoutAttributes; - -/***/ }), - -/***/ "./node_modules/style-loader/dist/runtime/styleDomAPI.js": -/***/ (function(module) { - -"use strict"; - - -/* istanbul ignore next */ -function apply(styleElement, options, obj) { - var css = ""; - - if (obj.supports) { - css += "@supports (".concat(obj.supports, ") {"); - } - - if (obj.media) { - css += "@media ".concat(obj.media, " {"); - } - - var needLayer = typeof obj.layer !== "undefined"; - - if (needLayer) { - css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {"); - } - - css += obj.css; - - if (needLayer) { - css += "}"; - } - - if (obj.media) { - css += "}"; - } - - if (obj.supports) { - css += "}"; - } - - var sourceMap = obj.sourceMap; - - if (sourceMap && typeof btoa !== "undefined") { - css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */"); - } // For old IE - - /* istanbul ignore if */ - - - options.styleTagTransform(css, styleElement, options.options); -} - -function removeStyleElement(styleElement) { - // istanbul ignore if - if (styleElement.parentNode === null) { - return false; - } - - styleElement.parentNode.removeChild(styleElement); -} -/* istanbul ignore next */ - - -function domAPI(options) { - var styleElement = options.insertStyleElement(options); - return { - update: function update(obj) { - apply(styleElement, options, obj); - }, - remove: function remove() { - removeStyleElement(styleElement); + static extractTimeComponent(extractingComponents, match) { + let hour = 0; + let minute = 0; + let meridiem = null; + hour = parseInt(match[DESpecificTimeExpressionParser_HOUR_GROUP]); + if (match[DESpecificTimeExpressionParser_MINUTE_GROUP] != null) { + minute = parseInt(match[DESpecificTimeExpressionParser_MINUTE_GROUP]); } - }; -} - -module.exports = domAPI; - -/***/ }), - -/***/ "./node_modules/style-loader/dist/runtime/styleTagTransform.js": -/***/ (function(module) { - -"use strict"; - - -/* istanbul ignore next */ -function styleTagTransform(css, styleElement) { - if (styleElement.styleSheet) { - styleElement.styleSheet.cssText = css; - } else { - while (styleElement.firstChild) { - styleElement.removeChild(styleElement.firstChild); + if (minute >= 60 || hour > 24) { + return null; } - - styleElement.appendChild(document.createTextNode(css)); + if (hour >= 12) { + meridiem = esm_Meridiem.PM; + } + if (match[DESpecificTimeExpressionParser_AM_PM_HOUR_GROUP] != null) { + if (hour > 12) return null; + const ampm = match[DESpecificTimeExpressionParser_AM_PM_HOUR_GROUP].toLowerCase(); + if (ampm.match(/morgen|vormittag/)) { + meridiem = esm_Meridiem.AM; + if (hour == 12) { + hour = 0; + } + } + if (ampm.match(/nachmittag|abend/)) { + meridiem = esm_Meridiem.PM; + if (hour != 12) { + hour += 12; + } + } + if (ampm.match(/nacht/)) { + if (hour == 12) { + meridiem = esm_Meridiem.AM; + hour = 0; + } else if (hour < 6) { + meridiem = esm_Meridiem.AM; + } else { + meridiem = esm_Meridiem.PM; + hour += 12; + } + } + } + extractingComponents.assign("hour", hour); + extractingComponents.assign("minute", minute); + if (meridiem !== null) { + extractingComponents.assign("meridiem", meridiem); + } else { + if (hour < 12) { + extractingComponents.imply("meridiem", esm_Meridiem.AM); + } else { + extractingComponents.imply("meridiem", esm_Meridiem.PM); + } + } + if (match[DESpecificTimeExpressionParser_SECOND_GROUP] != null) { + const second = parseInt(match[DESpecificTimeExpressionParser_SECOND_GROUP]); + if (second >= 60) return null; + extractingComponents.assign("second", second); + } + return extractingComponents; } } +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/de/refiners/DEMergeDateRangeRefiner.js -module.exports = styleTagTransform; +class DEMergeDateRangeRefiner extends AbstractMergeDateRangeRefiner { + patternBetween() { + return /^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/de/refiners/DEMergeDateTimeRefiner.js -/***/ }) +class DEMergeDateTimeRefiner extends AbstractMergeDateTimeRefiner { + patternBetween() { + return new RegExp("^\\s*(T|um|am|,|-)?\\s*$"); + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/de/parsers/DECasualTimeParser.js -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ id: moduleId, -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/compat get default export */ -/******/ !function() { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function() { return module['default']; } : -/******/ function() { return module; }; -/******/ __webpack_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ !function() { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = function(exports, definition) { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ !function() { -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } -/******/ }(); -/******/ -/******/ /* webpack/runtime/nonce */ -/******/ !function() { -/******/ __webpack_require__.nc = undefined; -/******/ }(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be in strict mode. -!function() { -"use strict"; -// EXTERNAL MODULE: ./node_modules/chrono-node/dist/index.js -var dist = __webpack_require__("./node_modules/chrono-node/dist/index.js"); + + + +class DECasualTimeParser extends AbstractParserWithWordBoundaryChecking { + innerPattern(context) { + return /(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i; + } + innerExtract(context, match) { + const targetDate = dayjs_min(context.refDate); + const timeKeywordPattern = match[2].toLowerCase(); + const component = context.createParsingComponents(); + implySimilarTime(component, targetDate); + return DECasualTimeParser.extractTimeComponents(component, timeKeywordPattern); + } + static extractTimeComponents(component, timeKeywordPattern) { + switch (timeKeywordPattern) { + case "morgen": + component.imply("hour", 6); + component.imply("minute", 0); + component.imply("second", 0); + component.imply("meridiem", esm_Meridiem.AM); + break; + case "vormittag": + component.imply("hour", 9); + component.imply("minute", 0); + component.imply("second", 0); + component.imply("meridiem", esm_Meridiem.AM); + break; + case "mittag": + case "mittags": + component.imply("hour", 12); + component.imply("minute", 0); + component.imply("second", 0); + component.imply("meridiem", esm_Meridiem.AM); + break; + case "nachmittag": + component.imply("hour", 15); + component.imply("minute", 0); + component.imply("second", 0); + component.imply("meridiem", esm_Meridiem.PM); + break; + case "abend": + component.imply("hour", 18); + component.imply("minute", 0); + component.imply("second", 0); + component.imply("meridiem", esm_Meridiem.PM); + break; + case "nacht": + component.imply("hour", 22); + component.imply("minute", 0); + component.imply("second", 0); + component.imply("meridiem", esm_Meridiem.PM); + break; + case "mitternacht": + if (component.get("hour") > 1) { + component = addImpliedTimeUnits(component, { + "day": 1 + }); + } + component.imply("hour", 0); + component.imply("minute", 0); + component.imply("second", 0); + component.imply("meridiem", esm_Meridiem.AM); + break; + } + return component; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/de/parsers/DECasualDateParser.js + + + + + +const DECasualDateParser_PATTERN = new RegExp(`(jetzt|heute|morgen|übermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)` + `(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?` + `(?=\\W|$)`, "i"); +const DECasualDateParser_DATE_GROUP = 1; +const TIME_GROUP = 2; +class DECasualDateParser extends AbstractParserWithWordBoundaryChecking { + innerPattern(context) { + return DECasualDateParser_PATTERN; + } + innerExtract(context, match) { + let targetDate = dayjs_min(context.refDate); + const dateKeyword = (match[DECasualDateParser_DATE_GROUP] || "").toLowerCase(); + const timeKeyword = (match[TIME_GROUP] || "").toLowerCase(); + let component = context.createParsingComponents(); + switch (dateKeyword) { + case "jetzt": + component = now(context.reference); + break; + case "heute": + component = today(context.reference); + break; + case "morgen": + assignTheNextDay(component, targetDate); + break; + case "übermorgen": + case "uebermorgen": + targetDate = targetDate.add(1, "day"); + assignTheNextDay(component, targetDate); + break; + case "gestern": + targetDate = targetDate.add(-1, "day"); + dayjs_assignSimilarDate(component, targetDate); + implySimilarTime(component, targetDate); + break; + case "vorgestern": + targetDate = targetDate.add(-2, "day"); + dayjs_assignSimilarDate(component, targetDate); + implySimilarTime(component, targetDate); + break; + default: + if (dateKeyword.match(/letzte\s*nacht/)) { + if (targetDate.hour() > 6) { + targetDate = targetDate.add(-1, "day"); + } + dayjs_assignSimilarDate(component, targetDate); + component.imply("hour", 0); + } + break; + } + if (timeKeyword) { + component = DECasualTimeParser.extractTimeComponents(component, timeKeyword); + } + return component; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/de/parsers/DEMonthNameLittleEndianParser.js + + + + + +const DEMonthNameLittleEndianParser_PATTERN = new RegExp("(?:am\\s*?)?" + "(?:den\\s*?)?" + `([0-9]{1,2})\\.` + `(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\–|\\s)\\s*([0-9]{1,2})\\.?)?\\s*` + `(${matchAnyPattern(constants_MONTH_DICTIONARY)})` + `(?:(?:-|/|,?\\s*)(${constants_YEAR_PATTERN}(?![^\\s]\\d)))?` + `(?=\\W|$)`, "i"); +const DEMonthNameLittleEndianParser_DATE_GROUP = 1; +const DEMonthNameLittleEndianParser_DATE_TO_GROUP = 2; +const DEMonthNameLittleEndianParser_MONTH_NAME_GROUP = 3; +const DEMonthNameLittleEndianParser_YEAR_GROUP = 4; +class DEMonthNameLittleEndianParser extends AbstractParserWithWordBoundaryChecking { + innerPattern() { + return DEMonthNameLittleEndianParser_PATTERN; + } + innerExtract(context, match) { + const result = context.createParsingResult(match.index, match[0]); + const month = constants_MONTH_DICTIONARY[match[DEMonthNameLittleEndianParser_MONTH_NAME_GROUP].toLowerCase()]; + const day = parseInt(match[DEMonthNameLittleEndianParser_DATE_GROUP]); + if (day > 31) { + match.index = match.index + match[DEMonthNameLittleEndianParser_DATE_GROUP].length; + return null; + } + result.start.assign("month", month); + result.start.assign("day", day); + if (match[DEMonthNameLittleEndianParser_YEAR_GROUP]) { + const yearNumber = constants_parseYear(match[DEMonthNameLittleEndianParser_YEAR_GROUP]); + result.start.assign("year", yearNumber); + } else { + const year = findYearClosestToRef(context.refDate, day, month); + result.start.imply("year", year); + } + if (match[DEMonthNameLittleEndianParser_DATE_TO_GROUP]) { + const endDate = parseInt(match[DEMonthNameLittleEndianParser_DATE_TO_GROUP]); + result.end = result.start.clone(); + result.end.assign("day", endDate); + } + return result; + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/de/parsers/DETimeUnitRelativeFormatParser.js + + + + + +class DETimeUnitAgoFormatParser extends AbstractParserWithWordBoundaryChecking { + constructor() { + super(); + } + innerPattern() { + return new RegExp(`(?:\\s*((?:nächste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?|vor|in)\\s*)?` + `(${constants_NUMBER_PATTERN})?` + `(?:\\s*(nächste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?` + `\\s*(${matchAnyPattern(constants_TIME_UNIT_DICTIONARY)})`, "i"); + } + innerExtract(context, match) { + const num = match[2] ? constants_parseNumberPattern(match[2]) : 1; + const unit = constants_TIME_UNIT_DICTIONARY[match[4].toLowerCase()]; + let timeUnits = {}; + timeUnits[unit] = num; + let modifier = match[1] || match[3] || ""; + modifier = modifier.toLowerCase(); + if (!modifier) { + return; + } + if (/vor/.test(modifier) || /letzte/.test(modifier) || /vergangen/.test(modifier)) { + timeUnits = reverseTimeUnits(timeUnits); + } + return results_ParsingComponents.createRelativeFromReference(context.reference, timeUnits); + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/de/parsers/DETimeUnitWithinFormatParser.js + + + +class DETimeUnitWithinFormatParser extends AbstractParserWithWordBoundaryChecking { + innerPattern() { + return new RegExp(`(?:in|für|während)\\s*(${constants_TIME_UNITS_PATTERN})(?=\\W|$)`, "i"); + } + innerExtract(context, match) { + const timeUnits = constants_parseTimeUnits(match[1]); + return results_ParsingComponents.createRelativeFromReference(context.reference, timeUnits); + } +} +;// CONCATENATED MODULE: ./node_modules/chrono-node/dist/esm/locales/de/index.js + + + + + + + + + + + + + + +const de_casual = new Chrono(de_createCasualConfiguration()); +const de_strict = new Chrono(de_createConfiguration(true)); +function de_parse(text, ref, option) { + return de_casual.parse(text, ref, option); +} +function de_parseDate(text, ref, option) { + return de_casual.parseDate(text, ref, option); +} +function de_createCasualConfiguration(littleEndian = true) { + const option = de_createConfiguration(false, littleEndian); + option.parsers.unshift(new DECasualTimeParser()); + option.parsers.unshift(new DECasualDateParser()); + option.parsers.unshift(new DETimeUnitAgoFormatParser()); + return option; +} +function de_createConfiguration(strictMode = true, littleEndian = true) { + return includeCommonConfiguration({ + parsers: [new ISOFormatParser(), new SlashDateFormatParser(littleEndian), new DETimeExpressionParser(), new DESpecificTimeExpressionParser(), new DEMonthNameLittleEndianParser(), new DEWeekdayParser(), new DETimeUnitWithinFormatParser()], + refiners: [new DEMergeDateRangeRefiner(), new DEMergeDateTimeRefiner()] + }, strictMode); +} ;// CONCATENATED MODULE: external "axios" -var external_axios_namespaceObject = axios; +const external_axios_namespaceObject = axios; var external_axios_default = /*#__PURE__*/__webpack_require__.n(external_axios_namespaceObject); ;// CONCATENATED MODULE: external "axiosGmxhrAdapter" -var external_axiosGmxhrAdapter_namespaceObject = axiosGmxhrAdapter; +const external_axiosGmxhrAdapter_namespaceObject = axiosGmxhrAdapter; var external_axiosGmxhrAdapter_default = /*#__PURE__*/__webpack_require__.n(external_axiosGmxhrAdapter_namespaceObject); ;// CONCATENATED MODULE: ./src/utils.ts -/** - * @typedef {Object} AxiosResponse - * @property {Object} data - * @property {Object} headers - * @property {Object} config - * @property {Object} request - * @property {number} code - * @property {string} statusText - */ -/** - * @typedef {Object} AxiosError - * @property {AxiosResponse} response - */ - - -(external_axios_default()).defaults.adapter = (external_axiosGmxhrAdapter_default()); - -function extractNumber(s) { - var match = /(\+?[0-9]{4,})/.exec(s); - if (!match) { - return undefined; - } - var number = match[1]; - if (number.startsWith('+')) { - number = number.replace('+', '00'); - } - return number; -} -function fireChangeEvents(element) { - var changeEvent = null; - changeEvent = document.createEvent('HTMLEvents'); - changeEvent.initEvent('input', true, true); - element.dispatchEvent(changeEvent); - console.debug('input event dispatched for element: ' + element.id); - changeEvent = document.createEvent('HTMLEvents'); - changeEvent.initEvent('keyup', true, true); - element.dispatchEvent(changeEvent); - console.debug('keyup event dispatched for element: ' + element.id); - changeEvent = document.createEvent('HTMLEvents'); - changeEvent.initEvent('change', true, true); - element.dispatchEvent(changeEvent); - console.debug('change event dispatched for element: ' + element.id); -} +/** + * @typedef {Object} AxiosResponse + * @property {Object} data + * @property {Object} headers + * @property {Object} config + * @property {Object} request + * @property {number} code + * @property {string} statusText + */ +/** + * @typedef {Object} AxiosError + * @property {AxiosResponse} response + */ + + +(external_axios_default()).defaults.adapter = (external_axiosGmxhrAdapter_default()); + +function extractNumber(s) { + var match = /(\+?[0-9]{4,})/.exec(s); + if (!match) { + return undefined; + } + var number = match[1]; + if (number.startsWith('+')) { + number = number.replace('+', '00'); + } + return number; +} +function fireChangeEvents(element) { + var changeEvent = null; + changeEvent = document.createEvent('HTMLEvents'); + changeEvent.initEvent('input', true, true); + element.dispatchEvent(changeEvent); + console.debug('input event dispatched for element: ' + element.id); + changeEvent = document.createEvent('HTMLEvents'); + changeEvent.initEvent('keyup', true, true); + element.dispatchEvent(changeEvent); + console.debug('keyup event dispatched for element: ' + element.id); + changeEvent = document.createEvent('HTMLEvents'); + changeEvent.initEvent('change', true, true); + element.dispatchEvent(changeEvent); + console.debug('change event dispatched for element: ' + element.id); +} ;// CONCATENATED MODULE: ./src/call-history.ts -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - -class CallHistory { - constructor() { - this.callerIds = {}; - } - updateCallHistoryEntry(call, callerId) { - var span = call.querySelector(':scope > span'); - this.showTimeManager(call, call.querySelector('.date').textContent, callerId); - if (callerId && callerId.tD_NAME !== '') { - var text = span.textContent; - span.textContent = callerId.tD_NAME + ' ' + callerId.tD_NUMBER; - } - } - showTimeManager(call, date, callerId) { - var dateParts = date.match(/^(?.*), (?[0-9]{2}:[0-9]{2}:[0-9]{2})$/); - var duration = '00:00:00'; - if (dateParts) { - date = dateParts.groups.date; - duration = dateParts.groups.duration; - } - var parsedDate = dist.de.parseDate(date); - if (!parsedDate) { - parsedDate = dist.parseDate(date); - } - if (!parsedDate) { - return; - } - // Date parsing is awful, just assume the first number is the day of month - var day = date.match(/[0-9]+/)[0]; - var parsedDuration = dist.parseDate(duration); - console.log('TAPI call history time:', date, 'parsedDate:', parsedDate, 'duration:', duration, 'parsedDuration:', parsedDuration); - var connect = parsedDate.getFullYear().toString() + - (parsedDate.getMonth() + 1).toString().padStart(2, '0') + // (January gives 0) - day.toString().padStart(2, '0') + - parsedDate.getHours().toString().padStart(2, '0') + - parsedDate.getMinutes().toString().padStart(2, '0'); - var length = (parsedDuration.getHours() * 60 + parsedDuration.getMinutes()).toString(); - var toolbar = call.querySelector('call-history-options'); - var href = 'domizil://PM/Zeitbuchung?'; - if (callerId && callerId.tD_ID) { - href += 'KontaktId=' + callerId.tD_ID + '&'; - } - href += 'connect=' + connect + '&length=' + length; - var a = document.createElement('a'); - a.title = 'PM Zeitbuchung'; - a.dataset.domizilLink = href; - a.onclick = () => { - window.open(href); - }; - a.innerHTML = '' + - '' + - ' ' + - ' ' + - ' ' + - ' ' + - '' + - ''; - a.classList.add('btn'); - a.classList.add('btn-plain'); - toolbar.insertBefore(a, toolbar.firstChild); - } - showCallHistory(element) { - return __awaiter(this, void 0, void 0, function* () { - var span = element.querySelector(':scope > span'); - var number = extractNumber(span.textContent); - if (!number) { - this.updateCallHistoryEntry(element, undefined); - return; - } - if (this.callerIds[number] !== undefined) { - this.updateCallHistoryEntry(element, this.callerIds[number]); - } - else { - var response = yield external_axios_default().get('http://cpatapi.cpsrvweb2016.cp-austria.at/callerid/' + encodeURIComponent(number)); - var callerId = { tD_NAME: '' }; - if (response.status === 200) { - callerId = response.data; - } - console.log('TAPI call histroy callerid response', number, response, callerId); - this.callerIds[number] = callerId; - this.updateCallHistoryEntry(element, callerId); - } - }); - } -} +var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; + + +class CallHistory { + constructor() { + this.callerIds = {}; + } + updateCallHistoryEntry(call, callerId) { + var span = call.querySelector(':scope > span'); + this.showTimeManager(call, call.querySelector('.date').textContent, callerId); + if (callerId && callerId.tD_NAME !== '') { + var text = span.textContent; + span.textContent = callerId.tD_NAME + ' ' + callerId.tD_NUMBER; + } + } + showTimeManager(call, date, callerId) { + var dateParts = date.match(/^(?.*), (?[0-9]{2}:[0-9]{2}:[0-9]{2})$/); + var duration = '00:00:00'; + if (dateParts) { + date = dateParts.groups.date; + duration = dateParts.groups.duration; + } + var parsedDate = esm_parseDate(date); + var parsedDateDe = de_parseDate(date); + if (parsedDateDe) { + parsedDate = parsedDateDe; + } + if (!parsedDate) { + return; + } + // Date parsing is awful, just assume the first number is the day of month + var day = date.match(/[0-9]+/)[0]; + var parsedDuration = esm_parseDate(duration); + console.log('TAPI call history time:', date, 'parsedDate:', parsedDate, 'duration:', duration, 'parsedDuration:', parsedDuration); + var connect = parsedDate.getFullYear().toString() + + (parsedDate.getMonth() + 1).toString().padStart(2, '0') + // (January gives 0) + day.toString().padStart(2, '0') + + parsedDate.getHours().toString().padStart(2, '0') + + parsedDate.getMinutes().toString().padStart(2, '0'); + var length = (parsedDuration.getHours() * 60 + parsedDuration.getMinutes()).toString(); + var toolbar = call.querySelector('call-history-options'); + var href = 'domizil://PM/Zeitbuchung?'; + if (callerId && callerId.tD_ID) { + href += 'KontaktId=' + callerId.tD_ID + '&'; + } + href += 'connect=' + connect + '&length=' + length; + var a = document.createElement('a'); + a.title = 'PM Zeitbuchung'; + a.dataset.domizilLink = href; + a.onclick = () => { + window.open(href); + }; + a.innerHTML = '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ''; + a.classList.add('btn'); + a.classList.add('btn-plain'); + toolbar.insertBefore(a, toolbar.firstChild); + } + showCallHistory(element) { + return __awaiter(this, void 0, void 0, function* () { + var span = element.querySelector(':scope > span'); + var number = extractNumber(span.textContent); + if (!number) { + this.updateCallHistoryEntry(element, undefined); + return; + } + if (this.callerIds[number] !== undefined) { + this.updateCallHistoryEntry(element, this.callerIds[number]); + } + else { + var response = yield external_axios_default().get('http://cpatapi.cpsrvweb2016.cp-austria.at/callerid/' + encodeURIComponent(number)); + var callerId = { tD_NAME: '' }; + if (response.status === 200) { + callerId = response.data; + } + console.log('TAPI call histroy callerid response', number, response, callerId); + this.callerIds[number] = callerId; + this.updateCallHistoryEntry(element, callerId); + } + }); + } +} ;// CONCATENATED MODULE: ./src/call-notification.ts -var call_notification_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - -class CallNotification { - showCallNotification(element) { - return call_notification_awaiter(this, void 0, void 0, function* () { - var number = element.querySelector('.callNumber').textContent; - console.log('TAPI call notification', number); - number = extractNumber(number); - if (!number) { - console.log('TAPI callerid no number found'); - return; - } - console.log('TAPI searching callerid for', number); - var response = yield external_axios_default().get('http://cpatapi.cpsrvweb2016.cp-austria.at/callerid/' + encodeURIComponent(number)); - console.log('TAPI callerid response', response); - var notification = { - text: number - }; - if (response.status === 200) { - var callerId = response.data; - if (callerId) { - notification.text = callerId.tD_NAME + '\r\n' + number + ' (' + callerId.tD_MEDIUM + ')'; - } - } - // eslint-disable-next-line no-undef - GM.notification(notification); - }); - } -} +var call_notification_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; + +class CallNotification { + showCallNotification(element) { + return call_notification_awaiter(this, void 0, void 0, function* () { + var number = element.querySelector('.callNumber').textContent; + console.log('TAPI call notification', number); + number = extractNumber(number); + if (!number) { + console.log('TAPI callerid no number found'); + return; + } + console.log('TAPI searching callerid for', number); + var response = yield external_axios_default().get('http://cpatapi.cpsrvweb2016.cp-austria.at/callerid/' + encodeURIComponent(number)); + console.log('TAPI callerid response', response); + var notification = { + text: number + }; + if (response.status === 200) { + var callerId = response.data; + if (callerId) { + notification.text = callerId.tD_NAME + '\r\n' + number + ' (' + callerId.tD_MEDIUM + ')'; + } + } + // eslint-disable-next-line no-undef + GM.notification(notification); + }); + } +} // EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js var injectStylesIntoStyleTag = __webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); @@ -12324,7 +4234,7 @@ var update = injectStylesIntoStyleTag_default()(search/* default */.Z, options); - /* harmony default export */ var src_search = (search/* default */.Z && search/* default.locals */.Z.locals ? search/* default.locals */.Z.locals : undefined); + /* harmony default export */ const src_search = (search/* default */.Z && search/* default */.Z.locals ? search/* default */.Z.locals : undefined); ;// CONCATENATED MODULE: ./src/debounce.js function debounce(func, wait) { @@ -12333,193 +4243,164 @@ function debounce(func, wait) { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } - const later = () => { clearTimeout(timeout); func(...args); }; - clearTimeout(timeout); timeout = setTimeout(later, wait); }; } ;// CONCATENATED MODULE: ./src/search.ts -var search_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - -class Search { - constructor() { - this.currentSearchText = ''; - this.doSearch = debounce(() => search_awaiter(this, void 0, void 0, function* () { - var search = document.getElementById('tapiSearchInput'); - var searchText = search.value.trim(); - if (searchText === '') { - this.removeSearchResults(); - return; - } - else if (searchText === this.currentSearchText) { - return; - } - console.log('Searching TAPI'); - var response = yield external_axios_default().get('http://cpatapi.cpsrvweb2016.cp-austria.at/search?query=' + encodeURIComponent(searchText)); - console.log('TAPI Search response', response); - var contacts = response.data; - console.log('TAPI Contacts', contacts); - this.removeSearchResults(); - this.currentSearchText = searchText; - var resultList = document.createElement('ul'); - resultList.id = 'tapiResults'; - resultList.classList.add('search-nav-absolute'); - resultList.classList.add('search-nav-ul'); - document.getElementById('tapiSearchBox').appendChild(resultList); - resultList.innerHTML = ''; - contacts.forEach(contact => { - var li = document.createElement('li'); - li.classList.add('tapi-search-result'); - li.classList.add('pointer'); - li.onmouseover = () => { this.selectResult(li); }; - li.dataset.tapiNumber = contact.tD_NUMBER_TAPI; - li.onclick = () => { this.dial(contact.tD_NUMBER_TAPI); }; - li.style.listStyle = 'outside none none'; // display: flex; align-items: center; - var resultText = document.createElement('div'); - resultText.classList.add('search-result-txt'); - li.appendChild(resultText); - var line1 = document.createElement('div'); - line1.appendChild(document.createTextNode(contact.tD_NAME)); - resultText.appendChild(line1); - var line2 = document.createElement('div'); - line2.appendChild(document.createTextNode(contact.tD_MEDIUM + ': ' + contact.tD_NUMBER_TAPI)); - resultText.appendChild(line2); - resultList.appendChild(li); - }); - }), 200); - } - createSearchWindow(element) { - console.log('Create TAPI Search'); - var form = document.createElement('form'); - form.style.width = '200px'; - form.style.float = 'right'; - form.style.marginRight = '20px'; - form.onsubmit = () => { - var items = document.getElementsByClassName('tapi-search-result-selected'); - if (items.length === 0) { - items = document.getElementsByClassName('tapi-search-result'); - } - if (items.length > 0) { - this.dial(items[0].dataset.tapiNumber); - } - else { - this.dial(document.getElementById('tapiSearchInput').value); - } - return false; - }; - var searchBox = document.createElement('div'); - searchBox.classList.add('contact-search-box'); - searchBox.id = 'tapiSearchBox'; - form.appendChild(searchBox); - var searchWrapper = document.createElement('div'); - searchWrapper.classList.add('search-input-wrapper'); - searchWrapper.style.position = 'relative'; - searchBox.appendChild(searchWrapper); - var search = document.createElement('input'); - search.id = 'tapiSearchInput'; - search.autocomplete = 'off'; - search.classList.add('padder'); - search.classList.add('rounded'); - search.classList.add('bg-light'); - search.classList.add('no-border'); - search.classList.add('contact-search-box'); - search.placeholder = 'TAPI Suche'; - search.onfocus = () => { this.doSearch(); }; - search.onkeydown = (ev) => { this.doSearchKeyDown(ev); }; - search.onblur = () => { - console.log('TAPI Search exit', this); - setTimeout(() => { - console.log('TAPI clear search results'); - this.removeSearchResults(); - }, 500); - }; - searchWrapper.appendChild(search); - var icon = document.createElement('span'); - icon.classList.add('fa'); - icon.classList.add('fa-search'); - icon.classList.add('form-control-feedback'); - icon.style.color = 'grey'; - searchWrapper.appendChild(icon); - element.parentElement.insertBefore(form, element); - } - removeSearchResults() { - var resultList = document.getElementById('tapiResults'); - if (resultList) { - resultList.parentNode.removeChild(resultList); - } - this.currentSearchText = ''; - } - doSearchKeyDown(ev) { - if (ev.key === 'ArrowUp') { - let items = document.getElementsByClassName('tapi-search-result-selected'); - if (items.length > 0) { - var prev = items[0].previousSibling; - } - if (!prev) { - items = document.getElementsByClassName('tapi-search-result'); - if (items.length > 0) { - prev = items[items.length - 1]; - } - } - if (prev) { - this.selectResult(prev); - prev.scrollIntoView(true); - } - } - else if (ev.key === 'ArrowDown') { - let items = document.getElementsByClassName('tapi-search-result-selected'); - if (items.length > 0) { - var next = items[0].nextSibling; - } - if (!next) { - items = document.getElementsByClassName('tapi-search-result'); - if (items.length > 0) { - next = items[0]; - } - } - if (next) { - this.selectResult(next); - next.scrollIntoView(false); - } - } - else { - this.doSearch(); - } - } - selectResult(resultLi) { - var items = document.getElementsByClassName('tapi-search-result'); - for (var item of items) { - item.classList.remove('tapi-search-result-selected'); - } - resultLi.classList.add('tapi-search-result-selected'); - } - dial(number) { - console.log('TAPI Search dialing', number); - var searchInput = document.getElementById('dialpad-input'); - searchInput.value = number; - searchInput.focus; - fireChangeEvents(searchInput); - var toaster = document.querySelector('toaster-container'); - if (window.getComputedStyle(toaster, null).display == 'none') { - document.getElementById('menuDialer').click(); - } - } -} +var search_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; + + + +class Search { + constructor() { + this.currentSearchText = ''; + this.doSearch = debounce(() => search_awaiter(this, void 0, void 0, function* () { + var search = document.getElementById('tapiSearchInput'); + var searchText = search.value.trim(); + if (searchText === '') { + this.removeSearchResults(); + return; + } + else if (searchText === this.currentSearchText) { + return; + } + console.log('Searching TAPI'); + var response = yield external_axios_default().get('http://cpatapi.cpsrvweb2016.cp-austria.at/search?query=' + encodeURIComponent(searchText)); + console.log('TAPI Search response', response); + var contacts = response.data; + console.log('TAPI Contacts', contacts); + this.removeSearchResults(); + this.currentSearchText = searchText; + var results = document.createElement('div'); + results.setAttribute('id', 'tapi-search-autocomplete-list'); + results.setAttribute('class', 'tapi-search-autocomplete-items'); + document.getElementById('tapiSearchBox').appendChild(results); + contacts.forEach(contact => { + var item = document.createElement('div'); + item.setAttribute('class', 'tapi-search-autocomplete-item'); + item.appendChild(document.createTextNode(contact.tD_NAME)); + item.appendChild(document.createTextNode(contact.tD_MEDIUM + ': ' + contact.tD_NUMBER_TAPI)); + item.onclick = () => { this.dial(contact.tD_NUMBER_TAPI); }; + item.onmouseover = () => { this.selectResult(item); }; + item.dataset.tapiNumber = contact.tD_NUMBER_TAPI; + results.appendChild(item); + }); + }), 200); + } + createSearchWindow(element) { + console.log('Create TAPI Search'); + var form = document.createElement('form'); + form.onsubmit = () => { + var items = document.getElementsByClassName('tapi-search-autocomplete-active'); + if (items.length === 0) { + items = document.getElementsByClassName('tapi-search-autocomplete-item'); + } + if (items.length > 0) { + this.dial(items[0].dataset.tapiNumber); + } + else { + this.dial(document.getElementById('tapiSearchInput').value); + } + return false; + }; + var searchBox = document.createElement('div'); + searchBox.classList.add('tapi-search-autocomplete'); + searchBox.style.width = '200px'; + searchBox.id = 'tapiSearchBox'; + form.appendChild(searchBox); + var search = document.createElement('input'); + search.id = 'tapiSearchInput'; + search.autocomplete = 'off'; + search.placeholder = 'TAPI Suche'; + search.onfocus = () => { this.doSearch(); }; + search.onkeydown = (ev) => { this.doSearchKeyDown(ev); }; + search.onblur = () => { + console.log('TAPI Search exit', this); + setTimeout(() => { + console.log('TAPI clear search results'); + this.removeSearchResults(); + }, 250); + }; + searchBox.appendChild(search); + element.parentElement.insertBefore(form, element); + } + removeSearchResults() { + var resultList = document.getElementById('tapi-search-autocomplete-list'); + if (resultList) { + resultList.parentNode.removeChild(resultList); + } + this.currentSearchText = ''; + } + doSearchKeyDown(ev) { + if (ev.key === 'ArrowUp') { + let items = document.getElementsByClassName('tapi-search-autocomplete-active'); + if (items.length > 0) { + var prev = items[0].previousSibling; + } + if (!prev) { + items = document.getElementsByClassName('tapi-search-autocomplete-item'); + if (items.length > 0) { + prev = items[items.length - 1]; + } + } + if (prev) { + this.selectResult(prev); + prev.scrollIntoView(true); + } + } + else if (ev.key === 'ArrowDown') { + let items = document.getElementsByClassName('tapi-search-autocomplete-active'); + if (items.length > 0) { + var next = items[0].nextSibling; + } + if (!next) { + items = document.getElementsByClassName('tapi-search-autocomplete-item'); + if (items.length > 0) { + next = items[0]; + } + } + if (next) { + this.selectResult(next); + next.scrollIntoView(false); + } + } + else { + this.doSearch(); + } + } + selectResult(item) { + console.log('Select item', item); + var items = document.getElementsByClassName('tapi-search-autocomplete-active'); + for (var i of items) { + i.classList.remove('tapi-search-autocomplete-active'); + } + item.classList.add('tapi-search-autocomplete-active'); + } + dial(number) { + console.log('TAPI Search dialing', number); + var searchInput = document.getElementById('dialpad-input'); + searchInput.value = number; + searchInput.focus; + fireChangeEvents(searchInput); + var toaster = document.querySelector('toaster-container'); + if (window.getComputedStyle(toaster, null).display == 'none') { + document.getElementById('menuDialer').click(); + } + } +} // EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./src/status.css var cjs_js_src_status = __webpack_require__("./node_modules/css-loader/dist/cjs.js!./src/status.css"); @@ -12550,162 +4431,162 @@ var status_update = injectStylesIntoStyleTag_default()(cjs_js_src_status/* defau - /* harmony default export */ var src_status = (cjs_js_src_status/* default */.Z && cjs_js_src_status/* default.locals */.Z.locals ? cjs_js_src_status/* default.locals */.Z.locals : undefined); + /* harmony default export */ const src_status = (cjs_js_src_status/* default */.Z && cjs_js_src_status/* default */.Z.locals ? cjs_js_src_status/* default */.Z.locals : undefined); ;// CONCATENATED MODULE: ./src/status.ts -var status_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - -class Status { - constructor() { - this._enabled = false; - this._statusOn = 'menuAvailable'; - this._statusOff = 'menuAway'; - this._currentStatus = undefined; - } - showStatus(element) { - return status_awaiter(this, void 0, void 0, function* () { - this._user = yield GM.getValue('tapi-zc-user', ''); - this._enabled = yield GM.getValue('tapi-zc-enabled', false); - this._statusOn = yield GM.getValue('tapi-zc-on', 'menuAvailable'); - this._statusOff = yield GM.getValue('tapi-zc-off', 'menuAvailable'); - console.log('tapi-zc-user', this._user, 'tapi-zc-enabled', this._enabled, 'tapi-zc-on', this._statusOn, 'tapi-zc-off', this._statusOff); - this.checkStatus(); - waitForKeyElements("wc-account-menu > div > ul", (element) => { this.addZcStatusPopup(element); }, true); - }); - } - checkStatus() { - return status_awaiter(this, void 0, void 0, function* () { - if (this._enabled) { - try { - var response = yield external_axios_default().get('http://cpatapi.cpsrvweb2016.cp-austria.at/availability/' + encodeURIComponent(this._user)); - if (response.status == 200) { - var status = response.data; - if (this._currentStatus !== status.loggedIn) { - this._currentStatus = status.loggedIn; - console.log('New status, loggedIn', this._currentStatus); - document.getElementsByTagName("wcavatar")[0].click(); - setTimeout(() => { - var statusId = this._currentStatus ? this._statusOn : this._statusOff; - document.getElementById(statusId).click(); - }, 1000); - } - } - } - catch (error) { - console.log(error); - } - setTimeout(() => this.checkStatus(), 30000); - } - }); - } - addZcStatusPopup(element) { - var divider = document.createElement('li'); - divider.classList.add('divider'); - divider.classList.add('dropdown-divider'); - element.appendChild(divider); - var menu = document.createElement('li'); - element.appendChild(menu); - var link = document.createElement('a'); - link.id = 'tapi-zc-button'; - link.innerText = 'ZeitConsens'; - link.classList.add('dropdown-item'); - link.classList.add('d-flex'); - link.onclick = () => { - document.getElementById('zc-modal').classList.toggle('show'); - }; - menu.appendChild(link); - var html = ''; - var modal = document.createElement('modal-container'); - modal.id = 'zc-modal'; - modal.classList.add('modal'); - modal.classList.add('fade'); - modal.innerHTML = html; - var body = document.getElementsByTagName('body')[0].appendChild(modal); - var btnClose = document.getElementById('zc-btnClose'); - btnClose.onclick = () => { - document.getElementById('zc-modal').classList.toggle('show'); - }; - var zcUser = document.getElementById('tapi-zc-user'); - zcUser.value = this._user; - zcUser.onchange = () => { - this._user = zcUser.value; - GM.setValue('tapi-zc-user', this._user); - console.log('tapi-zc-user', this._user); - this._currentStatus = undefined; - }; - var zcEnabled = document.getElementById('tapi-zc-enabled'); - zcEnabled.checked = this._enabled; - zcEnabled.onchange = () => { - this._enabled = zcEnabled.checked; - GM.setValue('tapi-zc-enabled', this._enabled); - console.log('tapi-zc-enabled', this._enabled); - this._currentStatus = undefined; - this.checkStatus(); - }; - var zcOn = document.getElementById('tapi-zc-on'); - zcOn.value = this._statusOn; - zcOn.onchange = () => { - this._statusOn = zcOn.value; - GM.setValue('tapi-zc-on', this._statusOn); - console.log('tapi-zc-on', this._statusOn); - this._currentStatus = undefined; - }; - var zcOff = document.getElementById('tapi-zc-off'); - zcOff.value = this._statusOff; - zcOff.onchange = () => { - this._statusOff = zcOff.value; - GM.setValue('tapi-zc-off', this._statusOff); - console.log('tapi-zc-off', this._statusOff); - this._currentStatus = undefined; - }; - } -} +var status_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; + + +class Status { + constructor() { + this._enabled = false; + this._statusOn = 'menuAvailable'; + this._statusOff = 'menuAway'; + this._currentStatus = undefined; + } + showStatus(element) { + return status_awaiter(this, void 0, void 0, function* () { + this._user = yield GM.getValue('tapi-zc-user', ''); + this._enabled = yield GM.getValue('tapi-zc-enabled', false); + this._statusOn = yield GM.getValue('tapi-zc-on', 'menuAvailable'); + this._statusOff = yield GM.getValue('tapi-zc-off', 'menuAvailable'); + console.log('tapi-zc-user', this._user, 'tapi-zc-enabled', this._enabled, 'tapi-zc-on', this._statusOn, 'tapi-zc-off', this._statusOff); + this.checkStatus(); + waitForKeyElements("wc-account-menu > div > ul", (element) => { this.addZcStatusPopup(element); }, true); + }); + } + checkStatus() { + return status_awaiter(this, void 0, void 0, function* () { + if (this._enabled) { + try { + var response = yield external_axios_default().get('http://cpatapi.cpsrvweb2016.cp-austria.at/availability/' + encodeURIComponent(this._user)); + if (response.status == 200) { + var status = response.data; + if (this._currentStatus !== status.loggedIn) { + this._currentStatus = status.loggedIn; + console.log('New status, loggedIn', this._currentStatus); + document.getElementsByTagName("wcavatar")[0].click(); + setTimeout(() => { + var statusId = this._currentStatus ? this._statusOn : this._statusOff; + document.getElementById(statusId).click(); + }, 1000); + } + } + } + catch (error) { + console.log(error); + } + setTimeout(() => this.checkStatus(), 30000); + } + }); + } + addZcStatusPopup(element) { + var divider = document.createElement('li'); + divider.classList.add('divider'); + divider.classList.add('dropdown-divider'); + element.appendChild(divider); + var menu = document.createElement('li'); + element.appendChild(menu); + var link = document.createElement('a'); + link.id = 'tapi-zc-button'; + link.innerText = 'ZeitConsens'; + link.classList.add('dropdown-item'); + link.classList.add('d-flex'); + link.onclick = () => { + document.getElementById('zc-modal').classList.toggle('show'); + }; + menu.appendChild(link); + var html = ''; + var modal = document.createElement('modal-container'); + modal.id = 'zc-modal'; + modal.classList.add('modal'); + modal.classList.add('fade'); + modal.innerHTML = html; + var body = document.getElementsByTagName('body')[0].appendChild(modal); + var btnClose = document.getElementById('zc-btnClose'); + btnClose.onclick = () => { + document.getElementById('zc-modal').classList.toggle('show'); + }; + var zcUser = document.getElementById('tapi-zc-user'); + zcUser.value = this._user; + zcUser.onchange = () => { + this._user = zcUser.value; + GM.setValue('tapi-zc-user', this._user); + console.log('tapi-zc-user', this._user); + this._currentStatus = undefined; + }; + var zcEnabled = document.getElementById('tapi-zc-enabled'); + zcEnabled.checked = this._enabled; + zcEnabled.onchange = () => { + this._enabled = zcEnabled.checked; + GM.setValue('tapi-zc-enabled', this._enabled); + console.log('tapi-zc-enabled', this._enabled); + this._currentStatus = undefined; + this.checkStatus(); + }; + var zcOn = document.getElementById('tapi-zc-on'); + zcOn.value = this._statusOn; + zcOn.onchange = () => { + this._statusOn = zcOn.value; + GM.setValue('tapi-zc-on', this._statusOn); + console.log('tapi-zc-on', this._statusOn); + this._currentStatus = undefined; + }; + var zcOff = document.getElementById('tapi-zc-off'); + zcOff.value = this._statusOff; + zcOff.onchange = () => { + this._statusOff = zcOff.value; + GM.setValue('tapi-zc-off', this._statusOff); + console.log('tapi-zc-off', this._statusOff); + this._currentStatus = undefined; + }; + } +} ;// CONCATENATED MODULE: ./src/index.js // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -12715,26 +4596,27 @@ class Status { console.log('script start'); -const src_search_0 = new Search(); // eslint-disable-next-line no-undef - +const src_search_0 = new Search(); +// eslint-disable-next-line no-undef waitForKeyElements('ongoing-call-button', element => { src_search_0.createSearchWindow(element); }, false); -const callNotification = new CallNotification(); // eslint-disable-next-line no-undef - +const callNotification = new CallNotification(); +// eslint-disable-next-line no-undef waitForKeyElements('call-view', element => { callNotification.showCallNotification(element); }, false); -const callHistory = new CallHistory(); // eslint-disable-next-line no-undef - +const callHistory = new CallHistory(); +// eslint-disable-next-line no-undef waitForKeyElements('.call-history-list call', element => { callHistory.showCallHistory(element); }, false); -const src_status_0 = new Status(); // eslint-disable-next-line no-undef - +const src_status_0 = new Status(); +// eslint-disable-next-line no-undef waitForKeyElements('wc-account-menu', element => { src_status_0.showStatus(element); }, false); -}(); +})(); + /******/ })() ; \ No newline at end of file diff --git a/package.json b/package.json index 0cdac7a..848577c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "3cx-tapi", "description": "3CX CP Tapi and Projectmanager integration", - "version": "9.0.3", + "version": "9.1.0", "author": { "name": "Daniel Triendl", "email": "d.triendl@cp-solutions.at"