@justeattakeaway/pie-modal 0.13.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +6 -0
- package/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +47 -0
- package/README.md +17 -15
- package/dist/index.js +1070 -200
- package/dist/react.js +0 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/packages/components/pie-modal/src/defs.d.ts +50 -8
- package/dist/types/packages/components/pie-modal/src/defs.d.ts.map +1 -1
- package/dist/types/packages/components/pie-modal/src/index.d.ts +36 -3
- package/dist/types/packages/components/pie-modal/src/index.d.ts.map +1 -1
- package/dist/types/packages/components/pie-modal/src/react.d.ts +0 -0
- package/dist/types/packages/components/pie-modal/src/react.d.ts.map +0 -0
- package/dist/types/react.d.ts +0 -0
- package/package.json +3 -1
- package/playwright/index.ts +1 -1
- package/playwright-lit-visual.config.ts +0 -1
- package/playwright-lit.config.ts +1 -2
- package/src/defs.ts +62 -7
- package/src/index.ts +145 -37
- package/src/modal.scss +107 -19
- package/test/component/pie-modal.spec.ts +273 -12
- package/test/helpers/index.ts +2 -0
- package/test/visual/pie-modal.spec.ts +376 -85
- package/tsconfig.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { nothing as
|
|
2
|
-
import { html as
|
|
3
|
-
import { property as
|
|
4
|
-
import { property as
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
(r = n[
|
|
8
|
-
return
|
|
1
|
+
import { nothing as f, unsafeCSS as Xe, LitElement as Ge } from "lit";
|
|
2
|
+
import { html as y, unsafeStatic as Je } from "lit/static-html.js";
|
|
3
|
+
import { property as g, query as Ke } from "lit/decorators.js";
|
|
4
|
+
import { property as Qe } from "lit/decorators/property.js";
|
|
5
|
+
var et = Object.defineProperty, tt = Object.getOwnPropertyDescriptor, it = (n, e, t, i) => {
|
|
6
|
+
for (var o = i > 1 ? void 0 : i ? tt(e, t) : e, s = n.length - 1, r; s >= 0; s--)
|
|
7
|
+
(r = n[s]) && (o = (i ? r(e, t, o) : r(o)) || o);
|
|
8
|
+
return i && o && et(e, t, o), o;
|
|
9
9
|
};
|
|
10
|
-
const
|
|
10
|
+
const ot = (n) => {
|
|
11
11
|
class e extends n {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments), this.dir = "ltr";
|
|
@@ -22,171 +22,956 @@ const I = (n) => {
|
|
|
22
22
|
* will not be reactive and is only computed once
|
|
23
23
|
*/
|
|
24
24
|
get isRTL() {
|
|
25
|
-
var
|
|
26
|
-
return this.dir === "ltr" ? !1 : this.dir === "rtl" || ((
|
|
25
|
+
var i;
|
|
26
|
+
return this.dir === "ltr" ? !1 : this.dir === "rtl" || ((i = window == null ? void 0 : window.getComputedStyle(this)) == null ? void 0 : i.direction) === "rtl";
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
return
|
|
30
|
-
|
|
29
|
+
return it([
|
|
30
|
+
Qe({ type: String, reflect: !0 })
|
|
31
31
|
], e.prototype, "dir", 2), e;
|
|
32
|
-
},
|
|
33
|
-
const r = `#${
|
|
34
|
-
Object.defineProperty(
|
|
32
|
+
}, ge = (n, e, t) => function(o, s) {
|
|
33
|
+
const r = `#${s}`;
|
|
34
|
+
Object.defineProperty(o, s, {
|
|
35
35
|
get() {
|
|
36
36
|
return this[r];
|
|
37
37
|
},
|
|
38
|
-
set(
|
|
39
|
-
const
|
|
40
|
-
e.includes(
|
|
41
|
-
`<${n}> Invalid value "${
|
|
38
|
+
set(d) {
|
|
39
|
+
const l = this[r];
|
|
40
|
+
e.includes(d) ? this[r] = d : (console.error(
|
|
41
|
+
`<${n}> Invalid value "${d}" provided for property "${s}".`,
|
|
42
42
|
`Must be one of: ${e.join(" | ")}.`,
|
|
43
|
-
`Falling back to default value: "${
|
|
44
|
-
), this[r] =
|
|
43
|
+
`Falling back to default value: "${t}"`
|
|
44
|
+
), this[r] = t), this.requestUpdate(s, l);
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
-
},
|
|
48
|
-
const
|
|
49
|
-
Object.defineProperty(
|
|
47
|
+
}, nt = (n) => function(t, i) {
|
|
48
|
+
const o = `#${i}`;
|
|
49
|
+
Object.defineProperty(t, i, {
|
|
50
50
|
get() {
|
|
51
|
-
return this[
|
|
51
|
+
return this[o];
|
|
52
52
|
},
|
|
53
|
-
set(
|
|
54
|
-
const r = this[
|
|
55
|
-
(
|
|
53
|
+
set(s) {
|
|
54
|
+
const r = this[o];
|
|
55
|
+
(s == null || typeof s == "string" && s.trim() === "") && console.error(`<${n}> Missing required attribute "${i}"`), this[o] = s, this.requestUpdate(i, r);
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
|
-
function
|
|
59
|
+
function st(n) {
|
|
60
60
|
if (Array.isArray(n)) {
|
|
61
|
-
for (var e = 0,
|
|
62
|
-
|
|
63
|
-
return
|
|
61
|
+
for (var e = 0, t = Array(n.length); e < n.length; e++)
|
|
62
|
+
t[e] = n[e];
|
|
63
|
+
return t;
|
|
64
64
|
} else
|
|
65
65
|
return Array.from(n);
|
|
66
66
|
}
|
|
67
|
-
var
|
|
67
|
+
var me = !1;
|
|
68
68
|
if (typeof window < "u") {
|
|
69
|
-
var
|
|
69
|
+
var we = {
|
|
70
70
|
get passive() {
|
|
71
|
-
|
|
71
|
+
me = !0;
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
|
-
window.addEventListener("testPassive", null,
|
|
74
|
+
window.addEventListener("testPassive", null, we), window.removeEventListener("testPassive", null, we);
|
|
75
75
|
}
|
|
76
|
-
var
|
|
77
|
-
return
|
|
78
|
-
return !!(
|
|
76
|
+
var X = typeof window < "u" && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === "MacIntel" && window.navigator.maxTouchPoints > 1), E = [], G = !1, Ue = -1, T = void 0, S = void 0, R = void 0, He = function(e) {
|
|
77
|
+
return E.some(function(t) {
|
|
78
|
+
return !!(t.options.allowTouchMove && t.options.allowTouchMove(e));
|
|
79
79
|
});
|
|
80
|
-
},
|
|
81
|
-
var
|
|
82
|
-
return
|
|
83
|
-
},
|
|
84
|
-
if (
|
|
85
|
-
var
|
|
86
|
-
if (
|
|
87
|
-
var
|
|
88
|
-
|
|
80
|
+
}, J = function(e) {
|
|
81
|
+
var t = e || window.event;
|
|
82
|
+
return He(t.target) || t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
|
|
83
|
+
}, rt = function(e) {
|
|
84
|
+
if (R === void 0) {
|
|
85
|
+
var t = !!e && e.reserveScrollBarGap === !0, i = window.innerWidth - document.documentElement.clientWidth;
|
|
86
|
+
if (t && i > 0) {
|
|
87
|
+
var o = parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"), 10);
|
|
88
|
+
R = document.body.style.paddingRight, document.body.style.paddingRight = o + i + "px";
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
},
|
|
91
|
+
T === void 0 && (T = document.body.style.overflow, document.body.style.overflow = "hidden");
|
|
92
|
+
}, lt = function() {
|
|
93
|
+
R !== void 0 && (document.body.style.paddingRight = R, R = void 0), T !== void 0 && (document.body.style.overflow = T, T = void 0);
|
|
94
|
+
}, at = function() {
|
|
95
95
|
return window.requestAnimationFrame(function() {
|
|
96
|
-
if (
|
|
97
|
-
|
|
96
|
+
if (S === void 0) {
|
|
97
|
+
S = {
|
|
98
98
|
position: document.body.style.position,
|
|
99
99
|
top: document.body.style.top,
|
|
100
100
|
left: document.body.style.left
|
|
101
101
|
};
|
|
102
|
-
var e = window,
|
|
103
|
-
document.body.style.position = "fixed", document.body.style.top = -
|
|
102
|
+
var e = window, t = e.scrollY, i = e.scrollX, o = e.innerHeight;
|
|
103
|
+
document.body.style.position = "fixed", document.body.style.top = -t, document.body.style.left = -i, setTimeout(function() {
|
|
104
104
|
return window.requestAnimationFrame(function() {
|
|
105
|
-
var
|
|
106
|
-
|
|
105
|
+
var s = o - window.innerHeight;
|
|
106
|
+
s && t >= o && (document.body.style.top = -(t + s));
|
|
107
107
|
});
|
|
108
108
|
}, 300);
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
|
-
},
|
|
112
|
-
if (
|
|
113
|
-
var e = -parseInt(document.body.style.top, 10),
|
|
114
|
-
document.body.style.position =
|
|
111
|
+
}, dt = function() {
|
|
112
|
+
if (S !== void 0) {
|
|
113
|
+
var e = -parseInt(document.body.style.top, 10), t = -parseInt(document.body.style.left, 10);
|
|
114
|
+
document.body.style.position = S.position, document.body.style.top = S.top, document.body.style.left = S.left, window.scrollTo(t, e), S = void 0;
|
|
115
115
|
}
|
|
116
|
-
},
|
|
116
|
+
}, ct = function(e) {
|
|
117
117
|
return e ? e.scrollHeight - e.scrollTop <= e.clientHeight : !1;
|
|
118
|
-
},
|
|
119
|
-
var
|
|
120
|
-
return
|
|
121
|
-
},
|
|
118
|
+
}, ht = function(e, t) {
|
|
119
|
+
var i = e.targetTouches[0].clientY - Ue;
|
|
120
|
+
return He(e.target) ? !1 : t && t.scrollTop === 0 && i > 0 || ct(t) && i < 0 ? J(e) : (e.stopPropagation(), !0);
|
|
121
|
+
}, ut = function(e, t) {
|
|
122
122
|
if (!e) {
|
|
123
123
|
console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
126
|
-
if (!
|
|
127
|
-
return
|
|
126
|
+
if (!E.some(function(o) {
|
|
127
|
+
return o.targetElement === e;
|
|
128
128
|
})) {
|
|
129
|
-
var
|
|
129
|
+
var i = {
|
|
130
130
|
targetElement: e,
|
|
131
|
-
options:
|
|
131
|
+
options: t || {}
|
|
132
132
|
};
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}, e.ontouchmove = function(
|
|
136
|
-
|
|
137
|
-
},
|
|
133
|
+
E = [].concat(st(E), [i]), X ? at() : rt(t), X && (e.ontouchstart = function(o) {
|
|
134
|
+
o.targetTouches.length === 1 && (Ue = o.targetTouches[0].clientY);
|
|
135
|
+
}, e.ontouchmove = function(o) {
|
|
136
|
+
o.targetTouches.length === 1 && ht(o, e);
|
|
137
|
+
}, G || (document.addEventListener("touchmove", J, me ? { passive: !1 } : void 0), G = !0));
|
|
138
138
|
}
|
|
139
|
-
},
|
|
139
|
+
}, pt = function(e) {
|
|
140
140
|
if (!e) {
|
|
141
141
|
console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
|
|
145
|
-
return
|
|
146
|
-
}),
|
|
144
|
+
E = E.filter(function(t) {
|
|
145
|
+
return t.targetElement !== e;
|
|
146
|
+
}), X && (e.ontouchstart = null, e.ontouchmove = null, G && E.length === 0 && (document.removeEventListener("touchmove", J, me ? { passive: !1 } : void 0), G = !1)), X ? dt() : lt();
|
|
147
147
|
};
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
148
|
+
function $(n, e, t, i) {
|
|
149
|
+
var o = arguments.length, s = o < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, r;
|
|
150
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
151
|
+
s = Reflect.decorate(n, e, t, i);
|
|
152
|
+
else
|
|
153
|
+
for (var d = n.length - 1; d >= 0; d--)
|
|
154
|
+
(r = n[d]) && (s = (o < 3 ? r(s) : o > 3 ? r(e, t, s) : r(e, t)) || s);
|
|
155
|
+
return o > 3 && s && Object.defineProperty(e, t, s), s;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* @license
|
|
159
|
+
* Copyright 2019 Google LLC
|
|
160
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
161
|
+
*/
|
|
162
|
+
const Z = window, fe = Z.ShadowRoot && (Z.ShadyCSS === void 0 || Z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, be = Symbol(), Ae = /* @__PURE__ */ new WeakMap();
|
|
163
|
+
let De = class {
|
|
164
|
+
constructor(e, t, i) {
|
|
165
|
+
if (this._$cssResult$ = !0, i !== be)
|
|
166
|
+
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
167
|
+
this.cssText = e, this.t = t;
|
|
168
|
+
}
|
|
169
|
+
get styleSheet() {
|
|
170
|
+
let e = this.o;
|
|
171
|
+
const t = this.t;
|
|
172
|
+
if (fe && e === void 0) {
|
|
173
|
+
const i = t !== void 0 && t.length === 1;
|
|
174
|
+
i && (e = Ae.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && Ae.set(t, e));
|
|
175
|
+
}
|
|
176
|
+
return e;
|
|
177
|
+
}
|
|
178
|
+
toString() {
|
|
179
|
+
return this.cssText;
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
const vt = (n) => new De(typeof n == "string" ? n : n + "", void 0, be), ye = (n, ...e) => {
|
|
183
|
+
const t = n.length === 1 ? n[0] : e.reduce((i, o, s) => i + ((r) => {
|
|
184
|
+
if (r._$cssResult$ === !0)
|
|
185
|
+
return r.cssText;
|
|
186
|
+
if (typeof r == "number")
|
|
187
|
+
return r;
|
|
188
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + r + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
189
|
+
})(o) + n[s + 1], n[0]);
|
|
190
|
+
return new De(t, n, be);
|
|
191
|
+
}, gt = (n, e) => {
|
|
192
|
+
fe ? n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet) : e.forEach((t) => {
|
|
193
|
+
const i = document.createElement("style"), o = Z.litNonce;
|
|
194
|
+
o !== void 0 && i.setAttribute("nonce", o), i.textContent = t.cssText, n.appendChild(i);
|
|
195
|
+
});
|
|
196
|
+
}, Se = fe ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((e) => {
|
|
197
|
+
let t = "";
|
|
198
|
+
for (const i of e.cssRules)
|
|
199
|
+
t += i.cssText;
|
|
200
|
+
return vt(t);
|
|
201
|
+
})(n) : n;
|
|
202
|
+
/**
|
|
203
|
+
* @license
|
|
204
|
+
* Copyright 2017 Google LLC
|
|
205
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
206
|
+
*/
|
|
207
|
+
var oe;
|
|
208
|
+
const K = window, xe = K.trustedTypes, mt = xe ? xe.emptyScript : "", Ee = K.reactiveElementPolyfillSupport, ue = { toAttribute(n, e) {
|
|
209
|
+
switch (e) {
|
|
210
|
+
case Boolean:
|
|
211
|
+
n = n ? mt : null;
|
|
212
|
+
break;
|
|
213
|
+
case Object:
|
|
214
|
+
case Array:
|
|
215
|
+
n = n == null ? n : JSON.stringify(n);
|
|
216
|
+
}
|
|
217
|
+
return n;
|
|
218
|
+
}, fromAttribute(n, e) {
|
|
219
|
+
let t = n;
|
|
220
|
+
switch (e) {
|
|
221
|
+
case Boolean:
|
|
222
|
+
t = n !== null;
|
|
223
|
+
break;
|
|
224
|
+
case Number:
|
|
225
|
+
t = n === null ? null : Number(n);
|
|
226
|
+
break;
|
|
227
|
+
case Object:
|
|
228
|
+
case Array:
|
|
229
|
+
try {
|
|
230
|
+
t = JSON.parse(n);
|
|
231
|
+
} catch {
|
|
232
|
+
t = null;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return t;
|
|
236
|
+
} }, Ne = (n, e) => e !== n && (e == e || n == n), ne = { attribute: !0, type: String, converter: ue, reflect: !1, hasChanged: Ne }, pe = "finalized";
|
|
237
|
+
let z = class extends HTMLElement {
|
|
238
|
+
constructor() {
|
|
239
|
+
super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this.u();
|
|
240
|
+
}
|
|
241
|
+
static addInitializer(e) {
|
|
242
|
+
var t;
|
|
243
|
+
this.finalize(), ((t = this.h) !== null && t !== void 0 ? t : this.h = []).push(e);
|
|
244
|
+
}
|
|
245
|
+
static get observedAttributes() {
|
|
246
|
+
this.finalize();
|
|
247
|
+
const e = [];
|
|
248
|
+
return this.elementProperties.forEach((t, i) => {
|
|
249
|
+
const o = this._$Ep(i, t);
|
|
250
|
+
o !== void 0 && (this._$Ev.set(o, i), e.push(o));
|
|
251
|
+
}), e;
|
|
252
|
+
}
|
|
253
|
+
static createProperty(e, t = ne) {
|
|
254
|
+
if (t.state && (t.attribute = !1), this.finalize(), this.elementProperties.set(e, t), !t.noAccessor && !this.prototype.hasOwnProperty(e)) {
|
|
255
|
+
const i = typeof e == "symbol" ? Symbol() : "__" + e, o = this.getPropertyDescriptor(e, i, t);
|
|
256
|
+
o !== void 0 && Object.defineProperty(this.prototype, e, o);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
static getPropertyDescriptor(e, t, i) {
|
|
260
|
+
return { get() {
|
|
261
|
+
return this[t];
|
|
262
|
+
}, set(o) {
|
|
263
|
+
const s = this[e];
|
|
264
|
+
this[t] = o, this.requestUpdate(e, s, i);
|
|
265
|
+
}, configurable: !0, enumerable: !0 };
|
|
266
|
+
}
|
|
267
|
+
static getPropertyOptions(e) {
|
|
268
|
+
return this.elementProperties.get(e) || ne;
|
|
269
|
+
}
|
|
270
|
+
static finalize() {
|
|
271
|
+
if (this.hasOwnProperty(pe))
|
|
272
|
+
return !1;
|
|
273
|
+
this[pe] = !0;
|
|
274
|
+
const e = Object.getPrototypeOf(this);
|
|
275
|
+
if (e.finalize(), e.h !== void 0 && (this.h = [...e.h]), this.elementProperties = new Map(e.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) {
|
|
276
|
+
const t = this.properties, i = [...Object.getOwnPropertyNames(t), ...Object.getOwnPropertySymbols(t)];
|
|
277
|
+
for (const o of i)
|
|
278
|
+
this.createProperty(o, t[o]);
|
|
279
|
+
}
|
|
280
|
+
return this.elementStyles = this.finalizeStyles(this.styles), !0;
|
|
281
|
+
}
|
|
282
|
+
static finalizeStyles(e) {
|
|
283
|
+
const t = [];
|
|
284
|
+
if (Array.isArray(e)) {
|
|
285
|
+
const i = new Set(e.flat(1 / 0).reverse());
|
|
286
|
+
for (const o of i)
|
|
287
|
+
t.unshift(Se(o));
|
|
288
|
+
} else
|
|
289
|
+
e !== void 0 && t.push(Se(e));
|
|
290
|
+
return t;
|
|
291
|
+
}
|
|
292
|
+
static _$Ep(e, t) {
|
|
293
|
+
const i = t.attribute;
|
|
294
|
+
return i === !1 ? void 0 : typeof i == "string" ? i : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
295
|
+
}
|
|
296
|
+
u() {
|
|
297
|
+
var e;
|
|
298
|
+
this._$E_ = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$Eg(), this.requestUpdate(), (e = this.constructor.h) === null || e === void 0 || e.forEach((t) => t(this));
|
|
299
|
+
}
|
|
300
|
+
addController(e) {
|
|
301
|
+
var t, i;
|
|
302
|
+
((t = this._$ES) !== null && t !== void 0 ? t : this._$ES = []).push(e), this.renderRoot !== void 0 && this.isConnected && ((i = e.hostConnected) === null || i === void 0 || i.call(e));
|
|
303
|
+
}
|
|
304
|
+
removeController(e) {
|
|
305
|
+
var t;
|
|
306
|
+
(t = this._$ES) === null || t === void 0 || t.splice(this._$ES.indexOf(e) >>> 0, 1);
|
|
307
|
+
}
|
|
308
|
+
_$Eg() {
|
|
309
|
+
this.constructor.elementProperties.forEach((e, t) => {
|
|
310
|
+
this.hasOwnProperty(t) && (this._$Ei.set(t, this[t]), delete this[t]);
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
createRenderRoot() {
|
|
314
|
+
var e;
|
|
315
|
+
const t = (e = this.shadowRoot) !== null && e !== void 0 ? e : this.attachShadow(this.constructor.shadowRootOptions);
|
|
316
|
+
return gt(t, this.constructor.elementStyles), t;
|
|
317
|
+
}
|
|
318
|
+
connectedCallback() {
|
|
319
|
+
var e;
|
|
320
|
+
this.renderRoot === void 0 && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (e = this._$ES) === null || e === void 0 || e.forEach((t) => {
|
|
321
|
+
var i;
|
|
322
|
+
return (i = t.hostConnected) === null || i === void 0 ? void 0 : i.call(t);
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
enableUpdating(e) {
|
|
326
|
+
}
|
|
327
|
+
disconnectedCallback() {
|
|
328
|
+
var e;
|
|
329
|
+
(e = this._$ES) === null || e === void 0 || e.forEach((t) => {
|
|
330
|
+
var i;
|
|
331
|
+
return (i = t.hostDisconnected) === null || i === void 0 ? void 0 : i.call(t);
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
attributeChangedCallback(e, t, i) {
|
|
335
|
+
this._$AK(e, i);
|
|
336
|
+
}
|
|
337
|
+
_$EO(e, t, i = ne) {
|
|
338
|
+
var o;
|
|
339
|
+
const s = this.constructor._$Ep(e, i);
|
|
340
|
+
if (s !== void 0 && i.reflect === !0) {
|
|
341
|
+
const r = (((o = i.converter) === null || o === void 0 ? void 0 : o.toAttribute) !== void 0 ? i.converter : ue).toAttribute(t, i.type);
|
|
342
|
+
this._$El = e, r == null ? this.removeAttribute(s) : this.setAttribute(s, r), this._$El = null;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
_$AK(e, t) {
|
|
346
|
+
var i;
|
|
347
|
+
const o = this.constructor, s = o._$Ev.get(e);
|
|
348
|
+
if (s !== void 0 && this._$El !== s) {
|
|
349
|
+
const r = o.getPropertyOptions(s), d = typeof r.converter == "function" ? { fromAttribute: r.converter } : ((i = r.converter) === null || i === void 0 ? void 0 : i.fromAttribute) !== void 0 ? r.converter : ue;
|
|
350
|
+
this._$El = s, this[s] = d.fromAttribute(t, r.type), this._$El = null;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
requestUpdate(e, t, i) {
|
|
354
|
+
let o = !0;
|
|
355
|
+
e !== void 0 && (((i = i || this.constructor.getPropertyOptions(e)).hasChanged || Ne)(this[e], t) ? (this._$AL.has(e) || this._$AL.set(e, t), i.reflect === !0 && this._$El !== e && (this._$EC === void 0 && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(e, i))) : o = !1), !this.isUpdatePending && o && (this._$E_ = this._$Ej());
|
|
356
|
+
}
|
|
357
|
+
async _$Ej() {
|
|
358
|
+
this.isUpdatePending = !0;
|
|
359
|
+
try {
|
|
360
|
+
await this._$E_;
|
|
361
|
+
} catch (t) {
|
|
362
|
+
Promise.reject(t);
|
|
363
|
+
}
|
|
364
|
+
const e = this.scheduleUpdate();
|
|
365
|
+
return e != null && await e, !this.isUpdatePending;
|
|
366
|
+
}
|
|
367
|
+
scheduleUpdate() {
|
|
368
|
+
return this.performUpdate();
|
|
369
|
+
}
|
|
370
|
+
performUpdate() {
|
|
371
|
+
var e;
|
|
372
|
+
if (!this.isUpdatePending)
|
|
373
|
+
return;
|
|
374
|
+
this.hasUpdated, this._$Ei && (this._$Ei.forEach((o, s) => this[s] = o), this._$Ei = void 0);
|
|
375
|
+
let t = !1;
|
|
376
|
+
const i = this._$AL;
|
|
377
|
+
try {
|
|
378
|
+
t = this.shouldUpdate(i), t ? (this.willUpdate(i), (e = this._$ES) === null || e === void 0 || e.forEach((o) => {
|
|
379
|
+
var s;
|
|
380
|
+
return (s = o.hostUpdate) === null || s === void 0 ? void 0 : s.call(o);
|
|
381
|
+
}), this.update(i)) : this._$Ek();
|
|
382
|
+
} catch (o) {
|
|
383
|
+
throw t = !1, this._$Ek(), o;
|
|
384
|
+
}
|
|
385
|
+
t && this._$AE(i);
|
|
386
|
+
}
|
|
387
|
+
willUpdate(e) {
|
|
388
|
+
}
|
|
389
|
+
_$AE(e) {
|
|
390
|
+
var t;
|
|
391
|
+
(t = this._$ES) === null || t === void 0 || t.forEach((i) => {
|
|
392
|
+
var o;
|
|
393
|
+
return (o = i.hostUpdated) === null || o === void 0 ? void 0 : o.call(i);
|
|
394
|
+
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
395
|
+
}
|
|
396
|
+
_$Ek() {
|
|
397
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
398
|
+
}
|
|
399
|
+
get updateComplete() {
|
|
400
|
+
return this.getUpdateComplete();
|
|
401
|
+
}
|
|
402
|
+
getUpdateComplete() {
|
|
403
|
+
return this._$E_;
|
|
404
|
+
}
|
|
405
|
+
shouldUpdate(e) {
|
|
406
|
+
return !0;
|
|
407
|
+
}
|
|
408
|
+
update(e) {
|
|
409
|
+
this._$EC !== void 0 && (this._$EC.forEach((t, i) => this._$EO(i, this[i], t)), this._$EC = void 0), this._$Ek();
|
|
410
|
+
}
|
|
411
|
+
updated(e) {
|
|
412
|
+
}
|
|
413
|
+
firstUpdated(e) {
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
z[pe] = !0, z.elementProperties = /* @__PURE__ */ new Map(), z.elementStyles = [], z.shadowRootOptions = { mode: "open" }, Ee == null || Ee({ ReactiveElement: z }), ((oe = K.reactiveElementVersions) !== null && oe !== void 0 ? oe : K.reactiveElementVersions = []).push("1.6.2");
|
|
417
|
+
/**
|
|
418
|
+
* @license
|
|
419
|
+
* Copyright 2017 Google LLC
|
|
420
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
421
|
+
*/
|
|
422
|
+
var se;
|
|
423
|
+
const Q = window, O = Q.trustedTypes, Ce = O ? O.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, ve = "$lit$", _ = `lit$${(Math.random() + "").slice(9)}$`, je = "?" + _, ft = `<${je}>`, k = document, U = () => k.createComment(""), H = (n) => n === null || typeof n != "object" && typeof n != "function", Fe = Array.isArray, bt = (n) => Fe(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", re = `[
|
|
424
|
+
\f\r]`, B = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ke = /-->/g, ze = />/g, A = RegExp(`>|${re}(?:([^\\s"'>=/]+)(${re}*=${re}*(?:[^
|
|
425
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Oe = /'/g, Pe = /"/g, Ve = /^(?:script|style|textarea|title)$/i, yt = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), $e = yt(1), P = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), Me = /* @__PURE__ */ new WeakMap(), x = k.createTreeWalker(k, 129, null, !1), $t = (n, e) => {
|
|
426
|
+
const t = n.length - 1, i = [];
|
|
427
|
+
let o, s = e === 2 ? "<svg>" : "", r = B;
|
|
428
|
+
for (let l = 0; l < t; l++) {
|
|
429
|
+
const a = n[l];
|
|
430
|
+
let b, c, h = -1, m = 0;
|
|
431
|
+
for (; m < a.length && (r.lastIndex = m, c = r.exec(a), c !== null); )
|
|
432
|
+
m = r.lastIndex, r === B ? c[1] === "!--" ? r = ke : c[1] !== void 0 ? r = ze : c[2] !== void 0 ? (Ve.test(c[2]) && (o = RegExp("</" + c[2], "g")), r = A) : c[3] !== void 0 && (r = A) : r === A ? c[0] === ">" ? (r = o ?? B, h = -1) : c[1] === void 0 ? h = -2 : (h = r.lastIndex - c[2].length, b = c[1], r = c[3] === void 0 ? A : c[3] === '"' ? Pe : Oe) : r === Pe || r === Oe ? r = A : r === ke || r === ze ? r = B : (r = A, o = void 0);
|
|
433
|
+
const w = r === A && n[l + 1].startsWith("/>") ? " " : "";
|
|
434
|
+
s += r === B ? a + ft : h >= 0 ? (i.push(b), a.slice(0, h) + ve + a.slice(h) + _ + w) : a + _ + (h === -2 ? (i.push(void 0), l) : w);
|
|
435
|
+
}
|
|
436
|
+
const d = s + (n[t] || "<?>") + (e === 2 ? "</svg>" : "");
|
|
437
|
+
if (!Array.isArray(n) || !n.hasOwnProperty("raw"))
|
|
438
|
+
throw Error("invalid template strings array");
|
|
439
|
+
return [Ce !== void 0 ? Ce.createHTML(d) : d, i];
|
|
440
|
+
};
|
|
441
|
+
class D {
|
|
442
|
+
constructor({ strings: e, _$litType$: t }, i) {
|
|
443
|
+
let o;
|
|
444
|
+
this.parts = [];
|
|
445
|
+
let s = 0, r = 0;
|
|
446
|
+
const d = e.length - 1, l = this.parts, [a, b] = $t(e, t);
|
|
447
|
+
if (this.el = D.createElement(a, i), x.currentNode = this.el.content, t === 2) {
|
|
448
|
+
const c = this.el.content, h = c.firstChild;
|
|
449
|
+
h.remove(), c.append(...h.childNodes);
|
|
450
|
+
}
|
|
451
|
+
for (; (o = x.nextNode()) !== null && l.length < d; ) {
|
|
452
|
+
if (o.nodeType === 1) {
|
|
453
|
+
if (o.hasAttributes()) {
|
|
454
|
+
const c = [];
|
|
455
|
+
for (const h of o.getAttributeNames())
|
|
456
|
+
if (h.endsWith(ve) || h.startsWith(_)) {
|
|
457
|
+
const m = b[r++];
|
|
458
|
+
if (c.push(h), m !== void 0) {
|
|
459
|
+
const w = o.getAttribute(m.toLowerCase() + ve).split(_), q = /([.?@])?(.*)/.exec(m);
|
|
460
|
+
l.push({ type: 1, index: s, name: q[2], strings: w, ctor: q[1] === "." ? wt : q[1] === "?" ? St : q[1] === "@" ? xt : ie });
|
|
461
|
+
} else
|
|
462
|
+
l.push({ type: 6, index: s });
|
|
463
|
+
}
|
|
464
|
+
for (const h of c)
|
|
465
|
+
o.removeAttribute(h);
|
|
466
|
+
}
|
|
467
|
+
if (Ve.test(o.tagName)) {
|
|
468
|
+
const c = o.textContent.split(_), h = c.length - 1;
|
|
469
|
+
if (h > 0) {
|
|
470
|
+
o.textContent = O ? O.emptyScript : "";
|
|
471
|
+
for (let m = 0; m < h; m++)
|
|
472
|
+
o.append(c[m], U()), x.nextNode(), l.push({ type: 2, index: ++s });
|
|
473
|
+
o.append(c[h], U());
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
} else if (o.nodeType === 8)
|
|
477
|
+
if (o.data === je)
|
|
478
|
+
l.push({ type: 2, index: s });
|
|
479
|
+
else {
|
|
480
|
+
let c = -1;
|
|
481
|
+
for (; (c = o.data.indexOf(_, c + 1)) !== -1; )
|
|
482
|
+
l.push({ type: 7, index: s }), c += _.length - 1;
|
|
483
|
+
}
|
|
484
|
+
s++;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
static createElement(e, t) {
|
|
488
|
+
const i = k.createElement("template");
|
|
489
|
+
return i.innerHTML = e, i;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
function M(n, e, t = n, i) {
|
|
493
|
+
var o, s, r, d;
|
|
494
|
+
if (e === P)
|
|
495
|
+
return e;
|
|
496
|
+
let l = i !== void 0 ? (o = t._$Co) === null || o === void 0 ? void 0 : o[i] : t._$Cl;
|
|
497
|
+
const a = H(e) ? void 0 : e._$litDirective$;
|
|
498
|
+
return (l == null ? void 0 : l.constructor) !== a && ((s = l == null ? void 0 : l._$AO) === null || s === void 0 || s.call(l, !1), a === void 0 ? l = void 0 : (l = new a(n), l._$AT(n, t, i)), i !== void 0 ? ((r = (d = t)._$Co) !== null && r !== void 0 ? r : d._$Co = [])[i] = l : t._$Cl = l), l !== void 0 && (e = M(n, l._$AS(n, e.values), l, i)), e;
|
|
499
|
+
}
|
|
500
|
+
class _t {
|
|
501
|
+
constructor(e, t) {
|
|
502
|
+
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
503
|
+
}
|
|
504
|
+
get parentNode() {
|
|
505
|
+
return this._$AM.parentNode;
|
|
506
|
+
}
|
|
507
|
+
get _$AU() {
|
|
508
|
+
return this._$AM._$AU;
|
|
509
|
+
}
|
|
510
|
+
u(e) {
|
|
511
|
+
var t;
|
|
512
|
+
const { el: { content: i }, parts: o } = this._$AD, s = ((t = e == null ? void 0 : e.creationScope) !== null && t !== void 0 ? t : k).importNode(i, !0);
|
|
513
|
+
x.currentNode = s;
|
|
514
|
+
let r = x.nextNode(), d = 0, l = 0, a = o[0];
|
|
515
|
+
for (; a !== void 0; ) {
|
|
516
|
+
if (d === a.index) {
|
|
517
|
+
let b;
|
|
518
|
+
a.type === 2 ? b = new N(r, r.nextSibling, this, e) : a.type === 1 ? b = new a.ctor(r, a.name, a.strings, this, e) : a.type === 6 && (b = new Et(r, this, e)), this._$AV.push(b), a = o[++l];
|
|
519
|
+
}
|
|
520
|
+
d !== (a == null ? void 0 : a.index) && (r = x.nextNode(), d++);
|
|
521
|
+
}
|
|
522
|
+
return x.currentNode = k, s;
|
|
523
|
+
}
|
|
524
|
+
v(e) {
|
|
525
|
+
let t = 0;
|
|
526
|
+
for (const i of this._$AV)
|
|
527
|
+
i !== void 0 && (i.strings !== void 0 ? (i._$AI(e, i, t), t += i.strings.length - 2) : i._$AI(e[t])), t++;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
class N {
|
|
531
|
+
constructor(e, t, i, o) {
|
|
532
|
+
var s;
|
|
533
|
+
this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = o, this._$Cp = (s = o == null ? void 0 : o.isConnected) === null || s === void 0 || s;
|
|
534
|
+
}
|
|
535
|
+
get _$AU() {
|
|
536
|
+
var e, t;
|
|
537
|
+
return (t = (e = this._$AM) === null || e === void 0 ? void 0 : e._$AU) !== null && t !== void 0 ? t : this._$Cp;
|
|
538
|
+
}
|
|
539
|
+
get parentNode() {
|
|
540
|
+
let e = this._$AA.parentNode;
|
|
541
|
+
const t = this._$AM;
|
|
542
|
+
return t !== void 0 && (e == null ? void 0 : e.nodeType) === 11 && (e = t.parentNode), e;
|
|
543
|
+
}
|
|
544
|
+
get startNode() {
|
|
545
|
+
return this._$AA;
|
|
546
|
+
}
|
|
547
|
+
get endNode() {
|
|
548
|
+
return this._$AB;
|
|
549
|
+
}
|
|
550
|
+
_$AI(e, t = this) {
|
|
551
|
+
e = M(this, e, t), H(e) ? e === u || e == null || e === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : e !== this._$AH && e !== P && this._(e) : e._$litType$ !== void 0 ? this.g(e) : e.nodeType !== void 0 ? this.$(e) : bt(e) ? this.T(e) : this._(e);
|
|
552
|
+
}
|
|
553
|
+
k(e) {
|
|
554
|
+
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
555
|
+
}
|
|
556
|
+
$(e) {
|
|
557
|
+
this._$AH !== e && (this._$AR(), this._$AH = this.k(e));
|
|
558
|
+
}
|
|
559
|
+
_(e) {
|
|
560
|
+
this._$AH !== u && H(this._$AH) ? this._$AA.nextSibling.data = e : this.$(k.createTextNode(e)), this._$AH = e;
|
|
561
|
+
}
|
|
562
|
+
g(e) {
|
|
563
|
+
var t;
|
|
564
|
+
const { values: i, _$litType$: o } = e, s = typeof o == "number" ? this._$AC(e) : (o.el === void 0 && (o.el = D.createElement(o.h, this.options)), o);
|
|
565
|
+
if (((t = this._$AH) === null || t === void 0 ? void 0 : t._$AD) === s)
|
|
566
|
+
this._$AH.v(i);
|
|
567
|
+
else {
|
|
568
|
+
const r = new _t(s, this), d = r.u(this.options);
|
|
569
|
+
r.v(i), this.$(d), this._$AH = r;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
_$AC(e) {
|
|
573
|
+
let t = Me.get(e.strings);
|
|
574
|
+
return t === void 0 && Me.set(e.strings, t = new D(e)), t;
|
|
575
|
+
}
|
|
576
|
+
T(e) {
|
|
577
|
+
Fe(this._$AH) || (this._$AH = [], this._$AR());
|
|
578
|
+
const t = this._$AH;
|
|
579
|
+
let i, o = 0;
|
|
580
|
+
for (const s of e)
|
|
581
|
+
o === t.length ? t.push(i = new N(this.k(U()), this.k(U()), this, this.options)) : i = t[o], i._$AI(s), o++;
|
|
582
|
+
o < t.length && (this._$AR(i && i._$AB.nextSibling, o), t.length = o);
|
|
583
|
+
}
|
|
584
|
+
_$AR(e = this._$AA.nextSibling, t) {
|
|
585
|
+
var i;
|
|
586
|
+
for ((i = this._$AP) === null || i === void 0 || i.call(this, !1, !0, t); e && e !== this._$AB; ) {
|
|
587
|
+
const o = e.nextSibling;
|
|
588
|
+
e.remove(), e = o;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
setConnected(e) {
|
|
592
|
+
var t;
|
|
593
|
+
this._$AM === void 0 && (this._$Cp = e, (t = this._$AP) === null || t === void 0 || t.call(this, e));
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
class ie {
|
|
597
|
+
constructor(e, t, i, o, s) {
|
|
598
|
+
this.type = 1, this._$AH = u, this._$AN = void 0, this.element = e, this.name = t, this._$AM = o, this.options = s, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = u;
|
|
599
|
+
}
|
|
600
|
+
get tagName() {
|
|
601
|
+
return this.element.tagName;
|
|
602
|
+
}
|
|
603
|
+
get _$AU() {
|
|
604
|
+
return this._$AM._$AU;
|
|
605
|
+
}
|
|
606
|
+
_$AI(e, t = this, i, o) {
|
|
607
|
+
const s = this.strings;
|
|
608
|
+
let r = !1;
|
|
609
|
+
if (s === void 0)
|
|
610
|
+
e = M(this, e, t, 0), r = !H(e) || e !== this._$AH && e !== P, r && (this._$AH = e);
|
|
611
|
+
else {
|
|
612
|
+
const d = e;
|
|
613
|
+
let l, a;
|
|
614
|
+
for (e = s[0], l = 0; l < s.length - 1; l++)
|
|
615
|
+
a = M(this, d[i + l], t, l), a === P && (a = this._$AH[l]), r || (r = !H(a) || a !== this._$AH[l]), a === u ? e = u : e !== u && (e += (a ?? "") + s[l + 1]), this._$AH[l] = a;
|
|
616
|
+
}
|
|
617
|
+
r && !o && this.j(e);
|
|
618
|
+
}
|
|
619
|
+
j(e) {
|
|
620
|
+
e === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
class wt extends ie {
|
|
624
|
+
constructor() {
|
|
625
|
+
super(...arguments), this.type = 3;
|
|
626
|
+
}
|
|
627
|
+
j(e) {
|
|
628
|
+
this.element[this.name] = e === u ? void 0 : e;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
const At = O ? O.emptyScript : "";
|
|
632
|
+
class St extends ie {
|
|
633
|
+
constructor() {
|
|
634
|
+
super(...arguments), this.type = 4;
|
|
635
|
+
}
|
|
636
|
+
j(e) {
|
|
637
|
+
e && e !== u ? this.element.setAttribute(this.name, At) : this.element.removeAttribute(this.name);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
class xt extends ie {
|
|
641
|
+
constructor(e, t, i, o, s) {
|
|
642
|
+
super(e, t, i, o, s), this.type = 5;
|
|
643
|
+
}
|
|
644
|
+
_$AI(e, t = this) {
|
|
645
|
+
var i;
|
|
646
|
+
if ((e = (i = M(this, e, t, 0)) !== null && i !== void 0 ? i : u) === P)
|
|
647
|
+
return;
|
|
648
|
+
const o = this._$AH, s = e === u && o !== u || e.capture !== o.capture || e.once !== o.once || e.passive !== o.passive, r = e !== u && (o === u || s);
|
|
649
|
+
s && this.element.removeEventListener(this.name, this, o), r && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
650
|
+
}
|
|
651
|
+
handleEvent(e) {
|
|
652
|
+
var t, i;
|
|
653
|
+
typeof this._$AH == "function" ? this._$AH.call((i = (t = this.options) === null || t === void 0 ? void 0 : t.host) !== null && i !== void 0 ? i : this.element, e) : this._$AH.handleEvent(e);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
class Et {
|
|
657
|
+
constructor(e, t, i) {
|
|
658
|
+
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = i;
|
|
659
|
+
}
|
|
660
|
+
get _$AU() {
|
|
661
|
+
return this._$AM._$AU;
|
|
662
|
+
}
|
|
663
|
+
_$AI(e) {
|
|
664
|
+
M(this, e);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
const Le = Q.litHtmlPolyfillSupport;
|
|
668
|
+
Le == null || Le(D, N), ((se = Q.litHtmlVersions) !== null && se !== void 0 ? se : Q.litHtmlVersions = []).push("2.7.4");
|
|
669
|
+
const Ct = (n, e, t) => {
|
|
670
|
+
var i, o;
|
|
671
|
+
const s = (i = t == null ? void 0 : t.renderBefore) !== null && i !== void 0 ? i : e;
|
|
672
|
+
let r = s._$litPart$;
|
|
673
|
+
if (r === void 0) {
|
|
674
|
+
const d = (o = t == null ? void 0 : t.renderBefore) !== null && o !== void 0 ? o : null;
|
|
675
|
+
s._$litPart$ = r = new N(e.insertBefore(U(), d), d, void 0, t ?? {});
|
|
676
|
+
}
|
|
677
|
+
return r._$AI(n), r;
|
|
154
678
|
};
|
|
155
|
-
|
|
156
|
-
|
|
679
|
+
/**
|
|
680
|
+
* @license
|
|
681
|
+
* Copyright 2017 Google LLC
|
|
682
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
683
|
+
*/
|
|
684
|
+
var le, ae;
|
|
685
|
+
class C extends z {
|
|
157
686
|
constructor() {
|
|
158
|
-
super(), this.
|
|
687
|
+
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
688
|
+
}
|
|
689
|
+
createRenderRoot() {
|
|
690
|
+
var e, t;
|
|
691
|
+
const i = super.createRenderRoot();
|
|
692
|
+
return (e = (t = this.renderOptions).renderBefore) !== null && e !== void 0 || (t.renderBefore = i.firstChild), i;
|
|
693
|
+
}
|
|
694
|
+
update(e) {
|
|
695
|
+
const t = this.render();
|
|
696
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Ct(t, this.renderRoot, this.renderOptions);
|
|
697
|
+
}
|
|
698
|
+
connectedCallback() {
|
|
699
|
+
var e;
|
|
700
|
+
super.connectedCallback(), (e = this._$Do) === null || e === void 0 || e.setConnected(!0);
|
|
701
|
+
}
|
|
702
|
+
disconnectedCallback() {
|
|
703
|
+
var e;
|
|
704
|
+
super.disconnectedCallback(), (e = this._$Do) === null || e === void 0 || e.setConnected(!1);
|
|
705
|
+
}
|
|
706
|
+
render() {
|
|
707
|
+
return P;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
C.finalized = !0, C._$litElement$ = !0, (le = globalThis.litElementHydrateSupport) === null || le === void 0 || le.call(globalThis, { LitElement: C });
|
|
711
|
+
const Ie = globalThis.litElementPolyfillSupport;
|
|
712
|
+
Ie == null || Ie({ LitElement: C });
|
|
713
|
+
((ae = globalThis.litElementVersions) !== null && ae !== void 0 ? ae : globalThis.litElementVersions = []).push("3.3.2");
|
|
714
|
+
/**
|
|
715
|
+
* @license
|
|
716
|
+
* Copyright 2017 Google LLC
|
|
717
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
718
|
+
*/
|
|
719
|
+
const kt = (n, e) => e.kind === "method" && e.descriptor && !("value" in e.descriptor) ? { ...e, finisher(t) {
|
|
720
|
+
t.createProperty(e.key, n);
|
|
721
|
+
} } : { kind: "field", key: Symbol(), placement: "own", descriptor: {}, originalKey: e.key, initializer() {
|
|
722
|
+
typeof e.initializer == "function" && (this[e.key] = e.initializer.call(this));
|
|
723
|
+
}, finisher(t) {
|
|
724
|
+
t.createProperty(e.key, n);
|
|
725
|
+
} }, zt = (n, e, t) => {
|
|
726
|
+
e.constructor.createProperty(t, n);
|
|
727
|
+
};
|
|
728
|
+
function I(n) {
|
|
729
|
+
return (e, t) => t !== void 0 ? zt(n, e, t) : kt(n, e);
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* @license
|
|
733
|
+
* Copyright 2017 Google LLC
|
|
734
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
735
|
+
*/
|
|
736
|
+
const Ot = ({ finisher: n, descriptor: e }) => (t, i) => {
|
|
737
|
+
var o;
|
|
738
|
+
if (i === void 0) {
|
|
739
|
+
const s = (o = t.originalKey) !== null && o !== void 0 ? o : t.key, r = e != null ? { kind: "method", placement: "prototype", key: s, descriptor: e(t.key) } : { ...t, key: s };
|
|
740
|
+
return n != null && (r.finisher = function(d) {
|
|
741
|
+
n(d, s);
|
|
742
|
+
}), r;
|
|
743
|
+
}
|
|
744
|
+
{
|
|
745
|
+
const s = t.constructor;
|
|
746
|
+
e !== void 0 && Object.defineProperty(t, i, e(i)), n == null || n(s, i);
|
|
747
|
+
}
|
|
748
|
+
};
|
|
749
|
+
/**
|
|
750
|
+
* @license
|
|
751
|
+
* Copyright 2017 Google LLC
|
|
752
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
753
|
+
*/
|
|
754
|
+
function _e(n, e) {
|
|
755
|
+
return Ot({ descriptor: (t) => {
|
|
756
|
+
const i = { get() {
|
|
757
|
+
var o, s;
|
|
758
|
+
return (s = (o = this.renderRoot) === null || o === void 0 ? void 0 : o.querySelector(n)) !== null && s !== void 0 ? s : null;
|
|
759
|
+
}, enumerable: !0, configurable: !0 };
|
|
760
|
+
if (e) {
|
|
761
|
+
const o = typeof t == "symbol" ? Symbol() : "__" + t;
|
|
762
|
+
i.get = function() {
|
|
763
|
+
var s, r;
|
|
764
|
+
return this[o] === void 0 && (this[o] = (r = (s = this.renderRoot) === null || s === void 0 ? void 0 : s.querySelector(n)) !== null && r !== void 0 ? r : null), this[o];
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
return i;
|
|
768
|
+
} });
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* @license
|
|
772
|
+
* Copyright 2021 Google LLC
|
|
773
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
774
|
+
*/
|
|
775
|
+
var de;
|
|
776
|
+
((de = window.HTMLSlotElement) === null || de === void 0 ? void 0 : de.prototype.assignedElements) != null;
|
|
777
|
+
const ee = {
|
|
778
|
+
xs: 16,
|
|
779
|
+
s: 20,
|
|
780
|
+
m: 24,
|
|
781
|
+
l: 28,
|
|
782
|
+
xl: 32,
|
|
783
|
+
xxl: 40
|
|
784
|
+
}, We = Object.keys(ee), qe = "xs", Ye = 8, te = 32;
|
|
785
|
+
function Pt(n, e, t) {
|
|
786
|
+
const i = parseInt(n, 10), o = i % t === 0;
|
|
787
|
+
return i >= e && o;
|
|
788
|
+
}
|
|
789
|
+
const Ze = {
|
|
790
|
+
large: (n) => Pt(n, te, Ye),
|
|
791
|
+
regular: (n) => We.includes(n)
|
|
792
|
+
};
|
|
793
|
+
function Mt(n) {
|
|
794
|
+
const e = Ze.large(n);
|
|
795
|
+
return { isValid: e, size: e ? n : te };
|
|
796
|
+
}
|
|
797
|
+
function Lt(n) {
|
|
798
|
+
const e = Ze.regular(n), t = e ? ee[n] : ee[qe];
|
|
799
|
+
return { isValid: e, size: t };
|
|
800
|
+
}
|
|
801
|
+
const L = (n, e, t, i) => {
|
|
802
|
+
const o = n.endsWith("Large") || n.endsWith("-large");
|
|
803
|
+
let s, r;
|
|
804
|
+
if (t) {
|
|
805
|
+
if ({ isValid: s, size: r } = o ? Mt(t) : Lt(t), !s) {
|
|
806
|
+
const d = o ? `Invalid prop "size" value supplied to "${i}". The prop value should be a number equal or greater than ${te} and multiple of ${Ye}.` : `Invalid prop "size" value supplied to "${i}". The prop value should be one of the following values: ${We.join(", ")}.`;
|
|
807
|
+
console.error(d);
|
|
808
|
+
}
|
|
809
|
+
} else
|
|
810
|
+
r = o ? te : ee[qe];
|
|
811
|
+
return {
|
|
812
|
+
class: [n, e].filter(Boolean).join(" "),
|
|
813
|
+
width: r,
|
|
814
|
+
height: r
|
|
815
|
+
};
|
|
816
|
+
}, Be = "icon-close";
|
|
817
|
+
class j extends C {
|
|
818
|
+
constructor() {
|
|
819
|
+
super(...arguments), this.size = "xs", this.class = "c-pieIcon c-pieIcon--close";
|
|
820
|
+
}
|
|
821
|
+
connectedCallback() {
|
|
822
|
+
var e, t, i;
|
|
823
|
+
if (super.connectedCallback(), ((e = this._svg) === null || e === void 0 ? void 0 : e.getAttribute("width")) === null) {
|
|
824
|
+
const o = L("c-pieIcon c-pieIcon--close", "", null, "IconClose");
|
|
825
|
+
(t = this._svg) === null || t === void 0 || t.setAttribute("width", o.width), (i = this._svg) === null || i === void 0 || i.setAttribute("height", o.height);
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
updated(e) {
|
|
829
|
+
var t, i;
|
|
830
|
+
let o;
|
|
831
|
+
e.has("size") && (o = L("c-pieIcon c-pieIcon--close", "", this.size, "IconClose"), (t = this._svg) === null || t === void 0 || t.setAttribute("width", o.width), (i = this._svg) === null || i === void 0 || i.setAttribute("height", o.height));
|
|
832
|
+
}
|
|
833
|
+
render() {
|
|
834
|
+
return $e`<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--close"><path d="M11.868 3.205 8 7.072 4.133 3.205l-.928.927L7.073 8l-3.868 3.867.928.928L8 8.927l3.868 3.868.927-.928L8.928 8l3.867-3.868-.927-.927Z"></path></svg>`;
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
j.styles = ye`
|
|
838
|
+
:host-context(pie-icon-button) svg,
|
|
839
|
+
:host-context(pie-button) svg {
|
|
840
|
+
display: block;
|
|
841
|
+
width: var(--btn-icon-size);
|
|
842
|
+
height: var(--btn-icon-size);
|
|
843
|
+
}
|
|
844
|
+
`;
|
|
845
|
+
$([
|
|
846
|
+
I({ type: String, reflect: !0 })
|
|
847
|
+
], j.prototype, "size", void 0);
|
|
848
|
+
$([
|
|
849
|
+
I({ type: String, reflect: !0 })
|
|
850
|
+
], j.prototype, "class", void 0);
|
|
851
|
+
$([
|
|
852
|
+
_e("svg")
|
|
853
|
+
], j.prototype, "_svg", void 0);
|
|
854
|
+
customElements.get(Be) === void 0 && customElements.define(Be, j);
|
|
855
|
+
const Te = "icon-chevron-left";
|
|
856
|
+
class F extends C {
|
|
857
|
+
constructor() {
|
|
858
|
+
super(...arguments), this.size = "xs", this.class = "c-pieIcon c-pieIcon--chevronLeft";
|
|
859
|
+
}
|
|
860
|
+
connectedCallback() {
|
|
861
|
+
var e, t, i;
|
|
862
|
+
if (super.connectedCallback(), ((e = this._svg) === null || e === void 0 ? void 0 : e.getAttribute("width")) === null) {
|
|
863
|
+
const o = L("c-pieIcon c-pieIcon--chevronLeft", "", null, "IconChevronLeft");
|
|
864
|
+
(t = this._svg) === null || t === void 0 || t.setAttribute("width", o.width), (i = this._svg) === null || i === void 0 || i.setAttribute("height", o.height);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
updated(e) {
|
|
868
|
+
var t, i;
|
|
869
|
+
let o;
|
|
870
|
+
e.has("size") && (o = L("c-pieIcon c-pieIcon--chevronLeft", "", this.size, "IconChevronLeft"), (t = this._svg) === null || t === void 0 || t.setAttribute("width", o.width), (i = this._svg) === null || i === void 0 || i.setAttribute("height", o.height));
|
|
871
|
+
}
|
|
872
|
+
render() {
|
|
873
|
+
return $e`<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--chevronLeft"><path d="M10.96 2.82 5.605 8l5.399 5.197-.875.963-5.565-5.364a1.164 1.164 0 0 1 0-1.671l5.495-5.25.901.945Z"></path></svg>`;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
F.styles = ye`
|
|
877
|
+
:host-context(pie-icon-button) svg,
|
|
878
|
+
:host-context(pie-button) svg {
|
|
879
|
+
display: block;
|
|
880
|
+
width: var(--btn-icon-size);
|
|
881
|
+
height: var(--btn-icon-size);
|
|
882
|
+
}
|
|
883
|
+
`;
|
|
884
|
+
$([
|
|
885
|
+
I({ type: String, reflect: !0 })
|
|
886
|
+
], F.prototype, "size", void 0);
|
|
887
|
+
$([
|
|
888
|
+
I({ type: String, reflect: !0 })
|
|
889
|
+
], F.prototype, "class", void 0);
|
|
890
|
+
$([
|
|
891
|
+
_e("svg")
|
|
892
|
+
], F.prototype, "_svg", void 0);
|
|
893
|
+
customElements.get(Te) === void 0 && customElements.define(Te, F);
|
|
894
|
+
const Re = "icon-chevron-right";
|
|
895
|
+
class V extends C {
|
|
896
|
+
constructor() {
|
|
897
|
+
super(...arguments), this.size = "xs", this.class = "c-pieIcon c-pieIcon--chevronRight";
|
|
898
|
+
}
|
|
899
|
+
connectedCallback() {
|
|
900
|
+
var e, t, i;
|
|
901
|
+
if (super.connectedCallback(), ((e = this._svg) === null || e === void 0 ? void 0 : e.getAttribute("width")) === null) {
|
|
902
|
+
const o = L("c-pieIcon c-pieIcon--chevronRight", "", null, "IconChevronRight");
|
|
903
|
+
(t = this._svg) === null || t === void 0 || t.setAttribute("width", o.width), (i = this._svg) === null || i === void 0 || i.setAttribute("height", o.height);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
updated(e) {
|
|
907
|
+
var t, i;
|
|
908
|
+
let o;
|
|
909
|
+
e.has("size") && (o = L("c-pieIcon c-pieIcon--chevronRight", "", this.size, "IconChevronRight"), (t = this._svg) === null || t === void 0 || t.setAttribute("width", o.width), (i = this._svg) === null || i === void 0 || i.setAttribute("height", o.height));
|
|
910
|
+
}
|
|
911
|
+
render() {
|
|
912
|
+
return $e`<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--chevronRight"><path d="M5.044 13.18 10.399 8 5 2.82l.875-.962 5.539 5.346a1.164 1.164 0 0 1 0 1.636l-5.469 5.285-.901-.945Z"></path></svg>`;
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
V.styles = ye`
|
|
916
|
+
:host-context(pie-icon-button) svg,
|
|
917
|
+
:host-context(pie-button) svg {
|
|
918
|
+
display: block;
|
|
919
|
+
width: var(--btn-icon-size);
|
|
920
|
+
height: var(--btn-icon-size);
|
|
921
|
+
}
|
|
922
|
+
`;
|
|
923
|
+
$([
|
|
924
|
+
I({ type: String, reflect: !0 })
|
|
925
|
+
], V.prototype, "size", void 0);
|
|
926
|
+
$([
|
|
927
|
+
I({ type: String, reflect: !0 })
|
|
928
|
+
], V.prototype, "class", void 0);
|
|
929
|
+
$([
|
|
930
|
+
_e("svg")
|
|
931
|
+
], V.prototype, "_svg", void 0);
|
|
932
|
+
customElements.get(Re) === void 0 && customElements.define(Re, V);
|
|
933
|
+
const It = `*,*:before,*:after{box-sizing:border-box}@keyframes rotate360{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.c-modal{--modal-size-s: 450px;--modal-size-m: 600px;--modal-size-l: 1080px;--modal-border-radius: var(--dt-radius-rounded-d);--modal-font: var(--dt-font-interactive-m-family);--modal-bg-color: var(--dt-color-container-default);--modal-elevation: var(--dt-elevation-04);text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;border-radius:var(--modal-border-radius);border:none;box-shadow:var(--modal-elevation);font-family:var(--modal-font);background-color:var(--modal-bg-color);padding:0;--modal-margin-none: var(--dt-spacing-none);--modal-margin-small: var(--dt-spacing-g);--modal-margin-large: var(--dt-spacing-j);--modal-margin-block: var(--modal-margin-small);--modal-block-size: fit-content;--modal-inline-size: 75%;--modal-max-block-size: calc(100vh - calc(var(--modal-margin-block) * 2));--modal-max-inline-size: var(--modal-size-m);block-size:var(--modal-block-size);inline-size:var(--modal-inline-size);max-block-size:var(--modal-max-block-size);max-inline-size:var(--modal-max-inline-size)}.c-modal:focus-visible{outline:none}@media (max-width: 768px){.c-modal pie-icon-button{--btn-dimension: 40px}}.c-modal[open]{display:flex;flex-direction:column}@media (min-width: 768px){.c-modal{--modal-margin-block: var(--modal-margin-large)}}.c-modal[size=small]{--modal-max-inline-size: var(--modal-size-s)}@media (min-width: 768px){.c-modal[size=small]{--modal-margin-block: var(--modal-margin-large)}}@media (max-width: 767px){.c-modal[size=medium][isfullwidthbelowmid]{--modal-margin-block: var(--modal-margin-none);--modal-border-radius: var(--dt-radius-rounded-none);--modal-block-size: 100%;--modal-inline-size: 100%;--modal-max-inline-size: 100%}}.c-modal[size=large]{--modal-inline-size: 75%;--modal-max-inline-size: var(--modal-size-l);--modal-margin-block: var(--modal-margin-large)}@media (max-width: 767px){.c-modal[size=large]{--modal-margin-block: var(--modal-margin-none);--modal-border-radius: var(--dt-radius-rounded-none);--modal-block-size: 100%;--modal-inline-size: 100%}}.c-modal[position=top]{margin-block-start:var(--dt-spacing-j)}@media (max-width: 767px){.c-modal[position=top][isfullwidthbelowmid]{margin-block-start:var(--dt-spacing-none)}}.c-modal::backdrop{background:rgba(0,0,0,.5)}.c-modal .c-modal-footer{--modal-button-spacing: var(--dt-spacing-d);--modal-footer-padding: var(--dt-spacing-d);display:flex;flex-flow:row-reverse;flex-wrap:wrap;gap:var(--modal-button-spacing);padding:var(--modal-footer-padding)}@media (min-width: 768px){.c-modal .c-modal-footer{--modal-footer-padding: var(--dt-spacing-e)}}@media (max-width: 767px){.c-modal[hasstackedactions] .c-modal-footer{flex-direction:column}}.c-modal .c-modal-header{padding-inline:var(--dt-spacing-d);padding-block:14px;display:grid;grid-template-areas:"back heading close" ". heading .";grid-template-columns:minmax(0,max-content) minmax(0,1fr) minmax(0,max-content);align-items:center}@media (min-width: 768px){.c-modal .c-modal-header{padding-inline:var(--dt-spacing-e);padding-block:20px}}.c-modal[hasbackbutton] .c-modal-header{padding-block:var(--dt-spacing-b);padding-inline-start:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[hasbackbutton] .c-modal-header{padding-block:var(--dt-spacing-c);padding-inline-start:var(--dt-spacing-c)}}.c-modal[isdismissible] .c-modal-header{padding-block:var(--dt-spacing-b);padding-inline-end:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[isdismissible] .c-modal-header{padding-block:var(--dt-spacing-c);padding-inline-end:var(--dt-spacing-c)}}.c-modal .c-modal-heading{--modal-header-font-size: calc(var(--dt-font-heading-m-size--wide) * 1px);--modal-header-font-line-height: calc(var(--dt-font-heading-m-line-height--wide) * 1px);--modal-header-font-weight: var(--dt-font-heading-m-weight);font-size:var(--modal-header-font-size);line-height:var(--modal-header-font-line-height);font-weight:var(--modal-header-font-weight);margin:0;grid-area:heading}.c-modal[hasbackbutton] .c-modal-heading{padding-inline-start:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[hasbackbutton] .c-modal-heading{padding-inline-start:var(--dt-spacing-c)}}.c-modal[isdismissible] .c-modal-heading{padding-inline-end:var(--dt-spacing-d)}@media (min-width: 768px){.c-modal[isdismissible] .c-modal-heading{padding-inline-end:var(--dt-spacing-e)}}.c-modal .c-modal-backBtn{grid-area:back}.c-modal .c-modal-closeBtn{grid-area:close}.c-modal[isfooterpinned] .c-modal-content,.c-modal .c-modal-scrollContainer{overflow-y:auto}.c-modal .c-modal-scrollContainer{--bg-scroll-start: linear-gradient(var(--dt-color-container-default) 30%, rgba(255, 255, 255, 0));--bg-scroll-end: linear-gradient(rgba(255, 255, 255, 0), var(--dt-color-container-default) 70%) 0 100%;--bg-scroll-top: radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0));--bg-scroll-bottom: radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0)) 0 100%;--bg-size-scroll-start: 100% 40px;--bg-size-scroll-end: 100% 40px;--bg-size-scroll-top: 100% 16px;--bg-size-scroll-bottom: 100% 16px;background:var(--bg-scroll-start),var(--bg-scroll-end),var(--bg-scroll-top),var(--bg-scroll-bottom);background-repeat:no-repeat;background-color:var(--dt-color-container-default);background-size:var(--bg-size-scroll-start),var(--bg-size-scroll-end),var(--bg-size-scroll-top),var(--bg-size-scroll-bottom);background-attachment:local,local,scroll,scroll}.c-modal .c-modal-content{--modal-content-font-size: calc(var(--dt-font-size-16) * 1px);--modal-content-font-weight: var(--dt-font-weight-regular);--modal-content-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--modal-content-padding: var(--dt-spacing-e);--modal-content-padding-block: var(--dt-spacing-a);--spinner-size: 48px;--spinner-border-width: 6px;--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l);--spinner-left-color-opacity: .35;--spinner-left-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), var(--spinner-left-color-opacity));--spinner-right-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), 1);--spinner-animation-duration: 1.15s;--spinner-animation-timing-function: linear;--spinner-animation-iteration-count: infinite;position:relative;min-block-size:var(--dt-spacing-j);font-size:var(--modal-content-font-size);line-height:var(--modal-content-line-height);font-weight:var(--modal-content-font-weight);padding-inline:var(--modal-content-padding);padding-block:var(--modal-content-padding-block)}.c-modal .c-modal-content--scrollable{background:linear-gradient(to bottom,transparent,var(--dt-color-container-default) 75%) center bottom,linear-gradient(transparent,var(--dt-color-border-strong)) center bottom;background-repeat:no-repeat;background-size:100% 48px,100% 12px;background-attachment:local,scroll}.c-modal .c-modal-content:before{content:"";position:absolute;left:50%;top:50%;translate:-50% -50%;height:var(--spinner-size);width:var(--spinner-size);display:block;background-color:transparent;border-radius:50%;border-color:var(--spinner-left-color) var(--spinner-right-color) var(--spinner-right-color) var(--spinner-left-color);border-width:var(--spinner-border-width);border-style:solid;will-change:transform;opacity:0}.c-modal[isLoading] .c-modal-content:before{animation:rotate360 var(--spinner-animation-duration) var(--spinner-animation-timing-function) var(--spinner-animation-iteration-count);opacity:1}.c-modal[isLoading] .c-modal-content .c-modal-contentInner{opacity:0}
|
|
934
|
+
`, Bt = ["h1", "h2", "h3", "h4", "h5", "h6"], Tt = ["small", "medium", "large"], Rt = ["top", "center"], ce = "pie-modal-close", Y = "pie-modal-open", he = "pie-modal-back";
|
|
935
|
+
var Ut = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor, v = (n, e, t, i) => {
|
|
936
|
+
for (var o = i > 1 ? void 0 : i ? Ht(e, t) : e, s = n.length - 1, r; s >= 0; s--)
|
|
937
|
+
(r = n[s]) && (o = (i ? r(e, t, o) : r(o)) || o);
|
|
938
|
+
return i && o && Ut(e, t, o), o;
|
|
939
|
+
};
|
|
940
|
+
const W = "pie-modal";
|
|
941
|
+
class p extends ot(Ge) {
|
|
942
|
+
constructor() {
|
|
943
|
+
super(), this.headingLevel = "h2", this.hasBackButton = !1, this.hasStackedActions = !1, this.isDismissible = !1, this.isFooterPinned = !0, this.isFullWidthBelowMid = !1, this.isLoading = !1, this.isOpen = !1, this.position = "center", this.size = "medium", this._backButtonClicked = !1, this._handleDialogCancelEvent = (e) => {
|
|
159
944
|
this.isDismissible || e.preventDefault();
|
|
160
945
|
}, this._handleDialogLightDismiss = (e) => {
|
|
161
|
-
var
|
|
946
|
+
var l;
|
|
162
947
|
if (!this.isDismissible)
|
|
163
948
|
return;
|
|
164
|
-
const
|
|
165
|
-
top:
|
|
166
|
-
bottom:
|
|
167
|
-
left:
|
|
949
|
+
const t = (l = this._dialog) == null ? void 0 : l.getBoundingClientRect(), {
|
|
950
|
+
top: i = 0,
|
|
951
|
+
bottom: o = 0,
|
|
952
|
+
left: s = 0,
|
|
168
953
|
right: r = 0
|
|
169
|
-
} =
|
|
170
|
-
if (
|
|
954
|
+
} = t || {};
|
|
955
|
+
if (i === 0 && o === 0 && s === 0 && r === 0)
|
|
171
956
|
return;
|
|
172
|
-
(e.clientY <
|
|
957
|
+
(e.clientY < i || e.clientY > o || e.clientX < s || e.clientX > r) && (this.isOpen = !1);
|
|
173
958
|
}, this._dispatchModalCustomEvent = (e) => {
|
|
174
|
-
const
|
|
959
|
+
const t = new CustomEvent(e, {
|
|
175
960
|
bubbles: !0,
|
|
176
961
|
composed: !0
|
|
177
962
|
});
|
|
178
|
-
this.dispatchEvent(
|
|
963
|
+
this.dispatchEvent(t);
|
|
179
964
|
}, this.addEventListener("click", (e) => this._handleDialogLightDismiss(e));
|
|
180
965
|
}
|
|
181
966
|
connectedCallback() {
|
|
182
|
-
super.connectedCallback(), document.addEventListener(
|
|
967
|
+
super.connectedCallback(), document.addEventListener(Y, this._handleModalOpened.bind(this)), document.addEventListener(ce, this._handleModalClosed.bind(this)), document.addEventListener(he, this._handleModalClosed.bind(this));
|
|
183
968
|
}
|
|
184
969
|
disconnectedCallback() {
|
|
185
|
-
document.removeEventListener(
|
|
970
|
+
document.removeEventListener(Y, this._handleModalOpened.bind(this)), document.removeEventListener(ce, this._handleModalClosed.bind(this)), document.removeEventListener(he, this._handleModalClosed.bind(this)), super.disconnectedCallback();
|
|
186
971
|
}
|
|
187
972
|
firstUpdated(e) {
|
|
188
|
-
var
|
|
189
|
-
(
|
|
973
|
+
var t, i;
|
|
974
|
+
(t = this._dialog) == null || t.addEventListener("cancel", (o) => this._handleDialogCancelEvent(o)), this._handleModalOpenStateOnFirstRender(e), (i = this._dialog) == null || i.addEventListener("close", () => {
|
|
190
975
|
this.isOpen = !1;
|
|
191
976
|
});
|
|
192
977
|
}
|
|
@@ -197,33 +982,33 @@ class l extends I(E) {
|
|
|
197
982
|
* Opens the dialog element and disables page scrolling
|
|
198
983
|
*/
|
|
199
984
|
_handleModalOpened() {
|
|
200
|
-
var e,
|
|
201
|
-
|
|
985
|
+
var e, t, i;
|
|
986
|
+
ut(this), !((e = this._dialog) != null && e.hasAttribute("open") || !((t = this._dialog) != null && t.isConnected)) && ((i = this._dialog) == null || i.showModal());
|
|
202
987
|
}
|
|
203
988
|
/**
|
|
204
989
|
* Closes the dialog element and re-enables page scrolling
|
|
205
990
|
*/
|
|
206
991
|
_handleModalClosed() {
|
|
207
992
|
var e;
|
|
208
|
-
|
|
993
|
+
pt(this), (e = this._dialog) == null || e.close(), this._returnFocus();
|
|
209
994
|
}
|
|
210
995
|
// Handles the value of the isOpen property on first render of the component
|
|
211
996
|
_handleModalOpenStateOnFirstRender(e) {
|
|
212
|
-
e.get("isOpen") === void 0 && this.isOpen && this._dispatchModalCustomEvent(
|
|
997
|
+
e.get("isOpen") === void 0 && this.isOpen && this._dispatchModalCustomEvent(Y);
|
|
213
998
|
}
|
|
214
999
|
// Handles changes to the modal isOpen property by dispatching any appropriate events
|
|
215
1000
|
_handleModalOpenStateChanged(e) {
|
|
216
|
-
const
|
|
217
|
-
|
|
1001
|
+
const t = e.get("isOpen");
|
|
1002
|
+
t !== void 0 && (t ? this._backButtonClicked ? (this._backButtonClicked = !1, this._dispatchModalCustomEvent(he)) : this._dispatchModalCustomEvent(ce) : this._dispatchModalCustomEvent(Y));
|
|
218
1003
|
}
|
|
219
1004
|
/**
|
|
220
1005
|
* Return focus to the specified element, providing the selector is valid
|
|
221
1006
|
* and the chosen element can be found.
|
|
222
1007
|
*/
|
|
223
1008
|
_returnFocus() {
|
|
224
|
-
var
|
|
225
|
-
const e = (
|
|
226
|
-
e && ((
|
|
1009
|
+
var t, i;
|
|
1010
|
+
const e = (t = this.returnFocusAfterCloseSelector) == null ? void 0 : t.trim();
|
|
1011
|
+
e && ((i = document.querySelector(e)) == null || i.focus());
|
|
227
1012
|
}
|
|
228
1013
|
/**
|
|
229
1014
|
* Template for the close button element. Called within the
|
|
@@ -232,15 +1017,18 @@ class l extends I(E) {
|
|
|
232
1017
|
* @private
|
|
233
1018
|
*/
|
|
234
1019
|
renderCloseButton() {
|
|
235
|
-
|
|
1020
|
+
var e;
|
|
1021
|
+
return y`
|
|
236
1022
|
<pie-icon-button
|
|
237
1023
|
@click="${() => {
|
|
238
1024
|
this.isOpen = !1;
|
|
239
1025
|
}}"
|
|
240
1026
|
variant="ghost-secondary"
|
|
241
1027
|
class="c-modal-closeBtn"
|
|
242
|
-
|
|
243
|
-
|
|
1028
|
+
aria-label="${((e = this.aria) == null ? void 0 : e.close) || f}"
|
|
1029
|
+
data-test-id="modal-close-button">
|
|
1030
|
+
<icon-close></icon-close>
|
|
1031
|
+
</pie-icon-button>`;
|
|
244
1032
|
}
|
|
245
1033
|
/**
|
|
246
1034
|
* Template for the back button element. Called within the
|
|
@@ -249,112 +1037,194 @@ class l extends I(E) {
|
|
|
249
1037
|
* @private
|
|
250
1038
|
*/
|
|
251
1039
|
renderBackButton() {
|
|
252
|
-
|
|
1040
|
+
var e;
|
|
1041
|
+
return y`
|
|
253
1042
|
<pie-icon-button
|
|
254
1043
|
@click="${() => {
|
|
255
1044
|
this._backButtonClicked = !0, this.isOpen = !1;
|
|
256
1045
|
}}"
|
|
257
1046
|
variant="ghost-secondary"
|
|
258
1047
|
class="c-modal-backBtn"
|
|
1048
|
+
aria-label="${((e = this.aria) == null ? void 0 : e.back) || f}"
|
|
259
1049
|
data-test-id="modal-back-button">
|
|
260
|
-
${this.isRTL ?
|
|
1050
|
+
${this.isRTL ? y`<icon-chevron-right></icon-chevron-right>` : y`<icon-chevron-left></icon-chevron-left>`}
|
|
261
1051
|
</pie-icon-button>
|
|
262
1052
|
`;
|
|
263
1053
|
}
|
|
1054
|
+
/**
|
|
1055
|
+
* Render leadingAction button depending on prop availability.
|
|
1056
|
+
*
|
|
1057
|
+
* 1. If the prop `leadingAction` is not provided, the button is not rendered.
|
|
1058
|
+
* 2. If the prop `leadingAction` is provided but any of the optional properties
|
|
1059
|
+
* are not provided, they fall back to their default values.
|
|
1060
|
+
*
|
|
1061
|
+
* @private
|
|
1062
|
+
*/
|
|
1063
|
+
renderLeadingAction() {
|
|
1064
|
+
const { text: e, variant: t = "primary", ariaLabel: i } = this.leadingAction;
|
|
1065
|
+
return e ? y`
|
|
1066
|
+
<pie-button
|
|
1067
|
+
variant="${t}"
|
|
1068
|
+
aria-label="${i || f}"
|
|
1069
|
+
type="submit"
|
|
1070
|
+
?isFullWidth="${this.hasStackedActions}"
|
|
1071
|
+
@click="${() => {
|
|
1072
|
+
var o;
|
|
1073
|
+
return (o = this._dialog) == null ? void 0 : o.close("leading");
|
|
1074
|
+
}}"
|
|
1075
|
+
data-test-id="modal-leading-action">
|
|
1076
|
+
${e}
|
|
1077
|
+
</pie-button>
|
|
1078
|
+
` : f;
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* Render supportingAction button depending on prop availability.
|
|
1082
|
+
*
|
|
1083
|
+
* 1. If the prop `supportingAction` is not provided, the button is not rendered.
|
|
1084
|
+
* 2. If the prop `supportingAction` is provided but any of the optional properties
|
|
1085
|
+
* are not provided, they fall back to their default values.
|
|
1086
|
+
* 3. If `supportingAction` is provided but not `leadingAction`, log a warning and do
|
|
1087
|
+
* not render `supportingAction`.
|
|
1088
|
+
*
|
|
1089
|
+
* @private
|
|
1090
|
+
*/
|
|
1091
|
+
renderSupportingAction() {
|
|
1092
|
+
const { text: e, variant: t = "ghost", ariaLabel: i } = this.supportingAction;
|
|
1093
|
+
return e ? this.leadingAction ? y`
|
|
1094
|
+
<pie-button
|
|
1095
|
+
variant="${t}"
|
|
1096
|
+
aria-label="${i || f}"
|
|
1097
|
+
type="reset"
|
|
1098
|
+
?isFullWidth="${this.hasStackedActions}"
|
|
1099
|
+
@click="${() => {
|
|
1100
|
+
var o;
|
|
1101
|
+
return (o = this._dialog) == null ? void 0 : o.close("supporting");
|
|
1102
|
+
}}"
|
|
1103
|
+
data-test-id="modal-supporting-action">
|
|
1104
|
+
${e}
|
|
1105
|
+
</pie-button>
|
|
1106
|
+
` : (console.warn("Use `leadingAction` instead of `supportingAction`. `supportingAction` is being ignored."), f) : f;
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
* Renders the modal inner content and footer of the modal.
|
|
1110
|
+
* @private
|
|
1111
|
+
*/
|
|
1112
|
+
renderModalContentAndFooter() {
|
|
1113
|
+
return y`
|
|
1114
|
+
<article class="c-modal-content c-modal-content--scrollable">
|
|
1115
|
+
<div class="c-modal-contentInner">
|
|
1116
|
+
<slot></slot>
|
|
1117
|
+
</div>
|
|
1118
|
+
</article>
|
|
1119
|
+
<footer class="c-modal-footer">
|
|
1120
|
+
${this.leadingAction ? this.renderLeadingAction() : f}
|
|
1121
|
+
${this.supportingAction ? this.renderSupportingAction() : f}
|
|
1122
|
+
</footer>`;
|
|
1123
|
+
}
|
|
264
1124
|
render() {
|
|
265
1125
|
const {
|
|
266
|
-
|
|
1126
|
+
aria: e,
|
|
1127
|
+
hasBackButton: t,
|
|
1128
|
+
hasStackedActions: i,
|
|
267
1129
|
heading: o,
|
|
268
|
-
headingLevel:
|
|
269
|
-
isDismissible:
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
1130
|
+
headingLevel: s = "h2",
|
|
1131
|
+
isDismissible: r,
|
|
1132
|
+
isFooterPinned: d,
|
|
1133
|
+
isFullWidthBelowMid: l,
|
|
1134
|
+
isLoading: a,
|
|
1135
|
+
leadingAction: b,
|
|
1136
|
+
position: c,
|
|
1137
|
+
size: h,
|
|
1138
|
+
supportingAction: m
|
|
1139
|
+
} = this, w = Je(s);
|
|
1140
|
+
return y`
|
|
275
1141
|
<dialog
|
|
276
1142
|
id="dialog"
|
|
277
1143
|
class="c-modal"
|
|
278
|
-
size="${
|
|
279
|
-
|
|
280
|
-
?
|
|
281
|
-
?
|
|
282
|
-
?
|
|
1144
|
+
size="${h}"
|
|
1145
|
+
position="${c}"
|
|
1146
|
+
?hasActions=${b || m}
|
|
1147
|
+
?hasBackButton=${t}
|
|
1148
|
+
?hasStackedActions=${i}
|
|
1149
|
+
?isDismissible=${r}
|
|
1150
|
+
?isFooterPinned=${d}
|
|
1151
|
+
?isFullWidthBelowMid=${l}
|
|
1152
|
+
?isLoading=${a}
|
|
1153
|
+
aria-busy="${a ? "true" : "false"}"
|
|
1154
|
+
aria-label="${a && (e == null ? void 0 : e.loading) || f}"
|
|
283
1155
|
data-test-id="pie-modal">
|
|
284
1156
|
<header class="c-modal-header">
|
|
285
|
-
${
|
|
286
|
-
<${
|
|
1157
|
+
${t ? this.renderBackButton() : f}
|
|
1158
|
+
<${w} class="c-modal-heading">
|
|
287
1159
|
${o}
|
|
288
|
-
</${
|
|
289
|
-
${
|
|
1160
|
+
</${w}>
|
|
1161
|
+
${r ? this.renderCloseButton() : f}
|
|
290
1162
|
</header>
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
<pie-button
|
|
298
|
-
variant="primary"
|
|
299
|
-
type="submit"
|
|
300
|
-
@click="${() => {
|
|
301
|
-
var h;
|
|
302
|
-
return (h = this._dialog) == null ? void 0 : h.close("leading");
|
|
303
|
-
}}"
|
|
304
|
-
data-test-id="modal-leading-action">
|
|
305
|
-
Confirm
|
|
306
|
-
</pie-button>
|
|
307
|
-
<pie-button
|
|
308
|
-
variant="ghost"
|
|
309
|
-
type="reset"
|
|
310
|
-
@click="${() => {
|
|
311
|
-
var h;
|
|
312
|
-
return (h = this._dialog) == null ? void 0 : h.close("supporting");
|
|
313
|
-
}}"
|
|
314
|
-
data-test-id="modal-supporting-action">
|
|
315
|
-
Cancel
|
|
316
|
-
</pie-button>
|
|
317
|
-
</footer>
|
|
1163
|
+
${// We need to wrap the remaining content in a shared scrollable container if the footer is not pinned
|
|
1164
|
+
d ? this.renderModalContentAndFooter() : y`
|
|
1165
|
+
<div class="c-modal-scrollContainer">
|
|
1166
|
+
${this.renderModalContentAndFooter()}
|
|
1167
|
+
</div>
|
|
1168
|
+
`}
|
|
318
1169
|
</dialog>`;
|
|
319
1170
|
}
|
|
320
1171
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
],
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
],
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
],
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
],
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
],
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
],
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
1172
|
+
p.styles = Xe(It);
|
|
1173
|
+
v([
|
|
1174
|
+
g({ type: Object })
|
|
1175
|
+
], p.prototype, "aria", 2);
|
|
1176
|
+
v([
|
|
1177
|
+
g({ type: String }),
|
|
1178
|
+
nt(W)
|
|
1179
|
+
], p.prototype, "heading", 2);
|
|
1180
|
+
v([
|
|
1181
|
+
g(),
|
|
1182
|
+
ge(W, Bt, "h2")
|
|
1183
|
+
], p.prototype, "headingLevel", 2);
|
|
1184
|
+
v([
|
|
1185
|
+
g({ type: Boolean })
|
|
1186
|
+
], p.prototype, "hasBackButton", 2);
|
|
1187
|
+
v([
|
|
1188
|
+
g({ type: Boolean })
|
|
1189
|
+
], p.prototype, "hasStackedActions", 2);
|
|
1190
|
+
v([
|
|
1191
|
+
g({ type: Boolean, reflect: !0 })
|
|
1192
|
+
], p.prototype, "isDismissible", 2);
|
|
1193
|
+
v([
|
|
1194
|
+
g({ type: Boolean })
|
|
1195
|
+
], p.prototype, "isFooterPinned", 2);
|
|
1196
|
+
v([
|
|
1197
|
+
g({ type: Boolean })
|
|
1198
|
+
], p.prototype, "isFullWidthBelowMid", 2);
|
|
1199
|
+
v([
|
|
1200
|
+
g({ type: Boolean, reflect: !0 })
|
|
1201
|
+
], p.prototype, "isLoading", 2);
|
|
1202
|
+
v([
|
|
1203
|
+
g({ type: Boolean })
|
|
1204
|
+
], p.prototype, "isOpen", 2);
|
|
1205
|
+
v([
|
|
1206
|
+
g({ type: Object })
|
|
1207
|
+
], p.prototype, "leadingAction", 2);
|
|
1208
|
+
v([
|
|
1209
|
+
g(),
|
|
1210
|
+
ge(W, Rt, "center")
|
|
1211
|
+
], p.prototype, "position", 2);
|
|
1212
|
+
v([
|
|
1213
|
+
g()
|
|
1214
|
+
], p.prototype, "returnFocusAfterCloseSelector", 2);
|
|
1215
|
+
v([
|
|
1216
|
+
g(),
|
|
1217
|
+
ge(W, Tt, "medium")
|
|
1218
|
+
], p.prototype, "size", 2);
|
|
1219
|
+
v([
|
|
1220
|
+
g({ type: Object })
|
|
1221
|
+
], p.prototype, "supportingAction", 2);
|
|
1222
|
+
v([
|
|
1223
|
+
Ke("dialog")
|
|
1224
|
+
], p.prototype, "_dialog", 2);
|
|
1225
|
+
customElements.define(W, p);
|
|
356
1226
|
export {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
1227
|
+
p as PieModal,
|
|
1228
|
+
Bt as headingLevels,
|
|
1229
|
+
Tt as sizes
|
|
360
1230
|
};
|