@eox/drawtools 0.3.0 → 0.3.1

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.
@@ -6,7 +6,7 @@ var p = (r, t, e) => ($t(r, typeof t != "symbol" ? t + "" : t, e), e);
6
6
  * Copyright 2019 Google LLC
7
7
  * SPDX-License-Identifier: BSD-3-Clause
8
8
  */
9
- const D = window, Q = D.ShadowRoot && (D.ShadyCSS === void 0 || D.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ht = Symbol(), G = /* @__PURE__ */ new WeakMap();
9
+ const k = window, Q = k.ShadowRoot && (k.ShadyCSS === void 0 || k.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ht = Symbol(), X = /* @__PURE__ */ new WeakMap();
10
10
  let vt = class {
11
11
  constructor(t, e, i) {
12
12
  if (this._$cssResult$ = !0, i !== ht)
@@ -18,7 +18,7 @@ let vt = class {
18
18
  const e = this.t;
19
19
  if (Q && t === void 0) {
20
20
  const i = e !== void 0 && e.length === 1;
21
- i && (t = G.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && G.set(e, t));
21
+ i && (t = X.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && X.set(e, t));
22
22
  }
23
23
  return t;
24
24
  }
@@ -28,10 +28,10 @@ let vt = class {
28
28
  };
29
29
  const yt = (r) => new vt(typeof r == "string" ? r : r + "", void 0, ht), ft = (r, t) => {
30
30
  Q ? r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet) : t.forEach((e) => {
31
- const i = document.createElement("style"), s = D.litNonce;
31
+ const i = document.createElement("style"), s = k.litNonce;
32
32
  s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
33
33
  });
34
- }, X = Q ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
34
+ }, G = Q ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
35
35
  let e = "";
36
36
  for (const i of t.cssRules)
37
37
  e += i.cssText;
@@ -43,7 +43,7 @@ const yt = (r) => new vt(typeof r == "string" ? r : r + "", void 0, ht), ft = (r
43
43
  * SPDX-License-Identifier: BSD-3-Clause
44
44
  */
45
45
  var j;
46
- const k = window, Y = k.trustedTypes, gt = Y ? Y.emptyScript : "", tt = k.reactiveElementPolyfillSupport, K = { toAttribute(r, t) {
46
+ const R = window, Y = R.trustedTypes, gt = Y ? Y.emptyScript : "", tt = R.reactiveElementPolyfillSupport, K = { toAttribute(r, t) {
47
47
  switch (t) {
48
48
  case Boolean:
49
49
  r = r ? gt : null;
@@ -122,9 +122,9 @@ let w = class extends HTMLElement {
122
122
  if (Array.isArray(t)) {
123
123
  const i = new Set(t.flat(1 / 0).reverse());
124
124
  for (const s of i)
125
- e.unshift(X(s));
125
+ e.unshift(G(s));
126
126
  } else
127
- t !== void 0 && e.push(X(t));
127
+ t !== void 0 && e.push(G(t));
128
128
  return e;
129
129
  }
130
130
  static _$Ep(t, e) {
@@ -251,25 +251,25 @@ let w = class extends HTMLElement {
251
251
  firstUpdated(t) {
252
252
  }
253
253
  };
254
- w[J] = !0, w.elementProperties = /* @__PURE__ */ new Map(), w.elementStyles = [], w.shadowRootOptions = { mode: "open" }, tt == null || tt({ ReactiveElement: w }), ((j = k.reactiveElementVersions) !== null && j !== void 0 ? j : k.reactiveElementVersions = []).push("1.6.2");
254
+ w[J] = !0, w.elementProperties = /* @__PURE__ */ new Map(), w.elementStyles = [], w.shadowRootOptions = { mode: "open" }, tt == null || tt({ ReactiveElement: w }), ((j = R.reactiveElementVersions) !== null && j !== void 0 ? j : R.reactiveElementVersions = []).push("1.6.2");
255
255
  /**
256
256
  * @license
257
257
  * Copyright 2017 Google LLC
258
258
  * SPDX-License-Identifier: BSD-3-Clause
259
259
  */
260
260
  var B;
261
- const R = window, E = R.trustedTypes, et = E ? E.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Z = "$lit$", f = `lit$${(Math.random() + "").slice(9)}$`, ct = "?" + f, At = `<${ct}>`, m = document, U = () => m.createComment(""), M = (r) => r === null || typeof r != "object" && typeof r != "function", ut = Array.isArray, mt = (r) => ut(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", F = `[
261
+ const I = window, E = I.trustedTypes, et = E ? E.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Z = "$lit$", f = `lit$${(Math.random() + "").slice(9)}$`, ct = "?" + f, At = `<${ct}>`, m = document, U = () => m.createComment(""), M = (r) => r === null || typeof r != "object" && typeof r != "function", ut = Array.isArray, mt = (r) => ut(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", F = `[
262
262
  \f\r]`, x = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, it = /-->/g, st = />/g, g = RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^
263
263
  \f\r"'\`<>=]|("|')|))|$)`, "g"), rt = /'/g, nt = /"/g, pt = /^(?:script|style|textarea|title)$/i, wt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), Et = wt(1), S = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), ot = /* @__PURE__ */ new WeakMap(), A = m.createTreeWalker(m, 129, null, !1), St = (r, t) => {
264
264
  const e = r.length - 1, i = [];
265
265
  let s, o = t === 2 ? "<svg>" : "", n = x;
266
266
  for (let l = 0; l < e; l++) {
267
267
  const a = r[l];
268
- let y, h, c = -1, _ = 0;
269
- for (; _ < a.length && (n.lastIndex = _, h = n.exec(a), h !== null); )
270
- _ = n.lastIndex, n === x ? h[1] === "!--" ? n = it : h[1] !== void 0 ? n = st : h[2] !== void 0 ? (pt.test(h[2]) && (s = RegExp("</" + h[2], "g")), n = g) : h[3] !== void 0 && (n = g) : n === g ? h[0] === ">" ? (n = s ?? x, c = -1) : h[1] === void 0 ? c = -2 : (c = n.lastIndex - h[2].length, y = h[1], n = h[3] === void 0 ? g : h[3] === '"' ? nt : rt) : n === nt || n === rt ? n = g : n === it || n === st ? n = x : (n = g, s = void 0);
271
- const O = n === g && r[l + 1].startsWith("/>") ? " " : "";
272
- o += n === x ? a + At : c >= 0 ? (i.push(y), a.slice(0, c) + Z + a.slice(c) + f + O) : a + f + (c === -2 ? (i.push(void 0), l) : O);
268
+ let y, h, c = -1, $ = 0;
269
+ for (; $ < a.length && (n.lastIndex = $, h = n.exec(a), h !== null); )
270
+ $ = n.lastIndex, n === x ? h[1] === "!--" ? n = it : h[1] !== void 0 ? n = st : h[2] !== void 0 ? (pt.test(h[2]) && (s = RegExp("</" + h[2], "g")), n = g) : h[3] !== void 0 && (n = g) : n === g ? h[0] === ">" ? (n = s ?? x, c = -1) : h[1] === void 0 ? c = -2 : (c = n.lastIndex - h[2].length, y = h[1], n = h[3] === void 0 ? g : h[3] === '"' ? nt : rt) : n === nt || n === rt ? n = g : n === it || n === st ? n = x : (n = g, s = void 0);
271
+ const T = n === g && r[l + 1].startsWith("/>") ? " " : "";
272
+ o += n === x ? a + At : c >= 0 ? (i.push(y), a.slice(0, c) + Z + a.slice(c) + f + T) : a + f + (c === -2 ? (i.push(void 0), l) : T);
273
273
  }
274
274
  const d = o + (r[e] || "<?>") + (t === 2 ? "</svg>" : "");
275
275
  if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
@@ -292,10 +292,10 @@ class H {
292
292
  const h = [];
293
293
  for (const c of s.getAttributeNames())
294
294
  if (c.endsWith(Z) || c.startsWith(f)) {
295
- const _ = y[n++];
296
- if (h.push(c), _ !== void 0) {
297
- const O = s.getAttribute(_.toLowerCase() + Z).split(f), T = /([.?@])?(.*)/.exec(_);
298
- l.push({ type: 1, index: o, name: T[2], strings: O, ctor: T[1] === "." ? Ct : T[1] === "?" ? Pt : T[1] === "@" ? Ut : I });
295
+ const $ = y[n++];
296
+ if (h.push(c), $ !== void 0) {
297
+ const T = s.getAttribute($.toLowerCase() + Z).split(f), D = /([.?@])?(.*)/.exec($);
298
+ l.push({ type: 1, index: o, name: D[2], strings: T, ctor: D[1] === "." ? Ct : D[1] === "?" ? Pt : D[1] === "@" ? Ut : L });
299
299
  } else
300
300
  l.push({ type: 6, index: o });
301
301
  }
@@ -306,8 +306,8 @@ class H {
306
306
  const h = s.textContent.split(f), c = h.length - 1;
307
307
  if (c > 0) {
308
308
  s.textContent = E ? E.emptyScript : "";
309
- for (let _ = 0; _ < c; _++)
310
- s.append(h[_], U()), A.nextNode(), l.push({ type: 2, index: ++o });
309
+ for (let $ = 0; $ < c; $++)
310
+ s.append(h[$], U()), A.nextNode(), l.push({ type: 2, index: ++o });
311
311
  s.append(h[c], U());
312
312
  }
313
313
  }
@@ -431,7 +431,7 @@ class N {
431
431
  this._$AM === void 0 && (this._$Cp = t, (e = this._$AP) === null || e === void 0 || e.call(this, t));
432
432
  }
433
433
  }
434
- class I {
434
+ class L {
435
435
  constructor(t, e, i, s, o) {
436
436
  this.type = 1, this._$AH = u, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = u;
437
437
  }
@@ -458,7 +458,7 @@ class I {
458
458
  t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
459
459
  }
460
460
  }
461
- class Ct extends I {
461
+ class Ct extends L {
462
462
  constructor() {
463
463
  super(...arguments), this.type = 3;
464
464
  }
@@ -467,7 +467,7 @@ class Ct extends I {
467
467
  }
468
468
  }
469
469
  const xt = E ? E.emptyScript : "";
470
- class Pt extends I {
470
+ class Pt extends L {
471
471
  constructor() {
472
472
  super(...arguments), this.type = 4;
473
473
  }
@@ -475,7 +475,7 @@ class Pt extends I {
475
475
  t && t !== u ? this.element.setAttribute(this.name, xt) : this.element.removeAttribute(this.name);
476
476
  }
477
477
  }
478
- class Ut extends I {
478
+ class Ut extends L {
479
479
  constructor(t, e, i, s, o) {
480
480
  super(t, e, i, s, o), this.type = 5;
481
481
  }
@@ -502,8 +502,8 @@ class Mt {
502
502
  b(this, t);
503
503
  }
504
504
  }
505
- const lt = R.litHtmlPolyfillSupport;
506
- lt == null || lt(H, N), ((B = R.litHtmlVersions) !== null && B !== void 0 ? B : R.litHtmlVersions = []).push("2.7.4");
505
+ const lt = I.litHtmlPolyfillSupport;
506
+ lt == null || lt(H, N), ((B = I.litHtmlVersions) !== null && B !== void 0 ? B : I.litHtmlVersions = []).push("2.7.4");
507
507
  const Ht = (r, t, e) => {
508
508
  var i, s;
509
509
  const o = (i = e == null ? void 0 : e.renderBefore) !== null && i !== void 0 ? i : t;
@@ -574,7 +574,7 @@ const Ot = (r, t) => t.kind === "method" && t.descriptor && !("value" in t.descr
574
574
  } }, Tt = (r, t, e) => {
575
575
  t.constructor.createProperty(e, r);
576
576
  };
577
- function L(r) {
577
+ function O(r) {
578
578
  return (t, e) => e !== void 0 ? Tt(r, t, e) : Ot(r, t);
579
579
  }
580
580
  /**
@@ -583,7 +583,7 @@ function L(r) {
583
583
  * SPDX-License-Identifier: BSD-3-Clause
584
584
  */
585
585
  function C(r) {
586
- return L({ ...r, state: !0 });
586
+ return O({ ...r, state: !0 });
587
587
  }
588
588
  /**
589
589
  * @license
@@ -596,13 +596,14 @@ const Dt = `
596
596
  :host {
597
597
  display: block;
598
598
  }
599
+ `, kt = `
599
600
  `;
600
- var kt = Object.defineProperty, Rt = Object.getOwnPropertyDescriptor, v = (r, t, e, i) => {
601
- for (var s = i > 1 ? void 0 : i ? Rt(t, e) : t, o = r.length - 1, n; o >= 0; o--)
601
+ var Rt = Object.defineProperty, It = Object.getOwnPropertyDescriptor, v = (r, t, e, i) => {
602
+ for (var s = i > 1 ? void 0 : i ? It(t, e) : t, o = r.length - 1, n; o >= 0; o--)
602
603
  (n = r[o]) && (s = (i ? n(t, e, s) : n(s)) || s);
603
- return i && s && kt(t, e, s), s;
604
+ return i && s && Rt(t, e, s), s;
604
605
  };
605
- let $ = class extends P {
606
+ let _ = class extends P {
606
607
  constructor() {
607
608
  super(...arguments);
608
609
  p(this, "_layerId");
@@ -614,6 +615,7 @@ let $ = class extends P {
614
615
  p(this, "multipleFeatures");
615
616
  p(this, "for");
616
617
  p(this, "layer");
618
+ p(this, "unstyled");
617
619
  p(this, "_draw");
618
620
  p(this, "_modify");
619
621
  }
@@ -646,6 +648,7 @@ let $ = class extends P {
646
648
  return this._eoxMap = t, this._olMap = t.map, this._layerId = this.layer, this._drawLayer = this._olMap.getLayers().getArray().find((e) => e.get("id") === this._layerId), this.requestUpdate(), Et`
647
649
  <style>
648
650
  ${Dt}
651
+ ${!this.unstyled && kt}
649
652
  </style>
650
653
  <div>
651
654
  <slot></slot>
@@ -667,34 +670,37 @@ let $ = class extends P {
667
670
  };
668
671
  v([
669
672
  C()
670
- ], $.prototype, "_layerId", 2);
673
+ ], _.prototype, "_layerId", 2);
671
674
  v([
672
675
  C()
673
- ], $.prototype, "_eoxMap", 2);
676
+ ], _.prototype, "_eoxMap", 2);
674
677
  v([
675
678
  C()
676
- ], $.prototype, "_olMap", 2);
679
+ ], _.prototype, "_olMap", 2);
677
680
  v([
678
681
  C()
679
- ], $.prototype, "_drawLayer", 2);
682
+ ], _.prototype, "_drawLayer", 2);
680
683
  v([
681
684
  C()
682
- ], $.prototype, "_drawnFeatures", 2);
685
+ ], _.prototype, "_drawnFeatures", 2);
683
686
  v([
684
687
  C()
685
- ], $.prototype, "_currentlyDrawing", 2);
688
+ ], _.prototype, "_currentlyDrawing", 2);
686
689
  v([
687
- L({ type: Boolean })
688
- ], $.prototype, "multipleFeatures", 2);
690
+ O({ type: Boolean })
691
+ ], _.prototype, "multipleFeatures", 2);
689
692
  v([
690
- L()
691
- ], $.prototype, "for", 2);
693
+ O()
694
+ ], _.prototype, "for", 2);
692
695
  v([
693
- L()
694
- ], $.prototype, "layer", 2);
695
- $ = v([
696
+ O()
697
+ ], _.prototype, "layer", 2);
698
+ v([
699
+ O({ type: Boolean })
700
+ ], _.prototype, "unstyled", 2);
701
+ _ = v([
696
702
  Nt("eox-drawtools")
697
- ], $);
703
+ ], _);
698
704
  export {
699
- $ as EOxDrawTools
705
+ _ as EOxDrawTools
700
706
  };
@@ -1,22 +1,22 @@
1
- (function(d,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(d=typeof globalThis<"u"?globalThis:d||self,_(d["eox-drawtools"]={}))})(this,function(d){"use strict";var kt=Object.defineProperty;var Rt=(d,_,f)=>_ in d?kt(d,_,{enumerable:!0,configurable:!0,writable:!0,value:f}):d[_]=f;var $=(d,_,f)=>(Rt(d,typeof _!="symbol"?_+"":_,f),f);/**
1
+ (function(d,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(d=typeof globalThis<"u"?globalThis:d||self,_(d["eox-drawtools"]={}))})(this,function(d){"use strict";var Rt=Object.defineProperty;var It=(d,_,f)=>_ in d?Rt(d,_,{enumerable:!0,configurable:!0,writable:!0,value:f}):d[_]=f;var $=(d,_,f)=>(It(d,typeof _!="symbol"?_+"":_,f),f);/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const _=window,f=_.ShadowRoot&&(_.ShadyCSS===void 0||_.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,G=Symbol(),X=new WeakMap;let _t=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==G)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(f&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=X.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&X.set(e,t))}return t}toString(){return this.cssText}};const $t=r=>new _t(typeof r=="string"?r:r+"",void 0,G),vt=(r,t)=>{f?r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{const i=document.createElement("style"),s=_.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,r.appendChild(i)})},Y=f?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return $t(e)})(r):r;/**
5
+ */const _=window,f=_.ShadowRoot&&(_.ShadyCSS===void 0||_.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,X=Symbol(),G=new WeakMap;let _t=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==X)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(f&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=G.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&G.set(e,t))}return t}toString(){return this.cssText}};const $t=r=>new _t(typeof r=="string"?r:r+"",void 0,X),vt=(r,t)=>{f?r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{const i=document.createElement("style"),s=_.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,r.appendChild(i)})},Y=f?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return $t(e)})(r):r;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */var z;const N=window,tt=N.trustedTypes,yt=tt?tt.emptyScript:"",et=N.reactiveElementPolyfillSupport,B={toAttribute(r,t){switch(t){case Boolean:r=r?yt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},it=(r,t)=>t!==r&&(t==t||r==r),F={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:it},q="finalized";let S=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((e,i)=>{const s=this._$Ep(i,e);s!==void 0&&(this._$Ev.set(s,i),t.push(s))}),t}static createProperty(t,e=F){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i=typeof t=="symbol"?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);s!==void 0&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const o=this[t];this[e]=s,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||F}static finalize(){if(this.hasOwnProperty(q))return!1;this[q]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,i=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const s of i)this.createProperty(s,e[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)e.unshift(Y(s))}else t!==void 0&&e.push(Y(t));return e}static _$Ep(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,i;((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))}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;const e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return vt(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostConnected)===null||i===void 0?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostDisconnected)===null||i===void 0?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=F){var s;const o=this.constructor._$Ep(t,i);if(o!==void 0&&i.reflect===!0){const n=(((s=i.converter)===null||s===void 0?void 0:s.toAttribute)!==void 0?i.converter:B).toAttribute(e,i.type);this._$El=t,n==null?this.removeAttribute(o):this.setAttribute(o,n),this._$El=null}}_$AK(t,e){var i;const s=this.constructor,o=s._$Ev.get(t);if(o!==void 0&&this._$El!==o){const n=s.getPropertyOptions(o),u=typeof n.converter=="function"?{fromAttribute:n.converter}:((i=n.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?n.converter:B;this._$El=o,this[o]=u.fromAttribute(e,n.type),this._$El=null}}requestUpdate(t,e,i){let s=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||it)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((s,o)=>this[o]=s),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$ES)===null||t===void 0||t.forEach(s=>{var o;return(o=s.hostUpdate)===null||o===void 0?void 0:o.call(s)}),this.update(i)):this._$Ek()}catch(s){throw e=!1,this._$Ek(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(i=>{var s;return(s=i.hostUpdated)===null||s===void 0?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,i)=>this._$EO(i,this[i],e)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};S[q]=!0,S.elementProperties=new Map,S.elementStyles=[],S.shadowRootOptions={mode:"open"},et==null||et({ReactiveElement:S}),((z=N.reactiveElementVersions)!==null&&z!==void 0?z:N.reactiveElementVersions=[]).push("1.6.2");/**
9
+ */var z;const k=window,tt=k.trustedTypes,yt=tt?tt.emptyScript:"",et=k.reactiveElementPolyfillSupport,B={toAttribute(r,t){switch(t){case Boolean:r=r?yt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},it=(r,t)=>t!==r&&(t==t||r==r),F={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:it},q="finalized";let S=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((e,i)=>{const s=this._$Ep(i,e);s!==void 0&&(this._$Ev.set(s,i),t.push(s))}),t}static createProperty(t,e=F){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i=typeof t=="symbol"?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);s!==void 0&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const o=this[t];this[e]=s,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||F}static finalize(){if(this.hasOwnProperty(q))return!1;this[q]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,i=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const s of i)this.createProperty(s,e[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)e.unshift(Y(s))}else t!==void 0&&e.push(Y(t));return e}static _$Ep(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,i;((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))}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;const e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return vt(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostConnected)===null||i===void 0?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostDisconnected)===null||i===void 0?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=F){var s;const o=this.constructor._$Ep(t,i);if(o!==void 0&&i.reflect===!0){const n=(((s=i.converter)===null||s===void 0?void 0:s.toAttribute)!==void 0?i.converter:B).toAttribute(e,i.type);this._$El=t,n==null?this.removeAttribute(o):this.setAttribute(o,n),this._$El=null}}_$AK(t,e){var i;const s=this.constructor,o=s._$Ev.get(t);if(o!==void 0&&this._$El!==o){const n=s.getPropertyOptions(o),u=typeof n.converter=="function"?{fromAttribute:n.converter}:((i=n.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?n.converter:B;this._$El=o,this[o]=u.fromAttribute(e,n.type),this._$El=null}}requestUpdate(t,e,i){let s=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||it)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((s,o)=>this[o]=s),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$ES)===null||t===void 0||t.forEach(s=>{var o;return(o=s.hostUpdate)===null||o===void 0?void 0:o.call(s)}),this.update(i)):this._$Ek()}catch(s){throw e=!1,this._$Ek(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(i=>{var s;return(s=i.hostUpdated)===null||s===void 0?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,i)=>this._$EO(i,this[i],e)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};S[q]=!0,S.elementProperties=new Map,S.elementStyles=[],S.shadowRootOptions={mode:"open"},et==null||et({ReactiveElement:S}),((z=k.reactiveElementVersions)!==null&&z!==void 0?z:k.reactiveElementVersions=[]).push("1.6.2");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */var V;const k=window,b=k.trustedTypes,st=b?b.createPolicy("lit-html",{createHTML:r=>r}):void 0,W="$lit$",m=`lit$${(Math.random()+"").slice(9)}$`,rt="?"+m,ft=`<${rt}>`,A=document,O=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",nt=Array.isArray,gt=r=>nt(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",K=`[
13
+ */var V;const R=window,b=R.trustedTypes,st=b?b.createPolicy("lit-html",{createHTML:r=>r}):void 0,W="$lit$",m=`lit$${(Math.random()+"").slice(9)}$`,rt="?"+m,ft=`<${rt}>`,A=document,T=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",nt=Array.isArray,gt=r=>nt(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",K=`[
14
14
  \f\r]`,D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ot=/-->/g,lt=/>/g,w=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),at=/'/g,ht=/"/g,dt=/^(?:script|style|textarea|title)$/i,mt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),At=mt(1),C=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),ct=new WeakMap,E=A.createTreeWalker(A,129,null,!1),wt=(r,t)=>{const e=r.length-1,i=[];let s,o=t===2?"<svg>":"",n=D;for(let l=0;l<e;l++){const a=r[l];let g,h,p=-1,v=0;for(;v<a.length&&(n.lastIndex=v,h=n.exec(a),h!==null);)v=n.lastIndex,n===D?h[1]==="!--"?n=ot:h[1]!==void 0?n=lt:h[2]!==void 0?(dt.test(h[2])&&(s=RegExp("</"+h[2],"g")),n=w):h[3]!==void 0&&(n=w):n===w?h[0]===">"?(n=s??D,p=-1):h[1]===void 0?p=-2:(p=n.lastIndex-h[2].length,g=h[1],n=h[3]===void 0?w:h[3]==='"'?ht:at):n===ht||n===at?n=w:n===ot||n===lt?n=D:(n=w,s=void 0);const L=n===w&&r[l+1].startsWith("/>")?" ":"";o+=n===D?a+ft:p>=0?(i.push(g),a.slice(0,p)+W+a.slice(p)+m+L):a+m+(p===-2?(i.push(void 0),l):L)}const u=o+(r[e]||"<?>")+(t===2?"</svg>":"");if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return[st!==void 0?st.createHTML(u):u,i]};class U{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,n=0;const u=t.length-1,l=this.parts,[a,g]=wt(t,e);if(this.el=U.createElement(a,i),E.currentNode=this.el.content,e===2){const h=this.el.content,p=h.firstChild;p.remove(),h.append(...p.childNodes)}for(;(s=E.nextNode())!==null&&l.length<u;){if(s.nodeType===1){if(s.hasAttributes()){const h=[];for(const p of s.getAttributeNames())if(p.endsWith(W)||p.startsWith(m)){const v=g[n++];if(h.push(p),v!==void 0){const L=s.getAttribute(v.toLowerCase()+W).split(m),j=/([.?@])?(.*)/.exec(v);l.push({type:1,index:o,name:j[2],strings:L,ctor:j[1]==="."?St:j[1]==="?"?Ct:j[1]==="@"?xt:R})}else l.push({type:6,index:o})}for(const p of h)s.removeAttribute(p)}if(dt.test(s.tagName)){const h=s.textContent.split(m),p=h.length-1;if(p>0){s.textContent=b?b.emptyScript:"";for(let v=0;v<p;v++)s.append(h[v],O()),E.nextNode(),l.push({type:2,index:++o});s.append(h[p],O())}}}else if(s.nodeType===8)if(s.data===rt)l.push({type:2,index:o});else{let h=-1;for(;(h=s.data.indexOf(m,h+1))!==-1;)l.push({type:7,index:o}),h+=m.length-1}o++}}static createElement(t,e){const i=A.createElement("template");return i.innerHTML=t,i}}function x(r,t,e=r,i){var s,o,n,u;if(t===C)return t;let l=i!==void 0?(s=e._$Co)===null||s===void 0?void 0:s[i]:e._$Cl;const a=P(t)?void 0:t._$litDirective$;return(l==null?void 0:l.constructor)!==a&&((o=l==null?void 0:l._$AO)===null||o===void 0||o.call(l,!1),a===void 0?l=void 0:(l=new a(r),l._$AT(r,e,i)),i!==void 0?((n=(u=e)._$Co)!==null&&n!==void 0?n:u._$Co=[])[i]=l:e._$Cl=l),l!==void 0&&(t=x(r,l._$AS(r,t.values),l,i)),t}class Et{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:s}=this._$AD,o=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:A).importNode(i,!0);E.currentNode=o;let n=E.nextNode(),u=0,l=0,a=s[0];for(;a!==void 0;){if(u===a.index){let g;a.type===2?g=new M(n,n.nextSibling,this,t):a.type===1?g=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(g=new Tt(n,this,t)),this._$AV.push(g),a=s[++l]}u!==(a==null?void 0:a.index)&&(n=E.nextNode(),u++)}return E.currentNode=A,o}v(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class M{constructor(t,e,i,s){var o;this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cp=(o=s==null?void 0:s.isConnected)===null||o===void 0||o}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=x(this,t,e),P(t)?t===c||t==null||t===""?(this._$AH!==c&&this._$AR(),this._$AH=c):t!==this._$AH&&t!==C&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):gt(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==c&&P(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:s}=t,o=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=U.createElement(s.h,this.options)),s);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===o)this._$AH.v(i);else{const n=new Et(o,this),u=n.u(this.options);n.v(i),this.$(u),this._$AH=n}}_$AC(t){let e=ct.get(t.strings);return e===void 0&&ct.set(t.strings,e=new U(t)),e}T(t){nt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new M(this.k(O()),this.k(O()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cp=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}}class R{constructor(t,e,i,s,o){this.type=1,this._$AH=c,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=c}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const o=this.strings;let n=!1;if(o===void 0)t=x(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==C,n&&(this._$AH=t);else{const u=t;let l,a;for(t=o[0],l=0;l<o.length-1;l++)a=x(this,u[i+l],e,l),a===C&&(a=this._$AH[l]),n||(n=!P(a)||a!==this._$AH[l]),a===c?t=c:t!==c&&(t+=(a??"")+o[l+1]),this._$AH[l]=a}n&&!s&&this.j(t)}j(t){t===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class St extends R{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===c?void 0:t}}const bt=b?b.emptyScript:"";class Ct extends R{constructor(){super(...arguments),this.type=4}j(t){t&&t!==c?this.element.setAttribute(this.name,bt):this.element.removeAttribute(this.name)}}class xt extends R{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){var i;if((t=(i=x(this,t,e,0))!==null&&i!==void 0?i:c)===C)return;const s=this._$AH,o=t===c&&s!==c||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==c&&(s===c||o);o&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;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)}}class Tt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){x(this,t)}}const ut=k.litHtmlPolyfillSupport;ut==null||ut(U,M),((V=k.litHtmlVersions)!==null&&V!==void 0?V:k.litHtmlVersions=[]).push("2.7.4");const Ot=(r,t,e)=>{var i,s;const o=(i=e==null?void 0:e.renderBefore)!==null&&i!==void 0?i:t;let n=o._$litPart$;if(n===void 0){const u=(s=e==null?void 0:e.renderBefore)!==null&&s!==void 0?s:null;o._$litPart$=n=new M(t.insertBefore(O(),u),u,void 0,e??{})}return n._$AI(r),n};/**
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),at=/'/g,ht=/"/g,dt=/^(?:script|style|textarea|title)$/i,mt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),At=mt(1),C=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),ct=new WeakMap,E=A.createTreeWalker(A,129,null,!1),wt=(r,t)=>{const e=r.length-1,i=[];let s,o=t===2?"<svg>":"",n=D;for(let l=0;l<e;l++){const a=r[l];let g,h,p=-1,y=0;for(;y<a.length&&(n.lastIndex=y,h=n.exec(a),h!==null);)y=n.lastIndex,n===D?h[1]==="!--"?n=ot:h[1]!==void 0?n=lt:h[2]!==void 0?(dt.test(h[2])&&(s=RegExp("</"+h[2],"g")),n=w):h[3]!==void 0&&(n=w):n===w?h[0]===">"?(n=s??D,p=-1):h[1]===void 0?p=-2:(p=n.lastIndex-h[2].length,g=h[1],n=h[3]===void 0?w:h[3]==='"'?ht:at):n===ht||n===at?n=w:n===ot||n===lt?n=D:(n=w,s=void 0);const L=n===w&&r[l+1].startsWith("/>")?" ":"";o+=n===D?a+ft:p>=0?(i.push(g),a.slice(0,p)+W+a.slice(p)+m+L):a+m+(p===-2?(i.push(void 0),l):L)}const u=o+(r[e]||"<?>")+(t===2?"</svg>":"");if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return[st!==void 0?st.createHTML(u):u,i]};class U{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,n=0;const u=t.length-1,l=this.parts,[a,g]=wt(t,e);if(this.el=U.createElement(a,i),E.currentNode=this.el.content,e===2){const h=this.el.content,p=h.firstChild;p.remove(),h.append(...p.childNodes)}for(;(s=E.nextNode())!==null&&l.length<u;){if(s.nodeType===1){if(s.hasAttributes()){const h=[];for(const p of s.getAttributeNames())if(p.endsWith(W)||p.startsWith(m)){const y=g[n++];if(h.push(p),y!==void 0){const L=s.getAttribute(y.toLowerCase()+W).split(m),j=/([.?@])?(.*)/.exec(y);l.push({type:1,index:o,name:j[2],strings:L,ctor:j[1]==="."?St:j[1]==="?"?Ct:j[1]==="@"?xt:I})}else l.push({type:6,index:o})}for(const p of h)s.removeAttribute(p)}if(dt.test(s.tagName)){const h=s.textContent.split(m),p=h.length-1;if(p>0){s.textContent=b?b.emptyScript:"";for(let y=0;y<p;y++)s.append(h[y],T()),E.nextNode(),l.push({type:2,index:++o});s.append(h[p],T())}}}else if(s.nodeType===8)if(s.data===rt)l.push({type:2,index:o});else{let h=-1;for(;(h=s.data.indexOf(m,h+1))!==-1;)l.push({type:7,index:o}),h+=m.length-1}o++}}static createElement(t,e){const i=A.createElement("template");return i.innerHTML=t,i}}function x(r,t,e=r,i){var s,o,n,u;if(t===C)return t;let l=i!==void 0?(s=e._$Co)===null||s===void 0?void 0:s[i]:e._$Cl;const a=P(t)?void 0:t._$litDirective$;return(l==null?void 0:l.constructor)!==a&&((o=l==null?void 0:l._$AO)===null||o===void 0||o.call(l,!1),a===void 0?l=void 0:(l=new a(r),l._$AT(r,e,i)),i!==void 0?((n=(u=e)._$Co)!==null&&n!==void 0?n:u._$Co=[])[i]=l:e._$Cl=l),l!==void 0&&(t=x(r,l._$AS(r,t.values),l,i)),t}class Et{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:s}=this._$AD,o=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:A).importNode(i,!0);E.currentNode=o;let n=E.nextNode(),u=0,l=0,a=s[0];for(;a!==void 0;){if(u===a.index){let g;a.type===2?g=new M(n,n.nextSibling,this,t):a.type===1?g=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(g=new Ot(n,this,t)),this._$AV.push(g),a=s[++l]}u!==(a==null?void 0:a.index)&&(n=E.nextNode(),u++)}return E.currentNode=A,o}v(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class M{constructor(t,e,i,s){var o;this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cp=(o=s==null?void 0:s.isConnected)===null||o===void 0||o}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=x(this,t,e),P(t)?t===c||t==null||t===""?(this._$AH!==c&&this._$AR(),this._$AH=c):t!==this._$AH&&t!==C&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):gt(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==c&&P(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:s}=t,o=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=U.createElement(s.h,this.options)),s);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===o)this._$AH.v(i);else{const n=new Et(o,this),u=n.u(this.options);n.v(i),this.$(u),this._$AH=n}}_$AC(t){let e=ct.get(t.strings);return e===void 0&&ct.set(t.strings,e=new U(t)),e}T(t){nt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new M(this.k(T()),this.k(T()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cp=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}}class I{constructor(t,e,i,s,o){this.type=1,this._$AH=c,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=c}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const o=this.strings;let n=!1;if(o===void 0)t=x(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==C,n&&(this._$AH=t);else{const u=t;let l,a;for(t=o[0],l=0;l<o.length-1;l++)a=x(this,u[i+l],e,l),a===C&&(a=this._$AH[l]),n||(n=!P(a)||a!==this._$AH[l]),a===c?t=c:t!==c&&(t+=(a??"")+o[l+1]),this._$AH[l]=a}n&&!s&&this.j(t)}j(t){t===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class St extends I{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===c?void 0:t}}const bt=b?b.emptyScript:"";class Ct extends I{constructor(){super(...arguments),this.type=4}j(t){t&&t!==c?this.element.setAttribute(this.name,bt):this.element.removeAttribute(this.name)}}class xt extends I{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){var i;if((t=(i=x(this,t,e,0))!==null&&i!==void 0?i:c)===C)return;const s=this._$AH,o=t===c&&s!==c||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==c&&(s===c||o);o&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;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)}}class Ot{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){x(this,t)}}const ut=R.litHtmlPolyfillSupport;ut==null||ut(U,M),((V=R.litHtmlVersions)!==null&&V!==void 0?V:R.litHtmlVersions=[]).push("2.7.4");const Tt=(r,t,e)=>{var i,s;const o=(i=e==null?void 0:e.renderBefore)!==null&&i!==void 0?i:t;let n=o._$litPart$;if(n===void 0){const u=(s=e==null?void 0:e.renderBefore)!==null&&s!==void 0?s:null;o._$litPart$=n=new M(t.insertBefore(T(),u),u,void 0,e??{})}return n._$AI(r),n};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
19
- */var J,Z;class H extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Ot(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return C}}H.finalized=!0,H._$litElement$=!0,(J=globalThis.litElementHydrateSupport)===null||J===void 0||J.call(globalThis,{LitElement:H});const pt=globalThis.litElementPolyfillSupport;pt==null||pt({LitElement:H}),((Z=globalThis.litElementVersions)!==null&&Z!==void 0?Z:globalThis.litElementVersions=[]).push("3.3.2");/**
19
+ */var J,Z;class H extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Tt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return C}}H.finalized=!0,H._$litElement$=!0,(J=globalThis.litElementHydrateSupport)===null||J===void 0||J.call(globalThis,{LitElement:H});const pt=globalThis.litElementPolyfillSupport;pt==null||pt({LitElement:H}),((Z=globalThis.litElementVersions)!==null&&Z!==void 0?Z:globalThis.litElementVersions=[]).push("3.3.2");/**
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
@@ -24,11 +24,11 @@
24
24
  * @license
25
25
  * Copyright 2017 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
- */const Dt=(r,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(e){e.createProperty(t.key,r)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,r)}},Ut=(r,t,e)=>{t.constructor.createProperty(e,r)};function I(r){return(t,e)=>e!==void 0?Ut(r,t,e):Dt(r,t)}/**
27
+ */const Dt=(r,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(e){e.createProperty(t.key,r)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,r)}},Ut=(r,t,e)=>{t.constructor.createProperty(e,r)};function N(r){return(t,e)=>e!==void 0?Ut(r,t,e):Dt(r,t)}/**
28
28
  * @license
29
29
  * Copyright 2017 Google LLC
30
30
  * SPDX-License-Identifier: BSD-3-Clause
31
- */function T(r){return I({...r,state:!0})}/**
31
+ */function O(r){return N({...r,state:!0})}/**
32
32
  * @license
33
33
  * Copyright 2021 Google LLC
34
34
  * SPDX-License-Identifier: BSD-3-Clause
@@ -36,9 +36,11 @@
36
36
  :host {
37
37
  display: block;
38
38
  }
39
- `;var Ht=Object.defineProperty,Nt=Object.getOwnPropertyDescriptor,y=(r,t,e,i)=>{for(var s=i>1?void 0:i?Nt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&Ht(t,e,s),s};d.EOxDrawTools=class extends H{constructor(){super(...arguments);$(this,"_layerId");$(this,"_eoxMap");$(this,"_olMap");$(this,"_drawLayer");$(this,"_drawnFeatures",[]);$(this,"_currentlyDrawing");$(this,"multipleFeatures");$(this,"for");$(this,"layer");$(this,"_draw");$(this,"_modify")}_startDrawing(){this._eoxMap.addDraw(this._layerId,{id:"drawInteraction",type:"Polygon"}),this._draw=this._eoxMap.interactions.drawInteraction,this._modify=this._eoxMap.interactions.drawInteraction_modify,this._draw.on("drawend",e=>this._onDrawEnd(e)),this._modify.on("modifyend",e=>this._onModifyEnd(e)),this._currentlyDrawing=!0,this.requestUpdate()}_discardDrawing(){this._drawnFeatures=[],this._eoxMap.removeInteraction("drawInteraction"),this._drawLayer.getSource().clear(),this._currentlyDrawing=!1,this.requestUpdate()}_onDrawEnd(e){console.log(e),this._emitDrawnFeatures(),this._eoxMap.removeInteraction("drawInteraction"),this._currentlyDrawing=!1,this.requestUpdate()}_onModifyEnd(e){console.log(e),this._emitDrawnFeatures()}_emitDrawnFeatures(){setTimeout(()=>{this._drawnFeatures=this._drawLayer.getSource().getFeatures(),this.requestUpdate();const e=new CustomEvent("drawupdate",{detail:this._drawnFeatures});this.dispatchEvent(e)},0)}render(){const e=document.querySelector(this.for);return this._eoxMap=e,this._olMap=e.map,this._layerId=this.layer,this._drawLayer=this._olMap.getLayers().getArray().find(i=>i.get("id")===this._layerId),this.requestUpdate(),At`
39
+ `,Ht=`
40
+ `;var Nt=Object.defineProperty,kt=Object.getOwnPropertyDescriptor,v=(r,t,e,i)=>{for(var s=i>1?void 0:i?kt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&Nt(t,e,s),s};d.EOxDrawTools=class extends H{constructor(){super(...arguments);$(this,"_layerId");$(this,"_eoxMap");$(this,"_olMap");$(this,"_drawLayer");$(this,"_drawnFeatures",[]);$(this,"_currentlyDrawing");$(this,"multipleFeatures");$(this,"for");$(this,"layer");$(this,"unstyled");$(this,"_draw");$(this,"_modify")}_startDrawing(){this._eoxMap.addDraw(this._layerId,{id:"drawInteraction",type:"Polygon"}),this._draw=this._eoxMap.interactions.drawInteraction,this._modify=this._eoxMap.interactions.drawInteraction_modify,this._draw.on("drawend",e=>this._onDrawEnd(e)),this._modify.on("modifyend",e=>this._onModifyEnd(e)),this._currentlyDrawing=!0,this.requestUpdate()}_discardDrawing(){this._drawnFeatures=[],this._eoxMap.removeInteraction("drawInteraction"),this._drawLayer.getSource().clear(),this._currentlyDrawing=!1,this.requestUpdate()}_onDrawEnd(e){console.log(e),this._emitDrawnFeatures(),this._eoxMap.removeInteraction("drawInteraction"),this._currentlyDrawing=!1,this.requestUpdate()}_onModifyEnd(e){console.log(e),this._emitDrawnFeatures()}_emitDrawnFeatures(){setTimeout(()=>{this._drawnFeatures=this._drawLayer.getSource().getFeatures(),this.requestUpdate();const e=new CustomEvent("drawupdate",{detail:this._drawnFeatures});this.dispatchEvent(e)},0)}render(){const e=document.querySelector(this.for);return this._eoxMap=e,this._olMap=e.map,this._layerId=this.layer,this._drawLayer=this._olMap.getLayers().getArray().find(i=>i.get("id")===this._layerId),this.requestUpdate(),At`
40
41
  <style>
41
42
  ${Mt}
43
+ ${!this.unstyled&&Ht}
42
44
  </style>
43
45
  <div>
44
46
  <slot></slot>
@@ -55,4 +57,4 @@
55
57
  discard
56
58
  </button>
57
59
  </div>
58
- `}},y([T()],d.EOxDrawTools.prototype,"_layerId",2),y([T()],d.EOxDrawTools.prototype,"_eoxMap",2),y([T()],d.EOxDrawTools.prototype,"_olMap",2),y([T()],d.EOxDrawTools.prototype,"_drawLayer",2),y([T()],d.EOxDrawTools.prototype,"_drawnFeatures",2),y([T()],d.EOxDrawTools.prototype,"_currentlyDrawing",2),y([I({type:Boolean})],d.EOxDrawTools.prototype,"multipleFeatures",2),y([I()],d.EOxDrawTools.prototype,"for",2),y([I()],d.EOxDrawTools.prototype,"layer",2),d.EOxDrawTools=y([Pt("eox-drawtools")],d.EOxDrawTools),Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
60
+ `}},v([O()],d.EOxDrawTools.prototype,"_layerId",2),v([O()],d.EOxDrawTools.prototype,"_eoxMap",2),v([O()],d.EOxDrawTools.prototype,"_olMap",2),v([O()],d.EOxDrawTools.prototype,"_drawLayer",2),v([O()],d.EOxDrawTools.prototype,"_drawnFeatures",2),v([O()],d.EOxDrawTools.prototype,"_currentlyDrawing",2),v([N({type:Boolean})],d.EOxDrawTools.prototype,"multipleFeatures",2),v([N()],d.EOxDrawTools.prototype,"for",2),v([N()],d.EOxDrawTools.prototype,"layer",2),v([N({type:Boolean})],d.EOxDrawTools.prototype,"unstyled",2),d.EOxDrawTools=v([Pt("eox-drawtools")],d.EOxDrawTools),Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eox/drawtools",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
6
  "@eox/eslint-config": "^1.0.0",