@eox/drawtools 0.4.2 → 0.5.0

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.
@@ -1,30 +1,32 @@
1
- var K = (r, t, e) => {
1
+ var gt = Object.defineProperty;
2
+ var ft = (r, t, e) => t in r ? gt(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var A = (r, t, e) => (ft(r, typeof t != "symbol" ? t + "" : t, e), e), J = (r, t, e) => {
2
4
  if (!t.has(r))
3
5
  throw TypeError("Cannot " + e);
4
6
  };
5
- var g = (r, t, e) => (K(r, t, "read from private field"), e ? e.call(r) : t.get(r)), V = (r, t, e) => {
7
+ var $ = (r, t, e) => (J(r, t, "read from private field"), e ? e.call(r) : t.get(r)), V = (r, t, e) => {
6
8
  if (t.has(r))
7
9
  throw TypeError("Cannot add the same private member more than once");
8
10
  t instanceof WeakSet ? t.add(r) : t.set(r, e);
9
- }, L = (r, t, e, i) => (K(r, t, "write to private field"), i ? i.call(r, e) : t.set(r, e), e);
11
+ }, R = (r, t, e, s) => (J(r, t, "write to private field"), s ? s.call(r, e) : t.set(r, e), e);
10
12
  /**
11
13
  * @license
12
14
  * Copyright 2019 Google LLC
13
15
  * SPDX-License-Identifier: BSD-3-Clause
14
16
  */
15
- const O = window, J = O.ShadowRoot && (O.ShadyCSS === void 0 || O.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, at = Symbol(), Q = /* @__PURE__ */ new WeakMap();
16
- let vt = class {
17
- constructor(t, e, i) {
18
- if (this._$cssResult$ = !0, i !== at)
17
+ const T = globalThis, Z = T.ShadowRoot && (T.ShadyCSS === void 0 || T.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, at = Symbol(), K = /* @__PURE__ */ new WeakMap();
18
+ let _t = class {
19
+ constructor(t, e, s) {
20
+ if (this._$cssResult$ = !0, s !== at)
19
21
  throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
20
22
  this.cssText = t, this.t = e;
21
23
  }
22
24
  get styleSheet() {
23
25
  let t = this.o;
24
26
  const e = this.t;
25
- if (J && t === void 0) {
26
- const i = e !== void 0 && e.length === 1;
27
- i && (t = Q.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && Q.set(e, t));
27
+ if (Z && t === void 0) {
28
+ const s = e !== void 0 && e.length === 1;
29
+ s && (t = K.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && K.set(e, t));
28
30
  }
29
31
  return t;
30
32
  }
@@ -32,27 +34,29 @@ let vt = class {
32
34
  return this.cssText;
33
35
  }
34
36
  };
35
- const gt = (r) => new vt(typeof r == "string" ? r : r + "", void 0, at), yt = (r, t) => {
36
- J ? r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet) : t.forEach((e) => {
37
- const i = document.createElement("style"), s = O.litNonce;
38
- s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
39
- });
40
- }, X = J ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
37
+ const mt = (r) => new _t(typeof r == "string" ? r : r + "", void 0, at), wt = (r, t) => {
38
+ if (Z)
39
+ r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
40
+ else
41
+ for (const e of t) {
42
+ const s = document.createElement("style"), i = T.litNonce;
43
+ i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
44
+ }
45
+ }, G = Z ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
41
46
  let e = "";
42
- for (const i of t.cssRules)
43
- e += i.cssText;
44
- return gt(e);
47
+ for (const s of t.cssRules)
48
+ e += s.cssText;
49
+ return mt(e);
45
50
  })(r) : r;
46
51
  /**
47
52
  * @license
48
53
  * Copyright 2017 Google LLC
49
54
  * SPDX-License-Identifier: BSD-3-Clause
50
55
  */
51
- var R;
52
- const k = window, G = k.trustedTypes, _t = G ? G.emptyScript : "", Y = k.reactiveElementPolyfillSupport, q = { toAttribute(r, t) {
56
+ const { is: bt, defineProperty: At, getOwnPropertyDescriptor: vt, getOwnPropertyNames: xt, getOwnPropertySymbols: Et, getPrototypeOf: St } = Object, _ = globalThis, Q = _.trustedTypes, Ct = Q ? Q.emptyScript : "", B = _.reactiveElementPolyfillSupport, H = (r, t) => r, W = { toAttribute(r, t) {
53
57
  switch (t) {
54
58
  case Boolean:
55
- r = r ? _t : null;
59
+ r = r ? Ct : null;
56
60
  break;
57
61
  case Object:
58
62
  case Array:
@@ -77,131 +81,154 @@ const k = window, G = k.trustedTypes, _t = G ? G.emptyScript : "", Y = k.reactiv
77
81
  }
78
82
  }
79
83
  return e;
80
- } }, ht = (r, t) => t !== r && (t == t || r == r), B = { attribute: !0, type: String, converter: q, reflect: !1, hasChanged: ht }, W = "finalized";
81
- let A = class extends HTMLElement {
82
- constructor() {
83
- super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this.u();
84
- }
84
+ } }, ht = (r, t) => !bt(r, t), X = { attribute: !0, type: String, converter: W, reflect: !1, hasChanged: ht };
85
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), _.litPropertyMetadata ?? (_.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
86
+ class v extends HTMLElement {
85
87
  static addInitializer(t) {
86
- var e;
87
- this.finalize(), ((e = this.h) !== null && e !== void 0 ? e : this.h = []).push(t);
88
+ this._$Ei(), (this.l ?? (this.l = [])).push(t);
88
89
  }
89
90
  static get observedAttributes() {
90
- this.finalize();
91
- const t = [];
92
- return this.elementProperties.forEach((e, i) => {
93
- const s = this._$Ep(i, e);
94
- s !== void 0 && (this._$Ev.set(s, i), t.push(s));
95
- }), t;
96
- }
97
- static createProperty(t, e = B) {
98
- if (e.state && (e.attribute = !1), this.finalize(), this.elementProperties.set(t, e), !e.noAccessor && !this.prototype.hasOwnProperty(t)) {
99
- const i = typeof t == "symbol" ? Symbol() : "__" + t, s = this.getPropertyDescriptor(t, i, e);
100
- s !== void 0 && Object.defineProperty(this.prototype, t, s);
91
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
92
+ }
93
+ static createProperty(t, e = X) {
94
+ if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
95
+ const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
96
+ i !== void 0 && At(this.prototype, t, i);
101
97
  }
102
98
  }
103
- static getPropertyDescriptor(t, e, i) {
104
- return { get() {
99
+ static getPropertyDescriptor(t, e, s) {
100
+ const { get: i, set: n } = vt(this.prototype, t) ?? { get() {
105
101
  return this[e];
106
- }, set(s) {
107
- const n = this[t];
108
- this[e] = s, this.requestUpdate(t, n, i);
102
+ }, set(o) {
103
+ this[e] = o;
104
+ } };
105
+ return { get() {
106
+ return i == null ? void 0 : i.call(this);
107
+ }, set(o) {
108
+ const c = i == null ? void 0 : i.call(this);
109
+ n.call(this, o), this.requestUpdate(t, c, s);
109
110
  }, configurable: !0, enumerable: !0 };
110
111
  }
111
112
  static getPropertyOptions(t) {
112
- return this.elementProperties.get(t) || B;
113
+ return this.elementProperties.get(t) ?? X;
114
+ }
115
+ static _$Ei() {
116
+ if (this.hasOwnProperty(H("elementProperties")))
117
+ return;
118
+ const t = St(this);
119
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
113
120
  }
114
121
  static finalize() {
115
- if (this.hasOwnProperty(W))
116
- return !1;
117
- this[W] = !0;
118
- const t = Object.getPrototypeOf(this);
119
- if (t.finalize(), t.h !== void 0 && (this.h = [...t.h]), this.elementProperties = new Map(t.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) {
120
- const e = this.properties, i = [...Object.getOwnPropertyNames(e), ...Object.getOwnPropertySymbols(e)];
121
- for (const s of i)
122
- this.createProperty(s, e[s]);
122
+ if (this.hasOwnProperty(H("finalized")))
123
+ return;
124
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(H("properties"))) {
125
+ const e = this.properties, s = [...xt(e), ...Et(e)];
126
+ for (const i of s)
127
+ this.createProperty(i, e[i]);
128
+ }
129
+ const t = this[Symbol.metadata];
130
+ if (t !== null) {
131
+ const e = litPropertyMetadata.get(t);
132
+ if (e !== void 0)
133
+ for (const [s, i] of e)
134
+ this.elementProperties.set(s, i);
135
+ }
136
+ this._$Eh = /* @__PURE__ */ new Map();
137
+ for (const [e, s] of this.elementProperties) {
138
+ const i = this._$Eu(e, s);
139
+ i !== void 0 && this._$Eh.set(i, e);
123
140
  }
124
- return this.elementStyles = this.finalizeStyles(this.styles), !0;
141
+ this.elementStyles = this.finalizeStyles(this.styles);
125
142
  }
126
143
  static finalizeStyles(t) {
127
144
  const e = [];
128
145
  if (Array.isArray(t)) {
129
- const i = new Set(t.flat(1 / 0).reverse());
130
- for (const s of i)
131
- e.unshift(X(s));
146
+ const s = new Set(t.flat(1 / 0).reverse());
147
+ for (const i of s)
148
+ e.unshift(G(i));
132
149
  } else
133
- t !== void 0 && e.push(X(t));
150
+ t !== void 0 && e.push(G(t));
134
151
  return e;
135
152
  }
136
- static _$Ep(t, e) {
137
- const i = e.attribute;
138
- return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
153
+ static _$Eu(t, e) {
154
+ const s = e.attribute;
155
+ return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
139
156
  }
140
- u() {
157
+ constructor() {
158
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
159
+ }
160
+ _$Ev() {
141
161
  var t;
142
- this._$E_ = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$Eg(), this.requestUpdate(), (t = this.constructor.h) === null || t === void 0 || t.forEach((e) => e(this));
162
+ this._$Eg = 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));
143
163
  }
144
164
  addController(t) {
145
- var e, i;
146
- ((e = this._$ES) !== null && e !== void 0 ? e : this._$ES = []).push(t), this.renderRoot !== void 0 && this.isConnected && ((i = t.hostConnected) === null || i === void 0 || i.call(t));
165
+ var e;
166
+ (this._$ES ?? (this._$ES = [])).push(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
147
167
  }
148
168
  removeController(t) {
149
169
  var e;
150
- (e = this._$ES) === null || e === void 0 || e.splice(this._$ES.indexOf(t) >>> 0, 1);
170
+ (e = this._$ES) == null || e.splice(this._$ES.indexOf(t) >>> 0, 1);
151
171
  }
152
- _$Eg() {
153
- this.constructor.elementProperties.forEach((t, e) => {
154
- this.hasOwnProperty(e) && (this._$Ei.set(e, this[e]), delete this[e]);
155
- });
172
+ _$E_() {
173
+ const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
174
+ for (const s of e.keys())
175
+ this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
176
+ t.size > 0 && (this._$Ep = t);
156
177
  }
157
178
  createRenderRoot() {
158
- var t;
159
- const e = (t = this.shadowRoot) !== null && t !== void 0 ? t : this.attachShadow(this.constructor.shadowRootOptions);
160
- return yt(e, this.constructor.elementStyles), e;
179
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
180
+ return wt(t, this.constructor.elementStyles), t;
161
181
  }
162
182
  connectedCallback() {
163
183
  var t;
164
- this.renderRoot === void 0 && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$ES) === null || t === void 0 || t.forEach((e) => {
165
- var i;
166
- return (i = e.hostConnected) === null || i === void 0 ? void 0 : i.call(e);
184
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$ES) == null || t.forEach((e) => {
185
+ var s;
186
+ return (s = e.hostConnected) == null ? void 0 : s.call(e);
167
187
  });
168
188
  }
169
189
  enableUpdating(t) {
170
190
  }
171
191
  disconnectedCallback() {
172
192
  var t;
173
- (t = this._$ES) === null || t === void 0 || t.forEach((e) => {
174
- var i;
175
- return (i = e.hostDisconnected) === null || i === void 0 ? void 0 : i.call(e);
193
+ (t = this._$ES) == null || t.forEach((e) => {
194
+ var s;
195
+ return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
176
196
  });
177
197
  }
178
- attributeChangedCallback(t, e, i) {
179
- this._$AK(t, i);
198
+ attributeChangedCallback(t, e, s) {
199
+ this._$AK(t, s);
180
200
  }
181
- _$EO(t, e, i = B) {
182
- var s;
183
- const n = this.constructor._$Ep(t, i);
184
- if (n !== void 0 && i.reflect === !0) {
185
- const o = (((s = i.converter) === null || s === void 0 ? void 0 : s.toAttribute) !== void 0 ? i.converter : q).toAttribute(e, i.type);
186
- this._$El = t, o == null ? this.removeAttribute(n) : this.setAttribute(n, o), this._$El = null;
201
+ _$EO(t, e) {
202
+ var n;
203
+ const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
204
+ if (i !== void 0 && s.reflect === !0) {
205
+ const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : W).toAttribute(e, s.type);
206
+ this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
187
207
  }
188
208
  }
189
209
  _$AK(t, e) {
190
- var i;
191
- const s = this.constructor, n = s._$Ev.get(t);
192
- if (n !== void 0 && this._$El !== n) {
193
- const o = s.getPropertyOptions(n), h = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((i = o.converter) === null || i === void 0 ? void 0 : i.fromAttribute) !== void 0 ? o.converter : q;
194
- this._$El = n, this[n] = h.fromAttribute(e, o.type), this._$El = null;
210
+ var n;
211
+ const s = this.constructor, i = s._$Eh.get(t);
212
+ if (i !== void 0 && this._$Em !== i) {
213
+ const o = s.getPropertyOptions(i), c = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : W;
214
+ this._$Em = i, this[i] = c.fromAttribute(e, o.type), this._$Em = null;
195
215
  }
196
216
  }
197
- requestUpdate(t, e, i) {
198
- let s = !0;
199
- t !== void 0 && (((i = i || this.constructor.getPropertyOptions(t)).hasChanged || ht)(this[t], e) ? (this._$AL.has(t) || this._$AL.set(t, e), i.reflect === !0 && this._$El !== t && (this._$EC === void 0 && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(t, i))) : s = !1), !this.isUpdatePending && s && (this._$E_ = this._$Ej());
217
+ requestUpdate(t, e, s, i = !1, n) {
218
+ if (t !== void 0) {
219
+ if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? ht)(i ? n : this[t], e))
220
+ return;
221
+ this.C(t, e, s);
222
+ }
223
+ this.isUpdatePending === !1 && (this._$Eg = this._$EP());
224
+ }
225
+ C(t, e, s) {
226
+ this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
200
227
  }
201
- async _$Ej() {
228
+ async _$EP() {
202
229
  this.isUpdatePending = !0;
203
230
  try {
204
- await this._$E_;
231
+ await this._$Eg;
205
232
  } catch (e) {
206
233
  Promise.reject(e);
207
234
  }
@@ -212,139 +239,141 @@ let A = class extends HTMLElement {
212
239
  return this.performUpdate();
213
240
  }
214
241
  performUpdate() {
215
- var t;
242
+ var s;
216
243
  if (!this.isUpdatePending)
217
244
  return;
218
- this.hasUpdated, this._$Ei && (this._$Ei.forEach((s, n) => this[n] = s), this._$Ei = void 0);
219
- let e = !1;
220
- const i = this._$AL;
245
+ if (!this.hasUpdated) {
246
+ if (this._$Ep) {
247
+ for (const [n, o] of this._$Ep)
248
+ this[n] = o;
249
+ this._$Ep = void 0;
250
+ }
251
+ const i = this.constructor.elementProperties;
252
+ if (i.size > 0)
253
+ for (const [n, o] of i)
254
+ o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.C(n, this[n], o);
255
+ }
256
+ let t = !1;
257
+ const e = this._$AL;
221
258
  try {
222
- e = this.shouldUpdate(i), e ? (this.willUpdate(i), (t = this._$ES) === null || t === void 0 || t.forEach((s) => {
259
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$ES) == null || s.forEach((i) => {
223
260
  var n;
224
- return (n = s.hostUpdate) === null || n === void 0 ? void 0 : n.call(s);
225
- }), this.update(i)) : this._$Ek();
226
- } catch (s) {
227
- throw e = !1, this._$Ek(), s;
261
+ return (n = i.hostUpdate) == null ? void 0 : n.call(i);
262
+ }), this.update(e)) : this._$ET();
263
+ } catch (i) {
264
+ throw t = !1, this._$ET(), i;
228
265
  }
229
- e && this._$AE(i);
266
+ t && this._$AE(e);
230
267
  }
231
268
  willUpdate(t) {
232
269
  }
233
270
  _$AE(t) {
234
271
  var e;
235
- (e = this._$ES) === null || e === void 0 || e.forEach((i) => {
236
- var s;
237
- return (s = i.hostUpdated) === null || s === void 0 ? void 0 : s.call(i);
272
+ (e = this._$ES) == null || e.forEach((s) => {
273
+ var i;
274
+ return (i = s.hostUpdated) == null ? void 0 : i.call(s);
238
275
  }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
239
276
  }
240
- _$Ek() {
277
+ _$ET() {
241
278
  this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
242
279
  }
243
280
  get updateComplete() {
244
281
  return this.getUpdateComplete();
245
282
  }
246
283
  getUpdateComplete() {
247
- return this._$E_;
284
+ return this._$Eg;
248
285
  }
249
286
  shouldUpdate(t) {
250
287
  return !0;
251
288
  }
252
289
  update(t) {
253
- this._$EC !== void 0 && (this._$EC.forEach((e, i) => this._$EO(i, this[i], e)), this._$EC = void 0), this._$Ek();
290
+ this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EO(e, this[e]))), this._$ET();
254
291
  }
255
292
  updated(t) {
256
293
  }
257
294
  firstUpdated(t) {
258
295
  }
259
- };
260
- A[W] = !0, A.elementProperties = /* @__PURE__ */ new Map(), A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, Y == null || Y({ ReactiveElement: A }), ((R = k.reactiveElementVersions) !== null && R !== void 0 ? R : k.reactiveElementVersions = []).push("1.6.2");
296
+ }
297
+ v.elementStyles = [], v.shadowRootOptions = { mode: "open" }, v[H("elementProperties")] = /* @__PURE__ */ new Map(), v[H("finalized")] = /* @__PURE__ */ new Map(), B == null || B({ ReactiveElement: v }), (_.reactiveElementVersions ?? (_.reactiveElementVersions = [])).push("2.0.1");
261
298
  /**
262
299
  * @license
263
300
  * Copyright 2017 Google LLC
264
301
  * SPDX-License-Identifier: BSD-3-Clause
265
302
  */
266
- var I;
267
- const T = window, b = T.trustedTypes, tt = b ? b.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Z = "$lit$", y = `lit$${(Math.random() + "").slice(9)}$`, dt = "?" + y, ft = `<${dt}>`, m = document, C = () => m.createComment(""), H = (r) => r === null || typeof r != "object" && typeof r != "function", ct = Array.isArray, mt = (r) => ct(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", F = `[
268
- \f\r]`, E = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, et = /-->/g, it = />/g, _ = RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^
269
- \f\r"'\`<>=]|("|')|))|$)`, "g"), st = /'/g, rt = /"/g, ut = /^(?:script|style|textarea|title)$/i, At = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), bt = At(1), w = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), nt = /* @__PURE__ */ new WeakMap(), f = m.createTreeWalker(m, 129, null, !1);
270
- function pt(r, t) {
303
+ const I = globalThis, O = I.trustedTypes, Y = O ? O.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, lt = "$lit$", f = `lit$${(Math.random() + "").slice(9)}$`, ct = "?" + f, kt = `<${ct}>`, b = document, M = () => b.createComment(""), U = (r) => r === null || typeof r != "object" && typeof r != "function", dt = Array.isArray, Ht = (r) => dt(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", z = `[
304
+ \f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, tt = /-->/g, et = />/g, m = RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
305
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), st = /'/g, it = /"/g, pt = /^(?:script|style|textarea|title)$/i, It = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), F = It(1), S = Symbol.for("lit-noChange"), l = Symbol.for("lit-nothing"), rt = /* @__PURE__ */ new WeakMap(), w = b.createTreeWalker(b, 129);
306
+ function ut(r, t) {
271
307
  if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
272
308
  throw Error("invalid template strings array");
273
- return tt !== void 0 ? tt.createHTML(t) : t;
309
+ return Y !== void 0 ? Y.createHTML(t) : t;
274
310
  }
275
- const wt = (r, t) => {
276
- const e = r.length - 1, i = [];
277
- let s, n = t === 2 ? "<svg>" : "", o = E;
278
- for (let h = 0; h < e; h++) {
279
- const l = r[h];
280
- let a, d, c = -1, p = 0;
281
- for (; p < l.length && (o.lastIndex = p, d = o.exec(l), d !== null); )
282
- p = o.lastIndex, o === E ? d[1] === "!--" ? o = et : d[1] !== void 0 ? o = it : d[2] !== void 0 ? (ut.test(d[2]) && (s = RegExp("</" + d[2], "g")), o = _) : d[3] !== void 0 && (o = _) : o === _ ? d[0] === ">" ? (o = s ?? E, c = -1) : d[1] === void 0 ? c = -2 : (c = o.lastIndex - d[2].length, a = d[1], o = d[3] === void 0 ? _ : d[3] === '"' ? rt : st) : o === rt || o === st ? o = _ : o === et || o === it ? o = E : (o = _, s = void 0);
283
- const $ = o === _ && r[h + 1].startsWith("/>") ? " " : "";
284
- n += o === E ? l + ft : c >= 0 ? (i.push(a), l.slice(0, c) + Z + l.slice(c) + y + $) : l + y + (c === -2 ? (i.push(void 0), h) : $);
285
- }
286
- return [pt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
311
+ const Mt = (r, t) => {
312
+ const e = r.length - 1, s = [];
313
+ let i, n = t === 2 ? "<svg>" : "", o = k;
314
+ for (let c = 0; c < e; c++) {
315
+ const a = r[c];
316
+ let d, p, h = -1, y = 0;
317
+ for (; y < a.length && (o.lastIndex = y, p = o.exec(a), p !== null); )
318
+ y = o.lastIndex, o === k ? p[1] === "!--" ? o = tt : p[1] !== void 0 ? o = et : p[2] !== void 0 ? (pt.test(p[2]) && (i = RegExp("</" + p[2], "g")), o = m) : p[3] !== void 0 && (o = m) : o === m ? p[0] === ">" ? (o = i ?? k, h = -1) : p[1] === void 0 ? h = -2 : (h = o.lastIndex - p[2].length, d = p[1], o = p[3] === void 0 ? m : p[3] === '"' ? it : st) : o === it || o === st ? o = m : o === tt || o === et ? o = k : (o = m, i = void 0);
319
+ const g = o === m && r[c + 1].startsWith("/>") ? " " : "";
320
+ n += o === k ? a + kt : h >= 0 ? (s.push(d), a.slice(0, h) + lt + a.slice(h) + f + g) : a + f + (h === -2 ? c : g);
321
+ }
322
+ return [ut(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), s];
287
323
  };
288
- class U {
289
- constructor({ strings: t, _$litType$: e }, i) {
290
- let s;
324
+ class P {
325
+ constructor({ strings: t, _$litType$: e }, s) {
326
+ let i;
291
327
  this.parts = [];
292
328
  let n = 0, o = 0;
293
- const h = t.length - 1, l = this.parts, [a, d] = wt(t, e);
294
- if (this.el = U.createElement(a, i), f.currentNode = this.el.content, e === 2) {
295
- const c = this.el.content, p = c.firstChild;
296
- p.remove(), c.append(...p.childNodes);
329
+ const c = t.length - 1, a = this.parts, [d, p] = Mt(t, e);
330
+ if (this.el = P.createElement(d, s), w.currentNode = this.el.content, e === 2) {
331
+ const h = this.el.content.firstChild;
332
+ h.replaceWith(...h.childNodes);
297
333
  }
298
- for (; (s = f.nextNode()) !== null && l.length < h; ) {
299
- if (s.nodeType === 1) {
300
- if (s.hasAttributes()) {
301
- const c = [];
302
- for (const p of s.getAttributeNames())
303
- if (p.endsWith(Z) || p.startsWith(y)) {
304
- const $ = d[o++];
305
- if (c.push(p), $ !== void 0) {
306
- const $t = s.getAttribute($.toLowerCase() + Z).split(y), D = /([.?@])?(.*)/.exec($);
307
- l.push({ type: 1, index: n, name: D[2], strings: $t, ctor: D[1] === "." ? Et : D[1] === "?" ? Ct : D[1] === "@" ? Ht : N });
308
- } else
309
- l.push({ type: 6, index: n });
310
- }
311
- for (const p of c)
312
- s.removeAttribute(p);
313
- }
314
- if (ut.test(s.tagName)) {
315
- const c = s.textContent.split(y), p = c.length - 1;
316
- if (p > 0) {
317
- s.textContent = b ? b.emptyScript : "";
318
- for (let $ = 0; $ < p; $++)
319
- s.append(c[$], C()), f.nextNode(), l.push({ type: 2, index: ++n });
320
- s.append(c[p], C());
334
+ for (; (i = w.nextNode()) !== null && a.length < c; ) {
335
+ if (i.nodeType === 1) {
336
+ if (i.hasAttributes())
337
+ for (const h of i.getAttributeNames())
338
+ if (h.endsWith(lt)) {
339
+ const y = p[o++], g = i.getAttribute(h).split(f), L = /([.?@])?(.*)/.exec(y);
340
+ a.push({ type: 1, index: n, name: L[2], strings: g, ctor: L[1] === "." ? Pt : L[1] === "?" ? Dt : L[1] === "@" ? Lt : N }), i.removeAttribute(h);
341
+ } else
342
+ h.startsWith(f) && (a.push({ type: 6, index: n }), i.removeAttribute(h));
343
+ if (pt.test(i.tagName)) {
344
+ const h = i.textContent.split(f), y = h.length - 1;
345
+ if (y > 0) {
346
+ i.textContent = O ? O.emptyScript : "";
347
+ for (let g = 0; g < y; g++)
348
+ i.append(h[g], M()), w.nextNode(), a.push({ type: 2, index: ++n });
349
+ i.append(h[y], M());
321
350
  }
322
351
  }
323
- } else if (s.nodeType === 8)
324
- if (s.data === dt)
325
- l.push({ type: 2, index: n });
352
+ } else if (i.nodeType === 8)
353
+ if (i.data === ct)
354
+ a.push({ type: 2, index: n });
326
355
  else {
327
- let c = -1;
328
- for (; (c = s.data.indexOf(y, c + 1)) !== -1; )
329
- l.push({ type: 7, index: n }), c += y.length - 1;
356
+ let h = -1;
357
+ for (; (h = i.data.indexOf(f, h + 1)) !== -1; )
358
+ a.push({ type: 7, index: n }), h += f.length - 1;
330
359
  }
331
360
  n++;
332
361
  }
333
362
  }
334
363
  static createElement(t, e) {
335
- const i = m.createElement("template");
336
- return i.innerHTML = t, i;
364
+ const s = b.createElement("template");
365
+ return s.innerHTML = t, s;
337
366
  }
338
367
  }
339
- function x(r, t, e = r, i) {
340
- var s, n, o, h;
341
- if (t === w)
368
+ function C(r, t, e = r, s) {
369
+ var o, c;
370
+ if (t === S)
342
371
  return t;
343
- let l = i !== void 0 ? (s = e._$Co) === null || s === void 0 ? void 0 : s[i] : e._$Cl;
344
- const a = H(t) ? void 0 : t._$litDirective$;
345
- return (l == null ? void 0 : l.constructor) !== a && ((n = l == null ? void 0 : l._$AO) === null || n === void 0 || n.call(l, !1), a === void 0 ? l = void 0 : (l = new a(r), l._$AT(r, e, i)), i !== void 0 ? ((o = (h = e)._$Co) !== null && o !== void 0 ? o : h._$Co = [])[i] = l : e._$Cl = l), l !== void 0 && (t = x(r, l._$AS(r, t.values), l, i)), t;
372
+ let i = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
373
+ const n = U(t) ? void 0 : t._$litDirective$;
374
+ return (i == null ? void 0 : i.constructor) !== n && ((c = i == null ? void 0 : i._$AO) == null || c.call(i, !1), n === void 0 ? i = void 0 : (i = new n(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = C(r, i._$AS(r, t.values), i, s)), t;
346
375
  }
347
- class xt {
376
+ class Ut {
348
377
  constructor(t, e) {
349
378
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
350
379
  }
@@ -355,33 +384,31 @@ class xt {
355
384
  return this._$AM._$AU;
356
385
  }
357
386
  u(t) {
358
- var e;
359
- const { el: { content: i }, parts: s } = this._$AD, n = ((e = t == null ? void 0 : t.creationScope) !== null && e !== void 0 ? e : m).importNode(i, !0);
360
- f.currentNode = n;
361
- let o = f.nextNode(), h = 0, l = 0, a = s[0];
387
+ const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? b).importNode(e, !0);
388
+ w.currentNode = i;
389
+ let n = w.nextNode(), o = 0, c = 0, a = s[0];
362
390
  for (; a !== void 0; ) {
363
- if (h === a.index) {
391
+ if (o === a.index) {
364
392
  let d;
365
- a.type === 2 ? d = new M(o, o.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (d = new Ut(o, this, t)), this._$AV.push(d), a = s[++l];
393
+ a.type === 2 ? d = new D(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Tt(n, this, t)), this._$AV.push(d), a = s[++c];
366
394
  }
367
- h !== (a == null ? void 0 : a.index) && (o = f.nextNode(), h++);
395
+ o !== (a == null ? void 0 : a.index) && (n = w.nextNode(), o++);
368
396
  }
369
- return f.currentNode = m, n;
397
+ return w.currentNode = b, i;
370
398
  }
371
- v(t) {
399
+ p(t) {
372
400
  let e = 0;
373
- for (const i of this._$AV)
374
- i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
401
+ for (const s of this._$AV)
402
+ s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
375
403
  }
376
404
  }
377
- class M {
378
- constructor(t, e, i, s) {
379
- var n;
380
- this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cp = (n = s == null ? void 0 : s.isConnected) === null || n === void 0 || n;
381
- }
405
+ class D {
382
406
  get _$AU() {
383
- var t, e;
384
- return (e = (t = this._$AM) === null || t === void 0 ? void 0 : t._$AU) !== null && e !== void 0 ? e : this._$Cp;
407
+ var t;
408
+ return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
409
+ }
410
+ constructor(t, e, s, i) {
411
+ this.type = 2, this._$AH = l, 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;
385
412
  }
386
413
  get parentNode() {
387
414
  let t = this._$AA.parentNode;
@@ -395,7 +422,7 @@ class M {
395
422
  return this._$AB;
396
423
  }
397
424
  _$AI(t, e = this) {
398
- t = x(this, t, e), H(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== w && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : mt(t) ? this.T(t) : this._(t);
425
+ t = C(this, t, e), U(t) ? t === l || t == null || t === "" ? (this._$AH !== l && this._$AR(), this._$AH = l) : t !== this._$AH && t !== S && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : Ht(t) ? this.T(t) : this._(t);
399
426
  }
400
427
  k(t) {
401
428
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -404,165 +431,201 @@ class M {
404
431
  this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
405
432
  }
406
433
  _(t) {
407
- this._$AH !== u && H(this._$AH) ? this._$AA.nextSibling.data = t : this.$(m.createTextNode(t)), this._$AH = t;
434
+ this._$AH !== l && U(this._$AH) ? this._$AA.nextSibling.data = t : this.$(b.createTextNode(t)), this._$AH = t;
408
435
  }
409
436
  g(t) {
410
- var e;
411
- const { values: i, _$litType$: s } = t, n = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = U.createElement(pt(s.h, s.h[0]), this.options)), s);
412
- if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) === n)
413
- this._$AH.v(i);
437
+ var n;
438
+ const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = P.createElement(ut(s.h, s.h[0]), this.options)), s);
439
+ if (((n = this._$AH) == null ? void 0 : n._$AD) === i)
440
+ this._$AH.p(e);
414
441
  else {
415
- const o = new xt(n, this), h = o.u(this.options);
416
- o.v(i), this.$(h), this._$AH = o;
442
+ const o = new Ut(i, this), c = o.u(this.options);
443
+ o.p(e), this.$(c), this._$AH = o;
417
444
  }
418
445
  }
419
446
  _$AC(t) {
420
- let e = nt.get(t.strings);
421
- return e === void 0 && nt.set(t.strings, e = new U(t)), e;
447
+ let e = rt.get(t.strings);
448
+ return e === void 0 && rt.set(t.strings, e = new P(t)), e;
422
449
  }
423
450
  T(t) {
424
- ct(this._$AH) || (this._$AH = [], this._$AR());
451
+ dt(this._$AH) || (this._$AH = [], this._$AR());
425
452
  const e = this._$AH;
426
- let i, s = 0;
453
+ let s, i = 0;
427
454
  for (const n of t)
428
- s === e.length ? e.push(i = new M(this.k(C()), this.k(C()), this, this.options)) : i = e[s], i._$AI(n), s++;
429
- s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
455
+ i === e.length ? e.push(s = new D(this.k(M()), this.k(M()), this, this.options)) : s = e[i], s._$AI(n), i++;
456
+ i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
430
457
  }
431
458
  _$AR(t = this._$AA.nextSibling, e) {
432
- var i;
433
- for ((i = this._$AP) === null || i === void 0 || i.call(this, !1, !0, e); t && t !== this._$AB; ) {
434
- const s = t.nextSibling;
435
- t.remove(), t = s;
459
+ var s;
460
+ for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
461
+ const i = t.nextSibling;
462
+ t.remove(), t = i;
436
463
  }
437
464
  }
438
465
  setConnected(t) {
439
466
  var e;
440
- this._$AM === void 0 && (this._$Cp = t, (e = this._$AP) === null || e === void 0 || e.call(this, t));
467
+ this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
441
468
  }
442
469
  }
443
470
  class N {
444
- constructor(t, e, i, s, n) {
445
- this.type = 1, this._$AH = u, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = u;
446
- }
447
471
  get tagName() {
448
472
  return this.element.tagName;
449
473
  }
450
474
  get _$AU() {
451
475
  return this._$AM._$AU;
452
476
  }
453
- _$AI(t, e = this, i, s) {
477
+ constructor(t, e, s, i, n) {
478
+ this.type = 1, this._$AH = l, this._$AN = void 0, this.element = t, this.name = e, 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 = l;
479
+ }
480
+ _$AI(t, e = this, s, i) {
454
481
  const n = this.strings;
455
482
  let o = !1;
456
483
  if (n === void 0)
457
- t = x(this, t, e, 0), o = !H(t) || t !== this._$AH && t !== w, o && (this._$AH = t);
484
+ t = C(this, t, e, 0), o = !U(t) || t !== this._$AH && t !== S, o && (this._$AH = t);
458
485
  else {
459
- const h = t;
460
- let l, a;
461
- for (t = n[0], l = 0; l < n.length - 1; l++)
462
- a = x(this, h[i + l], e, l), a === w && (a = this._$AH[l]), o || (o = !H(a) || a !== this._$AH[l]), a === u ? t = u : t !== u && (t += (a ?? "") + n[l + 1]), this._$AH[l] = a;
486
+ const c = t;
487
+ let a, d;
488
+ for (t = n[0], a = 0; a < n.length - 1; a++)
489
+ d = C(this, c[s + a], e, a), d === S && (d = this._$AH[a]), o || (o = !U(d) || d !== this._$AH[a]), d === l ? t = l : t !== l && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
463
490
  }
464
- o && !s && this.j(t);
491
+ o && !i && this.O(t);
465
492
  }
466
- j(t) {
467
- t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
493
+ O(t) {
494
+ t === l ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
468
495
  }
469
496
  }
470
- class Et extends N {
497
+ class Pt extends N {
471
498
  constructor() {
472
499
  super(...arguments), this.type = 3;
473
500
  }
474
- j(t) {
475
- this.element[this.name] = t === u ? void 0 : t;
501
+ O(t) {
502
+ this.element[this.name] = t === l ? void 0 : t;
476
503
  }
477
504
  }
478
- const St = b ? b.emptyScript : "";
479
- class Ct extends N {
505
+ class Dt extends N {
480
506
  constructor() {
481
507
  super(...arguments), this.type = 4;
482
508
  }
483
- j(t) {
484
- t && t !== u ? this.element.setAttribute(this.name, St) : this.element.removeAttribute(this.name);
509
+ O(t) {
510
+ this.element.toggleAttribute(this.name, !!t && t !== l);
485
511
  }
486
512
  }
487
- class Ht extends N {
488
- constructor(t, e, i, s, n) {
489
- super(t, e, i, s, n), this.type = 5;
513
+ class Lt extends N {
514
+ constructor(t, e, s, i, n) {
515
+ super(t, e, s, i, n), this.type = 5;
490
516
  }
491
517
  _$AI(t, e = this) {
492
- var i;
493
- if ((t = (i = x(this, t, e, 0)) !== null && i !== void 0 ? i : u) === w)
518
+ if ((t = C(this, t, e, 0) ?? l) === S)
494
519
  return;
495
- const s = this._$AH, n = t === u && s !== u || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== u && (s === u || n);
496
- n && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
520
+ const s = this._$AH, i = t === l && s !== l || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== l && (s === l || i);
521
+ i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
497
522
  }
498
523
  handleEvent(t) {
499
- var e, i;
500
- typeof this._$AH == "function" ? this._$AH.call((i = (e = this.options) === null || e === void 0 ? void 0 : e.host) !== null && i !== void 0 ? i : this.element, t) : this._$AH.handleEvent(t);
524
+ var e;
525
+ typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
501
526
  }
502
527
  }
503
- class Ut {
504
- constructor(t, e, i) {
505
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
528
+ class Tt {
529
+ constructor(t, e, s) {
530
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
506
531
  }
507
532
  get _$AU() {
508
533
  return this._$AM._$AU;
509
534
  }
510
535
  _$AI(t) {
511
- x(this, t);
536
+ C(this, t);
512
537
  }
513
538
  }
514
- const ot = T.litHtmlPolyfillSupport;
515
- ot == null || ot(U, M), ((I = T.litHtmlVersions) !== null && I !== void 0 ? I : T.litHtmlVersions = []).push("2.8.0");
516
- const Pt = (r, t, e) => {
517
- var i, s;
518
- const n = (i = e == null ? void 0 : e.renderBefore) !== null && i !== void 0 ? i : t;
519
- let o = n._$litPart$;
520
- if (o === void 0) {
521
- const h = (s = e == null ? void 0 : e.renderBefore) !== null && s !== void 0 ? s : null;
522
- n._$litPart$ = o = new M(t.insertBefore(C(), h), h, void 0, e ?? {});
523
- }
524
- return o._$AI(r), o;
539
+ const q = I.litHtmlPolyfillSupport;
540
+ q == null || q(P, D), (I.litHtmlVersions ?? (I.litHtmlVersions = [])).push("3.0.2");
541
+ const Ot = (r, t, e) => {
542
+ const s = (e == null ? void 0 : e.renderBefore) ?? t;
543
+ let i = s._$litPart$;
544
+ if (i === void 0) {
545
+ const n = (e == null ? void 0 : e.renderBefore) ?? null;
546
+ s._$litPart$ = i = new D(t.insertBefore(M(), n), n, void 0, e ?? {});
547
+ }
548
+ return i._$AI(r), i;
525
549
  };
526
550
  /**
527
551
  * @license
528
552
  * Copyright 2017 Google LLC
529
553
  * SPDX-License-Identifier: BSD-3-Clause
530
554
  */
531
- var z, j;
532
- class S extends A {
555
+ class x extends v {
533
556
  constructor() {
534
557
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
535
558
  }
536
559
  createRenderRoot() {
537
- var t, e;
538
- const i = super.createRenderRoot();
539
- return (t = (e = this.renderOptions).renderBefore) !== null && t !== void 0 || (e.renderBefore = i.firstChild), i;
560
+ var e;
561
+ const t = super.createRenderRoot();
562
+ return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
540
563
  }
541
564
  update(t) {
542
565
  const e = this.render();
543
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Pt(e, this.renderRoot, this.renderOptions);
566
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Ot(e, this.renderRoot, this.renderOptions);
544
567
  }
545
568
  connectedCallback() {
546
569
  var t;
547
- super.connectedCallback(), (t = this._$Do) === null || t === void 0 || t.setConnected(!0);
570
+ super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
548
571
  }
549
572
  disconnectedCallback() {
550
573
  var t;
551
- super.disconnectedCallback(), (t = this._$Do) === null || t === void 0 || t.setConnected(!1);
574
+ super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
552
575
  }
553
576
  render() {
554
- return w;
577
+ return S;
555
578
  }
556
579
  }
557
- S.finalized = !0, S._$litElement$ = !0, (z = globalThis.litElementHydrateSupport) === null || z === void 0 || z.call(globalThis, { LitElement: S });
558
- const lt = globalThis.litElementPolyfillSupport;
559
- lt == null || lt({ LitElement: S });
560
- ((j = globalThis.litElementVersions) !== null && j !== void 0 ? j : globalThis.litElementVersions = []).push("3.3.2");
561
- const Mt = `
562
- :host {
563
- display: block;
564
- }
565
- `, Dt = `
580
+ var ot;
581
+ x._$litElement$ = !0, x.finalized = !0, (ot = globalThis.litElementHydrateSupport) == null || ot.call(globalThis, { LitElement: x });
582
+ const j = globalThis.litElementPolyfillSupport;
583
+ j == null || j({ LitElement: x });
584
+ (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.1");
585
+ /**
586
+ * @license
587
+ * Copyright 2017 Google LLC
588
+ * SPDX-License-Identifier: BSD-3-Clause
589
+ */
590
+ const Ft = (r) => (...t) => ({ _$litDirective$: r, values: t });
591
+ let Nt = class {
592
+ constructor(t) {
593
+ }
594
+ get _$AU() {
595
+ return this._$AM._$AU;
596
+ }
597
+ _$AT(t, e, s) {
598
+ this._$Ct = t, this._$AM = e, this._$Ci = s;
599
+ }
600
+ _$AS(t, e) {
601
+ return this.update(t, e);
602
+ }
603
+ update(t, e) {
604
+ return this.render(...e);
605
+ }
606
+ };
607
+ /**
608
+ * @license
609
+ * Copyright 2020 Google LLC
610
+ * SPDX-License-Identifier: BSD-3-Clause
611
+ */
612
+ const Vt = {}, Rt = (r, t = Vt) => r._$AH = t;
613
+ /**
614
+ * @license
615
+ * Copyright 2021 Google LLC
616
+ * SPDX-License-Identifier: BSD-3-Clause
617
+ */
618
+ const Bt = Ft(class extends Nt {
619
+ constructor() {
620
+ super(...arguments), this.key = l;
621
+ }
622
+ render(r, t) {
623
+ return this.key = r, t;
624
+ }
625
+ update(r, [t, e]) {
626
+ return t !== this.key && (Rt(r), this.key = t), e;
627
+ }
628
+ }), zt = `
566
629
  button {
567
630
  /* TODO: why does this only work here and not from :root? */
568
631
  --primary-color: #004170;
@@ -651,34 +714,235 @@ button.small {
651
714
  padding: 12.4px;
652
715
  font-size: .75rem;
653
716
  }
654
- `, Ot = `
655
- * {
656
- font-family: Roboto, sans-serif;
657
- }
717
+ `, $t = `
718
+ * {
719
+ font-family: Roboto, sans-serif;
720
+ }
658
721
 
659
- ${Dt}
722
+ ${zt}
660
723
 
661
- button.discard:before {
662
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23FF5252' viewBox='0 0 24 24'%3E%3Ctitle%3Etrash-can-outline%3C/title%3E%3Cpath d='M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z' /%3E%3C/svg%3E")
663
- }
724
+ button.discard:before {
725
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23FF5252' viewBox='0 0 24 24'%3E%3Ctitle%3Etrash-can-outline%3C/title%3E%3Cpath d='M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z' /%3E%3C/svg%3E")
726
+ }
727
+
728
+ button.polygon:before {
729
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eshape-polygon-plus%3C/title%3E%3Cpath d='M17,15.7V13H19V17L10,21L3,14L7,5H11V7H8.3L5.4,13.6L10.4,18.6L17,15.7M22,5V7H19V10H17V7H14V5H17V2H19V5H22Z' /%3E%3C/svg%3E");
730
+ }
731
+ ul {
732
+ padding: 0;
733
+ }
734
+ ul ul {
735
+ padding-left: 48px;
736
+ }
737
+ li:hover {
738
+ background: #f0f5f9;
739
+ }
740
+ li.selected {
741
+ background: #f0f5f9;
742
+ }
743
+ li {
744
+ list-style: none;
745
+ padding: 4px;
746
+ }
747
+ li {
748
+ border-bottom: 1px solid #0041703a;
749
+ }
750
+ li:first-child {
751
+ border-top: 1px solid #0041703a;
752
+ }
753
+ li.sortable-chosen {
754
+ background: #eeea;
755
+ }
756
+ li.sortable-drag {
757
+ opacity: 0;
758
+ }
759
+ li.sortable-ghost {
760
+ }
761
+ button.small.icon, button.small.icon::before {
762
+ height: 16px;
763
+ width: 16px;
764
+ padding: 0px;
765
+ }
766
+ button.discard.icon {
767
+ opacity: .7;
768
+ }
769
+ button.discard.icon:hover {
770
+ opacity: 1;
771
+ }
772
+ eox-drawtools-list {
773
+ width: 100%;
774
+ }
775
+ .list {
776
+ width: 100%;
777
+ align-items: center;
778
+ justify-content: space-between;
779
+ display: flex;
780
+ align-items: center;
781
+ cursor: pointer;
782
+ font-size: small;
783
+ gap: 10px;
664
784
 
665
- button.polygon:before {
666
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eshape-polygon-plus%3C/title%3E%3Cpath d='M17,15.7V13H19V17L10,21L3,14L7,5H11V7H8.3L5.4,13.6L10.4,18.6L17,15.7M22,5V7H19V10H17V7H14V5H17V2H19V5H22Z' /%3E%3C/svg%3E");
785
+ }
786
+ label {
787
+ gap: 10px;
788
+ }
789
+ label, span {
790
+ display: flex;
791
+ align-items: center;
792
+ cursor: pointer;
793
+ font-size: small;
794
+ flex-grow: 1;
795
+ }
796
+ `, nt = (r, t, e = !1) => ({
797
+ id: r,
798
+ condition: t,
799
+ panIn: e,
800
+ layer: {
801
+ type: "Vector",
802
+ properties: {
803
+ id: "selectLayer"
804
+ },
805
+ source: {
806
+ type: "Vector"
807
+ },
808
+ style: {
809
+ "fill-color": "rgba(51, 153, 204,0.5)",
810
+ "stroke-color": "#3399CC",
811
+ "stroke-width": 2.5
812
+ }
813
+ }
814
+ });
815
+ class yt extends x {
816
+ constructor() {
817
+ super();
818
+ /**
819
+ * @type import("../../../map/src/select").EOxSelectInteraction
820
+ */
821
+ A(this, "hoverInteraction");
822
+ /**
823
+ * @type import("../../../map/src/select").EOxSelectInteraction
824
+ */
825
+ A(this, "clickInteraction");
826
+ /**
827
+ * @type string | number
828
+ */
829
+ A(this, "hoverId");
830
+ /**
831
+ * @type string | number
832
+ */
833
+ A(this, "clickId");
834
+ this.eoxMap = null, this.olMap = null, this.draw = null, this.layer = "draw", this.drawLayer = null, this.drawnFeatures = [], this.modify = null, this.unstyled = !1;
835
+ }
836
+ /**
837
+ * Delete individual feature @param {any} evt
838
+ */
839
+ _handleDelete(e) {
840
+ e.stopPropagation();
841
+ const s = e.target.getAttribute("index"), i = this.drawnFeatures[s];
842
+ this.drawLayer.getSource().removeFeature(i), this.drawnFeatures.splice(s, 1), this.requestUpdate();
843
+ }
844
+ /**
845
+ * Select and Deselect feature from the list
846
+ *
847
+ * @param {import("ol").Feature} feature
848
+ */
849
+ _handleFeatureSelectAndDeselect(e) {
850
+ const s = e.get("id");
851
+ if (this.clickId === s) {
852
+ const i = this.drawLayer.getSource().getExtent();
853
+ this.olMap.getView().fit(i, { duration: 750 }), this.clickInteraction.highlightById([]);
854
+ } else
855
+ this.clickInteraction.highlightById([s]), this.olMap.getView().fit(e.getGeometry().getExtent(), { duration: 750 });
856
+ this.requestUpdate();
857
+ }
858
+ firstUpdated() {
859
+ var i, n;
860
+ const e = (i = this.eoxMap) == null ? void 0 : i.selectInteractions["draw-hover"], s = (n = this.eoxMap) == null ? void 0 : n.selectInteractions["draw-click"];
861
+ e || (this.hoverInteraction = this.eoxMap.addSelect(
862
+ this.layer,
863
+ nt("draw-hover", "pointermove")
864
+ )), s || (this.clickInteraction = this.eoxMap.addSelect(
865
+ this.layer,
866
+ nt("draw-click", "click", !0)
867
+ )), this.hoverInteraction.selectStyleLayer.on(
868
+ "change",
869
+ () => this.requestUpdate()
870
+ ), this.clickInteraction.selectStyleLayer.on(
871
+ "change",
872
+ () => this.requestUpdate()
873
+ );
874
+ }
875
+ render() {
876
+ var e, s;
877
+ return this.hoverInteraction = this.eoxMap.selectInteractions["draw-hover"], this.clickInteraction = this.eoxMap.selectInteractions["draw-click"], this.hoverId = (e = this.hoverInteraction) == null ? void 0 : e.selectedFids[0], this.clickId = (s = this.clickInteraction) == null ? void 0 : s.selectedFids[0], F`
878
+ <style>
879
+ ${!this.unstyled && $t}
880
+ </style>
881
+ <ul>
882
+ ${this.drawnFeatures.map((i, n) => {
883
+ const o = i.get("id"), c = this.hoverId === o || this.clickId === o;
884
+ return Bt(
885
+ n + 1,
886
+ F`
887
+ <li
888
+ class="${c ? "selected" : l}"
889
+ @mouseover=${() => {
890
+ this.clickId !== o && this.hoverInteraction.highlightById([o]);
891
+ }}
892
+ @mouseout=${() => {
893
+ this.clickId !== o && this.hoverInteraction.highlightById([]);
894
+ }}
895
+ >
896
+ <div
897
+ class="list"
898
+ @click="${() => this._handleFeatureSelectAndDeselect(i)}"
899
+ >
900
+ <span class="title">Feature #${n + 1}</span>
901
+ <button
902
+ index=${n}
903
+ class="icon small discard"
904
+ @click="${this._handleDelete}"
905
+ >
906
+ ${this.unstyled ? "x" : l}
907
+ </button>
908
+ </div>
909
+ </li>
910
+ `
911
+ );
912
+ })}
913
+ </ul>
914
+ `;
915
+ }
916
+ }
917
+ A(yt, "properties", {
918
+ eoxMap: { attribute: !1, state: !0 },
919
+ olMap: { attribute: !1, state: !0 },
920
+ draw: { attribute: !1, state: !0 },
921
+ layer: { type: String },
922
+ drawLayer: { attribute: !1, state: !0 },
923
+ drawnFeatures: { attribute: !1, state: !0, type: Array },
924
+ modify: { attribute: !1, state: !0 },
925
+ unstyled: { type: Boolean }
926
+ });
927
+ customElements.define("eox-drawtools-list", yt);
928
+ const qt = `
929
+ :host {
930
+ display: block;
667
931
  }
668
932
  `;
669
- var v, P;
670
- class kt extends S {
933
+ var u, E;
934
+ class jt extends x {
671
935
  constructor() {
672
936
  super();
673
937
  /**
674
938
  * @type import("../../map/main").EOxMap
675
939
  */
676
- V(this, v, void 0);
940
+ V(this, u, void 0);
677
941
  /**
678
942
  * @type import("ol").Map
679
943
  */
680
- V(this, P, void 0);
681
- this.for = "eox-map", this.currentlyDrawing = !1, this.draw = null, this.drawLayer = null, this.drawnFeatures = [], this.layer = "draw", this.modify = null, this.multipleFeatures = !1, this.unstyled = !1;
944
+ V(this, E, void 0);
945
+ this.for = "eox-map", this.currentlyDrawing = !1, this.draw = null, this.drawLayer = null, this.drawnFeatures = [], this.layer = "draw", this.modify = null, this.multipleFeatures = !1, this.showList = !1, this.unstyled = !1;
682
946
  }
683
947
  static get properties() {
684
948
  return {
@@ -690,30 +954,31 @@ class kt extends S {
690
954
  layer: { type: String },
691
955
  modify: { attribute: !1, state: !0 },
692
956
  multipleFeatures: { attribute: "multiple-features", type: Boolean },
957
+ showList: { attribute: "show-list", type: Boolean },
693
958
  unstyled: { type: Boolean }
694
959
  };
695
960
  }
696
961
  startDrawing() {
697
- var e, i;
698
- g(this, v).addDraw(this.layer, {
962
+ var e, s;
963
+ $(this, u).addDraw(this.layer, {
699
964
  id: "drawInteraction",
700
965
  type: "Polygon",
701
966
  stopClick: !0
702
967
  }), this.draw = /** @type {import("ol/interaction").Draw} */
703
968
  /** @type {unknown} */
704
- g(this, v).interactions.drawInteraction, this.modify = /** @type {import("ol/interaction").Modify} */
969
+ $(this, u).interactions.drawInteraction, this.modify = /** @type {import("ol/interaction").Modify} */
705
970
  /** @type {unknown} */
706
- g(this, v).interactions.drawInteractionmodify, (e = this.draw) == null || e.on("drawend", (s) => this.onDrawEnd(s)), (i = this.modify) == null || i.on("modifyend", (s) => this.onModifyEnd(s)), this.currentlyDrawing = !0, this.requestUpdate();
971
+ $(this, u).interactions.drawInteractionmodify, (e = this.draw) == null || e.on("drawend", (i) => this.onDrawEnd(i)), (s = this.modify) == null || s.on("modifyend", (i) => this.onModifyEnd(i)), this.currentlyDrawing = !0, this.requestUpdate();
707
972
  }
708
973
  discardDrawing() {
709
- this.drawnFeatures = [], g(this, v).removeInteraction("drawInteraction"), this.drawLayer.getSource().clear(), this.emitDrawnFeatures(), this.currentlyDrawing = !1, this.requestUpdate();
974
+ this.drawnFeatures = [], $(this, u).removeInteraction("drawInteraction"), this.drawLayer.getSource().clear(), this.emitDrawnFeatures(), this.currentlyDrawing = !1, this.requestUpdate();
710
975
  }
711
976
  /**
712
977
  *
713
978
  * @param {import("ol/interaction/Draw").DrawEvent} evt
714
979
  */
715
980
  onDrawEnd() {
716
- this.emitDrawnFeatures(), g(this, v).removeInteraction("drawInteraction"), this.currentlyDrawing = !1, this.requestUpdate();
981
+ this.emitDrawnFeatures(), $(this, u).removeInteraction("drawInteraction"), this.currentlyDrawing = !1, this.requestUpdate();
717
982
  }
718
983
  /**
719
984
  *
@@ -732,30 +997,30 @@ class kt extends S {
732
997
  }, 0);
733
998
  }
734
999
  render() {
735
- var i, s;
1000
+ var s, i, n;
736
1001
  const e = document.querySelector(this.for);
737
- return L(
1002
+ return R(
738
1003
  this,
739
- v,
1004
+ u,
740
1005
  /** @type {import("@eox/map/main").EOxMap} */
741
1006
  e
742
- ), L(
1007
+ ), R(
743
1008
  this,
744
- P,
1009
+ E,
745
1010
  /** @type {import("ol").Map} */
746
- g(this, v).map
1011
+ $(this, u).map
747
1012
  ), this.drawLayer = /** @type {import("ol/layer").Vector<import("ol/source").Vector>} */
748
- g(this, P).getLayers().getArray().find((n) => n.get("id") === this.layer), this.requestUpdate(), bt`
1013
+ $(this, E).getLayers().getArray().find((o) => o.get("id") === this.layer), this.requestUpdate(), F`
749
1014
  <style>
750
- ${Mt}
751
- ${!this.unstyled && Ot}
1015
+ ${qt}
1016
+ ${!this.unstyled && $t}
752
1017
  </style>
753
1018
  <div>
754
1019
  <slot></slot>
755
1020
  <button
756
1021
  data-cy="drawBtn"
757
1022
  class="polygon icon"
758
- disabled="${!this.multipleFeatures && ((i = this.drawnFeatures) == null ? void 0 : i.length) > 0 || this.currentlyDrawing || u}"
1023
+ disabled="${!this.multipleFeatures && ((s = this.drawnFeatures) == null ? void 0 : s.length) > 0 || this.currentlyDrawing || l}"
759
1024
  @click="${() => this.startDrawing()}"
760
1025
  >
761
1026
  ${this.currentlyDrawing ? "drawing" : "draw"}
@@ -763,17 +1028,29 @@ class kt extends S {
763
1028
  <button
764
1029
  data-cy="discardBtn"
765
1030
  class="discard icon"
766
- disabled="${!((s = this.drawnFeatures) != null && s.length) && !this.currentlyDrawing || u}"
1031
+ disabled="${!((i = this.drawnFeatures) != null && i.length) && !this.currentlyDrawing || l}"
767
1032
  @click="${() => this.discardDrawing()}"
768
1033
  >
769
1034
  discard
770
1035
  </button>
771
1036
  </div>
1037
+ ${this.showList && ((n = this.drawnFeatures) != null && n.length) ? F`<eox-drawtools-list
1038
+ .eoxMap=${$(this, u)}
1039
+ .olMap=${$(this, E)}
1040
+ .draw=${this.draw}
1041
+ .layer=${this.layer}
1042
+ .drawLayer=${this.drawLayer}
1043
+ .drawnFeatures=${this.drawnFeatures}
1044
+ .modify=${this.modify}
1045
+ .unstyled=${this.unstyled}
1046
+ @changed=${() => this.requestUpdate()}
1047
+ >
1048
+ </eox-drawtools-list>` : l}
772
1049
  `;
773
1050
  }
774
1051
  }
775
- v = new WeakMap(), P = new WeakMap();
776
- customElements.define("eox-drawtools", kt);
1052
+ u = new WeakMap(), E = new WeakMap();
1053
+ customElements.define("eox-drawtools", jt);
777
1054
  export {
778
- kt as EOxDrawTools
1055
+ jt as EOxDrawTools
779
1056
  };