From 84a4b612558ef305a062b49ce9adf338bc0d128d Mon Sep 17 00:00:00 2001 From: spencer kelly Date: Wed, 27 Dec 2023 11:38:17 -0500 Subject: [PATCH 1/8] start timer plugin --- plugins/play/scratch.js | 7 +++++++ plugins/play/src/Ticker.js | 36 ++++++++++++++++++++++++++++++++++++ plugins/play/src/index.js | 21 +++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 plugins/play/scratch.js create mode 100644 plugins/play/src/Ticker.js create mode 100644 plugins/play/src/index.js diff --git a/plugins/play/scratch.js b/plugins/play/scratch.js new file mode 100644 index 00000000..d81fbc48 --- /dev/null +++ b/plugins/play/scratch.js @@ -0,0 +1,7 @@ +import spacetime from 'spacetime' +import plugin from './src/index.js' + +spacetime.extend(plugin) + +let s = spacetime.now() +s.play() diff --git a/plugins/play/src/Ticker.js b/plugins/play/src/Ticker.js new file mode 100644 index 00000000..5f8c6b5e --- /dev/null +++ b/plugins/play/src/Ticker.js @@ -0,0 +1,36 @@ +/* global performance */ + +// recursive setTimeOut - not perfect, but does not drift +// https://stackoverflow.com/questions/29971898/how-to-create-an-accurate-timer-in-javascript +// see benchmarks at https://github.com/dbkaplun/driftless +class Ticker { + constructor(hertz, callback) { + this.target = performance.now() // target time for the next frame + this.interval = (1 / hertz) * 1000 // the milliseconds between ticks + this.callback = callback + this.stopped = false + this.frame = 0 + this.tick(this) + } + + tick(self) { + if (self.stopped) { + return + } + const currentTime = performance.now() + const currentTarget = self.target + const currentInterval = (self.target += self.interval) - currentTime + + setTimeout(self.tick, currentInterval, self) + self.callback(self.frame++, currentTime, currentTarget, self) + } + + stop() { + this.stopped = true + return this.frame + } +} + +export default Ticker + +// let c = new Ticker(2, () => { console.log('tick') }) diff --git a/plugins/play/src/index.js b/plugins/play/src/index.js new file mode 100644 index 00000000..20471390 --- /dev/null +++ b/plugins/play/src/index.js @@ -0,0 +1,21 @@ +let methods = { + start: function () { + this.startEpoch = this.epoch + return this + }, + stop: function () { + this.startEpoch = null + this.isRunning = false + return this + }, + pause: function () { + this.isRunning = false + return this + }, + elapsed: async function () { + let start = this._from(this.startEpoch, this.tz) + return this.diff(start) + } +} +methods.play = methods.start +export default methods From 39bedcbdf2a0da2ab256e344133ada92da9975e9 Mon Sep 17 00:00:00 2001 From: Jacob Craig Date: Mon, 5 Feb 2024 20:21:32 -0700 Subject: [PATCH 2/8] Getting the type tests fixed --- package-lock.json | 1008 +++++++++++++++++++++++++++----- package.json | 9 +- test/types/constructor.test.ts | 2 +- test/types/index.ts | 9 +- test/types/spacetime-static.ts | 2 +- test/types/tsconfig.json | 4 +- test/types/types.test.ts | 2 +- 7 files changed, 891 insertions(+), 145 deletions(-) diff --git a/package-lock.json b/package-lock.json index af95dacf..35a6d01f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,8 @@ "version": "7.5.0", "license": "Apache-2.0", "devDependencies": { + "@types/node": "^18", + "@types/tape": "5.6.4", "amble": "^1.3.0", "codecov": "3.8.3", "nyc": "^15.1.0", @@ -21,7 +23,10 @@ "shelljs": "0.8.5", "tap-dancer": "0.3.4", "tape": "5.7.2", - "timekeeper": "2.3.1" + "timekeeper": "2.3.1", + "tslib": "2.6.2", + "tsx": "4.7.0", + "typescript": "5.3.3" } }, "node_modules/@babel/code-frame": { @@ -212,10 +217,19 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" @@ -259,9 +273,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.16.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.6.tgz", - "integrity": "sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", + "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -306,18 +320,387 @@ } }, "node_modules/@babel/types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz", - "integrity": "sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", + "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -392,13 +775,13 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz", - "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==", + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", + "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@ljharb/resumer": { @@ -447,10 +830,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "12.6.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.6.9.tgz", - "integrity": "sha512-+YB9FtyxXGyD54p8rXwWaN1EWEyar5L58GlGWgtH2I9rGmLGBQcw63+0jw+ujqVavNuO47S1ByAjm9zdHMnskw==", - "dev": true + "version": "18.19.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.14.tgz", + "integrity": "sha512-EnQ4Us2rmOS64nHDWr0XqAD8DsO6f3XR6lf9UIIrZQpUzPVdN/oPuEzfDWNHSyXLvoGgjuEm/sPwFGSSs35Wtg==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/resolve": { "version": "0.0.8", @@ -461,6 +847,25 @@ "@types/node": "*" } }, + "node_modules/@types/tape": { + "version": "5.6.4", + "resolved": "https://registry.npmjs.org/@types/tape/-/tape-5.6.4.tgz", + "integrity": "sha512-EmL4fJpZyByNCkupLLcJhneqcnT+rQUG5fWKNCsZyBK1x7nUuDTwwEerc4biEMZgvSK2+FXr775aLeXhKXK4Yw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/through": "*" + } + }, + "node_modules/@types/through": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/through/-/through-0.0.33.tgz", + "integrity": "sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/acorn": { "version": "8.8.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", @@ -1151,6 +1556,44 @@ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, + "node_modules/esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -1271,10 +1714,11 @@ "dev": true }, "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, + "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -1377,6 +1821,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-tsconfig": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.2.tgz", + "integrity": "sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -1446,9 +1902,9 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, "node_modules/has": { @@ -2021,9 +2477,9 @@ "dev": true }, "node_modules/istanbul-lib-coverage": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", - "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, "engines": { "node": ">=8" @@ -2142,9 +2598,9 @@ } }, "node_modules/istanbul-reports": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", - "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", "dev": true, "dependencies": { "html-escaper": "^2.0.0", @@ -2734,12 +3190,20 @@ "dev": true }, "node_modules/resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "dependencies": { - "path-parse": "^1.0.6" + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/resolve-from": { @@ -2751,6 +3215,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -2792,15 +3265,6 @@ "rollup-pluginutils": "^2.8.1" } }, - "node_modules/rollup-plugin-commonjs/node_modules/resolve": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", - "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", - "dev": true, - "dependencies": { - "path-parse": "^1.0.6" - } - }, "node_modules/rollup-plugin-filesize-check": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/rollup-plugin-filesize-check/-/rollup-plugin-filesize-check-0.0.2.tgz", @@ -2841,15 +3305,6 @@ "node": ">=6" } }, - "node_modules/rollup-plugin-node-resolve/node_modules/resolve": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", - "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", - "dev": true, - "dependencies": { - "path-parse": "^1.0.6" - } - }, "node_modules/rollup-plugin-terser": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", @@ -3021,9 +3476,9 @@ } }, "node_modules/signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, "node_modules/source-map": { @@ -3126,14 +3581,14 @@ } }, "node_modules/string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" @@ -3185,12 +3640,12 @@ } }, "node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" @@ -3427,6 +3882,31 @@ "integrity": "sha512-3JVP2YVqITUisXblCDq/Bi4P9457G/sdEamInkyvCsjbTcXLXIiG7XCb4kGMFWh6JGXesS3TKxOPtrncN/xe8w==", "dev": true }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "node_modules/tsx": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.0.tgz", + "integrity": "sha512-I+t79RYPlEYlHn9a+KzwrvEwhJg35h/1zHsLC2JXvhC2mdynMv6Zxzvhv5EMV6VF5qJlLlkSnMVvdZV3PSIGcg==", + "dev": true, + "dependencies": { + "esbuild": "~0.19.10", + "get-tsconfig": "^4.7.2" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, "node_modules/type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", @@ -3510,6 +3990,19 @@ "is-typedarray": "^1.0.0" } }, + "node_modules/typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -3525,6 +4018,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "node_modules/urlgrey": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-1.0.0.tgz", @@ -3884,10 +4383,16 @@ "@babel/types": "^7.16.0" } }, + "@babel/helper-string-parser": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "dev": true + }, "@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true }, "@babel/helper-validator-option": { @@ -3919,9 +4424,9 @@ } }, "@babel/parser": { - "version": "7.16.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.6.tgz", - "integrity": "sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", + "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", "dev": true }, "@babel/template": { @@ -3954,15 +4459,177 @@ } }, "@babel/types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz", - "integrity": "sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", + "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" } }, + "@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "dev": true, + "optional": true + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -4022,13 +4689,13 @@ "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz", - "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==", + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", + "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", "dev": true, "requires": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "@ljharb/resumer": { @@ -4068,10 +4735,13 @@ "dev": true }, "@types/node": { - "version": "12.6.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.6.9.tgz", - "integrity": "sha512-+YB9FtyxXGyD54p8rXwWaN1EWEyar5L58GlGWgtH2I9rGmLGBQcw63+0jw+ujqVavNuO47S1ByAjm9zdHMnskw==", - "dev": true + "version": "18.19.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.14.tgz", + "integrity": "sha512-EnQ4Us2rmOS64nHDWr0XqAD8DsO6f3XR6lf9UIIrZQpUzPVdN/oPuEzfDWNHSyXLvoGgjuEm/sPwFGSSs35Wtg==", + "dev": true, + "requires": { + "undici-types": "~5.26.4" + } }, "@types/resolve": { "version": "0.0.8", @@ -4082,6 +4752,25 @@ "@types/node": "*" } }, + "@types/tape": { + "version": "5.6.4", + "resolved": "https://registry.npmjs.org/@types/tape/-/tape-5.6.4.tgz", + "integrity": "sha512-EmL4fJpZyByNCkupLLcJhneqcnT+rQUG5fWKNCsZyBK1x7nUuDTwwEerc4biEMZgvSK2+FXr775aLeXhKXK4Yw==", + "dev": true, + "requires": { + "@types/node": "*", + "@types/through": "*" + } + }, + "@types/through": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/through/-/through-0.0.33.tgz", + "integrity": "sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "acorn": { "version": "8.8.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", @@ -4636,6 +5325,37 @@ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, + "esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -4731,9 +5451,9 @@ "dev": true }, "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "optional": true }, @@ -4801,6 +5521,15 @@ "get-intrinsic": "^1.1.1" } }, + "get-tsconfig": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.2.tgz", + "integrity": "sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -4849,9 +5578,9 @@ } }, "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, "has": { @@ -5259,9 +5988,9 @@ "dev": true }, "istanbul-lib-coverage": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", - "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true }, "istanbul-lib-hook": { @@ -5356,9 +6085,9 @@ } }, "istanbul-reports": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", - "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", "dev": true, "requires": { "html-escaper": "^2.0.0", @@ -5811,12 +6540,14 @@ "dev": true }, "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "requires": { - "path-parse": "^1.0.6" + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" } }, "resolve-from": { @@ -5825,6 +6556,12 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -5854,17 +6591,6 @@ "magic-string": "^0.25.2", "resolve": "^1.11.0", "rollup-pluginutils": "^2.8.1" - }, - "dependencies": { - "resolve": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", - "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - } } }, "rollup-plugin-filesize-check": { @@ -5901,15 +6627,6 @@ "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", "dev": true - }, - "resolve": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", - "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } } } }, @@ -6053,9 +6770,9 @@ } }, "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, "source-map": { @@ -6145,14 +6862,14 @@ } }, "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" } }, "string.prototype.trim": { @@ -6189,12 +6906,12 @@ } }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } }, "strip-bom": { @@ -6378,6 +7095,23 @@ "integrity": "sha512-3JVP2YVqITUisXblCDq/Bi4P9457G/sdEamInkyvCsjbTcXLXIiG7XCb4kGMFWh6JGXesS3TKxOPtrncN/xe8w==", "dev": true }, + "tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "tsx": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.0.tgz", + "integrity": "sha512-I+t79RYPlEYlHn9a+KzwrvEwhJg35h/1zHsLC2JXvhC2mdynMv6Zxzvhv5EMV6VF5qJlLlkSnMVvdZV3PSIGcg==", + "dev": true, + "requires": { + "esbuild": "~0.19.10", + "fsevents": "~2.3.3", + "get-tsconfig": "^4.7.2" + } + }, "type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", @@ -6440,6 +7174,12 @@ "is-typedarray": "^1.0.0" } }, + "typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "dev": true + }, "unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -6452,6 +7192,12 @@ "which-boxed-primitive": "^1.0.2" } }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "urlgrey": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-1.0.0.tgz", diff --git a/package.json b/package.json index 61b06993..d86434f8 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "watch": "amble ./scratch.js", "test": "tape ./test/**/*.test.js | tap-dancer --color always", "testb": "TESTENV=prod tape ./test/**/*.test.js | tap-dancer --color always", - "test:types": "ts-node ./test/types/index.ts | tap-dancer --color always", + "test:types": "tsx ./test/types/index.ts | tap-dancer --color always", "coverage": "nyc -r lcov -n 'src/**/*' -n 'plugins/**/*' npm run coverage:tests", "coverage:tests": "npm run test", "codecov": "npm run coverage && codecov -t 411de6c7-82d2-41e9-a1cc-9096cdab6c72", @@ -47,6 +47,8 @@ "printWidth": 100 }, "devDependencies": { + "@types/node": "^18", + "@types/tape": "5.6.4", "amble": "^1.3.0", "codecov": "3.8.3", "nyc": "^15.1.0", @@ -59,7 +61,10 @@ "shelljs": "0.8.5", "tap-dancer": "0.3.4", "tape": "5.7.2", - "timekeeper": "2.3.1" + "timekeeper": "2.3.1", + "tslib": "2.6.2", + "tsx": "4.7.0", + "typescript": "5.3.3" }, "license": "Apache-2.0" } diff --git a/test/types/constructor.test.ts b/test/types/constructor.test.ts index 0c4ed719..26f8437b 100644 --- a/test/types/constructor.test.ts +++ b/test/types/constructor.test.ts @@ -1,4 +1,4 @@ -import * as test from 'tape' +import { default as test } from 'tape' import { spacetime } from './spacetime-static' import { ParsableDate } from '../../types/types' diff --git a/test/types/index.ts b/test/types/index.ts index 94888864..8c26e73e 100644 --- a/test/types/index.ts +++ b/test/types/index.ts @@ -1,11 +1,4 @@ -// a smoke-test for our typescipt typings -// to run: -// npm install -g typescript -// npm install -g ts-node -// npm install --no-save @types/tape @types/node -// npm run test:types - -import * as test from 'tape' +import { default as test } from 'tape' import { spacetime } from './spacetime-static' test('typefile smoketest', (t: test.Test) => { diff --git a/test/types/spacetime-static.ts b/test/types/spacetime-static.ts index 5b73d4f7..d14c733a 100644 --- a/test/types/spacetime-static.ts +++ b/test/types/spacetime-static.ts @@ -1,4 +1,4 @@ -import * as spacetimejs from '../../builds/spacetime' +import { default as spacetimejs } from '../../builds/spacetime.cjs' import { SpacetimeStatic } from '../../types/constructors' export const spacetime: SpacetimeStatic = spacetimejs diff --git a/test/types/tsconfig.json b/test/types/tsconfig.json index 2f9c146c..809a0bd2 100644 --- a/test/types/tsconfig.json +++ b/test/types/tsconfig.json @@ -1,6 +1,8 @@ { "compilerOptions": { + "outDir": "dist", "target": "es5", + "esModuleInterop": true, "module": "commonjs", "lib": [], "allowJs": true, @@ -22,4 +24,4 @@ "moduleResolution": "node", "allowSyntheticDefaultImports": true } -} +} \ No newline at end of file diff --git a/test/types/types.test.ts b/test/types/types.test.ts index 6232737b..d3965fcd 100644 --- a/test/types/types.test.ts +++ b/test/types/types.test.ts @@ -1,4 +1,4 @@ -import * as test from 'tape' +import { default as test } from 'tape' import { spacetime } from './spacetime-static' test('Spacetime base properties exist', (t: test.Test) => { From dea71aade9af8e645a756009eb412ebd3882ca9c Mon Sep 17 00:00:00 2001 From: Jacob Craig Date: Mon, 5 Feb 2024 21:29:10 -0700 Subject: [PATCH 3/8] Made the exports into explicitly types --- types/constraints.d.ts | 15 +++++++-------- types/constructors.d.ts | 10 ++++++---- types/index.d.ts | 8 ++++---- types/types.d.ts | 2 +- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/types/constraints.d.ts b/types/constraints.d.ts index 7b4177fd..0c3fde63 100644 --- a/types/constraints.d.ts +++ b/types/constraints.d.ts @@ -75,23 +75,22 @@ export type Format = | 'nice-full' | string - export interface I18nOptions { /** Alternatives to Monday, Tuesday..*/ days?: { - short: string[], - long: string[], + short: string[] + long: string[] } /** Alternatives to Jan, Feb..*/ months?: { - short: string[], - long: string[], + short: string[] + long: string[] } /** Alternatives to am, pm*/ ampm?: { - am: string, - pm: string, + am: string + pm: string } /** Default dayname formatting */ useTitleCase?: boolean -} \ No newline at end of file +} diff --git a/types/constructors.d.ts b/types/constructors.d.ts index 89595d2c..8b2cdf1b 100644 --- a/types/constructors.d.ts +++ b/types/constructors.d.ts @@ -1,4 +1,4 @@ -import { Spacetime, ParsableDate, TimezoneSet } from './types' +import type { Spacetime, ParsableDate, TimezoneSet } from './types' export interface SpacetimeConstructorOptions { /** javascript dates use millisecond-epochs, instead of second-epochs, like some other languages. This is a common bug, and by default spacetime warns if you set an epoch within January 1970. to disable set to true */ @@ -54,7 +54,11 @@ export interface SpacetimeConstructor { * @param timezone Optional timezone. If omitted uses the browser timezone. * @param options Options for silencing warnings. */ - (parsableDate?: ParsableDate | null, timezone?: string, options?: SpacetimeConstructorOptions): Spacetime + ( + parsableDate?: ParsableDate | null, + timezone?: string, + options?: SpacetimeConstructorOptions + ): Spacetime } export interface SpacetimeStatic extends SpacetimeConstructor { @@ -84,6 +88,4 @@ export interface SpacetimeStatic extends SpacetimeConstructor { /** set as furthest-possible future date */ max: (timezone?: string, options?: SpacetimeConstructorOptions) => Spacetime - } - diff --git a/types/index.d.ts b/types/index.d.ts index 1508ca65..9526619a 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,10 +1,10 @@ -import { SpacetimeStatic } from './constructors' +import type { SpacetimeStatic } from './constructors' declare const spacetime: SpacetimeStatic // We need to use a single default export here so everything lines up with the actual imported object from JS export default spacetime -export * from './constructors' -export * from './constraints' -export * from './types' +export { SpacetimeConstructor, SpacetimeConstructorOptions, SpacetimeStatic } from './constructors' +export { Format, I18nOptions, TimeUnit } from './constraints' +export { Spacetime, Diff, ParsableDate, Progress, Since, TimezoneMeta, TimezoneSet } from './types' diff --git a/types/types.d.ts b/types/types.d.ts index 7319db75..4be20a42 100644 --- a/types/types.d.ts +++ b/types/types.d.ts @@ -1,4 +1,4 @@ -import { TimeUnit, Format, I18nOptions } from './constraints' +import type { TimeUnit, Format, I18nOptions } from './constraints' /** a date/timezone object */ export interface Spacetime { From 9ef01e5589d923141dad8bff21ac7fe0eb1e41f3 Mon Sep 17 00:00:00 2001 From: spencer kelly Date: Wed, 7 Feb 2024 15:59:08 -0500 Subject: [PATCH 4/8] fix leap-year fmt issue --- scratch.js | 13 ++++++++++--- src/input/formats/02-mdy.js | 14 ++++++++------ src/input/parse.js | 1 - 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/scratch.js b/scratch.js index 5e211799..5fcf6181 100644 --- a/scratch.js +++ b/scratch.js @@ -1,9 +1,16 @@ // const spacetime = require('./builds/spacetime.cjs') import spacetime from './src/index.js' -let s = spacetime(null, 'pacific/fiji') -console.log(s.time()) -console.log(s.timezone()) +// console.log(spacetime('Feb 29 2001').iso()) +console.log(spacetime('Sun Mar 14 15:09:48 +0000 2021').iso()) +// console.log(spacetime('Feb 29 2001').isValid()) +// console.log(spacetime('Feb 29 2001').isValid()) +// console.log(spacetime('Feb 29 2000').isValid(), true) +// console.log(spacetime('Feb 29 2003').isValid(), false) + +// let s = spacetime(null, 'pacific/fiji') +// console.log(s.time()) +// console.log(s.timezone()) // s = s.minus(5, 'months') // console.log(s.time()) // console.log(s.timezone()) diff --git a/src/input/formats/02-mdy.js b/src/input/formats/02-mdy.js index 8894c21d..1296cf3e 100644 --- a/src/input/formats/02-mdy.js +++ b/src/input/formats/02-mdy.js @@ -1,6 +1,6 @@ import walkTo from '../../methods/set/walk.js' import { toCardinal } from '../../fns.js' -import { validate, parseTime, parseYear, parseMonth } from './_parsers.js' +import { validate, parseTime, parseYear, parseMonth, parseOffset } from './_parsers.js' export default [ // ===== @@ -71,19 +71,21 @@ export default [ }, // 'Sun Mar 14 15:09:48 +0000 2021' { - reg: /^([a-z]+) ([0-9]{1,2})( [0-9:]+)?( \+[0-9]{4})?( [0-9]{4})?$/i, + reg: /^([a-z]+) ([0-9]{1,2}) ([0-9]{1,2}:[0-9]{2}:?[0-9]{0,2})( \+[0-9]{4})?( [0-9]{4})?$/i, parse: (s, arr) => { + let [, month, date, time, tz, year] = arr let obj = { - year: parseYear(arr[5], s._today), - month: parseMonth(arr[1]), - date: toCardinal(arr[2] || '') + year: parseYear(year, s._today), + month: parseMonth(month), + date: toCardinal(date || '') } if (validate(obj) === false) { s.epoch = null return s } walkTo(s, obj) - s = parseTime(s, arr[3]) + s = parseTime(s, time) + s = parseOffset(s, tz) return s } } diff --git a/src/input/parse.js b/src/input/parse.js index 2b26ebc7..abbedb84 100644 --- a/src/input/parse.js +++ b/src/input/parse.js @@ -6,7 +6,6 @@ const parseString = function (s, input, givenTz) { for (let i = 0; i < parsers.length; i++) { let m = input.match(parsers[i].reg) if (m) { - // console.log(parsers[i].reg) let res = parsers[i].parse(s, m, givenTz) if (res !== null && res.isValid()) { return res From d1f956a04014d0551e978668d9626cc031cb79ae Mon Sep 17 00:00:00 2001 From: spencer kelly Date: Wed, 7 Feb 2024 16:19:57 -0500 Subject: [PATCH 5/8] all tests passing again --- scratch.js | 5 +---- src/input/formats/02-mdy.js | 2 +- src/input/formats/parseOffset.js | 2 +- src/input/formats/parseTime.js | 13 +++++++------ src/spacetime.js | 3 +++ test/str-parse.test.js | 12 ++++++------ 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/scratch.js b/scratch.js index 5fcf6181..3a21c7d9 100644 --- a/scratch.js +++ b/scratch.js @@ -2,11 +2,8 @@ import spacetime from './src/index.js' // console.log(spacetime('Feb 29 2001').iso()) +// console.log(spacetime('2001-02-02T12Z').tz) console.log(spacetime('Sun Mar 14 15:09:48 +0000 2021').iso()) -// console.log(spacetime('Feb 29 2001').isValid()) -// console.log(spacetime('Feb 29 2001').isValid()) -// console.log(spacetime('Feb 29 2000').isValid(), true) -// console.log(spacetime('Feb 29 2003').isValid(), false) // let s = spacetime(null, 'pacific/fiji') // console.log(s.time()) diff --git a/src/input/formats/02-mdy.js b/src/input/formats/02-mdy.js index 1296cf3e..2cdaa34d 100644 --- a/src/input/formats/02-mdy.js +++ b/src/input/formats/02-mdy.js @@ -84,8 +84,8 @@ export default [ return s } walkTo(s, obj) - s = parseTime(s, time) s = parseOffset(s, tz) + s = parseTime(s, time) return s } } diff --git a/src/input/formats/parseOffset.js b/src/input/formats/parseOffset.js index 30cc97f5..a68acf08 100644 --- a/src/input/formats/parseOffset.js +++ b/src/input/formats/parseOffset.js @@ -3,7 +3,7 @@ const parseOffset = (s, offset) => { if (!offset) { return s } - + offset = offset.trim().toLowerCase() // according to ISO8601, tz could be hh:mm, hhmm or hh // so need few more steps before the calculation. let num = 0 diff --git a/src/input/formats/parseTime.js b/src/input/formats/parseTime.js index 427b2aab..489a7086 100644 --- a/src/input/formats/parseTime.js +++ b/src/input/formats/parseTime.js @@ -1,10 +1,10 @@ // truncate any sub-millisecond values const parseMs = function (str = '') { str = String(str) - //js does not support sub-millisecond values + //js does not support sub-millisecond values // so truncate these - 2021-11-02T19:55:30.087772 if (str.length > 3) { - str = str.substr(0, 3) + str = str.substring(0, 3) } else if (str.length === 1) { // assume ms are zero-padded on the left // but maybe not on the right. @@ -22,19 +22,20 @@ const parseTime = (s, str = '') => { //formal time format - 04:30.23 let arr = str.match(/([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?[:\.]?([0-9]{1,4})?/) if (arr !== null) { + let [, h, m, sec, ms] = arr //validate it a little - let h = Number(arr[1]) + h = Number(h) if (h < 0 || h > 24) { return s.startOf('day') } - let m = Number(arr[2]) //don't accept '5:3pm' + m = Number(m) //don't accept '5:3pm' if (arr[2].length < 2 || m < 0 || m > 59) { return s.startOf('day') } s = s.hour(h) s = s.minute(m) - s = s.seconds(arr[3] || 0) - s = s.millisecond(parseMs(arr[4])) + s = s.seconds(sec || 0) + s = s.millisecond(parseMs(ms)) //parse-out am/pm let ampm = str.match(/[\b0-9] ?(am|pm)\b/) if (ampm !== null && ampm[1]) { diff --git a/src/spacetime.js b/src/spacetime.js index f5498d1c..0c5fe90f 100644 --- a/src/spacetime.js +++ b/src/spacetime.js @@ -64,6 +64,9 @@ const SpaceTime = function (input, tz, options = {}) { // parse the various formats let tmp = handleInput(this, input) this.epoch = tmp.epoch + if (tmp.tz) { + this.tz = tmp.tz + } } // (add instance methods to prototype) diff --git a/test/str-parse.test.js b/test/str-parse.test.js index ca04de2b..c2fb108c 100644 --- a/test/str-parse.test.js +++ b/test/str-parse.test.js @@ -11,7 +11,7 @@ test('string-parse', (t) => { let arr = [ ['Sun Mar 14 15:09:48 1999', 'March 14 1999 3:09:48pm'], ['Tue Mar 16 21:49', 'Tues Mar 16 9:49pm'], - ['Sun Mar 14 15:09:48 +0000 2012', 'March 14 15:09:48 GMT'], + ['Sun Mar 14 15:09:48 +0000 2012', '2012-03-14T15:09:48Z'], // dmy ['2 February 2003', '2003-02-02'], ['08 February 1986', '1986-02-08'], @@ -46,11 +46,11 @@ test('string-parse', (t) => { ['feb.5.2002 2:30pm', '2002-02-05 2:30pm'], ['2002.feb.5 14:00:00', '2002-02-05 2:00pm'], // millisecond varieties - ['2021-11-02T19:55:30.087+01', '2021-11-02T19:55:30.087+01'],//leading zero - ['2021-11-02T19:55:30.0872+01', '2021-11-02T19:55:30.087+01'],//4 digits - ['2021-11-02T19:55:30.00872+01', '2021-11-02T19:55:30.008+01'],//5 digits - ['2021-11-02T19:55:30.008722+01', '2021-11-02T19:55:30.008+01'],//6 digits - ['2021-11-02T19:55:30.9898989+01', '2021-11-02T19:55:30.989+01'],//lots + ['2021-11-02T19:55:30.087+01', '2021-11-02T19:55:30.087+01'], //leading zero + ['2021-11-02T19:55:30.0872+01', '2021-11-02T19:55:30.087+01'], //4 digits + ['2021-11-02T19:55:30.00872+01', '2021-11-02T19:55:30.008+01'], //5 digits + ['2021-11-02T19:55:30.008722+01', '2021-11-02T19:55:30.008+01'], //6 digits + ['2021-11-02T19:55:30.9898989+01', '2021-11-02T19:55:30.989+01'] //lots ] arr.forEach((a) => { let left = spacetime(a[0], null, { today }) From 30830cd10655b6ab4b56706bfb9c9477a2f3b0ba Mon Sep 17 00:00:00 2001 From: spencer kelly Date: Wed, 7 Feb 2024 16:24:44 -0500 Subject: [PATCH 6/8] bump release jobs --- .github/workflows/build-and-test.yml | 6 +++--- .github/workflows/coverage.yml | 6 +++--- .github/workflows/release.yml | 13 ++++++++----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 50344beb..a9213efd 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -11,15 +11,15 @@ jobs: node-version: [16.x, 18.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: use node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: cache dependencies - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.npm key: ${{ runner.os }}-npm-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 8e6bb34e..0880588e 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -11,12 +11,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2.1.2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: '16' - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 532e05a3..786b4ce3 100755 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,9 @@ on: jobs: release: runs-on: ubuntu-latest - + permissions: + contents: read + id-token: write env: CI: true @@ -17,9 +19,10 @@ jobs: # delegate to the build- and-test workflow, but I haven't found a way to do # that yet. steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: actions/setup-node@v4 with: node-version: 16.x @@ -56,6 +59,6 @@ jobs: - name: publish run: | echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc - npm publish + npm publish --access public --provenance env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} From 2bc115f20cbf0188fb92015f84fecbd591c45814 Mon Sep 17 00:00:00 2001 From: spencer kelly Date: Mon, 12 Feb 2024 09:10:57 -0500 Subject: [PATCH 7/8] fixes to cairo, kyiv, gaza DST times, etc --- zonefile/iana.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/zonefile/iana.js b/zonefile/iana.js index 548f7ff1..f6ca4345 100644 --- a/zonefile/iana.js +++ b/zonefile/iana.js @@ -54,7 +54,7 @@ export default { 'africa/cairo': { offset: 3, hem: 'n', - dst: '04/28:00->10/26:24' + dst: '04/26:00->10/31:24' }, 'africa/casablanca': { offset: 0, @@ -563,7 +563,8 @@ export default { }, 'america/metlakatla': { offset: -8, - hem: 'n' + hem: 'n', + dst: '03/10:02->11/03:02' }, 'america/mexico_city': { offset: -6, @@ -633,7 +634,7 @@ export default { 'america/ciudad_juarez': { offset: -6, hem: 'n', - dst: '03/12:02->11/05:02' + dst: '03/10:02->11/03:02' }, 'america/panama': { offset: -5, @@ -975,12 +976,12 @@ export default { 'asia/gaza': { offset: 3, hem: 'n', - dst: '03/31:00->10/25:01' + dst: '04/20:02->10/26:02' }, 'asia/hebron': { offset: 3, hem: 'n', - dst: '03/31:00->10/25:01' + dst: '04/20:02->10/26:02' }, 'asia/hong_kong': { offset: 8, @@ -1413,7 +1414,7 @@ export default { 'europe/kyiv': { offset: 3, hem: 'n', - dst: '03/26:03->10/29:04' + dst: '03/31:03->10/27:04' }, 'europe/lisbon': { offset: 1, From 5a8cbc077cb9923d337c298703ca0ed3b0ed3ee9 Mon Sep 17 00:00:00 2001 From: spencer kelly Date: Mon, 12 Feb 2024 09:15:33 -0500 Subject: [PATCH 8/8] 7.6.0rc --- builds/spacetime.cjs | 49 ++++---- builds/spacetime.min.js | 2 +- builds/spacetime.mjs | 2 +- changelog.md | 9 ++ package-lock.json | 248 ++++++++++++++++++++++------------------ package.json | 6 +- src/_version.js | 2 +- zonefile/_build.js | 14 +-- 8 files changed, 185 insertions(+), 147 deletions(-) diff --git a/builds/spacetime.cjs b/builds/spacetime.cjs index f897d2f1..ca48f746 100644 --- a/builds/spacetime.cjs +++ b/builds/spacetime.cjs @@ -1,4 +1,4 @@ -/* spencermountain/spacetime 7.5.0 Apache 2.0 */ +/* spencermountain/spacetime 7.6.0 Apache 2.0 */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : @@ -75,13 +75,12 @@ "4|n": "2/baku,2/dubai,2/muscat,2/tbilisi,2/yerevan,8/astrakhan,8/samara,8/saratov,8/ulyanovsk,8/volgograd,9/mahe,9/mauritius,2/volgograd", "4.5|n": "2/kabul", "3|s": "12/syowa,9/antananarivo", - "3|n|04/28:00->10/26:24": "0/cairo,egypt", - "3|n|03/31:03->10/27:04": "2/famagusta,2/nicosia,8/athens,8/bucharest,8/helsinki,8/mariehamn,8/riga,8/sofia,8/tallinn,8/uzhgorod,8/vilnius,8/zaporozhye,8/nicosia,eet", + "3|n|04/26:00->10/31:24": "0/cairo,egypt", + "3|n|04/20:02->10/26:02": "2/gaza,2/hebron", + "3|n|03/31:03->10/27:04": "2/famagusta,2/nicosia,8/athens,8/bucharest,8/helsinki,8/kyiv,8/mariehamn,8/riga,8/sofia,8/tallinn,8/uzhgorod,8/vilnius,8/zaporozhye,8/nicosia,8/kiev,eet", "3|n|03/31:02->10/27:03": "8/chisinau,8/tiraspol", "3|n|03/31:00->10/26:24": "2/beirut", - "3|n|03/31:00->10/25:01": "2/gaza,2/hebron", "3|n|03/29:02->10/27:02": "2/jerusalem,2/tel_aviv,israel", - "3|n|03/26:03->10/29:04": "8/kyiv,8/kiev", "3|n": "0/addis_ababa,0/asmara,0/asmera,0/dar_es_salaam,0/djibouti,0/juba,0/kampala,0/mogadishu,0/nairobi,2/aden,2/amman,2/baghdad,2/bahrain,2/damascus,2/kuwait,2/qatar,2/riyadh,8/istanbul,8/kirov,8/minsk,8/moscow,8/simferopol,9/comoro,9/mayotte,2/istanbul,turkey,w-su", "3.5|n": "2/tehran,iran", "2|s|03/31:02->10/27:02": "12/troll", @@ -112,14 +111,13 @@ "-9|n|03/10:02->11/03:02": "1/adak,1/atka,us/aleutian", "-9|n": "11/gambier", "-9.5|n": "11/marquesas", - "-8|n|03/10:02->11/03:02": "1/anchorage,1/juneau,1/nome,1/sitka,1/yakutat,us/alaska", - "-8|n": "1/metlakatla,11/pitcairn", + "-8|n|03/10:02->11/03:02": "1/anchorage,1/juneau,1/metlakatla,1/nome,1/sitka,1/yakutat,us/alaska", + "-8|n": "11/pitcairn", "-7|n|03/10:02->11/03:02": "1/los_angeles,1/santa_isabel,1/tijuana,1/vancouver,1/ensenada,6/pacific,10/bajanorte,us/pacific-new,us/pacific", "-7|n": "1/creston,1/dawson,1/dawson_creek,1/fort_nelson,1/hermosillo,1/mazatlan,1/phoenix,1/whitehorse,6/yukon,10/bajasur,us/arizona,mst", "-6|s|04/06:22->09/07:22": "11/easter,7/easterisland", "-6|n|04/07:02->10/27:02": "1/merida", - "-6|n|03/12:02->11/05:02": "1/ciudad_juarez", - "-6|n|03/10:02->11/03:02": "1/boise,1/cambridge_bay,1/denver,1/edmonton,1/inuvik,1/north_dakota,1/ojinaga,1/yellowknife,1/shiprock,6/mountain,navajo,us/mountain", + "-6|n|03/10:02->11/03:02": "1/boise,1/cambridge_bay,1/denver,1/edmonton,1/inuvik,1/north_dakota,1/ojinaga,1/ciudad_juarez,1/yellowknife,1/shiprock,6/mountain,navajo,us/mountain", "-6|n": "1/bahia_banderas,1/belize,1/chihuahua,1/costa_rica,1/el_salvador,1/guatemala,1/managua,1/mexico_city,1/monterrey,1/regina,1/swift_current,1/tegucigalpa,11/galapagos,6/east-saskatchewan,6/saskatchewan,10/general", "-5|s": "1/lima,1/rio_branco,1/porto_acre,5/acre", "-5|n|03/10:02->11/03:02": "1/chicago,1/matamoros,1/menominee,1/rainy_river,1/rankin_inlet,1/resolute,1/winnipeg,1/indiana/knox,1/indiana/tell_city,1/north_dakota/beulah,1/north_dakota/center,1/north_dakota/new_salem,1/knox_in,6/central,us/central,us/indiana-starke", @@ -779,7 +777,7 @@ if (!offset) { return s } - + offset = offset.trim().toLowerCase(); // according to ISO8601, tz could be hh:mm, hhmm or hh // so need few more steps before the calculation. let num = 0; @@ -834,10 +832,10 @@ // truncate any sub-millisecond values const parseMs = function (str = '') { str = String(str); - //js does not support sub-millisecond values + //js does not support sub-millisecond values // so truncate these - 2021-11-02T19:55:30.087772 if (str.length > 3) { - str = str.substr(0, 3); + str = str.substring(0, 3); } else if (str.length === 1) { // assume ms are zero-padded on the left // but maybe not on the right. @@ -855,19 +853,20 @@ //formal time format - 04:30.23 let arr = str.match(/([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?[:\.]?([0-9]{1,4})?/); if (arr !== null) { + let [, h, m, sec, ms] = arr; //validate it a little - let h = Number(arr[1]); + h = Number(h); if (h < 0 || h > 24) { return s.startOf('day') } - let m = Number(arr[2]); //don't accept '5:3pm' + m = Number(m); //don't accept '5:3pm' if (arr[2].length < 2 || m < 0 || m > 59) { return s.startOf('day') } s = s.hour(h); s = s.minute(m); - s = s.seconds(arr[3] || 0); - s = s.millisecond(parseMs(arr[4])); + s = s.seconds(sec || 0); + s = s.millisecond(parseMs(ms)); //parse-out am/pm let ampm = str.match(/[\b0-9] ?(am|pm)\b/); if (ampm !== null && ampm[1]) { @@ -1084,19 +1083,21 @@ }, // 'Sun Mar 14 15:09:48 +0000 2021' { - reg: /^([a-z]+) ([0-9]{1,2})( [0-9:]+)?( \+[0-9]{4})?( [0-9]{4})?$/i, + reg: /^([a-z]+) ([0-9]{1,2}) ([0-9]{1,2}:[0-9]{2}:?[0-9]{0,2})( \+[0-9]{4})?( [0-9]{4})?$/i, parse: (s, arr) => { + let [, month, date, time, tz, year] = arr; let obj = { - year: parseYear(arr[5], s._today), - month: parseMonth(arr[1]), - date: toCardinal(arr[2] || '') + year: parseYear(year, s._today), + month: parseMonth(month), + date: toCardinal(date || '') }; if (validate$1(obj) === false) { s.epoch = null; return s } walkTo$1(s, obj); - s = parseTime$1(s, arr[3]); + s = parseOffset$1(s, tz); + s = parseTime$1(s, time); return s } } @@ -1312,7 +1313,6 @@ for (let i = 0; i < parsers.length; i++) { let m = input.match(parsers[i].reg); if (m) { - // console.log(parsers[i].reg) let res = parsers[i].parse(s, m, givenTz); if (res !== null && res.isValid()) { return res @@ -4031,6 +4031,9 @@ // parse the various formats let tmp = handleInput(this, input); this.epoch = tmp.epoch; + if (tmp.tz) { + this.tz = tmp.tz; + } }; // (add instance methods to prototype) @@ -4110,7 +4113,7 @@ }; var whereIts$1 = whereIts; - var version = '7.5.0'; + var version = '7.6.0'; const main = (input, tz, options) => new Spacetime(input, tz, options); diff --git a/builds/spacetime.min.js b/builds/spacetime.min.js index 20dc7cb2..0b326718 100644 --- a/builds/spacetime.min.js +++ b/builds/spacetime.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).spacetime=t()}(this,(function(){"use strict";const e=(e,t,n)=>{const[r,a]=e.split("/"),[o,i]=a.split(":");return Date.UTC(n,r-1,o,i)-36e5*t};var t=(t,n,r,a,o)=>{const i=new Date(t).getUTCFullYear(),s=e(n,o,i),u=e(r,a,i);return t>=s&&t{let n=e.timezones[e.tz];if(void 0===n)return console.warn("Warning: couldn't find timezone "+e.tz),0;if(void 0===n.dst)return n.offset;let r=n.offset,a=n.offset+1;"n"===n.hem&&(a=r-1);let o=n.dst.split("->");return!0===t(e.epoch,o[0],o[1],r,a)?r:a},r={"9|s":"2/dili,2/jayapura","9|n":"2/chita,2/khandyga,2/pyongyang,2/seoul,2/tokyo,2/yakutsk,11/palau,japan,rok","9.5|s|04/07:03->10/06:02":"4/adelaide,4/broken_hill,4/south,4/yancowinna","9.5|s":"4/darwin,4/north","8|s|03/13:01->10/02:00":"12/casey","8|s":"2/kuala_lumpur,2/makassar,2/singapore,4/perth,2/ujung_pandang,4/west,singapore","8|n":"2/brunei,2/choibalsan,2/hong_kong,2/irkutsk,2/kuching,2/macau,2/manila,2/shanghai,2/taipei,2/ulaanbaatar,2/chongqing,2/chungking,2/harbin,2/macao,2/ulan_bator,hongkong,prc,roc","8.75|s":"4/eucla","7|s":"12/davis,2/jakarta,9/christmas","7|n":"2/bangkok,2/barnaul,2/hovd,2/krasnoyarsk,2/novokuznetsk,2/novosibirsk,2/phnom_penh,2/pontianak,2/ho_chi_minh,2/tomsk,2/vientiane,2/saigon","6|s":"12/vostok","6|n":"2/almaty,2/bishkek,2/dhaka,2/omsk,2/qyzylorda,2/qostanay,2/thimphu,2/urumqi,9/chagos,2/dacca,2/kashgar,2/thimbu","6.5|n":"2/yangon,9/cocos,2/rangoon","5|s":"12/mawson,9/kerguelen","5|n":"2/aqtau,2/aqtobe,2/ashgabat,2/atyrau,2/dushanbe,2/karachi,2/oral,2/samarkand,2/tashkent,2/yekaterinburg,9/maldives,2/ashkhabad","5.75|n":"2/kathmandu,2/katmandu","5.5|n":"2/kolkata,2/colombo,2/calcutta","4|s":"9/reunion","4|n":"2/baku,2/dubai,2/muscat,2/tbilisi,2/yerevan,8/astrakhan,8/samara,8/saratov,8/ulyanovsk,8/volgograd,9/mahe,9/mauritius,2/volgograd","4.5|n":"2/kabul","3|s":"12/syowa,9/antananarivo","3|n|04/28:00->10/26:24":"0/cairo,egypt","3|n|03/31:03->10/27:04":"2/famagusta,2/nicosia,8/athens,8/bucharest,8/helsinki,8/mariehamn,8/riga,8/sofia,8/tallinn,8/uzhgorod,8/vilnius,8/zaporozhye,8/nicosia,eet","3|n|03/31:02->10/27:03":"8/chisinau,8/tiraspol","3|n|03/31:00->10/26:24":"2/beirut","3|n|03/31:00->10/25:01":"2/gaza,2/hebron","3|n|03/29:02->10/27:02":"2/jerusalem,2/tel_aviv,israel","3|n|03/26:03->10/29:04":"8/kyiv,8/kiev","3|n":"0/addis_ababa,0/asmara,0/asmera,0/dar_es_salaam,0/djibouti,0/juba,0/kampala,0/mogadishu,0/nairobi,2/aden,2/amman,2/baghdad,2/bahrain,2/damascus,2/kuwait,2/qatar,2/riyadh,8/istanbul,8/kirov,8/minsk,8/moscow,8/simferopol,9/comoro,9/mayotte,2/istanbul,turkey,w-su","3.5|n":"2/tehran,iran","2|s|03/31:02->10/27:02":"12/troll","2|s":"0/gaborone,0/harare,0/johannesburg,0/lubumbashi,0/lusaka,0/maputo,0/maseru,0/mbabane","2|n|03/31:02->10/27:03":"0/ceuta,arctic/longyearbyen,8/amsterdam,8/andorra,8/belgrade,8/berlin,8/bratislava,8/brussels,8/budapest,8/busingen,8/copenhagen,8/gibraltar,8/ljubljana,8/luxembourg,8/madrid,8/malta,8/monaco,8/oslo,8/paris,8/podgorica,8/prague,8/rome,8/san_marino,8/sarajevo,8/skopje,8/stockholm,8/tirane,8/vaduz,8/vatican,8/vienna,8/warsaw,8/zagreb,8/zurich,3/jan_mayen,poland,cet,met","2|n":"0/blantyre,0/bujumbura,0/khartoum,0/kigali,0/tripoli,8/kaliningrad,libya","1|s":"0/brazzaville,0/kinshasa,0/luanda,0/windhoek","1|n|03/31:01->10/27:02":"3/canary,3/faroe,3/madeira,8/dublin,8/guernsey,8/isle_of_man,8/jersey,8/lisbon,8/london,3/faeroe,eire,8/belfast,gb-eire,gb,portugal,wet","1|n":"0/algiers,0/bangui,0/douala,0/lagos,0/libreville,0/malabo,0/ndjamena,0/niamey,0/porto-novo,0/tunis","14|n":"11/kiritimati","13|s":"11/apia,11/tongatapu","13|n":"11/enderbury,11/kanton,11/fakaofo","12|s|04/07:03->09/29:02":"12/mcmurdo,11/auckland,12/south_pole,nz","12|s":"11/fiji","12|n":"2/anadyr,2/kamchatka,2/srednekolymsk,11/funafuti,11/kwajalein,11/majuro,11/nauru,11/tarawa,11/wake,11/wallis,kwajalein","12.75|s|04/07:03->04/07:02":"11/chatham,nz-chat","11|s|04/07:03->10/06:02":"12/macquarie","11|s":"11/bougainville","11|n":"2/magadan,2/sakhalin,11/efate,11/guadalcanal,11/kosrae,11/noumea,11/pohnpei,11/ponape","11.5|n|04/07:03->10/06:02":"11/norfolk","10|s|04/07:03->10/06:02":"4/currie,4/hobart,4/melbourne,4/sydney,4/act,4/canberra,4/nsw,4/tasmania,4/victoria","10|s":"12/dumontdurville,4/brisbane,4/lindeman,11/port_moresby,4/queensland","10|n":"2/ust-nera,2/vladivostok,11/guam,11/saipan,11/chuuk,11/truk,11/yap","10.5|s|04/07:01->10/06:02":"4/lord_howe,4/lhi","0|s|03/10:03->04/14:02":"0/casablanca,0/el_aaiun","0|n|03/31:00->10/27:01":"1/scoresbysund,3/azores","0|n":"0/abidjan,0/accra,0/bamako,0/banjul,0/bissau,0/conakry,0/dakar,0/freetown,0/lome,0/monrovia,0/nouakchott,0/ouagadougou,0/sao_tome,1/danmarkshavn,3/reykjavik,3/st_helena,13/gmt,13/utc,0/timbuktu,13/greenwich,13/uct,13/universal,13/zulu,gmt-0,gmt+0,gmt0,greenwich,iceland,uct,universal,utc,zulu,13/unknown,factory","-9|n|03/10:02->11/03:02":"1/adak,1/atka,us/aleutian","-9|n":"11/gambier","-9.5|n":"11/marquesas","-8|n|03/10:02->11/03:02":"1/anchorage,1/juneau,1/nome,1/sitka,1/yakutat,us/alaska","-8|n":"1/metlakatla,11/pitcairn","-7|n|03/10:02->11/03:02":"1/los_angeles,1/santa_isabel,1/tijuana,1/vancouver,1/ensenada,6/pacific,10/bajanorte,us/pacific-new,us/pacific","-7|n":"1/creston,1/dawson,1/dawson_creek,1/fort_nelson,1/hermosillo,1/mazatlan,1/phoenix,1/whitehorse,6/yukon,10/bajasur,us/arizona,mst","-6|s|04/06:22->09/07:22":"11/easter,7/easterisland","-6|n|04/07:02->10/27:02":"1/merida","-6|n|03/12:02->11/05:02":"1/ciudad_juarez","-6|n|03/10:02->11/03:02":"1/boise,1/cambridge_bay,1/denver,1/edmonton,1/inuvik,1/north_dakota,1/ojinaga,1/yellowknife,1/shiprock,6/mountain,navajo,us/mountain","-6|n":"1/bahia_banderas,1/belize,1/chihuahua,1/costa_rica,1/el_salvador,1/guatemala,1/managua,1/mexico_city,1/monterrey,1/regina,1/swift_current,1/tegucigalpa,11/galapagos,6/east-saskatchewan,6/saskatchewan,10/general","-5|s":"1/lima,1/rio_branco,1/porto_acre,5/acre","-5|n|03/10:02->11/03:02":"1/chicago,1/matamoros,1/menominee,1/rainy_river,1/rankin_inlet,1/resolute,1/winnipeg,1/indiana/knox,1/indiana/tell_city,1/north_dakota/beulah,1/north_dakota/center,1/north_dakota/new_salem,1/knox_in,6/central,us/central,us/indiana-starke","-5|n":"1/bogota,1/cancun,1/cayman,1/coral_harbour,1/eirunepe,1/guayaquil,1/jamaica,1/panama,1/atikokan,jamaica,est","-4|s|04/06:24->09/08:00":"1/santiago,7/continental","-4|s|03/23:24->10/06:00":"1/asuncion","-4|s":"1/campo_grande,1/cuiaba,1/la_paz,1/manaus,5/west","-4|n|03/10:02->11/03:02":"1/detroit,1/grand_turk,1/indiana,1/indianapolis,1/iqaluit,1/kentucky,1/louisville,1/montreal,1/nassau,1/new_york,1/nipigon,1/pangnirtung,1/port-au-prince,1/thunder_bay,1/toronto,1/indiana/marengo,1/indiana/petersburg,1/indiana/vevay,1/indiana/vincennes,1/indiana/winamac,1/kentucky/monticello,1/fort_wayne,1/indiana/indianapolis,1/kentucky/louisville,6/eastern,us/east-indiana,us/eastern,us/michigan","-4|n|03/10:00->11/03:01":"1/havana,cuba","-4|n":"1/anguilla,1/antigua,1/aruba,1/barbados,1/blanc-sablon,1/boa_vista,1/caracas,1/curacao,1/dominica,1/grenada,1/guadeloupe,1/guyana,1/kralendijk,1/lower_princes,1/marigot,1/martinique,1/montserrat,1/port_of_spain,1/porto_velho,1/puerto_rico,1/santo_domingo,1/st_barthelemy,1/st_kitts,1/st_lucia,1/st_thomas,1/st_vincent,1/tortola,1/virgin","-3|s":"1/argentina,1/buenos_aires,1/catamarca,1/cordoba,1/fortaleza,1/jujuy,1/mendoza,1/montevideo,1/punta_arenas,1/sao_paulo,12/palmer,12/rothera,3/stanley,1/argentina/la_rioja,1/argentina/rio_gallegos,1/argentina/salta,1/argentina/san_juan,1/argentina/san_luis,1/argentina/tucuman,1/argentina/ushuaia,1/argentina/comodrivadavia,1/argentina/buenos_aires,1/argentina/catamarca,1/argentina/cordoba,1/argentina/jujuy,1/argentina/mendoza,1/argentina/rosario,1/rosario,5/east","-3|n|03/10:02->11/03:02":"1/glace_bay,1/goose_bay,1/halifax,1/moncton,1/thule,3/bermuda,6/atlantic","-3|n":"1/araguaina,1/bahia,1/belem,1/cayenne,1/maceio,1/paramaribo,1/recife,1/santarem","-2|n|03/30:22->10/26:23":"1/nuuk,1/godthab","-2|n|03/10:02->11/03:02":"1/miquelon","-2|n":"1/noronha,3/south_georgia,5/denoronha","-2.5|n|03/10:02->11/03:02":"1/st_johns,6/newfoundland","-1|n":"3/cape_verde","-11|n":"11/midway,11/niue,11/pago_pago,11/samoa,us/samoa","-10|n":"11/honolulu,11/johnston,11/rarotonga,11/tahiti,us/hawaii,hst"},a=["africa","america","asia","atlantic","australia","brazil","canada","chile","europe","indian","mexico","pacific","antarctica","etc"];let o={};Object.keys(r).forEach((e=>{let t=e.split("|"),n={offset:Number(t[0]),hem:t[1]};t[2]&&(n.dst=t[2]),r[e].split(",").forEach((e=>{e=e.replace(/(^[0-9]+)\//,((e,t)=>(t=Number(t),a[t]+"/"))),o[e]=n}))})),o.utc={offset:0,hem:"n"};for(let e=-14;e<=14;e+=.5){let t=e;t>0&&(t="+"+t);let n="etc/gmt"+t;o[n]={offset:-1*e,hem:"n"},n="utc/gmt"+t,o[n]={offset:-1*e,hem:"n"}}var i=o;var s=()=>{let e=(()=>{if("undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;let e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;let t=e.resolvedOptions().timeZone;return t?t.toLowerCase():null})();return null===e?"utc":e};const u=/(\-?[0-9]+)h(rs)?/i,l=/(\-?[0-9]+)/,c=/utc([\-+]?[0-9]+)/i,h=/gmt([\-+]?[0-9]+)/i,d=function(e){return(e=Number(e))>=-13&&e<=13?"etc/gmt"+(e=((e*=-1)>0?"+":"")+e):null};var m=function(e){let t=e.match(u);if(null!==t)return d(t[1]);if(t=e.match(c),null!==t)return d(t[1]);if(t=e.match(h),null!==t){let e=-1*Number(t[1]);return d(e)}return t=e.match(l),null!==t?d(t[1]):null};let f=s();const p=Object.keys(i).reduce(((e,t)=>{let n=t.split("/")[1]||"";return n=n.replace(/_/g," "),e[n]=t,e}),{});var y=(e,t)=>{if(!e)return t.hasOwnProperty(f)||(console.warn(`Unrecognized IANA id '${f}'. Setting fallback tz to UTC.`),f="utc"),f;"string"!=typeof e&&console.error("Timezone must be a string - recieved: '",e,"'\n");let n=e.trim();if(n=n.toLowerCase(),!0===t.hasOwnProperty(n))return n;if(n=(e=>(e=(e=(e=(e=(e=e.replace(/ time/g,"")).replace(/ (standard|daylight|summer)/g,"")).replace(/\b(east|west|north|south)ern/g,"$1")).replace(/\b(africa|america|australia)n/g,"$1")).replace(/\beuropean/g,"europe")).replace(/\islands/g,"island"))(n),!0===t.hasOwnProperty(n))return n;if(!0===p.hasOwnProperty(n))return p[n];if(!0===/[0-9]/.test(n)){let e=m(n);if(e)return e}throw new Error("Spacetime: Cannot find timezone named: '"+e+"'. Please enter an IANA timezone id.")};function g(e){return e%4==0&&e%100!=0||e%400==0}function b(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.valueOf())}function k(e){return"[object Object]"===Object.prototype.toString.call(e)}function w(e,t=2){return(e+="").length>=t?e:new Array(t-e.length+1).join("0")+e}function v(e){let t=e%10,n=e%100;return 1===t&&11!==n?e+"st":2===t&&12!==n?e+"nd":3===t&&13!==n?e+"rd":e+"th"}function _(e){return e=(e=String(e)).replace(/([0-9])(st|nd|rd|th)$/i,"$1"),parseInt(e,10)}function j(e=""){return"day"===(e=(e=(e=(e=e.toLowerCase().trim()).replace(/ies$/,"y")).replace(/s$/,"")).replace(/-/g,""))||"days"===e?"date":"min"===e||"mins"===e?"minute":e}function $(e){return"number"==typeof e?e:b(e)?e.getTime():e.epoch?e.epoch:null}function z(e,t){return!1===k(e)?t.clone().set(e):e}function O(e,t=""){const n=e>0?"+":"-",r=Math.abs(e);return`${n}${w(parseInt(""+r,10))}${t}${w(r%1*60)}`}const D={year:(new Date).getFullYear(),month:0,date:1};var M={parseArray:(e,t,n)=>{if(0===t.length)return e;let r=["year","month","date","hour","minute","second","millisecond"];for(let a=0;a{if(0===Object.keys(t).length)return e;t=Object.assign({},D,n,t);let r=Object.keys(t);for(let a=0;a0&&t<25e8&&!1===e.silent&&(console.warn(" - Warning: You are setting the date to January 1970."),console.warn(" - did input seconds instead of milliseconds?")),e.epoch=t,e}};const S=function(e){return e.epoch=Date.now(),Object.keys(e._today||{}).forEach((t=>{"function"==typeof e[t]&&(e=e[t](e._today[t]))})),e},q={now:e=>S(e),today:e=>S(e),tonight:e=>e=(e=S(e)).hour(18),tomorrow:e=>e=(e=(e=S(e)).add(1,"day")).startOf("day"),yesterday:e=>e=(e=(e=S(e)).subtract(1,"day")).startOf("day"),christmas:e=>{let t=S(e).year();return e=e.set([t,11,25,18,0,0])},"new years":e=>{let t=S(e).year();return e=e.set([t,11,31,18,0,0])}};q["new years eve"]=q["new years"];var N=q;var I=function(e){return e=(e=(e=(e=e.replace(/\b(mon|tues?|wed|wednes|thur?s?|fri|sat|satur|sun)(day)?\b/i,"")).replace(/([0-9])(th|rd|st|nd)/,"$1")).replace(/,/g,"")).replace(/ +/g," ").trim()};let T={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5};T.date=T.day,T.month=25488e5,T.week=6048e5,T.year=3154e7,Object.keys(T).forEach((e=>{T[e+"s"]=T[e]}));var E=T;const C=(e,t,n,r,a)=>{let o=e.d[n]();if(o===t)return;let i=null===a?null:e.d[a](),s=e.epoch,u=t-o;e.epoch+=E[r]*u,"day"===r&&Math.abs(u)>28&&t<28&&(e.epoch+=E.hour),null!==a&&i!==e.d[a]()&&(e.epoch=s);const l=E[r]/2;for(;e.d[n]()t;)e.epoch-=l;null!==a&&i!==e.d[a]()&&(e.epoch=s)},x={year:{valid:e=>e>-4e3&&e<4e3,walkTo:(e,t)=>C(e,t,"getFullYear","year",null)},month:{valid:e=>e>=0&&e<=11,walkTo:(e,t)=>{let n=e.d,r=n.getMonth(),a=e.epoch,o=n.getFullYear();if(r===t)return;let i=t-r;for(e.epoch+=E.day*(28*i),o!==e.d.getFullYear()&&(e.epoch=a);e.d.getMonth()t;)e.epoch-=E.day}},date:{valid:e=>e>0&&e<=31,walkTo:(e,t)=>C(e,t,"getDate","day","getMonth")},hour:{valid:e=>e>=0&&e<24,walkTo:(e,t)=>C(e,t,"getHours","hour","getDate")},minute:{valid:e=>e>=0&&e<60,walkTo:(e,t)=>C(e,t,"getMinutes","minute","getHours")},second:{valid:e=>e>=0&&e<60,walkTo:(e,t)=>{e.epoch=e.seconds(t).epoch}},millisecond:{valid:e=>e>=0&&e<1e3,walkTo:(e,t)=>{e.epoch=e.milliseconds(t).epoch}}};var A=(e,t)=>{let n=Object.keys(x),r=e.clone();for(let a=0;a{if(!t)return e;let n=0;if(/^[\+-]?[0-9]{2}:[0-9]{2}$/.test(t)&&(!0===/:00/.test(t)&&(t=t.replace(/:00/,"")),!0===/:30/.test(t)&&(t=t.replace(/:30/,".5"))),/^[\+-]?[0-9]{4}$/.test(t)&&(t=t.replace(/30$/,".5")),n=parseFloat(t),Math.abs(n)>100&&(n/=100),0===n||"Z"===t||"z"===t)return e.tz="etc/gmt",e;n*=-1,n>=0&&(n="+"+n);let r="etc/gmt"+n;return e.timezones[r]&&(e.tz=r),e};var Z=(e,t="")=>{let n=(t=t.replace(/^\s+/,"").toLowerCase()).match(/([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?[:\.]?([0-9]{1,4})?/);if(null!==n){let r=Number(n[1]);if(r<0||r>24)return e.startOf("day");let a=Number(n[2]);if(n[2].length<2||a<0||a>59)return e.startOf("day");e=(e=(e=(e=e.hour(r)).minute(a)).seconds(n[3]||0)).millisecond(function(e=""){return(e=String(e)).length>3?e=e.substr(0,3):1===e.length?e+="00":2===e.length&&(e+="0"),Number(e)||0}(n[4]));let o=t.match(/[\b0-9] ?(am|pm)\b/);return null!==o&&o[1]&&(e=e.ampm(o[1])),e}if(n=t.match(/([0-9]+) ?(am|pm)/),null!==n&&n[1]){let t=Number(n[1]);return t>12||t<1?e.startOf("day"):e=(e=(e=e.hour(n[1]||0)).ampm(n[2])).startOf("hour")}return e=e.startOf("day")};let U=B();const Q=e=>{if(!0!==Y.hasOwnProperty(e.month))return!1;if(1===e.month)return!!(g(e.year)&&e.date<=29)||e.date<=28;let t=Y[e.month]||0;return e.date<=t},G=(e="",t)=>{if(e=e.trim(),!0===/^'[0-9][0-9]$/.test(e)){let t=Number(e.replace(/'/,""));return t>50?1900+t:2e3+t}let n=parseInt(e,10);return!n&&t&&(n=t.year),n=n||(new Date).getFullYear(),n},V=function(e){return"sept"===(e=e.toLowerCase().trim())?U.sep:U[e]};var W=[{reg:/^([0-9]{1,2})[\-\/.]([0-9]{1,2})[\-\/.]?([0-9]{4})?( [0-9]{1,2}:[0-9]{2}:?[0-9]{0,2}? ?(am|pm|gmt))?$/i,parse:(e,t)=>{let n=parseInt(t[1],10)-1,r=parseInt(t[2],10);(e.british||n>=12)&&(r=parseInt(t[1],10),n=parseInt(t[2],10)-1);let a={date:r,month:n,year:G(t[3],e._today)||(new Date).getFullYear()};return!1===Q(a)?(e.epoch=null,e):(A(e,a),e=Z(e,t[4]))}},{reg:/^([a-z]+)[\-\/\. ]([0-9]{1,2})[\-\/\. ]?([0-9]{4}|'[0-9]{2})?( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[1]),date:_(t[2]||"")};return!1===Q(n)?(e.epoch=null,e):(A(e,n),e=Z(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2})( [0-9]{4})?( ([0-9:]+( ?am| ?pm| ?gmt)?))?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[1]),date:_(t[2]||"")};return!1===Q(n)?(e.epoch=null,e):(A(e,n),e=Z(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2})( [0-9:]+)?( \+[0-9]{4})?( [0-9]{4})?$/i,parse:(e,t)=>{let n={year:G(t[5],e._today),month:V(t[1]),date:_(t[2]||"")};return!1===Q(n)?(e.epoch=null,e):(A(e,n),e=Z(e,t[3]))}}],J=[{reg:/^([0-9]{4})[\-\/]([0-9]{2})$/i,parse:(e,t)=>{let n={year:t[1],month:parseInt(t[2],10)-1,date:1};return!1===Q(n)?(e.epoch=null,e):(A(e,n),e=Z(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{4})$/i,parse:(e,t)=>{let n={year:G(t[2],e._today),month:V(t[1]),date:e._today.date||1};return!1===Q(n)?(e.epoch=null,e):(A(e,n),e=Z(e,t[4]))}},{reg:/^(q[0-9])( of)?( [0-9]{4})?/i,parse:(e,t)=>{let n=t[1]||"";e=e.quarter(n);let r=t[3]||"";return r&&(r=r.trim(),e=e.year(r)),e}},{reg:/^(spring|summer|winter|fall|autumn)( of)?( [0-9]{4})?/i,parse:(e,t)=>{let n=t[1]||"";e=e.season(n);let r=t[3]||"";return r&&(r=r.trim(),e=e.year(r)),e}},{reg:/^[0-9,]+ ?b\.?c\.?$/i,parse:(e,t)=>{let n=t[0]||"";n=n.replace(/^([0-9,]+) ?b\.?c\.?$/i,"-$1");let r=new Date,a={year:parseInt(n.trim(),10),month:r.getMonth(),date:r.getDate()};return!1===Q(a)?(e.epoch=null,e):(A(e,a),e=Z(e))}},{reg:/^[0-9,]+ ?(a\.?d\.?|c\.?e\.?)$/i,parse:(e,t)=>{let n=t[0]||"";n=n.replace(/,/g,"");let r=new Date,a={year:parseInt(n.trim(),10),month:r.getMonth(),date:r.getDate()};return!1===Q(a)?(e.epoch=null,e):(A(e,a),e=Z(e))}},{reg:/^[0-9]{4}( ?a\.?d\.?)?$/i,parse:(e,t)=>{let n=e._today;n.month&&!n.date&&(n.date=1);let r=new Date,a={year:G(t[0],n),month:n.month||r.getMonth(),date:n.date||r.getDate()};return!1===Q(a)?(e.epoch=null,e):(A(e,a),e=Z(e))}}],K=[].concat([{reg:/^(\-?0?0?[0-9]{3,4})-([0-9]{1,2})-([0-9]{1,2})[T| ]([0-9.:]+)(Z|[0-9\-\+:]+)?$/i,parse:(e,t)=>{let n={year:t[1],month:parseInt(t[2],10)-1,date:t[3]};return!1===Q(n)?(e.epoch=null,e):(H(e,t[5]),A(e,n),e=Z(e,t[4]))}},{reg:/^([0-9]{4})[\-\/\. ]([0-9]{1,2})[\-\/\. ]([0-9]{1,2})( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={year:t[1],month:parseInt(t[2],10)-1,date:parseInt(t[3],10)};return n.month>=12&&(n.date=parseInt(t[2],10),n.month=parseInt(t[3],10)-1),!1===Q(n)?(e.epoch=null,e):(A(e,n),e=Z(e,t[4]))}},{reg:/^([0-9]{4})[\-\/\. ]([a-z]+)[\-\/\. ]([0-9]{1,2})( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={year:G(t[1],e._today),month:V(t[2]),date:_(t[3]||"")};return!1===Q(n)?(e.epoch=null,e):(A(e,n),e=Z(e,t[4]))}}],W,[{reg:/^([0-9]{1,2})[\-\/]([a-z]+)[\-\/]?([0-9]{4})?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[2]),date:_(t[1]||"")};return!1===Q(n)?(e.epoch=null,e):(A(e,n),e=Z(e,t[4]))}},{reg:/^([0-9]{1,2})( [a-z]+)( [0-9]{4}| '[0-9]{2})? ?([0-9]{1,2}:[0-9]{2}:?[0-9]{0,2}? ?(am|pm|gmt))?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[2]),date:_(t[1])};return n.month&&!1!==Q(n)?(A(e,n),e=Z(e,t[4])):(e.epoch=null,e)}},{reg:/^([0-9]{1,2})[\. -/]([a-z]+)[\. -/]([0-9]{4})?( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={date:Number(t[1]),month:V(t[2]),year:Number(t[3])};return!1===Q(n)?(e.epoch=null,e):(A(e,n),e=e.startOf("day"),e=Z(e,t[4]))}}],J);var R=function(e,t,n){for(let r=0;r{let n=e._today||ne;if("number"==typeof t)return te(e,t);if(e.epoch=Date.now(),e._today&&k(e._today)&&Object.keys(e._today).length>0){let t=ee(e,n,ne);t.isValid()&&(e.epoch=t.epoch)}return null==t||""===t?e:!0===b(t)?(e.epoch=t.getTime(),e):!0===function(e){return"[object Array]"===Object.prototype.toString.call(e)}(t)?e=X(e,t,n):!0===k(t)?t.epoch?(e.epoch=t.epoch,e.tz=t.tz,e):e=ee(e,t,n):"string"!=typeof t?e:(t=I(t),!0===N.hasOwnProperty(t)?e=N[t](e):R(e,t))};let ae=["sun","mon","tue","wed","thu","fri","sat"],oe=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function ie(){return ae}function se(){return oe}const ue={mo:1,tu:2,we:3,th:4,fr:5,sa:6,su:7,tues:2,weds:3,wedn:3,thur:4,thurs:4};let le=!0;var ce=e=>{let t=e.timezone().current.offset;return t?O(t,":"):"Z"};const he=e=>le?function(e){return e?e[0].toUpperCase()+e.substr(1):""}(e):e,de={day:e=>he(e.dayName()),"day-short":e=>he(ie()[e.day()]),"day-number":e=>e.day(),"day-ordinal":e=>v(e.day()),"day-pad":e=>w(e.day()),date:e=>e.date(),"date-ordinal":e=>v(e.date()),"date-pad":e=>w(e.date()),month:e=>he(e.monthName()),"month-short":e=>he(L()[e.month()]),"month-number":e=>e.month(),"month-ordinal":e=>v(e.month()),"month-pad":e=>w(e.month()),"iso-month":e=>w(e.month()+1),year:e=>{let t=e.year();return t>0?t:(t=Math.abs(t),t+" BC")},"year-short":e=>{let t=e.year();return t>0?`'${String(e.year()).substr(2,4)}`:(t=Math.abs(t),t+" BC")},"iso-year":e=>{let t=e.year(),n=t<0,r=w(Math.abs(t),4);return n&&(r=w(r,6),r="-"+r),r},time:e=>e.time(),"time-24":e=>`${e.hour24()}:${w(e.minute())}`,hour:e=>e.hour12(),"hour-pad":e=>w(e.hour12()),"hour-24":e=>e.hour24(),"hour-24-pad":e=>w(e.hour24()),minute:e=>e.minute(),"minute-pad":e=>w(e.minute()),second:e=>e.second(),"second-pad":e=>w(e.second()),millisecond:e=>e.millisecond(),"millisecond-pad":e=>w(e.millisecond(),3),ampm:e=>e.ampm(),AMPM:e=>e.ampm().toUpperCase(),quarter:e=>"Q"+e.quarter(),season:e=>e.season(),era:e=>e.era(),json:e=>e.json(),timezone:e=>e.timezone().name,offset:e=>ce(e),numeric:e=>`${e.year()}/${w(e.month()+1)}/${w(e.date())}`,"numeric-us":e=>`${w(e.month()+1)}/${w(e.date())}/${e.year()}`,"numeric-uk":e=>`${w(e.date())}/${w(e.month()+1)}/${e.year()}`,"mm/dd":e=>`${w(e.month()+1)}/${w(e.date())}`,iso:e=>`${e.format("iso-year")}-${w(e.month()+1)}-${w(e.date())}T${w(e.h24())}:${w(e.minute())}:${w(e.second())}.${w(e.millisecond(),3)}${ce(e)}`,"iso-short":e=>{let t=w(e.month()+1),n=w(e.date());var r;return`${(r=e.year())>=0?w(r,4):"-"+w(r=Math.abs(r),4)}-${t}-${n}`},"iso-utc":e=>new Date(e.epoch).toISOString(),nice:e=>`${L()[e.month()]} ${v(e.date())}, ${e.time()}`,"nice-24":e=>`${L()[e.month()]} ${v(e.date())}, ${e.hour24()}:${w(e.minute())}`,"nice-year":e=>`${L()[e.month()]} ${v(e.date())}, ${e.year()}`,"nice-day":e=>`${ie()[e.day()]} ${he(L()[e.month()])} ${v(e.date())}`,"nice-full":e=>`${e.dayName()} ${he(e.monthName())} ${v(e.date())}, ${e.time()}`,"nice-full-24":e=>`${e.dayName()} ${he(e.monthName())} ${v(e.date())}, ${e.hour24()}:${w(e.minute())}`},me={"day-name":"day","month-name":"month","iso 8601":"iso","time-h24":"time-24","time-12":"time","time-h12":"time",tz:"timezone","day-num":"day-number","month-num":"month-number","month-iso":"iso-month","year-iso":"iso-year","nice-short":"nice","nice-short-24":"nice-24",mdy:"numeric-us",dmy:"numeric-uk",ymd:"numeric","yyyy/mm/dd":"numeric","mm/dd/yyyy":"numeric-us","dd/mm/yyyy":"numeric-us","little-endian":"numeric-uk","big-endian":"numeric","day-nice":"nice-day"};Object.keys(me).forEach((e=>de[e]=de[me[e]]));var fe=(e,t="")=>{if(!0!==e.isValid())return"";if(de.hasOwnProperty(t)){let n=de[t](e)||"";return"json"!==t&&(n=String(n),"ampm"!==t.toLowerCase()&&(n=he(n))),n}if(-1!==t.indexOf("{")){let n=/\{(.+?)\}/g;return t=t.replace(n,((t,n)=>{if(n=n.toLowerCase().trim(),de.hasOwnProperty(n)){let t=String(de[n](e));return"ampm"!==n.toLowerCase()?he(t):t}return""})),t}return e.format("iso-short")};const pe={G:e=>e.era(),GG:e=>e.era(),GGG:e=>e.era(),GGGG:e=>"AD"===e.era()?"Anno Domini":"Before Christ",y:e=>e.year(),yy:e=>w(Number(String(e.year()).substr(2,4))),yyy:e=>e.year(),yyyy:e=>e.year(),yyyyy:e=>"0"+e.year(),Q:e=>e.quarter(),QQ:e=>e.quarter(),QQQ:e=>e.quarter(),QQQQ:e=>e.quarter(),M:e=>e.month()+1,MM:e=>w(e.month()+1),MMM:e=>e.format("month-short"),MMMM:e=>e.format("month"),w:e=>e.week(),ww:e=>w(e.week()),d:e=>e.date(),dd:e=>w(e.date()),D:e=>e.dayOfYear(),DD:e=>w(e.dayOfYear()),DDD:e=>w(e.dayOfYear(),3),E:e=>e.format("day-short"),EE:e=>e.format("day-short"),EEE:e=>e.format("day-short"),EEEE:e=>e.format("day"),EEEEE:e=>e.format("day")[0],e:e=>e.day(),ee:e=>e.day(),eee:e=>e.format("day-short"),eeee:e=>e.format("day"),eeeee:e=>e.format("day")[0],a:e=>e.ampm().toUpperCase(),aa:e=>e.ampm().toUpperCase(),aaa:e=>e.ampm().toUpperCase(),aaaa:e=>e.ampm().toUpperCase(),h:e=>e.h12(),hh:e=>w(e.h12()),H:e=>e.hour(),HH:e=>w(e.hour()),m:e=>e.minute(),mm:e=>w(e.minute()),s:e=>e.second(),ss:e=>w(e.second()),SSS:e=>w(e.millisecond(),3),A:e=>e.epoch-e.startOf("day").epoch,z:e=>e.timezone().name,zz:e=>e.timezone().name,zzz:e=>e.timezone().name,zzzz:e=>e.timezone().name,Z:e=>O(e.timezone().current.offset),ZZ:e=>O(e.timezone().current.offset),ZZZ:e=>O(e.timezone().current.offset),ZZZZ:e=>O(e.timezone().current.offset,":")},ye=(e,t,n)=>{let r=e,a=t;for(let o=0;o{let n=t.split("");return n=function(e){for(let t=0;te))}(n),n=function(e){for(let t=0;te))).map((e=>("''"===e&&(e="'"),e)))}(n),n.reduce(((t,n)=>(void 0!==pe[n]?t+=pe[n](e)||"":(/^'.{1,}'$/.test(n)&&(n=n.replace(/'/g,"")),t+=n),t)),"")};const be=["year","season","quarter","month","week","day","quarterHour","hour","minute"],ke=function(e,t){let n=e.clone().startOf(t),r=e.clone().endOf(t).epoch-n.epoch,a=(e.epoch-n.epoch)/r;return parseFloat(a.toFixed(2))};var we=(e,t)=>{if(t)return t=j(t),ke(e,t);let n={};return be.forEach((t=>{n[t]=ke(e,t)})),n};var ve=(e,t)=>{let n=e.progress();return"quarterhour"===(t=j(t))&&(t="quarterHour"),void 0!==n[t]?(n[t]>.5&&(e=e.add(1,t)),e=e.startOf(t)):!1===e.silent&&console.warn("no known unit '"+t+"'"),e};const _e=(e,t,n)=>{let r=0;for(e=e.clone();e.isBefore(t);)e=e.add(1,n),r+=1;return e.isAfter(t,n)&&(r-=1),r};var je=(e,t,n)=>e.isBefore(t)?_e(e,t,n):-1*_e(t,e,n);var $e=function(e,t){let n=t.epoch-e.epoch,r={milliseconds:n,seconds:parseInt(n/1e3,10)};r.minutes=parseInt(r.seconds/60,10),r.hours=parseInt(r.minutes/60,10);let a=e.clone();return r.years=((e,t)=>{let n=t.year()-e.year();return(e=e.year(t.year())).isAfter(t)&&(n-=1),n})(a,t),a=e.add(r.years,"year"),r.months=12*r.years,a=e.add(r.months,"month"),r.months+=je(a,t,"month"),r.quarters=4*r.years,r.quarters+=parseInt(r.months%12/3,10),r.weeks=52*r.years,a=e.add(r.weeks,"week"),r.weeks+=je(a,t,"week"),r.days=7*r.weeks,a=e.add(r.days,"day"),r.days+=je(a,t,"day"),r};var ze=function(e,t,n){t=z(t,e);let r=!1;if(e.isAfter(t)){let n=e;e=t,t=n,r=!0}let a=$e(e,t);return r&&(a=function(e){return Object.keys(e).forEach((t=>{e[t]*=-1})),e}(a)),n?(n=j(n),!0!==/s$/.test(n)&&(n+="s"),"dates"===n&&(n="days"),a[n]):a};const Oe=e=>Math.abs(e)||0;var De=function(e){let t="P";return t+=Oe(e.years)+"Y",t+=Oe(e.months)+"M",t+=Oe(e.days)+"DT",t+=Oe(e.hours)+"H",t+=Oe(e.minutes)+"M",t+=Oe(e.seconds)+"S",t};let Me={second:"second",seconds:"seconds",minute:"minute",minutes:"minutes",hour:"hour",hours:"hours",day:"day",days:"days",month:"month",months:"months",year:"year",years:"years"};function Se(e){return Me[e]||""}let qe="past",Ne="future",Ie="present",Te="now",Ee="almost",Ce="over",xe=e=>`${e} ago`,Ae=e=>`in ${e}`;function Ye(e){return xe(e)}function Fe(e){return Ae(e)}function Pe(){return Te}const Le={months:{almost:10,over:4},days:{almost:25,over:10},hours:{almost:20,over:8},minutes:{almost:50,over:20},seconds:{almost:50,over:20}};function Be(e,t){return 1===e?e+" "+Se(t.slice(0,-1)):e+" "+Se(t)}var He=function(e){let t=null,n=null,r=[],a=[];return Object.keys(e).forEach(((o,i,s)=>{const u=Math.abs(e[o]);if(0===u)return;r.push(u+o[0]);const l=Be(u,o);if(a.push(l),!t){if(t=n=l,i>4)return;const r=s[i+1],a=Math.abs(e[r]);a>Le[r].almost?(t=Be(u+1,o),n=Ee+" "+t):a>Le[r].over&&(n=Ce+" "+l)}})),{qualified:n,rounded:t,abbreviated:r,englishValues:a}};var Ze=(e,t)=>{const n=function(e,t){const n=e.isBefore(t),r=n?t:e;let a=n?e:t;a=a.clone();const o={years:0,months:0,days:0,hours:0,minutes:0,seconds:0};return Object.keys(o).forEach((e=>{if(a.isSame(r,e))return;let t=a.diff(r,e);a=a.add(t,e),o[e]=t})),n&&Object.keys(o).forEach((e=>{0!==o[e]&&(o[e]*=-1)})),o}(e,t=z(t,e));if(!0===Object.keys(n).every((e=>!n[e])))return{diff:n,rounded:Pe(),qualified:Pe(),precise:Pe(),abbreviated:[],iso:"P0Y0M0DT0H0M0S",direction:Ie};let r,a=Ne,{rounded:o,qualified:i,englishValues:s,abbreviated:u}=He(n);r=s.splice(0,2).join(", "),!0===e.isAfter(t)?(o=Ye(o),i=Ye(i),r=Ye(r),a=qe):(o=Fe(o),i=Fe(i),r=Fe(r));let l=De(n);return{diff:n,rounded:o,qualified:i,precise:r,abbreviated:u,iso:l,direction:a}};var Ue={north:[["spring",2,1],["summer",5,1],["fall",8,1],["autumn",8,1],["winter",11,1]],south:[["fall",2,1],["autumn",2,1],["winter",5,1],["spring",8,1],["summer",11,1]]},Qe=[null,[0,1],[3,1],[6,1],[9,1]];const Ge={second:e=>(A(e,{millisecond:0}),e),minute:e=>(A(e,{second:0,millisecond:0}),e),quarterhour:e=>{let t=e.minutes();return e=t>=45?e.minutes(45):t>=30?e.minutes(30):t>=15?e.minutes(15):e.minutes(0),A(e,{second:0,millisecond:0}),e},hour:e=>(A(e,{minute:0,second:0,millisecond:0}),e),day:e=>(A(e,{hour:0,minute:0,second:0,millisecond:0}),e),week:e=>{let t=e.clone();return(e=e.day(e._weekStart)).isAfter(t)&&(e=e.subtract(1,"week")),A(e,{hour:0,minute:0,second:0,millisecond:0}),e},month:e=>(A(e,{date:1,hour:0,minute:0,second:0,millisecond:0}),e),quarter:e=>{let t=e.quarter();return Qe[t]&&A(e,{month:Qe[t][0],date:Qe[t][1],hour:0,minute:0,second:0,millisecond:0}),e},season:e=>{let t=e.season(),n="north";"South"===e.hemisphere()&&(n="south");for(let r=0;r(A(e,{month:0,date:1,hour:0,minute:0,second:0,millisecond:0}),e),decade:e=>{let t=(e=e.startOf("year")).year(),n=10*parseInt(t/10,10);return e=e.year(n)},century:e=>{let t=(e=e.startOf("year")).year(),n=100*parseInt(t/100,10);return e=e.year(n)}};Ge.date=Ge.day;var Ve=function(e,t,n){if(!t||!n)return[];if(t=j(t),n=e.clone().set(n),e.isAfter(n)){let t=e;e=n,n=t}let r=e.clone();if(function(e){return!!ie().find((t=>t===e))||!!se().find((t=>t===e))}(t))r=r.next(t),t="week";else{r.startOf(t).isBefore(e)&&(r=r.next(t))}let a=[];for(;r.isBefore(n);)a.push(r),r=r.add(1,t);return a};var We=e=>{let n=e.timezones,r=e.tz;if(!1===n.hasOwnProperty(r)&&(r=y(e.tz,n)),null===r)return!1===e.silent&&console.warn("Warn: could not find given or local timezone - '"+e.tz+"'"),{current:{epochShift:0}};let a=n[r],o={name:(i=r,i=(i=(i=(i=(i=(i=(i=i[0].toUpperCase()+i.substr(1)).replace(/[\/_-]([a-z])/gi,(e=>e.toUpperCase()))).replace(/_(of|es)_/i,(e=>e.toLowerCase()))).replace(/\/gmt/i,"/GMT")).replace(/\/Dumontdurville$/i,"/DumontDUrville")).replace(/\/Mcmurdo$/i,"/McMurdo")).replace(/\/Port-au-prince$/i,"/Port-au-Prince")),hasDst:Boolean(a.dst),default_offset:a.offset,hemisphere:"s"===a.hem?"South":"North",current:{}};var i,s;if(o.hasDst){let e=(s=a.dst)?s.split("->"):[];o.change={start:e[0],back:e[1]}}let u=a.offset,l=u;return!0===o.hasDst&&(l="North"===o.hemisphere?u-1:a.offset+1),!1===o.hasDst?(o.current.offset=u,o.current.isDST=!1):!0===t(e.epoch,o.change.start,o.change.back,u,l)?(o.current.offset=u,o.current.isDST="North"===o.hemisphere):(o.current.offset=l,o.current.isDST="South"===o.hemisphere),o};const Je=["century","decade","year","month","date","day","hour","minute","second","millisecond"],Ke={set:function(e,t){let n=this.clone();return n=re(n,e),t&&(this.tz=y(t)),n},timezone:function(){return We(this)},isDST:function(){return We(this).current.isDST},hasDST:function(){return We(this).hasDst},offset:function(){return 60*We(this).current.offset},hemisphere:function(){return We(this).hemisphere},format:function(e){return fe(this,e)},unixFmt:function(e){return ge(this,e)},startOf:function(e){return((e,t)=>{let n=e.clone();return t=j(t),Ge[t]?Ge[t](n):"summer"===t||"winter"===t?(n=n.season(t),Ge.season(n)):n})(this,e)},endOf:function(e){return((e,t)=>{let n=e.clone();return t=j(t),Ge[t]?(n=Ge[t](n),n=n.add(1,t),n=n.subtract(1,"millisecond"),n):n})(this,e)},leapYear:function(){return g(this.year())},progress:function(e){return we(this,e)},nearest:function(e){return ve(this,e)},diff:function(e,t){return ze(this,e,t)},since:function(e){return e||(e=this.clone().set()),Ze(this,e)},next:function(e){return this.add(1,e).startOf(e)},last:function(e){return this.subtract(1,e).startOf(e)},isValid:function(){return!(!this.epoch&&0!==this.epoch)&&!isNaN(this.d.getTime())},goto:function(e){let t=this.clone();return t.tz=y(e,t.timezones),t},every:function(e,t){if("object"==typeof e&&"string"==typeof t){let n=t;t=e,e=n}return Ve(this,e,t)},isAwake:function(){let e=this.hour();return!(e<8||e>22)},isAsleep:function(){return!this.isAwake()},daysInMonth:function(){switch(this.month()){case 0:case 2:case 4:case 6:case 7:case 9:case 11:return 31;case 1:return this.leapYear()?29:28;case 3:case 5:case 8:case 10:return 30;default:throw new Error("Invalid Month state.")}},log:function(){return console.log(""),console.log(fe(this,"nice-short")),this},logYear:function(){return console.log(""),console.log(fe(this,"full-short")),this},json:function(){return Je.reduce(((e,t)=>(e[t]=this[t](),e)),{})},debug:function(){let e=this.timezone(),t=this.format("MM")+" "+this.format("date-ordinal")+" "+this.year();return t+="\n - "+this.format("time"),console.log("\n\n",t+"\n - "+e.name+" ("+e.current.offset+")"),this},from:function(e){return(e=this.clone().set(e)).since(this)},fromNow:function(){return this.clone().set(Date.now()).since(this)},weekStart:function(e){if("number"==typeof e)return this._weekStart=e,this;if("string"==typeof e){e=e.toLowerCase().trim();let t=ie().indexOf(e);-1===t&&(t=se().indexOf(e)),-1===t&&(t=1),this._weekStart=t}else console.warn("Spacetime Error: Cannot understand .weekStart() input:",e);return this}};Ke.inDST=Ke.isDST,Ke.round=Ke.nearest,Ke.each=Ke.every;var Re=Ke;const Xe=e=>("string"==typeof e&&(e=parseInt(e,10)),e),et=["year","month","date","hour","minute","second","millisecond"],tt=(e,t,n)=>{let r=et.indexOf(n),a=et.slice(r,et.length);for(let n=0;n=24?t=24:t<0&&(t=0);let r=e.clone(),a=e.hour()-t,o=a*E.hour;return e.epoch-=o,e.date()!==r.date()&&(e=r.clone(),a>1&&(a-=1),a<1&&(a+=1),o=a*E.hour,e.epoch-=o),A(e,{hour:t}),tt(e,r,"minute"),(e=nt(e,r,n,"day")).epoch},ot=function(e,t){return"string"==typeof t&&/^'[0-9]{2}$/.test(t)&&(t=t.replace(/'/,"").trim(),t=(t=Number(t))>30?1900+t:2e3+t),t=Xe(t),A(e,{year:t}),e.epoch};let it="am",st="pm";const ut={millisecond:function(e){if(void 0!==e){let t=this.clone();return t.epoch=function(e,t){t=Xe(t);let n=e.millisecond()-t;return e.epoch-n}(t,e),t}return this.d.getMilliseconds()},second:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){t=Xe(t);let r=e.clone(),a=(e.second()-t)*E.second;return e.epoch=e.epoch-a,(e=nt(e,r,n,"minute")).epoch}(n,e,t),n}return this.d.getSeconds()},minute:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=rt(n,e,t),n}return this.d.getMinutes()},hour:function(e,t){let n=this.d;if(void 0!==e){let n=this.clone();return n.epoch=at(n,e,t),n}return n.getHours()},hourFloat:function(e,t){if(void 0!==e){let n=this.clone(),r=e%1;r*=60;let a=parseInt(e,10);return n.epoch=at(n,a,t),n.epoch=rt(n,r,t),n}let n=this.d,r=n.getHours(),a=n.getMinutes();return a/=60,r+a},hour12:function(e,t){let n=this.d;if(void 0!==e){let n=this.clone(),r=(e=""+e).match(/^([0-9]+)(am|pm)$/);if(r){let e=parseInt(r[1],10);"pm"===r[2]&&(e+=12),n.epoch=at(n,e,t)}return n}let r=n.getHours();return r>12&&(r-=12),0===r&&(r=12),r},time:function(e,t){if(void 0!==e){let n=this.clone();return e=e.toLowerCase().trim(),n.epoch=function(e,t,n){let r=t.match(/([0-9]{1,2})[:h]([0-9]{1,2})(:[0-9]{1,2})? ?(am|pm)?/);if(!r){if(r=t.match(/([0-9]{1,2}) ?(am|pm)/),!r)return e.epoch;r.splice(2,0,"0"),r.splice(3,0,"")}let a=!1,o=parseInt(r[1],10),i=parseInt(r[2],10);i>=60&&(i=59),o>12&&(a=!0),!1===a&&("am"===r[4]&&12===o&&(o=0),"pm"===r[4]&&o<12&&(o+=12)),r[3]=r[3]||"",r[3]=r[3].replace(/:/,"");let s=parseInt(r[3],10)||0,u=e.clone();return e=(e=(e=(e=e.hour(o)).minute(i)).second(s)).millisecond(0),(e=nt(e,u,n,"day")).epoch}(n,e,t),n}return`${this.h12()}:${w(this.minute())}${this.ampm()}`},ampm:function(e,t){let n=it,r=this.hour();if(r>=12&&(n=st),"string"!=typeof e)return n;let a=this.clone();return e=e.toLowerCase().trim(),r>=12&&"am"===e?(r-=12,a.hour(r,t)):r<12&&"pm"===e?(r+=12,a.hour(r,t)):a},dayTime:function(e,t){if(void 0!==e){const n={morning:"7:00",breakfast:"7:00",noon:"12:00",lunch:"12:00",afternoon:"14:00",evening:"18:00",dinner:"18:00",night:"23:00",midnight:"00:00"};let r=this.clone();return e=(e=e||"").toLowerCase(),!0===n.hasOwnProperty(e)&&(r=r.time(n[e],t)),r}let n=this.hour();return n<6?"night":n<12?"morning":n<17?"afternoon":n<22?"evening":"night"},iso:function(e){return void 0!==e?this.set(e):this.format("iso")}};var lt=ut;const ct={date:function(e,t){if(void 0!==e){let n=this.clone();return(e=parseInt(e,10))&&(n.epoch=function(e,t,n){if((t=Xe(t))>28){let n=e.month(),r=Y[n];1===n&&29===t&&g(e.year())&&(r=29),t>r&&(t=r)}t<=0&&(t=1);let r=e.clone();return A(e,{date:t}),(e=nt(e,r,n,"month")).epoch}(n,e,t)),n}return this.d.getDate()},day:function(e,t){if(void 0===e)return this.d.getDay();let n=this.clone(),r=e;"string"==typeof e&&(e=e.toLowerCase(),ue.hasOwnProperty(e)?r=ue[e]:(r=ie().indexOf(e),-1===r&&(r=se().indexOf(e))));let a=this.d.getDay()-r;!0===t&&a>0&&(a-=7),!1===t&&a<0&&(a+=7);let o=this.subtract(a,"days");return A(o,{hour:n.hour(),minute:n.minute(),second:n.second()}),o},dayName:function(e,t){if(void 0===e)return se()[this.day()];let n=this.clone();return n=n.day(e,t),n}};var ht=ct;const dt=e=>e=(e=(e=e.minute(0)).second(0)).millisecond(1),mt={dayOfYear:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){t=Xe(t);let r=e.clone();return(t-=1)<=0?t=0:t>=365&&(t=g(e.year())?365:364),e=(e=e.startOf("year")).add(t,"day"),tt(e,r,"hour"),(e=nt(e,r,n,"year")).epoch}(n,e,t),n}let n,r=0,a=this.d.getMonth();for(let e=1;e<=a;e++)n=new Date,n.setDate(1),n.setFullYear(this.d.getFullYear()),n.setHours(1),n.setMinutes(1),n.setMonth(e),n.setHours(-2),r+=n.getDate();return r+this.d.getDate()},week:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){let r=e.clone();return t=Xe(t),"december"===(e=(e=(e=e.month(0)).date(1)).day("monday")).monthName()&&e.date()>=28&&(e=e.add(1,"week")),t-=1,e=e.add(t,"weeks"),(e=nt(e,r,n,"year")).epoch}(this,e,t),n=dt(n),n}let n=this.clone();n=n.month(0),n=n.date(1),n=dt(n),n=n.day("monday"),11===n.month()&&n.date()>=25&&(n=n.add(1,"week"));let r=1;1===n.date()&&(r=0),n=n.minus(1,"second");const a=this.epoch;if(n.epoch>a)return 1;let o=0,i=4*this.month();for(n.epoch+=E.week*i,o+=i;o<=52;o++){if(n.epoch>a)return o+r;n=n.add(1,"week")}return 52},month:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){"string"==typeof t&&("sept"===t&&(t="sep"),t=B()[t.toLowerCase()]),(t=Xe(t))>=12&&(t=11),t<=0&&(t=0);let r=e.date();r>Y[t]&&(r=Y[t]);let a=e.clone();return A(e,{month:t,d:r}),(e=nt(e,a,n,"year")).epoch}(n,e,t),n}return this.d.getMonth()},monthName:function(e,t){if(void 0!==e){let n=this.clone();return n=n.month(e,t),n}return P[this.month()]},quarter:function(e,t){if(void 0!==e&&("string"==typeof e&&(e=e.replace(/^q/i,""),e=parseInt(e,10)),Qe[e])){let n=this.clone(),r=Qe[e][0];return n=n.month(r,t),n=n.date(1,t),n=n.startOf("day"),n}let n=this.d.getMonth();for(let e=1;e=Ue[n][e][1]&&r0&&(t.epoch=ot(t,-1*n)),"ad"===e&&n<0&&(t.epoch=ot(t,-1*n)),t}return this.d.getFullYear()<0?"BC":"AD"},decade:function(e){if(void 0!==e){if(!(e=(e=(e=String(e)).replace(/([0-9])'?s$/,"$1")).replace(/([0-9])(th|rd|st|nd)/,"$1")))return console.warn("Spacetime: Invalid decade input"),this;2===e.length&&/[0-9][0-9]/.test(e)&&(e="19"+e);let t=Number(e);return isNaN(t)?this:(t=10*Math.floor(t/10),this.year(t))}return this.startOf("decade").year()},century:function(e){if(void 0!==e){"string"==typeof e&&(e=(e=(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1")).replace(/([0-9]+) ?(b\.?c\.?|a\.?d\.?)/i,((e,t,n)=>(n.match(/b\.?c\.?/i)&&(t="-"+t),t)))).replace(/c$/,""));let t=Number(e);return isNaN(e)?(console.warn("Spacetime: Invalid century input"),this):(0===t&&(t=1),t=t>=0?100*(t-1):100*(t+1),this.year(t))}let t=this.startOf("century").year();return t=Math.floor(t/100),t<0?t-1:t+1},millenium:function(e){if(void 0!==e){if("string"==typeof e&&(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1"),e=Number(e),isNaN(e)))return console.warn("Spacetime: Invalid millenium input"),this;e>0&&(e-=1);let t=1e3*e;return 0===t&&(t=1),this.year(t)}let t=Math.floor(this.year()/1e3);return t>=0&&(t+=1),t}};var ft=mt;const pt=Object.assign({},lt,ht,ft);pt.milliseconds=pt.millisecond,pt.seconds=pt.second,pt.minutes=pt.minute,pt.hours=pt.hour,pt.hour24=pt.hour,pt.h12=pt.hour12,pt.h24=pt.hour24,pt.days=pt.day;var yt=e=>{Object.keys(pt).forEach((t=>{e.prototype[t]=pt[t]}))};const gt=function(e,t){return 1===e&&g(t)?29:Y[e]},bt=(e,t)=>{if(e.month>0){let n=parseInt(e.month/12,10);e.year=t.year()+n,e.month=e.month%12}else if(e.month<0){let n=Math.abs(e.month),r=parseInt(n/12,10);n%12!=0&&(r+=1),e.year=t.year()-r,e.month=e.month%12,e.month=e.month+12,12===e.month&&(e.month=0)}return e},kt=(e,t,n)=>{let r=t.year(),a=t.month(),o=gt(a,r);for(;n>o;)n-=o,a+=1,a>=12&&(a-=12,r+=1),o=gt(a,r);return e.month=a,e.date=n,e},wt=(e,t,n)=>{e.year=t.year(),e.month=t.month();let r=t.date();for(e.date=r-Math.abs(n);e.date<1;){e.month-=1,e.month<0&&(e.month=11,e.year-=1);let t=gt(e.month,e.year);e.date+=t}return e},vt=["millisecond","second","minute","hour","date","month"];let _t={second:vt.slice(0,1),minute:vt.slice(0,2),quarterhour:vt.slice(0,2),hour:vt.slice(0,3),date:vt.slice(0,4),month:vt.slice(0,4),quarter:vt.slice(0,4),season:vt.slice(0,4),year:vt,decade:vt,century:vt};_t.week=_t.hour,_t.season=_t.date,_t.quarter=_t.date;const jt={year:!0,quarter:!0,season:!0,month:!0,week:!0,date:!0},$t={month:!0,quarter:!0,season:!0,year:!0};var zt=e=>{e.prototype.add=function(e,t){let n=this.clone();if(!t||0===e)return n;let r=this.clone();if("millisecond"===(t=j(t)))return n.epoch+=e,n;"fortnight"===t&&(e*=2,t="week"),E[t]?n.epoch+=E[t]*e:"week"===t||"weekend"===t?n.epoch+=E.day*(7*e):"quarter"===t||"season"===t?n.epoch+=E.month*(3*e):"quarterhour"===t&&(n.epoch+=15*E.minute*e);let a={};if(_t[t]&&_t[t].forEach((e=>{a[e]=r[e]()})),jt[t]){const e=r.timezone().current.offset-n.timezone().current.offset;n.epoch+=3600*e*1e3}if("month"===t&&(a.month=r.month()+e,a=bt(a,r)),"week"===t){let t=r.date()+7*e;t<=28&&t>1&&(a.date=t)}if("weekend"===t&&"saturday"!==n.dayName())n=n.day("saturday",!0);else if("date"===t){if(e<0)a=wt(a,r,e);else{let t=r.date()+e;a=kt(a,r,t)}0!==e&&r.isSame(n,"day")&&(a.date=r.date()+e)}else if("quarter"===t){if(a.month=r.month()+3*e,a.year=r.year(),a.month<0){let e=Math.floor(a.month/12),t=a.month+12*Math.abs(e);a.month=t,a.year+=e}else if(a.month>=12){let e=Math.floor(a.month/12);a.month=a.month%12,a.year+=e}a.date=r.date()}else if("year"===t){let t=r.year()+e,a=n.year();if(at){let t=Math.floor(e/4)||1;n.epoch+=E.day*t}}else"decade"===t?a.year=n.year()+10:"century"===t&&(a.year=n.year()+100);if($t[t]){let e=Y[a.month];a.date=r.date(),a.date>e&&(a.date=e)}return Object.keys(a).length>1&&A(n,a),n},e.prototype.subtract=function(e,t){return this.clone().add(-1*e,t)},e.prototype.minus=e.prototype.subtract,e.prototype.plus=e.prototype.add};const Ot={millisecond:e=>e.epoch,second:e=>[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second()].join("-"),minute:e=>[e.year(),e.month(),e.date(),e.hour(),e.minute()].join("-"),hour:e=>[e.year(),e.month(),e.date(),e.hour()].join("-"),day:e=>[e.year(),e.month(),e.date()].join("-"),week:e=>[e.year(),e.week()].join("-"),month:e=>[e.year(),e.month()].join("-"),quarter:e=>[e.year(),e.quarter()].join("-"),year:e=>e.year()};Ot.date=Ot.day;var Dt=e=>{e.prototype.isSame=function(t,n,r=!0){let a=this;if(!n)return null;if("string"==typeof t&&"object"==typeof n){let e=t;t=n,n=e}return"string"!=typeof t&&"number"!=typeof t||(t=new e(t,this.timezone.name)),n=n.replace(/s$/,""),!0===r&&a.tz!==t.tz&&((t=t.clone()).tz=a.tz),Ot[n]?Ot[n](a)===Ot[n](t):null}};var Mt=e=>{const t={isAfter:function(e){let t=$(e=z(e,this));return null===t?null:this.epoch>t},isBefore:function(e){let t=$(e=z(e,this));return null===t?null:this.epoch{e.prototype[n]=t[n]}))};var St=e=>{const t={i18n:function(e){var t,n,r;return k(e.days)&&(t=e.days,ae=t.short||ae,oe=t.long||oe),k(e.months)&&function(e){F=e.short||F,P=e.long||P}(e.months),r=e.useTitleCase,"[object Boolean]"===Object.prototype.toString.call(r)&&(n=e.useTitleCase,le=n),k(e.ampm)&&function(e){it=e.am||it,st=e.pm||st}(e.ampm),k(e.distance)&&function(e){xe=e.pastDistance||xe,Ae=e.futureDistance||Ae,qe=e.past||qe,Ne=e.future||Ne,Ie=e.present||Ie,Te=e.now||Te,Ee=e.almost||Ee,Ce=e.over||Ce}(e.distance),k(e.units)&&function(e={}){Me={second:e.second||Me.second,seconds:e.seconds||Me.seconds,minute:e.minute||Me.minute,minutes:e.minutes||Me.minutes,hour:e.hour||Me.hour,hours:e.hours||Me.hours,day:e.day||Me.day,days:e.days||Me.days,month:e.month||Me.month,months:e.months||Me.months,year:e.year||Me.year,years:e.years||Me.years}}(e.units),this}};Object.keys(t).forEach((n=>{e.prototype[n]=t[n]}))};let qt=i;const Nt=function(e,t,r={}){this.epoch=null,this.tz=y(t,qt),this.silent=void 0===r.silent||r.silent,this.british=r.dmy||r.british,this._weekStart=1,void 0!==r.weekStart&&(this._weekStart=r.weekStart),this._today={},void 0!==r.today&&(this._today=r.today),Object.defineProperty(this,"d",{get:function(){let e=n(this),t=(new Date(this.epoch).getTimezoneOffset()||0)+60*e;t=60*t*1e3;let r=this.epoch+t;return new Date(r)}}),Object.defineProperty(this,"timezones",{get:()=>qt,set:e=>(qt=e,e)});let a=re(this,e);this.epoch=a.epoch};Object.keys(Re).forEach((e=>{Nt.prototype[e]=Re[e]})),Nt.prototype.clone=function(){return new Nt(this.epoch,this.tz,{silent:this.silent,weekStart:this._weekStart,today:this._today,parsers:this.parsers})},Nt.prototype.toLocalDate=function(){return this.toNativeDate()},Nt.prototype.toNativeDate=function(){return new Date(this.epoch)},yt(Nt),zt(Nt),Dt(Nt),Mt(Nt),St(Nt);var It=Nt;var Tt=(e,t)=>{let n=new It(null),r=new It(null);n=n.time(e),r=t?r.time(t):n.add(59,"minutes");let a=n.hour(),o=r.hour();return Object.keys(n.timezones).filter((e=>{if(-1===e.indexOf("/"))return!1;let t=new It(null,e),i=t.hour();return i>=a&&i<=o&&(!(i===a&&t.minute()r.minute()))}))};const Et=(e,t,n)=>new It(e,t,n),Ct=function(e){let t=e._today||{};return Object.keys(t).forEach((n=>{e=e[n](t[n])})),e};return Et.now=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n},Et.today=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n.startOf("day")},Et.tomorrow=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n.add(1,"day").startOf("day")},Et.yesterday=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n.subtract(1,"day").startOf("day")},Et.extend=function(e={}){return Object.keys(e).forEach((t=>{It.prototype[t]=e[t]})),this},Et.timezones=function(){return(new It).timezones},Et.max=function(e,t){let n=new It(null,e,t);return n.epoch=864e13,n},Et.min=function(e,t){let n=new It(null,e,t);return n.epoch=-864e13,n},Et.whereIts=Tt,Et.version="7.5.0",Et.plugin=Et.extend,Et})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).spacetime=t()}(this,(function(){"use strict";const e=(e,t,n)=>{const[r,a]=e.split("/"),[o,i]=a.split(":");return Date.UTC(n,r-1,o,i)-36e5*t};var t=(t,n,r,a,o)=>{const i=new Date(t).getUTCFullYear(),s=e(n,o,i),u=e(r,a,i);return t>=s&&t{let n=e.timezones[e.tz];if(void 0===n)return console.warn("Warning: couldn't find timezone "+e.tz),0;if(void 0===n.dst)return n.offset;let r=n.offset,a=n.offset+1;"n"===n.hem&&(a=r-1);let o=n.dst.split("->");return!0===t(e.epoch,o[0],o[1],r,a)?r:a},r={"9|s":"2/dili,2/jayapura","9|n":"2/chita,2/khandyga,2/pyongyang,2/seoul,2/tokyo,2/yakutsk,11/palau,japan,rok","9.5|s|04/07:03->10/06:02":"4/adelaide,4/broken_hill,4/south,4/yancowinna","9.5|s":"4/darwin,4/north","8|s|03/13:01->10/02:00":"12/casey","8|s":"2/kuala_lumpur,2/makassar,2/singapore,4/perth,2/ujung_pandang,4/west,singapore","8|n":"2/brunei,2/choibalsan,2/hong_kong,2/irkutsk,2/kuching,2/macau,2/manila,2/shanghai,2/taipei,2/ulaanbaatar,2/chongqing,2/chungking,2/harbin,2/macao,2/ulan_bator,hongkong,prc,roc","8.75|s":"4/eucla","7|s":"12/davis,2/jakarta,9/christmas","7|n":"2/bangkok,2/barnaul,2/hovd,2/krasnoyarsk,2/novokuznetsk,2/novosibirsk,2/phnom_penh,2/pontianak,2/ho_chi_minh,2/tomsk,2/vientiane,2/saigon","6|s":"12/vostok","6|n":"2/almaty,2/bishkek,2/dhaka,2/omsk,2/qyzylorda,2/qostanay,2/thimphu,2/urumqi,9/chagos,2/dacca,2/kashgar,2/thimbu","6.5|n":"2/yangon,9/cocos,2/rangoon","5|s":"12/mawson,9/kerguelen","5|n":"2/aqtau,2/aqtobe,2/ashgabat,2/atyrau,2/dushanbe,2/karachi,2/oral,2/samarkand,2/tashkent,2/yekaterinburg,9/maldives,2/ashkhabad","5.75|n":"2/kathmandu,2/katmandu","5.5|n":"2/kolkata,2/colombo,2/calcutta","4|s":"9/reunion","4|n":"2/baku,2/dubai,2/muscat,2/tbilisi,2/yerevan,8/astrakhan,8/samara,8/saratov,8/ulyanovsk,8/volgograd,9/mahe,9/mauritius,2/volgograd","4.5|n":"2/kabul","3|s":"12/syowa,9/antananarivo","3|n|04/26:00->10/31:24":"0/cairo,egypt","3|n|04/20:02->10/26:02":"2/gaza,2/hebron","3|n|03/31:03->10/27:04":"2/famagusta,2/nicosia,8/athens,8/bucharest,8/helsinki,8/kyiv,8/mariehamn,8/riga,8/sofia,8/tallinn,8/uzhgorod,8/vilnius,8/zaporozhye,8/nicosia,8/kiev,eet","3|n|03/31:02->10/27:03":"8/chisinau,8/tiraspol","3|n|03/31:00->10/26:24":"2/beirut","3|n|03/29:02->10/27:02":"2/jerusalem,2/tel_aviv,israel","3|n":"0/addis_ababa,0/asmara,0/asmera,0/dar_es_salaam,0/djibouti,0/juba,0/kampala,0/mogadishu,0/nairobi,2/aden,2/amman,2/baghdad,2/bahrain,2/damascus,2/kuwait,2/qatar,2/riyadh,8/istanbul,8/kirov,8/minsk,8/moscow,8/simferopol,9/comoro,9/mayotte,2/istanbul,turkey,w-su","3.5|n":"2/tehran,iran","2|s|03/31:02->10/27:02":"12/troll","2|s":"0/gaborone,0/harare,0/johannesburg,0/lubumbashi,0/lusaka,0/maputo,0/maseru,0/mbabane","2|n|03/31:02->10/27:03":"0/ceuta,arctic/longyearbyen,8/amsterdam,8/andorra,8/belgrade,8/berlin,8/bratislava,8/brussels,8/budapest,8/busingen,8/copenhagen,8/gibraltar,8/ljubljana,8/luxembourg,8/madrid,8/malta,8/monaco,8/oslo,8/paris,8/podgorica,8/prague,8/rome,8/san_marino,8/sarajevo,8/skopje,8/stockholm,8/tirane,8/vaduz,8/vatican,8/vienna,8/warsaw,8/zagreb,8/zurich,3/jan_mayen,poland,cet,met","2|n":"0/blantyre,0/bujumbura,0/khartoum,0/kigali,0/tripoli,8/kaliningrad,libya","1|s":"0/brazzaville,0/kinshasa,0/luanda,0/windhoek","1|n|03/31:01->10/27:02":"3/canary,3/faroe,3/madeira,8/dublin,8/guernsey,8/isle_of_man,8/jersey,8/lisbon,8/london,3/faeroe,eire,8/belfast,gb-eire,gb,portugal,wet","1|n":"0/algiers,0/bangui,0/douala,0/lagos,0/libreville,0/malabo,0/ndjamena,0/niamey,0/porto-novo,0/tunis","14|n":"11/kiritimati","13|s":"11/apia,11/tongatapu","13|n":"11/enderbury,11/kanton,11/fakaofo","12|s|04/07:03->09/29:02":"12/mcmurdo,11/auckland,12/south_pole,nz","12|s":"11/fiji","12|n":"2/anadyr,2/kamchatka,2/srednekolymsk,11/funafuti,11/kwajalein,11/majuro,11/nauru,11/tarawa,11/wake,11/wallis,kwajalein","12.75|s|04/07:03->04/07:02":"11/chatham,nz-chat","11|s|04/07:03->10/06:02":"12/macquarie","11|s":"11/bougainville","11|n":"2/magadan,2/sakhalin,11/efate,11/guadalcanal,11/kosrae,11/noumea,11/pohnpei,11/ponape","11.5|n|04/07:03->10/06:02":"11/norfolk","10|s|04/07:03->10/06:02":"4/currie,4/hobart,4/melbourne,4/sydney,4/act,4/canberra,4/nsw,4/tasmania,4/victoria","10|s":"12/dumontdurville,4/brisbane,4/lindeman,11/port_moresby,4/queensland","10|n":"2/ust-nera,2/vladivostok,11/guam,11/saipan,11/chuuk,11/truk,11/yap","10.5|s|04/07:01->10/06:02":"4/lord_howe,4/lhi","0|s|03/10:03->04/14:02":"0/casablanca,0/el_aaiun","0|n|03/31:00->10/27:01":"1/scoresbysund,3/azores","0|n":"0/abidjan,0/accra,0/bamako,0/banjul,0/bissau,0/conakry,0/dakar,0/freetown,0/lome,0/monrovia,0/nouakchott,0/ouagadougou,0/sao_tome,1/danmarkshavn,3/reykjavik,3/st_helena,13/gmt,13/utc,0/timbuktu,13/greenwich,13/uct,13/universal,13/zulu,gmt-0,gmt+0,gmt0,greenwich,iceland,uct,universal,utc,zulu,13/unknown,factory","-9|n|03/10:02->11/03:02":"1/adak,1/atka,us/aleutian","-9|n":"11/gambier","-9.5|n":"11/marquesas","-8|n|03/10:02->11/03:02":"1/anchorage,1/juneau,1/metlakatla,1/nome,1/sitka,1/yakutat,us/alaska","-8|n":"11/pitcairn","-7|n|03/10:02->11/03:02":"1/los_angeles,1/santa_isabel,1/tijuana,1/vancouver,1/ensenada,6/pacific,10/bajanorte,us/pacific-new,us/pacific","-7|n":"1/creston,1/dawson,1/dawson_creek,1/fort_nelson,1/hermosillo,1/mazatlan,1/phoenix,1/whitehorse,6/yukon,10/bajasur,us/arizona,mst","-6|s|04/06:22->09/07:22":"11/easter,7/easterisland","-6|n|04/07:02->10/27:02":"1/merida","-6|n|03/10:02->11/03:02":"1/boise,1/cambridge_bay,1/denver,1/edmonton,1/inuvik,1/north_dakota,1/ojinaga,1/ciudad_juarez,1/yellowknife,1/shiprock,6/mountain,navajo,us/mountain","-6|n":"1/bahia_banderas,1/belize,1/chihuahua,1/costa_rica,1/el_salvador,1/guatemala,1/managua,1/mexico_city,1/monterrey,1/regina,1/swift_current,1/tegucigalpa,11/galapagos,6/east-saskatchewan,6/saskatchewan,10/general","-5|s":"1/lima,1/rio_branco,1/porto_acre,5/acre","-5|n|03/10:02->11/03:02":"1/chicago,1/matamoros,1/menominee,1/rainy_river,1/rankin_inlet,1/resolute,1/winnipeg,1/indiana/knox,1/indiana/tell_city,1/north_dakota/beulah,1/north_dakota/center,1/north_dakota/new_salem,1/knox_in,6/central,us/central,us/indiana-starke","-5|n":"1/bogota,1/cancun,1/cayman,1/coral_harbour,1/eirunepe,1/guayaquil,1/jamaica,1/panama,1/atikokan,jamaica,est","-4|s|04/06:24->09/08:00":"1/santiago,7/continental","-4|s|03/23:24->10/06:00":"1/asuncion","-4|s":"1/campo_grande,1/cuiaba,1/la_paz,1/manaus,5/west","-4|n|03/10:02->11/03:02":"1/detroit,1/grand_turk,1/indiana,1/indianapolis,1/iqaluit,1/kentucky,1/louisville,1/montreal,1/nassau,1/new_york,1/nipigon,1/pangnirtung,1/port-au-prince,1/thunder_bay,1/toronto,1/indiana/marengo,1/indiana/petersburg,1/indiana/vevay,1/indiana/vincennes,1/indiana/winamac,1/kentucky/monticello,1/fort_wayne,1/indiana/indianapolis,1/kentucky/louisville,6/eastern,us/east-indiana,us/eastern,us/michigan","-4|n|03/10:00->11/03:01":"1/havana,cuba","-4|n":"1/anguilla,1/antigua,1/aruba,1/barbados,1/blanc-sablon,1/boa_vista,1/caracas,1/curacao,1/dominica,1/grenada,1/guadeloupe,1/guyana,1/kralendijk,1/lower_princes,1/marigot,1/martinique,1/montserrat,1/port_of_spain,1/porto_velho,1/puerto_rico,1/santo_domingo,1/st_barthelemy,1/st_kitts,1/st_lucia,1/st_thomas,1/st_vincent,1/tortola,1/virgin","-3|s":"1/argentina,1/buenos_aires,1/catamarca,1/cordoba,1/fortaleza,1/jujuy,1/mendoza,1/montevideo,1/punta_arenas,1/sao_paulo,12/palmer,12/rothera,3/stanley,1/argentina/la_rioja,1/argentina/rio_gallegos,1/argentina/salta,1/argentina/san_juan,1/argentina/san_luis,1/argentina/tucuman,1/argentina/ushuaia,1/argentina/comodrivadavia,1/argentina/buenos_aires,1/argentina/catamarca,1/argentina/cordoba,1/argentina/jujuy,1/argentina/mendoza,1/argentina/rosario,1/rosario,5/east","-3|n|03/10:02->11/03:02":"1/glace_bay,1/goose_bay,1/halifax,1/moncton,1/thule,3/bermuda,6/atlantic","-3|n":"1/araguaina,1/bahia,1/belem,1/cayenne,1/maceio,1/paramaribo,1/recife,1/santarem","-2|n|03/30:22->10/26:23":"1/nuuk,1/godthab","-2|n|03/10:02->11/03:02":"1/miquelon","-2|n":"1/noronha,3/south_georgia,5/denoronha","-2.5|n|03/10:02->11/03:02":"1/st_johns,6/newfoundland","-1|n":"3/cape_verde","-11|n":"11/midway,11/niue,11/pago_pago,11/samoa,us/samoa","-10|n":"11/honolulu,11/johnston,11/rarotonga,11/tahiti,us/hawaii,hst"},a=["africa","america","asia","atlantic","australia","brazil","canada","chile","europe","indian","mexico","pacific","antarctica","etc"];let o={};Object.keys(r).forEach((e=>{let t=e.split("|"),n={offset:Number(t[0]),hem:t[1]};t[2]&&(n.dst=t[2]),r[e].split(",").forEach((e=>{e=e.replace(/(^[0-9]+)\//,((e,t)=>(t=Number(t),a[t]+"/"))),o[e]=n}))})),o.utc={offset:0,hem:"n"};for(let e=-14;e<=14;e+=.5){let t=e;t>0&&(t="+"+t);let n="etc/gmt"+t;o[n]={offset:-1*e,hem:"n"},n="utc/gmt"+t,o[n]={offset:-1*e,hem:"n"}}var i=o;var s=()=>{let e=(()=>{if("undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;let e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;let t=e.resolvedOptions().timeZone;return t?t.toLowerCase():null})();return null===e?"utc":e};const u=/(\-?[0-9]+)h(rs)?/i,l=/(\-?[0-9]+)/,c=/utc([\-+]?[0-9]+)/i,h=/gmt([\-+]?[0-9]+)/i,d=function(e){return(e=Number(e))>=-13&&e<=13?"etc/gmt"+(e=((e*=-1)>0?"+":"")+e):null};var m=function(e){let t=e.match(u);if(null!==t)return d(t[1]);if(t=e.match(c),null!==t)return d(t[1]);if(t=e.match(h),null!==t){let e=-1*Number(t[1]);return d(e)}return t=e.match(l),null!==t?d(t[1]):null};let f=s();const p=Object.keys(i).reduce(((e,t)=>{let n=t.split("/")[1]||"";return n=n.replace(/_/g," "),e[n]=t,e}),{});var y=(e,t)=>{if(!e)return t.hasOwnProperty(f)||(console.warn(`Unrecognized IANA id '${f}'. Setting fallback tz to UTC.`),f="utc"),f;"string"!=typeof e&&console.error("Timezone must be a string - recieved: '",e,"'\n");let n=e.trim();if(n=n.toLowerCase(),!0===t.hasOwnProperty(n))return n;if(n=(e=>(e=(e=(e=(e=(e=e.replace(/ time/g,"")).replace(/ (standard|daylight|summer)/g,"")).replace(/\b(east|west|north|south)ern/g,"$1")).replace(/\b(africa|america|australia)n/g,"$1")).replace(/\beuropean/g,"europe")).replace(/\islands/g,"island"))(n),!0===t.hasOwnProperty(n))return n;if(!0===p.hasOwnProperty(n))return p[n];if(!0===/[0-9]/.test(n)){let e=m(n);if(e)return e}throw new Error("Spacetime: Cannot find timezone named: '"+e+"'. Please enter an IANA timezone id.")};function g(e){return e%4==0&&e%100!=0||e%400==0}function b(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.valueOf())}function k(e){return"[object Object]"===Object.prototype.toString.call(e)}function w(e,t=2){return(e+="").length>=t?e:new Array(t-e.length+1).join("0")+e}function v(e){let t=e%10,n=e%100;return 1===t&&11!==n?e+"st":2===t&&12!==n?e+"nd":3===t&&13!==n?e+"rd":e+"th"}function _(e){return e=(e=String(e)).replace(/([0-9])(st|nd|rd|th)$/i,"$1"),parseInt(e,10)}function j(e=""){return"day"===(e=(e=(e=(e=e.toLowerCase().trim()).replace(/ies$/,"y")).replace(/s$/,"")).replace(/-/g,""))||"days"===e?"date":"min"===e||"mins"===e?"minute":e}function z(e){return"number"==typeof e?e:b(e)?e.getTime():e.epoch?e.epoch:null}function $(e,t){return!1===k(e)?t.clone().set(e):e}function O(e,t=""){const n=e>0?"+":"-",r=Math.abs(e);return`${n}${w(parseInt(""+r,10))}${t}${w(r%1*60)}`}const D={year:(new Date).getFullYear(),month:0,date:1};var M={parseArray:(e,t,n)=>{if(0===t.length)return e;let r=["year","month","date","hour","minute","second","millisecond"];for(let a=0;a{if(0===Object.keys(t).length)return e;t=Object.assign({},D,n,t);let r=Object.keys(t);for(let a=0;a0&&t<25e8&&!1===e.silent&&(console.warn(" - Warning: You are setting the date to January 1970."),console.warn(" - did input seconds instead of milliseconds?")),e.epoch=t,e}};const S=function(e){return e.epoch=Date.now(),Object.keys(e._today||{}).forEach((t=>{"function"==typeof e[t]&&(e=e[t](e._today[t]))})),e},q={now:e=>S(e),today:e=>S(e),tonight:e=>e=(e=S(e)).hour(18),tomorrow:e=>e=(e=(e=S(e)).add(1,"day")).startOf("day"),yesterday:e=>e=(e=(e=S(e)).subtract(1,"day")).startOf("day"),christmas:e=>{let t=S(e).year();return e=e.set([t,11,25,18,0,0])},"new years":e=>{let t=S(e).year();return e=e.set([t,11,31,18,0,0])}};q["new years eve"]=q["new years"];var N=q;var I=function(e){return e=(e=(e=(e=e.replace(/\b(mon|tues?|wed|wednes|thur?s?|fri|sat|satur|sun)(day)?\b/i,"")).replace(/([0-9])(th|rd|st|nd)/,"$1")).replace(/,/g,"")).replace(/ +/g," ").trim()};let T={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5};T.date=T.day,T.month=25488e5,T.week=6048e5,T.year=3154e7,Object.keys(T).forEach((e=>{T[e+"s"]=T[e]}));var E=T;const C=(e,t,n,r,a)=>{let o=e.d[n]();if(o===t)return;let i=null===a?null:e.d[a](),s=e.epoch,u=t-o;e.epoch+=E[r]*u,"day"===r&&Math.abs(u)>28&&t<28&&(e.epoch+=E.hour),null!==a&&i!==e.d[a]()&&(e.epoch=s);const l=E[r]/2;for(;e.d[n]()t;)e.epoch-=l;null!==a&&i!==e.d[a]()&&(e.epoch=s)},x={year:{valid:e=>e>-4e3&&e<4e3,walkTo:(e,t)=>C(e,t,"getFullYear","year",null)},month:{valid:e=>e>=0&&e<=11,walkTo:(e,t)=>{let n=e.d,r=n.getMonth(),a=e.epoch,o=n.getFullYear();if(r===t)return;let i=t-r;for(e.epoch+=E.day*(28*i),o!==e.d.getFullYear()&&(e.epoch=a);e.d.getMonth()t;)e.epoch-=E.day}},date:{valid:e=>e>0&&e<=31,walkTo:(e,t)=>C(e,t,"getDate","day","getMonth")},hour:{valid:e=>e>=0&&e<24,walkTo:(e,t)=>C(e,t,"getHours","hour","getDate")},minute:{valid:e=>e>=0&&e<60,walkTo:(e,t)=>C(e,t,"getMinutes","minute","getHours")},second:{valid:e=>e>=0&&e<60,walkTo:(e,t)=>{e.epoch=e.seconds(t).epoch}},millisecond:{valid:e=>e>=0&&e<1e3,walkTo:(e,t)=>{e.epoch=e.milliseconds(t).epoch}}};var A=(e,t)=>{let n=Object.keys(x),r=e.clone();for(let a=0;a{if(!t)return e;t=t.trim().toLowerCase();let n=0;if(/^[\+-]?[0-9]{2}:[0-9]{2}$/.test(t)&&(!0===/:00/.test(t)&&(t=t.replace(/:00/,"")),!0===/:30/.test(t)&&(t=t.replace(/:30/,".5"))),/^[\+-]?[0-9]{4}$/.test(t)&&(t=t.replace(/30$/,".5")),n=parseFloat(t),Math.abs(n)>100&&(n/=100),0===n||"Z"===t||"z"===t)return e.tz="etc/gmt",e;n*=-1,n>=0&&(n="+"+n);let r="etc/gmt"+n;return e.timezones[r]&&(e.tz=r),e};var Z=(e,t="")=>{let n=(t=t.replace(/^\s+/,"").toLowerCase()).match(/([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?[:\.]?([0-9]{1,4})?/);if(null!==n){let[,r,a,o,i]=n;if(r=Number(r),r<0||r>24)return e.startOf("day");if(a=Number(a),n[2].length<2||a<0||a>59)return e.startOf("day");e=(e=(e=(e=e.hour(r)).minute(a)).seconds(o||0)).millisecond(function(e=""){return(e=String(e)).length>3?e=e.substring(0,3):1===e.length?e+="00":2===e.length&&(e+="0"),Number(e)||0}(i));let s=t.match(/[\b0-9] ?(am|pm)\b/);return null!==s&&s[1]&&(e=e.ampm(s[1])),e}if(n=t.match(/([0-9]+) ?(am|pm)/),null!==n&&n[1]){let t=Number(n[1]);return t>12||t<1?e.startOf("day"):e=(e=(e=e.hour(n[1]||0)).ampm(n[2])).startOf("hour")}return e=e.startOf("day")};let U=B();const Q=e=>{if(!0!==Y.hasOwnProperty(e.month))return!1;if(1===e.month)return!!(g(e.year)&&e.date<=29)||e.date<=28;let t=Y[e.month]||0;return e.date<=t},G=(e="",t)=>{if(e=e.trim(),!0===/^'[0-9][0-9]$/.test(e)){let t=Number(e.replace(/'/,""));return t>50?1900+t:2e3+t}let n=parseInt(e,10);return!n&&t&&(n=t.year),n=n||(new Date).getFullYear(),n},V=function(e){return"sept"===(e=e.toLowerCase().trim())?U.sep:U[e]};var W=[{reg:/^([0-9]{1,2})[\-\/.]([0-9]{1,2})[\-\/.]?([0-9]{4})?( [0-9]{1,2}:[0-9]{2}:?[0-9]{0,2}? ?(am|pm|gmt))?$/i,parse:(e,t)=>{let n=parseInt(t[1],10)-1,r=parseInt(t[2],10);(e.british||n>=12)&&(r=parseInt(t[1],10),n=parseInt(t[2],10)-1);let a={date:r,month:n,year:G(t[3],e._today)||(new Date).getFullYear()};return!1===Q(a)?(e.epoch=null,e):(A(e,a),e=Z(e,t[4]))}},{reg:/^([a-z]+)[\-\/\. ]([0-9]{1,2})[\-\/\. ]?([0-9]{4}|'[0-9]{2})?( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[1]),date:_(t[2]||"")};return!1===Q(n)?(e.epoch=null,e):(A(e,n),e=Z(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2})( [0-9]{4})?( ([0-9:]+( ?am| ?pm| ?gmt)?))?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[1]),date:_(t[2]||"")};return!1===Q(n)?(e.epoch=null,e):(A(e,n),e=Z(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2}) ([0-9]{1,2}:[0-9]{2}:?[0-9]{0,2})( \+[0-9]{4})?( [0-9]{4})?$/i,parse:(e,t)=>{let[,n,r,a,o,i]=t,s={year:G(i,e._today),month:V(n),date:_(r||"")};return!1===Q(s)?(e.epoch=null,e):(A(e,s),e=H(e,o),e=Z(e,a))}}],J=[{reg:/^([0-9]{4})[\-\/]([0-9]{2})$/i,parse:(e,t)=>{let n={year:t[1],month:parseInt(t[2],10)-1,date:1};return!1===Q(n)?(e.epoch=null,e):(A(e,n),e=Z(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{4})$/i,parse:(e,t)=>{let n={year:G(t[2],e._today),month:V(t[1]),date:e._today.date||1};return!1===Q(n)?(e.epoch=null,e):(A(e,n),e=Z(e,t[4]))}},{reg:/^(q[0-9])( of)?( [0-9]{4})?/i,parse:(e,t)=>{let n=t[1]||"";e=e.quarter(n);let r=t[3]||"";return r&&(r=r.trim(),e=e.year(r)),e}},{reg:/^(spring|summer|winter|fall|autumn)( of)?( [0-9]{4})?/i,parse:(e,t)=>{let n=t[1]||"";e=e.season(n);let r=t[3]||"";return r&&(r=r.trim(),e=e.year(r)),e}},{reg:/^[0-9,]+ ?b\.?c\.?$/i,parse:(e,t)=>{let n=t[0]||"";n=n.replace(/^([0-9,]+) ?b\.?c\.?$/i,"-$1");let r=new Date,a={year:parseInt(n.trim(),10),month:r.getMonth(),date:r.getDate()};return!1===Q(a)?(e.epoch=null,e):(A(e,a),e=Z(e))}},{reg:/^[0-9,]+ ?(a\.?d\.?|c\.?e\.?)$/i,parse:(e,t)=>{let n=t[0]||"";n=n.replace(/,/g,"");let r=new Date,a={year:parseInt(n.trim(),10),month:r.getMonth(),date:r.getDate()};return!1===Q(a)?(e.epoch=null,e):(A(e,a),e=Z(e))}},{reg:/^[0-9]{4}( ?a\.?d\.?)?$/i,parse:(e,t)=>{let n=e._today;n.month&&!n.date&&(n.date=1);let r=new Date,a={year:G(t[0],n),month:n.month||r.getMonth(),date:n.date||r.getDate()};return!1===Q(a)?(e.epoch=null,e):(A(e,a),e=Z(e))}}],K=[].concat([{reg:/^(\-?0?0?[0-9]{3,4})-([0-9]{1,2})-([0-9]{1,2})[T| ]([0-9.:]+)(Z|[0-9\-\+:]+)?$/i,parse:(e,t)=>{let n={year:t[1],month:parseInt(t[2],10)-1,date:t[3]};return!1===Q(n)?(e.epoch=null,e):(H(e,t[5]),A(e,n),e=Z(e,t[4]))}},{reg:/^([0-9]{4})[\-\/\. ]([0-9]{1,2})[\-\/\. ]([0-9]{1,2})( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={year:t[1],month:parseInt(t[2],10)-1,date:parseInt(t[3],10)};return n.month>=12&&(n.date=parseInt(t[2],10),n.month=parseInt(t[3],10)-1),!1===Q(n)?(e.epoch=null,e):(A(e,n),e=Z(e,t[4]))}},{reg:/^([0-9]{4})[\-\/\. ]([a-z]+)[\-\/\. ]([0-9]{1,2})( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={year:G(t[1],e._today),month:V(t[2]),date:_(t[3]||"")};return!1===Q(n)?(e.epoch=null,e):(A(e,n),e=Z(e,t[4]))}}],W,[{reg:/^([0-9]{1,2})[\-\/]([a-z]+)[\-\/]?([0-9]{4})?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[2]),date:_(t[1]||"")};return!1===Q(n)?(e.epoch=null,e):(A(e,n),e=Z(e,t[4]))}},{reg:/^([0-9]{1,2})( [a-z]+)( [0-9]{4}| '[0-9]{2})? ?([0-9]{1,2}:[0-9]{2}:?[0-9]{0,2}? ?(am|pm|gmt))?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[2]),date:_(t[1])};return n.month&&!1!==Q(n)?(A(e,n),e=Z(e,t[4])):(e.epoch=null,e)}},{reg:/^([0-9]{1,2})[\. -/]([a-z]+)[\. -/]([0-9]{4})?( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={date:Number(t[1]),month:V(t[2]),year:Number(t[3])};return!1===Q(n)?(e.epoch=null,e):(A(e,n),e=e.startOf("day"),e=Z(e,t[4]))}}],J);var R=function(e,t,n){for(let r=0;r{let n=e._today||ne;if("number"==typeof t)return te(e,t);if(e.epoch=Date.now(),e._today&&k(e._today)&&Object.keys(e._today).length>0){let t=ee(e,n,ne);t.isValid()&&(e.epoch=t.epoch)}return null==t||""===t?e:!0===b(t)?(e.epoch=t.getTime(),e):!0===function(e){return"[object Array]"===Object.prototype.toString.call(e)}(t)?e=X(e,t,n):!0===k(t)?t.epoch?(e.epoch=t.epoch,e.tz=t.tz,e):e=ee(e,t,n):"string"!=typeof t?e:(t=I(t),!0===N.hasOwnProperty(t)?e=N[t](e):R(e,t))};let ae=["sun","mon","tue","wed","thu","fri","sat"],oe=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function ie(){return ae}function se(){return oe}const ue={mo:1,tu:2,we:3,th:4,fr:5,sa:6,su:7,tues:2,weds:3,wedn:3,thur:4,thurs:4};let le=!0;var ce=e=>{let t=e.timezone().current.offset;return t?O(t,":"):"Z"};const he=e=>le?function(e){return e?e[0].toUpperCase()+e.substr(1):""}(e):e,de={day:e=>he(e.dayName()),"day-short":e=>he(ie()[e.day()]),"day-number":e=>e.day(),"day-ordinal":e=>v(e.day()),"day-pad":e=>w(e.day()),date:e=>e.date(),"date-ordinal":e=>v(e.date()),"date-pad":e=>w(e.date()),month:e=>he(e.monthName()),"month-short":e=>he(L()[e.month()]),"month-number":e=>e.month(),"month-ordinal":e=>v(e.month()),"month-pad":e=>w(e.month()),"iso-month":e=>w(e.month()+1),year:e=>{let t=e.year();return t>0?t:(t=Math.abs(t),t+" BC")},"year-short":e=>{let t=e.year();return t>0?`'${String(e.year()).substr(2,4)}`:(t=Math.abs(t),t+" BC")},"iso-year":e=>{let t=e.year(),n=t<0,r=w(Math.abs(t),4);return n&&(r=w(r,6),r="-"+r),r},time:e=>e.time(),"time-24":e=>`${e.hour24()}:${w(e.minute())}`,hour:e=>e.hour12(),"hour-pad":e=>w(e.hour12()),"hour-24":e=>e.hour24(),"hour-24-pad":e=>w(e.hour24()),minute:e=>e.minute(),"minute-pad":e=>w(e.minute()),second:e=>e.second(),"second-pad":e=>w(e.second()),millisecond:e=>e.millisecond(),"millisecond-pad":e=>w(e.millisecond(),3),ampm:e=>e.ampm(),AMPM:e=>e.ampm().toUpperCase(),quarter:e=>"Q"+e.quarter(),season:e=>e.season(),era:e=>e.era(),json:e=>e.json(),timezone:e=>e.timezone().name,offset:e=>ce(e),numeric:e=>`${e.year()}/${w(e.month()+1)}/${w(e.date())}`,"numeric-us":e=>`${w(e.month()+1)}/${w(e.date())}/${e.year()}`,"numeric-uk":e=>`${w(e.date())}/${w(e.month()+1)}/${e.year()}`,"mm/dd":e=>`${w(e.month()+1)}/${w(e.date())}`,iso:e=>`${e.format("iso-year")}-${w(e.month()+1)}-${w(e.date())}T${w(e.h24())}:${w(e.minute())}:${w(e.second())}.${w(e.millisecond(),3)}${ce(e)}`,"iso-short":e=>{let t=w(e.month()+1),n=w(e.date());var r;return`${(r=e.year())>=0?w(r,4):"-"+w(r=Math.abs(r),4)}-${t}-${n}`},"iso-utc":e=>new Date(e.epoch).toISOString(),nice:e=>`${L()[e.month()]} ${v(e.date())}, ${e.time()}`,"nice-24":e=>`${L()[e.month()]} ${v(e.date())}, ${e.hour24()}:${w(e.minute())}`,"nice-year":e=>`${L()[e.month()]} ${v(e.date())}, ${e.year()}`,"nice-day":e=>`${ie()[e.day()]} ${he(L()[e.month()])} ${v(e.date())}`,"nice-full":e=>`${e.dayName()} ${he(e.monthName())} ${v(e.date())}, ${e.time()}`,"nice-full-24":e=>`${e.dayName()} ${he(e.monthName())} ${v(e.date())}, ${e.hour24()}:${w(e.minute())}`},me={"day-name":"day","month-name":"month","iso 8601":"iso","time-h24":"time-24","time-12":"time","time-h12":"time",tz:"timezone","day-num":"day-number","month-num":"month-number","month-iso":"iso-month","year-iso":"iso-year","nice-short":"nice","nice-short-24":"nice-24",mdy:"numeric-us",dmy:"numeric-uk",ymd:"numeric","yyyy/mm/dd":"numeric","mm/dd/yyyy":"numeric-us","dd/mm/yyyy":"numeric-us","little-endian":"numeric-uk","big-endian":"numeric","day-nice":"nice-day"};Object.keys(me).forEach((e=>de[e]=de[me[e]]));var fe=(e,t="")=>{if(!0!==e.isValid())return"";if(de.hasOwnProperty(t)){let n=de[t](e)||"";return"json"!==t&&(n=String(n),"ampm"!==t.toLowerCase()&&(n=he(n))),n}if(-1!==t.indexOf("{")){let n=/\{(.+?)\}/g;return t=t.replace(n,((t,n)=>{if(n=n.toLowerCase().trim(),de.hasOwnProperty(n)){let t=String(de[n](e));return"ampm"!==n.toLowerCase()?he(t):t}return""})),t}return e.format("iso-short")};const pe={G:e=>e.era(),GG:e=>e.era(),GGG:e=>e.era(),GGGG:e=>"AD"===e.era()?"Anno Domini":"Before Christ",y:e=>e.year(),yy:e=>w(Number(String(e.year()).substr(2,4))),yyy:e=>e.year(),yyyy:e=>e.year(),yyyyy:e=>"0"+e.year(),Q:e=>e.quarter(),QQ:e=>e.quarter(),QQQ:e=>e.quarter(),QQQQ:e=>e.quarter(),M:e=>e.month()+1,MM:e=>w(e.month()+1),MMM:e=>e.format("month-short"),MMMM:e=>e.format("month"),w:e=>e.week(),ww:e=>w(e.week()),d:e=>e.date(),dd:e=>w(e.date()),D:e=>e.dayOfYear(),DD:e=>w(e.dayOfYear()),DDD:e=>w(e.dayOfYear(),3),E:e=>e.format("day-short"),EE:e=>e.format("day-short"),EEE:e=>e.format("day-short"),EEEE:e=>e.format("day"),EEEEE:e=>e.format("day")[0],e:e=>e.day(),ee:e=>e.day(),eee:e=>e.format("day-short"),eeee:e=>e.format("day"),eeeee:e=>e.format("day")[0],a:e=>e.ampm().toUpperCase(),aa:e=>e.ampm().toUpperCase(),aaa:e=>e.ampm().toUpperCase(),aaaa:e=>e.ampm().toUpperCase(),h:e=>e.h12(),hh:e=>w(e.h12()),H:e=>e.hour(),HH:e=>w(e.hour()),m:e=>e.minute(),mm:e=>w(e.minute()),s:e=>e.second(),ss:e=>w(e.second()),SSS:e=>w(e.millisecond(),3),A:e=>e.epoch-e.startOf("day").epoch,z:e=>e.timezone().name,zz:e=>e.timezone().name,zzz:e=>e.timezone().name,zzzz:e=>e.timezone().name,Z:e=>O(e.timezone().current.offset),ZZ:e=>O(e.timezone().current.offset),ZZZ:e=>O(e.timezone().current.offset),ZZZZ:e=>O(e.timezone().current.offset,":")},ye=(e,t,n)=>{let r=e,a=t;for(let o=0;o{let n=t.split("");return n=function(e){for(let t=0;te))}(n),n=function(e){for(let t=0;te))).map((e=>("''"===e&&(e="'"),e)))}(n),n.reduce(((t,n)=>(void 0!==pe[n]?t+=pe[n](e)||"":(/^'.{1,}'$/.test(n)&&(n=n.replace(/'/g,"")),t+=n),t)),"")};const be=["year","season","quarter","month","week","day","quarterHour","hour","minute"],ke=function(e,t){let n=e.clone().startOf(t),r=e.clone().endOf(t).epoch-n.epoch,a=(e.epoch-n.epoch)/r;return parseFloat(a.toFixed(2))};var we=(e,t)=>{if(t)return t=j(t),ke(e,t);let n={};return be.forEach((t=>{n[t]=ke(e,t)})),n};var ve=(e,t)=>{let n=e.progress();return"quarterhour"===(t=j(t))&&(t="quarterHour"),void 0!==n[t]?(n[t]>.5&&(e=e.add(1,t)),e=e.startOf(t)):!1===e.silent&&console.warn("no known unit '"+t+"'"),e};const _e=(e,t,n)=>{let r=0;for(e=e.clone();e.isBefore(t);)e=e.add(1,n),r+=1;return e.isAfter(t,n)&&(r-=1),r};var je=(e,t,n)=>e.isBefore(t)?_e(e,t,n):-1*_e(t,e,n);var ze=function(e,t){let n=t.epoch-e.epoch,r={milliseconds:n,seconds:parseInt(n/1e3,10)};r.minutes=parseInt(r.seconds/60,10),r.hours=parseInt(r.minutes/60,10);let a=e.clone();return r.years=((e,t)=>{let n=t.year()-e.year();return(e=e.year(t.year())).isAfter(t)&&(n-=1),n})(a,t),a=e.add(r.years,"year"),r.months=12*r.years,a=e.add(r.months,"month"),r.months+=je(a,t,"month"),r.quarters=4*r.years,r.quarters+=parseInt(r.months%12/3,10),r.weeks=52*r.years,a=e.add(r.weeks,"week"),r.weeks+=je(a,t,"week"),r.days=7*r.weeks,a=e.add(r.days,"day"),r.days+=je(a,t,"day"),r};var $e=function(e,t,n){t=$(t,e);let r=!1;if(e.isAfter(t)){let n=e;e=t,t=n,r=!0}let a=ze(e,t);return r&&(a=function(e){return Object.keys(e).forEach((t=>{e[t]*=-1})),e}(a)),n?(n=j(n),!0!==/s$/.test(n)&&(n+="s"),"dates"===n&&(n="days"),a[n]):a};const Oe=e=>Math.abs(e)||0;var De=function(e){let t="P";return t+=Oe(e.years)+"Y",t+=Oe(e.months)+"M",t+=Oe(e.days)+"DT",t+=Oe(e.hours)+"H",t+=Oe(e.minutes)+"M",t+=Oe(e.seconds)+"S",t};let Me={second:"second",seconds:"seconds",minute:"minute",minutes:"minutes",hour:"hour",hours:"hours",day:"day",days:"days",month:"month",months:"months",year:"year",years:"years"};function Se(e){return Me[e]||""}let qe="past",Ne="future",Ie="present",Te="now",Ee="almost",Ce="over",xe=e=>`${e} ago`,Ae=e=>`in ${e}`;function Ye(e){return xe(e)}function Fe(e){return Ae(e)}function Pe(){return Te}const Le={months:{almost:10,over:4},days:{almost:25,over:10},hours:{almost:20,over:8},minutes:{almost:50,over:20},seconds:{almost:50,over:20}};function Be(e,t){return 1===e?e+" "+Se(t.slice(0,-1)):e+" "+Se(t)}var He=function(e){let t=null,n=null,r=[],a=[];return Object.keys(e).forEach(((o,i,s)=>{const u=Math.abs(e[o]);if(0===u)return;r.push(u+o[0]);const l=Be(u,o);if(a.push(l),!t){if(t=n=l,i>4)return;const r=s[i+1],a=Math.abs(e[r]);a>Le[r].almost?(t=Be(u+1,o),n=Ee+" "+t):a>Le[r].over&&(n=Ce+" "+l)}})),{qualified:n,rounded:t,abbreviated:r,englishValues:a}};var Ze=(e,t)=>{const n=function(e,t){const n=e.isBefore(t),r=n?t:e;let a=n?e:t;a=a.clone();const o={years:0,months:0,days:0,hours:0,minutes:0,seconds:0};return Object.keys(o).forEach((e=>{if(a.isSame(r,e))return;let t=a.diff(r,e);a=a.add(t,e),o[e]=t})),n&&Object.keys(o).forEach((e=>{0!==o[e]&&(o[e]*=-1)})),o}(e,t=$(t,e));if(!0===Object.keys(n).every((e=>!n[e])))return{diff:n,rounded:Pe(),qualified:Pe(),precise:Pe(),abbreviated:[],iso:"P0Y0M0DT0H0M0S",direction:Ie};let r,a=Ne,{rounded:o,qualified:i,englishValues:s,abbreviated:u}=He(n);r=s.splice(0,2).join(", "),!0===e.isAfter(t)?(o=Ye(o),i=Ye(i),r=Ye(r),a=qe):(o=Fe(o),i=Fe(i),r=Fe(r));let l=De(n);return{diff:n,rounded:o,qualified:i,precise:r,abbreviated:u,iso:l,direction:a}};var Ue={north:[["spring",2,1],["summer",5,1],["fall",8,1],["autumn",8,1],["winter",11,1]],south:[["fall",2,1],["autumn",2,1],["winter",5,1],["spring",8,1],["summer",11,1]]},Qe=[null,[0,1],[3,1],[6,1],[9,1]];const Ge={second:e=>(A(e,{millisecond:0}),e),minute:e=>(A(e,{second:0,millisecond:0}),e),quarterhour:e=>{let t=e.minutes();return e=t>=45?e.minutes(45):t>=30?e.minutes(30):t>=15?e.minutes(15):e.minutes(0),A(e,{second:0,millisecond:0}),e},hour:e=>(A(e,{minute:0,second:0,millisecond:0}),e),day:e=>(A(e,{hour:0,minute:0,second:0,millisecond:0}),e),week:e=>{let t=e.clone();return(e=e.day(e._weekStart)).isAfter(t)&&(e=e.subtract(1,"week")),A(e,{hour:0,minute:0,second:0,millisecond:0}),e},month:e=>(A(e,{date:1,hour:0,minute:0,second:0,millisecond:0}),e),quarter:e=>{let t=e.quarter();return Qe[t]&&A(e,{month:Qe[t][0],date:Qe[t][1],hour:0,minute:0,second:0,millisecond:0}),e},season:e=>{let t=e.season(),n="north";"South"===e.hemisphere()&&(n="south");for(let r=0;r(A(e,{month:0,date:1,hour:0,minute:0,second:0,millisecond:0}),e),decade:e=>{let t=(e=e.startOf("year")).year(),n=10*parseInt(t/10,10);return e=e.year(n)},century:e=>{let t=(e=e.startOf("year")).year(),n=100*parseInt(t/100,10);return e=e.year(n)}};Ge.date=Ge.day;var Ve=function(e,t,n){if(!t||!n)return[];if(t=j(t),n=e.clone().set(n),e.isAfter(n)){let t=e;e=n,n=t}let r=e.clone();if(function(e){return!!ie().find((t=>t===e))||!!se().find((t=>t===e))}(t))r=r.next(t),t="week";else{r.startOf(t).isBefore(e)&&(r=r.next(t))}let a=[];for(;r.isBefore(n);)a.push(r),r=r.add(1,t);return a};var We=e=>{let n=e.timezones,r=e.tz;if(!1===n.hasOwnProperty(r)&&(r=y(e.tz,n)),null===r)return!1===e.silent&&console.warn("Warn: could not find given or local timezone - '"+e.tz+"'"),{current:{epochShift:0}};let a=n[r],o={name:(i=r,i=(i=(i=(i=(i=(i=(i=i[0].toUpperCase()+i.substr(1)).replace(/[\/_-]([a-z])/gi,(e=>e.toUpperCase()))).replace(/_(of|es)_/i,(e=>e.toLowerCase()))).replace(/\/gmt/i,"/GMT")).replace(/\/Dumontdurville$/i,"/DumontDUrville")).replace(/\/Mcmurdo$/i,"/McMurdo")).replace(/\/Port-au-prince$/i,"/Port-au-Prince")),hasDst:Boolean(a.dst),default_offset:a.offset,hemisphere:"s"===a.hem?"South":"North",current:{}};var i,s;if(o.hasDst){let e=(s=a.dst)?s.split("->"):[];o.change={start:e[0],back:e[1]}}let u=a.offset,l=u;return!0===o.hasDst&&(l="North"===o.hemisphere?u-1:a.offset+1),!1===o.hasDst?(o.current.offset=u,o.current.isDST=!1):!0===t(e.epoch,o.change.start,o.change.back,u,l)?(o.current.offset=u,o.current.isDST="North"===o.hemisphere):(o.current.offset=l,o.current.isDST="South"===o.hemisphere),o};const Je=["century","decade","year","month","date","day","hour","minute","second","millisecond"],Ke={set:function(e,t){let n=this.clone();return n=re(n,e),t&&(this.tz=y(t)),n},timezone:function(){return We(this)},isDST:function(){return We(this).current.isDST},hasDST:function(){return We(this).hasDst},offset:function(){return 60*We(this).current.offset},hemisphere:function(){return We(this).hemisphere},format:function(e){return fe(this,e)},unixFmt:function(e){return ge(this,e)},startOf:function(e){return((e,t)=>{let n=e.clone();return t=j(t),Ge[t]?Ge[t](n):"summer"===t||"winter"===t?(n=n.season(t),Ge.season(n)):n})(this,e)},endOf:function(e){return((e,t)=>{let n=e.clone();return t=j(t),Ge[t]?(n=Ge[t](n),n=n.add(1,t),n=n.subtract(1,"millisecond"),n):n})(this,e)},leapYear:function(){return g(this.year())},progress:function(e){return we(this,e)},nearest:function(e){return ve(this,e)},diff:function(e,t){return $e(this,e,t)},since:function(e){return e||(e=this.clone().set()),Ze(this,e)},next:function(e){return this.add(1,e).startOf(e)},last:function(e){return this.subtract(1,e).startOf(e)},isValid:function(){return!(!this.epoch&&0!==this.epoch)&&!isNaN(this.d.getTime())},goto:function(e){let t=this.clone();return t.tz=y(e,t.timezones),t},every:function(e,t){if("object"==typeof e&&"string"==typeof t){let n=t;t=e,e=n}return Ve(this,e,t)},isAwake:function(){let e=this.hour();return!(e<8||e>22)},isAsleep:function(){return!this.isAwake()},daysInMonth:function(){switch(this.month()){case 0:case 2:case 4:case 6:case 7:case 9:case 11:return 31;case 1:return this.leapYear()?29:28;case 3:case 5:case 8:case 10:return 30;default:throw new Error("Invalid Month state.")}},log:function(){return console.log(""),console.log(fe(this,"nice-short")),this},logYear:function(){return console.log(""),console.log(fe(this,"full-short")),this},json:function(){return Je.reduce(((e,t)=>(e[t]=this[t](),e)),{})},debug:function(){let e=this.timezone(),t=this.format("MM")+" "+this.format("date-ordinal")+" "+this.year();return t+="\n - "+this.format("time"),console.log("\n\n",t+"\n - "+e.name+" ("+e.current.offset+")"),this},from:function(e){return(e=this.clone().set(e)).since(this)},fromNow:function(){return this.clone().set(Date.now()).since(this)},weekStart:function(e){if("number"==typeof e)return this._weekStart=e,this;if("string"==typeof e){e=e.toLowerCase().trim();let t=ie().indexOf(e);-1===t&&(t=se().indexOf(e)),-1===t&&(t=1),this._weekStart=t}else console.warn("Spacetime Error: Cannot understand .weekStart() input:",e);return this}};Ke.inDST=Ke.isDST,Ke.round=Ke.nearest,Ke.each=Ke.every;var Re=Ke;const Xe=e=>("string"==typeof e&&(e=parseInt(e,10)),e),et=["year","month","date","hour","minute","second","millisecond"],tt=(e,t,n)=>{let r=et.indexOf(n),a=et.slice(r,et.length);for(let n=0;n=24?t=24:t<0&&(t=0);let r=e.clone(),a=e.hour()-t,o=a*E.hour;return e.epoch-=o,e.date()!==r.date()&&(e=r.clone(),a>1&&(a-=1),a<1&&(a+=1),o=a*E.hour,e.epoch-=o),A(e,{hour:t}),tt(e,r,"minute"),(e=nt(e,r,n,"day")).epoch},ot=function(e,t){return"string"==typeof t&&/^'[0-9]{2}$/.test(t)&&(t=t.replace(/'/,"").trim(),t=(t=Number(t))>30?1900+t:2e3+t),t=Xe(t),A(e,{year:t}),e.epoch};let it="am",st="pm";const ut={millisecond:function(e){if(void 0!==e){let t=this.clone();return t.epoch=function(e,t){t=Xe(t);let n=e.millisecond()-t;return e.epoch-n}(t,e),t}return this.d.getMilliseconds()},second:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){t=Xe(t);let r=e.clone(),a=(e.second()-t)*E.second;return e.epoch=e.epoch-a,(e=nt(e,r,n,"minute")).epoch}(n,e,t),n}return this.d.getSeconds()},minute:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=rt(n,e,t),n}return this.d.getMinutes()},hour:function(e,t){let n=this.d;if(void 0!==e){let n=this.clone();return n.epoch=at(n,e,t),n}return n.getHours()},hourFloat:function(e,t){if(void 0!==e){let n=this.clone(),r=e%1;r*=60;let a=parseInt(e,10);return n.epoch=at(n,a,t),n.epoch=rt(n,r,t),n}let n=this.d,r=n.getHours(),a=n.getMinutes();return a/=60,r+a},hour12:function(e,t){let n=this.d;if(void 0!==e){let n=this.clone(),r=(e=""+e).match(/^([0-9]+)(am|pm)$/);if(r){let e=parseInt(r[1],10);"pm"===r[2]&&(e+=12),n.epoch=at(n,e,t)}return n}let r=n.getHours();return r>12&&(r-=12),0===r&&(r=12),r},time:function(e,t){if(void 0!==e){let n=this.clone();return e=e.toLowerCase().trim(),n.epoch=function(e,t,n){let r=t.match(/([0-9]{1,2})[:h]([0-9]{1,2})(:[0-9]{1,2})? ?(am|pm)?/);if(!r){if(r=t.match(/([0-9]{1,2}) ?(am|pm)/),!r)return e.epoch;r.splice(2,0,"0"),r.splice(3,0,"")}let a=!1,o=parseInt(r[1],10),i=parseInt(r[2],10);i>=60&&(i=59),o>12&&(a=!0),!1===a&&("am"===r[4]&&12===o&&(o=0),"pm"===r[4]&&o<12&&(o+=12)),r[3]=r[3]||"",r[3]=r[3].replace(/:/,"");let s=parseInt(r[3],10)||0,u=e.clone();return e=(e=(e=(e=e.hour(o)).minute(i)).second(s)).millisecond(0),(e=nt(e,u,n,"day")).epoch}(n,e,t),n}return`${this.h12()}:${w(this.minute())}${this.ampm()}`},ampm:function(e,t){let n=it,r=this.hour();if(r>=12&&(n=st),"string"!=typeof e)return n;let a=this.clone();return e=e.toLowerCase().trim(),r>=12&&"am"===e?(r-=12,a.hour(r,t)):r<12&&"pm"===e?(r+=12,a.hour(r,t)):a},dayTime:function(e,t){if(void 0!==e){const n={morning:"7:00",breakfast:"7:00",noon:"12:00",lunch:"12:00",afternoon:"14:00",evening:"18:00",dinner:"18:00",night:"23:00",midnight:"00:00"};let r=this.clone();return e=(e=e||"").toLowerCase(),!0===n.hasOwnProperty(e)&&(r=r.time(n[e],t)),r}let n=this.hour();return n<6?"night":n<12?"morning":n<17?"afternoon":n<22?"evening":"night"},iso:function(e){return void 0!==e?this.set(e):this.format("iso")}};var lt=ut;const ct={date:function(e,t){if(void 0!==e){let n=this.clone();return(e=parseInt(e,10))&&(n.epoch=function(e,t,n){if((t=Xe(t))>28){let n=e.month(),r=Y[n];1===n&&29===t&&g(e.year())&&(r=29),t>r&&(t=r)}t<=0&&(t=1);let r=e.clone();return A(e,{date:t}),(e=nt(e,r,n,"month")).epoch}(n,e,t)),n}return this.d.getDate()},day:function(e,t){if(void 0===e)return this.d.getDay();let n=this.clone(),r=e;"string"==typeof e&&(e=e.toLowerCase(),ue.hasOwnProperty(e)?r=ue[e]:(r=ie().indexOf(e),-1===r&&(r=se().indexOf(e))));let a=this.d.getDay()-r;!0===t&&a>0&&(a-=7),!1===t&&a<0&&(a+=7);let o=this.subtract(a,"days");return A(o,{hour:n.hour(),minute:n.minute(),second:n.second()}),o},dayName:function(e,t){if(void 0===e)return se()[this.day()];let n=this.clone();return n=n.day(e,t),n}};var ht=ct;const dt=e=>e=(e=(e=e.minute(0)).second(0)).millisecond(1),mt={dayOfYear:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){t=Xe(t);let r=e.clone();return(t-=1)<=0?t=0:t>=365&&(t=g(e.year())?365:364),e=(e=e.startOf("year")).add(t,"day"),tt(e,r,"hour"),(e=nt(e,r,n,"year")).epoch}(n,e,t),n}let n,r=0,a=this.d.getMonth();for(let e=1;e<=a;e++)n=new Date,n.setDate(1),n.setFullYear(this.d.getFullYear()),n.setHours(1),n.setMinutes(1),n.setMonth(e),n.setHours(-2),r+=n.getDate();return r+this.d.getDate()},week:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){let r=e.clone();return t=Xe(t),"december"===(e=(e=(e=e.month(0)).date(1)).day("monday")).monthName()&&e.date()>=28&&(e=e.add(1,"week")),t-=1,e=e.add(t,"weeks"),(e=nt(e,r,n,"year")).epoch}(this,e,t),n=dt(n),n}let n=this.clone();n=n.month(0),n=n.date(1),n=dt(n),n=n.day("monday"),11===n.month()&&n.date()>=25&&(n=n.add(1,"week"));let r=1;1===n.date()&&(r=0),n=n.minus(1,"second");const a=this.epoch;if(n.epoch>a)return 1;let o=0,i=4*this.month();for(n.epoch+=E.week*i,o+=i;o<=52;o++){if(n.epoch>a)return o+r;n=n.add(1,"week")}return 52},month:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){"string"==typeof t&&("sept"===t&&(t="sep"),t=B()[t.toLowerCase()]),(t=Xe(t))>=12&&(t=11),t<=0&&(t=0);let r=e.date();r>Y[t]&&(r=Y[t]);let a=e.clone();return A(e,{month:t,d:r}),(e=nt(e,a,n,"year")).epoch}(n,e,t),n}return this.d.getMonth()},monthName:function(e,t){if(void 0!==e){let n=this.clone();return n=n.month(e,t),n}return P[this.month()]},quarter:function(e,t){if(void 0!==e&&("string"==typeof e&&(e=e.replace(/^q/i,""),e=parseInt(e,10)),Qe[e])){let n=this.clone(),r=Qe[e][0];return n=n.month(r,t),n=n.date(1,t),n=n.startOf("day"),n}let n=this.d.getMonth();for(let e=1;e=Ue[n][e][1]&&r0&&(t.epoch=ot(t,-1*n)),"ad"===e&&n<0&&(t.epoch=ot(t,-1*n)),t}return this.d.getFullYear()<0?"BC":"AD"},decade:function(e){if(void 0!==e){if(!(e=(e=(e=String(e)).replace(/([0-9])'?s$/,"$1")).replace(/([0-9])(th|rd|st|nd)/,"$1")))return console.warn("Spacetime: Invalid decade input"),this;2===e.length&&/[0-9][0-9]/.test(e)&&(e="19"+e);let t=Number(e);return isNaN(t)?this:(t=10*Math.floor(t/10),this.year(t))}return this.startOf("decade").year()},century:function(e){if(void 0!==e){"string"==typeof e&&(e=(e=(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1")).replace(/([0-9]+) ?(b\.?c\.?|a\.?d\.?)/i,((e,t,n)=>(n.match(/b\.?c\.?/i)&&(t="-"+t),t)))).replace(/c$/,""));let t=Number(e);return isNaN(e)?(console.warn("Spacetime: Invalid century input"),this):(0===t&&(t=1),t=t>=0?100*(t-1):100*(t+1),this.year(t))}let t=this.startOf("century").year();return t=Math.floor(t/100),t<0?t-1:t+1},millenium:function(e){if(void 0!==e){if("string"==typeof e&&(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1"),e=Number(e),isNaN(e)))return console.warn("Spacetime: Invalid millenium input"),this;e>0&&(e-=1);let t=1e3*e;return 0===t&&(t=1),this.year(t)}let t=Math.floor(this.year()/1e3);return t>=0&&(t+=1),t}};var ft=mt;const pt=Object.assign({},lt,ht,ft);pt.milliseconds=pt.millisecond,pt.seconds=pt.second,pt.minutes=pt.minute,pt.hours=pt.hour,pt.hour24=pt.hour,pt.h12=pt.hour12,pt.h24=pt.hour24,pt.days=pt.day;var yt=e=>{Object.keys(pt).forEach((t=>{e.prototype[t]=pt[t]}))};const gt=function(e,t){return 1===e&&g(t)?29:Y[e]},bt=(e,t)=>{if(e.month>0){let n=parseInt(e.month/12,10);e.year=t.year()+n,e.month=e.month%12}else if(e.month<0){let n=Math.abs(e.month),r=parseInt(n/12,10);n%12!=0&&(r+=1),e.year=t.year()-r,e.month=e.month%12,e.month=e.month+12,12===e.month&&(e.month=0)}return e},kt=(e,t,n)=>{let r=t.year(),a=t.month(),o=gt(a,r);for(;n>o;)n-=o,a+=1,a>=12&&(a-=12,r+=1),o=gt(a,r);return e.month=a,e.date=n,e},wt=(e,t,n)=>{e.year=t.year(),e.month=t.month();let r=t.date();for(e.date=r-Math.abs(n);e.date<1;){e.month-=1,e.month<0&&(e.month=11,e.year-=1);let t=gt(e.month,e.year);e.date+=t}return e},vt=["millisecond","second","minute","hour","date","month"];let _t={second:vt.slice(0,1),minute:vt.slice(0,2),quarterhour:vt.slice(0,2),hour:vt.slice(0,3),date:vt.slice(0,4),month:vt.slice(0,4),quarter:vt.slice(0,4),season:vt.slice(0,4),year:vt,decade:vt,century:vt};_t.week=_t.hour,_t.season=_t.date,_t.quarter=_t.date;const jt={year:!0,quarter:!0,season:!0,month:!0,week:!0,date:!0},zt={month:!0,quarter:!0,season:!0,year:!0};var $t=e=>{e.prototype.add=function(e,t){let n=this.clone();if(!t||0===e)return n;let r=this.clone();if("millisecond"===(t=j(t)))return n.epoch+=e,n;"fortnight"===t&&(e*=2,t="week"),E[t]?n.epoch+=E[t]*e:"week"===t||"weekend"===t?n.epoch+=E.day*(7*e):"quarter"===t||"season"===t?n.epoch+=E.month*(3*e):"quarterhour"===t&&(n.epoch+=15*E.minute*e);let a={};if(_t[t]&&_t[t].forEach((e=>{a[e]=r[e]()})),jt[t]){const e=r.timezone().current.offset-n.timezone().current.offset;n.epoch+=3600*e*1e3}if("month"===t&&(a.month=r.month()+e,a=bt(a,r)),"week"===t){let t=r.date()+7*e;t<=28&&t>1&&(a.date=t)}if("weekend"===t&&"saturday"!==n.dayName())n=n.day("saturday",!0);else if("date"===t){if(e<0)a=wt(a,r,e);else{let t=r.date()+e;a=kt(a,r,t)}0!==e&&r.isSame(n,"day")&&(a.date=r.date()+e)}else if("quarter"===t){if(a.month=r.month()+3*e,a.year=r.year(),a.month<0){let e=Math.floor(a.month/12),t=a.month+12*Math.abs(e);a.month=t,a.year+=e}else if(a.month>=12){let e=Math.floor(a.month/12);a.month=a.month%12,a.year+=e}a.date=r.date()}else if("year"===t){let t=r.year()+e,a=n.year();if(at){let t=Math.floor(e/4)||1;n.epoch+=E.day*t}}else"decade"===t?a.year=n.year()+10:"century"===t&&(a.year=n.year()+100);if(zt[t]){let e=Y[a.month];a.date=r.date(),a.date>e&&(a.date=e)}return Object.keys(a).length>1&&A(n,a),n},e.prototype.subtract=function(e,t){return this.clone().add(-1*e,t)},e.prototype.minus=e.prototype.subtract,e.prototype.plus=e.prototype.add};const Ot={millisecond:e=>e.epoch,second:e=>[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second()].join("-"),minute:e=>[e.year(),e.month(),e.date(),e.hour(),e.minute()].join("-"),hour:e=>[e.year(),e.month(),e.date(),e.hour()].join("-"),day:e=>[e.year(),e.month(),e.date()].join("-"),week:e=>[e.year(),e.week()].join("-"),month:e=>[e.year(),e.month()].join("-"),quarter:e=>[e.year(),e.quarter()].join("-"),year:e=>e.year()};Ot.date=Ot.day;var Dt=e=>{e.prototype.isSame=function(t,n,r=!0){let a=this;if(!n)return null;if("string"==typeof t&&"object"==typeof n){let e=t;t=n,n=e}return"string"!=typeof t&&"number"!=typeof t||(t=new e(t,this.timezone.name)),n=n.replace(/s$/,""),!0===r&&a.tz!==t.tz&&((t=t.clone()).tz=a.tz),Ot[n]?Ot[n](a)===Ot[n](t):null}};var Mt=e=>{const t={isAfter:function(e){let t=z(e=$(e,this));return null===t?null:this.epoch>t},isBefore:function(e){let t=z(e=$(e,this));return null===t?null:this.epoch{e.prototype[n]=t[n]}))};var St=e=>{const t={i18n:function(e){var t,n,r;return k(e.days)&&(t=e.days,ae=t.short||ae,oe=t.long||oe),k(e.months)&&function(e){F=e.short||F,P=e.long||P}(e.months),r=e.useTitleCase,"[object Boolean]"===Object.prototype.toString.call(r)&&(n=e.useTitleCase,le=n),k(e.ampm)&&function(e){it=e.am||it,st=e.pm||st}(e.ampm),k(e.distance)&&function(e){xe=e.pastDistance||xe,Ae=e.futureDistance||Ae,qe=e.past||qe,Ne=e.future||Ne,Ie=e.present||Ie,Te=e.now||Te,Ee=e.almost||Ee,Ce=e.over||Ce}(e.distance),k(e.units)&&function(e={}){Me={second:e.second||Me.second,seconds:e.seconds||Me.seconds,minute:e.minute||Me.minute,minutes:e.minutes||Me.minutes,hour:e.hour||Me.hour,hours:e.hours||Me.hours,day:e.day||Me.day,days:e.days||Me.days,month:e.month||Me.month,months:e.months||Me.months,year:e.year||Me.year,years:e.years||Me.years}}(e.units),this}};Object.keys(t).forEach((n=>{e.prototype[n]=t[n]}))};let qt=i;const Nt=function(e,t,r={}){this.epoch=null,this.tz=y(t,qt),this.silent=void 0===r.silent||r.silent,this.british=r.dmy||r.british,this._weekStart=1,void 0!==r.weekStart&&(this._weekStart=r.weekStart),this._today={},void 0!==r.today&&(this._today=r.today),Object.defineProperty(this,"d",{get:function(){let e=n(this),t=(new Date(this.epoch).getTimezoneOffset()||0)+60*e;t=60*t*1e3;let r=this.epoch+t;return new Date(r)}}),Object.defineProperty(this,"timezones",{get:()=>qt,set:e=>(qt=e,e)});let a=re(this,e);this.epoch=a.epoch,a.tz&&(this.tz=a.tz)};Object.keys(Re).forEach((e=>{Nt.prototype[e]=Re[e]})),Nt.prototype.clone=function(){return new Nt(this.epoch,this.tz,{silent:this.silent,weekStart:this._weekStart,today:this._today,parsers:this.parsers})},Nt.prototype.toLocalDate=function(){return this.toNativeDate()},Nt.prototype.toNativeDate=function(){return new Date(this.epoch)},yt(Nt),$t(Nt),Dt(Nt),Mt(Nt),St(Nt);var It=Nt;var Tt=(e,t)=>{let n=new It(null),r=new It(null);n=n.time(e),r=t?r.time(t):n.add(59,"minutes");let a=n.hour(),o=r.hour();return Object.keys(n.timezones).filter((e=>{if(-1===e.indexOf("/"))return!1;let t=new It(null,e),i=t.hour();return i>=a&&i<=o&&(!(i===a&&t.minute()r.minute()))}))};const Et=(e,t,n)=>new It(e,t,n),Ct=function(e){let t=e._today||{};return Object.keys(t).forEach((n=>{e=e[n](t[n])})),e};return Et.now=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n},Et.today=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n.startOf("day")},Et.tomorrow=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n.add(1,"day").startOf("day")},Et.yesterday=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n.subtract(1,"day").startOf("day")},Et.extend=function(e={}){return Object.keys(e).forEach((t=>{It.prototype[t]=e[t]})),this},Et.timezones=function(){return(new It).timezones},Et.max=function(e,t){let n=new It(null,e,t);return n.epoch=864e13,n},Et.min=function(e,t){let n=new It(null,e,t);return n.epoch=-864e13,n},Et.whereIts=Tt,Et.version="7.6.0",Et.plugin=Et.extend,Et})); diff --git a/builds/spacetime.mjs b/builds/spacetime.mjs index fecbabee..ad97072f 100644 --- a/builds/spacetime.mjs +++ b/builds/spacetime.mjs @@ -1 +1 @@ -const e=(e,t,n)=>{const[a,r]=e.split("/"),[o,i]=r.split(":");return Date.UTC(n,a-1,o,i)-36e5*t};var t=(t,n,a,r,o)=>{const i=new Date(t).getUTCFullYear(),s=e(n,o,i),u=e(a,r,i);return t>=s&&t{let n=e.timezones[e.tz];if(void 0===n)return console.warn("Warning: couldn't find timezone "+e.tz),0;if(void 0===n.dst)return n.offset;let a=n.offset,r=n.offset+1;"n"===n.hem&&(r=a-1);let o=n.dst.split("->");return!0===t(e.epoch,o[0],o[1],a,r)?a:r},a={"9|s":"2/dili,2/jayapura","9|n":"2/chita,2/khandyga,2/pyongyang,2/seoul,2/tokyo,2/yakutsk,11/palau,japan,rok","9.5|s|04/07:03->10/06:02":"4/adelaide,4/broken_hill,4/south,4/yancowinna","9.5|s":"4/darwin,4/north","8|s|03/13:01->10/02:00":"12/casey","8|s":"2/kuala_lumpur,2/makassar,2/singapore,4/perth,2/ujung_pandang,4/west,singapore","8|n":"2/brunei,2/choibalsan,2/hong_kong,2/irkutsk,2/kuching,2/macau,2/manila,2/shanghai,2/taipei,2/ulaanbaatar,2/chongqing,2/chungking,2/harbin,2/macao,2/ulan_bator,hongkong,prc,roc","8.75|s":"4/eucla","7|s":"12/davis,2/jakarta,9/christmas","7|n":"2/bangkok,2/barnaul,2/hovd,2/krasnoyarsk,2/novokuznetsk,2/novosibirsk,2/phnom_penh,2/pontianak,2/ho_chi_minh,2/tomsk,2/vientiane,2/saigon","6|s":"12/vostok","6|n":"2/almaty,2/bishkek,2/dhaka,2/omsk,2/qyzylorda,2/qostanay,2/thimphu,2/urumqi,9/chagos,2/dacca,2/kashgar,2/thimbu","6.5|n":"2/yangon,9/cocos,2/rangoon","5|s":"12/mawson,9/kerguelen","5|n":"2/aqtau,2/aqtobe,2/ashgabat,2/atyrau,2/dushanbe,2/karachi,2/oral,2/samarkand,2/tashkent,2/yekaterinburg,9/maldives,2/ashkhabad","5.75|n":"2/kathmandu,2/katmandu","5.5|n":"2/kolkata,2/colombo,2/calcutta","4|s":"9/reunion","4|n":"2/baku,2/dubai,2/muscat,2/tbilisi,2/yerevan,8/astrakhan,8/samara,8/saratov,8/ulyanovsk,8/volgograd,9/mahe,9/mauritius,2/volgograd","4.5|n":"2/kabul","3|s":"12/syowa,9/antananarivo","3|n|04/28:00->10/26:24":"0/cairo,egypt","3|n|03/31:03->10/27:04":"2/famagusta,2/nicosia,8/athens,8/bucharest,8/helsinki,8/mariehamn,8/riga,8/sofia,8/tallinn,8/uzhgorod,8/vilnius,8/zaporozhye,8/nicosia,eet","3|n|03/31:02->10/27:03":"8/chisinau,8/tiraspol","3|n|03/31:00->10/26:24":"2/beirut","3|n|03/31:00->10/25:01":"2/gaza,2/hebron","3|n|03/29:02->10/27:02":"2/jerusalem,2/tel_aviv,israel","3|n|03/26:03->10/29:04":"8/kyiv,8/kiev","3|n":"0/addis_ababa,0/asmara,0/asmera,0/dar_es_salaam,0/djibouti,0/juba,0/kampala,0/mogadishu,0/nairobi,2/aden,2/amman,2/baghdad,2/bahrain,2/damascus,2/kuwait,2/qatar,2/riyadh,8/istanbul,8/kirov,8/minsk,8/moscow,8/simferopol,9/comoro,9/mayotte,2/istanbul,turkey,w-su","3.5|n":"2/tehran,iran","2|s|03/31:02->10/27:02":"12/troll","2|s":"0/gaborone,0/harare,0/johannesburg,0/lubumbashi,0/lusaka,0/maputo,0/maseru,0/mbabane","2|n|03/31:02->10/27:03":"0/ceuta,arctic/longyearbyen,8/amsterdam,8/andorra,8/belgrade,8/berlin,8/bratislava,8/brussels,8/budapest,8/busingen,8/copenhagen,8/gibraltar,8/ljubljana,8/luxembourg,8/madrid,8/malta,8/monaco,8/oslo,8/paris,8/podgorica,8/prague,8/rome,8/san_marino,8/sarajevo,8/skopje,8/stockholm,8/tirane,8/vaduz,8/vatican,8/vienna,8/warsaw,8/zagreb,8/zurich,3/jan_mayen,poland,cet,met","2|n":"0/blantyre,0/bujumbura,0/khartoum,0/kigali,0/tripoli,8/kaliningrad,libya","1|s":"0/brazzaville,0/kinshasa,0/luanda,0/windhoek","1|n|03/31:01->10/27:02":"3/canary,3/faroe,3/madeira,8/dublin,8/guernsey,8/isle_of_man,8/jersey,8/lisbon,8/london,3/faeroe,eire,8/belfast,gb-eire,gb,portugal,wet","1|n":"0/algiers,0/bangui,0/douala,0/lagos,0/libreville,0/malabo,0/ndjamena,0/niamey,0/porto-novo,0/tunis","14|n":"11/kiritimati","13|s":"11/apia,11/tongatapu","13|n":"11/enderbury,11/kanton,11/fakaofo","12|s|04/07:03->09/29:02":"12/mcmurdo,11/auckland,12/south_pole,nz","12|s":"11/fiji","12|n":"2/anadyr,2/kamchatka,2/srednekolymsk,11/funafuti,11/kwajalein,11/majuro,11/nauru,11/tarawa,11/wake,11/wallis,kwajalein","12.75|s|04/07:03->04/07:02":"11/chatham,nz-chat","11|s|04/07:03->10/06:02":"12/macquarie","11|s":"11/bougainville","11|n":"2/magadan,2/sakhalin,11/efate,11/guadalcanal,11/kosrae,11/noumea,11/pohnpei,11/ponape","11.5|n|04/07:03->10/06:02":"11/norfolk","10|s|04/07:03->10/06:02":"4/currie,4/hobart,4/melbourne,4/sydney,4/act,4/canberra,4/nsw,4/tasmania,4/victoria","10|s":"12/dumontdurville,4/brisbane,4/lindeman,11/port_moresby,4/queensland","10|n":"2/ust-nera,2/vladivostok,11/guam,11/saipan,11/chuuk,11/truk,11/yap","10.5|s|04/07:01->10/06:02":"4/lord_howe,4/lhi","0|s|03/10:03->04/14:02":"0/casablanca,0/el_aaiun","0|n|03/31:00->10/27:01":"1/scoresbysund,3/azores","0|n":"0/abidjan,0/accra,0/bamako,0/banjul,0/bissau,0/conakry,0/dakar,0/freetown,0/lome,0/monrovia,0/nouakchott,0/ouagadougou,0/sao_tome,1/danmarkshavn,3/reykjavik,3/st_helena,13/gmt,13/utc,0/timbuktu,13/greenwich,13/uct,13/universal,13/zulu,gmt-0,gmt+0,gmt0,greenwich,iceland,uct,universal,utc,zulu,13/unknown,factory","-9|n|03/10:02->11/03:02":"1/adak,1/atka,us/aleutian","-9|n":"11/gambier","-9.5|n":"11/marquesas","-8|n|03/10:02->11/03:02":"1/anchorage,1/juneau,1/nome,1/sitka,1/yakutat,us/alaska","-8|n":"1/metlakatla,11/pitcairn","-7|n|03/10:02->11/03:02":"1/los_angeles,1/santa_isabel,1/tijuana,1/vancouver,1/ensenada,6/pacific,10/bajanorte,us/pacific-new,us/pacific","-7|n":"1/creston,1/dawson,1/dawson_creek,1/fort_nelson,1/hermosillo,1/mazatlan,1/phoenix,1/whitehorse,6/yukon,10/bajasur,us/arizona,mst","-6|s|04/06:22->09/07:22":"11/easter,7/easterisland","-6|n|04/07:02->10/27:02":"1/merida","-6|n|03/12:02->11/05:02":"1/ciudad_juarez","-6|n|03/10:02->11/03:02":"1/boise,1/cambridge_bay,1/denver,1/edmonton,1/inuvik,1/north_dakota,1/ojinaga,1/yellowknife,1/shiprock,6/mountain,navajo,us/mountain","-6|n":"1/bahia_banderas,1/belize,1/chihuahua,1/costa_rica,1/el_salvador,1/guatemala,1/managua,1/mexico_city,1/monterrey,1/regina,1/swift_current,1/tegucigalpa,11/galapagos,6/east-saskatchewan,6/saskatchewan,10/general","-5|s":"1/lima,1/rio_branco,1/porto_acre,5/acre","-5|n|03/10:02->11/03:02":"1/chicago,1/matamoros,1/menominee,1/rainy_river,1/rankin_inlet,1/resolute,1/winnipeg,1/indiana/knox,1/indiana/tell_city,1/north_dakota/beulah,1/north_dakota/center,1/north_dakota/new_salem,1/knox_in,6/central,us/central,us/indiana-starke","-5|n":"1/bogota,1/cancun,1/cayman,1/coral_harbour,1/eirunepe,1/guayaquil,1/jamaica,1/panama,1/atikokan,jamaica,est","-4|s|04/06:24->09/08:00":"1/santiago,7/continental","-4|s|03/23:24->10/06:00":"1/asuncion","-4|s":"1/campo_grande,1/cuiaba,1/la_paz,1/manaus,5/west","-4|n|03/10:02->11/03:02":"1/detroit,1/grand_turk,1/indiana,1/indianapolis,1/iqaluit,1/kentucky,1/louisville,1/montreal,1/nassau,1/new_york,1/nipigon,1/pangnirtung,1/port-au-prince,1/thunder_bay,1/toronto,1/indiana/marengo,1/indiana/petersburg,1/indiana/vevay,1/indiana/vincennes,1/indiana/winamac,1/kentucky/monticello,1/fort_wayne,1/indiana/indianapolis,1/kentucky/louisville,6/eastern,us/east-indiana,us/eastern,us/michigan","-4|n|03/10:00->11/03:01":"1/havana,cuba","-4|n":"1/anguilla,1/antigua,1/aruba,1/barbados,1/blanc-sablon,1/boa_vista,1/caracas,1/curacao,1/dominica,1/grenada,1/guadeloupe,1/guyana,1/kralendijk,1/lower_princes,1/marigot,1/martinique,1/montserrat,1/port_of_spain,1/porto_velho,1/puerto_rico,1/santo_domingo,1/st_barthelemy,1/st_kitts,1/st_lucia,1/st_thomas,1/st_vincent,1/tortola,1/virgin","-3|s":"1/argentina,1/buenos_aires,1/catamarca,1/cordoba,1/fortaleza,1/jujuy,1/mendoza,1/montevideo,1/punta_arenas,1/sao_paulo,12/palmer,12/rothera,3/stanley,1/argentina/la_rioja,1/argentina/rio_gallegos,1/argentina/salta,1/argentina/san_juan,1/argentina/san_luis,1/argentina/tucuman,1/argentina/ushuaia,1/argentina/comodrivadavia,1/argentina/buenos_aires,1/argentina/catamarca,1/argentina/cordoba,1/argentina/jujuy,1/argentina/mendoza,1/argentina/rosario,1/rosario,5/east","-3|n|03/10:02->11/03:02":"1/glace_bay,1/goose_bay,1/halifax,1/moncton,1/thule,3/bermuda,6/atlantic","-3|n":"1/araguaina,1/bahia,1/belem,1/cayenne,1/maceio,1/paramaribo,1/recife,1/santarem","-2|n|03/30:22->10/26:23":"1/nuuk,1/godthab","-2|n|03/10:02->11/03:02":"1/miquelon","-2|n":"1/noronha,3/south_georgia,5/denoronha","-2.5|n|03/10:02->11/03:02":"1/st_johns,6/newfoundland","-1|n":"3/cape_verde","-11|n":"11/midway,11/niue,11/pago_pago,11/samoa,us/samoa","-10|n":"11/honolulu,11/johnston,11/rarotonga,11/tahiti,us/hawaii,hst"},r=["africa","america","asia","atlantic","australia","brazil","canada","chile","europe","indian","mexico","pacific","antarctica","etc"];let o={};Object.keys(a).forEach((e=>{let t=e.split("|"),n={offset:Number(t[0]),hem:t[1]};t[2]&&(n.dst=t[2]),a[e].split(",").forEach((e=>{e=e.replace(/(^[0-9]+)\//,((e,t)=>(t=Number(t),r[t]+"/"))),o[e]=n}))})),o.utc={offset:0,hem:"n"};for(let e=-14;e<=14;e+=.5){let t=e;t>0&&(t="+"+t);let n="etc/gmt"+t;o[n]={offset:-1*e,hem:"n"},n="utc/gmt"+t,o[n]={offset:-1*e,hem:"n"}}var i=o;var s=()=>{let e=(()=>{if("undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;let e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;let t=e.resolvedOptions().timeZone;return t?t.toLowerCase():null})();return null===e?"utc":e};const u=/(\-?[0-9]+)h(rs)?/i,l=/(\-?[0-9]+)/,c=/utc([\-+]?[0-9]+)/i,h=/gmt([\-+]?[0-9]+)/i,d=function(e){return(e=Number(e))>=-13&&e<=13?"etc/gmt"+(e=((e*=-1)>0?"+":"")+e):null};var m=function(e){let t=e.match(u);if(null!==t)return d(t[1]);if(t=e.match(c),null!==t)return d(t[1]);if(t=e.match(h),null!==t){let e=-1*Number(t[1]);return d(e)}return t=e.match(l),null!==t?d(t[1]):null};let f=s();const p=Object.keys(i).reduce(((e,t)=>{let n=t.split("/")[1]||"";return n=n.replace(/_/g," "),e[n]=t,e}),{});var y=(e,t)=>{if(!e)return t.hasOwnProperty(f)||(console.warn(`Unrecognized IANA id '${f}'. Setting fallback tz to UTC.`),f="utc"),f;"string"!=typeof e&&console.error("Timezone must be a string - recieved: '",e,"'\n");let n=e.trim();if(n=n.toLowerCase(),!0===t.hasOwnProperty(n))return n;if(n=(e=>(e=(e=(e=(e=(e=e.replace(/ time/g,"")).replace(/ (standard|daylight|summer)/g,"")).replace(/\b(east|west|north|south)ern/g,"$1")).replace(/\b(africa|america|australia)n/g,"$1")).replace(/\beuropean/g,"europe")).replace(/\islands/g,"island"))(n),!0===t.hasOwnProperty(n))return n;if(!0===p.hasOwnProperty(n))return p[n];if(!0===/[0-9]/.test(n)){let e=m(n);if(e)return e}throw new Error("Spacetime: Cannot find timezone named: '"+e+"'. Please enter an IANA timezone id.")};function g(e){return e%4==0&&e%100!=0||e%400==0}function b(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.valueOf())}function k(e){return"[object Object]"===Object.prototype.toString.call(e)}function w(e,t=2){return(e+="").length>=t?e:new Array(t-e.length+1).join("0")+e}function v(e){let t=e%10,n=e%100;return 1===t&&11!==n?e+"st":2===t&&12!==n?e+"nd":3===t&&13!==n?e+"rd":e+"th"}function _(e){return e=(e=String(e)).replace(/([0-9])(st|nd|rd|th)$/i,"$1"),parseInt(e,10)}function j(e=""){return"day"===(e=(e=(e=(e=e.toLowerCase().trim()).replace(/ies$/,"y")).replace(/s$/,"")).replace(/-/g,""))||"days"===e?"date":"min"===e||"mins"===e?"minute":e}function $(e){return"number"==typeof e?e:b(e)?e.getTime():e.epoch?e.epoch:null}function z(e,t){return!1===k(e)?t.clone().set(e):e}function O(e,t=""){const n=e>0?"+":"-",a=Math.abs(e);return`${n}${w(parseInt(""+a,10))}${t}${w(a%1*60)}`}const D={year:(new Date).getFullYear(),month:0,date:1};var M={parseArray:(e,t,n)=>{if(0===t.length)return e;let a=["year","month","date","hour","minute","second","millisecond"];for(let r=0;r{if(0===Object.keys(t).length)return e;t=Object.assign({},D,n,t);let a=Object.keys(t);for(let r=0;r0&&t<25e8&&!1===e.silent&&(console.warn(" - Warning: You are setting the date to January 1970."),console.warn(" - did input seconds instead of milliseconds?")),e.epoch=t,e}};const S=function(e){return e.epoch=Date.now(),Object.keys(e._today||{}).forEach((t=>{"function"==typeof e[t]&&(e=e[t](e._today[t]))})),e},q={now:e=>S(e),today:e=>S(e),tonight:e=>e=(e=S(e)).hour(18),tomorrow:e=>e=(e=(e=S(e)).add(1,"day")).startOf("day"),yesterday:e=>e=(e=(e=S(e)).subtract(1,"day")).startOf("day"),christmas:e=>{let t=S(e).year();return e=e.set([t,11,25,18,0,0])},"new years":e=>{let t=S(e).year();return e=e.set([t,11,31,18,0,0])}};q["new years eve"]=q["new years"];var N=q;var I=function(e){return e=(e=(e=(e=e.replace(/\b(mon|tues?|wed|wednes|thur?s?|fri|sat|satur|sun)(day)?\b/i,"")).replace(/([0-9])(th|rd|st|nd)/,"$1")).replace(/,/g,"")).replace(/ +/g," ").trim()};let E={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5};E.date=E.day,E.month=25488e5,E.week=6048e5,E.year=3154e7,Object.keys(E).forEach((e=>{E[e+"s"]=E[e]}));var T=E;const C=(e,t,n,a,r)=>{let o=e.d[n]();if(o===t)return;let i=null===r?null:e.d[r](),s=e.epoch,u=t-o;e.epoch+=T[a]*u,"day"===a&&Math.abs(u)>28&&t<28&&(e.epoch+=T.hour),null!==r&&i!==e.d[r]()&&(e.epoch=s);const l=T[a]/2;for(;e.d[n]()t;)e.epoch-=l;null!==r&&i!==e.d[r]()&&(e.epoch=s)},A={year:{valid:e=>e>-4e3&&e<4e3,walkTo:(e,t)=>C(e,t,"getFullYear","year",null)},month:{valid:e=>e>=0&&e<=11,walkTo:(e,t)=>{let n=e.d,a=n.getMonth(),r=e.epoch,o=n.getFullYear();if(a===t)return;let i=t-a;for(e.epoch+=T.day*(28*i),o!==e.d.getFullYear()&&(e.epoch=r);e.d.getMonth()t;)e.epoch-=T.day}},date:{valid:e=>e>0&&e<=31,walkTo:(e,t)=>C(e,t,"getDate","day","getMonth")},hour:{valid:e=>e>=0&&e<24,walkTo:(e,t)=>C(e,t,"getHours","hour","getDate")},minute:{valid:e=>e>=0&&e<60,walkTo:(e,t)=>C(e,t,"getMinutes","minute","getHours")},second:{valid:e=>e>=0&&e<60,walkTo:(e,t)=>{e.epoch=e.seconds(t).epoch}},millisecond:{valid:e=>e>=0&&e<1e3,walkTo:(e,t)=>{e.epoch=e.milliseconds(t).epoch}}};var Y=(e,t)=>{let n=Object.keys(A),a=e.clone();for(let r=0;r{if(!t)return e;let n=0;if(/^[\+-]?[0-9]{2}:[0-9]{2}$/.test(t)&&(!0===/:00/.test(t)&&(t=t.replace(/:00/,"")),!0===/:30/.test(t)&&(t=t.replace(/:30/,".5"))),/^[\+-]?[0-9]{4}$/.test(t)&&(t=t.replace(/30$/,".5")),n=parseFloat(t),Math.abs(n)>100&&(n/=100),0===n||"Z"===t||"z"===t)return e.tz="etc/gmt",e;n*=-1,n>=0&&(n="+"+n);let a="etc/gmt"+n;return e.timezones[a]&&(e.tz=a),e};var Z=(e,t="")=>{let n=(t=t.replace(/^\s+/,"").toLowerCase()).match(/([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?[:\.]?([0-9]{1,4})?/);if(null!==n){let a=Number(n[1]);if(a<0||a>24)return e.startOf("day");let r=Number(n[2]);if(n[2].length<2||r<0||r>59)return e.startOf("day");e=(e=(e=(e=e.hour(a)).minute(r)).seconds(n[3]||0)).millisecond(function(e=""){return(e=String(e)).length>3?e=e.substr(0,3):1===e.length?e+="00":2===e.length&&(e+="0"),Number(e)||0}(n[4]));let o=t.match(/[\b0-9] ?(am|pm)\b/);return null!==o&&o[1]&&(e=e.ampm(o[1])),e}if(n=t.match(/([0-9]+) ?(am|pm)/),null!==n&&n[1]){let t=Number(n[1]);return t>12||t<1?e.startOf("day"):e=(e=(e=e.hour(n[1]||0)).ampm(n[2])).startOf("hour")}return e=e.startOf("day")};let U=B();const Q=e=>{if(!0!==x.hasOwnProperty(e.month))return!1;if(1===e.month)return!!(g(e.year)&&e.date<=29)||e.date<=28;let t=x[e.month]||0;return e.date<=t},G=(e="",t)=>{if(e=e.trim(),!0===/^'[0-9][0-9]$/.test(e)){let t=Number(e.replace(/'/,""));return t>50?1900+t:2e3+t}let n=parseInt(e,10);return!n&&t&&(n=t.year),n=n||(new Date).getFullYear(),n},V=function(e){return"sept"===(e=e.toLowerCase().trim())?U.sep:U[e]};var W=[{reg:/^([0-9]{1,2})[\-\/.]([0-9]{1,2})[\-\/.]?([0-9]{4})?( [0-9]{1,2}:[0-9]{2}:?[0-9]{0,2}? ?(am|pm|gmt))?$/i,parse:(e,t)=>{let n=parseInt(t[1],10)-1,a=parseInt(t[2],10);(e.british||n>=12)&&(a=parseInt(t[1],10),n=parseInt(t[2],10)-1);let r={date:a,month:n,year:G(t[3],e._today)||(new Date).getFullYear()};return!1===Q(r)?(e.epoch=null,e):(Y(e,r),e=Z(e,t[4]))}},{reg:/^([a-z]+)[\-\/\. ]([0-9]{1,2})[\-\/\. ]?([0-9]{4}|'[0-9]{2})?( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[1]),date:_(t[2]||"")};return!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=Z(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2})( [0-9]{4})?( ([0-9:]+( ?am| ?pm| ?gmt)?))?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[1]),date:_(t[2]||"")};return!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=Z(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2})( [0-9:]+)?( \+[0-9]{4})?( [0-9]{4})?$/i,parse:(e,t)=>{let n={year:G(t[5],e._today),month:V(t[1]),date:_(t[2]||"")};return!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=Z(e,t[3]))}}],J=[{reg:/^([0-9]{4})[\-\/]([0-9]{2})$/i,parse:(e,t)=>{let n={year:t[1],month:parseInt(t[2],10)-1,date:1};return!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=Z(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{4})$/i,parse:(e,t)=>{let n={year:G(t[2],e._today),month:V(t[1]),date:e._today.date||1};return!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=Z(e,t[4]))}},{reg:/^(q[0-9])( of)?( [0-9]{4})?/i,parse:(e,t)=>{let n=t[1]||"";e=e.quarter(n);let a=t[3]||"";return a&&(a=a.trim(),e=e.year(a)),e}},{reg:/^(spring|summer|winter|fall|autumn)( of)?( [0-9]{4})?/i,parse:(e,t)=>{let n=t[1]||"";e=e.season(n);let a=t[3]||"";return a&&(a=a.trim(),e=e.year(a)),e}},{reg:/^[0-9,]+ ?b\.?c\.?$/i,parse:(e,t)=>{let n=t[0]||"";n=n.replace(/^([0-9,]+) ?b\.?c\.?$/i,"-$1");let a=new Date,r={year:parseInt(n.trim(),10),month:a.getMonth(),date:a.getDate()};return!1===Q(r)?(e.epoch=null,e):(Y(e,r),e=Z(e))}},{reg:/^[0-9,]+ ?(a\.?d\.?|c\.?e\.?)$/i,parse:(e,t)=>{let n=t[0]||"";n=n.replace(/,/g,"");let a=new Date,r={year:parseInt(n.trim(),10),month:a.getMonth(),date:a.getDate()};return!1===Q(r)?(e.epoch=null,e):(Y(e,r),e=Z(e))}},{reg:/^[0-9]{4}( ?a\.?d\.?)?$/i,parse:(e,t)=>{let n=e._today;n.month&&!n.date&&(n.date=1);let a=new Date,r={year:G(t[0],n),month:n.month||a.getMonth(),date:n.date||a.getDate()};return!1===Q(r)?(e.epoch=null,e):(Y(e,r),e=Z(e))}}],K=[].concat([{reg:/^(\-?0?0?[0-9]{3,4})-([0-9]{1,2})-([0-9]{1,2})[T| ]([0-9.:]+)(Z|[0-9\-\+:]+)?$/i,parse:(e,t)=>{let n={year:t[1],month:parseInt(t[2],10)-1,date:t[3]};return!1===Q(n)?(e.epoch=null,e):(H(e,t[5]),Y(e,n),e=Z(e,t[4]))}},{reg:/^([0-9]{4})[\-\/\. ]([0-9]{1,2})[\-\/\. ]([0-9]{1,2})( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={year:t[1],month:parseInt(t[2],10)-1,date:parseInt(t[3],10)};return n.month>=12&&(n.date=parseInt(t[2],10),n.month=parseInt(t[3],10)-1),!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=Z(e,t[4]))}},{reg:/^([0-9]{4})[\-\/\. ]([a-z]+)[\-\/\. ]([0-9]{1,2})( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={year:G(t[1],e._today),month:V(t[2]),date:_(t[3]||"")};return!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=Z(e,t[4]))}}],W,[{reg:/^([0-9]{1,2})[\-\/]([a-z]+)[\-\/]?([0-9]{4})?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[2]),date:_(t[1]||"")};return!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=Z(e,t[4]))}},{reg:/^([0-9]{1,2})( [a-z]+)( [0-9]{4}| '[0-9]{2})? ?([0-9]{1,2}:[0-9]{2}:?[0-9]{0,2}? ?(am|pm|gmt))?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[2]),date:_(t[1])};return n.month&&!1!==Q(n)?(Y(e,n),e=Z(e,t[4])):(e.epoch=null,e)}},{reg:/^([0-9]{1,2})[\. -/]([a-z]+)[\. -/]([0-9]{4})?( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={date:Number(t[1]),month:V(t[2]),year:Number(t[3])};return!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=e.startOf("day"),e=Z(e,t[4]))}}],J);var R=function(e,t,n){for(let a=0;a{let n=e._today||ne;if("number"==typeof t)return te(e,t);if(e.epoch=Date.now(),e._today&&k(e._today)&&Object.keys(e._today).length>0){let t=ee(e,n,ne);t.isValid()&&(e.epoch=t.epoch)}return null==t||""===t?e:!0===b(t)?(e.epoch=t.getTime(),e):!0===function(e){return"[object Array]"===Object.prototype.toString.call(e)}(t)?e=X(e,t,n):!0===k(t)?t.epoch?(e.epoch=t.epoch,e.tz=t.tz,e):e=ee(e,t,n):"string"!=typeof t?e:(t=I(t),!0===N.hasOwnProperty(t)?e=N[t](e):R(e,t))};let re=["sun","mon","tue","wed","thu","fri","sat"],oe=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function ie(){return re}function se(){return oe}const ue={mo:1,tu:2,we:3,th:4,fr:5,sa:6,su:7,tues:2,weds:3,wedn:3,thur:4,thurs:4};let le=!0;var ce=e=>{let t=e.timezone().current.offset;return t?O(t,":"):"Z"};const he=e=>le?function(e){return e?e[0].toUpperCase()+e.substr(1):""}(e):e,de={day:e=>he(e.dayName()),"day-short":e=>he(ie()[e.day()]),"day-number":e=>e.day(),"day-ordinal":e=>v(e.day()),"day-pad":e=>w(e.day()),date:e=>e.date(),"date-ordinal":e=>v(e.date()),"date-pad":e=>w(e.date()),month:e=>he(e.monthName()),"month-short":e=>he(L()[e.month()]),"month-number":e=>e.month(),"month-ordinal":e=>v(e.month()),"month-pad":e=>w(e.month()),"iso-month":e=>w(e.month()+1),year:e=>{let t=e.year();return t>0?t:(t=Math.abs(t),t+" BC")},"year-short":e=>{let t=e.year();return t>0?`'${String(e.year()).substr(2,4)}`:(t=Math.abs(t),t+" BC")},"iso-year":e=>{let t=e.year(),n=t<0,a=w(Math.abs(t),4);return n&&(a=w(a,6),a="-"+a),a},time:e=>e.time(),"time-24":e=>`${e.hour24()}:${w(e.minute())}`,hour:e=>e.hour12(),"hour-pad":e=>w(e.hour12()),"hour-24":e=>e.hour24(),"hour-24-pad":e=>w(e.hour24()),minute:e=>e.minute(),"minute-pad":e=>w(e.minute()),second:e=>e.second(),"second-pad":e=>w(e.second()),millisecond:e=>e.millisecond(),"millisecond-pad":e=>w(e.millisecond(),3),ampm:e=>e.ampm(),AMPM:e=>e.ampm().toUpperCase(),quarter:e=>"Q"+e.quarter(),season:e=>e.season(),era:e=>e.era(),json:e=>e.json(),timezone:e=>e.timezone().name,offset:e=>ce(e),numeric:e=>`${e.year()}/${w(e.month()+1)}/${w(e.date())}`,"numeric-us":e=>`${w(e.month()+1)}/${w(e.date())}/${e.year()}`,"numeric-uk":e=>`${w(e.date())}/${w(e.month()+1)}/${e.year()}`,"mm/dd":e=>`${w(e.month()+1)}/${w(e.date())}`,iso:e=>`${e.format("iso-year")}-${w(e.month()+1)}-${w(e.date())}T${w(e.h24())}:${w(e.minute())}:${w(e.second())}.${w(e.millisecond(),3)}${ce(e)}`,"iso-short":e=>{let t=w(e.month()+1),n=w(e.date());var a;return`${(a=e.year())>=0?w(a,4):"-"+w(a=Math.abs(a),4)}-${t}-${n}`},"iso-utc":e=>new Date(e.epoch).toISOString(),nice:e=>`${L()[e.month()]} ${v(e.date())}, ${e.time()}`,"nice-24":e=>`${L()[e.month()]} ${v(e.date())}, ${e.hour24()}:${w(e.minute())}`,"nice-year":e=>`${L()[e.month()]} ${v(e.date())}, ${e.year()}`,"nice-day":e=>`${ie()[e.day()]} ${he(L()[e.month()])} ${v(e.date())}`,"nice-full":e=>`${e.dayName()} ${he(e.monthName())} ${v(e.date())}, ${e.time()}`,"nice-full-24":e=>`${e.dayName()} ${he(e.monthName())} ${v(e.date())}, ${e.hour24()}:${w(e.minute())}`},me={"day-name":"day","month-name":"month","iso 8601":"iso","time-h24":"time-24","time-12":"time","time-h12":"time",tz:"timezone","day-num":"day-number","month-num":"month-number","month-iso":"iso-month","year-iso":"iso-year","nice-short":"nice","nice-short-24":"nice-24",mdy:"numeric-us",dmy:"numeric-uk",ymd:"numeric","yyyy/mm/dd":"numeric","mm/dd/yyyy":"numeric-us","dd/mm/yyyy":"numeric-us","little-endian":"numeric-uk","big-endian":"numeric","day-nice":"nice-day"};Object.keys(me).forEach((e=>de[e]=de[me[e]]));var fe=(e,t="")=>{if(!0!==e.isValid())return"";if(de.hasOwnProperty(t)){let n=de[t](e)||"";return"json"!==t&&(n=String(n),"ampm"!==t.toLowerCase()&&(n=he(n))),n}if(-1!==t.indexOf("{")){let n=/\{(.+?)\}/g;return t=t.replace(n,((t,n)=>{if(n=n.toLowerCase().trim(),de.hasOwnProperty(n)){let t=String(de[n](e));return"ampm"!==n.toLowerCase()?he(t):t}return""})),t}return e.format("iso-short")};const pe={G:e=>e.era(),GG:e=>e.era(),GGG:e=>e.era(),GGGG:e=>"AD"===e.era()?"Anno Domini":"Before Christ",y:e=>e.year(),yy:e=>w(Number(String(e.year()).substr(2,4))),yyy:e=>e.year(),yyyy:e=>e.year(),yyyyy:e=>"0"+e.year(),Q:e=>e.quarter(),QQ:e=>e.quarter(),QQQ:e=>e.quarter(),QQQQ:e=>e.quarter(),M:e=>e.month()+1,MM:e=>w(e.month()+1),MMM:e=>e.format("month-short"),MMMM:e=>e.format("month"),w:e=>e.week(),ww:e=>w(e.week()),d:e=>e.date(),dd:e=>w(e.date()),D:e=>e.dayOfYear(),DD:e=>w(e.dayOfYear()),DDD:e=>w(e.dayOfYear(),3),E:e=>e.format("day-short"),EE:e=>e.format("day-short"),EEE:e=>e.format("day-short"),EEEE:e=>e.format("day"),EEEEE:e=>e.format("day")[0],e:e=>e.day(),ee:e=>e.day(),eee:e=>e.format("day-short"),eeee:e=>e.format("day"),eeeee:e=>e.format("day")[0],a:e=>e.ampm().toUpperCase(),aa:e=>e.ampm().toUpperCase(),aaa:e=>e.ampm().toUpperCase(),aaaa:e=>e.ampm().toUpperCase(),h:e=>e.h12(),hh:e=>w(e.h12()),H:e=>e.hour(),HH:e=>w(e.hour()),m:e=>e.minute(),mm:e=>w(e.minute()),s:e=>e.second(),ss:e=>w(e.second()),SSS:e=>w(e.millisecond(),3),A:e=>e.epoch-e.startOf("day").epoch,z:e=>e.timezone().name,zz:e=>e.timezone().name,zzz:e=>e.timezone().name,zzzz:e=>e.timezone().name,Z:e=>O(e.timezone().current.offset),ZZ:e=>O(e.timezone().current.offset),ZZZ:e=>O(e.timezone().current.offset),ZZZZ:e=>O(e.timezone().current.offset,":")},ye=(e,t,n)=>{let a=e,r=t;for(let o=0;o{let n=t.split("");return n=function(e){for(let t=0;te))}(n),n=function(e){for(let t=0;te))).map((e=>("''"===e&&(e="'"),e)))}(n),n.reduce(((t,n)=>(void 0!==pe[n]?t+=pe[n](e)||"":(/^'.{1,}'$/.test(n)&&(n=n.replace(/'/g,"")),t+=n),t)),"")};const be=["year","season","quarter","month","week","day","quarterHour","hour","minute"],ke=function(e,t){let n=e.clone().startOf(t),a=e.clone().endOf(t).epoch-n.epoch,r=(e.epoch-n.epoch)/a;return parseFloat(r.toFixed(2))};var we=(e,t)=>{if(t)return t=j(t),ke(e,t);let n={};return be.forEach((t=>{n[t]=ke(e,t)})),n};var ve=(e,t)=>{let n=e.progress();return"quarterhour"===(t=j(t))&&(t="quarterHour"),void 0!==n[t]?(n[t]>.5&&(e=e.add(1,t)),e=e.startOf(t)):!1===e.silent&&console.warn("no known unit '"+t+"'"),e};const _e=(e,t,n)=>{let a=0;for(e=e.clone();e.isBefore(t);)e=e.add(1,n),a+=1;return e.isAfter(t,n)&&(a-=1),a};var je=(e,t,n)=>e.isBefore(t)?_e(e,t,n):-1*_e(t,e,n);var $e=function(e,t){let n=t.epoch-e.epoch,a={milliseconds:n,seconds:parseInt(n/1e3,10)};a.minutes=parseInt(a.seconds/60,10),a.hours=parseInt(a.minutes/60,10);let r=e.clone();return a.years=((e,t)=>{let n=t.year()-e.year();return(e=e.year(t.year())).isAfter(t)&&(n-=1),n})(r,t),r=e.add(a.years,"year"),a.months=12*a.years,r=e.add(a.months,"month"),a.months+=je(r,t,"month"),a.quarters=4*a.years,a.quarters+=parseInt(a.months%12/3,10),a.weeks=52*a.years,r=e.add(a.weeks,"week"),a.weeks+=je(r,t,"week"),a.days=7*a.weeks,r=e.add(a.days,"day"),a.days+=je(r,t,"day"),a};var ze=function(e,t,n){t=z(t,e);let a=!1;if(e.isAfter(t)){let n=e;e=t,t=n,a=!0}let r=$e(e,t);return a&&(r=function(e){return Object.keys(e).forEach((t=>{e[t]*=-1})),e}(r)),n?(n=j(n),!0!==/s$/.test(n)&&(n+="s"),"dates"===n&&(n="days"),r[n]):r};const Oe=e=>Math.abs(e)||0;var De=function(e){let t="P";return t+=Oe(e.years)+"Y",t+=Oe(e.months)+"M",t+=Oe(e.days)+"DT",t+=Oe(e.hours)+"H",t+=Oe(e.minutes)+"M",t+=Oe(e.seconds)+"S",t};let Me={second:"second",seconds:"seconds",minute:"minute",minutes:"minutes",hour:"hour",hours:"hours",day:"day",days:"days",month:"month",months:"months",year:"year",years:"years"};function Se(e){return Me[e]||""}let qe="past",Ne="future",Ie="present",Ee="now",Te="almost",Ce="over",Ae=e=>`${e} ago`,Ye=e=>`in ${e}`;function xe(e){return Ae(e)}function Fe(e){return Ye(e)}function Pe(){return Ee}const Le={months:{almost:10,over:4},days:{almost:25,over:10},hours:{almost:20,over:8},minutes:{almost:50,over:20},seconds:{almost:50,over:20}};function Be(e,t){return 1===e?e+" "+Se(t.slice(0,-1)):e+" "+Se(t)}var He=function(e){let t=null,n=null,a=[],r=[];return Object.keys(e).forEach(((o,i,s)=>{const u=Math.abs(e[o]);if(0===u)return;a.push(u+o[0]);const l=Be(u,o);if(r.push(l),!t){if(t=n=l,i>4)return;const a=s[i+1],r=Math.abs(e[a]);r>Le[a].almost?(t=Be(u+1,o),n=Te+" "+t):r>Le[a].over&&(n=Ce+" "+l)}})),{qualified:n,rounded:t,abbreviated:a,englishValues:r}};var Ze=(e,t)=>{const n=function(e,t){const n=e.isBefore(t),a=n?t:e;let r=n?e:t;r=r.clone();const o={years:0,months:0,days:0,hours:0,minutes:0,seconds:0};return Object.keys(o).forEach((e=>{if(r.isSame(a,e))return;let t=r.diff(a,e);r=r.add(t,e),o[e]=t})),n&&Object.keys(o).forEach((e=>{0!==o[e]&&(o[e]*=-1)})),o}(e,t=z(t,e));if(!0===Object.keys(n).every((e=>!n[e])))return{diff:n,rounded:Pe(),qualified:Pe(),precise:Pe(),abbreviated:[],iso:"P0Y0M0DT0H0M0S",direction:Ie};let a,r=Ne,{rounded:o,qualified:i,englishValues:s,abbreviated:u}=He(n);a=s.splice(0,2).join(", "),!0===e.isAfter(t)?(o=xe(o),i=xe(i),a=xe(a),r=qe):(o=Fe(o),i=Fe(i),a=Fe(a));let l=De(n);return{diff:n,rounded:o,qualified:i,precise:a,abbreviated:u,iso:l,direction:r}};var Ue={north:[["spring",2,1],["summer",5,1],["fall",8,1],["autumn",8,1],["winter",11,1]],south:[["fall",2,1],["autumn",2,1],["winter",5,1],["spring",8,1],["summer",11,1]]},Qe=[null,[0,1],[3,1],[6,1],[9,1]];const Ge={second:e=>(Y(e,{millisecond:0}),e),minute:e=>(Y(e,{second:0,millisecond:0}),e),quarterhour:e=>{let t=e.minutes();return e=t>=45?e.minutes(45):t>=30?e.minutes(30):t>=15?e.minutes(15):e.minutes(0),Y(e,{second:0,millisecond:0}),e},hour:e=>(Y(e,{minute:0,second:0,millisecond:0}),e),day:e=>(Y(e,{hour:0,minute:0,second:0,millisecond:0}),e),week:e=>{let t=e.clone();return(e=e.day(e._weekStart)).isAfter(t)&&(e=e.subtract(1,"week")),Y(e,{hour:0,minute:0,second:0,millisecond:0}),e},month:e=>(Y(e,{date:1,hour:0,minute:0,second:0,millisecond:0}),e),quarter:e=>{let t=e.quarter();return Qe[t]&&Y(e,{month:Qe[t][0],date:Qe[t][1],hour:0,minute:0,second:0,millisecond:0}),e},season:e=>{let t=e.season(),n="north";"South"===e.hemisphere()&&(n="south");for(let a=0;a(Y(e,{month:0,date:1,hour:0,minute:0,second:0,millisecond:0}),e),decade:e=>{let t=(e=e.startOf("year")).year(),n=10*parseInt(t/10,10);return e=e.year(n)},century:e=>{let t=(e=e.startOf("year")).year(),n=100*parseInt(t/100,10);return e=e.year(n)}};Ge.date=Ge.day;var Ve=function(e,t,n){if(!t||!n)return[];if(t=j(t),n=e.clone().set(n),e.isAfter(n)){let t=e;e=n,n=t}let a=e.clone();if(function(e){return!!ie().find((t=>t===e))||!!se().find((t=>t===e))}(t))a=a.next(t),t="week";else{a.startOf(t).isBefore(e)&&(a=a.next(t))}let r=[];for(;a.isBefore(n);)r.push(a),a=a.add(1,t);return r};var We=e=>{let n=e.timezones,a=e.tz;if(!1===n.hasOwnProperty(a)&&(a=y(e.tz,n)),null===a)return!1===e.silent&&console.warn("Warn: could not find given or local timezone - '"+e.tz+"'"),{current:{epochShift:0}};let r=n[a],o={name:(i=a,i=(i=(i=(i=(i=(i=(i=i[0].toUpperCase()+i.substr(1)).replace(/[\/_-]([a-z])/gi,(e=>e.toUpperCase()))).replace(/_(of|es)_/i,(e=>e.toLowerCase()))).replace(/\/gmt/i,"/GMT")).replace(/\/Dumontdurville$/i,"/DumontDUrville")).replace(/\/Mcmurdo$/i,"/McMurdo")).replace(/\/Port-au-prince$/i,"/Port-au-Prince")),hasDst:Boolean(r.dst),default_offset:r.offset,hemisphere:"s"===r.hem?"South":"North",current:{}};var i,s;if(o.hasDst){let e=(s=r.dst)?s.split("->"):[];o.change={start:e[0],back:e[1]}}let u=r.offset,l=u;return!0===o.hasDst&&(l="North"===o.hemisphere?u-1:r.offset+1),!1===o.hasDst?(o.current.offset=u,o.current.isDST=!1):!0===t(e.epoch,o.change.start,o.change.back,u,l)?(o.current.offset=u,o.current.isDST="North"===o.hemisphere):(o.current.offset=l,o.current.isDST="South"===o.hemisphere),o};const Je=["century","decade","year","month","date","day","hour","minute","second","millisecond"],Ke={set:function(e,t){let n=this.clone();return n=ae(n,e),t&&(this.tz=y(t)),n},timezone:function(){return We(this)},isDST:function(){return We(this).current.isDST},hasDST:function(){return We(this).hasDst},offset:function(){return 60*We(this).current.offset},hemisphere:function(){return We(this).hemisphere},format:function(e){return fe(this,e)},unixFmt:function(e){return ge(this,e)},startOf:function(e){return((e,t)=>{let n=e.clone();return t=j(t),Ge[t]?Ge[t](n):"summer"===t||"winter"===t?(n=n.season(t),Ge.season(n)):n})(this,e)},endOf:function(e){return((e,t)=>{let n=e.clone();return t=j(t),Ge[t]?(n=Ge[t](n),n=n.add(1,t),n=n.subtract(1,"millisecond"),n):n})(this,e)},leapYear:function(){return g(this.year())},progress:function(e){return we(this,e)},nearest:function(e){return ve(this,e)},diff:function(e,t){return ze(this,e,t)},since:function(e){return e||(e=this.clone().set()),Ze(this,e)},next:function(e){return this.add(1,e).startOf(e)},last:function(e){return this.subtract(1,e).startOf(e)},isValid:function(){return!(!this.epoch&&0!==this.epoch)&&!isNaN(this.d.getTime())},goto:function(e){let t=this.clone();return t.tz=y(e,t.timezones),t},every:function(e,t){if("object"==typeof e&&"string"==typeof t){let n=t;t=e,e=n}return Ve(this,e,t)},isAwake:function(){let e=this.hour();return!(e<8||e>22)},isAsleep:function(){return!this.isAwake()},daysInMonth:function(){switch(this.month()){case 0:case 2:case 4:case 6:case 7:case 9:case 11:return 31;case 1:return this.leapYear()?29:28;case 3:case 5:case 8:case 10:return 30;default:throw new Error("Invalid Month state.")}},log:function(){return console.log(""),console.log(fe(this,"nice-short")),this},logYear:function(){return console.log(""),console.log(fe(this,"full-short")),this},json:function(){return Je.reduce(((e,t)=>(e[t]=this[t](),e)),{})},debug:function(){let e=this.timezone(),t=this.format("MM")+" "+this.format("date-ordinal")+" "+this.year();return t+="\n - "+this.format("time"),console.log("\n\n",t+"\n - "+e.name+" ("+e.current.offset+")"),this},from:function(e){return(e=this.clone().set(e)).since(this)},fromNow:function(){return this.clone().set(Date.now()).since(this)},weekStart:function(e){if("number"==typeof e)return this._weekStart=e,this;if("string"==typeof e){e=e.toLowerCase().trim();let t=ie().indexOf(e);-1===t&&(t=se().indexOf(e)),-1===t&&(t=1),this._weekStart=t}else console.warn("Spacetime Error: Cannot understand .weekStart() input:",e);return this}};Ke.inDST=Ke.isDST,Ke.round=Ke.nearest,Ke.each=Ke.every;var Re=Ke;const Xe=e=>("string"==typeof e&&(e=parseInt(e,10)),e),et=["year","month","date","hour","minute","second","millisecond"],tt=(e,t,n)=>{let a=et.indexOf(n),r=et.slice(a,et.length);for(let n=0;n=24?t=24:t<0&&(t=0);let a=e.clone(),r=e.hour()-t,o=r*T.hour;return e.epoch-=o,e.date()!==a.date()&&(e=a.clone(),r>1&&(r-=1),r<1&&(r+=1),o=r*T.hour,e.epoch-=o),Y(e,{hour:t}),tt(e,a,"minute"),(e=nt(e,a,n,"day")).epoch},ot=function(e,t){return"string"==typeof t&&/^'[0-9]{2}$/.test(t)&&(t=t.replace(/'/,"").trim(),t=(t=Number(t))>30?1900+t:2e3+t),t=Xe(t),Y(e,{year:t}),e.epoch};let it="am",st="pm";const ut={millisecond:function(e){if(void 0!==e){let t=this.clone();return t.epoch=function(e,t){t=Xe(t);let n=e.millisecond()-t;return e.epoch-n}(t,e),t}return this.d.getMilliseconds()},second:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){t=Xe(t);let a=e.clone(),r=(e.second()-t)*T.second;return e.epoch=e.epoch-r,(e=nt(e,a,n,"minute")).epoch}(n,e,t),n}return this.d.getSeconds()},minute:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=at(n,e,t),n}return this.d.getMinutes()},hour:function(e,t){let n=this.d;if(void 0!==e){let n=this.clone();return n.epoch=rt(n,e,t),n}return n.getHours()},hourFloat:function(e,t){if(void 0!==e){let n=this.clone(),a=e%1;a*=60;let r=parseInt(e,10);return n.epoch=rt(n,r,t),n.epoch=at(n,a,t),n}let n=this.d,a=n.getHours(),r=n.getMinutes();return r/=60,a+r},hour12:function(e,t){let n=this.d;if(void 0!==e){let n=this.clone(),a=(e=""+e).match(/^([0-9]+)(am|pm)$/);if(a){let e=parseInt(a[1],10);"pm"===a[2]&&(e+=12),n.epoch=rt(n,e,t)}return n}let a=n.getHours();return a>12&&(a-=12),0===a&&(a=12),a},time:function(e,t){if(void 0!==e){let n=this.clone();return e=e.toLowerCase().trim(),n.epoch=function(e,t,n){let a=t.match(/([0-9]{1,2})[:h]([0-9]{1,2})(:[0-9]{1,2})? ?(am|pm)?/);if(!a){if(a=t.match(/([0-9]{1,2}) ?(am|pm)/),!a)return e.epoch;a.splice(2,0,"0"),a.splice(3,0,"")}let r=!1,o=parseInt(a[1],10),i=parseInt(a[2],10);i>=60&&(i=59),o>12&&(r=!0),!1===r&&("am"===a[4]&&12===o&&(o=0),"pm"===a[4]&&o<12&&(o+=12)),a[3]=a[3]||"",a[3]=a[3].replace(/:/,"");let s=parseInt(a[3],10)||0,u=e.clone();return e=(e=(e=(e=e.hour(o)).minute(i)).second(s)).millisecond(0),(e=nt(e,u,n,"day")).epoch}(n,e,t),n}return`${this.h12()}:${w(this.minute())}${this.ampm()}`},ampm:function(e,t){let n=it,a=this.hour();if(a>=12&&(n=st),"string"!=typeof e)return n;let r=this.clone();return e=e.toLowerCase().trim(),a>=12&&"am"===e?(a-=12,r.hour(a,t)):a<12&&"pm"===e?(a+=12,r.hour(a,t)):r},dayTime:function(e,t){if(void 0!==e){const n={morning:"7:00",breakfast:"7:00",noon:"12:00",lunch:"12:00",afternoon:"14:00",evening:"18:00",dinner:"18:00",night:"23:00",midnight:"00:00"};let a=this.clone();return e=(e=e||"").toLowerCase(),!0===n.hasOwnProperty(e)&&(a=a.time(n[e],t)),a}let n=this.hour();return n<6?"night":n<12?"morning":n<17?"afternoon":n<22?"evening":"night"},iso:function(e){return void 0!==e?this.set(e):this.format("iso")}};var lt=ut;const ct={date:function(e,t){if(void 0!==e){let n=this.clone();return(e=parseInt(e,10))&&(n.epoch=function(e,t,n){if((t=Xe(t))>28){let n=e.month(),a=x[n];1===n&&29===t&&g(e.year())&&(a=29),t>a&&(t=a)}t<=0&&(t=1);let a=e.clone();return Y(e,{date:t}),(e=nt(e,a,n,"month")).epoch}(n,e,t)),n}return this.d.getDate()},day:function(e,t){if(void 0===e)return this.d.getDay();let n=this.clone(),a=e;"string"==typeof e&&(e=e.toLowerCase(),ue.hasOwnProperty(e)?a=ue[e]:(a=ie().indexOf(e),-1===a&&(a=se().indexOf(e))));let r=this.d.getDay()-a;!0===t&&r>0&&(r-=7),!1===t&&r<0&&(r+=7);let o=this.subtract(r,"days");return Y(o,{hour:n.hour(),minute:n.minute(),second:n.second()}),o},dayName:function(e,t){if(void 0===e)return se()[this.day()];let n=this.clone();return n=n.day(e,t),n}};var ht=ct;const dt=e=>e=(e=(e=e.minute(0)).second(0)).millisecond(1),mt={dayOfYear:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){t=Xe(t);let a=e.clone();return(t-=1)<=0?t=0:t>=365&&(t=g(e.year())?365:364),e=(e=e.startOf("year")).add(t,"day"),tt(e,a,"hour"),(e=nt(e,a,n,"year")).epoch}(n,e,t),n}let n,a=0,r=this.d.getMonth();for(let e=1;e<=r;e++)n=new Date,n.setDate(1),n.setFullYear(this.d.getFullYear()),n.setHours(1),n.setMinutes(1),n.setMonth(e),n.setHours(-2),a+=n.getDate();return a+this.d.getDate()},week:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){let a=e.clone();return t=Xe(t),"december"===(e=(e=(e=e.month(0)).date(1)).day("monday")).monthName()&&e.date()>=28&&(e=e.add(1,"week")),t-=1,e=e.add(t,"weeks"),(e=nt(e,a,n,"year")).epoch}(this,e,t),n=dt(n),n}let n=this.clone();n=n.month(0),n=n.date(1),n=dt(n),n=n.day("monday"),11===n.month()&&n.date()>=25&&(n=n.add(1,"week"));let a=1;1===n.date()&&(a=0),n=n.minus(1,"second");const r=this.epoch;if(n.epoch>r)return 1;let o=0,i=4*this.month();for(n.epoch+=T.week*i,o+=i;o<=52;o++){if(n.epoch>r)return o+a;n=n.add(1,"week")}return 52},month:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){"string"==typeof t&&("sept"===t&&(t="sep"),t=B()[t.toLowerCase()]),(t=Xe(t))>=12&&(t=11),t<=0&&(t=0);let a=e.date();a>x[t]&&(a=x[t]);let r=e.clone();return Y(e,{month:t,d:a}),(e=nt(e,r,n,"year")).epoch}(n,e,t),n}return this.d.getMonth()},monthName:function(e,t){if(void 0!==e){let n=this.clone();return n=n.month(e,t),n}return P[this.month()]},quarter:function(e,t){if(void 0!==e&&("string"==typeof e&&(e=e.replace(/^q/i,""),e=parseInt(e,10)),Qe[e])){let n=this.clone(),a=Qe[e][0];return n=n.month(a,t),n=n.date(1,t),n=n.startOf("day"),n}let n=this.d.getMonth();for(let e=1;e=Ue[n][e][1]&&a0&&(t.epoch=ot(t,-1*n)),"ad"===e&&n<0&&(t.epoch=ot(t,-1*n)),t}return this.d.getFullYear()<0?"BC":"AD"},decade:function(e){if(void 0!==e){if(!(e=(e=(e=String(e)).replace(/([0-9])'?s$/,"$1")).replace(/([0-9])(th|rd|st|nd)/,"$1")))return console.warn("Spacetime: Invalid decade input"),this;2===e.length&&/[0-9][0-9]/.test(e)&&(e="19"+e);let t=Number(e);return isNaN(t)?this:(t=10*Math.floor(t/10),this.year(t))}return this.startOf("decade").year()},century:function(e){if(void 0!==e){"string"==typeof e&&(e=(e=(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1")).replace(/([0-9]+) ?(b\.?c\.?|a\.?d\.?)/i,((e,t,n)=>(n.match(/b\.?c\.?/i)&&(t="-"+t),t)))).replace(/c$/,""));let t=Number(e);return isNaN(e)?(console.warn("Spacetime: Invalid century input"),this):(0===t&&(t=1),t=t>=0?100*(t-1):100*(t+1),this.year(t))}let t=this.startOf("century").year();return t=Math.floor(t/100),t<0?t-1:t+1},millenium:function(e){if(void 0!==e){if("string"==typeof e&&(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1"),e=Number(e),isNaN(e)))return console.warn("Spacetime: Invalid millenium input"),this;e>0&&(e-=1);let t=1e3*e;return 0===t&&(t=1),this.year(t)}let t=Math.floor(this.year()/1e3);return t>=0&&(t+=1),t}};var ft=mt;const pt=Object.assign({},lt,ht,ft);pt.milliseconds=pt.millisecond,pt.seconds=pt.second,pt.minutes=pt.minute,pt.hours=pt.hour,pt.hour24=pt.hour,pt.h12=pt.hour12,pt.h24=pt.hour24,pt.days=pt.day;var yt=e=>{Object.keys(pt).forEach((t=>{e.prototype[t]=pt[t]}))};const gt=function(e,t){return 1===e&&g(t)?29:x[e]},bt=(e,t)=>{if(e.month>0){let n=parseInt(e.month/12,10);e.year=t.year()+n,e.month=e.month%12}else if(e.month<0){let n=Math.abs(e.month),a=parseInt(n/12,10);n%12!=0&&(a+=1),e.year=t.year()-a,e.month=e.month%12,e.month=e.month+12,12===e.month&&(e.month=0)}return e},kt=(e,t,n)=>{let a=t.year(),r=t.month(),o=gt(r,a);for(;n>o;)n-=o,r+=1,r>=12&&(r-=12,a+=1),o=gt(r,a);return e.month=r,e.date=n,e},wt=(e,t,n)=>{e.year=t.year(),e.month=t.month();let a=t.date();for(e.date=a-Math.abs(n);e.date<1;){e.month-=1,e.month<0&&(e.month=11,e.year-=1);let t=gt(e.month,e.year);e.date+=t}return e},vt=["millisecond","second","minute","hour","date","month"];let _t={second:vt.slice(0,1),minute:vt.slice(0,2),quarterhour:vt.slice(0,2),hour:vt.slice(0,3),date:vt.slice(0,4),month:vt.slice(0,4),quarter:vt.slice(0,4),season:vt.slice(0,4),year:vt,decade:vt,century:vt};_t.week=_t.hour,_t.season=_t.date,_t.quarter=_t.date;const jt={year:!0,quarter:!0,season:!0,month:!0,week:!0,date:!0},$t={month:!0,quarter:!0,season:!0,year:!0};var zt=e=>{e.prototype.add=function(e,t){let n=this.clone();if(!t||0===e)return n;let a=this.clone();if("millisecond"===(t=j(t)))return n.epoch+=e,n;"fortnight"===t&&(e*=2,t="week"),T[t]?n.epoch+=T[t]*e:"week"===t||"weekend"===t?n.epoch+=T.day*(7*e):"quarter"===t||"season"===t?n.epoch+=T.month*(3*e):"quarterhour"===t&&(n.epoch+=15*T.minute*e);let r={};if(_t[t]&&_t[t].forEach((e=>{r[e]=a[e]()})),jt[t]){const e=a.timezone().current.offset-n.timezone().current.offset;n.epoch+=3600*e*1e3}if("month"===t&&(r.month=a.month()+e,r=bt(r,a)),"week"===t){let t=a.date()+7*e;t<=28&&t>1&&(r.date=t)}if("weekend"===t&&"saturday"!==n.dayName())n=n.day("saturday",!0);else if("date"===t){if(e<0)r=wt(r,a,e);else{let t=a.date()+e;r=kt(r,a,t)}0!==e&&a.isSame(n,"day")&&(r.date=a.date()+e)}else if("quarter"===t){if(r.month=a.month()+3*e,r.year=a.year(),r.month<0){let e=Math.floor(r.month/12),t=r.month+12*Math.abs(e);r.month=t,r.year+=e}else if(r.month>=12){let e=Math.floor(r.month/12);r.month=r.month%12,r.year+=e}r.date=a.date()}else if("year"===t){let t=a.year()+e,r=n.year();if(rt){let t=Math.floor(e/4)||1;n.epoch+=T.day*t}}else"decade"===t?r.year=n.year()+10:"century"===t&&(r.year=n.year()+100);if($t[t]){let e=x[r.month];r.date=a.date(),r.date>e&&(r.date=e)}return Object.keys(r).length>1&&Y(n,r),n},e.prototype.subtract=function(e,t){return this.clone().add(-1*e,t)},e.prototype.minus=e.prototype.subtract,e.prototype.plus=e.prototype.add};const Ot={millisecond:e=>e.epoch,second:e=>[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second()].join("-"),minute:e=>[e.year(),e.month(),e.date(),e.hour(),e.minute()].join("-"),hour:e=>[e.year(),e.month(),e.date(),e.hour()].join("-"),day:e=>[e.year(),e.month(),e.date()].join("-"),week:e=>[e.year(),e.week()].join("-"),month:e=>[e.year(),e.month()].join("-"),quarter:e=>[e.year(),e.quarter()].join("-"),year:e=>e.year()};Ot.date=Ot.day;var Dt=e=>{e.prototype.isSame=function(t,n,a=!0){let r=this;if(!n)return null;if("string"==typeof t&&"object"==typeof n){let e=t;t=n,n=e}return"string"!=typeof t&&"number"!=typeof t||(t=new e(t,this.timezone.name)),n=n.replace(/s$/,""),!0===a&&r.tz!==t.tz&&((t=t.clone()).tz=r.tz),Ot[n]?Ot[n](r)===Ot[n](t):null}};var Mt=e=>{const t={isAfter:function(e){let t=$(e=z(e,this));return null===t?null:this.epoch>t},isBefore:function(e){let t=$(e=z(e,this));return null===t?null:this.epoch{e.prototype[n]=t[n]}))};var St=e=>{const t={i18n:function(e){var t,n,a;return k(e.days)&&(t=e.days,re=t.short||re,oe=t.long||oe),k(e.months)&&function(e){F=e.short||F,P=e.long||P}(e.months),a=e.useTitleCase,"[object Boolean]"===Object.prototype.toString.call(a)&&(n=e.useTitleCase,le=n),k(e.ampm)&&function(e){it=e.am||it,st=e.pm||st}(e.ampm),k(e.distance)&&function(e){Ae=e.pastDistance||Ae,Ye=e.futureDistance||Ye,qe=e.past||qe,Ne=e.future||Ne,Ie=e.present||Ie,Ee=e.now||Ee,Te=e.almost||Te,Ce=e.over||Ce}(e.distance),k(e.units)&&function(e={}){Me={second:e.second||Me.second,seconds:e.seconds||Me.seconds,minute:e.minute||Me.minute,minutes:e.minutes||Me.minutes,hour:e.hour||Me.hour,hours:e.hours||Me.hours,day:e.day||Me.day,days:e.days||Me.days,month:e.month||Me.month,months:e.months||Me.months,year:e.year||Me.year,years:e.years||Me.years}}(e.units),this}};Object.keys(t).forEach((n=>{e.prototype[n]=t[n]}))};let qt=i;const Nt=function(e,t,a={}){this.epoch=null,this.tz=y(t,qt),this.silent=void 0===a.silent||a.silent,this.british=a.dmy||a.british,this._weekStart=1,void 0!==a.weekStart&&(this._weekStart=a.weekStart),this._today={},void 0!==a.today&&(this._today=a.today),Object.defineProperty(this,"d",{get:function(){let e=n(this),t=(new Date(this.epoch).getTimezoneOffset()||0)+60*e;t=60*t*1e3;let a=this.epoch+t;return new Date(a)}}),Object.defineProperty(this,"timezones",{get:()=>qt,set:e=>(qt=e,e)});let r=ae(this,e);this.epoch=r.epoch};Object.keys(Re).forEach((e=>{Nt.prototype[e]=Re[e]})),Nt.prototype.clone=function(){return new Nt(this.epoch,this.tz,{silent:this.silent,weekStart:this._weekStart,today:this._today,parsers:this.parsers})},Nt.prototype.toLocalDate=function(){return this.toNativeDate()},Nt.prototype.toNativeDate=function(){return new Date(this.epoch)},yt(Nt),zt(Nt),Dt(Nt),Mt(Nt),St(Nt);var It=Nt;var Et=(e,t)=>{let n=new It(null),a=new It(null);n=n.time(e),a=t?a.time(t):n.add(59,"minutes");let r=n.hour(),o=a.hour();return Object.keys(n.timezones).filter((e=>{if(-1===e.indexOf("/"))return!1;let t=new It(null,e),i=t.hour();return i>=r&&i<=o&&(!(i===r&&t.minute()a.minute()))}))};const Tt=(e,t,n)=>new It(e,t,n),Ct=function(e){let t=e._today||{};return Object.keys(t).forEach((n=>{e=e[n](t[n])})),e};Tt.now=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n},Tt.today=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n.startOf("day")},Tt.tomorrow=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n.add(1,"day").startOf("day")},Tt.yesterday=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n.subtract(1,"day").startOf("day")},Tt.extend=function(e={}){return Object.keys(e).forEach((t=>{It.prototype[t]=e[t]})),this},Tt.timezones=function(){return(new It).timezones},Tt.max=function(e,t){let n=new It(null,e,t);return n.epoch=864e13,n},Tt.min=function(e,t){let n=new It(null,e,t);return n.epoch=-864e13,n},Tt.whereIts=Et,Tt.version="7.5.0",Tt.plugin=Tt.extend;export{Tt as default}; +const e=(e,t,n)=>{const[r,a]=e.split("/"),[o,i]=a.split(":");return Date.UTC(n,r-1,o,i)-36e5*t};var t=(t,n,r,a,o)=>{const i=new Date(t).getUTCFullYear(),s=e(n,o,i),u=e(r,a,i);return t>=s&&t{let n=e.timezones[e.tz];if(void 0===n)return console.warn("Warning: couldn't find timezone "+e.tz),0;if(void 0===n.dst)return n.offset;let r=n.offset,a=n.offset+1;"n"===n.hem&&(a=r-1);let o=n.dst.split("->");return!0===t(e.epoch,o[0],o[1],r,a)?r:a},r={"9|s":"2/dili,2/jayapura","9|n":"2/chita,2/khandyga,2/pyongyang,2/seoul,2/tokyo,2/yakutsk,11/palau,japan,rok","9.5|s|04/07:03->10/06:02":"4/adelaide,4/broken_hill,4/south,4/yancowinna","9.5|s":"4/darwin,4/north","8|s|03/13:01->10/02:00":"12/casey","8|s":"2/kuala_lumpur,2/makassar,2/singapore,4/perth,2/ujung_pandang,4/west,singapore","8|n":"2/brunei,2/choibalsan,2/hong_kong,2/irkutsk,2/kuching,2/macau,2/manila,2/shanghai,2/taipei,2/ulaanbaatar,2/chongqing,2/chungking,2/harbin,2/macao,2/ulan_bator,hongkong,prc,roc","8.75|s":"4/eucla","7|s":"12/davis,2/jakarta,9/christmas","7|n":"2/bangkok,2/barnaul,2/hovd,2/krasnoyarsk,2/novokuznetsk,2/novosibirsk,2/phnom_penh,2/pontianak,2/ho_chi_minh,2/tomsk,2/vientiane,2/saigon","6|s":"12/vostok","6|n":"2/almaty,2/bishkek,2/dhaka,2/omsk,2/qyzylorda,2/qostanay,2/thimphu,2/urumqi,9/chagos,2/dacca,2/kashgar,2/thimbu","6.5|n":"2/yangon,9/cocos,2/rangoon","5|s":"12/mawson,9/kerguelen","5|n":"2/aqtau,2/aqtobe,2/ashgabat,2/atyrau,2/dushanbe,2/karachi,2/oral,2/samarkand,2/tashkent,2/yekaterinburg,9/maldives,2/ashkhabad","5.75|n":"2/kathmandu,2/katmandu","5.5|n":"2/kolkata,2/colombo,2/calcutta","4|s":"9/reunion","4|n":"2/baku,2/dubai,2/muscat,2/tbilisi,2/yerevan,8/astrakhan,8/samara,8/saratov,8/ulyanovsk,8/volgograd,9/mahe,9/mauritius,2/volgograd","4.5|n":"2/kabul","3|s":"12/syowa,9/antananarivo","3|n|04/26:00->10/31:24":"0/cairo,egypt","3|n|04/20:02->10/26:02":"2/gaza,2/hebron","3|n|03/31:03->10/27:04":"2/famagusta,2/nicosia,8/athens,8/bucharest,8/helsinki,8/kyiv,8/mariehamn,8/riga,8/sofia,8/tallinn,8/uzhgorod,8/vilnius,8/zaporozhye,8/nicosia,8/kiev,eet","3|n|03/31:02->10/27:03":"8/chisinau,8/tiraspol","3|n|03/31:00->10/26:24":"2/beirut","3|n|03/29:02->10/27:02":"2/jerusalem,2/tel_aviv,israel","3|n":"0/addis_ababa,0/asmara,0/asmera,0/dar_es_salaam,0/djibouti,0/juba,0/kampala,0/mogadishu,0/nairobi,2/aden,2/amman,2/baghdad,2/bahrain,2/damascus,2/kuwait,2/qatar,2/riyadh,8/istanbul,8/kirov,8/minsk,8/moscow,8/simferopol,9/comoro,9/mayotte,2/istanbul,turkey,w-su","3.5|n":"2/tehran,iran","2|s|03/31:02->10/27:02":"12/troll","2|s":"0/gaborone,0/harare,0/johannesburg,0/lubumbashi,0/lusaka,0/maputo,0/maseru,0/mbabane","2|n|03/31:02->10/27:03":"0/ceuta,arctic/longyearbyen,8/amsterdam,8/andorra,8/belgrade,8/berlin,8/bratislava,8/brussels,8/budapest,8/busingen,8/copenhagen,8/gibraltar,8/ljubljana,8/luxembourg,8/madrid,8/malta,8/monaco,8/oslo,8/paris,8/podgorica,8/prague,8/rome,8/san_marino,8/sarajevo,8/skopje,8/stockholm,8/tirane,8/vaduz,8/vatican,8/vienna,8/warsaw,8/zagreb,8/zurich,3/jan_mayen,poland,cet,met","2|n":"0/blantyre,0/bujumbura,0/khartoum,0/kigali,0/tripoli,8/kaliningrad,libya","1|s":"0/brazzaville,0/kinshasa,0/luanda,0/windhoek","1|n|03/31:01->10/27:02":"3/canary,3/faroe,3/madeira,8/dublin,8/guernsey,8/isle_of_man,8/jersey,8/lisbon,8/london,3/faeroe,eire,8/belfast,gb-eire,gb,portugal,wet","1|n":"0/algiers,0/bangui,0/douala,0/lagos,0/libreville,0/malabo,0/ndjamena,0/niamey,0/porto-novo,0/tunis","14|n":"11/kiritimati","13|s":"11/apia,11/tongatapu","13|n":"11/enderbury,11/kanton,11/fakaofo","12|s|04/07:03->09/29:02":"12/mcmurdo,11/auckland,12/south_pole,nz","12|s":"11/fiji","12|n":"2/anadyr,2/kamchatka,2/srednekolymsk,11/funafuti,11/kwajalein,11/majuro,11/nauru,11/tarawa,11/wake,11/wallis,kwajalein","12.75|s|04/07:03->04/07:02":"11/chatham,nz-chat","11|s|04/07:03->10/06:02":"12/macquarie","11|s":"11/bougainville","11|n":"2/magadan,2/sakhalin,11/efate,11/guadalcanal,11/kosrae,11/noumea,11/pohnpei,11/ponape","11.5|n|04/07:03->10/06:02":"11/norfolk","10|s|04/07:03->10/06:02":"4/currie,4/hobart,4/melbourne,4/sydney,4/act,4/canberra,4/nsw,4/tasmania,4/victoria","10|s":"12/dumontdurville,4/brisbane,4/lindeman,11/port_moresby,4/queensland","10|n":"2/ust-nera,2/vladivostok,11/guam,11/saipan,11/chuuk,11/truk,11/yap","10.5|s|04/07:01->10/06:02":"4/lord_howe,4/lhi","0|s|03/10:03->04/14:02":"0/casablanca,0/el_aaiun","0|n|03/31:00->10/27:01":"1/scoresbysund,3/azores","0|n":"0/abidjan,0/accra,0/bamako,0/banjul,0/bissau,0/conakry,0/dakar,0/freetown,0/lome,0/monrovia,0/nouakchott,0/ouagadougou,0/sao_tome,1/danmarkshavn,3/reykjavik,3/st_helena,13/gmt,13/utc,0/timbuktu,13/greenwich,13/uct,13/universal,13/zulu,gmt-0,gmt+0,gmt0,greenwich,iceland,uct,universal,utc,zulu,13/unknown,factory","-9|n|03/10:02->11/03:02":"1/adak,1/atka,us/aleutian","-9|n":"11/gambier","-9.5|n":"11/marquesas","-8|n|03/10:02->11/03:02":"1/anchorage,1/juneau,1/metlakatla,1/nome,1/sitka,1/yakutat,us/alaska","-8|n":"11/pitcairn","-7|n|03/10:02->11/03:02":"1/los_angeles,1/santa_isabel,1/tijuana,1/vancouver,1/ensenada,6/pacific,10/bajanorte,us/pacific-new,us/pacific","-7|n":"1/creston,1/dawson,1/dawson_creek,1/fort_nelson,1/hermosillo,1/mazatlan,1/phoenix,1/whitehorse,6/yukon,10/bajasur,us/arizona,mst","-6|s|04/06:22->09/07:22":"11/easter,7/easterisland","-6|n|04/07:02->10/27:02":"1/merida","-6|n|03/10:02->11/03:02":"1/boise,1/cambridge_bay,1/denver,1/edmonton,1/inuvik,1/north_dakota,1/ojinaga,1/ciudad_juarez,1/yellowknife,1/shiprock,6/mountain,navajo,us/mountain","-6|n":"1/bahia_banderas,1/belize,1/chihuahua,1/costa_rica,1/el_salvador,1/guatemala,1/managua,1/mexico_city,1/monterrey,1/regina,1/swift_current,1/tegucigalpa,11/galapagos,6/east-saskatchewan,6/saskatchewan,10/general","-5|s":"1/lima,1/rio_branco,1/porto_acre,5/acre","-5|n|03/10:02->11/03:02":"1/chicago,1/matamoros,1/menominee,1/rainy_river,1/rankin_inlet,1/resolute,1/winnipeg,1/indiana/knox,1/indiana/tell_city,1/north_dakota/beulah,1/north_dakota/center,1/north_dakota/new_salem,1/knox_in,6/central,us/central,us/indiana-starke","-5|n":"1/bogota,1/cancun,1/cayman,1/coral_harbour,1/eirunepe,1/guayaquil,1/jamaica,1/panama,1/atikokan,jamaica,est","-4|s|04/06:24->09/08:00":"1/santiago,7/continental","-4|s|03/23:24->10/06:00":"1/asuncion","-4|s":"1/campo_grande,1/cuiaba,1/la_paz,1/manaus,5/west","-4|n|03/10:02->11/03:02":"1/detroit,1/grand_turk,1/indiana,1/indianapolis,1/iqaluit,1/kentucky,1/louisville,1/montreal,1/nassau,1/new_york,1/nipigon,1/pangnirtung,1/port-au-prince,1/thunder_bay,1/toronto,1/indiana/marengo,1/indiana/petersburg,1/indiana/vevay,1/indiana/vincennes,1/indiana/winamac,1/kentucky/monticello,1/fort_wayne,1/indiana/indianapolis,1/kentucky/louisville,6/eastern,us/east-indiana,us/eastern,us/michigan","-4|n|03/10:00->11/03:01":"1/havana,cuba","-4|n":"1/anguilla,1/antigua,1/aruba,1/barbados,1/blanc-sablon,1/boa_vista,1/caracas,1/curacao,1/dominica,1/grenada,1/guadeloupe,1/guyana,1/kralendijk,1/lower_princes,1/marigot,1/martinique,1/montserrat,1/port_of_spain,1/porto_velho,1/puerto_rico,1/santo_domingo,1/st_barthelemy,1/st_kitts,1/st_lucia,1/st_thomas,1/st_vincent,1/tortola,1/virgin","-3|s":"1/argentina,1/buenos_aires,1/catamarca,1/cordoba,1/fortaleza,1/jujuy,1/mendoza,1/montevideo,1/punta_arenas,1/sao_paulo,12/palmer,12/rothera,3/stanley,1/argentina/la_rioja,1/argentina/rio_gallegos,1/argentina/salta,1/argentina/san_juan,1/argentina/san_luis,1/argentina/tucuman,1/argentina/ushuaia,1/argentina/comodrivadavia,1/argentina/buenos_aires,1/argentina/catamarca,1/argentina/cordoba,1/argentina/jujuy,1/argentina/mendoza,1/argentina/rosario,1/rosario,5/east","-3|n|03/10:02->11/03:02":"1/glace_bay,1/goose_bay,1/halifax,1/moncton,1/thule,3/bermuda,6/atlantic","-3|n":"1/araguaina,1/bahia,1/belem,1/cayenne,1/maceio,1/paramaribo,1/recife,1/santarem","-2|n|03/30:22->10/26:23":"1/nuuk,1/godthab","-2|n|03/10:02->11/03:02":"1/miquelon","-2|n":"1/noronha,3/south_georgia,5/denoronha","-2.5|n|03/10:02->11/03:02":"1/st_johns,6/newfoundland","-1|n":"3/cape_verde","-11|n":"11/midway,11/niue,11/pago_pago,11/samoa,us/samoa","-10|n":"11/honolulu,11/johnston,11/rarotonga,11/tahiti,us/hawaii,hst"},a=["africa","america","asia","atlantic","australia","brazil","canada","chile","europe","indian","mexico","pacific","antarctica","etc"];let o={};Object.keys(r).forEach((e=>{let t=e.split("|"),n={offset:Number(t[0]),hem:t[1]};t[2]&&(n.dst=t[2]),r[e].split(",").forEach((e=>{e=e.replace(/(^[0-9]+)\//,((e,t)=>(t=Number(t),a[t]+"/"))),o[e]=n}))})),o.utc={offset:0,hem:"n"};for(let e=-14;e<=14;e+=.5){let t=e;t>0&&(t="+"+t);let n="etc/gmt"+t;o[n]={offset:-1*e,hem:"n"},n="utc/gmt"+t,o[n]={offset:-1*e,hem:"n"}}var i=o;var s=()=>{let e=(()=>{if("undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;let e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;let t=e.resolvedOptions().timeZone;return t?t.toLowerCase():null})();return null===e?"utc":e};const u=/(\-?[0-9]+)h(rs)?/i,l=/(\-?[0-9]+)/,c=/utc([\-+]?[0-9]+)/i,h=/gmt([\-+]?[0-9]+)/i,d=function(e){return(e=Number(e))>=-13&&e<=13?"etc/gmt"+(e=((e*=-1)>0?"+":"")+e):null};var m=function(e){let t=e.match(u);if(null!==t)return d(t[1]);if(t=e.match(c),null!==t)return d(t[1]);if(t=e.match(h),null!==t){let e=-1*Number(t[1]);return d(e)}return t=e.match(l),null!==t?d(t[1]):null};let f=s();const p=Object.keys(i).reduce(((e,t)=>{let n=t.split("/")[1]||"";return n=n.replace(/_/g," "),e[n]=t,e}),{});var y=(e,t)=>{if(!e)return t.hasOwnProperty(f)||(console.warn(`Unrecognized IANA id '${f}'. Setting fallback tz to UTC.`),f="utc"),f;"string"!=typeof e&&console.error("Timezone must be a string - recieved: '",e,"'\n");let n=e.trim();if(n=n.toLowerCase(),!0===t.hasOwnProperty(n))return n;if(n=(e=>(e=(e=(e=(e=(e=e.replace(/ time/g,"")).replace(/ (standard|daylight|summer)/g,"")).replace(/\b(east|west|north|south)ern/g,"$1")).replace(/\b(africa|america|australia)n/g,"$1")).replace(/\beuropean/g,"europe")).replace(/\islands/g,"island"))(n),!0===t.hasOwnProperty(n))return n;if(!0===p.hasOwnProperty(n))return p[n];if(!0===/[0-9]/.test(n)){let e=m(n);if(e)return e}throw new Error("Spacetime: Cannot find timezone named: '"+e+"'. Please enter an IANA timezone id.")};function g(e){return e%4==0&&e%100!=0||e%400==0}function b(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.valueOf())}function k(e){return"[object Object]"===Object.prototype.toString.call(e)}function w(e,t=2){return(e+="").length>=t?e:new Array(t-e.length+1).join("0")+e}function v(e){let t=e%10,n=e%100;return 1===t&&11!==n?e+"st":2===t&&12!==n?e+"nd":3===t&&13!==n?e+"rd":e+"th"}function _(e){return e=(e=String(e)).replace(/([0-9])(st|nd|rd|th)$/i,"$1"),parseInt(e,10)}function z(e=""){return"day"===(e=(e=(e=(e=e.toLowerCase().trim()).replace(/ies$/,"y")).replace(/s$/,"")).replace(/-/g,""))||"days"===e?"date":"min"===e||"mins"===e?"minute":e}function j(e){return"number"==typeof e?e:b(e)?e.getTime():e.epoch?e.epoch:null}function $(e,t){return!1===k(e)?t.clone().set(e):e}function O(e,t=""){const n=e>0?"+":"-",r=Math.abs(e);return`${n}${w(parseInt(""+r,10))}${t}${w(r%1*60)}`}const D={year:(new Date).getFullYear(),month:0,date:1};var M={parseArray:(e,t,n)=>{if(0===t.length)return e;let r=["year","month","date","hour","minute","second","millisecond"];for(let a=0;a{if(0===Object.keys(t).length)return e;t=Object.assign({},D,n,t);let r=Object.keys(t);for(let a=0;a0&&t<25e8&&!1===e.silent&&(console.warn(" - Warning: You are setting the date to January 1970."),console.warn(" - did input seconds instead of milliseconds?")),e.epoch=t,e}};const S=function(e){return e.epoch=Date.now(),Object.keys(e._today||{}).forEach((t=>{"function"==typeof e[t]&&(e=e[t](e._today[t]))})),e},q={now:e=>S(e),today:e=>S(e),tonight:e=>e=(e=S(e)).hour(18),tomorrow:e=>e=(e=(e=S(e)).add(1,"day")).startOf("day"),yesterday:e=>e=(e=(e=S(e)).subtract(1,"day")).startOf("day"),christmas:e=>{let t=S(e).year();return e=e.set([t,11,25,18,0,0])},"new years":e=>{let t=S(e).year();return e=e.set([t,11,31,18,0,0])}};q["new years eve"]=q["new years"];var N=q;var I=function(e){return e=(e=(e=(e=e.replace(/\b(mon|tues?|wed|wednes|thur?s?|fri|sat|satur|sun)(day)?\b/i,"")).replace(/([0-9])(th|rd|st|nd)/,"$1")).replace(/,/g,"")).replace(/ +/g," ").trim()};let E={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5};E.date=E.day,E.month=25488e5,E.week=6048e5,E.year=3154e7,Object.keys(E).forEach((e=>{E[e+"s"]=E[e]}));var T=E;const C=(e,t,n,r,a)=>{let o=e.d[n]();if(o===t)return;let i=null===a?null:e.d[a](),s=e.epoch,u=t-o;e.epoch+=T[r]*u,"day"===r&&Math.abs(u)>28&&t<28&&(e.epoch+=T.hour),null!==a&&i!==e.d[a]()&&(e.epoch=s);const l=T[r]/2;for(;e.d[n]()t;)e.epoch-=l;null!==a&&i!==e.d[a]()&&(e.epoch=s)},A={year:{valid:e=>e>-4e3&&e<4e3,walkTo:(e,t)=>C(e,t,"getFullYear","year",null)},month:{valid:e=>e>=0&&e<=11,walkTo:(e,t)=>{let n=e.d,r=n.getMonth(),a=e.epoch,o=n.getFullYear();if(r===t)return;let i=t-r;for(e.epoch+=T.day*(28*i),o!==e.d.getFullYear()&&(e.epoch=a);e.d.getMonth()t;)e.epoch-=T.day}},date:{valid:e=>e>0&&e<=31,walkTo:(e,t)=>C(e,t,"getDate","day","getMonth")},hour:{valid:e=>e>=0&&e<24,walkTo:(e,t)=>C(e,t,"getHours","hour","getDate")},minute:{valid:e=>e>=0&&e<60,walkTo:(e,t)=>C(e,t,"getMinutes","minute","getHours")},second:{valid:e=>e>=0&&e<60,walkTo:(e,t)=>{e.epoch=e.seconds(t).epoch}},millisecond:{valid:e=>e>=0&&e<1e3,walkTo:(e,t)=>{e.epoch=e.milliseconds(t).epoch}}};var Y=(e,t)=>{let n=Object.keys(A),r=e.clone();for(let a=0;a{if(!t)return e;t=t.trim().toLowerCase();let n=0;if(/^[\+-]?[0-9]{2}:[0-9]{2}$/.test(t)&&(!0===/:00/.test(t)&&(t=t.replace(/:00/,"")),!0===/:30/.test(t)&&(t=t.replace(/:30/,".5"))),/^[\+-]?[0-9]{4}$/.test(t)&&(t=t.replace(/30$/,".5")),n=parseFloat(t),Math.abs(n)>100&&(n/=100),0===n||"Z"===t||"z"===t)return e.tz="etc/gmt",e;n*=-1,n>=0&&(n="+"+n);let r="etc/gmt"+n;return e.timezones[r]&&(e.tz=r),e};var Z=(e,t="")=>{let n=(t=t.replace(/^\s+/,"").toLowerCase()).match(/([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?[:\.]?([0-9]{1,4})?/);if(null!==n){let[,r,a,o,i]=n;if(r=Number(r),r<0||r>24)return e.startOf("day");if(a=Number(a),n[2].length<2||a<0||a>59)return e.startOf("day");e=(e=(e=(e=e.hour(r)).minute(a)).seconds(o||0)).millisecond(function(e=""){return(e=String(e)).length>3?e=e.substring(0,3):1===e.length?e+="00":2===e.length&&(e+="0"),Number(e)||0}(i));let s=t.match(/[\b0-9] ?(am|pm)\b/);return null!==s&&s[1]&&(e=e.ampm(s[1])),e}if(n=t.match(/([0-9]+) ?(am|pm)/),null!==n&&n[1]){let t=Number(n[1]);return t>12||t<1?e.startOf("day"):e=(e=(e=e.hour(n[1]||0)).ampm(n[2])).startOf("hour")}return e=e.startOf("day")};let U=B();const Q=e=>{if(!0!==x.hasOwnProperty(e.month))return!1;if(1===e.month)return!!(g(e.year)&&e.date<=29)||e.date<=28;let t=x[e.month]||0;return e.date<=t},G=(e="",t)=>{if(e=e.trim(),!0===/^'[0-9][0-9]$/.test(e)){let t=Number(e.replace(/'/,""));return t>50?1900+t:2e3+t}let n=parseInt(e,10);return!n&&t&&(n=t.year),n=n||(new Date).getFullYear(),n},V=function(e){return"sept"===(e=e.toLowerCase().trim())?U.sep:U[e]};var W=[{reg:/^([0-9]{1,2})[\-\/.]([0-9]{1,2})[\-\/.]?([0-9]{4})?( [0-9]{1,2}:[0-9]{2}:?[0-9]{0,2}? ?(am|pm|gmt))?$/i,parse:(e,t)=>{let n=parseInt(t[1],10)-1,r=parseInt(t[2],10);(e.british||n>=12)&&(r=parseInt(t[1],10),n=parseInt(t[2],10)-1);let a={date:r,month:n,year:G(t[3],e._today)||(new Date).getFullYear()};return!1===Q(a)?(e.epoch=null,e):(Y(e,a),e=Z(e,t[4]))}},{reg:/^([a-z]+)[\-\/\. ]([0-9]{1,2})[\-\/\. ]?([0-9]{4}|'[0-9]{2})?( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[1]),date:_(t[2]||"")};return!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=Z(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2})( [0-9]{4})?( ([0-9:]+( ?am| ?pm| ?gmt)?))?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[1]),date:_(t[2]||"")};return!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=Z(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2}) ([0-9]{1,2}:[0-9]{2}:?[0-9]{0,2})( \+[0-9]{4})?( [0-9]{4})?$/i,parse:(e,t)=>{let[,n,r,a,o,i]=t,s={year:G(i,e._today),month:V(n),date:_(r||"")};return!1===Q(s)?(e.epoch=null,e):(Y(e,s),e=H(e,o),e=Z(e,a))}}],J=[{reg:/^([0-9]{4})[\-\/]([0-9]{2})$/i,parse:(e,t)=>{let n={year:t[1],month:parseInt(t[2],10)-1,date:1};return!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=Z(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{4})$/i,parse:(e,t)=>{let n={year:G(t[2],e._today),month:V(t[1]),date:e._today.date||1};return!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=Z(e,t[4]))}},{reg:/^(q[0-9])( of)?( [0-9]{4})?/i,parse:(e,t)=>{let n=t[1]||"";e=e.quarter(n);let r=t[3]||"";return r&&(r=r.trim(),e=e.year(r)),e}},{reg:/^(spring|summer|winter|fall|autumn)( of)?( [0-9]{4})?/i,parse:(e,t)=>{let n=t[1]||"";e=e.season(n);let r=t[3]||"";return r&&(r=r.trim(),e=e.year(r)),e}},{reg:/^[0-9,]+ ?b\.?c\.?$/i,parse:(e,t)=>{let n=t[0]||"";n=n.replace(/^([0-9,]+) ?b\.?c\.?$/i,"-$1");let r=new Date,a={year:parseInt(n.trim(),10),month:r.getMonth(),date:r.getDate()};return!1===Q(a)?(e.epoch=null,e):(Y(e,a),e=Z(e))}},{reg:/^[0-9,]+ ?(a\.?d\.?|c\.?e\.?)$/i,parse:(e,t)=>{let n=t[0]||"";n=n.replace(/,/g,"");let r=new Date,a={year:parseInt(n.trim(),10),month:r.getMonth(),date:r.getDate()};return!1===Q(a)?(e.epoch=null,e):(Y(e,a),e=Z(e))}},{reg:/^[0-9]{4}( ?a\.?d\.?)?$/i,parse:(e,t)=>{let n=e._today;n.month&&!n.date&&(n.date=1);let r=new Date,a={year:G(t[0],n),month:n.month||r.getMonth(),date:n.date||r.getDate()};return!1===Q(a)?(e.epoch=null,e):(Y(e,a),e=Z(e))}}],K=[].concat([{reg:/^(\-?0?0?[0-9]{3,4})-([0-9]{1,2})-([0-9]{1,2})[T| ]([0-9.:]+)(Z|[0-9\-\+:]+)?$/i,parse:(e,t)=>{let n={year:t[1],month:parseInt(t[2],10)-1,date:t[3]};return!1===Q(n)?(e.epoch=null,e):(H(e,t[5]),Y(e,n),e=Z(e,t[4]))}},{reg:/^([0-9]{4})[\-\/\. ]([0-9]{1,2})[\-\/\. ]([0-9]{1,2})( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={year:t[1],month:parseInt(t[2],10)-1,date:parseInt(t[3],10)};return n.month>=12&&(n.date=parseInt(t[2],10),n.month=parseInt(t[3],10)-1),!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=Z(e,t[4]))}},{reg:/^([0-9]{4})[\-\/\. ]([a-z]+)[\-\/\. ]([0-9]{1,2})( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={year:G(t[1],e._today),month:V(t[2]),date:_(t[3]||"")};return!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=Z(e,t[4]))}}],W,[{reg:/^([0-9]{1,2})[\-\/]([a-z]+)[\-\/]?([0-9]{4})?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[2]),date:_(t[1]||"")};return!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=Z(e,t[4]))}},{reg:/^([0-9]{1,2})( [a-z]+)( [0-9]{4}| '[0-9]{2})? ?([0-9]{1,2}:[0-9]{2}:?[0-9]{0,2}? ?(am|pm|gmt))?$/i,parse:(e,t)=>{let n={year:G(t[3],e._today),month:V(t[2]),date:_(t[1])};return n.month&&!1!==Q(n)?(Y(e,n),e=Z(e,t[4])):(e.epoch=null,e)}},{reg:/^([0-9]{1,2})[\. -/]([a-z]+)[\. -/]([0-9]{4})?( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let n={date:Number(t[1]),month:V(t[2]),year:Number(t[3])};return!1===Q(n)?(e.epoch=null,e):(Y(e,n),e=e.startOf("day"),e=Z(e,t[4]))}}],J);var R=function(e,t,n){for(let r=0;r{let n=e._today||ne;if("number"==typeof t)return te(e,t);if(e.epoch=Date.now(),e._today&&k(e._today)&&Object.keys(e._today).length>0){let t=ee(e,n,ne);t.isValid()&&(e.epoch=t.epoch)}return null==t||""===t?e:!0===b(t)?(e.epoch=t.getTime(),e):!0===function(e){return"[object Array]"===Object.prototype.toString.call(e)}(t)?e=X(e,t,n):!0===k(t)?t.epoch?(e.epoch=t.epoch,e.tz=t.tz,e):e=ee(e,t,n):"string"!=typeof t?e:(t=I(t),!0===N.hasOwnProperty(t)?e=N[t](e):R(e,t))};let ae=["sun","mon","tue","wed","thu","fri","sat"],oe=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function ie(){return ae}function se(){return oe}const ue={mo:1,tu:2,we:3,th:4,fr:5,sa:6,su:7,tues:2,weds:3,wedn:3,thur:4,thurs:4};let le=!0;var ce=e=>{let t=e.timezone().current.offset;return t?O(t,":"):"Z"};const he=e=>le?function(e){return e?e[0].toUpperCase()+e.substr(1):""}(e):e,de={day:e=>he(e.dayName()),"day-short":e=>he(ie()[e.day()]),"day-number":e=>e.day(),"day-ordinal":e=>v(e.day()),"day-pad":e=>w(e.day()),date:e=>e.date(),"date-ordinal":e=>v(e.date()),"date-pad":e=>w(e.date()),month:e=>he(e.monthName()),"month-short":e=>he(L()[e.month()]),"month-number":e=>e.month(),"month-ordinal":e=>v(e.month()),"month-pad":e=>w(e.month()),"iso-month":e=>w(e.month()+1),year:e=>{let t=e.year();return t>0?t:(t=Math.abs(t),t+" BC")},"year-short":e=>{let t=e.year();return t>0?`'${String(e.year()).substr(2,4)}`:(t=Math.abs(t),t+" BC")},"iso-year":e=>{let t=e.year(),n=t<0,r=w(Math.abs(t),4);return n&&(r=w(r,6),r="-"+r),r},time:e=>e.time(),"time-24":e=>`${e.hour24()}:${w(e.minute())}`,hour:e=>e.hour12(),"hour-pad":e=>w(e.hour12()),"hour-24":e=>e.hour24(),"hour-24-pad":e=>w(e.hour24()),minute:e=>e.minute(),"minute-pad":e=>w(e.minute()),second:e=>e.second(),"second-pad":e=>w(e.second()),millisecond:e=>e.millisecond(),"millisecond-pad":e=>w(e.millisecond(),3),ampm:e=>e.ampm(),AMPM:e=>e.ampm().toUpperCase(),quarter:e=>"Q"+e.quarter(),season:e=>e.season(),era:e=>e.era(),json:e=>e.json(),timezone:e=>e.timezone().name,offset:e=>ce(e),numeric:e=>`${e.year()}/${w(e.month()+1)}/${w(e.date())}`,"numeric-us":e=>`${w(e.month()+1)}/${w(e.date())}/${e.year()}`,"numeric-uk":e=>`${w(e.date())}/${w(e.month()+1)}/${e.year()}`,"mm/dd":e=>`${w(e.month()+1)}/${w(e.date())}`,iso:e=>`${e.format("iso-year")}-${w(e.month()+1)}-${w(e.date())}T${w(e.h24())}:${w(e.minute())}:${w(e.second())}.${w(e.millisecond(),3)}${ce(e)}`,"iso-short":e=>{let t=w(e.month()+1),n=w(e.date());var r;return`${(r=e.year())>=0?w(r,4):"-"+w(r=Math.abs(r),4)}-${t}-${n}`},"iso-utc":e=>new Date(e.epoch).toISOString(),nice:e=>`${L()[e.month()]} ${v(e.date())}, ${e.time()}`,"nice-24":e=>`${L()[e.month()]} ${v(e.date())}, ${e.hour24()}:${w(e.minute())}`,"nice-year":e=>`${L()[e.month()]} ${v(e.date())}, ${e.year()}`,"nice-day":e=>`${ie()[e.day()]} ${he(L()[e.month()])} ${v(e.date())}`,"nice-full":e=>`${e.dayName()} ${he(e.monthName())} ${v(e.date())}, ${e.time()}`,"nice-full-24":e=>`${e.dayName()} ${he(e.monthName())} ${v(e.date())}, ${e.hour24()}:${w(e.minute())}`},me={"day-name":"day","month-name":"month","iso 8601":"iso","time-h24":"time-24","time-12":"time","time-h12":"time",tz:"timezone","day-num":"day-number","month-num":"month-number","month-iso":"iso-month","year-iso":"iso-year","nice-short":"nice","nice-short-24":"nice-24",mdy:"numeric-us",dmy:"numeric-uk",ymd:"numeric","yyyy/mm/dd":"numeric","mm/dd/yyyy":"numeric-us","dd/mm/yyyy":"numeric-us","little-endian":"numeric-uk","big-endian":"numeric","day-nice":"nice-day"};Object.keys(me).forEach((e=>de[e]=de[me[e]]));var fe=(e,t="")=>{if(!0!==e.isValid())return"";if(de.hasOwnProperty(t)){let n=de[t](e)||"";return"json"!==t&&(n=String(n),"ampm"!==t.toLowerCase()&&(n=he(n))),n}if(-1!==t.indexOf("{")){let n=/\{(.+?)\}/g;return t=t.replace(n,((t,n)=>{if(n=n.toLowerCase().trim(),de.hasOwnProperty(n)){let t=String(de[n](e));return"ampm"!==n.toLowerCase()?he(t):t}return""})),t}return e.format("iso-short")};const pe={G:e=>e.era(),GG:e=>e.era(),GGG:e=>e.era(),GGGG:e=>"AD"===e.era()?"Anno Domini":"Before Christ",y:e=>e.year(),yy:e=>w(Number(String(e.year()).substr(2,4))),yyy:e=>e.year(),yyyy:e=>e.year(),yyyyy:e=>"0"+e.year(),Q:e=>e.quarter(),QQ:e=>e.quarter(),QQQ:e=>e.quarter(),QQQQ:e=>e.quarter(),M:e=>e.month()+1,MM:e=>w(e.month()+1),MMM:e=>e.format("month-short"),MMMM:e=>e.format("month"),w:e=>e.week(),ww:e=>w(e.week()),d:e=>e.date(),dd:e=>w(e.date()),D:e=>e.dayOfYear(),DD:e=>w(e.dayOfYear()),DDD:e=>w(e.dayOfYear(),3),E:e=>e.format("day-short"),EE:e=>e.format("day-short"),EEE:e=>e.format("day-short"),EEEE:e=>e.format("day"),EEEEE:e=>e.format("day")[0],e:e=>e.day(),ee:e=>e.day(),eee:e=>e.format("day-short"),eeee:e=>e.format("day"),eeeee:e=>e.format("day")[0],a:e=>e.ampm().toUpperCase(),aa:e=>e.ampm().toUpperCase(),aaa:e=>e.ampm().toUpperCase(),aaaa:e=>e.ampm().toUpperCase(),h:e=>e.h12(),hh:e=>w(e.h12()),H:e=>e.hour(),HH:e=>w(e.hour()),m:e=>e.minute(),mm:e=>w(e.minute()),s:e=>e.second(),ss:e=>w(e.second()),SSS:e=>w(e.millisecond(),3),A:e=>e.epoch-e.startOf("day").epoch,z:e=>e.timezone().name,zz:e=>e.timezone().name,zzz:e=>e.timezone().name,zzzz:e=>e.timezone().name,Z:e=>O(e.timezone().current.offset),ZZ:e=>O(e.timezone().current.offset),ZZZ:e=>O(e.timezone().current.offset),ZZZZ:e=>O(e.timezone().current.offset,":")},ye=(e,t,n)=>{let r=e,a=t;for(let o=0;o{let n=t.split("");return n=function(e){for(let t=0;te))}(n),n=function(e){for(let t=0;te))).map((e=>("''"===e&&(e="'"),e)))}(n),n.reduce(((t,n)=>(void 0!==pe[n]?t+=pe[n](e)||"":(/^'.{1,}'$/.test(n)&&(n=n.replace(/'/g,"")),t+=n),t)),"")};const be=["year","season","quarter","month","week","day","quarterHour","hour","minute"],ke=function(e,t){let n=e.clone().startOf(t),r=e.clone().endOf(t).epoch-n.epoch,a=(e.epoch-n.epoch)/r;return parseFloat(a.toFixed(2))};var we=(e,t)=>{if(t)return t=z(t),ke(e,t);let n={};return be.forEach((t=>{n[t]=ke(e,t)})),n};var ve=(e,t)=>{let n=e.progress();return"quarterhour"===(t=z(t))&&(t="quarterHour"),void 0!==n[t]?(n[t]>.5&&(e=e.add(1,t)),e=e.startOf(t)):!1===e.silent&&console.warn("no known unit '"+t+"'"),e};const _e=(e,t,n)=>{let r=0;for(e=e.clone();e.isBefore(t);)e=e.add(1,n),r+=1;return e.isAfter(t,n)&&(r-=1),r};var ze=(e,t,n)=>e.isBefore(t)?_e(e,t,n):-1*_e(t,e,n);var je=function(e,t){let n=t.epoch-e.epoch,r={milliseconds:n,seconds:parseInt(n/1e3,10)};r.minutes=parseInt(r.seconds/60,10),r.hours=parseInt(r.minutes/60,10);let a=e.clone();return r.years=((e,t)=>{let n=t.year()-e.year();return(e=e.year(t.year())).isAfter(t)&&(n-=1),n})(a,t),a=e.add(r.years,"year"),r.months=12*r.years,a=e.add(r.months,"month"),r.months+=ze(a,t,"month"),r.quarters=4*r.years,r.quarters+=parseInt(r.months%12/3,10),r.weeks=52*r.years,a=e.add(r.weeks,"week"),r.weeks+=ze(a,t,"week"),r.days=7*r.weeks,a=e.add(r.days,"day"),r.days+=ze(a,t,"day"),r};var $e=function(e,t,n){t=$(t,e);let r=!1;if(e.isAfter(t)){let n=e;e=t,t=n,r=!0}let a=je(e,t);return r&&(a=function(e){return Object.keys(e).forEach((t=>{e[t]*=-1})),e}(a)),n?(n=z(n),!0!==/s$/.test(n)&&(n+="s"),"dates"===n&&(n="days"),a[n]):a};const Oe=e=>Math.abs(e)||0;var De=function(e){let t="P";return t+=Oe(e.years)+"Y",t+=Oe(e.months)+"M",t+=Oe(e.days)+"DT",t+=Oe(e.hours)+"H",t+=Oe(e.minutes)+"M",t+=Oe(e.seconds)+"S",t};let Me={second:"second",seconds:"seconds",minute:"minute",minutes:"minutes",hour:"hour",hours:"hours",day:"day",days:"days",month:"month",months:"months",year:"year",years:"years"};function Se(e){return Me[e]||""}let qe="past",Ne="future",Ie="present",Ee="now",Te="almost",Ce="over",Ae=e=>`${e} ago`,Ye=e=>`in ${e}`;function xe(e){return Ae(e)}function Fe(e){return Ye(e)}function Pe(){return Ee}const Le={months:{almost:10,over:4},days:{almost:25,over:10},hours:{almost:20,over:8},minutes:{almost:50,over:20},seconds:{almost:50,over:20}};function Be(e,t){return 1===e?e+" "+Se(t.slice(0,-1)):e+" "+Se(t)}var He=function(e){let t=null,n=null,r=[],a=[];return Object.keys(e).forEach(((o,i,s)=>{const u=Math.abs(e[o]);if(0===u)return;r.push(u+o[0]);const l=Be(u,o);if(a.push(l),!t){if(t=n=l,i>4)return;const r=s[i+1],a=Math.abs(e[r]);a>Le[r].almost?(t=Be(u+1,o),n=Te+" "+t):a>Le[r].over&&(n=Ce+" "+l)}})),{qualified:n,rounded:t,abbreviated:r,englishValues:a}};var Ze=(e,t)=>{const n=function(e,t){const n=e.isBefore(t),r=n?t:e;let a=n?e:t;a=a.clone();const o={years:0,months:0,days:0,hours:0,minutes:0,seconds:0};return Object.keys(o).forEach((e=>{if(a.isSame(r,e))return;let t=a.diff(r,e);a=a.add(t,e),o[e]=t})),n&&Object.keys(o).forEach((e=>{0!==o[e]&&(o[e]*=-1)})),o}(e,t=$(t,e));if(!0===Object.keys(n).every((e=>!n[e])))return{diff:n,rounded:Pe(),qualified:Pe(),precise:Pe(),abbreviated:[],iso:"P0Y0M0DT0H0M0S",direction:Ie};let r,a=Ne,{rounded:o,qualified:i,englishValues:s,abbreviated:u}=He(n);r=s.splice(0,2).join(", "),!0===e.isAfter(t)?(o=xe(o),i=xe(i),r=xe(r),a=qe):(o=Fe(o),i=Fe(i),r=Fe(r));let l=De(n);return{diff:n,rounded:o,qualified:i,precise:r,abbreviated:u,iso:l,direction:a}};var Ue={north:[["spring",2,1],["summer",5,1],["fall",8,1],["autumn",8,1],["winter",11,1]],south:[["fall",2,1],["autumn",2,1],["winter",5,1],["spring",8,1],["summer",11,1]]},Qe=[null,[0,1],[3,1],[6,1],[9,1]];const Ge={second:e=>(Y(e,{millisecond:0}),e),minute:e=>(Y(e,{second:0,millisecond:0}),e),quarterhour:e=>{let t=e.minutes();return e=t>=45?e.minutes(45):t>=30?e.minutes(30):t>=15?e.minutes(15):e.minutes(0),Y(e,{second:0,millisecond:0}),e},hour:e=>(Y(e,{minute:0,second:0,millisecond:0}),e),day:e=>(Y(e,{hour:0,minute:0,second:0,millisecond:0}),e),week:e=>{let t=e.clone();return(e=e.day(e._weekStart)).isAfter(t)&&(e=e.subtract(1,"week")),Y(e,{hour:0,minute:0,second:0,millisecond:0}),e},month:e=>(Y(e,{date:1,hour:0,minute:0,second:0,millisecond:0}),e),quarter:e=>{let t=e.quarter();return Qe[t]&&Y(e,{month:Qe[t][0],date:Qe[t][1],hour:0,minute:0,second:0,millisecond:0}),e},season:e=>{let t=e.season(),n="north";"South"===e.hemisphere()&&(n="south");for(let r=0;r(Y(e,{month:0,date:1,hour:0,minute:0,second:0,millisecond:0}),e),decade:e=>{let t=(e=e.startOf("year")).year(),n=10*parseInt(t/10,10);return e=e.year(n)},century:e=>{let t=(e=e.startOf("year")).year(),n=100*parseInt(t/100,10);return e=e.year(n)}};Ge.date=Ge.day;var Ve=function(e,t,n){if(!t||!n)return[];if(t=z(t),n=e.clone().set(n),e.isAfter(n)){let t=e;e=n,n=t}let r=e.clone();if(function(e){return!!ie().find((t=>t===e))||!!se().find((t=>t===e))}(t))r=r.next(t),t="week";else{r.startOf(t).isBefore(e)&&(r=r.next(t))}let a=[];for(;r.isBefore(n);)a.push(r),r=r.add(1,t);return a};var We=e=>{let n=e.timezones,r=e.tz;if(!1===n.hasOwnProperty(r)&&(r=y(e.tz,n)),null===r)return!1===e.silent&&console.warn("Warn: could not find given or local timezone - '"+e.tz+"'"),{current:{epochShift:0}};let a=n[r],o={name:(i=r,i=(i=(i=(i=(i=(i=(i=i[0].toUpperCase()+i.substr(1)).replace(/[\/_-]([a-z])/gi,(e=>e.toUpperCase()))).replace(/_(of|es)_/i,(e=>e.toLowerCase()))).replace(/\/gmt/i,"/GMT")).replace(/\/Dumontdurville$/i,"/DumontDUrville")).replace(/\/Mcmurdo$/i,"/McMurdo")).replace(/\/Port-au-prince$/i,"/Port-au-Prince")),hasDst:Boolean(a.dst),default_offset:a.offset,hemisphere:"s"===a.hem?"South":"North",current:{}};var i,s;if(o.hasDst){let e=(s=a.dst)?s.split("->"):[];o.change={start:e[0],back:e[1]}}let u=a.offset,l=u;return!0===o.hasDst&&(l="North"===o.hemisphere?u-1:a.offset+1),!1===o.hasDst?(o.current.offset=u,o.current.isDST=!1):!0===t(e.epoch,o.change.start,o.change.back,u,l)?(o.current.offset=u,o.current.isDST="North"===o.hemisphere):(o.current.offset=l,o.current.isDST="South"===o.hemisphere),o};const Je=["century","decade","year","month","date","day","hour","minute","second","millisecond"],Ke={set:function(e,t){let n=this.clone();return n=re(n,e),t&&(this.tz=y(t)),n},timezone:function(){return We(this)},isDST:function(){return We(this).current.isDST},hasDST:function(){return We(this).hasDst},offset:function(){return 60*We(this).current.offset},hemisphere:function(){return We(this).hemisphere},format:function(e){return fe(this,e)},unixFmt:function(e){return ge(this,e)},startOf:function(e){return((e,t)=>{let n=e.clone();return t=z(t),Ge[t]?Ge[t](n):"summer"===t||"winter"===t?(n=n.season(t),Ge.season(n)):n})(this,e)},endOf:function(e){return((e,t)=>{let n=e.clone();return t=z(t),Ge[t]?(n=Ge[t](n),n=n.add(1,t),n=n.subtract(1,"millisecond"),n):n})(this,e)},leapYear:function(){return g(this.year())},progress:function(e){return we(this,e)},nearest:function(e){return ve(this,e)},diff:function(e,t){return $e(this,e,t)},since:function(e){return e||(e=this.clone().set()),Ze(this,e)},next:function(e){return this.add(1,e).startOf(e)},last:function(e){return this.subtract(1,e).startOf(e)},isValid:function(){return!(!this.epoch&&0!==this.epoch)&&!isNaN(this.d.getTime())},goto:function(e){let t=this.clone();return t.tz=y(e,t.timezones),t},every:function(e,t){if("object"==typeof e&&"string"==typeof t){let n=t;t=e,e=n}return Ve(this,e,t)},isAwake:function(){let e=this.hour();return!(e<8||e>22)},isAsleep:function(){return!this.isAwake()},daysInMonth:function(){switch(this.month()){case 0:case 2:case 4:case 6:case 7:case 9:case 11:return 31;case 1:return this.leapYear()?29:28;case 3:case 5:case 8:case 10:return 30;default:throw new Error("Invalid Month state.")}},log:function(){return console.log(""),console.log(fe(this,"nice-short")),this},logYear:function(){return console.log(""),console.log(fe(this,"full-short")),this},json:function(){return Je.reduce(((e,t)=>(e[t]=this[t](),e)),{})},debug:function(){let e=this.timezone(),t=this.format("MM")+" "+this.format("date-ordinal")+" "+this.year();return t+="\n - "+this.format("time"),console.log("\n\n",t+"\n - "+e.name+" ("+e.current.offset+")"),this},from:function(e){return(e=this.clone().set(e)).since(this)},fromNow:function(){return this.clone().set(Date.now()).since(this)},weekStart:function(e){if("number"==typeof e)return this._weekStart=e,this;if("string"==typeof e){e=e.toLowerCase().trim();let t=ie().indexOf(e);-1===t&&(t=se().indexOf(e)),-1===t&&(t=1),this._weekStart=t}else console.warn("Spacetime Error: Cannot understand .weekStart() input:",e);return this}};Ke.inDST=Ke.isDST,Ke.round=Ke.nearest,Ke.each=Ke.every;var Re=Ke;const Xe=e=>("string"==typeof e&&(e=parseInt(e,10)),e),et=["year","month","date","hour","minute","second","millisecond"],tt=(e,t,n)=>{let r=et.indexOf(n),a=et.slice(r,et.length);for(let n=0;n=24?t=24:t<0&&(t=0);let r=e.clone(),a=e.hour()-t,o=a*T.hour;return e.epoch-=o,e.date()!==r.date()&&(e=r.clone(),a>1&&(a-=1),a<1&&(a+=1),o=a*T.hour,e.epoch-=o),Y(e,{hour:t}),tt(e,r,"minute"),(e=nt(e,r,n,"day")).epoch},ot=function(e,t){return"string"==typeof t&&/^'[0-9]{2}$/.test(t)&&(t=t.replace(/'/,"").trim(),t=(t=Number(t))>30?1900+t:2e3+t),t=Xe(t),Y(e,{year:t}),e.epoch};let it="am",st="pm";const ut={millisecond:function(e){if(void 0!==e){let t=this.clone();return t.epoch=function(e,t){t=Xe(t);let n=e.millisecond()-t;return e.epoch-n}(t,e),t}return this.d.getMilliseconds()},second:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){t=Xe(t);let r=e.clone(),a=(e.second()-t)*T.second;return e.epoch=e.epoch-a,(e=nt(e,r,n,"minute")).epoch}(n,e,t),n}return this.d.getSeconds()},minute:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=rt(n,e,t),n}return this.d.getMinutes()},hour:function(e,t){let n=this.d;if(void 0!==e){let n=this.clone();return n.epoch=at(n,e,t),n}return n.getHours()},hourFloat:function(e,t){if(void 0!==e){let n=this.clone(),r=e%1;r*=60;let a=parseInt(e,10);return n.epoch=at(n,a,t),n.epoch=rt(n,r,t),n}let n=this.d,r=n.getHours(),a=n.getMinutes();return a/=60,r+a},hour12:function(e,t){let n=this.d;if(void 0!==e){let n=this.clone(),r=(e=""+e).match(/^([0-9]+)(am|pm)$/);if(r){let e=parseInt(r[1],10);"pm"===r[2]&&(e+=12),n.epoch=at(n,e,t)}return n}let r=n.getHours();return r>12&&(r-=12),0===r&&(r=12),r},time:function(e,t){if(void 0!==e){let n=this.clone();return e=e.toLowerCase().trim(),n.epoch=function(e,t,n){let r=t.match(/([0-9]{1,2})[:h]([0-9]{1,2})(:[0-9]{1,2})? ?(am|pm)?/);if(!r){if(r=t.match(/([0-9]{1,2}) ?(am|pm)/),!r)return e.epoch;r.splice(2,0,"0"),r.splice(3,0,"")}let a=!1,o=parseInt(r[1],10),i=parseInt(r[2],10);i>=60&&(i=59),o>12&&(a=!0),!1===a&&("am"===r[4]&&12===o&&(o=0),"pm"===r[4]&&o<12&&(o+=12)),r[3]=r[3]||"",r[3]=r[3].replace(/:/,"");let s=parseInt(r[3],10)||0,u=e.clone();return e=(e=(e=(e=e.hour(o)).minute(i)).second(s)).millisecond(0),(e=nt(e,u,n,"day")).epoch}(n,e,t),n}return`${this.h12()}:${w(this.minute())}${this.ampm()}`},ampm:function(e,t){let n=it,r=this.hour();if(r>=12&&(n=st),"string"!=typeof e)return n;let a=this.clone();return e=e.toLowerCase().trim(),r>=12&&"am"===e?(r-=12,a.hour(r,t)):r<12&&"pm"===e?(r+=12,a.hour(r,t)):a},dayTime:function(e,t){if(void 0!==e){const n={morning:"7:00",breakfast:"7:00",noon:"12:00",lunch:"12:00",afternoon:"14:00",evening:"18:00",dinner:"18:00",night:"23:00",midnight:"00:00"};let r=this.clone();return e=(e=e||"").toLowerCase(),!0===n.hasOwnProperty(e)&&(r=r.time(n[e],t)),r}let n=this.hour();return n<6?"night":n<12?"morning":n<17?"afternoon":n<22?"evening":"night"},iso:function(e){return void 0!==e?this.set(e):this.format("iso")}};var lt=ut;const ct={date:function(e,t){if(void 0!==e){let n=this.clone();return(e=parseInt(e,10))&&(n.epoch=function(e,t,n){if((t=Xe(t))>28){let n=e.month(),r=x[n];1===n&&29===t&&g(e.year())&&(r=29),t>r&&(t=r)}t<=0&&(t=1);let r=e.clone();return Y(e,{date:t}),(e=nt(e,r,n,"month")).epoch}(n,e,t)),n}return this.d.getDate()},day:function(e,t){if(void 0===e)return this.d.getDay();let n=this.clone(),r=e;"string"==typeof e&&(e=e.toLowerCase(),ue.hasOwnProperty(e)?r=ue[e]:(r=ie().indexOf(e),-1===r&&(r=se().indexOf(e))));let a=this.d.getDay()-r;!0===t&&a>0&&(a-=7),!1===t&&a<0&&(a+=7);let o=this.subtract(a,"days");return Y(o,{hour:n.hour(),minute:n.minute(),second:n.second()}),o},dayName:function(e,t){if(void 0===e)return se()[this.day()];let n=this.clone();return n=n.day(e,t),n}};var ht=ct;const dt=e=>e=(e=(e=e.minute(0)).second(0)).millisecond(1),mt={dayOfYear:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){t=Xe(t);let r=e.clone();return(t-=1)<=0?t=0:t>=365&&(t=g(e.year())?365:364),e=(e=e.startOf("year")).add(t,"day"),tt(e,r,"hour"),(e=nt(e,r,n,"year")).epoch}(n,e,t),n}let n,r=0,a=this.d.getMonth();for(let e=1;e<=a;e++)n=new Date,n.setDate(1),n.setFullYear(this.d.getFullYear()),n.setHours(1),n.setMinutes(1),n.setMonth(e),n.setHours(-2),r+=n.getDate();return r+this.d.getDate()},week:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){let r=e.clone();return t=Xe(t),"december"===(e=(e=(e=e.month(0)).date(1)).day("monday")).monthName()&&e.date()>=28&&(e=e.add(1,"week")),t-=1,e=e.add(t,"weeks"),(e=nt(e,r,n,"year")).epoch}(this,e,t),n=dt(n),n}let n=this.clone();n=n.month(0),n=n.date(1),n=dt(n),n=n.day("monday"),11===n.month()&&n.date()>=25&&(n=n.add(1,"week"));let r=1;1===n.date()&&(r=0),n=n.minus(1,"second");const a=this.epoch;if(n.epoch>a)return 1;let o=0,i=4*this.month();for(n.epoch+=T.week*i,o+=i;o<=52;o++){if(n.epoch>a)return o+r;n=n.add(1,"week")}return 52},month:function(e,t){if(void 0!==e){let n=this.clone();return n.epoch=function(e,t,n){"string"==typeof t&&("sept"===t&&(t="sep"),t=B()[t.toLowerCase()]),(t=Xe(t))>=12&&(t=11),t<=0&&(t=0);let r=e.date();r>x[t]&&(r=x[t]);let a=e.clone();return Y(e,{month:t,d:r}),(e=nt(e,a,n,"year")).epoch}(n,e,t),n}return this.d.getMonth()},monthName:function(e,t){if(void 0!==e){let n=this.clone();return n=n.month(e,t),n}return P[this.month()]},quarter:function(e,t){if(void 0!==e&&("string"==typeof e&&(e=e.replace(/^q/i,""),e=parseInt(e,10)),Qe[e])){let n=this.clone(),r=Qe[e][0];return n=n.month(r,t),n=n.date(1,t),n=n.startOf("day"),n}let n=this.d.getMonth();for(let e=1;e=Ue[n][e][1]&&r0&&(t.epoch=ot(t,-1*n)),"ad"===e&&n<0&&(t.epoch=ot(t,-1*n)),t}return this.d.getFullYear()<0?"BC":"AD"},decade:function(e){if(void 0!==e){if(!(e=(e=(e=String(e)).replace(/([0-9])'?s$/,"$1")).replace(/([0-9])(th|rd|st|nd)/,"$1")))return console.warn("Spacetime: Invalid decade input"),this;2===e.length&&/[0-9][0-9]/.test(e)&&(e="19"+e);let t=Number(e);return isNaN(t)?this:(t=10*Math.floor(t/10),this.year(t))}return this.startOf("decade").year()},century:function(e){if(void 0!==e){"string"==typeof e&&(e=(e=(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1")).replace(/([0-9]+) ?(b\.?c\.?|a\.?d\.?)/i,((e,t,n)=>(n.match(/b\.?c\.?/i)&&(t="-"+t),t)))).replace(/c$/,""));let t=Number(e);return isNaN(e)?(console.warn("Spacetime: Invalid century input"),this):(0===t&&(t=1),t=t>=0?100*(t-1):100*(t+1),this.year(t))}let t=this.startOf("century").year();return t=Math.floor(t/100),t<0?t-1:t+1},millenium:function(e){if(void 0!==e){if("string"==typeof e&&(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1"),e=Number(e),isNaN(e)))return console.warn("Spacetime: Invalid millenium input"),this;e>0&&(e-=1);let t=1e3*e;return 0===t&&(t=1),this.year(t)}let t=Math.floor(this.year()/1e3);return t>=0&&(t+=1),t}};var ft=mt;const pt=Object.assign({},lt,ht,ft);pt.milliseconds=pt.millisecond,pt.seconds=pt.second,pt.minutes=pt.minute,pt.hours=pt.hour,pt.hour24=pt.hour,pt.h12=pt.hour12,pt.h24=pt.hour24,pt.days=pt.day;var yt=e=>{Object.keys(pt).forEach((t=>{e.prototype[t]=pt[t]}))};const gt=function(e,t){return 1===e&&g(t)?29:x[e]},bt=(e,t)=>{if(e.month>0){let n=parseInt(e.month/12,10);e.year=t.year()+n,e.month=e.month%12}else if(e.month<0){let n=Math.abs(e.month),r=parseInt(n/12,10);n%12!=0&&(r+=1),e.year=t.year()-r,e.month=e.month%12,e.month=e.month+12,12===e.month&&(e.month=0)}return e},kt=(e,t,n)=>{let r=t.year(),a=t.month(),o=gt(a,r);for(;n>o;)n-=o,a+=1,a>=12&&(a-=12,r+=1),o=gt(a,r);return e.month=a,e.date=n,e},wt=(e,t,n)=>{e.year=t.year(),e.month=t.month();let r=t.date();for(e.date=r-Math.abs(n);e.date<1;){e.month-=1,e.month<0&&(e.month=11,e.year-=1);let t=gt(e.month,e.year);e.date+=t}return e},vt=["millisecond","second","minute","hour","date","month"];let _t={second:vt.slice(0,1),minute:vt.slice(0,2),quarterhour:vt.slice(0,2),hour:vt.slice(0,3),date:vt.slice(0,4),month:vt.slice(0,4),quarter:vt.slice(0,4),season:vt.slice(0,4),year:vt,decade:vt,century:vt};_t.week=_t.hour,_t.season=_t.date,_t.quarter=_t.date;const zt={year:!0,quarter:!0,season:!0,month:!0,week:!0,date:!0},jt={month:!0,quarter:!0,season:!0,year:!0};var $t=e=>{e.prototype.add=function(e,t){let n=this.clone();if(!t||0===e)return n;let r=this.clone();if("millisecond"===(t=z(t)))return n.epoch+=e,n;"fortnight"===t&&(e*=2,t="week"),T[t]?n.epoch+=T[t]*e:"week"===t||"weekend"===t?n.epoch+=T.day*(7*e):"quarter"===t||"season"===t?n.epoch+=T.month*(3*e):"quarterhour"===t&&(n.epoch+=15*T.minute*e);let a={};if(_t[t]&&_t[t].forEach((e=>{a[e]=r[e]()})),zt[t]){const e=r.timezone().current.offset-n.timezone().current.offset;n.epoch+=3600*e*1e3}if("month"===t&&(a.month=r.month()+e,a=bt(a,r)),"week"===t){let t=r.date()+7*e;t<=28&&t>1&&(a.date=t)}if("weekend"===t&&"saturday"!==n.dayName())n=n.day("saturday",!0);else if("date"===t){if(e<0)a=wt(a,r,e);else{let t=r.date()+e;a=kt(a,r,t)}0!==e&&r.isSame(n,"day")&&(a.date=r.date()+e)}else if("quarter"===t){if(a.month=r.month()+3*e,a.year=r.year(),a.month<0){let e=Math.floor(a.month/12),t=a.month+12*Math.abs(e);a.month=t,a.year+=e}else if(a.month>=12){let e=Math.floor(a.month/12);a.month=a.month%12,a.year+=e}a.date=r.date()}else if("year"===t){let t=r.year()+e,a=n.year();if(at){let t=Math.floor(e/4)||1;n.epoch+=T.day*t}}else"decade"===t?a.year=n.year()+10:"century"===t&&(a.year=n.year()+100);if(jt[t]){let e=x[a.month];a.date=r.date(),a.date>e&&(a.date=e)}return Object.keys(a).length>1&&Y(n,a),n},e.prototype.subtract=function(e,t){return this.clone().add(-1*e,t)},e.prototype.minus=e.prototype.subtract,e.prototype.plus=e.prototype.add};const Ot={millisecond:e=>e.epoch,second:e=>[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second()].join("-"),minute:e=>[e.year(),e.month(),e.date(),e.hour(),e.minute()].join("-"),hour:e=>[e.year(),e.month(),e.date(),e.hour()].join("-"),day:e=>[e.year(),e.month(),e.date()].join("-"),week:e=>[e.year(),e.week()].join("-"),month:e=>[e.year(),e.month()].join("-"),quarter:e=>[e.year(),e.quarter()].join("-"),year:e=>e.year()};Ot.date=Ot.day;var Dt=e=>{e.prototype.isSame=function(t,n,r=!0){let a=this;if(!n)return null;if("string"==typeof t&&"object"==typeof n){let e=t;t=n,n=e}return"string"!=typeof t&&"number"!=typeof t||(t=new e(t,this.timezone.name)),n=n.replace(/s$/,""),!0===r&&a.tz!==t.tz&&((t=t.clone()).tz=a.tz),Ot[n]?Ot[n](a)===Ot[n](t):null}};var Mt=e=>{const t={isAfter:function(e){let t=j(e=$(e,this));return null===t?null:this.epoch>t},isBefore:function(e){let t=j(e=$(e,this));return null===t?null:this.epoch{e.prototype[n]=t[n]}))};var St=e=>{const t={i18n:function(e){var t,n,r;return k(e.days)&&(t=e.days,ae=t.short||ae,oe=t.long||oe),k(e.months)&&function(e){F=e.short||F,P=e.long||P}(e.months),r=e.useTitleCase,"[object Boolean]"===Object.prototype.toString.call(r)&&(n=e.useTitleCase,le=n),k(e.ampm)&&function(e){it=e.am||it,st=e.pm||st}(e.ampm),k(e.distance)&&function(e){Ae=e.pastDistance||Ae,Ye=e.futureDistance||Ye,qe=e.past||qe,Ne=e.future||Ne,Ie=e.present||Ie,Ee=e.now||Ee,Te=e.almost||Te,Ce=e.over||Ce}(e.distance),k(e.units)&&function(e={}){Me={second:e.second||Me.second,seconds:e.seconds||Me.seconds,minute:e.minute||Me.minute,minutes:e.minutes||Me.minutes,hour:e.hour||Me.hour,hours:e.hours||Me.hours,day:e.day||Me.day,days:e.days||Me.days,month:e.month||Me.month,months:e.months||Me.months,year:e.year||Me.year,years:e.years||Me.years}}(e.units),this}};Object.keys(t).forEach((n=>{e.prototype[n]=t[n]}))};let qt=i;const Nt=function(e,t,r={}){this.epoch=null,this.tz=y(t,qt),this.silent=void 0===r.silent||r.silent,this.british=r.dmy||r.british,this._weekStart=1,void 0!==r.weekStart&&(this._weekStart=r.weekStart),this._today={},void 0!==r.today&&(this._today=r.today),Object.defineProperty(this,"d",{get:function(){let e=n(this),t=(new Date(this.epoch).getTimezoneOffset()||0)+60*e;t=60*t*1e3;let r=this.epoch+t;return new Date(r)}}),Object.defineProperty(this,"timezones",{get:()=>qt,set:e=>(qt=e,e)});let a=re(this,e);this.epoch=a.epoch,a.tz&&(this.tz=a.tz)};Object.keys(Re).forEach((e=>{Nt.prototype[e]=Re[e]})),Nt.prototype.clone=function(){return new Nt(this.epoch,this.tz,{silent:this.silent,weekStart:this._weekStart,today:this._today,parsers:this.parsers})},Nt.prototype.toLocalDate=function(){return this.toNativeDate()},Nt.prototype.toNativeDate=function(){return new Date(this.epoch)},yt(Nt),$t(Nt),Dt(Nt),Mt(Nt),St(Nt);var It=Nt;var Et=(e,t)=>{let n=new It(null),r=new It(null);n=n.time(e),r=t?r.time(t):n.add(59,"minutes");let a=n.hour(),o=r.hour();return Object.keys(n.timezones).filter((e=>{if(-1===e.indexOf("/"))return!1;let t=new It(null,e),i=t.hour();return i>=a&&i<=o&&(!(i===a&&t.minute()r.minute()))}))};const Tt=(e,t,n)=>new It(e,t,n),Ct=function(e){let t=e._today||{};return Object.keys(t).forEach((n=>{e=e[n](t[n])})),e};Tt.now=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n},Tt.today=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n.startOf("day")},Tt.tomorrow=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n.add(1,"day").startOf("day")},Tt.yesterday=(e,t)=>{let n=new It((new Date).getTime(),e,t);return n=Ct(n),n.subtract(1,"day").startOf("day")},Tt.extend=function(e={}){return Object.keys(e).forEach((t=>{It.prototype[t]=e[t]})),this},Tt.timezones=function(){return(new It).timezones},Tt.max=function(e,t){let n=new It(null,e,t);return n.epoch=864e13,n},Tt.min=function(e,t){let n=new It(null,e,t);return n.epoch=-864e13,n},Tt.whereIts=Et,Tt.version="7.6.0",Tt.plugin=Tt.extend;export{Tt as default}; diff --git a/changelog.md b/changelog.md index 3a1b140f..9765d400 100644 --- a/changelog.md +++ b/changelog.md @@ -9,6 +9,15 @@ This project follows semVer, where: --> +### 7.6.0 [Feb 2024] + +- **[fix]** - leap-year string parse issue +- **[change]** - typescript export changes #408 #409 (thanks jecraig!) +- **[update]** - DST date changes for metlakatla, kiev, ciudad_juarez +- **[update]** - late DST date changes for gaza, hebron +- **[change]** - update github script +- **[update]** - deps + ### 7.5.0 [Dec 2023] - **[fix]** - offset in Africa/Cairo #404 diff --git a/package-lock.json b/package-lock.json index 35a6d01f..c2f80675 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,10 +22,10 @@ "rollup-plugin-terser": "7.0.2", "shelljs": "0.8.5", "tap-dancer": "0.3.4", - "tape": "5.7.2", + "tape": "5.7.4", "timekeeper": "2.3.1", "tslib": "2.6.2", - "tsx": "4.7.0", + "tsx": "4.7.1", "typescript": "5.3.3" } }, @@ -1045,9 +1045,9 @@ } }, "node_modules/available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.6.tgz", + "integrity": "sha512-j1QzY8iPNPG4o4xmO3ptzpRxTciqD3MgEHtifP/YnJpIo58Xu+ne4BejlbkuaLfXn/nz6HFiw29bLpj2PNMdGg==", "dev": true, "engines": { "node": ">= 0.4" @@ -1331,15 +1331,15 @@ } }, "node_modules/deep-equal": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.2.tgz", - "integrity": "sha512-xjVyBf0w5vH0I42jdAZzOKVldmPgSulmiyPRywoyq7HXC9qdgo17kxJE+rdnif5Tz6+pIrpJI8dCpMNLIGkUiA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", + "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.2", + "call-bind": "^1.0.5", "es-get-iterator": "^1.1.3", - "get-intrinsic": "^1.2.1", + "get-intrinsic": "^1.2.2", "is-arguments": "^1.1.1", "is-array-buffer": "^3.0.2", "is-date-object": "^1.0.5", @@ -1349,11 +1349,14 @@ "object-is": "^1.1.5", "object-keys": "^1.1.1", "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.0", + "regexp.prototype.flags": "^1.5.1", "side-channel": "^1.0.4", "which-boxed-primitive": "^1.0.2", "which-collection": "^1.0.1", - "which-typed-array": "^1.1.9" + "which-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1392,11 +1395,12 @@ } }, "node_modules/define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, "dependencies": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, @@ -1493,6 +1497,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-get-iterator": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", @@ -1782,15 +1795,19 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1929,13 +1946,16 @@ } }, "node_modules/has-dynamic-import": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.0.1.tgz", - "integrity": "sha512-X3fbtsZmwb6W7fJGR9o7x65fZoodygCrZ3TVycvghP62yYQfS0t4RS0Qcz+j5tQYUKeSWS09tHkWW6WhFV3XhQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.1.0.tgz", + "integrity": "sha512-su0anMkNEnJKZ/rB99jn3y6lV/J8Ro96hBJ28YAeVzj5rWxH+YL/AdCyiYYA1HDLV9YhmvqpWSJJj2KLo1MX6g==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "call-bind": "^1.0.5", + "get-intrinsic": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1987,12 +2007,12 @@ } }, "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, "dependencies": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -2764,16 +2784,16 @@ } }, "node_modules/mock-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/mock-property/-/mock-property-1.0.2.tgz", - "integrity": "sha512-GHVKHd3bFiXtvZtp23+8+EQLMeDJWcEVrSA2pOBs1KB5Uh2ww8Q+9fYDljS67k3GzU4DIDBa6+qRIgfZ2Bp+gQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/mock-property/-/mock-property-1.0.3.tgz", + "integrity": "sha512-2emPTb1reeLLYwHxyVx993iYyCHEiRRO+y8NFXFPL5kl5q14sgTK76cXyEKkeKCHeRw35SfdkUJ10Q1KfHuiIQ==", "dev": true, "dependencies": { - "define-data-property": "^1.1.0", + "define-data-property": "^1.1.1", "functions-have-names": "^1.2.3", "gopd": "^1.0.1", - "has": "^1.0.3", "has-property-descriptors": "^1.0.0", + "hasown": "^2.0.0", "isarray": "^2.0.5" }, "engines": { @@ -2918,13 +2938,13 @@ } }, "node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, @@ -3722,31 +3742,31 @@ } }, "node_modules/tape": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.7.2.tgz", - "integrity": "sha512-cvSyprYahyOYXbtBwV/B7nrx7kINeZ3VZ9fKoSywoPwZN3oQ1WVLvt+Vl0XCz/gi37CDrY3dlW790nzviIzoPw==", + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.7.4.tgz", + "integrity": "sha512-uaigP+5H9+E8aaMLKMbGkDd33G5TKu4UFpapqT7um+8xSHQQUS2lJNd+hTj9fFVQLg8bmcIofwc8b9f6+ISSfQ==", "dev": true, "dependencies": { "@ljharb/resumer": "^0.0.1", "@ljharb/through": "^2.3.11", "array.prototype.every": "^1.1.5", "call-bind": "^1.0.5", - "deep-equal": "^2.2.2", + "deep-equal": "^2.2.3", "defined": "^1.0.1", "dotignore": "^0.1.2", "for-each": "^0.3.3", "get-package-type": "^0.1.0", "glob": "^7.2.3", - "has-dynamic-import": "^2.0.1", + "has-dynamic-import": "^2.1.0", "hasown": "^2.0.0", "inherits": "^2.0.4", "is-regex": "^1.1.4", "minimist": "^1.2.8", - "mock-property": "^1.0.2", + "mock-property": "^1.0.3", "object-inspect": "^1.13.1", "object-is": "^1.1.5", "object-keys": "^1.1.1", - "object.assign": "^4.1.4", + "object.assign": "^4.1.5", "resolve": "^2.0.0-next.5", "string.prototype.trim": "^1.2.8" }, @@ -3889,9 +3909,9 @@ "dev": true }, "node_modules/tsx": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.0.tgz", - "integrity": "sha512-I+t79RYPlEYlHn9a+KzwrvEwhJg35h/1zHsLC2JXvhC2mdynMv6Zxzvhv5EMV6VF5qJlLlkSnMVvdZV3PSIGcg==", + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.1.tgz", + "integrity": "sha512-8d6VuibXHtlN5E3zFkgY8u4DX7Y3Z27zvvPKVmLon/D4AjuKzarkUBTLDBgj9iTQ0hg5xM7c/mYiRVM+HETf0g==", "dev": true, "dependencies": { "esbuild": "~0.19.10", @@ -4117,16 +4137,16 @@ "dev": true }, "node_modules/which-typed-array": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", - "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", + "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", "dev": true, "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "available-typed-arrays": "^1.0.6", + "call-bind": "^1.0.5", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "has-tostringtag": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -4907,9 +4927,9 @@ } }, "available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.6.tgz", + "integrity": "sha512-j1QzY8iPNPG4o4xmO3ptzpRxTciqD3MgEHtifP/YnJpIo58Xu+ne4BejlbkuaLfXn/nz6HFiw29bLpj2PNMdGg==", "dev": true }, "balanced-match": { @@ -5135,15 +5155,15 @@ "dev": true }, "deep-equal": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.2.tgz", - "integrity": "sha512-xjVyBf0w5vH0I42jdAZzOKVldmPgSulmiyPRywoyq7HXC9qdgo17kxJE+rdnif5Tz6+pIrpJI8dCpMNLIGkUiA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", + "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", "dev": true, "requires": { "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.2", + "call-bind": "^1.0.5", "es-get-iterator": "^1.1.3", - "get-intrinsic": "^1.2.1", + "get-intrinsic": "^1.2.2", "is-arguments": "^1.1.1", "is-array-buffer": "^3.0.2", "is-date-object": "^1.0.5", @@ -5153,11 +5173,11 @@ "object-is": "^1.1.5", "object-keys": "^1.1.1", "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.0", + "regexp.prototype.flags": "^1.5.1", "side-channel": "^1.0.4", "which-boxed-primitive": "^1.0.2", "which-collection": "^1.0.1", - "which-typed-array": "^1.1.9" + "which-typed-array": "^1.1.13" }, "dependencies": { "isarray": { @@ -5189,11 +5209,12 @@ } }, "define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, "requires": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } @@ -5272,6 +5293,12 @@ "which-typed-array": "^1.1.11" } }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, "es-get-iterator": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", @@ -5494,15 +5521,16 @@ "dev": true }, "get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" } }, "get-package-type": { @@ -5599,13 +5627,13 @@ "dev": true }, "has-dynamic-import": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.0.1.tgz", - "integrity": "sha512-X3fbtsZmwb6W7fJGR9o7x65fZoodygCrZ3TVycvghP62yYQfS0t4RS0Qcz+j5tQYUKeSWS09tHkWW6WhFV3XhQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.1.0.tgz", + "integrity": "sha512-su0anMkNEnJKZ/rB99jn3y6lV/J8Ro96hBJ28YAeVzj5rWxH+YL/AdCyiYYA1HDLV9YhmvqpWSJJj2KLo1MX6g==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "call-bind": "^1.0.5", + "get-intrinsic": "^1.2.2" } }, "has-flag": { @@ -5636,12 +5664,12 @@ "dev": true }, "has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, "requires": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" } }, "hasha": { @@ -6213,16 +6241,16 @@ "dev": true }, "mock-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/mock-property/-/mock-property-1.0.2.tgz", - "integrity": "sha512-GHVKHd3bFiXtvZtp23+8+EQLMeDJWcEVrSA2pOBs1KB5Uh2ww8Q+9fYDljS67k3GzU4DIDBa6+qRIgfZ2Bp+gQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/mock-property/-/mock-property-1.0.3.tgz", + "integrity": "sha512-2emPTb1reeLLYwHxyVx993iYyCHEiRRO+y8NFXFPL5kl5q14sgTK76cXyEKkeKCHeRw35SfdkUJ10Q1KfHuiIQ==", "dev": true, "requires": { - "define-data-property": "^1.1.0", + "define-data-property": "^1.1.1", "functions-have-names": "^1.2.3", "gopd": "^1.0.1", - "has": "^1.0.3", "has-property-descriptors": "^1.0.0", + "hasown": "^2.0.0", "isarray": "^2.0.5" }, "dependencies": { @@ -6328,13 +6356,13 @@ "dev": true }, "object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", "has-symbols": "^1.0.3", "object-keys": "^1.1.1" } @@ -6964,31 +6992,31 @@ } }, "tape": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.7.2.tgz", - "integrity": "sha512-cvSyprYahyOYXbtBwV/B7nrx7kINeZ3VZ9fKoSywoPwZN3oQ1WVLvt+Vl0XCz/gi37CDrY3dlW790nzviIzoPw==", + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.7.4.tgz", + "integrity": "sha512-uaigP+5H9+E8aaMLKMbGkDd33G5TKu4UFpapqT7um+8xSHQQUS2lJNd+hTj9fFVQLg8bmcIofwc8b9f6+ISSfQ==", "dev": true, "requires": { "@ljharb/resumer": "^0.0.1", "@ljharb/through": "^2.3.11", "array.prototype.every": "^1.1.5", "call-bind": "^1.0.5", - "deep-equal": "^2.2.2", + "deep-equal": "^2.2.3", "defined": "^1.0.1", "dotignore": "^0.1.2", "for-each": "^0.3.3", "get-package-type": "^0.1.0", "glob": "^7.2.3", - "has-dynamic-import": "^2.0.1", + "has-dynamic-import": "^2.1.0", "hasown": "^2.0.0", "inherits": "^2.0.4", "is-regex": "^1.1.4", "minimist": "^1.2.8", - "mock-property": "^1.0.2", + "mock-property": "^1.0.3", "object-inspect": "^1.13.1", "object-is": "^1.1.5", "object-keys": "^1.1.1", - "object.assign": "^4.1.4", + "object.assign": "^4.1.5", "resolve": "^2.0.0-next.5", "string.prototype.trim": "^1.2.8" }, @@ -7102,9 +7130,9 @@ "dev": true }, "tsx": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.0.tgz", - "integrity": "sha512-I+t79RYPlEYlHn9a+KzwrvEwhJg35h/1zHsLC2JXvhC2mdynMv6Zxzvhv5EMV6VF5qJlLlkSnMVvdZV3PSIGcg==", + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.1.tgz", + "integrity": "sha512-8d6VuibXHtlN5E3zFkgY8u4DX7Y3Z27zvvPKVmLon/D4AjuKzarkUBTLDBgj9iTQ0hg5xM7c/mYiRVM+HETf0g==", "dev": true, "requires": { "esbuild": "~0.19.10", @@ -7276,16 +7304,16 @@ "dev": true }, "which-typed-array": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", - "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", + "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", "dev": true, "requires": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "available-typed-arrays": "^1.0.6", + "call-bind": "^1.0.5", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "has-tostringtag": "^1.0.1" } }, "wrap-ansi": { diff --git a/package.json b/package.json index d86434f8..9f74fbe0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "spacetime", - "version": "7.5.0", + "version": "7.6.0", "description": "figure-out dates across timezones", "main": "src/index.js", "unpkg": "builds/spacetime.min.js", @@ -60,10 +60,10 @@ "rollup-plugin-terser": "7.0.2", "shelljs": "0.8.5", "tap-dancer": "0.3.4", - "tape": "5.7.2", + "tape": "5.7.4", "timekeeper": "2.3.1", "tslib": "2.6.2", - "tsx": "4.7.0", + "tsx": "4.7.1", "typescript": "5.3.3" }, "license": "Apache-2.0" diff --git a/src/_version.js b/src/_version.js index 31add70e..f5edafb5 100644 --- a/src/_version.js +++ b/src/_version.js @@ -1 +1 @@ -export default '7.5.0' \ No newline at end of file +export default '7.6.0' \ No newline at end of file diff --git a/zonefile/_build.js b/zonefile/_build.js index 94cdd435..5f04eee6 100644 --- a/zonefile/_build.js +++ b/zonefile/_build.js @@ -20,13 +20,12 @@ export default { "4|n": "2/baku,2/dubai,2/muscat,2/tbilisi,2/yerevan,8/astrakhan,8/samara,8/saratov,8/ulyanovsk,8/volgograd,9/mahe,9/mauritius,2/volgograd", "4.5|n": "2/kabul", "3|s": "12/syowa,9/antananarivo", - "3|n|04/28:00->10/26:24": "0/cairo,egypt", - "3|n|03/31:03->10/27:04": "2/famagusta,2/nicosia,8/athens,8/bucharest,8/helsinki,8/mariehamn,8/riga,8/sofia,8/tallinn,8/uzhgorod,8/vilnius,8/zaporozhye,8/nicosia,eet", + "3|n|04/26:00->10/31:24": "0/cairo,egypt", + "3|n|04/20:02->10/26:02": "2/gaza,2/hebron", + "3|n|03/31:03->10/27:04": "2/famagusta,2/nicosia,8/athens,8/bucharest,8/helsinki,8/kyiv,8/mariehamn,8/riga,8/sofia,8/tallinn,8/uzhgorod,8/vilnius,8/zaporozhye,8/nicosia,8/kiev,eet", "3|n|03/31:02->10/27:03": "8/chisinau,8/tiraspol", "3|n|03/31:00->10/26:24": "2/beirut", - "3|n|03/31:00->10/25:01": "2/gaza,2/hebron", "3|n|03/29:02->10/27:02": "2/jerusalem,2/tel_aviv,israel", - "3|n|03/26:03->10/29:04": "8/kyiv,8/kiev", "3|n": "0/addis_ababa,0/asmara,0/asmera,0/dar_es_salaam,0/djibouti,0/juba,0/kampala,0/mogadishu,0/nairobi,2/aden,2/amman,2/baghdad,2/bahrain,2/damascus,2/kuwait,2/qatar,2/riyadh,8/istanbul,8/kirov,8/minsk,8/moscow,8/simferopol,9/comoro,9/mayotte,2/istanbul,turkey,w-su", "3.5|n": "2/tehran,iran", "2|s|03/31:02->10/27:02": "12/troll", @@ -57,14 +56,13 @@ export default { "-9|n|03/10:02->11/03:02": "1/adak,1/atka,us/aleutian", "-9|n": "11/gambier", "-9.5|n": "11/marquesas", - "-8|n|03/10:02->11/03:02": "1/anchorage,1/juneau,1/nome,1/sitka,1/yakutat,us/alaska", - "-8|n": "1/metlakatla,11/pitcairn", + "-8|n|03/10:02->11/03:02": "1/anchorage,1/juneau,1/metlakatla,1/nome,1/sitka,1/yakutat,us/alaska", + "-8|n": "11/pitcairn", "-7|n|03/10:02->11/03:02": "1/los_angeles,1/santa_isabel,1/tijuana,1/vancouver,1/ensenada,6/pacific,10/bajanorte,us/pacific-new,us/pacific", "-7|n": "1/creston,1/dawson,1/dawson_creek,1/fort_nelson,1/hermosillo,1/mazatlan,1/phoenix,1/whitehorse,6/yukon,10/bajasur,us/arizona,mst", "-6|s|04/06:22->09/07:22": "11/easter,7/easterisland", "-6|n|04/07:02->10/27:02": "1/merida", - "-6|n|03/12:02->11/05:02": "1/ciudad_juarez", - "-6|n|03/10:02->11/03:02": "1/boise,1/cambridge_bay,1/denver,1/edmonton,1/inuvik,1/north_dakota,1/ojinaga,1/yellowknife,1/shiprock,6/mountain,navajo,us/mountain", + "-6|n|03/10:02->11/03:02": "1/boise,1/cambridge_bay,1/denver,1/edmonton,1/inuvik,1/north_dakota,1/ojinaga,1/ciudad_juarez,1/yellowknife,1/shiprock,6/mountain,navajo,us/mountain", "-6|n": "1/bahia_banderas,1/belize,1/chihuahua,1/costa_rica,1/el_salvador,1/guatemala,1/managua,1/mexico_city,1/monterrey,1/regina,1/swift_current,1/tegucigalpa,11/galapagos,6/east-saskatchewan,6/saskatchewan,10/general", "-5|s": "1/lima,1/rio_branco,1/porto_acre,5/acre", "-5|n|03/10:02->11/03:02": "1/chicago,1/matamoros,1/menominee,1/rainy_river,1/rankin_inlet,1/resolute,1/winnipeg,1/indiana/knox,1/indiana/tell_city,1/north_dakota/beulah,1/north_dakota/center,1/north_dakota/new_salem,1/knox_in,6/central,us/central,us/indiana-starke",