UNPKG

@indexea/widgets

Version:

This is the web components of Indexea, which contains multiple components such as SearchBox, SearchDialog, RecommListBox, etc

2,484 lines (2,483 loc) 685 kB
var Ce = Object.defineProperty; var Me = (e, y, n) => y in e ? Ce(e, y, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[y] = n; var Re = (e, y, n) => (Me(e, typeof y != "symbol" ? y + "" : y, n), n); function noop() { } const identity = (e) => e; function assign(e, y) { for (const n in y) e[n] = y[n]; return e; } function is_promise(e) { return e && typeof e == "object" && typeof e.then == "function"; } function run(e) { return e(); } function blank_object() { return /* @__PURE__ */ Object.create(null); } function run_all(e) { e.forEach(run); } function is_function(e) { return typeof e == "function"; } function safe_not_equal(e, y) { return e != e ? y == y : e !== y || e && typeof e == "object" || typeof e == "function"; } let src_url_equal_anchor; function src_url_equal(e, y) { return src_url_equal_anchor || (src_url_equal_anchor = document.createElement("a")), src_url_equal_anchor.href = y, e === src_url_equal_anchor.href; } function is_empty(e) { return Object.keys(e).length === 0; } function subscribe(e, ...y) { if (e == null) return noop; const n = e.subscribe(...y); return n.unsubscribe ? () => n.unsubscribe() : n; } function component_subscribe(e, y, n) { e.$$.on_destroy.push(subscribe(y, n)); } function create_slot(e, y, n, S) { if (e) { const f = get_slot_context(e, y, n, S); return e[0](f); } } function get_slot_context(e, y, n, S) { return e[1] && S ? assign(n.ctx.slice(), e[1](S(y))) : n.ctx; } function get_slot_changes(e, y, n, S) { if (e[2] && S) { const f = e[2](S(n)); if (y.dirty === void 0) return f; if (typeof f == "object") { const t = [], F = Math.max(y.dirty.length, f.length); for (let N = 0; N < F; N += 1) t[N] = y.dirty[N] | f[N]; return t; } return y.dirty | f; } return y.dirty; } function update_slot_base(e, y, n, S, f, t) { if (f) { const F = get_slot_context(y, n, S, t); e.p(F, f); } } function get_all_dirty_from_scope(e) { if (e.ctx.length > 32) { const y = [], n = e.ctx.length / 32; for (let S = 0; S < n; S++) y[S] = -1; return y; } return -1; } function exclude_internal_props(e) { const y = {}; for (const n in e) n[0] !== "$" && (y[n] = e[n]); return y; } const is_client = typeof window < "u"; let now$2 = is_client ? () => window.performance.now() : () => Date.now(), raf = is_client ? (e) => requestAnimationFrame(e) : noop; const tasks = /* @__PURE__ */ new Set(); function run_tasks(e) { tasks.forEach((y) => { y.c(e) || (tasks.delete(y), y.f()); }), tasks.size !== 0 && raf(run_tasks); } function loop(e) { let y; return tasks.size === 0 && raf(run_tasks), { promise: new Promise((n) => { tasks.add(y = { c: e, f: n }); }), abort() { tasks.delete(y); } }; } function append(e, y) { e.appendChild(y); } function append_styles(e, y, n) { const S = get_root_for_style(e); if (!S.getElementById(y)) { const f = element("style"); f.id = y, f.textContent = n, append_stylesheet(S, f); } } function get_root_for_style(e) { if (!e) return document; const y = e.getRootNode ? e.getRootNode() : e.ownerDocument; return y && y.host ? y : e.ownerDocument; } function append_empty_stylesheet(e) { const y = element("style"); return append_stylesheet(get_root_for_style(e), y), y.sheet; } function append_stylesheet(e, y) { return append(e.head || e, y), y.sheet; } function insert(e, y, n) { e.insertBefore(y, n || null); } function detach(e) { e.parentNode && e.parentNode.removeChild(e); } function destroy_each(e, y) { for (let n = 0; n < e.length; n += 1) e[n] && e[n].d(y); } function element(e) { return document.createElement(e); } function svg_element(e) { return document.createElementNS("http://www.w3.org/2000/svg", e); } function text(e) { return document.createTextNode(e); } function space() { return text(" "); } function empty() { return text(""); } function listen(e, y, n, S) { return e.addEventListener(y, n, S), () => e.removeEventListener(y, n, S); } function prevent_default(e) { return function(y) { return y.preventDefault(), e.call(this, y); }; } function attr(e, y, n) { n == null ? e.removeAttribute(y) : e.getAttribute(y) !== n && e.setAttribute(y, n); } function children(e) { return Array.from(e.childNodes); } function set_data(e, y) { y = "" + y, e.wholeText !== y && (e.data = y); } function set_input_value(e, y) { e.value = y ?? ""; } function toggle_class(e, y, n) { e.classList[n ? "add" : "remove"](y); } function custom_event(e, y, { bubbles: n = !1, cancelable: S = !1 } = {}) { const f = document.createEvent("CustomEvent"); return f.initCustomEvent(e, n, S, y), f; } class HtmlTag { constructor(y = !1) { this.is_svg = !1, this.is_svg = y, this.e = this.n = null; } c(y) { this.h(y); } m(y, n, S = null) { this.e || (this.is_svg ? this.e = svg_element(n.nodeName) : this.e = element(n.nodeName), this.t = n, this.c(y)), this.i(S); } h(y) { this.e.innerHTML = y, this.n = Array.from(this.e.childNodes); } i(y) { for (let n = 0; n < this.n.length; n += 1) insert(this.t, this.n[n], y); } p(y) { this.d(), this.h(y), this.i(this.a); } d() { this.n.forEach(detach); } } const managed_styles = /* @__PURE__ */ new Map(); let active = 0; function hash(e) { let y = 5381, n = e.length; for (; n--; ) y = (y << 5) - y ^ e.charCodeAt(n); return y >>> 0; } function create_style_information(e, y) { const n = { stylesheet: append_empty_stylesheet(y), rules: {} }; return managed_styles.set(e, n), n; } function create_rule(e, y, n, S, f, t, F, N = 0) { const I = 16.666 / S; let A = `{ `; for (let se = 0; se <= 1; se += I) { const le = y + (n - y) * t(se); A += se * 100 + `%{${F(le, 1 - le)}} `; } const P = A + `100% {${F(n, 1 - n)}} }`, Y = `__svelte_${hash(P)}_${N}`, ee = get_root_for_style(e), { stylesheet: ne, rules: ae } = managed_styles.get(ee) || create_style_information(ee, e); ae[Y] || (ae[Y] = !0, ne.insertRule(`@keyframes ${Y} ${P}`, ne.cssRules.length)); const pe = e.style.animation || ""; return e.style.animation = `${pe ? `${pe}, ` : ""}${Y} ${S}ms linear ${f}ms 1 both`, active += 1, Y; } function delete_rule(e, y) { const n = (e.style.animation || "").split(", "), S = n.filter( y ? (t) => t.indexOf(y) < 0 : (t) => t.indexOf("__svelte") === -1 ), f = n.length - S.length; f && (e.style.animation = S.join(", "), active -= f, active || clear_rules()); } function clear_rules() { raf(() => { active || (managed_styles.forEach((e) => { const { ownerNode: y } = e.stylesheet; y && detach(y); }), managed_styles.clear()); }); } let current_component; function set_current_component(e) { current_component = e; } function get_current_component() { if (!current_component) throw new Error("Function called outside component initialization"); return current_component; } function onMount(e) { get_current_component().$$.on_mount.push(e); } function afterUpdate(e) { get_current_component().$$.after_update.push(e); } function onDestroy(e) { get_current_component().$$.on_destroy.push(e); } const dirty_components = [], binding_callbacks = [], render_callbacks = [], flush_callbacks = [], resolved_promise = Promise.resolve(); let update_scheduled = !1; function schedule_update() { update_scheduled || (update_scheduled = !0, resolved_promise.then(flush)); } function add_render_callback(e) { render_callbacks.push(e); } function add_flush_callback(e) { flush_callbacks.push(e); } const seen_callbacks = /* @__PURE__ */ new Set(); let flushidx = 0; function flush() { const e = current_component; do { for (; flushidx < dirty_components.length; ) { const y = dirty_components[flushidx]; flushidx++, set_current_component(y), update(y.$$); } for (set_current_component(null), dirty_components.length = 0, flushidx = 0; binding_callbacks.length; ) binding_callbacks.pop()(); for (let y = 0; y < render_callbacks.length; y += 1) { const n = render_callbacks[y]; seen_callbacks.has(n) || (seen_callbacks.add(n), n()); } render_callbacks.length = 0; } while (dirty_components.length); for (; flush_callbacks.length; ) flush_callbacks.pop()(); update_scheduled = !1, seen_callbacks.clear(), set_current_component(e); } function update(e) { if (e.fragment !== null) { e.update(), run_all(e.before_update); const y = e.dirty; e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, y), e.after_update.forEach(add_render_callback); } } let promise; function wait() { return promise || (promise = Promise.resolve(), promise.then(() => { promise = null; })), promise; } function dispatch(e, y, n) { e.dispatchEvent(custom_event(`${y ? "intro" : "outro"}${n}`)); } const outroing = /* @__PURE__ */ new Set(); let outros; function group_outros() { outros = { r: 0, c: [], p: outros }; } function check_outros() { outros.r || run_all(outros.c), outros = outros.p; } function transition_in(e, y) { e && e.i && (outroing.delete(e), e.i(y)); } function transition_out(e, y, n, S) { if (e && e.o) { if (outroing.has(e)) return; outroing.add(e), outros.c.push(() => { outroing.delete(e), S && (n && e.d(1), S()); }), e.o(y); } else S && S(); } const null_transition = { duration: 0 }; function create_in_transition(e, y, n) { const S = { direction: "in" }; let f = y(e, n, S), t = !1, F, N, I = 0; function A() { F && delete_rule(e, F); } function P() { const { delay: ee = 0, duration: ne = 300, easing: ae = identity, tick: pe = noop, css: se } = f || null_transition; se && (F = create_rule(e, 0, 1, ne, ee, ae, se, I++)), pe(0, 1); const le = now$2() + ee, me = le + ne; N && N.abort(), t = !0, add_render_callback(() => dispatch(e, !0, "start")), N = loop((fe) => { if (t) { if (fe >= me) return pe(1, 0), dispatch(e, !0, "end"), A(), t = !1; if (fe >= le) { const ge = ae((fe - le) / ne); pe(ge, 1 - ge); } } return t; }); } let Y = !1; return { start() { Y || (Y = !0, delete_rule(e), is_function(f) ? (f = f(S), wait().then(P)) : P()); }, invalidate() { Y = !1; }, end() { t && (A(), t = !1); } }; } function create_out_transition(e, y, n) { const S = { direction: "out" }; let f = y(e, n, S), t = !0, F; const N = outros; N.r += 1; function I() { const { delay: A = 0, duration: P = 300, easing: Y = identity, tick: ee = noop, css: ne } = f || null_transition; ne && (F = create_rule(e, 1, 0, P, A, Y, ne)); const ae = now$2() + A, pe = ae + P; add_render_callback(() => dispatch(e, !1, "start")), loop((se) => { if (t) { if (se >= pe) return ee(0, 1), dispatch(e, !1, "end"), --N.r || run_all(N.c), !1; if (se >= ae) { const le = Y((se - ae) / P); ee(1 - le, le); } } return t; }); } return is_function(f) ? wait().then(() => { f = f(S), I(); }) : I(), { end(A) { A && f.tick && f.tick(1, 0), t && (F && delete_rule(e, F), t = !1); } }; } function create_bidirectional_transition(e, y, n, S) { const f = { direction: "both" }; let t = y(e, n, f), F = S ? 0 : 1, N = null, I = null, A = null; function P() { A && delete_rule(e, A); } function Y(ne, ae) { const pe = ne.b - F; return ae *= Math.abs(pe), { a: F, b: ne.b, d: pe, duration: ae, start: ne.start, end: ne.start + ae, group: ne.group }; } function ee(ne) { const { delay: ae = 0, duration: pe = 300, easing: se = identity, tick: le = noop, css: me } = t || null_transition, fe = { start: now$2() + ae, b: ne }; ne || (fe.group = outros, outros.r += 1), N || I ? I = fe : (me && (P(), A = create_rule(e, F, ne, pe, ae, se, me)), ne && le(0, 1), N = Y(fe, pe), add_render_callback(() => dispatch(e, ne, "start")), loop((ge) => { if (I && ge > I.start && (N = Y(I, pe), I = null, dispatch(e, N.b, "start"), me && (P(), A = create_rule(e, F, N.b, N.duration, 0, se, t.css))), N) { if (ge >= N.end) le(F = N.b, 1 - F), dispatch(e, N.b, "end"), I || (N.b ? P() : --N.group.r || run_all(N.group.c)), N = null; else if (ge >= N.start) { const oe = ge - N.start; F = N.a + N.d * se(oe / N.duration), le(F, 1 - F); } } return !!(N || I); })); } return { run(ne) { is_function(t) ? wait().then(() => { t = t(f), ee(ne); }) : ee(ne); }, end() { P(), N = I = null; } }; } function handle_promise(e, y) { const n = y.token = {}; function S(f, t, F, N) { if (y.token !== n) return; y.resolved = N; let I = y.ctx; F !== void 0 && (I = I.slice(), I[F] = N); const A = f && (y.current = f)(I); let P = !1; y.block && (y.blocks ? y.blocks.forEach((Y, ee) => { ee !== t && Y && (group_outros(), transition_out(Y, 1, 1, () => { y.blocks[ee] === Y && (y.blocks[ee] = null); }), check_outros()); }) : y.block.d(1), A.c(), transition_in(A, 1), A.m(y.mount(), y.anchor), P = !0), y.block = A, y.blocks && (y.blocks[t] = A), P && flush(); } if (is_promise(e)) { const f = get_current_component(); if (e.then((t) => { set_current_component(f), S(y.then, 1, y.value, t), set_current_component(null); }, (t) => { if (set_current_component(f), S(y.catch, 2, y.error, t), set_current_component(null), !y.hasCatch) throw t; }), y.current !== y.pending) return S(y.pending, 0), !0; } else { if (y.current !== y.then) return S(y.then, 1, y.value, e), !0; y.resolved = e; } } function update_await_block_branch(e, y, n) { const S = y.slice(), { resolved: f } = e; e.current === e.then && (S[e.value] = f), e.current === e.catch && (S[e.error] = f), e.block.p(S, n); } function bind(e, y, n, S) { const f = e.$$.props[y]; f !== void 0 && (e.$$.bound[f] = n, S === void 0 && n(e.$$.ctx[f])); } function create_component(e) { e && e.c(); } function mount_component(e, y, n, S) { const { fragment: f, after_update: t } = e.$$; f && f.m(y, n), S || add_render_callback(() => { const F = e.$$.on_mount.map(run).filter(is_function); e.$$.on_destroy ? e.$$.on_destroy.push(...F) : run_all(F), e.$$.on_mount = []; }), t.forEach(add_render_callback); } function destroy_component(e, y) { const n = e.$$; n.fragment !== null && (run_all(n.on_destroy), n.fragment && n.fragment.d(y), n.on_destroy = n.fragment = null, n.ctx = []); } function make_dirty(e, y) { e.$$.dirty[0] === -1 && (dirty_components.push(e), schedule_update(), e.$$.dirty.fill(0)), e.$$.dirty[y / 31 | 0] |= 1 << y % 31; } function init(e, y, n, S, f, t, F, N = [-1]) { const I = current_component; set_current_component(e); const A = e.$$ = { fragment: null, ctx: [], props: t, update: noop, not_equal: f, bound: blank_object(), on_mount: [], on_destroy: [], on_disconnect: [], before_update: [], after_update: [], context: new Map(y.context || (I ? I.$$.context : [])), callbacks: blank_object(), dirty: N, skip_bound: !1, root: y.target || I.$$.root }; F && F(A.root); let P = !1; if (A.ctx = n ? n(e, y.props || {}, (Y, ee, ...ne) => { const ae = ne.length ? ne[0] : ee; return A.ctx && f(A.ctx[Y], A.ctx[Y] = ae) && (!A.skip_bound && A.bound[Y] && A.bound[Y](ae), P && make_dirty(e, Y)), ee; }) : [], A.update(), P = !0, run_all(A.before_update), A.fragment = S ? S(A.ctx) : !1, y.target) { if (y.hydrate) { const Y = children(y.target); A.fragment && A.fragment.l(Y), Y.forEach(detach); } else A.fragment && A.fragment.c(); y.intro && transition_in(e.$$.fragment), mount_component(e, y.target, y.anchor, y.customElement), flush(); } set_current_component(I); } class SvelteComponent { $destroy() { destroy_component(this, 1), this.$destroy = noop; } $on(y, n) { if (!is_function(n)) return noop; const S = this.$$.callbacks[y] || (this.$$.callbacks[y] = []); return S.push(n), () => { const f = S.indexOf(n); f !== -1 && S.splice(f, 1); }; } $set(y) { this.$$set && !is_empty(y) && (this.$$.skip_bound = !0, this.$$set(y), this.$$.skip_bound = !1); } } const subscriber_queue = []; function readable(e, y) { return { subscribe: writable(e, y).subscribe }; } function writable(e, y = noop) { let n; const S = /* @__PURE__ */ new Set(); function f(N) { if (safe_not_equal(e, N) && (e = N, n)) { const I = !subscriber_queue.length; for (const A of S) A[1](), subscriber_queue.push(A, e); if (I) { for (let A = 0; A < subscriber_queue.length; A += 2) subscriber_queue[A][0](subscriber_queue[A + 1]); subscriber_queue.length = 0; } } } function t(N) { f(N(e)); } function F(N, I = noop) { const A = [N, I]; return S.add(A), S.size === 1 && (n = y(f) || noop), N(e), () => { S.delete(A), S.size === 0 && (n(), n = null); }; } return { set: f, update: t, subscribe: F }; } function derived(e, y, n) { const S = !Array.isArray(e), f = S ? [e] : e, t = y.length < 2; return readable(n, (F) => { let N = !1; const I = []; let A = 0, P = noop; const Y = () => { if (A) return; P(); const ne = y(S ? I[0] : I, F); t ? F(ne) : P = is_function(ne) ? ne : noop; }, ee = f.map((ne, ae) => subscribe(ne, (pe) => { I[ae] = pe, A &= ~(1 << ae), N && Y(); }, () => { A |= 1 << ae; })); return N = !0, Y(), function() { run_all(ee), P(); }; }); } var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, isMergeableObject = function(y) { return isNonNullObject(y) && !isSpecial(y); }; function isNonNullObject(e) { return !!e && typeof e == "object"; } function isSpecial(e) { var y = Object.prototype.toString.call(e); return y === "[object RegExp]" || y === "[object Date]" || isReactElement(e); } var canUseSymbol = typeof Symbol == "function" && Symbol.for, REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103; function isReactElement(e) { return e.$$typeof === REACT_ELEMENT_TYPE; } function emptyTarget(e) { return Array.isArray(e) ? [] : {}; } function cloneUnlessOtherwiseSpecified(e, y) { return y.clone !== !1 && y.isMergeableObject(e) ? deepmerge(emptyTarget(e), e, y) : e; } function defaultArrayMerge(e, y, n) { return e.concat(y).map(function(S) { return cloneUnlessOtherwiseSpecified(S, n); }); } function getMergeFunction(e, y) { if (!y.customMerge) return deepmerge; var n = y.customMerge(e); return typeof n == "function" ? n : deepmerge; } function getEnumerableOwnPropertySymbols(e) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(y) { return e.propertyIsEnumerable(y); }) : []; } function getKeys(e) { return Object.keys(e).concat(getEnumerableOwnPropertySymbols(e)); } function propertyIsOnObject(e, y) { try { return y in e; } catch { return !1; } } function propertyIsUnsafe(e, y) { return propertyIsOnObject(e, y) && !(Object.hasOwnProperty.call(e, y) && Object.propertyIsEnumerable.call(e, y)); } function mergeObject(e, y, n) { var S = {}; return n.isMergeableObject(e) && getKeys(e).forEach(function(f) { S[f] = cloneUnlessOtherwiseSpecified(e[f], n); }), getKeys(y).forEach(function(f) { propertyIsUnsafe(e, f) || (propertyIsOnObject(e, f) && n.isMergeableObject(y[f]) ? S[f] = getMergeFunction(f, n)(e[f], y[f], n) : S[f] = cloneUnlessOtherwiseSpecified(y[f], n)); }), S; } function deepmerge(e, y, n) { n = n || {}, n.arrayMerge = n.arrayMerge || defaultArrayMerge, n.isMergeableObject = n.isMergeableObject || isMergeableObject, n.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; var S = Array.isArray(y), f = Array.isArray(e), t = S === f; return t ? S ? n.arrayMerge(e, y, n) : mergeObject(e, y, n) : cloneUnlessOtherwiseSpecified(y, n); } deepmerge.all = function(y, n) { if (!Array.isArray(y)) throw new Error("first argument should be an array"); return y.reduce(function(S, f) { return deepmerge(S, f, n); }, {}); }; var deepmerge_1 = deepmerge, cjs = deepmerge_1, extendStatics = function(e, y) { return extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, S) { n.__proto__ = S; } || function(n, S) { for (var f in S) Object.prototype.hasOwnProperty.call(S, f) && (n[f] = S[f]); }, extendStatics(e, y); }; function __extends$d(e, y) { if (typeof y != "function" && y !== null) throw new TypeError("Class extends value " + String(y) + " is not a constructor or null"); extendStatics(e, y); function n() { this.constructor = e; } e.prototype = y === null ? Object.create(y) : (n.prototype = y.prototype, new n()); } var __assign = function() { return __assign = Object.assign || function(y) { for (var n, S = 1, f = arguments.length; S < f; S++) { n = arguments[S]; for (var t in n) Object.prototype.hasOwnProperty.call(n, t) && (y[t] = n[t]); } return y; }, __assign.apply(this, arguments); }; function __spreadArray(e, y, n) { if (n || arguments.length === 2) for (var S = 0, f = y.length, t; S < f; S++) (t || !(S in y)) && (t || (t = Array.prototype.slice.call(y, 0, S)), t[S] = y[S]); return e.concat(t || Array.prototype.slice.call(y)); } var ErrorKind; (function(e) { e[e.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE", e[e.EMPTY_ARGUMENT = 2] = "EMPTY_ARGUMENT", e[e.MALFORMED_ARGUMENT = 3] = "MALFORMED_ARGUMENT", e[e.EXPECT_ARGUMENT_TYPE = 4] = "EXPECT_ARGUMENT_TYPE", e[e.INVALID_ARGUMENT_TYPE = 5] = "INVALID_ARGUMENT_TYPE", e[e.EXPECT_ARGUMENT_STYLE = 6] = "EXPECT_ARGUMENT_STYLE", e[e.INVALID_NUMBER_SKELETON = 7] = "INVALID_NUMBER_SKELETON", e[e.INVALID_DATE_TIME_SKELETON = 8] = "INVALID_DATE_TIME_SKELETON", e[e.EXPECT_NUMBER_SKELETON = 9] = "EXPECT_NUMBER_SKELETON", e[e.EXPECT_DATE_TIME_SKELETON = 10] = "EXPECT_DATE_TIME_SKELETON", e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE", e[e.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS", e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT", e[e.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR", e[e.MISSING_OTHER_CLAUSE = 22] = "MISSING_OTHER_CLAUSE", e[e.INVALID_TAG = 23] = "INVALID_TAG", e[e.INVALID_TAG_NAME = 25] = "INVALID_TAG_NAME", e[e.UNMATCHED_CLOSING_TAG = 26] = "UNMATCHED_CLOSING_TAG", e[e.UNCLOSED_TAG = 27] = "UNCLOSED_TAG"; })(ErrorKind || (ErrorKind = {})); var TYPE; (function(e) { e[e.literal = 0] = "literal", e[e.argument = 1] = "argument", e[e.number = 2] = "number", e[e.date = 3] = "date", e[e.time = 4] = "time", e[e.select = 5] = "select", e[e.plural = 6] = "plural", e[e.pound = 7] = "pound", e[e.tag = 8] = "tag"; })(TYPE || (TYPE = {})); var SKELETON_TYPE; (function(e) { e[e.number = 0] = "number", e[e.dateTime = 1] = "dateTime"; })(SKELETON_TYPE || (SKELETON_TYPE = {})); function isLiteralElement(e) { return e.type === TYPE.literal; } function isArgumentElement(e) { return e.type === TYPE.argument; } function isNumberElement(e) { return e.type === TYPE.number; } function isDateElement(e) { return e.type === TYPE.date; } function isTimeElement(e) { return e.type === TYPE.time; } function isSelectElement(e) { return e.type === TYPE.select; } function isPluralElement(e) { return e.type === TYPE.plural; } function isPoundElement(e) { return e.type === TYPE.pound; } function isTagElement(e) { return e.type === TYPE.tag; } function isNumberSkeleton(e) { return !!(e && typeof e == "object" && e.type === SKELETON_TYPE.number); } function isDateTimeSkeleton(e) { return !!(e && typeof e == "object" && e.type === SKELETON_TYPE.dateTime); } var SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g; function parseDateTimeSkeleton(e) { var y = {}; return e.replace(DATE_TIME_REGEX, function(n) { var S = n.length; switch (n[0]) { case "G": y.era = S === 4 ? "long" : S === 5 ? "narrow" : "short"; break; case "y": y.year = S === 2 ? "2-digit" : "numeric"; break; case "Y": case "u": case "U": case "r": throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead"); case "q": case "Q": throw new RangeError("`q/Q` (quarter) patterns are not supported"); case "M": case "L": y.month = ["numeric", "2-digit", "short", "long", "narrow"][S - 1]; break; case "w": case "W": throw new RangeError("`w/W` (week) patterns are not supported"); case "d": y.day = ["numeric", "2-digit"][S - 1]; break; case "D": case "F": case "g": throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead"); case "E": y.weekday = S === 4 ? "short" : S === 5 ? "narrow" : "short"; break; case "e": if (S < 4) throw new RangeError("`e..eee` (weekday) patterns are not supported"); y.weekday = ["short", "long", "narrow", "short"][S - 4]; break; case "c": if (S < 4) throw new RangeError("`c..ccc` (weekday) patterns are not supported"); y.weekday = ["short", "long", "narrow", "short"][S - 4]; break; case "a": y.hour12 = !0; break; case "b": case "B": throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead"); case "h": y.hourCycle = "h12", y.hour = ["numeric", "2-digit"][S - 1]; break; case "H": y.hourCycle = "h23", y.hour = ["numeric", "2-digit"][S - 1]; break; case "K": y.hourCycle = "h11", y.hour = ["numeric", "2-digit"][S - 1]; break; case "k": y.hourCycle = "h24", y.hour = ["numeric", "2-digit"][S - 1]; break; case "j": case "J": case "C": throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead"); case "m": y.minute = ["numeric", "2-digit"][S - 1]; break; case "s": y.second = ["numeric", "2-digit"][S - 1]; break; case "S": case "A": throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead"); case "z": y.timeZoneName = S < 4 ? "short" : "long"; break; case "Z": case "O": case "v": case "V": case "X": case "x": throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead"); } return ""; }), y; } var WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; function parseNumberSkeletonFromString(e) { if (e.length === 0) throw new Error("Number skeleton cannot be empty"); for (var y = e.split(WHITE_SPACE_REGEX).filter(function(ee) { return ee.length > 0; }), n = [], S = 0, f = y; S < f.length; S++) { var t = f[S], F = t.split("/"); if (F.length === 0) throw new Error("Invalid number skeleton"); for (var N = F[0], I = F.slice(1), A = 0, P = I; A < P.length; A++) { var Y = P[A]; if (Y.length === 0) throw new Error("Invalid number skeleton"); } n.push({ stem: N, options: I }); } return n; } function icuUnitToEcma(e) { return e.replace(/^(.*?)-/, ""); } var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g, INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g, CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/; function parseSignificantPrecision(e) { var y = {}; return e[e.length - 1] === "r" ? y.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (y.roundingPriority = "lessPrecision"), e.replace(SIGNIFICANT_PRECISION_REGEX, function(n, S, f) { return typeof f != "string" ? (y.minimumSignificantDigits = S.length, y.maximumSignificantDigits = S.length) : f === "+" ? y.minimumSignificantDigits = S.length : S[0] === "#" ? y.maximumSignificantDigits = S.length : (y.minimumSignificantDigits = S.length, y.maximumSignificantDigits = S.length + (typeof f == "string" ? f.length : 0)), ""; }), y; } function parseSign(e) { switch (e) { case "sign-auto": return { signDisplay: "auto" }; case "sign-accounting": case "()": return { currencySign: "accounting" }; case "sign-always": case "+!": return { signDisplay: "always" }; case "sign-accounting-always": case "()!": return { signDisplay: "always", currencySign: "accounting" }; case "sign-except-zero": case "+?": return { signDisplay: "exceptZero" }; case "sign-accounting-except-zero": case "()?": return { signDisplay: "exceptZero", currencySign: "accounting" }; case "sign-never": case "+_": return { signDisplay: "never" }; } } function parseConciseScientificAndEngineeringStem(e) { var y; if (e[0] === "E" && e[1] === "E" ? (y = { notation: "engineering" }, e = e.slice(2)) : e[0] === "E" && (y = { notation: "scientific" }, e = e.slice(1)), y) { var n = e.slice(0, 2); if (n === "+!" ? (y.signDisplay = "always", e = e.slice(2)) : n === "+?" && (y.signDisplay = "exceptZero", e = e.slice(2)), !CONCISE_INTEGER_WIDTH_REGEX.test(e)) throw new Error("Malformed concise eng/scientific notation"); y.minimumIntegerDigits = e.length; } return y; } function parseNotationOptions(e) { var y = {}, n = parseSign(e); return n || y; } function parseNumberSkeleton(e) { for (var y = {}, n = 0, S = e; n < S.length; n++) { var f = S[n]; switch (f.stem) { case "percent": case "%": y.style = "percent"; continue; case "%x100": y.style = "percent", y.scale = 100; continue; case "currency": y.style = "currency", y.currency = f.options[0]; continue; case "group-off": case ",_": y.useGrouping = !1; continue; case "precision-integer": case ".": y.maximumFractionDigits = 0; continue; case "measure-unit": case "unit": y.style = "unit", y.unit = icuUnitToEcma(f.options[0]); continue; case "compact-short": case "K": y.notation = "compact", y.compactDisplay = "short"; continue; case "compact-long": case "KK": y.notation = "compact", y.compactDisplay = "long"; continue; case "scientific": y = __assign(__assign(__assign({}, y), { notation: "scientific" }), f.options.reduce(function(I, A) { return __assign(__assign({}, I), parseNotationOptions(A)); }, {})); continue; case "engineering": y = __assign(__assign(__assign({}, y), { notation: "engineering" }), f.options.reduce(function(I, A) { return __assign(__assign({}, I), parseNotationOptions(A)); }, {})); continue; case "notation-simple": y.notation = "standard"; continue; case "unit-width-narrow": y.currencyDisplay = "narrowSymbol", y.unitDisplay = "narrow"; continue; case "unit-width-short": y.currencyDisplay = "code", y.unitDisplay = "short"; continue; case "unit-width-full-name": y.currencyDisplay = "name", y.unitDisplay = "long"; continue; case "unit-width-iso-code": y.currencyDisplay = "symbol"; continue; case "scale": y.scale = parseFloat(f.options[0]); continue; case "integer-width": if (f.options.length > 1) throw new RangeError("integer-width stems only accept a single optional option"); f.options[0].replace(INTEGER_WIDTH_REGEX, function(I, A, P, Y, ee, ne) { if (A) y.minimumIntegerDigits = P.length; else { if (Y && ee) throw new Error("We currently do not support maximum integer digits"); if (ne) throw new Error("We currently do not support exact integer digits"); } return ""; }); continue; } if (CONCISE_INTEGER_WIDTH_REGEX.test(f.stem)) { y.minimumIntegerDigits = f.stem.length; continue; } if (FRACTION_PRECISION_REGEX.test(f.stem)) { if (f.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option"); f.stem.replace(FRACTION_PRECISION_REGEX, function(I, A, P, Y, ee, ne) { return P === "*" ? y.minimumFractionDigits = A.length : Y && Y[0] === "#" ? y.maximumFractionDigits = Y.length : ee && ne ? (y.minimumFractionDigits = ee.length, y.maximumFractionDigits = ee.length + ne.length) : (y.minimumFractionDigits = A.length, y.maximumFractionDigits = A.length), ""; }); var t = f.options[0]; t === "w" ? y = __assign(__assign({}, y), { trailingZeroDisplay: "stripIfInteger" }) : t && (y = __assign(__assign({}, y), parseSignificantPrecision(t))); continue; } if (SIGNIFICANT_PRECISION_REGEX.test(f.stem)) { y = __assign(__assign({}, y), parseSignificantPrecision(f.stem)); continue; } var F = parseSign(f.stem); F && (y = __assign(__assign({}, y), F)); var N = parseConciseScientificAndEngineeringStem(f.stem); N && (y = __assign(__assign({}, y), N)); } return y; } var timeData = { AX: [ "H" ], BQ: [ "H" ], CP: [ "H" ], CZ: [ "H" ], DK: [ "H" ], FI: [ "H" ], ID: [ "H" ], IS: [ "H" ], ML: [ "H" ], NE: [ "H" ], RU: [ "H" ], SE: [ "H" ], SJ: [ "H" ], SK: [ "H" ], AS: [ "h", "H" ], BT: [ "h", "H" ], DJ: [ "h", "H" ], ER: [ "h", "H" ], GH: [ "h", "H" ], IN: [ "h", "H" ], LS: [ "h", "H" ], PG: [ "h", "H" ], PW: [ "h", "H" ], SO: [ "h", "H" ], TO: [ "h", "H" ], VU: [ "h", "H" ], WS: [ "h", "H" ], "001": [ "H", "h" ], AL: [ "h", "H", "hB" ], TD: [ "h", "H", "hB" ], "ca-ES": [ "H", "h", "hB" ], CF: [ "H", "h", "hB" ], CM: [ "H", "h", "hB" ], "fr-CA": [ "H", "h", "hB" ], "gl-ES": [ "H", "h", "hB" ], "it-CH": [ "H", "h", "hB" ], "it-IT": [ "H", "h", "hB" ], LU: [ "H", "h", "hB" ], NP: [ "H", "h", "hB" ], PF: [ "H", "h", "hB" ], SC: [ "H", "h", "hB" ], SM: [ "H", "h", "hB" ], SN: [ "H", "h", "hB" ], TF: [ "H", "h", "hB" ], VA: [ "H", "h", "hB" ], CY: [ "h", "H", "hb", "hB" ], GR: [ "h", "H", "hb", "hB" ], CO: [ "h", "H", "hB", "hb" ], DO: [ "h", "H", "hB", "hb" ], KP: [ "h", "H", "hB", "hb" ], KR: [ "h", "H", "hB", "hb" ], NA: [ "h", "H", "hB", "hb" ], PA: [ "h", "H", "hB", "hb" ], PR: [ "h", "H", "hB", "hb" ], VE: [ "h", "H", "hB", "hb" ], AC: [ "H", "h", "hb", "hB" ], AI: [ "H", "h", "hb", "hB" ], BW: [ "H", "h", "hb", "hB" ], BZ: [ "H", "h", "hb", "hB" ], CC: [ "H", "h", "hb", "hB" ], CK: [ "H", "h", "hb", "hB" ], CX: [ "H", "h", "hb", "hB" ], DG: [ "H", "h", "hb", "hB" ], FK: [ "H", "h", "hb", "hB" ], GB: [ "H", "h", "hb", "hB" ], GG: [ "H", "h", "hb", "hB" ], GI: [ "H", "h", "hb", "hB" ], IE: [ "H", "h", "hb", "hB" ], IM: [ "H", "h", "hb", "hB" ], IO: [ "H", "h", "hb", "hB" ], JE: [ "H", "h", "hb", "hB" ], LT: [ "H", "h", "hb", "hB" ], MK: [ "H", "h", "hb", "hB" ], MN: [ "H", "h", "hb", "hB" ], MS: [ "H", "h", "hb", "hB" ], NF: [ "H", "h", "hb", "hB" ], NG: [ "H", "h", "hb", "hB" ], NR: [ "H", "h", "hb", "hB" ], NU: [ "H", "h", "hb", "hB" ], PN: [ "H", "h", "hb", "hB" ], SH: [ "H", "h", "hb", "hB" ], SX: [ "H", "h", "hb", "hB" ], TA: [ "H", "h", "hb", "hB" ], ZA: [ "H", "h", "hb", "hB" ], "af-ZA": [ "H", "h", "hB", "hb" ], AR: [ "H", "h", "hB", "hb" ], CL: [ "H", "h", "hB", "hb" ], CR: [ "H", "h", "hB", "hb" ], CU: [ "H", "h", "hB", "hb" ], EA: [ "H", "h", "hB", "hb" ], "es-BO": [ "H", "h", "hB", "hb" ], "es-BR": [ "H", "h", "hB", "hb" ], "es-EC": [ "H", "h", "hB", "hb" ], "es-ES": [ "H", "h", "hB", "hb" ], "es-GQ": [ "H", "h", "hB", "hb" ], "es-PE": [ "H", "h", "hB", "hb" ], GT: [ "H", "h", "hB", "hb" ], HN: [ "H", "h", "hB", "hb" ], IC: [ "H", "h", "hB", "hb" ], KG: [ "H", "h", "hB", "hb" ], KM: [ "H", "h", "hB", "hb" ], LK: [ "H", "h", "hB", "hb" ], MA: [ "H", "h", "hB", "hb" ], MX: [ "H", "h", "hB", "hb" ], NI: [ "H", "h", "hB", "hb" ], PY: [ "H", "h", "hB", "hb" ], SV: [ "H", "h", "hB", "hb" ], UY: [ "H", "h", "hB", "hb" ], JP: [ "H", "h", "K" ], AD: [ "H", "hB" ], AM: [ "H", "hB" ], AO: [ "H", "hB" ], AT: [ "H", "hB" ], AW: [ "H", "hB" ], BE: [ "H", "hB" ], BF: [ "H", "hB" ], BJ: [ "H", "hB" ], BL: [ "H", "hB" ], BR: [ "H", "hB" ], CG: [ "H", "hB" ], CI: [ "H", "hB" ], CV: [ "H", "hB" ], DE: [ "H", "hB" ], EE: [ "H", "hB" ], FR: [ "H", "hB" ], GA: [ "H", "hB" ], GF: [ "H", "hB" ], GN: [ "H", "hB" ], GP: [ "H", "hB" ], GW: [ "H", "hB" ], HR: [ "H", "hB" ], IL: [ "H", "hB" ], IT: [ "H", "hB" ], KZ: [ "H", "hB" ], MC: [ "H", "hB" ], MD: [ "H", "hB" ], MF: [ "H", "hB" ], MQ: [ "H", "hB" ], MZ: [ "H", "hB" ], NC: [ "H", "hB" ], NL: [ "H", "hB" ], PM: [ "H", "hB" ], PT: [ "H", "hB" ], RE: [ "H", "hB" ], RO: [ "H", "hB" ], SI: [ "H", "hB" ], SR: [ "H", "hB" ], ST: [ "H", "hB" ], TG: [ "H", "hB" ], TR: [ "H", "hB" ], WF: [ "H", "hB" ], YT: [ "H", "hB" ], BD: [ "h", "hB", "H" ], PK: [ "h", "hB", "H" ], AZ: [ "H", "hB", "h" ], BA: [ "H", "hB", "h" ], BG: [ "H", "hB", "h" ], CH: [ "H", "hB", "h" ], GE: [ "H", "hB", "h" ], LI: [ "H", "hB", "h" ], ME: [ "H", "hB", "h" ], RS: [ "H", "hB", "h" ], UA: [ "H", "hB", "h" ], UZ: [ "H", "hB", "h" ], XK: [ "H", "hB", "h" ], AG: [ "h", "hb", "H", "hB" ], AU: [ "h", "hb", "H", "hB" ], BB: [ "h", "hb", "H", "hB" ], BM: [ "h", "hb", "H", "hB" ], BS: [ "h", "hb", "H", "hB" ], CA: [ "h", "hb", "H", "hB" ], DM: [ "h", "hb", "H", "hB" ], "en-001": [ "h", "hb", "H", "hB" ], FJ: [ "h", "hb", "H", "hB" ], FM: [ "h", "hb", "H", "hB" ], GD: [ "h", "hb", "H", "hB" ], GM: [ "h", "hb", "H", "hB" ], GU: [ "h", "hb", "H", "hB" ], GY: [ "h", "hb", "H", "hB" ], JM: [ "h", "hb", "H", "hB" ], KI: [ "h", "hb", "H", "hB" ], KN: [ "h", "hb", "H", "hB" ], KY: [ "h", "hb", "H", "hB" ], LC: [ "h", "hb", "H", "hB" ], LR: [ "h", "hb", "H", "hB" ], MH: [ "h", "hb", "H", "hB" ], MP: [ "h", "hb", "H", "hB" ], MW: [ "h", "hb", "H", "hB" ], NZ: [ "h", "hb", "H", "hB" ], SB: [ "h", "hb", "H", "hB" ], SG: [ "h", "hb", "H", "hB" ], SL: [ "h", "hb", "H", "hB" ], SS: [ "h", "hb", "H", "hB" ], SZ: [ "h", "hb", "H", "hB" ], TC: [ "h", "hb", "H", "hB" ], TT: [ "h", "hb", "H", "hB" ], UM: [ "h", "hb", "H", "hB" ], US: [ "h", "hb", "H", "hB" ], VC: [ "h", "hb", "H", "hB" ], VG: [ "h", "hb", "H", "hB" ], VI: [ "h", "hb", "H", "hB" ], ZM: [ "h", "hb", "H", "hB" ], BO: [ "H", "hB", "h", "hb" ], EC: [ "H", "hB", "h", "hb" ], ES: [ "H", "hB", "h", "hb" ], GQ: [ "H", "hB", "h", "hb" ], PE: [ "H", "hB", "h", "hb" ], AE: [ "h", "hB", "hb", "H" ], "ar-001": [ "h", "hB", "hb", "H" ], BH: [ "h", "hB", "hb", "H" ], DZ: [ "h", "hB", "hb", "H" ], EG: [ "h", "hB", "hb", "H" ], EH: [ "h", "hB", "hb", "H" ], HK: [ "h", "hB", "hb", "H" ], IQ: [ "h", "hB", "hb", "H" ], JO: [ "h", "hB", "hb", "H" ], KW: [ "h", "hB", "hb", "H" ], LB: [ "h", "hB", "hb", "H" ], LY: [ "h", "hB", "hb", "H" ], MO: [ "h", "hB", "hb", "H" ], MR: [ "h", "hB", "hb", "H" ], OM: [ "h", "hB", "hb", "H" ], PH: [ "h", "hB", "hb", "H" ], PS: [ "h", "hB", "hb", "H" ], QA: [ "h", "hB", "hb", "H" ], SA: [ "h", "hB", "hb", "H" ], SD: [ "h", "hB", "hb", "H" ], SY: [ "h", "hB", "hb", "H" ], TN: [ "h", "hB", "hb", "H" ], YE: [ "h", "hB", "hb", "H" ], AF: [ "H", "hb", "hB", "h" ], LA: [ "H", "hb", "hB", "h" ], CN: [ "H", "hB", "hb", "h" ], LV: [ "H", "hB", "hb", "h" ], TL: [ "H", "hB", "hb", "h" ], "zu-ZA": [ "H", "hB", "hb", "h" ], CD: [ "hB", "H" ], IR: [ "hB", "H" ], "hi-IN": [ "hB", "h", "H" ], "kn-IN": [ "hB", "h", "H" ], "ml-IN": [ "hB", "h", "H" ], "te-IN": [ "hB", "h", "H" ], KH: [ "hB", "h", "H", "hb" ], "ta-IN": [ "hB", "h", "hb", "H" ], BN: [ "hb", "hB", "h", "H" ], MY: [ "hb", "hB", "h", "H" ], ET: [ "hB", "hb", "h", "H" ], "gu-IN": [ "hB", "hb", "h", "H" ], "mr-IN": [ "hB", "hb", "h", "H" ], "pa-IN": [ "hB", "hb", "h", "H" ], TW: [ "hB", "hb", "h", "H" ], KE: [ "hB", "hb", "H", "h" ], MM: [ "hB", "hb", "H", "h" ], TZ: [ "hB", "hb", "H", "h" ], UG: [ "hB", "hb", "H", "h" ] }; function getBestPattern(e, y) { for (var n = "", S = 0; S < e.length; S++) { var f = e.charAt(S); if (f === "j") { for (var t = 0; S + 1 < e.length && e.charAt(S + 1) === f; ) t++, S++; var F = 1 + (t & 1), N = t < 2 ? 1 : 3 + (t >> 1), I = "a", A = getDefaultHourSymbolFromLocale(y); for ((A == "H" || A == "k") && (N = 0); N-- > 0; ) n += I; for (; F-- > 0; ) n = A + n; } else f === "J" ? n += "H" : n += f; } return n; } function getDefaultHourSymbolFromLocale(e) { var y = e.hourCycle; if (y === void 0 && e.hourCycles && e.hourCycles.length && (y = e.hourCycles[0]), y) switch (y) { case "h24": return "k"; case "h23": return "H"; case "h12": return "h"; case "h11": return "K"; default: throw new Error("Invalid hourCycle"); } var n = e.language, S; n !== "root" && (S = e.maximize().region); var f = timeData[S || ""] || timeData[n || ""] || timeData["".concat(n, "-001")] || timeData["001"]; return f[0]; } var _a, SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*")), SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$")); function createLocation(e, y) { return { start: e, end: y }; } var hasNativeStartsWith = !!String.prototype.startsWith, hasNativeFromCodePoint = !!String.fromCodePoint, hasNativeFromEntries = !!Object.fromEntries, hasNativeCodePointAt = !!String.prototype.codePointAt, hasTrimStart = !!String.prototype.trimStart, hasTrimEnd = !!String.prototype.trimEnd, hasNativeIsSafeInteger = !!Number.isSafeInteger, isSafeInteger = hasNativeIsSafeInteger ? Number.isSafeInteger : function(e) { return typeof e == "number" && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991; }, REGEX_SUPPORTS_U_AND_Y = !0; try { var re = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec("a")) === null || _a === void 0 ? void 0 : _a[0]) === "a"; } catch { REGEX_SUPPORTS_U_AND_Y = !1; } var startsWith = hasNativeStartsWith ? function(y, n, S) { return y.startsWith(n, S); } : function(y, n, S) { return y.slice(S, S + n.length) === n; }, fromCodePoint = hasNativeFromCodePoint ? String.fromCodePoint : function() { for (var y = [], n = 0; n < arguments.length; n++) y[n] = arguments[n]; for (var S = "", f = y.length, t = 0, F; f > t; ) { if (F = y[t++], F > 1114111) throw RangeError(F + " is not a valid code point"); S += F < 65536 ? String.fromCharCode(F) : String.fromCharCode(((F -= 65536) >> 10) + 55296, F % 1024 + 56320); } return S; }, fromEntries = hasNativeFromEntries ? Object.fromEntries : function(y) { for (var n = {}, S = 0, f = y; S < f.length; S++) { var t = f[S], F = t[0], N = t[1]; n[F] = N; } return n; }, codePointAt = hasNativeCodePointAt ? function(y, n) { return y.codePointAt(n); } : function(y, n) { var S = y.length; if (!(n < 0 || n >= S)) { var f = y.charCodeAt(n), t; return f < 55296 || f > 56319 || n + 1 === S || (t = y.charCodeAt(n + 1)) < 56320 || t > 57343 ? f : (f - 55296 << 10) + (t - 56320) + 65536; } }, trimStart = hasTrimStart ? function(y) { return y.trimStart(); } : function(y) { return y.replace(SPACE_SEPARATOR_START_REGEX, ""); }, trimEnd = hasTrimEnd ? function(y) { return y.trimEnd(); } : function(y) { return y.replace(SPACE_SEPARATOR_END_REGEX, ""); }; function RE(e, y) { return new RegExp(e, y); } var matchIdentifierAtIndex; if (REGEX_SUPPORTS_U_AND_Y) { var IDENTIFIER_PREFIX_RE_1 = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); matchIdentifierAtIndex = function(y, n) { var S; IDENTIFIER_PREFIX_RE_1.lastIndex = n; var f = IDENTIFIER_PREFIX_RE_1.exec(y); return (S = f[1]) !== null && S !== void 0 ? S : ""; }; } else matchIdentifierAtIndex = function(y, n) { for (var S = []; ; ) { var f = codePointAt(y, n); if (f === void 0 || _isWhiteSpace(f) || _isPatternSyntax(f)) break;