@mantou/gem 2.2.0 → 2.2.2
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.
- package/dist/gem.es.js +2039 -2051
- package/dist/gem.umd.js +12 -32
- package/elements/base/dialog.d.ts +1 -1
- package/elements/base/dialog.d.ts.map +1 -1
- package/elements/base/dialog.js +2 -2
- package/elements/base/dialog.js.map +1 -1
- package/elements/base/gesture.d.ts +1 -1
- package/elements/base/gesture.d.ts.map +1 -1
- package/elements/base/gesture.js +5 -5
- package/elements/base/gesture.js.map +1 -1
- package/elements/base/link.d.ts +1 -1
- package/elements/base/link.d.ts.map +1 -1
- package/elements/base/link.js +18 -19
- package/elements/base/link.js.map +1 -1
- package/elements/base/modal-factory.d.ts +93 -57
- package/elements/base/modal-factory.d.ts.map +1 -1
- package/elements/base/modal-factory.js +4 -3
- package/elements/base/modal-factory.js.map +1 -1
- package/elements/base/reflect.d.ts +1 -2
- package/elements/base/reflect.d.ts.map +1 -1
- package/elements/base/reflect.js +8 -10
- package/elements/base/reflect.js.map +1 -1
- package/elements/base/route.d.ts +18 -8
- package/elements/base/route.d.ts.map +1 -1
- package/elements/base/route.js +17 -21
- package/elements/base/route.js.map +1 -1
- package/elements/base/title.d.ts +1 -1
- package/elements/base/title.d.ts.map +1 -1
- package/elements/base/title.js +5 -7
- package/elements/base/title.js.map +1 -1
- package/elements/base/unsafe.d.ts +4 -3
- package/elements/base/unsafe.d.ts.map +1 -1
- package/elements/base/unsafe.js +45 -24
- package/elements/base/unsafe.js.map +1 -1
- package/elements/base/use.d.ts +1 -1
- package/elements/base/use.d.ts.map +1 -1
- package/elements/base/use.js +1 -1
- package/elements/base/use.js.map +1 -1
- package/elements/link.js +1 -1
- package/elements/link.js.map +1 -1
- package/elements/route.js +1 -1
- package/elements/route.js.map +1 -1
- package/helper/hmr.d.ts +11 -0
- package/helper/hmr.d.ts.map +1 -0
- package/helper/hmr.js +255 -0
- package/helper/hmr.js.map +1 -0
- package/helper/i18n.d.ts +2 -2
- package/helper/i18n.d.ts.map +1 -1
- package/helper/i18n.js +5 -4
- package/helper/i18n.js.map +1 -1
- package/helper/logger.d.ts +1 -1
- package/helper/logger.d.ts.map +1 -1
- package/helper/logger.js +8 -5
- package/helper/logger.js.map +1 -1
- package/helper/mediaquery.js +1 -1
- package/helper/mediaquery.js.map +1 -1
- package/helper/react-utils.d.ts.map +1 -1
- package/helper/react-utils.js +2 -6
- package/helper/react-utils.js.map +1 -1
- package/helper/ssr-shim.d.ts.map +1 -1
- package/helper/ssr-shim.js +2 -1
- package/helper/ssr-shim.js.map +1 -1
- package/helper/theme.d.ts +17 -6
- package/helper/theme.d.ts.map +1 -1
- package/helper/theme.js +23 -8
- package/helper/theme.js.map +1 -1
- package/index.d.ts +1 -2
- package/index.d.ts.map +1 -1
- package/index.js +1 -3
- package/index.js.map +1 -1
- package/lib/decorators.d.ts +54 -62
- package/lib/decorators.d.ts.map +1 -1
- package/lib/decorators.js +90 -91
- package/lib/decorators.js.map +1 -1
- package/lib/directive.d.ts +0 -18
- package/lib/directive.d.ts.map +1 -1
- package/lib/directive.js +1 -2
- package/lib/directive.js.map +1 -1
- package/lib/element.d.ts +8 -137
- package/lib/element.d.ts.map +1 -1
- package/lib/element.js +16 -481
- package/lib/element.js.map +1 -1
- package/lib/history.d.ts +68 -10
- package/lib/history.d.ts.map +1 -1
- package/lib/history.js +15 -15
- package/lib/history.js.map +1 -1
- package/lib/lit-html.d.ts +7 -109
- package/lib/lit-html.d.ts.map +1 -1
- package/lib/lit-html.js +75 -32
- package/lib/lit-html.js.map +1 -1
- package/lib/reactive.d.ts +130 -0
- package/lib/reactive.d.ts.map +1 -0
- package/lib/reactive.js +474 -0
- package/lib/reactive.js.map +1 -0
- package/lib/repeat.d.ts +3 -3
- package/lib/repeat.d.ts.map +1 -1
- package/lib/repeat.js +3 -3
- package/lib/repeat.js.map +1 -1
- package/lib/store.d.ts +15 -4
- package/lib/store.d.ts.map +1 -1
- package/lib/store.js +2 -0
- package/lib/store.js.map +1 -1
- package/lib/utils.d.ts +26 -11
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +21 -14
- package/lib/utils.js.map +1 -1
- package/package.json +3 -3
- package/src/dist.ts +6 -8
- package/src/elements/base/dialog.ts +2 -2
- package/src/elements/base/gesture.ts +6 -6
- package/src/elements/base/link.ts +18 -24
- package/src/elements/base/modal-factory.ts +4 -3
- package/src/elements/base/reflect.ts +2 -3
- package/src/elements/base/route.ts +21 -28
- package/src/elements/base/title.ts +6 -8
- package/src/elements/base/unsafe.ts +33 -14
- package/src/elements/base/use.ts +1 -1
- package/src/elements/link.ts +1 -1
- package/src/elements/route.ts +1 -1
- package/src/helper/hmr.ts +305 -0
- package/src/helper/i18n.ts +7 -7
- package/src/helper/logger.ts +9 -5
- package/src/helper/mediaquery.ts +1 -1
- package/src/helper/react-utils.ts +4 -12
- package/src/helper/ssr-shim.ts +3 -1
- package/src/helper/theme.ts +29 -14
- package/src/index.ts +1 -4
- package/src/lib/decorators.ts +107 -117
- package/src/lib/directive.ts +3 -5
- package/src/lib/element.ts +21 -600
- package/src/lib/history.ts +16 -18
- package/src/lib/lit-html.ts +89 -34
- package/src/lib/reactive.ts +620 -0
- package/src/lib/repeat.ts +5 -5
- package/src/lib/store.ts +4 -2
- package/src/lib/utils.ts +41 -29
- package/src/test/elements/link.test.ts +2 -2
- package/src/test/elements/reflect.test.ts +3 -3
- package/src/test/elements/title.test.ts +2 -2
- package/src/test/gem-element/advance.test.ts +11 -10
- package/src/test/gem-element/basic.test.ts +4 -5
- package/src/test/gem-element/decorators.test.ts +10 -10
- package/src/test/gem-element/multi.test.ts +2 -2
- package/src/test/history.test.ts +1 -2
- package/src/test/store.test.ts +2 -3
- package/src/test/utils.test.ts +5 -6
- package/src/test/utils.ts +2 -2
- package/helper/react-shim.d.ts +0 -15
- package/helper/react-shim.d.ts.map +0 -1
- package/helper/react-shim.js +0 -56
- package/helper/react-shim.js.map +0 -1
- package/lib/directives.d.ts +0 -4
- package/lib/directives.d.ts.map +0 -1
- package/lib/directives.js +0 -5
- package/lib/directives.js.map +0 -1
- package/lib/ref.d.ts +0 -1
- package/lib/ref.d.ts.map +0 -1
- package/lib/ref.js +0 -2
- package/lib/ref.js.map +0 -1
package/dist/gem.es.js
CHANGED
|
@@ -1,1091 +1,408 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var Ya = Object.defineProperty;
|
|
2
|
+
var Ri = (s) => {
|
|
3
|
+
throw TypeError(s);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var _ = (
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
get boolattribute() {
|
|
23
|
-
return Rn;
|
|
24
|
-
},
|
|
25
|
-
get connectStore() {
|
|
26
|
-
return Wn;
|
|
27
|
-
},
|
|
28
|
-
get customElement() {
|
|
29
|
-
return Uc;
|
|
30
|
-
},
|
|
31
|
-
get effect() {
|
|
32
|
-
return wt;
|
|
33
|
-
},
|
|
34
|
-
get emitter() {
|
|
35
|
-
return be;
|
|
36
|
-
},
|
|
37
|
-
get fallback() {
|
|
38
|
-
return Wc;
|
|
39
|
-
},
|
|
40
|
-
get globalemitter() {
|
|
41
|
-
return Dc;
|
|
42
|
-
},
|
|
43
|
-
get light() {
|
|
44
|
-
return Wr;
|
|
45
|
-
},
|
|
46
|
-
get memo() {
|
|
47
|
-
return Nr;
|
|
48
|
-
},
|
|
49
|
-
get mounted() {
|
|
50
|
-
return Qe;
|
|
51
|
-
},
|
|
52
|
-
get numattribute() {
|
|
53
|
-
return Ic;
|
|
54
|
-
},
|
|
55
|
-
get part() {
|
|
56
|
-
return Ir;
|
|
57
|
-
},
|
|
58
|
-
get property() {
|
|
59
|
-
return F;
|
|
60
|
-
},
|
|
61
|
-
get shadow() {
|
|
62
|
-
return Vt;
|
|
63
|
-
},
|
|
64
|
-
get slot() {
|
|
65
|
-
return Vc;
|
|
66
|
-
},
|
|
67
|
-
get state() {
|
|
68
|
-
return In;
|
|
69
|
-
},
|
|
70
|
-
get template() {
|
|
71
|
-
return le;
|
|
72
|
-
},
|
|
73
|
-
get unmounted() {
|
|
74
|
-
return Hc;
|
|
75
|
-
},
|
|
76
|
-
get willMount() {
|
|
77
|
-
return Ds;
|
|
78
|
-
}
|
|
79
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
80
|
-
/**
|
|
81
|
-
* @license
|
|
82
|
-
* Copyright 2017 Google LLC
|
|
83
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
84
|
-
*/
|
|
85
|
-
const Va = globalThis, qe = Va.trustedTypes, Pi = qe == null ? void 0 : qe.createPolicy("lit-html", {
|
|
86
|
-
createHTML: (n) => n
|
|
87
|
-
}), vr = "$lit$", mt = `lit$${Math.random().toFixed(9).slice(2)}$`, wr = "?" + mt, Da = `<${wr}>`, Ht = document, Be = () => Ht.createComment(""), Ke = (n) => n === null || typeof n != "object" && typeof n != "function", jt = (n) => n == null, Ga = (n) => Symbol.iterator in n, Bn = `[
|
|
88
|
-
\f\r]`, Ua = `[^
|
|
89
|
-
\f\r"'\`<>=]`, qa = `[^\\s"'>=/]`, we = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ti = 1, Kn = 2, Fa = 3, ki = /-->/g, Oi = />/g, Ct = new RegExp(
|
|
90
|
-
`>|${Bn}(?:(${qa}+)(${Bn}*=${Bn}*(?:${Ua}|("|')|))|$)`,
|
|
91
|
-
"g"
|
|
92
|
-
), Ba = 0, Mi = 1, Ka = 2, xi = 3, Ai = /'/g, Li = /"/g, yr = /^(?:script|style|textarea|title)$/i, Ps = 1, vn = 2, ja = 3, Ja = 4, Qa = 5, Ts = 6, Ya = 7;
|
|
93
|
-
class ks {
|
|
94
|
-
constructor(t, e, s) {
|
|
95
|
-
$(this, "type");
|
|
96
|
-
$(this, "strings");
|
|
97
|
-
$(this, "values");
|
|
98
|
-
this.type = t, this.strings = e, this.values = s;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
const Os = (n) => (t, ...e) => new ks(n, t, e), ht = Os(
|
|
102
|
-
0
|
|
103
|
-
/* HTML */
|
|
104
|
-
), Za = Os(
|
|
105
|
-
1
|
|
106
|
-
/* SVG */
|
|
107
|
-
), Xa = Os(
|
|
108
|
-
2
|
|
109
|
-
/* MATHML */
|
|
110
|
-
), Ms = Symbol.for("lit-noChange"), Ni = /* @__PURE__ */ new WeakMap(), Mt = Ht.createTreeWalker(
|
|
111
|
-
Ht,
|
|
112
|
-
129
|
|
113
|
-
/* NodeFilter.SHOW_{ELEMENT|COMMENT} */
|
|
114
|
-
);
|
|
115
|
-
function tc(n, t) {
|
|
116
|
-
if (!Array.isArray(n)) throw new Error("invalid template");
|
|
117
|
-
return Pi !== void 0 ? Pi.createHTML(t) : t;
|
|
5
|
+
var Za = (s, t, e) => t in s ? Ya(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
6
|
+
var v = (s, t, e) => Za(s, typeof t != "symbol" ? t + "" : t, e), Bs = (s, t, e) => t.has(s) || Ri("Cannot " + e);
|
|
7
|
+
var _ = (s, t, e) => (Bs(s, t, "read from private field"), e ? e.call(s) : t.get(s)), E = (s, t, e) => t.has(s) ? Ri("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), M = (s, t, e, n) => (Bs(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), Ks = (s, t, e) => (Bs(s, t, "access private method"), e);
|
|
8
|
+
const { assign: Xa, fromEntries: tc, entries: ec, keys: sc } = Object;
|
|
9
|
+
function nc(s) {
|
|
10
|
+
Promise.resolve().then(s);
|
|
11
|
+
}
|
|
12
|
+
const js = /* @__PURE__ */ new Set();
|
|
13
|
+
function St(s, t = nc) {
|
|
14
|
+
js.has(s) || (t(() => {
|
|
15
|
+
js.delete(s), s();
|
|
16
|
+
}), js.add(s));
|
|
17
|
+
}
|
|
18
|
+
function xs(s, t) {
|
|
19
|
+
const e = t;
|
|
20
|
+
return delete e.name, delete e.length, Xa(e, s), e;
|
|
118
21
|
}
|
|
119
|
-
|
|
120
|
-
const e
|
|
121
|
-
|
|
122
|
-
for (let l = 0; l < e; l++) {
|
|
123
|
-
const d = n[l];
|
|
124
|
-
let f = -1, o, m = 0, h;
|
|
125
|
-
for (; m < d.length && (a.lastIndex = m, h = a.exec(d), h !== null); )
|
|
126
|
-
m = a.lastIndex, a === we ? h[Ti] === "!--" ? a = ki : h[Ti] !== void 0 ? a = Oi : h[Kn] !== void 0 ? (yr.test(h[Kn]) && (r = new RegExp(`</${h[Kn]}`, "g")), a = Ct) : h[Fa] !== void 0 && (a = Ct) : a === Ct ? h[Ba] === ">" ? (a = r ?? we, f = -1) : h[Mi] === void 0 ? f = -2 : (f = a.lastIndex - h[Ka].length, o = h[Mi], a = h[xi] === void 0 ? Ct : h[xi] === '"' ? Li : Ai) : a === Li || a === Ai ? a = Ct : a === ki || a === Oi ? a = we : (a = Ct, r = void 0);
|
|
127
|
-
const g = a === Ct && n[l + 1].startsWith("/>") ? " " : "";
|
|
128
|
-
i += a === we ? d + Da : f >= 0 ? (s.push(o), d.slice(0, f) + vr + d.slice(f) + mt + g) : d + mt + (f === -2 ? l : g);
|
|
129
|
-
}
|
|
130
|
-
const c = i + (n[e] || "<?>") + (t === 1 ? "</svg>" : t === 2 ? "</math>" : "");
|
|
131
|
-
return [tc(n, c), s];
|
|
132
|
-
};
|
|
133
|
-
class xs {
|
|
134
|
-
constructor({ strings: t, type: e }, s) {
|
|
135
|
-
/** @internal */
|
|
136
|
-
$(this, "el");
|
|
137
|
-
$(this, "parts", []);
|
|
138
|
-
let i, r = 0, a = 0;
|
|
139
|
-
const c = t.length - 1, l = this.parts, [d, f] = ec(t, e);
|
|
140
|
-
if (this.el = xs.createElement(d, s), Mt.currentNode = this.el.content, e === 1 || e === 2) {
|
|
141
|
-
const o = this.el.content.firstChild;
|
|
142
|
-
o.replaceWith(...o.childNodes);
|
|
143
|
-
}
|
|
144
|
-
for (; (i = Mt.nextNode()) !== null && l.length < c; ) {
|
|
145
|
-
if (i.nodeType === 1) {
|
|
146
|
-
if (i.hasAttributes())
|
|
147
|
-
for (const o of i.getAttributeNames())
|
|
148
|
-
if (o.endsWith(vr)) {
|
|
149
|
-
const m = f[a++], g = i.getAttribute(o).split(mt), v = /([.?@])?(.*)/.exec(m);
|
|
150
|
-
l.push({
|
|
151
|
-
type: Ps,
|
|
152
|
-
index: r,
|
|
153
|
-
name: v[2],
|
|
154
|
-
strings: g,
|
|
155
|
-
ctor: v[1] === "." ? sc : v[1] === "?" ? ic : v[1] === "@" ? rc : On
|
|
156
|
-
}), i.removeAttribute(o);
|
|
157
|
-
} else o.startsWith(mt) && (l.push({
|
|
158
|
-
type: Ts,
|
|
159
|
-
index: r
|
|
160
|
-
}), i.removeAttribute(o));
|
|
161
|
-
if (yr.test(i.tagName)) {
|
|
162
|
-
const o = i.textContent.split(mt), m = o.length - 1;
|
|
163
|
-
if (m > 0) {
|
|
164
|
-
i.textContent = qe ? qe.emptyScript : "";
|
|
165
|
-
for (let h = 0; h < m; h++)
|
|
166
|
-
i.append(o[h], Be()), Mt.nextNode(), l.push({ type: vn, index: ++r });
|
|
167
|
-
i.append(o[m], Be());
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
} else if (i.nodeType === 8)
|
|
171
|
-
if (i.data === wr)
|
|
172
|
-
l.push({ type: vn, index: r });
|
|
173
|
-
else {
|
|
174
|
-
let m = -1;
|
|
175
|
-
for (; (m = i.data.indexOf(mt, m + 1)) !== -1; )
|
|
176
|
-
l.push({ type: Ya, index: r }), m += mt.length - 1;
|
|
177
|
-
}
|
|
178
|
-
r++;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
// Overridden via `litHtmlPolyfillSupport` to provide platform support.
|
|
182
|
-
/** @nocollapse */
|
|
183
|
-
static createElement(t, e) {
|
|
184
|
-
const s = Ht.createElement("template");
|
|
185
|
-
return s.innerHTML = t, s;
|
|
186
|
-
}
|
|
22
|
+
function xr(s = "", t = "") {
|
|
23
|
+
const { pathname: e, search: n, hash: i } = new URL(t, location.origin + s);
|
|
24
|
+
return e + n + decodeURIComponent(i);
|
|
187
25
|
}
|
|
188
|
-
function
|
|
189
|
-
|
|
190
|
-
if (t === Ms)
|
|
191
|
-
return t;
|
|
192
|
-
let i = s !== void 0 ? (a = e.__directives) == null ? void 0 : a[s] : e.__directive;
|
|
193
|
-
const r = Ke(t) ? void 0 : (
|
|
194
|
-
// This property needs to remain unminified.
|
|
195
|
-
t._$litDirective$
|
|
196
|
-
);
|
|
197
|
-
return (i == null ? void 0 : i.constructor) !== r && ((c = i == null ? void 0 : i._$notifyDirectiveConnectionChanged) == null || c.call(i, !1), r === void 0 ? i = void 0 : (i = new r(n), i._$initialize(n, e, s)), s !== void 0 ? (e.__directives ?? (e.__directives = []))[s] = i : e.__directive = i), i !== void 0 && (t = re(
|
|
198
|
-
n,
|
|
199
|
-
i._$resolve(n, t.values),
|
|
200
|
-
i,
|
|
201
|
-
s
|
|
202
|
-
)), t;
|
|
26
|
+
function Lr(s, t, e, n) {
|
|
27
|
+
return s.addEventListener(t, e, n), () => s.removeEventListener(t, e, n);
|
|
203
28
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
this._$template = t, this._$parent = e;
|
|
213
|
-
}
|
|
214
|
-
// Called by ChildPart parentNode getter
|
|
215
|
-
get parentNode() {
|
|
216
|
-
return this._$parent.parentNode;
|
|
29
|
+
var dt, at, ut, Je, nn;
|
|
30
|
+
class ic extends EventTarget {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(...arguments);
|
|
33
|
+
E(this, Je);
|
|
34
|
+
E(this, dt, /* @__PURE__ */ new Map());
|
|
35
|
+
E(this, at);
|
|
36
|
+
E(this, ut);
|
|
217
37
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
return this._$parent._$isConnected;
|
|
38
|
+
get size() {
|
|
39
|
+
return _(this, dt).size;
|
|
221
40
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
_clone(t) {
|
|
225
|
-
const {
|
|
226
|
-
el: { content: e },
|
|
227
|
-
parts: s
|
|
228
|
-
} = this._$template, i = ((t == null ? void 0 : t.creationScope) ?? Ht).importNode(e, !0);
|
|
229
|
-
Mt.currentNode = i;
|
|
230
|
-
let r = Mt.nextNode(), a = 0, c = 0, l = s[0];
|
|
231
|
-
for (; l !== void 0; ) {
|
|
232
|
-
if (a === l.index) {
|
|
233
|
-
let d;
|
|
234
|
-
l.type === vn ? d = new on(r, r.nextSibling, this, t) : l.type === Ps ? d = new l.ctor(r, l.name, l.strings, this, t) : l.type === Ts && (d = new oc(r, this, t)), this._$parts.push(d), l = s[++c];
|
|
235
|
-
}
|
|
236
|
-
a !== (l == null ? void 0 : l.index) && (r = Mt.nextNode(), a++);
|
|
237
|
-
}
|
|
238
|
-
return Mt.currentNode = Ht, i;
|
|
41
|
+
get first() {
|
|
42
|
+
return _(this, at);
|
|
239
43
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
for (const s of this._$parts)
|
|
243
|
-
s !== void 0 && (s.strings !== void 0 ? (s._$setValue(t, s, e), e += s.strings.length - 2) : s._$setValue(t[e])), e++;
|
|
44
|
+
get last() {
|
|
45
|
+
return _(this, ut);
|
|
244
46
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
$(this, "_$startNode");
|
|
255
|
-
/** @internal */
|
|
256
|
-
$(this, "_$endNode");
|
|
257
|
-
/** @internal */
|
|
258
|
-
$(this, "_$parent");
|
|
259
|
-
/**
|
|
260
|
-
* Connection state for RootParts only (i.e. ChildPart without _$parent
|
|
261
|
-
* returned from top-level `render`). This field is unused otherwise. The
|
|
262
|
-
* intention would be clearer if we made `RootPart` a subclass of `ChildPart`
|
|
263
|
-
* with this field (and a different _$isConnected getter), but the subclass
|
|
264
|
-
* caused a perf regression, possibly due to making call sites polymorphic.
|
|
265
|
-
* @internal
|
|
266
|
-
*/
|
|
267
|
-
$(this, "__isConnected");
|
|
268
|
-
// The following fields will be patched onto ChildParts when required by
|
|
269
|
-
// AsyncDirective
|
|
270
|
-
/** @internal */
|
|
271
|
-
$(this, "_$disconnectableChildren");
|
|
272
|
-
this._$startNode = t, this._$endNode = e, this._$parent = s, this.options = i, this.__isConnected = (i == null ? void 0 : i.isConnected) ?? !0;
|
|
47
|
+
isSuperLinkOf(e) {
|
|
48
|
+
let n = e.first;
|
|
49
|
+
if (!n) return !0;
|
|
50
|
+
let i = this.find(n.value);
|
|
51
|
+
for (; i && i.value === n.value; ) {
|
|
52
|
+
if (n = n.next, !n) return !0;
|
|
53
|
+
i = i.next;
|
|
54
|
+
}
|
|
55
|
+
return !1;
|
|
273
56
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
var t;
|
|
277
|
-
return ((t = this._$parent) == null ? void 0 : t._$isConnected) ?? this.__isConnected;
|
|
57
|
+
find(e) {
|
|
58
|
+
return _(this, dt).get(e);
|
|
278
59
|
}
|
|
279
60
|
/**
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
* A ChildPart's content consists of a range of adjacent child nodes of
|
|
283
|
-
* `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and
|
|
284
|
-
* `.endNode`).
|
|
285
|
-
*
|
|
286
|
-
* - If both `.startNode` and `.endNode` are non-null, then the part's content
|
|
287
|
-
* consists of all siblings between `.startNode` and `.endNode`, exclusively.
|
|
288
|
-
*
|
|
289
|
-
* - If `.startNode` is non-null but `.endNode` is null, then the part's
|
|
290
|
-
* content consists of all siblings following `.startNode`, up to and
|
|
291
|
-
* including the last child of `.parentNode`. If `.endNode` is non-null, then
|
|
292
|
-
* `.startNode` will always be non-null.
|
|
293
|
-
*
|
|
294
|
-
* - If both `.endNode` and `.startNode` are null, then the part's content
|
|
295
|
-
* consists of all child nodes of `.parentNode`.
|
|
61
|
+
* 添加到尾部,已存在时会删除老的项目
|
|
62
|
+
* 如果是添加第一个,start 事件会在添加前触发,避免处理事件重复的逻辑
|
|
296
63
|
*/
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
const
|
|
300
|
-
|
|
64
|
+
add(e) {
|
|
65
|
+
_(this, ut) || this.dispatchEvent(new CustomEvent("start"));
|
|
66
|
+
const n = Ks(this, Je, nn).call(this, e) || { value: e };
|
|
67
|
+
n.prev = _(this, ut), n.prev && (n.prev.next = n), n.next = void 0, M(this, ut, n), _(this, at) || M(this, at, n), _(this, dt).set(e, n);
|
|
301
68
|
}
|
|
302
|
-
/**
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
get startNode() {
|
|
307
|
-
return this._$startNode;
|
|
69
|
+
/** 删除这个元素后没有其他元素时立即出发 end 事件 */
|
|
70
|
+
delete(e) {
|
|
71
|
+
const n = Ks(this, Je, nn).call(this, e);
|
|
72
|
+
return _(this, at) || this.dispatchEvent(new CustomEvent("end")), n;
|
|
308
73
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
* information.
|
|
312
|
-
*/
|
|
313
|
-
get endNode() {
|
|
314
|
-
return this._$endNode;
|
|
74
|
+
clear() {
|
|
75
|
+
_(this, dt).clear(), M(this, at, M(this, ut, void 0));
|
|
315
76
|
}
|
|
316
|
-
|
|
317
|
-
|
|
77
|
+
/** 获取头部元素,会从链表删除 */
|
|
78
|
+
get() {
|
|
79
|
+
const e = _(this, at);
|
|
80
|
+
if (e)
|
|
81
|
+
return this.delete(e.value), e.value;
|
|
318
82
|
}
|
|
319
|
-
|
|
320
|
-
|
|
83
|
+
}
|
|
84
|
+
dt = new WeakMap(), at = new WeakMap(), ut = new WeakMap(), Je = new WeakSet(), nn = function(e) {
|
|
85
|
+
const n = _(this, dt).get(e);
|
|
86
|
+
return n && (n.prev ? n.prev.next = n.next : M(this, at, n.next), n.next ? n.next.prev = n.prev : M(this, ut, n.prev), _(this, dt).delete(e)), n;
|
|
87
|
+
};
|
|
88
|
+
class rc extends WeakMap {
|
|
89
|
+
get(t) {
|
|
90
|
+
let e = super.get(t);
|
|
91
|
+
return e || (e = {}, this.set(t, e)), e;
|
|
321
92
|
}
|
|
322
|
-
|
|
323
|
-
|
|
93
|
+
}
|
|
94
|
+
var Qt, Ts;
|
|
95
|
+
class qe extends URLSearchParams {
|
|
96
|
+
constructor() {
|
|
97
|
+
super(...arguments);
|
|
98
|
+
E(this, Qt, (e) => typeof e == "string" ? e : JSON.stringify(e));
|
|
99
|
+
E(this, Ts, (e) => {
|
|
100
|
+
if (!e) return null;
|
|
101
|
+
try {
|
|
102
|
+
return JSON.parse(e);
|
|
103
|
+
} catch {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
324
107
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
this._$committedValue = t;
|
|
108
|
+
// support `{ key: ObjectValue }`
|
|
109
|
+
concat(e) {
|
|
110
|
+
let n;
|
|
111
|
+
typeof e == "string" ? n = tc(new URLSearchParams(e).entries()) : n = e, ec(n).forEach(([i, o]) => {
|
|
112
|
+
this.append(i, _(this, Qt).call(this, o));
|
|
113
|
+
});
|
|
332
114
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
if (((i = this._$committedValue) == null ? void 0 : i._$template) === s)
|
|
337
|
-
this._$committedValue._update(e);
|
|
115
|
+
setAny(e, n) {
|
|
116
|
+
if (Array.isArray(n))
|
|
117
|
+
this.delete(e), n.forEach((i) => this.append(e, _(this, Qt).call(this, i)));
|
|
338
118
|
else {
|
|
339
|
-
const
|
|
340
|
-
|
|
119
|
+
const i = _(this, Qt).call(this, n);
|
|
120
|
+
i ? this.set(e, i) : this.delete(e);
|
|
341
121
|
}
|
|
342
122
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
_$getTemplate(t) {
|
|
346
|
-
let e = Ni.get(t.strings);
|
|
347
|
-
return e === void 0 && Ni.set(t.strings, e = new xs(t)), e;
|
|
123
|
+
getAny(e) {
|
|
124
|
+
return this.getAnyAll(e)[0];
|
|
348
125
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
const e = this._$committedValue;
|
|
352
|
-
let s = 0, i;
|
|
353
|
-
for (const r of t)
|
|
354
|
-
s === e.length ? e.push(
|
|
355
|
-
i = new on(this._insert(Be()), this._insert(Be()), this, this.options)
|
|
356
|
-
) : i = e[s], i._$setValue(r), s++;
|
|
357
|
-
s < e.length && (this._$clear(i && i._$endNode.nextSibling, s), e.length = s);
|
|
126
|
+
getAnyAll(e) {
|
|
127
|
+
return this.getAll(e).filter((n) => n !== "").map((n) => _(this, Ts).call(this, n));
|
|
358
128
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
* @param start Start node to clear from, for clearing a subset of the part's
|
|
363
|
-
* DOM (used when truncating iterables)
|
|
364
|
-
* @param from When `start` is specified, the index within the iterable from
|
|
365
|
-
* which ChildParts are being removed, used for disconnecting directives in
|
|
366
|
-
* those Parts.
|
|
367
|
-
*
|
|
368
|
-
* @internal
|
|
369
|
-
*/
|
|
370
|
-
_$clear(t = this._$startNode.nextSibling, e) {
|
|
371
|
-
var s;
|
|
372
|
-
for ((s = this._$notifyConnectionChanged) == null || s.call(this, !1, !0, e); t && t !== this._$endNode; ) {
|
|
373
|
-
const i = t.nextSibling;
|
|
374
|
-
t.remove(), t = i;
|
|
375
|
-
}
|
|
129
|
+
toString() {
|
|
130
|
+
const e = super.toString();
|
|
131
|
+
return e ? `?${e}` : "";
|
|
376
132
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
* should only be called on `RootPart`s (the `ChildPart` returned from a
|
|
380
|
-
* top-level `render()` call). It has no effect on non-root ChildParts.
|
|
381
|
-
* @param isConnected Whether to set
|
|
382
|
-
* @internal
|
|
383
|
-
*/
|
|
384
|
-
setConnected(t) {
|
|
385
|
-
var e;
|
|
386
|
-
this._$parent === void 0 && (this.__isConnected = t, (e = this._$notifyConnectionChanged) == null || e.call(this, t));
|
|
133
|
+
toJSON() {
|
|
134
|
+
return this.toString();
|
|
387
135
|
}
|
|
388
136
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
return this.element.tagName;
|
|
137
|
+
Qt = new WeakMap(), Ts = new WeakMap();
|
|
138
|
+
function Nn(s, ...t) {
|
|
139
|
+
return s.reduce((e, n, i) => e + (t[i - 1] ?? "") + n);
|
|
140
|
+
}
|
|
141
|
+
const Pl = Nn;
|
|
142
|
+
function Rn(s = 5) {
|
|
143
|
+
const t = Math.random().toString(36).slice(2, 2 + s);
|
|
144
|
+
return t.length < s ? t + Rn(s - t.length) : t;
|
|
145
|
+
}
|
|
146
|
+
function he(s) {
|
|
147
|
+
return s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
148
|
+
}
|
|
149
|
+
function Ml(s) {
|
|
150
|
+
return s.replace(/-(.)/g, (t, e) => e.toUpperCase());
|
|
151
|
+
}
|
|
152
|
+
function In(s) {
|
|
153
|
+
return sc(s).forEach((t) => {
|
|
154
|
+
delete s[t];
|
|
155
|
+
}), s;
|
|
156
|
+
}
|
|
157
|
+
class wt extends Error {
|
|
158
|
+
constructor(t) {
|
|
159
|
+
super(t), this.message = `gem: ${this.message}`;
|
|
413
160
|
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
* of the template instance values, and allow a fast-path for single-valued
|
|
428
|
-
* parts.
|
|
429
|
-
*
|
|
430
|
-
* @param value The part value, or an array of values for multi-valued parts
|
|
431
|
-
* @param valueIndex the index to start reading values from. `undefined` for
|
|
432
|
-
* single-valued parts
|
|
433
|
-
* @param noCommit causes the part to not commit its value to the DOM. Used
|
|
434
|
-
* in hydration to prime attribute parts with their first-rendered value,
|
|
435
|
-
* but not set the attribute, and in SSR to no-op the DOM operation and
|
|
436
|
-
* capture the value for serialization.
|
|
437
|
-
*
|
|
438
|
-
* @internal
|
|
439
|
-
*/
|
|
440
|
-
_$setValue(t, e = this, s, i) {
|
|
441
|
-
const r = this.strings;
|
|
442
|
-
let a = !1;
|
|
443
|
-
if (r === void 0)
|
|
444
|
-
t = re(this, t, e, 0), a = !Ke(t) || t !== this._$committedValue, a && (this._$committedValue = t);
|
|
445
|
-
else {
|
|
446
|
-
const c = t;
|
|
447
|
-
t = r[0];
|
|
448
|
-
let l, d;
|
|
449
|
-
for (l = 0; l < r.length - 1; l++)
|
|
450
|
-
d = re(this, c[s + l], e, l), a || (a = !Ke(d) || d !== this._$committedValue[l]), jt(d) ? t = void 0 : jt(t) || (t += d + r[l + 1]), this._$committedValue[l] = d;
|
|
451
|
-
}
|
|
452
|
-
a && !i && this._commitValue(t);
|
|
453
|
-
}
|
|
454
|
-
/** @internal */
|
|
455
|
-
_commitValue(t) {
|
|
456
|
-
jt(t) ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t);
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
class sc extends On {
|
|
460
|
-
constructor() {
|
|
461
|
-
super(...arguments);
|
|
462
|
-
$(this, "type", ja);
|
|
463
|
-
}
|
|
464
|
-
/** @internal */
|
|
465
|
-
_commitValue(e) {
|
|
466
|
-
this.element[this.name] = e;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
class ic extends On {
|
|
470
|
-
constructor() {
|
|
471
|
-
super(...arguments);
|
|
472
|
-
$(this, "type", Ja);
|
|
473
|
-
}
|
|
474
|
-
/** @internal */
|
|
475
|
-
_commitValue(e) {
|
|
476
|
-
this.element.toggleAttribute(this.name, !!e);
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
class rc extends On {
|
|
480
|
-
constructor(e, s, i, r, a) {
|
|
481
|
-
super(e, s, i, r, a);
|
|
482
|
-
$(this, "type", Qa);
|
|
483
|
-
}
|
|
484
|
-
/** @internal */
|
|
485
|
-
_$setValue(e, s = this) {
|
|
486
|
-
e = re(this, e, s, 0);
|
|
487
|
-
const i = this._$committedValue, r = i && (!e || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive), a = e && (!i || r);
|
|
488
|
-
r && this.element.removeEventListener(this.name, this, i), a && this.element.addEventListener(this.name, this, e), this._$committedValue = e;
|
|
489
|
-
}
|
|
490
|
-
handleEvent(e) {
|
|
491
|
-
var s;
|
|
492
|
-
typeof this._$committedValue == "function" ? this._$committedValue.call(((s = this.options) == null ? void 0 : s.host) ?? this.element, e) : this._$committedValue.handleEvent(e);
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
class oc {
|
|
496
|
-
constructor(t, e, s) {
|
|
497
|
-
$(this, "type", Ts);
|
|
498
|
-
/** @internal */
|
|
499
|
-
$(this, "__directive");
|
|
500
|
-
// This is to ensure that every Part has a _$committedValue
|
|
501
|
-
$(this, "_$committedValue");
|
|
502
|
-
/** @internal */
|
|
503
|
-
$(this, "_$parent");
|
|
504
|
-
/** @internal */
|
|
505
|
-
$(this, "_$disconnectableChildren");
|
|
506
|
-
$(this, "_$props");
|
|
507
|
-
$(this, "options");
|
|
508
|
-
this.element = t, this._$parent = e, this.options = s;
|
|
509
|
-
}
|
|
510
|
-
// See comment in Disconnectable interface for why this is a getter
|
|
511
|
-
get _$isConnected() {
|
|
512
|
-
return this._$parent._$isConnected;
|
|
513
|
-
}
|
|
514
|
-
_$setValue(t) {
|
|
515
|
-
if (t)
|
|
516
|
-
if (t instanceof Sr)
|
|
517
|
-
t.value = this.element;
|
|
518
|
-
else if (t._$litDirective$)
|
|
519
|
-
re(this, t);
|
|
520
|
-
else {
|
|
521
|
-
if (this._$props)
|
|
522
|
-
for (const e in this._$props)
|
|
523
|
-
Reflect.set(this.element, e, void 0);
|
|
524
|
-
Object.assign(this.element, t), this._$props = t;
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
const ac = () => new Sr();
|
|
529
|
-
class Sr {
|
|
530
|
-
constructor() {
|
|
531
|
-
$(this, "value");
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
const As = (n, t, e) => {
|
|
535
|
-
const s = (e == null ? void 0 : e.renderBefore) ?? t;
|
|
536
|
-
let i = s._$litPart$;
|
|
537
|
-
if (i === void 0) {
|
|
538
|
-
const r = (e == null ? void 0 : e.renderBefore) ?? null;
|
|
539
|
-
s._$litPart$ = i = new on(
|
|
540
|
-
t.insertBefore(Be(), r),
|
|
541
|
-
r,
|
|
542
|
-
void 0,
|
|
543
|
-
e ?? {}
|
|
544
|
-
);
|
|
545
|
-
}
|
|
546
|
-
return i._$setValue(n), i;
|
|
547
|
-
}, { assign: cc, fromEntries: hc, entries: lc, keys: dc } = Object, jn = /* @__PURE__ */ new Set();
|
|
548
|
-
function xt(n) {
|
|
549
|
-
jn.has(n) || (queueMicrotask(() => {
|
|
550
|
-
jn.delete(n), n();
|
|
551
|
-
}), jn.add(n));
|
|
552
|
-
}
|
|
553
|
-
function Mn(n, t) {
|
|
554
|
-
const e = t;
|
|
555
|
-
return delete e.name, delete e.length, cc(e, n), e;
|
|
556
|
-
}
|
|
557
|
-
function Er(n = "", t = "") {
|
|
558
|
-
const { pathname: e, search: s, hash: i } = new URL(t, location.origin + n);
|
|
559
|
-
return e + s + decodeURIComponent(i);
|
|
560
|
-
}
|
|
561
|
-
function Cr(n, t, e, s) {
|
|
562
|
-
return n.addEventListener(t, e, s), () => n.removeEventListener(t, e, s);
|
|
563
|
-
}
|
|
564
|
-
var gt, lt, $t, Xe, ts;
|
|
565
|
-
class uc extends EventTarget {
|
|
566
|
-
constructor() {
|
|
567
|
-
super(...arguments);
|
|
568
|
-
E(this, Xe);
|
|
569
|
-
E(this, gt, /* @__PURE__ */ new Map());
|
|
570
|
-
E(this, lt);
|
|
571
|
-
E(this, $t);
|
|
572
|
-
}
|
|
573
|
-
get size() {
|
|
574
|
-
return _(this, gt).size;
|
|
575
|
-
}
|
|
576
|
-
get first() {
|
|
577
|
-
return _(this, lt);
|
|
578
|
-
}
|
|
579
|
-
get last() {
|
|
580
|
-
return _(this, $t);
|
|
581
|
-
}
|
|
582
|
-
isSuperLinkOf(e) {
|
|
583
|
-
let s = e.first;
|
|
584
|
-
if (!s) return !0;
|
|
585
|
-
let i = this.find(s.value);
|
|
586
|
-
for (; i && i.value === s.value; ) {
|
|
587
|
-
if (s = s.next, !s) return !0;
|
|
588
|
-
i = i.next;
|
|
589
|
-
}
|
|
590
|
-
return !1;
|
|
591
|
-
}
|
|
592
|
-
find(e) {
|
|
593
|
-
return _(this, gt).get(e);
|
|
594
|
-
}
|
|
595
|
-
// 添加到尾部,已存在时会删除老的项目
|
|
596
|
-
// 如果是添加第一个,start 事件会在添加前触发,避免处理事件重复的逻辑
|
|
597
|
-
add(e) {
|
|
598
|
-
_(this, $t) || this.dispatchEvent(new CustomEvent("start"));
|
|
599
|
-
const s = Fn(this, Xe, ts).call(this, e) || { value: e };
|
|
600
|
-
s.prev = _(this, $t), s.prev && (s.prev.next = s), s.next = void 0, O(this, $t, s), _(this, lt) || O(this, lt, s), _(this, gt).set(e, s);
|
|
601
|
-
}
|
|
602
|
-
// 删除这个元素后没有其他元素时立即出发 end 事件
|
|
603
|
-
delete(e) {
|
|
604
|
-
const s = Fn(this, Xe, ts).call(this, e);
|
|
605
|
-
return _(this, lt) || this.dispatchEvent(new CustomEvent("end")), s;
|
|
606
|
-
}
|
|
607
|
-
// 获取头部元素
|
|
608
|
-
// 会从链表删除
|
|
609
|
-
get() {
|
|
610
|
-
const e = _(this, lt);
|
|
611
|
-
if (e)
|
|
612
|
-
return this.delete(e.value), e.value;
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
gt = new WeakMap(), lt = new WeakMap(), $t = new WeakMap(), Xe = new WeakSet(), ts = function(e) {
|
|
616
|
-
const s = _(this, gt).get(e);
|
|
617
|
-
return s && (s.prev ? s.prev.next = s.next : O(this, lt, s.next), s.next ? s.next.prev = s.prev : O(this, $t, s.prev), _(this, gt).delete(e)), s;
|
|
618
|
-
};
|
|
619
|
-
class _c extends WeakMap {
|
|
620
|
-
get(t) {
|
|
621
|
-
let e = super.get(t);
|
|
622
|
-
return e || (e = {}, this.set(t, e)), e;
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
var Jt, Cn;
|
|
626
|
-
class je extends URLSearchParams {
|
|
627
|
-
constructor(e) {
|
|
628
|
-
super(e);
|
|
629
|
-
E(this, Jt, (e) => typeof e == "string" ? e : JSON.stringify(e));
|
|
630
|
-
E(this, Cn, (e) => {
|
|
631
|
-
if (!e) return null;
|
|
632
|
-
try {
|
|
633
|
-
return JSON.parse(e);
|
|
634
|
-
} catch {
|
|
635
|
-
return null;
|
|
636
|
-
}
|
|
637
|
-
});
|
|
638
|
-
}
|
|
639
|
-
// support `{ key: ObjectValue }`
|
|
640
|
-
concat(e) {
|
|
641
|
-
let s;
|
|
642
|
-
typeof e == "string" ? s = hc(new URLSearchParams(e).entries()) : s = e, lc(s).forEach(([i, r]) => {
|
|
643
|
-
this.append(i, _(this, Jt).call(this, r));
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
setAny(e, s) {
|
|
647
|
-
if (Array.isArray(s))
|
|
648
|
-
this.delete(e), s.forEach((i) => this.append(e, _(this, Jt).call(this, i)));
|
|
649
|
-
else {
|
|
650
|
-
const i = _(this, Jt).call(this, s);
|
|
651
|
-
i ? this.set(e, i) : this.delete(e);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
getAny(e) {
|
|
655
|
-
return this.getAnyAll(e)[0];
|
|
656
|
-
}
|
|
657
|
-
getAnyAll(e) {
|
|
658
|
-
return this.getAll(e).filter((s) => s !== "").map((s) => _(this, Cn).call(this, s));
|
|
659
|
-
}
|
|
660
|
-
toString() {
|
|
661
|
-
const e = super.toString();
|
|
662
|
-
return e ? `?${e}` : "";
|
|
663
|
-
}
|
|
664
|
-
toJSON() {
|
|
665
|
-
return this.toString();
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
Jt = new WeakMap(), Cn = new WeakMap();
|
|
669
|
-
function br(n, ...t) {
|
|
670
|
-
return n.reduce((e, s, i) => e + (t[i - 1] ?? "") + s);
|
|
671
|
-
}
|
|
672
|
-
const ul = br;
|
|
673
|
-
function Ls(n = 5) {
|
|
674
|
-
const t = Math.random().toString(36).slice(2, 2 + n);
|
|
675
|
-
return t.length < n ? t + Ls(n - t.length) : t;
|
|
676
|
-
}
|
|
677
|
-
function ce(n) {
|
|
678
|
-
return n.replace(/[A-Z]/g, (t) => "-" + t.toLowerCase());
|
|
679
|
-
}
|
|
680
|
-
function _l(n) {
|
|
681
|
-
return n.replace(/-(.)/g, (t, e) => e.toUpperCase());
|
|
682
|
-
}
|
|
683
|
-
function Ns(n) {
|
|
684
|
-
return dc(n).forEach((t) => {
|
|
685
|
-
delete n[t];
|
|
686
|
-
}), n;
|
|
687
|
-
}
|
|
688
|
-
class vt extends Error {
|
|
689
|
-
constructor(t) {
|
|
690
|
-
super(t), this.message = `gem: ${this.message}`;
|
|
161
|
+
}
|
|
162
|
+
function oc(s, t) {
|
|
163
|
+
const e = s.length;
|
|
164
|
+
if (t.length !== e) return !0;
|
|
165
|
+
for (let n = 0; n < e; n++)
|
|
166
|
+
if (s[n] !== t[n]) return !0;
|
|
167
|
+
return !1;
|
|
168
|
+
}
|
|
169
|
+
function Hn(s, t, e) {
|
|
170
|
+
let n = t;
|
|
171
|
+
for (const i in s) {
|
|
172
|
+
const o = e(i, s[i]);
|
|
173
|
+
n += o ? o + t : "";
|
|
691
174
|
}
|
|
175
|
+
return n;
|
|
692
176
|
}
|
|
693
|
-
function
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
for (let s = 0; s < e; s++)
|
|
697
|
-
if (n[s] !== t[s]) return !0;
|
|
698
|
-
return !1;
|
|
699
|
-
}
|
|
700
|
-
function Rs(n, t, e) {
|
|
701
|
-
let s = t;
|
|
702
|
-
for (const i in n) {
|
|
703
|
-
const r = e(i, n[i]);
|
|
704
|
-
s += r ? r + t : "";
|
|
705
|
-
}
|
|
706
|
-
return s;
|
|
707
|
-
}
|
|
708
|
-
function pl(n) {
|
|
709
|
-
return Rs(
|
|
710
|
-
n,
|
|
177
|
+
function Ol(s) {
|
|
178
|
+
return Hn(
|
|
179
|
+
s,
|
|
711
180
|
";",
|
|
712
|
-
(t, e) => e || e === 0 ? `${
|
|
181
|
+
(t, e) => e || e === 0 ? `${he(t)}:${e}` : ""
|
|
713
182
|
);
|
|
714
183
|
}
|
|
715
|
-
function
|
|
716
|
-
return
|
|
184
|
+
function ac(s) {
|
|
185
|
+
return Hn(s, " ", (t, e) => e ? t : "");
|
|
717
186
|
}
|
|
718
|
-
const
|
|
719
|
-
function
|
|
720
|
-
return
|
|
721
|
-
|
|
187
|
+
const xl = ac;
|
|
188
|
+
function Ll(s) {
|
|
189
|
+
return Hn(
|
|
190
|
+
s,
|
|
722
191
|
",",
|
|
723
192
|
(t, e) => e === !0 || t === e ? t : e ? `${t}:${e}` : ""
|
|
724
193
|
);
|
|
725
194
|
}
|
|
726
|
-
const
|
|
727
|
-
function
|
|
728
|
-
const t =
|
|
729
|
-
var
|
|
730
|
-
Object.assign(t, e), (
|
|
195
|
+
const vs = /* @__PURE__ */ new WeakMap();
|
|
196
|
+
function Wt(s) {
|
|
197
|
+
const t = xs(s, (e) => {
|
|
198
|
+
var n;
|
|
199
|
+
Object.assign(t, e), (n = vs.get(t)) == null || n.forEach((i) => St(i));
|
|
731
200
|
});
|
|
732
|
-
return
|
|
201
|
+
return vs.set(t, /* @__PURE__ */ new Set()), t;
|
|
733
202
|
}
|
|
734
|
-
function
|
|
735
|
-
const e =
|
|
203
|
+
function mt(s, t) {
|
|
204
|
+
const e = vs.get(s);
|
|
736
205
|
return e == null || e.add(t), () => e == null ? void 0 : e.delete(t);
|
|
737
206
|
}
|
|
738
|
-
const
|
|
207
|
+
const cc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
739
208
|
__proto__: null,
|
|
740
|
-
_StoreListenerMap:
|
|
741
|
-
connect:
|
|
742
|
-
createStore:
|
|
209
|
+
_StoreListenerMap: vs,
|
|
210
|
+
connect: mt,
|
|
211
|
+
createStore: Wt
|
|
743
212
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
BOOLEAN_ATTRIBUTE: 4,
|
|
754
|
-
EVENT: 5,
|
|
755
|
-
ELEMENT: 6
|
|
756
|
-
}, Pr = (n) => (...t) => ({
|
|
757
|
-
// This property needs to remain unminified.
|
|
758
|
-
_$litDirective$: n,
|
|
759
|
-
values: t
|
|
760
|
-
});
|
|
761
|
-
class $c {
|
|
762
|
-
constructor(t) {
|
|
763
|
-
//@internal
|
|
764
|
-
$(this, "__part");
|
|
765
|
-
//@internal
|
|
766
|
-
$(this, "__attributeIndex");
|
|
767
|
-
//@internal
|
|
768
|
-
$(this, "__directive");
|
|
769
|
-
//@internal
|
|
770
|
-
$(this, "_$parent");
|
|
771
|
-
// These will only exist on the AsyncDirective subclass
|
|
772
|
-
//@internal
|
|
773
|
-
$(this, "_$disconnectableChildren");
|
|
774
|
-
}
|
|
775
|
-
// See comment in Disconnectable interface for why this is a getter
|
|
776
|
-
get _$isConnected() {
|
|
777
|
-
return this._$parent._$isConnected;
|
|
778
|
-
}
|
|
779
|
-
/** @internal */
|
|
780
|
-
_$initialize(t, e, s) {
|
|
781
|
-
this.__part = t, this._$parent = e, this.__attributeIndex = s;
|
|
782
|
-
}
|
|
783
|
-
/** @internal */
|
|
784
|
-
_$resolve(t, e) {
|
|
785
|
-
return this.update(t, e);
|
|
786
|
-
}
|
|
787
|
-
update(t, e) {
|
|
788
|
-
return this.render(...e);
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
const Ri = () => document.createComment(""), ye = (n, t, e) => {
|
|
792
|
-
var r;
|
|
793
|
-
const s = n._$startNode.parentNode, i = t === void 0 ? n._$endNode : t._$startNode;
|
|
794
|
-
if (e === void 0) {
|
|
795
|
-
const a = s.insertBefore(Ri(), i), c = s.insertBefore(Ri(), i);
|
|
796
|
-
e = new on(a, c, n, n.options);
|
|
797
|
-
} else {
|
|
798
|
-
const a = e._$endNode.nextSibling, c = e._$parent, l = c !== n;
|
|
799
|
-
if (l) {
|
|
800
|
-
(r = e._$reparentDisconnectables) == null || r.call(e, n), e._$parent = n;
|
|
801
|
-
let d;
|
|
802
|
-
e._$notifyConnectionChanged !== void 0 && (d = n._$isConnected) !== c._$isConnected && e._$notifyConnectionChanged(d);
|
|
803
|
-
}
|
|
804
|
-
if (a !== i || l) {
|
|
805
|
-
let d = e._$startNode;
|
|
806
|
-
for (; d !== a; ) {
|
|
807
|
-
const f = d.nextSibling;
|
|
808
|
-
s.insertBefore(d, i), d = f;
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
return e;
|
|
813
|
-
}, bt = (n, t, e = n) => (n._$setValue(t, e), n), vc = {}, wc = (n, t = vc) => n._$committedValue = t, yc = (n) => n._$committedValue, Jn = (n) => {
|
|
814
|
-
var s;
|
|
815
|
-
(s = n._$notifyConnectionChanged) == null || s.call(n, !1, !0);
|
|
816
|
-
let t = n._$startNode;
|
|
817
|
-
const e = n._$endNode.nextSibling;
|
|
818
|
-
for (; t !== e; ) {
|
|
819
|
-
const i = t.nextSibling;
|
|
820
|
-
t.remove(), t = i;
|
|
821
|
-
}
|
|
822
|
-
}, Ii = (n, t, e) => {
|
|
823
|
-
const s = /* @__PURE__ */ new Map();
|
|
824
|
-
for (let i = t; i <= e; i++)
|
|
825
|
-
s.set(n[i], i);
|
|
826
|
-
return s;
|
|
827
|
-
};
|
|
828
|
-
class Sc extends $c {
|
|
829
|
-
constructor(e) {
|
|
830
|
-
super(e);
|
|
831
|
-
$(this, "_itemKeys");
|
|
832
|
-
if (e.type !== gc.CHILD)
|
|
833
|
-
throw new Error("repeat() can only be used in text expressions");
|
|
834
|
-
}
|
|
835
|
-
_getValuesAndKeys(e, s, i) {
|
|
836
|
-
let r;
|
|
837
|
-
i === void 0 ? i = s : s !== void 0 && (r = s);
|
|
838
|
-
const a = [], c = [];
|
|
839
|
-
let l = 0;
|
|
840
|
-
for (const d of e)
|
|
841
|
-
a[l] = r ? r(d, l) : l, c[l] = i(d, l), l++;
|
|
842
|
-
return {
|
|
843
|
-
values: c,
|
|
844
|
-
keys: a
|
|
845
|
-
};
|
|
846
|
-
}
|
|
847
|
-
render(e, s, i) {
|
|
848
|
-
return this._getValuesAndKeys(e, s, i).values;
|
|
849
|
-
}
|
|
850
|
-
update(e, [s, i, r]) {
|
|
851
|
-
const a = yc(e), { values: c, keys: l } = this._getValuesAndKeys(s, i, r);
|
|
852
|
-
if (!Array.isArray(a))
|
|
853
|
-
return this._itemKeys = l, c;
|
|
854
|
-
const d = this._itemKeys ?? (this._itemKeys = []), f = [];
|
|
855
|
-
let o, m, h = 0, g = a.length - 1, v = 0, S = c.length - 1;
|
|
856
|
-
for (; h <= g && v <= S; )
|
|
857
|
-
if (a[h] === null)
|
|
858
|
-
h++;
|
|
859
|
-
else if (a[g] === null)
|
|
860
|
-
g--;
|
|
861
|
-
else if (d[h] === l[v])
|
|
862
|
-
f[v] = bt(a[h], c[v]), h++, v++;
|
|
863
|
-
else if (d[g] === l[S])
|
|
864
|
-
f[S] = bt(a[g], c[S]), g--, S--;
|
|
865
|
-
else if (d[h] === l[S])
|
|
866
|
-
f[S] = bt(a[h], c[S]), ye(e, f[S + 1], a[h]), h++, S--;
|
|
867
|
-
else if (d[g] === l[v])
|
|
868
|
-
f[v] = bt(a[g], c[v]), ye(e, a[h], a[g]), g--, v++;
|
|
869
|
-
else if (o === void 0 && (o = Ii(l, v, S), m = Ii(d, h, g)), !o.has(d[h]))
|
|
870
|
-
Jn(a[h]), h++;
|
|
871
|
-
else if (!o.has(d[g]))
|
|
872
|
-
Jn(a[g]), g--;
|
|
873
|
-
else {
|
|
874
|
-
const T = m.get(l[v]), p = T !== void 0 ? a[T] : null;
|
|
875
|
-
if (p === null) {
|
|
876
|
-
const b = ye(e, a[h]);
|
|
877
|
-
bt(b, c[v]), f[v] = b;
|
|
878
|
-
} else
|
|
879
|
-
f[v] = bt(p, c[v]), ye(e, a[h], p), a[T] = null;
|
|
880
|
-
v++;
|
|
881
|
-
}
|
|
882
|
-
for (; v <= S; ) {
|
|
883
|
-
const T = ye(e, f[S + 1]);
|
|
884
|
-
bt(T, c[v]), f[v++] = T;
|
|
885
|
-
}
|
|
886
|
-
for (; h <= g; ) {
|
|
887
|
-
const T = a[h++];
|
|
888
|
-
T !== null && Jn(T);
|
|
889
|
-
}
|
|
890
|
-
return this._itemKeys = l, wc(e, f), Ms;
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
const Ec = Pr(Sc), { assign: Hi, defineProperty: Cc } = Object;
|
|
894
|
-
Cc(Symbol, "metadata", { value: Symbol.for("Symbol.metadata") });
|
|
895
|
-
const Tr = (n) => typeof n == "function" && n(), Wt = Symbol.for("gem@sheetToken"), xn = Symbol.for("gem@update"), kr = "gem-style-boundary", Is = "gem@render-error", bc = xn, Qn = /* @__PURE__ */ new WeakMap(), Or = /* @__PURE__ */ new WeakMap();
|
|
896
|
-
var at;
|
|
897
|
-
class Pc extends CSSStyleSheet {
|
|
213
|
+
let ot = (s, ...t) => Nn(s, ...t.map((e) => e instanceof Element ? e.outerHTML : e)), Ls = (s, t) => t.innerHTML = s;
|
|
214
|
+
function Ar(s, t) {
|
|
215
|
+
ot = s, Ls = t;
|
|
216
|
+
}
|
|
217
|
+
const { assign: Ii, defineProperty: hc } = Object;
|
|
218
|
+
hc(Symbol, "metadata", { value: Symbol.for("Symbol.metadata") });
|
|
219
|
+
const Nr = (s) => typeof s == "function" && s(), rn = globalThis.nQM, Et = Symbol.for("gem@sheetToken"), As = Symbol.for("gem@update"), Rr = "gem-style-boundary", Wn = "gem@render-error", lc = As, Qs = /* @__PURE__ */ new WeakMap(), Ir = /* @__PURE__ */ new WeakMap();
|
|
220
|
+
var _t;
|
|
221
|
+
class dc extends CSSStyleSheet {
|
|
898
222
|
constructor() {
|
|
899
223
|
super(...arguments);
|
|
900
|
-
E(this,
|
|
901
|
-
|
|
224
|
+
E(this, _t);
|
|
225
|
+
v(this, "cssText", "");
|
|
902
226
|
}
|
|
903
227
|
get element() {
|
|
904
|
-
return _(this,
|
|
228
|
+
return _(this, _t) || (M(this, _t, document.createElement("style")), _(this, _t).textContent = this.cssText), _(this, _t);
|
|
905
229
|
}
|
|
906
230
|
replaceSync(e) {
|
|
907
|
-
this.cssText = e, _(this,
|
|
231
|
+
this.cssText = e, _(this, _t) && (_(this, _t).textContent = e), super.replaceSync(e);
|
|
908
232
|
}
|
|
909
233
|
}
|
|
910
|
-
|
|
911
|
-
var
|
|
912
|
-
class
|
|
234
|
+
_t = new WeakMap();
|
|
235
|
+
var Lt, Ye, Jt, Yt;
|
|
236
|
+
class uc {
|
|
913
237
|
constructor(t = "") {
|
|
914
|
-
E(this,
|
|
915
|
-
E(this,
|
|
238
|
+
E(this, Lt, "");
|
|
239
|
+
E(this, Ye, "");
|
|
916
240
|
// 不需要 GC
|
|
917
|
-
E(this,
|
|
241
|
+
E(this, Jt, /* @__PURE__ */ new Map());
|
|
918
242
|
E(this, Yt, /* @__PURE__ */ new Map());
|
|
919
|
-
|
|
243
|
+
M(this, Ye, t);
|
|
920
244
|
}
|
|
921
245
|
setContent(t) {
|
|
922
|
-
|
|
923
|
-
}
|
|
924
|
-
getStyle(t) {
|
|
925
|
-
var
|
|
926
|
-
const
|
|
927
|
-
if (!_(this,
|
|
928
|
-
const
|
|
929
|
-
_(this,
|
|
246
|
+
M(this, Lt, t);
|
|
247
|
+
}
|
|
248
|
+
getStyle(t, e) {
|
|
249
|
+
var a;
|
|
250
|
+
const n = t && !((a = t.internals) != null && a.shadowRoot), i = n ? t.constructor : this;
|
|
251
|
+
if (!_(this, Jt).has(i)) {
|
|
252
|
+
const c = new dc({ media: _(this, Ye) });
|
|
253
|
+
_(this, Jt).set(i, c);
|
|
930
254
|
}
|
|
931
|
-
const
|
|
932
|
-
if (!_(this, Yt).has(
|
|
933
|
-
let
|
|
934
|
-
|
|
255
|
+
const o = _(this, Jt).get(i);
|
|
256
|
+
if (!_(this, Yt).has(o)) {
|
|
257
|
+
let c = _(this, Lt), l = "";
|
|
258
|
+
n && (l = e ? "@scope" : `@scope (${t.tagName}) to (:state(${Rr}) > *)`, c = `${l}{ ${c} }`), o.replaceSync(c), _(this, Yt).set(o, l);
|
|
935
259
|
}
|
|
936
|
-
return
|
|
260
|
+
return o;
|
|
937
261
|
}
|
|
938
262
|
// 一般用于主题更新
|
|
939
263
|
updateStyle() {
|
|
940
264
|
_(this, Yt).forEach((t, e) => {
|
|
941
|
-
e.replaceSync(t ? `${t}{${_(this,
|
|
265
|
+
e.replaceSync(t ? `${t}{${_(this, Lt)}}` : _(this, Lt));
|
|
942
266
|
});
|
|
943
267
|
}
|
|
944
268
|
}
|
|
945
|
-
|
|
946
|
-
function
|
|
947
|
-
let e = "",
|
|
269
|
+
Lt = new WeakMap(), Ye = new WeakMap(), Jt = new WeakMap(), Yt = new WeakMap();
|
|
270
|
+
function le(s, ...t) {
|
|
271
|
+
let e = "", n = "";
|
|
948
272
|
const i = t.at(0);
|
|
949
|
-
Array.isArray(
|
|
950
|
-
const
|
|
273
|
+
Array.isArray(s) ? n = Nn(s, ...t) : i !== void 0 ? (e = s, n = i) : n = s;
|
|
274
|
+
const o = new uc(e), a = { [Et]: o };
|
|
951
275
|
let c = "";
|
|
952
|
-
return typeof
|
|
276
|
+
return typeof n == "string" ? c = n : Object.keys(n).forEach((l) => {
|
|
953
277
|
const d = l === "$";
|
|
954
|
-
a[l] = d || l.includes("-") ? l : `${l}-${
|
|
955
|
-
}),
|
|
278
|
+
a[l] = d || l.includes("-") ? l : `${l}-${Rn()}`, c += `${d ? ":where(&:not([hidden])),:host(:where(:not([hidden])))" : `.${a[l]}`} {${n[l]}}`;
|
|
279
|
+
}), o.setContent(c), a;
|
|
956
280
|
}
|
|
957
|
-
const
|
|
958
|
-
let
|
|
281
|
+
const Hi = (s, t, e) => {
|
|
282
|
+
let n = !1;
|
|
959
283
|
t.forEach((i) => {
|
|
960
|
-
const
|
|
961
|
-
|
|
962
|
-
}),
|
|
963
|
-
},
|
|
964
|
-
const e =
|
|
965
|
-
if (!
|
|
284
|
+
const o = s.get(i) || 0;
|
|
285
|
+
n || (n = e === 1 && o === 0 || e === -1 && o === 1), s.set(i, o + e);
|
|
286
|
+
}), n && St(Ir.get(s), rn);
|
|
287
|
+
}, _c = (s, t) => {
|
|
288
|
+
const e = s.getRootNode();
|
|
289
|
+
if (!Qs.has(e)) {
|
|
966
290
|
const i = /* @__PURE__ */ new Map();
|
|
967
|
-
|
|
968
|
-
const
|
|
969
|
-
i.forEach((a, c) => a &&
|
|
291
|
+
Qs.set(e, i), Ir.set(i, () => {
|
|
292
|
+
const o = e.adoptedStyleSheets.filter((a) => !i.has(a));
|
|
293
|
+
i.forEach((a, c) => a && o.push(c)), e.adoptedStyleSheets = o.reverse();
|
|
970
294
|
});
|
|
971
295
|
}
|
|
972
|
-
const
|
|
973
|
-
return
|
|
296
|
+
const n = Qs.get(e);
|
|
297
|
+
return Hi(n, t, 1), () => Hi(n, t, -1);
|
|
974
298
|
};
|
|
975
|
-
let
|
|
976
|
-
function
|
|
977
|
-
|
|
978
|
-
const { callback: e, getDep:
|
|
979
|
-
(!
|
|
299
|
+
let zn;
|
|
300
|
+
function Wi(s) {
|
|
301
|
+
s == null || s.forEach((t) => {
|
|
302
|
+
const { callback: e, getDep: n, values: i, preCallback: o } = t, a = n == null ? void 0 : n();
|
|
303
|
+
(!n || !i || oc(i, a)) && (Nr(o), t.preCallback = e(a, i), t.values = a, t.initialized = !0);
|
|
980
304
|
});
|
|
981
305
|
}
|
|
982
|
-
function
|
|
983
|
-
return
|
|
306
|
+
function zi(s) {
|
|
307
|
+
return s.filter((t) => (Nr(t.preCallback), t.initialized = !1, t.values = void 0, t.fixed));
|
|
984
308
|
}
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
@scope {
|
|
991
|
-
:scope {
|
|
992
|
-
display: none !important;
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
</style>
|
|
996
|
-
`;
|
|
997
|
-
let Ws;
|
|
998
|
-
const Bt = new uc(), es = (n = performance.now()) => {
|
|
999
|
-
if (performance.now() > n + 16) return requestAnimationFrame(es);
|
|
1000
|
-
const t = Bt.get();
|
|
1001
|
-
t && (t(), es(n));
|
|
309
|
+
let Vn;
|
|
310
|
+
const Kt = new ic(), on = (s = performance.now()) => {
|
|
311
|
+
if (performance.now() > s + 16) return requestAnimationFrame(on);
|
|
312
|
+
const t = Kt.get();
|
|
313
|
+
t && (t(), on(s));
|
|
1002
314
|
};
|
|
1003
|
-
|
|
1004
|
-
let
|
|
1005
|
-
var Zt,
|
|
1006
|
-
|
|
315
|
+
Kt.addEventListener("start", () => St(on));
|
|
316
|
+
let Vi;
|
|
317
|
+
var Zt, Q, ct, At, pt, Xt, it, te, ee, Nt, rt, Ut, an, ks, Ps, Ze, se, Rt, Xe, Ms, Os, ts, ne;
|
|
318
|
+
class tt extends HTMLElement {
|
|
1007
319
|
constructor() {
|
|
1008
320
|
super();
|
|
1009
|
-
E(this,
|
|
1010
|
-
E(this,
|
|
1011
|
-
E(this,
|
|
321
|
+
E(this, rt);
|
|
322
|
+
E(this, Zt);
|
|
323
|
+
E(this, Q);
|
|
1012
324
|
E(this, ct, []);
|
|
1013
|
-
E(this,
|
|
1014
|
-
E(this,
|
|
1015
|
-
E(this,
|
|
325
|
+
E(this, At, []);
|
|
326
|
+
E(this, pt, []);
|
|
327
|
+
E(this, Xt);
|
|
1016
328
|
E(this, it);
|
|
1017
329
|
// not in constructor 的近似值
|
|
330
|
+
E(this, te);
|
|
1018
331
|
E(this, ee);
|
|
1019
|
-
E(this, ne);
|
|
1020
332
|
E(this, Nt);
|
|
1021
333
|
/**
|
|
1022
334
|
* 每次更新完检查依赖,执行对应的副作用回调
|
|
1023
335
|
* */
|
|
1024
|
-
E(this,
|
|
1025
|
-
|
|
336
|
+
E(this, ks, () => {
|
|
337
|
+
Wi(_(this, ct));
|
|
1026
338
|
});
|
|
1027
|
-
E(this,
|
|
1028
|
-
|
|
339
|
+
E(this, Ps, () => {
|
|
340
|
+
Wi(_(this, At));
|
|
1029
341
|
});
|
|
1030
342
|
/**
|
|
1031
343
|
* - 条件渲染
|
|
1032
344
|
* - 没有 `render` 时显示子内容
|
|
1033
345
|
* - 返回 `undefined` 时不会更新现有内容
|
|
1034
346
|
* - 返回 `null` 时渲染空内容
|
|
1035
|
-
* -
|
|
347
|
+
* - 返回空的 TemplateResult 时渲染空的子内容
|
|
1036
348
|
* */
|
|
1037
|
-
E(this,
|
|
349
|
+
E(this, Ze, (e) => {
|
|
1038
350
|
try {
|
|
1039
|
-
|
|
1040
|
-
const
|
|
1041
|
-
if (
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
351
|
+
M(this, ee, !0), _(this, Ps).call(this);
|
|
352
|
+
const n = _(this, Zt) === this, i = e ? e.render() : n ? void 0 : ot`<slot></slot>`;
|
|
353
|
+
if (i === void 0) return;
|
|
354
|
+
Ls(
|
|
355
|
+
i !== null ? i : ot`<style>${n ? "@scope" : ":host"}{&{display:none!important;}}</style>`,
|
|
356
|
+
_(this, Zt)
|
|
357
|
+
);
|
|
358
|
+
} catch (n) {
|
|
359
|
+
throw this.dispatchEvent(new CustomEvent(Wn, { bubbles: !0, composed: !0, detail: n })), n;
|
|
360
|
+
} finally {
|
|
361
|
+
M(this, ee, !1);
|
|
1045
362
|
}
|
|
1046
363
|
});
|
|
1047
364
|
E(this, se, () => {
|
|
1048
|
-
const e = _(this,
|
|
365
|
+
const e = _(this, rt, an);
|
|
1049
366
|
_(this, it) && // 当有渲染函数,但是没一个符合条件时跳过
|
|
1050
|
-
(e || !_(this,
|
|
367
|
+
(e || !_(this, pt).length) && (_(this, Ze).call(this, e), St(_(this, ks)));
|
|
1051
368
|
});
|
|
1052
369
|
E(this, Rt, () => {
|
|
1053
|
-
_(this,
|
|
370
|
+
_(this, rt, Ut).noBlocking ? Kt.add(_(this, se)) : _(this, se).call(this);
|
|
1054
371
|
});
|
|
1055
|
-
E(this,
|
|
1056
|
-
const { adoptedStyleSheets: e = [] } = _(this,
|
|
1057
|
-
if (
|
|
1058
|
-
|
|
372
|
+
E(this, Xe, () => {
|
|
373
|
+
const { adoptedStyleSheets: e = [] } = _(this, rt, Ut), { shadowRoot: n, sheets: i } = _(this, Q), o = e.map((a) => a[Et].getStyle(this));
|
|
374
|
+
if (n)
|
|
375
|
+
n.adoptedStyleSheets = o.concat(i);
|
|
1059
376
|
else
|
|
1060
|
-
return this.prepend(...i.map((a) => a.element)),
|
|
377
|
+
return this.prepend(...i.map((a) => a.element)), _c(this, o);
|
|
1061
378
|
});
|
|
1062
379
|
/**
|
|
1063
380
|
* 元素挂载后执行还未初始化的副作用
|
|
1064
381
|
* */
|
|
1065
|
-
E(this,
|
|
382
|
+
E(this, Ms, () => {
|
|
1066
383
|
var e;
|
|
1067
|
-
(e = _(this, ct)) == null || e.forEach((
|
|
1068
|
-
const { callback: i, getDep:
|
|
1069
|
-
a || (
|
|
384
|
+
(e = _(this, ct)) == null || e.forEach((n) => {
|
|
385
|
+
const { callback: i, getDep: o, initialized: a } = n;
|
|
386
|
+
a || (n.values = o == null ? void 0 : o(), n.preCallback = i(n.values), n.initialized = !0);
|
|
1070
387
|
});
|
|
1071
388
|
});
|
|
1072
|
-
E(this,
|
|
389
|
+
E(this, Os, () => {
|
|
1073
390
|
var e;
|
|
1074
|
-
this.willMount && this.memo(this.willMount.bind(this), () => []), this.mounted && this.effect(this.mounted.bind(this), () => []), this.updated && this.effect((
|
|
391
|
+
this.willMount && this.memo(this.willMount.bind(this), () => []), this.mounted && this.effect(this.mounted.bind(this), () => []), this.updated && this.effect((n, i) => i && this.updated.apply(this)), this.unmounted && this.effect(
|
|
1075
392
|
() => this.unmounted.bind(this),
|
|
1076
393
|
() => []
|
|
1077
|
-
), !_(this,
|
|
394
|
+
), !_(this, pt).length && this.render && _(this, pt).push({ render: this.render.bind(this), condition: (e = this.shouldUpdate) == null ? void 0 : e.bind(this) });
|
|
1078
395
|
});
|
|
1079
|
-
E(this,
|
|
1080
|
-
E(this,
|
|
1081
|
-
var
|
|
1082
|
-
if (_(this,
|
|
1083
|
-
|
|
396
|
+
E(this, ts);
|
|
397
|
+
E(this, ne, async () => {
|
|
398
|
+
var o;
|
|
399
|
+
if (_(this, Xt)) {
|
|
400
|
+
M(this, Xt, !1), (o = _(this, Nt)) == null || o.call(this), M(this, Nt, _(this, Xe).call(this));
|
|
1084
401
|
return;
|
|
1085
402
|
}
|
|
1086
|
-
|
|
1087
|
-
const { observedStores: e, mode:
|
|
1088
|
-
!
|
|
403
|
+
M(this, te, !0), _(this, Os).call(this);
|
|
404
|
+
const { observedStores: e, mode: n, penetrable: i } = _(this, rt, Ut);
|
|
405
|
+
!n && _(this, pt).length && !i && _(this, Q).states.add(Rr), M(this, ts, e == null ? void 0 : e.map((a) => mt(a, _(this, Rt)))), _(this, Ze).call(this, _(this, rt, an)), M(this, it, !0), M(this, Nt, _(this, Xe).call(this)), St(_(this, Ms));
|
|
1089
406
|
});
|
|
1090
407
|
/**
|
|
1091
408
|
* @helper
|
|
@@ -1101,14 +418,14 @@ const Kt = class Kt extends HTMLElement {
|
|
|
1101
418
|
* }
|
|
1102
419
|
* ```
|
|
1103
420
|
* */
|
|
1104
|
-
|
|
421
|
+
v(this, "effect", (e, n) => {
|
|
1105
422
|
const i = {
|
|
1106
423
|
callback: e,
|
|
1107
|
-
getDep:
|
|
424
|
+
getDep: n,
|
|
1108
425
|
initialized: _(this, it),
|
|
1109
|
-
fixed: !_(this,
|
|
426
|
+
fixed: !_(this, te)
|
|
1110
427
|
};
|
|
1111
|
-
_(this, it) && (i.values =
|
|
428
|
+
_(this, it) && (i.values = n == null ? void 0 : n(), i.preCallback = e(i.values)), _(this, ct).push(i);
|
|
1112
429
|
});
|
|
1113
430
|
/**
|
|
1114
431
|
* @helper
|
|
@@ -1127,722 +444,1502 @@ const Kt = class Kt extends HTMLElement {
|
|
|
1127
444
|
* }
|
|
1128
445
|
* ```
|
|
1129
446
|
* */
|
|
1130
|
-
|
|
1131
|
-
_(this,
|
|
447
|
+
v(this, "memo", (e, n) => {
|
|
448
|
+
_(this, At).push({
|
|
1132
449
|
callback: e,
|
|
1133
|
-
getDep:
|
|
1134
|
-
fixed: !_(this,
|
|
450
|
+
getDep: n,
|
|
451
|
+
fixed: !_(this, te)
|
|
1135
452
|
});
|
|
1136
453
|
});
|
|
1137
454
|
/**
|
|
1138
455
|
* @helper
|
|
1139
456
|
* async
|
|
1140
457
|
*/
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
const { mode: e, serializable:
|
|
1144
|
-
|
|
458
|
+
v(this, "update", () => St(_(this, Rt)));
|
|
459
|
+
Vi = this;
|
|
460
|
+
const { mode: e, serializable: n, delegatesFocus: i, slotAssignment: o, aria: a } = _(this, rt, Ut), { focusable: c, ...l } = a || {};
|
|
461
|
+
M(this, Zt, e ? this.attachShadow({ mode: e, serializable: n, delegatesFocus: i, slotAssignment: o }) : this), M(this, Q, this.attachInternals()), _(this, Q).stateList = [], _(this, Q).sheets = [], Ii(_(this, Q), l);
|
|
1145
462
|
let d;
|
|
1146
463
|
_(this, ct).push({
|
|
1147
464
|
fixed: !0,
|
|
1148
465
|
getDep: () => [this.disabled],
|
|
1149
466
|
callback: ([f = !1]) => {
|
|
1150
|
-
if (d === void 0 && (d = this.hasAttribute("tabindex")), _(this,
|
|
1151
|
-
return
|
|
467
|
+
if (d === void 0 && (d = this.hasAttribute("tabindex")), _(this, Q).ariaDisabled = String(f), c && !d && (this.tabIndex = -Number(f)), (c || i) && f)
|
|
468
|
+
return Lr(this, "click", (r) => r.isTrusted && r.stopImmediatePropagation(), {
|
|
1152
469
|
capture: !0
|
|
1153
470
|
});
|
|
1154
471
|
}
|
|
1155
472
|
});
|
|
1156
473
|
}
|
|
1157
|
-
[
|
|
1158
|
-
_(this, it) &&
|
|
474
|
+
[lc]() {
|
|
475
|
+
_(this, it) && St(_(this, Rt));
|
|
1159
476
|
}
|
|
1160
477
|
get internals() {
|
|
1161
|
-
return _(this,
|
|
478
|
+
return _(this, Q);
|
|
1162
479
|
}
|
|
1163
480
|
/**
|
|
1164
481
|
* @private
|
|
1165
482
|
* @final
|
|
1166
|
-
* use
|
|
483
|
+
* use `@mounted`
|
|
1167
484
|
*/
|
|
1168
485
|
connectedCallback() {
|
|
1169
|
-
|
|
486
|
+
_(this, rt, Ut).noBlocking ? Kt.add(_(this, ne)) : _(this, ne).call(this);
|
|
1170
487
|
}
|
|
1171
488
|
/**
|
|
1172
489
|
* @private
|
|
1173
490
|
* @final
|
|
1174
|
-
|
|
1175
|
-
adoptedCallback() {
|
|
1176
|
-
return _(Kt, Zt);
|
|
1177
|
-
}
|
|
1178
|
-
/**
|
|
1179
|
-
* @private
|
|
1180
|
-
* @final
|
|
1181
|
-
* use `unmounted`
|
|
491
|
+
* use `@unmounted`
|
|
1182
492
|
*/
|
|
1183
493
|
disconnectedCallback() {
|
|
1184
|
-
var e,
|
|
494
|
+
var e, n;
|
|
1185
495
|
if (this.isConnected) {
|
|
1186
|
-
|
|
496
|
+
M(this, Xt, !0);
|
|
1187
497
|
return;
|
|
1188
498
|
}
|
|
1189
|
-
|
|
499
|
+
Kt.delete(_(this, ne)), Kt.delete(_(this, se)), M(this, it, !1), (e = _(this, ts)) == null || e.forEach((i) => i()), M(this, ct, zi(_(this, ct))), M(this, At, zi(_(this, At))), (n = _(this, Nt)) == null || n.call(this);
|
|
1190
500
|
}
|
|
1191
|
-
}
|
|
1192
|
-
Zt = new WeakMap(),
|
|
501
|
+
}
|
|
502
|
+
Zt = new WeakMap(), Q = new WeakMap(), ct = new WeakMap(), At = new WeakMap(), pt = new WeakMap(), Xt = new WeakMap(), it = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), Nt = new WeakMap(), rt = new WeakSet(), Ut = function() {
|
|
1193
503
|
return this.constructor[Symbol.metadata];
|
|
1194
|
-
},
|
|
1195
|
-
return _(this,
|
|
1196
|
-
},
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
throw new vt("Do't set state sync before insert the DOM");
|
|
1203
|
-
Hi(i, r), !_(s, ne) && _(s, it) && xt(_(s, Rt));
|
|
504
|
+
}, an = function() {
|
|
505
|
+
return _(this, pt).findLast((e) => !e.condition || e.condition());
|
|
506
|
+
}, ks = new WeakMap(), Ps = new WeakMap(), Ze = new WeakMap(), se = new WeakMap(), Rt = new WeakMap(), Xe = new WeakMap(), Ms = new WeakMap(), Os = new WeakMap(), ts = new WeakMap(), ne = new WeakMap(), zn = (e) => {
|
|
507
|
+
const n = Vi, i = xs(e, (o) => {
|
|
508
|
+
const a = _(n, ct).at(0);
|
|
509
|
+
if (!rn && _(n, it) && a && !a.initialized)
|
|
510
|
+
throw new wt("Don't set state sync before insert the DOM");
|
|
511
|
+
Ii(i, o), !_(n, ee) && _(n, it) && St(_(n, Rt), rn);
|
|
1204
512
|
});
|
|
1205
|
-
return _(
|
|
1206
|
-
},
|
|
1207
|
-
|
|
1208
|
-
const Mc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
513
|
+
return _(n, Q).stateList.push(i), i;
|
|
514
|
+
}, Vn = (e, n) => _(e, pt).push(n);
|
|
515
|
+
const pc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1209
516
|
__proto__: null,
|
|
1210
|
-
GemElement:
|
|
1211
|
-
SheetToken:
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
_RenderErrorEvent: Is,
|
|
517
|
+
GemElement: tt,
|
|
518
|
+
SheetToken: Et,
|
|
519
|
+
UpdateToken: As,
|
|
520
|
+
_RenderErrorEvent: Wn,
|
|
1215
521
|
get _createTemplate() {
|
|
1216
|
-
return
|
|
522
|
+
return Vn;
|
|
1217
523
|
},
|
|
1218
|
-
createRef: ac,
|
|
1219
524
|
get createState() {
|
|
1220
|
-
return
|
|
525
|
+
return zn;
|
|
1221
526
|
},
|
|
1222
|
-
css:
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
render
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
}, Symbol.toStringTag, { value: "Module" })), { deleteProperty: Lc, getOwnPropertyDescriptor: Mr, defineProperty: An } = Reflect, { getPrototypeOf: he, assign: xr } = Object, Gi = new _c();
|
|
1233
|
-
function yt(n, t, e) {
|
|
527
|
+
css: le,
|
|
528
|
+
get html() {
|
|
529
|
+
return ot;
|
|
530
|
+
},
|
|
531
|
+
get render() {
|
|
532
|
+
return Ls;
|
|
533
|
+
},
|
|
534
|
+
setEngine: Ar
|
|
535
|
+
}, Symbol.toStringTag, { value: "Module" })), { deleteProperty: fc, getOwnPropertyDescriptor: Gn, defineProperty: Ns } = Reflect, { getPrototypeOf: Rs, assign: mc, hasOwn: Is } = Object, Gi = new rc();
|
|
536
|
+
function Ct(s, t, e) {
|
|
1234
537
|
var i;
|
|
1235
|
-
const
|
|
1236
|
-
|
|
1237
|
-
value: ((i =
|
|
1238
|
-
}),
|
|
1239
|
-
}
|
|
1240
|
-
function
|
|
1241
|
-
const { value: e } =
|
|
1242
|
-
|
|
1243
|
-
}
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
538
|
+
const n = s.metadata;
|
|
539
|
+
Gn(n, t) || Ns(n, t, {
|
|
540
|
+
value: ((i = n[t]) == null ? void 0 : i.filter((o) => o !== e)) || []
|
|
541
|
+
}), n[t].push(e);
|
|
542
|
+
}
|
|
543
|
+
function Hs(s, t) {
|
|
544
|
+
const { value: e } = Gn(s, t) || {};
|
|
545
|
+
fc(s, t), s[t] = e;
|
|
546
|
+
}
|
|
547
|
+
const cn = /* @__PURE__ */ new WeakMap(), { setAttribute: Hr, toggleAttribute: gc, removeAttribute: Wr } = Element.prototype, Dn = (s, t) => {
|
|
548
|
+
var e;
|
|
549
|
+
return (e = cn.get(Rs(s))) == null ? void 0 : e.get(t);
|
|
550
|
+
};
|
|
551
|
+
tt.prototype.setAttribute = function(s, t) {
|
|
552
|
+
const e = Dn(this, s);
|
|
553
|
+
if (!e) return Hr.call(this, s, t);
|
|
1249
554
|
this[e] = t;
|
|
1250
555
|
};
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
if (!t) return Lr.call(this, n);
|
|
556
|
+
tt.prototype.removeAttribute = function(s) {
|
|
557
|
+
const t = Dn(this, s);
|
|
558
|
+
if (!t) return Wr.call(this, s);
|
|
1255
559
|
this[t] = null;
|
|
1256
560
|
};
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
return e ? this[e] = t ?? !this.hasAttribute(n) : Nc.call(this, n, t);
|
|
561
|
+
tt.prototype.toggleAttribute = function(s, t) {
|
|
562
|
+
const e = Dn(this, s);
|
|
563
|
+
return e ? this[e] = t ?? !this.hasAttribute(s) : gc.call(this, s, t);
|
|
1261
564
|
};
|
|
1262
|
-
function
|
|
565
|
+
function vc() {
|
|
1263
566
|
}
|
|
1264
|
-
const
|
|
1265
|
-
function
|
|
1266
|
-
|
|
567
|
+
const Di = Symbol("event handle");
|
|
568
|
+
function Un(s, t, { attr: e, attrType: n, event: i, eventOptions: o } = {}) {
|
|
569
|
+
Ns(s, t, {
|
|
1267
570
|
configurable: !0,
|
|
1268
571
|
get() {
|
|
1269
572
|
const a = Gi.get(this)[t];
|
|
1270
|
-
return i && !a ? (this[t] =
|
|
573
|
+
return i && !a ? (this[t] = vc, this[t]) : a;
|
|
1271
574
|
},
|
|
1272
575
|
set(a) {
|
|
1273
576
|
const c = this, l = Gi.get(c);
|
|
1274
|
-
e && (a =
|
|
577
|
+
e && (a = n === Boolean && a === "" ? !0 : n(a || ""), a ? Hr.call(this, e, n === Boolean ? "" : a) : Wr.call(this, e)), a !== l[t] && (i ? (l[t] = a != null && a[Di] ? a : async (d, f) => {
|
|
1275
578
|
await Promise.resolve();
|
|
1276
|
-
const
|
|
1277
|
-
c.dispatchEvent(
|
|
1278
|
-
}, l[t][
|
|
579
|
+
const r = new CustomEvent(i, { ...f, ...o, detail: d });
|
|
580
|
+
c.dispatchEvent(r), await a(d, f);
|
|
581
|
+
}, l[t][Di] = !0) : (l[t] = a, this[As]()));
|
|
1279
582
|
}
|
|
1280
583
|
});
|
|
1281
584
|
}
|
|
1282
|
-
const
|
|
1283
|
-
function
|
|
1284
|
-
const e =
|
|
585
|
+
const Ui = /* @__PURE__ */ new WeakMap();
|
|
586
|
+
function ns(s, { metadata: t }) {
|
|
587
|
+
const e = Ui.get(t);
|
|
1285
588
|
if (e) return e;
|
|
1286
|
-
let
|
|
589
|
+
let n = s;
|
|
1287
590
|
do
|
|
1288
|
-
|
|
1289
|
-
while (
|
|
1290
|
-
return
|
|
1291
|
-
}
|
|
1292
|
-
function
|
|
1293
|
-
const e =
|
|
1294
|
-
return
|
|
1295
|
-
const i =
|
|
1296
|
-
i
|
|
1297
|
-
const
|
|
1298
|
-
a.set(
|
|
591
|
+
n = Rs(n);
|
|
592
|
+
while (n.constructor[Symbol.metadata] !== t);
|
|
593
|
+
return Ui.set(t, n), n;
|
|
594
|
+
}
|
|
595
|
+
function Fn(s, t) {
|
|
596
|
+
const e = s.name, n = he(e);
|
|
597
|
+
return s.addInitializer(function() {
|
|
598
|
+
const i = ns(this, s);
|
|
599
|
+
Is(i, e) || (Ct(s, "observedAttributes", n), Un(i, e, { attr: n, attrType: t })), Hs(this, e);
|
|
600
|
+
const o = Rs(this), a = cn.get(o) || /* @__PURE__ */ new Map();
|
|
601
|
+
a.set(n, e), cn.set(o, a);
|
|
1299
602
|
}), function(i) {
|
|
1300
|
-
return this.getAttribute(
|
|
603
|
+
return this.getAttribute(n) ?? i;
|
|
1301
604
|
};
|
|
1302
605
|
}
|
|
1303
|
-
function
|
|
1304
|
-
return
|
|
606
|
+
function B(s, t) {
|
|
607
|
+
return Fn(t, String);
|
|
1305
608
|
}
|
|
1306
|
-
function
|
|
1307
|
-
return
|
|
609
|
+
function Ws(s, t) {
|
|
610
|
+
return Fn(t, Boolean);
|
|
1308
611
|
}
|
|
1309
|
-
function
|
|
1310
|
-
return
|
|
612
|
+
function $c(s, t) {
|
|
613
|
+
return Fn(t, Number);
|
|
1311
614
|
}
|
|
1312
|
-
function
|
|
615
|
+
function D(s, t) {
|
|
1313
616
|
const e = t.name;
|
|
1314
617
|
return t.addInitializer(function() {
|
|
1315
|
-
const
|
|
1316
|
-
|
|
1317
|
-
}), function(
|
|
1318
|
-
return this[e] ??
|
|
618
|
+
const n = ns(this, t);
|
|
619
|
+
Is(n, e) || (Ct(t, "observedProperties", e), Un(n, e)), Hs(this, e);
|
|
620
|
+
}), function(n) {
|
|
621
|
+
return this[e] ?? n;
|
|
1319
622
|
};
|
|
1320
623
|
}
|
|
1321
|
-
function
|
|
1322
|
-
return
|
|
1323
|
-
const { addInitializer:
|
|
1324
|
-
|
|
1325
|
-
const c =
|
|
624
|
+
function zr(s) {
|
|
625
|
+
return (t, e) => {
|
|
626
|
+
const { addInitializer: n, name: i, access: o, kind: a } = e;
|
|
627
|
+
n(function() {
|
|
628
|
+
const c = s && (() => s(this));
|
|
1326
629
|
if (a === "getter") {
|
|
1327
|
-
if (e.private) throw new
|
|
1328
|
-
|
|
630
|
+
if (e.private) throw new wt("not support");
|
|
631
|
+
const l = ns(this, e), d = Gn(l, i).get.bind(this);
|
|
632
|
+
this.memo(() => {
|
|
633
|
+
Ns(this, i, {
|
|
634
|
+
configurable: !0,
|
|
635
|
+
value: d()
|
|
636
|
+
});
|
|
637
|
+
}, c);
|
|
1329
638
|
} else
|
|
1330
|
-
this.memo(
|
|
639
|
+
this.memo(o.get.call(this, this).bind(this), c);
|
|
1331
640
|
});
|
|
1332
641
|
};
|
|
1333
642
|
}
|
|
1334
|
-
function
|
|
1335
|
-
return
|
|
643
|
+
function ft(s) {
|
|
644
|
+
return (t, { addInitializer: e, access: n }) => {
|
|
1336
645
|
e(function() {
|
|
1337
|
-
this.effect(
|
|
646
|
+
this.effect(n.get.call(this, this).bind(this), s && (() => s(this)));
|
|
1338
647
|
});
|
|
1339
648
|
};
|
|
1340
649
|
}
|
|
1341
|
-
function
|
|
1342
|
-
return
|
|
650
|
+
function Sc() {
|
|
651
|
+
return (s, { addInitializer: t, access: e }) => {
|
|
1343
652
|
t(function() {
|
|
1344
653
|
this.effect(
|
|
1345
|
-
() => e.get(this).bind(this),
|
|
654
|
+
() => e.get.call(this, this).bind(this),
|
|
1346
655
|
() => []
|
|
1347
656
|
);
|
|
1348
657
|
});
|
|
1349
658
|
};
|
|
1350
659
|
}
|
|
1351
|
-
function
|
|
1352
|
-
return
|
|
660
|
+
function qn() {
|
|
661
|
+
return zr(() => []);
|
|
1353
662
|
}
|
|
1354
|
-
function
|
|
1355
|
-
return
|
|
663
|
+
function Be() {
|
|
664
|
+
return ft(() => []);
|
|
1356
665
|
}
|
|
1357
|
-
function
|
|
1358
|
-
return
|
|
666
|
+
function de(s) {
|
|
667
|
+
return (t, { addInitializer: e, access: n }) => {
|
|
1359
668
|
e(function() {
|
|
1360
|
-
|
|
1361
|
-
render:
|
|
1362
|
-
condition:
|
|
669
|
+
Vn(this, {
|
|
670
|
+
render: n.get.call(this, this).bind(this),
|
|
671
|
+
condition: s && (() => s(this))
|
|
1363
672
|
});
|
|
1364
673
|
});
|
|
1365
674
|
};
|
|
1366
675
|
}
|
|
1367
|
-
function
|
|
1368
|
-
return
|
|
676
|
+
function yc() {
|
|
677
|
+
return (s, { addInitializer: t, access: e }) => {
|
|
1369
678
|
t(function() {
|
|
1370
|
-
this.addEventListener(
|
|
1371
|
-
|
|
679
|
+
this.addEventListener(Wn, ({ detail: n }) => {
|
|
680
|
+
Ls(e.get.call(this, this).apply(this, [n]), this.internals.shadowRoot || this);
|
|
1372
681
|
});
|
|
1373
682
|
});
|
|
1374
683
|
};
|
|
1375
684
|
}
|
|
1376
|
-
function
|
|
1377
|
-
|
|
685
|
+
function wc(s, t, e) {
|
|
686
|
+
Ns(s, t, {
|
|
1378
687
|
configurable: !0,
|
|
1379
688
|
get() {
|
|
1380
|
-
const
|
|
689
|
+
const n = this, { states: i } = n.internals;
|
|
1381
690
|
return i == null ? void 0 : i.has(e);
|
|
1382
691
|
},
|
|
1383
|
-
set(
|
|
1384
|
-
const i = this, { states:
|
|
1385
|
-
|
|
692
|
+
set(n) {
|
|
693
|
+
const i = this, { states: o } = i.internals;
|
|
694
|
+
n ? o == null || o.add(e) : o == null || o.delete(e);
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
function zs(s, t) {
|
|
699
|
+
const e = t.name, n = he(e);
|
|
700
|
+
t.addInitializer(function() {
|
|
701
|
+
const i = ns(this, t);
|
|
702
|
+
Is(i, e) || (Ct(t, "definedCSSStates", n), wc(i, e, n)), Hs(this, e);
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
function Vr(s, t, e, n) {
|
|
706
|
+
const i = s.name, o = he(i);
|
|
707
|
+
if (s.static)
|
|
708
|
+
Ct(s, e, o);
|
|
709
|
+
else {
|
|
710
|
+
const a = Rs(t);
|
|
711
|
+
a[i] || (a[i] = o, Ct(s, e, o));
|
|
712
|
+
}
|
|
713
|
+
return n || o;
|
|
714
|
+
}
|
|
715
|
+
function Ec(s, t) {
|
|
716
|
+
return function(e) {
|
|
717
|
+
return Vr(t, this, "definedSlots", e);
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
function Gr(s, t) {
|
|
721
|
+
return function(e) {
|
|
722
|
+
return Vr(t, this, "definedParts", e);
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
function Te(s, t) {
|
|
726
|
+
Dr(t);
|
|
727
|
+
}
|
|
728
|
+
function Cc(s, t) {
|
|
729
|
+
Dr(t, { bubbles: !0, composed: !0 });
|
|
730
|
+
}
|
|
731
|
+
function Dr(s, t) {
|
|
732
|
+
const e = s.name, n = he(e);
|
|
733
|
+
s.addInitializer(function() {
|
|
734
|
+
const i = ns(this, s);
|
|
735
|
+
Is(i, e) || (Ct(s, "definedEvents", n), Un(i, e, { event: n, eventOptions: t })), Hs(this, e);
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
function is(s) {
|
|
739
|
+
return (t, e) => {
|
|
740
|
+
Ct(e, "adoptedStyleSheets", s);
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
function Vs(s) {
|
|
744
|
+
return (t, e) => {
|
|
745
|
+
Ct(e, "observedStores", s);
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
function zt({
|
|
749
|
+
mode: s = "open",
|
|
750
|
+
serializable: t = !0,
|
|
751
|
+
delegatesFocus: e,
|
|
752
|
+
slotAssignment: n
|
|
753
|
+
} = {}) {
|
|
754
|
+
return (i, o) => {
|
|
755
|
+
const a = o.metadata;
|
|
756
|
+
mc(a, { mode: s, serializable: t, delegatesFocus: e, slotAssignment: n });
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
function Ur({ penetrable: s }) {
|
|
760
|
+
return (t, e) => {
|
|
761
|
+
const n = e.metadata;
|
|
762
|
+
n.penetrable = s;
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
function bc() {
|
|
766
|
+
return (s, t) => {
|
|
767
|
+
const e = t.metadata;
|
|
768
|
+
e.noBlocking = !0;
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
function Gs(s) {
|
|
772
|
+
return (t, e) => {
|
|
773
|
+
const n = e.metadata;
|
|
774
|
+
n.aria = { ...n.aria, ...s };
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
function Tc(s) {
|
|
778
|
+
return (t, { addInitializer: e }) => {
|
|
779
|
+
e(() => {
|
|
780
|
+
customElements.define(s, t);
|
|
781
|
+
});
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
const kc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
785
|
+
__proto__: null,
|
|
786
|
+
adoptedStyle: is,
|
|
787
|
+
aria: Gs,
|
|
788
|
+
async: bc,
|
|
789
|
+
attribute: B,
|
|
790
|
+
boolattribute: Ws,
|
|
791
|
+
connectStore: Vs,
|
|
792
|
+
customElement: Tc,
|
|
793
|
+
effect: ft,
|
|
794
|
+
emitter: Te,
|
|
795
|
+
fallback: yc,
|
|
796
|
+
globalemitter: Cc,
|
|
797
|
+
light: Ur,
|
|
798
|
+
memo: zr,
|
|
799
|
+
mounted: Be,
|
|
800
|
+
numattribute: $c,
|
|
801
|
+
part: Gr,
|
|
802
|
+
property: D,
|
|
803
|
+
shadow: zt,
|
|
804
|
+
slot: Ec,
|
|
805
|
+
state: zs,
|
|
806
|
+
template: de,
|
|
807
|
+
unmounted: Sc,
|
|
808
|
+
willMount: qn
|
|
809
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
810
|
+
/**
|
|
811
|
+
* @license
|
|
812
|
+
* Copyright 2017 Google LLC
|
|
813
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
814
|
+
*/
|
|
815
|
+
const Pc = globalThis, Ue = Pc.trustedTypes, Fi = Ue == null ? void 0 : Ue.createPolicy("lit-html", { createHTML: (s) => s }), Fr = "$lit$", yt = `lit$${Math.random().toFixed(9).slice(2)}$`, qr = "?" + yt, Mc = `<${qr}>`, Ht = document, re = () => Ht.createComment(""), Ke = (s) => s === null || typeof s != "object" && typeof s != "function", jt = (s) => s == null, Oc = (s) => Symbol.iterator in s, Js = `[
|
|
816
|
+
\f\r]`, xc = `[^
|
|
817
|
+
\f\r"'\`<>=]`, Lc = `[^\\s"'>=/]`, ye = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, qi = 1, Ys = 2, Ac = 3, Bi = /-->/g, Ki = />/g, kt = new RegExp(
|
|
818
|
+
`>|${Js}(?:(${Lc}+)(${Js}*=${Js}*(?:${xc}|("|')|))|$)`,
|
|
819
|
+
"g"
|
|
820
|
+
), Nc = 0, ji = 1, Rc = 2, Qi = 3, Ji = /'/g, Yi = /"/g, Br = /^(?:script|style|textarea|title)$/i, Ic = 1, $s = 2, Ss = 3, Bn = 1, ys = 2, Hc = 3, Wc = 4, zc = 5, Kn = 6, Vc = 7, Zi = "v-if", Xi = "v-else-if", tr = "v-else";
|
|
821
|
+
class Kr {
|
|
822
|
+
constructor(t, e, n) {
|
|
823
|
+
v(this, "type");
|
|
824
|
+
v(this, "strings");
|
|
825
|
+
v(this, "values");
|
|
826
|
+
this.type = t, this.strings = e, this.values = n;
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
const jn = (s) => (t, ...e) => new Kr(s, t, e), Gc = jn(Ic), Al = jn($s), Nl = jn(Ss), Qn = Symbol.for("lit-noChange"), er = /* @__PURE__ */ new WeakMap(), xt = Ht.createTreeWalker(
|
|
830
|
+
Ht,
|
|
831
|
+
129
|
|
832
|
+
/* NodeFilter.SHOW_{ELEMENT|COMMENT} */
|
|
833
|
+
);
|
|
834
|
+
function Dc(s, t) {
|
|
835
|
+
if (!Array.isArray(s)) throw new Error("invalid template");
|
|
836
|
+
return Fi !== void 0 ? Fi.createHTML(t) : t;
|
|
837
|
+
}
|
|
838
|
+
const Uc = (s, t) => {
|
|
839
|
+
const e = s.length - 1, n = [];
|
|
840
|
+
let i = t === $s ? "<svg>" : t === Ss ? "<math>" : "", o, a = ye;
|
|
841
|
+
for (let l = 0; l < e; l++) {
|
|
842
|
+
const d = s[l];
|
|
843
|
+
let f = -1, r, m = 0, h;
|
|
844
|
+
for (; m < d.length && (a.lastIndex = m, h = a.exec(d), h !== null); )
|
|
845
|
+
m = a.lastIndex, a === ye ? h[qi] === "!--" ? a = Bi : h[qi] !== void 0 ? a = Ki : h[Ys] !== void 0 ? (Br.test(h[Ys]) && (o = new RegExp(`</${h[Ys]}`, "g")), a = kt) : h[Ac] !== void 0 && (a = kt) : a === kt ? h[Nc] === ">" ? (a = o ?? ye, f = -1) : h[ji] === void 0 ? f = -2 : (f = a.lastIndex - h[Rc].length, r = h[ji], a = h[Qi] === void 0 ? kt : h[Qi] === '"' ? Yi : Ji) : a === Yi || a === Ji ? a = kt : a === Bi || a === Ki ? a = ye : (a = kt, o = void 0);
|
|
846
|
+
const g = a === kt && s[l + 1].startsWith("/>") ? " " : "";
|
|
847
|
+
i += a === ye ? d + Mc : f >= 0 ? (n.push(r), d.slice(0, f) + Fr + d.slice(f) + yt + g) : d + yt + (f === -2 ? l : g);
|
|
848
|
+
}
|
|
849
|
+
const c = i + (s[e] || "<?>") + (t === $s ? "</svg>" : t === Ss ? "</math>" : "");
|
|
850
|
+
return [Dc(s, c), n];
|
|
851
|
+
};
|
|
852
|
+
class Jn {
|
|
853
|
+
constructor({ strings: t, type: e }, n) {
|
|
854
|
+
/** @internal */
|
|
855
|
+
v(this, "el");
|
|
856
|
+
v(this, "parts", []);
|
|
857
|
+
let i, o = 0, a = 0;
|
|
858
|
+
const c = t.length - 1, l = this.parts, [d, f] = Uc(t, e);
|
|
859
|
+
if (this.el = Jn.createElement(d, n), xt.currentNode = this.el.content, e === $s || e === Ss) {
|
|
860
|
+
const r = this.el.content.firstChild;
|
|
861
|
+
r.replaceWith(...r.childNodes);
|
|
862
|
+
}
|
|
863
|
+
for (; (i = xt.nextNode()) !== null && l.length < c; ) {
|
|
864
|
+
if (i.nodeType === 1) {
|
|
865
|
+
if (i.hasAttributes())
|
|
866
|
+
for (const r of i.getAttributeNames())
|
|
867
|
+
if (r.endsWith(Fr)) {
|
|
868
|
+
const m = f[a++], g = i.getAttribute(r).split(yt), $ = /([.?@])?(.*)/.exec(m);
|
|
869
|
+
l.push({
|
|
870
|
+
type: Bn,
|
|
871
|
+
index: o,
|
|
872
|
+
name: $[2],
|
|
873
|
+
strings: g,
|
|
874
|
+
ctor: $[1] === "." ? Bc : $[1] === "?" ? Kc : $[1] === "@" ? jc : Ds
|
|
875
|
+
}), i.removeAttribute(r);
|
|
876
|
+
} else r.startsWith(yt) && (l.push({
|
|
877
|
+
type: Kn,
|
|
878
|
+
index: o
|
|
879
|
+
}), i.removeAttribute(r));
|
|
880
|
+
if (Br.test(i.tagName)) {
|
|
881
|
+
const r = i.textContent.split(yt), m = r.length - 1;
|
|
882
|
+
if (m > 0) {
|
|
883
|
+
i.textContent = Ue ? Ue.emptyScript : "";
|
|
884
|
+
for (let h = 0; h < m; h++)
|
|
885
|
+
i.append(r[h], re()), xt.nextNode(), l.push({ type: ys, index: ++o });
|
|
886
|
+
i.append(r[m], re());
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
} else if (i.nodeType === 8)
|
|
890
|
+
if (i.data === qr)
|
|
891
|
+
l.push({ type: ys, index: o });
|
|
892
|
+
else {
|
|
893
|
+
let m = -1;
|
|
894
|
+
for (; (m = i.data.indexOf(yt, m + 1)) !== -1; )
|
|
895
|
+
l.push({ type: Vc, index: o }), m += yt.length - 1;
|
|
896
|
+
}
|
|
897
|
+
o++;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
// Overridden via `litHtmlPolyfillSupport` to provide platform support.
|
|
901
|
+
/** @nocollapse */
|
|
902
|
+
static createElement(t, e) {
|
|
903
|
+
const n = Ht.createElement("template");
|
|
904
|
+
return n.innerHTML = t, n;
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
function oe(s, t, e = s, n) {
|
|
908
|
+
var a, c;
|
|
909
|
+
if (t === Qn)
|
|
910
|
+
return t;
|
|
911
|
+
let i = n !== void 0 ? (a = e.__directives) == null ? void 0 : a[n] : e.__directive;
|
|
912
|
+
const o = Ke(t) ? void 0 : (
|
|
913
|
+
// This property needs to remain unminified.
|
|
914
|
+
t._$litDirective$
|
|
915
|
+
);
|
|
916
|
+
return (i == null ? void 0 : i.constructor) !== o && ((c = i == null ? void 0 : i._$notifyDirectiveConnectionChanged) == null || c.call(i, !1), o === void 0 ? i = void 0 : (i = new o(s), i._$initialize(s, e, n)), n !== void 0 ? (e.__directives ?? (e.__directives = []))[n] = i : e.__directive = i), i !== void 0 && (t = oe(
|
|
917
|
+
s,
|
|
918
|
+
i._$resolve(s, t.values),
|
|
919
|
+
i,
|
|
920
|
+
n
|
|
921
|
+
)), t;
|
|
922
|
+
}
|
|
923
|
+
class Fc {
|
|
924
|
+
constructor(t, e) {
|
|
925
|
+
v(this, "_$template");
|
|
926
|
+
v(this, "_$parts", []);
|
|
927
|
+
/** @internal */
|
|
928
|
+
v(this, "_$conditions", []);
|
|
929
|
+
/** @internal */
|
|
930
|
+
v(this, "_$parent");
|
|
931
|
+
/** @internal */
|
|
932
|
+
v(this, "_$disconnectableChildren");
|
|
933
|
+
this._$template = t, this._$parent = e;
|
|
934
|
+
}
|
|
935
|
+
// Called by ChildPart parentNode getter
|
|
936
|
+
get parentNode() {
|
|
937
|
+
return this._$parent.parentNode;
|
|
938
|
+
}
|
|
939
|
+
// See comment in Disconnectable interface for why this is a getter
|
|
940
|
+
get _$isConnected() {
|
|
941
|
+
return this._$parent._$isConnected;
|
|
942
|
+
}
|
|
943
|
+
// This method is separate from the constructor because we need to return a
|
|
944
|
+
// DocumentFragment and we don't want to hold onto it with an instance field.
|
|
945
|
+
_clone(t) {
|
|
946
|
+
const {
|
|
947
|
+
el: { content: e },
|
|
948
|
+
parts: n
|
|
949
|
+
} = this._$template, i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), a = ((t == null ? void 0 : t.creationScope) ?? Ht).importNode(e, !0);
|
|
950
|
+
xt.currentNode = a;
|
|
951
|
+
let c = xt.nextNode(), l = 0, d = 0, f = n[0];
|
|
952
|
+
for (; f !== void 0; ) {
|
|
953
|
+
if (l === f.index) {
|
|
954
|
+
let r;
|
|
955
|
+
f.type === ys ? r = new rs(c, c.nextSibling, this, t) : f.type === Bn ? (f.name === Zi && i.set(c, d), f.name === Xi && o.set(c, d), r = new f.ctor(c, f.name, f.strings, this, t)) : f.type === Kn && (r = new Qc(c, this, t)), this._$parts.push(r), f = n[++d];
|
|
956
|
+
}
|
|
957
|
+
l !== (f == null ? void 0 : f.index) && (c = xt.nextNode(), l++);
|
|
958
|
+
}
|
|
959
|
+
return i.forEach((r, m) => {
|
|
960
|
+
const h = new qc(m, r);
|
|
961
|
+
this._$conditions.push(h);
|
|
962
|
+
let g = m;
|
|
963
|
+
for (; g = g.nextElementSibling; ) {
|
|
964
|
+
const $ = o.get(g);
|
|
965
|
+
if ($ === void 0) break;
|
|
966
|
+
h.push(g, $);
|
|
967
|
+
}
|
|
968
|
+
}), xt.currentNode = Ht, a;
|
|
969
|
+
}
|
|
970
|
+
_update(t) {
|
|
971
|
+
let e = 0;
|
|
972
|
+
for (const n of this._$parts)
|
|
973
|
+
n !== void 0 && (n.strings !== void 0 ? (n._$setValue(t, n, e), e += n.strings.length - 2) : n.name === Zi || n.name === Xi || n._$setValue(t[e])), e++;
|
|
974
|
+
this._$conditions.forEach((n) => n.update(t));
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
class qc {
|
|
978
|
+
constructor(t, e) {
|
|
979
|
+
v(this, "mark");
|
|
980
|
+
v(this, "list");
|
|
981
|
+
const n = re();
|
|
982
|
+
t.before(n), this.mark = n, this.list = [{ ele: t, idx: e }], this.check();
|
|
983
|
+
}
|
|
984
|
+
get next() {
|
|
985
|
+
return this.list.at(-1).ele.nextElementSibling;
|
|
986
|
+
}
|
|
987
|
+
push(t, e) {
|
|
988
|
+
this.list.push({ ele: t, idx: e }), this.check();
|
|
989
|
+
}
|
|
990
|
+
check() {
|
|
991
|
+
const t = this.next;
|
|
992
|
+
t != null && t.attributes.getNamedItem(tr) && (this.list.push({ ele: t }), t.removeAttribute(tr));
|
|
993
|
+
}
|
|
994
|
+
update(t) {
|
|
995
|
+
const { mark: e, list: n } = this, i = n.find(({ idx: o }) => o === void 0 || !!t[o]);
|
|
996
|
+
i && !i.ele.parentNode && e.after(i.ele), n.forEach(({ ele: o }) => (!i || o !== i.ele) && o.remove());
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
class rs {
|
|
1000
|
+
constructor(t, e, n, i) {
|
|
1001
|
+
v(this, "type", ys);
|
|
1002
|
+
v(this, "options");
|
|
1003
|
+
v(this, "_$committedValue");
|
|
1004
|
+
/** @internal */
|
|
1005
|
+
v(this, "__directive");
|
|
1006
|
+
/** @internal */
|
|
1007
|
+
v(this, "_$startNode");
|
|
1008
|
+
/** @internal */
|
|
1009
|
+
v(this, "_$endNode");
|
|
1010
|
+
/** @internal */
|
|
1011
|
+
v(this, "_$parent");
|
|
1012
|
+
/**
|
|
1013
|
+
* Connection state for RootParts only (i.e. ChildPart without _$parent
|
|
1014
|
+
* returned from top-level `render`). This field is unused otherwise. The
|
|
1015
|
+
* intention would be clearer if we made `RootPart` a subclass of `ChildPart`
|
|
1016
|
+
* with this field (and a different _$isConnected getter), but the subclass
|
|
1017
|
+
* caused a perf regression, possibly due to making call sites polymorphic.
|
|
1018
|
+
* @internal
|
|
1019
|
+
*/
|
|
1020
|
+
v(this, "__isConnected");
|
|
1021
|
+
// The following fields will be patched onto ChildParts when required by
|
|
1022
|
+
// AsyncDirective
|
|
1023
|
+
/** @internal */
|
|
1024
|
+
v(this, "_$disconnectableChildren");
|
|
1025
|
+
this._$startNode = t, this._$endNode = e, this._$parent = n, this.options = i, this.__isConnected = (i == null ? void 0 : i.isConnected) ?? !0;
|
|
1026
|
+
}
|
|
1027
|
+
// See comment in Disconnectable interface for why this is a getter
|
|
1028
|
+
get _$isConnected() {
|
|
1029
|
+
var t;
|
|
1030
|
+
return ((t = this._$parent) == null ? void 0 : t._$isConnected) ?? this.__isConnected;
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* The parent node into which the part renders its content.
|
|
1034
|
+
*
|
|
1035
|
+
* A ChildPart's content consists of a range of adjacent child nodes of
|
|
1036
|
+
* `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and
|
|
1037
|
+
* `.endNode`).
|
|
1038
|
+
*
|
|
1039
|
+
* - If both `.startNode` and `.endNode` are non-null, then the part's content
|
|
1040
|
+
* consists of all siblings between `.startNode` and `.endNode`, exclusively.
|
|
1041
|
+
*
|
|
1042
|
+
* - If `.startNode` is non-null but `.endNode` is null, then the part's
|
|
1043
|
+
* content consists of all siblings following `.startNode`, up to and
|
|
1044
|
+
* including the last child of `.parentNode`. If `.endNode` is non-null, then
|
|
1045
|
+
* `.startNode` will always be non-null.
|
|
1046
|
+
*
|
|
1047
|
+
* - If both `.endNode` and `.startNode` are null, then the part's content
|
|
1048
|
+
* consists of all child nodes of `.parentNode`.
|
|
1049
|
+
*/
|
|
1050
|
+
get parentNode() {
|
|
1051
|
+
let t = this._$startNode.parentNode;
|
|
1052
|
+
const e = this._$parent;
|
|
1053
|
+
return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
|
|
1054
|
+
}
|
|
1055
|
+
/**
|
|
1056
|
+
* The part's leading marker node, if any. See `.parentNode` for more
|
|
1057
|
+
* information.
|
|
1058
|
+
*/
|
|
1059
|
+
get startNode() {
|
|
1060
|
+
return this._$startNode;
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* The part's trailing marker node, if any. See `.parentNode` for more
|
|
1064
|
+
* information.
|
|
1065
|
+
*/
|
|
1066
|
+
get endNode() {
|
|
1067
|
+
return this._$endNode;
|
|
1068
|
+
}
|
|
1069
|
+
_$setValue(t, e = this) {
|
|
1070
|
+
this.parentNode && (t = oe(this, t, e), Ke(t) ? jt(t) || t === "" ? (jt(this._$committedValue) || this._$clear(), this._$committedValue = void 0) : t !== this._$committedValue && t !== Qn && this._commitText(t) : t instanceof Kr ? this._commitTemplateResult(t) : t.nodeType !== void 0 ? this._commitNode(t) : Oc(t) ? this._commitIterable(t) : this._commitText(t));
|
|
1071
|
+
}
|
|
1072
|
+
_insert(t) {
|
|
1073
|
+
return this._$startNode.parentNode.insertBefore(t, this._$endNode);
|
|
1074
|
+
}
|
|
1075
|
+
_commitNode(t) {
|
|
1076
|
+
this._$committedValue !== t && (this._$clear(), this._$committedValue = this._insert(t));
|
|
1077
|
+
}
|
|
1078
|
+
_commitText(t) {
|
|
1079
|
+
if (!jt(this._$committedValue) && Ke(this._$committedValue)) {
|
|
1080
|
+
const e = this._$startNode.nextSibling;
|
|
1081
|
+
e.data = t;
|
|
1082
|
+
} else
|
|
1083
|
+
this._commitNode(Ht.createTextNode(t));
|
|
1084
|
+
this._$committedValue = t;
|
|
1085
|
+
}
|
|
1086
|
+
_commitTemplateResult(t) {
|
|
1087
|
+
var i;
|
|
1088
|
+
const { values: e } = t, n = this._$getTemplate(t);
|
|
1089
|
+
if (((i = this._$committedValue) == null ? void 0 : i._$template) === n)
|
|
1090
|
+
this._$committedValue._update(e);
|
|
1091
|
+
else {
|
|
1092
|
+
const o = new Fc(n, this), a = o._clone(this.options);
|
|
1093
|
+
o._update(e), this._commitNode(a), this._$committedValue = o;
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
// Overridden via `litHtmlPolyfillSupport` to provide platform support.
|
|
1097
|
+
/** @internal */
|
|
1098
|
+
_$getTemplate(t) {
|
|
1099
|
+
let e = er.get(t.strings);
|
|
1100
|
+
return e === void 0 && er.set(t.strings, e = new Jn(t)), e;
|
|
1101
|
+
}
|
|
1102
|
+
_commitIterable(t) {
|
|
1103
|
+
Array.isArray(this._$committedValue) || (this._$committedValue = [], this._$clear());
|
|
1104
|
+
const e = this._$committedValue;
|
|
1105
|
+
let n = 0, i;
|
|
1106
|
+
for (const o of t)
|
|
1107
|
+
n === e.length ? e.push(
|
|
1108
|
+
i = new rs(this._insert(re()), this._insert(re()), this, this.options)
|
|
1109
|
+
) : i = e[n], i._$setValue(o), n++;
|
|
1110
|
+
n < e.length && (this._$clear(i && i._$endNode.nextSibling, n), e.length = n);
|
|
1111
|
+
}
|
|
1112
|
+
/**
|
|
1113
|
+
* Removes the nodes contained within this Part from the DOM.
|
|
1114
|
+
*
|
|
1115
|
+
* @param start Start node to clear from, for clearing a subset of the part's
|
|
1116
|
+
* DOM (used when truncating iterables)
|
|
1117
|
+
* @param from When `start` is specified, the index within the iterable from
|
|
1118
|
+
* which ChildParts are being removed, used for disconnecting directives in
|
|
1119
|
+
* those Parts.
|
|
1120
|
+
*
|
|
1121
|
+
* @internal
|
|
1122
|
+
*/
|
|
1123
|
+
_$clear(t = this._$startNode.nextSibling, e) {
|
|
1124
|
+
var n;
|
|
1125
|
+
for ((n = this._$notifyConnectionChanged) == null || n.call(this, !1, !0, e); t && t !== this._$endNode; ) {
|
|
1126
|
+
const i = t.nextSibling;
|
|
1127
|
+
t.remove(), t = i;
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
/**
|
|
1131
|
+
* Implementation of RootPart's `isConnected`. Note that this method
|
|
1132
|
+
* should only be called on `RootPart`s (the `ChildPart` returned from a
|
|
1133
|
+
* top-level `render()` call). It has no effect on non-root ChildParts.
|
|
1134
|
+
* @param isConnected Whether to set
|
|
1135
|
+
* @internal
|
|
1136
|
+
*/
|
|
1137
|
+
setConnected(t) {
|
|
1138
|
+
var e;
|
|
1139
|
+
this._$parent === void 0 && (this.__isConnected = t, (e = this._$notifyConnectionChanged) == null || e.call(this, t));
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
class Ds {
|
|
1143
|
+
constructor(t, e, n, i, o) {
|
|
1144
|
+
v(this, "type", Bn);
|
|
1145
|
+
v(this, "element");
|
|
1146
|
+
v(this, "name");
|
|
1147
|
+
v(this, "options");
|
|
1148
|
+
/**
|
|
1149
|
+
* If this attribute part represents an interpolation, this contains the
|
|
1150
|
+
* static strings of the interpolation. For single-value, complete bindings,
|
|
1151
|
+
* this is undefined.
|
|
1152
|
+
*/
|
|
1153
|
+
v(this, "strings");
|
|
1154
|
+
/** @internal */
|
|
1155
|
+
v(this, "_$committedValue");
|
|
1156
|
+
/** @internal */
|
|
1157
|
+
v(this, "__directives");
|
|
1158
|
+
/** @internal */
|
|
1159
|
+
v(this, "_$parent");
|
|
1160
|
+
/** @internal */
|
|
1161
|
+
v(this, "_$disconnectableChildren");
|
|
1162
|
+
this.element = t, this.name = e, this._$parent = i, this.options = o, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$committedValue = new Array(n.length - 1).fill(new String()), this.strings = n) : this._$committedValue = void 0;
|
|
1163
|
+
}
|
|
1164
|
+
get tagName() {
|
|
1165
|
+
return this.element.tagName;
|
|
1166
|
+
}
|
|
1167
|
+
// See comment in Disconnectable interface for why this is a getter
|
|
1168
|
+
get _$isConnected() {
|
|
1169
|
+
return this._$parent._$isConnected;
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
* Sets the value of this part by resolving the value from possibly multiple
|
|
1173
|
+
* values and static strings and committing it to the DOM.
|
|
1174
|
+
* If this part is single-valued, `this._strings` will be undefined, and the
|
|
1175
|
+
* method will be called with a single value argument. If this part is
|
|
1176
|
+
* multi-value, `this._strings` will be defined, and the method is called
|
|
1177
|
+
* with the value array of the part's owning TemplateInstance, and an offset
|
|
1178
|
+
* into the value array from which the values should be read.
|
|
1179
|
+
* This method is overloaded this way to eliminate short-lived array slices
|
|
1180
|
+
* of the template instance values, and allow a fast-path for single-valued
|
|
1181
|
+
* parts.
|
|
1182
|
+
*
|
|
1183
|
+
* @param value The part value, or an array of values for multi-valued parts
|
|
1184
|
+
* @param valueIndex the index to start reading values from. `undefined` for
|
|
1185
|
+
* single-valued parts
|
|
1186
|
+
* @param noCommit causes the part to not commit its value to the DOM. Used
|
|
1187
|
+
* in hydration to prime attribute parts with their first-rendered value,
|
|
1188
|
+
* but not set the attribute, and in SSR to no-op the DOM operation and
|
|
1189
|
+
* capture the value for serialization.
|
|
1190
|
+
*
|
|
1191
|
+
* @internal
|
|
1192
|
+
*/
|
|
1193
|
+
_$setValue(t, e = this, n, i) {
|
|
1194
|
+
const o = this.strings;
|
|
1195
|
+
let a = !1;
|
|
1196
|
+
if (o === void 0)
|
|
1197
|
+
t = oe(this, t, e, 0), a = !Ke(t) || t !== this._$committedValue, a && (this._$committedValue = t);
|
|
1198
|
+
else {
|
|
1199
|
+
const c = t;
|
|
1200
|
+
t = o[0];
|
|
1201
|
+
let l, d;
|
|
1202
|
+
for (l = 0; l < o.length - 1; l++)
|
|
1203
|
+
d = oe(this, c[n + l], e, l), a || (a = !Ke(d) || d !== this._$committedValue[l]), jt(d) ? t = void 0 : jt(t) || (t += d + o[l + 1]), this._$committedValue[l] = d;
|
|
1204
|
+
}
|
|
1205
|
+
a && !i && this._commitValue(t);
|
|
1206
|
+
}
|
|
1207
|
+
/** @internal */
|
|
1208
|
+
_commitValue(t) {
|
|
1209
|
+
jt(t) ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t);
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
class Bc extends Ds {
|
|
1213
|
+
constructor() {
|
|
1214
|
+
super(...arguments);
|
|
1215
|
+
v(this, "type", Hc);
|
|
1216
|
+
}
|
|
1217
|
+
/** @internal */
|
|
1218
|
+
_commitValue(e) {
|
|
1219
|
+
this.element[this.name] = e;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
class Kc extends Ds {
|
|
1223
|
+
constructor() {
|
|
1224
|
+
super(...arguments);
|
|
1225
|
+
v(this, "type", Wc);
|
|
1226
|
+
}
|
|
1227
|
+
/** @internal */
|
|
1228
|
+
_commitValue(e) {
|
|
1229
|
+
this.element.toggleAttribute(this.name, !!e);
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
class jc extends Ds {
|
|
1233
|
+
constructor() {
|
|
1234
|
+
super(...arguments);
|
|
1235
|
+
v(this, "type", zc);
|
|
1236
|
+
}
|
|
1237
|
+
/** @internal */
|
|
1238
|
+
_$setValue(e, n = this) {
|
|
1239
|
+
e = oe(this, e, n, 0);
|
|
1240
|
+
const i = this._$committedValue, o = i && (!e || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive), a = e && (!i || o);
|
|
1241
|
+
o && this.element.removeEventListener(this.name, this, i), a && this.element.addEventListener(this.name, this, e), this._$committedValue = e;
|
|
1242
|
+
}
|
|
1243
|
+
handleEvent(e) {
|
|
1244
|
+
var n;
|
|
1245
|
+
typeof this._$committedValue == "function" ? this._$committedValue.call(((n = this.options) == null ? void 0 : n.host) ?? this.element, e) : this._$committedValue.handleEvent(e);
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
class Qc {
|
|
1249
|
+
constructor(t, e, n) {
|
|
1250
|
+
v(this, "type", Kn);
|
|
1251
|
+
/** @internal */
|
|
1252
|
+
v(this, "__directive");
|
|
1253
|
+
// This is to ensure that every Part has a _$committedValue
|
|
1254
|
+
v(this, "_$committedValue");
|
|
1255
|
+
/** @internal */
|
|
1256
|
+
v(this, "_$parent");
|
|
1257
|
+
/** @internal */
|
|
1258
|
+
v(this, "_$disconnectableChildren");
|
|
1259
|
+
v(this, "_$props");
|
|
1260
|
+
v(this, "options");
|
|
1261
|
+
this.element = t, this._$parent = e, this.options = n;
|
|
1262
|
+
}
|
|
1263
|
+
// See comment in Disconnectable interface for why this is a getter
|
|
1264
|
+
get _$isConnected() {
|
|
1265
|
+
return this._$parent._$isConnected;
|
|
1266
|
+
}
|
|
1267
|
+
_$setValue(t) {
|
|
1268
|
+
if (t)
|
|
1269
|
+
if (t instanceof jr)
|
|
1270
|
+
t.value = this.element;
|
|
1271
|
+
else if (t._$litDirective$)
|
|
1272
|
+
oe(this, t);
|
|
1273
|
+
else {
|
|
1274
|
+
if (this._$props)
|
|
1275
|
+
for (const e in this._$props)
|
|
1276
|
+
Reflect.set(this.element, e, void 0);
|
|
1277
|
+
Object.assign(this.element, t), this._$props = t;
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
const Rl = () => new jr();
|
|
1282
|
+
class jr {
|
|
1283
|
+
constructor() {
|
|
1284
|
+
v(this, "value");
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
const Jc = (s, t, e) => {
|
|
1288
|
+
const n = (e == null ? void 0 : e.renderBefore) ?? t;
|
|
1289
|
+
let i = n._$litPart$;
|
|
1290
|
+
if (i === void 0) {
|
|
1291
|
+
const o = (e == null ? void 0 : e.renderBefore) ?? null;
|
|
1292
|
+
n._$litPart$ = i = new rs(
|
|
1293
|
+
t.insertBefore(re(), o),
|
|
1294
|
+
o,
|
|
1295
|
+
void 0,
|
|
1296
|
+
e ?? {}
|
|
1297
|
+
);
|
|
1298
|
+
}
|
|
1299
|
+
return i._$setValue(s), i;
|
|
1300
|
+
}, Yc = "0.0.0", Zc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1301
|
+
__proto__: null,
|
|
1302
|
+
version: Yc
|
|
1303
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1304
|
+
/**
|
|
1305
|
+
* @license
|
|
1306
|
+
* Copyright 2017 Google LLC
|
|
1307
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1308
|
+
*/
|
|
1309
|
+
const Xc = {
|
|
1310
|
+
CHILD: 2
|
|
1311
|
+
}, th = (s) => (...t) => ({
|
|
1312
|
+
// This property needs to remain unminified.
|
|
1313
|
+
_$litDirective$: s,
|
|
1314
|
+
values: t
|
|
1315
|
+
});
|
|
1316
|
+
class eh {
|
|
1317
|
+
constructor() {
|
|
1318
|
+
//@internal
|
|
1319
|
+
v(this, "__part");
|
|
1320
|
+
//@internal
|
|
1321
|
+
v(this, "__attributeIndex");
|
|
1322
|
+
//@internal
|
|
1323
|
+
v(this, "__directive");
|
|
1324
|
+
//@internal
|
|
1325
|
+
v(this, "_$parent");
|
|
1326
|
+
// These will only exist on the AsyncDirective subclass
|
|
1327
|
+
//@internal
|
|
1328
|
+
v(this, "_$disconnectableChildren");
|
|
1329
|
+
}
|
|
1330
|
+
// See comment in Disconnectable interface for why this is a getter
|
|
1331
|
+
get _$isConnected() {
|
|
1332
|
+
return this._$parent._$isConnected;
|
|
1333
|
+
}
|
|
1334
|
+
/** @internal */
|
|
1335
|
+
_$initialize(t, e, n) {
|
|
1336
|
+
this.__part = t, this._$parent = e, this.__attributeIndex = n;
|
|
1337
|
+
}
|
|
1338
|
+
/** @internal */
|
|
1339
|
+
_$resolve(t, e) {
|
|
1340
|
+
return this.update(t, e);
|
|
1341
|
+
}
|
|
1342
|
+
update(t, e) {
|
|
1343
|
+
return this.render(...e);
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
const sr = () => document.createComment(""), we = (s, t, e) => {
|
|
1347
|
+
var o;
|
|
1348
|
+
const n = s._$startNode.parentNode, i = t === void 0 ? s._$endNode : t._$startNode;
|
|
1349
|
+
if (e === void 0) {
|
|
1350
|
+
const a = n.insertBefore(sr(), i), c = n.insertBefore(sr(), i);
|
|
1351
|
+
e = new rs(a, c, s, s.options);
|
|
1352
|
+
} else {
|
|
1353
|
+
const a = e._$endNode.nextSibling, c = e._$parent, l = c !== s;
|
|
1354
|
+
if (l) {
|
|
1355
|
+
(o = e._$reparentDisconnectables) == null || o.call(e, s), e._$parent = s;
|
|
1356
|
+
let d;
|
|
1357
|
+
e._$notifyConnectionChanged !== void 0 && (d = s._$isConnected) !== c._$isConnected && e._$notifyConnectionChanged(d);
|
|
1358
|
+
}
|
|
1359
|
+
if (a !== i || l) {
|
|
1360
|
+
let d = e._$startNode;
|
|
1361
|
+
for (; d !== a; ) {
|
|
1362
|
+
const f = d.nextSibling;
|
|
1363
|
+
n.insertBefore(d, i), d = f;
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
return e;
|
|
1368
|
+
}, Pt = (s, t, e = s) => (s._$setValue(t, e), s), sh = {}, nh = (s, t = sh) => s._$committedValue = t, ih = (s) => s._$committedValue, Zs = (s) => {
|
|
1369
|
+
var n;
|
|
1370
|
+
(n = s._$notifyConnectionChanged) == null || n.call(s, !1, !0);
|
|
1371
|
+
let t = s._$startNode;
|
|
1372
|
+
const e = s._$endNode.nextSibling;
|
|
1373
|
+
for (; t !== e; ) {
|
|
1374
|
+
const i = t.nextSibling;
|
|
1375
|
+
t.remove(), t = i;
|
|
1376
|
+
}
|
|
1377
|
+
}, nr = (s, t, e) => {
|
|
1378
|
+
const n = /* @__PURE__ */ new Map();
|
|
1379
|
+
for (let i = t; i <= e; i++)
|
|
1380
|
+
n.set(s[i], i);
|
|
1381
|
+
return n;
|
|
1382
|
+
};
|
|
1383
|
+
class rh extends eh {
|
|
1384
|
+
constructor(e) {
|
|
1385
|
+
super();
|
|
1386
|
+
v(this, "_itemKeys");
|
|
1387
|
+
if (e.type !== Xc.CHILD)
|
|
1388
|
+
throw new Error("repeat() can only be used in text expressions");
|
|
1389
|
+
}
|
|
1390
|
+
_getValuesAndKeys(e, n, i) {
|
|
1391
|
+
let o;
|
|
1392
|
+
i === void 0 ? i = n : n !== void 0 && (o = n);
|
|
1393
|
+
const a = [], c = [];
|
|
1394
|
+
let l = 0;
|
|
1395
|
+
for (const d of e)
|
|
1396
|
+
a[l] = o ? o(d, l) : l, c[l] = i(d, l), l++;
|
|
1397
|
+
return {
|
|
1398
|
+
values: c,
|
|
1399
|
+
keys: a
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1402
|
+
render(e, n, i) {
|
|
1403
|
+
return this._getValuesAndKeys(e, n, i).values;
|
|
1404
|
+
}
|
|
1405
|
+
update(e, [n, i, o]) {
|
|
1406
|
+
const a = ih(e), { values: c, keys: l } = this._getValuesAndKeys(n, i, o);
|
|
1407
|
+
if (!Array.isArray(a))
|
|
1408
|
+
return this._itemKeys = l, c;
|
|
1409
|
+
const d = this._itemKeys ?? (this._itemKeys = []), f = [];
|
|
1410
|
+
let r, m, h = 0, g = a.length - 1, $ = 0, w = c.length - 1;
|
|
1411
|
+
for (; h <= g && $ <= w; )
|
|
1412
|
+
if (a[h] === null)
|
|
1413
|
+
h++;
|
|
1414
|
+
else if (a[g] === null)
|
|
1415
|
+
g--;
|
|
1416
|
+
else if (d[h] === l[$])
|
|
1417
|
+
f[$] = Pt(a[h], c[$]), h++, $++;
|
|
1418
|
+
else if (d[g] === l[w])
|
|
1419
|
+
f[w] = Pt(a[g], c[w]), g--, w--;
|
|
1420
|
+
else if (d[h] === l[w])
|
|
1421
|
+
f[w] = Pt(a[h], c[w]), we(e, f[w + 1], a[h]), h++, w--;
|
|
1422
|
+
else if (d[g] === l[$])
|
|
1423
|
+
f[$] = Pt(a[g], c[$]), we(e, a[h], a[g]), g--, $++;
|
|
1424
|
+
else if (r === void 0 && (r = nr(l, $, w), m = nr(d, h, g)), !r.has(d[h]))
|
|
1425
|
+
Zs(a[h]), h++;
|
|
1426
|
+
else if (!r.has(d[g]))
|
|
1427
|
+
Zs(a[g]), g--;
|
|
1428
|
+
else {
|
|
1429
|
+
const k = m.get(l[$]), p = k !== void 0 ? a[k] : null;
|
|
1430
|
+
if (p === null) {
|
|
1431
|
+
const b = we(e, a[h]);
|
|
1432
|
+
Pt(b, c[$]), f[$] = b;
|
|
1433
|
+
} else
|
|
1434
|
+
f[$] = Pt(p, c[$]), we(e, a[h], p), a[k] = null;
|
|
1435
|
+
$++;
|
|
1436
|
+
}
|
|
1437
|
+
for (; $ <= w; ) {
|
|
1438
|
+
const k = we(e, f[w + 1]);
|
|
1439
|
+
Pt(k, c[$]), f[$++] = k;
|
|
1386
1440
|
}
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
const i = Nn(this, t);
|
|
1393
|
-
i.hasOwnProperty(e) || (yt(t, "definedCSSStates", s), zc(i, e, s)), Ln(this, e);
|
|
1394
|
-
});
|
|
1395
|
-
}
|
|
1396
|
-
function Rr(n, t, e, s) {
|
|
1397
|
-
const i = n.name, r = ce(i);
|
|
1398
|
-
if (n.static)
|
|
1399
|
-
yt(n, e, r);
|
|
1400
|
-
else {
|
|
1401
|
-
const a = he(t);
|
|
1402
|
-
a[i] || (a[i] = r, yt(n, e, r));
|
|
1441
|
+
for (; h <= g; ) {
|
|
1442
|
+
const k = a[h++];
|
|
1443
|
+
k !== null && Zs(k);
|
|
1444
|
+
}
|
|
1445
|
+
return this._itemKeys = l, nh(e, f), Qn;
|
|
1403
1446
|
}
|
|
1404
|
-
return s || r;
|
|
1405
|
-
}
|
|
1406
|
-
function Vc(n, t) {
|
|
1407
|
-
return function(e) {
|
|
1408
|
-
return Rr(t, this, "definedSlots", e);
|
|
1409
|
-
};
|
|
1410
|
-
}
|
|
1411
|
-
function Ir(n, t) {
|
|
1412
|
-
return function(e) {
|
|
1413
|
-
return Rr(t, this, "definedParts", e);
|
|
1414
|
-
};
|
|
1415
|
-
}
|
|
1416
|
-
function be(n, t) {
|
|
1417
|
-
Hr(t);
|
|
1418
|
-
}
|
|
1419
|
-
function Dc(n, t) {
|
|
1420
|
-
Hr(t, { bubbles: !0, composed: !0 });
|
|
1421
|
-
}
|
|
1422
|
-
function Hr(n, t) {
|
|
1423
|
-
const e = n.name, s = ce(e);
|
|
1424
|
-
n.addInitializer(function() {
|
|
1425
|
-
const i = Nn(this, n);
|
|
1426
|
-
i.hasOwnProperty(e) || (yt(n, "definedEvents", s), zs(i, e, { event: s, eventOptions: t })), Ln(this, e);
|
|
1427
|
-
});
|
|
1428
|
-
}
|
|
1429
|
-
function Hn(n) {
|
|
1430
|
-
return function(t, e) {
|
|
1431
|
-
yt(e, "adoptedStyleSheets", n);
|
|
1432
|
-
};
|
|
1433
|
-
}
|
|
1434
|
-
function Wn(n) {
|
|
1435
|
-
return function(t, e) {
|
|
1436
|
-
yt(e, "observedStores", n);
|
|
1437
|
-
};
|
|
1438
|
-
}
|
|
1439
|
-
function Vt({
|
|
1440
|
-
mode: n = "open",
|
|
1441
|
-
serializable: t = !0,
|
|
1442
|
-
delegatesFocus: e,
|
|
1443
|
-
slotAssignment: s
|
|
1444
|
-
} = {}) {
|
|
1445
|
-
return function(i, r) {
|
|
1446
|
-
const a = r.metadata;
|
|
1447
|
-
xr(a, { mode: n, serializable: t, delegatesFocus: e, slotAssignment: s });
|
|
1448
|
-
};
|
|
1449
|
-
}
|
|
1450
|
-
function Wr({ penetrable: n }) {
|
|
1451
|
-
return function(t, e) {
|
|
1452
|
-
const s = e.metadata;
|
|
1453
|
-
s.penetrable = n;
|
|
1454
|
-
};
|
|
1455
|
-
}
|
|
1456
|
-
function Gc() {
|
|
1457
|
-
return function(n, t) {
|
|
1458
|
-
const e = t.metadata;
|
|
1459
|
-
e.noBlocking = !0;
|
|
1460
|
-
};
|
|
1461
|
-
}
|
|
1462
|
-
function zn(n) {
|
|
1463
|
-
return function(t, e) {
|
|
1464
|
-
const s = e.metadata;
|
|
1465
|
-
s.aria = { ...s.aria, ...n };
|
|
1466
|
-
};
|
|
1467
|
-
}
|
|
1468
|
-
function Uc(n) {
|
|
1469
|
-
return function(t, { addInitializer: e }) {
|
|
1470
|
-
e(function() {
|
|
1471
|
-
customElements.define(n, t);
|
|
1472
|
-
});
|
|
1473
|
-
};
|
|
1474
1447
|
}
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
...
|
|
1479
|
-
...
|
|
1448
|
+
const Il = th(rh);
|
|
1449
|
+
Ar(Gc, Jc);
|
|
1450
|
+
globalThis.__GEM_DEVTOOLS__HOOK__ && !globalThis.__GEM_DEVTOOLS__HOOK__.GemElement && Object.assign(globalThis.__GEM_DEVTOOLS__HOOK__, {
|
|
1451
|
+
...pc,
|
|
1452
|
+
...kc,
|
|
1453
|
+
...cc,
|
|
1454
|
+
...Zc
|
|
1480
1455
|
});
|
|
1481
|
-
const
|
|
1482
|
-
let
|
|
1483
|
-
const
|
|
1456
|
+
const J = globalThis.history, Qr = J.pushState.bind(J), Jr = J.replaceState.bind(J);
|
|
1457
|
+
let oh = 0;
|
|
1458
|
+
const Yn = () => `${performance.now()}-${++oh}`, O = Wt({
|
|
1484
1459
|
$hasCloseHandle: !1,
|
|
1485
1460
|
$hasOpenHandle: !1,
|
|
1486
1461
|
$hasShouldCloseHandle: !1,
|
|
1487
1462
|
$key: ""
|
|
1488
1463
|
}), q = /* @__PURE__ */ new Map();
|
|
1489
|
-
function
|
|
1490
|
-
const { $key: t, $hasCloseHandle: e, $hasOpenHandle:
|
|
1491
|
-
if (
|
|
1492
|
-
if (t) throw new
|
|
1493
|
-
if (e) throw new
|
|
1494
|
-
if (
|
|
1495
|
-
if (i) throw new
|
|
1464
|
+
function Yr(s) {
|
|
1465
|
+
const { $key: t, $hasCloseHandle: e, $hasOpenHandle: n, $hasShouldCloseHandle: i } = s || {};
|
|
1466
|
+
if (O.$key !== t) {
|
|
1467
|
+
if (t) throw new wt("`$key` is not allowed");
|
|
1468
|
+
if (e) throw new wt("`$hasCloseHandle` is not allowed");
|
|
1469
|
+
if (n) throw new wt("`$hasOpenHandle` is not allowed");
|
|
1470
|
+
if (i) throw new wt("`$hasShouldCloseHandle` is not allowed");
|
|
1496
1471
|
}
|
|
1497
1472
|
}
|
|
1498
|
-
function
|
|
1499
|
-
return Y.basePath ? Y.basePath +
|
|
1473
|
+
function Zr(s) {
|
|
1474
|
+
return Y.basePath ? Y.basePath + s : s;
|
|
1500
1475
|
}
|
|
1501
|
-
function
|
|
1502
|
-
return
|
|
1476
|
+
function ws(s) {
|
|
1477
|
+
return s === Y.basePath ? "/" : s.replace(new RegExp(`^${Y.basePath}/`), "/");
|
|
1503
1478
|
}
|
|
1504
|
-
function
|
|
1479
|
+
function Zn() {
|
|
1505
1480
|
Y.dispatchEvent(new CustomEvent("beforechange"));
|
|
1506
1481
|
}
|
|
1507
|
-
function
|
|
1508
|
-
const t = q.get(
|
|
1509
|
-
return { ...
|
|
1482
|
+
function Es(s) {
|
|
1483
|
+
const t = q.get(O.$key) || { path: ws(location.pathname), query: new qe() }, e = s.path ? xr(t.path, s.path) : ws(location.pathname), n = new qe(s.query ?? (s.path ? "" : location.search)), i = String(n) !== String(t.query), o = i ? n : t.query, a = e !== t.path || i, c = s.title || (a ? "" : document.title), l = s.close || s.data || s.open || s.shouldClose, d = decodeURIComponent(s.hash ?? (!a && l ? location.hash : ""));
|
|
1484
|
+
return { ...s, title: c, path: e, query: o, hash: d };
|
|
1510
1485
|
}
|
|
1511
|
-
function
|
|
1512
|
-
|
|
1513
|
-
const e =
|
|
1486
|
+
function ir(s, t) {
|
|
1487
|
+
Yr(s.data);
|
|
1488
|
+
const e = Es(s), { title: n, path: i, query: o, hash: a, close: c, open: l, shouldClose: d, data: f } = e, r = {
|
|
1514
1489
|
$hasCloseHandle: !!c,
|
|
1515
1490
|
$hasOpenHandle: !!l,
|
|
1516
1491
|
$hasShouldCloseHandle: !!d,
|
|
1517
|
-
$key:
|
|
1518
|
-
$title:
|
|
1492
|
+
$key: Yn(),
|
|
1493
|
+
$title: n,
|
|
1519
1494
|
...f
|
|
1520
1495
|
};
|
|
1521
|
-
q.set(
|
|
1522
|
-
const m =
|
|
1523
|
-
t(
|
|
1496
|
+
q.set(r.$key, e), Zn(), In(O), O(r);
|
|
1497
|
+
const m = Zr(i) + new qe(o) + a, h = decodeURIComponent(location.hash);
|
|
1498
|
+
t(r, n, m), h !== a && dispatchEvent(new CustomEvent("hashchange"));
|
|
1524
1499
|
}
|
|
1525
|
-
function
|
|
1526
|
-
|
|
1500
|
+
function rr(s, t, e, n) {
|
|
1501
|
+
Yr(s);
|
|
1527
1502
|
const i = {
|
|
1528
|
-
$key:
|
|
1503
|
+
$key: Yn(),
|
|
1529
1504
|
$title: t,
|
|
1530
|
-
...
|
|
1531
|
-
}, { pathname:
|
|
1532
|
-
q.set(i.$key, l),
|
|
1533
|
-
const d =
|
|
1534
|
-
|
|
1505
|
+
...s || {}
|
|
1506
|
+
}, { pathname: o, search: a, hash: c } = new URL(e, location.origin + location.pathname), l = Es({ path: o, query: new qe(a), hash: c, title: t, data: s });
|
|
1507
|
+
q.set(i.$key, l), Zn(), In(O), O(i);
|
|
1508
|
+
const d = Zr(o) + l.query + c, f = location.hash;
|
|
1509
|
+
n(i, t, d), f !== c && dispatchEvent(new CustomEvent("hashchange"));
|
|
1535
1510
|
}
|
|
1536
|
-
const
|
|
1511
|
+
const hn = Wt({
|
|
1537
1512
|
basePath: ""
|
|
1538
1513
|
});
|
|
1539
|
-
class
|
|
1514
|
+
class ah extends EventTarget {
|
|
1540
1515
|
get store() {
|
|
1541
|
-
return
|
|
1516
|
+
return O;
|
|
1542
1517
|
}
|
|
1543
1518
|
get currentKey() {
|
|
1544
|
-
return
|
|
1519
|
+
return O.$key;
|
|
1545
1520
|
}
|
|
1546
1521
|
get basePath() {
|
|
1547
|
-
return
|
|
1522
|
+
return hn.basePath;
|
|
1548
1523
|
}
|
|
1549
1524
|
set basePath(t) {
|
|
1550
|
-
|
|
1525
|
+
hn({ basePath: t }), Object.assign(q.get(O.$key), { path: ws(location.pathname) });
|
|
1551
1526
|
}
|
|
1552
1527
|
getParams() {
|
|
1553
|
-
return q.get(
|
|
1528
|
+
return q.get(O.$key);
|
|
1554
1529
|
}
|
|
1555
1530
|
updateParams(t) {
|
|
1556
|
-
Object.assign(q.get(
|
|
1531
|
+
Object.assign(q.get(O.$key), t), O();
|
|
1557
1532
|
}
|
|
1558
1533
|
push(t) {
|
|
1559
|
-
|
|
1534
|
+
ir(t, Qr);
|
|
1560
1535
|
}
|
|
1561
1536
|
replace(t) {
|
|
1562
|
-
|
|
1537
|
+
ir(t, Jr);
|
|
1563
1538
|
}
|
|
1564
1539
|
pushIgnoreCloseHandle(t) {
|
|
1565
|
-
var e,
|
|
1566
|
-
|
|
1540
|
+
var e, n;
|
|
1541
|
+
O.$hasCloseHandle ? ((n = (e = q.get(O.$key)) == null ? void 0 : e.close) == null || n.call(e), this.replace(t)) : this.push(t);
|
|
1567
1542
|
}
|
|
1568
1543
|
forward() {
|
|
1569
|
-
|
|
1544
|
+
J.forward();
|
|
1570
1545
|
}
|
|
1571
1546
|
back() {
|
|
1572
|
-
|
|
1547
|
+
J.back();
|
|
1573
1548
|
}
|
|
1574
1549
|
}
|
|
1575
|
-
const Y = new
|
|
1576
|
-
if (!
|
|
1577
|
-
if (
|
|
1578
|
-
|
|
1579
|
-
},
|
|
1580
|
-
|
|
1581
|
-
},
|
|
1550
|
+
const Y = new ah(), Ft = Wt({ defaultTitle: document.title, url: "", title: "" }), ch = { history: Y, titleStore: Ft, basePathStore: hn };
|
|
1551
|
+
if (!globalThis._GEMHISTORY) {
|
|
1552
|
+
if (globalThis._GEMHISTORY = ch, J.pushState = (t, e, n) => {
|
|
1553
|
+
rr(t, e, n, Qr);
|
|
1554
|
+
}, J.replaceState = (t, e, n) => {
|
|
1555
|
+
rr(t, e, n, Jr);
|
|
1556
|
+
}, addEventListener("hashchange", ({ isTrusted: t }) => {
|
|
1582
1557
|
t && Y.replace({ hash: location.hash });
|
|
1583
|
-
}),
|
|
1584
|
-
if (
|
|
1585
|
-
|
|
1586
|
-
const t =
|
|
1587
|
-
q.set(
|
|
1558
|
+
}), J.state)
|
|
1559
|
+
if (J.state.$hasCloseHandle) {
|
|
1560
|
+
O(J.state);
|
|
1561
|
+
const t = Es({ title: document.title });
|
|
1562
|
+
q.set(O.$key, t), Y.back();
|
|
1588
1563
|
} else {
|
|
1589
|
-
const t =
|
|
1590
|
-
|
|
1591
|
-
$key:
|
|
1592
|
-
...
|
|
1593
|
-
}), q.set(
|
|
1564
|
+
const t = Es({ title: document.title, hash: location.hash });
|
|
1565
|
+
O({
|
|
1566
|
+
$key: Yn(),
|
|
1567
|
+
...J.state || {}
|
|
1568
|
+
}), q.set(O.$key, t);
|
|
1594
1569
|
}
|
|
1595
1570
|
else {
|
|
1596
|
-
const { protocol: t, pathname: e, search:
|
|
1597
|
-
t.startsWith("http") && Y.replace({ path: e, query:
|
|
1571
|
+
const { protocol: t, pathname: e, search: n, hash: i } = location;
|
|
1572
|
+
t.startsWith("http") && Y.replace({ path: e, query: n, hash: i });
|
|
1598
1573
|
}
|
|
1599
|
-
|
|
1600
|
-
const t = q.get(
|
|
1601
|
-
t && (t.title =
|
|
1602
|
-
}),
|
|
1574
|
+
mt(Ft, () => {
|
|
1575
|
+
const t = q.get(O.$key);
|
|
1576
|
+
t && (t.title = Ft.title);
|
|
1577
|
+
}), mt(O, () => {
|
|
1603
1578
|
const { title: t } = Y.getParams();
|
|
1604
|
-
t !==
|
|
1579
|
+
t !== Ft.title && Ft({ title: t });
|
|
1605
1580
|
});
|
|
1606
|
-
let
|
|
1607
|
-
|
|
1608
|
-
var
|
|
1581
|
+
let s = !1;
|
|
1582
|
+
addEventListener("popstate", (t) => {
|
|
1583
|
+
var o, a;
|
|
1609
1584
|
const e = t.state;
|
|
1610
1585
|
if (!(e != null && e.$key))
|
|
1611
1586
|
return;
|
|
1612
|
-
if (
|
|
1613
|
-
|
|
1587
|
+
if (s) {
|
|
1588
|
+
s = !1;
|
|
1614
1589
|
return;
|
|
1615
1590
|
}
|
|
1616
1591
|
if (!q.has(e.$key)) {
|
|
1617
1592
|
const { pathname: c, search: l, hash: d } = location;
|
|
1618
1593
|
q.set(e.$key, {
|
|
1619
|
-
path: c,
|
|
1620
|
-
query: new
|
|
1594
|
+
path: ws(c),
|
|
1595
|
+
query: new qe(l),
|
|
1621
1596
|
hash: decodeURIComponent(d),
|
|
1622
|
-
title: e.$title,
|
|
1597
|
+
title: Ft.title || e.$title,
|
|
1623
1598
|
// document.title 是导航前的
|
|
1624
1599
|
data: e
|
|
1625
1600
|
});
|
|
1626
1601
|
}
|
|
1627
|
-
const
|
|
1628
|
-
if (parseFloat(e.$key) > parseFloat(
|
|
1629
|
-
(a = (
|
|
1630
|
-
else if (
|
|
1631
|
-
const c = q.get(
|
|
1602
|
+
const n = O;
|
|
1603
|
+
if (parseFloat(e.$key) > parseFloat(n.$key) && e.$hasOpenHandle)
|
|
1604
|
+
(a = (o = q.get(e.$key)) == null ? void 0 : o.open) == null || a.call(o);
|
|
1605
|
+
else if (n.$hasCloseHandle) {
|
|
1606
|
+
const c = q.get(n.$key), l = c == null ? void 0 : c.close, d = c == null ? void 0 : c.shouldClose;
|
|
1632
1607
|
if (d && !d()) {
|
|
1633
|
-
|
|
1608
|
+
s = !0, Y.forward();
|
|
1634
1609
|
return;
|
|
1635
1610
|
} else
|
|
1636
|
-
l ? l() : e.$hasCloseHandle && (
|
|
1611
|
+
l ? l() : e.$hasCloseHandle && (s = !0, Y.back());
|
|
1637
1612
|
}
|
|
1638
|
-
|
|
1613
|
+
Zn(), In(O), O(e);
|
|
1639
1614
|
});
|
|
1640
1615
|
}
|
|
1641
|
-
const { history: x, titleStore: It, basePathStore:
|
|
1642
|
-
var
|
|
1643
|
-
throw TypeError(
|
|
1644
|
-
},
|
|
1645
|
-
for (var i = 0,
|
|
1646
|
-
return
|
|
1647
|
-
},
|
|
1648
|
-
var a, c, l, d, f,
|
|
1649
|
-
return
|
|
1616
|
+
const { history: x, titleStore: It, basePathStore: hh } = globalThis._GEMHISTORY;
|
|
1617
|
+
var lh = Object.create, Xn = Object.defineProperty, dh = Object.getOwnPropertyDescriptor, Xr = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), ue = (s) => {
|
|
1618
|
+
throw TypeError(s);
|
|
1619
|
+
}, to = (s, t, e) => t in s ? Xn(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, or = (s, t) => Xn(s, "name", { value: t, configurable: !0 }), uh = (s) => [, , , lh((s == null ? void 0 : s[Xr("metadata")]) ?? null)], eo = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], ke = (s) => s !== void 0 && typeof s != "function" ? ue("Function expected") : s, _h = (s, t, e, n, i) => ({ kind: eo[s], name: t, metadata: n, addInitializer: (o) => e._ ? ue("Already initialized") : i.push(ke(o || null)) }), ph = (s, t) => to(t, Xr("metadata"), s[3]), Mt = (s, t, e, n) => {
|
|
1620
|
+
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
1621
|
+
return n;
|
|
1622
|
+
}, Us = (s, t, e, n, i, o) => {
|
|
1623
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = eo[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && dh(r < 4 ? i : { get [e]() {
|
|
1624
|
+
return nt(this, o);
|
|
1625
|
+
}, set [e](u) {
|
|
1626
|
+
return Fe(this, o, u);
|
|
1627
|
+
} }, e));
|
|
1628
|
+
r ? h && r < 4 && or(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : or(i, e);
|
|
1629
|
+
for (var b = n.length - 1; b >= 0; b--)
|
|
1630
|
+
d = _h(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => fh(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? nt : mh)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => Fe(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? ke(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? ue("Object expected") : (ke(a = c.get) && (p.get = a), ke(a = c.set) && (p.set = a), ke(a = c.init) && w.unshift(a));
|
|
1631
|
+
return r || ph(s, i), p && Xn(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
1632
|
+
}, Ee = (s, t, e) => to(s, typeof t != "symbol" ? t + "" : t, e), ti = (s, t, e) => t.has(s) || ue("Cannot " + e), fh = (s, t) => Object(t) !== t ? ue('Cannot use the "in" operator on this value') : s.has(t), nt = (s, t, e) => (ti(s, t, "read from private field"), e ? e.call(s) : t.get(s)), Gt = (s, t, e) => t.has(s) ? ue("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), Fe = (s, t, e, n) => (ti(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), mh = (s, t, e) => (ti(s, t, "access private method"), e), so, no, io, ln, ro, Z, Pe, Me, Oe, dn, ds, ei;
|
|
1633
|
+
const Xs = Symbol();
|
|
1634
|
+
ro = [Vs(x.store), Gs({ role: "dialog", ariaModal: "true" })];
|
|
1635
|
+
class je extends (ln = tt, io = [B], no = [zs], so = [qn()], ln) {
|
|
1636
|
+
constructor() {
|
|
1637
|
+
super(...arguments), Ee(this, "label", Mt(Z, 8, this)), Mt(Z, 11, this), Ee(this, "opened", Mt(Z, 12, this)), Mt(Z, 15, this), Gt(this, Pe), Gt(this, Me), Gt(this, Oe, []), Gt(this, dn, () => {
|
|
1638
|
+
var t;
|
|
1639
|
+
this.inert = !0, nt(this, Oe).forEach((e) => e.inert = !1), nt(this, Pe) ? nt(this, Pe).before(this) : nt(this, Me) && ((t = nt(this, Me)) == null || t.appendChild(this)), this.dispatchEvent(new CustomEvent("close")), this.opened = !1;
|
|
1640
|
+
}), Gt(this, ds, () => {
|
|
1641
|
+
this.hidden = !1, this.inert = !1, Fe(this, Pe, this.nextSibling), Fe(this, Me, this.parentElement || this.getRootNode()), Fe(this, Oe, [...document.body.children].filter((t) => !t.inert)), nt(this, Oe).forEach((t) => t.inert = !0), document.body.append(this), this.dispatchEvent(new CustomEvent("open")), this.opened = !0;
|
|
1642
|
+
}), Gt(this, ei, Mt(Z, 16, this, () => this.inert = !0)), Mt(Z, 19, this), Ee(this, "open", () => {
|
|
1643
|
+
if (!this.opened)
|
|
1644
|
+
return nt(this, ds).call(this), x.push({
|
|
1645
|
+
title: this.label,
|
|
1646
|
+
open: nt(this, ds),
|
|
1647
|
+
close: nt(this, dn),
|
|
1648
|
+
shouldClose: this.shouldClose
|
|
1649
|
+
}), Xs;
|
|
1650
|
+
}), Ee(this, "close", () => (x.back(), Xs)), Ee(this, "forceClose", () => (this.opened = !1, setTimeout(this.close, 100), Xs));
|
|
1651
|
+
}
|
|
1652
|
+
shouldClose() {
|
|
1653
|
+
return !0;
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
Z = uh(ln);
|
|
1657
|
+
Pe = /* @__PURE__ */ new WeakMap();
|
|
1658
|
+
Me = /* @__PURE__ */ new WeakMap();
|
|
1659
|
+
Oe = /* @__PURE__ */ new WeakMap();
|
|
1660
|
+
dn = /* @__PURE__ */ new WeakMap();
|
|
1661
|
+
ds = /* @__PURE__ */ new WeakMap();
|
|
1662
|
+
ei = /* @__PURE__ */ new WeakMap();
|
|
1663
|
+
Us(Z, 5, "label", io, je);
|
|
1664
|
+
Us(Z, 5, "opened", no, je);
|
|
1665
|
+
Us(Z, 21, "#init", so, ei);
|
|
1666
|
+
je = Us(Z, 0, "GemDialogBaseElement", ro, je);
|
|
1667
|
+
Mt(Z, 1, je);
|
|
1668
|
+
var gh = Object.create, si = Object.defineProperty, vh = Object.getOwnPropertyDescriptor, oo = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), _e = (s) => {
|
|
1669
|
+
throw TypeError(s);
|
|
1670
|
+
}, ao = (s, t, e) => t in s ? si(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, ar = (s, t) => si(s, "name", { value: t, configurable: !0 }), $h = (s) => [, , , gh((s == null ? void 0 : s[oo("metadata")]) ?? null)], co = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], xe = (s) => s !== void 0 && typeof s != "function" ? _e("Function expected") : s, Sh = (s, t, e, n, i) => ({ kind: co[s], name: t, metadata: n, addInitializer: (o) => e._ ? _e("Already initialized") : i.push(xe(o || null)) }), yh = (s, t) => ao(t, oo("metadata"), s[3]), Ce = (s, t, e, n) => {
|
|
1671
|
+
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
1672
|
+
return n;
|
|
1673
|
+
}, tn = (s, t, e, n, i, o) => {
|
|
1674
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = co[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && vh(r < 4 ? i : { get [e]() {
|
|
1675
|
+
return cr(this, o);
|
|
1676
|
+
}, set [e](u) {
|
|
1677
|
+
return lr(this, o, u);
|
|
1678
|
+
} }, e));
|
|
1679
|
+
r ? h && r < 4 && ar(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : ar(i, e);
|
|
1680
|
+
for (var b = n.length - 1; b >= 0; b--)
|
|
1681
|
+
d = Sh(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => wh(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? cr : Eh)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => lr(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? xe(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? _e("Object expected") : (xe(a = c.get) && (p.get = a), xe(a = c.set) && (p.set = a), xe(a = c.init) && w.unshift(a));
|
|
1682
|
+
return r || yh(s, i), p && si(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
1683
|
+
}, as = (s, t, e) => ao(s, typeof t != "symbol" ? t + "" : t, e), ni = (s, t, e) => t.has(s) || _e("Cannot " + e), wh = (s, t) => Object(t) !== t ? _e('Cannot use the "in" operator on this value') : s.has(t), cr = (s, t, e) => (ni(s, t, "read from private field"), e ? e.call(s) : t.get(s)), hr = (s, t, e) => t.has(s) ? _e("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), lr = (s, t, e, n) => (ni(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), Eh = (s, t, e) => (ni(s, t, "access private method"), e);
|
|
1684
|
+
const cs = Symbol("open mark");
|
|
1685
|
+
function Hl(s) {
|
|
1686
|
+
var t, e, n, i, o, a, c;
|
|
1687
|
+
const l = Symbol();
|
|
1688
|
+
i = [zt(), Gs({ role: "alertdialog", ariaModal: "true" })];
|
|
1689
|
+
let d = class ho extends (n = tt, e = [Be()], t = [Be()], n) {
|
|
1690
|
+
constructor() {
|
|
1691
|
+
super(...arguments), as(this, "label", ""), hr(this, a, Ce(o, 8, this, () => mt(x.store, this.update))), Ce(o, 11, this), hr(this, c, Ce(o, 12, this, () => mt(ho.store, this.update))), Ce(o, 15, this);
|
|
1692
|
+
}
|
|
1693
|
+
/**@final */
|
|
1694
|
+
static get isOpen() {
|
|
1695
|
+
return this.store[cs];
|
|
1696
|
+
}
|
|
1697
|
+
/**
|
|
1698
|
+
* @final
|
|
1699
|
+
* 自带 100ms 延迟,以允许在其他 Dialog 的 `shouldClose` 中调用此方法;
|
|
1700
|
+
* 浏览器 history 为异步 API,需要设置较长延迟;
|
|
1701
|
+
*/
|
|
1702
|
+
static open(m) {
|
|
1703
|
+
const h = new this();
|
|
1704
|
+
this.instance = h, this.inertStore = [...document.body.children].filter(($) => !$.inert), this.inertStore.forEach(($) => $.inert = !0), document.body.append(h);
|
|
1705
|
+
const g = () => this.store({ [cs]: !0, ...m });
|
|
1706
|
+
return setTimeout(() => {
|
|
1707
|
+
g(), x.push({
|
|
1708
|
+
title: h.label,
|
|
1709
|
+
open: g,
|
|
1710
|
+
close: this.closeHandle.bind(this),
|
|
1711
|
+
shouldClose: this.shouldClose.bind(this)
|
|
1712
|
+
});
|
|
1713
|
+
}, 100), l;
|
|
1714
|
+
}
|
|
1715
|
+
/**
|
|
1716
|
+
* @final
|
|
1717
|
+
* UI 中执行关闭
|
|
1718
|
+
*/
|
|
1719
|
+
static close() {
|
|
1720
|
+
return x.back(), l;
|
|
1721
|
+
}
|
|
1722
|
+
/**
|
|
1723
|
+
* @final
|
|
1724
|
+
* history 中自动调用
|
|
1725
|
+
*/
|
|
1726
|
+
static closeHandle() {
|
|
1727
|
+
var m;
|
|
1728
|
+
return this.inertStore.forEach((h) => h.inert = !1), (m = this.instance) == null || m.remove(), this.store({ [cs]: !1, ...s }), l;
|
|
1729
|
+
}
|
|
1730
|
+
/**
|
|
1731
|
+
* 由于要操作浏览器历史记录,所以没有设计为 Promise;
|
|
1732
|
+
*/
|
|
1733
|
+
static shouldClose() {
|
|
1734
|
+
return !0;
|
|
1735
|
+
}
|
|
1736
|
+
};
|
|
1737
|
+
return o = $h(n), a = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), tn(o, 21, "#connectHistory", e, a), tn(o, 21, "#connectStore", t, c), d = tn(o, 0, "ModalElement", i, d), as(d, "inertStore", []), as(d, "instance", null), as(d, "store", Wt({
|
|
1738
|
+
[cs]: !1,
|
|
1739
|
+
...s
|
|
1740
|
+
})), Ce(o, 1, d), d;
|
|
1741
|
+
}
|
|
1742
|
+
var Ch = Object.create, ii = Object.defineProperty, bh = Object.getOwnPropertyDescriptor, lo = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), pe = (s) => {
|
|
1743
|
+
throw TypeError(s);
|
|
1744
|
+
}, uo = (s, t, e) => t in s ? ii(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, dr = (s, t) => ii(s, "name", { value: t, configurable: !0 }), _o = (s) => [, , , Ch((s == null ? void 0 : s[lo("metadata")]) ?? null)], po = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Le = (s) => s !== void 0 && typeof s != "function" ? pe("Function expected") : s, Th = (s, t, e, n, i) => ({ kind: po[s], name: t, metadata: n, addInitializer: (o) => e._ ? pe("Already initialized") : i.push(Le(o || null)) }), kh = (s, t) => uo(t, lo("metadata"), s[3]), T = (s, t, e, n) => {
|
|
1745
|
+
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
1746
|
+
return n;
|
|
1747
|
+
}, W = (s, t, e, n, i, o) => {
|
|
1748
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = po[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && bh(r < 4 ? i : { get [e]() {
|
|
1749
|
+
return V(this, o);
|
|
1650
1750
|
}, set [e](u) {
|
|
1651
|
-
return
|
|
1751
|
+
return Cs(this, o, u);
|
|
1652
1752
|
} }, e));
|
|
1653
|
-
|
|
1654
|
-
for (var b =
|
|
1655
|
-
d =
|
|
1656
|
-
return
|
|
1657
|
-
},
|
|
1658
|
-
const
|
|
1659
|
-
class
|
|
1753
|
+
r ? h && r < 4 && dr(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : dr(i, e);
|
|
1754
|
+
for (var b = n.length - 1; b >= 0; b--)
|
|
1755
|
+
d = Th(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => Ph(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? V : Mh)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => Cs(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? Le(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? pe("Object expected") : (Le(a = c.get) && (p.get = a), Le(a = c.set) && (p.set = a), Le(a = c.init) && w.unshift(a));
|
|
1756
|
+
return r || kh(s, i), p && ii(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
1757
|
+
}, z = (s, t, e) => uo(s, typeof t != "symbol" ? t + "" : t, e), ri = (s, t, e) => t.has(s) || pe("Cannot " + e), Ph = (s, t) => Object(t) !== t ? pe('Cannot use the "in" operator on this value') : s.has(t), V = (s, t, e) => (ri(s, t, "read from private field"), e ? e.call(s) : t.get(s)), et = (s, t, e) => t.has(s) ? pe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), Cs = (s, t, e, n) => (ri(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), Mh = (s, t, e) => (ri(s, t, "access private method"), e), fo, mo, go, vo, $o, So, yo, wo, Eo, Co, bo, To, ko, Po, Mo, un, Oo, S, Ot, qt, Ae, us, _n, Ne, pn, oi, ai, fn, ci, hi, xo, li, Lo;
|
|
1758
|
+
const Ao = "_";
|
|
1759
|
+
class Oh extends RegExp {
|
|
1660
1760
|
constructor(t) {
|
|
1661
1761
|
let e = 0;
|
|
1662
1762
|
super(
|
|
1663
|
-
`^${t.replace(/((:[^/$]+)|(\*))/g, (
|
|
1763
|
+
`^${t.replace(/((:[^/$]+)|(\*))/g, (n, i) => i === "*" ? `(?<${Ao}${e++}>.*)` : `(?<${i.slice(1)}>[^/]+)`)}$`
|
|
1664
1764
|
);
|
|
1665
1765
|
}
|
|
1666
1766
|
}
|
|
1667
|
-
function
|
|
1668
|
-
if (
|
|
1669
|
-
const
|
|
1767
|
+
function No(s, t) {
|
|
1768
|
+
if (globalThis.URLPattern) {
|
|
1769
|
+
const o = new URLPattern({ pathname: s }), a = o.exec({ pathname: t }) || o.exec({ pathname: `${t}/` });
|
|
1670
1770
|
return a ? a.pathname.groups : null;
|
|
1671
1771
|
}
|
|
1672
|
-
const e = new
|
|
1673
|
-
if (!
|
|
1772
|
+
const e = new Oh(s), n = t.match(e) || `${t}/`.match(e);
|
|
1773
|
+
if (!n) return null;
|
|
1674
1774
|
const i = {};
|
|
1675
|
-
return
|
|
1676
|
-
i[
|
|
1775
|
+
return n.groups && Object.entries(n.groups).forEach(([o, a]) => {
|
|
1776
|
+
i[o.startsWith(Ao) ? o.slice(1) : o] = a;
|
|
1677
1777
|
}), i;
|
|
1678
1778
|
}
|
|
1679
|
-
function
|
|
1680
|
-
let e = 0,
|
|
1779
|
+
function di(s, t) {
|
|
1780
|
+
let e = 0, n = s.pattern.replaceAll("*", () => `:${e++}`);
|
|
1681
1781
|
const i = t == null ? void 0 : t.params;
|
|
1682
|
-
return i && Object.keys(i).forEach((
|
|
1683
|
-
|
|
1684
|
-
}),
|
|
1782
|
+
return i && Object.keys(i).forEach((o) => {
|
|
1783
|
+
n = n.replace(new RegExp(`:${o}`, "g"), i[o]);
|
|
1784
|
+
}), n;
|
|
1685
1785
|
}
|
|
1686
|
-
function
|
|
1786
|
+
function xh(s, t) {
|
|
1687
1787
|
return {
|
|
1688
|
-
path:
|
|
1788
|
+
path: di(s, t),
|
|
1689
1789
|
...t
|
|
1690
1790
|
};
|
|
1691
1791
|
}
|
|
1692
|
-
const
|
|
1693
|
-
|
|
1694
|
-
class
|
|
1792
|
+
const en = ot``, ur = /* @__PURE__ */ new Map();
|
|
1793
|
+
Oo = [Ur({ penetrable: !0 })];
|
|
1794
|
+
class H extends (un = tt, Mo = [Ws], Po = [D], ko = [D], To = [D], bo = [Te], Co = [Te], Eo = [Te], wo = [Te], yo = [D], So = [D], $o = [D], vo = [ft((t) => [t.scrollContainer])], go = [ft((t) => [t.scrollContainer])], mo = [ft((t) => {
|
|
1695
1795
|
var e;
|
|
1696
|
-
return
|
|
1697
|
-
})],
|
|
1796
|
+
return V(e = t, fn).call(e);
|
|
1797
|
+
})], fo = [de((t) => !t.inert)], un) {
|
|
1698
1798
|
constructor() {
|
|
1699
|
-
super(...arguments), et(this,
|
|
1799
|
+
super(...arguments), et(this, Ot), z(this, "transition", T(S, 8, this)), T(S, 11, this), z(this, "routes", T(S, 12, this)), T(S, 15, this), z(this, "locationStore", T(S, 16, this)), T(S, 19, this), z(this, "key", T(S, 20, this)), T(S, 23, this), z(this, "loading", T(S, 24, this)), T(S, 27, this), z(this, "beforeroutechange", T(S, 28, this)), T(S, 31, this), z(this, "routechange", T(S, 32, this)), T(S, 35, this), z(this, "error", T(S, 36, this)), T(S, 39, this), z(this, "scrollContainer", T(S, 40, this)), T(S, 43, this), z(this, "scrollIgnoreHash", T(S, 44, this)), T(S, 47, this), z(this, "trigger", T(S, 48, this, x)), T(S, 51, this), z(this, "currentRoute"), z(this, "currentParams", {}), et(this, Ae, zn({ content: en })), et(this, us, () => {
|
|
1700
1800
|
if (!this.locationStore) return;
|
|
1701
|
-
const { path: t, query: e, hash:
|
|
1801
|
+
const { path: t, query: e, hash: n, data: i } = x.getParams();
|
|
1702
1802
|
this.locationStore({
|
|
1703
1803
|
path: t,
|
|
1704
1804
|
params: this.currentParams,
|
|
1705
1805
|
query: e,
|
|
1706
|
-
hash:
|
|
1806
|
+
hash: n,
|
|
1707
1807
|
data: i
|
|
1708
1808
|
});
|
|
1709
|
-
}), et(this,
|
|
1710
|
-
if (!
|
|
1711
|
-
const t =
|
|
1712
|
-
t ?
|
|
1713
|
-
}), et(this,
|
|
1714
|
-
this.beforeroutechange(t),
|
|
1809
|
+
}), et(this, _n, () => {
|
|
1810
|
+
if (!V(this, Ot, qt)) return;
|
|
1811
|
+
const t = ur.get(x.currentKey);
|
|
1812
|
+
t ? V(this, Ot, qt).scroll(0, t) : (this.scrollIgnoreHash || !x.getParams().hash) && V(this, Ot, qt).scroll(0, 0);
|
|
1813
|
+
}), et(this, Ne), et(this, pn, (t, e, n) => {
|
|
1814
|
+
this.beforeroutechange(t), Cs(this, Ne, void 0), this.currentRoute = t, this.currentParams = e;
|
|
1715
1815
|
const i = async () => {
|
|
1716
|
-
|
|
1816
|
+
V(this, Ae).call(this, { content: n }), V(this, us).call(this), await Promise.resolve(), V(this, _n).call(this), this.routechange(this.currentRoute);
|
|
1717
1817
|
};
|
|
1718
1818
|
this.transition && "startViewTransition" in document ? document.startViewTransition(() => i()) : i();
|
|
1719
|
-
}), et(this,
|
|
1720
|
-
if (
|
|
1721
|
-
return
|
|
1819
|
+
}), et(this, oi, T(S, 52, this, () => {
|
|
1820
|
+
if (V(this, Ot, qt))
|
|
1821
|
+
return Lr(
|
|
1722
1822
|
x,
|
|
1723
1823
|
"beforechange",
|
|
1724
|
-
() =>
|
|
1824
|
+
() => ur.set(x.currentKey, V(this, Ot, qt).scrollTop)
|
|
1725
1825
|
);
|
|
1726
|
-
})),
|
|
1727
|
-
const { path: t, query: e, hash:
|
|
1728
|
-
return [this.key, t, e,
|
|
1729
|
-
}), et(this,
|
|
1730
|
-
if (
|
|
1731
|
-
|
|
1826
|
+
})), T(S, 55, this), et(this, ai, T(S, 56, this, () => this.trigger.store && mt(this.trigger.store, () => V(this, Ae).call(this)))), T(S, 59, this), et(this, fn, () => {
|
|
1827
|
+
const { path: t, query: e, hash: n } = this.trigger.getParams();
|
|
1828
|
+
return [this.key, t, e, n];
|
|
1829
|
+
}), et(this, ci, T(S, 60, this, ([t, e], n) => {
|
|
1830
|
+
if (n && t === n[0] && e === n[1]) {
|
|
1831
|
+
V(this, us).call(this);
|
|
1732
1832
|
return;
|
|
1733
1833
|
}
|
|
1734
1834
|
this.update();
|
|
1735
|
-
})),
|
|
1736
|
-
const { content: t } =
|
|
1835
|
+
})), T(S, 63, this), et(this, hi, T(S, 64, this, () => {
|
|
1836
|
+
const { content: t } = V(this, Ae);
|
|
1737
1837
|
if (t !== void 0)
|
|
1738
|
-
return this.shadowRoot ? t ===
|
|
1739
|
-
})),
|
|
1740
|
-
const { path: t, hash: e, query:
|
|
1838
|
+
return this.shadowRoot ? t === en ? ot`<slot></slot>` : t : t === en ? void 0 : ot`${t}`;
|
|
1839
|
+
})), T(S, 67, this), z(this, "update", async () => {
|
|
1840
|
+
const { path: t, hash: e, query: n } = this.trigger.getParams(), { route: i, params: o = {} } = Qe.findRoute(this.routes, t), { redirect: a, content: c, getContent: l } = i || {};
|
|
1741
1841
|
if (a) {
|
|
1742
1842
|
this.trigger.replace({
|
|
1743
|
-
path:
|
|
1744
|
-
query:
|
|
1843
|
+
path: di({ pattern: a }, { params: o }),
|
|
1844
|
+
query: n,
|
|
1745
1845
|
hash: e
|
|
1746
1846
|
});
|
|
1747
1847
|
return;
|
|
1748
1848
|
}
|
|
1749
1849
|
this.trigger === x && (location.href !== It.url || i != null && i.title) && It({ url: location.href, title: i == null ? void 0 : i.title });
|
|
1750
|
-
const d = c || (l == null ? void 0 : l(
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
});
|
|
1759
|
-
return;
|
|
1850
|
+
const d = c || (l == null ? void 0 : l(o, this.shadowRoot || this));
|
|
1851
|
+
this.loading(i), Cs(this, Ne, d);
|
|
1852
|
+
const f = () => V(this, Ne) === d;
|
|
1853
|
+
try {
|
|
1854
|
+
const r = await d;
|
|
1855
|
+
f() && V(this, pn).call(this, i, o, r);
|
|
1856
|
+
} catch (r) {
|
|
1857
|
+
f() && this.error(r);
|
|
1760
1858
|
}
|
|
1761
|
-
H(this, _n).call(this, i, r, d);
|
|
1762
1859
|
});
|
|
1763
1860
|
}
|
|
1764
1861
|
}
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1862
|
+
S = _o(un);
|
|
1863
|
+
Ot = /* @__PURE__ */ new WeakSet();
|
|
1864
|
+
qt = function() {
|
|
1768
1865
|
return typeof this.scrollContainer == "function" ? this.scrollContainer() : this.scrollContainer;
|
|
1769
1866
|
};
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
os = /* @__PURE__ */ new WeakMap();
|
|
1773
|
-
Oe = /* @__PURE__ */ new WeakMap();
|
|
1867
|
+
Ae = /* @__PURE__ */ new WeakMap();
|
|
1868
|
+
us = /* @__PURE__ */ new WeakMap();
|
|
1774
1869
|
_n = /* @__PURE__ */ new WeakMap();
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1870
|
+
Ne = /* @__PURE__ */ new WeakMap();
|
|
1871
|
+
pn = /* @__PURE__ */ new WeakMap();
|
|
1872
|
+
oi = /* @__PURE__ */ new WeakMap();
|
|
1873
|
+
ai = /* @__PURE__ */ new WeakMap();
|
|
1874
|
+
fn = /* @__PURE__ */ new WeakMap();
|
|
1875
|
+
ci = /* @__PURE__ */ new WeakMap();
|
|
1876
|
+
hi = /* @__PURE__ */ new WeakMap();
|
|
1877
|
+
W(S, 5, "transition", Mo, H);
|
|
1878
|
+
W(S, 5, "routes", Po, H);
|
|
1879
|
+
W(S, 5, "locationStore", ko, H);
|
|
1880
|
+
W(S, 5, "key", To, H);
|
|
1881
|
+
W(S, 5, "loading", bo, H);
|
|
1882
|
+
W(S, 5, "beforeroutechange", Co, H);
|
|
1883
|
+
W(S, 5, "routechange", Eo, H);
|
|
1884
|
+
W(S, 5, "error", wo, H);
|
|
1885
|
+
W(S, 5, "scrollContainer", yo, H);
|
|
1886
|
+
W(S, 5, "scrollIgnoreHash", So, H);
|
|
1887
|
+
W(S, 5, "trigger", $o, H);
|
|
1888
|
+
W(S, 21, "#rememberScrollPosition", vo, oi);
|
|
1889
|
+
W(S, 21, "#connectTriggerStore", go, ai);
|
|
1890
|
+
W(S, 21, "#updateContent", mo, ci);
|
|
1891
|
+
W(S, 21, "#content", fo, hi);
|
|
1892
|
+
H = W(S, 0, "GemLightRouteElement", Oo, H);
|
|
1893
|
+
z(H, "createLocationStore", () => {
|
|
1894
|
+
const { path: s, query: t, hash: e, data: n } = x.getParams();
|
|
1895
|
+
return Wt({ path: s, query: t, hash: e, data: n, params: {} });
|
|
1799
1896
|
});
|
|
1800
|
-
|
|
1801
|
-
let e = null,
|
|
1802
|
-
|
|
1803
|
-
for (const i of
|
|
1897
|
+
z(H, "findRoute", (s = [], t) => {
|
|
1898
|
+
let e = null, n;
|
|
1899
|
+
Array.isArray(s) ? n = s : n = Object.values(s);
|
|
1900
|
+
for (const i of n)
|
|
1804
1901
|
if (i.pattern === "*")
|
|
1805
1902
|
e = i;
|
|
1806
1903
|
else {
|
|
1807
|
-
const
|
|
1808
|
-
if (
|
|
1809
|
-
return { route: i, params:
|
|
1904
|
+
const o = No(i.pattern, t);
|
|
1905
|
+
if (o)
|
|
1906
|
+
return { route: i, params: o };
|
|
1810
1907
|
}
|
|
1811
1908
|
return { route: e };
|
|
1812
1909
|
});
|
|
1813
|
-
|
|
1814
|
-
const
|
|
1910
|
+
T(S, 1, H);
|
|
1911
|
+
const Lh = le`
|
|
1815
1912
|
:host(:where(:not([hidden]))),
|
|
1816
1913
|
:not(:defined) {
|
|
1817
1914
|
display: contents;
|
|
1818
1915
|
}
|
|
1819
1916
|
`;
|
|
1820
|
-
|
|
1821
|
-
class
|
|
1822
|
-
}
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
var
|
|
1827
|
-
throw TypeError(
|
|
1828
|
-
},
|
|
1829
|
-
for (var i = 0,
|
|
1830
|
-
return
|
|
1831
|
-
},
|
|
1832
|
-
var a, c, l, d, f,
|
|
1833
|
-
return
|
|
1917
|
+
xo = [zt(), is(Lh)];
|
|
1918
|
+
class Qe extends (Lo = H) {
|
|
1919
|
+
}
|
|
1920
|
+
li = _o(Lo);
|
|
1921
|
+
Qe = W(li, 0, "GemRouteElement", xo, Qe);
|
|
1922
|
+
T(li, 1, Qe);
|
|
1923
|
+
var Ah = Object.create, ui = Object.defineProperty, Nh = Object.getOwnPropertyDescriptor, Ro = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), fe = (s) => {
|
|
1924
|
+
throw TypeError(s);
|
|
1925
|
+
}, Io = (s, t, e) => t in s ? ui(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, _r = (s, t) => ui(s, "name", { value: t, configurable: !0 }), Ho = (s) => [, , , Ah((s == null ? void 0 : s[Ro("metadata")]) ?? null)], Wo = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Re = (s) => s !== void 0 && typeof s != "function" ? fe("Function expected") : s, Rh = (s, t, e, n, i) => ({ kind: Wo[s], name: t, metadata: n, addInitializer: (o) => e._ ? fe("Already initialized") : i.push(Re(o || null)) }), Ih = (s, t) => Io(t, Ro("metadata"), s[3]), C = (s, t, e, n) => {
|
|
1926
|
+
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
1927
|
+
return n;
|
|
1928
|
+
}, R = (s, t, e, n, i, o) => {
|
|
1929
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = Wo[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && Nh(r < 4 ? i : { get [e]() {
|
|
1930
|
+
return ht(this, o);
|
|
1834
1931
|
}, set [e](u) {
|
|
1835
|
-
return
|
|
1932
|
+
return pr(this, o, u);
|
|
1836
1933
|
} }, e));
|
|
1837
|
-
|
|
1838
|
-
for (var b =
|
|
1839
|
-
d =
|
|
1840
|
-
return
|
|
1841
|
-
},
|
|
1842
|
-
function
|
|
1843
|
-
return !
|
|
1844
|
-
}
|
|
1845
|
-
const
|
|
1934
|
+
r ? h && r < 4 && _r(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : _r(i, e);
|
|
1935
|
+
for (var b = n.length - 1; b >= 0; b--)
|
|
1936
|
+
d = Rh(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => Hh(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? ht : Wh)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => pr(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? Re(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? fe("Object expected") : (Re(a = c.get) && (p.get = a), Re(a = c.set) && (p.set = a), Re(a = c.init) && w.unshift(a));
|
|
1937
|
+
return r || Ih(s, i), p && ui(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
1938
|
+
}, U = (s, t, e) => Io(s, typeof t != "symbol" ? t + "" : t, e), _i = (s, t, e) => t.has(s) || fe("Cannot " + e), Hh = (s, t) => Object(t) !== t ? fe('Cannot use the "in" operator on this value') : s.has(t), ht = (s, t, e) => (_i(s, t, "read from private field"), e ? e.call(s) : t.get(s)), Bt = (s, t, e) => t.has(s) ? fe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), pr = (s, t, e, n) => (_i(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), Wh = (s, t, e) => (_i(s, t, "access private method"), e), zo, Vo, Go, Do, Uo, Fo, qo, Bo, Ko, jo, Qo, Jo, Yo, Zo, mn, Xo, y, vt, Ie, ta, pi, gn, fi, vn, mi, ea, sa, na, $n, ia, X, gi;
|
|
1939
|
+
function fr(s) {
|
|
1940
|
+
return !s.startsWith("/");
|
|
1941
|
+
}
|
|
1942
|
+
const zh = le`
|
|
1846
1943
|
:host {
|
|
1847
1944
|
/* link default style */
|
|
1848
1945
|
cursor: pointer;
|
|
@@ -1857,38 +1954,39 @@ const hh = an`
|
|
|
1857
1954
|
color: unset;
|
|
1858
1955
|
}
|
|
1859
1956
|
`;
|
|
1860
|
-
|
|
1861
|
-
class
|
|
1957
|
+
Xo = [Vs(hh), is(zh), zt(), Gs({ focusable: !0 })];
|
|
1958
|
+
let N = class ra extends (mn = tt, Zo = [Gr], Yo = [B], Jo = [B], Qo = [B], jo = [B], Ko = [B], Bo = [B], qo = [Ws], Fo = [D], Uo = [D], Do = [D], Go = [D], Vo = [Be()], zo = [de()], mn) {
|
|
1862
1959
|
constructor() {
|
|
1863
|
-
super(...arguments), C(y, 5, this),
|
|
1864
|
-
var
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
if (
|
|
1960
|
+
super(...arguments), C(y, 5, this), Bt(this, vt), U(this, "href", C(y, 12, this)), C(y, 15, this), U(this, "target", C(y, 16, this)), C(y, 19, this), U(this, "path", C(y, 20, this)), C(y, 23, this), U(this, "query", C(y, 24, this)), C(y, 27, this), U(this, "hash", C(y, 28, this)), C(y, 31, this), U(this, "hint", C(y, 32, this)), C(y, 35, this), U(this, "preload", C(y, 36, this)), C(y, 39, this), U(this, "route", C(y, 40, this)), C(y, 43, this), U(this, "options", C(y, 44, this)), C(y, 47, this), U(this, "routeOptions", C(y, 48, this)), C(y, 51, this), U(this, "prepare", C(y, 52, this)), C(y, 55, this), Bt(this, pi, async (t) => {
|
|
1961
|
+
var a;
|
|
1962
|
+
t.preventDefault();
|
|
1963
|
+
const e = this._getLocationString();
|
|
1964
|
+
if (!e) return;
|
|
1965
|
+
if (fr(e))
|
|
1868
1966
|
switch (this.target) {
|
|
1869
1967
|
case "_self":
|
|
1870
|
-
window.location.href =
|
|
1968
|
+
window.location.href = e;
|
|
1871
1969
|
return;
|
|
1872
1970
|
case "_parent":
|
|
1873
|
-
window.parent.location.href =
|
|
1971
|
+
window.parent.location.href = e;
|
|
1874
1972
|
return;
|
|
1875
1973
|
case "_top":
|
|
1876
|
-
window.top.location.href =
|
|
1974
|
+
window.top.location.href = e;
|
|
1877
1975
|
return;
|
|
1878
1976
|
default:
|
|
1879
|
-
window.open(
|
|
1977
|
+
window.open(e);
|
|
1880
1978
|
return;
|
|
1881
1979
|
}
|
|
1882
|
-
const { path:
|
|
1883
|
-
if (
|
|
1884
|
-
if (await ((
|
|
1885
|
-
x.pushIgnoreCloseHandle(
|
|
1980
|
+
const { path: n, query: i, hash: o } = x.getParams();
|
|
1981
|
+
if (n + i + o !== e)
|
|
1982
|
+
if (await ((a = this.prepare) == null ? void 0 : a.call(this)), this.route)
|
|
1983
|
+
x.pushIgnoreCloseHandle(xh(this.route, ht(this, vt, Ie)));
|
|
1886
1984
|
else if (this.href) {
|
|
1887
|
-
const
|
|
1985
|
+
const c = new URL(e, location.origin);
|
|
1888
1986
|
x.pushIgnoreCloseHandle({
|
|
1889
|
-
path:
|
|
1890
|
-
query:
|
|
1891
|
-
hash:
|
|
1987
|
+
path: c.pathname,
|
|
1988
|
+
query: c.search,
|
|
1989
|
+
hash: c.hash
|
|
1892
1990
|
});
|
|
1893
1991
|
} else
|
|
1894
1992
|
x.pushIgnoreCloseHandle({
|
|
@@ -1896,19 +1994,16 @@ class W extends (cs = B, xo = [D], Mo = [D], Oo = [D], ko = [D], To = [D], Po =
|
|
|
1896
1994
|
query: this.query,
|
|
1897
1995
|
hash: this.hash
|
|
1898
1996
|
});
|
|
1899
|
-
}),
|
|
1997
|
+
}), Bt(this, gn, () => {
|
|
1900
1998
|
const t = this._getLocationString();
|
|
1901
|
-
return
|
|
1902
|
-
}),
|
|
1903
|
-
var t, e,
|
|
1904
|
-
(t = this.route) == null || t.content, (
|
|
1905
|
-
}),
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
tabindex="-1"
|
|
1910
|
-
><slot></slot
|
|
1911
|
-
></a>`)), C(y, 59, this);
|
|
1999
|
+
return fr(t) ? t : new URL(x.basePath + t, location.origin).toString();
|
|
2000
|
+
}), Bt(this, fi, () => {
|
|
2001
|
+
var t, e, n;
|
|
2002
|
+
(t = this.route) == null || t.content, (n = (e = this.route) == null ? void 0 : e.getContent) == null || n.call(e, {}, this.shadowRoot);
|
|
2003
|
+
}), Bt(this, mi, C(y, 56, this, () => {
|
|
2004
|
+
const t = ht(this, vt, ta) === "off" ? null : ht(this, gn).call(this);
|
|
2005
|
+
return ot`<a part=${ra.link} href=${t} tabindex="-1"><slot></slot></a>`;
|
|
2006
|
+
})), C(y, 59, this);
|
|
1912
2007
|
}
|
|
1913
2008
|
/**
|
|
1914
2009
|
* 如果该元素是外部链接返回 URL,否则返回路径(不包含 basePath)
|
|
@@ -1916,137 +2011,242 @@ class W extends (cs = B, xo = [D], Mo = [D], Oo = [D], ko = [D], To = [D], Po =
|
|
|
1916
2011
|
_getLocationString() {
|
|
1917
2012
|
var t, e;
|
|
1918
2013
|
if (this.route) {
|
|
1919
|
-
const
|
|
1920
|
-
return
|
|
2014
|
+
const n = ((t = ht(this, vt, Ie)) == null ? void 0 : t.query) || "", i = ((e = ht(this, vt, Ie)) == null ? void 0 : e.hash) || "";
|
|
2015
|
+
return di(this.route, ht(this, vt, Ie)) + n + i;
|
|
1921
2016
|
} else {
|
|
1922
|
-
const
|
|
1923
|
-
return
|
|
2017
|
+
const n = this.href || this.path + this.query + this.hash, { path: i, query: o } = x.getParams();
|
|
2018
|
+
return n.startsWith("#") ? `${i}${o}${n}` : n.startsWith("?") ? `${i}${n}` : n.startsWith(".") ? xr(i, n) : n;
|
|
1924
2019
|
}
|
|
1925
2020
|
}
|
|
1926
|
-
}
|
|
1927
|
-
y =
|
|
1928
|
-
|
|
1929
|
-
|
|
2021
|
+
};
|
|
2022
|
+
y = Ho(mn);
|
|
2023
|
+
vt = /* @__PURE__ */ new WeakSet();
|
|
2024
|
+
Ie = function() {
|
|
1930
2025
|
return this.routeOptions || this.options;
|
|
1931
2026
|
};
|
|
1932
|
-
|
|
2027
|
+
ta = function() {
|
|
1933
2028
|
return this.hint || "on";
|
|
1934
2029
|
};
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
2030
|
+
pi = /* @__PURE__ */ new WeakMap();
|
|
2031
|
+
gn = /* @__PURE__ */ new WeakMap();
|
|
2032
|
+
fi = /* @__PURE__ */ new WeakMap();
|
|
2033
|
+
vn = function() {
|
|
2034
|
+
this.addEventListener("click", ht(this, pi)), this.addEventListener("pointerenter", ht(this, fi));
|
|
2035
|
+
};
|
|
2036
|
+
mi = /* @__PURE__ */ new WeakMap();
|
|
2037
|
+
vn = R(y, 17, "#init", Vo, vt, vn);
|
|
2038
|
+
R(y, 13, "link", Zo, N);
|
|
2039
|
+
R(y, 5, "href", Yo, N);
|
|
2040
|
+
R(y, 5, "target", Jo, N);
|
|
2041
|
+
R(y, 5, "path", Qo, N);
|
|
2042
|
+
R(y, 5, "query", jo, N);
|
|
2043
|
+
R(y, 5, "hash", Ko, N);
|
|
2044
|
+
R(y, 5, "hint", Bo, N);
|
|
2045
|
+
R(y, 5, "preload", qo, N);
|
|
2046
|
+
R(y, 5, "route", Fo, N);
|
|
2047
|
+
R(y, 5, "options", Uo, N);
|
|
2048
|
+
R(y, 5, "routeOptions", Do, N);
|
|
2049
|
+
R(y, 5, "prepare", Go, N);
|
|
2050
|
+
R(y, 21, "#content", zo, mi);
|
|
2051
|
+
N = R(y, 0, "GemLinkElement", Xo, N);
|
|
2052
|
+
U(N, "link", C(y, 8, N)), C(y, 11, N);
|
|
2053
|
+
C(y, 1, N);
|
|
2054
|
+
let oa = N;
|
|
2055
|
+
ia = [Vs(x.store)];
|
|
2056
|
+
class ae extends ($n = oa, na = [B], sa = [zs], ea = [ft()], $n) {
|
|
2057
|
+
constructor() {
|
|
2058
|
+
super(...arguments), U(this, "pattern", C(X, 8, this)), C(X, 11, this), U(this, "active", C(X, 12, this)), C(X, 15, this), Bt(this, gi, C(X, 16, this, () => {
|
|
2059
|
+
const { path: t, query: e, hash: n } = x.getParams(), i = this.pattern && No(this.pattern, t);
|
|
2060
|
+
this.active = !!i || t + e + n === this._getLocationString();
|
|
2061
|
+
})), C(X, 19, this);
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
X = Ho($n);
|
|
2065
|
+
gi = /* @__PURE__ */ new WeakMap();
|
|
2066
|
+
R(X, 5, "pattern", na, ae);
|
|
2067
|
+
R(X, 5, "active", sa, ae);
|
|
2068
|
+
R(X, 21, "#updateState", ea, gi);
|
|
2069
|
+
ae = R(X, 0, "GemActiveLinkElement", ia, ae);
|
|
2070
|
+
C(X, 1, ae);
|
|
2071
|
+
customElements.define("gem-link", oa);
|
|
2072
|
+
customElements.define("gem-active-link", ae);
|
|
2073
|
+
var Vh = Object.create, vi = Object.defineProperty, Gh = Object.getOwnPropertyDescriptor, aa = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), me = (s) => {
|
|
2074
|
+
throw TypeError(s);
|
|
2075
|
+
}, ca = (s, t, e) => t in s ? vi(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, mr = (s, t) => vi(s, "name", { value: t, configurable: !0 }), Dh = (s) => [, , , Vh((s == null ? void 0 : s[aa("metadata")]) ?? null)], ha = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], He = (s) => s !== void 0 && typeof s != "function" ? me("Function expected") : s, Uh = (s, t, e, n, i) => ({ kind: ha[s], name: t, metadata: n, addInitializer: (o) => e._ ? me("Already initialized") : i.push(He(o || null)) }), la = (s, t) => ca(t, aa("metadata"), s[3]), gt = (s, t, e, n) => {
|
|
2076
|
+
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
2077
|
+
return n;
|
|
2078
|
+
}, Fs = (s, t, e, n, i, o) => {
|
|
2079
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = ha[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && Gh(r < 4 ? i : { get [e]() {
|
|
2080
|
+
return $t(this, o);
|
|
2081
|
+
}, set [e](u) {
|
|
2082
|
+
return Sn(this, o, u);
|
|
2083
|
+
} }, e));
|
|
2084
|
+
r ? h && r < 4 && mr(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : mr(i, e);
|
|
2085
|
+
for (var b = n.length - 1; b >= 0; b--)
|
|
2086
|
+
d = Uh(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => Fh(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? $t : qh)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => Sn(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? He(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? me("Object expected") : (He(a = c.get) && (p.get = a), He(a = c.set) && (p.set = a), He(a = c.init) && w.unshift(a));
|
|
2087
|
+
return r || la(s, i), p && vi(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
2088
|
+
}, gr = (s, t, e) => ca(s, typeof t != "symbol" ? t + "" : t, e), $i = (s, t, e) => t.has(s) || me("Cannot " + e), Fh = (s, t) => Object(t) !== t ? me('Cannot use the "in" operator on this value') : s.has(t), $t = (s, t, e) => ($i(s, t, "read from private field"), e ? e.call(s) : t.get(s)), Dt = (s, t, e) => t.has(s) ? me("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), Sn = (s, t, e, n) => ($i(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), qh = (s, t, e) => ($i(s, t, "access private method"), e), da, ua, _a, pa, yn, F, wn, fa, Si, _s, En, We, yi;
|
|
2089
|
+
const Bh = "gem-reflect-start", ma = "gem-reflect-end", vr = (s) => new Comment(s), Kh = (s) => {
|
|
2090
|
+
const t = [];
|
|
2091
|
+
let e = s;
|
|
2092
|
+
for (; e && (t.push(e), e.nodeValue !== ma); )
|
|
2093
|
+
e = e.nextSibling;
|
|
2094
|
+
return t;
|
|
1941
2095
|
};
|
|
1942
|
-
|
|
1943
|
-
ds = N(y, 17, "#init", vo, pt, ds);
|
|
1944
|
-
N(y, 5, "href", xo, W);
|
|
1945
|
-
N(y, 5, "target", Mo, W);
|
|
1946
|
-
N(y, 5, "path", Oo, W);
|
|
1947
|
-
N(y, 5, "query", ko, W);
|
|
1948
|
-
N(y, 5, "hash", To, W);
|
|
1949
|
-
N(y, 5, "hint", Po, W);
|
|
1950
|
-
N(y, 5, "preload", bo, W);
|
|
1951
|
-
N(y, 5, "route", Co, W);
|
|
1952
|
-
N(y, 5, "options", Eo, W);
|
|
1953
|
-
N(y, 5, "routeOptions", So, W);
|
|
1954
|
-
N(y, 5, "prepare", yo, W);
|
|
1955
|
-
N(y, 5, "link", wo, W);
|
|
1956
|
-
N(y, 21, "#content", $o, ni);
|
|
1957
|
-
W = N(y, 0, "GemLinkElement", Ao, W);
|
|
1958
|
-
C(y, 1, W);
|
|
1959
|
-
Ho = [Wn(x.store)];
|
|
1960
|
-
class oe extends (us = W, Io = [D], Ro = [In], No = [wt()], us) {
|
|
2096
|
+
class qs extends (yn = tt, pa = [B], _a = [D], ua = [qn()], da = [ft((t) => [t.target])], yn) {
|
|
1961
2097
|
constructor() {
|
|
1962
|
-
super(...arguments),
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
}
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
2098
|
+
super(...arguments), Dt(this, wn), gr(this, "method", gt(F, 8, this)), gt(F, 11, this), gr(this, "target", gt(F, 12, this, document.head)), gt(F, 15, this), Dt(this, Si, gt(F, 16, this, () => {
|
|
2099
|
+
this.hidden = !0;
|
|
2100
|
+
})), gt(F, 19, this), Dt(this, _s, vr(Bh)), Dt(this, En, vr(ma)), Dt(this, We), Dt(this, yi, gt(F, 20, this, () => (($t(this, We) || [$t(this, _s), ...this.childNodes, $t(this, En)]).forEach((t, e, n) => {
|
|
2101
|
+
const i = n[e - 1];
|
|
2102
|
+
i ? i.after(t) : this.target[$t(this, wn, fa)](t);
|
|
2103
|
+
}), () => {
|
|
2104
|
+
Sn(this, We, Kh($t(this, _s))), $t(this, We).forEach((t) => t.remove());
|
|
2105
|
+
}))), gt(F, 23, this);
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
F = Dh(yn);
|
|
2109
|
+
wn = /* @__PURE__ */ new WeakSet();
|
|
2110
|
+
fa = function() {
|
|
2111
|
+
return this.method || "append";
|
|
2112
|
+
};
|
|
2113
|
+
Si = /* @__PURE__ */ new WeakMap();
|
|
2114
|
+
_s = /* @__PURE__ */ new WeakMap();
|
|
2115
|
+
En = /* @__PURE__ */ new WeakMap();
|
|
2116
|
+
We = /* @__PURE__ */ new WeakMap();
|
|
2117
|
+
yi = /* @__PURE__ */ new WeakMap();
|
|
2118
|
+
Fs(F, 5, "method", pa, qs);
|
|
2119
|
+
Fs(F, 5, "target", _a, qs);
|
|
2120
|
+
Fs(F, 21, "#init", ua, Si);
|
|
2121
|
+
Fs(F, 21, "#changeTarget", da, yi);
|
|
2122
|
+
la(F, qs);
|
|
2123
|
+
customElements.define("gem-reflect", qs);
|
|
2124
|
+
customElements.define("gem-route", Qe);
|
|
2125
|
+
customElements.define("gem-light-route", H);
|
|
2126
|
+
var jh = Object.create, wi = Object.defineProperty, Qh = Object.getOwnPropertyDescriptor, ga = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), ge = (s) => {
|
|
2127
|
+
throw TypeError(s);
|
|
2128
|
+
}, va = (s, t, e) => t in s ? wi(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, $r = (s, t) => wi(s, "name", { value: t, configurable: !0 }), Jh = (s) => [, , , jh((s == null ? void 0 : s[ga("metadata")]) ?? null)], $a = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], ze = (s) => s !== void 0 && typeof s != "function" ? ge("Function expected") : s, Yh = (s, t, e, n, i) => ({ kind: $a[s], name: t, metadata: n, addInitializer: (o) => e._ ? ge("Already initialized") : i.push(ze(o || null)) }), Zh = (s, t) => va(t, ga("metadata"), s[3]), j = (s, t, e, n) => {
|
|
2129
|
+
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
2130
|
+
return n;
|
|
2131
|
+
}, Vt = (s, t, e, n, i, o) => {
|
|
2132
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = $a[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && Qh(r < 4 ? i : { get [e]() {
|
|
2133
|
+
return Cn(this, o);
|
|
1987
2134
|
}, set [e](u) {
|
|
1988
|
-
return
|
|
2135
|
+
return Sr(this, o, u);
|
|
1989
2136
|
} }, e));
|
|
1990
|
-
|
|
1991
|
-
for (var b =
|
|
1992
|
-
d =
|
|
1993
|
-
return
|
|
1994
|
-
},
|
|
1995
|
-
let
|
|
1996
|
-
const
|
|
1997
|
-
clearTimeout(
|
|
2137
|
+
r ? h && r < 4 && $r(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : $r(i, e);
|
|
2138
|
+
for (var b = n.length - 1; b >= 0; b--)
|
|
2139
|
+
d = Yh(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => Xh(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? Cn : tl)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => Sr(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? ze(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? ge("Object expected") : (ze(a = c.get) && (p.get = a), ze(a = c.set) && (p.set = a), ze(a = c.init) && w.unshift(a));
|
|
2140
|
+
return r || Zh(s, i), p && wi(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
2141
|
+
}, ps = (s, t, e) => va(s, typeof t != "symbol" ? t + "" : t, e), Ei = (s, t, e) => t.has(s) || ge("Cannot " + e), Xh = (s, t) => Object(t) !== t ? ge('Cannot use the "in" operator on this value') : s.has(t), Cn = (s, t, e) => (Ei(s, t, "read from private field"), e ? e.call(s) : t.get(s)), hs = (s, t, e) => t.has(s) ? ge("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), Sr = (s, t, e, n) => (Ei(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), tl = (s, t, e) => (Ei(s, t, "access private method"), e), Sa, ya, wa, Ea, Ca, ba, bn, Ta, L, Ci, Tn, bi, Ti;
|
|
2142
|
+
let yr = 0;
|
|
2143
|
+
const wr = (s) => {
|
|
2144
|
+
clearTimeout(yr), yr = setTimeout(() => document.title = s);
|
|
1998
2145
|
};
|
|
1999
|
-
function
|
|
2000
|
-
const
|
|
2001
|
-
|
|
2146
|
+
function el(s, t = "", e = "") {
|
|
2147
|
+
const n = It.title || s;
|
|
2148
|
+
n && n !== It.defaultTitle ? wr(t + (kn.title = n) + e) : wr(kn.title = It.defaultTitle);
|
|
2002
2149
|
}
|
|
2003
|
-
|
|
2004
|
-
let
|
|
2150
|
+
Ta = [zt()];
|
|
2151
|
+
let bt = class ka extends (bn = tt, ba = [B], Ca = [B], Ea = [Ws], wa = [ft((t) => [t.inert])], ya = [Be()], Sa = [de()], bn) {
|
|
2005
2152
|
constructor() {
|
|
2006
|
-
super(...arguments),
|
|
2007
|
-
|
|
2008
|
-
})), j(
|
|
2153
|
+
super(...arguments), ps(this, "prefix", j(L, 8, this)), j(L, 11, this), ps(this, "suffix", j(L, 12, this)), j(L, 15, this), ps(this, "inert", j(L, 16, this)), j(L, 19, this), hs(this, Ci, j(L, 20, this, () => !this.inert && mt(It, this.update))), j(L, 23, this), hs(this, Tn, new MutationObserver(() => this.update())), hs(this, bi, j(L, 24, this, () => {
|
|
2154
|
+
Cn(this, Tn).observe(this, { characterData: !0, childList: !0, subtree: !0 });
|
|
2155
|
+
})), j(L, 27, this), hs(this, Ti, j(L, 28, this, () => {
|
|
2009
2156
|
var t;
|
|
2010
|
-
return
|
|
2011
|
-
})), j(
|
|
2157
|
+
return el((t = this.textContent) == null ? void 0 : t.trim(), this.prefix, this.suffix), ot`${ka.title}`;
|
|
2158
|
+
})), j(L, 31, this);
|
|
2012
2159
|
}
|
|
2013
2160
|
static setTitle(t) {
|
|
2014
2161
|
It({ title: t });
|
|
2015
2162
|
}
|
|
2016
2163
|
};
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
j(
|
|
2031
|
-
let
|
|
2032
|
-
customElements.define("gem-title",
|
|
2033
|
-
var
|
|
2034
|
-
throw TypeError(
|
|
2035
|
-
},
|
|
2036
|
-
for (var i = 0,
|
|
2037
|
-
return
|
|
2038
|
-
},
|
|
2039
|
-
var a, c, l, d, f,
|
|
2040
|
-
return
|
|
2164
|
+
L = Jh(bn);
|
|
2165
|
+
Ci = /* @__PURE__ */ new WeakMap();
|
|
2166
|
+
Tn = /* @__PURE__ */ new WeakMap();
|
|
2167
|
+
bi = /* @__PURE__ */ new WeakMap();
|
|
2168
|
+
Ti = /* @__PURE__ */ new WeakMap();
|
|
2169
|
+
Vt(L, 5, "prefix", ba, bt);
|
|
2170
|
+
Vt(L, 5, "suffix", Ca, bt);
|
|
2171
|
+
Vt(L, 5, "inert", Ea, bt);
|
|
2172
|
+
Vt(L, 21, "#connectStore", wa, Ci);
|
|
2173
|
+
Vt(L, 21, "#obTextContent", ya, bi);
|
|
2174
|
+
Vt(L, 21, "#content", Sa, Ti);
|
|
2175
|
+
bt = Vt(L, 0, "GemTitleElement", Ta, bt);
|
|
2176
|
+
ps(bt, "title", document.title);
|
|
2177
|
+
j(L, 1, bt);
|
|
2178
|
+
let kn = bt;
|
|
2179
|
+
customElements.define("gem-title", kn);
|
|
2180
|
+
var sl = Object.create, ki = Object.defineProperty, nl = Object.getOwnPropertyDescriptor, Pa = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), ve = (s) => {
|
|
2181
|
+
throw TypeError(s);
|
|
2182
|
+
}, Ma = (s, t, e) => t in s ? ki(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, Er = (s, t) => ki(s, "name", { value: t, configurable: !0 }), il = (s) => [, , , sl((s == null ? void 0 : s[Pa("metadata")]) ?? null)], Oa = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Ve = (s) => s !== void 0 && typeof s != "function" ? ve("Function expected") : s, rl = (s, t, e, n, i) => ({ kind: Oa[s], name: t, metadata: n, addInitializer: (o) => e._ ? ve("Already initialized") : i.push(Ve(o || null)) }), ol = (s, t) => Ma(t, Pa("metadata"), s[3]), lt = (s, t, e, n) => {
|
|
2183
|
+
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
2184
|
+
return n;
|
|
2185
|
+
}, os = (s, t, e, n, i, o) => {
|
|
2186
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = Oa[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && nl(r < 4 ? i : { get [e]() {
|
|
2187
|
+
return Pn(this, o);
|
|
2188
|
+
}, set [e](u) {
|
|
2189
|
+
return br(this, o, u);
|
|
2190
|
+
} }, e));
|
|
2191
|
+
r ? h && r < 4 && Er(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : Er(i, e);
|
|
2192
|
+
for (var b = n.length - 1; b >= 0; b--)
|
|
2193
|
+
d = rl(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => al(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? Pn : cl)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => br(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? Ve(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? ve("Object expected") : (Ve(a = c.get) && (p.get = a), Ve(a = c.set) && (p.set = a), Ve(a = c.init) && w.unshift(a));
|
|
2194
|
+
return r || ol(s, i), p && ki(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
2195
|
+
}, Cr = (s, t, e) => Ma(s, typeof t != "symbol" ? t + "" : t, e), Pi = (s, t, e) => t.has(s) || ve("Cannot " + e), al = (s, t) => Object(t) !== t ? ve('Cannot use the "in" operator on this value') : s.has(t), Pn = (s, t, e) => (Pi(s, t, "read from private field"), e ? e.call(s) : t.get(s)), sn = (s, t, e) => t.has(s) ? ve("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), br = (s, t, e, n) => (Pi(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), cl = (s, t, e) => (Pi(s, t, "access private method"), e), xa, La, Aa, Na, Mn, Ra, G, On, Ia, Mi, Oi;
|
|
2196
|
+
const hl = le`
|
|
2197
|
+
:host(:where(:not([hidden]))) {
|
|
2198
|
+
display: contents;
|
|
2199
|
+
}
|
|
2200
|
+
`;
|
|
2201
|
+
Ra = [zt(), is(hl)];
|
|
2202
|
+
class ce extends (Mn = tt, Na = [B], Aa = [D], La = [ft()], xa = [de()], Mn) {
|
|
2203
|
+
constructor() {
|
|
2204
|
+
super(...arguments), sn(this, On), Cr(this, "html", lt(G, 8, this)), lt(G, 11, this), Cr(this, "styles", lt(G, 12, this)), lt(G, 15, this), sn(this, Mi, lt(G, 16, this, () => {
|
|
2205
|
+
const t = this.shadowRoot.adoptedStyleSheets;
|
|
2206
|
+
return this.shadowRoot.adoptedStyleSheets = t.concat(Pn(this, On, Ia)), () => {
|
|
2207
|
+
this.shadowRoot.adoptedStyleSheets = t;
|
|
2208
|
+
};
|
|
2209
|
+
})), lt(G, 19, this), sn(this, Oi, lt(G, 20, this, () => {
|
|
2210
|
+
this.shadowRoot.innerHTML = this.html;
|
|
2211
|
+
})), lt(G, 23, this);
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
G = il(Mn);
|
|
2215
|
+
On = /* @__PURE__ */ new WeakSet();
|
|
2216
|
+
Ia = function() {
|
|
2217
|
+
if (!this.styles) return [];
|
|
2218
|
+
if (typeof this.styles == "string") {
|
|
2219
|
+
const s = new CSSStyleSheet();
|
|
2220
|
+
return s.replaceSync(this.styles), [s];
|
|
2221
|
+
} else
|
|
2222
|
+
return [this.styles].flat().map((s) => s[Et].getStyle());
|
|
2223
|
+
};
|
|
2224
|
+
Mi = /* @__PURE__ */ new WeakMap();
|
|
2225
|
+
Oi = /* @__PURE__ */ new WeakMap();
|
|
2226
|
+
os(G, 5, "html", Na, ce);
|
|
2227
|
+
os(G, 5, "styles", Aa, ce);
|
|
2228
|
+
os(G, 21, "#adoptStyles", La, Mi);
|
|
2229
|
+
os(G, 21, "#content", xa, Oi);
|
|
2230
|
+
ce = os(G, 0, "GemUnsafeElement", Ra, ce);
|
|
2231
|
+
lt(G, 1, ce);
|
|
2232
|
+
customElements.define("gem-unsafe", ce);
|
|
2233
|
+
var ll = Object.create, xi = Object.defineProperty, dl = Object.getOwnPropertyDescriptor, Ha = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), $e = (s) => {
|
|
2234
|
+
throw TypeError(s);
|
|
2235
|
+
}, Wa = (s, t, e) => t in s ? xi(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, Tr = (s, t) => xi(s, "name", { value: t, configurable: !0 }), ul = (s) => [, , , ll((s == null ? void 0 : s[Ha("metadata")]) ?? null)], za = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Ge = (s) => s !== void 0 && typeof s != "function" ? $e("Function expected") : s, _l = (s, t, e, n, i) => ({ kind: za[s], name: t, metadata: n, addInitializer: (o) => e._ ? $e("Already initialized") : i.push(Ge(o || null)) }), pl = (s, t) => Wa(t, Ha("metadata"), s[3]), st = (s, t, e, n) => {
|
|
2236
|
+
for (var i = 0, o = s[t >> 1], a = o && o.length; i < a; i++) t & 1 ? o[i].call(e) : n = o[i].call(e, n);
|
|
2237
|
+
return n;
|
|
2238
|
+
}, Se = (s, t, e, n, i, o) => {
|
|
2239
|
+
var a, c, l, d, f, r = t & 7, m = !!(t & 8), h = !!(t & 16), g = r > 3 ? s.length + 1 : r ? m ? 1 : 2 : 0, $ = za[r + 5], w = r > 3 && (s[g - 1] = []), k = s[g] || (s[g] = []), p = r && (!h && !m && (i = i.prototype), r < 5 && (r > 3 || !h) && dl(r < 4 ? i : { get [e]() {
|
|
2240
|
+
return xn(this, o);
|
|
2041
2241
|
}, set [e](u) {
|
|
2042
|
-
return
|
|
2242
|
+
return Pr(this, o, u);
|
|
2043
2243
|
} }, e));
|
|
2044
|
-
|
|
2045
|
-
for (var b =
|
|
2046
|
-
d =
|
|
2047
|
-
return
|
|
2048
|
-
},
|
|
2049
|
-
const
|
|
2244
|
+
r ? h && r < 4 && Tr(o, (r > 2 ? "set " : r > 1 ? "get " : "") + e) : Tr(i, e);
|
|
2245
|
+
for (var b = n.length - 1; b >= 0; b--)
|
|
2246
|
+
d = _l(r, e, l = {}, s[3], k), r && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => fl(i, u) : (u) => e in u }, r ^ 3 && (f.get = h ? (u) => (r ^ 1 ? xn : ml)(u, i, r ^ 4 ? o : p.get) : (u) => u[e]), r > 2 && (f.set = h ? (u, P) => Pr(u, i, P, r ^ 4 ? o : p.set) : (u, P) => u[e] = P)), c = (0, n[b])(r ? r < 4 ? h ? o : p[$] : r > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, r ^ 4 || c === void 0 ? Ge(c) && (r > 4 ? w.unshift(c) : r ? h ? o = c : p[$] = c : i = c) : typeof c != "object" || c === null ? $e("Object expected") : (Ge(a = c.get) && (p.get = a), Ge(a = c.set) && (p.set = a), Ge(a = c.init) && w.unshift(a));
|
|
2247
|
+
return r || pl(s, i), p && xi(i, e, p), h ? r ^ 4 ? o : p : i;
|
|
2248
|
+
}, ls = (s, t, e) => Wa(s, typeof t != "symbol" ? t + "" : t, e), Li = (s, t, e) => t.has(s) || $e("Cannot " + e), fl = (s, t) => Object(t) !== t ? $e('Cannot use the "in" operator on this value') : s.has(t), xn = (s, t, e) => (Li(s, t, "read from private field"), e ? e.call(s) : t.get(s)), kr = (s, t, e) => t.has(s) ? $e("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), Pr = (s, t, e, n) => (Li(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), ml = (s, t, e) => (Li(s, t, "access private method"), e), Va, Ga, Da, Ua, Fa, Ln, qa, I, An, Ai;
|
|
2249
|
+
const gl = le`
|
|
2050
2250
|
:host(:where(:not([hidden]))) {
|
|
2051
2251
|
position: relative;
|
|
2052
2252
|
display: inline-flex;
|
|
@@ -2056,329 +2256,115 @@ const bh = an`
|
|
|
2056
2256
|
width: 100%;
|
|
2057
2257
|
height: 100%;
|
|
2058
2258
|
}
|
|
2059
|
-
`,
|
|
2060
|
-
|
|
2061
|
-
class
|
|
2259
|
+
`, Mr = /* @__PURE__ */ new Map();
|
|
2260
|
+
qa = [zt(), is(gl)];
|
|
2261
|
+
class Tt extends (Ln = tt, Fa = [B], Ua = [D], Da = [D], Ga = [zs], Va = [de()], Ln) {
|
|
2062
2262
|
constructor() {
|
|
2063
|
-
super(...arguments),
|
|
2263
|
+
super(...arguments), ls(this, "selector", st(I, 8, this)), st(I, 11, this), ls(this, "root", st(I, 12, this)), st(I, 15, this), ls(this, "element", st(I, 16, this)), st(I, 19, this), ls(this, "active", st(I, 20, this)), st(I, 23, this), kr(this, An, () => {
|
|
2064
2264
|
const t = this.element || (this.selector ? (this.root || document).querySelector(this.selector) : null);
|
|
2065
2265
|
if (typeof t == "string") {
|
|
2066
|
-
let e =
|
|
2067
|
-
return e || (e = document.createElement("template"), e.innerHTML = t,
|
|
2266
|
+
let e = Mr.get(t);
|
|
2267
|
+
return e || (e = document.createElement("template"), e.innerHTML = t, Mr.set(t, e)), e.content.cloneNode(!0);
|
|
2068
2268
|
} else return t instanceof HTMLTemplateElement ? t.content.cloneNode(!0) : t == null ? void 0 : t.cloneNode(!0);
|
|
2069
|
-
}),
|
|
2070
|
-
}
|
|
2071
|
-
}
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
customElements.define("gem-use",
|
|
2083
|
-
var
|
|
2084
|
-
|
|
2085
|
-
}, ra = (n, t, e) => t in n ? ui(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, or = (n, t) => ui(n, "name", { value: t, configurable: !0 }), kh = (n) => [, , , Ph((n == null ? void 0 : n[ia("metadata")]) ?? null)], oa = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Re = (n) => n !== void 0 && typeof n != "function" ? me("Function expected") : n, Oh = (n, t, e, s, i) => ({ kind: oa[n], name: t, metadata: s, addInitializer: (r) => e._ ? me("Already initialized") : i.push(Re(r || null)) }), Mh = (n, t) => ra(t, ia("metadata"), n[3]), kt = (n, t, e, s) => {
|
|
2086
|
-
for (var i = 0, r = n[t >> 1], a = r && r.length; i < a; i++) t & 1 ? r[i].call(e) : s = r[i].call(e, s);
|
|
2087
|
-
return s;
|
|
2088
|
-
}, Vn = (n, t, e, s, i, r) => {
|
|
2089
|
-
var a, c, l, d, f, o = t & 7, m = !!(t & 8), h = !!(t & 16), g = o > 3 ? n.length + 1 : o ? m ? 1 : 2 : 0, v = oa[o + 5], S = o > 3 && (n[g - 1] = []), T = n[g] || (n[g] = []), p = o && (!h && !m && (i = i.prototype), o < 5 && (o > 3 || !h) && Th(o < 4 ? i : { get [e]() {
|
|
2090
|
-
return cr(this, r);
|
|
2091
|
-
}, set [e](u) {
|
|
2092
|
-
return hr(this, r, u);
|
|
2093
|
-
} }, e));
|
|
2094
|
-
o ? h && o < 4 && or(r, (o > 2 ? "set " : o > 1 ? "get " : "") + e) : or(i, e);
|
|
2095
|
-
for (var b = s.length - 1; b >= 0; b--)
|
|
2096
|
-
d = Oh(o, e, l = {}, n[3], T), o && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => xh(i, u) : (u) => e in u }, o ^ 3 && (f.get = h ? (u) => (o ^ 1 ? cr : Lh)(u, i, o ^ 4 ? r : p.get) : (u) => u[e]), o > 2 && (f.set = h ? (u, k) => hr(u, i, k, o ^ 4 ? r : p.set) : (u, k) => u[e] = k)), c = (0, s[b])(o ? o < 4 ? h ? r : p[v] : o > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, o ^ 4 || c === void 0 ? Re(c) && (o > 4 ? S.unshift(c) : o ? h ? r = c : p[v] = c : i = c) : typeof c != "object" || c === null ? me("Object expected") : (Re(a = c.get) && (p.get = a), Re(a = c.set) && (p.set = a), Re(a = c.init) && S.unshift(a));
|
|
2097
|
-
return o || Mh(n, i), p && ui(i, e, p), h ? o ^ 4 ? r : p : i;
|
|
2098
|
-
}, ar = (n, t, e) => ra(n, typeof t != "symbol" ? t + "" : t, e), _i = (n, t, e) => t.has(n) || me("Cannot " + e), xh = (n, t) => Object(t) !== t ? me('Cannot use the "in" operator on this value') : n.has(t), cr = (n, t, e) => (_i(n, t, "read from private field"), e ? e.call(n) : t.get(n)), Ah = (n, t, e) => t.has(n) ? me("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), hr = (n, t, e, s) => (_i(n, t, "write to private field"), s ? s.call(n, e) : t.set(n, e), e), Lh = (n, t, e) => (_i(n, t, "access private method"), e), aa, ca, ha, vs, la, X, pi;
|
|
2099
|
-
la = [Vt()];
|
|
2100
|
-
class ae extends (vs = B, ha = [D], ca = [D], aa = [le()], vs) {
|
|
2101
|
-
constructor() {
|
|
2102
|
-
super(...arguments), ar(this, "content", kt(X, 8, this)), kt(X, 11, this), ar(this, "contentcss", kt(X, 12, this)), kt(X, 15, this), Ah(this, pi, kt(X, 16, this, () => {
|
|
2103
|
-
const t = (
|
|
2104
|
-
/*html*/
|
|
2105
|
-
`
|
|
2106
|
-
<style>
|
|
2107
|
-
:host(:where(:not([hidden]))) {
|
|
2108
|
-
display: contents;
|
|
2109
|
-
}
|
|
2110
|
-
${this.contentcss}
|
|
2111
|
-
</style>
|
|
2112
|
-
`
|
|
2113
|
-
);
|
|
2114
|
-
this.shadowRoot.innerHTML = this.content + t.trim();
|
|
2115
|
-
})), kt(X, 19, this);
|
|
2116
|
-
}
|
|
2117
|
-
}
|
|
2118
|
-
X = kh(vs);
|
|
2119
|
-
pi = /* @__PURE__ */ new WeakMap();
|
|
2120
|
-
Vn(X, 5, "content", ha, ae);
|
|
2121
|
-
Vn(X, 5, "contentcss", ca, ae);
|
|
2122
|
-
Vn(X, 21, "#content", aa, pi);
|
|
2123
|
-
ae = Vn(X, 0, "GemUnsafeElement", la, ae);
|
|
2124
|
-
kt(X, 1, ae);
|
|
2125
|
-
customElements.define("gem-unsafe", ae);
|
|
2126
|
-
var Nh = Object.create, fi = Object.defineProperty, Rh = Object.getOwnPropertyDescriptor, da = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n), ge = (n) => {
|
|
2127
|
-
throw TypeError(n);
|
|
2128
|
-
}, ua = (n, t, e) => t in n ? fi(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, lr = (n, t) => fi(n, "name", { value: t, configurable: !0 }), Ih = (n) => [, , , Nh((n == null ? void 0 : n[da("metadata")]) ?? null)], _a = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Ie = (n) => n !== void 0 && typeof n != "function" ? ge("Function expected") : n, Hh = (n, t, e, s, i) => ({ kind: _a[n], name: t, metadata: s, addInitializer: (r) => e._ ? ge("Already initialized") : i.push(Ie(r || null)) }), pa = (n, t) => ua(t, da("metadata"), n[3]), _t = (n, t, e, s) => {
|
|
2129
|
-
for (var i = 0, r = n[t >> 1], a = r && r.length; i < a; i++) t & 1 ? r[i].call(e) : s = r[i].call(e, s);
|
|
2130
|
-
return s;
|
|
2131
|
-
}, Dn = (n, t, e, s, i, r) => {
|
|
2132
|
-
var a, c, l, d, f, o = t & 7, m = !!(t & 8), h = !!(t & 16), g = o > 3 ? n.length + 1 : o ? m ? 1 : 2 : 0, v = _a[o + 5], S = o > 3 && (n[g - 1] = []), T = n[g] || (n[g] = []), p = o && (!h && !m && (i = i.prototype), o < 5 && (o > 3 || !h) && Rh(o < 4 ? i : { get [e]() {
|
|
2133
|
-
return ft(this, r);
|
|
2134
|
-
}, set [e](u) {
|
|
2135
|
-
return ws(this, r, u);
|
|
2136
|
-
} }, e));
|
|
2137
|
-
o ? h && o < 4 && lr(r, (o > 2 ? "set " : o > 1 ? "get " : "") + e) : lr(i, e);
|
|
2138
|
-
for (var b = s.length - 1; b >= 0; b--)
|
|
2139
|
-
d = Hh(o, e, l = {}, n[3], T), o && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => Wh(i, u) : (u) => e in u }, o ^ 3 && (f.get = h ? (u) => (o ^ 1 ? ft : zh)(u, i, o ^ 4 ? r : p.get) : (u) => u[e]), o > 2 && (f.set = h ? (u, k) => ws(u, i, k, o ^ 4 ? r : p.set) : (u, k) => u[e] = k)), c = (0, s[b])(o ? o < 4 ? h ? r : p[v] : o > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, o ^ 4 || c === void 0 ? Ie(c) && (o > 4 ? S.unshift(c) : o ? h ? r = c : p[v] = c : i = c) : typeof c != "object" || c === null ? ge("Object expected") : (Ie(a = c.get) && (p.get = a), Ie(a = c.set) && (p.set = a), Ie(a = c.init) && S.unshift(a));
|
|
2140
|
-
return o || pa(n, i), p && fi(i, e, p), h ? o ^ 4 ? r : p : i;
|
|
2141
|
-
}, dr = (n, t, e) => ua(n, typeof t != "symbol" ? t + "" : t, e), mi = (n, t, e) => t.has(n) || ge("Cannot " + e), Wh = (n, t) => Object(t) !== t ? ge('Cannot use the "in" operator on this value') : n.has(t), ft = (n, t, e) => (mi(n, t, "read from private field"), e ? e.call(n) : t.get(n)), Gt = (n, t, e) => t.has(n) ? ge("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), ws = (n, t, e, s) => (mi(n, t, "write to private field"), s ? s.call(n, e) : t.set(n, e), e), zh = (n, t, e) => (mi(n, t, "access private method"), e), fa, ma, ga, $a, ys, U, Ss, va, gi, fn, Es, He, $i;
|
|
2142
|
-
const Vh = "gem-reflect-start", wa = "gem-reflect-end", ur = (n) => new Comment(n), Dh = (n) => {
|
|
2143
|
-
const t = [];
|
|
2144
|
-
let e = n;
|
|
2145
|
-
for (; e && (t.push(e), e.nodeValue !== wa); )
|
|
2146
|
-
e = e.nextSibling;
|
|
2147
|
-
return t;
|
|
2148
|
-
};
|
|
2149
|
-
class Gn extends (ys = B, $a = [D], ga = [F], ma = [Ds()], fa = [wt((t) => [t.target])], ys) {
|
|
2150
|
-
constructor() {
|
|
2151
|
-
super(...arguments), Gt(this, Ss), dr(this, "method", _t(U, 8, this)), _t(U, 11, this), dr(this, "target", _t(U, 12, this, document.head)), _t(U, 15, this), Gt(this, gi, _t(U, 16, this, () => {
|
|
2152
|
-
this.hidden = !0, this.dataset.gemReflect = "";
|
|
2153
|
-
})), _t(U, 19, this), Gt(this, fn, ur(Vh)), Gt(this, Es, ur(wa)), Gt(this, He), Gt(this, $i, _t(U, 20, this, () => ((ft(this, He) || [ft(this, fn), ...this.childNodes, ft(this, Es)]).forEach((t, e, s) => {
|
|
2154
|
-
const i = s[e - 1];
|
|
2155
|
-
i ? i.after(t) : this.target[ft(this, Ss, va)](t);
|
|
2156
|
-
}), () => {
|
|
2157
|
-
ws(this, He, Dh(ft(this, fn))), ft(this, He).forEach((t) => t.remove());
|
|
2158
|
-
}))), _t(U, 23, this);
|
|
2159
|
-
}
|
|
2160
|
-
}
|
|
2161
|
-
U = Ih(ys);
|
|
2162
|
-
Ss = /* @__PURE__ */ new WeakSet();
|
|
2163
|
-
va = function() {
|
|
2164
|
-
return this.method || "append";
|
|
2165
|
-
};
|
|
2166
|
-
gi = /* @__PURE__ */ new WeakMap();
|
|
2167
|
-
fn = /* @__PURE__ */ new WeakMap();
|
|
2168
|
-
Es = /* @__PURE__ */ new WeakMap();
|
|
2169
|
-
He = /* @__PURE__ */ new WeakMap();
|
|
2170
|
-
$i = /* @__PURE__ */ new WeakMap();
|
|
2171
|
-
Dn(U, 5, "method", $a, Gn);
|
|
2172
|
-
Dn(U, 5, "target", ga, Gn);
|
|
2173
|
-
Dn(U, 21, "#init", ma, gi);
|
|
2174
|
-
Dn(U, 21, "#changeTarget", fa, $i);
|
|
2175
|
-
pa(U, Gn);
|
|
2176
|
-
customElements.define("gem-reflect", Gn);
|
|
2177
|
-
var Gh = Object.create, vi = Object.defineProperty, Uh = Object.getOwnPropertyDescriptor, ya = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n), $e = (n) => {
|
|
2178
|
-
throw TypeError(n);
|
|
2179
|
-
}, Sa = (n, t, e) => t in n ? vi(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, _r = (n, t) => vi(n, "name", { value: t, configurable: !0 }), qh = (n) => [, , , Gh((n == null ? void 0 : n[ya("metadata")]) ?? null)], Ea = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], We = (n) => n !== void 0 && typeof n != "function" ? $e("Function expected") : n, Fh = (n, t, e, s, i) => ({ kind: Ea[n], name: t, metadata: s, addInitializer: (r) => e._ ? $e("Already initialized") : i.push(We(r || null)) }), Bh = (n, t) => Sa(t, ya("metadata"), n[3]), Se = (n, t, e, s) => {
|
|
2180
|
-
for (var i = 0, r = n[t >> 1], a = r && r.length; i < a; i++) t & 1 ? r[i].call(e) : s = r[i].call(e, s);
|
|
2181
|
-
return s;
|
|
2182
|
-
}, Zn = (n, t, e, s, i, r) => {
|
|
2183
|
-
var a, c, l, d, f, o = t & 7, m = !!(t & 8), h = !!(t & 16), g = o > 3 ? n.length + 1 : o ? m ? 1 : 2 : 0, v = Ea[o + 5], S = o > 3 && (n[g - 1] = []), T = n[g] || (n[g] = []), p = o && (!h && !m && (i = i.prototype), o < 5 && (o > 3 || !h) && Uh(o < 4 ? i : { get [e]() {
|
|
2184
|
-
return pr(this, r);
|
|
2185
|
-
}, set [e](u) {
|
|
2186
|
-
return mr(this, r, u);
|
|
2187
|
-
} }, e));
|
|
2188
|
-
o ? h && o < 4 && _r(r, (o > 2 ? "set " : o > 1 ? "get " : "") + e) : _r(i, e);
|
|
2189
|
-
for (var b = s.length - 1; b >= 0; b--)
|
|
2190
|
-
d = Fh(o, e, l = {}, n[3], T), o && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => Kh(i, u) : (u) => e in u }, o ^ 3 && (f.get = h ? (u) => (o ^ 1 ? pr : jh)(u, i, o ^ 4 ? r : p.get) : (u) => u[e]), o > 2 && (f.set = h ? (u, k) => mr(u, i, k, o ^ 4 ? r : p.set) : (u, k) => u[e] = k)), c = (0, s[b])(o ? o < 4 ? h ? r : p[v] : o > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, o ^ 4 || c === void 0 ? We(c) && (o > 4 ? S.unshift(c) : o ? h ? r = c : p[v] = c : i = c) : typeof c != "object" || c === null ? $e("Object expected") : (We(a = c.get) && (p.get = a), We(a = c.set) && (p.set = a), We(a = c.init) && S.unshift(a));
|
|
2191
|
-
return o || Bh(n, i), p && vi(i, e, p), h ? o ^ 4 ? r : p : i;
|
|
2192
|
-
}, ln = (n, t, e) => Sa(n, typeof t != "symbol" ? t + "" : t, e), wi = (n, t, e) => t.has(n) || $e("Cannot " + e), Kh = (n, t) => Object(t) !== t ? $e('Cannot use the "in" operator on this value') : n.has(t), pr = (n, t, e) => (wi(n, t, "read from private field"), e ? e.call(n) : t.get(n)), fr = (n, t, e) => t.has(n) ? $e("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), mr = (n, t, e, s) => (wi(n, t, "write to private field"), s ? s.call(n, e) : t.set(n, e), e), jh = (n, t, e) => (wi(n, t, "access private method"), e);
|
|
2193
|
-
const dn = Symbol("open mark");
|
|
2194
|
-
function gl(n) {
|
|
2195
|
-
var t, e, s, i, r, a, c;
|
|
2196
|
-
const l = Symbol();
|
|
2197
|
-
i = [Vt(), zn({ role: "alertdialog", ariaModal: "true" })];
|
|
2198
|
-
let d = class Ca extends (s = B, e = [Qe()], t = [Qe()], s) {
|
|
2199
|
-
constructor() {
|
|
2200
|
-
super(...arguments), ln(this, "label", ""), fr(this, a, Se(r, 8, this, () => ut(x.store, this.update))), Se(r, 11, this), fr(this, c, Se(r, 12, this, () => ut(Ca.store, this.update))), Se(r, 15, this);
|
|
2201
|
-
}
|
|
2202
|
-
/**@final */
|
|
2203
|
-
static get isOpen() {
|
|
2204
|
-
return this.store[dn];
|
|
2205
|
-
}
|
|
2206
|
-
/**
|
|
2207
|
-
* @final
|
|
2208
|
-
* 自带 100ms 延迟,以允许在其他 Dialog 的 `shouldClose` 中调用此方法;
|
|
2209
|
-
* 浏览器 history 为异步 API,需要设置较长延迟;
|
|
2210
|
-
*/
|
|
2211
|
-
static open(m) {
|
|
2212
|
-
const h = new this();
|
|
2213
|
-
this.instance = h, this.inertStore = [...document.body.children].filter((v) => !v.inert), this.inertStore.forEach((v) => v.inert = !0), document.body.append(h);
|
|
2214
|
-
const g = () => this.store({ [dn]: !0, ...m });
|
|
2215
|
-
return setTimeout(() => {
|
|
2216
|
-
g(), x.push({
|
|
2217
|
-
title: h.label,
|
|
2218
|
-
open: g,
|
|
2219
|
-
close: this.closeHandle.bind(this),
|
|
2220
|
-
shouldClose: this.shouldClose.bind(this)
|
|
2221
|
-
});
|
|
2222
|
-
}, 100), l;
|
|
2223
|
-
}
|
|
2224
|
-
/**
|
|
2225
|
-
* @final
|
|
2226
|
-
* UI 中执行关闭
|
|
2227
|
-
*/
|
|
2228
|
-
static close() {
|
|
2229
|
-
return x.back(), l;
|
|
2230
|
-
}
|
|
2231
|
-
/**
|
|
2232
|
-
* @final
|
|
2233
|
-
* history 中自动调用
|
|
2234
|
-
*/
|
|
2235
|
-
static closeHandle() {
|
|
2236
|
-
var m;
|
|
2237
|
-
return this.inertStore.forEach((h) => h.inert = !1), (m = this.instance) == null || m.remove(), this.store({ [dn]: !1, ...n }), l;
|
|
2238
|
-
}
|
|
2239
|
-
/**
|
|
2240
|
-
* 由于要操作浏览器历史记录,所以没有设计为 Promise;
|
|
2241
|
-
*/
|
|
2242
|
-
static shouldClose() {
|
|
2243
|
-
return !0;
|
|
2244
|
-
}
|
|
2245
|
-
};
|
|
2246
|
-
return r = qh(s), a = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), Zn(r, 21, "#connectHistory", e, a), Zn(r, 21, "#connectStore", t, c), d = Zn(r, 0, "ModalElement", i, d), ln(d, "inertStore", []), ln(d, "instance", null), ln(d, "store", zt({
|
|
2247
|
-
[dn]: !1,
|
|
2248
|
-
...n
|
|
2249
|
-
})), Se(r, 1, d), d;
|
|
2250
|
-
}
|
|
2251
|
-
var Jh = Object.create, yi = Object.defineProperty, Qh = Object.getOwnPropertyDescriptor, ba = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n), ve = (n) => {
|
|
2252
|
-
throw TypeError(n);
|
|
2253
|
-
}, Pa = (n, t, e) => t in n ? yi(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, gr = (n, t) => yi(n, "name", { value: t, configurable: !0 }), Yh = (n) => [, , , Jh((n == null ? void 0 : n[ba("metadata")]) ?? null)], Ta = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], ze = (n) => n !== void 0 && typeof n != "function" ? ve("Function expected") : n, Zh = (n, t, e, s, i) => ({ kind: Ta[n], name: t, metadata: s, addInitializer: (r) => e._ ? ve("Already initialized") : i.push(ze(r || null)) }), Xh = (n, t) => Pa(t, ba("metadata"), n[3]), Ot = (n, t, e, s) => {
|
|
2254
|
-
for (var i = 0, r = n[t >> 1], a = r && r.length; i < a; i++) t & 1 ? r[i].call(e) : s = r[i].call(e, s);
|
|
2255
|
-
return s;
|
|
2256
|
-
}, Un = (n, t, e, s, i, r) => {
|
|
2257
|
-
var a, c, l, d, f, o = t & 7, m = !!(t & 8), h = !!(t & 16), g = o > 3 ? n.length + 1 : o ? m ? 1 : 2 : 0, v = Ta[o + 5], S = o > 3 && (n[g - 1] = []), T = n[g] || (n[g] = []), p = o && (!h && !m && (i = i.prototype), o < 5 && (o > 3 || !h) && Qh(o < 4 ? i : { get [e]() {
|
|
2258
|
-
return st(this, r);
|
|
2259
|
-
}, set [e](u) {
|
|
2260
|
-
return Fe(this, r, u);
|
|
2261
|
-
} }, e));
|
|
2262
|
-
o ? h && o < 4 && gr(r, (o > 2 ? "set " : o > 1 ? "get " : "") + e) : gr(i, e);
|
|
2263
|
-
for (var b = s.length - 1; b >= 0; b--)
|
|
2264
|
-
d = Zh(o, e, l = {}, n[3], T), o && (d.static = m, d.private = h, f = d.access = { has: h ? (u) => tl(i, u) : (u) => e in u }, o ^ 3 && (f.get = h ? (u) => (o ^ 1 ? st : el)(u, i, o ^ 4 ? r : p.get) : (u) => u[e]), o > 2 && (f.set = h ? (u, k) => Fe(u, i, k, o ^ 4 ? r : p.set) : (u, k) => u[e] = k)), c = (0, s[b])(o ? o < 4 ? h ? r : p[v] : o > 4 ? void 0 : { get: p.get, set: p.set } : i, d), l._ = 1, o ^ 4 || c === void 0 ? ze(c) && (o > 4 ? S.unshift(c) : o ? h ? r = c : p[v] = c : i = c) : typeof c != "object" || c === null ? ve("Object expected") : (ze(a = c.get) && (p.get = a), ze(a = c.set) && (p.set = a), ze(a = c.init) && S.unshift(a));
|
|
2265
|
-
return o || Xh(n, i), p && yi(i, e, p), h ? o ^ 4 ? r : p : i;
|
|
2266
|
-
}, Ee = (n, t, e) => Pa(n, typeof t != "symbol" ? t + "" : t, e), Si = (n, t, e) => t.has(n) || ve("Cannot " + e), tl = (n, t) => Object(t) !== t ? ve('Cannot use the "in" operator on this value') : n.has(t), st = (n, t, e) => (Si(n, t, "read from private field"), e ? e.call(n) : t.get(n)), Ut = (n, t, e) => t.has(n) ? ve("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), Fe = (n, t, e, s) => (Si(n, t, "write to private field"), s ? s.call(n, e) : t.set(n, e), e), el = (n, t, e) => (Si(n, t, "access private method"), e), ka, Oa, Ma, Cs, xa, tt, Ve, De, Ge, bs, mn, Ei;
|
|
2267
|
-
const Xn = Symbol();
|
|
2268
|
-
xa = [Wn(x.store), zn({ role: "dialog", ariaModal: "true" })];
|
|
2269
|
-
class Ze extends (Cs = B, Ma = [D], Oa = [In], ka = [Ds()], Cs) {
|
|
2270
|
-
constructor() {
|
|
2271
|
-
super(...arguments), Ee(this, "label", Ot(tt, 8, this)), Ot(tt, 11, this), Ee(this, "opened", Ot(tt, 12, this)), Ot(tt, 15, this), Ut(this, Ve), Ut(this, De), Ut(this, Ge, []), Ut(this, bs, () => {
|
|
2272
|
-
var t;
|
|
2273
|
-
this.inert = !0, st(this, Ge).forEach((e) => e.inert = !1), st(this, Ve) ? st(this, Ve).before(this) : st(this, De) && ((t = st(this, De)) == null || t.appendChild(this)), this.dispatchEvent(new CustomEvent("close")), this.opened = !1;
|
|
2274
|
-
}), Ut(this, mn, () => {
|
|
2275
|
-
this.hidden = !1, this.inert = !1, Fe(this, Ve, this.nextSibling), Fe(this, De, this.parentElement || this.getRootNode()), Fe(this, Ge, [...document.body.children].filter((t) => !t.inert)), st(this, Ge).forEach((t) => t.inert = !0), document.body.append(this), this.dispatchEvent(new CustomEvent("open")), this.opened = !0;
|
|
2276
|
-
}), Ut(this, Ei, Ot(tt, 16, this, () => this.inert = !0)), Ot(tt, 19, this), Ee(this, "open", () => {
|
|
2277
|
-
if (!this.opened)
|
|
2278
|
-
return st(this, mn).call(this), x.push({
|
|
2279
|
-
title: this.label,
|
|
2280
|
-
open: st(this, mn),
|
|
2281
|
-
close: st(this, bs),
|
|
2282
|
-
shouldClose: this.shouldClose
|
|
2283
|
-
}), Xn;
|
|
2284
|
-
}), Ee(this, "close", () => (x.back(), Xn)), Ee(this, "forceClose", () => (this.opened = !1, setTimeout(this.close, 100), Xn));
|
|
2285
|
-
}
|
|
2286
|
-
shouldClose() {
|
|
2287
|
-
return !0;
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
tt = Yh(Cs);
|
|
2291
|
-
Ve = /* @__PURE__ */ new WeakMap();
|
|
2292
|
-
De = /* @__PURE__ */ new WeakMap();
|
|
2293
|
-
Ge = /* @__PURE__ */ new WeakMap();
|
|
2294
|
-
bs = /* @__PURE__ */ new WeakMap();
|
|
2295
|
-
mn = /* @__PURE__ */ new WeakMap();
|
|
2296
|
-
Ei = /* @__PURE__ */ new WeakMap();
|
|
2297
|
-
Un(tt, 5, "label", Ma, Ze);
|
|
2298
|
-
Un(tt, 5, "opened", Oa, Ze);
|
|
2299
|
-
Un(tt, 21, "#init", ka, Ei);
|
|
2300
|
-
Ze = Un(tt, 0, "GemDialogBaseElement", xa, Ze);
|
|
2301
|
-
Ot(tt, 1, Ze);
|
|
2302
|
-
class nl {
|
|
2269
|
+
}), kr(this, Ai, st(I, 24, this, () => ot`${xn(this, An).call(this)}<slot></slot>`)), st(I, 27, this);
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
I = ul(Ln);
|
|
2273
|
+
An = /* @__PURE__ */ new WeakMap();
|
|
2274
|
+
Ai = /* @__PURE__ */ new WeakMap();
|
|
2275
|
+
Se(I, 5, "selector", Fa, Tt);
|
|
2276
|
+
Se(I, 5, "root", Ua, Tt);
|
|
2277
|
+
Se(I, 5, "element", Da, Tt);
|
|
2278
|
+
Se(I, 5, "active", Ga, Tt);
|
|
2279
|
+
Se(I, 21, "#content", Va, Ai);
|
|
2280
|
+
Tt = Se(I, 0, "GemUseElement", qa, Tt);
|
|
2281
|
+
st(I, 1, Tt);
|
|
2282
|
+
customElements.define("gem-use", Tt);
|
|
2283
|
+
var es, ie, fs;
|
|
2284
|
+
class vl {
|
|
2303
2285
|
constructor(t) {
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2286
|
+
E(this, ie);
|
|
2287
|
+
E(this, es);
|
|
2288
|
+
v(this, "info", (...t) => {
|
|
2289
|
+
console.log(_(this, ie, fs), ...t);
|
|
2307
2290
|
});
|
|
2308
|
-
|
|
2309
|
-
console.warn(
|
|
2291
|
+
v(this, "warn", (...t) => {
|
|
2292
|
+
console.warn(_(this, ie, fs), ...t);
|
|
2310
2293
|
});
|
|
2311
|
-
|
|
2312
|
-
console.error(
|
|
2294
|
+
v(this, "error", (...t) => {
|
|
2295
|
+
console.error(_(this, ie, fs), ...t);
|
|
2313
2296
|
});
|
|
2314
|
-
this
|
|
2297
|
+
M(this, es, t);
|
|
2315
2298
|
}
|
|
2316
2299
|
}
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2300
|
+
es = new WeakMap(), ie = new WeakSet(), fs = function() {
|
|
2301
|
+
return `[${_(this, es)}]`;
|
|
2302
|
+
};
|
|
2303
|
+
const $l = new vl("GEM"), Sl = /\$\d(?:<[^>]*>)?/, yl = /\$(\d)(<([^>]*)>)?/g, wl = 3;
|
|
2304
|
+
function El(s, ...t) {
|
|
2305
|
+
const e = s.split(Sl), n = [];
|
|
2320
2306
|
let i;
|
|
2321
|
-
for (; i =
|
|
2322
|
-
const
|
|
2323
|
-
|
|
2307
|
+
for (; i = yl.exec(s); ) {
|
|
2308
|
+
const o = i[wl], a = Number(i[1]) - 1, c = t[a];
|
|
2309
|
+
n.push(typeof c == "function" ? c(o) : c);
|
|
2324
2310
|
}
|
|
2325
|
-
return
|
|
2311
|
+
return ot(e, ...n);
|
|
2326
2312
|
}
|
|
2327
|
-
const
|
|
2328
|
-
var
|
|
2329
|
-
const
|
|
2313
|
+
const be = /* @__PURE__ */ new Set();
|
|
2314
|
+
var A, ms, Ba, Ka, De, gs, ss;
|
|
2315
|
+
const Ni = class Ni {
|
|
2330
2316
|
constructor(t) {
|
|
2331
|
-
E(this,
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2317
|
+
E(this, A);
|
|
2318
|
+
v(this, "resources");
|
|
2319
|
+
v(this, "fallbackLanguage");
|
|
2320
|
+
v(this, "currentLanguage");
|
|
2321
|
+
v(this, "cache");
|
|
2322
|
+
v(this, "cachePrefix", "gem-i18n");
|
|
2323
|
+
v(this, "urlParamsType");
|
|
2324
|
+
v(this, "urlParamsName");
|
|
2325
|
+
v(this, "onChange");
|
|
2340
2326
|
// 兼容 `<gem-route>`
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
E(this,
|
|
2327
|
+
v(this, "replace", ({ path: t }) => this.setLanguage(t));
|
|
2328
|
+
v(this, "getParams", () => ({ path: this.currentLanguage }));
|
|
2329
|
+
E(this, ss, !0);
|
|
2344
2330
|
if (!t.resources[t.fallbackLanguage])
|
|
2345
|
-
throw new
|
|
2331
|
+
throw new wt("i18n: fallbackLanguage invalid");
|
|
2346
2332
|
Object.assign(this, t);
|
|
2347
|
-
let e = _(this,
|
|
2348
|
-
const
|
|
2349
|
-
if (
|
|
2333
|
+
let e = _(this, A, Ba) || this.currentLanguage || _(this, A, Ka);
|
|
2334
|
+
const n = document.querySelector(`[type*=${this.cachePrefix}]`);
|
|
2335
|
+
if (n)
|
|
2350
2336
|
try {
|
|
2351
|
-
const i = JSON.parse(
|
|
2337
|
+
const i = JSON.parse(n.textContent || "");
|
|
2352
2338
|
e = i.currentLanguage, this.resources[i.currentLanguage] = i.currentLanguagePack;
|
|
2353
2339
|
} catch {
|
|
2354
2340
|
}
|
|
2355
|
-
e ? (
|
|
2341
|
+
e ? (M(this, A, e, gs), this.setLanguage(e)) : this.resetLanguage(), M(this, ss, !1);
|
|
2356
2342
|
}
|
|
2357
2343
|
get(t, ...e) {
|
|
2358
|
-
const
|
|
2359
|
-
return e.length ?
|
|
2344
|
+
const n = this.resources[this.currentLanguage], i = this.resources[this.fallbackLanguage], o = n[t] || i[t], a = (o == null ? void 0 : o.message) || o || `[${t}]`;
|
|
2345
|
+
return e.length ? El(a, ...e) : a;
|
|
2360
2346
|
}
|
|
2361
2347
|
detectLanguage() {
|
|
2362
|
-
const t = Object.keys(this.resources), e = navigator.languages.map((
|
|
2363
|
-
for (const
|
|
2364
|
-
const i = t.find((
|
|
2348
|
+
const t = Object.keys(this.resources), e = navigator.languages.map((n) => n.replace(/-(.*)/, (i) => i.toUpperCase()));
|
|
2349
|
+
for (const n of e) {
|
|
2350
|
+
const i = t.find((o) => o === n || n.startsWith(`${o}-`));
|
|
2365
2351
|
if (i) return i;
|
|
2366
2352
|
}
|
|
2367
2353
|
return this.fallbackLanguage;
|
|
2368
2354
|
}
|
|
2369
2355
|
async setLanguage(t) {
|
|
2370
|
-
var i,
|
|
2371
|
-
_(this,
|
|
2356
|
+
var i, o;
|
|
2357
|
+
_(this, A, De) && be.forEach(async (a) => await a.setLanguage(t));
|
|
2372
2358
|
let e;
|
|
2373
|
-
const
|
|
2374
|
-
if (!
|
|
2375
|
-
return
|
|
2376
|
-
if (typeof
|
|
2377
|
-
const a = `${this.cachePrefix}:`, c = `${a}${
|
|
2378
|
-
const f = await (await fetch(
|
|
2359
|
+
const n = this.resources[t];
|
|
2360
|
+
if (!n)
|
|
2361
|
+
return $l.warn(`${this.cachePrefix}: not found \`${t}\``), this.resetLanguage();
|
|
2362
|
+
if (typeof n == "string") {
|
|
2363
|
+
const a = `${this.cachePrefix}:`, c = `${a}${n}`, l = localStorage.getItem(c), d = async () => {
|
|
2364
|
+
const f = await (await fetch(n)).json();
|
|
2379
2365
|
if (this.cache) {
|
|
2380
|
-
for (let
|
|
2381
|
-
const m = localStorage.key(
|
|
2366
|
+
for (let r = 0; r < localStorage.length; r++) {
|
|
2367
|
+
const m = localStorage.key(r);
|
|
2382
2368
|
m.startsWith(a) && localStorage.removeItem(m);
|
|
2383
2369
|
}
|
|
2384
2370
|
localStorage.setItem(c, JSON.stringify(f));
|
|
@@ -2394,32 +2380,32 @@ const Ci = class Ci {
|
|
|
2394
2380
|
else
|
|
2395
2381
|
e = await d();
|
|
2396
2382
|
} else
|
|
2397
|
-
e =
|
|
2398
|
-
if (this.resources[t] = e, !_(this,
|
|
2383
|
+
e = n;
|
|
2384
|
+
if (this.resources[t] = e, !_(this, ss)) {
|
|
2399
2385
|
const a = [document.documentElement];
|
|
2400
2386
|
for (; a.length; ) {
|
|
2401
2387
|
const c = a.pop();
|
|
2402
|
-
(i = c[
|
|
2388
|
+
(i = c[As]) == null || i.call(c), a.push(...[...c.children, ...((o = c.shadowRoot) == null ? void 0 : o.children) || []].reverse());
|
|
2403
2389
|
}
|
|
2404
2390
|
}
|
|
2405
|
-
return t !== this.currentLanguage &&
|
|
2391
|
+
return t !== this.currentLanguage && M(this, A, t, gs), this.cache === !0 && this.setCache(), t;
|
|
2406
2392
|
}
|
|
2407
2393
|
resetLanguage() {
|
|
2408
|
-
return _(this,
|
|
2394
|
+
return _(this, A, De) && be.forEach((t) => t.resetLanguage()), M(this, A, this.fallbackLanguage, gs), this.cache && localStorage.removeItem(_(this, A, ms)), this.setLanguage(this.detectLanguage());
|
|
2409
2395
|
}
|
|
2410
2396
|
// 一般用在 `onChange` 中
|
|
2411
2397
|
setCache() {
|
|
2412
|
-
_(this,
|
|
2398
|
+
_(this, A, De) && be.forEach((t) => t.setCache()), localStorage.setItem(_(this, A, ms), this.currentLanguage);
|
|
2413
2399
|
}
|
|
2414
2400
|
createSubModule(t, e) {
|
|
2415
|
-
const
|
|
2401
|
+
const n = new Ni({
|
|
2416
2402
|
resources: e,
|
|
2417
2403
|
cachePrefix: `${this.cachePrefix}-${t}`,
|
|
2418
2404
|
currentLanguage: this.currentLanguage,
|
|
2419
2405
|
fallbackLanguage: this.fallbackLanguage,
|
|
2420
2406
|
cache: this.cache
|
|
2421
2407
|
});
|
|
2422
|
-
return
|
|
2408
|
+
return be.add(n), n;
|
|
2423
2409
|
}
|
|
2424
2410
|
/**
|
|
2425
2411
|
* @example
|
|
@@ -2437,10 +2423,10 @@ const Ci = class Ci {
|
|
|
2437
2423
|
};
|
|
2438
2424
|
}
|
|
2439
2425
|
};
|
|
2440
|
-
|
|
2426
|
+
A = new WeakSet(), ms = function() {
|
|
2441
2427
|
return `${this.cachePrefix}:current`;
|
|
2442
|
-
},
|
|
2443
|
-
const { hostname: t, pathname: e, search:
|
|
2428
|
+
}, Ba = function() {
|
|
2429
|
+
const { hostname: t, pathname: e, search: n } = location, i = t.split(".");
|
|
2444
2430
|
switch (this.urlParamsType) {
|
|
2445
2431
|
case "ccTLD":
|
|
2446
2432
|
return i.pop();
|
|
@@ -2448,20 +2434,21 @@ L = new WeakSet(), gn = function() {
|
|
|
2448
2434
|
return i.shift();
|
|
2449
2435
|
case "path":
|
|
2450
2436
|
return e.split("/")[1];
|
|
2451
|
-
default:
|
|
2452
|
-
const
|
|
2453
|
-
return
|
|
2454
|
-
|
|
2455
|
-
}
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2437
|
+
default: {
|
|
2438
|
+
const o = this.urlParamsName && new URLSearchParams(n).get(this.urlParamsName) || "";
|
|
2439
|
+
return o in this.resources ? o : "";
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
}, Ka = function() {
|
|
2443
|
+
return this.cache && localStorage.getItem(_(this, A, ms)) || "";
|
|
2444
|
+
}, De = function() {
|
|
2445
|
+
return !be.has(this);
|
|
2446
|
+
}, gs = function(t) {
|
|
2460
2447
|
var e;
|
|
2461
|
-
_(this,
|
|
2462
|
-
},
|
|
2463
|
-
let
|
|
2464
|
-
const K = (
|
|
2448
|
+
_(this, A, De) && (document.documentElement.lang = t), this.currentLanguage = t, (e = this.onChange) == null || e.call(this, t);
|
|
2449
|
+
}, ss = new WeakMap();
|
|
2450
|
+
let Or = Ni;
|
|
2451
|
+
const K = (s) => matchMedia(s).matches, Wl = {
|
|
2465
2452
|
PRINT: "print",
|
|
2466
2453
|
get isPrint() {
|
|
2467
2454
|
return K(this.PRINT);
|
|
@@ -2521,27 +2508,27 @@ const K = (n) => window.matchMedia(n).matches, $l = {
|
|
|
2521
2508
|
get isWidthScreen() {
|
|
2522
2509
|
return K(this.WIDTHSCREEN);
|
|
2523
2510
|
}
|
|
2524
|
-
},
|
|
2525
|
-
function
|
|
2511
|
+
}, Cl = Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array())).constructor;
|
|
2512
|
+
function bl(s = {}) {
|
|
2526
2513
|
const {
|
|
2527
2514
|
origin: t = location.origin,
|
|
2528
2515
|
base: e = "",
|
|
2529
|
-
appendHeaders:
|
|
2530
|
-
transformInput: i = (
|
|
2531
|
-
transformOutput:
|
|
2516
|
+
appendHeaders: n = () => ({}),
|
|
2517
|
+
transformInput: i = (r) => r,
|
|
2518
|
+
transformOutput: o = (r) => r,
|
|
2532
2519
|
...a
|
|
2533
|
-
} =
|
|
2534
|
-
if (new URL(
|
|
2535
|
-
throw new
|
|
2520
|
+
} = s, c = (r) => r instanceof FormData || r instanceof Blob || r instanceof Cl || r instanceof URLSearchParams || r instanceof ReadableStream || r instanceof ArrayBuffer ? r : typeof r == "object" ? JSON.stringify(r) : r, l = (r, m) => {
|
|
2521
|
+
if (new URL(r, location.origin).pathname !== r)
|
|
2522
|
+
throw new wt("`path` format is incorrect");
|
|
2536
2523
|
const h = new URLSearchParams(m).toString();
|
|
2537
|
-
return `${t}${e}${
|
|
2538
|
-
}, d = (
|
|
2539
|
-
if (!
|
|
2540
|
-
if (
|
|
2541
|
-
const m = Array.isArray(
|
|
2524
|
+
return `${t}${e}${r}${h ? "?" : ""}${h}`;
|
|
2525
|
+
}, d = (r) => {
|
|
2526
|
+
if (!r) return {};
|
|
2527
|
+
if (r instanceof Headers) return Object.fromEntries(r);
|
|
2528
|
+
const m = Array.isArray(r) ? r : Object.entries(r);
|
|
2542
2529
|
return Object.fromEntries(m.map(([h, g]) => [h.toLowerCase(), g]));
|
|
2543
|
-
}, f = async (
|
|
2544
|
-
const h = new Request(
|
|
2530
|
+
}, f = async (r, m = {}) => {
|
|
2531
|
+
const h = new Request(r, {
|
|
2545
2532
|
...a,
|
|
2546
2533
|
...m,
|
|
2547
2534
|
headers: new Headers({
|
|
@@ -2552,193 +2539,194 @@ function hl(n = {}) {
|
|
|
2552
2539
|
}), g = await fetch(h);
|
|
2553
2540
|
if (g.status === 0) throw new Error("Request fail");
|
|
2554
2541
|
if (g.status >= 500) throw new Error(g.statusText);
|
|
2555
|
-
const
|
|
2542
|
+
const $ = h.headers.get("content-type"), w = g.status >= 400;
|
|
2556
2543
|
try {
|
|
2557
|
-
let
|
|
2558
|
-
if (
|
|
2559
|
-
return
|
|
2544
|
+
let k;
|
|
2545
|
+
if ($.includes("json") ? k = await g.json() : $.includes("octet-stream") ? k = await g.arrayBuffer() : k = await g.text(), w) throw new Error(g.statusText, { cause: k });
|
|
2546
|
+
return o(k, h);
|
|
2560
2547
|
} catch {
|
|
2561
2548
|
throw new Error("Parse error");
|
|
2562
2549
|
}
|
|
2563
2550
|
};
|
|
2564
2551
|
return {
|
|
2565
2552
|
request: f,
|
|
2566
|
-
get(
|
|
2553
|
+
get(r, m) {
|
|
2567
2554
|
const h = i(m);
|
|
2568
|
-
return f(l(
|
|
2555
|
+
return f(l(r, h), {
|
|
2569
2556
|
method: "GET",
|
|
2570
|
-
headers:
|
|
2557
|
+
headers: n(h)
|
|
2571
2558
|
});
|
|
2572
2559
|
},
|
|
2573
|
-
del(
|
|
2560
|
+
del(r, m) {
|
|
2574
2561
|
const h = i(m);
|
|
2575
|
-
return f(l(
|
|
2562
|
+
return f(l(r, h), {
|
|
2576
2563
|
method: "DELETE",
|
|
2577
|
-
headers:
|
|
2564
|
+
headers: n(h)
|
|
2578
2565
|
});
|
|
2579
2566
|
},
|
|
2580
|
-
put(
|
|
2567
|
+
put(r, m) {
|
|
2581
2568
|
const h = i(m);
|
|
2582
|
-
return f(l(
|
|
2569
|
+
return f(l(r), {
|
|
2583
2570
|
method: "PUT",
|
|
2584
|
-
headers:
|
|
2571
|
+
headers: n(h),
|
|
2585
2572
|
body: c(h)
|
|
2586
2573
|
});
|
|
2587
2574
|
},
|
|
2588
|
-
post(
|
|
2575
|
+
post(r, m) {
|
|
2589
2576
|
const h = i(m);
|
|
2590
|
-
return f(l(
|
|
2577
|
+
return f(l(r), {
|
|
2591
2578
|
method: "POST",
|
|
2592
|
-
headers:
|
|
2579
|
+
headers: n(h),
|
|
2593
2580
|
body: c(h)
|
|
2594
2581
|
});
|
|
2595
2582
|
}
|
|
2596
2583
|
};
|
|
2597
2584
|
}
|
|
2598
|
-
const { request:
|
|
2599
|
-
function
|
|
2600
|
-
return
|
|
2585
|
+
const { request: zl, del: Vl, get: Gl, post: Dl, put: Ul } = bl(), ja = /* @__PURE__ */ new WeakMap(), Qa = /* @__PURE__ */ new WeakMap();
|
|
2586
|
+
function Fl(s) {
|
|
2587
|
+
return ja.get(s);
|
|
2601
2588
|
}
|
|
2602
|
-
function
|
|
2603
|
-
return
|
|
2589
|
+
function Ja(s) {
|
|
2590
|
+
return Qa.get(s);
|
|
2604
2591
|
}
|
|
2605
|
-
function
|
|
2606
|
-
const e =
|
|
2607
|
-
|
|
2592
|
+
function bs(s, t = {}) {
|
|
2593
|
+
const e = Rn(), n = le({})[Et], i = Wt(s), o = new Proxy(
|
|
2594
|
+
xs({ [Et]: n }, (c) => i(c)),
|
|
2608
2595
|
{
|
|
2609
2596
|
get(c, l) {
|
|
2610
2597
|
if (!c[l]) {
|
|
2611
|
-
const [d, f,
|
|
2612
|
-
f && (c[l] = `oklch(from ${c[f]} calc(l - ${(Number(
|
|
2598
|
+
const [d, f, r] = l.match(/^(\w*Color)(\d+)$/) || [];
|
|
2599
|
+
f && (c[l] = `oklch(from ${c[f]} calc(l - ${(Number(r) - 400) / 1e3}) c h)`);
|
|
2613
2600
|
}
|
|
2614
2601
|
return c[l];
|
|
2615
2602
|
}
|
|
2616
2603
|
}
|
|
2617
2604
|
);
|
|
2618
|
-
|
|
2605
|
+
Qa.set(o, t), ja.set(o, i);
|
|
2619
2606
|
const a = () => {
|
|
2620
2607
|
let c = "";
|
|
2621
2608
|
Object.keys(i).forEach((l) => {
|
|
2622
|
-
t[l] || (t[l] = `--${
|
|
2623
|
-
}),
|
|
2609
|
+
t[l] || (t[l] = `--${he(l)}-${e}`, o[l] = `var(${t[l]})`), c += `${t[l]}:${i[l]};`;
|
|
2610
|
+
}), n.setContent(`&,:host{${c}}`);
|
|
2624
2611
|
};
|
|
2625
|
-
return a(),
|
|
2626
|
-
a(),
|
|
2627
|
-
}),
|
|
2612
|
+
return a(), mt(i, () => {
|
|
2613
|
+
a(), n.updateStyle();
|
|
2614
|
+
}), o;
|
|
2628
2615
|
}
|
|
2629
|
-
function
|
|
2630
|
-
return
|
|
2616
|
+
function Tl(s) {
|
|
2617
|
+
return bs(s);
|
|
2631
2618
|
}
|
|
2632
|
-
function
|
|
2633
|
-
const t =
|
|
2634
|
-
return document.adoptedStyleSheets.push(t[
|
|
2619
|
+
function ql(s) {
|
|
2620
|
+
const t = Tl(s);
|
|
2621
|
+
return document.adoptedStyleSheets.push(t[Et].getStyle()), t;
|
|
2635
2622
|
}
|
|
2636
|
-
function
|
|
2637
|
-
return
|
|
2623
|
+
function Bl(s, t) {
|
|
2624
|
+
return bs(t, Ja(s));
|
|
2638
2625
|
}
|
|
2639
|
-
function
|
|
2640
|
-
const t =
|
|
2641
|
-
return
|
|
2626
|
+
function Kl(s) {
|
|
2627
|
+
const t = bs(s), e = Ja(t);
|
|
2628
|
+
return xs(t, (i) => (o, { addInitializer: a, access: c }) => {
|
|
2642
2629
|
a(function() {
|
|
2643
|
-
const l =
|
|
2644
|
-
this.internals.sheets.push(l[
|
|
2630
|
+
const l = bs({ ...s }, e);
|
|
2631
|
+
this.internals.sheets.push(l[Et].getStyle(this, !0)), this.memo(() => l(c.get(this).apply(this)), i && (() => i(this)));
|
|
2645
2632
|
});
|
|
2646
2633
|
});
|
|
2647
2634
|
}
|
|
2648
2635
|
export {
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2636
|
+
ae as GemActiveLinkElement,
|
|
2637
|
+
je as GemDialogBaseElement,
|
|
2638
|
+
tt as GemElement,
|
|
2639
|
+
wt as GemError,
|
|
2640
|
+
H as GemLightRouteElement,
|
|
2641
|
+
oa as GemLinkElement,
|
|
2642
|
+
qs as GemReflectElement,
|
|
2643
|
+
Qe as GemRouteElement,
|
|
2644
|
+
kn as GemTitleElement,
|
|
2645
|
+
ce as GemUnsafeElement,
|
|
2646
|
+
Tt as GemUseElement,
|
|
2647
|
+
Or as I18n,
|
|
2648
|
+
ic as LinkedList,
|
|
2649
|
+
vl as Logger,
|
|
2650
|
+
rc as PropProxyMap,
|
|
2651
|
+
qe as QueryString,
|
|
2652
|
+
Et as SheetToken,
|
|
2653
|
+
Kr as TemplateResult,
|
|
2654
|
+
As as UpdateToken,
|
|
2655
|
+
Wn as _RenderErrorEvent,
|
|
2656
|
+
vs as _StoreListenerMap,
|
|
2657
|
+
Vn as _createTemplate,
|
|
2658
|
+
xr as absoluteLocation,
|
|
2659
|
+
Lr as addListener,
|
|
2660
|
+
St as addMicrotask,
|
|
2661
|
+
is as adoptedStyle,
|
|
2662
|
+
Gs as aria,
|
|
2663
|
+
bc as async,
|
|
2664
|
+
B as attribute,
|
|
2665
|
+
hh as basePathStore,
|
|
2666
|
+
Ws as boolattribute,
|
|
2667
|
+
he as camelToKebabCase,
|
|
2668
|
+
ac as classMap,
|
|
2669
|
+
In as cleanObject,
|
|
2670
|
+
mt as connect,
|
|
2671
|
+
Vs as connectStore,
|
|
2672
|
+
Kl as createDecoratorTheme,
|
|
2673
|
+
xh as createHistoryParams,
|
|
2674
|
+
Hl as createModalClass,
|
|
2675
|
+
Bl as createOverrideTheme,
|
|
2676
|
+
di as createPath,
|
|
2677
|
+
Rl as createRef,
|
|
2678
|
+
Tl as createScopedTheme,
|
|
2679
|
+
zn as createState,
|
|
2680
|
+
Wt as createStore,
|
|
2681
|
+
ql as createTheme,
|
|
2682
|
+
xs as createUpdater,
|
|
2683
|
+
le as css,
|
|
2684
|
+
Tc as customElement,
|
|
2685
|
+
Vl as del,
|
|
2686
|
+
th as directive,
|
|
2687
|
+
ft as effect,
|
|
2688
|
+
Te as emitter,
|
|
2689
|
+
Ll as exportPartsMap,
|
|
2690
|
+
yc as fallback,
|
|
2691
|
+
Gl as get,
|
|
2692
|
+
Ja as getThemeProps,
|
|
2693
|
+
Fl as getThemeStore,
|
|
2694
|
+
Cc as globalemitter,
|
|
2708
2695
|
x as history,
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2696
|
+
ot as html,
|
|
2697
|
+
bl as initRequest,
|
|
2698
|
+
oc as isArrayChange,
|
|
2699
|
+
Ml as kebabToCamelCase,
|
|
2700
|
+
Ur as light,
|
|
2701
|
+
$l as logger,
|
|
2702
|
+
No as matchPath,
|
|
2703
|
+
Nl as mathml,
|
|
2704
|
+
Wl as mediaQuery,
|
|
2705
|
+
zr as memo,
|
|
2706
|
+
Be as mounted,
|
|
2707
|
+
$c as numattribute,
|
|
2708
|
+
Hn as objectMapToString,
|
|
2709
|
+
Gr as part,
|
|
2710
|
+
xl as partMap,
|
|
2711
|
+
Dl as post,
|
|
2712
|
+
D as property,
|
|
2713
|
+
Ul as put,
|
|
2714
|
+
Rn as randomStr,
|
|
2715
|
+
Nn as raw,
|
|
2716
|
+
Ls as render,
|
|
2717
|
+
Il as repeat,
|
|
2718
|
+
zl as request,
|
|
2719
|
+
Ar as setEngine,
|
|
2720
|
+
zt as shadow,
|
|
2721
|
+
Ec as slot,
|
|
2722
|
+
El as splice,
|
|
2723
|
+
zs as state,
|
|
2724
|
+
Ol as styleMap,
|
|
2725
|
+
Pl as styled,
|
|
2726
|
+
Al as svg,
|
|
2727
|
+
de as template,
|
|
2740
2728
|
It as titleStore,
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2729
|
+
Sc as unmounted,
|
|
2730
|
+
Yc as version,
|
|
2731
|
+
qn as willMount
|
|
2744
2732
|
};
|