@eox/drawtools
Advanced tools
Comparing version 0.4.2 to 0.5.0
@@ -1,10 +0,12 @@ | ||
var K = (r, t, e) => { | ||
var gt = Object.defineProperty; | ||
var ft = (r, t, e) => t in r ? gt(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e; | ||
var A = (r, t, e) => (ft(r, typeof t != "symbol" ? t + "" : t, e), e), J = (r, t, e) => { | ||
if (!t.has(r)) | ||
throw TypeError("Cannot " + e); | ||
}; | ||
var g = (r, t, e) => (K(r, t, "read from private field"), e ? e.call(r) : t.get(r)), V = (r, t, e) => { | ||
var $ = (r, t, e) => (J(r, t, "read from private field"), e ? e.call(r) : t.get(r)), V = (r, t, e) => { | ||
if (t.has(r)) | ||
throw TypeError("Cannot add the same private member more than once"); | ||
t instanceof WeakSet ? t.add(r) : t.set(r, e); | ||
}, L = (r, t, e, i) => (K(r, t, "write to private field"), i ? i.call(r, e) : t.set(r, e), e); | ||
}, R = (r, t, e, s) => (J(r, t, "write to private field"), s ? s.call(r, e) : t.set(r, e), e); | ||
/** | ||
@@ -15,6 +17,6 @@ * @license | ||
*/ | ||
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(); | ||
let vt = class { | ||
constructor(t, e, i) { | ||
if (this._$cssResult$ = !0, i !== at) | ||
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(); | ||
let _t = class { | ||
constructor(t, e, s) { | ||
if (this._$cssResult$ = !0, s !== at) | ||
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); | ||
@@ -26,5 +28,5 @@ this.cssText = t, this.t = e; | ||
const e = this.t; | ||
if (J && t === void 0) { | ||
const i = e !== void 0 && e.length === 1; | ||
i && (t = Q.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && Q.set(e, t)); | ||
if (Z && t === void 0) { | ||
const s = e !== void 0 && e.length === 1; | ||
s && (t = K.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && K.set(e, t)); | ||
} | ||
@@ -37,12 +39,15 @@ return t; | ||
}; | ||
const gt = (r) => new vt(typeof r == "string" ? r : r + "", void 0, at), yt = (r, t) => { | ||
J ? r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet) : t.forEach((e) => { | ||
const i = document.createElement("style"), s = O.litNonce; | ||
s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i); | ||
}); | ||
}, X = J ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => { | ||
const mt = (r) => new _t(typeof r == "string" ? r : r + "", void 0, at), wt = (r, t) => { | ||
if (Z) | ||
r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet); | ||
else | ||
for (const e of t) { | ||
const s = document.createElement("style"), i = T.litNonce; | ||
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s); | ||
} | ||
}, G = Z ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => { | ||
let e = ""; | ||
for (const i of t.cssRules) | ||
e += i.cssText; | ||
return gt(e); | ||
for (const s of t.cssRules) | ||
e += s.cssText; | ||
return mt(e); | ||
})(r) : r; | ||
@@ -54,7 +59,6 @@ /** | ||
*/ | ||
var R; | ||
const k = window, G = k.trustedTypes, _t = G ? G.emptyScript : "", Y = k.reactiveElementPolyfillSupport, q = { toAttribute(r, t) { | ||
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) { | ||
switch (t) { | ||
case Boolean: | ||
r = r ? _t : null; | ||
r = r ? Ct : null; | ||
break; | ||
@@ -84,47 +88,60 @@ case Object: | ||
return e; | ||
} }, ht = (r, t) => t !== r && (t == t || r == r), B = { attribute: !0, type: String, converter: q, reflect: !1, hasChanged: ht }, W = "finalized"; | ||
let A = class extends HTMLElement { | ||
constructor() { | ||
super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this.u(); | ||
} | ||
} }, ht = (r, t) => !bt(r, t), X = { attribute: !0, type: String, converter: W, reflect: !1, hasChanged: ht }; | ||
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), _.litPropertyMetadata ?? (_.litPropertyMetadata = /* @__PURE__ */ new WeakMap()); | ||
class v extends HTMLElement { | ||
static addInitializer(t) { | ||
var e; | ||
this.finalize(), ((e = this.h) !== null && e !== void 0 ? e : this.h = []).push(t); | ||
this._$Ei(), (this.l ?? (this.l = [])).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; | ||
return this.finalize(), this._$Eh && [...this._$Eh.keys()]; | ||
} | ||
static createProperty(t, e = B) { | ||
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 createProperty(t, e = X) { | ||
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) { | ||
const s = Symbol(), i = this.getPropertyDescriptor(t, s, e); | ||
i !== void 0 && At(this.prototype, t, i); | ||
} | ||
} | ||
static getPropertyDescriptor(t, e, i) { | ||
static getPropertyDescriptor(t, e, s) { | ||
const { get: i, set: n } = vt(this.prototype, t) ?? { get() { | ||
return this[e]; | ||
}, set(o) { | ||
this[e] = o; | ||
} }; | ||
return { get() { | ||
return this[e]; | ||
}, set(s) { | ||
const n = this[t]; | ||
this[e] = s, this.requestUpdate(t, n, i); | ||
return i == null ? void 0 : i.call(this); | ||
}, set(o) { | ||
const c = i == null ? void 0 : i.call(this); | ||
n.call(this, o), this.requestUpdate(t, c, s); | ||
}, configurable: !0, enumerable: !0 }; | ||
} | ||
static getPropertyOptions(t) { | ||
return this.elementProperties.get(t) || B; | ||
return this.elementProperties.get(t) ?? X; | ||
} | ||
static _$Ei() { | ||
if (this.hasOwnProperty(H("elementProperties"))) | ||
return; | ||
const t = St(this); | ||
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties); | ||
} | ||
static finalize() { | ||
if (this.hasOwnProperty(W)) | ||
return !1; | ||
this[W] = !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 = /* @__PURE__ */ 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]); | ||
if (this.hasOwnProperty(H("finalized"))) | ||
return; | ||
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(H("properties"))) { | ||
const e = this.properties, s = [...xt(e), ...Et(e)]; | ||
for (const i of s) | ||
this.createProperty(i, e[i]); | ||
} | ||
return this.elementStyles = this.finalizeStyles(this.styles), !0; | ||
const t = this[Symbol.metadata]; | ||
if (t !== null) { | ||
const e = litPropertyMetadata.get(t); | ||
if (e !== void 0) | ||
for (const [s, i] of e) | ||
this.elementProperties.set(s, i); | ||
} | ||
this._$Eh = /* @__PURE__ */ new Map(); | ||
for (const [e, s] of this.elementProperties) { | ||
const i = this._$Eu(e, s); | ||
i !== void 0 && this._$Eh.set(i, e); | ||
} | ||
this.elementStyles = this.finalizeStyles(this.styles); | ||
} | ||
@@ -134,40 +151,43 @@ static finalizeStyles(t) { | ||
if (Array.isArray(t)) { | ||
const i = new Set(t.flat(1 / 0).reverse()); | ||
for (const s of i) | ||
e.unshift(X(s)); | ||
const s = new Set(t.flat(1 / 0).reverse()); | ||
for (const i of s) | ||
e.unshift(G(i)); | ||
} else | ||
t !== void 0 && e.push(X(t)); | ||
t !== void 0 && e.push(G(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; | ||
static _$Eu(t, e) { | ||
const s = e.attribute; | ||
return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0; | ||
} | ||
u() { | ||
constructor() { | ||
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev(); | ||
} | ||
_$Ev() { | ||
var t; | ||
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)); | ||
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)); | ||
} | ||
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)); | ||
var e; | ||
(this._$ES ?? (this._$ES = [])).push(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t)); | ||
} | ||
removeController(t) { | ||
var e; | ||
(e = this._$ES) === null || e === void 0 || e.splice(this._$ES.indexOf(t) >>> 0, 1); | ||
(e = this._$ES) == null || 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]); | ||
}); | ||
_$E_() { | ||
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties; | ||
for (const s of e.keys()) | ||
this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]); | ||
t.size > 0 && (this._$Ep = t); | ||
} | ||
createRenderRoot() { | ||
var t; | ||
const e = (t = this.shadowRoot) !== null && t !== void 0 ? t : this.attachShadow(this.constructor.shadowRootOptions); | ||
return yt(e, this.constructor.elementStyles), e; | ||
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); | ||
return wt(t, this.constructor.elementStyles), t; | ||
} | ||
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); | ||
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$ES) == null || t.forEach((e) => { | ||
var s; | ||
return (s = e.hostConnected) == null ? void 0 : s.call(e); | ||
}); | ||
@@ -179,34 +199,41 @@ } | ||
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); | ||
(t = this._$ES) == null || t.forEach((e) => { | ||
var s; | ||
return (s = e.hostDisconnected) == null ? void 0 : s.call(e); | ||
}); | ||
} | ||
attributeChangedCallback(t, e, i) { | ||
this._$AK(t, i); | ||
attributeChangedCallback(t, e, s) { | ||
this._$AK(t, s); | ||
} | ||
_$EO(t, e, i = B) { | ||
var s; | ||
const n = this.constructor._$Ep(t, i); | ||
if (n !== void 0 && i.reflect === !0) { | ||
const o = (((s = i.converter) === null || s === void 0 ? void 0 : s.toAttribute) !== void 0 ? i.converter : q).toAttribute(e, i.type); | ||
this._$El = t, o == null ? this.removeAttribute(n) : this.setAttribute(n, o), this._$El = null; | ||
_$EO(t, e) { | ||
var n; | ||
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s); | ||
if (i !== void 0 && s.reflect === !0) { | ||
const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : W).toAttribute(e, s.type); | ||
this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null; | ||
} | ||
} | ||
_$AK(t, e) { | ||
var i; | ||
const s = this.constructor, n = s._$Ev.get(t); | ||
if (n !== void 0 && this._$El !== n) { | ||
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; | ||
this._$El = n, this[n] = h.fromAttribute(e, o.type), this._$El = null; | ||
var n; | ||
const s = this.constructor, i = s._$Eh.get(t); | ||
if (i !== void 0 && this._$Em !== i) { | ||
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; | ||
this._$Em = i, this[i] = c.fromAttribute(e, o.type), this._$Em = null; | ||
} | ||
} | ||
requestUpdate(t, e, i) { | ||
let s = !0; | ||
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()); | ||
requestUpdate(t, e, s, i = !1, n) { | ||
if (t !== void 0) { | ||
if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? ht)(i ? n : this[t], e)) | ||
return; | ||
this.C(t, e, s); | ||
} | ||
this.isUpdatePending === !1 && (this._$Eg = this._$EP()); | ||
} | ||
async _$Ej() { | ||
C(t, e, s) { | ||
this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t); | ||
} | ||
async _$EP() { | ||
this.isUpdatePending = !0; | ||
try { | ||
await this._$E_; | ||
await this._$Eg; | ||
} catch (e) { | ||
@@ -222,17 +249,27 @@ Promise.reject(e); | ||
performUpdate() { | ||
var t; | ||
var s; | ||
if (!this.isUpdatePending) | ||
return; | ||
this.hasUpdated, this._$Ei && (this._$Ei.forEach((s, n) => this[n] = s), this._$Ei = void 0); | ||
let e = !1; | ||
const i = this._$AL; | ||
if (!this.hasUpdated) { | ||
if (this._$Ep) { | ||
for (const [n, o] of this._$Ep) | ||
this[n] = o; | ||
this._$Ep = void 0; | ||
} | ||
const i = this.constructor.elementProperties; | ||
if (i.size > 0) | ||
for (const [n, o] of i) | ||
o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.C(n, this[n], o); | ||
} | ||
let t = !1; | ||
const e = this._$AL; | ||
try { | ||
e = this.shouldUpdate(i), e ? (this.willUpdate(i), (t = this._$ES) === null || t === void 0 || t.forEach((s) => { | ||
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$ES) == null || s.forEach((i) => { | ||
var n; | ||
return (n = s.hostUpdate) === null || n === void 0 ? void 0 : n.call(s); | ||
}), this.update(i)) : this._$Ek(); | ||
} catch (s) { | ||
throw e = !1, this._$Ek(), s; | ||
return (n = i.hostUpdate) == null ? void 0 : n.call(i); | ||
}), this.update(e)) : this._$ET(); | ||
} catch (i) { | ||
throw t = !1, this._$ET(), i; | ||
} | ||
e && this._$AE(i); | ||
t && this._$AE(e); | ||
} | ||
@@ -243,8 +280,8 @@ willUpdate(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); | ||
(e = this._$ES) == null || e.forEach((s) => { | ||
var i; | ||
return (i = s.hostUpdated) == null ? void 0 : i.call(s); | ||
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t); | ||
} | ||
_$Ek() { | ||
_$ET() { | ||
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1; | ||
@@ -256,3 +293,3 @@ } | ||
getUpdateComplete() { | ||
return this._$E_; | ||
return this._$Eg; | ||
} | ||
@@ -263,3 +300,3 @@ shouldUpdate(t) { | ||
update(t) { | ||
this._$EC !== void 0 && (this._$EC.forEach((e, i) => this._$EO(i, this[i], e)), this._$EC = void 0), this._$Ek(); | ||
this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EO(e, this[e]))), this._$ET(); | ||
} | ||
@@ -270,4 +307,4 @@ updated(t) { | ||
} | ||
}; | ||
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"); | ||
} | ||
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"); | ||
/** | ||
@@ -278,66 +315,58 @@ * @license | ||
*/ | ||
var I; | ||
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 = `[ | ||
\f\r]`, E = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, et = /-->/g, it = />/g, _ = RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^ | ||
\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); | ||
function pt(r, t) { | ||
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 = `[ | ||
\f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, tt = /-->/g, et = />/g, m = RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^ | ||
\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); | ||
function ut(r, t) { | ||
if (!Array.isArray(r) || !r.hasOwnProperty("raw")) | ||
throw Error("invalid template strings array"); | ||
return tt !== void 0 ? tt.createHTML(t) : t; | ||
return Y !== void 0 ? Y.createHTML(t) : t; | ||
} | ||
const wt = (r, t) => { | ||
const e = r.length - 1, i = []; | ||
let s, n = t === 2 ? "<svg>" : "", o = E; | ||
for (let h = 0; h < e; h++) { | ||
const l = r[h]; | ||
let a, d, c = -1, p = 0; | ||
for (; p < l.length && (o.lastIndex = p, d = o.exec(l), d !== null); ) | ||
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); | ||
const $ = o === _ && r[h + 1].startsWith("/>") ? " " : ""; | ||
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) : $); | ||
const Mt = (r, t) => { | ||
const e = r.length - 1, s = []; | ||
let i, n = t === 2 ? "<svg>" : "", o = k; | ||
for (let c = 0; c < e; c++) { | ||
const a = r[c]; | ||
let d, p, h = -1, y = 0; | ||
for (; y < a.length && (o.lastIndex = y, p = o.exec(a), p !== null); ) | ||
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); | ||
const g = o === m && r[c + 1].startsWith("/>") ? " " : ""; | ||
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); | ||
} | ||
return [pt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i]; | ||
return [ut(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), s]; | ||
}; | ||
class U { | ||
constructor({ strings: t, _$litType$: e }, i) { | ||
let s; | ||
class P { | ||
constructor({ strings: t, _$litType$: e }, s) { | ||
let i; | ||
this.parts = []; | ||
let n = 0, o = 0; | ||
const h = t.length - 1, l = this.parts, [a, d] = wt(t, e); | ||
if (this.el = U.createElement(a, i), f.currentNode = this.el.content, e === 2) { | ||
const c = this.el.content, p = c.firstChild; | ||
p.remove(), c.append(...p.childNodes); | ||
const c = t.length - 1, a = this.parts, [d, p] = Mt(t, e); | ||
if (this.el = P.createElement(d, s), w.currentNode = this.el.content, e === 2) { | ||
const h = this.el.content.firstChild; | ||
h.replaceWith(...h.childNodes); | ||
} | ||
for (; (s = f.nextNode()) !== null && l.length < h; ) { | ||
if (s.nodeType === 1) { | ||
if (s.hasAttributes()) { | ||
const c = []; | ||
for (const p of s.getAttributeNames()) | ||
if (p.endsWith(Z) || p.startsWith(y)) { | ||
const $ = d[o++]; | ||
if (c.push(p), $ !== void 0) { | ||
const $t = s.getAttribute($.toLowerCase() + Z).split(y), D = /([.?@])?(.*)/.exec($); | ||
l.push({ type: 1, index: n, name: D[2], strings: $t, ctor: D[1] === "." ? Et : D[1] === "?" ? Ct : D[1] === "@" ? Ht : N }); | ||
} else | ||
l.push({ type: 6, index: n }); | ||
} | ||
for (const p of c) | ||
s.removeAttribute(p); | ||
} | ||
if (ut.test(s.tagName)) { | ||
const c = s.textContent.split(y), p = c.length - 1; | ||
if (p > 0) { | ||
s.textContent = b ? b.emptyScript : ""; | ||
for (let $ = 0; $ < p; $++) | ||
s.append(c[$], C()), f.nextNode(), l.push({ type: 2, index: ++n }); | ||
s.append(c[p], C()); | ||
for (; (i = w.nextNode()) !== null && a.length < c; ) { | ||
if (i.nodeType === 1) { | ||
if (i.hasAttributes()) | ||
for (const h of i.getAttributeNames()) | ||
if (h.endsWith(lt)) { | ||
const y = p[o++], g = i.getAttribute(h).split(f), L = /([.?@])?(.*)/.exec(y); | ||
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); | ||
} else | ||
h.startsWith(f) && (a.push({ type: 6, index: n }), i.removeAttribute(h)); | ||
if (pt.test(i.tagName)) { | ||
const h = i.textContent.split(f), y = h.length - 1; | ||
if (y > 0) { | ||
i.textContent = O ? O.emptyScript : ""; | ||
for (let g = 0; g < y; g++) | ||
i.append(h[g], M()), w.nextNode(), a.push({ type: 2, index: ++n }); | ||
i.append(h[y], M()); | ||
} | ||
} | ||
} else if (s.nodeType === 8) | ||
if (s.data === dt) | ||
l.push({ type: 2, index: n }); | ||
} else if (i.nodeType === 8) | ||
if (i.data === ct) | ||
a.push({ type: 2, index: n }); | ||
else { | ||
let c = -1; | ||
for (; (c = s.data.indexOf(y, c + 1)) !== -1; ) | ||
l.push({ type: 7, index: n }), c += y.length - 1; | ||
let h = -1; | ||
for (; (h = i.data.indexOf(f, h + 1)) !== -1; ) | ||
a.push({ type: 7, index: n }), h += f.length - 1; | ||
} | ||
@@ -348,15 +377,15 @@ n++; | ||
static createElement(t, e) { | ||
const i = m.createElement("template"); | ||
return i.innerHTML = t, i; | ||
const s = b.createElement("template"); | ||
return s.innerHTML = t, s; | ||
} | ||
} | ||
function x(r, t, e = r, i) { | ||
var s, n, o, h; | ||
if (t === w) | ||
function C(r, t, e = r, s) { | ||
var o, c; | ||
if (t === S) | ||
return t; | ||
let l = i !== void 0 ? (s = e._$Co) === null || s === void 0 ? void 0 : s[i] : e._$Cl; | ||
const a = H(t) ? void 0 : t._$litDirective$; | ||
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; | ||
let i = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl; | ||
const n = U(t) ? void 0 : t._$litDirective$; | ||
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; | ||
} | ||
class xt { | ||
class Ut { | ||
constructor(t, e) { | ||
@@ -372,30 +401,28 @@ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e; | ||
u(t) { | ||
var e; | ||
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); | ||
f.currentNode = n; | ||
let o = f.nextNode(), h = 0, l = 0, a = s[0]; | ||
const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? b).importNode(e, !0); | ||
w.currentNode = i; | ||
let n = w.nextNode(), o = 0, c = 0, a = s[0]; | ||
for (; a !== void 0; ) { | ||
if (h === a.index) { | ||
if (o === a.index) { | ||
let d; | ||
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]; | ||
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]; | ||
} | ||
h !== (a == null ? void 0 : a.index) && (o = f.nextNode(), h++); | ||
o !== (a == null ? void 0 : a.index) && (n = w.nextNode(), o++); | ||
} | ||
return f.currentNode = m, n; | ||
return w.currentNode = b, i; | ||
} | ||
v(t) { | ||
p(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++; | ||
for (const s of this._$AV) | ||
s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++; | ||
} | ||
} | ||
class M { | ||
constructor(t, e, i, s) { | ||
var n; | ||
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; | ||
} | ||
class D { | ||
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; | ||
var t; | ||
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv; | ||
} | ||
constructor(t, e, s, i) { | ||
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; | ||
} | ||
get parentNode() { | ||
@@ -413,3 +440,3 @@ let t = this._$AA.parentNode; | ||
_$AI(t, e = this) { | ||
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); | ||
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); | ||
} | ||
@@ -423,31 +450,31 @@ k(t) { | ||
_(t) { | ||
this._$AH !== u && H(this._$AH) ? this._$AA.nextSibling.data = t : this.$(m.createTextNode(t)), this._$AH = t; | ||
this._$AH !== l && U(this._$AH) ? this._$AA.nextSibling.data = t : this.$(b.createTextNode(t)), this._$AH = t; | ||
} | ||
g(t) { | ||
var e; | ||
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); | ||
if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) === n) | ||
this._$AH.v(i); | ||
var n; | ||
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); | ||
if (((n = this._$AH) == null ? void 0 : n._$AD) === i) | ||
this._$AH.p(e); | ||
else { | ||
const o = new xt(n, this), h = o.u(this.options); | ||
o.v(i), this.$(h), this._$AH = o; | ||
const o = new Ut(i, this), c = o.u(this.options); | ||
o.p(e), this.$(c), this._$AH = o; | ||
} | ||
} | ||
_$AC(t) { | ||
let e = nt.get(t.strings); | ||
return e === void 0 && nt.set(t.strings, e = new U(t)), e; | ||
let e = rt.get(t.strings); | ||
return e === void 0 && rt.set(t.strings, e = new P(t)), e; | ||
} | ||
T(t) { | ||
ct(this._$AH) || (this._$AH = [], this._$AR()); | ||
dt(this._$AH) || (this._$AH = [], this._$AR()); | ||
const e = this._$AH; | ||
let i, s = 0; | ||
let s, i = 0; | ||
for (const n of t) | ||
s === e.length ? e.push(i = new M(this.k(C()), this.k(C()), this, this.options)) : i = e[s], i._$AI(n), s++; | ||
s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s); | ||
i === e.length ? e.push(s = new D(this.k(M()), this.k(M()), this, this.options)) : s = e[i], s._$AI(n), i++; | ||
i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i); | ||
} | ||
_$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; | ||
var s; | ||
for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) { | ||
const i = t.nextSibling; | ||
t.remove(), t = i; | ||
} | ||
@@ -457,9 +484,6 @@ } | ||
var e; | ||
this._$AM === void 0 && (this._$Cp = t, (e = this._$AP) === null || e === void 0 || e.call(this, t)); | ||
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t)); | ||
} | ||
} | ||
class N { | ||
constructor(t, e, i, s, n) { | ||
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; | ||
} | ||
get tagName() { | ||
@@ -471,55 +495,56 @@ return this.element.tagName; | ||
} | ||
_$AI(t, e = this, i, s) { | ||
constructor(t, e, s, i, n) { | ||
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; | ||
} | ||
_$AI(t, e = this, s, i) { | ||
const n = this.strings; | ||
let o = !1; | ||
if (n === void 0) | ||
t = x(this, t, e, 0), o = !H(t) || t !== this._$AH && t !== w, o && (this._$AH = t); | ||
t = C(this, t, e, 0), o = !U(t) || t !== this._$AH && t !== S, o && (this._$AH = t); | ||
else { | ||
const h = t; | ||
let l, a; | ||
for (t = n[0], l = 0; l < n.length - 1; l++) | ||
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; | ||
const c = t; | ||
let a, d; | ||
for (t = n[0], a = 0; a < n.length - 1; a++) | ||
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; | ||
} | ||
o && !s && this.j(t); | ||
o && !i && this.O(t); | ||
} | ||
j(t) { | ||
t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? ""); | ||
O(t) { | ||
t === l ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? ""); | ||
} | ||
} | ||
class Et extends N { | ||
class Pt extends N { | ||
constructor() { | ||
super(...arguments), this.type = 3; | ||
} | ||
j(t) { | ||
this.element[this.name] = t === u ? void 0 : t; | ||
O(t) { | ||
this.element[this.name] = t === l ? void 0 : t; | ||
} | ||
} | ||
const St = b ? b.emptyScript : ""; | ||
class Ct extends N { | ||
class Dt extends N { | ||
constructor() { | ||
super(...arguments), this.type = 4; | ||
} | ||
j(t) { | ||
t && t !== u ? this.element.setAttribute(this.name, St) : this.element.removeAttribute(this.name); | ||
O(t) { | ||
this.element.toggleAttribute(this.name, !!t && t !== l); | ||
} | ||
} | ||
class Ht extends N { | ||
constructor(t, e, i, s, n) { | ||
super(t, e, i, s, n), this.type = 5; | ||
class Lt extends N { | ||
constructor(t, e, s, i, n) { | ||
super(t, e, s, i, n), this.type = 5; | ||
} | ||
_$AI(t, e = this) { | ||
var i; | ||
if ((t = (i = x(this, t, e, 0)) !== null && i !== void 0 ? i : u) === w) | ||
if ((t = C(this, t, e, 0) ?? l) === S) | ||
return; | ||
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); | ||
n && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t; | ||
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); | ||
i && 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); | ||
var e; | ||
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t); | ||
} | ||
} | ||
class Ut { | ||
constructor(t, e, i) { | ||
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i; | ||
class Tt { | ||
constructor(t, e, s) { | ||
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s; | ||
} | ||
@@ -530,16 +555,15 @@ get _$AU() { | ||
_$AI(t) { | ||
x(this, t); | ||
C(this, t); | ||
} | ||
} | ||
const ot = T.litHtmlPolyfillSupport; | ||
ot == null || ot(U, M), ((I = T.litHtmlVersions) !== null && I !== void 0 ? I : T.litHtmlVersions = []).push("2.8.0"); | ||
const Pt = (r, t, e) => { | ||
var i, s; | ||
const n = (i = e == null ? void 0 : e.renderBefore) !== null && i !== void 0 ? i : t; | ||
let o = n._$litPart$; | ||
if (o === void 0) { | ||
const h = (s = e == null ? void 0 : e.renderBefore) !== null && s !== void 0 ? s : null; | ||
n._$litPart$ = o = new M(t.insertBefore(C(), h), h, void 0, e ?? {}); | ||
const q = I.litHtmlPolyfillSupport; | ||
q == null || q(P, D), (I.litHtmlVersions ?? (I.litHtmlVersions = [])).push("3.0.2"); | ||
const Ot = (r, t, e) => { | ||
const s = (e == null ? void 0 : e.renderBefore) ?? t; | ||
let i = s._$litPart$; | ||
if (i === void 0) { | ||
const n = (e == null ? void 0 : e.renderBefore) ?? null; | ||
s._$litPart$ = i = new D(t.insertBefore(M(), n), n, void 0, e ?? {}); | ||
} | ||
return o._$AI(r), o; | ||
return i._$AI(r), i; | ||
}; | ||
@@ -551,4 +575,3 @@ /** | ||
*/ | ||
var z, j; | ||
class S extends A { | ||
class x extends v { | ||
constructor() { | ||
@@ -558,31 +581,71 @@ 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; | ||
var e; | ||
const t = super.createRenderRoot(); | ||
return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t; | ||
} | ||
update(t) { | ||
const e = this.render(); | ||
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Pt(e, this.renderRoot, this.renderOptions); | ||
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); | ||
super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0); | ||
} | ||
disconnectedCallback() { | ||
var t; | ||
super.disconnectedCallback(), (t = this._$Do) === null || t === void 0 || t.setConnected(!1); | ||
super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1); | ||
} | ||
render() { | ||
return w; | ||
return S; | ||
} | ||
} | ||
S.finalized = !0, S._$litElement$ = !0, (z = globalThis.litElementHydrateSupport) === null || z === void 0 || z.call(globalThis, { LitElement: S }); | ||
const lt = globalThis.litElementPolyfillSupport; | ||
lt == null || lt({ LitElement: S }); | ||
((j = globalThis.litElementVersions) !== null && j !== void 0 ? j : globalThis.litElementVersions = []).push("3.3.2"); | ||
const Mt = ` | ||
:host { | ||
display: block; | ||
} | ||
`, Dt = ` | ||
var ot; | ||
x._$litElement$ = !0, x.finalized = !0, (ot = globalThis.litElementHydrateSupport) == null || ot.call(globalThis, { LitElement: x }); | ||
const j = globalThis.litElementPolyfillSupport; | ||
j == null || j({ LitElement: x }); | ||
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.1"); | ||
/** | ||
* @license | ||
* Copyright 2017 Google LLC | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
const Ft = (r) => (...t) => ({ _$litDirective$: r, values: t }); | ||
let Nt = class { | ||
constructor(t) { | ||
} | ||
get _$AU() { | ||
return this._$AM._$AU; | ||
} | ||
_$AT(t, e, s) { | ||
this._$Ct = t, this._$AM = e, this._$Ci = s; | ||
} | ||
_$AS(t, e) { | ||
return this.update(t, e); | ||
} | ||
update(t, e) { | ||
return this.render(...e); | ||
} | ||
}; | ||
/** | ||
* @license | ||
* Copyright 2020 Google LLC | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
const Vt = {}, Rt = (r, t = Vt) => r._$AH = t; | ||
/** | ||
* @license | ||
* Copyright 2021 Google LLC | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
const Bt = Ft(class extends Nt { | ||
constructor() { | ||
super(...arguments), this.key = l; | ||
} | ||
render(r, t) { | ||
return this.key = r, t; | ||
} | ||
update(r, [t, e]) { | ||
return t !== this.key && (Rt(r), this.key = t), e; | ||
} | ||
}), zt = ` | ||
button { | ||
@@ -676,19 +739,220 @@ /* TODO: why does this only work here and not from :root? */ | ||
} | ||
`, Ot = ` | ||
* { | ||
font-family: Roboto, sans-serif; | ||
} | ||
`, $t = ` | ||
* { | ||
font-family: Roboto, sans-serif; | ||
} | ||
${Dt} | ||
${zt} | ||
button.discard:before { | ||
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") | ||
} | ||
button.discard:before { | ||
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") | ||
} | ||
button.polygon:before { | ||
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"); | ||
button.polygon:before { | ||
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"); | ||
} | ||
ul { | ||
padding: 0; | ||
} | ||
ul ul { | ||
padding-left: 48px; | ||
} | ||
li:hover { | ||
background: #f0f5f9; | ||
} | ||
li.selected { | ||
background: #f0f5f9; | ||
} | ||
li { | ||
list-style: none; | ||
padding: 4px; | ||
} | ||
li { | ||
border-bottom: 1px solid #0041703a; | ||
} | ||
li:first-child { | ||
border-top: 1px solid #0041703a; | ||
} | ||
li.sortable-chosen { | ||
background: #eeea; | ||
} | ||
li.sortable-drag { | ||
opacity: 0; | ||
} | ||
li.sortable-ghost { | ||
} | ||
button.small.icon, button.small.icon::before { | ||
height: 16px; | ||
width: 16px; | ||
padding: 0px; | ||
} | ||
button.discard.icon { | ||
opacity: .7; | ||
} | ||
button.discard.icon:hover { | ||
opacity: 1; | ||
} | ||
eox-drawtools-list { | ||
width: 100%; | ||
} | ||
.list { | ||
width: 100%; | ||
align-items: center; | ||
justify-content: space-between; | ||
display: flex; | ||
align-items: center; | ||
cursor: pointer; | ||
font-size: small; | ||
gap: 10px; | ||
} | ||
label { | ||
gap: 10px; | ||
} | ||
label, span { | ||
display: flex; | ||
align-items: center; | ||
cursor: pointer; | ||
font-size: small; | ||
flex-grow: 1; | ||
} | ||
`, nt = (r, t, e = !1) => ({ | ||
id: r, | ||
condition: t, | ||
panIn: e, | ||
layer: { | ||
type: "Vector", | ||
properties: { | ||
id: "selectLayer" | ||
}, | ||
source: { | ||
type: "Vector" | ||
}, | ||
style: { | ||
"fill-color": "rgba(51, 153, 204,0.5)", | ||
"stroke-color": "#3399CC", | ||
"stroke-width": 2.5 | ||
} | ||
} | ||
}); | ||
class yt extends x { | ||
constructor() { | ||
super(); | ||
/** | ||
* @type import("../../../map/src/select").EOxSelectInteraction | ||
*/ | ||
A(this, "hoverInteraction"); | ||
/** | ||
* @type import("../../../map/src/select").EOxSelectInteraction | ||
*/ | ||
A(this, "clickInteraction"); | ||
/** | ||
* @type string | number | ||
*/ | ||
A(this, "hoverId"); | ||
/** | ||
* @type string | number | ||
*/ | ||
A(this, "clickId"); | ||
this.eoxMap = null, this.olMap = null, this.draw = null, this.layer = "draw", this.drawLayer = null, this.drawnFeatures = [], this.modify = null, this.unstyled = !1; | ||
} | ||
/** | ||
* Delete individual feature @param {any} evt | ||
*/ | ||
_handleDelete(e) { | ||
e.stopPropagation(); | ||
const s = e.target.getAttribute("index"), i = this.drawnFeatures[s]; | ||
this.drawLayer.getSource().removeFeature(i), this.drawnFeatures.splice(s, 1), this.requestUpdate(); | ||
} | ||
/** | ||
* Select and Deselect feature from the list | ||
* | ||
* @param {import("ol").Feature} feature | ||
*/ | ||
_handleFeatureSelectAndDeselect(e) { | ||
const s = e.get("id"); | ||
if (this.clickId === s) { | ||
const i = this.drawLayer.getSource().getExtent(); | ||
this.olMap.getView().fit(i, { duration: 750 }), this.clickInteraction.highlightById([]); | ||
} else | ||
this.clickInteraction.highlightById([s]), this.olMap.getView().fit(e.getGeometry().getExtent(), { duration: 750 }); | ||
this.requestUpdate(); | ||
} | ||
firstUpdated() { | ||
var i, n; | ||
const e = (i = this.eoxMap) == null ? void 0 : i.selectInteractions["draw-hover"], s = (n = this.eoxMap) == null ? void 0 : n.selectInteractions["draw-click"]; | ||
e || (this.hoverInteraction = this.eoxMap.addSelect( | ||
this.layer, | ||
nt("draw-hover", "pointermove") | ||
)), s || (this.clickInteraction = this.eoxMap.addSelect( | ||
this.layer, | ||
nt("draw-click", "click", !0) | ||
)), this.hoverInteraction.selectStyleLayer.on( | ||
"change", | ||
() => this.requestUpdate() | ||
), this.clickInteraction.selectStyleLayer.on( | ||
"change", | ||
() => this.requestUpdate() | ||
); | ||
} | ||
render() { | ||
var e, s; | ||
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` | ||
<style> | ||
${!this.unstyled && $t} | ||
</style> | ||
<ul> | ||
${this.drawnFeatures.map((i, n) => { | ||
const o = i.get("id"), c = this.hoverId === o || this.clickId === o; | ||
return Bt( | ||
n + 1, | ||
F` | ||
<li | ||
class="${c ? "selected" : l}" | ||
@mouseover=${() => { | ||
this.clickId !== o && this.hoverInteraction.highlightById([o]); | ||
}} | ||
@mouseout=${() => { | ||
this.clickId !== o && this.hoverInteraction.highlightById([]); | ||
}} | ||
> | ||
<div | ||
class="list" | ||
@click="${() => this._handleFeatureSelectAndDeselect(i)}" | ||
> | ||
<span class="title">Feature #${n + 1}</span> | ||
<button | ||
index=${n} | ||
class="icon small discard" | ||
@click="${this._handleDelete}" | ||
> | ||
${this.unstyled ? "x" : l} | ||
</button> | ||
</div> | ||
</li> | ||
` | ||
); | ||
})} | ||
</ul> | ||
`; | ||
} | ||
} | ||
A(yt, "properties", { | ||
eoxMap: { attribute: !1, state: !0 }, | ||
olMap: { attribute: !1, state: !0 }, | ||
draw: { attribute: !1, state: !0 }, | ||
layer: { type: String }, | ||
drawLayer: { attribute: !1, state: !0 }, | ||
drawnFeatures: { attribute: !1, state: !0, type: Array }, | ||
modify: { attribute: !1, state: !0 }, | ||
unstyled: { type: Boolean } | ||
}); | ||
customElements.define("eox-drawtools-list", yt); | ||
const qt = ` | ||
:host { | ||
display: block; | ||
} | ||
`; | ||
var v, P; | ||
class kt extends S { | ||
var u, E; | ||
class jt extends x { | ||
constructor() { | ||
@@ -699,8 +963,8 @@ super(); | ||
*/ | ||
V(this, v, void 0); | ||
V(this, u, void 0); | ||
/** | ||
* @type import("ol").Map | ||
*/ | ||
V(this, P, void 0); | ||
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; | ||
V(this, E, void 0); | ||
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; | ||
} | ||
@@ -717,2 +981,3 @@ static get properties() { | ||
multipleFeatures: { attribute: "multiple-features", type: Boolean }, | ||
showList: { attribute: "show-list", type: Boolean }, | ||
unstyled: { type: Boolean } | ||
@@ -722,4 +987,4 @@ }; | ||
startDrawing() { | ||
var e, i; | ||
g(this, v).addDraw(this.layer, { | ||
var e, s; | ||
$(this, u).addDraw(this.layer, { | ||
id: "drawInteraction", | ||
@@ -730,8 +995,8 @@ type: "Polygon", | ||
/** @type {unknown} */ | ||
g(this, v).interactions.drawInteraction, this.modify = /** @type {import("ol/interaction").Modify} */ | ||
$(this, u).interactions.drawInteraction, this.modify = /** @type {import("ol/interaction").Modify} */ | ||
/** @type {unknown} */ | ||
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(); | ||
$(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(); | ||
} | ||
discardDrawing() { | ||
this.drawnFeatures = [], g(this, v).removeInteraction("drawInteraction"), this.drawLayer.getSource().clear(), this.emitDrawnFeatures(), this.currentlyDrawing = !1, this.requestUpdate(); | ||
this.drawnFeatures = [], $(this, u).removeInteraction("drawInteraction"), this.drawLayer.getSource().clear(), this.emitDrawnFeatures(), this.currentlyDrawing = !1, this.requestUpdate(); | ||
} | ||
@@ -743,3 +1008,3 @@ /** | ||
onDrawEnd() { | ||
this.emitDrawnFeatures(), g(this, v).removeInteraction("drawInteraction"), this.currentlyDrawing = !1, this.requestUpdate(); | ||
this.emitDrawnFeatures(), $(this, u).removeInteraction("drawInteraction"), this.currentlyDrawing = !1, this.requestUpdate(); | ||
} | ||
@@ -763,19 +1028,19 @@ /** | ||
render() { | ||
var i, s; | ||
var s, i, n; | ||
const e = document.querySelector(this.for); | ||
return L( | ||
return R( | ||
this, | ||
v, | ||
u, | ||
/** @type {import("@eox/map/main").EOxMap} */ | ||
e | ||
), L( | ||
), R( | ||
this, | ||
P, | ||
E, | ||
/** @type {import("ol").Map} */ | ||
g(this, v).map | ||
$(this, u).map | ||
), this.drawLayer = /** @type {import("ol/layer").Vector<import("ol/source").Vector>} */ | ||
g(this, P).getLayers().getArray().find((n) => n.get("id") === this.layer), this.requestUpdate(), bt` | ||
$(this, E).getLayers().getArray().find((o) => o.get("id") === this.layer), this.requestUpdate(), F` | ||
<style> | ||
${Mt} | ||
${!this.unstyled && Ot} | ||
${qt} | ||
${!this.unstyled && $t} | ||
</style> | ||
@@ -787,3 +1052,3 @@ <div> | ||
class="polygon icon" | ||
disabled="${!this.multipleFeatures && ((i = this.drawnFeatures) == null ? void 0 : i.length) > 0 || this.currentlyDrawing || u}" | ||
disabled="${!this.multipleFeatures && ((s = this.drawnFeatures) == null ? void 0 : s.length) > 0 || this.currentlyDrawing || l}" | ||
@click="${() => this.startDrawing()}" | ||
@@ -796,3 +1061,3 @@ > | ||
class="discard icon" | ||
disabled="${!((s = this.drawnFeatures) != null && s.length) && !this.currentlyDrawing || u}" | ||
disabled="${!((i = this.drawnFeatures) != null && i.length) && !this.currentlyDrawing || l}" | ||
@click="${() => this.discardDrawing()}" | ||
@@ -803,9 +1068,21 @@ > | ||
</div> | ||
${this.showList && ((n = this.drawnFeatures) != null && n.length) ? F`<eox-drawtools-list | ||
.eoxMap=${$(this, u)} | ||
.olMap=${$(this, E)} | ||
.draw=${this.draw} | ||
.layer=${this.layer} | ||
.drawLayer=${this.drawLayer} | ||
.drawnFeatures=${this.drawnFeatures} | ||
.modify=${this.modify} | ||
.unstyled=${this.unstyled} | ||
@changed=${() => this.requestUpdate()} | ||
> | ||
</eox-drawtools-list>` : l} | ||
`; | ||
} | ||
} | ||
v = new WeakMap(), P = new WeakMap(); | ||
customElements.define("eox-drawtools", kt); | ||
u = new WeakMap(), E = new WeakMap(); | ||
customElements.define("eox-drawtools", jt); | ||
export { | ||
kt as EOxDrawTools | ||
jt as EOxDrawTools | ||
}; |
{ | ||
"name": "@eox/drawtools", | ||
"version": "0.4.2", | ||
"version": "0.5.0", | ||
"type": "module", | ||
@@ -8,3 +8,3 @@ "devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^6.8.0", | ||
"@typescript-eslint/parser": "^5.50.0", | ||
"@typescript-eslint/parser": "^6.8.0", | ||
"eslint-plugin-typescript": "^0.14.0", | ||
@@ -33,4 +33,4 @@ "ol": "^8.1.0", | ||
"dependencies": { | ||
"lit": "^2.7.4" | ||
"lit": "^3.0.2" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64688
1441
+ Added@lit/reactive-element@2.0.4(transitive)
+ Addedlit@3.2.1(transitive)
+ Addedlit-element@4.1.1(transitive)
+ Addedlit-html@3.2.1(transitive)
- Removed@lit/reactive-element@1.6.3(transitive)
- Removedlit@2.8.0(transitive)
- Removedlit-element@3.3.3(transitive)
- Removedlit-html@2.8.0(transitive)
Updatedlit@^3.0.2