sa-spell-checker 1.0.2 → 1.0.3

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.
@@ -3,215 +3,215 @@
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- const R = globalThis, W = R.ShadowRoot && (R.ShadyCSS === void 0 || R.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, nt = Symbol(), F = /* @__PURE__ */ new WeakMap();
7
- let dt = class {
8
- constructor(t, e, s) {
9
- if (this._$cssResult$ = !0, s !== nt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
10
- this.cssText = t, this.t = e;
6
+ const te = globalThis, ye = te.ShadowRoot && (te.ShadyCSS === void 0 || te.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Xe = Symbol(), Oe = /* @__PURE__ */ new WeakMap();
7
+ let ft = class {
8
+ constructor(e, t, s) {
9
+ if (this._$cssResult$ = !0, s !== Xe) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
10
+ this.cssText = e, this.t = t;
11
11
  }
12
12
  get styleSheet() {
13
- let t = this.o;
14
- const e = this.t;
15
- if (W && t === void 0) {
16
- const s = e !== void 0 && e.length === 1;
17
- s && (t = F.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && F.set(e, t));
13
+ let e = this.o;
14
+ const t = this.t;
15
+ if (ye && e === void 0) {
16
+ const s = t !== void 0 && t.length === 1;
17
+ s && (e = Oe.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && Oe.set(t, e));
18
18
  }
19
- return t;
19
+ return e;
20
20
  }
21
21
  toString() {
22
22
  return this.cssText;
23
23
  }
24
24
  };
25
- const ht = (r) => new dt(typeof r == "string" ? r : r + "", void 0, nt), ut = (r, t) => {
26
- if (W) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
27
- else for (const e of t) {
28
- const s = document.createElement("style"), i = R.litNonce;
29
- i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
30
- }
31
- }, K = W ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
32
- let e = "";
33
- for (const s of t.cssRules) e += s.cssText;
34
- return ht(e);
25
+ const Ze = (r) => new ft(typeof r == "string" ? r : r + "", void 0, Xe), gt = (r, e) => {
26
+ if (ye) r.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
27
+ else for (const t of e) {
28
+ const s = document.createElement("style"), i = te.litNonce;
29
+ i !== void 0 && s.setAttribute("nonce", i), s.textContent = t.cssText, r.appendChild(s);
30
+ }
31
+ }, Se = ye ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((e) => {
32
+ let t = "";
33
+ for (const s of e.cssRules) t += s.cssText;
34
+ return Ze(t);
35
35
  })(r) : r;
36
36
  /**
37
37
  * @license
38
38
  * Copyright 2017 Google LLC
39
39
  * SPDX-License-Identifier: BSD-3-Clause
40
40
  */
41
- const { is: $t, defineProperty: ft, getOwnPropertyDescriptor: _t, getOwnPropertyNames: gt, getOwnPropertySymbols: At, getPrototypeOf: mt } = Object, g = globalThis, Z = g.trustedTypes, yt = Z ? Z.emptyScript : "", j = g.reactiveElementPolyfillSupport, P = (r, t) => r, z = { toAttribute(r, t) {
42
- switch (t) {
41
+ const { is: vt, defineProperty: $t, getOwnPropertyDescriptor: _t, getOwnPropertyNames: mt, getOwnPropertySymbols: yt, getPrototypeOf: bt } = Object, T = globalThis, Re = T.trustedTypes, At = Re ? Re.emptyScript : "", ce = T.reactiveElementPolyfillSupport, G = (r, e) => r, se = { toAttribute(r, e) {
42
+ switch (e) {
43
43
  case Boolean:
44
- r = r ? yt : null;
44
+ r = r ? At : null;
45
45
  break;
46
46
  case Object:
47
47
  case Array:
48
48
  r = r == null ? r : JSON.stringify(r);
49
49
  }
50
50
  return r;
51
- }, fromAttribute(r, t) {
52
- let e = r;
53
- switch (t) {
51
+ }, fromAttribute(r, e) {
52
+ let t = r;
53
+ switch (e) {
54
54
  case Boolean:
55
- e = r !== null;
55
+ t = r !== null;
56
56
  break;
57
57
  case Number:
58
- e = r === null ? null : Number(r);
58
+ t = r === null ? null : Number(r);
59
59
  break;
60
60
  case Object:
61
61
  case Array:
62
62
  try {
63
- e = JSON.parse(r);
63
+ t = JSON.parse(r);
64
64
  } catch {
65
- e = null;
65
+ t = null;
66
66
  }
67
67
  }
68
- return e;
69
- } }, V = (r, t) => !$t(r, t), J = { attribute: !0, type: String, converter: z, reflect: !1, useDefault: !1, hasChanged: V };
70
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), g.litPropertyMetadata ?? (g.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
71
- let E = class extends HTMLElement {
72
- static addInitializer(t) {
73
- this._$Ei(), (this.l ?? (this.l = [])).push(t);
68
+ return t;
69
+ } }, be = (r, e) => !vt(r, e), Ne = { attribute: !0, type: String, converter: se, reflect: !1, useDefault: !1, hasChanged: be };
70
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), T.litPropertyMetadata ?? (T.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
71
+ let j = class extends HTMLElement {
72
+ static addInitializer(e) {
73
+ this._$Ei(), (this.l ?? (this.l = [])).push(e);
74
74
  }
75
75
  static get observedAttributes() {
76
76
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
77
77
  }
78
- static createProperty(t, e = J) {
79
- if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
80
- const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
81
- i !== void 0 && ft(this.prototype, t, i);
78
+ static createProperty(e, t = Ne) {
79
+ if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
80
+ const s = Symbol(), i = this.getPropertyDescriptor(e, s, t);
81
+ i !== void 0 && $t(this.prototype, e, i);
82
82
  }
83
83
  }
84
- static getPropertyDescriptor(t, e, s) {
85
- const { get: i, set: o } = _t(this.prototype, t) ?? { get() {
86
- return this[e];
87
- }, set(n) {
88
- this[e] = n;
84
+ static getPropertyDescriptor(e, t, s) {
85
+ const { get: i, set: n } = _t(this.prototype, e) ?? { get() {
86
+ return this[t];
87
+ }, set(o) {
88
+ this[t] = o;
89
89
  } };
90
- return { get: i, set(n) {
91
- const l = i == null ? void 0 : i.call(this);
92
- o == null || o.call(this, n), this.requestUpdate(t, l, s);
90
+ return { get: i, set(o) {
91
+ const h = i == null ? void 0 : i.call(this);
92
+ n == null || n.call(this, o), this.requestUpdate(e, h, s);
93
93
  }, configurable: !0, enumerable: !0 };
94
94
  }
95
- static getPropertyOptions(t) {
96
- return this.elementProperties.get(t) ?? J;
95
+ static getPropertyOptions(e) {
96
+ return this.elementProperties.get(e) ?? Ne;
97
97
  }
98
98
  static _$Ei() {
99
- if (this.hasOwnProperty(P("elementProperties"))) return;
100
- const t = mt(this);
101
- t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
99
+ if (this.hasOwnProperty(G("elementProperties"))) return;
100
+ const e = bt(this);
101
+ e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
102
102
  }
103
103
  static finalize() {
104
- if (this.hasOwnProperty(P("finalized"))) return;
105
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(P("properties"))) {
106
- const e = this.properties, s = [...gt(e), ...At(e)];
107
- for (const i of s) this.createProperty(i, e[i]);
104
+ if (this.hasOwnProperty(G("finalized"))) return;
105
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(G("properties"))) {
106
+ const t = this.properties, s = [...mt(t), ...yt(t)];
107
+ for (const i of s) this.createProperty(i, t[i]);
108
108
  }
109
- const t = this[Symbol.metadata];
110
- if (t !== null) {
111
- const e = litPropertyMetadata.get(t);
112
- if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
109
+ const e = this[Symbol.metadata];
110
+ if (e !== null) {
111
+ const t = litPropertyMetadata.get(e);
112
+ if (t !== void 0) for (const [s, i] of t) this.elementProperties.set(s, i);
113
113
  }
114
114
  this._$Eh = /* @__PURE__ */ new Map();
115
- for (const [e, s] of this.elementProperties) {
116
- const i = this._$Eu(e, s);
117
- i !== void 0 && this._$Eh.set(i, e);
115
+ for (const [t, s] of this.elementProperties) {
116
+ const i = this._$Eu(t, s);
117
+ i !== void 0 && this._$Eh.set(i, t);
118
118
  }
119
119
  this.elementStyles = this.finalizeStyles(this.styles);
120
120
  }
121
- static finalizeStyles(t) {
122
- const e = [];
123
- if (Array.isArray(t)) {
124
- const s = new Set(t.flat(1 / 0).reverse());
125
- for (const i of s) e.unshift(K(i));
126
- } else t !== void 0 && e.push(K(t));
127
- return e;
121
+ static finalizeStyles(e) {
122
+ const t = [];
123
+ if (Array.isArray(e)) {
124
+ const s = new Set(e.flat(1 / 0).reverse());
125
+ for (const i of s) t.unshift(Se(i));
126
+ } else e !== void 0 && t.push(Se(e));
127
+ return t;
128
128
  }
129
- static _$Eu(t, e) {
130
- const s = e.attribute;
131
- return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
129
+ static _$Eu(e, t) {
130
+ const s = t.attribute;
131
+ return s === !1 ? void 0 : typeof s == "string" ? s : typeof e == "string" ? e.toLowerCase() : void 0;
132
132
  }
133
133
  constructor() {
134
134
  super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
135
135
  }
136
136
  _$Ev() {
137
- var t;
138
- this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
139
- }
140
- addController(t) {
141
137
  var e;
142
- (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
138
+ this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (e = this.constructor.l) == null || e.forEach((t) => t(this));
143
139
  }
144
- removeController(t) {
145
- var e;
146
- (e = this._$EO) == null || e.delete(t);
140
+ addController(e) {
141
+ var t;
142
+ (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(e), this.renderRoot !== void 0 && this.isConnected && ((t = e.hostConnected) == null || t.call(e));
143
+ }
144
+ removeController(e) {
145
+ var t;
146
+ (t = this._$EO) == null || t.delete(e);
147
147
  }
148
148
  _$E_() {
149
- const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
150
- for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
151
- t.size > 0 && (this._$Ep = t);
149
+ const e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties;
150
+ for (const s of t.keys()) this.hasOwnProperty(s) && (e.set(s, this[s]), delete this[s]);
151
+ e.size > 0 && (this._$Ep = e);
152
152
  }
153
153
  createRenderRoot() {
154
- const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
155
- return ut(t, this.constructor.elementStyles), t;
154
+ const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
155
+ return gt(e, this.constructor.elementStyles), e;
156
156
  }
157
157
  connectedCallback() {
158
- var t;
159
- this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
158
+ var e;
159
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (e = this._$EO) == null || e.forEach((t) => {
160
160
  var s;
161
- return (s = e.hostConnected) == null ? void 0 : s.call(e);
161
+ return (s = t.hostConnected) == null ? void 0 : s.call(t);
162
162
  });
163
163
  }
164
- enableUpdating(t) {
164
+ enableUpdating(e) {
165
165
  }
166
166
  disconnectedCallback() {
167
- var t;
168
- (t = this._$EO) == null || t.forEach((e) => {
167
+ var e;
168
+ (e = this._$EO) == null || e.forEach((t) => {
169
169
  var s;
170
- return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
170
+ return (s = t.hostDisconnected) == null ? void 0 : s.call(t);
171
171
  });
172
172
  }
173
- attributeChangedCallback(t, e, s) {
174
- this._$AK(t, s);
173
+ attributeChangedCallback(e, t, s) {
174
+ this._$AK(e, s);
175
175
  }
176
- _$ET(t, e) {
177
- var o;
178
- const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
176
+ _$ET(e, t) {
177
+ var n;
178
+ const s = this.constructor.elementProperties.get(e), i = this.constructor._$Eu(e, s);
179
179
  if (i !== void 0 && s.reflect === !0) {
180
- const n = (((o = s.converter) == null ? void 0 : o.toAttribute) !== void 0 ? s.converter : z).toAttribute(e, s.type);
181
- this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
180
+ const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : se).toAttribute(t, s.type);
181
+ this._$Em = e, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
182
182
  }
183
183
  }
184
- _$AK(t, e) {
185
- var o, n;
186
- const s = this.constructor, i = s._$Eh.get(t);
184
+ _$AK(e, t) {
185
+ var n, o;
186
+ const s = this.constructor, i = s._$Eh.get(e);
187
187
  if (i !== void 0 && this._$Em !== i) {
188
- const l = s.getPropertyOptions(i), h = typeof l.converter == "function" ? { fromAttribute: l.converter } : ((o = l.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? l.converter : z;
188
+ const h = s.getPropertyOptions(i), a = typeof h.converter == "function" ? { fromAttribute: h.converter } : ((n = h.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? h.converter : se;
189
189
  this._$Em = i;
190
- const c = h.fromAttribute(e, l.type);
191
- this[i] = c ?? ((n = this._$Ej) == null ? void 0 : n.get(i)) ?? c, this._$Em = null;
190
+ const d = a.fromAttribute(t, h.type);
191
+ this[i] = d ?? ((o = this._$Ej) == null ? void 0 : o.get(i)) ?? d, this._$Em = null;
192
192
  }
193
193
  }
194
- requestUpdate(t, e, s, i = !1, o) {
195
- var n;
196
- if (t !== void 0) {
197
- const l = this.constructor;
198
- if (i === !1 && (o = this[t]), s ?? (s = l.getPropertyOptions(t)), !((s.hasChanged ?? V)(o, e) || s.useDefault && s.reflect && o === ((n = this._$Ej) == null ? void 0 : n.get(t)) && !this.hasAttribute(l._$Eu(t, s)))) return;
199
- this.C(t, e, s);
194
+ requestUpdate(e, t, s, i = !1, n) {
195
+ var o;
196
+ if (e !== void 0) {
197
+ const h = this.constructor;
198
+ if (i === !1 && (n = this[e]), s ?? (s = h.getPropertyOptions(e)), !((s.hasChanged ?? be)(n, t) || s.useDefault && s.reflect && n === ((o = this._$Ej) == null ? void 0 : o.get(e)) && !this.hasAttribute(h._$Eu(e, s)))) return;
199
+ this.C(e, t, s);
200
200
  }
201
201
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
202
202
  }
203
- C(t, e, { useDefault: s, reflect: i, wrapped: o }, n) {
204
- s && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t));
203
+ C(e, t, { useDefault: s, reflect: i, wrapped: n }, o) {
204
+ s && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(e) && (this._$Ej.set(e, o ?? t ?? this[e]), n !== !0 || o !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (t = void 0), this._$AL.set(e, t)), i === !0 && this._$Em !== e && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(e));
205
205
  }
206
206
  async _$EP() {
207
207
  this.isUpdatePending = !0;
208
208
  try {
209
209
  await this._$ES;
210
- } catch (e) {
211
- Promise.reject(e);
210
+ } catch (t) {
211
+ Promise.reject(t);
212
212
  }
213
- const t = this.scheduleUpdate();
214
- return t != null && await t, !this.isUpdatePending;
213
+ const e = this.scheduleUpdate();
214
+ return e != null && await e, !this.isUpdatePending;
215
215
  }
216
216
  scheduleUpdate() {
217
217
  return this.performUpdate();
@@ -221,35 +221,35 @@ let E = class extends HTMLElement {
221
221
  if (!this.isUpdatePending) return;
222
222
  if (!this.hasUpdated) {
223
223
  if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
224
- for (const [o, n] of this._$Ep) this[o] = n;
224
+ for (const [n, o] of this._$Ep) this[n] = o;
225
225
  this._$Ep = void 0;
226
226
  }
227
227
  const i = this.constructor.elementProperties;
228
- if (i.size > 0) for (const [o, n] of i) {
229
- const { wrapped: l } = n, h = this[o];
230
- l !== !0 || this._$AL.has(o) || h === void 0 || this.C(o, void 0, n, h);
228
+ if (i.size > 0) for (const [n, o] of i) {
229
+ const { wrapped: h } = o, a = this[n];
230
+ h !== !0 || this._$AL.has(n) || a === void 0 || this.C(n, void 0, o, a);
231
231
  }
232
232
  }
233
- let t = !1;
234
- const e = this._$AL;
233
+ let e = !1;
234
+ const t = this._$AL;
235
235
  try {
236
- t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => {
237
- var o;
238
- return (o = i.hostUpdate) == null ? void 0 : o.call(i);
239
- }), this.update(e)) : this._$EM();
236
+ e = this.shouldUpdate(t), e ? (this.willUpdate(t), (s = this._$EO) == null || s.forEach((i) => {
237
+ var n;
238
+ return (n = i.hostUpdate) == null ? void 0 : n.call(i);
239
+ }), this.update(t)) : this._$EM();
240
240
  } catch (i) {
241
- throw t = !1, this._$EM(), i;
241
+ throw e = !1, this._$EM(), i;
242
242
  }
243
- t && this._$AE(e);
243
+ e && this._$AE(t);
244
244
  }
245
- willUpdate(t) {
245
+ willUpdate(e) {
246
246
  }
247
- _$AE(t) {
248
- var e;
249
- (e = this._$EO) == null || e.forEach((s) => {
247
+ _$AE(e) {
248
+ var t;
249
+ (t = this._$EO) == null || t.forEach((s) => {
250
250
  var i;
251
251
  return (i = s.hostUpdated) == null ? void 0 : i.call(s);
252
- }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
252
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
253
253
  }
254
254
  _$EM() {
255
255
  this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
@@ -260,89 +260,89 @@ let E = class extends HTMLElement {
260
260
  getUpdateComplete() {
261
261
  return this._$ES;
262
262
  }
263
- shouldUpdate(t) {
263
+ shouldUpdate(e) {
264
264
  return !0;
265
265
  }
266
- update(t) {
267
- this._$Eq && (this._$Eq = this._$Eq.forEach((e) => this._$ET(e, this[e]))), this._$EM();
266
+ update(e) {
267
+ this._$Eq && (this._$Eq = this._$Eq.forEach((t) => this._$ET(t, this[t]))), this._$EM();
268
268
  }
269
- updated(t) {
269
+ updated(e) {
270
270
  }
271
- firstUpdated(t) {
271
+ firstUpdated(e) {
272
272
  }
273
273
  };
274
- E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[P("elementProperties")] = /* @__PURE__ */ new Map(), E[P("finalized")] = /* @__PURE__ */ new Map(), j == null || j({ ReactiveElement: E }), (g.reactiveElementVersions ?? (g.reactiveElementVersions = [])).push("2.1.2");
274
+ j.elementStyles = [], j.shadowRootOptions = { mode: "open" }, j[G("elementProperties")] = /* @__PURE__ */ new Map(), j[G("finalized")] = /* @__PURE__ */ new Map(), ce == null || ce({ ReactiveElement: j }), (T.reactiveElementVersions ?? (T.reactiveElementVersions = [])).push("2.1.2");
275
275
  /**
276
276
  * @license
277
277
  * Copyright 2017 Google LLC
278
278
  * SPDX-License-Identifier: BSD-3-Clause
279
279
  */
280
- const O = globalThis, Q = (r) => r, L = O.trustedTypes, X = L ? L.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, lt = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, at = "?" + _, vt = `<${at}>`, v = document, k = () => v.createComment(""), M = (r) => r === null || typeof r != "object" && typeof r != "function", G = Array.isArray, bt = (r) => G(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", I = `[
281
- \f\r]`, C = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Y = /-->/g, tt = />/g, A = RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^
282
- \f\r"'\`<>=]|("|')|))|$)`, "g"), et = /'/g, st = /"/g, ct = /^(?:script|style|textarea|title)$/i, Et = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), it = Et(1), S = Symbol.for("lit-noChange"), p = Symbol.for("lit-nothing"), rt = /* @__PURE__ */ new WeakMap(), m = v.createTreeWalker(v, 129);
283
- function pt(r, t) {
284
- if (!G(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
285
- return X !== void 0 ? X.createHTML(t) : t;
286
- }
287
- const St = (r, t) => {
288
- const e = r.length - 1, s = [];
289
- let i, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = C;
290
- for (let l = 0; l < e; l++) {
291
- const h = r[l];
292
- let c, d, a = -1, u = 0;
293
- for (; u < h.length && (n.lastIndex = u, d = n.exec(h), d !== null); ) u = n.lastIndex, n === C ? d[1] === "!--" ? n = Y : d[1] !== void 0 ? n = tt : d[2] !== void 0 ? (ct.test(d[2]) && (i = RegExp("</" + d[2], "g")), n = A) : d[3] !== void 0 && (n = A) : n === A ? d[0] === ">" ? (n = i ?? C, a = -1) : d[1] === void 0 ? a = -2 : (a = n.lastIndex - d[2].length, c = d[1], n = d[3] === void 0 ? A : d[3] === '"' ? st : et) : n === st || n === et ? n = A : n === Y || n === tt ? n = C : (n = A, i = void 0);
294
- const f = n === A && r[l + 1].startsWith("/>") ? " " : "";
295
- o += n === C ? h + vt : a >= 0 ? (s.push(c), h.slice(0, a) + lt + h.slice(a) + _ + f) : h + _ + (a === -2 ? l : f);
296
- }
297
- return [pt(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
280
+ const Y = globalThis, Ue = (r) => r, ie = Y.trustedTypes, Pe = ie ? ie.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Je = "$lit$", P = `lit$${Math.random().toFixed(9).slice(2)}$`, Qe = "?" + P, wt = `<${Qe}>`, I = document, V = () => I.createComment(""), X = (r) => r === null || typeof r != "object" && typeof r != "function", Ae = Array.isArray, Et = (r) => Ae(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", de = `[
281
+ \f\r]`, W = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Te = /-->/g, Me = />/g, D = RegExp(`>|${de}(?:([^\\s"'>=/]+)(${de}*=${de}*(?:[^
282
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), ke = /'/g, De = /"/g, et = /^(?:script|style|textarea|title)$/i, Ct = (r) => (e, ...t) => ({ _$litType$: r, strings: e, values: t }), pe = Ct(1), M = Symbol.for("lit-noChange"), $ = Symbol.for("lit-nothing"), Le = /* @__PURE__ */ new WeakMap(), L = I.createTreeWalker(I, 129);
283
+ function tt(r, e) {
284
+ if (!Ae(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
285
+ return Pe !== void 0 ? Pe.createHTML(e) : e;
286
+ }
287
+ const xt = (r, e) => {
288
+ const t = r.length - 1, s = [];
289
+ let i, n = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o = W;
290
+ for (let h = 0; h < t; h++) {
291
+ const a = r[h];
292
+ let d, l, c = -1, u = 0;
293
+ for (; u < a.length && (o.lastIndex = u, l = o.exec(a), l !== null); ) u = o.lastIndex, o === W ? l[1] === "!--" ? o = Te : l[1] !== void 0 ? o = Me : l[2] !== void 0 ? (et.test(l[2]) && (i = RegExp("</" + l[2], "g")), o = D) : l[3] !== void 0 && (o = D) : o === D ? l[0] === ">" ? (o = i ?? W, c = -1) : l[1] === void 0 ? c = -2 : (c = o.lastIndex - l[2].length, d = l[1], o = l[3] === void 0 ? D : l[3] === '"' ? De : ke) : o === De || o === ke ? o = D : o === Te || o === Me ? o = W : (o = D, i = void 0);
294
+ const p = o === D && r[h + 1].startsWith("/>") ? " " : "";
295
+ n += o === W ? a + wt : c >= 0 ? (s.push(d), a.slice(0, c) + Je + a.slice(c) + P + p) : a + P + (c === -2 ? h : p);
296
+ }
297
+ return [tt(r, n + (r[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
298
298
  };
299
- class N {
300
- constructor({ strings: t, _$litType$: e }, s) {
299
+ class Z {
300
+ constructor({ strings: e, _$litType$: t }, s) {
301
301
  let i;
302
302
  this.parts = [];
303
- let o = 0, n = 0;
304
- const l = t.length - 1, h = this.parts, [c, d] = St(t, e);
305
- if (this.el = N.createElement(c, s), m.currentNode = this.el.content, e === 2 || e === 3) {
306
- const a = this.el.content.firstChild;
307
- a.replaceWith(...a.childNodes);
303
+ let n = 0, o = 0;
304
+ const h = e.length - 1, a = this.parts, [d, l] = xt(e, t);
305
+ if (this.el = Z.createElement(d, s), L.currentNode = this.el.content, t === 2 || t === 3) {
306
+ const c = this.el.content.firstChild;
307
+ c.replaceWith(...c.childNodes);
308
308
  }
309
- for (; (i = m.nextNode()) !== null && h.length < l; ) {
309
+ for (; (i = L.nextNode()) !== null && a.length < h; ) {
310
310
  if (i.nodeType === 1) {
311
- if (i.hasAttributes()) for (const a of i.getAttributeNames()) if (a.endsWith(lt)) {
312
- const u = d[n++], f = i.getAttribute(a).split(_), H = /([.?@])?(.*)/.exec(u);
313
- h.push({ type: 1, index: o, name: H[2], strings: f, ctor: H[1] === "." ? xt : H[1] === "?" ? Ct : H[1] === "@" ? Pt : D }), i.removeAttribute(a);
314
- } else a.startsWith(_) && (h.push({ type: 6, index: o }), i.removeAttribute(a));
315
- if (ct.test(i.tagName)) {
316
- const a = i.textContent.split(_), u = a.length - 1;
311
+ if (i.hasAttributes()) for (const c of i.getAttributeNames()) if (c.endsWith(Je)) {
312
+ const u = l[o++], p = i.getAttribute(c).split(P), f = /([.?@])?(.*)/.exec(u);
313
+ a.push({ type: 1, index: n, name: f[2], strings: p, ctor: f[1] === "." ? St : f[1] === "?" ? Rt : f[1] === "@" ? Nt : oe }), i.removeAttribute(c);
314
+ } else c.startsWith(P) && (a.push({ type: 6, index: n }), i.removeAttribute(c));
315
+ if (et.test(i.tagName)) {
316
+ const c = i.textContent.split(P), u = c.length - 1;
317
317
  if (u > 0) {
318
- i.textContent = L ? L.emptyScript : "";
319
- for (let f = 0; f < u; f++) i.append(a[f], k()), m.nextNode(), h.push({ type: 2, index: ++o });
320
- i.append(a[u], k());
318
+ i.textContent = ie ? ie.emptyScript : "";
319
+ for (let p = 0; p < u; p++) i.append(c[p], V()), L.nextNode(), a.push({ type: 2, index: ++n });
320
+ i.append(c[u], V());
321
321
  }
322
322
  }
323
- } else if (i.nodeType === 8) if (i.data === at) h.push({ type: 2, index: o });
323
+ } else if (i.nodeType === 8) if (i.data === Qe) a.push({ type: 2, index: n });
324
324
  else {
325
- let a = -1;
326
- for (; (a = i.data.indexOf(_, a + 1)) !== -1; ) h.push({ type: 7, index: o }), a += _.length - 1;
325
+ let c = -1;
326
+ for (; (c = i.data.indexOf(P, c + 1)) !== -1; ) a.push({ type: 7, index: n }), c += P.length - 1;
327
327
  }
328
- o++;
328
+ n++;
329
329
  }
330
330
  }
331
- static createElement(t, e) {
332
- const s = v.createElement("template");
333
- return s.innerHTML = t, s;
331
+ static createElement(e, t) {
332
+ const s = I.createElement("template");
333
+ return s.innerHTML = e, s;
334
334
  }
335
335
  }
336
- function w(r, t, e = r, s) {
337
- var n, l;
338
- if (t === S) return t;
339
- let i = s !== void 0 ? (n = e._$Co) == null ? void 0 : n[s] : e._$Cl;
340
- const o = M(t) ? void 0 : t._$litDirective$;
341
- return (i == null ? void 0 : i.constructor) !== o && ((l = i == null ? void 0 : i._$AO) == null || l.call(i, !1), o === void 0 ? i = void 0 : (i = new o(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = w(r, i._$AS(r, t.values), i, s)), t;
336
+ function B(r, e, t = r, s) {
337
+ var o, h;
338
+ if (e === M) return e;
339
+ let i = s !== void 0 ? (o = t._$Co) == null ? void 0 : o[s] : t._$Cl;
340
+ const n = X(e) ? void 0 : e._$litDirective$;
341
+ return (i == null ? void 0 : i.constructor) !== n && ((h = i == null ? void 0 : i._$AO) == null || h.call(i, !1), n === void 0 ? i = void 0 : (i = new n(r), i._$AT(r, t, s)), s !== void 0 ? (t._$Co ?? (t._$Co = []))[s] = i : t._$Cl = i), i !== void 0 && (e = B(r, i._$AS(r, e.values), i, s)), e;
342
342
  }
343
- class wt {
344
- constructor(t, e) {
345
- this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
343
+ class Ot {
344
+ constructor(e, t) {
345
+ this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
346
346
  }
347
347
  get parentNode() {
348
348
  return this._$AM.parentNode;
@@ -350,36 +350,36 @@ class wt {
350
350
  get _$AU() {
351
351
  return this._$AM._$AU;
352
352
  }
353
- u(t) {
354
- const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? v).importNode(e, !0);
355
- m.currentNode = i;
356
- let o = m.nextNode(), n = 0, l = 0, h = s[0];
357
- for (; h !== void 0; ) {
358
- if (n === h.index) {
359
- let c;
360
- h.type === 2 ? c = new T(o, o.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(o, h.name, h.strings, this, t) : h.type === 6 && (c = new Ot(o, this, t)), this._$AV.push(c), h = s[++l];
353
+ u(e) {
354
+ const { el: { content: t }, parts: s } = this._$AD, i = ((e == null ? void 0 : e.creationScope) ?? I).importNode(t, !0);
355
+ L.currentNode = i;
356
+ let n = L.nextNode(), o = 0, h = 0, a = s[0];
357
+ for (; a !== void 0; ) {
358
+ if (o === a.index) {
359
+ let d;
360
+ a.type === 2 ? d = new J(n, n.nextSibling, this, e) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, e) : a.type === 6 && (d = new Ut(n, this, e)), this._$AV.push(d), a = s[++h];
361
361
  }
362
- n !== (h == null ? void 0 : h.index) && (o = m.nextNode(), n++);
362
+ o !== (a == null ? void 0 : a.index) && (n = L.nextNode(), o++);
363
363
  }
364
- return m.currentNode = v, i;
364
+ return L.currentNode = I, i;
365
365
  }
366
- p(t) {
367
- let e = 0;
368
- for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
366
+ p(e) {
367
+ let t = 0;
368
+ for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, t), t += s.strings.length - 2) : s._$AI(e[t])), t++;
369
369
  }
370
370
  }
371
- class T {
371
+ class J {
372
372
  get _$AU() {
373
- var t;
374
- return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
373
+ var e;
374
+ return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
375
375
  }
376
- constructor(t, e, s, i) {
377
- this.type = 2, this._$AH = p, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
376
+ constructor(e, t, s, i) {
377
+ this.type = 2, this._$AH = $, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
378
378
  }
379
379
  get parentNode() {
380
- let t = this._$AA.parentNode;
381
- const e = this._$AM;
382
- return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
380
+ let e = this._$AA.parentNode;
381
+ const t = this._$AM;
382
+ return t !== void 0 && (e == null ? void 0 : e.nodeType) === 11 && (e = t.parentNode), e;
383
383
  }
384
384
  get startNode() {
385
385
  return this._$AA;
@@ -387,124 +387,124 @@ class T {
387
387
  get endNode() {
388
388
  return this._$AB;
389
389
  }
390
- _$AI(t, e = this) {
391
- t = w(this, t, e), M(t) ? t === p || t == null || t === "" ? (this._$AH !== p && this._$AR(), this._$AH = p) : t !== this._$AH && t !== S && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : bt(t) ? this.k(t) : this._(t);
390
+ _$AI(e, t = this) {
391
+ e = B(this, e, t), X(e) ? e === $ || e == null || e === "" ? (this._$AH !== $ && this._$AR(), this._$AH = $) : e !== this._$AH && e !== M && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Et(e) ? this.k(e) : this._(e);
392
392
  }
393
- O(t) {
394
- return this._$AA.parentNode.insertBefore(t, this._$AB);
393
+ O(e) {
394
+ return this._$AA.parentNode.insertBefore(e, this._$AB);
395
395
  }
396
- T(t) {
397
- this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
396
+ T(e) {
397
+ this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
398
398
  }
399
- _(t) {
400
- this._$AH !== p && M(this._$AH) ? this._$AA.nextSibling.data = t : this.T(v.createTextNode(t)), this._$AH = t;
399
+ _(e) {
400
+ this._$AH !== $ && X(this._$AH) ? this._$AA.nextSibling.data = e : this.T(I.createTextNode(e)), this._$AH = e;
401
401
  }
402
- $(t) {
403
- var o;
404
- const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = N.createElement(pt(s.h, s.h[0]), this.options)), s);
405
- if (((o = this._$AH) == null ? void 0 : o._$AD) === i) this._$AH.p(e);
402
+ $(e) {
403
+ var n;
404
+ const { values: t, _$litType$: s } = e, i = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = Z.createElement(tt(s.h, s.h[0]), this.options)), s);
405
+ if (((n = this._$AH) == null ? void 0 : n._$AD) === i) this._$AH.p(t);
406
406
  else {
407
- const n = new wt(i, this), l = n.u(this.options);
408
- n.p(e), this.T(l), this._$AH = n;
407
+ const o = new Ot(i, this), h = o.u(this.options);
408
+ o.p(t), this.T(h), this._$AH = o;
409
409
  }
410
410
  }
411
- _$AC(t) {
412
- let e = rt.get(t.strings);
413
- return e === void 0 && rt.set(t.strings, e = new N(t)), e;
411
+ _$AC(e) {
412
+ let t = Le.get(e.strings);
413
+ return t === void 0 && Le.set(e.strings, t = new Z(e)), t;
414
414
  }
415
- k(t) {
416
- G(this._$AH) || (this._$AH = [], this._$AR());
417
- const e = this._$AH;
415
+ k(e) {
416
+ Ae(this._$AH) || (this._$AH = [], this._$AR());
417
+ const t = this._$AH;
418
418
  let s, i = 0;
419
- for (const o of t) i === e.length ? e.push(s = new T(this.O(k()), this.O(k()), this, this.options)) : s = e[i], s._$AI(o), i++;
420
- i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
419
+ for (const n of e) i === t.length ? t.push(s = new J(this.O(V()), this.O(V()), this, this.options)) : s = t[i], s._$AI(n), i++;
420
+ i < t.length && (this._$AR(s && s._$AB.nextSibling, i), t.length = i);
421
421
  }
422
- _$AR(t = this._$AA.nextSibling, e) {
422
+ _$AR(e = this._$AA.nextSibling, t) {
423
423
  var s;
424
- for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t !== this._$AB; ) {
425
- const i = Q(t).nextSibling;
426
- Q(t).remove(), t = i;
424
+ for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, t); e !== this._$AB; ) {
425
+ const i = Ue(e).nextSibling;
426
+ Ue(e).remove(), e = i;
427
427
  }
428
428
  }
429
- setConnected(t) {
430
- var e;
431
- this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
429
+ setConnected(e) {
430
+ var t;
431
+ this._$AM === void 0 && (this._$Cv = e, (t = this._$AP) == null || t.call(this, e));
432
432
  }
433
433
  }
434
- class D {
434
+ class oe {
435
435
  get tagName() {
436
436
  return this.element.tagName;
437
437
  }
438
438
  get _$AU() {
439
439
  return this._$AM._$AU;
440
440
  }
441
- constructor(t, e, s, i, o) {
442
- this.type = 1, this._$AH = p, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = p;
441
+ constructor(e, t, s, i, n) {
442
+ this.type = 1, this._$AH = $, this._$AN = void 0, this.element = e, this.name = t, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = $;
443
443
  }
444
- _$AI(t, e = this, s, i) {
445
- const o = this.strings;
446
- let n = !1;
447
- if (o === void 0) t = w(this, t, e, 0), n = !M(t) || t !== this._$AH && t !== S, n && (this._$AH = t);
444
+ _$AI(e, t = this, s, i) {
445
+ const n = this.strings;
446
+ let o = !1;
447
+ if (n === void 0) e = B(this, e, t, 0), o = !X(e) || e !== this._$AH && e !== M, o && (this._$AH = e);
448
448
  else {
449
- const l = t;
450
- let h, c;
451
- for (t = o[0], h = 0; h < o.length - 1; h++) c = w(this, l[s + h], e, h), c === S && (c = this._$AH[h]), n || (n = !M(c) || c !== this._$AH[h]), c === p ? t = p : t !== p && (t += (c ?? "") + o[h + 1]), this._$AH[h] = c;
449
+ const h = e;
450
+ let a, d;
451
+ for (e = n[0], a = 0; a < n.length - 1; a++) d = B(this, h[s + a], t, a), d === M && (d = this._$AH[a]), o || (o = !X(d) || d !== this._$AH[a]), d === $ ? e = $ : e !== $ && (e += (d ?? "") + n[a + 1]), this._$AH[a] = d;
452
452
  }
453
- n && !i && this.j(t);
453
+ o && !i && this.j(e);
454
454
  }
455
- j(t) {
456
- t === p ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
455
+ j(e) {
456
+ e === $ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
457
457
  }
458
458
  }
459
- class xt extends D {
459
+ class St extends oe {
460
460
  constructor() {
461
461
  super(...arguments), this.type = 3;
462
462
  }
463
- j(t) {
464
- this.element[this.name] = t === p ? void 0 : t;
463
+ j(e) {
464
+ this.element[this.name] = e === $ ? void 0 : e;
465
465
  }
466
466
  }
467
- class Ct extends D {
467
+ class Rt extends oe {
468
468
  constructor() {
469
469
  super(...arguments), this.type = 4;
470
470
  }
471
- j(t) {
472
- this.element.toggleAttribute(this.name, !!t && t !== p);
471
+ j(e) {
472
+ this.element.toggleAttribute(this.name, !!e && e !== $);
473
473
  }
474
474
  }
475
- class Pt extends D {
476
- constructor(t, e, s, i, o) {
477
- super(t, e, s, i, o), this.type = 5;
475
+ class Nt extends oe {
476
+ constructor(e, t, s, i, n) {
477
+ super(e, t, s, i, n), this.type = 5;
478
478
  }
479
- _$AI(t, e = this) {
480
- if ((t = w(this, t, e, 0) ?? p) === S) return;
481
- const s = this._$AH, i = t === p && s !== p || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== p && (s === p || i);
482
- i && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
479
+ _$AI(e, t = this) {
480
+ if ((e = B(this, e, t, 0) ?? $) === M) return;
481
+ const s = this._$AH, i = e === $ && s !== $ || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, n = e !== $ && (s === $ || i);
482
+ i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, e), this._$AH = e;
483
483
  }
484
- handleEvent(t) {
485
- var e;
486
- typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
484
+ handleEvent(e) {
485
+ var t;
486
+ typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
487
487
  }
488
488
  }
489
- class Ot {
490
- constructor(t, e, s) {
491
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
489
+ class Ut {
490
+ constructor(e, t, s) {
491
+ this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
492
492
  }
493
493
  get _$AU() {
494
494
  return this._$AM._$AU;
495
495
  }
496
- _$AI(t) {
497
- w(this, t);
496
+ _$AI(e) {
497
+ B(this, e);
498
498
  }
499
499
  }
500
- const B = O.litHtmlPolyfillSupport;
501
- B == null || B(N, T), (O.litHtmlVersions ?? (O.litHtmlVersions = [])).push("3.3.2");
502
- const Ut = (r, t, e) => {
503
- const s = (e == null ? void 0 : e.renderBefore) ?? t;
500
+ const ue = Y.litHtmlPolyfillSupport;
501
+ ue == null || ue(Z, J), (Y.litHtmlVersions ?? (Y.litHtmlVersions = [])).push("3.3.2");
502
+ const Pt = (r, e, t) => {
503
+ const s = (t == null ? void 0 : t.renderBefore) ?? e;
504
504
  let i = s._$litPart$;
505
505
  if (i === void 0) {
506
- const o = (e == null ? void 0 : e.renderBefore) ?? null;
507
- s._$litPart$ = i = new T(t.insertBefore(k(), o), o, void 0, e ?? {});
506
+ const n = (t == null ? void 0 : t.renderBefore) ?? null;
507
+ s._$litPart$ = i = new J(e.insertBefore(V(), n), n, void 0, t ?? {});
508
508
  }
509
509
  return i._$AI(r), i;
510
510
  };
@@ -513,178 +513,671 @@ const Ut = (r, t, e) => {
513
513
  * Copyright 2017 Google LLC
514
514
  * SPDX-License-Identifier: BSD-3-Clause
515
515
  */
516
- const y = globalThis;
517
- class U extends E {
516
+ const H = globalThis;
517
+ let q = class extends j {
518
518
  constructor() {
519
519
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
520
520
  }
521
521
  createRenderRoot() {
522
- var e;
523
- const t = super.createRenderRoot();
524
- return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
522
+ var t;
523
+ const e = super.createRenderRoot();
524
+ return (t = this.renderOptions).renderBefore ?? (t.renderBefore = e.firstChild), e;
525
525
  }
526
- update(t) {
527
- const e = this.render();
528
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Ut(e, this.renderRoot, this.renderOptions);
526
+ update(e) {
527
+ const t = this.render();
528
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Pt(t, this.renderRoot, this.renderOptions);
529
529
  }
530
530
  connectedCallback() {
531
- var t;
532
- super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
531
+ var e;
532
+ super.connectedCallback(), (e = this._$Do) == null || e.setConnected(!0);
533
533
  }
534
534
  disconnectedCallback() {
535
- var t;
536
- super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
535
+ var e;
536
+ super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
537
537
  }
538
538
  render() {
539
- return S;
539
+ return M;
540
540
  }
541
- }
542
- var ot;
543
- U._$litElement$ = !0, U.finalized = !0, (ot = y.litElementHydrateSupport) == null || ot.call(y, { LitElement: U });
544
- const q = y.litElementPolyfillSupport;
545
- q == null || q({ LitElement: U });
546
- (y.litElementVersions ?? (y.litElementVersions = [])).push("4.2.2");
541
+ };
542
+ var Ve;
543
+ q._$litElement$ = !0, q.finalized = !0, (Ve = H.litElementHydrateSupport) == null || Ve.call(H, { LitElement: q });
544
+ const fe = H.litElementPolyfillSupport;
545
+ fe == null || fe({ LitElement: q });
546
+ (H.litElementVersions ?? (H.litElementVersions = [])).push("4.2.2");
547
547
  /**
548
548
  * @license
549
549
  * Copyright 2017 Google LLC
550
550
  * SPDX-License-Identifier: BSD-3-Clause
551
551
  */
552
- const kt = (r) => (t, e) => {
553
- e !== void 0 ? e.addInitializer(() => {
554
- customElements.define(r, t);
555
- }) : customElements.define(r, t);
552
+ const Tt = (r) => (e, t) => {
553
+ t !== void 0 ? t.addInitializer(() => {
554
+ customElements.define(r, e);
555
+ }) : customElements.define(r, e);
556
556
  };
557
557
  /**
558
558
  * @license
559
559
  * Copyright 2017 Google LLC
560
560
  * SPDX-License-Identifier: BSD-3-Clause
561
561
  */
562
- const Mt = { attribute: !0, type: String, converter: z, reflect: !1, hasChanged: V }, Nt = (r = Mt, t, e) => {
563
- const { kind: s, metadata: i } = e;
564
- let o = globalThis.litPropertyMetadata.get(i);
565
- if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), s === "setter" && ((r = Object.create(r)).wrapped = !0), o.set(e.name, r), s === "accessor") {
566
- const { name: n } = e;
567
- return { set(l) {
568
- const h = t.get.call(this);
569
- t.set.call(this, l), this.requestUpdate(n, h, r, !0, l);
570
- }, init(l) {
571
- return l !== void 0 && this.C(n, void 0, r, l), l;
562
+ const Mt = { attribute: !0, type: String, converter: se, reflect: !1, hasChanged: be }, kt = (r = Mt, e, t) => {
563
+ const { kind: s, metadata: i } = t;
564
+ let n = globalThis.litPropertyMetadata.get(i);
565
+ if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), s === "setter" && ((r = Object.create(r)).wrapped = !0), n.set(t.name, r), s === "accessor") {
566
+ const { name: o } = t;
567
+ return { set(h) {
568
+ const a = e.get.call(this);
569
+ e.set.call(this, h), this.requestUpdate(o, a, r, !0, h);
570
+ }, init(h) {
571
+ return h !== void 0 && this.C(o, void 0, r, h), h;
572
572
  } };
573
573
  }
574
574
  if (s === "setter") {
575
- const { name: n } = e;
576
- return function(l) {
577
- const h = this[n];
578
- t.call(this, l), this.requestUpdate(n, h, r, !0, l);
575
+ const { name: o } = t;
576
+ return function(h) {
577
+ const a = this[o];
578
+ e.call(this, h), this.requestUpdate(o, a, r, !0, h);
579
579
  };
580
580
  }
581
581
  throw Error("Unsupported decorator location: " + s);
582
582
  };
583
- function x(r) {
584
- return (t, e) => typeof e == "object" ? Nt(r, t, e) : ((s, i, o) => {
585
- const n = i.hasOwnProperty(o);
586
- return i.constructor.createProperty(o, s), n ? Object.getOwnPropertyDescriptor(i, o) : void 0;
587
- })(r, t, e);
583
+ function F(r) {
584
+ return (e, t) => typeof t == "object" ? kt(r, e, t) : ((s, i, n) => {
585
+ const o = i.hasOwnProperty(n);
586
+ return i.constructor.createProperty(n, s), o ? Object.getOwnPropertyDescriptor(i, n) : void 0;
587
+ })(r, e, t);
588
+ }
589
+ /**
590
+ * @license
591
+ * Copyright 2017 Google LLC
592
+ * SPDX-License-Identifier: BSD-3-Clause
593
+ */
594
+ function we(r) {
595
+ return F({ ...r, state: !0, attribute: !1 });
596
+ }
597
+ /**
598
+ * @license
599
+ * Copyright 2017 Google LLC
600
+ * SPDX-License-Identifier: BSD-3-Clause
601
+ */
602
+ const Dt = (r, e, t) => (t.configurable = !0, t.enumerable = !0, Reflect.decorate && typeof e != "object" && Object.defineProperty(r, e, t), t);
603
+ /**
604
+ * @license
605
+ * Copyright 2017 Google LLC
606
+ * SPDX-License-Identifier: BSD-3-Clause
607
+ */
608
+ function rt(r, e) {
609
+ return (t, s, i) => {
610
+ const n = (o) => {
611
+ var h;
612
+ return ((h = o.renderRoot) == null ? void 0 : h.querySelector(r)) ?? null;
613
+ };
614
+ return Dt(t, s, { get() {
615
+ return n(this);
616
+ } });
617
+ };
618
+ }
619
+ /**
620
+ * @license
621
+ * Copyright 2017 Google LLC
622
+ * SPDX-License-Identifier: BSD-3-Clause
623
+ */
624
+ const st = { ATTRIBUTE: 1, CHILD: 2 }, it = (r) => (...e) => ({ _$litDirective$: r, values: e });
625
+ class nt {
626
+ constructor(e) {
627
+ }
628
+ get _$AU() {
629
+ return this._$AM._$AU;
630
+ }
631
+ _$AT(e, t, s) {
632
+ this._$Ct = e, this._$AM = t, this._$Ci = s;
633
+ }
634
+ _$AS(e, t) {
635
+ return this.update(e, t);
636
+ }
637
+ update(e, t) {
638
+ return this.render(...t);
639
+ }
588
640
  }
589
641
  /**
590
642
  * @license
591
643
  * Copyright 2017 Google LLC
592
644
  * SPDX-License-Identifier: BSD-3-Clause
593
645
  */
594
- function Tt(r) {
595
- return x({ ...r, state: !0, attribute: !1 });
596
- }
597
- const Ht = ":host{display:block;width:100%;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.controls{display:flex;gap:12px;align-items:center;margin-bottom:8px;flex-wrap:wrap}.controls label{font-size:12px;font-weight:600;color:#374151}button{font-size:12px;padding:3px 10px;border-radius:4px;cursor:pointer;border:1px solid #76b900;background:#76b900;color:#fff;font-weight:600}button.off{background:#fff;color:#6b7280;border-color:#d1d5db}select{font-size:12px;padding:3px 8px;border:1px solid #d1d5db;border-radius:4px;cursor:pointer;color:#374151}textarea{width:100%;min-height:80px;box-sizing:border-box;font-family:inherit;font-size:14px;line-height:1.5;color:#111827;background:#fff;border:1px solid #d1d5db;border-radius:6px;padding:8px 12px;resize:vertical;outline:none;transition:border-color .15s,box-shadow .15s}textarea:focus{border-color:#6366f1;box-shadow:0 0 0 3px #6366f11f}textarea::placeholder{color:#9ca3af}";
598
- var Rt = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, b = (r, t, e, s) => {
599
- for (var i = s > 1 ? void 0 : s ? zt(t, e) : t, o = r.length - 1, n; o >= 0; o--)
600
- (n = r[o]) && (i = (s ? n(t, e, i) : n(i)) || i);
601
- return s && i && Rt(t, e, i), i;
646
+ let $e = class extends nt {
647
+ constructor(e) {
648
+ if (super(e), this.it = $, e.type !== st.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
649
+ }
650
+ render(e) {
651
+ if (e === $ || e == null) return this._t = void 0, this.it = e;
652
+ if (e === M) return e;
653
+ if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
654
+ if (e === this.it) return this._t;
655
+ this.it = e;
656
+ const t = [e];
657
+ return t.raw = t, this._t = { _$litType$: this.constructor.resultType, strings: t, values: [] };
658
+ }
659
+ };
660
+ $e.directiveName = "unsafeHTML", $e.resultType = 1;
661
+ const Lt = it($e);
662
+ /**
663
+ * @license
664
+ * Copyright 2018 Google LLC
665
+ * SPDX-License-Identifier: BSD-3-Clause
666
+ */
667
+ const Ht = it(class extends nt {
668
+ constructor(r) {
669
+ var e;
670
+ if (super(r), r.type !== st.ATTRIBUTE || r.name !== "class" || ((e = r.strings) == null ? void 0 : e.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
671
+ }
672
+ render(r) {
673
+ return " " + Object.keys(r).filter((e) => r[e]).join(" ") + " ";
674
+ }
675
+ update(r, [e]) {
676
+ var s, i;
677
+ if (this.st === void 0) {
678
+ this.st = /* @__PURE__ */ new Set(), r.strings !== void 0 && (this.nt = new Set(r.strings.join(" ").split(/\s/).filter((n) => n !== "")));
679
+ for (const n in e) e[n] && !((s = this.nt) != null && s.has(n)) && this.st.add(n);
680
+ return this.render(e);
681
+ }
682
+ const t = r.element.classList;
683
+ for (const n of this.st) n in e || (t.remove(n), this.st.delete(n));
684
+ for (const n in e) {
685
+ const o = !!e[n];
686
+ o === this.st.has(n) || (i = this.nt) != null && i.has(n) || (o ? (t.add(n), this.st.add(n)) : (t.remove(n), this.st.delete(n)));
687
+ }
688
+ return M;
689
+ }
690
+ }), It = ":host{display:block;width:100%;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.controls{display:flex;gap:12px;align-items:center;margin-bottom:8px;flex-wrap:wrap}.controls label{font-size:12px;font-weight:600;color:#374151}.btn-toggle{font-size:12px;padding:3px 10px;border-radius:4px;cursor:pointer;border:1px solid #76b900;background:#76b900;color:#fff;font-weight:600}.btn-toggle.off{background:#fff;color:#6b7280;border-color:#d1d5db}select{font-size:12px;padding:3px 8px;border:1px solid #d1d5db;border-radius:4px;cursor:pointer;color:#374151;background:#fff}.editor-wrapper{position:relative;background:#fff;border:1px solid #d1d5db;border-radius:6px;transition:border-color .15s,box-shadow .15s}.editor-wrapper:focus-within{border-color:#6366f1;box-shadow:0 0 0 3px #6366f11f}.highlight-layer,textarea{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:14px;line-height:1.5;padding:8px 12px;width:100%;box-sizing:border-box;white-space:pre-wrap;word-break:break-word;overflow-wrap:break-word}.highlight-layer{position:absolute;top:0;left:0;height:100%;color:transparent;pointer-events:none;overflow:hidden;border:none;background:transparent;margin:0}.highlight-layer mark{background:transparent;color:transparent;text-decoration:underline wavy red}textarea{position:relative;display:block;min-height:80px;outline:none;background:transparent;color:#111827;caret-color:#111827;border:none;border-radius:6px;resize:vertical;margin:0}textarea::placeholder{color:#9ca3af}.loading-hint{font-size:11px;color:#9ca3af;margin-top:4px}";
691
+ function zt(r) {
692
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
693
+ }
694
+ /*!
695
+ * Determine if an object is a Buffer
696
+ *
697
+ * @author Feross Aboukhadijeh <https://feross.org>
698
+ * @license MIT
699
+ */
700
+ var jt = function(e) {
701
+ return e != null && e.constructor != null && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e);
702
+ }, ot = Ft, Bt = [];
703
+ function Ft(r, e) {
704
+ var t = 0, s;
705
+ if (!e) return Bt;
706
+ if (r.FLAG === "long") {
707
+ for (s = new Array(Math.ceil(e.length / 2)); t < e.length; )
708
+ s[t / 2] = e.slice(t, t + 2), t += 2;
709
+ return s;
710
+ }
711
+ return e.split(r.FLAG === "num" ? "," : "");
712
+ }
713
+ var Wt = ot, Kt = qt, Gt = [].push, ee = "etaoinshrdlcumwfgypbvkjxqz".split(""), K = /\s+/, Yt = [
714
+ "qwertzuop",
715
+ "yxcvbnm",
716
+ "qaw",
717
+ "say",
718
+ "wse",
719
+ "dsx",
720
+ "sy",
721
+ "edr",
722
+ "fdc",
723
+ "dx",
724
+ "rft",
725
+ "gfv",
726
+ "fc",
727
+ "tgz",
728
+ "hgb",
729
+ "gv",
730
+ "zhu",
731
+ "jhn",
732
+ "hb",
733
+ "uji",
734
+ "kjm",
735
+ "jn",
736
+ "iko",
737
+ "lkm"
738
+ ];
739
+ function qt(r) {
740
+ var e = /* @__PURE__ */ Object.create(null), t = /* @__PURE__ */ Object.create(null), s = /* @__PURE__ */ Object.create(null), i = [], n = { in: [], out: [] }, o = [], h = r.toString("utf8"), a = [], d = 0, l = h.indexOf(`
741
+ `), c, u, p, f, m, w, b, A, S, v, C, g, x;
742
+ for (s.KEY = []; l > -1; )
743
+ y(h.slice(d, l)), d = l + 1, l = h.indexOf(`
744
+ `, d);
745
+ for (y(h.slice(d)), l = -1; ++l < a.length; )
746
+ if (u = a[l], c = u.split(K), p = c[0], p === "REP") {
747
+ for (f = l + parseInt(c[1], 10); ++l <= f; )
748
+ c = a[l].split(K), i.push([c[1], c[2]]);
749
+ l--;
750
+ } else if (p === "ICONV" || p === "OCONV") {
751
+ for (f = l + parseInt(c[1], 10), A = n[p === "ICONV" ? "in" : "out"]; ++l <= f; )
752
+ c = a[l].split(K), A.push([new RegExp(c[1], "g"), c[2]]);
753
+ l--;
754
+ } else if (p === "COMPOUNDRULE") {
755
+ for (f = l + parseInt(c[1], 10); ++l <= f; )
756
+ for (v = a[l].split(K)[1], S = -1, o.push(v); ++S < v.length; )
757
+ t[v.charAt(S)] = [];
758
+ l--;
759
+ } else if (p === "PFX" || p === "SFX") {
760
+ for (f = l + parseInt(c[3], 10), v = {
761
+ type: p,
762
+ combineable: c[2] === "Y",
763
+ entries: []
764
+ }, e[c[1]] = v; ++l <= f; ) {
765
+ c = a[l].split(K), m = c[2], w = c[3].split("/"), b = c[4], A = {
766
+ add: "",
767
+ remove: "",
768
+ match: "",
769
+ continuation: Wt(s, w[1])
770
+ }, w && w[0] !== "0" && (A.add = w[0]);
771
+ try {
772
+ m !== "0" && (A.remove = p === "SFX" ? He(m) : m), b && b !== "." && (A.match = p === "SFX" ? He(b) : Vt(b));
773
+ } catch {
774
+ A = null;
775
+ }
776
+ A && v.entries.push(A);
777
+ }
778
+ l--;
779
+ } else if (p === "TRY") {
780
+ for (b = c[1], g = -1, C = []; ++g < b.length; )
781
+ x = b.charAt(g), x.toLowerCase() === x && C.push(x);
782
+ for (g = -1; ++g < ee.length; )
783
+ b.indexOf(ee[g]) < 0 && C.push(ee[g]);
784
+ s[p] = C;
785
+ } else p === "KEY" ? Gt.apply(s[p], c[1].split("|")) : p === "COMPOUNDMIN" ? s[p] = Number(c[1]) : p === "ONLYINCOMPOUND" ? (s[p] = c[1], t[c[1]] = []) : s[p] = c[1];
786
+ return isNaN(s.COMPOUNDMIN) && (s.COMPOUNDMIN = 3), s.KEY.length || (s.KEY = Yt), s.TRY || (s.TRY = ee.concat()), s.KEEPCASE || (s.KEEPCASE = !1), {
787
+ compoundRuleCodes: t,
788
+ replacementTable: i,
789
+ conversion: n,
790
+ compoundRules: o,
791
+ rules: e,
792
+ flags: s
793
+ };
794
+ function y(_) {
795
+ _ = _.trim(), _ && _.charCodeAt(0) !== 35 && a.push(_);
796
+ }
797
+ }
798
+ function He(r) {
799
+ return new RegExp(r + "$");
800
+ }
801
+ function Vt(r) {
802
+ return new RegExp("^" + r);
803
+ }
804
+ var at = Xt;
805
+ function Xt(r, e) {
806
+ for (var t = -1; ++t < e.length; )
807
+ r = r.replace(e[t][0], e[t][1]);
808
+ return r;
809
+ }
810
+ var ae = Zt;
811
+ function Zt(r, e, t) {
812
+ return t && e in r && t.indexOf(r[e]) > -1;
813
+ }
814
+ var Jt = ae, Qt = er;
815
+ function er(r, e) {
816
+ var t = -1;
817
+ if (r.data[e])
818
+ return !Jt(r.flags, "ONLYINCOMPOUND", r.data[e]);
819
+ if (e.length >= r.flags.COMPOUNDMIN) {
820
+ for (; ++t < r.compoundRules.length; )
821
+ if (r.compoundRules[t].test(e))
822
+ return !0;
823
+ }
824
+ return !1;
825
+ }
826
+ var tr = at, ge = Qt, _e = ae, Ee = rr;
827
+ function rr(r, e, t) {
828
+ var s = e.trim(), i;
829
+ if (!s)
830
+ return null;
831
+ if (s = tr(s, r.conversion.in), ge(r, s))
832
+ return !t && _e(r.flags, "FORBIDDENWORD", r.data[s]) ? null : s;
833
+ if (s.toUpperCase() === s) {
834
+ if (i = s.charAt(0) + s.slice(1).toLowerCase(), Ie(r.flags, r.data[i], t))
835
+ return null;
836
+ if (ge(r, i))
837
+ return i;
838
+ }
839
+ if (i = s.toLowerCase(), i !== s) {
840
+ if (Ie(r.flags, r.data[i], t))
841
+ return null;
842
+ if (ge(r, i))
843
+ return i;
844
+ }
845
+ return null;
846
+ }
847
+ function Ie(r, e, t) {
848
+ return _e(r, "KEEPCASE", e) || t || _e(r, "FORBIDDENWORD", e);
849
+ }
850
+ var sr = Ee, ir = nr;
851
+ function nr(r) {
852
+ return !!sr(this, r);
853
+ }
854
+ var or = ar;
855
+ function ar(r) {
856
+ var e = ze(r.charAt(0)), t = r.slice(1);
857
+ return !t || (t = ze(t), e === t) ? e : e === "u" && t === "l" ? "s" : null;
858
+ }
859
+ function ze(r) {
860
+ return r === r.toLowerCase() ? "l" : r === r.toUpperCase() ? "u" : null;
861
+ }
862
+ var re = or, je = at, lr = ae, hr = Ee, cr = pr, dr = [].push;
863
+ function pr(r) {
864
+ var e = this, t = {}, s = [], i = {}, n, o, h = [], a, d, l, c, u, p, f, m, w, b, A, S, v, C, g, x, y, _, U, z, le, he, Q;
865
+ if (r = je(r.trim(), e.conversion.in), !r || e.correct(r))
866
+ return [];
867
+ for (Q = re(r), d = -1; ++d < e.replacementTable.length; )
868
+ for (o = e.replacementTable[d], l = r.indexOf(o[0]); l > -1; )
869
+ h.push(r.replace(o[0], o[1])), l = r.indexOf(o[0], l + 1);
870
+ for (d = -1; ++d < r.length; )
871
+ for (m = r.charAt(d), b = r.slice(0, d), A = r.slice(d + 1), v = m.toLowerCase(), S = v !== m, t = {}, l = -1; ++l < e.flags.KEY.length; )
872
+ if (w = e.flags.KEY[l], c = w.indexOf(v), !(c < 0)) {
873
+ for (p = -1; ++p < w.length; )
874
+ if (p !== c) {
875
+ if (f = w.charAt(p), t[f])
876
+ continue;
877
+ t[f] = !0, S && (f = f.toUpperCase()), h.push(b + f + A);
878
+ }
879
+ }
880
+ for (d = -1, y = r.charAt(0), a = [""], _ = 1, U = 0; ++d < r.length; ) {
881
+ for (m = y, y = r.charAt(d + 1), b = r.slice(0, d), o = m === y ? "" : m + m, l = -1, u = a.length; ++l < u; )
882
+ l <= _ && a.push(a[l] + o), a[l] += m;
883
+ ++U < 3 && (_ = a.length);
884
+ }
885
+ for (dr.apply(h, a), a = [r], o = r.toLowerCase(), (r === o || Q === null) && a.push(r.charAt(0).toUpperCase() + o.slice(1)), o = r.toUpperCase(), r !== o && a.push(o), n = {
886
+ state: {},
887
+ weighted: i,
888
+ suggestions: s
889
+ }, C = Be(e, n, a, h), g = 0, _ = Math.min(C.length, Math.pow(Math.max(15 - r.length, 3), 3)), z = Math.max(Math.pow(10 - r.length, 3), 1); !s.length && g < _; )
890
+ x = g + z, Be(e, n, C.slice(g, x)), g = x;
891
+ for (s.sort(ct), a = [], le = [], d = -1; ++d < s.length; )
892
+ he = je(s[d], e.conversion.out), o = he.toLowerCase(), le.indexOf(o) < 0 && (a.push(he), le.push(o));
893
+ return a;
894
+ function ct(R, N) {
895
+ return dt(R, N) || pt(R, N) || ut(R, N);
896
+ }
897
+ function dt(R, N) {
898
+ return i[R] === i[N] ? 0 : i[R] > i[N] ? -1 : 1;
899
+ }
900
+ function pt(R, N) {
901
+ var Ce = re(R), xe = re(N);
902
+ return Ce === xe ? 0 : Ce === Q ? -1 : xe === Q ? 1 : void 0;
903
+ }
904
+ function ut(R, N) {
905
+ return R.localeCompare(N);
906
+ }
907
+ }
908
+ function Be(r, e, t, s) {
909
+ var i = r.flags.TRY, n = r.data, o = r.flags, h = [], a = -1, d, l, c, u, p, f, m, w, b, A, S, v, C;
910
+ if (s)
911
+ for (; ++a < s.length; )
912
+ g(s[a], !0);
913
+ for (a = -1; ++a < t.length; )
914
+ for (d = t[a], l = "", c = "", u = d.charAt(0), p = d, f = d.slice(1), m = u.toLowerCase() !== u, w = re(d), b = -1; ++b <= d.length; )
915
+ for (l += c, A = p, p = f, f = p.slice(1), c = u, u = d.charAt(b + 1), S = m, u && (m = u.toLowerCase() !== u), p && S !== m && (g(l + x(p)), g(
916
+ l + x(u) + x(c) + f
917
+ )), g(l + p), p && g(l + u + c + f), C = -1; ++C < i.length; )
918
+ v = i[C], S && v !== v.toUpperCase() ? (w !== "s" && (g(l + v + A), g(l + v + p)), v = v.toUpperCase(), g(l + v + A), g(l + v + p)) : (g(l + v + A), g(l + v + p));
919
+ return h;
920
+ function g(y, _) {
921
+ var U = e.state[y], z;
922
+ U !== !!U && (h.push(y), z = hr(r, y), U = z && !lr(o, "NOSUGGEST", n[z]), e.state[y] = U, U && (e.weighted[y] = _ ? 10 : 0, e.suggestions.push(y))), U && e.weighted[y]++;
923
+ }
924
+ function x(y) {
925
+ var _ = y.charAt(0);
926
+ return (_.toLowerCase() === _ ? _.toUpperCase() : _.toLowerCase()) + y.slice(1);
927
+ }
928
+ }
929
+ var ur = Ee, Fe = ae, fr = gr;
930
+ function gr(r) {
931
+ var e = this, t = ur(e, r, !0);
932
+ return {
933
+ correct: e.correct(r),
934
+ forbidden: !!(t && Fe(e.flags, "FORBIDDENWORD", e.data[t])),
935
+ warn: !!(t && Fe(e.flags, "WARN", e.data[t]))
936
+ };
937
+ }
938
+ var vr = lt;
939
+ function lt(r, e, t, s) {
940
+ for (var i = -1, n, o, h, a, d; ++i < e.entries.length; )
941
+ if (n = e.entries[i], a = n.continuation, d = -1, (!n.match || n.match.test(r)) && (o = n.remove ? r.replace(n.remove, "") : r, o = e.type === "SFX" ? o + n.add : n.add + o, s.push(o), a && a.length))
942
+ for (; ++d < a.length; )
943
+ h = t[a[d]], h && lt(o, h, t, s);
944
+ return s;
945
+ }
946
+ var We = vr, ht = mr, $r = [].push, me = [];
947
+ function _r(r, e, t) {
948
+ var s = r[e];
949
+ e in r ? s === me ? r[e] = t.concat() : $r.apply(s, t) : r[e] = t.concat();
950
+ }
951
+ function mr(r, e, t, s) {
952
+ var i = -1, n, o, h, a, d, l, c;
953
+ for ((!("NEEDAFFIX" in s.flags) || t.indexOf(s.flags.NEEDAFFIX) < 0) && _r(r, e, t); ++i < t.length; )
954
+ if (n = s.rules[t[i]], t[i] in s.compoundRuleCodes && s.compoundRuleCodes[t[i]].push(e), n) {
955
+ for (l = We(e, n, s.rules, []), o = -1; ++o < l.length; )
956
+ if (l[o] in r || (r[l[o]] = me), n.combineable) {
957
+ for (h = i; ++h < t.length; )
958
+ if (d = s.rules[t[h]], d && d.combineable && n.type !== d.type)
959
+ for (c = We(
960
+ l[o],
961
+ d,
962
+ s.rules,
963
+ []
964
+ ), a = -1; ++a < c.length; )
965
+ c[a] in r || (r[c[a]] = me);
966
+ }
967
+ }
968
+ }
969
+ var yr = ht, br = wr, Ar = [];
970
+ function wr(r, e) {
971
+ var t = this;
972
+ return yr(t.data, r, t.data[e] || Ar, t), t;
973
+ }
974
+ var Er = Cr;
975
+ function Cr(r) {
976
+ var e = this;
977
+ return delete e.data[r], e;
978
+ }
979
+ var xr = Or;
980
+ function Or() {
981
+ return this.flags.WORDCHARS || null;
982
+ }
983
+ var Sr = ot, Rr = ht, Nr = Ur, Ke = /\s/g;
984
+ function Ur(r, e, t) {
985
+ for (var s = r.toString("utf8"), i = s.indexOf(`
986
+ `) + 1, n = s.indexOf(`
987
+ `, i); n > -1; )
988
+ s.charCodeAt(i) !== 9 && Ge(s.slice(i, n), e, t), i = n + 1, n = s.indexOf(`
989
+ `, i);
990
+ Ge(s.slice(i), e, t);
991
+ }
992
+ function Ge(r, e, t) {
993
+ for (var s = r.indexOf("/"), i = r.indexOf("#"), n = "", o, h; s > -1 && r.charCodeAt(s - 1) === 92; )
994
+ r = r.slice(0, s - 1) + r.slice(s), s = r.indexOf("/", s);
995
+ i > -1 ? s > -1 && s < i ? (o = r.slice(0, s), Ke.lastIndex = s + 1, h = Ke.exec(r), n = r.slice(s + 1, h ? h.index : void 0)) : o = r.slice(0, i) : s > -1 ? (o = r.slice(0, s), n = r.slice(s + 1)) : o = r, o = o.trim(), o && Rr(t, o, Sr(e.flags, n.trim()), e);
996
+ }
997
+ var Pr = Nr, Tr = Mr;
998
+ function Mr(r) {
999
+ var e = this, t = -1, s, i, n, o;
1000
+ for (Pr(r, e, e.data); ++t < e.compoundRules.length; ) {
1001
+ for (s = e.compoundRules[t], i = "", o = -1; ++o < s.length; )
1002
+ n = s.charAt(o), i += e.compoundRuleCodes[n].length ? "(?:" + e.compoundRuleCodes[n].join("|") + ")" : n;
1003
+ e.compoundRules[t] = new RegExp(i, "i");
1004
+ }
1005
+ return e;
1006
+ }
1007
+ var kr = Dr;
1008
+ function Dr(r) {
1009
+ var e = this, t = r.toString("utf8").split(`
1010
+ `), s = -1, i, n, o, h;
1011
+ for (e.flags.FORBIDDENWORD === void 0 && (e.flags.FORBIDDENWORD = !1), h = e.flags.FORBIDDENWORD; ++s < t.length; )
1012
+ i = t[s].trim(), i && (i = i.split("/"), o = i[0], n = o.charAt(0) === "*", n && (o = o.slice(1)), e.add(o, i[1]), n && e.data[o].push(h));
1013
+ return e;
1014
+ }
1015
+ var Ye = jt, Lr = Kt, Hr = ne, k = ne.prototype;
1016
+ k.correct = ir;
1017
+ k.suggest = cr;
1018
+ k.spell = fr;
1019
+ k.add = br;
1020
+ k.remove = Er;
1021
+ k.wordCharacters = xr;
1022
+ k.dictionary = Tr;
1023
+ k.personal = kr;
1024
+ function ne(r, e) {
1025
+ var t = -1, s;
1026
+ if (!(this instanceof ne))
1027
+ return new ne(r, e);
1028
+ if (typeof r == "string" || Ye(r) ? (typeof e == "string" || Ye(e)) && (s = [{ dic: e }]) : r && ("length" in r ? (s = r, r = r[0] && r[0].aff) : (r.dic && (s = [r]), r = r.aff)), !r)
1029
+ throw new Error("Missing `aff` in dictionary");
1030
+ if (r = Lr(r), this.data = /* @__PURE__ */ Object.create(null), this.compoundRuleCodes = r.compoundRuleCodes, this.replacementTable = r.replacementTable, this.conversion = r.conversion, this.compoundRules = r.compoundRules, this.rules = r.rules, this.flags = r.flags, s)
1031
+ for (; ++t < s.length; )
1032
+ s[t].dic && this.dictionary(s[t].dic);
1033
+ }
1034
+ const Ir = /* @__PURE__ */ zt(Hr), qe = "https://cdn.jsdelivr.net/npm", zr = {
1035
+ "en-US": "dictionary-en",
1036
+ "en-GB": "dictionary-en-gb",
1037
+ fr: "dictionary-fr",
1038
+ de: "dictionary-de",
1039
+ es: "dictionary-es",
1040
+ ko: "dictionary-ko"
1041
+ }, ve = /* @__PURE__ */ new Map();
1042
+ async function jr(r) {
1043
+ if (ve.has(r)) return ve.get(r);
1044
+ const e = zr[r] ?? "dictionary-en", [t, s] = await Promise.all([
1045
+ fetch(`${qe}/${e}/index.aff`).then((n) => n.text()),
1046
+ fetch(`${qe}/${e}/index.dic`).then((n) => n.text())
1047
+ ]), i = Ir({ aff: t, dic: s });
1048
+ return ve.set(r, i), i;
1049
+ }
1050
+ function Br(r, e, t) {
1051
+ const s = r.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1052
+ return !e || !t ? s + `
1053
+ ` : s.replace(/[a-zA-ZÀ-ÿ\u3131-\uD79D][a-zA-ZÀ-ÿ\u3131-\uD79D'']*/g, (n) => {
1054
+ const o = n.replace(/^'+|'+$/g, "");
1055
+ return !o || e.correct(o) ? n : `<mark>${n}</mark>`;
1056
+ }) + `
1057
+ `;
1058
+ }
1059
+ var Fr = Object.defineProperty, Wr = Object.getOwnPropertyDescriptor, O = (r, e, t, s) => {
1060
+ for (var i = s > 1 ? void 0 : s ? Wr(e, t) : e, n = r.length - 1, o; n >= 0; n--)
1061
+ (o = r[n]) && (i = (s ? o(e, t, i) : o(i)) || i);
1062
+ return s && i && Fr(e, t, i), i;
602
1063
  };
603
- let $ = class extends U {
1064
+ const Kr = [
1065
+ { value: "en-US", label: "English (US)" },
1066
+ { value: "en-GB", label: "English (UK)" },
1067
+ { value: "fr", label: "French" },
1068
+ { value: "de", label: "German" },
1069
+ { value: "es", label: "Spanish" },
1070
+ { value: "ko", label: "Korean" }
1071
+ ];
1072
+ let E = class extends q {
604
1073
  constructor() {
605
- super(...arguments), this.spellcheck = !0, this.lang = "en-US", this.placeholder = "Type here...", this.value = "", this.rows = 4, this._spellcheckOn = !0, this.LANGUAGES = [
606
- { value: "en-US", label: "English (US)" },
607
- { value: "en-GB", label: "English (UK)" },
608
- { value: "fr", label: "French" },
609
- { value: "de", label: "German" },
610
- { value: "es", label: "Spanish" },
611
- { value: "ko", label: "Korean" }
612
- ];
1074
+ super(...arguments), this.spellcheck = !0, this.lang = "en-US", this.placeholder = "Type here...", this.value = "", this.rows = 4, this._spellcheckOn = !0, this._loading = !1, this._highlightHTML = `
1075
+ `, this._checker = null, this._debounceTimer = null;
613
1076
  }
614
1077
  connectedCallback() {
615
- super.connectedCallback(), this._spellcheckOn = this.spellcheck;
1078
+ super.connectedCallback(), this._spellcheckOn = this.spellcheck, this._resizeObserver = new ResizeObserver(() => this._syncScroll()), this._loadDict();
616
1079
  }
617
- _onToggle() {
618
- this._spellcheckOn = !this._spellcheckOn;
1080
+ disconnectedCallback() {
1081
+ super.disconnectedCallback(), this._resizeObserver.disconnect();
619
1082
  }
620
- _onLangChange(r) {
621
- this.lang = r.target.value;
1083
+ firstUpdated() {
1084
+ this._resizeObserver.observe(this._textarea);
1085
+ }
1086
+ async _loadDict() {
1087
+ this._loading = !0;
1088
+ try {
1089
+ this._checker = await jr(this.lang), this._updateHighlight();
1090
+ } finally {
1091
+ this._loading = !1;
1092
+ }
1093
+ }
1094
+ _updateHighlight() {
1095
+ this._highlightHTML = Br(this.value, this._checker, this._spellcheckOn);
1096
+ }
1097
+ _syncScroll() {
1098
+ this._overlay && this._textarea && (this._overlay.scrollTop = this._textarea.scrollTop);
622
1099
  }
623
1100
  _onInput(r) {
624
- this.value = r.target.value, this.dispatchEvent(
625
- new CustomEvent("sa-change", {
626
- detail: { value: this.value },
627
- bubbles: !0,
628
- composed: !0
629
- })
630
- );
1101
+ this.value = r.target.value, this._syncScroll(), this.dispatchEvent(new CustomEvent("sa-change", {
1102
+ detail: { value: this.value },
1103
+ bubbles: !0,
1104
+ composed: !0
1105
+ })), this._debounceTimer && clearTimeout(this._debounceTimer), this._debounceTimer = setTimeout(() => this._updateHighlight(), 400);
1106
+ }
1107
+ _onToggle() {
1108
+ this._spellcheckOn = !this._spellcheckOn, this._updateHighlight();
1109
+ }
1110
+ _onLangChange(r) {
1111
+ this.lang = r.target.value, this._loadDict();
631
1112
  }
632
1113
  render() {
633
- return it`
1114
+ return pe`
634
1115
  <div class="controls">
635
1116
  <label>Spellcheck:</label>
636
1117
  <button
637
- class=${this._spellcheckOn ? "" : "off"}
1118
+ class=${Ht({ "btn-toggle": !0, off: !this._spellcheckOn })}
638
1119
  @click=${this._onToggle}
639
1120
  >
640
- ${this._spellcheckOn ? "ON" : "OFF"}
1121
+ ${this._loading ? "..." : this._spellcheckOn ? "ON" : "OFF"}
641
1122
  </button>
642
-
643
1123
  <label>Language:</label>
644
1124
  <select @change=${this._onLangChange}>
645
- ${this.LANGUAGES.map(
646
- ({ value: r, label: t }) => it`
647
- <option value=${r} ?selected=${r === this.lang}>
648
- ${t}
649
- </option>
650
- `
651
- )}
1125
+ ${Kr.map(({ value: r, label: e }) => pe`
1126
+ <option value=${r} ?selected=${r === this.lang}>${e}</option>
1127
+ `)}
652
1128
  </select>
653
1129
  </div>
654
1130
 
655
- <textarea
656
- .value=${this.value}
657
- placeholder=${this.placeholder}
658
- rows=${this.rows}
659
- lang=${this.lang}
660
- ?spellcheck=${this._spellcheckOn}
661
- @input=${this._onInput}
662
- ></textarea>
1131
+ <div class="editor-wrapper">
1132
+ <div class="highlight-layer">${Lt(this._highlightHTML)}</div>
1133
+ <textarea
1134
+ .value=${this.value}
1135
+ placeholder=${this.placeholder}
1136
+ rows=${this.rows}
1137
+ spellcheck="false"
1138
+ @input=${this._onInput}
1139
+ @scroll=${this._syncScroll}
1140
+ ></textarea>
1141
+ </div>
1142
+
1143
+ ${this._loading ? pe`<p class="loading-hint">Loading dictionary...</p>` : ""}
663
1144
  `;
664
1145
  }
665
1146
  };
666
- $.styles = ht(Ht);
667
- b([
668
- x({ type: Boolean })
669
- ], $.prototype, "spellcheck", 2);
670
- b([
671
- x()
672
- ], $.prototype, "lang", 2);
673
- b([
674
- x()
675
- ], $.prototype, "placeholder", 2);
676
- b([
677
- x()
678
- ], $.prototype, "value", 2);
679
- b([
680
- x({ type: Number })
681
- ], $.prototype, "rows", 2);
682
- b([
683
- Tt()
684
- ], $.prototype, "_spellcheckOn", 2);
685
- $ = b([
686
- kt("sa-spell-checker")
687
- ], $);
1147
+ E.styles = Ze(It);
1148
+ O([
1149
+ F({ type: Boolean })
1150
+ ], E.prototype, "spellcheck", 2);
1151
+ O([
1152
+ F()
1153
+ ], E.prototype, "lang", 2);
1154
+ O([
1155
+ F()
1156
+ ], E.prototype, "placeholder", 2);
1157
+ O([
1158
+ F()
1159
+ ], E.prototype, "value", 2);
1160
+ O([
1161
+ F({ type: Number })
1162
+ ], E.prototype, "rows", 2);
1163
+ O([
1164
+ we()
1165
+ ], E.prototype, "_spellcheckOn", 2);
1166
+ O([
1167
+ we()
1168
+ ], E.prototype, "_loading", 2);
1169
+ O([
1170
+ we()
1171
+ ], E.prototype, "_highlightHTML", 2);
1172
+ O([
1173
+ rt("textarea")
1174
+ ], E.prototype, "_textarea", 2);
1175
+ O([
1176
+ rt(".highlight-layer")
1177
+ ], E.prototype, "_overlay", 2);
1178
+ E = O([
1179
+ Tt("sa-spell-checker")
1180
+ ], E);
688
1181
  export {
689
- $ as SaSpellChecker
1182
+ E as SaSpellChecker
690
1183
  };