@triptease/tt-date-picker 6.0.18 → 6.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/TtDatePicker.js +6 -1
- package/dist/src/TtDatePicker.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/types.d.ts +25 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +16 -7
- package/.editorconfig +0 -29
- package/CHANGELOG.md +0 -81
- package/demo/index.html +0 -26
- package/dist/test/date-picker.test.d.ts +0 -1
- package/dist/test/date-picker.test.js +0 -57
- package/dist/test/date-picker.test.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/web/FocusEvent.d.js +0 -4
- package/dist/web/FocusEvent.d.js.map +0 -7
- package/dist/web/TtDatePicker.js +0 -7619
- package/dist/web/TtDatePicker.js.map +0 -7
- package/dist/web/helpers.js +0 -6475
- package/dist/web/helpers.js.map +0 -7
- package/dist/web/index.js +0 -9008
- package/dist/web/index.js.map +0 -7
- package/dist/web/styles.js +0 -659
- package/dist/web/styles.js.map +0 -7
- package/dist/web/tt-date-picker.js +0 -9008
- package/dist/web/tt-date-picker.js.map +0 -7
- package/src/FocusEvent.d.ts +0 -13
- package/src/TtDatePicker.ts +0 -249
- package/src/helpers.ts +0 -7
- package/src/index.ts +0 -1
- package/src/styles.ts +0 -67
- package/src/tt-date-picker.ts +0 -23
- package/test/date-picker.test.ts +0 -78
- package/tsconfig.json +0 -22
- package/web-dev-server.config.js +0 -27
- package/web-test-runner.config.js +0 -41
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../node_modules/tslib/tslib.es6.mjs", "../../../../node_modules/@lit/reactive-element/src/css-tag.ts", "../../../../node_modules/@lit/reactive-element/src/reactive-element.ts", "../../../../node_modules/lit-html/src/lit-html.ts", "../../../../node_modules/lit-element/src/lit-element.ts", "../../../../node_modules/@lit/reactive-element/src/decorators/property.ts", "../../../../node_modules/@lit/reactive-element/src/decorators/state.ts", "../../../../node_modules/@lit/reactive-element/src/decorators/base.ts", "../../../../node_modules/@lit/reactive-element/src/decorators/query.ts", "../../../../node_modules/@lit/reactive-element/src/decorators/query-all.ts", "../../../../node_modules/@lit/reactive-element/src/decorators/query-assigned-elements.ts", "../../../../node_modules/lit-html/src/directive.ts", "../../../../node_modules/lit-html/src/directives/class-map.ts", "../../../../node_modules/lit-html/src/directives/unsafe-html.ts", "../../../../node_modules/lit-html/src/directives/unsafe-svg.ts", "../../../../node_modules/luxon/src/errors.js", "../../../../node_modules/luxon/src/impl/formats.js", "../../../../node_modules/luxon/src/zone.js", "../../../../node_modules/luxon/src/zones/systemZone.js", "../../../../node_modules/luxon/src/zones/IANAZone.js", "../../../../node_modules/luxon/src/impl/locale.js", "../../../../node_modules/luxon/src/zones/fixedOffsetZone.js", "../../../../node_modules/luxon/src/zones/invalidZone.js", "../../../../node_modules/luxon/src/impl/zoneUtil.js", "../../../../node_modules/luxon/src/impl/digits.js", "../../../../node_modules/luxon/src/settings.js", "../../../../node_modules/luxon/src/impl/invalid.js", "../../../../node_modules/luxon/src/impl/conversions.js", "../../../../node_modules/luxon/src/impl/util.js", "../../../../node_modules/luxon/src/impl/english.js", "../../../../node_modules/luxon/src/impl/formatter.js", "../../../../node_modules/luxon/src/impl/regexParser.js", "../../../../node_modules/luxon/src/duration.js", "../../../../node_modules/luxon/src/interval.js", "../../../../node_modules/luxon/src/info.js", "../../../../node_modules/luxon/src/impl/diff.js", "../../../../node_modules/luxon/src/impl/tokenParser.js", "../../../../node_modules/luxon/src/datetime.js", "../../../../node_modules/@lit/context/src/lib/create-context.ts", "../../../tt-calendar/src/DateSelectionContext.ts", "../../../icons/src/icons/calendar.ts", "../../../icons/src/icons/chevron.ts", "../../../icons/src/icons/chevron-down.ts", "../../../icons/src/icons/double-chevron.ts", "../../../icons/src/icons/keyboard.ts", "../../../tt-calendar/src/Styles.ts", "../../../tt-calendar/src/helpers.ts", "../../../tt-calendar/src/TtCalendar.ts", "../../../tt-calendar/src/tt-calendar.ts", "../../../../node_modules/lit-html/src/directives/if-defined.ts", "../../../../node_modules/lit-html/src/directives/guard.ts", "../../node_modules/@triptease/tt-date-input/src/DateInput.ts", "../../node_modules/@triptease/tt-date-input/src/tt-date-input.ts", "../../node_modules/@triptease/tt-dialog/src/styles.ts", "../../node_modules/@triptease/tt-dialog/src/focus-trap.ts", "../../node_modules/@triptease/tt-dialog/src/TtDialog.ts", "../../node_modules/@triptease/tt-dialog/src/tt-dialog.ts", "../../src/helpers.ts", "../../src/styles.ts", "../../src/TtDatePicker.ts", "../../src/tt-date-picker.ts"],
|
|
4
|
-
"sourcesContent": ["/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n", "/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nconst NODE_MODE = false;\n\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\n/**\n * Whether the current browser supports `adoptedStyleSheets`.\n */\nexport const supportsAdoptingStyleSheets: boolean =\n global.ShadowRoot &&\n (global.ShadyCSS === undefined || global.ShadyCSS.nativeShadow) &&\n 'adoptedStyleSheets' in Document.prototype &&\n 'replace' in CSSStyleSheet.prototype;\n\n/**\n * A CSSResult or native CSSStyleSheet.\n *\n * In browsers that support constructible CSS style sheets, CSSStyleSheet\n * object can be used for styling along side CSSResult from the `css`\n * template tag.\n */\nexport type CSSResultOrNative = CSSResult | CSSStyleSheet;\n\nexport type CSSResultArray = Array<CSSResultOrNative | CSSResultArray>;\n\n/**\n * A single CSSResult, CSSStyleSheet, or an array or nested arrays of those.\n */\nexport type CSSResultGroup = CSSResultOrNative | CSSResultArray;\n\nconst constructionToken = Symbol();\n\nconst cssTagCache = new WeakMap<TemplateStringsArray, CSSStyleSheet>();\n\n/**\n * A container for a string of CSS text, that may be used to create a CSSStyleSheet.\n *\n * CSSResult is the return value of `css`-tagged template literals and\n * `unsafeCSS()`. In order to ensure that CSSResults are only created via the\n * `css` tag and `unsafeCSS()`, CSSResult cannot be constructed directly.\n */\nexport class CSSResult {\n // This property needs to remain unminified.\n ['_$cssResult$'] = true;\n readonly cssText: string;\n private _styleSheet?: CSSStyleSheet;\n private _strings: TemplateStringsArray | undefined;\n\n private constructor(\n cssText: string,\n strings: TemplateStringsArray | undefined,\n safeToken: symbol\n ) {\n if (safeToken !== constructionToken) {\n throw new Error(\n 'CSSResult is not constructable. Use `unsafeCSS` or `css` instead.'\n );\n }\n this.cssText = cssText;\n this._strings = strings;\n }\n\n // This is a getter so that it's lazy. In practice, this means stylesheets\n // are not created until the first element instance is made.\n get styleSheet(): CSSStyleSheet | undefined {\n // If `supportsAdoptingStyleSheets` is true then we assume CSSStyleSheet is\n // constructable.\n let styleSheet = this._styleSheet;\n const strings = this._strings;\n if (supportsAdoptingStyleSheets && styleSheet === undefined) {\n const cacheable = strings !== undefined && strings.length === 1;\n if (cacheable) {\n styleSheet = cssTagCache.get(strings);\n }\n if (styleSheet === undefined) {\n (this._styleSheet = styleSheet = new CSSStyleSheet()).replaceSync(\n this.cssText\n );\n if (cacheable) {\n cssTagCache.set(strings, styleSheet);\n }\n }\n }\n return styleSheet;\n }\n\n toString(): string {\n return this.cssText;\n }\n}\n\ntype ConstructableCSSResult = CSSResult & {\n new (\n cssText: string,\n strings: TemplateStringsArray | undefined,\n safeToken: symbol\n ): CSSResult;\n};\n\nconst textFromCSSResult = (value: CSSResultGroup | number) => {\n // This property needs to remain unminified.\n if ((value as CSSResult)['_$cssResult$'] === true) {\n return (value as CSSResult).cssText;\n } else if (typeof value === 'number') {\n return value;\n } else {\n throw new Error(\n `Value passed to 'css' function must be a 'css' function result: ` +\n `${value}. Use 'unsafeCSS' to pass non-literal values, but take care ` +\n `to ensure page security.`\n );\n }\n};\n\n/**\n * Wrap a value for interpolation in a {@linkcode css} tagged template literal.\n *\n * This is unsafe because untrusted CSS text can be used to phone home\n * or exfiltrate data to an attacker controlled site. Take care to only use\n * this with trusted input.\n */\nexport const unsafeCSS = (value: unknown) =>\n new (CSSResult as ConstructableCSSResult)(\n typeof value === 'string' ? value : String(value),\n undefined,\n constructionToken\n );\n\n/**\n * A template literal tag which can be used with LitElement's\n * {@linkcode LitElement.styles} property to set element styles.\n *\n * For security reasons, only literal string values and number may be used in\n * embedded expressions. To incorporate non-literal values {@linkcode unsafeCSS}\n * may be used inside an expression.\n */\nexport const css = (\n strings: TemplateStringsArray,\n ...values: (CSSResultGroup | number)[]\n): CSSResult => {\n const cssText =\n strings.length === 1\n ? strings[0]\n : values.reduce(\n (acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1],\n strings[0]\n );\n return new (CSSResult as ConstructableCSSResult)(\n cssText,\n strings,\n constructionToken\n );\n};\n\n/**\n * Applies the given styles to a `shadowRoot`. When Shadow DOM is\n * available but `adoptedStyleSheets` is not, styles are appended to the\n * `shadowRoot` to [mimic the native feature](https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/adoptedStyleSheets).\n * Note, when shimming is used, any styles that are subsequently placed into\n * the shadowRoot should be placed *before* any shimmed adopted styles. This\n * will match spec behavior that gives adopted sheets precedence over styles in\n * shadowRoot.\n */\nexport const adoptStyles = (\n renderRoot: ShadowRoot,\n styles: Array<CSSResultOrNative>\n) => {\n if (supportsAdoptingStyleSheets) {\n (renderRoot as ShadowRoot).adoptedStyleSheets = styles.map((s) =>\n s instanceof CSSStyleSheet ? s : s.styleSheet!\n );\n } else {\n for (const s of styles) {\n const style = document.createElement('style');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const nonce = (global as any)['litNonce'];\n if (nonce !== undefined) {\n style.setAttribute('nonce', nonce);\n }\n style.textContent = (s as CSSResult).cssText;\n renderRoot.appendChild(style);\n }\n }\n};\n\nconst cssResultFromStyleSheet = (sheet: CSSStyleSheet) => {\n let cssText = '';\n for (const rule of sheet.cssRules) {\n cssText += rule.cssText;\n }\n return unsafeCSS(cssText);\n};\n\nexport const getCompatibleStyle =\n supportsAdoptingStyleSheets ||\n (NODE_MODE && global.CSSStyleSheet === undefined)\n ? (s: CSSResultOrNative) => s\n : (s: CSSResultOrNative) =>\n s instanceof CSSStyleSheet ? cssResultFromStyleSheet(s) : s;\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Use this module if you want to create your own base class extending\n * {@link ReactiveElement}.\n * @packageDocumentation\n */\n\nimport {\n getCompatibleStyle,\n adoptStyles,\n CSSResultGroup,\n CSSResultOrNative,\n} from './css-tag.js';\nimport type {\n ReactiveController,\n ReactiveControllerHost,\n} from './reactive-controller.js';\n\n// In the Node build, this import will be injected by Rollup:\n// import {HTMLElement, customElements} from '@lit-labs/ssr-dom-shim';\n\nexport * from './css-tag.js';\nexport type {\n ReactiveController,\n ReactiveControllerHost,\n} from './reactive-controller.js';\n\n/**\n * Removes the `readonly` modifier from properties in the union K.\n *\n * This is a safer way to cast a value to a type with a mutable version of a\n * readonly field, than casting to an interface with the field re-declared\n * because it preserves the type of all the fields and warns on typos.\n */\ntype Mutable<T, K extends keyof T> = Omit<T, K> & {\n -readonly [P in keyof Pick<T, K>]: P extends K ? T[P] : never;\n};\n\n// TODO (justinfagnani): Add `hasOwn` here when we ship ES2022\nconst {\n is,\n defineProperty,\n getOwnPropertyDescriptor,\n getOwnPropertyNames,\n getOwnPropertySymbols,\n getPrototypeOf,\n} = Object;\n\nconst NODE_MODE = false;\n\n// Lets a minifier replace globalThis references with a minified name\nconst global = globalThis;\n\nif (NODE_MODE) {\n global.customElements ??= customElements;\n}\n\nconst DEV_MODE = true;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nconst trustedTypes = (global as unknown as {trustedTypes?: {emptyScript: ''}})\n .trustedTypes;\n\n// Temporary workaround for https://crbug.com/993268\n// Currently, any attribute starting with \"on\" is considered to be a\n// TrustedScript source. Such boolean attributes must be set to the equivalent\n// trusted emptyScript value.\nconst emptyStringForBooleanAttribute = trustedTypes\n ? (trustedTypes.emptyScript as unknown as '')\n : '';\n\nconst polyfillSupport = DEV_MODE\n ? global.reactiveElementPolyfillSupportDevMode\n : global.reactiveElementPolyfillSupport;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n global.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += ` See https://lit.dev/msg/${code} for more information.`;\n if (\n !global.litIssuedWarnings!.has(warning) &&\n !global.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n\n queueMicrotask(() => {\n issueWarning(\n 'dev-mode',\n `Lit is in dev mode. Not recommended for production!`\n );\n\n // Issue polyfill support warning.\n if (global.ShadyDOM?.inUse && polyfillSupport === undefined) {\n issueWarning(\n 'polyfill-support-missing',\n `Shadow DOM is being polyfilled via \\`ShadyDOM\\` but ` +\n `the \\`polyfill-support\\` module has not been loaded.`\n );\n }\n });\n}\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ReactiveUnstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry = Update;\n export interface Update {\n kind: 'update';\n }\n }\n}\n\ninterface DebugLoggingWindow {\n // Even in dev mode, we generally don't want to emit these events, as that's\n // another level of cost, so only emit them when DEV_MODE is true _and_ when\n // window.emitLitDebugEvents is true.\n emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n ? (event: ReactiveUnstable.DebugLog.Entry) => {\n const shouldEmit = (global as unknown as DebugLoggingWindow)\n .emitLitDebugLogEvents;\n if (!shouldEmit) {\n return;\n }\n global.dispatchEvent(\n new CustomEvent<ReactiveUnstable.DebugLog.Entry>('lit-debug', {\n detail: event,\n })\n );\n }\n : undefined;\n\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\n/*@__INLINE__*/\nconst JSCompiler_renameProperty = <P extends PropertyKey>(\n prop: P,\n _obj: unknown\n): P => prop;\n\n/**\n * Converts property values to and from attribute values.\n */\nexport interface ComplexAttributeConverter<Type = unknown, TypeHint = unknown> {\n /**\n * Called to convert an attribute value to a property\n * value.\n */\n fromAttribute?(value: string | null, type?: TypeHint): Type;\n\n /**\n * Called to convert a property value to an attribute\n * value.\n *\n * It returns unknown instead of string, to be compatible with\n * https://github.com/WICG/trusted-types (and similar efforts).\n */\n toAttribute?(value: Type, type?: TypeHint): unknown;\n}\n\ntype AttributeConverter<Type = unknown, TypeHint = unknown> =\n | ComplexAttributeConverter<Type>\n | ((value: string | null, type?: TypeHint) => Type);\n\n/**\n * Defines options for a property accessor.\n */\nexport interface PropertyDeclaration<Type = unknown, TypeHint = unknown> {\n /**\n * When set to `true`, indicates the property is internal private state. The\n * property should not be set by users. When using TypeScript, this property\n * should be marked as `private` or `protected`, and it is also a common\n * practice to use a leading `_` in the name. The property is not added to\n * `observedAttributes`.\n */\n readonly state?: boolean;\n\n /**\n * Indicates how and whether the property becomes an observed attribute.\n * If the value is `false`, the property is not added to `observedAttributes`.\n * If true or absent, the lowercased property name is observed (e.g. `fooBar`\n * becomes `foobar`). If a string, the string value is observed (e.g\n * `attribute: 'foo-bar'`).\n */\n readonly attribute?: boolean | string;\n\n /**\n * Indicates the type of the property. This is used only as a hint for the\n * `converter` to determine how to convert the attribute\n * to/from a property.\n */\n readonly type?: TypeHint;\n\n /**\n * Indicates how to convert the attribute to/from a property. If this value\n * is a function, it is used to convert the attribute value a the property\n * value. If it's an object, it can have keys for `fromAttribute` and\n * `toAttribute`. If no `toAttribute` function is provided and\n * `reflect` is set to `true`, the property value is set directly to the\n * attribute. A default `converter` is used if none is provided; it supports\n * `Boolean`, `String`, `Number`, `Object`, and `Array`. Note,\n * when a property changes and the converter is used to update the attribute,\n * the property is never updated again as a result of the attribute changing,\n * and vice versa.\n */\n readonly converter?: AttributeConverter<Type, TypeHint>;\n\n /**\n * Indicates if the property should reflect to an attribute.\n * If `true`, when the property is set, the attribute is set using the\n * attribute name determined according to the rules for the `attribute`\n * property option and the value of the property converted using the rules\n * from the `converter` property option.\n */\n readonly reflect?: boolean;\n\n /**\n * A function that indicates if a property should be considered changed when\n * it is set. The function should take the `newValue` and `oldValue` and\n * return `true` if an update should be requested.\n */\n hasChanged?(value: Type, oldValue: Type): boolean;\n\n /**\n * Indicates whether an accessor will be created for this property. By\n * default, an accessor will be generated for this property that requests an\n * update when set. If this flag is `true`, no accessor will be created, and\n * it will be the user's responsibility to call\n * `this.requestUpdate(propertyName, oldValue)` to request an update when\n * the property changes.\n */\n readonly noAccessor?: boolean;\n\n /**\n * Whether this property is wrapping accessors. This is set by `@property`\n * to control the initial value change and reflection logic.\n *\n * @internal\n */\n wrapped?: boolean;\n\n /**\n * When `true`, uses the initial value of the property as the default value,\n * which changes how attributes are handled:\n * - The initial value does *not* reflect, even if the `reflect` option is `true`.\n * Subsequent changes to the property will reflect, even if they are equal to the\n * default value.\n * - When the attribute is removed, the property is set to the default value\n * - The initial value will not trigger an old value in the `changedProperties` map\n * argument to update lifecycle methods.\n *\n * When set, properties must be initialized, either with a field initializer, or an\n * assignment in the constructor. Not initializing the property may lead to\n * improper handling of subsequent property assignments.\n *\n * While this behavior is opt-in, most properties that reflect to attributes should\n * use `useDefault: true` so that their initial values do not reflect.\n */\n useDefault?: boolean;\n}\n\n/**\n * Map of properties to PropertyDeclaration options. For each property an\n * accessor is made, and the property is processed according to the\n * PropertyDeclaration options.\n */\nexport interface PropertyDeclarations {\n readonly [key: string]: PropertyDeclaration;\n}\n\ntype PropertyDeclarationMap = Map<PropertyKey, PropertyDeclaration>;\n\ntype AttributeMap = Map<string, PropertyKey>;\n\n/**\n * A Map of property keys to values.\n *\n * Takes an optional type parameter T, which when specified as a non-any,\n * non-unknown type, will make the Map more strongly-typed, associating the map\n * keys with their corresponding value type on T.\n *\n * Use `PropertyValues<this>` when overriding ReactiveElement.update() and\n * other lifecycle methods in order to get stronger type-checking on keys\n * and values.\n */\n// This type is conditional so that if the parameter T is not specified, or\n// is `any`, the type will include `Map<PropertyKey, unknown>`. Since T is not\n// given in the uses of PropertyValues in this file, all uses here fallback to\n// meaning `Map<PropertyKey, unknown>`, but if a developer uses\n// `PropertyValues<this>` (or any other value for T) they will get a\n// strongly-typed Map type.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PropertyValues<T = any> = T extends object\n ? PropertyValueMap<T>\n : Map<PropertyKey, unknown>;\n\n/**\n * Do not use, instead prefer {@linkcode PropertyValues}.\n */\n// This type must be exported such that JavaScript generated by the Google\n// Closure Compiler can import a type reference.\nexport interface PropertyValueMap<T> extends Map<PropertyKey, unknown> {\n get<K extends keyof T>(k: K): T[K] | undefined;\n set<K extends keyof T>(key: K, value: T[K]): this;\n has<K extends keyof T>(k: K): boolean;\n delete<K extends keyof T>(k: K): boolean;\n}\n\nexport const defaultConverter: ComplexAttributeConverter = {\n toAttribute(value: unknown, type?: unknown): unknown {\n switch (type) {\n case Boolean:\n value = value ? emptyStringForBooleanAttribute : null;\n break;\n case Object:\n case Array:\n // if the value is `null` or `undefined` pass this through\n // to allow removing/no change behavior.\n value = value == null ? value : JSON.stringify(value);\n break;\n }\n return value;\n },\n\n fromAttribute(value: string | null, type?: unknown) {\n let fromValue: unknown = value;\n switch (type) {\n case Boolean:\n fromValue = value !== null;\n break;\n case Number:\n fromValue = value === null ? null : Number(value);\n break;\n case Object:\n case Array:\n // Do *not* generate exception when invalid JSON is set as elements\n // don't normally complain on being mis-configured.\n // TODO(sorvell): Do generate exception in *dev mode*.\n try {\n // Assert to adhere to Bazel's \"must type assert JSON parse\" rule.\n fromValue = JSON.parse(value!) as unknown;\n } catch (e) {\n fromValue = null;\n }\n break;\n }\n return fromValue;\n },\n};\n\nexport interface HasChanged {\n (value: unknown, old: unknown): boolean;\n}\n\n/**\n * Change function that returns true if `value` is different from `oldValue`.\n * This method is used as the default for a property's `hasChanged` function.\n */\nexport const notEqual: HasChanged = (value: unknown, old: unknown): boolean =>\n !is(value, old);\n\nconst defaultPropertyDeclaration: PropertyDeclaration = {\n attribute: true,\n type: String,\n converter: defaultConverter,\n reflect: false,\n useDefault: false,\n hasChanged: notEqual,\n};\n\n/**\n * A string representing one of the supported dev mode warning categories.\n */\nexport type WarningKind =\n | 'change-in-update'\n | 'migration'\n | 'async-perform-update';\n\nexport type Initializer = (element: ReactiveElement) => void;\n\n// Temporary, until google3 is on TypeScript 5.2\ndeclare global {\n interface SymbolConstructor {\n readonly metadata: unique symbol;\n }\n}\n\n// Ensure metadata is enabled. TypeScript does not polyfill\n// Symbol.metadata, so we must ensure that it exists.\n(Symbol as {metadata: symbol}).metadata ??= Symbol('metadata');\n\ndeclare global {\n // This is public global API, do not change!\n // eslint-disable-next-line no-var\n var litPropertyMetadata: WeakMap<\n object,\n Map<PropertyKey, PropertyDeclaration>\n >;\n}\n\n// Map from a class's metadata object to property options\n// Note that we must use nullish-coalescing assignment so that we only use one\n// map even if we load multiple version of this module.\nglobal.litPropertyMetadata ??= new WeakMap<\n object,\n Map<PropertyKey, PropertyDeclaration>\n>();\n\n/**\n * Base element class which manages element properties and attributes. When\n * properties change, the `update` method is asynchronously called. This method\n * should be supplied by subclasses to render updates as desired.\n * @noInheritDoc\n */\nexport abstract class ReactiveElement\n // In the Node build, this `extends` clause will be substituted with\n // `(globalThis.HTMLElement ?? HTMLElement)`.\n //\n // This way, we will first prefer any global `HTMLElement` polyfill that the\n // user has assigned, and then fall back to the `HTMLElement` shim which has\n // been imported (see note at the top of this file about how this import is\n // generated by Rollup). Note that the `HTMLElement` variable has been\n // shadowed by this import, so it no longer refers to the global.\n extends HTMLElement\n implements ReactiveControllerHost\n{\n // Note: these are patched in only in DEV_MODE.\n /**\n * Read or set all the enabled warning categories for this class.\n *\n * This property is only used in development builds.\n *\n * @nocollapse\n * @category dev-mode\n */\n static enabledWarnings?: WarningKind[];\n\n /**\n * Enable the given warning category for this class.\n *\n * This method only exists in development builds, so it should be accessed\n * with a guard like:\n *\n * ```ts\n * // Enable for all ReactiveElement subclasses\n * ReactiveElement.enableWarning?.('migration');\n *\n * // Enable for only MyElement and subclasses\n * MyElement.enableWarning?.('migration');\n * ```\n *\n * @nocollapse\n * @category dev-mode\n */\n static enableWarning?: (warningKind: WarningKind) => void;\n\n /**\n * Disable the given warning category for this class.\n *\n * This method only exists in development builds, so it should be accessed\n * with a guard like:\n *\n * ```ts\n * // Disable for all ReactiveElement subclasses\n * ReactiveElement.disableWarning?.('migration');\n *\n * // Disable for only MyElement and subclasses\n * MyElement.disableWarning?.('migration');\n * ```\n *\n * @nocollapse\n * @category dev-mode\n */\n static disableWarning?: (warningKind: WarningKind) => void;\n\n /**\n * Adds an initializer function to the class that is called during instance\n * construction.\n *\n * This is useful for code that runs against a `ReactiveElement`\n * subclass, such as a decorator, that needs to do work for each\n * instance, such as setting up a `ReactiveController`.\n *\n * ```ts\n * const myDecorator = (target: typeof ReactiveElement, key: string) => {\n * target.addInitializer((instance: ReactiveElement) => {\n * // This is run during construction of the element\n * new MyController(instance);\n * });\n * }\n * ```\n *\n * Decorating a field will then cause each instance to run an initializer\n * that adds a controller:\n *\n * ```ts\n * class MyElement extends LitElement {\n * @myDecorator foo;\n * }\n * ```\n *\n * Initializers are stored per-constructor. Adding an initializer to a\n * subclass does not add it to a superclass. Since initializers are run in\n * constructors, initializers will run in order of the class hierarchy,\n * starting with superclasses and progressing to the instance's class.\n *\n * @nocollapse\n */\n static addInitializer(initializer: Initializer) {\n this.__prepare();\n (this._initializers ??= []).push(initializer);\n }\n\n static _initializers?: Initializer[];\n\n /*\n * Due to closure compiler ES6 compilation bugs, @nocollapse is required on\n * all static methods and properties with initializers. Reference:\n * - https://github.com/google/closure-compiler/issues/1776\n */\n\n /**\n * Maps attribute names to properties; for example `foobar` attribute to\n * `fooBar` property. Created lazily on user subclasses when finalizing the\n * class.\n * @nocollapse\n */\n private static __attributeToPropertyMap: AttributeMap;\n\n /**\n * Marks class as having been finalized, which includes creating properties\n * from `static properties`, but does *not* include all properties created\n * from decorators.\n * @nocollapse\n */\n protected static finalized: true | undefined;\n\n /**\n * Memoized list of all element properties, including any superclass\n * properties. Created lazily on user subclasses when finalizing the class.\n *\n * @nocollapse\n * @category properties\n */\n static elementProperties: PropertyDeclarationMap;\n\n /**\n * User-supplied object that maps property names to `PropertyDeclaration`\n * objects containing options for configuring reactive properties. When\n * a reactive property is set the element will update and render.\n *\n * By default properties are public fields, and as such, they should be\n * considered as primarily settable by element users, either via attribute or\n * the property itself.\n *\n * Generally, properties that are changed by the element should be private or\n * protected fields and should use the `state: true` option. Properties\n * marked as `state` do not reflect from the corresponding attribute\n *\n * However, sometimes element code does need to set a public property. This\n * should typically only be done in response to user interaction, and an event\n * should be fired informing the user; for example, a checkbox sets its\n * `checked` property when clicked and fires a `changed` event. Mutating\n * public properties should typically not be done for non-primitive (object or\n * array) properties. In other cases when an element needs to manage state, a\n * private property set with the `state: true` option should be used. When\n * needed, state properties can be initialized via public properties to\n * facilitate complex interactions.\n * @nocollapse\n * @category properties\n */\n static properties: PropertyDeclarations;\n\n /**\n * Memoized list of all element styles.\n * Created lazily on user subclasses when finalizing the class.\n * @nocollapse\n * @category styles\n */\n static elementStyles: Array<CSSResultOrNative> = [];\n\n /**\n * Array of styles to apply to the element. The styles should be defined\n * using the {@linkcode css} tag function, via constructible stylesheets, or\n * imported from native CSS module scripts.\n *\n * Note on Content Security Policy:\n *\n * Element styles are implemented with `<style>` tags when the browser doesn't\n * support adopted StyleSheets. To use such `<style>` tags with the style-src\n * CSP directive, the style-src value must either include 'unsafe-inline' or\n * `nonce-<base64-value>` with `<base64-value>` replaced be a server-generated\n * nonce.\n *\n * To provide a nonce to use on generated `<style>` elements, set\n * `window.litNonce` to a server-generated nonce in your page's HTML, before\n * loading application code:\n *\n * ```html\n * <script>\n * // Generated and unique per request:\n * window.litNonce = 'a1b2c3d4';\n * </script>\n * ```\n * @nocollapse\n * @category styles\n */\n static styles?: CSSResultGroup;\n\n /**\n * Returns a list of attributes corresponding to the registered properties.\n * @nocollapse\n * @category attributes\n */\n static get observedAttributes() {\n // Ensure we've created all properties\n this.finalize();\n // this.__attributeToPropertyMap is only undefined after finalize() in\n // ReactiveElement itself. ReactiveElement.observedAttributes is only\n // accessed with ReactiveElement as the receiver when a subclass or mixin\n // calls super.observedAttributes\n return (\n this.__attributeToPropertyMap && [...this.__attributeToPropertyMap.keys()]\n );\n }\n\n private __instanceProperties?: PropertyValues = undefined;\n\n /**\n * Creates a property accessor on the element prototype if one does not exist\n * and stores a {@linkcode PropertyDeclaration} for the property with the\n * given options. The property setter calls the property's `hasChanged`\n * property option or uses a strict identity check to determine whether or not\n * to request an update.\n *\n * This method may be overridden to customize properties; however,\n * when doing so, it's important to call `super.createProperty` to ensure\n * the property is setup correctly. This method calls\n * `getPropertyDescriptor` internally to get a descriptor to install.\n * To customize what properties do when they are get or set, override\n * `getPropertyDescriptor`. To customize the options for a property,\n * implement `createProperty` like this:\n *\n * ```ts\n * static createProperty(name, options) {\n * options = Object.assign(options, {myOption: true});\n * super.createProperty(name, options);\n * }\n * ```\n *\n * @nocollapse\n * @category properties\n */\n static createProperty(\n name: PropertyKey,\n options: PropertyDeclaration = defaultPropertyDeclaration\n ) {\n // If this is a state property, force the attribute to false.\n if (options.state) {\n (options as Mutable<PropertyDeclaration, 'attribute'>).attribute = false;\n }\n this.__prepare();\n // Whether this property is wrapping accessors.\n // Helps control the initial value change and reflection logic.\n if (this.prototype.hasOwnProperty(name)) {\n options = Object.create(options);\n options.wrapped = true;\n }\n this.elementProperties.set(name, options);\n if (!options.noAccessor) {\n const key = DEV_MODE\n ? // Use Symbol.for in dev mode to make it easier to maintain state\n // when doing HMR.\n Symbol.for(`${String(name)} (@property() cache)`)\n : Symbol();\n const descriptor = this.getPropertyDescriptor(name, key, options);\n if (descriptor !== undefined) {\n defineProperty(this.prototype, name, descriptor);\n }\n }\n }\n\n /**\n * Returns a property descriptor to be defined on the given named property.\n * If no descriptor is returned, the property will not become an accessor.\n * For example,\n *\n * ```ts\n * class MyElement extends LitElement {\n * static getPropertyDescriptor(name, key, options) {\n * const defaultDescriptor =\n * super.getPropertyDescriptor(name, key, options);\n * const setter = defaultDescriptor.set;\n * return {\n * get: defaultDescriptor.get,\n * set(value) {\n * setter.call(this, value);\n * // custom action.\n * },\n * configurable: true,\n * enumerable: true\n * }\n * }\n * }\n * ```\n *\n * @nocollapse\n * @category properties\n */\n protected static getPropertyDescriptor(\n name: PropertyKey,\n key: string | symbol,\n options: PropertyDeclaration\n ): PropertyDescriptor | undefined {\n const {get, set} = getOwnPropertyDescriptor(this.prototype, name) ?? {\n get(this: ReactiveElement) {\n return this[key as keyof typeof this];\n },\n set(this: ReactiveElement, v: unknown) {\n (this as unknown as Record<string | symbol, unknown>)[key] = v;\n },\n };\n if (DEV_MODE && get == null) {\n if ('value' in (getOwnPropertyDescriptor(this.prototype, name) ?? {})) {\n throw new Error(\n `Field ${JSON.stringify(String(name))} on ` +\n `${this.name} was declared as a reactive property ` +\n `but it's actually declared as a value on the prototype. ` +\n `Usually this is due to using @property or @state on a method.`\n );\n }\n issueWarning(\n 'reactive-property-without-getter',\n `Field ${JSON.stringify(String(name))} on ` +\n `${this.name} was declared as a reactive property ` +\n `but it does not have a getter. This will be an error in a ` +\n `future version of Lit.`\n );\n }\n return {\n get,\n set(this: ReactiveElement, value: unknown) {\n const oldValue = get?.call(this);\n set?.call(this, value);\n this.requestUpdate(name, oldValue, options);\n },\n configurable: true,\n enumerable: true,\n };\n }\n\n /**\n * Returns the property options associated with the given property.\n * These options are defined with a `PropertyDeclaration` via the `properties`\n * object or the `@property` decorator and are registered in\n * `createProperty(...)`.\n *\n * Note, this method should be considered \"final\" and not overridden. To\n * customize the options for a given property, override\n * {@linkcode createProperty}.\n *\n * @nocollapse\n * @final\n * @category properties\n */\n static getPropertyOptions(name: PropertyKey) {\n return this.elementProperties.get(name) ?? defaultPropertyDeclaration;\n }\n\n // Temporary, until google3 is on TypeScript 5.2\n declare static [Symbol.metadata]: object & Record<PropertyKey, unknown>;\n\n /**\n * Initializes static own properties of the class used in bookkeeping\n * for element properties, initializers, etc.\n *\n * Can be called multiple times by code that needs to ensure these\n * properties exist before using them.\n *\n * This method ensures the superclass is finalized so that inherited\n * property metadata can be copied down.\n * @nocollapse\n */\n private static __prepare() {\n if (\n this.hasOwnProperty(JSCompiler_renameProperty('elementProperties', this))\n ) {\n // Already prepared\n return;\n }\n // Finalize any superclasses\n const superCtor = getPrototypeOf(this) as typeof ReactiveElement;\n superCtor.finalize();\n\n // Create own set of initializers for this class if any exist on the\n // superclass and copy them down. Note, for a small perf boost, avoid\n // creating initializers unless needed.\n if (superCtor._initializers !== undefined) {\n this._initializers = [...superCtor._initializers];\n }\n // Initialize elementProperties from the superclass\n this.elementProperties = new Map(superCtor.elementProperties);\n }\n\n /**\n * Finishes setting up the class so that it's ready to be registered\n * as a custom element and instantiated.\n *\n * This method is called by the ReactiveElement.observedAttributes getter.\n * If you override the observedAttributes getter, you must either call\n * super.observedAttributes to trigger finalization, or call finalize()\n * yourself.\n *\n * @nocollapse\n */\n protected static finalize() {\n if (this.hasOwnProperty(JSCompiler_renameProperty('finalized', this))) {\n return;\n }\n this.finalized = true;\n this.__prepare();\n\n // Create properties from the static properties block:\n if (this.hasOwnProperty(JSCompiler_renameProperty('properties', this))) {\n const props = this.properties;\n const propKeys = [\n ...getOwnPropertyNames(props),\n ...getOwnPropertySymbols(props),\n ] as Array<keyof typeof props>;\n for (const p of propKeys) {\n this.createProperty(p, props[p]);\n }\n }\n\n // Create properties from standard decorator metadata:\n const metadata = this[Symbol.metadata];\n if (metadata !== null) {\n const properties = litPropertyMetadata.get(metadata);\n if (properties !== undefined) {\n for (const [p, options] of properties) {\n this.elementProperties.set(p, options);\n }\n }\n }\n\n // Create the attribute-to-property map\n this.__attributeToPropertyMap = new Map();\n for (const [p, options] of this.elementProperties) {\n const attr = this.__attributeNameForProperty(p, options);\n if (attr !== undefined) {\n this.__attributeToPropertyMap.set(attr, p);\n }\n }\n\n this.elementStyles = this.finalizeStyles(this.styles);\n\n if (DEV_MODE) {\n if (this.hasOwnProperty('createProperty')) {\n issueWarning(\n 'no-override-create-property',\n 'Overriding ReactiveElement.createProperty() is deprecated. ' +\n 'The override will not be called with standard decorators'\n );\n }\n if (this.hasOwnProperty('getPropertyDescriptor')) {\n issueWarning(\n 'no-override-get-property-descriptor',\n 'Overriding ReactiveElement.getPropertyDescriptor() is deprecated. ' +\n 'The override will not be called with standard decorators'\n );\n }\n }\n }\n\n /**\n * Options used when calling `attachShadow`. Set this property to customize\n * the options for the shadowRoot; for example, to create a closed\n * shadowRoot: `{mode: 'closed'}`.\n *\n * Note, these options are used in `createRenderRoot`. If this method\n * is customized, options should be respected if possible.\n * @nocollapse\n * @category rendering\n */\n static shadowRootOptions: ShadowRootInit = {mode: 'open'};\n\n /**\n * Takes the styles the user supplied via the `static styles` property and\n * returns the array of styles to apply to the element.\n * Override this method to integrate into a style management system.\n *\n * Styles are deduplicated preserving the _last_ instance in the list. This\n * is a performance optimization to avoid duplicated styles that can occur\n * especially when composing via subclassing. The last item is kept to try\n * to preserve the cascade order with the assumption that it's most important\n * that last added styles override previous styles.\n *\n * @nocollapse\n * @category styles\n */\n protected static finalizeStyles(\n styles?: CSSResultGroup\n ): Array<CSSResultOrNative> {\n const elementStyles = [];\n if (Array.isArray(styles)) {\n // Dedupe the flattened array in reverse order to preserve the last items.\n // Casting to Array<unknown> works around TS error that\n // appears to come from trying to flatten a type CSSResultArray.\n const set = new Set((styles as Array<unknown>).flat(Infinity).reverse());\n // Then preserve original order by adding the set items in reverse order.\n for (const s of set) {\n elementStyles.unshift(getCompatibleStyle(s as CSSResultOrNative));\n }\n } else if (styles !== undefined) {\n elementStyles.push(getCompatibleStyle(styles));\n }\n return elementStyles;\n }\n\n /**\n * Node or ShadowRoot into which element DOM should be rendered. Defaults\n * to an open shadowRoot.\n * @category rendering\n */\n readonly renderRoot!: HTMLElement | DocumentFragment;\n\n /**\n * Returns the property name for the given attribute `name`.\n * @nocollapse\n */\n private static __attributeNameForProperty(\n name: PropertyKey,\n options: PropertyDeclaration\n ) {\n const attribute = options.attribute;\n return attribute === false\n ? undefined\n : typeof attribute === 'string'\n ? attribute\n : typeof name === 'string'\n ? name.toLowerCase()\n : undefined;\n }\n\n // Initialize to an unresolved Promise so we can make sure the element has\n // connected before first update.\n private __updatePromise!: Promise<boolean>;\n\n /**\n * True if there is a pending update as a result of calling `requestUpdate()`.\n * Should only be read.\n * @category updates\n */\n isUpdatePending = false;\n\n /**\n * Is set to `true` after the first update. The element code cannot assume\n * that `renderRoot` exists before the element `hasUpdated`.\n * @category updates\n */\n hasUpdated = false;\n\n /**\n * Map with keys for any properties that have changed since the last\n * update cycle with previous values.\n *\n * @internal\n */\n _$changedProperties!: PropertyValues;\n\n /**\n * Records property default values when the\n * `useDefault` option is used.\n */\n private __defaultValues?: Map<PropertyKey, unknown>;\n\n /**\n * Properties that should be reflected when updated.\n */\n private __reflectingProperties?: Set<PropertyKey>;\n\n /**\n * Name of currently reflecting property\n */\n private __reflectingProperty: PropertyKey | null = null;\n\n /**\n * Set of controllers.\n */\n private __controllers?: Set<ReactiveController>;\n\n constructor() {\n super();\n this.__initialize();\n }\n\n /**\n * Internal only override point for customizing work done when elements\n * are constructed.\n */\n private __initialize() {\n this.__updatePromise = new Promise<boolean>(\n (res) => (this.enableUpdating = res)\n );\n this._$changedProperties = new Map();\n // This enqueues a microtask that must run before the first update, so it\n // must be called before requestUpdate()\n this.__saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this.requestUpdate();\n (this.constructor as typeof ReactiveElement)._initializers?.forEach((i) =>\n i(this)\n );\n }\n\n /**\n * Registers a `ReactiveController` to participate in the element's reactive\n * update cycle. The element automatically calls into any registered\n * controllers during its lifecycle callbacks.\n *\n * If the element is connected when `addController()` is called, the\n * controller's `hostConnected()` callback will be immediately called.\n * @category controllers\n */\n addController(controller: ReactiveController) {\n (this.__controllers ??= new Set()).add(controller);\n // If a controller is added after the element has been connected,\n // call hostConnected. Note, re-using existence of `renderRoot` here\n // (which is set in connectedCallback) to avoid the need to track a\n // first connected state.\n if (this.renderRoot !== undefined && this.isConnected) {\n controller.hostConnected?.();\n }\n }\n\n /**\n * Removes a `ReactiveController` from the element.\n * @category controllers\n */\n removeController(controller: ReactiveController) {\n this.__controllers?.delete(controller);\n }\n\n /**\n * Fixes any properties set on the instance before upgrade time.\n * Otherwise these would shadow the accessor and break these properties.\n * The properties are stored in a Map which is played back after the\n * constructor runs.\n */\n private __saveInstanceProperties() {\n const instanceProperties = new Map<PropertyKey, unknown>();\n const elementProperties = (this.constructor as typeof ReactiveElement)\n .elementProperties;\n for (const p of elementProperties.keys() as IterableIterator<keyof this>) {\n if (this.hasOwnProperty(p)) {\n instanceProperties.set(p, this[p]);\n delete this[p];\n }\n }\n if (instanceProperties.size > 0) {\n this.__instanceProperties = instanceProperties;\n }\n }\n\n /**\n * Returns the node into which the element should render and by default\n * creates and returns an open shadowRoot. Implement to customize where the\n * element's DOM is rendered. For example, to render into the element's\n * childNodes, return `this`.\n *\n * @return Returns a node into which to render.\n * @category rendering\n */\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n const renderRoot =\n this.shadowRoot ??\n this.attachShadow(\n (this.constructor as typeof ReactiveElement).shadowRootOptions\n );\n adoptStyles(\n renderRoot,\n (this.constructor as typeof ReactiveElement).elementStyles\n );\n return renderRoot;\n }\n\n /**\n * On first connection, creates the element's renderRoot, sets up\n * element styling, and enables updating.\n * @category lifecycle\n */\n connectedCallback() {\n // Create renderRoot before controllers `hostConnected`\n (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n this.createRenderRoot();\n this.enableUpdating(true);\n this.__controllers?.forEach((c) => c.hostConnected?.());\n }\n\n /**\n * Note, this method should be considered final and not overridden. It is\n * overridden on the element instance with a function that triggers the first\n * update.\n * @category updates\n */\n protected enableUpdating(_requestedUpdate: boolean) {}\n\n /**\n * Allows for `super.disconnectedCallback()` in extensions while\n * reserving the possibility of making non-breaking feature additions\n * when disconnecting at some point in the future.\n * @category lifecycle\n */\n disconnectedCallback() {\n this.__controllers?.forEach((c) => c.hostDisconnected?.());\n }\n\n /**\n * Synchronizes property values when attributes change.\n *\n * Specifically, when an attribute is set, the corresponding property is set.\n * You should rarely need to implement this callback. If this method is\n * overridden, `super.attributeChangedCallback(name, _old, value)` must be\n * called.\n *\n * See [responding to attribute changes](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#responding_to_attribute_changes)\n * on MDN for more information about the `attributeChangedCallback`.\n * @category attributes\n */\n attributeChangedCallback(\n name: string,\n _old: string | null,\n value: string | null\n ) {\n this._$attributeToProperty(name, value);\n }\n\n private __propertyToAttribute(name: PropertyKey, value: unknown) {\n const elemProperties: PropertyDeclarationMap = (\n this.constructor as typeof ReactiveElement\n ).elementProperties;\n const options = elemProperties.get(name)!;\n const attr = (\n this.constructor as typeof ReactiveElement\n ).__attributeNameForProperty(name, options);\n if (attr !== undefined && options.reflect === true) {\n const converter =\n (options.converter as ComplexAttributeConverter)?.toAttribute !==\n undefined\n ? (options.converter as ComplexAttributeConverter)\n : defaultConverter;\n const attrValue = converter.toAttribute!(value, options.type);\n if (\n DEV_MODE &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'migration'\n ) &&\n attrValue === undefined\n ) {\n issueWarning(\n 'undefined-attribute-value',\n `The attribute value for the ${name as string} property is ` +\n `undefined on element ${this.localName}. The attribute will be ` +\n `removed, but in the previous version of \\`ReactiveElement\\`, ` +\n `the attribute would not have changed.`\n );\n }\n // Track if the property is being reflected to avoid\n // setting the property again via `attributeChangedCallback`. Note:\n // 1. this takes advantage of the fact that the callback is synchronous.\n // 2. will behave incorrectly if multiple attributes are in the reaction\n // stack at time of calling. However, since we process attributes\n // in `update` this should not be possible (or an extreme corner case\n // that we'd like to discover).\n // mark state reflecting\n this.__reflectingProperty = name;\n if (attrValue == null) {\n this.removeAttribute(attr);\n } else {\n this.setAttribute(attr, attrValue as string);\n }\n // mark state not reflecting\n this.__reflectingProperty = null;\n }\n }\n\n /** @internal */\n _$attributeToProperty(name: string, value: string | null) {\n const ctor = this.constructor as typeof ReactiveElement;\n // Note, hint this as an `AttributeMap` so closure clearly understands\n // the type; it has issues with tracking types through statics\n const propName = (ctor.__attributeToPropertyMap as AttributeMap).get(name);\n // Use tracking info to avoid reflecting a property value to an attribute\n // if it was just set because the attribute changed.\n if (propName !== undefined && this.__reflectingProperty !== propName) {\n const options = ctor.getPropertyOptions(propName);\n const converter =\n typeof options.converter === 'function'\n ? {fromAttribute: options.converter}\n : options.converter?.fromAttribute !== undefined\n ? options.converter\n : defaultConverter;\n // mark state reflecting\n this.__reflectingProperty = propName;\n this[propName as keyof this] =\n converter.fromAttribute!(value, options.type) ??\n this.__defaultValues?.get(propName) ??\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (null as any);\n // mark state not reflecting\n this.__reflectingProperty = null;\n }\n }\n\n /**\n * Requests an update which is processed asynchronously. This should be called\n * when an element should update based on some state not triggered by setting\n * a reactive property. In this case, pass no arguments. It should also be\n * called when manually implementing a property setter. In this case, pass the\n * property `name` and `oldValue` to ensure that any configured property\n * options are honored.\n *\n * @param name name of requesting property\n * @param oldValue old value of requesting property\n * @param options property options to use instead of the previously\n * configured options\n * @category updates\n */\n requestUpdate(\n name?: PropertyKey,\n oldValue?: unknown,\n options?: PropertyDeclaration\n ): void {\n // If we have a property key, perform property update steps.\n if (name !== undefined) {\n if (DEV_MODE && (name as unknown) instanceof Event) {\n issueWarning(\n ``,\n `The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()`\n );\n }\n const ctor = this.constructor as typeof ReactiveElement;\n const newValue = this[name as keyof this];\n options ??= ctor.getPropertyOptions(name);\n const changed =\n (options.hasChanged ?? notEqual)(newValue, oldValue) ||\n // When there is no change, check a corner case that can occur when\n // 1. there's a initial value which was not reflected\n // 2. the property is subsequently set to this value.\n // For example, `prop: {useDefault: true, reflect: true}`\n // and el.prop = 'foo'. This should be considered a change if the\n // attribute is not set because we will now reflect the property to the attribute.\n (options.useDefault &&\n options.reflect &&\n newValue === this.__defaultValues?.get(name) &&\n !this.hasAttribute(ctor.__attributeNameForProperty(name, options)!));\n if (changed) {\n this._$changeProperty(name, oldValue, options);\n } else {\n // Abort the request if the property should not be considered changed.\n return;\n }\n }\n if (this.isUpdatePending === false) {\n this.__updatePromise = this.__enqueueUpdate();\n }\n }\n\n /**\n * @internal\n */\n _$changeProperty(\n name: PropertyKey,\n oldValue: unknown,\n {useDefault, reflect, wrapped}: PropertyDeclaration,\n initializeValue?: unknown\n ) {\n // Record default value when useDefault is used. This allows us to\n // restore this value when the attribute is removed.\n if (useDefault && !(this.__defaultValues ??= new Map()).has(name)) {\n this.__defaultValues.set(\n name,\n initializeValue ?? oldValue ?? this[name as keyof this]\n );\n // if this is not wrapping an accessor, it must be an initial setting\n // and in this case we do not want to record the change or reflect.\n if (wrapped !== true || initializeValue !== undefined) {\n return;\n }\n }\n // TODO (justinfagnani): Create a benchmark of Map.has() + Map.set(\n // vs just Map.set()\n if (!this._$changedProperties.has(name)) {\n // On the initial change, the old value should be `undefined`, except\n // with `useDefault`\n if (!this.hasUpdated && !useDefault) {\n oldValue = undefined;\n }\n this._$changedProperties.set(name, oldValue);\n }\n // Add to reflecting properties set.\n // Note, it's important that every change has a chance to add the\n // property to `__reflectingProperties`. This ensures setting\n // attribute + property reflects correctly.\n if (reflect === true && this.__reflectingProperty !== name) {\n (this.__reflectingProperties ??= new Set<PropertyKey>()).add(name);\n }\n }\n\n /**\n * Sets up the element to asynchronously update.\n */\n private async __enqueueUpdate() {\n this.isUpdatePending = true;\n try {\n // Ensure any previous update has resolved before updating.\n // This `await` also ensures that property changes are batched.\n await this.__updatePromise;\n } catch (e) {\n // Refire any previous errors async so they do not disrupt the update\n // cycle. Errors are refired so developers have a chance to observe\n // them, and this can be done by implementing\n // `window.onunhandledrejection`.\n Promise.reject(e);\n }\n const result = this.scheduleUpdate();\n // If `scheduleUpdate` returns a Promise, we await it. This is done to\n // enable coordinating updates with a scheduler. Note, the result is\n // checked to avoid delaying an additional microtask unless we need to.\n if (result != null) {\n await result;\n }\n return !this.isUpdatePending;\n }\n\n /**\n * Schedules an element update. You can override this method to change the\n * timing of updates by returning a Promise. The update will await the\n * returned Promise, and you should resolve the Promise to allow the update\n * to proceed. If this method is overridden, `super.scheduleUpdate()`\n * must be called.\n *\n * For instance, to schedule updates to occur just before the next frame:\n *\n * ```ts\n * override protected async scheduleUpdate(): Promise<unknown> {\n * await new Promise((resolve) => requestAnimationFrame(() => resolve()));\n * super.scheduleUpdate();\n * }\n * ```\n * @category updates\n */\n protected scheduleUpdate(): void | Promise<unknown> {\n const result = this.performUpdate();\n if (\n DEV_MODE &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'async-perform-update'\n ) &&\n typeof (result as unknown as Promise<unknown> | undefined)?.then ===\n 'function'\n ) {\n issueWarning(\n 'async-perform-update',\n `Element ${this.localName} returned a Promise from performUpdate(). ` +\n `This behavior is deprecated and will be removed in a future ` +\n `version of ReactiveElement.`\n );\n }\n return result;\n }\n\n /**\n * Performs an element update. Note, if an exception is thrown during the\n * update, `firstUpdated` and `updated` will not be called.\n *\n * Call `performUpdate()` to immediately process a pending update. This should\n * generally not be needed, but it can be done in rare cases when you need to\n * update synchronously.\n *\n * @category updates\n */\n protected performUpdate(): void {\n // Abort any update if one is not pending when this is called.\n // This can happen if `performUpdate` is called early to \"flush\"\n // the update.\n if (!this.isUpdatePending) {\n return;\n }\n debugLogEvent?.({kind: 'update'});\n if (!this.hasUpdated) {\n // Create renderRoot before first update. This occurs in `connectedCallback`\n // but is done here to support out of tree calls to `enableUpdating`/`performUpdate`.\n (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n this.createRenderRoot();\n if (DEV_MODE) {\n // Produce warning if any reactive properties on the prototype are\n // shadowed by class fields. Instance fields set before upgrade are\n // deleted by this point, so any own property is caused by class field\n // initialization in the constructor.\n const ctor = this.constructor as typeof ReactiveElement;\n const shadowedProperties = [...ctor.elementProperties.keys()].filter(\n (p) => this.hasOwnProperty(p) && p in getPrototypeOf(this)\n );\n if (shadowedProperties.length) {\n throw new Error(\n `The following properties on element ${this.localName} will not ` +\n `trigger updates as expected because they are set using class ` +\n `fields: ${shadowedProperties.join(', ')}. ` +\n `Native class fields and some compiled output will overwrite ` +\n `accessors used for detecting changes. See ` +\n `https://lit.dev/msg/class-field-shadowing ` +\n `for more information.`\n );\n }\n }\n // Mixin instance properties once, if they exist.\n if (this.__instanceProperties) {\n // TODO (justinfagnani): should we use the stored value? Could a new value\n // have been set since we stored the own property value?\n for (const [p, value] of this.__instanceProperties) {\n this[p as keyof this] = value as this[keyof this];\n }\n this.__instanceProperties = undefined;\n }\n // Trigger initial value reflection and populate the initial\n // `changedProperties` map, but only for the case of properties created\n // via `createProperty` on accessors, which will not have already\n // populated the `changedProperties` map since they are not set.\n // We can't know if these accessors had initializers, so we just set\n // them anyway - a difference from experimental decorators on fields and\n // standard decorators on auto-accessors.\n // For context see:\n // https://github.com/lit/lit/pull/4183#issuecomment-1711959635\n const elementProperties = (this.constructor as typeof ReactiveElement)\n .elementProperties;\n if (elementProperties.size > 0) {\n for (const [p, options] of elementProperties) {\n const {wrapped} = options;\n const value = this[p as keyof this];\n if (\n wrapped === true &&\n !this._$changedProperties.has(p) &&\n value !== undefined\n ) {\n this._$changeProperty(p, undefined, options, value);\n }\n }\n }\n }\n let shouldUpdate = false;\n const changedProperties = this._$changedProperties;\n try {\n shouldUpdate = this.shouldUpdate(changedProperties);\n if (shouldUpdate) {\n this.willUpdate(changedProperties);\n this.__controllers?.forEach((c) => c.hostUpdate?.());\n this.update(changedProperties);\n } else {\n this.__markUpdated();\n }\n } catch (e) {\n // Prevent `firstUpdated` and `updated` from running when there's an\n // update exception.\n shouldUpdate = false;\n // Ensure element can accept additional updates after an exception.\n this.__markUpdated();\n throw e;\n }\n // The update is no longer considered pending and further updates are now allowed.\n if (shouldUpdate) {\n this._$didUpdate(changedProperties);\n }\n }\n\n /**\n * Invoked before `update()` to compute values needed during the update.\n *\n * Implement `willUpdate` to compute property values that depend on other\n * properties and are used in the rest of the update process.\n *\n * ```ts\n * willUpdate(changedProperties) {\n * // only need to check changed properties for an expensive computation.\n * if (changedProperties.has('firstName') || changedProperties.has('lastName')) {\n * this.sha = computeSHA(`${this.firstName} ${this.lastName}`);\n * }\n * }\n *\n * render() {\n * return html`SHA: ${this.sha}`;\n * }\n * ```\n *\n * @category updates\n */\n protected willUpdate(_changedProperties: PropertyValues): void {}\n\n // Note, this is an override point for polyfill-support.\n // @internal\n _$didUpdate(changedProperties: PropertyValues) {\n this.__controllers?.forEach((c) => c.hostUpdated?.());\n if (!this.hasUpdated) {\n this.hasUpdated = true;\n this.firstUpdated(changedProperties);\n }\n this.updated(changedProperties);\n if (\n DEV_MODE &&\n this.isUpdatePending &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'change-in-update'\n )\n ) {\n issueWarning(\n 'change-in-update',\n `Element ${this.localName} scheduled an update ` +\n `(generally because a property was set) ` +\n `after an update completed, causing a new update to be scheduled. ` +\n `This is inefficient and should be avoided unless the next update ` +\n `can only be scheduled as a side effect of the previous update.`\n );\n }\n }\n\n private __markUpdated() {\n this._$changedProperties = new Map();\n this.isUpdatePending = false;\n }\n\n /**\n * Returns a Promise that resolves when the element has completed updating.\n * The Promise value is a boolean that is `true` if the element completed the\n * update without triggering another update. The Promise result is `false` if\n * a property was set inside `updated()`. If the Promise is rejected, an\n * exception was thrown during the update.\n *\n * To await additional asynchronous work, override the `getUpdateComplete`\n * method. For example, it is sometimes useful to await a rendered element\n * before fulfilling this Promise. To do this, first await\n * `super.getUpdateComplete()`, then any subsequent state.\n *\n * @return A promise of a boolean that resolves to true if the update completed\n * without triggering another update.\n * @category updates\n */\n get updateComplete(): Promise<boolean> {\n return this.getUpdateComplete();\n }\n\n /**\n * Override point for the `updateComplete` promise.\n *\n * It is not safe to override the `updateComplete` getter directly due to a\n * limitation in TypeScript which means it is not possible to call a\n * superclass getter (e.g. `super.updateComplete.then(...)`) when the target\n * language is ES5 (https://github.com/microsoft/TypeScript/issues/338).\n * This method should be overridden instead. For example:\n *\n * ```ts\n * class MyElement extends LitElement {\n * override async getUpdateComplete() {\n * const result = await super.getUpdateComplete();\n * await this._myChild.updateComplete;\n * return result;\n * }\n * }\n * ```\n *\n * @return A promise of a boolean that resolves to true if the update completed\n * without triggering another update.\n * @category updates\n */\n protected getUpdateComplete(): Promise<boolean> {\n return this.__updatePromise;\n }\n\n /**\n * Controls whether or not `update()` should be called when the element requests\n * an update. By default, this method always returns `true`, but this can be\n * customized to control when to update.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected shouldUpdate(_changedProperties: PropertyValues): boolean {\n return true;\n }\n\n /**\n * Updates the element. This method reflects property values to attributes.\n * It can be overridden to render and keep updated element DOM.\n * Setting properties inside this method will *not* trigger\n * another update.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected update(_changedProperties: PropertyValues) {\n // The forEach() expression will only run when __reflectingProperties is\n // defined, and it returns undefined, setting __reflectingProperties to\n // undefined\n this.__reflectingProperties &&= this.__reflectingProperties.forEach((p) =>\n this.__propertyToAttribute(p, this[p as keyof this])\n ) as undefined;\n this.__markUpdated();\n }\n\n /**\n * Invoked whenever the element is updated. Implement to perform\n * post-updating tasks via DOM APIs, for example, focusing an element.\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected updated(_changedProperties: PropertyValues) {}\n\n /**\n * Invoked when the element is first updated. Implement to perform one time\n * work on the element after update.\n *\n * ```ts\n * firstUpdated() {\n * this.renderRoot.getElementById('my-text-area').focus();\n * }\n * ```\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected firstUpdated(_changedProperties: PropertyValues) {}\n}\n// Assigned here to work around a jscompiler bug with static fields\n// when compiling to ES5.\n// https://github.com/google/closure-compiler/issues/3177\n(ReactiveElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('elementProperties', ReactiveElement)\n] = new Map();\n(ReactiveElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('finalized', ReactiveElement)\n] = new Map();\n\n// Apply polyfills if available\npolyfillSupport?.({ReactiveElement});\n\n// Dev mode warnings...\nif (DEV_MODE) {\n // Default warning set.\n ReactiveElement.enabledWarnings = [\n 'change-in-update',\n 'async-perform-update',\n ];\n const ensureOwnWarnings = function (ctor: typeof ReactiveElement) {\n if (\n !ctor.hasOwnProperty(JSCompiler_renameProperty('enabledWarnings', ctor))\n ) {\n ctor.enabledWarnings = ctor.enabledWarnings!.slice();\n }\n };\n ReactiveElement.enableWarning = function (\n this: typeof ReactiveElement,\n warning: WarningKind\n ) {\n ensureOwnWarnings(this);\n if (!this.enabledWarnings!.includes(warning)) {\n this.enabledWarnings!.push(warning);\n }\n };\n ReactiveElement.disableWarning = function (\n this: typeof ReactiveElement,\n warning: WarningKind\n ) {\n ensureOwnWarnings(this);\n const i = this.enabledWarnings!.indexOf(warning);\n if (i >= 0) {\n this.enabledWarnings!.splice(i, 1);\n }\n };\n}\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for ReactiveElement usage.\n(global.reactiveElementVersions ??= []).push('2.1.0');\nif (DEV_MODE && global.reactiveElementVersions.length > 1) {\n queueMicrotask(() => {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. Loading multiple versions ` +\n `is not recommended.`\n );\n });\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// IMPORTANT: these imports must be type-only\nimport type {Directive, DirectiveResult, PartInfo} from './directive.js';\nimport type {TrustedHTML, TrustedTypesWindow} from 'trusted-types/lib/index.js';\n\nconst DEV_MODE = true;\nconst ENABLE_EXTRA_SECURITY_HOOKS = true;\nconst ENABLE_SHADYDOM_NOPATCH = true;\nconst NODE_MODE = false;\n\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace LitUnstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry =\n | TemplatePrep\n | TemplateInstantiated\n | TemplateInstantiatedAndUpdated\n | TemplateUpdating\n | BeginRender\n | EndRender\n | CommitPartEntry\n | SetPartValue;\n export interface TemplatePrep {\n kind: 'template prep';\n template: Template;\n strings: TemplateStringsArray;\n clonableTemplate: HTMLTemplateElement;\n parts: TemplatePart[];\n }\n export interface BeginRender {\n kind: 'begin render';\n id: number;\n value: unknown;\n container: HTMLElement | DocumentFragment;\n options: RenderOptions | undefined;\n part: ChildPart | undefined;\n }\n export interface EndRender {\n kind: 'end render';\n id: number;\n value: unknown;\n container: HTMLElement | DocumentFragment;\n options: RenderOptions | undefined;\n part: ChildPart;\n }\n export interface TemplateInstantiated {\n kind: 'template instantiated';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n fragment: Node;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface TemplateInstantiatedAndUpdated {\n kind: 'template instantiated and updated';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n fragment: Node;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface TemplateUpdating {\n kind: 'template updating';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface SetPartValue {\n kind: 'set part';\n part: Part;\n value: unknown;\n valueIndex: number;\n values: unknown[];\n templateInstance: TemplateInstance;\n }\n\n export type CommitPartEntry =\n | CommitNothingToChildEntry\n | CommitText\n | CommitNode\n | CommitAttribute\n | CommitProperty\n | CommitBooleanAttribute\n | CommitEventListener\n | CommitToElementBinding;\n\n export interface CommitNothingToChildEntry {\n kind: 'commit nothing to child';\n start: ChildNode;\n end: ChildNode | null;\n parent: Disconnectable | undefined;\n options: RenderOptions | undefined;\n }\n\n export interface CommitText {\n kind: 'commit text';\n node: Text;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitNode {\n kind: 'commit node';\n start: Node;\n parent: Disconnectable | undefined;\n value: Node;\n options: RenderOptions | undefined;\n }\n\n export interface CommitAttribute {\n kind: 'commit attribute';\n element: Element;\n name: string;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitProperty {\n kind: 'commit property';\n element: Element;\n name: string;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitBooleanAttribute {\n kind: 'commit boolean attribute';\n element: Element;\n name: string;\n value: boolean;\n options: RenderOptions | undefined;\n }\n\n export interface CommitEventListener {\n kind: 'commit event listener';\n element: Element;\n name: string;\n value: unknown;\n oldListener: unknown;\n options: RenderOptions | undefined;\n // True if we're removing the old event listener (e.g. because settings changed, or value is nothing)\n removeListener: boolean;\n // True if we're adding a new event listener (e.g. because first render, or settings changed)\n addListener: boolean;\n }\n\n export interface CommitToElementBinding {\n kind: 'commit to element binding';\n element: Element;\n value: unknown;\n options: RenderOptions | undefined;\n }\n }\n}\n\ninterface DebugLoggingWindow {\n // Even in dev mode, we generally don't want to emit these events, as that's\n // another level of cost, so only emit them when DEV_MODE is true _and_ when\n // window.emitLitDebugEvents is true.\n emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n ? (event: LitUnstable.DebugLog.Entry) => {\n const shouldEmit = (global as unknown as DebugLoggingWindow)\n .emitLitDebugLogEvents;\n if (!shouldEmit) {\n return;\n }\n global.dispatchEvent(\n new CustomEvent<LitUnstable.DebugLog.Entry>('lit-debug', {\n detail: event,\n })\n );\n }\n : undefined;\n// Used for connecting beginRender and endRender events when there are nested\n// renders when errors are thrown preventing an endRender event from being\n// called.\nlet debugLogRenderId = 0;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n global.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += code\n ? ` See https://lit.dev/msg/${code} for more information.`\n : '';\n if (\n !global.litIssuedWarnings!.has(warning) &&\n !global.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n\n queueMicrotask(() => {\n issueWarning(\n 'dev-mode',\n `Lit is in dev mode. Not recommended for production!`\n );\n });\n}\n\nconst wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n global.ShadyDOM?.inUse &&\n global.ShadyDOM?.noPatch === true\n ? (global.ShadyDOM!.wrap as <T extends Node>(node: T) => T)\n : <T extends Node>(node: T) => node;\n\nconst trustedTypes = (global as unknown as TrustedTypesWindow).trustedTypes;\n\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = trustedTypes\n ? trustedTypes.createPolicy('lit-html', {\n createHTML: (s) => s,\n })\n : undefined;\n\n/**\n * Used to sanitize any value before it is written into the DOM. This can be\n * used to implement a security policy of allowed and disallowed values in\n * order to prevent XSS attacks.\n *\n * One way of using this callback would be to check attributes and properties\n * against a list of high risk fields, and require that values written to such\n * fields be instances of a class which is safe by construction. Closure's Safe\n * HTML Types is one implementation of this technique (\n * https://github.com/google/safe-html-types/blob/master/doc/safehtml-types.md).\n * The TrustedTypes polyfill in API-only mode could also be used as a basis\n * for this technique (https://github.com/WICG/trusted-types).\n *\n * @param node The HTML node (usually either a #text node or an Element) that\n * is being written to. Note that this is just an exemplar node, the write\n * may take place against another instance of the same class of node.\n * @param name The name of an attribute or property (for example, 'href').\n * @param type Indicates whether the write that's about to be performed will\n * be to a property or a node.\n * @return A function that will sanitize this class of writes.\n */\nexport type SanitizerFactory = (\n node: Node,\n name: string,\n type: 'property' | 'attribute'\n) => ValueSanitizer;\n\n/**\n * A function which can sanitize values that will be written to a specific kind\n * of DOM sink.\n *\n * See SanitizerFactory.\n *\n * @param value The value to sanitize. Will be the actual value passed into\n * the lit-html template literal, so this could be of any type.\n * @return The value to write to the DOM. Usually the same as the input value,\n * unless sanitization is needed.\n */\nexport type ValueSanitizer = (value: unknown) => unknown;\n\nconst identityFunction: ValueSanitizer = (value: unknown) => value;\nconst noopSanitizer: SanitizerFactory = (\n _node: Node,\n _name: string,\n _type: 'property' | 'attribute'\n) => identityFunction;\n\n/** Sets the global sanitizer factory. */\nconst setSanitizer = (newSanitizer: SanitizerFactory) => {\n if (!ENABLE_EXTRA_SECURITY_HOOKS) {\n return;\n }\n if (sanitizerFactoryInternal !== noopSanitizer) {\n throw new Error(\n `Attempted to overwrite existing lit-html security policy.` +\n ` setSanitizeDOMValueFactory should be called at most once.`\n );\n }\n sanitizerFactoryInternal = newSanitizer;\n};\n\n/**\n * Only used in internal tests, not a part of the public API.\n */\nconst _testOnlyClearSanitizerFactoryDoNotCallOrElse = () => {\n sanitizerFactoryInternal = noopSanitizer;\n};\n\nconst createSanitizer: SanitizerFactory = (node, name, type) => {\n return sanitizerFactoryInternal(node, name, type);\n};\n\n// Added to an attribute name to mark the attribute as bound so we can find\n// it easily.\nconst boundAttributeSuffix = '$lit$';\n\n// This marker is used in many syntactic positions in HTML, so it must be\n// a valid element name and attribute name. We don't support dynamic names (yet)\n// but this at least ensures that the parse tree is closer to the template\n// intention.\nconst marker = `lit$${Math.random().toFixed(9).slice(2)}$`;\n\n// String used to tell if a comment is a marker comment\nconst markerMatch = '?' + marker;\n\n// Text used to insert a comment marker node. We use processing instruction\n// syntax because it's slightly smaller, but parses as a comment node.\nconst nodeMarker = `<${markerMatch}>`;\n\nconst d =\n NODE_MODE && global.document === undefined\n ? ({\n createTreeWalker() {\n return {};\n },\n } as unknown as Document)\n : document;\n\n// Creates a dynamic marker. We never have to search for these in the DOM.\nconst createMarker = () => d.createComment('');\n\n// https://tc39.github.io/ecma262/#sec-typeof-operator\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\nconst isPrimitive = (value: unknown): value is Primitive =>\n value === null || (typeof value != 'object' && typeof value != 'function');\nconst isArray = Array.isArray;\nconst isIterable = (value: unknown): value is Iterable<unknown> =>\n isArray(value) ||\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n typeof (value as any)?.[Symbol.iterator] === 'function';\n\nconst SPACE_CHAR = `[ \\t\\n\\f\\r]`;\nconst ATTR_VALUE_CHAR = `[^ \\t\\n\\f\\r\"'\\`<>=]`;\nconst NAME_CHAR = `[^\\\\s\"'>=/]`;\n\n// These regexes represent the five parsing states that we care about in the\n// Template's HTML scanner. They match the *end* of the state they're named\n// after.\n// Depending on the match, we transition to a new state. If there's no match,\n// we stay in the same state.\n// Note that the regexes are stateful. We utilize lastIndex and sync it\n// across the multiple regexes used. In addition to the five regexes below\n// we also dynamically create a regex to find the matching end tags for raw\n// text elements.\n\n/**\n * End of text is: `<` followed by:\n * (comment start) or (tag) or (dynamic tag binding)\n */\nconst textEndRegex = /<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g;\nconst COMMENT_START = 1;\nconst TAG_NAME = 2;\nconst DYNAMIC_TAG_NAME = 3;\n\nconst commentEndRegex = /-->/g;\n/**\n * Comments not started with <!--, like </{, can be ended by a single `>`\n */\nconst comment2EndRegex = />/g;\n\n/**\n * The tagEnd regex matches the end of the \"inside an opening\" tag syntax\n * position. It either matches a `>`, an attribute-like sequence, or the end\n * of the string after a space (attribute-name position ending).\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \" \\t\\n\\f\\r\" are HTML space characters:\n * https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * So an attribute is:\n * * The name: any character except a whitespace character, (\"), ('), \">\",\n * \"=\", or \"/\". Note: this is different from the HTML spec which also excludes control characters.\n * * Followed by zero or more space characters\n * * Followed by \"=\"\n * * Followed by zero or more space characters\n * * Followed by:\n * * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n * * (\") then any non-(\"), or\n * * (') then any non-(')\n */\nconst tagEndRegex = new RegExp(\n `>|${SPACE_CHAR}(?:(${NAME_CHAR}+)(${SPACE_CHAR}*=${SPACE_CHAR}*(?:${ATTR_VALUE_CHAR}|(\"|')|))|$)`,\n 'g'\n);\nconst ENTIRE_MATCH = 0;\nconst ATTRIBUTE_NAME = 1;\nconst SPACES_AND_EQUALS = 2;\nconst QUOTE_CHAR = 3;\n\nconst singleQuoteAttrEndRegex = /'/g;\nconst doubleQuoteAttrEndRegex = /\"/g;\n/**\n * Matches the raw text elements.\n *\n * Comments are not parsed within raw text elements, so we need to search their\n * text content for marker strings.\n */\nconst rawTextElement = /^(?:script|style|textarea|title)$/i;\n\n/** TemplateResult types */\nconst HTML_RESULT = 1;\nconst SVG_RESULT = 2;\nconst MATHML_RESULT = 3;\n\ntype ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT;\n\n// TemplatePart types\n// IMPORTANT: these must match the values in PartType\nconst ATTRIBUTE_PART = 1;\nconst CHILD_PART = 2;\nconst PROPERTY_PART = 3;\nconst BOOLEAN_ATTRIBUTE_PART = 4;\nconst EVENT_PART = 5;\nconst ELEMENT_PART = 6;\nconst COMMENT_PART = 7;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg} when it hasn't been compiled by @lit-labs/compiler.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n */\nexport type UncompiledTemplateResult<T extends ResultType = ResultType> = {\n // This property needs to remain unminified.\n ['_$litType$']: T;\n strings: TemplateStringsArray;\n values: unknown[];\n};\n\n/**\n * This is a template result that may be either uncompiled or compiled.\n *\n * In the future, TemplateResult will be this type. If you want to explicitly\n * note that a template result is potentially compiled, you can reference this\n * type and it will continue to behave the same through the next major version\n * of Lit. This can be useful for code that wants to prepare for the next\n * major version of Lit.\n */\nexport type MaybeCompiledTemplateResult<T extends ResultType = ResultType> =\n | UncompiledTemplateResult<T>\n | CompiledTemplateResult;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg}.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n * In Lit 4, this type will be an alias of\n * MaybeCompiledTemplateResult, so that code will get type errors if it assumes\n * that Lit templates are not compiled. When deliberately working with only\n * one, use either {@linkcode CompiledTemplateResult} or\n * {@linkcode UncompiledTemplateResult} explicitly.\n */\nexport type TemplateResult<T extends ResultType = ResultType> =\n UncompiledTemplateResult<T>;\n\nexport type HTMLTemplateResult = TemplateResult<typeof HTML_RESULT>;\n\nexport type SVGTemplateResult = TemplateResult<typeof SVG_RESULT>;\n\nexport type MathMLTemplateResult = TemplateResult<typeof MATHML_RESULT>;\n\n/**\n * A TemplateResult that has been compiled by @lit-labs/compiler, skipping the\n * prepare step.\n */\nexport interface CompiledTemplateResult {\n // This is a factory in order to make template initialization lazy\n // and allow ShadyRenderOptions scope to be passed in.\n // This property needs to remain unminified.\n ['_$litType$']: CompiledTemplate;\n values: unknown[];\n}\n\nexport interface CompiledTemplate extends Omit<Template, 'el'> {\n // el is overridden to be optional. We initialize it on first render\n el?: HTMLTemplateElement;\n\n // The prepared HTML string to create a template element from.\n // The type is a TemplateStringsArray to guarantee that the value came from\n // source code, preventing a JSON injection attack.\n h: TemplateStringsArray;\n}\n\n/**\n * Generates a template literal tag function that returns a TemplateResult with\n * the given result type.\n */\nconst tag =\n <T extends ResultType>(type: T) =>\n (strings: TemplateStringsArray, ...values: unknown[]): TemplateResult<T> => {\n // Warn against templates octal escape sequences\n // We do this here rather than in render so that the warning is closer to the\n // template definition.\n if (DEV_MODE && strings.some((s) => s === undefined)) {\n console.warn(\n 'Some template strings are undefined.\\n' +\n 'This is probably caused by illegal octal escape sequences.'\n );\n }\n if (DEV_MODE) {\n // Import static-html.js results in a circular dependency which g3 doesn't\n // handle. Instead we know that static values must have the field\n // `_$litStatic$`.\n if (\n values.some((val) => (val as {_$litStatic$: unknown})?.['_$litStatic$'])\n ) {\n issueWarning(\n '',\n `Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\\n` +\n `Please use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions`\n );\n }\n }\n return {\n // This property needs to remain unminified.\n ['_$litType$']: type,\n strings,\n values,\n };\n };\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n *\n * ```ts\n * const header = (title: string) => html`<h1>${title}</h1>`;\n * ```\n *\n * The `html` tag returns a description of the DOM to render as a value. It is\n * lazy, meaning no work is done until the template is rendered. When rendering,\n * if a template comes from the same expression as a previously rendered result,\n * it's efficiently updated instead of replaced.\n */\nexport const html = tag(HTML_RESULT);\n\n/**\n * Interprets a template literal as an SVG fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const rect = svg`<rect width=\"10\" height=\"10\"></rect>`;\n *\n * const myImage = html`\n * <svg viewBox=\"0 0 10 10\" xmlns=\"http://www.w3.org/2000/svg\">\n * ${rect}\n * </svg>`;\n * ```\n *\n * The `svg` *tag function* should only be used for SVG fragments, or elements\n * that would be contained **inside** an `<svg>` HTML element. A common error is\n * placing an `<svg>` *element* in a template tagged with the `svg` tag\n * function. The `<svg>` element is an HTML element and should be used within a\n * template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an SVG fragment from the\n * `render()` method, as the SVG fragment will be contained within the element's\n * shadow root and thus not be properly contained within an `<svg>` HTML\n * element.\n */\nexport const svg = tag(SVG_RESULT);\n\n/**\n * Interprets a template literal as MathML fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const num = mathml`<mn>1</mn>`;\n *\n * const eq = html`\n * <math>\n * ${num}\n * </math>`;\n * ```\n *\n * The `mathml` *tag function* should only be used for MathML fragments, or\n * elements that would be contained **inside** a `<math>` HTML element. A common\n * error is placing a `<math>` *element* in a template tagged with the `mathml`\n * tag function. The `<math>` element is an HTML element and should be used\n * within a template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an MathML fragment from the\n * `render()` method, as the MathML fragment will be contained within the\n * element's shadow root and thus not be properly contained within a `<math>`\n * HTML element.\n */\nexport const mathml = tag(MATHML_RESULT);\n\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange = Symbol.for('lit-noChange');\n\n/**\n * A sentinel value that signals a ChildPart to fully clear its content.\n *\n * ```ts\n * const button = html`${\n * user.isAdmin\n * ? html`<button>DELETE</button>`\n * : nothing\n * }`;\n * ```\n *\n * Prefer using `nothing` over other falsy values as it provides a consistent\n * behavior between various expression binding contexts.\n *\n * In child expressions, `undefined`, `null`, `''`, and `nothing` all behave the\n * same and render no nodes. In attribute expressions, `nothing` _removes_ the\n * attribute, while `undefined` and `null` will render an empty string. In\n * property expressions `nothing` becomes `undefined`.\n */\nexport const nothing = Symbol.for('lit-nothing');\n\n/**\n * The cache of prepared templates, keyed by the tagged TemplateStringsArray\n * and _not_ accounting for the specific template tag used. This means that\n * template tags cannot be dynamic - they must statically be one of html, svg,\n * or attr. This restriction simplifies the cache lookup, which is on the hot\n * path for rendering.\n */\nconst templateCache = new WeakMap<TemplateStringsArray, Template>();\n\n/**\n * Object specifying options for controlling lit-html rendering. Note that\n * while `render` may be called multiple times on the same `container` (and\n * `renderBefore` reference node) to efficiently update the rendered content,\n * only the options passed in during the first render are respected during\n * the lifetime of renders to that unique `container` + `renderBefore`\n * combination.\n */\nexport interface RenderOptions {\n /**\n * An object to use as the `this` value for event listeners. It's often\n * useful to set this to the host component rendering a template.\n */\n host?: object;\n /**\n * A DOM node before which to render content in the container.\n */\n renderBefore?: ChildNode | null;\n /**\n * Node used for cloning the template (`importNode` will be called on this\n * node). This controls the `ownerDocument` of the rendered DOM, along with\n * any inherited context. Defaults to the global `document`.\n */\n creationScope?: {importNode(node: Node, deep?: boolean): Node};\n /**\n * The initial connected state for the top-level part being rendered. If no\n * `isConnected` option is set, `AsyncDirective`s will be connected by\n * default. Set to `false` if the initial render occurs in a disconnected tree\n * and `AsyncDirective`s should see `isConnected === false` for their initial\n * render. The `part.setConnected()` method must be used subsequent to initial\n * render to change the connected state of the part.\n */\n isConnected?: boolean;\n}\n\nconst walker = d.createTreeWalker(\n d,\n 129 /* NodeFilter.SHOW_{ELEMENT|COMMENT} */\n);\n\nlet sanitizerFactoryInternal: SanitizerFactory = noopSanitizer;\n\n//\n// Classes only below here, const variable declarations only above here...\n//\n// Keeping variable declarations and classes together improves minification.\n// Interfaces and type aliases can be interleaved freely.\n//\n\n// Type for classes that have a `_directive` or `_directives[]` field, used by\n// `resolveDirective`\nexport interface DirectiveParent {\n _$parent?: DirectiveParent;\n _$isConnected: boolean;\n __directive?: Directive;\n __directives?: Array<Directive | undefined>;\n}\n\nfunction trustFromTemplateString(\n tsa: TemplateStringsArray,\n stringFromTSA: string\n): TrustedHTML {\n // A security check to prevent spoofing of Lit template results.\n // In the future, we may be able to replace this with Array.isTemplateObject,\n // though we might need to make that check inside of the html and svg\n // functions, because precompiled templates don't come in as\n // TemplateStringArray objects.\n if (!isArray(tsa) || !tsa.hasOwnProperty('raw')) {\n let message = 'invalid template strings array';\n if (DEV_MODE) {\n message = `\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n `\n .trim()\n .replace(/\\n */g, '\\n');\n }\n throw new Error(message);\n }\n return policy !== undefined\n ? policy.createHTML(stringFromTSA)\n : (stringFromTSA as unknown as TrustedHTML);\n}\n\n/**\n * Returns an HTML string for the given TemplateStringsArray and result type\n * (HTML or SVG), along with the case-sensitive bound attribute names in\n * template order. The HTML contains comment markers denoting the `ChildPart`s\n * and suffixes on bound attributes denoting the `AttributeParts`.\n *\n * @param strings template strings array\n * @param type HTML or SVG\n * @return Array containing `[html, attrNames]` (array returned for terseness,\n * to avoid object fields since this code is shared with non-minified SSR\n * code)\n */\nconst getTemplateHtml = (\n strings: TemplateStringsArray,\n type: ResultType\n): [TrustedHTML, Array<string>] => {\n // Insert makers into the template HTML to represent the position of\n // bindings. The following code scans the template strings to determine the\n // syntactic position of the bindings. They can be in text position, where\n // we insert an HTML comment, attribute value position, where we insert a\n // sentinel string and re-write the attribute name, or inside a tag where\n // we insert the sentinel string.\n const l = strings.length - 1;\n // Stores the case-sensitive bound attribute names in the order of their\n // parts. ElementParts are also reflected in this array as undefined\n // rather than a string, to disambiguate from attribute bindings.\n const attrNames: Array<string> = [];\n let html =\n type === SVG_RESULT ? '<svg>' : type === MATHML_RESULT ? '<math>' : '';\n\n // When we're inside a raw text tag (not it's text content), the regex\n // will still be tagRegex so we can find attributes, but will switch to\n // this regex when the tag ends.\n let rawTextEndRegex: RegExp | undefined;\n\n // The current parsing state, represented as a reference to one of the\n // regexes\n let regex = textEndRegex;\n\n for (let i = 0; i < l; i++) {\n const s = strings[i];\n // The index of the end of the last attribute name. When this is\n // positive at end of a string, it means we're in an attribute value\n // position and need to rewrite the attribute name.\n // We also use a special value of -2 to indicate that we encountered\n // the end of a string in attribute name position.\n let attrNameEndIndex = -1;\n let attrName: string | undefined;\n let lastIndex = 0;\n let match!: RegExpExecArray | null;\n\n // The conditions in this loop handle the current parse state, and the\n // assignments to the `regex` variable are the state transitions.\n while (lastIndex < s.length) {\n // Make sure we start searching from where we previously left off\n regex.lastIndex = lastIndex;\n match = regex.exec(s);\n if (match === null) {\n break;\n }\n lastIndex = regex.lastIndex;\n if (regex === textEndRegex) {\n if (match[COMMENT_START] === '!--') {\n regex = commentEndRegex;\n } else if (match[COMMENT_START] !== undefined) {\n // We started a weird comment, like </{\n regex = comment2EndRegex;\n } else if (match[TAG_NAME] !== undefined) {\n if (rawTextElement.test(match[TAG_NAME])) {\n // Record if we encounter a raw-text element. We'll switch to\n // this regex at the end of the tag.\n rawTextEndRegex = new RegExp(`</${match[TAG_NAME]}`, 'g');\n }\n regex = tagEndRegex;\n } else if (match[DYNAMIC_TAG_NAME] !== undefined) {\n if (DEV_MODE) {\n throw new Error(\n 'Bindings in tag names are not supported. Please use static templates instead. ' +\n 'See https://lit.dev/docs/templates/expressions/#static-expressions'\n );\n }\n regex = tagEndRegex;\n }\n } else if (regex === tagEndRegex) {\n if (match[ENTIRE_MATCH] === '>') {\n // End of a tag. If we had started a raw-text element, use that\n // regex\n regex = rawTextEndRegex ?? textEndRegex;\n // We may be ending an unquoted attribute value, so make sure we\n // clear any pending attrNameEndIndex\n attrNameEndIndex = -1;\n } else if (match[ATTRIBUTE_NAME] === undefined) {\n // Attribute name position\n attrNameEndIndex = -2;\n } else {\n attrNameEndIndex = regex.lastIndex - match[SPACES_AND_EQUALS].length;\n attrName = match[ATTRIBUTE_NAME];\n regex =\n match[QUOTE_CHAR] === undefined\n ? tagEndRegex\n : match[QUOTE_CHAR] === '\"'\n ? doubleQuoteAttrEndRegex\n : singleQuoteAttrEndRegex;\n }\n } else if (\n regex === doubleQuoteAttrEndRegex ||\n regex === singleQuoteAttrEndRegex\n ) {\n regex = tagEndRegex;\n } else if (regex === commentEndRegex || regex === comment2EndRegex) {\n regex = textEndRegex;\n } else {\n // Not one of the five state regexes, so it must be the dynamically\n // created raw text regex and we're at the close of that element.\n regex = tagEndRegex;\n rawTextEndRegex = undefined;\n }\n }\n\n if (DEV_MODE) {\n // If we have a attrNameEndIndex, which indicates that we should\n // rewrite the attribute name, assert that we're in a valid attribute\n // position - either in a tag, or a quoted attribute value.\n console.assert(\n attrNameEndIndex === -1 ||\n regex === tagEndRegex ||\n regex === singleQuoteAttrEndRegex ||\n regex === doubleQuoteAttrEndRegex,\n 'unexpected parse state B'\n );\n }\n\n // We have four cases:\n // 1. We're in text position, and not in a raw text element\n // (regex === textEndRegex): insert a comment marker.\n // 2. We have a non-negative attrNameEndIndex which means we need to\n // rewrite the attribute name to add a bound attribute suffix.\n // 3. We're at the non-first binding in a multi-binding attribute, use a\n // plain marker.\n // 4. We're somewhere else inside the tag. If we're in attribute name\n // position (attrNameEndIndex === -2), add a sequential suffix to\n // generate a unique attribute name.\n\n // Detect a binding next to self-closing tag end and insert a space to\n // separate the marker from the tag end:\n const end =\n regex === tagEndRegex && strings[i + 1].startsWith('/>') ? ' ' : '';\n html +=\n regex === textEndRegex\n ? s + nodeMarker\n : attrNameEndIndex >= 0\n ? (attrNames.push(attrName!),\n s.slice(0, attrNameEndIndex) +\n boundAttributeSuffix +\n s.slice(attrNameEndIndex)) +\n marker +\n end\n : s + marker + (attrNameEndIndex === -2 ? i : end);\n }\n\n const htmlResult: string | TrustedHTML =\n html +\n (strings[l] || '<?>') +\n (type === SVG_RESULT ? '</svg>' : type === MATHML_RESULT ? '</math>' : '');\n\n // Returned as an array for terseness\n return [trustFromTemplateString(strings, htmlResult), attrNames];\n};\n\n/** @internal */\nexport type {Template};\nclass Template {\n /** @internal */\n el!: HTMLTemplateElement;\n\n parts: Array<TemplatePart> = [];\n\n constructor(\n // This property needs to remain unminified.\n {strings, ['_$litType$']: type}: UncompiledTemplateResult,\n options?: RenderOptions\n ) {\n let node: Node | null;\n let nodeIndex = 0;\n let attrNameIndex = 0;\n const partCount = strings.length - 1;\n const parts = this.parts;\n\n // Create template element\n const [html, attrNames] = getTemplateHtml(strings, type);\n this.el = Template.createElement(html, options);\n walker.currentNode = this.el.content;\n\n // Re-parent SVG or MathML nodes into template root\n if (type === SVG_RESULT || type === MATHML_RESULT) {\n const wrapper = this.el.content.firstChild!;\n wrapper.replaceWith(...wrapper.childNodes);\n }\n\n // Walk the template to find binding markers and create TemplateParts\n while ((node = walker.nextNode()) !== null && parts.length < partCount) {\n if (node.nodeType === 1) {\n if (DEV_MODE) {\n const tag = (node as Element).localName;\n // Warn if `textarea` includes an expression and throw if `template`\n // does since these are not supported. We do this by checking\n // innerHTML for anything that looks like a marker. This catches\n // cases like bindings in textarea there markers turn into text nodes.\n if (\n /^(?:textarea|template)$/i!.test(tag) &&\n (node as Element).innerHTML.includes(marker)\n ) {\n const m =\n `Expressions are not supported inside \\`${tag}\\` ` +\n `elements. See https://lit.dev/msg/expression-in-${tag} for more ` +\n `information.`;\n if (tag === 'template') {\n throw new Error(m);\n } else issueWarning('', m);\n }\n }\n // TODO (justinfagnani): for attempted dynamic tag names, we don't\n // increment the bindingIndex, and it'll be off by 1 in the element\n // and off by two after it.\n if ((node as Element).hasAttributes()) {\n for (const name of (node as Element).getAttributeNames()) {\n if (name.endsWith(boundAttributeSuffix)) {\n const realName = attrNames[attrNameIndex++];\n const value = (node as Element).getAttribute(name)!;\n const statics = value.split(marker);\n const m = /([.?@])?(.*)/.exec(realName)!;\n parts.push({\n type: ATTRIBUTE_PART,\n index: nodeIndex,\n name: m[2],\n strings: statics,\n ctor:\n m[1] === '.'\n ? PropertyPart\n : m[1] === '?'\n ? BooleanAttributePart\n : m[1] === '@'\n ? EventPart\n : AttributePart,\n });\n (node as Element).removeAttribute(name);\n } else if (name.startsWith(marker)) {\n parts.push({\n type: ELEMENT_PART,\n index: nodeIndex,\n });\n (node as Element).removeAttribute(name);\n }\n }\n }\n // TODO (justinfagnani): benchmark the regex against testing for each\n // of the 3 raw text element names.\n if (rawTextElement.test((node as Element).tagName)) {\n // For raw text elements we need to split the text content on\n // markers, create a Text node for each segment, and create\n // a TemplatePart for each marker.\n const strings = (node as Element).textContent!.split(marker);\n const lastIndex = strings.length - 1;\n if (lastIndex > 0) {\n (node as Element).textContent = trustedTypes\n ? (trustedTypes.emptyScript as unknown as '')\n : '';\n // Generate a new text node for each literal section\n // These nodes are also used as the markers for child parts\n for (let i = 0; i < lastIndex; i++) {\n (node as Element).append(strings[i], createMarker());\n // Walk past the marker node we just added\n walker.nextNode();\n parts.push({type: CHILD_PART, index: ++nodeIndex});\n }\n // Note because this marker is added after the walker's current\n // node, it will be walked to in the outer loop (and ignored), so\n // we don't need to adjust nodeIndex here\n (node as Element).append(strings[lastIndex], createMarker());\n }\n }\n } else if (node.nodeType === 8) {\n const data = (node as Comment).data;\n if (data === markerMatch) {\n parts.push({type: CHILD_PART, index: nodeIndex});\n } else {\n let i = -1;\n while ((i = (node as Comment).data.indexOf(marker, i + 1)) !== -1) {\n // Comment node has a binding marker inside, make an inactive part\n // The binding won't work, but subsequent bindings will\n parts.push({type: COMMENT_PART, index: nodeIndex});\n // Move to the end of the match\n i += marker.length - 1;\n }\n }\n }\n nodeIndex++;\n }\n\n if (DEV_MODE) {\n // If there was a duplicate attribute on a tag, then when the tag is\n // parsed into an element the attribute gets de-duplicated. We can detect\n // this mismatch if we haven't precisely consumed every attribute name\n // when preparing the template. This works because `attrNames` is built\n // from the template string and `attrNameIndex` comes from processing the\n // resulting DOM.\n if (attrNames.length !== attrNameIndex) {\n throw new Error(\n `Detected duplicate attribute bindings. This occurs if your template ` +\n `has duplicate attributes on an element tag. For example ` +\n `\"<input ?disabled=\\${true} ?disabled=\\${false}>\" contains a ` +\n `duplicate \"disabled\" attribute. The error was detected in ` +\n `the following template: \\n` +\n '`' +\n strings.join('${...}') +\n '`'\n );\n }\n }\n\n // We could set walker.currentNode to another node here to prevent a memory\n // leak, but every time we prepare a template, we immediately render it\n // and re-use the walker in new TemplateInstance._clone().\n debugLogEvent &&\n debugLogEvent({\n kind: 'template prep',\n template: this,\n clonableTemplate: this.el,\n parts: this.parts,\n strings,\n });\n }\n\n // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n /** @nocollapse */\n static createElement(html: TrustedHTML, _options?: RenderOptions) {\n const el = d.createElement('template');\n el.innerHTML = html as unknown as string;\n return el;\n }\n}\n\nexport interface Disconnectable {\n _$parent?: Disconnectable;\n _$disconnectableChildren?: Set<Disconnectable>;\n // Rather than hold connection state on instances, Disconnectables recursively\n // fetch the connection state from the RootPart they are connected in via\n // getters up the Disconnectable tree via _$parent references. This pushes the\n // cost of tracking the isConnected state to `AsyncDirectives`, and avoids\n // needing to pass all Disconnectables (parts, template instances, and\n // directives) their connection state each time it changes, which would be\n // costly for trees that have no AsyncDirectives.\n _$isConnected: boolean;\n}\n\nfunction resolveDirective(\n part: ChildPart | AttributePart | ElementPart,\n value: unknown,\n parent: DirectiveParent = part,\n attributeIndex?: number\n): unknown {\n // Bail early if the value is explicitly noChange. Note, this means any\n // nested directive is still attached and is not run.\n if (value === noChange) {\n return value;\n }\n let currentDirective =\n attributeIndex !== undefined\n ? (parent as AttributePart).__directives?.[attributeIndex]\n : (parent as ChildPart | ElementPart | Directive).__directive;\n const nextDirectiveConstructor = isPrimitive(value)\n ? undefined\n : // This property needs to remain unminified.\n (value as DirectiveResult)['_$litDirective$'];\n if (currentDirective?.constructor !== nextDirectiveConstructor) {\n // This property needs to remain unminified.\n currentDirective?.['_$notifyDirectiveConnectionChanged']?.(false);\n if (nextDirectiveConstructor === undefined) {\n currentDirective = undefined;\n } else {\n currentDirective = new nextDirectiveConstructor(part as PartInfo);\n currentDirective._$initialize(part, parent, attributeIndex);\n }\n if (attributeIndex !== undefined) {\n ((parent as AttributePart).__directives ??= [])[attributeIndex] =\n currentDirective;\n } else {\n (parent as ChildPart | Directive).__directive = currentDirective;\n }\n }\n if (currentDirective !== undefined) {\n value = resolveDirective(\n part,\n currentDirective._$resolve(part, (value as DirectiveResult).values),\n currentDirective,\n attributeIndex\n );\n }\n return value;\n}\n\nexport type {TemplateInstance};\n/**\n * An updateable instance of a Template. Holds references to the Parts used to\n * update the template instance.\n */\nclass TemplateInstance implements Disconnectable {\n _$template: Template;\n _$parts: Array<Part | undefined> = [];\n\n /** @internal */\n _$parent: ChildPart;\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n constructor(template: Template, parent: ChildPart) {\n this._$template = template;\n this._$parent = parent;\n }\n\n // Called by ChildPart parentNode getter\n get parentNode() {\n return this._$parent.parentNode;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n // This method is separate from the constructor because we need to return a\n // DocumentFragment and we don't want to hold onto it with an instance field.\n _clone(options: RenderOptions | undefined) {\n const {\n el: {content},\n parts: parts,\n } = this._$template;\n const fragment = (options?.creationScope ?? d).importNode(content, true);\n walker.currentNode = fragment;\n\n let node = walker.nextNode()!;\n let nodeIndex = 0;\n let partIndex = 0;\n let templatePart = parts[0];\n\n while (templatePart !== undefined) {\n if (nodeIndex === templatePart.index) {\n let part: Part | undefined;\n if (templatePart.type === CHILD_PART) {\n part = new ChildPart(\n node as HTMLElement,\n node.nextSibling,\n this,\n options\n );\n } else if (templatePart.type === ATTRIBUTE_PART) {\n part = new templatePart.ctor(\n node as HTMLElement,\n templatePart.name,\n templatePart.strings,\n this,\n options\n );\n } else if (templatePart.type === ELEMENT_PART) {\n part = new ElementPart(node as HTMLElement, this, options);\n }\n this._$parts.push(part);\n templatePart = parts[++partIndex];\n }\n if (nodeIndex !== templatePart?.index) {\n node = walker.nextNode()!;\n nodeIndex++;\n }\n }\n // We need to set the currentNode away from the cloned tree so that we\n // don't hold onto the tree even if the tree is detached and should be\n // freed.\n walker.currentNode = d;\n return fragment;\n }\n\n _update(values: Array<unknown>) {\n let i = 0;\n for (const part of this._$parts) {\n if (part !== undefined) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'set part',\n part,\n value: values[i],\n valueIndex: i,\n values,\n templateInstance: this,\n });\n if ((part as AttributePart).strings !== undefined) {\n (part as AttributePart)._$setValue(values, part as AttributePart, i);\n // The number of values the part consumes is part.strings.length - 1\n // since values are in between template spans. We increment i by 1\n // later in the loop, so increment it by part.strings.length - 2 here\n i += (part as AttributePart).strings!.length - 2;\n } else {\n part._$setValue(values[i]);\n }\n }\n i++;\n }\n }\n}\n\n/*\n * Parts\n */\ntype AttributeTemplatePart = {\n readonly type: typeof ATTRIBUTE_PART;\n readonly index: number;\n readonly name: string;\n readonly ctor: typeof AttributePart;\n readonly strings: ReadonlyArray<string>;\n};\ntype ChildTemplatePart = {\n readonly type: typeof CHILD_PART;\n readonly index: number;\n};\ntype ElementTemplatePart = {\n readonly type: typeof ELEMENT_PART;\n readonly index: number;\n};\ntype CommentTemplatePart = {\n readonly type: typeof COMMENT_PART;\n readonly index: number;\n};\n\n/**\n * A TemplatePart represents a dynamic part in a template, before the template\n * is instantiated. When a template is instantiated Parts are created from\n * TemplateParts.\n */\ntype TemplatePart =\n | ChildTemplatePart\n | AttributeTemplatePart\n | ElementTemplatePart\n | CommentTemplatePart;\n\nexport type Part =\n | ChildPart\n | AttributePart\n | PropertyPart\n | BooleanAttributePart\n | ElementPart\n | EventPart;\n\nexport type {ChildPart};\nclass ChildPart implements Disconnectable {\n readonly type = CHILD_PART;\n readonly options: RenderOptions | undefined;\n _$committedValue: unknown = nothing;\n /** @internal */\n __directive?: Directive;\n /** @internal */\n _$startNode: ChildNode;\n /** @internal */\n _$endNode: ChildNode | null;\n private _textSanitizer: ValueSanitizer | undefined;\n /** @internal */\n _$parent: Disconnectable | undefined;\n /**\n * Connection state for RootParts only (i.e. ChildPart without _$parent\n * returned from top-level `render`). This field is unused otherwise. The\n * intention would be clearer if we made `RootPart` a subclass of `ChildPart`\n * with this field (and a different _$isConnected getter), but the subclass\n * caused a perf regression, possibly due to making call sites polymorphic.\n * @internal\n */\n __isConnected: boolean;\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n // ChildParts that are not at the root should always be created with a\n // parent; only RootChildNode's won't, so they return the local isConnected\n // state\n return this._$parent?._$isConnected ?? this.__isConnected;\n }\n\n // The following fields will be patched onto ChildParts when required by\n // AsyncDirective\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n /** @internal */\n _$notifyConnectionChanged?(\n isConnected: boolean,\n removeFromParent?: boolean,\n from?: number\n ): void;\n /** @internal */\n _$reparentDisconnectables?(parent: Disconnectable): void;\n\n constructor(\n startNode: ChildNode,\n endNode: ChildNode | null,\n parent: TemplateInstance | ChildPart | undefined,\n options: RenderOptions | undefined\n ) {\n this._$startNode = startNode;\n this._$endNode = endNode;\n this._$parent = parent;\n this.options = options;\n // Note __isConnected is only ever accessed on RootParts (i.e. when there is\n // no _$parent); the value on a non-root-part is \"don't care\", but checking\n // for parent would be more code\n this.__isConnected = options?.isConnected ?? true;\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n // Explicitly initialize for consistent class shape.\n this._textSanitizer = undefined;\n }\n }\n\n /**\n * The parent node into which the part renders its content.\n *\n * A ChildPart's content consists of a range of adjacent child nodes of\n * `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and\n * `.endNode`).\n *\n * - If both `.startNode` and `.endNode` are non-null, then the part's content\n * consists of all siblings between `.startNode` and `.endNode`, exclusively.\n *\n * - If `.startNode` is non-null but `.endNode` is null, then the part's\n * content consists of all siblings following `.startNode`, up to and\n * including the last child of `.parentNode`. If `.endNode` is non-null, then\n * `.startNode` will always be non-null.\n *\n * - If both `.endNode` and `.startNode` are null, then the part's content\n * consists of all child nodes of `.parentNode`.\n */\n get parentNode(): Node {\n let parentNode: Node = wrap(this._$startNode).parentNode!;\n const parent = this._$parent;\n if (\n parent !== undefined &&\n parentNode?.nodeType === 11 /* Node.DOCUMENT_FRAGMENT */\n ) {\n // If the parentNode is a DocumentFragment, it may be because the DOM is\n // still in the cloned fragment during initial render; if so, get the real\n // parentNode the part will be committed into by asking the parent.\n parentNode = (parent as ChildPart | TemplateInstance).parentNode;\n }\n return parentNode;\n }\n\n /**\n * The part's leading marker node, if any. See `.parentNode` for more\n * information.\n */\n get startNode(): Node | null {\n return this._$startNode;\n }\n\n /**\n * The part's trailing marker node, if any. See `.parentNode` for more\n * information.\n */\n get endNode(): Node | null {\n return this._$endNode;\n }\n\n _$setValue(value: unknown, directiveParent: DirectiveParent = this): void {\n if (DEV_MODE && this.parentNode === null) {\n throw new Error(\n `This \\`ChildPart\\` has no \\`parentNode\\` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's \\`innerHTML\\` or \\`textContent\\` can do this.`\n );\n }\n value = resolveDirective(this, value, directiveParent);\n if (isPrimitive(value)) {\n // Non-rendering child values. It's important that these do not render\n // empty text nodes to avoid issues with preventing default <slot>\n // fallback content.\n if (value === nothing || value == null || value === '') {\n if (this._$committedValue !== nothing) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit nothing to child',\n start: this._$startNode,\n end: this._$endNode,\n parent: this._$parent,\n options: this.options,\n });\n this._$clear();\n }\n this._$committedValue = nothing;\n } else if (value !== this._$committedValue && value !== noChange) {\n this._commitText(value);\n }\n // This property needs to remain unminified.\n } else if ((value as TemplateResult)['_$litType$'] !== undefined) {\n this._commitTemplateResult(value as TemplateResult);\n } else if ((value as Node).nodeType !== undefined) {\n if (DEV_MODE && this.options?.host === value) {\n this._commitText(\n `[probable mistake: rendered a template's host in itself ` +\n `(commonly caused by writing \\${this} in a template]`\n );\n console.warn(\n `Attempted to render the template host`,\n value,\n `inside itself. This is almost always a mistake, and in dev mode `,\n `we render some warning text. In production however, we'll `,\n `render it, which will usually result in an error, and sometimes `,\n `in the element disappearing from the DOM.`\n );\n return;\n }\n this._commitNode(value as Node);\n } else if (isIterable(value)) {\n this._commitIterable(value);\n } else {\n // Fallback, will render the string representation\n this._commitText(value);\n }\n }\n\n private _insert<T extends Node>(node: T) {\n return wrap(wrap(this._$startNode).parentNode!).insertBefore(\n node,\n this._$endNode\n );\n }\n\n private _commitNode(value: Node): void {\n if (this._$committedValue !== value) {\n this._$clear();\n if (\n ENABLE_EXTRA_SECURITY_HOOKS &&\n sanitizerFactoryInternal !== noopSanitizer\n ) {\n const parentNodeName = this._$startNode.parentNode?.nodeName;\n if (parentNodeName === 'STYLE' || parentNodeName === 'SCRIPT') {\n let message = 'Forbidden';\n if (DEV_MODE) {\n if (parentNodeName === 'STYLE') {\n message =\n `Lit does not support binding inside style nodes. ` +\n `This is a security risk, as style injection attacks can ` +\n `exfiltrate data and spoof UIs. ` +\n `Consider instead using css\\`...\\` literals ` +\n `to compose styles, and do dynamic styling with ` +\n `css custom properties, ::parts, <slot>s, ` +\n `and by mutating the DOM rather than stylesheets.`;\n } else {\n message =\n `Lit does not support binding inside script nodes. ` +\n `This is a security risk, as it could allow arbitrary ` +\n `code execution.`;\n }\n }\n throw new Error(message);\n }\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit node',\n start: this._$startNode,\n parent: this._$parent,\n value: value,\n options: this.options,\n });\n this._$committedValue = this._insert(value);\n }\n }\n\n private _commitText(value: unknown): void {\n // If the committed value is a primitive it means we called _commitText on\n // the previous render, and we know that this._$startNode.nextSibling is a\n // Text node. We can now just replace the text content (.data) of the node.\n if (\n this._$committedValue !== nothing &&\n isPrimitive(this._$committedValue)\n ) {\n const node = wrap(this._$startNode).nextSibling as Text;\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._textSanitizer === undefined) {\n this._textSanitizer = createSanitizer(node, 'data', 'property');\n }\n value = this._textSanitizer(value);\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node,\n value,\n options: this.options,\n });\n (node as Text).data = value as string;\n } else {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n const textNode = d.createTextNode('');\n this._commitNode(textNode);\n // When setting text content, for security purposes it matters a lot\n // what the parent is. For example, <style> and <script> need to be\n // handled with care, while <span> does not. So first we need to put a\n // text node into the document, then we can sanitize its content.\n if (this._textSanitizer === undefined) {\n this._textSanitizer = createSanitizer(textNode, 'data', 'property');\n }\n value = this._textSanitizer(value);\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node: textNode,\n value,\n options: this.options,\n });\n textNode.data = value as string;\n } else {\n this._commitNode(d.createTextNode(value as string));\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node: wrap(this._$startNode).nextSibling as Text,\n value,\n options: this.options,\n });\n }\n }\n this._$committedValue = value;\n }\n\n private _commitTemplateResult(\n result: TemplateResult | CompiledTemplateResult\n ): void {\n // This property needs to remain unminified.\n const {values, ['_$litType$']: type} = result;\n // If $litType$ is a number, result is a plain TemplateResult and we get\n // the template from the template cache. If not, result is a\n // CompiledTemplateResult and _$litType$ is a CompiledTemplate and we need\n // to create the <template> element the first time we see it.\n const template: Template | CompiledTemplate =\n typeof type === 'number'\n ? this._$getTemplate(result as UncompiledTemplateResult)\n : (type.el === undefined &&\n (type.el = Template.createElement(\n trustFromTemplateString(type.h, type.h[0]),\n this.options\n )),\n type);\n\n if ((this._$committedValue as TemplateInstance)?._$template === template) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'template updating',\n template,\n instance: this._$committedValue as TemplateInstance,\n parts: (this._$committedValue as TemplateInstance)._$parts,\n options: this.options,\n values,\n });\n (this._$committedValue as TemplateInstance)._update(values);\n } else {\n const instance = new TemplateInstance(template as Template, this);\n const fragment = instance._clone(this.options);\n debugLogEvent &&\n debugLogEvent({\n kind: 'template instantiated',\n template,\n instance,\n parts: instance._$parts,\n options: this.options,\n fragment,\n values,\n });\n instance._update(values);\n debugLogEvent &&\n debugLogEvent({\n kind: 'template instantiated and updated',\n template,\n instance,\n parts: instance._$parts,\n options: this.options,\n fragment,\n values,\n });\n this._commitNode(fragment);\n this._$committedValue = instance;\n }\n }\n\n // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n /** @internal */\n _$getTemplate(result: UncompiledTemplateResult) {\n let template = templateCache.get(result.strings);\n if (template === undefined) {\n templateCache.set(result.strings, (template = new Template(result)));\n }\n return template;\n }\n\n private _commitIterable(value: Iterable<unknown>): void {\n // For an Iterable, we create a new InstancePart per item, then set its\n // value to the item. This is a little bit of overhead for every item in\n // an Iterable, but it lets us recurse easily and efficiently update Arrays\n // of TemplateResults that will be commonly returned from expressions like:\n // array.map((i) => html`${i}`), by reusing existing TemplateInstances.\n\n // If value is an array, then the previous render was of an\n // iterable and value will contain the ChildParts from the previous\n // render. If value is not an array, clear this part and make a new\n // array for ChildParts.\n if (!isArray(this._$committedValue)) {\n this._$committedValue = [];\n this._$clear();\n }\n\n // Lets us keep track of how many items we stamped so we can clear leftover\n // items from a previous render\n const itemParts = this._$committedValue as ChildPart[];\n let partIndex = 0;\n let itemPart: ChildPart | undefined;\n\n for (const item of value) {\n if (partIndex === itemParts.length) {\n // If no existing part, create a new one\n // TODO (justinfagnani): test perf impact of always creating two parts\n // instead of sharing parts between nodes\n // https://github.com/lit/lit/issues/1266\n itemParts.push(\n (itemPart = new ChildPart(\n this._insert(createMarker()),\n this._insert(createMarker()),\n this,\n this.options\n ))\n );\n } else {\n // Reuse an existing part\n itemPart = itemParts[partIndex];\n }\n itemPart._$setValue(item);\n partIndex++;\n }\n\n if (partIndex < itemParts.length) {\n // itemParts always have end nodes\n this._$clear(\n itemPart && wrap(itemPart._$endNode!).nextSibling,\n partIndex\n );\n // Truncate the parts array so _value reflects the current state\n itemParts.length = partIndex;\n }\n }\n\n /**\n * Removes the nodes contained within this Part from the DOM.\n *\n * @param start Start node to clear from, for clearing a subset of the part's\n * DOM (used when truncating iterables)\n * @param from When `start` is specified, the index within the iterable from\n * which ChildParts are being removed, used for disconnecting directives in\n * those Parts.\n *\n * @internal\n */\n _$clear(\n start: ChildNode | null = wrap(this._$startNode).nextSibling,\n from?: number\n ) {\n this._$notifyConnectionChanged?.(false, true, from);\n while (start && start !== this._$endNode) {\n const n = wrap(start!).nextSibling;\n (wrap(start!) as Element).remove();\n start = n;\n }\n }\n /**\n * Implementation of RootPart's `isConnected`. Note that this method\n * should only be called on `RootPart`s (the `ChildPart` returned from a\n * top-level `render()` call). It has no effect on non-root ChildParts.\n * @param isConnected Whether to set\n * @internal\n */\n setConnected(isConnected: boolean) {\n if (this._$parent === undefined) {\n this.__isConnected = isConnected;\n this._$notifyConnectionChanged?.(isConnected);\n } else if (DEV_MODE) {\n throw new Error(\n 'part.setConnected() may only be called on a ' +\n 'RootPart returned from render().'\n );\n }\n }\n}\n\n/**\n * A top-level `ChildPart` returned from `render` that manages the connected\n * state of `AsyncDirective`s created throughout the tree below it.\n */\nexport interface RootPart extends ChildPart {\n /**\n * Sets the connection state for `AsyncDirective`s contained within this root\n * ChildPart.\n *\n * lit-html does not automatically monitor the connectedness of DOM rendered;\n * as such, it is the responsibility of the caller to `render` to ensure that\n * `part.setConnected(false)` is called before the part object is potentially\n * discarded, to ensure that `AsyncDirective`s have a chance to dispose of\n * any resources being held. If a `RootPart` that was previously\n * disconnected is subsequently re-connected (and its `AsyncDirective`s should\n * re-connect), `setConnected(true)` should be called.\n *\n * @param isConnected Whether directives within this tree should be connected\n * or not\n */\n setConnected(isConnected: boolean): void;\n}\n\nexport type {AttributePart};\nclass AttributePart implements Disconnectable {\n readonly type:\n | typeof ATTRIBUTE_PART\n | typeof PROPERTY_PART\n | typeof BOOLEAN_ATTRIBUTE_PART\n | typeof EVENT_PART = ATTRIBUTE_PART;\n readonly element: HTMLElement;\n readonly name: string;\n readonly options: RenderOptions | undefined;\n\n /**\n * If this attribute part represents an interpolation, this contains the\n * static strings of the interpolation. For single-value, complete bindings,\n * this is undefined.\n */\n readonly strings?: ReadonlyArray<string>;\n /** @internal */\n _$committedValue: unknown | Array<unknown> = nothing;\n /** @internal */\n __directives?: Array<Directive | undefined>;\n /** @internal */\n _$parent: Disconnectable;\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n protected _sanitizer: ValueSanitizer | undefined;\n\n get tagName() {\n return this.element.tagName;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n constructor(\n element: HTMLElement,\n name: string,\n strings: ReadonlyArray<string>,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n this.element = element;\n this.name = name;\n this._$parent = parent;\n this.options = options;\n if (strings.length > 2 || strings[0] !== '' || strings[1] !== '') {\n this._$committedValue = new Array(strings.length - 1).fill(new String());\n this.strings = strings;\n } else {\n this._$committedValue = nothing;\n }\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n this._sanitizer = undefined;\n }\n }\n\n /**\n * Sets the value of this part by resolving the value from possibly multiple\n * values and static strings and committing it to the DOM.\n * If this part is single-valued, `this._strings` will be undefined, and the\n * method will be called with a single value argument. If this part is\n * multi-value, `this._strings` will be defined, and the method is called\n * with the value array of the part's owning TemplateInstance, and an offset\n * into the value array from which the values should be read.\n * This method is overloaded this way to eliminate short-lived array slices\n * of the template instance values, and allow a fast-path for single-valued\n * parts.\n *\n * @param value The part value, or an array of values for multi-valued parts\n * @param valueIndex the index to start reading values from. `undefined` for\n * single-valued parts\n * @param noCommit causes the part to not commit its value to the DOM. Used\n * in hydration to prime attribute parts with their first-rendered value,\n * but not set the attribute, and in SSR to no-op the DOM operation and\n * capture the value for serialization.\n *\n * @internal\n */\n _$setValue(\n value: unknown | Array<unknown>,\n directiveParent: DirectiveParent = this,\n valueIndex?: number,\n noCommit?: boolean\n ) {\n const strings = this.strings;\n\n // Whether any of the values has changed, for dirty-checking\n let change = false;\n\n if (strings === undefined) {\n // Single-value binding case\n value = resolveDirective(this, value, directiveParent, 0);\n change =\n !isPrimitive(value) ||\n (value !== this._$committedValue && value !== noChange);\n if (change) {\n this._$committedValue = value;\n }\n } else {\n // Interpolation case\n const values = value as Array<unknown>;\n value = strings[0];\n\n let i, v;\n for (i = 0; i < strings.length - 1; i++) {\n v = resolveDirective(this, values[valueIndex! + i], directiveParent, i);\n\n if (v === noChange) {\n // If the user-provided value is `noChange`, use the previous value\n v = (this._$committedValue as Array<unknown>)[i];\n }\n change ||=\n !isPrimitive(v) || v !== (this._$committedValue as Array<unknown>)[i];\n if (v === nothing) {\n value = nothing;\n } else if (value !== nothing) {\n value += (v ?? '') + strings[i + 1];\n }\n // We always record each value, even if one is `nothing`, for future\n // change detection.\n (this._$committedValue as Array<unknown>)[i] = v;\n }\n }\n if (change && !noCommit) {\n this._commitValue(value);\n }\n }\n\n /** @internal */\n _commitValue(value: unknown) {\n if (value === nothing) {\n (wrap(this.element) as Element).removeAttribute(this.name);\n } else {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._sanitizer === undefined) {\n this._sanitizer = sanitizerFactoryInternal(\n this.element,\n this.name,\n 'attribute'\n );\n }\n value = this._sanitizer(value ?? '');\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit attribute',\n element: this.element,\n name: this.name,\n value,\n options: this.options,\n });\n (wrap(this.element) as Element).setAttribute(\n this.name,\n (value ?? '') as string\n );\n }\n }\n}\n\nexport type {PropertyPart};\nclass PropertyPart extends AttributePart {\n override readonly type = PROPERTY_PART;\n\n /** @internal */\n override _commitValue(value: unknown) {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._sanitizer === undefined) {\n this._sanitizer = sanitizerFactoryInternal(\n this.element,\n this.name,\n 'property'\n );\n }\n value = this._sanitizer(value);\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit property',\n element: this.element,\n name: this.name,\n value,\n options: this.options,\n });\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.element as any)[this.name] = value === nothing ? undefined : value;\n }\n}\n\nexport type {BooleanAttributePart};\nclass BooleanAttributePart extends AttributePart {\n override readonly type = BOOLEAN_ATTRIBUTE_PART;\n\n /** @internal */\n override _commitValue(value: unknown) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit boolean attribute',\n element: this.element,\n name: this.name,\n value: !!(value && value !== nothing),\n options: this.options,\n });\n (wrap(this.element) as Element).toggleAttribute(\n this.name,\n !!value && value !== nothing\n );\n }\n}\n\ntype EventListenerWithOptions = EventListenerOrEventListenerObject &\n Partial<AddEventListenerOptions>;\n\n/**\n * An AttributePart that manages an event listener via add/removeEventListener.\n *\n * This part works by adding itself as the event listener on an element, then\n * delegating to the value passed to it. This reduces the number of calls to\n * add/removeEventListener if the listener changes frequently, such as when an\n * inline function is used as a listener.\n *\n * Because event options are passed when adding listeners, we must take case\n * to add and remove the part as a listener when the event options change.\n */\nexport type {EventPart};\nclass EventPart extends AttributePart {\n override readonly type = EVENT_PART;\n\n constructor(\n element: HTMLElement,\n name: string,\n strings: ReadonlyArray<string>,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n super(element, name, strings, parent, options);\n\n if (DEV_MODE && this.strings !== undefined) {\n throw new Error(\n `A \\`<${element.localName}>\\` has a \\`@${name}=...\\` listener with ` +\n 'invalid content. Event listeners in templates must have exactly ' +\n 'one expression and no surrounding text.'\n );\n }\n }\n\n // EventPart does not use the base _$setValue/_resolveValue implementation\n // since the dirty checking is more complex\n /** @internal */\n override _$setValue(\n newListener: unknown,\n directiveParent: DirectiveParent = this\n ) {\n newListener =\n resolveDirective(this, newListener, directiveParent, 0) ?? nothing;\n if (newListener === noChange) {\n return;\n }\n const oldListener = this._$committedValue;\n\n // If the new value is nothing or any options change we have to remove the\n // part as a listener.\n const shouldRemoveListener =\n (newListener === nothing && oldListener !== nothing) ||\n (newListener as EventListenerWithOptions).capture !==\n (oldListener as EventListenerWithOptions).capture ||\n (newListener as EventListenerWithOptions).once !==\n (oldListener as EventListenerWithOptions).once ||\n (newListener as EventListenerWithOptions).passive !==\n (oldListener as EventListenerWithOptions).passive;\n\n // If the new value is not nothing and we removed the listener, we have\n // to add the part as a listener.\n const shouldAddListener =\n newListener !== nothing &&\n (oldListener === nothing || shouldRemoveListener);\n\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit event listener',\n element: this.element,\n name: this.name,\n value: newListener,\n options: this.options,\n removeListener: shouldRemoveListener,\n addListener: shouldAddListener,\n oldListener,\n });\n if (shouldRemoveListener) {\n this.element.removeEventListener(\n this.name,\n this,\n oldListener as EventListenerWithOptions\n );\n }\n if (shouldAddListener) {\n this.element.addEventListener(\n this.name,\n this,\n newListener as EventListenerWithOptions\n );\n }\n this._$committedValue = newListener;\n }\n\n handleEvent(event: Event) {\n if (typeof this._$committedValue === 'function') {\n this._$committedValue.call(this.options?.host ?? this.element, event);\n } else {\n (this._$committedValue as EventListenerObject).handleEvent(event);\n }\n }\n}\n\nexport type {ElementPart};\nclass ElementPart implements Disconnectable {\n readonly type = ELEMENT_PART;\n\n /** @internal */\n __directive?: Directive;\n\n // This is to ensure that every Part has a _$committedValue\n _$committedValue: undefined;\n\n /** @internal */\n _$parent!: Disconnectable;\n\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n options: RenderOptions | undefined;\n\n constructor(\n public element: Element,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n this._$parent = parent;\n this.options = options;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n _$setValue(value: unknown): void {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit to element binding',\n element: this.element,\n value,\n options: this.options,\n });\n resolveDirective(this, value);\n }\n}\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LH object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-element, which re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LH = {\n // Used in lit-ssr\n _boundAttributeSuffix: boundAttributeSuffix,\n _marker: marker,\n _markerMatch: markerMatch,\n _HTML_RESULT: HTML_RESULT,\n _getTemplateHtml: getTemplateHtml,\n // Used in tests and private-ssr-support\n _TemplateInstance: TemplateInstance,\n _isIterable: isIterable,\n _resolveDirective: resolveDirective,\n _ChildPart: ChildPart,\n _AttributePart: AttributePart,\n _BooleanAttributePart: BooleanAttributePart,\n _EventPart: EventPart,\n _PropertyPart: PropertyPart,\n _ElementPart: ElementPart,\n};\n\n// Apply polyfills if available\nconst polyfillSupport = DEV_MODE\n ? global.litHtmlPolyfillSupportDevMode\n : global.litHtmlPolyfillSupport;\npolyfillSupport?.(Template, ChildPart);\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for lit-html usage.\n(global.litHtmlVersions ??= []).push('3.3.0');\nif (DEV_MODE && global.litHtmlVersions.length > 1) {\n queueMicrotask(() => {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. ` +\n `Loading multiple versions is not recommended.`\n );\n });\n}\n\n/**\n * Renders a value, usually a lit-html TemplateResult, to the container.\n *\n * This example renders the text \"Hello, Zoe!\" inside a paragraph tag, appending\n * it to the container `document.body`.\n *\n * ```js\n * import {html, render} from 'lit';\n *\n * const name = \"Zoe\";\n * render(html`<p>Hello, ${name}!</p>`, document.body);\n * ```\n *\n * @param value Any [renderable\n * value](https://lit.dev/docs/templates/expressions/#child-expressions),\n * typically a {@linkcode TemplateResult} created by evaluating a template tag\n * like {@linkcode html} or {@linkcode svg}.\n * @param container A DOM container to render to. The first render will append\n * the rendered value to the container, and subsequent renders will\n * efficiently update the rendered value if the same result type was\n * previously rendered there.\n * @param options See {@linkcode RenderOptions} for options documentation.\n * @see\n * {@link https://lit.dev/docs/libraries/standalone-templates/#rendering-lit-html-templates| Rendering Lit HTML Templates}\n */\nexport const render = (\n value: unknown,\n container: HTMLElement | DocumentFragment,\n options?: RenderOptions\n): RootPart => {\n if (DEV_MODE && container == null) {\n // Give a clearer error message than\n // Uncaught TypeError: Cannot read properties of null (reading\n // '_$litPart$')\n // which reads like an internal Lit error.\n throw new TypeError(`The container to render into may not be ${container}`);\n }\n const renderId = DEV_MODE ? debugLogRenderId++ : 0;\n const partOwnerNode = options?.renderBefore ?? container;\n // This property needs to remain unminified.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let part: ChildPart = (partOwnerNode as any)['_$litPart$'];\n debugLogEvent &&\n debugLogEvent({\n kind: 'begin render',\n id: renderId,\n value,\n container,\n options,\n part,\n });\n if (part === undefined) {\n const endNode = options?.renderBefore ?? null;\n // This property needs to remain unminified.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (partOwnerNode as any)['_$litPart$'] = part = new ChildPart(\n container.insertBefore(createMarker(), endNode),\n endNode,\n undefined,\n options ?? {}\n );\n }\n part._$setValue(value);\n debugLogEvent &&\n debugLogEvent({\n kind: 'end render',\n id: renderId,\n value,\n container,\n options,\n part,\n });\n return part as RootPart;\n};\n\nif (ENABLE_EXTRA_SECURITY_HOOKS) {\n render.setSanitizer = setSanitizer;\n render.createSanitizer = createSanitizer;\n if (DEV_MODE) {\n render._testOnlyClearSanitizerFactoryDoNotCallOrElse =\n _testOnlyClearSanitizerFactoryDoNotCallOrElse;\n }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The main LitElement module, which defines the {@linkcode LitElement} base\n * class and related APIs.\n *\n * LitElement components can define a template and a set of observed\n * properties. Changing an observed property triggers a re-render of the\n * element.\n *\n * Import {@linkcode LitElement} and {@linkcode html} from this module to\n * create a component:\n *\n * ```js\n * import {LitElement, html} from 'lit-element';\n *\n * class MyElement extends LitElement {\n *\n * // Declare observed properties\n * static get properties() {\n * return {\n * adjective: {}\n * }\n * }\n *\n * constructor() {\n * this.adjective = 'awesome';\n * }\n *\n * // Define the element's template\n * render() {\n * return html`<p>your ${adjective} template here</p>`;\n * }\n * }\n *\n * customElements.define('my-element', MyElement);\n * ```\n *\n * `LitElement` extends {@linkcode ReactiveElement} and adds lit-html\n * templating. The `ReactiveElement` class is provided for users that want to\n * build their own custom element base classes that don't use lit-html.\n *\n * @packageDocumentation\n */\nimport {PropertyValues, ReactiveElement} from '@lit/reactive-element';\nimport {render, RenderOptions, noChange, RootPart} from 'lit-html';\nexport * from '@lit/reactive-element';\nexport * from 'lit-html';\n\nimport {LitUnstable} from 'lit-html';\nimport {ReactiveUnstable} from '@lit/reactive-element';\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace Unstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry =\n | LitUnstable.DebugLog.Entry\n | ReactiveUnstable.DebugLog.Entry;\n }\n}\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\n/*@__INLINE__*/\nconst JSCompiler_renameProperty = <P extends PropertyKey>(\n prop: P,\n _obj: unknown\n): P => prop;\n\nconst DEV_MODE = true;\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n global.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += ` See https://lit.dev/msg/${code} for more information.`;\n if (\n !global.litIssuedWarnings!.has(warning) &&\n !global.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n}\n\n/**\n * Base element class that manages element properties and attributes, and\n * renders a lit-html template.\n *\n * To define a component, subclass `LitElement` and implement a\n * `render` method to provide the component's template. Define properties\n * using the {@linkcode LitElement.properties properties} property or the\n * {@linkcode property} decorator.\n */\nexport class LitElement extends ReactiveElement {\n // This property needs to remain unminified.\n static ['_$litElement$'] = true;\n\n /**\n * @category rendering\n */\n readonly renderOptions: RenderOptions = {host: this};\n\n private __childPart: RootPart | undefined = undefined;\n\n /**\n * @category rendering\n */\n protected override createRenderRoot() {\n const renderRoot = super.createRenderRoot();\n // When adoptedStyleSheets are shimmed, they are inserted into the\n // shadowRoot by createRenderRoot. Adjust the renderBefore node so that\n // any styles in Lit content render before adoptedStyleSheets. This is\n // important so that adoptedStyleSheets have precedence over styles in\n // the shadowRoot.\n this.renderOptions.renderBefore ??= renderRoot!.firstChild as ChildNode;\n return renderRoot;\n }\n\n /**\n * Updates the element. This method reflects property values to attributes\n * and calls `render` to render DOM via lit-html. Setting properties inside\n * this method will *not* trigger another update.\n * @param changedProperties Map of changed properties with old values\n * @category updates\n */\n protected override update(changedProperties: PropertyValues) {\n // Setting properties in `render` should not trigger an update. Since\n // updates are allowed after super.update, it's important to call `render`\n // before that.\n const value = this.render();\n if (!this.hasUpdated) {\n this.renderOptions.isConnected = this.isConnected;\n }\n super.update(changedProperties);\n this.__childPart = render(value, this.renderRoot, this.renderOptions);\n }\n\n /**\n * Invoked when the component is added to the document's DOM.\n *\n * In `connectedCallback()` you should setup tasks that should only occur when\n * the element is connected to the document. The most common of these is\n * adding event listeners to nodes external to the element, like a keydown\n * event handler added to the window.\n *\n * ```ts\n * connectedCallback() {\n * super.connectedCallback();\n * addEventListener('keydown', this._handleKeydown);\n * }\n * ```\n *\n * Typically, anything done in `connectedCallback()` should be undone when the\n * element is disconnected, in `disconnectedCallback()`.\n *\n * @category lifecycle\n */\n override connectedCallback() {\n super.connectedCallback();\n this.__childPart?.setConnected(true);\n }\n\n /**\n * Invoked when the component is removed from the document's DOM.\n *\n * This callback is the main signal to the element that it may no longer be\n * used. `disconnectedCallback()` should ensure that nothing is holding a\n * reference to the element (such as event listeners added to nodes external\n * to the element), so that it is free to be garbage collected.\n *\n * ```ts\n * disconnectedCallback() {\n * super.disconnectedCallback();\n * window.removeEventListener('keydown', this._handleKeydown);\n * }\n * ```\n *\n * An element may be re-connected after being disconnected.\n *\n * @category lifecycle\n */\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.__childPart?.setConnected(false);\n }\n\n /**\n * Invoked on each update to perform rendering tasks. This method may return\n * any value renderable by lit-html's `ChildPart` - typically a\n * `TemplateResult`. Setting properties inside this method will *not* trigger\n * the element to update.\n * @category rendering\n */\n protected render(): unknown {\n return noChange;\n }\n}\n\n/**\n * Ensure this class is marked as `finalized` as an optimization ensuring\n * it will not needlessly try to `finalize`.\n *\n * Note this property name is a string to prevent breaking Closure JS Compiler\n * optimizations. See @lit/reactive-element for more information.\n */\n(LitElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('finalized', LitElement)\n] = true;\n\n// Install hydration if available\nglobal.litElementHydrateSupport?.({LitElement});\n\n// Apply polyfills if available\nconst polyfillSupport = DEV_MODE\n ? global.litElementPolyfillSupportDevMode\n : global.litElementPolyfillSupport;\npolyfillSupport?.({LitElement});\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LE object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-html, since this module re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LE = {\n _$attributeToProperty: (\n el: LitElement,\n name: string,\n value: string | null\n ) => {\n // eslint-disable-next-line\n (el as any)._$attributeToProperty(name, value);\n },\n // eslint-disable-next-line\n _$changedProperties: (el: LitElement) => (el as any)._$changedProperties,\n};\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for LitElement usage.\n(global.litElementVersions ??= []).push('4.2.0');\nif (DEV_MODE && global.litElementVersions.length > 1) {\n queueMicrotask(() => {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. Loading multiple versions ` +\n `is not recommended.`\n );\n });\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\n\nimport {\n type PropertyDeclaration,\n type ReactiveElement,\n defaultConverter,\n notEqual,\n} from '../reactive-element.js';\nimport type {Interface} from './base.js';\n\nconst DEV_MODE = true;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n globalThis.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += ` See https://lit.dev/msg/${code} for more information.`;\n if (\n !globalThis.litIssuedWarnings!.has(warning) &&\n !globalThis.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n globalThis.litIssuedWarnings!.add(warning);\n }\n };\n}\n\n// Overloads for property decorator so that TypeScript can infer the correct\n// return type when a decorator is used as an accessor decorator or a setter\n// decorator.\nexport type PropertyDecorator = {\n // accessor decorator signature\n <C extends Interface<ReactiveElement>, V>(\n target: ClassAccessorDecoratorTarget<C, V>,\n context: ClassAccessorDecoratorContext<C, V>\n ): ClassAccessorDecoratorResult<C, V>;\n\n // setter decorator signature\n <C extends Interface<ReactiveElement>, V>(\n target: (value: V) => void,\n context: ClassSetterDecoratorContext<C, V>\n ): (this: C, value: V) => void;\n\n // legacy decorator signature\n (\n protoOrDescriptor: Object,\n name: PropertyKey,\n descriptor?: PropertyDescriptor\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): any;\n};\n\nconst legacyProperty = (\n options: PropertyDeclaration | undefined,\n proto: Object,\n name: PropertyKey\n) => {\n const hasOwnProperty = proto.hasOwnProperty(name);\n (proto.constructor as typeof ReactiveElement).createProperty(name, options);\n // For accessors (which have a descriptor on the prototype) we need to\n // return a descriptor, otherwise TypeScript overwrites the descriptor we\n // define in createProperty() with the original descriptor. We don't do this\n // for fields, which don't have a descriptor, because this could overwrite\n // descriptor defined by other decorators.\n return hasOwnProperty\n ? Object.getOwnPropertyDescriptor(proto, name)\n : undefined;\n};\n\n// This is duplicated from a similar variable in reactive-element.ts, but\n// actually makes sense to have this default defined with the decorator, so\n// that different decorators could have different defaults.\nconst defaultPropertyDeclaration: PropertyDeclaration = {\n attribute: true,\n type: String,\n converter: defaultConverter,\n reflect: false,\n hasChanged: notEqual,\n};\n\n// Temporary type, until google3 is on TypeScript 5.2\ntype StandardPropertyContext<C, V> = (\n | ClassAccessorDecoratorContext<C, V>\n | ClassSetterDecoratorContext<C, V>\n) & {metadata: object};\n\n/**\n * Wraps a class accessor or setter so that `requestUpdate()` is called with the\n * property name and old value when the accessor is set.\n */\nexport const standardProperty = <C extends Interface<ReactiveElement>, V>(\n options: PropertyDeclaration = defaultPropertyDeclaration,\n target: ClassAccessorDecoratorTarget<C, V> | ((value: V) => void),\n context: StandardPropertyContext<C, V>\n): ClassAccessorDecoratorResult<C, V> | ((this: C, value: V) => void) => {\n const {kind, metadata} = context;\n\n if (DEV_MODE && metadata == null) {\n issueWarning(\n 'missing-class-metadata',\n `The class ${target} is missing decorator metadata. This ` +\n `could mean that you're using a compiler that supports decorators ` +\n `but doesn't support decorator metadata, such as TypeScript 5.1. ` +\n `Please update your compiler.`\n );\n }\n\n // Store the property options\n let properties = globalThis.litPropertyMetadata.get(metadata);\n if (properties === undefined) {\n globalThis.litPropertyMetadata.set(metadata, (properties = new Map()));\n }\n if (kind === 'setter') {\n options = Object.create(options);\n options.wrapped = true;\n }\n properties.set(context.name, options);\n\n if (kind === 'accessor') {\n // Standard decorators cannot dynamically modify the class, so we can't\n // replace a field with accessors. The user must use the new `accessor`\n // keyword instead.\n const {name} = context;\n return {\n set(this: ReactiveElement, v: V) {\n const oldValue = (\n target as ClassAccessorDecoratorTarget<C, V>\n ).get.call(this as unknown as C);\n (target as ClassAccessorDecoratorTarget<C, V>).set.call(\n this as unknown as C,\n v\n );\n this.requestUpdate(name, oldValue, options);\n },\n init(this: ReactiveElement, v: V): V {\n if (v !== undefined) {\n this._$changeProperty(name, undefined, options, v);\n }\n return v;\n },\n } as unknown as ClassAccessorDecoratorResult<C, V>;\n } else if (kind === 'setter') {\n const {name} = context;\n return function (this: ReactiveElement, value: V) {\n const oldValue = this[name as keyof ReactiveElement];\n (target as (value: V) => void).call(this, value);\n this.requestUpdate(name, oldValue, options);\n } as unknown as (this: C, value: V) => void;\n }\n throw new Error(`Unsupported decorator location: ${kind}`);\n};\n\n/**\n * A class field or accessor decorator which creates a reactive property that\n * reflects a corresponding attribute value. When a decorated property is set\n * the element will update and render. A {@linkcode PropertyDeclaration} may\n * optionally be supplied to configure property features.\n *\n * This decorator should only be used for public fields. As public fields,\n * properties should be considered as primarily settable by element users,\n * either via attribute or the property itself.\n *\n * Generally, properties that are changed by the element should be private or\n * protected fields and should use the {@linkcode state} decorator.\n *\n * However, sometimes element code does need to set a public property. This\n * should typically only be done in response to user interaction, and an event\n * should be fired informing the user; for example, a checkbox sets its\n * `checked` property when clicked and fires a `changed` event. Mutating public\n * properties should typically not be done for non-primitive (object or array)\n * properties. In other cases when an element needs to manage state, a private\n * property decorated via the {@linkcode state} decorator should be used. When\n * needed, state properties can be initialized via public properties to\n * facilitate complex interactions.\n *\n * ```ts\n * class MyElement {\n * @property({ type: Boolean })\n * clicked = false;\n * }\n * ```\n * @category Decorator\n * @ExportDecoratedItems\n */\nexport function property(options?: PropertyDeclaration): PropertyDecorator {\n return <C extends Interface<ReactiveElement>, V>(\n protoOrTarget:\n | object\n | ClassAccessorDecoratorTarget<C, V>\n | ((value: V) => void),\n nameOrContext:\n | PropertyKey\n | ClassAccessorDecoratorContext<C, V>\n | ClassSetterDecoratorContext<C, V>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): any => {\n return (\n typeof nameOrContext === 'object'\n ? standardProperty<C, V>(\n options,\n protoOrTarget as\n | ClassAccessorDecoratorTarget<C, V>\n | ((value: V) => void),\n nameOrContext as StandardPropertyContext<C, V>\n )\n : legacyProperty(\n options,\n protoOrTarget as Object,\n nameOrContext as PropertyKey\n )\n ) as PropertyDecorator;\n };\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\n\nimport {property} from './property.js';\n\nexport interface StateDeclaration<Type = unknown> {\n /**\n * A function that indicates if a property should be considered changed when\n * it is set. The function should take the `newValue` and `oldValue` and\n * return `true` if an update should be requested.\n */\n hasChanged?(value: Type, oldValue: Type): boolean;\n}\n\n/**\n * @deprecated use StateDeclaration\n */\nexport type InternalPropertyDeclaration<Type = unknown> =\n StateDeclaration<Type>;\n\n/**\n * Declares a private or protected reactive property that still triggers\n * updates to the element when it changes. It does not reflect from the\n * corresponding attribute.\n *\n * Properties declared this way must not be used from HTML or HTML templating\n * systems, they're solely for properties internal to the element. These\n * properties may be renamed by optimization tools like closure compiler.\n * @category Decorator\n */\nexport function state(options?: StateDeclaration) {\n return property({\n ...options,\n // Add both `state` and `attribute` because we found a third party\n // controller that is keying off of PropertyOptions.state to determine\n // whether a field is a private internal property or not.\n state: true,\n attribute: false,\n });\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Generates a public interface type that removes private and protected fields.\n * This allows accepting otherwise incompatible versions of the type (e.g. from\n * multiple copies of the same package in `node_modules`).\n */\nexport type Interface<T> = {\n [K in keyof T]: T[K];\n};\n\nexport type Constructor<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n};\n\n/**\n * Wraps up a few best practices when returning a property descriptor from a\n * decorator.\n *\n * Marks the defined property as configurable, and enumerable, and handles\n * the case where we have a busted Reflect.decorate zombiefill (e.g. in Angular\n * apps).\n *\n * @internal\n */\nexport const desc = (\n obj: object,\n name: PropertyKey | ClassAccessorDecoratorContext<unknown, unknown>,\n descriptor: PropertyDescriptor\n) => {\n // For backwards compatibility, we keep them configurable and enumerable.\n descriptor.configurable = true;\n descriptor.enumerable = true;\n if (\n // We check for Reflect.decorate each time, in case the zombiefill\n // is applied via lazy loading some Angular code.\n (Reflect as typeof Reflect & {decorate?: unknown}).decorate &&\n typeof name !== 'object'\n ) {\n // If we're called as a legacy decorator, and Reflect.decorate is present\n // then we have no guarantees that the returned descriptor will be\n // defined on the class, so we must apply it directly ourselves.\n\n Object.defineProperty(obj, name, descriptor);\n }\n return descriptor;\n};\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\nimport type {ReactiveElement} from '../reactive-element.js';\nimport {desc, type Interface} from './base.js';\n\nconst DEV_MODE = true;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n globalThis.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += code\n ? ` See https://lit.dev/msg/${code} for more information.`\n : '';\n if (\n !globalThis.litIssuedWarnings!.has(warning) &&\n !globalThis.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n globalThis.litIssuedWarnings!.add(warning);\n }\n };\n}\n\nexport type QueryDecorator = {\n // legacy\n (\n proto: Interface<ReactiveElement>,\n name: PropertyKey,\n descriptor?: PropertyDescriptor\n // Note TypeScript requires the return type to be `void|any`\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): void | any;\n\n // standard\n <C extends Interface<ReactiveElement>, V extends Element | null>(\n value: ClassAccessorDecoratorTarget<C, V>,\n context: ClassAccessorDecoratorContext<C, V>\n ): ClassAccessorDecoratorResult<C, V>;\n};\n\n/**\n * A property decorator that converts a class property into a getter that\n * executes a querySelector on the element's renderRoot.\n *\n * @param selector A DOMString containing one or more selectors to match.\n * @param cache An optional boolean which when true performs the DOM query only\n * once and caches the result.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector\n *\n * ```ts\n * class MyElement {\n * @query('#first')\n * first: HTMLDivElement;\n *\n * render() {\n * return html`\n * <div id=\"first\"></div>\n * <div id=\"second\"></div>\n * `;\n * }\n * }\n * ```\n * @category Decorator\n */\nexport function query(selector: string, cache?: boolean): QueryDecorator {\n return (<C extends Interface<ReactiveElement>, V extends Element | null>(\n protoOrTarget: ClassAccessorDecoratorTarget<C, V>,\n nameOrContext: PropertyKey | ClassAccessorDecoratorContext<C, V>,\n descriptor?: PropertyDescriptor\n ) => {\n const doQuery = (el: Interface<ReactiveElement>): V => {\n const result = (el.renderRoot?.querySelector(selector) ?? null) as V;\n if (DEV_MODE && result === null && cache && !el.hasUpdated) {\n const name =\n typeof nameOrContext === 'object'\n ? nameOrContext.name\n : nameOrContext;\n issueWarning(\n '',\n `@query'd field ${JSON.stringify(String(name))} with the 'cache' ` +\n `flag set for selector '${selector}' has been accessed before ` +\n `the first update and returned null. This is expected if the ` +\n `renderRoot tree has not been provided beforehand (e.g. via ` +\n `Declarative Shadow DOM). Therefore the value hasn't been cached.`\n );\n }\n // TODO: if we want to allow users to assert that the query will never\n // return null, we need a new option and to throw here if the result\n // is null.\n return result;\n };\n if (cache) {\n // Accessors to wrap from either:\n // 1. The decorator target, in the case of standard decorators\n // 2. The property descriptor, in the case of experimental decorators\n // on auto-accessors.\n // 3. Functions that access our own cache-key property on the instance,\n // in the case of experimental decorators on fields.\n const {get, set} =\n typeof nameOrContext === 'object'\n ? protoOrTarget\n : descriptor ??\n (() => {\n const key = DEV_MODE\n ? Symbol(`${String(nameOrContext)} (@query() cache)`)\n : Symbol();\n type WithCache = ReactiveElement & {\n [key: symbol]: Element | null;\n };\n return {\n get() {\n return (this as WithCache)[key];\n },\n set(v) {\n (this as WithCache)[key] = v;\n },\n };\n })();\n return desc(protoOrTarget, nameOrContext, {\n get(this: ReactiveElement): V {\n let result: V = get!.call(this);\n if (result === undefined) {\n result = doQuery(this);\n if (result !== null || this.hasUpdated) {\n set!.call(this, result);\n }\n }\n return result;\n },\n });\n } else {\n // This object works as the return type for both standard and\n // experimental decorators.\n return desc(protoOrTarget, nameOrContext, {\n get(this: ReactiveElement) {\n return doQuery(this);\n },\n });\n }\n }) as QueryDecorator;\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\nimport type {ReactiveElement} from '../reactive-element.js';\nimport {desc, type Interface} from './base.js';\n\nexport type QueryAllDecorator = {\n // legacy\n (\n proto: Interface<ReactiveElement>,\n name: PropertyKey,\n descriptor?: PropertyDescriptor\n // Note TypeScript requires the return type to be `void|any`\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): void | any;\n\n // standard\n <C extends Interface<ReactiveElement>, V extends NodeList>(\n value: ClassAccessorDecoratorTarget<C, V>,\n context: ClassAccessorDecoratorContext<C, V>\n ): ClassAccessorDecoratorResult<C, V>;\n};\n\n// Shared fragment used to generate empty NodeLists when a render root is\n// undefined\nlet fragment: DocumentFragment;\n\n/**\n * A property decorator that converts a class property into a getter\n * that executes a querySelectorAll on the element's renderRoot.\n *\n * @param selector A DOMString containing one or more selectors to match.\n *\n * See:\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll\n *\n * ```ts\n * class MyElement {\n * @queryAll('div')\n * divs: NodeListOf<HTMLDivElement>;\n *\n * render() {\n * return html`\n * <div id=\"first\"></div>\n * <div id=\"second\"></div>\n * `;\n * }\n * }\n * ```\n * @category Decorator\n */\nexport function queryAll(selector: string): QueryAllDecorator {\n return ((\n obj: object,\n name: PropertyKey | ClassAccessorDecoratorContext<unknown, unknown>\n ) => {\n return desc(obj, name, {\n get(this: ReactiveElement) {\n const container =\n this.renderRoot ?? (fragment ??= document.createDocumentFragment());\n return container.querySelectorAll(selector);\n },\n });\n }) as QueryAllDecorator;\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\n\nimport type {ReactiveElement} from '../reactive-element.js';\nimport type {QueryAssignedNodesOptions} from './query-assigned-nodes.js';\nimport {desc, type Interface} from './base.js';\n\nexport type QueryAssignedElementsDecorator = {\n // legacy\n (\n proto: Interface<ReactiveElement>,\n name: PropertyKey,\n descriptor?: PropertyDescriptor\n // Note TypeScript requires the return type to be `void|any`\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): void | any;\n\n // standard\n <C extends Interface<ReactiveElement>, V extends Array<Element>>(\n value: ClassAccessorDecoratorTarget<C, V>,\n context: ClassAccessorDecoratorContext<C, V>\n ): ClassAccessorDecoratorResult<C, V>;\n};\n\n/**\n * Options for the {@linkcode queryAssignedElements} decorator. Extends the\n * options that can be passed into\n * [HTMLSlotElement.assignedElements](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSlotElement/assignedElements).\n */\nexport interface QueryAssignedElementsOptions\n extends QueryAssignedNodesOptions {\n /**\n * CSS selector used to filter the elements returned. For example, a selector\n * of `\".item\"` will only include elements with the `item` class.\n */\n selector?: string;\n}\n\n/**\n * A property decorator that converts a class property into a getter that\n * returns the `assignedElements` of the given `slot`. Provides a declarative\n * way to use\n * [`HTMLSlotElement.assignedElements`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSlotElement/assignedElements).\n *\n * Can be passed an optional {@linkcode QueryAssignedElementsOptions} object.\n *\n * Example usage:\n * ```ts\n * class MyElement {\n * @queryAssignedElements({ slot: 'list' })\n * listItems!: Array<HTMLElement>;\n * @queryAssignedElements()\n * unnamedSlotEls!: Array<HTMLElement>;\n *\n * render() {\n * return html`\n * <slot name=\"list\"></slot>\n * <slot></slot>\n * `;\n * }\n * }\n * ```\n *\n * Note, the type of this property should be annotated as `Array<HTMLElement>`.\n *\n * @category Decorator\n */\nexport function queryAssignedElements(\n options?: QueryAssignedElementsOptions\n): QueryAssignedElementsDecorator {\n return (<V extends Array<Element>>(\n obj: object,\n name: PropertyKey | ClassAccessorDecoratorContext<unknown, unknown>\n ) => {\n const {slot, selector} = options ?? {};\n const slotSelector = `slot${slot ? `[name=${slot}]` : ':not([name])'}`;\n return desc(obj, name, {\n get(this: ReactiveElement): V {\n const slotEl =\n this.renderRoot?.querySelector<HTMLSlotElement>(slotSelector);\n const elements = slotEl?.assignedElements(options) ?? [];\n return (\n selector === undefined\n ? elements\n : elements.filter((node) => node.matches(selector))\n ) as V;\n },\n });\n }) as QueryAssignedElementsDecorator;\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {Disconnectable, Part} from './lit-html.js';\n\nexport {\n AttributePart,\n BooleanAttributePart,\n ChildPart,\n ElementPart,\n EventPart,\n Part,\n PropertyPart,\n} from './lit-html.js';\n\nexport interface DirectiveClass {\n new (part: PartInfo): Directive;\n}\n\n/**\n * This utility type extracts the signature of a directive class's render()\n * method so we can use it for the type of the generated directive function.\n */\nexport type DirectiveParameters<C extends Directive> = Parameters<C['render']>;\n\n/**\n * A generated directive function doesn't evaluate the directive, but just\n * returns a DirectiveResult object that captures the arguments.\n */\nexport interface DirectiveResult<C extends DirectiveClass = DirectiveClass> {\n /**\n * This property needs to remain unminified.\n * @internal\n */\n ['_$litDirective$']: C;\n /** @internal */\n values: DirectiveParameters<InstanceType<C>>;\n}\n\nexport const PartType = {\n ATTRIBUTE: 1,\n CHILD: 2,\n PROPERTY: 3,\n BOOLEAN_ATTRIBUTE: 4,\n EVENT: 5,\n ELEMENT: 6,\n} as const;\n\nexport type PartType = (typeof PartType)[keyof typeof PartType];\n\nexport interface ChildPartInfo {\n readonly type: typeof PartType.CHILD;\n}\n\nexport interface AttributePartInfo {\n readonly type:\n | typeof PartType.ATTRIBUTE\n | typeof PartType.PROPERTY\n | typeof PartType.BOOLEAN_ATTRIBUTE\n | typeof PartType.EVENT;\n readonly strings?: ReadonlyArray<string>;\n readonly name: string;\n readonly tagName: string;\n}\n\nexport interface ElementPartInfo {\n readonly type: typeof PartType.ELEMENT;\n}\n\n/**\n * Information about the part a directive is bound to.\n *\n * This is useful for checking that a directive is attached to a valid part,\n * such as with directive that can only be used on attribute bindings.\n */\nexport type PartInfo = ChildPartInfo | AttributePartInfo | ElementPartInfo;\n\n/**\n * Creates a user-facing directive function from a Directive class. This\n * function has the same parameters as the directive's render() method.\n */\nexport const directive =\n <C extends DirectiveClass>(c: C) =>\n (...values: DirectiveParameters<InstanceType<C>>): DirectiveResult<C> => ({\n // This property needs to remain unminified.\n ['_$litDirective$']: c,\n values,\n });\n\n/**\n * Base class for creating custom directives. Users should extend this class,\n * implement `render` and/or `update`, and then pass their subclass to\n * `directive`.\n */\nexport abstract class Directive implements Disconnectable {\n //@internal\n __part!: Part;\n //@internal\n __attributeIndex: number | undefined;\n //@internal\n __directive?: Directive;\n\n //@internal\n _$parent!: Disconnectable;\n\n // These will only exist on the AsyncDirective subclass\n //@internal\n _$disconnectableChildren?: Set<Disconnectable>;\n // This property needs to remain unminified.\n //@internal\n ['_$notifyDirectiveConnectionChanged']?(isConnected: boolean): void;\n\n constructor(_partInfo: PartInfo) {}\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n /** @internal */\n _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n this.__part = part;\n this._$parent = parent;\n this.__attributeIndex = attributeIndex;\n }\n /** @internal */\n _$resolve(part: Part, props: Array<unknown>): unknown {\n return this.update(part, props);\n }\n\n abstract render(...props: Array<unknown>): unknown;\n\n update(_part: Part, props: Array<unknown>): unknown {\n return this.render(...props);\n }\n}\n", "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {AttributePart, noChange} from '../lit-html.js';\nimport {\n directive,\n Directive,\n DirectiveParameters,\n PartInfo,\n PartType,\n} from '../directive.js';\n\n/**\n * A key-value set of class names to truthy values.\n */\nexport interface ClassInfo {\n readonly [name: string]: string | boolean | number;\n}\n\nclass ClassMapDirective extends Directive {\n /**\n * Stores the ClassInfo object applied to a given AttributePart.\n * Used to unset existing values when a new ClassInfo object is applied.\n */\n private _previousClasses?: Set<string>;\n private _staticClasses?: Set<string>;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (\n partInfo.type !== PartType.ATTRIBUTE ||\n partInfo.name !== 'class' ||\n (partInfo.strings?.length as number) > 2\n ) {\n throw new Error(\n '`classMap()` can only be used in the `class` attribute ' +\n 'and must be the only part in the attribute.'\n );\n }\n }\n\n render(classInfo: ClassInfo) {\n // Add spaces to ensure separation from static classes\n return (\n ' ' +\n Object.keys(classInfo)\n .filter((key) => classInfo[key])\n .join(' ') +\n ' '\n );\n }\n\n override update(part: AttributePart, [classInfo]: DirectiveParameters<this>) {\n // Remember dynamic classes on the first render\n if (this._previousClasses === undefined) {\n this._previousClasses = new Set();\n if (part.strings !== undefined) {\n this._staticClasses = new Set(\n part.strings\n .join(' ')\n .split(/\\s/)\n .filter((s) => s !== '')\n );\n }\n for (const name in classInfo) {\n if (classInfo[name] && !this._staticClasses?.has(name)) {\n this._previousClasses.add(name);\n }\n }\n return this.render(classInfo);\n }\n\n const classList = part.element.classList;\n\n // Remove old classes that no longer apply\n for (const name of this._previousClasses) {\n if (!(name in classInfo)) {\n classList.remove(name);\n this._previousClasses!.delete(name);\n }\n }\n\n // Add or remove classes based on their classMap value\n for (const name in classInfo) {\n // We explicitly want a loose truthy check of `value` because it seems\n // more convenient that '' and 0 are skipped.\n const value = !!classInfo[name];\n if (\n value !== this._previousClasses.has(name) &&\n !this._staticClasses?.has(name)\n ) {\n if (value) {\n classList.add(name);\n this._previousClasses.add(name);\n } else {\n classList.remove(name);\n this._previousClasses.delete(name);\n }\n }\n }\n return noChange;\n }\n}\n\n/**\n * A directive that applies dynamic CSS classes.\n *\n * This must be used in the `class` attribute and must be the only part used in\n * the attribute. It takes each property in the `classInfo` argument and adds\n * the property name to the element's `classList` if the property value is\n * truthy; if the property value is falsy, the property name is removed from\n * the element's `class`.\n *\n * For example `{foo: bar}` applies the class `foo` if the value of `bar` is\n * truthy.\n *\n * @param classInfo\n */\nexport const classMap = directive(ClassMapDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {ClassMapDirective};\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {nothing, TemplateResult, noChange} from '../lit-html.js';\nimport {directive, Directive, PartInfo, PartType} from '../directive.js';\n\nconst HTML_RESULT = 1;\n\nexport class UnsafeHTMLDirective extends Directive {\n static directiveName = 'unsafeHTML';\n static resultType = HTML_RESULT;\n\n private _value: unknown = nothing;\n private _templateResult?: TemplateResult;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (partInfo.type !== PartType.CHILD) {\n throw new Error(\n `${\n (this.constructor as typeof UnsafeHTMLDirective).directiveName\n }() can only be used in child bindings`\n );\n }\n }\n\n render(value: string | typeof nothing | typeof noChange | undefined | null) {\n if (value === nothing || value == null) {\n this._templateResult = undefined;\n return (this._value = value);\n }\n if (value === noChange) {\n return value;\n }\n if (typeof value != 'string') {\n throw new Error(\n `${\n (this.constructor as typeof UnsafeHTMLDirective).directiveName\n }() called with a non-string value`\n );\n }\n if (value === this._value) {\n return this._templateResult;\n }\n this._value = value;\n const strings = [value] as unknown as TemplateStringsArray;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (strings as any).raw = strings;\n // WARNING: impersonating a TemplateResult like this is extremely\n // dangerous. Third-party directives should not do this.\n return (this._templateResult = {\n // Cast to a known set of integers that satisfy ResultType so that we\n // don't have to export ResultType and possibly encourage this pattern.\n // This property needs to remain unminified.\n ['_$litType$']: (this.constructor as typeof UnsafeHTMLDirective)\n .resultType as 1 | 2,\n strings,\n values: [],\n });\n }\n}\n\n/**\n * Renders the result as HTML, rather than text.\n *\n * The values `undefined`, `null`, and `nothing`, will all result in no content\n * (empty string) being rendered.\n *\n * Note, this is unsafe to use with any user-provided input that hasn't been\n * sanitized or escaped, as it may lead to cross-site-scripting\n * vulnerabilities.\n */\nexport const unsafeHTML = directive(UnsafeHTMLDirective);\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {directive} from '../directive.js';\nimport {UnsafeHTMLDirective} from './unsafe-html.js';\n\nconst SVG_RESULT = 2;\n\nclass UnsafeSVGDirective extends UnsafeHTMLDirective {\n static override directiveName = 'unsafeSVG';\n static override resultType = SVG_RESULT;\n}\n\n/**\n * Renders the result as SVG, rather than text.\n *\n * The values `undefined`, `null`, and `nothing`, will all result in no content\n * (empty string) being rendered.\n *\n * Note, this is unsafe to use with any user-provided input that hasn't been\n * sanitized or escaped, as it may lead to cross-site-scripting\n * vulnerabilities.\n */\nexport const unsafeSVG = directive(UnsafeSVGDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {UnsafeSVGDirective};\n", "// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n", "/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n", "import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The IANA name of this zone.\n * Defaults to `name` if not overwritten by a subclass.\n * @abstract\n * @type {string}\n */\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n", "import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n", "import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nconst dtfCache = new Map();\nfunction makeDTF(zoneName) {\n let dtf = dtfCache.get(zoneName);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zoneName,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n dtfCache.set(zoneName, dtf);\n }\n return dtf;\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nconst ianaZoneCache = new Map();\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n let zone = ianaZoneCache.get(name);\n if (zone === undefined) {\n ianaZoneCache.set(name, (zone = new IANAZone(name)));\n }\n return zone;\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache.clear();\n dtfCache.clear();\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /**\n * The type of zone. `iana` for all instances of `IANAZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"iana\";\n }\n\n /**\n * The name of this zone (i.e. the IANA zone name).\n * @override\n * @type {string}\n */\n get name() {\n return this.zoneName;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns false for all IANA zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return false;\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @override\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n if (!this.valid) return NaN;\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /**\n * Return whether this Zone is valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return this.valid;\n }\n}\n", "import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nconst intlDTCache = new Map();\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache.get(key);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache.set(key, dtf);\n }\n return dtf;\n}\n\nconst intlNumCache = new Map();\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache.get(key);\n if (inf === undefined) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache.set(key, inf);\n }\n return inf;\n}\n\nconst intlRelCache = new Map();\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache.get(key);\n if (inf === undefined) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache.set(key, inf);\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nconst intlResolvedOptionsCache = new Map();\nfunction getCachedIntResolvedOptions(locString) {\n let opts = intlResolvedOptionsCache.get(locString);\n if (opts === undefined) {\n opts = new Intl.DateTimeFormat(locString).resolvedOptions();\n intlResolvedOptionsCache.set(locString, opts);\n }\n return opts;\n}\n\nconst weekInfoCache = new Map();\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache.get(locString);\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86\n if (!(\"minimalDays\" in data)) {\n data = { ...fallbackWeekSettings, ...data };\n }\n weekInfoCache.set(locString, data);\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n getCachedIntResolvedOptions(loc.locale).numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache.clear();\n intlNumCache.clear();\n intlRelCache.clear();\n intlResolvedOptionsCache.clear();\n weekInfoCache.clear();\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n getCachedIntResolvedOptions(this.intl).locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n\n toString() {\n return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;\n }\n}\n", "import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /**\n * The type of zone. `fixed` for all instances of `FixedOffsetZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"fixed\";\n }\n\n /**\n * The name of this zone.\n * All fixed zones' names always start with \"UTC\" (plus optional offset)\n * @override\n * @type {string}\n */\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n /**\n * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn`\n *\n * @override\n * @type {string}\n */\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /**\n * Returns the offset's common name at the specified timestamp.\n *\n * For fixed offset zones this equals to the zone name.\n * @override\n */\n offsetName() {\n return this.name;\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns true for all fixed offset zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return true;\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n *\n * For fixed offset zones, this is constant and does not depend on a timestamp.\n * @override\n * @return {number}\n */\n offset() {\n return this.fixed;\n }\n\n /**\n * Return whether this Zone is equal to another zone (i.e. also fixed and same offset)\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /**\n * Return whether this Zone is valid:\n * All fixed offset zones are valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return true;\n }\n}\n", "import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n", "/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n", "const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\n// cache of {numberingSystem: {append: regex}}\nconst digitRegexCache = new Map();\nexport function resetDigitRegexCache() {\n digitRegexCache.clear();\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n const ns = numberingSystem || \"latn\";\n\n let appendCache = digitRegexCache.get(ns);\n if (appendCache === undefined) {\n appendCache = new Map();\n digitRegexCache.set(ns, appendCache);\n }\n let regex = appendCache.get(append);\n if (regex === undefined) {\n regex = new RegExp(`${numberingSystems[ns]}${append}`);\n appendCache.set(append, regex);\n }\n\n return regex;\n}\n", "import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport DateTime from \"./datetime.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\nimport { resetDigitRegexCache } from \"./impl/digits.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century\n * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n DateTime.resetCache();\n resetDigitRegexCache();\n }\n}\n", "export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n", "import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n", "/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\n/**\n * Returns the offset's value as a string\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n", "import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n", "import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n", "import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n", "import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n", "import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `<start>/<end>`, `<start>/<duration>`, and `<duration>/<end>` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns the last DateTime included in the interval (since end is not part of the interval)\n * @type {DateTime}\n */\n get lastDateTime() {\n return this.isValid ? (this.e ? this.e.minus(1) : null) : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into an equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * The resulting array will contain the Intervals in ascending order, that is, starting with the earliest Interval\n * and ending with the latest.\n *\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} \u2013 ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 \u2013 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 \u2013 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7\u20138 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 \u2013 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 \u2013 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' \u2013 '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" \u2013 \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n", "import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '\u0661'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabi\u02BB I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> '\u0627\u0644\u0627\u062B\u0646\u064A\u0646'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ '\u1014\u1036\u1014\u1000\u103A', '\u100A\u1014\u1031' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant J\u00E9sus-Christ', 'apr\u00E8s J\u00E9sus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n", "import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n", "import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport class TokenParser {\n constructor(locale, format) {\n this.locale = locale;\n this.format = format;\n this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale);\n this.units = this.tokens.map((t) => unitForToken(t, locale));\n this.disqualifyingUnit = this.units.find((t) => t.invalidReason);\n\n if (!this.disqualifyingUnit) {\n const [regexString, handlers] = buildRegex(this.units);\n this.regex = RegExp(regexString, \"i\");\n this.handlers = handlers;\n }\n }\n\n explainFromTokens(input) {\n if (!this.isValid) {\n return { input, tokens: this.tokens, invalidReason: this.invalidReason };\n } else {\n const [rawMatches, matches] = match(input, this.regex, this.handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return {\n input,\n tokens: this.tokens,\n regex: this.regex,\n rawMatches,\n matches,\n result,\n zone,\n specificOffset,\n };\n }\n }\n\n get isValid() {\n return !this.disqualifyingUnit;\n }\n\n get invalidReason() {\n return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;\n }\n}\n\nexport function explainFromTokens(locale, input, format) {\n const parser = new TokenParser(locale, format);\n return parser.explainFromTokens(input);\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n", "import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n TokenParser,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// cache offsets for zones based on the current timestamp when this function is\n// first called. When we are handling a datetime from components like (year,\n// month, day, hour) in a time zone, we need a guess about what the timezone\n// offset is so that we can convert into a UTC timestamp. One way is to find the\n// offset of now in the zone. The actual date may have a different offset (for\n// example, if we handle a date in June while we're in December in a zone that\n// observes DST), but we can check and adjust that.\n//\n// When handling many dates, calculating the offset for now every time is\n// expensive. It's just a guess, so we can cache the offset to use even if we\n// are right on a time change boundary (we'll just correct in the other\n// direction). Using a timestamp from first read is a slight optimization for\n// handling dates close to the current date, since those dates will usually be\n// in the same offset (we could set the timestamp statically, instead). We use a\n// single timestamp for all zones to make things a bit more predictable.\n//\n// This is safe for quickDT (used by local() and utc()) because we don't fill in\n// higher-order units from tsNow (as we do in fromObject, this requires that\n// offset is calculated from tsNow).\n/**\n * @param {Zone} zone\n * @return {number}\n */\nfunction guessOffsetForZone(zone) {\n if (zoneOffsetTs === undefined) {\n zoneOffsetTs = Settings.now();\n }\n\n // Do not cache anything but IANA zones, because it is not safe to do so.\n // Guessing an offset which is not present in the zone can cause wrong results from fixOffset\n if (zone.type !== \"iana\") {\n return zone.offset(zoneOffsetTs);\n }\n const zoneName = zone.name;\n let offsetGuess = zoneOffsetGuessCache.get(zoneName);\n if (offsetGuess === undefined) {\n offsetGuess = zone.offset(zoneOffsetTs);\n zoneOffsetGuessCache.set(zoneName, offsetGuess);\n }\n return offsetGuess;\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n }\n\n const loc = Locale.fromObject(opts);\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = guessOffsetForZone(zone);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = Settings.now();\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * Timestamp to use for cached zone offset guesses (exposed for test)\n */\nlet zoneOffsetTs;\n/**\n * Cache for zone offset guesses (exposed for test).\n *\n * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of\n * zone.offset().\n */\nconst zoneOffsetGuessCache = new Map();\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n // If an offset has been passed and we have not been called from\n // clone(), we can trust it and avoid the offset calculation.\n const ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n if (!inst.isValid) {\n return DateTime.invalid(inst.invalid);\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n static resetCache() {\n zoneOffsetTs = undefined;\n zoneOffsetGuessCache.clear();\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 ao\u00FBt 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string|null}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string|null}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string|null}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds (including milliseconds in the fractional part) of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval|DateTime}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 d\u00EDa\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"ma\u00F1ana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n /**\n * Build a parser for `fmt` using the given locale. This parser can be passed\n * to {@link DateTime.fromFormatParser} to a parse a date in this format. This\n * can be used to optimize cases where many dates need to be parsed in a\n * specific format.\n *\n * @param {String} fmt - the format the string is expected to be in (see\n * description)\n * @param {Object} options - options used to set locale and numberingSystem\n * for parser\n * @returns {TokenParser} - opaque object to be used\n */\n static buildFormatParser(fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return new TokenParser(localeToUse, fmt);\n }\n\n /**\n * Create a DateTime from an input string and format parser.\n *\n * The format parser must have been created with the same locale as this call.\n *\n * @param {String} text - the string to parse\n * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser}\n * @param {Object} opts - options taken by fromFormat()\n * @returns {DateTime}\n */\n static fromFormatParser(text, formatParser, opts = {}) {\n if (isUndefined(text) || isUndefined(formatParser)) {\n throw new InvalidArgumentError(\n \"fromFormatParser requires an input string and a format parser\"\n );\n }\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n\n if (!localeToUse.equals(formatParser.locale)) {\n throw new InvalidArgumentError(\n `fromFormatParser called with a locale of ${localeToUse}, ` +\n `but the format parser was created for ${formatParser.locale}`\n );\n }\n\n const { result, zone, specificOffset, invalidReason } = formatParser.explainFromTokens(text);\n\n if (invalidReason) {\n return DateTime.invalid(invalidReason);\n } else {\n return parseDataToDateTime(\n result,\n zone,\n opts,\n `format ${formatParser.format}`,\n text,\n specificOffset\n );\n }\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The Context type defines a type brand to associate a key value with the context value type\n */\nexport type Context<KeyType, ValueType> = KeyType & {__context__: ValueType};\n\n/**\n * @deprecated use Context instead\n */\nexport type ContextKey<KeyType, ValueType> = Context<KeyType, ValueType>;\n\n/**\n * A helper type which can extract a Context value type from a Context type\n */\nexport type ContextType<Key extends Context<unknown, unknown>> =\n Key extends Context<unknown, infer ValueType> ? ValueType : never;\n\n/**\n * Creates a typed Context.\n *\n * Contexts are compared with strict equality.\n *\n * If you want two separate `createContext()` calls to referer to the same\n * context, then use a key that will by equal under strict equality like a\n * string for `Symbol.for()`:\n *\n * ```ts\n * // true\n * createContext('my-context') === createContext('my-context')\n * // true\n * createContext(Symbol.for('my-context')) === createContext(Symbol.for('my-context'))\n * ```\n *\n * If you want a context to be unique so that it's guaranteed to not collide\n * with other contexts, use a key that's unique under strict equality, like\n * a `Symbol()` or object.:\n *\n * ```\n * // false\n * createContext({}) === createContext({})\n * // false\n * createContext(Symbol('my-context')) === createContext(Symbol('my-context'))\n * ```\n *\n * @param key a context key value\n * @template ValueType the type of value that can be provided by this context.\n * @returns the context key value cast to `Context<K, ValueType>`\n */\nexport function createContext<ValueType, K = unknown>(key: K) {\n return key as Context<K, ValueType>;\n}\n", "import { createContext } from '@lit/context';\n\nexport interface SingleDateSelection {\n selectedDate: Date | null;\n minDate?: Date;\n maxDate?: Date;\n timezone?: string;\n}\n\nexport interface DateRange {\n startDate?: string;\n endDate?: string;\n}\n\nexport interface DateRangeSelection {\n range: DateRange;\n minDate?: Date;\n maxDate?: Date;\n timezone?: string;\n}\n\nexport type DateSelection = SingleDateSelection | DateRangeSelection;\n\nexport class DateSelectionEvent extends CustomEvent<string> {\n constructor(dateSelection: string) {\n super('date-selection', {\n bubbles: true,\n composed: true,\n detail: dateSelection,\n });\n }\n\n public static is(event: Event): event is DateSelectionEvent {\n return event.type === 'date-selection';\n }\n}\n\nexport class DateRangeSelectionEvent extends CustomEvent<DateRange> {\n constructor(dateRangeSelection: DateRange) {\n super('date-range-selection', {\n bubbles: true,\n composed: true,\n detail: dateRangeSelection,\n });\n }\n\n public static is(event: Event): event is DateRangeSelectionEvent {\n return event.type === 'date-range-selection';\n }\n}\n\nexport const DateSelectionContext = createContext<DateSelection>(Symbol('date-selection-context'));\n\nexport const isSingleDateSelection = (selection: DateSelection): selection is SingleDateSelection => {\n return 'selectedDate' in selection;\n};\n\nexport const isDateRangeSelection = (selection: DateSelection): selection is DateRangeSelection => {\n return 'range' in selection;\n};\n", "export const calendarIcon = `<svg width=\"18\" height=\"19\" viewBox=\"0 0 18 19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.75 0.75C5.75 0.335786 5.41421 0 5 0C4.58579 0 4.25 0.335786 4.25 0.75V2H3C1.34315 2 0 3.34315 0 5V16C0 17.6569 1.34315 19 3 19H15C16.6569 19 18 17.6569 18 16V5C18 3.34315 16.6569 2 15 2H13.75V0.75C13.75 0.335786 13.4142 0 13 0C12.5858 0 12.25 0.335786 12.25 0.75V2H5.75V0.75ZM3 3.5H15C15.8284 3.5 16.5 4.17157 16.5 5V7.25H1.5V5C1.5 4.17157 2.17157 3.5 3 3.5ZM1.5 8.75V16C1.5 16.8284 2.17157 17.5 3 17.5H15C15.8284 17.5 16.5 16.8284 16.5 16V8.75H1.5Z\" fill=\"currentColor\"/>\n</svg>\n`;\n", "export const chevron = `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"chevron\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M15.7073 6.29289C16.0978 6.68342 16.0978 7.31658 15.7073 7.70711L11.4144 12L15.7073 16.2929C16.0978 16.6834 16.0978 17.3166 15.7073 17.7071C15.3167 18.0976 14.6836 18.0976 14.293 17.7071L8.58594 12L14.293 6.29289C14.6836 5.90237 15.3167 5.90237 15.7073 6.29289Z\" fill=\"currentColor\"/>\n</svg>`;\n", "export const chevronDown = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"currentColor\" class=\"bi bi-chevron-down chevron-down\"\n viewBox=\"0 0 16 16\" role=\"presentation\">\n <path fill-rule=\"evenodd\"\n d=\"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z\"\n stroke=\"currentColor\"/>\n </svg>`;\n", "export const doubleChevron = `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M12 7L7 12L12 17\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/>\n<path d=\"M17.5 9.5L15 12L17.5 14.5\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/>\n</svg>`;\n", "export const keyboard = `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"keyboard\">\n<g clip-path=\"url(#clip0_286_15035)\">\n<path d=\"M20 7V17H4V7H20ZM20 5H4C2.9 5 2.01 5.9 2.01 7L2 17C2 18.1 2.9 19 4 19H20C21.1 19 22 18.1 22 17V7C22 5.9 21.1 5 20 5ZM11 8H13V10H11V8ZM11 11H13V13H11V11ZM8 8H10V10H8V8ZM8 11H10V13H8V11ZM5 11H7V13H5V11ZM5 8H7V10H5V8ZM8 14H16V16H8V14ZM14 11H16V13H14V11ZM14 8H16V10H14V8ZM17 11H19V13H17V11ZM17 8H19V10H17V8Z\" fill=\"currentColor\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_286_15035\">\n<rect width=\"24\" height=\"24\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n`;\n", "import { css } from 'lit';\n\nexport const styles = css`\n :host {\n display: block;\n }\n\n button {\n appearance: none;\n padding: 0;\n border-width: 0;\n background-color: transparent;\n border-radius: var(--space-scale-1);\n padding-block: var(--space-scale-1);\n padding-inline: var(--space-scale-2);\n\n &.compact {\n padding-block: 0;\n padding-inline: 0;\n }\n\n &:hover {\n cursor: pointer;\n box-shadow:\n 0px 2px 5px 0px rgba(60, 66, 87, 0.08),\n 0px 1px 1px 0px rgba(0, 0, 0, 0.12);\n }\n\n &:focus {\n outline: 1px solid var(--color-primary-400);\n }\n\n svg {\n display: block;\n }\n\n &.right svg {\n transform: rotate(180deg);\n }\n }\n\n h2 {\n font-weight: var(--font-weight-semibold);\n color: var(--color-text-500);\n font-size: var(--font-size-400);\n display: contents;\n }\n\n .calendar-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 24px 24px 16px 24px;\n }\n\n .calendar-grid {\n text-align: center;\n border-top: var(--color-border-200) 1px solid;\n padding: 0 24px;\n\n table {\n width: 100%;\n border-collapse: collapse;\n }\n\n tbody {\n display: grid;\n row-gap: 4px;\n }\n\n tr {\n display: grid;\n grid-template-columns: repeat(7, 48px);\n }\n\n th {\n color: var(--color-text-400);\n font-size: var(--font-size-100);\n font-weight: var(--font-weight-normal);\n line-height: 20px;\n padding: 16px 0;\n }\n\n td {\n font-size: var(--font-size-100);\n font-weight: var(--font-weight-normal);\n }\n }\n\n .calendar-footer {\n display: flex;\n flex-direction: column;\n //gap: var(--space-scale-2);\n\n svg {\n vertical-align: middle;\n }\n\n .actions {\n display: flex;\n flex: 1 0 auto;\n padding: var(--space-scale-2) var(--space-scale-3) var(--space-scale-3);\n\n button {\n background-color: var(--color-surface-200);\n border-color: var(--color-primary-400);\n border-width: 1px;\n border-style: solid;\n color: var(--color-primary-400);\n font-weight: var(--font-weight-semibold);\n width: 100%;\n height: 40px;\n }\n }\n }\n\n .day {\n aspect-ratio: 1;\n cursor: pointer;\n position: relative; // For focus outline\n box-sizing: border-box;\n height: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .day.in-range {\n background: var(--color-primary-300);\n\n &:first-child {\n border-top-left-radius: var(--space-scale-1);\n border-bottom-left-radius: var(--space-scale-1);\n }\n\n &:last-child {\n border-top-right-radius: var(--space-scale-1);\n border-bottom-right-radius: var(--space-scale-1);\n }\n }\n\n .day[aria-disabled='true'] {\n opacity: 0.7;\n background-color: var(--color-surface-300);\n cursor: not-allowed;\n pointer-events: none;\n }\n\n .day.start-date:has(+ .in-range):after {\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: var(--color-primary-300);\n z-index: -1;\n border-radius: var(--space-scale-1);\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n }\n\n .day.in-range + :is(.day:hover, .day:not(.in-range)):before {\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: var(--color-primary-300);\n z-index: -1;\n border-radius: var(--space-scale-1);\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n }\n\n .day[aria-selected='true']:not(.in-range),\n .day:hover {\n background: var(--color-primary-400);\n color: var(--color-text-100);\n border-radius: var(--space-scale-1);\n font-weight: var(--font-weight-semibold);\n\n &.in-range {\n &:before {\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: var(--color-primary-300);\n z-index: -1;\n border-radius: var(--bg-border-radius, 0);\n }\n\n &:first-child {\n --bg-border-radius: var(--space-scale-1) 0 0 var(--space-scale-1);\n }\n\n &:last-child {\n --bg-border-radius: 0 var(--space-scale-1) var(--space-scale-1) 0;\n }\n }\n }\n\n .side-panel-wrapper {\n border-right: 1px solid var(--color-border-200, var(--color-surface-300));\n display: flex;\n align-items: start;\n }\n\n .side-panel {\n padding: var(--space-scale-3);\n grid-template-columns: 1fr;\n display: grid;\n gap: var(--space-scale-3);\n\n button {\n font-size: var(--font-size-200);\n text-wrap: nowrap;\n line-height: var(--space-scale-3);\n padding-block: 0;\n padding-inline: 0;\n\n &:hover {\n color: var(--color-primary-400);\n box-shadow: none;\n }\n\n &[aria-selected='true'] {\n color: var(--color-primary-400);\n }\n }\n }\n\n details {\n border-top: 1px solid var(--color-border-200);\n font-size: var(--font-size-100);\n font-weight: var(--font-weight-normal);\n padding: var(--space-scale-2) var(--space-scale-3) var(--space-scale-3);\n\n summary {\n font-weight: var(--font-weight-semibold);\n position: relative;\n display: flex;\n align-items: center;\n gap: var(--space-scale-1);\n\n &::marker {\n content: '';\n }\n\n svg.chevron-down {\n margin-left: var(--space-scale-1);\n transform: rotate(-90deg);\n }\n }\n\n &[open] svg.chevron-down {\n transform: rotate(0deg);\n }\n }\n`;\n", "import { DateTime } from 'luxon';\n\nexport const dateConverter = (value: string | null): Date | undefined =>\n value ? DateTime.fromISO(value).toJSDate() : undefined;\n\nexport const dateTimeConverter = (value: string | null): DateTime | undefined =>\n value ? DateTime.fromISO(value) : undefined;\n", "import { html, LitElement, PropertyValues } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport { DateTime, Interval } from 'luxon';\nimport { DateRange, DateRangeSelectionEvent, DateSelectionEvent } from './DateSelectionContext.js';\nimport { chevron, chevronDown, doubleChevron, keyboard } from '@triptease/icons';\nimport { styles } from './Styles.js';\nimport { dateTimeConverter } from './helpers.js';\n\ntype WeekdayList = [\n DateTime | null,\n DateTime | null,\n DateTime | null,\n DateTime | null,\n DateTime | null,\n DateTime | null,\n DateTime | null,\n];\n\ninterface CalendarWithRange {\n value?: DateRange;\n range: true;\n}\n\ninterface InternalDateRange {\n startDate?: DateTime;\n endDate?: DateTime;\n}\n\nexport class Calendar extends LitElement {\n static styles = styles;\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n // Start public properties\n\n @property({ type: String })\n public value?: string | DateRange;\n\n @property({ type: Boolean })\n public range = false;\n\n @property({ attribute: 'max-date', converter: dateTimeConverter })\n public maxDate?: DateTime;\n\n @property({ type: Number, attribute: 'max-days' })\n public maxDays?: number;\n\n @property({ attribute: 'min-date', converter: dateTimeConverter })\n public minDate?: DateTime;\n\n @property({ type: Number, attribute: 'min-days' })\n public minDays?: number;\n\n get internalRangeValue(): InternalDateRange {\n if (this.range && this.value) {\n const startDate = (this.value as DateRange)?.startDate\n ? DateTime.fromISO((this.value as DateRange).startDate!)\n : undefined;\n const endDate = (this.value as DateRange)?.endDate\n ? DateTime.fromISO((this.value as DateRange).endDate!)\n : undefined;\n return { startDate, endDate };\n }\n return { startDate: undefined, endDate: undefined };\n }\n\n getRange(): Interval {\n if (this.range && this.internalRangeValue.startDate && this.internalRangeValue.endDate) {\n return Interval.fromDateTimes(\n this.internalRangeValue.startDate,\n this.internalRangeValue.endDate.plus({ days: 1 })\n );\n }\n return Interval.invalid('Invalid range');\n }\n\n public updated(changedProperties: PropertyValues) {\n if (changedProperties.has('value') && this.value) {\n super.updateComplete.then(() => {\n if (!this.range) {\n const parsedDate = DateTime.fromISO(this.value as string);\n this.focusedDate = parsedDate.isValid ? parsedDate : this.today;\n } else {\n this.focusedDate = this.internalRangeValue?.startDate || this.today;\n }\n });\n }\n super.updated(changedProperties);\n }\n\n public toggleVisibility() {\n if (this.visible) {\n this.visible = false;\n } else {\n this.visible = true;\n this.updateComplete.then(() => {\n this.calendarDiv.focus();\n this.calendarDiv.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n });\n });\n if (!this.range) {\n console.log('received value', this.value);\n\n const parsedDate = DateTime.fromISO((this.value as string) ?? this.today);\n this.focusedDate = parsedDate.isValid ? parsedDate : this.today;\n } else {\n this.focusedDate = (this.value as DateRange)?.startDate\n ? DateTime.fromISO((this.value as DateRange).startDate!)\n : this.today;\n }\n }\n }\n\n // end public properties\n\n @query('.calendar-panel')\n private calendarDiv!: HTMLElement;\n\n @state()\n private focusedDate: DateTime = this.today;\n\n @state()\n private visible: boolean = false;\n\n private handleKeyDown(event: KeyboardEvent) {\n const currentDate = this.focusedDate;\n switch (event.key) {\n case 'ArrowLeft':\n event.preventDefault();\n this.focusDay(currentDate.minus({ day: 1 }));\n break;\n case 'ArrowRight':\n event.preventDefault();\n this.focusDay(currentDate.plus({ day: 1 }));\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.focusDay(currentDate.minus({ week: 1 }));\n break;\n case 'ArrowDown':\n event.preventDefault();\n this.focusDay(currentDate.plus({ week: 1 }));\n break;\n case 'Home':\n event.preventDefault();\n // Move to first day of week\n this.focusDay(currentDate.startOf('week'));\n break;\n case 'End':\n event.preventDefault();\n // Move to last day of week\n this.focusDay(currentDate.endOf('week'));\n break;\n case 'PageUp':\n event.preventDefault();\n if (event.shiftKey) {\n // Previous year\n this.focusDay(currentDate.minus({ year: 1 }));\n } else {\n // Previous month\n this.focusDay(currentDate.minus({ month: 1 }));\n }\n break;\n case 'PageDown':\n event.preventDefault();\n if (event.shiftKey) {\n // Next year\n this.focusDay(currentDate.plus({ year: 1 }));\n } else {\n // Next month\n this.focusDay(currentDate.plus({ month: 1 }));\n }\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n this.handleDayClick(this.focusedDate);\n return;\n\n default:\n return;\n }\n\n event.preventDefault();\n }\n\n private focusDay(date: DateTime) {\n this.focusedDate = date;\n this.updateComplete.then(() => {\n const dayElement = <HTMLElement | undefined>this.shadowRoot?.querySelector(`.day[data-date=\"${date.toISO()}\"]`);\n if (dayElement) {\n dayElement.focus();\n }\n });\n }\n\n private newWeek = () => new Array(7).fill(null) as WeekdayList;\n\n private getDaysInMonth(date: DateTime): WeekdayList[] {\n const startOfMonth = date.startOf('month');\n const endOfMonth = date.endOf('month');\n\n const weeks: WeekdayList[] = [];\n let currentWeek: WeekdayList = this.newWeek();\n\n let currentDay = startOfMonth;\n\n while (currentDay <= endOfMonth) {\n // Get the day of week (0-6, Sunday=0, Saturday=6)\n const dayOfWeek = currentDay.weekday === 7 ? 0 : currentDay.weekday;\n\n currentWeek[dayOfWeek] = currentDay;\n\n const isWeekComplete = dayOfWeek === 6; // Saturday (last day of week)\n const isLastDayOfMonth = currentDay.hasSame(endOfMonth, 'day');\n\n if (isWeekComplete || isLastDayOfMonth) {\n weeks.push(currentWeek);\n\n if (!isLastDayOfMonth) {\n currentWeek = this.newWeek();\n }\n }\n\n currentDay = currentDay.plus({ days: 1 });\n }\n\n return weeks;\n }\n\n private previousYear() {\n this.focusedDate = this.focusedDate.minus({ year: 1 });\n }\n\n private previousMonth() {\n this.focusedDate = this.focusedDate.minus({ month: 1 });\n }\n\n private nextMonth() {\n this.focusedDate = this.focusedDate.plus({ month: 1 });\n }\n\n private nextYear() {\n this.focusedDate = this.focusedDate.plus({ year: 1 });\n }\n\n private get today(): DateTime {\n return DateTime.local();\n }\n\n private handleDayClick(day: DateTime) {\n if (this.isRange()) {\n if (!this.value?.startDate || this.value?.endDate) {\n this.value = { startDate: day.toISODate()! };\n this.focusedDate = day;\n return;\n }\n\n if (!this.value.endDate) {\n this.value = { ...(this.value as DateRange), endDate: day.toISODate()! };\n this.focusedDate = day;\n this.dispatchEvent(new DateRangeSelectionEvent(this.value));\n return;\n }\n }\n\n if (day.isValid) {\n this.dispatchEvent(new DateSelectionEvent(day.toISODate()!));\n }\n }\n\n private handleButtonKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.stopPropagation();\n }\n };\n\n private getWeekdayLabels(): string[] {\n const monday = DateTime.fromISO('2024-06-02T00:00:00Z').startOf('week'); //Weeks start on Monday in Luxon https://moment.github.io/luxon/api-docs/index.html#datetimestartof\n const sunday = monday.plus({ days: 6 });\n return Array.from({ length: 7 }, (_, i) => {\n const date = sunday.plus({ days: i });\n return date.toLocaleString({ weekday: 'short' });\n });\n }\n\n private isSelected(date: DateTime): boolean {\n if (date.equals(this.focusedDate)) return true;\n\n if (this.isRange() && this.internalRangeValue.startDate) {\n if (!this.internalRangeValue.endDate) {\n const range = Interval.fromDateTimes(this.internalRangeValue.startDate, this.focusedDate.plus({ days: 1 }));\n return range.contains(date);\n }\n\n const range = this.getRange();\n return range.contains(date);\n }\n\n return false;\n }\n\n private isInRange(date: DateTime): boolean {\n if (!this.isRange() || !this.internalRangeValue?.startDate) {\n return false;\n }\n\n if (!this.internalRangeValue?.endDate) {\n const range = Interval.fromDateTimes(this.internalRangeValue.startDate, this.focusedDate);\n return range.contains(date) && !this.isStartDate(date) && !date.equals(this.focusedDate);\n }\n\n const range = this.getRange();\n return range.contains(date) && !this.isStartDate(date) && !this.isEndDate(date);\n }\n\n private isRange(): this is CalendarWithRange {\n return this.range;\n }\n\n private get isSelectingRange(): boolean {\n return Boolean(this.isRange() && this.value?.startDate && !this.value?.endDate);\n }\n\n private onDayHover = (event: MouseEvent) => {\n const day = (event.target as HTMLElement).dataset.date;\n if (!day) return;\n\n this.focusedDate = DateTime.fromISO(day);\n };\n\n private isStartDate = (date: DateTime): boolean =>\n Boolean(this.isRange() && this.internalRangeValue?.startDate && this.internalRangeValue.startDate.equals(date));\n\n private isEndDate = (date: DateTime): boolean =>\n Boolean(this.isRange() && this.internalRangeValue?.endDate && this.internalRangeValue.endDate.equals(date));\n\n private handleClearSelection = () => {\n this.value = { startDate: undefined, endDate: undefined };\n this.dispatchEvent(new DateRangeSelectionEvent({ startDate: undefined, endDate: undefined }));\n };\n\n private handleToggle(e: Event) {\n const details = e.target as HTMLDetailsElement;\n if (details.open) {\n details.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n });\n }\n }\n\n render() {\n const weeks = this.getDaysInMonth(this.focusedDate);\n const monthYear = this.focusedDate.toLocaleString({\n month: 'long',\n year: 'numeric',\n });\n\n return html`\n <div class=\"calendar-panel\" @keydown=${this.handleKeyDown} role=\"application\" aria-label=\"${monthYear}\">\n <div class=\"calendar-header\">\n <button\n @click=${this.previousYear}\n @keydown=${this.handleButtonKeyDown}\n aria-label=\"Previous year\"\n class=\"compact\"\n >\n ${unsafeSVG(doubleChevron)}\n </button>\n <button\n @click=${this.previousMonth}\n @keydown=\"${this.handleButtonKeyDown}\"\n aria-label=\"Previous month\"\n class=\"compact\"\n >\n ${unsafeSVG(chevron)}\n </button>\n <h2>${monthYear}</h2>\n <button\n @click=${this.nextMonth}\n @keydown=\"${this.handleButtonKeyDown}\"\n aria-label=\"Next month\"\n class=\"compact right\"\n >\n ${unsafeSVG(chevron)}\n </button>\n <button\n @click=${this.nextYear}\n @keydown=${this.handleButtonKeyDown}\n aria-label=\"Next year\"\n class=\"compact right\"\n >\n ${unsafeSVG(doubleChevron)}\n </button>\n </div>\n <div class=\"calendar-grid\">\n <table\n role=\"grid\"\n aria-labelledby=\"month-year\"\n data-range=\"${this.range}\"\n class=\"${this.isSelectingRange ? 'selecting' : ''}\"\n >\n <thead>\n <tr>\n ${this.getWeekdayLabels().map((label) => html` <th>${label}</th>`)}\n </tr>\n </thead>\n\n <tbody>\n ${weeks.map(\n (week) =>\n html` <tr>\n ${week.map((day) => {\n if (!day) {\n return html` <td></td>`;\n }\n\n const isDisabled = this.dayIsDisabled(day);\n\n return html` <td\n class=\"${classMap({\n day: true,\n 'in-range': this.isInRange(day),\n 'start-date': this.isStartDate(day),\n 'end-date': this.isEndDate(day),\n })}\"\n @click=${() => this.handleDayClick(day)}\n role=\"gridcell\"\n data-date=\"${day.toISODate()}\"\n aria-label=\"${day.toLocaleString({ dateStyle: 'long' })}\"\n aria-selected=\"${this.isSelected(day)}\"\n aria-disabled=\"${isDisabled}\"\n tabindex=\"-1\"\n @mouseenter=\"${this.onDayHover}\"\n >\n ${day.day}\n </td>`;\n })}\n </tr>`\n )}\n </tbody>\n </table>\n </div>\n\n <div class=\"calendar-footer\">\n <div class=\"actions\" @keydown=\"${this.handleButtonKeyDown}\">\n ${this.isRange()\n ? html`\n <button @click=${() => this.handleClearSelection()} data-theme=\"secondary\" id=\"clear-selection\">\n Clear selection\n </button>\n `\n : html` <button @click=${() => this.handleDayClick(this.today)} data-theme=\"secondary\">Today</button> `}\n </div>\n <div>\n <details @keydown=${this.handleButtonKeyDown} @toggle=${this.handleToggle}>\n <summary>${unsafeSVG(keyboard)} Keyboard commands ${unsafeSVG(chevronDown)}</summary>\n <p>Arrow keys: navigate the calendar</p>\n <p>Enter or Space: select the date</p>\n <p>Escape: close the calendar without selecting a date</p>\n <p>Tab: navigate between the calendar and the presets</p>\n <p>Home: move to first day of week</p>\n <p>End: move to last day of week</p>\n <p>Page Up: move to previous month</p>\n <p>Page Down: move to next month</p>\n <p>Shift + Page Up: move to next year</p>\n <p>Shift + Page Down: move to previous year</p>\n </details>\n </div>\n </div>\n </div>\n `;\n }\n\n private dayIsDisabled(day: DateTime) {\n if (this.maxDate && day > this.maxDate) return true;\n\n if (this.minDate && day < this.minDate) return true;\n\n if (this.range && this.isSelectingRange && this.internalRangeValue?.startDate) {\n if (day < this.internalRangeValue.startDate) return true;\n\n if (this.maxDays && day > this.internalRangeValue.startDate.plus({ days: this.maxDays })) return true;\n }\n\n return false;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'tt-calendar': Calendar;\n }\n}\n", "import { Calendar } from './TtCalendar.js';\n\nif (typeof window !== 'undefined') {\n if (!window.customElements.get('tt-calendar')) {\n window.customElements.define('tt-calendar', Calendar);\n }\n}\n\nexport { Calendar };\n", "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {nothing} from '../lit-html.js';\n\n/**\n * For AttributeParts, sets the attribute if the value is defined and removes\n * the attribute if the value is undefined.\n *\n * For other part types, this directive is a no-op.\n */\nexport const ifDefined = <T>(value: T) => value ?? nothing;\n", "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {noChange, Part} from '../lit-html.js';\nimport {directive, Directive, DirectiveParameters} from '../directive.js';\n\n// A sentinel that indicates guard() hasn't rendered anything yet\nconst initialValue = {};\n\nclass GuardDirective extends Directive {\n private _previousValue: unknown = initialValue;\n\n render(_value: unknown, f: () => unknown) {\n return f();\n }\n\n override update(_part: Part, [value, f]: DirectiveParameters<this>) {\n if (Array.isArray(value)) {\n // Dirty-check arrays by item\n if (\n Array.isArray(this._previousValue) &&\n this._previousValue.length === value.length &&\n value.every((v, i) => v === (this._previousValue as Array<unknown>)[i])\n ) {\n return noChange;\n }\n } else if (this._previousValue === value) {\n // Dirty-check non-arrays by identity\n return noChange;\n }\n\n // Copy the value if it's an array so that if it's mutated we don't forget\n // what the previous values were.\n this._previousValue = Array.isArray(value) ? Array.from(value) : value;\n const r = this.render(value, f);\n return r;\n }\n}\n\n/**\n * Prevents re-render of a template function until a single value or an array of\n * values changes.\n *\n * Values are checked against previous values with strict equality (`===`), and\n * so the check won't detect nested property changes inside objects or arrays.\n * Arrays values have each item checked against the previous value at the same\n * index with strict equality. Nested arrays are also checked only by strict\n * equality.\n *\n * Example:\n *\n * ```js\n * html`\n * <div>\n * ${guard([user.id, company.id], () => html`...`)}\n * </div>\n * `\n * ```\n *\n * In this case, the template only rerenders if either `user.id` or `company.id`\n * changes.\n *\n * guard() is useful with immutable data patterns, by preventing expensive work\n * until data updates.\n *\n * Example:\n *\n * ```js\n * html`\n * <div>\n * ${guard([immutableItems], () => immutableItems.map(i => html`${i}`))}\n * </div>\n * `\n * ```\n *\n * In this case, items are mapped over only when the array reference changes.\n *\n * @param value the value to check before re-rendering\n * @param f the template function\n */\nexport const guard = directive(GuardDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {GuardDirective};\n", "import { css, html, LitElement, nothing, PropertyValues } from 'lit';\nimport { DateTime } from 'luxon';\nimport { property, query, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { guard } from 'lit/directives/guard.js';\n\nexport class DateInput extends LitElement {\n static styles = css`\n :user-invalid {\n outline: 1px solid red;\n }\n\n input[type='number'] {\n -moz-appearance: textfield;\n\n border-width: 0;\n text-align: center;\n padding: 0;\n\n &[name='day'] {\n width: 3ch;\n }\n\n &[name='month'] {\n width: 3ch;\n }\n\n &[name='year'] {\n width: var(--space-scale-4);\n }\n\n font-size: var(--date-picker-font-size, var(--font-size-200, 1rem));\n }\n\n input[type='number']::-webkit-inner-spin-button,\n input[type='number']::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n input[type='number']::placeholder {\n color: var(--color-text-300);\n opacity: 1;\n }\n `;\n\n static formAssociated = true;\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n @property({ type: String })\n public value?: string;\n\n @property({ type: String })\n public name?: string;\n\n // Flag to track when value is being set internally\n private _internalValueChange = false;\n\n @state()\n private day?: number;\n\n @state()\n private month?: number;\n\n @state()\n private year?: number;\n\n @query('input[name=\"day\"]')\n private dayInput!: HTMLInputElement;\n\n @query('input[name=\"month\"]')\n private monthInput!: HTMLInputElement;\n\n @query('input[name=\"year\"]')\n private yearInput!: HTMLInputElement;\n\n @state()\n private _dateFormat: string[] = [];\n\n public internals: ReturnType<typeof this.attachInternals>;\n\n constructor() {\n super();\n this.internals = this.attachInternals();\n }\n\n public connectedCallback() {\n super.connectedCallback();\n\n const partsToFind = ['day', 'month', 'year'];\n\n const parts = DateTime.now().toLocaleParts();\n const filteredParts = parts.filter((part) => partsToFind.includes(part.type));\n\n this._dateFormat = filteredParts.map((part) => part.type);\n }\n\n public dateSplitter = (value: string) => {\n if (!value) return { day: undefined, month: undefined, year: undefined };\n return {\n day: parseInt(value.split('-')[2], 10),\n month: parseInt(value.split('-')[1], 10),\n year: parseInt(value.split('-')[0], 10),\n };\n };\n\n protected firstUpdated(_changedProperties: PropertyValues) {\n if (this.value) {\n const { day, month, year } = this.dateSplitter(this.value);\n this.day = day;\n this.month = month;\n this.year = year;\n }\n\n super.firstUpdated(_changedProperties);\n }\n\n protected update(changedProperties: PropertyValues) {\n if (changedProperties.has('value') && !this._internalValueChange) {\n if (this.value) {\n const { day, month, year } = this.dateSplitter(this.value);\n this.day = day;\n this.month = month;\n this.year = year;\n } else {\n this.day = undefined;\n this.month = undefined;\n this.year = undefined;\n }\n }\n\n super.update(changedProperties);\n }\n\n protected updated(changedProperties: PropertyValues) {\n if (\n (changedProperties.has('day') || changedProperties.has('month') || changedProperties.has('year')) &&\n !this._internalValueChange\n ) {\n // Only dispatch change event if this is not part of an internal value change\n this._dispatchChangeEvent();\n }\n\n super.updated(changedProperties);\n }\n\n private _onInput = (e: InputEvent) => {\n const { name, value } = e.target as HTMLInputElement;\n\n const isValid = (e.target as HTMLInputElement).checkValidity();\n\n // Set flag to prevent circular updates\n this._internalValueChange = true;\n\n try {\n switch (name) {\n case 'day':\n if (!isValid) {\n this.day = undefined;\n }\n this.day = parseInt(value, 10);\n if (this.day >= 4 && this.day <= 31) {\n this.monthInput.focus();\n }\n break;\n case 'month':\n if (!isValid) {\n this.month = undefined;\n }\n this.month = parseInt(value, 10);\n if (this.month >= 2 && this.month <= 12) {\n this.yearInput.focus();\n }\n break;\n case 'year':\n if (!isValid) {\n this.year = undefined;\n }\n this.year = parseInt(value, 10);\n break;\n default:\n break;\n }\n } finally {\n // Reset flag after updates\n this._internalValueChange = false;\n }\n };\n\n private _onKeyDown = (e: KeyboardEvent) => {\n const target = <HTMLInputElement>e.target;\n const { name } = target;\n\n // Set flag to prevent circular updates\n this._internalValueChange = true;\n\n try {\n switch (e.key) {\n case 'Backspace':\n if (target.value === '') {\n switch (name) {\n case 'day':\n this.day = undefined;\n break;\n case 'month':\n this.month = undefined;\n this.dayInput.focus();\n break;\n case 'year':\n this.year = undefined;\n this.monthInput.focus();\n break;\n default:\n break;\n }\n }\n break;\n case 'ArrowUp':\n e.preventDefault();\n switch (name) {\n case 'day':\n this.day = Math.min((this.day ?? 0) + 1, 31);\n break;\n case 'month':\n this.month = Math.min((this.month ?? 0) + 1, 12);\n break;\n case 'year':\n this.year = Math.min((this.year ?? 0) + 1, 3000);\n break;\n default:\n break;\n }\n break;\n case 'ArrowDown':\n e.preventDefault();\n switch (name) {\n case 'day':\n this.day = Math.max((this.day ?? 0) - 1, 1);\n break;\n case 'month':\n this.month = Math.max((this.month ?? 0) - 1, 1);\n break;\n case 'year':\n this.year = Math.max((this.year ?? 0) - 1, 1900);\n break;\n default:\n break;\n }\n break;\n case 'Enter':\n e.preventDefault();\n switch (name) {\n case 'day':\n this.monthInput.focus();\n break;\n case 'month':\n this.yearInput.focus();\n break;\n case 'year':\n // For Enter key on year, we'll handle the change event separately\n // so we don't need to set _internalValueChange to false here\n this._dispatchChangeEvent();\n return; // Early return to avoid resetting the flag\n default:\n break;\n }\n break;\n case '/':\n e.preventDefault();\n switch (name) {\n case 'day':\n this.monthInput.focus();\n break;\n case 'month':\n this.yearInput.focus();\n break;\n default:\n break;\n }\n break;\n default:\n break;\n }\n } finally {\n // Reset flag after updates\n this._internalValueChange = false;\n }\n };\n\n private get date(): DateTime | undefined {\n if (this.day && this.month && this.year) {\n return DateTime.utc(this.year, this.month, this.day);\n }\n return undefined;\n }\n\n private _validate(): boolean {\n const dayValid = this.day && this.dayInput.checkValidity() && !Number.isNaN(this.day);\n const monthValid = this.month && this.monthInput.checkValidity() && !Number.isNaN(this.month);\n const yearValid = this.year && this.yearInput.checkValidity() && !Number.isNaN(this.year);\n\n if (!dayValid || !monthValid || !yearValid) {\n return false;\n }\n\n const { date } = this;\n\n if (!date?.isValid) {\n this.internals.setValidity({ customError: true }, 'Please enter a valid date');\n return false;\n }\n\n this.internals.setValidity({});\n return true;\n }\n\n private _dispatchChangeEvent() {\n if (this._validate() && this.date) {\n const isoDate = this.date.toISODate();\n // We're already in an update cycle, so we need to schedule this change for after the current update\n // This prevents the \"scheduled an update after an update completed\" warning\n Promise.resolve().then(() => {\n // Set flag before changing value\n this._internalValueChange = true;\n this.value = isoDate ?? undefined;\n // Reset flag after value is set\n this._internalValueChange = false;\n this.dispatchEvent(new Event('change', { bubbles: true }));\n });\n }\n }\n\n private get _error(): string | undefined {\n if (!this.internals.validity.valid) {\n return this.internals.validationMessage;\n }\n return undefined;\n }\n\n private _pad = (value: number | undefined, maxLength: number): string | undefined => {\n if (value === undefined) return undefined;\n\n return String(value).padStart(maxLength, '0');\n };\n\n private _dayInput = () =>\n html`<input\n type=\"number\"\n inputmode=\"numeric\"\n placeholder=\"dd\"\n .value=${ifDefined(this._pad(this.day, 2))}\n name=\"day\"\n min=\"1\"\n max=\"31\"\n @keydown=\"${this._onKeyDown}\"\n @input=\"${this._onInput}\"\n enterkeyhint=\"next\"\n />`;\n\n private _monthInput = () => html`\n <input\n type=\"number\"\n inputmode=\"numeric\"\n min=\"1\"\n max=\"12\"\n placeholder=\"mm\"\n name=\"month\"\n .value=${ifDefined(this._pad(this.month, 2))}\n @keydown=\"${this._onKeyDown}\"\n @input=\"${this._onInput}\"\n enterkeyhint=\"next\"\n />\n `;\n\n private _yearInput = () => html`\n <input\n type=\"number\"\n inputmode=\"numeric\"\n placeholder=\"yyyy\"\n .value=${ifDefined(this._pad(this.year, 4))}\n name=\"year\"\n min=\"1900\"\n max=\"3000\"\n @keydown=\"${this._onKeyDown}\"\n @input=\"${this._onInput}\"\n />\n `;\n\n private _renderInputs = () => {\n const inputs = this._dateFormat\n .map((part) => {\n switch (part) {\n case 'day':\n return this._dayInput();\n case 'month':\n return this._monthInput();\n case 'year':\n return this._yearInput();\n default:\n return nothing;\n }\n })\n .flatMap((input) => [input, html`<span role=\"presentation\">/</span>`])\n .slice(0, -1); // Remove the last separator\n return html` ${inputs} `;\n };\n\n public render() {\n return html`\n ${guard([this._dateFormat, this.day, this.month, this.year], this._renderInputs)}\n <div class=\"errormessage\" id=\"error-msg-${this.id}\" role=\"alert\" aria-atomic=\"true\" part=\"error\">\n ${this._error ? html`${this._error}` : nothing}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'tt-date-input': DateInput;\n }\n}\n", "import { DateInput } from './DateInput.js';\n\nif (typeof window !== 'undefined') {\n if (!window.customElements.get('tt-date-input')) {\n window.customElements.define('tt-date-input', DateInput);\n }\n}\n\nexport { DateInput };\n", "import { css } from 'lit';\n\nexport const styles = css`\n :host {\n display: block;\n position: relative;\n }\n\n [role='dialog'] {\n display: flex;\n position: absolute;\n border-radius: var(--space-scale-2);\n background-color: var(--color-surface-100);\n width: fit-content;\n z-index: 2;\n box-shadow:\n 0px 8px 12px 0px rgba(0, 0, 0, 0.04),\n 0px 32px 48px 0px rgba(0, 0, 0, 0.04);\n left: var(--dialog-left-distance, var(--calendar-left-distance, auto)); // Fallback for the previous property name\n\n .start,\n .end {\n width: 1px;\n height: 1px;\n }\n }\n\n [role='dialog'][inert] {\n display: none;\n }\n`;\n", "// Inlined from @a11y/focus-trap@1.0.5\n// https://raw.githubusercontent.com/andreasbm/focus-trap/refs/tags/v1.0.5/src/lib/focusable.ts\n\n/**\n * Returns whether the element is hidden.\n * @param $elem\n */\nfunction isHidden($elem: HTMLElement): boolean {\n return (\n $elem.hasAttribute('hidden') ||\n ($elem.hasAttribute('aria-hidden') && $elem.getAttribute('aria-hidden') !== 'false') ||\n // A quick and dirty way to check whether the element is hidden.\n // For a more fine-grained check we could use \"window.getComputedStyle\" but we don't because of bad performance.\n // If the element has visibility set to \"hidden\" or \"collapse\", display set to \"none\" or opacity set to \"0\" through CSS\n // we won't be able to catch it here. We accept it due to the huge performance benefits.\n $elem.style.display === `none` ||\n $elem.style.opacity === `0` ||\n $elem.style.visibility === `hidden` ||\n $elem.style.visibility === `collapse`\n );\n\n // If offsetParent is null we can assume that the element is hidden\n // https://stackoverflow.com/questions/306305/what-would-make-offsetparent-null\n //|| $elem.offsetParent == null;\n}\n\n/**\n * Returns whether the element is disabled.\n * @param $elem\n */\nexport function isDisabled($elem: HTMLElement): boolean {\n return (\n $elem.hasAttribute('disabled') ||\n ($elem.hasAttribute('aria-disabled') && $elem.getAttribute('aria-disabled') !== 'false')\n );\n}\n\n/**\n * Determines whether an element is focusable.\n * Read more here: https://stackoverflow.com/questions/1599660/which-html-elements-can-receive-focus/1600194#1600194\n * Or here: https://stackoverflow.com/questions/18261595/how-to-check-if-a-dom-element-is-focusable\n * @param $elem\n */\nfunction isFocusable($elem: HTMLElement): boolean {\n // Discard elements that are removed from the tab order.\n if ($elem.getAttribute('tabindex') === '-1' || isHidden($elem) || isDisabled($elem)) {\n return false;\n }\n\n return (\n // At this point we know that the element can have focus (eg. won't be -1) if the tabindex attribute exists\n $elem.hasAttribute('tabindex') ||\n // Anchor tags or area tags with a href set\n (($elem instanceof HTMLAnchorElement || $elem instanceof HTMLAreaElement) && $elem.hasAttribute('href')) ||\n // Form elements which are not disabled\n $elem instanceof HTMLButtonElement ||\n $elem instanceof HTMLInputElement ||\n $elem instanceof HTMLTextAreaElement ||\n $elem instanceof HTMLSelectElement ||\n // IFrames\n $elem instanceof HTMLIFrameElement\n );\n}\n\n// Copied from @a11y/focus-trap@1.0.5\n// https://raw.githubusercontent.com/andreasbm/focus-trap/refs/tags/v1.0.5/src/lib/shadow.ts\n\n/**\n * Traverses the slots of the open shadowroots and returns all children matching the query.\n * @param {ShadowRoot | HTMLElement} root\n * @param skipNode\n * @param isMatch\n * @param {number} maxDepth\n * @param {number} depth\n * @returns {HTMLElement[]}\n */\nfunction queryShadowRoot(\n root: ShadowRoot | HTMLElement,\n skipNode: ($elem: HTMLElement) => boolean,\n isMatch: ($elem: HTMLElement) => boolean,\n maxDepth: number = 20,\n depth: number = 0\n): HTMLElement[] {\n const matches: HTMLElement[] = [];\n\n // If the depth is above the max depth, abort the searching here.\n if (depth >= maxDepth) {\n return matches;\n }\n\n // Traverses a slot element\n const traverseSlot = ($slot: HTMLSlotElement) => {\n // Only check nodes that are of the type Node.ELEMENT_NODE\n // Read more here https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\n const assignedNodes = $slot.assignedNodes().filter((node) => node.nodeType === 1);\n if (assignedNodes.length > 0) {\n return queryShadowRoot(assignedNodes[0].parentElement!, skipNode, isMatch, maxDepth, depth + 1);\n }\n\n return [];\n };\n\n // Go through each child and continue the traversing if necessary\n // Even though the typing says that children can't be undefined, Edge 15 sometimes gives an undefined value.\n // Therefore we fallback to an empty array if it is undefined.\n const children = <HTMLElement[]>Array.from(root.children || []);\n for (const $child of children) {\n // Check if the node and its descendants should be skipped\n if (skipNode($child)) {\n continue;\n }\n\n // If the child matches we always add it\n if (isMatch($child)) {\n matches.push($child);\n }\n\n if ($child.shadowRoot != null) {\n matches.push(...queryShadowRoot($child.shadowRoot, skipNode, isMatch, maxDepth, depth + 1));\n } else if ($child.tagName === 'SLOT') {\n matches.push(...traverseSlot(<HTMLSlotElement>$child));\n } else {\n matches.push(...queryShadowRoot($child, skipNode, isMatch, maxDepth, depth + 1));\n }\n }\n\n return matches;\n}\n\nexport function getFocusableElements(root: HTMLElement | ShadowRoot): HTMLElement[] {\n return queryShadowRoot(root, isHidden, isFocusable);\n}\n", "import { html, LitElement, PropertyValues } from 'lit';\nimport { property, queryAll, queryAssignedElements } from 'lit/decorators.js';\nimport { styles } from './styles.js';\nimport { getFocusableElements } from './focus-trap.js';\n\nexport class DialogOpenEvent extends CustomEvent<void> {\n constructor() {\n super('dialog-open', {\n bubbles: true,\n composed: true,\n });\n }\n}\n\nexport class DialogCloseEvent extends CustomEvent<void> {\n constructor() {\n super('dialog-close', {\n bubbles: true,\n composed: true,\n });\n }\n}\n\nexport class TtDialog extends LitElement {\n static styles = styles;\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n @property({ type: String })\n public name: string | undefined;\n\n @property({ type: String, attribute: 'aria-label' })\n public ariaLabel: string | null = null;\n\n @property({ type: Boolean, reflect: true })\n public open: boolean = false;\n\n @queryAssignedElements({ flatten: true })\n slottedElements!: Array<HTMLElement>;\n\n @queryAll('#start,#end')\n trapBoundaries!: Array<HTMLElement>;\n\n public contains(other: Node | null): boolean {\n if (!other) return false;\n return (\n other === this ||\n this.slottedElements.some((el) => el === other || el.contains(other)) ||\n Array.from(this.trapBoundaries).includes(<HTMLElement>other)\n );\n }\n\n public updated(changedProperties: PropertyValues) {\n if (changedProperties.has('open')) {\n if (this.open) {\n this.dispatchEvent(new DialogOpenEvent());\n this.updateComplete.then(() => {\n this.focusFirst();\n });\n } else {\n this.dispatchEvent(new DialogCloseEvent());\n }\n }\n }\n\n public toggleVisibility = () => {\n this.open = !this.open;\n };\n\n public hide = () => {\n this.open = false;\n };\n\n public show = () => {\n this.open = true;\n };\n\n private onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.toggleVisibility();\n }\n };\n\n private focusFirst = () => {\n getFocusableElements(this)[0]?.focus();\n };\n\n private focusLast = () => {\n const focusable = getFocusableElements(this);\n focusable[focusable.length - 1]?.focus();\n };\n\n render() {\n return html`\n <div\n role=\"dialog\"\n aria-label=\"${this.ariaLabel}\"\n ?inert=\"${!this.open}\"\n tabindex=\"-1\"\n @keydown=${this.onKeyDown}\n part=\"dialog\"\n >\n <div id=\"start\" @focus=${this.focusLast} tabindex=\"0\"></div>\n <slot></slot>\n <div id=\"end\" @focus=${this.focusFirst} tabindex=\"0\"></div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementEventMap {\n 'dialog-open': DialogOpenEvent;\n 'dialog-close': DialogCloseEvent;\n }\n}\n", "import { TtDialog } from './TtDialog.js';\n\nif (typeof window !== 'undefined') {\n if (!window.customElements.get('tt-dialog')) {\n window.customElements.define('tt-dialog', TtDialog);\n }\n}\n\nexport { TtDialog };\n", "import { DateTime } from 'luxon';\n\nexport const dateConverter = (value: string | null): Date | undefined =>\n value ? DateTime.fromISO(value).toJSDate() : undefined;\n\nexport const dateTimeConverter = (value: string | null): DateTime | undefined =>\n value ? DateTime.fromISO(value) : undefined;\n", "import { css } from 'lit';\n\nexport const styles = css`\n :host {\n position: relative;\n }\n\n :host(:state(disabled)) {\n pointer-events: none;\n opacity: 0.5;\n }\n\n tt-side-panel::part(side-panel) {\n border-right: 1px solid var(--color-border-200);\n }\n\n tt-side-panel:empty {\n display: none;\n }\n\n [part='container'] {\n padding: var(--space-scale-1) var(--space-scale-1-5);\n gap: var(--space-scale-1);\n }\n\n [part='controls'] {\n display: flex;\n border: 1px solid var(--color-border-200);\n border-radius: var(--border-radius);\n width: fit-content;\n height: var(--date-picker-height, fit-content);\n background-color: var(--color-surface-100);\n font-size: var(--font-size-200);\n color: var(--color-text-400);\n align-items: stretch;\n justify-content: space-around;\n padding: 0;\n\n &[aria-invalid='true'] {\n outline: 2px solid var(--color-alert-300, red);\n }\n\n button {\n border: 0;\n padding-inline: var(--space-scale-1);\n background-color: transparent;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n align-self: stretch;\n border-left: 1px solid var(--color-border-200);\n box-sizing: border-box;\n color: var(--color-text-400);\n }\n\n &:has(+ tt-dialog[open]) .show-calendar svg,\n .show-calendar:hover svg {\n color: var(--color-primary-400);\n }\n }\n\n [part='dialog']::part(dialog) {\n margin-top: var(--space-scale-1);\n flex-direction: row-reverse;\n }\n`;\n", "import { css, html, LitElement, nothing, PropertyValues } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport { DateTime } from 'luxon';\nimport { Calendar } from '@triptease/tt-calendar';\nimport { calendarIcon } from '@triptease/icons';\nimport { TtDialog } from '@triptease/tt-dialog';\nimport { DateInput } from '@triptease/tt-date-input';\nimport { DateSelectionEvent } from '@triptease/tt-calendar/date-selection-context.js';\nimport { dateConverter } from './helpers.js';\nimport { styles } from './styles.js';\n\nexport class TtDatePicker extends LitElement {\n static styles = [\n styles,\n css`\n [part='controls'] {\n min-width: 19.1ch;\n }\n `,\n ];\n\n static formAssociated = true;\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n @query('tt-calendar')\n calendar!: Calendar;\n\n @query('tt-dialog')\n dialog!: TtDialog;\n\n @property({ type: String })\n public value?: string;\n\n @property({\n type: Date,\n converter: dateConverter,\n })\n public minDate?: Date;\n\n @property({\n type: Date,\n converter: dateConverter,\n })\n public maxDate?: Date;\n\n @property({ type: Boolean, attribute: 'open-left' })\n public openLeft = false;\n\n @property({ type: Boolean })\n public disabled = false;\n\n // Internal DateTime properties for calculations\n private get _valueDateTime(): DateTime | undefined {\n return this.value ? DateTime.fromISO(this.value) : undefined;\n }\n\n private get _minDateTime(): DateTime | undefined {\n return this.minDate ? DateTime.fromJSDate(this.minDate) : undefined;\n }\n\n private get _maxDateTime(): DateTime | undefined {\n return this.maxDate ? DateTime.fromJSDate(this.maxDate) : undefined;\n }\n\n @state()\n private _open: boolean = false;\n\n @query('tt-date-input')\n private dateInput!: DateInput;\n\n public internals: ReturnType<typeof this.attachInternals>;\n\n private get _formValue(): string {\n return this.value ?? '';\n }\n\n constructor() {\n super();\n this.internals = this.attachInternals();\n }\n\n onDateChange(e: Event) {\n if (DateSelectionEvent.is(e)) {\n this.value = e.detail;\n } else if (e.type === 'change') {\n this.value = (e.target as HTMLInputElement).value;\n }\n\n this.dispatchEvent(new InputEvent('change'));\n this.dialog.hide();\n }\n\n get form(): HTMLFormElement | null {\n return this.internals.form;\n }\n\n public updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n\n if (changedProperties.has('value')) {\n this.internals.setFormValue(this._formValue);\n this.validate();\n }\n\n if (changedProperties.has('disabled')) {\n if (this.disabled) {\n this.internals.setFormValue(null);\n this.internals.states.add('disabled');\n this.inert = true;\n } else {\n this.internals.states.delete('disabled');\n this.internals.setFormValue(this._formValue);\n this.inert = false;\n }\n }\n }\n\n private validate() {\n const wasValid = this.internals.validity.valid;\n const oldMessage = this.internals.validationMessage;\n this.internals.setValidity({});\n\n if (this._valueDateTime) {\n const minDateIsValid =\n !this._minDateTime || this._valueDateTime > this._minDateTime || this._valueDateTime.equals(this._minDateTime);\n if (!minDateIsValid) {\n this.internals.setValidity(\n { rangeUnderflow: true },\n `Date should be equal or after ${this._minDateTime?.toLocaleString({\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n })}`\n );\n return;\n }\n const maxDateIsValid =\n !this._maxDateTime || this._valueDateTime.equals(this._maxDateTime) || this._valueDateTime < this._maxDateTime;\n if (!maxDateIsValid) {\n this.internals.setValidity(\n { rangeOverflow: true },\n `Date should be before or equal to ${this._maxDateTime?.toLocaleString({\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n })}`\n );\n return;\n }\n }\n if (wasValid !== this.internals.validity.valid || oldMessage !== this.internals.validationMessage) {\n this.requestUpdate();\n }\n }\n\n public connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener('date-selection', this.onDateChange);\n this.addEventListener('dialog-open', this._onDialogOpen);\n this.addEventListener('dialog-close', this._onDialogClose);\n this.addEventListener('focusout', this.onFocusOut);\n this.addEventListener('focus', this._onFocus);\n }\n\n private _onDialogOpen = () => {\n this._open = true;\n };\n\n private _onDialogClose = () => {\n this._open = false;\n };\n\n public onFocusOut = (event: FocusEvent) => {\n if (!this._open) return;\n\n const target = (event.relatedTarget ?? event.explicitOriginalTarget) as HTMLElement | null;\n\n if (!this.contains(target)) {\n this.dialog.hide();\n }\n };\n\n private _onFocus = () => {\n this.dateInput.focus();\n };\n\n public disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('date-selection', this.onDateChange);\n this.removeEventListener('dialog-open', this._onDialogOpen);\n this.removeEventListener('dialog-close', this._onDialogClose);\n this.removeEventListener('focusout', this.onFocusOut);\n this.removeEventListener('focus', this._onFocus);\n }\n\n showCalendar() {\n if (!this._open) {\n this.dialog.show();\n\n if (this.openLeft) {\n this.style.setProperty('--calendar-left-distance', '-192px');\n }\n } else {\n this.dialog.hide();\n }\n }\n\n render() {\n return html`\n <div part=\"controls\" aria-invalid=${!this.internals.validity.valid} aria-disabled=\"${this.disabled}\">\n <div name=\"container\" part=\"container\">\n <tt-date-input @change=${this.onDateChange} .value=${this.value} .disabled=${this.disabled}></tt-date-input>\n </div>\n <button\n name=\"Show calendar\"\n @click=${this.showCalendar}\n class=\"show-calendar\"\n aria-label=\"Choose date, ${this}\"\n ?disabled=${this.disabled}\n >\n ${unsafeSVG(calendarIcon)}\n </button>\n </div>\n <tt-dialog name=\"calendar\" aria-label=\"Choose date\" part=\"dialog\">\n <tt-calendar\n .value=\"${this.value}\"\n .minDate=${this.minDate}\n .maxDate=${this.maxDate}\n part=\"calendar\"\n ></tt-calendar>\n </tt-dialog>\n <div class=\"errormessage\" id=\"error-msg-${this.id}\" role=\"alert\" aria-atomic=\"true\" part=\"error\">\n ${this.internals.validity.valid ? nothing : this.internals.validationMessage}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'tt-date-picker': TtDatePicker;\n }\n}\n", "import { Calendar } from '@triptease/tt-calendar/tt-calendar.js';\nimport { DateInput } from '@triptease/tt-date-input/tt-date-input.js';\nimport { TtDialog } from '@triptease/tt-dialog/tt-dialog.js';\nimport { TtDatePicker } from './TtDatePicker.js';\n\nif (typeof window !== 'undefined') {\n if (!window.customElements.get('tt-calendar')) {\n window.customElements.define('tt-calendar', Calendar);\n }\n if (!window.customElements.get('tt-date-input')) {\n window.customElements.define('tt-date-input', DateInput);\n }\n\n if (!window.customElements.get('tt-dialog')) {\n window.customElements.define('tt-dialog', TtDialog);\n }\n\n if (!window.customElements.get('tt-date-picker')) {\n window.customElements.define('tt-date-picker', TtDatePicker);\n }\n}\n\nexport { TtDatePicker };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;AAsDO,SAAS,WAAW,YAAYA,SAAQ,KAAK,MAAM;AACxD,MAAIC,KAAI,UAAU,QAAQC,KAAID,KAAI,IAAID,UAAS,SAAS,OAAO,OAAO,OAAO,yBAAyBA,SAAQ,GAAG,IAAI,MAAMG;AAC3H,MAAI,OAAO,YAAY,YAAY,OAAO,QAA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C,GAAM;AAAA,GAzDI,aA0DH;AAGA;AAAA,EADPJ,GAAM,eAAe;AAAA,GA5DX,aA6DH;;;ACpEV,IAAI,OAAO,WAAW,aAAa;AACjC,MAAI,CAAC,OAAO,eAAe,IAAI,aAAa,GAAG;AAC7C,WAAO,eAAe,OAAO,eAAe,QAAQ;AAAA,EACtD;AACA,MAAI,CAAC,OAAO,eAAe,IAAI,eAAe,GAAG;AAC/C,WAAO,eAAe,OAAO,iBAAiB,SAAS;AAAA,EACzD;AAEA,MAAI,CAAC,OAAO,eAAe,IAAI,WAAW,GAAG;AAC3C,WAAO,eAAe,OAAO,aAAa,QAAQ;AAAA,EACpD;AAEA,MAAI,CAAC,OAAO,eAAe,IAAI,gBAAgB,GAAG;AAChD,WAAO,eAAe,OAAO,kBAAkB,YAAY;AAAA,EAC7D;AACF;",
|
|
6
|
-
"names": ["target", "c", "r", "d", "i", "global", "globalThis", "supportsAdoptingStyleSheets", "ShadowRoot", "ShadyCSS", "nativeShadow", "Document", "prototype", "CSSStyleSheet", "constructionToken", "Symbol", "cssTagCache", "WeakMap", "CSSResult", "cssText", "strings", "safeToken", "this", "Error", "_strings", "styleSheet", "_styleSheet", "cacheable", "length", "get", "replaceSync", "set", "toString", "unsafeCSS", "value", "String", "css", "values", "reduce", "acc", "v", "idx", "adoptStyles", "renderRoot", "styles", "adoptedStyleSheets", "map", "s", "style", "document", "createElement", "nonce", "setAttribute", "textContent", "appendChild", "getCompatibleStyle", "sheet", "rule", "cssRules", "is", "defineProperty", "getOwnPropertyDescriptor", "getOwnPropertyNames", "getOwnPropertySymbols", "getPrototypeOf", "Object", "global", "globalThis", "trustedTypes", "emptyStringForBooleanAttribute", "emptyScript", "polyfillSupport", "reactiveElementPolyfillSupport", "JSCompiler_renameProperty", "prop", "_obj", "defaultConverter", "value", "type", "Boolean", "Array", "JSON", "stringify", "fromValue", "Number", "parse", "e", "notEqual", "old", "defaultPropertyDeclaration", "attribute", "String", "converter", "reflect", "useDefault", "hasChanged", "Symbol", "metadata", "litPropertyMetadata", "WeakMap", "ReactiveElement", "HTMLElement", "initializer", "this", "__prepare", "_initializers", "push", "observedAttributes", "finalize", "__attributeToPropertyMap", "keys", "name", "options", "state", "prototype", "hasOwnProperty", "create", "wrapped", "elementProperties", "set", "noAccessor", "key", "descriptor", "getPropertyDescriptor", "get", "v", "oldValue", "call", "requestUpdate", "configurable", "enumerable", "superCtor", "Map", "finalized", "props", "properties", "propKeys", "p", "createProperty", "attr", "__attributeNameForProperty", "elementStyles", "finalizeStyles", "styles", "isArray", "Set", "flat", "Infinity", "reverse", "s", "unshift", "getCompatibleStyle", "toLowerCase", "constructor", "super", "__instanceProperties", "isUpdatePending", "hasUpdated", "__reflectingProperty", "__initialize", "__updatePromise", "Promise", "res", "enableUpdating", "_$changedProperties", "__saveInstanceProperties", "forEach", "i", "controller", "__controllers", "add", "renderRoot", "isConnected", "hostConnected", "delete", "instanceProperties", "size", "createRenderRoot", "shadowRoot", "attachShadow", "shadowRootOptions", "adoptStyles", "connectedCallback", "c", "_requestedUpdate", "disconnectedCallback", "hostDisconnected", "_old", "_$attributeToProperty", "attrValue", "toAttribute", "removeAttribute", "setAttribute", "ctor", "propName", "getPropertyOptions", "fromAttribute", "__defaultValues", "newValue", "hasAttribute", "_$changeProperty", "__enqueueUpdate", "initializeValue", "has", "__reflectingProperties", "reject", "result", "scheduleUpdate", "performUpdate", "shouldUpdate", "changedProperties", "willUpdate", "hostUpdate", "update", "__markUpdated", "_$didUpdate", "_changedProperties", "hostUpdated", "firstUpdated", "updated", "updateComplete", "getUpdateComplete", "__propertyToAttribute", "mode", "reactiveElementVersions", "global", "globalThis", "trustedTypes", "policy", "createPolicy", "createHTML", "s", "boundAttributeSuffix", "marker", "Math", "random", "toFixed", "slice", "markerMatch", "nodeMarker", "d", "document", "createMarker", "createComment", "isPrimitive", "value", "isArray", "Array", "isIterable", "Symbol", "iterator", "SPACE_CHAR", "textEndRegex", "commentEndRegex", "comment2EndRegex", "tagEndRegex", "RegExp", "singleQuoteAttrEndRegex", "doubleQuoteAttrEndRegex", "rawTextElement", "tag", "type", "strings", "values", "_$litType$", "html", "svg", "mathml", "noChange", "for", "nothing", "templateCache", "WeakMap", "walker", "createTreeWalker", "trustFromTemplateString", "tsa", "stringFromTSA", "hasOwnProperty", "Error", "getTemplateHtml", "l", "length", "attrNames", "rawTextEndRegex", "regex", "i", "attrName", "match", "attrNameEndIndex", "lastIndex", "exec", "test", "end", "startsWith", "push", "Template", "constructor", "options", "node", "this", "parts", "nodeIndex", "attrNameIndex", "partCount", "el", "createElement", "currentNode", "content", "wrapper", "firstChild", "replaceWith", "childNodes", "nextNode", "nodeType", "hasAttributes", "name", "getAttributeNames", "endsWith", "realName", "statics", "getAttribute", "split", "m", "index", "ctor", "PropertyPart", "BooleanAttributePart", "EventPart", "AttributePart", "removeAttribute", "tagName", "textContent", "emptyScript", "append", "data", "indexOf", "_options", "innerHTML", "resolveDirective", "part", "parent", "attributeIndex", "currentDirective", "__directives", "__directive", "nextDirectiveConstructor", "_$initialize", "_$resolve", "TemplateInstance", "template", "_$parts", "_$disconnectableChildren", "_$template", "_$parent", "parentNode", "_$isConnected", "fragment", "creationScope", "importNode", "partIndex", "templatePart", "ChildPart", "nextSibling", "ElementPart", "_$setValue", "__isConnected", "startNode", "endNode", "_$committedValue", "_$startNode", "_$endNode", "isConnected", "directiveParent", "_$clear", "_commitText", "_commitTemplateResult", "_commitNode", "_commitIterable", "insertBefore", "_insert", "createTextNode", "result", "_$getTemplate", "h", "_update", "instance", "_clone", "get", "set", "itemParts", "itemPart", "item", "start", "from", "_$notifyConnectionChanged", "n", "remove", "element", "fill", "String", "valueIndex", "noCommit", "change", "v", "_commitValue", "setAttribute", "toggleAttribute", "super", "newListener", "oldListener", "shouldRemoveListener", "capture", "once", "passive", "shouldAddListener", "removeEventListener", "addEventListener", "event", "call", "host", "handleEvent", "polyfillSupport", "global", "litHtmlPolyfillSupport", "Template", "ChildPart", "litHtmlVersions", "push", "render", "value", "container", "options", "partOwnerNode", "renderBefore", "part", "endNode", "insertBefore", "createMarker", "_$setValue", "global", "globalThis", "LitElement", "ReactiveElement", "constructor", "this", "renderOptions", "host", "__childPart", "createRenderRoot", "renderRoot", "super", "renderBefore", "firstChild", "changedProperties", "value", "render", "hasUpdated", "isConnected", "update", "connectedCallback", "setConnected", "disconnectedCallback", "noChange", "litElementHydrateSupport", "polyfillSupport", "litElementPolyfillSupport", "global", "litElementVersions", "push", "defaultPropertyDeclaration", "attribute", "type", "String", "converter", "defaultConverter", "reflect", "hasChanged", "notEqual", "standardProperty", "options", "target", "context", "kind", "metadata", "properties", "globalThis", "litPropertyMetadata", "get", "set", "Map", "Object", "create", "wrapped", "name", "v", "oldValue", "call", "this", "requestUpdate", "_$changeProperty", "value", "Error", "property", "protoOrTarget", "nameOrContext", "proto", "hasOwnProperty", "constructor", "createProperty", "getOwnPropertyDescriptor", "state", "options", "property", "attribute", "desc", "obj", "name", "descriptor", "configurable", "enumerable", "Reflect", "decorate", "Object", "defineProperty", "query", "selector", "cache", "protoOrTarget", "nameOrContext", "descriptor", "doQuery", "el", "renderRoot", "querySelector", "get", "set", "key", "Symbol", "this", "v", "desc", "result", "call", "hasUpdated", "fragment", "queryAll", "selector", "obj", "name", "desc", "get", "this", "renderRoot", "document", "createDocumentFragment", "querySelectorAll", "queryAssignedElements", "options", "obj", "name", "slot", "selector", "slotSelector", "desc", "get", "slotEl", "this", "renderRoot", "querySelector", "elements", "assignedElements", "filter", "node", "matches", "PartType", "ATTRIBUTE", "CHILD", "PROPERTY", "BOOLEAN_ATTRIBUTE", "EVENT", "ELEMENT", "directive", "c", "values", "_$litDirective$", "Directive", "_partInfo", "_$isConnected", "this", "_$parent", "part", "parent", "attributeIndex", "__part", "__attributeIndex", "props", "update", "_part", "render", "classMap", "directive", "Directive", "partInfo", "super", "type", "PartType", "ATTRIBUTE", "name", "strings", "length", "Error", "classInfo", "Object", "keys", "filter", "key", "join", "part", "this", "_previousClasses", "Set", "_staticClasses", "split", "s", "has", "add", "render", "classList", "element", "remove", "delete", "value", "noChange", "UnsafeHTMLDirective", "Directive", "partInfo", "super", "this", "_value", "nothing", "type", "PartType", "CHILD", "Error", "constructor", "directiveName", "value", "_templateResult", "noChange", "strings", "raw", "_$litType$", "resultType", "values", "unsafeHTML", "directive", "UnsafeSVGDirective", "UnsafeHTMLDirective", "directiveName", "resultType", "unsafeSVG", "directive", "n", "s", "l", "i", "s", "e", "e", "f", "i", "z", "m", "singleton", "offset", "s", "r", "defaultZone", "offset", "i", "n", "t", "d", "i", "o", "e", "a", "k", "v", "x", "n", "f", "d", "m", "u", "offset", "s", "i", "c", "n", "p", "formatOffset", "t", "f", "r", "m", "s", "match", "i", "offset", "text", "o", "l", "n", "s", "k", "u", "i", "INVALID", "text", "s", "e", "o", "d", "a", "b", "i", "x", "a", "b", "u", "i", "s", "h", "m", "t", "u", "f", "r", "k", "p", "INVALID", "clone", "o", "o2", "o3", "offset", "d", "c", "text", "orderedUnits", "u", "v", "t", "c2", "i", "createContext", "key", "n", "i", "dayOfWeek", "_", "range", "e", "o", "isDisabled", "n", "r", "ifDefined", "value", "nothing", "initialValue", "guard", "directive", "Directive", "constructor", "this", "_previousValue", "_value", "f", "_part", "value", "Array", "isArray", "length", "every", "v", "i", "noChange", "from", "render", "i", "e", "target", "o", "n", "r", "styles", "i", "styles", "n", "o", "r", "styles", "i", "target", "e", "o", "styles", "n", "r"]
|
|
7
|
-
}
|